@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
package/README.md CHANGED
@@ -10,7 +10,7 @@ React Native drawing component based on SVG with editable annotations
10
10
  - Compatible with `Expo`
11
11
  - Built with `react-native-reanimated` v2
12
12
  - Save result with `react-native-view-shot`
13
- - Customisable
13
+ - Fully customisable
14
14
 
15
15
  ## Installation
16
16
 
@@ -30,19 +30,16 @@ expo install @archireport/react-native-svg-draw react-native-reanimated react-na
30
30
 
31
31
  ```
32
32
 
33
-
34
33
  ---
34
+
35
35
  **⚠️ extra steps are required**
36
36
 
37
37
  _React Native Gesture Handler_ needs extra steps to finalize its installation, please follow their [installation instructions](https://docs.swmansion.com/react-native-gesture-handler/docs/#installation).
38
38
 
39
39
  _React Native Reanimated_ needs extra steps to finalize its installation, please follow their [installation instructions](https://docs.swmansion.com/react-native-reanimated/docs/installation/).
40
40
 
41
-
42
-
43
41
  ---
44
42
 
45
-
46
43
  ## Usage
47
44
 
48
45
  ### Bare react native app
@@ -52,8 +49,9 @@ import { DrawWithOptions } from 'react-native-svg-draw';
52
49
  import LinearGradient from 'react-native-linear-gradient';
53
50
 
54
51
  // ...
55
-
56
- <DrawWithOptions linearGradient={LinearGradient} />;
52
+ <DrawProvider>
53
+ <DrawWithOptions linearGradient={LinearGradient} />
54
+ </DrawProvider>;
57
55
  ```
58
56
 
59
57
  ### Expo
@@ -63,10 +61,70 @@ import { DrawWithOptions } from 'react-native-svg-draw';
63
61
  import { LinearGradient } from 'expo-linear-gradient';
64
62
 
65
63
  // ...
64
+ <DrawProvider>
65
+ <DrawWithOptions linearGradient={LinearGradient} />
66
+ </DrawProvider>;
67
+ ```
68
+
69
+ ---
70
+
71
+ ## How it works
72
+
73
+ The draw provider manage the context of the svg draw core.
74
+ You have 2 options
75
+
76
+ ### Use DrawWithOptions provided by the lib
77
+
78
+ Fast and easy way to use the lib.
79
+ Example :
66
80
 
67
- <DrawWithOptions linearGradient={LinearGradient} />;
81
+ ```js
82
+ <DrawProvider>
83
+ <DrawWithOptions
84
+ linearGradient={LinearGradient}
85
+ image={require('./pexels-sebastian-palomino-2847766.jpg')}
86
+ close={() => true}
87
+ takeSnapshot={(snap) => {
88
+ snap.then((uri) => console.log('snapShot uri:', uri));
89
+ }}
90
+ />
91
+ </DrawProvider>
68
92
  ```
69
93
 
94
+ ### Use your own "DrawWithOptions" component
95
+
96
+ You can create your own "DrawWithOptions" component and customize the ui.
97
+ You have to use the hook call "useDrawHook" inside your component to interact with the context. This hook expose a lot of functions and objects that can be used to interact with the drawcore.
98
+
99
+ ```js
100
+ const {
101
+ drawState,
102
+ dispatchDrawStates,
103
+ itemIsSelected,
104
+ cancelLastAction,
105
+ deleteSelectedItem,
106
+ ...
107
+ } = useDrawHook();
108
+ ```
109
+
110
+ #### useDrawHook
111
+
112
+ | Name | Type | Description |
113
+ | --------------------- | ---------------------- | --------------------------------------------------------------------------------------------------------- |
114
+ | `strokeWidth` | shared value(number) | Object from react-native-reanimated, get and set value => strokeWidth.value |
115
+ | `color` | shared value(hslColor) | Object from react-native-reanimated, get and set value => color.value |
116
+ | `onColorStrokeChange` | function | Function use when changing color or strokeWidth is done to memorize action for undo |
117
+ | `drawState` | object | Get the selected `drawingMode` : 'singleHead','doubleHead','rectangle','ellipse','text','pen', `cancelEnabled` is true when last action can be canceled, `doneItems` contains all previous draw items and `screenStates` helps to go back in time (cancel pops last state) |
118
+ | `dispatchDrawStates` | function | Can be used to update `drawingMode` |
119
+ | `itemIsSelected` | shared value(boolean) | Object from react-native-reanimated Indicate if an item is selected, to get value => itemIsSelected.value |
120
+ | `cancelLastAction` | function | Call this function when user press your undo button |
121
+ | `takeSnapshot` | function | This async function will return the uri of your drawing |
122
+ | `deleteSelectedItem` | function | Call this function when you want to delete the selected item |
123
+
124
+ ### Recommendation
125
+
126
+ Copy the drawWithOptions component, sliders component and adjust styles to match your theme
127
+
70
128
  ## Components
71
129
 
72
130
  ### DrawWithOptions
@@ -76,34 +134,22 @@ Component with header and footer, based on DrawCore
76
134
  #### Properties
77
135
 
78
136
  | Name | Type | Description |
79
- | ---------------- |-----------------|------------------------------------------------------------------------------------------|
137
+ | ---------------- | --------------- | ---------------------------------------------------------------------------------------- |
80
138
  | `close` | function | (optional) called when cross is pressed |
81
- | `takeSnapshot` | function | called when send button (at the bottom) is pressed |
139
+ | `takeSnapshot` | function | (optional) called when send button (at the top right) is pressed |
82
140
  | `linearGradient` | React Component | implementation used for linear gradient (differs between expo and bare react native app) |
83
141
  | `image` | image | (optional) background picture |
84
142
 
85
143
  ### DrawCore
86
144
 
87
- Component which can be used to customize header and footer
145
+ Component where the user can draw
88
146
 
89
147
  #### Properties
90
148
 
91
- | Name | Type | Description |
92
- |---------------------| --------------- | ---------------------------------------------------------------------------------------- |
93
- | `drawingMode` | enum | used shape for drawing |
94
- | `onSelectionChange` | function | called when a shape is selected |
95
- | `linearGradient` | React Component | implementation used for linear gradient (differs between expo and bare react native app) |
96
- | `image` | image | (optional) background picture |
97
- | `backgroundColor` | string | (optional) background color of the draw zone |
98
-
99
- #### Ref attributes
100
-
101
- Using ref on `<DrawCore/>` you can access to the following attributes
102
-
103
- | Name | Type | Description |
104
- | -------------------- | -------- | ---------------------------------------------------------------- |
105
- | `deleteSelectedItem` | function | delete selected item |
106
- | `takeSnapshot` | function | take a snapshot of the result (base on `react-native-view-shot`) |
149
+ | Name | Type | Description |
150
+ | ----------------- | ------ | -------------------------------------------- |
151
+ | `image` | image | (optional) background picture |
152
+ | `backgroundColor` | string | (optional) background color of the draw zone |
107
153
 
108
154
  ## Contributing
109
155
 
@@ -5,28 +5,18 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = CurrentAnimatedItem;
7
7
  exports.pointsToPath = void 0;
8
-
9
8
  var _react = _interopRequireDefault(require("react"));
10
-
11
9
  var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reanimated"));
12
-
13
10
  var _reactNativeSvg = require("react-native-svg");
14
-
15
11
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
16
-
17
12
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
18
-
19
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
20
-
21
14
  const AnimatedPath = _reactNativeReanimated.default.createAnimatedComponent(_reactNativeSvg.Path);
22
-
23
15
  const AnimatedEllipse = _reactNativeReanimated.default.createAnimatedComponent(_reactNativeSvg.Ellipse);
24
-
25
16
  const AnimatedRectangle = _reactNativeReanimated.default.createAnimatedComponent(_reactNativeSvg.Rect);
17
+ const AnimatedLine = _reactNativeReanimated.default.createAnimatedComponent(_reactNativeSvg.Line);
26
18
 
27
- const AnimatedLine = _reactNativeReanimated.default.createAnimatedComponent(_reactNativeSvg.Line); // properties of a line
28
-
29
-
19
+ // properties of a line
30
20
  const line = (pointA, pointB) => {
31
21
  'worklet';
32
22
 
@@ -36,18 +26,19 @@ const line = (pointA, pointB) => {
36
26
  length: Math.sqrt(Math.pow(lengthX, 2) + Math.pow(lengthY, 2)),
37
27
  angle: Math.atan2(lengthY, lengthX)
38
28
  };
39
- }; // position of a control point
40
-
29
+ };
41
30
 
31
+ // position of a control point
42
32
  const controlPoint = (current, previous, next, reverse) => {
43
- 'worklet'; // When 'current' is the first or last point of the array, 'previous' or 'next' don't exist --> replace with 'current'
33
+ 'worklet';
44
34
 
35
+ // When 'current' is the first or last point of the array, 'previous' or 'next' don't exist --> replace with 'current'
45
36
  const p = previous || current;
46
37
  const n = next || current;
47
- const smoothing = 0.2; // Properties of the opposed-line
48
-
49
- const o = line(p, n); // If is end-control-point, add PI to the angle to go backward
50
-
38
+ const smoothing = 0.2;
39
+ // Properties of the opposed-line
40
+ const o = line(p, n);
41
+ // If is end-control-point, add PI to the angle to go backward
51
42
  const angle = o.angle + (reverse ? Math.PI : 0);
52
43
  const length = o.length * smoothing;
53
44
  const x = current.x + Math.cos(angle) * length;
@@ -56,67 +47,65 @@ const controlPoint = (current, previous, next, reverse) => {
56
47
  x: x,
57
48
  y: y
58
49
  };
59
- }; // create the bezier curve command
60
-
50
+ };
61
51
 
52
+ // create the bezier curve command
62
53
  const bezierCommand = (point, i, a) => {
63
54
  'worklet';
64
55
 
65
- const endPoint = controlPoint(point, a[i - 1], a[i + 1], true);
66
-
67
- if (i === 1) {
68
- const startPoint = controlPoint(a[i - 1], a[i - 2], point, true);
69
- return `C ${startPoint.x},${startPoint.y} ${endPoint.x},${endPoint.y} ${point.x},${point.y}`;
70
- } else {
71
- return `S ${endPoint.x},${endPoint.y} ${point.x},${point.y}`;
56
+ const previousPoint = a[i - 1];
57
+ const nextPoint = a[i + 1];
58
+ if (previousPoint && nextPoint) {
59
+ const endPoint = controlPoint(point, previousPoint, nextPoint, true);
60
+ if (i === 1) {
61
+ const pointBefore = a[i - 2];
62
+ if (pointBefore) {
63
+ const startPoint = controlPoint(previousPoint, pointBefore, point, true);
64
+ return `C ${startPoint.x},${startPoint.y} ${endPoint.x},${endPoint.y} ${point.x},${point.y}`;
65
+ }
66
+ } else {
67
+ return `S ${endPoint.x},${endPoint.y} ${point.x},${point.y}`;
68
+ }
72
69
  }
70
+ return '';
73
71
  };
74
-
75
72
  const pointsToPath = points => {
76
73
  'worklet';
77
74
 
78
75
  return points.length > 0 ? points.reduce((acc, point, i, a) => i === 0 ? `M ${point.x},${point.y}` : `${acc} ${bezierCommand(point, i, a)}`, '') : '';
79
76
  };
80
-
81
77
  exports.pointsToPath = pointsToPath;
82
-
83
78
  function hue2rgb(p, q, t) {
84
79
  'worklet';
85
80
 
86
81
  if (t < 0) {
87
82
  t += 1;
88
83
  }
89
-
90
84
  if (t > 1) {
91
85
  t -= 1;
92
86
  }
93
-
94
87
  if (t < 1 / 6) {
95
88
  return p + (q - p) * 6 * t;
96
89
  }
97
-
98
90
  if (t < 1 / 2) {
99
91
  return q;
100
92
  }
101
-
102
93
  if (t < 2 / 3) {
103
94
  return p + (q - p) * (2 / 3 - t) * 6;
104
95
  }
105
-
106
96
  return p;
107
- } // see https://github.com/software-mansion/react-native-reanimated/issues/1909
108
-
97
+ }
109
98
 
99
+ // see https://github.com/software-mansion/react-native-reanimated/issues/1909
110
100
  function hslToRgb(col) {
111
101
  'worklet';
112
102
 
113
103
  const hslRegExp = new RegExp(/hsl\(([\d.]+),\s*(\d+)%,\s*([\d.]+)%\)/);
114
104
  const res = hslRegExp.exec(col);
115
- const h = res ? parseFloat(res[1]) / 360 : 0;
116
- const s = res ? parseFloat(res[2]) / 100 : 0;
117
- const l = res ? parseFloat(res[3]) / 100 : 0;
105
+ const h = res ? parseFloat(res[1] ?? '0') / 360 : 0;
106
+ const s = res ? parseFloat(res[2] ?? '0') / 100 : 0;
107
+ const l = res ? parseFloat(res[3] ?? '0') / 100 : 0;
118
108
  var r, g, b;
119
-
120
109
  if (s === 0) {
121
110
  r = g = b = l; // achromatic
122
111
  } else {
@@ -126,17 +115,28 @@ function hslToRgb(col) {
126
115
  g = hue2rgb(p, q, h);
127
116
  b = hue2rgb(p, q, h - 1 / 3);
128
117
  }
129
-
130
118
  return `rgb(${Math.round(r * 255)}, ${Math.round(g * 255)}, ${Math.round(b * 255)})`;
131
119
  }
132
-
120
+ const propAdapter = (0, _reactNativeReanimated.createAnimatedPropAdapter)(props => {
121
+ if (Object.keys(props).includes('fill') && (typeof props.fill === 'string' || typeof props.fill === 'number')) {
122
+ props.fill = {
123
+ type: 0,
124
+ payload: (0, _reactNativeReanimated.processColor)(props.fill)
125
+ };
126
+ }
127
+ if (Object.keys(props).includes('stroke') && (typeof props.stroke === 'string' || typeof props.stroke === 'number')) {
128
+ props.stroke = {
129
+ type: 0,
130
+ payload: (0, _reactNativeReanimated.processColor)(props.stroke)
131
+ };
132
+ }
133
+ }, ['fill', 'stroke']);
133
134
  function CurrentAnimatedItem(_ref) {
134
135
  let {
135
136
  currentItem
136
137
  } = _ref;
137
138
  const ellipseAnimatedProps = (0, _reactNativeReanimated.useAnimatedProps)(() => {
138
139
  var _currentItem$value, _currentItem$value2, _currentItem$value3, _currentItem$value4;
139
-
140
140
  const coordinates = ((_currentItem$value = currentItem.value) === null || _currentItem$value === void 0 ? void 0 : _currentItem$value.type) === 'ellipse' ? currentItem.value.data : {
141
141
  cx: -10,
142
142
  cy: -10,
@@ -148,15 +148,15 @@ function CurrentAnimatedItem(_ref) {
148
148
  cy: coordinates.cy,
149
149
  rx: coordinates.rx,
150
150
  ry: coordinates.ry,
151
+ fill: 'transparent',
151
152
  stroke: hslToRgb(((_currentItem$value2 = currentItem.value) === null || _currentItem$value2 === void 0 ? void 0 : _currentItem$value2.color) || 'hsl(0, 0%, 0%)'),
152
153
  opacity: ((_currentItem$value3 = currentItem.value) === null || _currentItem$value3 === void 0 ? void 0 : _currentItem$value3.type) === 'ellipse' ? 1 : 0,
153
154
  strokeWidth: ((_currentItem$value4 = currentItem.value) === null || _currentItem$value4 === void 0 ? void 0 : _currentItem$value4.type) === 'ellipse' ? currentItem.value.strokeWidth : 0,
154
155
  marker: 'url(#selection)'
155
156
  };
156
- }, [currentItem.value]);
157
+ }, null, propAdapter);
157
158
  const singleHeadAnimatedProps = (0, _reactNativeReanimated.useAnimatedProps)(() => {
158
159
  var _currentItem$value5, _currentItem$value6, _currentItem$value7, _currentItem$value8;
159
-
160
160
  const coordinates = ((_currentItem$value5 = currentItem.value) === null || _currentItem$value5 === void 0 ? void 0 : _currentItem$value5.type) === 'singleHead' ? currentItem.value.data : {
161
161
  x1: -10,
162
162
  y1: -10,
@@ -168,15 +168,15 @@ function CurrentAnimatedItem(_ref) {
168
168
  y1: coordinates.y1,
169
169
  x2: coordinates.x2,
170
170
  y2: coordinates.y2,
171
+ fill: 'transparent',
171
172
  stroke: hslToRgb(((_currentItem$value6 = currentItem.value) === null || _currentItem$value6 === void 0 ? void 0 : _currentItem$value6.color) || 'hsl(0, 0%, 0%)'),
172
173
  opacity: ((_currentItem$value7 = currentItem.value) === null || _currentItem$value7 === void 0 ? void 0 : _currentItem$value7.type) === 'singleHead' ? 1 : 0,
173
174
  strokeWidth: ((_currentItem$value8 = currentItem.value) === null || _currentItem$value8 === void 0 ? void 0 : _currentItem$value8.type) === 'singleHead' ? currentItem.value.strokeWidth : 0,
174
175
  markerEnd: 'arrowhead'
175
176
  };
176
- }, [currentItem.value]);
177
+ }, null, propAdapter);
177
178
  const doubleHeadAnimatedProps = (0, _reactNativeReanimated.useAnimatedProps)(() => {
178
179
  var _currentItem$value9, _currentItem$value10, _currentItem$value11, _currentItem$value12;
179
-
180
180
  const coordinates = ((_currentItem$value9 = currentItem.value) === null || _currentItem$value9 === void 0 ? void 0 : _currentItem$value9.type) === 'doubleHead' ? currentItem.value.data : {
181
181
  x1: -10,
182
182
  y1: -10,
@@ -188,16 +188,16 @@ function CurrentAnimatedItem(_ref) {
188
188
  y1: coordinates.y1,
189
189
  x2: coordinates.x2,
190
190
  y2: coordinates.y2,
191
+ fill: 'transparent',
191
192
  stroke: hslToRgb(((_currentItem$value10 = currentItem.value) === null || _currentItem$value10 === void 0 ? void 0 : _currentItem$value10.color) || 'hsl(0, 0%, 0%)'),
192
193
  opacity: ((_currentItem$value11 = currentItem.value) === null || _currentItem$value11 === void 0 ? void 0 : _currentItem$value11.type) === 'doubleHead' ? 1 : 0,
193
194
  strokeWidth: ((_currentItem$value12 = currentItem.value) === null || _currentItem$value12 === void 0 ? void 0 : _currentItem$value12.type) === 'doubleHead' ? currentItem.value.strokeWidth : 0,
194
195
  markerStart: 'side',
195
196
  markerEnd: 'side'
196
197
  };
197
- }, [currentItem.value]);
198
+ }, null, propAdapter);
198
199
  const rectangleAnimatedProps = (0, _reactNativeReanimated.useAnimatedProps)(() => {
199
200
  var _currentItem$value13, _currentItem$value14, _currentItem$value15, _currentItem$value16;
200
-
201
201
  const coordinates = ((_currentItem$value13 = currentItem.value) === null || _currentItem$value13 === void 0 ? void 0 : _currentItem$value13.type) === 'rectangle' ? currentItem.value.data : {
202
202
  x: -10,
203
203
  y: -10,
@@ -209,15 +209,15 @@ function CurrentAnimatedItem(_ref) {
209
209
  y: coordinates.y,
210
210
  width: coordinates.width,
211
211
  height: coordinates.height,
212
+ fill: 'transparent',
212
213
  stroke: hslToRgb(((_currentItem$value14 = currentItem.value) === null || _currentItem$value14 === void 0 ? void 0 : _currentItem$value14.color) || 'hsl(0, 0%, 0%)'),
213
214
  opacity: ((_currentItem$value15 = currentItem.value) === null || _currentItem$value15 === void 0 ? void 0 : _currentItem$value15.type) === 'rectangle' ? 1 : 0,
214
215
  strokeWidth: ((_currentItem$value16 = currentItem.value) === null || _currentItem$value16 === void 0 ? void 0 : _currentItem$value16.type) === 'rectangle' ? currentItem.value.strokeWidth : 0,
215
216
  marker: 'url(#selection)'
216
217
  };
217
- }, [currentItem.value]);
218
+ }, null, propAdapter);
218
219
  const penAnimatedProps = (0, _reactNativeReanimated.useAnimatedProps)(() => {
219
220
  var _currentItem$value17, _currentItem$value18, _currentItem$value19, _currentItem$value20;
220
-
221
221
  const d = pointsToPath(((_currentItem$value17 = currentItem.value) === null || _currentItem$value17 === void 0 ? void 0 : _currentItem$value17.type) === 'pen' ? currentItem.value.data : [{
222
222
  x: -10,
223
223
  y: -10
@@ -227,10 +227,11 @@ function CurrentAnimatedItem(_ref) {
227
227
  strokeWidth: ((_currentItem$value18 = currentItem.value) === null || _currentItem$value18 === void 0 ? void 0 : _currentItem$value18.type) === 'pen' ? currentItem.value.strokeWidth : 0,
228
228
  stroke: hslToRgb(((_currentItem$value19 = currentItem.value) === null || _currentItem$value19 === void 0 ? void 0 : _currentItem$value19.color) || 'hsl(0, 0%, 0%)'),
229
229
  opacity: ((_currentItem$value20 = currentItem.value) === null || _currentItem$value20 === void 0 ? void 0 : _currentItem$value20.type) === 'pen' ? 1 : 0,
230
+ fill: 'transparent',
230
231
  markerStart: 'selection',
231
232
  markerEnd: 'selection'
232
233
  };
233
- }, [currentItem.value]);
234
+ }, null, propAdapter);
234
235
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(AnimatedEllipse, {
235
236
  animatedProps: ellipseAnimatedProps
236
237
  }), /*#__PURE__*/_react.default.createElement(_reactNativeSvg.G, {
@@ -1 +1 @@
1
- {"version":3,"names":["AnimatedPath","Animated","createAnimatedComponent","Path","AnimatedEllipse","Ellipse","AnimatedRectangle","Rect","AnimatedLine","Line","line","pointA","pointB","lengthX","x","lengthY","y","length","Math","sqrt","pow","angle","atan2","controlPoint","current","previous","next","reverse","p","n","smoothing","o","PI","cos","sin","bezierCommand","point","i","a","endPoint","startPoint","pointsToPath","points","reduce","acc","hue2rgb","q","t","hslToRgb","col","hslRegExp","RegExp","res","exec","h","parseFloat","s","l","r","g","b","round","CurrentAnimatedItem","currentItem","ellipseAnimatedProps","useAnimatedProps","coordinates","value","type","data","cx","cy","rx","ry","stroke","color","opacity","strokeWidth","marker","singleHeadAnimatedProps","x1","y1","x2","y2","markerEnd","doubleHeadAnimatedProps","markerStart","rectangleAnimatedProps","width","height","penAnimatedProps","d"],"sources":["CurrentAnimatedItem.tsx"],"sourcesContent":["import React from 'react';\nimport Animated, { useAnimatedProps } from 'react-native-reanimated';\nimport { Path, Ellipse, Rect, Line, G } from 'react-native-svg';\nimport type { DrawItem, hslColor, Point } from '../../types';\n\nconst AnimatedPath = Animated.createAnimatedComponent(Path);\n\nconst AnimatedEllipse = Animated.createAnimatedComponent(Ellipse);\n\nconst AnimatedRectangle = Animated.createAnimatedComponent(Rect);\n\nconst AnimatedLine = Animated.createAnimatedComponent(Line);\n\n// properties of a line\nconst line = (pointA: Point, pointB: Point) => {\n 'worklet';\n const lengthX = pointB.x - pointA.x;\n const lengthY = pointB.y - pointA.y;\n return {\n length: Math.sqrt(Math.pow(lengthX, 2) + Math.pow(lengthY, 2)),\n angle: Math.atan2(lengthY, lengthX),\n };\n};\n\n// position of a control point\nconst controlPoint = (\n current: Point,\n previous: Point,\n next: Point,\n reverse: boolean\n): Point => {\n 'worklet';\n // When 'current' is the first or last point of the array, 'previous' or 'next' don't exist --> replace with 'current'\n const p = previous || current;\n const n = next || current;\n const smoothing = 0.2;\n // Properties of the opposed-line\n const o = line(p, n);\n // If is end-control-point, add PI to the angle to go backward\n const angle = o.angle + (reverse ? Math.PI : 0);\n const length = o.length * smoothing;\n\n const x = current.x + Math.cos(angle) * length;\n const y = current.y + Math.sin(angle) * length;\n\n return { x: x, y: y };\n};\n\n// create the bezier curve command\nconst bezierCommand = (point: Point, i: number, a: Point[]) => {\n 'worklet';\n const endPoint: Point = controlPoint(point, a[i - 1], a[i + 1], true);\n if (i === 1) {\n const startPoint: Point = controlPoint(a[i - 1], a[i - 2], point, true);\n return `C ${startPoint.x},${startPoint.y} ${endPoint.x},${endPoint.y} ${point.x},${point.y}`;\n } else {\n return `S ${endPoint.x},${endPoint.y} ${point.x},${point.y}`;\n }\n};\n\nexport const pointsToPath = (points: Point[]) => {\n 'worklet';\n return points.length > 0\n ? points.reduce(\n (acc, point, i, a) =>\n i === 0\n ? `M ${point.x},${point.y}`\n : `${acc} ${bezierCommand(point, i, a)}`,\n ''\n )\n : '';\n};\n\nfunction hue2rgb(p: number, q: number, t: number) {\n 'worklet';\n if (t < 0) {\n t += 1;\n }\n if (t > 1) {\n t -= 1;\n }\n if (t < 1 / 6) {\n return p + (q - p) * 6 * t;\n }\n if (t < 1 / 2) {\n return q;\n }\n if (t < 2 / 3) {\n return p + (q - p) * (2 / 3 - t) * 6;\n }\n return p;\n}\n\n// see https://github.com/software-mansion/react-native-reanimated/issues/1909\nfunction hslToRgb(col: hslColor) {\n 'worklet';\n const hslRegExp = new RegExp(/hsl\\(([\\d.]+),\\s*(\\d+)%,\\s*([\\d.]+)%\\)/);\n const res = hslRegExp.exec(col);\n\n const h = res ? parseFloat(res[1]) / 360 : 0;\n const s = res ? parseFloat(res[2]) / 100 : 0;\n const l = res ? parseFloat(res[3]) / 100 : 0;\n\n var r, g, b;\n\n if (s === 0) {\n r = g = b = l; // achromatic\n } else {\n var q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n var p = 2 * l - q;\n r = hue2rgb(p, q, h + 1 / 3);\n g = hue2rgb(p, q, h);\n b = hue2rgb(p, q, h - 1 / 3);\n }\n\n return `rgb(${Math.round(r * 255)}, ${Math.round(g * 255)}, ${Math.round(\n b * 255\n )})`;\n}\n\nexport default function CurrentAnimatedItem({\n currentItem,\n}: {\n currentItem: Animated.SharedValue<DrawItem | null>;\n}) {\n const ellipseAnimatedProps = useAnimatedProps(() => {\n const coordinates =\n currentItem.value?.type === 'ellipse'\n ? currentItem.value.data\n : { cx: -10, cy: -10, rx: 0, ry: 0 };\n\n return {\n cx: coordinates.cx,\n cy: coordinates.cy,\n rx: coordinates.rx,\n ry: coordinates.ry,\n stroke: hslToRgb(currentItem.value?.color || 'hsl(0, 0%, 0%)'),\n opacity: currentItem.value?.type === 'ellipse' ? 1 : 0,\n strokeWidth:\n currentItem.value?.type === 'ellipse'\n ? currentItem.value.strokeWidth\n : 0,\n marker: 'url(#selection)',\n };\n }, [currentItem.value]);\n\n const singleHeadAnimatedProps = useAnimatedProps(() => {\n const coordinates =\n currentItem.value?.type === 'singleHead'\n ? currentItem.value.data\n : { x1: -10, y1: -10, x2: -10, y2: -10 };\n return {\n x1: coordinates.x1,\n y1: coordinates.y1,\n x2: coordinates.x2,\n y2: coordinates.y2,\n stroke: hslToRgb(currentItem.value?.color || 'hsl(0, 0%, 0%)'),\n opacity: currentItem.value?.type === 'singleHead' ? 1 : 0,\n strokeWidth:\n currentItem.value?.type === 'singleHead'\n ? currentItem.value.strokeWidth\n : 0,\n markerEnd: 'arrowhead',\n };\n }, [currentItem.value]);\n\n const doubleHeadAnimatedProps = useAnimatedProps(() => {\n const coordinates =\n currentItem.value?.type === 'doubleHead'\n ? currentItem.value.data\n : { x1: -10, y1: -10, x2: -10, y2: -10 };\n\n return {\n x1: coordinates.x1,\n y1: coordinates.y1,\n x2: coordinates.x2,\n y2: coordinates.y2,\n stroke: hslToRgb(currentItem.value?.color || 'hsl(0, 0%, 0%)'),\n opacity: currentItem.value?.type === 'doubleHead' ? 1 : 0,\n strokeWidth:\n currentItem.value?.type === 'doubleHead'\n ? currentItem.value.strokeWidth\n : 0,\n markerStart: 'side',\n markerEnd: 'side',\n };\n }, [currentItem.value]);\n\n const rectangleAnimatedProps = useAnimatedProps(() => {\n const coordinates =\n currentItem.value?.type === 'rectangle'\n ? currentItem.value.data\n : { x: -10, y: -10, width: 0, height: 0 };\n return {\n x: coordinates.x,\n y: coordinates.y,\n width: coordinates.width,\n height: coordinates.height,\n stroke: hslToRgb(currentItem.value?.color || 'hsl(0, 0%, 0%)'),\n opacity: currentItem.value?.type === 'rectangle' ? 1 : 0,\n strokeWidth:\n currentItem.value?.type === 'rectangle'\n ? currentItem.value.strokeWidth\n : 0,\n\n marker: 'url(#selection)',\n };\n }, [currentItem.value]);\n\n const penAnimatedProps = useAnimatedProps(() => {\n const d = pointsToPath(\n currentItem.value?.type === 'pen'\n ? currentItem.value.data\n : [{ x: -10, y: -10 }]\n );\n return {\n d: d,\n strokeWidth:\n currentItem.value?.type === 'pen' ? currentItem.value.strokeWidth : 0,\n stroke: hslToRgb(currentItem.value?.color || 'hsl(0, 0%, 0%)'),\n opacity: currentItem.value?.type === 'pen' ? 1 : 0,\n markerStart: 'selection',\n markerEnd: 'selection',\n };\n }, [currentItem.value]);\n\n return (\n <>\n <AnimatedEllipse animatedProps={ellipseAnimatedProps} />\n <G markerStart=\"url(#selection)\" markerEnd=\"url(#selection)\">\n <AnimatedLine animatedProps={singleHeadAnimatedProps} />\n </G>\n <G markerStart=\"url(#selection)\" markerEnd=\"url(#selection)\">\n <AnimatedLine animatedProps={doubleHeadAnimatedProps} />\n </G>\n <AnimatedRectangle animatedProps={rectangleAnimatedProps} />\n <AnimatedPath animatedProps={penAnimatedProps} />\n </>\n );\n}\n"],"mappings":";;;;;;;;AAAA;;AACA;;AACA;;;;;;;;AAGA,MAAMA,YAAY,GAAGC,8BAAA,CAASC,uBAAT,CAAiCC,oBAAjC,CAArB;;AAEA,MAAMC,eAAe,GAAGH,8BAAA,CAASC,uBAAT,CAAiCG,uBAAjC,CAAxB;;AAEA,MAAMC,iBAAiB,GAAGL,8BAAA,CAASC,uBAAT,CAAiCK,oBAAjC,CAA1B;;AAEA,MAAMC,YAAY,GAAGP,8BAAA,CAASC,uBAAT,CAAiCO,oBAAjC,CAArB,C,CAEA;;;AACA,MAAMC,IAAI,GAAG,CAACC,MAAD,EAAgBC,MAAhB,KAAkC;EAC7C;;EACA,MAAMC,OAAO,GAAGD,MAAM,CAACE,CAAP,GAAWH,MAAM,CAACG,CAAlC;EACA,MAAMC,OAAO,GAAGH,MAAM,CAACI,CAAP,GAAWL,MAAM,CAACK,CAAlC;EACA,OAAO;IACLC,MAAM,EAAEC,IAAI,CAACC,IAAL,CAAUD,IAAI,CAACE,GAAL,CAASP,OAAT,EAAkB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AzB;EAiBA,oBACE,yEACE,6BAAC,eAAD;IAAiB,aAAa,EAAEH;EAAhC,EADF,eAEE,6BAAC,iBAAD;IAAG,WAAW,EAAC,iBAAf;IAAiC,SAAS,EAAC;EAA3C,gBACE,6BAAC,YAAD;IAAc,aAAa,EAAEe;EAA7B,EADF,CAFF,eAKE,6BAAC,iBAAD;IAAG,WAAW,EAAC,iBAAf;IAAiC,SAAS,EAAC;EAA3C,gBACE,6BAAC,YAAD;IAAc,aAAa,EAAEM;EAA7B,EADF,CALF,eAQE,6BAAC,iBAAD;IAAmB,aAAa,EAAEE;EAAlC,EARF,eASE,6BAAC,YAAD;IAAc,aAAa,EAAEG;EAA7B,EATF,CADF;AAaD"}
1
+ {"version":3,"names":["AnimatedPath","Animated","createAnimatedComponent","Path","AnimatedEllipse","Ellipse","AnimatedRectangle","Rect","AnimatedLine","Line","line","pointA","pointB","lengthX","x","lengthY","y","length","Math","sqrt","pow","angle","atan2","controlPoint","current","previous","next","reverse","p","n","smoothing","o","PI","cos","sin","bezierCommand","point","i","a","previousPoint","nextPoint","endPoint","pointBefore","startPoint","pointsToPath","points","reduce","acc","hue2rgb","q","t","hslToRgb","col","hslRegExp","RegExp","res","exec","h","parseFloat","s","l","r","g","b","round","propAdapter","createAnimatedPropAdapter","props","Object","keys","includes","fill","type","payload","processColor","stroke","CurrentAnimatedItem","currentItem","ellipseAnimatedProps","useAnimatedProps","coordinates","value","data","cx","cy","rx","ry","color","opacity","strokeWidth","marker","singleHeadAnimatedProps","x1","y1","x2","y2","markerEnd","doubleHeadAnimatedProps","markerStart","rectangleAnimatedProps","width","height","penAnimatedProps","d"],"sourceRoot":"../../../../src","sources":["components/DrawCore/CurrentAnimatedItem.tsx"],"mappings":";;;;;;;AAAA;AACA;AAKA;AAAgE;AAAA;AAAA;AAGhE,MAAMA,YAAY,GAAGC,8BAAQ,CAACC,uBAAuB,CAACC,oBAAI,CAAC;AAE3D,MAAMC,eAAe,GAAGH,8BAAQ,CAACC,uBAA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,CAAC;MAC9DC,OAAO,EAAE,yBAAAX,WAAW,CAACI,KAAK,yDAAjB,qBAAmBT,IAAI,MAAK,KAAK,GAAG,CAAC,GAAG,CAAC;MAClDD,IAAI,EAAE,aAAa;MACnB2B,WAAW,EAAE,WAAW;MACxBF,SAAS,EAAE;IACb,CAAC;EACH,CAAC,EACD,IAAI,EACJ/B,WAAW,CACZ;EAED,oBACE,yEACE,6BAAC,eAAe;IAAC,aAAa,EAAEa;EAAqB,EAAG,eACxD,6BAAC,iBAAC;IAAC,WAAW,EAAC,iBAAiB;IAAC,SAAS,EAAC;EAAiB,gBAC1D,6BAAC,YAAY;IAAC,aAAa,EAAEa;EAAwB,EAAG,CACtD,eACJ,6BAAC,iBAAC;IAAC,WAAW,EAAC,iBAAiB;IAAC,SAAS,EAAC;EAAiB,gBAC1D,6BAAC,YAAY;IAAC,aAAa,EAAEM;EAAwB,EAAG,CACtD,eACJ,6BAAC,iBAAiB;IAAC,aAAa,EAAEE;EAAuB,EAAG,eAC5D,6BAAC,YAAY;IAAC,aAAa,EAAEG;EAAiB,EAAG,CAChD;AAEP"}
@@ -4,17 +4,11 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = CurrentAnimatedText;
7
-
8
7
  var _react = _interopRequireWildcard(require("react"));
9
-
10
8
  var _reactNative = require("react-native");
11
-
12
9
  var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reanimated"));
13
-
14
10
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15
-
16
11
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
17
-
18
12
  const styles = _reactNative.StyleSheet.create({
19
13
  textBackground: {
20
14
  marginHorizontal: 10,
@@ -44,15 +38,13 @@ const styles = _reactNative.StyleSheet.create({
44
38
  borderColor: 'white'
45
39
  }
46
40
  });
41
+
47
42
  /**
48
43
  * There is an issue on re-render for ForeignObject (see https://github.com/react-native-svg/react-native-svg/issues/1357)
49
44
  * So we cannot embed this component directly in the Svg
50
45
  */
51
-
52
-
53
46
  function CurrentAnimatedText(_ref) {
54
47
  var _currentItem$value, _currentItem$value4;
55
-
56
48
  let {
57
49
  currentItem,
58
50
  onHeightChange
@@ -60,20 +52,17 @@ function CurrentAnimatedText(_ref) {
60
52
  const [text, setText] = (0, _react.useState)(((_currentItem$value = currentItem.value) === null || _currentItem$value === void 0 ? void 0 : _currentItem$value.type) === 'text' ? currentItem.value.text || '' : '');
61
53
  (0, _reactNativeReanimated.useDerivedValue)(() => {
62
54
  var _currentItem$value2;
63
-
64
55
  (0, _reactNativeReanimated.runOnJS)(setText)(((_currentItem$value2 = currentItem.value) === null || _currentItem$value2 === void 0 ? void 0 : _currentItem$value2.type) === 'text' ? currentItem.value.text || '' : '');
65
56
  }, [currentItem.value]);
66
57
  const textAnimatedStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => {
67
- var _currentItem$value$st, _currentItem$value3;
68
-
58
+ var _currentItem$value3;
69
59
  return {
70
- fontSize: 16 + ((_currentItem$value$st = (_currentItem$value3 = currentItem.value) === null || _currentItem$value3 === void 0 ? void 0 : _currentItem$value3.strokeWidth) !== null && _currentItem$value$st !== void 0 ? _currentItem$value$st : 0),
60
+ fontSize: 16 + (((_currentItem$value3 = currentItem.value) === null || _currentItem$value3 === void 0 ? void 0 : _currentItem$value3.strokeWidth) ?? 0),
71
61
  color: 'white'
72
62
  };
73
63
  }, [(_currentItem$value4 = currentItem.value) === null || _currentItem$value4 === void 0 ? void 0 : _currentItem$value4.strokeWidth]);
74
64
  const containerStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => {
75
65
  var _currentItem$value5, _currentItem$value6, _currentItem$value7, _currentItem$value8, _currentItem$value9;
76
-
77
66
  return {
78
67
  opacity: ((_currentItem$value5 = currentItem.value) === null || _currentItem$value5 === void 0 ? void 0 : _currentItem$value5.type) === 'text' ? 1 : 0,
79
68
  height: ((_currentItem$value6 = currentItem.value) === null || _currentItem$value6 === void 0 ? void 0 : _currentItem$value6.type) === 'text' ? 'auto' : -10,
@@ -1 +1 @@
1
- {"version":3,"names":["styles","StyleSheet","create","textBackground","marginHorizontal","backgroundColor","borderRadius","paddingVertical","paddingHorizontal","markerContainerLeft","position","left","height","justifyContent","markerContainerRight","right","marker","width","borderWidth","borderColor","CurrentAnimatedText","currentItem","onHeightChange","text","setText","useState","value","type","useDerivedValue","runOnJS","textAnimatedStyle","useAnimatedStyle","fontSize","strokeWidth","color","containerStyle","opacity","data","parseFloat","top","transform","translateX","x","translateY","y","event","nativeEvent","layout"],"sources":["CurrentAnimatedText.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { StyleSheet, View } from 'react-native';\nimport Animated, {\n runOnJS,\n useAnimatedStyle,\n useDerivedValue,\n} from 'react-native-reanimated';\nimport type { DrawItem } from '../../types';\n\nconst styles = StyleSheet.create({\n textBackground: {\n marginHorizontal: 10,\n backgroundColor: 'rgba(0, 0, 0, 0.6)',\n borderRadius: 10,\n paddingVertical: 13,\n paddingHorizontal: 18,\n },\n markerContainerLeft: {\n position: 'absolute',\n left: 5,\n height: '100%',\n justifyContent: 'center',\n },\n markerContainerRight: {\n position: 'absolute',\n right: 5,\n height: '100%',\n justifyContent: 'center',\n },\n marker: {\n width: 10,\n height: 10,\n borderRadius: 10,\n backgroundColor: '#3a6cff',\n borderWidth: 1,\n borderColor: 'white',\n },\n});\n\n/**\n * There is an issue on re-render for ForeignObject (see https://github.com/react-native-svg/react-native-svg/issues/1357)\n * So we cannot embed this component directly in the Svg\n */\nexport default function CurrentAnimatedText({\n currentItem,\n onHeightChange,\n}: {\n currentItem: Animated.SharedValue<DrawItem | null>;\n onHeightChange: (height: number) => void;\n}) {\n const [text, setText] = useState(\n currentItem.value?.type === 'text' ? currentItem.value.text || '' : ''\n );\n\n useDerivedValue(() => {\n runOnJS(setText)(\n currentItem.value?.type === 'text' ? currentItem.value.text || '' : ''\n );\n }, [currentItem.value]);\n\n const textAnimatedStyle = useAnimatedStyle(() => {\n return {\n fontSize: 16 + (currentItem.value?.strokeWidth ?? 0),\n color: 'white',\n };\n }, [currentItem.value?.strokeWidth]);\n\n const containerStyle = useAnimatedStyle(() => {\n return {\n opacity: currentItem.value?.type === 'text' ? 1 : 0,\n height: currentItem.value?.type === 'text' ? 'auto' : -10,\n width:\n (currentItem.value?.type === 'text' &&\n (typeof currentItem.value.data.width === 'string'\n ? parseFloat(currentItem.value.data.width)\n : currentItem.value.data.width)) ||\n 0,\n position: 'absolute',\n top: 0,\n left: 0,\n transform: [\n {\n translateX:\n (currentItem.value?.type === 'text' &&\n (typeof currentItem.value.data.x === 'string'\n ? parseFloat(currentItem.value.data.x)\n : currentItem.value.data.x)) ||\n 0,\n },\n {\n translateY:\n (currentItem.value?.type === 'text' &&\n (typeof currentItem.value.data.y === 'string'\n ? parseFloat(currentItem.value.data.y)\n : currentItem.value.data.y)) ||\n 0,\n },\n ],\n };\n }, [currentItem.value]);\n\n return (\n <Animated.View style={containerStyle}>\n <View\n style={styles.textBackground}\n onLayout={(event) => {\n onHeightChange(event.nativeEvent.layout.height);\n }}\n >\n <Animated.Text style={textAnimatedStyle}>{text}</Animated.Text>\n </View>\n <View style={styles.markerContainerLeft}>\n <View style={styles.marker} />\n </View>\n <View style={styles.markerContainerRight}>\n <View style={styles.marker} />\n </View>\n </Animated.View>\n );\n}\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;;;AAOA,MAAMA,MAAM,GAAGC,uBAAA,CAAWC,MAAX,CAAkB;EAC/BC,cAAc,EAAE;IACdC,gBAAgB,EAAE,EADJ;IAEdC,eAAe,EAAE,oBAFH;IAGdC,YAAY,EAAE,EAHA;IAIdC,eAAe,EAAE,EAJH;IAKdC,iBAAiB,EAAE;EALL,CADe;EAQ/BC,mBAAmB,EAAE;IACnBC,QAAQ,EAAE,UADS;IAEnBC,IAAI,EAAE,CAFa;IAGnBC,MAAM,EAAE,MAHW;IAInBC,cAAc,EAAE;EAJG,CARU;EAc/BC,oBAAoB,EAAE;IACpBJ,QAAQ,EAAE,UADU;IAEpBK,KAAK,EAAE,CAFa;IAGpBH,MAAM,EAAE,MAHY;IAIpBC,cAAc,EAAE;EAJI,CAdS;EAoB/BG,MAAM,EAAE;IACNC,KAAK,EAAE,EADD;IAENL,MAAM,EAAE,EAFF;IAGNN,YAAY,EAAE,EAHR;IAIND,eAAe,EAAE,SAJX;IAKNa,WAAW,EAAE,CALP;IAMNC,WAAW,EAAE;EANP;AApBuB,CAAlB,CAAf;AA8BA;AACA;AACA;AACA;;;AACe,SAASC,mBAAT,OAMZ;EAAA;;EAAA,IANyC;IAC1CC,WAD0C;IAE1CC;EAF0C,CAMzC;EACD,MAAM,CAACC,IAAD,EAAOC,OAAP,IAAkB,IAAAC,eAAA,EACtB,uBAAAJ,WAAW,CAACK,KAAZ,0EAAmBC,IAAnB,MAA4B,MAA5B,GAAqCN,WAAW,CAACK,KAAZ,CAAkBH,IAAlB,IAA0B,EAA/D,GAAoE,EAD9C,CAAxB;EAIA,IAAAK,sCAAA,EAAgB,MAAM;IAAA;;IACpB,IAAAC,8BAAA,EAAQL,OAAR,EACE,wBAAAH,WAAW,CAACK,KAAZ,4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ontal","backgroundColor","borderRadius","paddingVertical","paddingHorizontal","markerContainerLeft","position","left","height","justifyContent","markerContainerRight","right","marker","width","borderWidth","borderColor","CurrentAnimatedText","currentItem","onHeightChange","text","setText","useState","value","type","useDerivedValue","runOnJS","textAnimatedStyle","useAnimatedStyle","fontSize","strokeWidth","color","containerStyle","opacity","data","parseFloat","top","transform","translateX","x","translateY","y","event","nativeEvent","layout"],"sourceRoot":"../../../../src","sources":["components/DrawCore/CurrentAnimatedText.tsx"],"mappings":";;;;;;AAAA;AACA;AACA;AAIiC;AAAA;AAGjC,MAAMA,MAAM,GAAGC,uBAAU,CAACC,MAAM,CAAC;EAC/BC,cAAc,EAAE;IACdC,gBAAgB,EAAE,EAAE;IACpBC,eAAe,EAAE,oBAAoB;IACrCC,YAAY,EAAE,EAAE;IAChBC,eAAe,EAAE,EAAE;IACnBC,iBAAiB,EAAE;EACrB,CAAC;EACDC,mBAAmB,EAAE;IACnBC,QAAQ,EAAE,UAAU;IACpBC,IAAI,EAAE,CAAC;IACPC,MAAM,EAAE,MAAM;IACdC,cAAc,EAAE;EAClB,CAAC;EACDC,oBAAoB,EAAE;IACpBJ,QAAQ,EAAE,UAAU;IACpBK,KAAK,EAAE,CAAC;IACRH,MAAM,EAAE,MAAM;IACdC,cAAc,EAAE;EAClB,CAAC;EACDG,MAAM,EAAE;IACNC,KAAK,EAAE,EAAE;IACTL,MAAM,EAAE,EAAE;IACVN,YAAY,EAAE,EAAE;IAChBD,eAAe,EAAE,SAAS;IAC1Ba,WAAW,EAAE,CAAC;IACdC,WAAW,EAAE;EACf;AACF,CAAC,CAAC;;AAEF;AACA;AACA;AACA;AACe,SAASC,mBAAmB,OAMxC;EAAA;EAAA,IANyC;IAC1CC,WAAW;IACXC;EAIF,CAAC;EACC,MAAM,CAACC,IAAI,EAAEC,OAAO,CAAC,GAAG,IAAAC,eAAQ,EAC9B,uBAAAJ,WAAW,CAACK,KAAK,uDAAjB,mBAAmBC,IAAI,MAAK,MAAM,GAAG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qB,gBACvC,6BAAC,iBAAI;IAAC,KAAK,EAAEd,MAAM,CAACgB;EAAO,EAAG,CACzB,CACO;AAEpB"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.DrawContext = void 0;
7
+ var _react = require("react");
8
+ const DrawContext = /*#__PURE__*/(0, _react.createContext)({
9
+ drawState: {
10
+ doneItems: [],
11
+ screenStates: [[]],
12
+ drawingMode: 'ellipse',
13
+ cancelEnabled: false
14
+ },
15
+ dispatchDrawStates: () => true
16
+ });
17
+ exports.DrawContext = DrawContext;
18
+ //# sourceMappingURL=DrawContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["DrawContext","createContext","drawState","doneItems","screenStates","drawingMode","cancelEnabled","dispatchDrawStates"],"sourceRoot":"../../../../src","sources":["components/DrawCore/DrawContext.tsx"],"mappings":";;;;;;AACA;AAIO,MAAMA,WAAW,gBAAG,IAAAC,oBAAa,EAQrC;EACDC,SAAS,EAAE;IACTC,SAAS,EAAE,EAAE;IACbC,YAAY,EAAE,CAAC,EAAE,CAAC;IAClBC,WAAW,EAAE,SAAS;IACtBC,aAAa,EAAE;EACjB,CAAC;EACDC,kBAAkB,EAAE,MAAM;AAC5B,CAAC,CAAC;AAAC"}