@shopify/react-native-skia 0.1.147 → 0.1.149

Sign up to get free protection for your applications and to get access to all the features.
Files changed (836) hide show
  1. package/cpp/api/JsiSkFont.h +4 -4
  2. package/cpp/rnskia/RNSkJsiViewApi.h +2 -2
  3. package/lib/commonjs/dom/nodes/DrawingNode.js +84 -0
  4. package/lib/commonjs/dom/nodes/DrawingNode.js.map +1 -0
  5. package/lib/commonjs/dom/nodes/GroupNode.js +28 -0
  6. package/lib/commonjs/dom/nodes/GroupNode.js.map +1 -0
  7. package/lib/commonjs/dom/nodes/JsiSkDOM.js +256 -0
  8. package/lib/commonjs/dom/nodes/JsiSkDOM.js.map +1 -0
  9. package/lib/commonjs/dom/nodes/Node.js +158 -0
  10. package/lib/commonjs/dom/nodes/Node.js.map +1 -0
  11. package/lib/commonjs/dom/nodes/PaintContext.js +6 -0
  12. package/lib/commonjs/dom/nodes/PaintContext.js.map +1 -0
  13. package/lib/commonjs/dom/nodes/PaintNode.js +96 -0
  14. package/lib/commonjs/dom/nodes/PaintNode.js.map +1 -0
  15. package/lib/commonjs/dom/nodes/RenderNode.js +346 -0
  16. package/lib/commonjs/dom/nodes/RenderNode.js.map +1 -0
  17. package/lib/commonjs/{renderer/processors/Circles.js → dom/nodes/datatypes/Circle.js} +4 -2
  18. package/lib/commonjs/dom/nodes/datatypes/Circle.js.map +1 -0
  19. package/lib/commonjs/{renderer/processors → dom/nodes/datatypes}/Color.js +0 -0
  20. package/lib/commonjs/{renderer/processors → dom/nodes/datatypes}/Color.js.map +1 -1
  21. package/lib/commonjs/dom/nodes/datatypes/Enum.js +11 -0
  22. package/lib/commonjs/dom/nodes/datatypes/Enum.js.map +1 -0
  23. package/lib/commonjs/{renderer/components/image/BoxFit.js → dom/nodes/datatypes/Fitting.js} +2 -2
  24. package/lib/commonjs/{renderer/components/image/BoxFit.js.map → dom/nodes/datatypes/Fitting.js.map} +1 -1
  25. package/lib/commonjs/dom/nodes/datatypes/Gradient.js +65 -0
  26. package/lib/commonjs/dom/nodes/datatypes/Gradient.js.map +1 -0
  27. package/lib/commonjs/{renderer/processors/Paths.js → dom/nodes/datatypes/Path.js} +2 -2
  28. package/lib/commonjs/dom/nodes/datatypes/Path.js.map +1 -0
  29. package/lib/commonjs/{renderer/processors → dom/nodes/datatypes}/Radius.js +0 -0
  30. package/lib/commonjs/dom/nodes/datatypes/Radius.js.map +1 -0
  31. package/lib/commonjs/{renderer/processors/Rects.js → dom/nodes/datatypes/Rect.js} +1 -1
  32. package/lib/commonjs/dom/nodes/datatypes/Rect.js.map +1 -0
  33. package/lib/commonjs/dom/nodes/datatypes/Transform.js +42 -0
  34. package/lib/commonjs/dom/nodes/datatypes/Transform.js.map +1 -0
  35. package/lib/commonjs/dom/nodes/datatypes/index.js +123 -0
  36. package/lib/commonjs/dom/nodes/datatypes/index.js.map +1 -0
  37. package/lib/commonjs/dom/nodes/drawings/BackdropFilterNode.js +38 -0
  38. package/lib/commonjs/dom/nodes/drawings/BackdropFilterNode.js.map +1 -0
  39. package/lib/commonjs/dom/nodes/drawings/Box.js +105 -0
  40. package/lib/commonjs/dom/nodes/drawings/Box.js.map +1 -0
  41. package/lib/commonjs/dom/nodes/drawings/CircleNode.js +43 -0
  42. package/lib/commonjs/dom/nodes/drawings/CircleNode.js.map +1 -0
  43. package/lib/commonjs/dom/nodes/drawings/CustomDrawingNode.js +28 -0
  44. package/lib/commonjs/dom/nodes/drawings/CustomDrawingNode.js.map +1 -0
  45. package/lib/commonjs/dom/nodes/drawings/DiffRectNode.js +36 -0
  46. package/lib/commonjs/dom/nodes/drawings/DiffRectNode.js.map +1 -0
  47. package/lib/commonjs/dom/nodes/drawings/FillNode.js +33 -0
  48. package/lib/commonjs/dom/nodes/drawings/FillNode.js.map +1 -0
  49. package/lib/commonjs/dom/nodes/drawings/ImageNode.js +63 -0
  50. package/lib/commonjs/dom/nodes/drawings/ImageNode.js.map +1 -0
  51. package/lib/commonjs/dom/nodes/drawings/ImageSVG.js +45 -0
  52. package/lib/commonjs/dom/nodes/drawings/ImageSVG.js.map +1 -0
  53. package/lib/commonjs/dom/nodes/drawings/LineNode.js +36 -0
  54. package/lib/commonjs/dom/nodes/drawings/LineNode.js.map +1 -0
  55. package/lib/commonjs/dom/nodes/drawings/OvalNode.js +39 -0
  56. package/lib/commonjs/dom/nodes/drawings/OvalNode.js.map +1 -0
  57. package/lib/commonjs/dom/nodes/drawings/PatchNode.js +69 -0
  58. package/lib/commonjs/dom/nodes/drawings/PatchNode.js.map +1 -0
  59. package/lib/commonjs/dom/nodes/drawings/PathNode.js +68 -0
  60. package/lib/commonjs/dom/nodes/drawings/PathNode.js.map +1 -0
  61. package/lib/commonjs/dom/nodes/drawings/PictureNode.js +34 -0
  62. package/lib/commonjs/dom/nodes/drawings/PictureNode.js.map +1 -0
  63. package/lib/commonjs/dom/nodes/drawings/PointsNode.js +40 -0
  64. package/lib/commonjs/dom/nodes/drawings/PointsNode.js.map +1 -0
  65. package/lib/commonjs/dom/nodes/drawings/RRectNode.js +43 -0
  66. package/lib/commonjs/dom/nodes/drawings/RRectNode.js.map +1 -0
  67. package/lib/commonjs/dom/nodes/drawings/RectNode.js +39 -0
  68. package/lib/commonjs/dom/nodes/drawings/RectNode.js.map +1 -0
  69. package/lib/commonjs/dom/nodes/drawings/Text.js +185 -0
  70. package/lib/commonjs/dom/nodes/drawings/Text.js.map +1 -0
  71. package/lib/commonjs/dom/nodes/drawings/VerticesNode.js +55 -0
  72. package/lib/commonjs/dom/nodes/drawings/VerticesNode.js.map +1 -0
  73. package/lib/commonjs/dom/nodes/drawings/index.js +240 -0
  74. package/lib/commonjs/dom/nodes/drawings/index.js.map +1 -0
  75. package/lib/commonjs/dom/nodes/index.js +45 -0
  76. package/lib/commonjs/dom/nodes/index.js.map +1 -0
  77. package/lib/commonjs/dom/nodes/paint/BlendNode.js +82 -0
  78. package/lib/commonjs/dom/nodes/paint/BlendNode.js.map +1 -0
  79. package/lib/commonjs/dom/nodes/paint/ColorFilters.js +152 -0
  80. package/lib/commonjs/dom/nodes/paint/ColorFilters.js.map +1 -0
  81. package/lib/commonjs/dom/nodes/paint/ImageFilters.js +225 -0
  82. package/lib/commonjs/dom/nodes/paint/ImageFilters.js.map +1 -0
  83. package/lib/commonjs/dom/nodes/paint/MaskFilters.js +33 -0
  84. package/lib/commonjs/dom/nodes/paint/MaskFilters.js.map +1 -0
  85. package/lib/commonjs/dom/nodes/paint/PathEffects.js +223 -0
  86. package/lib/commonjs/dom/nodes/paint/PathEffects.js.map +1 -0
  87. package/lib/commonjs/dom/nodes/paint/Shaders.js +242 -0
  88. package/lib/commonjs/dom/nodes/paint/Shaders.js.map +1 -0
  89. package/lib/commonjs/dom/nodes/paint/index.js +84 -0
  90. package/lib/commonjs/dom/nodes/paint/index.js.map +1 -0
  91. package/lib/commonjs/dom/types/ColorFilters.js +6 -0
  92. package/lib/commonjs/dom/types/ColorFilters.js.map +1 -0
  93. package/lib/commonjs/dom/types/Common.js +6 -0
  94. package/lib/commonjs/dom/types/Common.js.map +1 -0
  95. package/lib/commonjs/dom/types/DrawingContext.js +6 -0
  96. package/lib/commonjs/dom/types/DrawingContext.js.map +1 -0
  97. package/lib/commonjs/dom/types/Drawings.js +6 -0
  98. package/lib/commonjs/dom/types/Drawings.js.map +1 -0
  99. package/lib/commonjs/dom/types/ImageFilters.js +6 -0
  100. package/lib/commonjs/dom/types/ImageFilters.js.map +1 -0
  101. package/lib/commonjs/dom/types/MaskFilters.js +6 -0
  102. package/lib/commonjs/dom/types/MaskFilters.js.map +1 -0
  103. package/lib/commonjs/dom/types/Node.js +6 -0
  104. package/lib/commonjs/dom/types/Node.js.map +1 -0
  105. package/lib/commonjs/dom/types/NodeType.js +80 -0
  106. package/lib/commonjs/dom/types/NodeType.js.map +1 -0
  107. package/lib/commonjs/dom/types/PathEffects.js +6 -0
  108. package/lib/commonjs/dom/types/PathEffects.js.map +1 -0
  109. package/lib/commonjs/dom/types/Shaders.js +6 -0
  110. package/lib/commonjs/dom/types/Shaders.js.map +1 -0
  111. package/lib/commonjs/dom/types/SkDOM.js +6 -0
  112. package/lib/commonjs/dom/types/SkDOM.js.map +1 -0
  113. package/lib/commonjs/dom/types/index.js +149 -0
  114. package/lib/commonjs/dom/types/index.js.map +1 -0
  115. package/lib/commonjs/index.js +26 -0
  116. package/lib/commonjs/index.js.map +1 -1
  117. package/lib/commonjs/renderer/Canvas.js +7 -3
  118. package/lib/commonjs/renderer/Canvas.js.map +1 -1
  119. package/lib/commonjs/renderer/Container.js +39 -0
  120. package/lib/commonjs/renderer/Container.js.map +1 -0
  121. package/lib/commonjs/renderer/DependencyManager.js +17 -5
  122. package/lib/commonjs/renderer/DependencyManager.js.map +1 -1
  123. package/lib/commonjs/renderer/HostComponents.js +196 -0
  124. package/lib/commonjs/renderer/HostComponents.js.map +1 -0
  125. package/lib/commonjs/renderer/HostConfig.js +47 -125
  126. package/lib/commonjs/renderer/HostConfig.js.map +1 -1
  127. package/lib/commonjs/renderer/components/Blend.js +1 -46
  128. package/lib/commonjs/renderer/components/Blend.js.map +1 -1
  129. package/lib/commonjs/renderer/components/Drawing.js +1 -15
  130. package/lib/commonjs/renderer/components/Drawing.js.map +1 -1
  131. package/lib/commonjs/renderer/components/Group.js +1 -69
  132. package/lib/commonjs/renderer/components/Group.js.map +1 -1
  133. package/lib/commonjs/renderer/components/Paint.js +2 -14
  134. package/lib/commonjs/renderer/components/Paint.js.map +1 -1
  135. package/lib/commonjs/renderer/components/Picture.js +1 -19
  136. package/lib/commonjs/renderer/components/Picture.js.map +1 -1
  137. package/lib/commonjs/renderer/components/backdrop/BackdropBlur.js.map +1 -1
  138. package/lib/commonjs/renderer/components/backdrop/BackdropFilter.js +2 -32
  139. package/lib/commonjs/renderer/components/backdrop/BackdropFilter.js.map +1 -1
  140. package/lib/commonjs/renderer/components/colorFilters/BlendColor.js +1 -25
  141. package/lib/commonjs/renderer/components/colorFilters/BlendColor.js.map +1 -1
  142. package/lib/commonjs/renderer/components/colorFilters/Lerp.js +1 -23
  143. package/lib/commonjs/renderer/components/colorFilters/Lerp.js.map +1 -1
  144. package/lib/commonjs/renderer/components/colorFilters/LinearToSRGBGamma.js +1 -17
  145. package/lib/commonjs/renderer/components/colorFilters/LinearToSRGBGamma.js.map +1 -1
  146. package/lib/commonjs/renderer/components/colorFilters/LumaColorFilter.js +1 -17
  147. package/lib/commonjs/renderer/components/colorFilters/LumaColorFilter.js.map +1 -1
  148. package/lib/commonjs/renderer/components/colorFilters/Matrix.js +1 -20
  149. package/lib/commonjs/renderer/components/colorFilters/Matrix.js.map +1 -1
  150. package/lib/commonjs/renderer/components/colorFilters/SRGBToLinearGamma.js +1 -17
  151. package/lib/commonjs/renderer/components/colorFilters/SRGBToLinearGamma.js.map +1 -1
  152. package/lib/commonjs/renderer/components/image/Image.js +1 -35
  153. package/lib/commonjs/renderer/components/image/Image.js.map +1 -1
  154. package/lib/commonjs/renderer/components/image/ImageSVG.js +1 -30
  155. package/lib/commonjs/renderer/components/image/ImageSVG.js.map +1 -1
  156. package/lib/commonjs/renderer/components/image/ImageShader.js +1 -61
  157. package/lib/commonjs/renderer/components/image/ImageShader.js.map +1 -1
  158. package/lib/commonjs/renderer/components/image/index.js +0 -13
  159. package/lib/commonjs/renderer/components/image/index.js.map +1 -1
  160. package/lib/commonjs/renderer/components/imageFilters/Blur.js +1 -27
  161. package/lib/commonjs/renderer/components/imageFilters/Blur.js.map +1 -1
  162. package/lib/commonjs/renderer/components/imageFilters/DisplacementMap.js +1 -38
  163. package/lib/commonjs/renderer/components/imageFilters/DisplacementMap.js.map +1 -1
  164. package/lib/commonjs/renderer/components/imageFilters/Morphology.js +1 -25
  165. package/lib/commonjs/renderer/components/imageFilters/Morphology.js.map +1 -1
  166. package/lib/commonjs/renderer/components/imageFilters/Offset.js +1 -20
  167. package/lib/commonjs/renderer/components/imageFilters/Offset.js.map +1 -1
  168. package/lib/commonjs/renderer/components/imageFilters/RuntimeShader.js +1 -28
  169. package/lib/commonjs/renderer/components/imageFilters/RuntimeShader.js.map +1 -1
  170. package/lib/commonjs/renderer/components/imageFilters/Shadow.js +1 -39
  171. package/lib/commonjs/renderer/components/imageFilters/Shadow.js.map +1 -1
  172. package/lib/commonjs/renderer/components/index.js +0 -13
  173. package/lib/commonjs/renderer/components/index.js.map +1 -1
  174. package/lib/commonjs/renderer/components/maskFilters/Blur.js +1 -23
  175. package/lib/commonjs/renderer/components/maskFilters/Blur.js.map +1 -1
  176. package/lib/commonjs/renderer/components/pathEffects/Corner.js +1 -30
  177. package/lib/commonjs/renderer/components/pathEffects/Corner.js.map +1 -1
  178. package/lib/commonjs/renderer/components/pathEffects/Dash.js +1 -27
  179. package/lib/commonjs/renderer/components/pathEffects/Dash.js.map +1 -1
  180. package/lib/commonjs/renderer/components/pathEffects/Discrete.js +1 -28
  181. package/lib/commonjs/renderer/components/pathEffects/Discrete.js.map +1 -1
  182. package/lib/commonjs/renderer/components/pathEffects/Line2D.js +1 -31
  183. package/lib/commonjs/renderer/components/pathEffects/Line2D.js.map +1 -1
  184. package/lib/commonjs/renderer/components/pathEffects/Path1D.js +1 -37
  185. package/lib/commonjs/renderer/components/pathEffects/Path1D.js.map +1 -1
  186. package/lib/commonjs/renderer/components/pathEffects/Path2D.js +1 -33
  187. package/lib/commonjs/renderer/components/pathEffects/Path2D.js.map +1 -1
  188. package/lib/commonjs/renderer/components/pathEffects/Sum.js +1 -17
  189. package/lib/commonjs/renderer/components/pathEffects/Sum.js.map +1 -1
  190. package/lib/commonjs/renderer/components/shaders/Color.js +1 -19
  191. package/lib/commonjs/renderer/components/shaders/Color.js.map +1 -1
  192. package/lib/commonjs/renderer/components/shaders/FractalNoise.js +1 -22
  193. package/lib/commonjs/renderer/components/shaders/FractalNoise.js.map +1 -1
  194. package/lib/commonjs/renderer/components/shaders/LinearGradient.js +1 -28
  195. package/lib/commonjs/renderer/components/shaders/LinearGradient.js.map +1 -1
  196. package/lib/commonjs/renderer/components/shaders/RadialGradient.js +1 -28
  197. package/lib/commonjs/renderer/components/shaders/RadialGradient.js.map +1 -1
  198. package/lib/commonjs/renderer/components/shaders/Shader.js +1 -23
  199. package/lib/commonjs/renderer/components/shaders/Shader.js.map +1 -1
  200. package/lib/commonjs/renderer/components/shaders/SweepGradient.js +1 -29
  201. package/lib/commonjs/renderer/components/shaders/SweepGradient.js.map +1 -1
  202. package/lib/commonjs/renderer/components/shaders/Turbulence.js +1 -22
  203. package/lib/commonjs/renderer/components/shaders/Turbulence.js.map +1 -1
  204. package/lib/commonjs/renderer/components/shaders/TwoPointConicalGradient.js +1 -30
  205. package/lib/commonjs/renderer/components/shaders/TwoPointConicalGradient.js.map +1 -1
  206. package/lib/commonjs/renderer/components/shapes/Box.js +2 -102
  207. package/lib/commonjs/renderer/components/shapes/Box.js.map +1 -1
  208. package/lib/commonjs/renderer/components/shapes/Circle.js +1 -22
  209. package/lib/commonjs/renderer/components/shapes/Circle.js.map +1 -1
  210. package/lib/commonjs/renderer/components/shapes/DiffRect.js +1 -19
  211. package/lib/commonjs/renderer/components/shapes/DiffRect.js.map +1 -1
  212. package/lib/commonjs/renderer/components/shapes/Fill.js +1 -15
  213. package/lib/commonjs/renderer/components/shapes/Fill.js.map +1 -1
  214. package/lib/commonjs/renderer/components/shapes/FitBox.js +3 -3
  215. package/lib/commonjs/renderer/components/shapes/FitBox.js.map +1 -1
  216. package/lib/commonjs/renderer/components/shapes/Line.js +1 -19
  217. package/lib/commonjs/renderer/components/shapes/Line.js.map +1 -1
  218. package/lib/commonjs/renderer/components/shapes/Oval.js +1 -19
  219. package/lib/commonjs/renderer/components/shapes/Oval.js.map +1 -1
  220. package/lib/commonjs/renderer/components/shapes/Patch.js +1 -37
  221. package/lib/commonjs/renderer/components/shapes/Patch.js.map +1 -1
  222. package/lib/commonjs/renderer/components/shapes/Path.js +1 -47
  223. package/lib/commonjs/renderer/components/shapes/Path.js.map +1 -1
  224. package/lib/commonjs/renderer/components/shapes/Points.js +1 -26
  225. package/lib/commonjs/renderer/components/shapes/Points.js.map +1 -1
  226. package/lib/commonjs/renderer/components/shapes/Rect.js +1 -19
  227. package/lib/commonjs/renderer/components/shapes/Rect.js.map +1 -1
  228. package/lib/commonjs/renderer/components/shapes/RoundedRect.js +1 -19
  229. package/lib/commonjs/renderer/components/shapes/RoundedRect.js.map +1 -1
  230. package/lib/commonjs/renderer/components/shapes/Vertices.js +1 -36
  231. package/lib/commonjs/renderer/components/shapes/Vertices.js.map +1 -1
  232. package/lib/commonjs/renderer/components/text/Glyphs.js +1 -39
  233. package/lib/commonjs/renderer/components/text/Glyphs.js.map +1 -1
  234. package/lib/commonjs/renderer/components/text/Text.js +1 -24
  235. package/lib/commonjs/renderer/components/text/Text.js.map +1 -1
  236. package/lib/commonjs/renderer/components/text/TextBlob.js +1 -20
  237. package/lib/commonjs/renderer/components/text/TextBlob.js.map +1 -1
  238. package/lib/commonjs/renderer/components/text/TextPath.js +1 -71
  239. package/lib/commonjs/renderer/components/text/TextPath.js.map +1 -1
  240. package/lib/commonjs/renderer/index.js +0 -13
  241. package/lib/commonjs/renderer/index.js.map +1 -1
  242. package/lib/commonjs/renderer/processors/Animations/Animations.js.map +1 -1
  243. package/lib/commonjs/renderer/processors/index.js +0 -117
  244. package/lib/commonjs/renderer/processors/index.js.map +1 -1
  245. package/lib/commonjs/skia/core/Data.js +10 -1
  246. package/lib/commonjs/skia/core/Data.js.map +1 -1
  247. package/lib/commonjs/web/WithSkiaWeb.js +3 -1
  248. package/lib/commonjs/web/WithSkiaWeb.js.map +1 -1
  249. package/lib/module/dom/nodes/DrawingNode.js +72 -0
  250. package/lib/module/dom/nodes/DrawingNode.js.map +1 -0
  251. package/lib/module/dom/nodes/GroupNode.js +17 -0
  252. package/lib/module/dom/nodes/GroupNode.js.map +1 -0
  253. package/lib/module/dom/nodes/JsiSkDOM.js +240 -0
  254. package/lib/module/dom/nodes/JsiSkDOM.js.map +1 -0
  255. package/lib/module/dom/nodes/Node.js +145 -0
  256. package/lib/module/dom/nodes/Node.js.map +1 -0
  257. package/lib/module/dom/nodes/PaintContext.js +2 -0
  258. package/lib/module/dom/nodes/PaintContext.js.map +1 -0
  259. package/lib/module/dom/nodes/PaintNode.js +83 -0
  260. package/lib/module/dom/nodes/PaintNode.js.map +1 -0
  261. package/lib/module/dom/nodes/RenderNode.js +329 -0
  262. package/lib/module/dom/nodes/RenderNode.js.map +1 -0
  263. package/lib/module/{renderer/processors/Circles.js → dom/nodes/datatypes/Circle.js} +2 -3
  264. package/lib/module/dom/nodes/datatypes/Circle.js.map +1 -0
  265. package/lib/module/{renderer/processors → dom/nodes/datatypes}/Color.js +0 -0
  266. package/lib/module/{renderer/processors → dom/nodes/datatypes}/Color.js.map +1 -1
  267. package/lib/module/dom/nodes/datatypes/Enum.js +2 -0
  268. package/lib/module/dom/nodes/datatypes/Enum.js.map +1 -0
  269. package/lib/module/{renderer/components/image/BoxFit.js → dom/nodes/datatypes/Fitting.js} +2 -2
  270. package/lib/module/{renderer/components/image/BoxFit.js.map → dom/nodes/datatypes/Fitting.js.map} +1 -1
  271. package/lib/module/dom/nodes/datatypes/Gradient.js +47 -0
  272. package/lib/module/dom/nodes/datatypes/Gradient.js.map +1 -0
  273. package/lib/module/{renderer/processors/Paths.js → dom/nodes/datatypes/Path.js} +2 -2
  274. package/lib/module/dom/nodes/datatypes/Path.js.map +1 -0
  275. package/lib/module/{renderer/processors → dom/nodes/datatypes}/Radius.js +0 -0
  276. package/lib/module/dom/nodes/datatypes/Radius.js.map +1 -0
  277. package/lib/module/{renderer/processors/Rects.js → dom/nodes/datatypes/Rect.js} +1 -1
  278. package/lib/module/dom/nodes/datatypes/Rect.js.map +1 -0
  279. package/lib/module/dom/nodes/datatypes/Transform.js +32 -0
  280. package/lib/module/dom/nodes/datatypes/Transform.js.map +1 -0
  281. package/lib/module/dom/nodes/datatypes/index.js +10 -0
  282. package/lib/module/dom/nodes/datatypes/index.js.map +1 -0
  283. package/lib/module/dom/nodes/drawings/BackdropFilterNode.js +25 -0
  284. package/lib/module/dom/nodes/drawings/BackdropFilterNode.js.map +1 -0
  285. package/lib/module/dom/nodes/drawings/Box.js +89 -0
  286. package/lib/module/dom/nodes/drawings/Box.js.map +1 -0
  287. package/lib/module/dom/nodes/drawings/CircleNode.js +31 -0
  288. package/lib/module/dom/nodes/drawings/CircleNode.js.map +1 -0
  289. package/lib/module/dom/nodes/drawings/CustomDrawingNode.js +17 -0
  290. package/lib/module/dom/nodes/drawings/CustomDrawingNode.js.map +1 -0
  291. package/lib/module/dom/nodes/drawings/DiffRectNode.js +25 -0
  292. package/lib/module/dom/nodes/drawings/DiffRectNode.js.map +1 -0
  293. package/lib/module/dom/nodes/drawings/FillNode.js +22 -0
  294. package/lib/module/dom/nodes/drawings/FillNode.js.map +1 -0
  295. package/lib/module/dom/nodes/drawings/ImageNode.js +51 -0
  296. package/lib/module/dom/nodes/drawings/ImageNode.js.map +1 -0
  297. package/lib/module/dom/nodes/drawings/ImageSVG.js +33 -0
  298. package/lib/module/dom/nodes/drawings/ImageSVG.js.map +1 -0
  299. package/lib/module/dom/nodes/drawings/LineNode.js +25 -0
  300. package/lib/module/dom/nodes/drawings/LineNode.js.map +1 -0
  301. package/lib/module/dom/nodes/drawings/OvalNode.js +27 -0
  302. package/lib/module/dom/nodes/drawings/OvalNode.js.map +1 -0
  303. package/lib/module/dom/nodes/drawings/PatchNode.js +56 -0
  304. package/lib/module/dom/nodes/drawings/PatchNode.js.map +1 -0
  305. package/lib/module/dom/nodes/drawings/PathNode.js +55 -0
  306. package/lib/module/dom/nodes/drawings/PathNode.js.map +1 -0
  307. package/lib/module/dom/nodes/drawings/PictureNode.js +23 -0
  308. package/lib/module/dom/nodes/drawings/PictureNode.js.map +1 -0
  309. package/lib/module/dom/nodes/drawings/PointsNode.js +27 -0
  310. package/lib/module/dom/nodes/drawings/PointsNode.js.map +1 -0
  311. package/lib/module/dom/nodes/drawings/RRectNode.js +31 -0
  312. package/lib/module/dom/nodes/drawings/RRectNode.js.map +1 -0
  313. package/lib/module/dom/nodes/drawings/RectNode.js +27 -0
  314. package/lib/module/dom/nodes/drawings/RectNode.js.map +1 -0
  315. package/lib/module/dom/nodes/drawings/Text.js +164 -0
  316. package/lib/module/dom/nodes/drawings/Text.js.map +1 -0
  317. package/lib/module/dom/nodes/drawings/VerticesNode.js +42 -0
  318. package/lib/module/dom/nodes/drawings/VerticesNode.js.map +1 -0
  319. package/lib/module/dom/nodes/drawings/index.js +19 -0
  320. package/lib/module/dom/nodes/drawings/index.js.map +1 -0
  321. package/lib/module/dom/nodes/index.js +4 -0
  322. package/lib/module/dom/nodes/index.js.map +1 -0
  323. package/lib/module/dom/nodes/paint/BlendNode.js +66 -0
  324. package/lib/module/dom/nodes/paint/BlendNode.js.map +1 -0
  325. package/lib/module/dom/nodes/paint/ColorFilters.js +120 -0
  326. package/lib/module/dom/nodes/paint/ColorFilters.js.map +1 -0
  327. package/lib/module/dom/nodes/paint/ImageFilters.js +191 -0
  328. package/lib/module/dom/nodes/paint/ImageFilters.js.map +1 -0
  329. package/lib/module/dom/nodes/paint/MaskFilters.js +20 -0
  330. package/lib/module/dom/nodes/paint/MaskFilters.js.map +1 -0
  331. package/lib/module/dom/nodes/paint/PathEffects.js +192 -0
  332. package/lib/module/dom/nodes/paint/PathEffects.js.map +1 -0
  333. package/lib/module/dom/nodes/paint/Shaders.js +201 -0
  334. package/lib/module/dom/nodes/paint/Shaders.js.map +1 -0
  335. package/lib/module/dom/nodes/paint/index.js +7 -0
  336. package/lib/module/dom/nodes/paint/index.js.map +1 -0
  337. package/lib/module/dom/types/ColorFilters.js +2 -0
  338. package/lib/module/dom/types/ColorFilters.js.map +1 -0
  339. package/lib/module/dom/types/Common.js +2 -0
  340. package/lib/module/dom/types/Common.js.map +1 -0
  341. package/lib/module/dom/types/DrawingContext.js +2 -0
  342. package/lib/module/dom/types/DrawingContext.js.map +1 -0
  343. package/lib/module/dom/types/Drawings.js +2 -0
  344. package/lib/module/dom/types/Drawings.js.map +1 -0
  345. package/lib/module/dom/types/ImageFilters.js +2 -0
  346. package/lib/module/dom/types/ImageFilters.js.map +1 -0
  347. package/lib/module/dom/types/MaskFilters.js +2 -0
  348. package/lib/module/dom/types/MaskFilters.js.map +1 -0
  349. package/lib/module/dom/types/Node.js +2 -0
  350. package/lib/module/dom/types/Node.js.map +1 -0
  351. package/lib/module/dom/types/NodeType.js +72 -0
  352. package/lib/module/dom/types/NodeType.js.map +1 -0
  353. package/lib/module/dom/types/PathEffects.js +2 -0
  354. package/lib/module/dom/types/PathEffects.js.map +1 -0
  355. package/lib/module/dom/types/Shaders.js +2 -0
  356. package/lib/module/dom/types/Shaders.js.map +1 -0
  357. package/lib/module/dom/types/SkDOM.js +2 -0
  358. package/lib/module/dom/types/SkDOM.js.map +1 -0
  359. package/lib/module/dom/types/index.js +12 -0
  360. package/lib/module/dom/types/index.js.map +1 -0
  361. package/lib/module/index.js +2 -0
  362. package/lib/module/index.js.map +1 -1
  363. package/lib/module/renderer/Canvas.js +7 -3
  364. package/lib/module/renderer/Canvas.js.map +1 -1
  365. package/lib/module/renderer/Container.js +29 -0
  366. package/lib/module/renderer/Container.js.map +1 -0
  367. package/lib/module/renderer/DependencyManager.js +17 -5
  368. package/lib/module/renderer/DependencyManager.js.map +1 -1
  369. package/lib/module/renderer/HostComponents.js +185 -0
  370. package/lib/module/renderer/HostComponents.js.map +1 -0
  371. package/lib/module/renderer/HostConfig.js +47 -126
  372. package/lib/module/renderer/HostConfig.js.map +1 -1
  373. package/lib/module/renderer/components/Blend.js +1 -42
  374. package/lib/module/renderer/components/Blend.js.map +1 -1
  375. package/lib/module/renderer/components/Drawing.js +1 -13
  376. package/lib/module/renderer/components/Drawing.js.map +1 -1
  377. package/lib/module/renderer/components/Group.js +1 -65
  378. package/lib/module/renderer/components/Group.js.map +1 -1
  379. package/lib/module/renderer/components/Paint.js +3 -12
  380. package/lib/module/renderer/components/Paint.js.map +1 -1
  381. package/lib/module/renderer/components/Picture.js +1 -17
  382. package/lib/module/renderer/components/Picture.js.map +1 -1
  383. package/lib/module/renderer/components/backdrop/BackdropBlur.js.map +1 -1
  384. package/lib/module/renderer/components/backdrop/BackdropFilter.js +2 -30
  385. package/lib/module/renderer/components/backdrop/BackdropFilter.js.map +1 -1
  386. package/lib/module/renderer/components/colorFilters/BlendColor.js +1 -20
  387. package/lib/module/renderer/components/colorFilters/BlendColor.js.map +1 -1
  388. package/lib/module/renderer/components/colorFilters/Lerp.js +1 -19
  389. package/lib/module/renderer/components/colorFilters/Lerp.js.map +1 -1
  390. package/lib/module/renderer/components/colorFilters/LinearToSRGBGamma.js +1 -15
  391. package/lib/module/renderer/components/colorFilters/LinearToSRGBGamma.js.map +1 -1
  392. package/lib/module/renderer/components/colorFilters/LumaColorFilter.js +1 -15
  393. package/lib/module/renderer/components/colorFilters/LumaColorFilter.js.map +1 -1
  394. package/lib/module/renderer/components/colorFilters/Matrix.js +1 -17
  395. package/lib/module/renderer/components/colorFilters/Matrix.js.map +1 -1
  396. package/lib/module/renderer/components/colorFilters/SRGBToLinearGamma.js +1 -15
  397. package/lib/module/renderer/components/colorFilters/SRGBToLinearGamma.js.map +1 -1
  398. package/lib/module/renderer/components/image/Image.js +1 -31
  399. package/lib/module/renderer/components/image/Image.js.map +1 -1
  400. package/lib/module/renderer/components/image/ImageSVG.js +1 -27
  401. package/lib/module/renderer/components/image/ImageSVG.js.map +1 -1
  402. package/lib/module/renderer/components/image/ImageShader.js +1 -57
  403. package/lib/module/renderer/components/image/ImageShader.js.map +1 -1
  404. package/lib/module/renderer/components/image/index.js +0 -1
  405. package/lib/module/renderer/components/image/index.js.map +1 -1
  406. package/lib/module/renderer/components/imageFilters/Blur.js +1 -21
  407. package/lib/module/renderer/components/imageFilters/Blur.js.map +1 -1
  408. package/lib/module/renderer/components/imageFilters/DisplacementMap.js +1 -30
  409. package/lib/module/renderer/components/imageFilters/DisplacementMap.js.map +1 -1
  410. package/lib/module/renderer/components/imageFilters/Morphology.js +1 -21
  411. package/lib/module/renderer/components/imageFilters/Morphology.js.map +1 -1
  412. package/lib/module/renderer/components/imageFilters/Offset.js +1 -17
  413. package/lib/module/renderer/components/imageFilters/Offset.js.map +1 -1
  414. package/lib/module/renderer/components/imageFilters/RuntimeShader.js +1 -24
  415. package/lib/module/renderer/components/imageFilters/RuntimeShader.js.map +1 -1
  416. package/lib/module/renderer/components/imageFilters/Shadow.js +1 -34
  417. package/lib/module/renderer/components/imageFilters/Shadow.js.map +1 -1
  418. package/lib/module/renderer/components/index.js +0 -1
  419. package/lib/module/renderer/components/index.js.map +1 -1
  420. package/lib/module/renderer/components/maskFilters/Blur.js +1 -19
  421. package/lib/module/renderer/components/maskFilters/Blur.js.map +1 -1
  422. package/lib/module/renderer/components/pathEffects/Corner.js +1 -27
  423. package/lib/module/renderer/components/pathEffects/Corner.js.map +1 -1
  424. package/lib/module/renderer/components/pathEffects/Dash.js +1 -24
  425. package/lib/module/renderer/components/pathEffects/Dash.js.map +1 -1
  426. package/lib/module/renderer/components/pathEffects/Discrete.js +1 -25
  427. package/lib/module/renderer/components/pathEffects/Discrete.js.map +1 -1
  428. package/lib/module/renderer/components/pathEffects/Line2D.js +1 -28
  429. package/lib/module/renderer/components/pathEffects/Line2D.js.map +1 -1
  430. package/lib/module/renderer/components/pathEffects/Path1D.js +1 -32
  431. package/lib/module/renderer/components/pathEffects/Path1D.js.map +1 -1
  432. package/lib/module/renderer/components/pathEffects/Path2D.js +1 -29
  433. package/lib/module/renderer/components/pathEffects/Path2D.js.map +1 -1
  434. package/lib/module/renderer/components/pathEffects/Sum.js +1 -14
  435. package/lib/module/renderer/components/pathEffects/Sum.js.map +1 -1
  436. package/lib/module/renderer/components/shaders/Color.js +1 -16
  437. package/lib/module/renderer/components/shaders/Color.js.map +1 -1
  438. package/lib/module/renderer/components/shaders/FractalNoise.js +1 -20
  439. package/lib/module/renderer/components/shaders/FractalNoise.js.map +1 -1
  440. package/lib/module/renderer/components/shaders/LinearGradient.js +1 -25
  441. package/lib/module/renderer/components/shaders/LinearGradient.js.map +1 -1
  442. package/lib/module/renderer/components/shaders/RadialGradient.js +1 -25
  443. package/lib/module/renderer/components/shaders/RadialGradient.js.map +1 -1
  444. package/lib/module/renderer/components/shaders/Shader.js +1 -19
  445. package/lib/module/renderer/components/shaders/Shader.js.map +1 -1
  446. package/lib/module/renderer/components/shaders/SweepGradient.js +1 -26
  447. package/lib/module/renderer/components/shaders/SweepGradient.js.map +1 -1
  448. package/lib/module/renderer/components/shaders/Turbulence.js +1 -20
  449. package/lib/module/renderer/components/shaders/Turbulence.js.map +1 -1
  450. package/lib/module/renderer/components/shaders/TwoPointConicalGradient.js +1 -27
  451. package/lib/module/renderer/components/shaders/TwoPointConicalGradient.js.map +1 -1
  452. package/lib/module/renderer/components/shapes/Box.js +2 -97
  453. package/lib/module/renderer/components/shapes/Box.js.map +1 -1
  454. package/lib/module/renderer/components/shapes/Circle.js +1 -19
  455. package/lib/module/renderer/components/shapes/Circle.js.map +1 -1
  456. package/lib/module/renderer/components/shapes/DiffRect.js +1 -17
  457. package/lib/module/renderer/components/shapes/DiffRect.js.map +1 -1
  458. package/lib/module/renderer/components/shapes/Fill.js +1 -13
  459. package/lib/module/renderer/components/shapes/Fill.js.map +1 -1
  460. package/lib/module/renderer/components/shapes/FitBox.js +1 -1
  461. package/lib/module/renderer/components/shapes/FitBox.js.map +1 -1
  462. package/lib/module/renderer/components/shapes/Line.js +1 -17
  463. package/lib/module/renderer/components/shapes/Line.js.map +1 -1
  464. package/lib/module/renderer/components/shapes/Oval.js +1 -16
  465. package/lib/module/renderer/components/shapes/Oval.js.map +1 -1
  466. package/lib/module/renderer/components/shapes/Patch.js +1 -32
  467. package/lib/module/renderer/components/shapes/Patch.js.map +1 -1
  468. package/lib/module/renderer/components/shapes/Path.js +1 -43
  469. package/lib/module/renderer/components/shapes/Path.js.map +1 -1
  470. package/lib/module/renderer/components/shapes/Points.js +1 -20
  471. package/lib/module/renderer/components/shapes/Points.js.map +1 -1
  472. package/lib/module/renderer/components/shapes/Rect.js +1 -16
  473. package/lib/module/renderer/components/shapes/Rect.js.map +1 -1
  474. package/lib/module/renderer/components/shapes/RoundedRect.js +1 -16
  475. package/lib/module/renderer/components/shapes/RoundedRect.js.map +1 -1
  476. package/lib/module/renderer/components/shapes/Vertices.js +1 -31
  477. package/lib/module/renderer/components/shapes/Vertices.js.map +1 -1
  478. package/lib/module/renderer/components/text/Glyphs.js +1 -37
  479. package/lib/module/renderer/components/text/Glyphs.js.map +1 -1
  480. package/lib/module/renderer/components/text/Text.js +1 -22
  481. package/lib/module/renderer/components/text/Text.js.map +1 -1
  482. package/lib/module/renderer/components/text/TextBlob.js +1 -18
  483. package/lib/module/renderer/components/text/TextBlob.js.map +1 -1
  484. package/lib/module/renderer/components/text/TextPath.js +1 -69
  485. package/lib/module/renderer/components/text/TextPath.js.map +1 -1
  486. package/lib/module/renderer/index.js +0 -1
  487. package/lib/module/renderer/index.js.map +1 -1
  488. package/lib/module/renderer/processors/Animations/Animations.js.map +1 -1
  489. package/lib/module/renderer/processors/index.js +0 -9
  490. package/lib/module/renderer/processors/index.js.map +1 -1
  491. package/lib/module/skia/core/Data.js +11 -2
  492. package/lib/module/skia/core/Data.js.map +1 -1
  493. package/lib/module/web/WithSkiaWeb.js +3 -1
  494. package/lib/module/web/WithSkiaWeb.js.map +1 -1
  495. package/lib/typescript/src/dom/nodes/DrawingNode.d.ts +14 -0
  496. package/lib/typescript/src/dom/nodes/GroupNode.d.ts +8 -0
  497. package/lib/typescript/src/dom/nodes/JsiSkDOM.d.ts +70 -0
  498. package/lib/typescript/src/dom/nodes/Node.d.ts +43 -0
  499. package/lib/typescript/src/dom/nodes/PaintContext.d.ts +18 -0
  500. package/lib/typescript/src/dom/nodes/PaintNode.d.ts +8 -0
  501. package/lib/typescript/src/dom/nodes/RenderNode.d.ts +29 -0
  502. package/lib/typescript/src/dom/nodes/datatypes/Circle.d.ts +4 -0
  503. package/lib/typescript/src/{renderer/processors → dom/nodes/datatypes}/Color.d.ts +1 -1
  504. package/lib/typescript/src/dom/nodes/datatypes/Enum.d.ts +1 -0
  505. package/lib/typescript/src/{renderer/components/image/BoxFit.d.ts → dom/nodes/datatypes/Fitting.d.ts} +1 -1
  506. package/lib/typescript/src/{renderer/processors/Transform.d.ts → dom/nodes/datatypes/Gradient.d.ts} +11 -9
  507. package/lib/typescript/src/dom/nodes/datatypes/Path.d.ts +4 -0
  508. package/lib/typescript/src/dom/nodes/datatypes/Radius.d.ts +3 -0
  509. package/lib/typescript/src/dom/nodes/datatypes/Rect.d.ts +5 -0
  510. package/lib/typescript/src/dom/nodes/datatypes/Transform.d.ts +3 -0
  511. package/lib/typescript/src/dom/nodes/datatypes/index.d.ts +9 -0
  512. package/lib/typescript/src/dom/nodes/drawings/BackdropFilterNode.d.ts +8 -0
  513. package/lib/typescript/src/dom/nodes/drawings/Box.d.ts +13 -0
  514. package/lib/typescript/src/dom/nodes/drawings/CircleNode.d.ts +9 -0
  515. package/lib/typescript/src/dom/nodes/drawings/CustomDrawingNode.d.ts +8 -0
  516. package/lib/typescript/src/dom/nodes/drawings/DiffRectNode.d.ts +8 -0
  517. package/lib/typescript/src/dom/nodes/drawings/FillNode.d.ts +8 -0
  518. package/lib/typescript/src/dom/nodes/drawings/ImageNode.d.ts +25 -0
  519. package/lib/typescript/src/dom/nodes/drawings/ImageSVG.d.ts +8 -0
  520. package/lib/typescript/src/dom/nodes/drawings/LineNode.d.ts +8 -0
  521. package/lib/typescript/src/dom/nodes/drawings/OvalNode.d.ts +9 -0
  522. package/lib/typescript/src/dom/nodes/drawings/PatchNode.d.ts +18 -0
  523. package/lib/typescript/src/dom/nodes/drawings/PathNode.d.ts +9 -0
  524. package/lib/typescript/src/dom/nodes/drawings/PictureNode.d.ts +8 -0
  525. package/lib/typescript/src/dom/nodes/drawings/PointsNode.d.ts +8 -0
  526. package/lib/typescript/src/dom/nodes/drawings/RRectNode.d.ts +10 -0
  527. package/lib/typescript/src/dom/nodes/drawings/RectNode.d.ts +9 -0
  528. package/lib/typescript/src/dom/nodes/drawings/Text.d.ts +30 -0
  529. package/lib/typescript/src/dom/nodes/drawings/VerticesNode.d.ts +9 -0
  530. package/lib/typescript/src/dom/nodes/drawings/index.d.ts +18 -0
  531. package/lib/typescript/src/dom/nodes/index.d.ts +3 -0
  532. package/lib/typescript/src/dom/nodes/paint/BlendNode.d.ts +12 -0
  533. package/lib/typescript/src/dom/nodes/paint/ColorFilters.d.ts +36 -0
  534. package/lib/typescript/src/dom/nodes/paint/ImageFilters.d.ts +42 -0
  535. package/lib/typescript/src/dom/nodes/paint/MaskFilters.d.ts +8 -0
  536. package/lib/typescript/src/dom/nodes/paint/PathEffects.d.ts +42 -0
  537. package/lib/typescript/src/dom/nodes/paint/Shaders.d.ts +44 -0
  538. package/lib/typescript/src/dom/nodes/paint/index.d.ts +6 -0
  539. package/lib/typescript/src/dom/types/ColorFilters.d.ts +12 -0
  540. package/lib/typescript/src/dom/types/Common.d.ts +57 -0
  541. package/lib/typescript/src/dom/types/DrawingContext.d.ts +6 -0
  542. package/lib/typescript/src/dom/types/Drawings.d.ts +106 -0
  543. package/lib/typescript/src/dom/types/ImageFilters.d.ts +37 -0
  544. package/lib/typescript/src/dom/types/MaskFilters.d.ts +7 -0
  545. package/lib/typescript/src/dom/types/Node.d.ts +29 -0
  546. package/lib/typescript/src/dom/types/NodeType.d.ts +66 -0
  547. package/lib/typescript/src/dom/types/PathEffects.d.ts +28 -0
  548. package/lib/typescript/src/dom/types/Shaders.d.ts +59 -0
  549. package/lib/typescript/src/dom/types/SkDOM.d.ts +71 -0
  550. package/lib/typescript/src/dom/types/index.d.ts +11 -0
  551. package/lib/typescript/src/index.d.ts +2 -0
  552. package/lib/typescript/src/renderer/Canvas.d.ts +3 -3
  553. package/lib/typescript/src/renderer/Container.d.ts +12 -0
  554. package/lib/typescript/src/renderer/DependencyManager.d.ts +5 -4
  555. package/lib/typescript/src/renderer/HostComponents.d.ts +72 -0
  556. package/lib/typescript/src/renderer/HostConfig.d.ts +5 -13
  557. package/lib/typescript/src/renderer/components/Blend.d.ts +4 -9
  558. package/lib/typescript/src/renderer/components/Drawing.d.ts +2 -6
  559. package/lib/typescript/src/renderer/components/Group.d.ts +4 -9
  560. package/lib/typescript/src/renderer/components/Paint.d.ts +4 -8
  561. package/lib/typescript/src/renderer/components/Picture.d.ts +3 -5
  562. package/lib/typescript/src/renderer/components/backdrop/BackdropBlur.d.ts +2 -1
  563. package/lib/typescript/src/renderer/components/backdrop/BackdropFilter.d.ts +3 -3
  564. package/lib/typescript/src/renderer/components/colorFilters/BlendColor.d.ts +4 -10
  565. package/lib/typescript/src/renderer/components/colorFilters/Lerp.d.ts +4 -7
  566. package/lib/typescript/src/renderer/components/colorFilters/LinearToSRGBGamma.d.ts +3 -4
  567. package/lib/typescript/src/renderer/components/colorFilters/LumaColorFilter.d.ts +3 -4
  568. package/lib/typescript/src/renderer/components/colorFilters/Matrix.d.ts +4 -8
  569. package/lib/typescript/src/renderer/components/colorFilters/SRGBToLinearGamma.d.ts +3 -4
  570. package/lib/typescript/src/renderer/components/image/Image.d.ts +3 -11
  571. package/lib/typescript/src/renderer/components/image/ImageSVG.d.ts +2 -5
  572. package/lib/typescript/src/renderer/components/image/ImageShader.d.ts +3 -15
  573. package/lib/typescript/src/renderer/components/image/index.d.ts +0 -1
  574. package/lib/typescript/src/renderer/components/imageFilters/Blur.d.ts +4 -10
  575. package/lib/typescript/src/renderer/components/imageFilters/DisplacementMap.d.ts +4 -10
  576. package/lib/typescript/src/renderer/components/imageFilters/Morphology.d.ts +4 -8
  577. package/lib/typescript/src/renderer/components/imageFilters/Offset.d.ts +4 -8
  578. package/lib/typescript/src/renderer/components/imageFilters/RuntimeShader.d.ts +3 -7
  579. package/lib/typescript/src/renderer/components/imageFilters/Shadow.d.ts +3 -11
  580. package/lib/typescript/src/renderer/components/index.d.ts +0 -1
  581. package/lib/typescript/src/renderer/components/maskFilters/Blur.d.ts +3 -9
  582. package/lib/typescript/src/renderer/components/pathEffects/Corner.d.ts +4 -7
  583. package/lib/typescript/src/renderer/components/pathEffects/Dash.d.ts +4 -8
  584. package/lib/typescript/src/renderer/components/pathEffects/Discrete.d.ts +4 -9
  585. package/lib/typescript/src/renderer/components/pathEffects/Line2D.d.ts +4 -9
  586. package/lib/typescript/src/renderer/components/pathEffects/Path1D.d.ts +4 -13
  587. package/lib/typescript/src/renderer/components/pathEffects/Path2D.d.ts +4 -10
  588. package/lib/typescript/src/renderer/components/pathEffects/Sum.d.ts +3 -6
  589. package/lib/typescript/src/renderer/components/shaders/Color.d.ts +3 -6
  590. package/lib/typescript/src/renderer/components/shaders/FractalNoise.d.ts +3 -10
  591. package/lib/typescript/src/renderer/components/shaders/LinearGradient.d.ts +3 -8
  592. package/lib/typescript/src/renderer/components/shaders/RadialGradient.d.ts +3 -8
  593. package/lib/typescript/src/renderer/components/shaders/Shader.d.ts +4 -9
  594. package/lib/typescript/src/renderer/components/shaders/SweepGradient.d.ts +3 -9
  595. package/lib/typescript/src/renderer/components/shaders/Turbulence.d.ts +3 -10
  596. package/lib/typescript/src/renderer/components/shaders/TwoPointConicalGradient.d.ts +3 -10
  597. package/lib/typescript/src/renderer/components/shapes/Box.d.ts +4 -21
  598. package/lib/typescript/src/renderer/components/shapes/Circle.d.ts +3 -3
  599. package/lib/typescript/src/renderer/components/shapes/DiffRect.d.ts +3 -8
  600. package/lib/typescript/src/renderer/components/shapes/Fill.d.ts +3 -4
  601. package/lib/typescript/src/renderer/components/shapes/FitBox.d.ts +1 -1
  602. package/lib/typescript/src/renderer/components/shapes/Line.d.ts +3 -7
  603. package/lib/typescript/src/renderer/components/shapes/Oval.d.ts +3 -3
  604. package/lib/typescript/src/renderer/components/shapes/Patch.d.ts +3 -20
  605. package/lib/typescript/src/renderer/components/shapes/Path.d.ts +3 -16
  606. package/lib/typescript/src/renderer/components/shapes/Points.d.ts +3 -9
  607. package/lib/typescript/src/renderer/components/shapes/Rect.d.ts +3 -3
  608. package/lib/typescript/src/renderer/components/shapes/RoundedRect.d.ts +3 -3
  609. package/lib/typescript/src/renderer/components/shapes/Vertices.d.ts +3 -12
  610. package/lib/typescript/src/renderer/components/text/Glyphs.d.ts +3 -13
  611. package/lib/typescript/src/renderer/components/text/Text.d.ts +3 -8
  612. package/lib/typescript/src/renderer/components/text/TextBlob.d.ts +3 -8
  613. package/lib/typescript/src/renderer/components/text/TextPath.d.ts +3 -9
  614. package/lib/typescript/src/renderer/index.d.ts +0 -1
  615. package/lib/typescript/src/renderer/processors/Animations/Animations.d.ts +1 -0
  616. package/lib/typescript/src/renderer/processors/index.d.ts +0 -9
  617. package/package.json +1 -1
  618. package/src/dom/nodes/DrawingNode.ts +72 -0
  619. package/src/dom/nodes/GroupNode.ts +23 -0
  620. package/src/dom/nodes/JsiSkDOM.ts +353 -0
  621. package/src/dom/nodes/Node.ts +158 -0
  622. package/src/dom/nodes/PaintContext.ts +30 -0
  623. package/src/dom/nodes/PaintNode.ts +77 -0
  624. package/src/dom/nodes/RenderNode.ts +349 -0
  625. package/src/{renderer/processors/Circles.ts → dom/nodes/datatypes/Circle.ts} +3 -15
  626. package/src/{renderer/processors → dom/nodes/datatypes}/Color.ts +1 -1
  627. package/src/dom/nodes/datatypes/Enum.ts +2 -0
  628. package/src/{renderer/components/image/BoxFit.ts → dom/nodes/datatypes/Fitting.ts} +2 -11
  629. package/src/dom/nodes/datatypes/Gradient.ts +48 -0
  630. package/src/{renderer/processors/Paths.ts → dom/nodes/datatypes/Path.ts} +3 -4
  631. package/src/{renderer/processors → dom/nodes/datatypes}/Radius.ts +2 -3
  632. package/src/{renderer/processors/Rects.ts → dom/nodes/datatypes/Rect.ts} +2 -16
  633. package/src/dom/nodes/datatypes/Transform.ts +26 -0
  634. package/src/dom/nodes/datatypes/index.ts +9 -0
  635. package/src/dom/nodes/drawings/BackdropFilterNode.ts +30 -0
  636. package/src/dom/nodes/drawings/Box.ts +105 -0
  637. package/src/dom/nodes/drawings/CircleNode.ts +24 -0
  638. package/src/dom/nodes/drawings/CustomDrawingNode.ts +21 -0
  639. package/src/dom/nodes/drawings/DiffRectNode.ts +19 -0
  640. package/src/dom/nodes/drawings/FillNode.ts +18 -0
  641. package/src/dom/nodes/drawings/ImageNode.ts +40 -0
  642. package/src/dom/nodes/drawings/ImageSVG.ts +24 -0
  643. package/src/dom/nodes/drawings/LineNode.ts +19 -0
  644. package/src/dom/nodes/drawings/OvalNode.ts +23 -0
  645. package/src/dom/nodes/drawings/PatchNode.ts +68 -0
  646. package/src/dom/nodes/drawings/PathNode.ts +42 -0
  647. package/src/dom/nodes/drawings/PictureNode.ts +19 -0
  648. package/src/dom/nodes/drawings/PointsNode.ts +21 -0
  649. package/src/dom/nodes/drawings/RRectNode.ts +25 -0
  650. package/src/dom/nodes/drawings/RectNode.ts +23 -0
  651. package/src/dom/nodes/drawings/Text.ts +122 -0
  652. package/src/dom/nodes/drawings/VerticesNode.ts +35 -0
  653. package/src/dom/nodes/drawings/index.ts +18 -0
  654. package/src/dom/nodes/index.ts +3 -0
  655. package/src/dom/nodes/paint/BlendNode.ts +79 -0
  656. package/src/dom/nodes/paint/ColorFilters.ts +130 -0
  657. package/src/dom/nodes/paint/ImageFilters.ts +210 -0
  658. package/src/dom/nodes/paint/MaskFilters.ts +25 -0
  659. package/src/dom/nodes/paint/PathEffects.ts +192 -0
  660. package/src/dom/nodes/paint/Shaders.ts +228 -0
  661. package/src/dom/nodes/paint/index.ts +6 -0
  662. package/src/dom/types/ColorFilters.ts +16 -0
  663. package/src/dom/types/Common.ts +90 -0
  664. package/src/dom/types/DrawingContext.ts +7 -0
  665. package/src/dom/types/Drawings.ts +157 -0
  666. package/src/dom/types/ImageFilters.ts +53 -0
  667. package/src/dom/types/MaskFilters.ts +9 -0
  668. package/src/dom/types/Node.ts +46 -0
  669. package/src/dom/types/NodeType.ts +80 -0
  670. package/src/dom/types/PathEffects.ts +35 -0
  671. package/src/dom/types/Shaders.ts +86 -0
  672. package/src/dom/types/SkDOM.ts +202 -0
  673. package/src/dom/types/index.ts +11 -0
  674. package/src/index.ts +2 -0
  675. package/src/renderer/Canvas.tsx +7 -6
  676. package/src/renderer/Container.tsx +31 -0
  677. package/src/renderer/DependencyManager.tsx +23 -15
  678. package/src/renderer/HostComponents.ts +269 -0
  679. package/src/renderer/HostConfig.ts +60 -123
  680. package/src/renderer/components/Blend.tsx +4 -45
  681. package/src/renderer/components/Drawing.tsx +3 -12
  682. package/src/renderer/components/Group.tsx +4 -79
  683. package/src/renderer/components/Paint.tsx +7 -24
  684. package/src/renderer/components/Picture.tsx +4 -13
  685. package/src/renderer/components/backdrop/BackdropBlur.tsx +2 -1
  686. package/src/renderer/components/backdrop/BackdropFilter.tsx +5 -29
  687. package/src/renderer/components/colorFilters/BlendColor.tsx +4 -26
  688. package/src/renderer/components/colorFilters/Lerp.tsx +4 -23
  689. package/src/renderer/components/colorFilters/LinearToSRGBGamma.tsx +4 -16
  690. package/src/renderer/components/colorFilters/LumaColorFilter.tsx +4 -14
  691. package/src/renderer/components/colorFilters/Matrix.tsx +4 -19
  692. package/src/renderer/components/colorFilters/SRGBToLinearGamma.tsx +4 -16
  693. package/src/renderer/components/image/Image.tsx +4 -40
  694. package/src/renderer/components/image/ImageSVG.tsx +3 -19
  695. package/src/renderer/components/image/ImageShader.tsx +4 -69
  696. package/src/renderer/components/image/index.ts +0 -1
  697. package/src/renderer/components/imageFilters/Blur.tsx +4 -29
  698. package/src/renderer/components/imageFilters/DisplacementMap.tsx +6 -30
  699. package/src/renderer/components/imageFilters/Morphology.tsx +4 -25
  700. package/src/renderer/components/imageFilters/Offset.tsx +4 -19
  701. package/src/renderer/components/imageFilters/RuntimeShader.tsx +6 -27
  702. package/src/renderer/components/imageFilters/Shadow.tsx +4 -38
  703. package/src/renderer/components/index.ts +0 -1
  704. package/src/renderer/components/maskFilters/Blur.tsx +4 -23
  705. package/src/renderer/components/pathEffects/Corner.tsx +4 -27
  706. package/src/renderer/components/pathEffects/Dash.tsx +4 -23
  707. package/src/renderer/components/pathEffects/Discrete.tsx +4 -24
  708. package/src/renderer/components/pathEffects/Line2D.tsx +4 -29
  709. package/src/renderer/components/pathEffects/Path1D.tsx +4 -39
  710. package/src/renderer/components/pathEffects/Path2D.tsx +4 -31
  711. package/src/renderer/components/pathEffects/Sum.tsx +3 -17
  712. package/src/renderer/components/shaders/Color.tsx +4 -16
  713. package/src/renderer/components/shaders/FractalNoise.tsx +4 -26
  714. package/src/renderer/components/shaders/LinearGradient.tsx +4 -29
  715. package/src/renderer/components/shaders/RadialGradient.tsx +4 -29
  716. package/src/renderer/components/shaders/Shader.tsx +4 -24
  717. package/src/renderer/components/shaders/SweepGradient.tsx +4 -32
  718. package/src/renderer/components/shaders/Turbulence.tsx +4 -26
  719. package/src/renderer/components/shaders/TwoPointConicalGradient.tsx +4 -33
  720. package/src/renderer/components/shapes/Box.tsx +6 -109
  721. package/src/renderer/components/shapes/Circle.tsx +4 -16
  722. package/src/renderer/components/shapes/DiffRect.tsx +4 -17
  723. package/src/renderer/components/shapes/Fill.tsx +4 -11
  724. package/src/renderer/components/shapes/FitBox.tsx +2 -2
  725. package/src/renderer/components/shapes/Line.tsx +4 -13
  726. package/src/renderer/components/shapes/Oval.tsx +4 -18
  727. package/src/renderer/components/shapes/Patch.tsx +4 -59
  728. package/src/renderer/components/shapes/Path.tsx +4 -48
  729. package/src/renderer/components/shapes/Points.tsx +4 -20
  730. package/src/renderer/components/shapes/Rect.tsx +4 -18
  731. package/src/renderer/components/shapes/RoundedRect.tsx +4 -17
  732. package/src/renderer/components/shapes/Vertices.tsx +4 -37
  733. package/src/renderer/components/text/Glyphs.tsx +4 -39
  734. package/src/renderer/components/text/Text.tsx +4 -22
  735. package/src/renderer/components/text/TextBlob.tsx +4 -17
  736. package/src/renderer/components/text/TextPath.tsx +4 -59
  737. package/src/renderer/index.ts +0 -1
  738. package/src/renderer/processors/Animations/Animations.ts +5 -0
  739. package/src/renderer/processors/index.ts +0 -9
  740. package/src/skia/core/Data.ts +11 -2
  741. package/src/web/WithSkiaWeb.tsx +3 -1
  742. package/lib/commonjs/renderer/components/Compose.js +0 -40
  743. package/lib/commonjs/renderer/components/Compose.js.map +0 -1
  744. package/lib/commonjs/renderer/components/colorFilters/Compose.js +0 -24
  745. package/lib/commonjs/renderer/components/colorFilters/Compose.js.map +0 -1
  746. package/lib/commonjs/renderer/components/imageFilters/InnerShadow.js +0 -28
  747. package/lib/commonjs/renderer/components/imageFilters/InnerShadow.js.map +0 -1
  748. package/lib/commonjs/renderer/components/imageFilters/getInput.js +0 -33
  749. package/lib/commonjs/renderer/components/imageFilters/getInput.js.map +0 -1
  750. package/lib/commonjs/renderer/components/shaders/Gradient.js +0 -32
  751. package/lib/commonjs/renderer/components/shaders/Gradient.js.map +0 -1
  752. package/lib/commonjs/renderer/nodes/Container.js +0 -28
  753. package/lib/commonjs/renderer/nodes/Container.js.map +0 -1
  754. package/lib/commonjs/renderer/nodes/Declaration.js +0 -57
  755. package/lib/commonjs/renderer/nodes/Declaration.js.map +0 -1
  756. package/lib/commonjs/renderer/nodes/Drawing.js +0 -56
  757. package/lib/commonjs/renderer/nodes/Drawing.js.map +0 -1
  758. package/lib/commonjs/renderer/nodes/Node.js +0 -73
  759. package/lib/commonjs/renderer/nodes/Node.js.map +0 -1
  760. package/lib/commonjs/renderer/nodes/index.js +0 -58
  761. package/lib/commonjs/renderer/nodes/index.js.map +0 -1
  762. package/lib/commonjs/renderer/processors/Circles.js.map +0 -1
  763. package/lib/commonjs/renderer/processors/Clips.js +0 -24
  764. package/lib/commonjs/renderer/processors/Clips.js.map +0 -1
  765. package/lib/commonjs/renderer/processors/Font.js +0 -13
  766. package/lib/commonjs/renderer/processors/Font.js.map +0 -1
  767. package/lib/commonjs/renderer/processors/Paint.js +0 -98
  768. package/lib/commonjs/renderer/processors/Paint.js.map +0 -1
  769. package/lib/commonjs/renderer/processors/Paths.js.map +0 -1
  770. package/lib/commonjs/renderer/processors/Radius.js.map +0 -1
  771. package/lib/commonjs/renderer/processors/Rects.js.map +0 -1
  772. package/lib/commonjs/renderer/processors/Transform.js +0 -58
  773. package/lib/commonjs/renderer/processors/Transform.js.map +0 -1
  774. package/lib/module/renderer/components/Compose.js +0 -25
  775. package/lib/module/renderer/components/Compose.js.map +0 -1
  776. package/lib/module/renderer/components/colorFilters/Compose.js +0 -14
  777. package/lib/module/renderer/components/colorFilters/Compose.js.map +0 -1
  778. package/lib/module/renderer/components/imageFilters/InnerShadow.js +0 -17
  779. package/lib/module/renderer/components/imageFilters/InnerShadow.js.map +0 -1
  780. package/lib/module/renderer/components/imageFilters/getInput.js +0 -23
  781. package/lib/module/renderer/components/imageFilters/getInput.js.map +0 -1
  782. package/lib/module/renderer/components/shaders/Gradient.js +0 -20
  783. package/lib/module/renderer/components/shaders/Gradient.js.map +0 -1
  784. package/lib/module/renderer/nodes/Container.js +0 -18
  785. package/lib/module/renderer/nodes/Container.js.map +0 -1
  786. package/lib/module/renderer/nodes/Declaration.js +0 -36
  787. package/lib/module/renderer/nodes/Declaration.js.map +0 -1
  788. package/lib/module/renderer/nodes/Drawing.js +0 -37
  789. package/lib/module/renderer/nodes/Drawing.js.map +0 -1
  790. package/lib/module/renderer/nodes/Node.js +0 -63
  791. package/lib/module/renderer/nodes/Node.js.map +0 -1
  792. package/lib/module/renderer/nodes/index.js +0 -5
  793. package/lib/module/renderer/nodes/index.js.map +0 -1
  794. package/lib/module/renderer/processors/Circles.js.map +0 -1
  795. package/lib/module/renderer/processors/Clips.js +0 -13
  796. package/lib/module/renderer/processors/Clips.js.map +0 -1
  797. package/lib/module/renderer/processors/Font.js +0 -4
  798. package/lib/module/renderer/processors/Font.js.map +0 -1
  799. package/lib/module/renderer/processors/Paint.js +0 -84
  800. package/lib/module/renderer/processors/Paint.js.map +0 -1
  801. package/lib/module/renderer/processors/Paths.js.map +0 -1
  802. package/lib/module/renderer/processors/Radius.js.map +0 -1
  803. package/lib/module/renderer/processors/Rects.js.map +0 -1
  804. package/lib/module/renderer/processors/Transform.js +0 -42
  805. package/lib/module/renderer/processors/Transform.js.map +0 -1
  806. package/lib/typescript/src/renderer/components/Compose.d.ts +0 -6
  807. package/lib/typescript/src/renderer/components/colorFilters/Compose.d.ts +0 -3
  808. package/lib/typescript/src/renderer/components/imageFilters/InnerShadow.d.ts +0 -2
  809. package/lib/typescript/src/renderer/components/imageFilters/getInput.d.ts +0 -3
  810. package/lib/typescript/src/renderer/components/shaders/Gradient.d.ts +0 -17
  811. package/lib/typescript/src/renderer/nodes/Container.d.ts +0 -8
  812. package/lib/typescript/src/renderer/nodes/Declaration.d.ts +0 -22
  813. package/lib/typescript/src/renderer/nodes/Drawing.d.ts +0 -21
  814. package/lib/typescript/src/renderer/nodes/Node.d.ts +0 -24
  815. package/lib/typescript/src/renderer/nodes/index.d.ts +0 -4
  816. package/lib/typescript/src/renderer/processors/Circles.d.ts +0 -13
  817. package/lib/typescript/src/renderer/processors/Clips.d.ts +0 -4
  818. package/lib/typescript/src/renderer/processors/Font.d.ts +0 -7
  819. package/lib/typescript/src/renderer/processors/Paint.d.ts +0 -22
  820. package/lib/typescript/src/renderer/processors/Paths.d.ts +0 -4
  821. package/lib/typescript/src/renderer/processors/Radius.d.ts +0 -3
  822. package/lib/typescript/src/renderer/processors/Rects.d.ts +0 -20
  823. package/src/renderer/components/Compose.tsx +0 -26
  824. package/src/renderer/components/colorFilters/Compose.ts +0 -18
  825. package/src/renderer/components/imageFilters/InnerShadow.tsx +0 -38
  826. package/src/renderer/components/imageFilters/getInput.ts +0 -20
  827. package/src/renderer/components/shaders/Gradient.ts +0 -24
  828. package/src/renderer/nodes/Container.tsx +0 -17
  829. package/src/renderer/nodes/Declaration.tsx +0 -65
  830. package/src/renderer/nodes/Drawing.tsx +0 -65
  831. package/src/renderer/nodes/Node.ts +0 -59
  832. package/src/renderer/nodes/index.ts +0 -4
  833. package/src/renderer/processors/Clips.ts +0 -23
  834. package/src/renderer/processors/Font.ts +0 -8
  835. package/src/renderer/processors/Paint.ts +0 -118
  836. package/src/renderer/processors/Transform.ts +0 -50
@@ -1 +1 @@
1
- {"version":3,"sources":["Oval.tsx"],"names":["React","processRect","createDrawing","onDraw","rectProps","canvas","paint","Skia","rect","drawOval","Oval","props","defaultProps","x","y"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAOA,SAASC,WAAT,QAA4B,kBAA5B;AACA,SAASC,aAAT,QAA8B,aAA9B;AAIA,MAAMC,MAAM,GAAGD,aAAa,CAC1B,OAA0BE,SAA1B,KAAwC;AAAA,MAAvC;AAAEC,IAAAA,MAAF;AAAUC,IAAAA,KAAV;AAAiBC,IAAAA;AAAjB,GAAuC;AACtC,QAAMC,IAAI,GAAGP,WAAW,CAACM,IAAD,EAAOH,SAAP,CAAxB;AACAC,EAAAA,MAAM,CAACI,QAAP,CAAgBD,IAAhB,EAAsBF,KAAtB;AACD,CAJyB,CAA5B;AAOA,OAAO,MAAMI,IAAI,GAAIC,KAAD,IAAqC;AACvD,sBAAO;AAAW,IAAA,MAAM,EAAER;AAAnB,KAA+BQ,KAA/B,EAAP;AACD,CAFM;AAIPD,IAAI,CAACE,YAAL,GAAoB;AAClBC,EAAAA,CAAC,EAAE,CADe;AAElBC,EAAAA,CAAC,EAAE;AAFe,CAApB","sourcesContent":["import React from \"react\";\n\nimport type {\n CustomPaintProps,\n RectDef,\n AnimatedProps,\n} from \"../../processors\";\nimport { processRect } from \"../../processors\";\nimport { createDrawing } from \"../../nodes\";\n\nexport type OvalProps = RectDef & CustomPaintProps;\n\nconst onDraw = createDrawing<OvalProps>(\n ({ canvas, paint, Skia }, rectProps) => {\n const rect = processRect(Skia, rectProps);\n canvas.drawOval(rect, paint);\n }\n);\n\nexport const Oval = (props: AnimatedProps<OvalProps>) => {\n return <skDrawing onDraw={onDraw} {...props} />;\n};\n\nOval.defaultProps = {\n x: 0,\n y: 0,\n};\n"]}
1
+ {"version":3,"sources":["Oval.tsx"],"names":["React","Oval","props","defaultProps","x","y"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAKA,OAAO,MAAMC,IAAI,GAAIC,KAAD,IAAiC;AACnD,sBAAO,8BAAYA,KAAZ,CAAP;AACD,CAFM;AAIPD,IAAI,CAACE,YAAL,GAAoB;AAClBC,EAAAA,CAAC,EAAE,CADe;AAElBC,EAAAA,CAAC,EAAE;AAFe,CAApB","sourcesContent":["import React from \"react\";\n\nimport type { OvalProps } from \"../../../dom/types\";\nimport type { SkiaProps } from \"../../processors\";\n\nexport const Oval = (props: SkiaProps<OvalProps>) => {\n return <skOval {...props} />;\n};\n\nOval.defaultProps = {\n x: 0,\n y: 0,\n};\n"]}
@@ -1,36 +1,5 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
3
1
  import React from "react";
4
- import { enumKey } from "../../processors";
5
- import { BlendMode } from "../../../skia/types";
6
- import { createDrawing } from "../../nodes";
7
- import { processColor } from "../../processors/Color";
8
- const onDraw = createDrawing((_ref, _ref2) => {
9
- let {
10
- canvas,
11
- paint,
12
- opacity,
13
- Skia
14
- } = _ref;
15
- let {
16
- colors,
17
- patch,
18
- texture,
19
- blendMode
20
- } = _ref2;
21
- // If the colors are provided, the default blendMode is set to dstOver, if not, the default is set to srcOver
22
- const defaultBlendMode = colors ? BlendMode.DstOver : BlendMode.SrcOver;
23
- const mode = blendMode ? BlendMode[enumKey(blendMode)] : defaultBlendMode;
24
- canvas.drawPatch( // Patch requires a path with the following constraints:
25
- // M tl
26
- // C c1 c2 br
27
- // C c1 c2 bl
28
- // C c1 c2 tl (the redundant point in the last command is removed)
29
- [patch[0].pos, patch[0].c2, patch[1].c1, patch[1].pos, patch[1].c2, patch[2].c1, patch[2].pos, patch[2].c2, patch[3].c1, patch[3].pos, patch[3].c2, patch[0].c1], colors ? colors.map(c => processColor(Skia, c, opacity)) : undefined, texture, mode, paint);
30
- });
31
2
  export const Patch = props => {
32
- return /*#__PURE__*/React.createElement("skDrawing", _extends({
33
- onDraw: onDraw
34
- }, props));
3
+ return /*#__PURE__*/React.createElement("skPatch", props);
35
4
  };
36
5
  //# sourceMappingURL=Patch.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["Patch.tsx"],"names":["React","enumKey","BlendMode","createDrawing","processColor","onDraw","canvas","paint","opacity","Skia","colors","patch","texture","blendMode","defaultBlendMode","DstOver","SrcOver","mode","drawPatch","pos","c2","c1","map","c","undefined","Patch","props"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAGA,SAASC,OAAT,QAAwB,kBAAxB;AAEA,SAASC,SAAT,QAA0B,qBAA1B;AACA,SAASC,aAAT,QAA8B,aAA9B;AACA,SAASC,YAAT,QAA6B,wBAA7B;AAoBA,MAAMC,MAAM,GAAGF,aAAa,CAC1B,iBAA6E;AAAA,MAA5E;AAAEG,IAAAA,MAAF;AAAUC,IAAAA,KAAV;AAAiBC,IAAAA,OAAjB;AAA0BC,IAAAA;AAA1B,GAA4E;AAAA,MAA1C;AAAEC,IAAAA,MAAF;AAAUC,IAAAA,KAAV;AAAiBC,IAAAA,OAAjB;AAA0BC,IAAAA;AAA1B,GAA0C;AAC3E;AACA,QAAMC,gBAAgB,GAAGJ,MAAM,GAAGR,SAAS,CAACa,OAAb,GAAuBb,SAAS,CAACc,OAAhE;AACA,QAAMC,IAAI,GAAGJ,SAAS,GAAGX,SAAS,CAACD,OAAO,CAACY,SAAD,CAAR,CAAZ,GAAmCC,gBAAzD;AACAR,EAAAA,MAAM,CAACY,SAAP,EACE;AACA;AACA;AACA;AACA;AACA,GACEP,KAAK,CAAC,CAAD,CAAL,CAASQ,GADX,EAEER,KAAK,CAAC,CAAD,CAAL,CAASS,EAFX,EAGET,KAAK,CAAC,CAAD,CAAL,CAASU,EAHX,EAIEV,KAAK,CAAC,CAAD,CAAL,CAASQ,GAJX,EAKER,KAAK,CAAC,CAAD,CAAL,CAASS,EALX,EAMET,KAAK,CAAC,CAAD,CAAL,CAASU,EANX,EAOEV,KAAK,CAAC,CAAD,CAAL,CAASQ,GAPX,EAQER,KAAK,CAAC,CAAD,CAAL,CAASS,EARX,EASET,KAAK,CAAC,CAAD,CAAL,CAASU,EATX,EAUEV,KAAK,CAAC,CAAD,CAAL,CAASQ,GAVX,EAWER,KAAK,CAAC,CAAD,CAAL,CAASS,EAXX,EAYET,KAAK,CAAC,CAAD,CAAL,CAASU,EAZX,CANF,EAoBEX,MAAM,GAAGA,MAAM,CAACY,GAAP,CAAYC,CAAD,IAAOnB,YAAY,CAACK,IAAD,EAAOc,CAAP,EAAUf,OAAV,CAA9B,CAAH,GAAuDgB,SApB/D,EAqBEZ,OArBF,EAsBEK,IAtBF,EAuBEV,KAvBF;AAyBD,CA9ByB,CAA5B;AAiCA,OAAO,MAAMkB,KAAK,GAAIC,KAAD,IAAsC;AACzD,sBAAO;AAAW,IAAA,MAAM,EAAErB;AAAnB,KAA+BqB,KAA/B,EAAP;AACD,CAFM","sourcesContent":["import React from \"react\";\n\nimport type { CustomPaintProps, SkEnum, AnimatedProps } from \"../../processors\";\nimport { enumKey } from \"../../processors\";\nimport type { SkPoint, Color, Vector } from \"../../../skia/types\";\nimport { BlendMode } from \"../../../skia/types\";\nimport { createDrawing } from \"../../nodes\";\nimport { processColor } from \"../../processors/Color\";\n\nexport interface CubicBezierHandle {\n pos: Vector;\n c1: Vector;\n c2: Vector;\n}\n\nexport interface PatchProps extends CustomPaintProps {\n colors?: readonly Color[];\n patch: readonly [\n CubicBezierHandle,\n CubicBezierHandle,\n CubicBezierHandle,\n CubicBezierHandle\n ];\n texture?: readonly [SkPoint, SkPoint, SkPoint, SkPoint];\n blendMode?: SkEnum<typeof BlendMode>;\n}\n\nconst onDraw = createDrawing<PatchProps>(\n ({ canvas, paint, opacity, Skia }, { colors, patch, texture, blendMode }) => {\n // If the colors are provided, the default blendMode is set to dstOver, if not, the default is set to srcOver\n const defaultBlendMode = colors ? BlendMode.DstOver : BlendMode.SrcOver;\n const mode = blendMode ? BlendMode[enumKey(blendMode)] : defaultBlendMode;\n canvas.drawPatch(\n // Patch requires a path with the following constraints:\n // M tl\n // C c1 c2 br\n // C c1 c2 bl\n // C c1 c2 tl (the redundant point in the last command is removed)\n [\n patch[0].pos,\n patch[0].c2,\n patch[1].c1,\n patch[1].pos,\n patch[1].c2,\n patch[2].c1,\n patch[2].pos,\n patch[2].c2,\n patch[3].c1,\n patch[3].pos,\n patch[3].c2,\n patch[0].c1,\n ],\n colors ? colors.map((c) => processColor(Skia, c, opacity)) : undefined,\n texture,\n mode,\n paint\n );\n }\n);\n\nexport const Patch = (props: AnimatedProps<PatchProps>) => {\n return <skDrawing onDraw={onDraw} {...props} />;\n};\n"]}
1
+ {"version":3,"sources":["Patch.tsx"],"names":["React","Patch","props"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAKA,OAAO,MAAMC,KAAK,GAAIC,KAAD,IAAkC;AACrD,sBAAO,+BAAaA,KAAb,CAAP;AACD,CAFM","sourcesContent":["import React from \"react\";\n\nimport type { SkiaProps } from \"../../processors\";\nimport type { PatchProps } from \"../../../dom/types\";\n\nexport const Patch = (props: SkiaProps<PatchProps>) => {\n return <skPatch {...props} />;\n};\n"]}
@@ -1,48 +1,6 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
3
1
  import React from "react";
4
- import { createDrawing } from "../../nodes";
5
- import { processPath, enumKey } from "../../processors";
6
- import { FillType } from "../../../skia/types";
7
- const onDraw = createDrawing((_ref, _ref2) => {
8
- let {
9
- canvas,
10
- paint,
11
- Skia
12
- } = _ref;
13
- let {
14
- start,
15
- end,
16
- stroke,
17
- fillType,
18
- ...pathProps
19
- } = _ref2;
20
- const hasStartOffset = start !== 0;
21
- const hasEndOffset = end !== 1;
22
- const hasStrokeOptions = stroke !== undefined;
23
- const hasFillType = !!fillType;
24
- const willMutatePath = hasStartOffset || hasEndOffset || hasStrokeOptions || hasFillType;
25
- const pristinePath = processPath(Skia, pathProps.path);
26
- const path = willMutatePath ? pristinePath.copy() : pristinePath;
27
-
28
- if (hasFillType) {
29
- path.setFillType(FillType[enumKey(fillType)]);
30
- }
31
-
32
- if (hasStrokeOptions) {
33
- path.stroke(stroke);
34
- }
35
-
36
- if (hasStartOffset || hasEndOffset) {
37
- path.trim(start, end, false);
38
- }
39
-
40
- canvas.drawPath(path, paint);
41
- });
42
2
  export const Path = props => {
43
- return /*#__PURE__*/React.createElement("skDrawing", _extends({
44
- onDraw: onDraw
45
- }, props));
3
+ return /*#__PURE__*/React.createElement("skPath", props);
46
4
  };
47
5
  Path.defaultProps = {
48
6
  start: 0,
@@ -1 +1 @@
1
- {"version":3,"sources":["Path.tsx"],"names":["React","createDrawing","processPath","enumKey","FillType","onDraw","canvas","paint","Skia","start","end","stroke","fillType","pathProps","hasStartOffset","hasEndOffset","hasStrokeOptions","undefined","hasFillType","willMutatePath","pristinePath","path","copy","setFillType","trim","drawPath","Path","props","defaultProps"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAQA,SAASC,aAAT,QAA8B,aAA9B;AACA,SAASC,WAAT,EAAsBC,OAAtB,QAAqC,kBAArC;AACA,SAASC,QAAT,QAAyB,qBAAzB;AAgBA,MAAMC,MAAM,GAAGJ,aAAa,CAC1B,iBAA6E;AAAA,MAA5E;AAAEK,IAAAA,MAAF;AAAUC,IAAAA,KAAV;AAAiBC,IAAAA;AAAjB,GAA4E;AAAA,MAAnD;AAAEC,IAAAA,KAAF;AAASC,IAAAA,GAAT;AAAcC,IAAAA,MAAd;AAAsBC,IAAAA,QAAtB;AAAgC,OAAGC;AAAnC,GAAmD;AAC3E,QAAMC,cAAc,GAAGL,KAAK,KAAK,CAAjC;AACA,QAAMM,YAAY,GAAGL,GAAG,KAAK,CAA7B;AACA,QAAMM,gBAAgB,GAAGL,MAAM,KAAKM,SAApC;AACA,QAAMC,WAAW,GAAG,CAAC,CAACN,QAAtB;AACA,QAAMO,cAAc,GAClBL,cAAc,IAAIC,YAAlB,IAAkCC,gBAAlC,IAAsDE,WADxD;AAEA,QAAME,YAAY,GAAGlB,WAAW,CAACM,IAAD,EAAOK,SAAS,CAACQ,IAAjB,CAAhC;AACA,QAAMA,IAAI,GAAGF,cAAc,GAAGC,YAAY,CAACE,IAAb,EAAH,GAAyBF,YAApD;;AACA,MAAIF,WAAJ,EAAiB;AACfG,IAAAA,IAAI,CAACE,WAAL,CAAiBnB,QAAQ,CAACD,OAAO,CAACS,QAAD,CAAR,CAAzB;AACD;;AACD,MAAII,gBAAJ,EAAsB;AACpBK,IAAAA,IAAI,CAACV,MAAL,CAAYA,MAAZ;AACD;;AACD,MAAIG,cAAc,IAAIC,YAAtB,EAAoC;AAClCM,IAAAA,IAAI,CAACG,IAAL,CAAUf,KAAV,EAAiBC,GAAjB,EAAsB,KAAtB;AACD;;AACDJ,EAAAA,MAAM,CAACmB,QAAP,CAAgBJ,IAAhB,EAAsBd,KAAtB;AACD,CApByB,CAA5B;AAuBA,OAAO,MAAMmB,IAAI,GAAIC,KAAD,IAAqC;AACvD,sBAAO;AAAW,IAAA,MAAM,EAAEtB;AAAnB,KAA+BsB,KAA/B,EAAP;AACD,CAFM;AAIPD,IAAI,CAACE,YAAL,GAAoB;AAClBnB,EAAAA,KAAK,EAAE,CADW;AAElBC,EAAAA,GAAG,EAAE;AAFa,CAApB","sourcesContent":["import React from \"react\";\n\nimport type {\n CustomPaintProps,\n AnimatedProps,\n PathDef,\n SkEnum,\n} from \"../../processors\";\nimport { createDrawing } from \"../../nodes\";\nimport { processPath, enumKey } from \"../../processors\";\nimport { FillType } from \"../../../skia/types\";\n\ninterface StrokeOpts {\n width?: number;\n strokeMiterlimit?: number;\n precision?: number;\n}\n\nexport interface PathProps extends CustomPaintProps {\n path: PathDef;\n start: number;\n end: number;\n stroke?: StrokeOpts;\n fillType?: SkEnum<typeof FillType>;\n}\n\nconst onDraw = createDrawing<PathProps>(\n ({ canvas, paint, Skia }, { start, end, stroke, fillType, ...pathProps }) => {\n const hasStartOffset = start !== 0;\n const hasEndOffset = end !== 1;\n const hasStrokeOptions = stroke !== undefined;\n const hasFillType = !!fillType;\n const willMutatePath =\n hasStartOffset || hasEndOffset || hasStrokeOptions || hasFillType;\n const pristinePath = processPath(Skia, pathProps.path);\n const path = willMutatePath ? pristinePath.copy() : pristinePath;\n if (hasFillType) {\n path.setFillType(FillType[enumKey(fillType)]);\n }\n if (hasStrokeOptions) {\n path.stroke(stroke);\n }\n if (hasStartOffset || hasEndOffset) {\n path.trim(start, end, false);\n }\n canvas.drawPath(path, paint);\n }\n);\n\nexport const Path = (props: AnimatedProps<PathProps>) => {\n return <skDrawing onDraw={onDraw} {...props} />;\n};\n\nPath.defaultProps = {\n start: 0,\n end: 1,\n};\n"]}
1
+ {"version":3,"sources":["Path.tsx"],"names":["React","Path","props","defaultProps","start","end"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAKA,OAAO,MAAMC,IAAI,GAAIC,KAAD,IAAiC;AACnD,sBAAO,8BAAYA,KAAZ,CAAP;AACD,CAFM;AAIPD,IAAI,CAACE,YAAL,GAAoB;AAClBC,EAAAA,KAAK,EAAE,CADW;AAElBC,EAAAA,GAAG,EAAE;AAFa,CAApB","sourcesContent":["import React from \"react\";\n\nimport type { SkiaProps } from \"../../processors\";\nimport type { PathProps } from \"../../../dom/types\";\n\nexport const Path = (props: SkiaProps<PathProps>) => {\n return <skPath {...props} />;\n};\n\nPath.defaultProps = {\n start: 0,\n end: 1,\n};\n"]}
@@ -1,25 +1,6 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
3
1
  import React from "react";
4
- import { PointMode } from "../../../skia/types";
5
- import { enumKey } from "../../processors/Paint";
6
- import { createDrawing } from "../../nodes/Drawing";
7
- const onDraw = createDrawing((_ref, _ref2) => {
8
- let {
9
- canvas,
10
- paint
11
- } = _ref;
12
- let {
13
- points,
14
- mode
15
- } = _ref2;
16
- const pointMode = PointMode[enumKey(mode)];
17
- canvas.drawPoints(pointMode, points, paint);
18
- });
19
2
  export const Points = props => {
20
- return /*#__PURE__*/React.createElement("skDrawing", _extends({
21
- onDraw: onDraw
22
- }, props));
3
+ return /*#__PURE__*/React.createElement("skPoints", props);
23
4
  };
24
5
  Points.defaultProps = {
25
6
  mode: "points"
@@ -1 +1 @@
1
- {"version":3,"sources":["Points.tsx"],"names":["React","PointMode","enumKey","createDrawing","onDraw","canvas","paint","points","mode","pointMode","drawPoints","Points","props","defaultProps"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAIA,SAASC,SAAT,QAA0B,qBAA1B;AACA,SAASC,OAAT,QAAwB,wBAAxB;AAEA,SAASC,aAAT,QAA8B,qBAA9B;AAOA,MAAMC,MAAM,GAAGD,aAAa,CAC1B,iBAAyC;AAAA,MAAxC;AAAEE,IAAAA,MAAF;AAAUC,IAAAA;AAAV,GAAwC;AAAA,MAArB;AAAEC,IAAAA,MAAF;AAAUC,IAAAA;AAAV,GAAqB;AACvC,QAAMC,SAAS,GAAGR,SAAS,CAACC,OAAO,CAACM,IAAD,CAAR,CAA3B;AACAH,EAAAA,MAAM,CAACK,UAAP,CAAkBD,SAAlB,EAA6BF,MAA7B,EAAqCD,KAArC;AACD,CAJyB,CAA5B;AAOA,OAAO,MAAMK,MAAM,GAAIC,KAAD,IAAuC;AAC3D,sBAAO;AAAW,IAAA,MAAM,EAAER;AAAnB,KAA+BQ,KAA/B,EAAP;AACD,CAFM;AAIPD,MAAM,CAACE,YAAP,GAAsB;AACpBL,EAAAA,IAAI,EAAE;AADc,CAAtB","sourcesContent":["import React from \"react\";\n\nimport type { CustomPaintProps, SkEnum } from \"../../processors\";\nimport type { SkPoint } from \"../../../skia/types\";\nimport { PointMode } from \"../../../skia/types\";\nimport { enumKey } from \"../../processors/Paint\";\nimport type { AnimatedProps } from \"../../processors/Animations/Animations\";\nimport { createDrawing } from \"../../nodes/Drawing\";\n\nexport interface PointsProps extends CustomPaintProps {\n points: SkPoint[];\n mode: SkEnum<typeof PointMode>;\n}\n\nconst onDraw = createDrawing<PointsProps>(\n ({ canvas, paint }, { points, mode }) => {\n const pointMode = PointMode[enumKey(mode)];\n canvas.drawPoints(pointMode, points, paint);\n }\n);\n\nexport const Points = (props: AnimatedProps<PointsProps>) => {\n return <skDrawing onDraw={onDraw} {...props} />;\n};\n\nPoints.defaultProps = {\n mode: \"points\",\n};\n"]}
1
+ {"version":3,"sources":["Points.tsx"],"names":["React","Points","props","defaultProps","mode"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAKA,OAAO,MAAMC,MAAM,GAAIC,KAAD,IAAmC;AACvD,sBAAO,gCAAcA,KAAd,CAAP;AACD,CAFM;AAIPD,MAAM,CAACE,YAAP,GAAsB;AACpBC,EAAAA,IAAI,EAAE;AADc,CAAtB","sourcesContent":["import React from \"react\";\n\nimport type { SkiaProps } from \"../../processors/Animations/Animations\";\nimport type { PointsProps } from \"../../../dom/types\";\n\nexport const Points = (props: SkiaProps<PointsProps>) => {\n return <skPoints {...props} />;\n};\n\nPoints.defaultProps = {\n mode: \"points\",\n};\n"]}
@@ -1,20 +1,5 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
3
1
  import React from "react";
4
- import { createDrawing } from "../../nodes/Drawing";
5
- import { processRect } from "../../processors";
6
- const onDraw = createDrawing((_ref, rectProps) => {
7
- let {
8
- canvas,
9
- paint,
10
- Skia
11
- } = _ref;
12
- const rect = processRect(Skia, rectProps);
13
- canvas.drawRect(rect, paint);
14
- });
15
2
  export const Rect = props => {
16
- return /*#__PURE__*/React.createElement("skDrawing", _extends({
17
- onDraw: onDraw
18
- }, props));
3
+ return /*#__PURE__*/React.createElement("skRect", props);
19
4
  };
20
5
  //# sourceMappingURL=Rect.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["Rect.tsx"],"names":["React","createDrawing","processRect","onDraw","rectProps","canvas","paint","Skia","rect","drawRect","Rect","props"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAEA,SAASC,aAAT,QAA8B,qBAA9B;AAMA,SAASC,WAAT,QAA4B,kBAA5B;AAIA,MAAMC,MAAM,GAAGF,aAAa,CAC1B,OAA0BG,SAA1B,KAAwC;AAAA,MAAvC;AAAEC,IAAAA,MAAF;AAAUC,IAAAA,KAAV;AAAiBC,IAAAA;AAAjB,GAAuC;AACtC,QAAMC,IAAI,GAAGN,WAAW,CAACK,IAAD,EAAOH,SAAP,CAAxB;AACAC,EAAAA,MAAM,CAACI,QAAP,CAAgBD,IAAhB,EAAsBF,KAAtB;AACD,CAJyB,CAA5B;AAOA,OAAO,MAAMI,IAAI,GAAIC,KAAD,IAAqC;AACvD,sBAAO;AAAW,IAAA,MAAM,EAAER;AAAnB,KAA+BQ,KAA/B,EAAP;AACD,CAFM","sourcesContent":["import React from \"react\";\n\nimport { createDrawing } from \"../../nodes/Drawing\";\nimport type {\n CustomPaintProps,\n RectDef,\n AnimatedProps,\n} from \"../../processors\";\nimport { processRect } from \"../../processors\";\n\nexport type RectProps = RectDef & CustomPaintProps;\n\nconst onDraw = createDrawing<RectProps>(\n ({ canvas, paint, Skia }, rectProps) => {\n const rect = processRect(Skia, rectProps);\n canvas.drawRect(rect, paint);\n }\n);\n\nexport const Rect = (props: AnimatedProps<RectProps>) => {\n return <skDrawing onDraw={onDraw} {...props} />;\n};\n"]}
1
+ {"version":3,"sources":["Rect.tsx"],"names":["React","Rect","props"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAKA,OAAO,MAAMC,IAAI,GAAIC,KAAD,IAAiC;AACnD,sBAAO,8BAAYA,KAAZ,CAAP;AACD,CAFM","sourcesContent":["import React from \"react\";\n\nimport type { RectProps } from \"../../../dom/types\";\nimport type { SkiaProps } from \"../../processors\";\n\nexport const Rect = (props: SkiaProps<RectProps>) => {\n return <skRect {...props} />;\n};\n"]}
@@ -1,21 +1,6 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
3
1
  import React from "react";
4
- import { createDrawing } from "../../nodes";
5
- import { processRRect } from "../../processors";
6
- const onDraw = createDrawing((_ref, rectProps) => {
7
- let {
8
- canvas,
9
- paint,
10
- Skia
11
- } = _ref;
12
- const rrect = processRRect(Skia, rectProps);
13
- canvas.drawRRect(rrect, paint);
14
- });
15
2
  export const RoundedRect = props => {
16
- return /*#__PURE__*/React.createElement("skDrawing", _extends({
17
- onDraw: onDraw
18
- }, props));
3
+ return /*#__PURE__*/React.createElement("skRRect", props);
19
4
  };
20
5
  RoundedRect.defaultProps = {
21
6
  r: 0
@@ -1 +1 @@
1
- {"version":3,"sources":["RoundedRect.tsx"],"names":["React","createDrawing","processRRect","onDraw","rectProps","canvas","paint","Skia","rrect","drawRRect","RoundedRect","props","defaultProps","r"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAEA,SAASC,aAAT,QAA8B,aAA9B;AAMA,SAASC,YAAT,QAA6B,kBAA7B;AAIA,MAAMC,MAAM,GAAGF,aAAa,CAC1B,OAA0BG,SAA1B,KAAwC;AAAA,MAAvC;AAAEC,IAAAA,MAAF;AAAUC,IAAAA,KAAV;AAAiBC,IAAAA;AAAjB,GAAuC;AACtC,QAAMC,KAAK,GAAGN,YAAY,CAACK,IAAD,EAAOH,SAAP,CAA1B;AACAC,EAAAA,MAAM,CAACI,SAAP,CAAiBD,KAAjB,EAAwBF,KAAxB;AACD,CAJyB,CAA5B;AAMA,OAAO,MAAMI,WAAW,GAAIC,KAAD,IAA4C;AACrE,sBAAO;AAAW,IAAA,MAAM,EAAER;AAAnB,KAA+BQ,KAA/B,EAAP;AACD,CAFM;AAIPD,WAAW,CAACE,YAAZ,GAA2B;AACzBC,EAAAA,CAAC,EAAE;AADsB,CAA3B","sourcesContent":["import React from \"react\";\n\nimport { createDrawing } from \"../../nodes\";\nimport type {\n CustomPaintProps,\n RRectDef,\n AnimatedProps,\n} from \"../../processors\";\nimport { processRRect } from \"../../processors\";\n\nexport type RoundedRectProps = RRectDef & CustomPaintProps;\n\nconst onDraw = createDrawing<RoundedRectProps>(\n ({ canvas, paint, Skia }, rectProps) => {\n const rrect = processRRect(Skia, rectProps);\n canvas.drawRRect(rrect, paint);\n }\n);\nexport const RoundedRect = (props: AnimatedProps<RoundedRectProps>) => {\n return <skDrawing onDraw={onDraw} {...props} />;\n};\n\nRoundedRect.defaultProps = {\n r: 0,\n};\n"]}
1
+ {"version":3,"sources":["RoundedRect.tsx"],"names":["React","RoundedRect","props","defaultProps","r"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAKA,OAAO,MAAMC,WAAW,GAAIC,KAAD,IAAwC;AACjE,sBAAO,+BAAaA,KAAb,CAAP;AACD,CAFM;AAIPD,WAAW,CAACE,YAAZ,GAA2B;AACzBC,EAAAA,CAAC,EAAE;AADsB,CAA3B","sourcesContent":["import React from \"react\";\n\nimport type { RoundedRectProps } from \"../../../dom/types\";\nimport type { SkiaProps } from \"../../processors\";\n\nexport const RoundedRect = (props: SkiaProps<RoundedRectProps>) => {\n return <skRRect {...props} />;\n};\n\nRoundedRect.defaultProps = {\n r: 0,\n};\n"]}
@@ -1,36 +1,6 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
3
1
  import React from "react";
4
- import { enumKey } from "../../processors";
5
- import { BlendMode, VertexMode } from "../../../skia/types";
6
- import { createDrawing } from "../../nodes";
7
- import { processColor } from "../../processors/Color";
8
- const onDraw = createDrawing((_ref, _ref2) => {
9
- let {
10
- canvas,
11
- paint,
12
- opacity,
13
- Skia
14
- } = _ref;
15
- let {
16
- colors,
17
- vertices,
18
- textures,
19
- blendMode,
20
- mode,
21
- indices
22
- } = _ref2;
23
- // If the colors are provided, the default blendMode is set to dstOver, if not, the default is set to srcOver
24
- const defaultBlendMode = colors ? BlendMode.DstOver : BlendMode.SrcOver;
25
- const blend = blendMode ? BlendMode[enumKey(blendMode)] : defaultBlendMode;
26
- const vertexMode = mode ? VertexMode[enumKey(mode)] : VertexMode.Triangles;
27
- const vert = Skia.MakeVertices(vertexMode, vertices, textures, colors ? colors.map(c => processColor(Skia, c, opacity)) : undefined, indices);
28
- canvas.drawVertices(vert, blend, paint);
29
- });
30
2
  export const Vertices = props => {
31
- return /*#__PURE__*/React.createElement("skDrawing", _extends({
32
- onDraw: onDraw
33
- }, props));
3
+ return /*#__PURE__*/React.createElement("skVertices", props);
34
4
  };
35
5
  Vertices.defaultProps = {
36
6
  mode: "triangles"
@@ -1 +1 @@
1
- {"version":3,"sources":["Vertices.tsx"],"names":["React","enumKey","BlendMode","VertexMode","createDrawing","processColor","onDraw","canvas","paint","opacity","Skia","colors","vertices","textures","blendMode","mode","indices","defaultBlendMode","DstOver","SrcOver","blend","vertexMode","Triangles","vert","MakeVertices","map","c","undefined","drawVertices","Vertices","props","defaultProps"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAGA,SAASC,OAAT,QAAwB,kBAAxB;AAEA,SAASC,SAAT,EAAoBC,UAApB,QAAsC,qBAAtC;AACA,SAASC,aAAT,QAA8B,aAA9B;AACA,SAASC,YAAT,QAA6B,wBAA7B;AAWA,MAAMC,MAAM,GAAGF,aAAa,CAC1B,iBAGK;AAAA,MAFH;AAAEG,IAAAA,MAAF;AAAUC,IAAAA,KAAV;AAAiBC,IAAAA,OAAjB;AAA0BC,IAAAA;AAA1B,GAEG;AAAA,MADH;AAAEC,IAAAA,MAAF;AAAUC,IAAAA,QAAV;AAAoBC,IAAAA,QAApB;AAA8BC,IAAAA,SAA9B;AAAyCC,IAAAA,IAAzC;AAA+CC,IAAAA;AAA/C,GACG;AACH;AACA,QAAMC,gBAAgB,GAAGN,MAAM,GAAGT,SAAS,CAACgB,OAAb,GAAuBhB,SAAS,CAACiB,OAAhE;AACA,QAAMC,KAAK,GAAGN,SAAS,GAAGZ,SAAS,CAACD,OAAO,CAACa,SAAD,CAAR,CAAZ,GAAmCG,gBAA1D;AACA,QAAMI,UAAU,GAAGN,IAAI,GAAGZ,UAAU,CAACF,OAAO,CAACc,IAAD,CAAR,CAAb,GAA+BZ,UAAU,CAACmB,SAAjE;AACA,QAAMC,IAAI,GAAGb,IAAI,CAACc,YAAL,CACXH,UADW,EAEXT,QAFW,EAGXC,QAHW,EAIXF,MAAM,GAAGA,MAAM,CAACc,GAAP,CAAYC,CAAD,IAAOrB,YAAY,CAACK,IAAD,EAAOgB,CAAP,EAAUjB,OAAV,CAA9B,CAAH,GAAuDkB,SAJlD,EAKXX,OALW,CAAb;AAOAT,EAAAA,MAAM,CAACqB,YAAP,CAAoBL,IAApB,EAA0BH,KAA1B,EAAiCZ,KAAjC;AACD,CAjByB,CAA5B;AAoBA,OAAO,MAAMqB,QAAQ,GAAIC,KAAD,IAAyC;AAC/D,sBAAO;AAAW,IAAA,MAAM,EAAExB;AAAnB,KAA+BwB,KAA/B,EAAP;AACD,CAFM;AAIPD,QAAQ,CAACE,YAAT,GAAwB;AACtBhB,EAAAA,IAAI,EAAE;AADgB,CAAxB","sourcesContent":["import React from \"react\";\n\nimport type { CustomPaintProps, SkEnum, AnimatedProps } from \"../../processors\";\nimport { enumKey } from \"../../processors\";\nimport type { SkPoint } from \"../../../skia/types\";\nimport { BlendMode, VertexMode } from \"../../../skia/types\";\nimport { createDrawing } from \"../../nodes\";\nimport { processColor } from \"../../processors/Color\";\n\nexport interface VerticesProps extends CustomPaintProps {\n colors?: string[];\n vertices: SkPoint[];\n textures?: SkPoint[];\n mode: SkEnum<typeof VertexMode>;\n blendMode?: SkEnum<typeof BlendMode>;\n indices?: number[];\n}\n\nconst onDraw = createDrawing<VerticesProps>(\n (\n { canvas, paint, opacity, Skia },\n { colors, vertices, textures, blendMode, mode, indices }\n ) => {\n // If the colors are provided, the default blendMode is set to dstOver, if not, the default is set to srcOver\n const defaultBlendMode = colors ? BlendMode.DstOver : BlendMode.SrcOver;\n const blend = blendMode ? BlendMode[enumKey(blendMode)] : defaultBlendMode;\n const vertexMode = mode ? VertexMode[enumKey(mode)] : VertexMode.Triangles;\n const vert = Skia.MakeVertices(\n vertexMode,\n vertices,\n textures,\n colors ? colors.map((c) => processColor(Skia, c, opacity)) : undefined,\n indices\n );\n canvas.drawVertices(vert, blend, paint);\n }\n);\n\nexport const Vertices = (props: AnimatedProps<VerticesProps>) => {\n return <skDrawing onDraw={onDraw} {...props} />;\n};\n\nVertices.defaultProps = {\n mode: \"triangles\",\n};\n"]}
1
+ {"version":3,"sources":["Vertices.tsx"],"names":["React","Vertices","props","defaultProps","mode"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAKA,OAAO,MAAMC,QAAQ,GAAIC,KAAD,IAAqC;AAC3D,sBAAO,kCAAgBA,KAAhB,CAAP;AACD,CAFM;AAIPD,QAAQ,CAACE,YAAT,GAAwB;AACtBC,EAAAA,IAAI,EAAE;AADgB,CAAxB","sourcesContent":["import React from \"react\";\n\nimport type { SkiaProps } from \"../../processors\";\nimport type { VerticesProps } from \"../../../dom/types\";\n\nexport const Vertices = (props: SkiaProps<VerticesProps>) => {\n return <skVertices {...props} />;\n};\n\nVertices.defaultProps = {\n mode: \"triangles\",\n};\n"]}
@@ -1,42 +1,6 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
3
1
  import React from "react";
4
- import { createDrawing } from "../../nodes/Drawing";
5
- const onDraw = createDrawing((_ref, _ref2) => {
6
- let {
7
- canvas,
8
- paint
9
- } = _ref;
10
- let {
11
- glyphs: rawGlyphs,
12
- x,
13
- y,
14
- ...fontDef
15
- } = _ref2;
16
- const {
17
- font
18
- } = fontDef;
19
- const {
20
- glyphs,
21
- positions
22
- } = rawGlyphs.reduce((acc, glyph) => {
23
- const {
24
- id,
25
- pos
26
- } = glyph;
27
- acc.glyphs.push(id);
28
- acc.positions.push(pos);
29
- return acc;
30
- }, {
31
- glyphs: [],
32
- positions: []
33
- });
34
- canvas.drawGlyphs(glyphs, positions, x, y, font, paint);
35
- });
36
2
  export const Glyphs = props => {
37
- return /*#__PURE__*/React.createElement("skDrawing", _extends({
38
- onDraw: onDraw
39
- }, props));
3
+ return /*#__PURE__*/React.createElement("skGlyphs", props);
40
4
  };
41
5
  Glyphs.defaultProps = {
42
6
  x: 0,
@@ -1 +1 @@
1
- {"version":3,"sources":["Glyphs.tsx"],"names":["React","createDrawing","onDraw","canvas","paint","glyphs","rawGlyphs","x","y","fontDef","font","positions","reduce","acc","glyph","id","pos","push","drawGlyphs","Glyphs","props","defaultProps"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAGA,SAASC,aAAT,QAA8B,qBAA9B;AAqBA,MAAMC,MAAM,GAAGD,aAAa,CAC1B,iBAAgE;AAAA,MAA/D;AAAEE,IAAAA,MAAF;AAAUC,IAAAA;AAAV,GAA+D;AAAA,MAA5C;AAAEC,IAAAA,MAAM,EAAEC,SAAV;AAAqBC,IAAAA,CAArB;AAAwBC,IAAAA,CAAxB;AAA2B,OAAGC;AAA9B,GAA4C;AAC9D,QAAM;AAAEC,IAAAA;AAAF,MAAWD,OAAjB;AACA,QAAM;AAAEJ,IAAAA,MAAF;AAAUM,IAAAA;AAAV,MAAwBL,SAAS,CAACM,MAAV,CAC5B,CAACC,GAAD,EAAMC,KAAN,KAAgB;AACd,UAAM;AAAEC,MAAAA,EAAF;AAAMC,MAAAA;AAAN,QAAcF,KAApB;AACAD,IAAAA,GAAG,CAACR,MAAJ,CAAWY,IAAX,CAAgBF,EAAhB;AACAF,IAAAA,GAAG,CAACF,SAAJ,CAAcM,IAAd,CAAmBD,GAAnB;AACA,WAAOH,GAAP;AACD,GAN2B,EAO5B;AAAER,IAAAA,MAAM,EAAE,EAAV;AAAcM,IAAAA,SAAS,EAAE;AAAzB,GAP4B,CAA9B;AASAR,EAAAA,MAAM,CAACe,UAAP,CAAkBb,MAAlB,EAA0BM,SAA1B,EAAqCJ,CAArC,EAAwCC,CAAxC,EAA2CE,IAA3C,EAAiDN,KAAjD;AACD,CAbyB,CAA5B;AAgBA,OAAO,MAAMe,MAAM,GAAIC,KAAD,IAAuC;AAC3D,sBAAO;AAAW,IAAA,MAAM,EAAElB;AAAnB,KAA+BkB,KAA/B,EAAP;AACD,CAFM;AAIPD,MAAM,CAACE,YAAP,GAAsB;AACpBd,EAAAA,CAAC,EAAE,CADiB;AAEpBC,EAAAA,CAAC,EAAE;AAFiB,CAAtB","sourcesContent":["import React from \"react\";\n\nimport type { CustomPaintProps, AnimatedProps } from \"../../processors\";\nimport { createDrawing } from \"../../nodes/Drawing\";\nimport type { SkPoint } from \"../../../skia/types\";\nimport type { FontDef } from \"../../processors/Font\";\n\nexport interface Glyph {\n id: number;\n pos: SkPoint;\n}\n\nexport type GlyphsProps = CustomPaintProps &\n FontDef & {\n x: number;\n y: number;\n glyphs: Glyph[];\n };\n\ninterface ProcessedGlyphs {\n glyphs: number[];\n positions: SkPoint[];\n}\n\nconst onDraw = createDrawing<GlyphsProps>(\n ({ canvas, paint }, { glyphs: rawGlyphs, x, y, ...fontDef }) => {\n const { font } = fontDef;\n const { glyphs, positions } = rawGlyphs.reduce<ProcessedGlyphs>(\n (acc, glyph) => {\n const { id, pos } = glyph;\n acc.glyphs.push(id);\n acc.positions.push(pos);\n return acc;\n },\n { glyphs: [], positions: [] }\n );\n canvas.drawGlyphs(glyphs, positions, x, y, font, paint);\n }\n);\n\nexport const Glyphs = (props: AnimatedProps<GlyphsProps>) => {\n return <skDrawing onDraw={onDraw} {...props} />;\n};\n\nGlyphs.defaultProps = {\n x: 0,\n y: 0,\n};\n"]}
1
+ {"version":3,"sources":["Glyphs.tsx"],"names":["React","Glyphs","props","defaultProps","x","y"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAKA,OAAO,MAAMC,MAAM,GAAIC,KAAD,IAAmC;AACvD,sBAAO,gCAAcA,KAAd,CAAP;AACD,CAFM;AAIPD,MAAM,CAACE,YAAP,GAAsB;AACpBC,EAAAA,CAAC,EAAE,CADiB;AAEpBC,EAAAA,CAAC,EAAE;AAFiB,CAAtB","sourcesContent":["import React from \"react\";\n\nimport type { GlyphsProps } from \"../../../dom/types\";\nimport type { SkiaProps } from \"../../processors/Animations/Animations\";\n\nexport const Glyphs = (props: SkiaProps<GlyphsProps>) => {\n return <skGlyphs {...props} />;\n};\n\nGlyphs.defaultProps = {\n x: 0,\n y: 0,\n};\n"]}
@@ -1,27 +1,6 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
3
1
  import React from "react";
4
- import { createDrawing } from "../../nodes/Drawing";
5
- const onDraw = createDrawing((_ref, _ref2) => {
6
- let {
7
- canvas,
8
- paint
9
- } = _ref;
10
- let {
11
- text,
12
- x,
13
- y,
14
- ...fontDef
15
- } = _ref2;
16
- const {
17
- font
18
- } = fontDef;
19
- canvas.drawText(text, x, y, paint, font);
20
- });
21
2
  export const Text = props => {
22
- return /*#__PURE__*/React.createElement("skDrawing", _extends({
23
- onDraw: onDraw
24
- }, props));
3
+ return /*#__PURE__*/React.createElement("skText", props);
25
4
  };
26
5
  Text.defaultProps = {
27
6
  x: 0,
@@ -1 +1 @@
1
- {"version":3,"sources":["Text.tsx"],"names":["React","createDrawing","onDraw","canvas","paint","text","x","y","fontDef","font","drawText","Text","props","defaultProps"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAOA,SAASC,aAAT,QAA8B,qBAA9B;AASA,MAAMC,MAAM,GAAGD,aAAa,CAC1B,iBAAmD;AAAA,MAAlD;AAAEE,IAAAA,MAAF;AAAUC,IAAAA;AAAV,GAAkD;AAAA,MAA/B;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,CAAR;AAAWC,IAAAA,CAAX;AAAc,OAAGC;AAAjB,GAA+B;AACjD,QAAM;AAAEC,IAAAA;AAAF,MAAWD,OAAjB;AACAL,EAAAA,MAAM,CAACO,QAAP,CAAgBL,IAAhB,EAAsBC,CAAtB,EAAyBC,CAAzB,EAA4BH,KAA5B,EAAmCK,IAAnC;AACD,CAJyB,CAA5B;AAOA,OAAO,MAAME,IAAI,GAAIC,KAAD,IAAqC;AACvD,sBAAO;AAAW,IAAA,MAAM,EAAEV;AAAnB,KAA+BU,KAA/B,EAAP;AACD,CAFM;AAIPD,IAAI,CAACE,YAAL,GAAoB;AAClBP,EAAAA,CAAC,EAAE,CADe;AAElBC,EAAAA,CAAC,EAAE;AAFe,CAApB","sourcesContent":["import React from \"react\";\n\nimport type {\n CustomPaintProps,\n AnimatedProps,\n FontDef,\n} from \"../../processors\";\nimport { createDrawing } from \"../../nodes/Drawing\";\n\ntype TextProps = CustomPaintProps &\n FontDef & {\n text: string;\n x: number;\n y: number;\n };\n\nconst onDraw = createDrawing<TextProps>(\n ({ canvas, paint }, { text, x, y, ...fontDef }) => {\n const { font } = fontDef;\n canvas.drawText(text, x, y, paint, font);\n }\n);\n\nexport const Text = (props: AnimatedProps<TextProps>) => {\n return <skDrawing onDraw={onDraw} {...props} />;\n};\n\nText.defaultProps = {\n x: 0,\n y: 0,\n};\n"]}
1
+ {"version":3,"sources":["Text.tsx"],"names":["React","Text","props","defaultProps","x","y"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAKA,OAAO,MAAMC,IAAI,GAAIC,KAAD,IAAiC;AACnD,sBAAO,8BAAYA,KAAZ,CAAP;AACD,CAFM;AAIPD,IAAI,CAACE,YAAL,GAAoB;AAClBC,EAAAA,CAAC,EAAE,CADe;AAElBC,EAAAA,CAAC,EAAE;AAFe,CAApB","sourcesContent":["import React from \"react\";\n\nimport type { SkiaProps } from \"../../processors\";\nimport type { TextProps } from \"../../../dom/types\";\n\nexport const Text = (props: SkiaProps<TextProps>) => {\n return <skText {...props} />;\n};\n\nText.defaultProps = {\n x: 0,\n y: 0,\n};\n"]}
@@ -1,23 +1,6 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
3
1
  import React from "react";
4
- import { createDrawing } from "../../nodes/Drawing";
5
- const onDraw = createDrawing((_ref, _ref2) => {
6
- let {
7
- canvas,
8
- paint
9
- } = _ref;
10
- let {
11
- blob,
12
- x,
13
- y
14
- } = _ref2;
15
- canvas.drawTextBlob(blob, x, y, paint);
16
- });
17
2
  export const TextBlob = props => {
18
- return /*#__PURE__*/React.createElement("skDrawing", _extends({
19
- onDraw: onDraw
20
- }, props));
3
+ return /*#__PURE__*/React.createElement("skTextBlob", props);
21
4
  };
22
5
  TextBlob.defaultProps = {
23
6
  x: 0,
@@ -1 +1 @@
1
- {"version":3,"sources":["TextBlob.tsx"],"names":["React","createDrawing","onDraw","canvas","paint","blob","x","y","drawTextBlob","TextBlob","props","defaultProps"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAGA,SAASC,aAAT,QAA8B,qBAA9B;AASA,MAAMC,MAAM,GAAGD,aAAa,CAC1B,iBAAuC;AAAA,MAAtC;AAAEE,IAAAA,MAAF;AAAUC,IAAAA;AAAV,GAAsC;AAAA,MAAnB;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,CAAR;AAAWC,IAAAA;AAAX,GAAmB;AACrCJ,EAAAA,MAAM,CAACK,YAAP,CAAoBH,IAApB,EAA0BC,CAA1B,EAA6BC,CAA7B,EAAgCH,KAAhC;AACD,CAHyB,CAA5B;AAMA,OAAO,MAAMK,QAAQ,GAAIC,KAAD,IAAyC;AAC/D,sBAAO;AAAW,IAAA,MAAM,EAAER;AAAnB,KAA+BQ,KAA/B,EAAP;AACD,CAFM;AAIPD,QAAQ,CAACE,YAAT,GAAwB;AACtBL,EAAAA,CAAC,EAAE,CADmB;AAEtBC,EAAAA,CAAC,EAAE;AAFmB,CAAxB","sourcesContent":["import React from \"react\";\n\nimport type { CustomPaintProps, AnimatedProps } from \"../../processors\";\nimport { createDrawing } from \"../../nodes/Drawing\";\nimport type { SkTextBlob } from \"../../../skia/types\";\n\nexport interface TextBlobProps extends CustomPaintProps {\n blob: SkTextBlob;\n x: number;\n y: number;\n}\n\nconst onDraw = createDrawing<TextBlobProps>(\n ({ canvas, paint }, { blob, x, y }) => {\n canvas.drawTextBlob(blob, x, y, paint);\n }\n);\n\nexport const TextBlob = (props: AnimatedProps<TextBlobProps>) => {\n return <skDrawing onDraw={onDraw} {...props} />;\n};\n\nTextBlob.defaultProps = {\n x: 0,\n y: 0,\n};\n"]}
1
+ {"version":3,"sources":["TextBlob.tsx"],"names":["React","TextBlob","props","defaultProps","x","y"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAKA,OAAO,MAAMC,QAAQ,GAAIC,KAAD,IAAqC;AAC3D,sBAAO,kCAAgBA,KAAhB,CAAP;AACD,CAFM;AAIPD,QAAQ,CAACE,YAAT,GAAwB;AACtBC,EAAAA,CAAC,EAAE,CADmB;AAEtBC,EAAAA,CAAC,EAAE;AAFmB,CAAxB","sourcesContent":["import React from \"react\";\n\nimport type { SkiaProps } from \"../../processors\";\nimport type { TextBlobProps } from \"../../../dom/types\";\n\nexport const TextBlob = (props: SkiaProps<TextBlobProps>) => {\n return <skTextBlob {...props} />;\n};\n\nTextBlob.defaultProps = {\n x: 0,\n y: 0,\n};\n"]}
@@ -1,74 +1,6 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
3
1
  import React from "react";
4
- import { createDrawing } from "../../nodes";
5
- const onDraw = createDrawing((_ref, _ref2) => {
6
- let {
7
- canvas,
8
- paint,
9
- Skia
10
- } = _ref;
11
- let {
12
- text,
13
- initialOffset,
14
- path: pathDef,
15
- ...fontDef
16
- } = _ref2;
17
- const path = typeof pathDef === "string" ? Skia.Path.MakeFromSVGString(pathDef) : pathDef;
18
-
19
- if (path === null) {
20
- throw new Error("Invalid path: " + pathDef);
21
- }
22
-
23
- const {
24
- font
25
- } = fontDef;
26
- const ids = font.getGlyphIDs(text);
27
- const widths = font.getGlyphWidths(ids, paint);
28
- const rsx = [];
29
- const meas = Skia.ContourMeasureIter(path, false, 1);
30
- let cont = meas.next();
31
- let dist = initialOffset;
32
-
33
- for (let i = 0; i < text.length && cont; i++) {
34
- const width = widths[i];
35
- dist += width / 2;
36
-
37
- if (dist > cont.length()) {
38
- // jump to next contour
39
- cont = meas.next();
40
-
41
- if (!cont) {
42
- // We have come to the end of the path - terminate the string
43
- // right here.
44
- text = text.substring(0, i);
45
- break;
46
- }
47
-
48
- dist = width / 2;
49
- } // Gives us the (x, y) coordinates as well as the cos/sin of the tangent
50
- // line at that position.
51
-
52
-
53
- const {
54
- px,
55
- py,
56
- tx,
57
- ty
58
- } = cont.getPosTan(dist);
59
- const adjustedX = px - width / 2 * tx;
60
- const adjustedY = py - width / 2 * ty;
61
- rsx.push(Skia.RSXform(tx, ty, adjustedX, adjustedY));
62
- dist += width / 2;
63
- }
64
-
65
- const blob = Skia.TextBlob.MakeFromRSXform(text, rsx, font);
66
- canvas.drawTextBlob(blob, 0, 0, paint);
67
- });
68
2
  export const TextPath = props => {
69
- return /*#__PURE__*/React.createElement("skDrawing", _extends({
70
- onDraw: onDraw
71
- }, props));
3
+ return /*#__PURE__*/React.createElement("skTextPath", props);
72
4
  };
73
5
  TextPath.defaultProps = {
74
6
  initialOffset: 0
@@ -1 +1 @@
1
- {"version":3,"sources":["TextPath.tsx"],"names":["React","createDrawing","onDraw","canvas","paint","Skia","text","initialOffset","path","pathDef","fontDef","Path","MakeFromSVGString","Error","font","ids","getGlyphIDs","widths","getGlyphWidths","rsx","meas","ContourMeasureIter","cont","next","dist","i","length","width","substring","px","py","tx","ty","getPosTan","adjustedX","adjustedY","push","RSXform","blob","TextBlob","MakeFromRSXform","drawTextBlob","TextPath","props","defaultProps"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAGA,SAASC,aAAT,QAA8B,aAA9B;AAWA,MAAMC,MAAM,GAAGD,aAAa,CAC1B,iBAGK;AAAA,MAFH;AAAEE,IAAAA,MAAF;AAAUC,IAAAA,KAAV;AAAiBC,IAAAA;AAAjB,GAEG;AAAA,MADH;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,aAAR;AAAuBC,IAAAA,IAAI,EAAEC,OAA7B;AAAsC,OAAGC;AAAzC,GACG;AACH,QAAMF,IAAI,GACR,OAAOC,OAAP,KAAmB,QAAnB,GACIJ,IAAI,CAACM,IAAL,CAAUC,iBAAV,CAA4BH,OAA5B,CADJ,GAEIA,OAHN;;AAIA,MAAID,IAAI,KAAK,IAAb,EAAmB;AACjB,UAAM,IAAIK,KAAJ,CAAU,mBAAmBJ,OAA7B,CAAN;AACD;;AACD,QAAM;AAAEK,IAAAA;AAAF,MAAWJ,OAAjB;AACA,QAAMK,GAAG,GAAGD,IAAI,CAACE,WAAL,CAAiBV,IAAjB,CAAZ;AACA,QAAMW,MAAM,GAAGH,IAAI,CAACI,cAAL,CAAoBH,GAApB,EAAyBX,KAAzB,CAAf;AACA,QAAMe,GAAgB,GAAG,EAAzB;AACA,QAAMC,IAAI,GAAGf,IAAI,CAACgB,kBAAL,CAAwBb,IAAxB,EAA8B,KAA9B,EAAqC,CAArC,CAAb;AACA,MAAIc,IAAI,GAAGF,IAAI,CAACG,IAAL,EAAX;AACA,MAAIC,IAAI,GAAGjB,aAAX;;AACA,OAAK,IAAIkB,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGnB,IAAI,CAACoB,MAAT,IAAmBJ,IAAnC,EAAyCG,CAAC,EAA1C,EAA8C;AAC5C,UAAME,KAAK,GAAGV,MAAM,CAACQ,CAAD,CAApB;AACAD,IAAAA,IAAI,IAAIG,KAAK,GAAG,CAAhB;;AACA,QAAIH,IAAI,GAAGF,IAAI,CAACI,MAAL,EAAX,EAA0B;AACxB;AACAJ,MAAAA,IAAI,GAAGF,IAAI,CAACG,IAAL,EAAP;;AACA,UAAI,CAACD,IAAL,EAAW;AACT;AACA;AACAhB,QAAAA,IAAI,GAAGA,IAAI,CAACsB,SAAL,CAAe,CAAf,EAAkBH,CAAlB,CAAP;AACA;AACD;;AACDD,MAAAA,IAAI,GAAGG,KAAK,GAAG,CAAf;AACD,KAb2C,CAc5C;AACA;;;AACA,UAAM;AAAEE,MAAAA,EAAF;AAAMC,MAAAA,EAAN;AAAUC,MAAAA,EAAV;AAAcC,MAAAA;AAAd,QAAqBV,IAAI,CAACW,SAAL,CAAeT,IAAf,CAA3B;AACA,UAAMU,SAAS,GAAGL,EAAE,GAAIF,KAAK,GAAG,CAAT,GAAcI,EAArC;AACA,UAAMI,SAAS,GAAGL,EAAE,GAAIH,KAAK,GAAG,CAAT,GAAcK,EAArC;AACAb,IAAAA,GAAG,CAACiB,IAAJ,CAAS/B,IAAI,CAACgC,OAAL,CAAaN,EAAb,EAAiBC,EAAjB,EAAqBE,SAArB,EAAgCC,SAAhC,CAAT;AACAX,IAAAA,IAAI,IAAIG,KAAK,GAAG,CAAhB;AACD;;AACD,QAAMW,IAAI,GAAGjC,IAAI,CAACkC,QAAL,CAAcC,eAAd,CAA8BlC,IAA9B,EAAoCa,GAApC,EAAyCL,IAAzC,CAAb;AACAX,EAAAA,MAAM,CAACsC,YAAP,CAAoBH,IAApB,EAA0B,CAA1B,EAA6B,CAA7B,EAAgClC,KAAhC;AACD,CA3CyB,CAA5B;AA8CA,OAAO,MAAMsC,QAAQ,GAAIC,KAAD,IAAyC;AAC/D,sBAAO;AAAW,IAAA,MAAM,EAAEzC;AAAnB,KAA+ByC,KAA/B,EAAP;AACD,CAFM;AAIPD,QAAQ,CAACE,YAAT,GAAwB;AACtBrC,EAAAA,aAAa,EAAE;AADO,CAAxB","sourcesContent":["import React from \"react\";\n\nimport type { CustomPaintProps, AnimatedProps } from \"../../processors\";\nimport { createDrawing } from \"../../nodes\";\nimport type { SkPath, SkRSXform } from \"../../../skia/types\";\nimport type { FontDef } from \"../../processors/Font\";\n\nexport type TextPathProps = CustomPaintProps &\n FontDef & {\n text: string;\n path: SkPath | string;\n initialOffset: number;\n };\n\nconst onDraw = createDrawing<TextPathProps>(\n (\n { canvas, paint, Skia },\n { text, initialOffset, path: pathDef, ...fontDef }\n ) => {\n const path =\n typeof pathDef === \"string\"\n ? Skia.Path.MakeFromSVGString(pathDef)\n : pathDef;\n if (path === null) {\n throw new Error(\"Invalid path: \" + pathDef);\n }\n const { font } = fontDef;\n const ids = font.getGlyphIDs(text);\n const widths = font.getGlyphWidths(ids, paint);\n const rsx: SkRSXform[] = [];\n const meas = Skia.ContourMeasureIter(path, false, 1);\n let cont = meas.next();\n let dist = initialOffset;\n for (let i = 0; i < text.length && cont; i++) {\n const width = widths[i];\n dist += width / 2;\n if (dist > cont.length()) {\n // jump to next contour\n cont = meas.next();\n if (!cont) {\n // We have come to the end of the path - terminate the string\n // right here.\n text = text.substring(0, i);\n break;\n }\n dist = width / 2;\n }\n // Gives us the (x, y) coordinates as well as the cos/sin of the tangent\n // line at that position.\n const { px, py, tx, ty } = cont.getPosTan(dist);\n const adjustedX = px - (width / 2) * tx;\n const adjustedY = py - (width / 2) * ty;\n rsx.push(Skia.RSXform(tx, ty, adjustedX, adjustedY));\n dist += width / 2;\n }\n const blob = Skia.TextBlob.MakeFromRSXform(text, rsx, font);\n canvas.drawTextBlob(blob, 0, 0, paint);\n }\n);\n\nexport const TextPath = (props: AnimatedProps<TextPathProps>) => {\n return <skDrawing onDraw={onDraw} {...props} />;\n};\n\nTextPath.defaultProps = {\n initialOffset: 0,\n};\n"]}
1
+ {"version":3,"sources":["TextPath.tsx"],"names":["React","TextPath","props","defaultProps","initialOffset"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAKA,OAAO,MAAMC,QAAQ,GAAIC,KAAD,IAAqC;AAC3D,sBAAO,kCAAgBA,KAAhB,CAAP;AACD,CAFM;AAIPD,QAAQ,CAACE,YAAT,GAAwB;AACtBC,EAAAA,aAAa,EAAE;AADO,CAAxB","sourcesContent":["import React from \"react\";\n\nimport type { SkiaProps } from \"../../processors\";\nimport type { TextPathProps } from \"../../../dom/types\";\n\nexport const TextPath = (props: SkiaProps<TextPathProps>) => {\n return <skTextPath {...props} />;\n};\n\nTextPath.defaultProps = {\n initialOffset: 0,\n};\n"]}
@@ -1,5 +1,4 @@
1
1
  export * from "./components";
2
- export * from "./nodes";
3
2
  export * from "./useContextBridge";
4
3
  export * from "./DependencyManager";
5
4
  export * from "./useCanvas";
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAd;AACA,cAAc,SAAd;AACA,cAAc,oBAAd;AACA,cAAc,qBAAd;AACA,cAAc,aAAd","sourcesContent":["export * from \"./components\";\nexport * from \"./nodes\";\nexport * from \"./useContextBridge\";\nexport * from \"./DependencyManager\";\nexport * from \"./useCanvas\";\n"]}
1
+ {"version":3,"sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAd;AACA,cAAc,oBAAd;AACA,cAAc,qBAAd;AACA,cAAc,aAAd","sourcesContent":["export * from \"./components\";\nexport * from \"./useContextBridge\";\nexport * from \"./DependencyManager\";\nexport * from \"./useCanvas\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["Animations.ts"],"names":["isValue","value","undefined","__typename__","isSelector","selector","isAnimated","props","Object","values"],"mappings":"AAEA,OAAO,MAAMA,OAAO,GAAIC,KAAD,IAAiD;AACtE,MAAIA,KAAK,KAAKC,SAAV,IAAuBD,KAAK,KAAK,IAArC,EAA2C;AACzC,WAAO,KAAP;AACD;;AACD,MAAI;AACF,QACE,OAAOA,KAAP,KAAiB,QAAjB,IACA,kBAAkBA,KADlB,IAECA,KAAD,CAAyCE,YAAzC,KAA0D,WAH5D,EAIE;AACA,aAAO,IAAP;AACD;AACF,GARD,CAQE,MAAM,CAAE;;AACV,SAAO,KAAP;AACD,CAdM;AAgBP,OAAO,MAAMC,UAAU,GACrBH,KADwB,IAKrB;AACH,MAAIA,KAAJ,EAAW;AACT,WACE,OAAOA,KAAP,KAAiB,QAAjB,IACA,cAAcA,KADd,IAEA,WAAWA,KAFX,IAGCA,KAAD,CAAmCI,QAAnC,KAAgDH,SAHhD,IAICD,KAAD,CAAmCA,KAAnC,KAA6CC,SAL/C;AAOD;;AACD,SAAO,KAAP;AACD,CAhBM;AAkBP,OAAO,MAAMI,UAAU,GAAOC,KAAJ,IAAgC;AACxD,OAAK,MAAMN,KAAX,IAAoBO,MAAM,CAACC,MAAP,CAAcF,KAAd,CAApB,EAA0C;AACxC,QAAIP,OAAO,CAACC,KAAD,CAAP,IAAkBG,UAAU,CAACH,KAAD,CAAhC,EAAyC;AACvC,aAAO,IAAP;AACD;AACF;;AACD,SAAO,KAAP;AACD,CAPM,C,CASP","sourcesContent":["import type { SkiaSelector, SkiaValue } from \"../../../values\";\n\nexport const isValue = (value: unknown): value is SkiaValue<unknown> => {\n if (value === undefined || value === null) {\n return false;\n }\n try {\n if (\n typeof value === \"object\" &&\n \"__typename__\" in value &&\n (value as unknown as SkiaValue<unknown>).__typename__ === \"RNSkValue\"\n ) {\n return true;\n }\n } catch {}\n return false;\n};\n\nexport const isSelector = <T, R>(\n value: unknown\n): value is {\n selector: (v: T) => R;\n value: SkiaValue<T>;\n} => {\n if (value) {\n return (\n typeof value === \"object\" &&\n \"selector\" in value &&\n \"value\" in value &&\n (value as Record<string, unknown>).selector !== undefined &&\n (value as Record<string, unknown>).value !== undefined\n );\n }\n return false;\n};\n\nexport const isAnimated = <T>(props: AnimatedProps<T>) => {\n for (const value of Object.values(props)) {\n if (isValue(value) || isSelector(value)) {\n return true;\n }\n }\n return false;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type AnimatedProp<T, P = any> = T | SkiaValue<T> | SkiaSelector<T, P>;\n\nexport type AnimatedProps<T> = {\n [K in keyof T]: AnimatedProp<T[K]>;\n};\n"]}
1
+ {"version":3,"sources":["Animations.ts"],"names":["isValue","value","undefined","__typename__","isSelector","selector","isAnimated","props","Object","values"],"mappings":"AAEA,OAAO,MAAMA,OAAO,GAAIC,KAAD,IAAiD;AACtE,MAAIA,KAAK,KAAKC,SAAV,IAAuBD,KAAK,KAAK,IAArC,EAA2C;AACzC,WAAO,KAAP;AACD;;AACD,MAAI;AACF,QACE,OAAOA,KAAP,KAAiB,QAAjB,IACA,kBAAkBA,KADlB,IAECA,KAAD,CAAyCE,YAAzC,KAA0D,WAH5D,EAIE;AACA,aAAO,IAAP;AACD;AACF,GARD,CAQE,MAAM,CAAE;;AACV,SAAO,KAAP;AACD,CAdM;AAgBP,OAAO,MAAMC,UAAU,GACrBH,KADwB,IAKrB;AACH,MAAIA,KAAJ,EAAW;AACT,WACE,OAAOA,KAAP,KAAiB,QAAjB,IACA,cAAcA,KADd,IAEA,WAAWA,KAFX,IAGCA,KAAD,CAAmCI,QAAnC,KAAgDH,SAHhD,IAICD,KAAD,CAAmCA,KAAnC,KAA6CC,SAL/C;AAOD;;AACD,SAAO,KAAP;AACD,CAhBM;AAkBP,OAAO,MAAMI,UAAU,GAAOC,KAAJ,IAAgC;AACxD,OAAK,MAAMN,KAAX,IAAoBO,MAAM,CAACC,MAAP,CAAcF,KAAd,CAApB,EAA0C;AACxC,QAAIP,OAAO,CAACC,KAAD,CAAP,IAAkBG,UAAU,CAACH,KAAD,CAAhC,EAAyC;AACvC,aAAO,IAAP;AACD;AACF;;AACD,SAAO,KAAP;AACD,CAPM,C,CASP","sourcesContent":["import type { SkiaSelector, SkiaValue } from \"../../../values\";\n\nexport const isValue = (value: unknown): value is SkiaValue<unknown> => {\n if (value === undefined || value === null) {\n return false;\n }\n try {\n if (\n typeof value === \"object\" &&\n \"__typename__\" in value &&\n (value as unknown as SkiaValue<unknown>).__typename__ === \"RNSkValue\"\n ) {\n return true;\n }\n } catch {}\n return false;\n};\n\nexport const isSelector = <T, R>(\n value: unknown\n): value is {\n selector: (v: T) => R;\n value: SkiaValue<T>;\n} => {\n if (value) {\n return (\n typeof value === \"object\" &&\n \"selector\" in value &&\n \"value\" in value &&\n (value as Record<string, unknown>).selector !== undefined &&\n (value as Record<string, unknown>).value !== undefined\n );\n }\n return false;\n};\n\nexport const isAnimated = <T>(props: AnimatedProps<T>) => {\n for (const value of Object.values(props)) {\n if (isValue(value) || isSelector(value)) {\n return true;\n }\n }\n return false;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type AnimatedProp<T, P = any> = T | SkiaValue<T> | SkiaSelector<T, P>;\n\nexport type AnimatedProps<T> = {\n [K in keyof T]: AnimatedProp<T[K]>;\n};\n\n// TODO: switch to AnimatedProps<GroupProps> and remove duplicate properties.\n// For instance matrix in color filter becomes colorMatrix\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport type SkiaProps<P = {}> = AnimatedProps<P>;\n"]}
@@ -1,12 +1,3 @@
1
- export * from "./Transform";
2
1
  export * from "./Animations";
3
- export * from "./Circles";
4
- export * from "./Rects";
5
2
  export * from "./math";
6
- export * from "./Font";
7
- export * from "./Paths";
8
- export * from "./Clips";
9
- export * from "./Radius";
10
- export * from "./Color";
11
- export * from "./Paint";
12
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAd;AACA,cAAc,cAAd;AACA,cAAc,WAAd;AACA,cAAc,SAAd;AACA,cAAc,QAAd;AACA,cAAc,QAAd;AACA,cAAc,SAAd;AACA,cAAc,SAAd;AACA,cAAc,UAAd;AACA,cAAc,SAAd;AACA,cAAc,SAAd","sourcesContent":["export * from \"./Transform\";\nexport * from \"./Animations\";\nexport * from \"./Circles\";\nexport * from \"./Rects\";\nexport * from \"./math\";\nexport * from \"./Font\";\nexport * from \"./Paths\";\nexport * from \"./Clips\";\nexport * from \"./Radius\";\nexport * from \"./Color\";\nexport * from \"./Paint\";\n"]}
1
+ {"version":3,"sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAd;AACA,cAAc,QAAd","sourcesContent":["export * from \"./Animations\";\nexport * from \"./math\";\n"]}
@@ -1,4 +1,4 @@
1
- import { useEffect, useState } from "react";
1
+ import { useEffect, useRef, useState } from "react";
2
2
  import { Image } from "react-native";
3
3
  import { Skia } from "../Skia";
4
4
  import { isRNModule } from "../types";
@@ -30,9 +30,18 @@ const loadData = (source, factory, onError) => {
30
30
  };
31
31
 
32
32
  const useLoading = (source, loader) => {
33
+ const mounted = useRef(false);
33
34
  const [data, setData] = useState(null);
34
35
  useEffect(() => {
35
- loader().then(setData); // eslint-disable-next-line react-hooks/exhaustive-deps
36
+ mounted.current = true;
37
+ loader().then(value => {
38
+ if (mounted.current) {
39
+ setData(value);
40
+ }
41
+ });
42
+ return () => {
43
+ mounted.current = false;
44
+ }; // eslint-disable-next-line react-hooks/exhaustive-deps
36
45
  }, [source]);
37
46
  return data;
38
47
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["Data.ts"],"names":["useEffect","useState","Image","Skia","isRNModule","resolveAsset","source","resolveAssetSource","uri","default","factoryWrapper","data2","factory","onError","factoryResult","Error","loadData","undefined","Promise","resolve","Uint8Array","Data","fromBytes","fromURI","then","d","useLoading","loader","data","setData","useRawData","identity","useData"],"mappings":"AAAA,SAASA,SAAT,EAAoBC,QAApB,QAAoC,OAApC;AACA,SAASC,KAAT,QAAsB,cAAtB;AAEA,SAASC,IAAT,QAAqB,SAArB;AACA,SAASC,UAAT,QAA2B,UAA3B;;AAGA,MAAMC,YAAY,GAAIC,MAAD,IAAwB;AAC3C,SAAOF,UAAU,CAACE,MAAD,CAAV,GACHJ,KAAK,CAACK,kBAAN,CAAyBD,MAAzB,EAAiCE,GAD9B,GAEHF,MAAM,CAACG,OAFX;AAGD,CAJD;;AAMA,MAAMC,cAAc,GAAG,CACrBC,KADqB,EAErBC,OAFqB,EAGrBC,OAHqB,KAIlB;AACH,QAAMC,aAAa,GAAGF,OAAO,CAACD,KAAD,CAA7B;;AACA,MAAIG,aAAa,KAAK,IAAtB,EAA4B;AAC1BD,IAAAA,OAAO,IAAIA,OAAO,CAAC,IAAIE,KAAJ,CAAU,qBAAV,CAAD,CAAlB;AACA,WAAO,IAAP;AACD,GAHD,MAGO;AACL,WAAOD,aAAP;AACD;AACF,CAZD;;AAcA,MAAME,QAAQ,GAAG,CACfV,MADe,EAEfM,OAFe,EAGfC,OAHe,KAIO;AACtB,MAAIP,MAAM,KAAK,IAAX,IAAmBA,MAAM,KAAKW,SAAlC,EAA6C;AAC3C,WAAO,IAAIC,OAAJ,CAAaC,OAAD,IAAaA,OAAO,CAAC,IAAD,CAAhC,CAAP;AACD,GAFD,MAEO,IAAIb,MAAM,YAAYc,UAAtB,EAAkC;AACvC,WAAO,IAAIF,OAAJ,CAAaC,OAAD,IACjBA,OAAO,CAACT,cAAc,CAACP,IAAI,CAACkB,IAAL,CAAUC,SAAV,CAAoBhB,MAApB,CAAD,EAA8BM,OAA9B,EAAuCC,OAAvC,CAAf,CADF,CAAP;AAGD,GAJM,MAIA;AACL,UAAML,GAAG,GAAG,OAAOF,MAAP,KAAkB,QAAlB,GAA6BA,MAA7B,GAAsCD,YAAY,CAACC,MAAD,CAA9D;AACA,WAAOH,IAAI,CAACkB,IAAL,CAAUE,OAAV,CAAkBf,GAAlB,EAAuBgB,IAAvB,CAA6BC,CAAD,IACjCf,cAAc,CAACe,CAAD,EAAIb,OAAJ,EAAaC,OAAb,CADT,CAAP;AAGD;AACF,CAjBD;;AAkBA,MAAMa,UAAU,GAAG,CACjBpB,MADiB,EAEjBqB,MAFiB,KAGd;AACH,QAAM,CAACC,IAAD,EAAOC,OAAP,IAAkB5B,QAAQ,CAAW,IAAX,CAAhC;AACAD,EAAAA,SAAS,CAAC,MAAM;AACd2B,IAAAA,MAAM,GAAGH,IAAT,CAAcK,OAAd,EADc,CAEd;AACD,GAHQ,EAGN,CAACvB,MAAD,CAHM,CAAT;AAIA,SAAOsB,IAAP;AACD,CAVD;;AAYA,OAAO,MAAME,UAAU,GAAG,CACxBxB,MADwB,EAExBM,OAFwB,EAGxBC,OAHwB,KAIrBa,UAAU,CAACpB,MAAD,EAAS,MAAMU,QAAQ,CAACV,MAAD,EAASM,OAAT,EAAkBC,OAAlB,CAAvB,CAJR;;AAMP,MAAMkB,QAAQ,GAAIH,IAAD,IAAkBA,IAAnC;;AAEA,OAAO,MAAMI,OAAO,GAAG,CACrB1B,MADqB,EAErBO,OAFqB,KAGlBiB,UAAU,CAACxB,MAAD,EAASyB,QAAT,EAAmBlB,OAAnB,CAHR","sourcesContent":["import { useEffect, useState } from \"react\";\nimport { Image } from \"react-native\";\n\nimport { Skia } from \"../Skia\";\nimport { isRNModule } from \"../types\";\nimport type { SkData, DataModule, DataSourceParam } from \"../types\";\n\nconst resolveAsset = (source: DataModule) => {\n return isRNModule(source)\n ? Image.resolveAssetSource(source).uri\n : source.default;\n};\n\nconst factoryWrapper = <T>(\n data2: SkData,\n factory: (data: SkData) => T,\n onError?: (err: Error) => void\n) => {\n const factoryResult = factory(data2);\n if (factoryResult === null) {\n onError && onError(new Error(\"Could not load data\"));\n return null;\n } else {\n return factoryResult;\n }\n};\n\nconst loadData = <T>(\n source: DataSourceParam,\n factory: (data: SkData) => T,\n onError?: (err: Error) => void\n): Promise<T | null> => {\n if (source === null || source === undefined) {\n return new Promise((resolve) => resolve(null));\n } else if (source instanceof Uint8Array) {\n return new Promise((resolve) =>\n resolve(factoryWrapper(Skia.Data.fromBytes(source), factory, onError))\n );\n } else {\n const uri = typeof source === \"string\" ? source : resolveAsset(source);\n return Skia.Data.fromURI(uri).then((d) =>\n factoryWrapper(d, factory, onError)\n );\n }\n};\nconst useLoading = <T>(\n source: DataSourceParam,\n loader: () => Promise<T | null>\n) => {\n const [data, setData] = useState<T | null>(null);\n useEffect(() => {\n loader().then(setData);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [source]);\n return data;\n};\n\nexport const useRawData = <T>(\n source: DataSourceParam,\n factory: (data: SkData) => T,\n onError?: (err: Error) => void\n) => useLoading(source, () => loadData(source, factory, onError));\n\nconst identity = (data: SkData) => data;\n\nexport const useData = (\n source: DataSourceParam,\n onError?: (err: Error) => void\n) => useRawData(source, identity, onError);\n"]}
1
+ {"version":3,"sources":["Data.ts"],"names":["useEffect","useRef","useState","Image","Skia","isRNModule","resolveAsset","source","resolveAssetSource","uri","default","factoryWrapper","data2","factory","onError","factoryResult","Error","loadData","undefined","Promise","resolve","Uint8Array","Data","fromBytes","fromURI","then","d","useLoading","loader","mounted","data","setData","current","value","useRawData","identity","useData"],"mappings":"AAAA,SAASA,SAAT,EAAoBC,MAApB,EAA4BC,QAA5B,QAA4C,OAA5C;AACA,SAASC,KAAT,QAAsB,cAAtB;AAEA,SAASC,IAAT,QAAqB,SAArB;AACA,SAASC,UAAT,QAA2B,UAA3B;;AAGA,MAAMC,YAAY,GAAIC,MAAD,IAAwB;AAC3C,SAAOF,UAAU,CAACE,MAAD,CAAV,GACHJ,KAAK,CAACK,kBAAN,CAAyBD,MAAzB,EAAiCE,GAD9B,GAEHF,MAAM,CAACG,OAFX;AAGD,CAJD;;AAMA,MAAMC,cAAc,GAAG,CACrBC,KADqB,EAErBC,OAFqB,EAGrBC,OAHqB,KAIlB;AACH,QAAMC,aAAa,GAAGF,OAAO,CAACD,KAAD,CAA7B;;AACA,MAAIG,aAAa,KAAK,IAAtB,EAA4B;AAC1BD,IAAAA,OAAO,IAAIA,OAAO,CAAC,IAAIE,KAAJ,CAAU,qBAAV,CAAD,CAAlB;AACA,WAAO,IAAP;AACD,GAHD,MAGO;AACL,WAAOD,aAAP;AACD;AACF,CAZD;;AAcA,MAAME,QAAQ,GAAG,CACfV,MADe,EAEfM,OAFe,EAGfC,OAHe,KAIO;AACtB,MAAIP,MAAM,KAAK,IAAX,IAAmBA,MAAM,KAAKW,SAAlC,EAA6C;AAC3C,WAAO,IAAIC,OAAJ,CAAaC,OAAD,IAAaA,OAAO,CAAC,IAAD,CAAhC,CAAP;AACD,GAFD,MAEO,IAAIb,MAAM,YAAYc,UAAtB,EAAkC;AACvC,WAAO,IAAIF,OAAJ,CAAaC,OAAD,IACjBA,OAAO,CAACT,cAAc,CAACP,IAAI,CAACkB,IAAL,CAAUC,SAAV,CAAoBhB,MAApB,CAAD,EAA8BM,OAA9B,EAAuCC,OAAvC,CAAf,CADF,CAAP;AAGD,GAJM,MAIA;AACL,UAAML,GAAG,GAAG,OAAOF,MAAP,KAAkB,QAAlB,GAA6BA,MAA7B,GAAsCD,YAAY,CAACC,MAAD,CAA9D;AACA,WAAOH,IAAI,CAACkB,IAAL,CAAUE,OAAV,CAAkBf,GAAlB,EAAuBgB,IAAvB,CAA6BC,CAAD,IACjCf,cAAc,CAACe,CAAD,EAAIb,OAAJ,EAAaC,OAAb,CADT,CAAP;AAGD;AACF,CAjBD;;AAkBA,MAAMa,UAAU,GAAG,CACjBpB,MADiB,EAEjBqB,MAFiB,KAGd;AACH,QAAMC,OAAO,GAAG5B,MAAM,CAAC,KAAD,CAAtB;AACA,QAAM,CAAC6B,IAAD,EAAOC,OAAP,IAAkB7B,QAAQ,CAAW,IAAX,CAAhC;AACAF,EAAAA,SAAS,CAAC,MAAM;AACd6B,IAAAA,OAAO,CAACG,OAAR,GAAkB,IAAlB;AACAJ,IAAAA,MAAM,GAAGH,IAAT,CAAeQ,KAAD,IAAW;AACvB,UAAIJ,OAAO,CAACG,OAAZ,EAAqB;AACnBD,QAAAA,OAAO,CAACE,KAAD,CAAP;AACD;AACF,KAJD;AAKA,WAAO,MAAM;AACXJ,MAAAA,OAAO,CAACG,OAAR,GAAkB,KAAlB;AACD,KAFD,CAPc,CAUd;AACD,GAXQ,EAWN,CAACzB,MAAD,CAXM,CAAT;AAYA,SAAOuB,IAAP;AACD,CAnBD;;AAqBA,OAAO,MAAMI,UAAU,GAAG,CACxB3B,MADwB,EAExBM,OAFwB,EAGxBC,OAHwB,KAIrBa,UAAU,CAACpB,MAAD,EAAS,MAAMU,QAAQ,CAACV,MAAD,EAASM,OAAT,EAAkBC,OAAlB,CAAvB,CAJR;;AAMP,MAAMqB,QAAQ,GAAIL,IAAD,IAAkBA,IAAnC;;AAEA,OAAO,MAAMM,OAAO,GAAG,CACrB7B,MADqB,EAErBO,OAFqB,KAGlBoB,UAAU,CAAC3B,MAAD,EAAS4B,QAAT,EAAmBrB,OAAnB,CAHR","sourcesContent":["import { useEffect, useRef, useState } from \"react\";\nimport { Image } from \"react-native\";\n\nimport { Skia } from \"../Skia\";\nimport { isRNModule } from \"../types\";\nimport type { SkData, DataModule, DataSourceParam } from \"../types\";\n\nconst resolveAsset = (source: DataModule) => {\n return isRNModule(source)\n ? Image.resolveAssetSource(source).uri\n : source.default;\n};\n\nconst factoryWrapper = <T>(\n data2: SkData,\n factory: (data: SkData) => T,\n onError?: (err: Error) => void\n) => {\n const factoryResult = factory(data2);\n if (factoryResult === null) {\n onError && onError(new Error(\"Could not load data\"));\n return null;\n } else {\n return factoryResult;\n }\n};\n\nconst loadData = <T>(\n source: DataSourceParam,\n factory: (data: SkData) => T,\n onError?: (err: Error) => void\n): Promise<T | null> => {\n if (source === null || source === undefined) {\n return new Promise((resolve) => resolve(null));\n } else if (source instanceof Uint8Array) {\n return new Promise((resolve) =>\n resolve(factoryWrapper(Skia.Data.fromBytes(source), factory, onError))\n );\n } else {\n const uri = typeof source === \"string\" ? source : resolveAsset(source);\n return Skia.Data.fromURI(uri).then((d) =>\n factoryWrapper(d, factory, onError)\n );\n }\n};\nconst useLoading = <T>(\n source: DataSourceParam,\n loader: () => Promise<T | null>\n) => {\n const mounted = useRef(false);\n const [data, setData] = useState<T | null>(null);\n useEffect(() => {\n mounted.current = true;\n loader().then((value) => {\n if (mounted.current) {\n setData(value);\n }\n });\n return () => {\n mounted.current = false;\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [source]);\n return data;\n};\n\nexport const useRawData = <T>(\n source: DataSourceParam,\n factory: (data: SkData) => T,\n onError?: (err: Error) => void\n) => useLoading(source, () => loadData(source, factory, onError));\n\nconst identity = (data: SkData) => data;\n\nexport const useData = (\n source: DataSourceParam,\n onError?: (err: Error) => void\n) => useRawData(source, identity, onError);\n"]}
@@ -7,7 +7,9 @@ export const WithSkiaWeb = _ref => {
7
7
  fallback,
8
8
  opts
9
9
  } = _ref;
10
- const Inner = useMemo(() => /*#__PURE__*/lazy(async () => {
10
+ const Inner = useMemo( // TODO: investigate
11
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
12
+ () => /*#__PURE__*/lazy(async () => {
11
13
  if (Platform.OS === "web") {
12
14
  await LoadSkiaWeb(opts);
13
15
  } else {