@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
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["BackdropFilterNode.ts"],"names":["isColorFilter","NodeType","JsiDrawingNode","JsiDeclarationNode","BackdropFilterNode","constructor","ctx","props","BackdropFilter","deriveProps","draw","canvas","child","_children","filter","materialize","saveLayer","undefined","Skia","ImageFilter","MakeColorFilter","restore"],"mappings":"AAAA,SAASA,aAAT,QAA8B,qBAA9B;AAEA,SAASC,QAAT,QAAyB,aAAzB;AACA,SAASC,cAAT,QAA+B,gBAA/B;AAEA,SAASC,kBAAT,QAAmC,SAAnC;AAEA,OAAO,MAAMC,kBAAN,SAAiCF,cAAjC,CAAqE;AAC1EG,EAAAA,WAAW,CAACC,GAAD,EAAmBC,KAAnB,EAAyC;AAClD,UAAMD,GAAN,EAAWL,QAAQ,CAACO,cAApB,EAAoCD,KAApC;AACD;;AAESE,EAAAA,WAAW,GAAG;AACtB,WAAO,IAAP;AACD;;AAEDC,EAAAA,IAAI,OAA6B;AAAA,QAA5B;AAAEC,MAAAA;AAAF,KAA4B;AAC/B,UAAMC,KAAK,GAAG,KAAKC,SAAL,CAAe,CAAf,CAAd;AACA,UAAMC,MAAM,GACVF,KAAK,YAAYT,kBAAjB,GAAsCS,KAAK,CAACG,WAAN,EAAtC,GAA4D,IAD9D;AAEAJ,IAAAA,MAAM,CAACK,SAAP,CACEC,SADF,EAEE,IAFF,EAGEjB,aAAa,CAACc,MAAD,CAAb,GACI,KAAKI,IAAL,CAAUC,WAAV,CAAsBC,eAAtB,CAAsCN,MAAtC,EAA8C,IAA9C,CADJ,GAEIA,MALN;AAOAH,IAAAA,MAAM,CAACU,OAAP;AACD;;AArByE","sourcesContent":["import { isColorFilter } from \"../../../skia/types\";\nimport type { ChildrenProps, DrawingContext } from \"../../types\";\nimport { NodeType } from \"../../types\";\nimport { JsiDrawingNode } from \"../DrawingNode\";\nimport type { NodeContext } from \"../Node\";\nimport { JsiDeclarationNode } from \"../Node\";\n\nexport class BackdropFilterNode extends JsiDrawingNode<ChildrenProps, null> {\n constructor(ctx: NodeContext, props: ChildrenProps) {\n super(ctx, NodeType.BackdropFilter, props);\n }\n\n protected deriveProps() {\n return null;\n }\n\n draw({ canvas }: DrawingContext) {\n const child = this._children[0];\n const filter =\n child instanceof JsiDeclarationNode ? child.materialize() : null;\n canvas.saveLayer(\n undefined,\n null,\n isColorFilter(filter)\n ? this.Skia.ImageFilter.MakeColorFilter(filter, null)\n : filter\n );\n canvas.restore();\n }\n}\n"]}
@@ -0,0 +1,89 @@
1
+ import { BlurStyle, ClipOp, isRRect } from "../../../skia/types";
2
+ import { DeclarationType, NodeType } from "../../types";
3
+ import { JsiDeclarationNode } from "../Node";
4
+ import { processColor } from "../datatypes";
5
+ import { JsiRenderNode } from "../RenderNode";
6
+
7
+ const inflate = function (Skia, box, dx, dy) {
8
+ let tx = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
9
+ let ty = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
10
+ return Skia.RRectXY(Skia.XYWHRect(box.rect.x - dx + tx, box.rect.y - dy + ty, box.rect.width + 2 * dx, box.rect.height + 2 * dy), box.rx + dx, box.ry + dy);
11
+ };
12
+
13
+ const deflate = function (Skia, box, dx, dy) {
14
+ let tx = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
15
+ let ty = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
16
+ return inflate(Skia, box, -dx, -dy, tx, ty);
17
+ };
18
+
19
+ export class BoxShadowNode extends JsiDeclarationNode {
20
+ constructor(ctx, props) {
21
+ super(ctx, DeclarationType.Unknown, NodeType.Box, props);
22
+ }
23
+
24
+ materialize() {
25
+ return this.props;
26
+ }
27
+
28
+ }
29
+ export class BoxNode extends JsiRenderNode {
30
+ constructor(ctx, props) {
31
+ super(ctx, NodeType.Box, props);
32
+ }
33
+
34
+ renderNode(_ref) {
35
+ let {
36
+ canvas,
37
+ paint,
38
+ opacity
39
+ } = _ref;
40
+ const {
41
+ box: defaultBox
42
+ } = this.props;
43
+ const box = isRRect(defaultBox) ? defaultBox : this.Skia.RRectXY(defaultBox, 0, 0);
44
+
45
+ const shadows = this._children.map(node => {
46
+ if (node instanceof BoxShadowNode) {
47
+ return node.materialize();
48
+ }
49
+
50
+ return null;
51
+ }).filter(n => n !== null);
52
+
53
+ shadows.filter(shadow => !shadow.inner).map(shadow => {
54
+ const {
55
+ color = "black",
56
+ blur,
57
+ spread = 0,
58
+ dx = 0,
59
+ dy = 0
60
+ } = shadow;
61
+ const lPaint = this.Skia.Paint();
62
+ lPaint.setColor(processColor(this.Skia, color, opacity));
63
+ lPaint.setMaskFilter(this.Skia.MaskFilter.MakeBlur(BlurStyle.Normal, blur, true));
64
+ canvas.drawRRect(inflate(this.Skia, box, spread, spread, dx, dy), lPaint);
65
+ });
66
+ canvas.drawRRect(box, paint);
67
+ shadows.filter(shadow => shadow.inner).map(shadow => {
68
+ const {
69
+ color = "black",
70
+ blur,
71
+ spread = 0,
72
+ dx = 0,
73
+ dy = 0
74
+ } = shadow;
75
+ const delta = this.Skia.Point(10 + Math.abs(dx), 10 + Math.abs(dy));
76
+ canvas.save();
77
+ canvas.clipRRect(box, ClipOp.Intersect, false);
78
+ const lPaint = this.Skia.Paint();
79
+ lPaint.setColor(processColor(this.Skia, color, opacity));
80
+ lPaint.setMaskFilter(this.Skia.MaskFilter.MakeBlur(BlurStyle.Normal, blur, true));
81
+ const inner = deflate(this.Skia, box, spread, spread, dx, dy);
82
+ const outer = inflate(this.Skia, box, delta.x, delta.y);
83
+ canvas.drawDRRect(outer, inner, lPaint);
84
+ canvas.restore();
85
+ });
86
+ }
87
+
88
+ }
89
+ //# sourceMappingURL=Box.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["Box.ts"],"names":["BlurStyle","ClipOp","isRRect","DeclarationType","NodeType","JsiDeclarationNode","processColor","JsiRenderNode","inflate","Skia","box","dx","dy","tx","ty","RRectXY","XYWHRect","rect","x","y","width","height","rx","ry","deflate","BoxShadowNode","constructor","ctx","props","Unknown","Box","materialize","BoxNode","renderNode","canvas","paint","opacity","defaultBox","shadows","_children","map","node","filter","n","shadow","inner","color","blur","spread","lPaint","Paint","setColor","setMaskFilter","MaskFilter","MakeBlur","Normal","drawRRect","delta","Point","Math","abs","save","clipRRect","Intersect","outer","drawDRRect","restore"],"mappings":"AACA,SAASA,SAAT,EAAoBC,MAApB,EAA4BC,OAA5B,QAA2C,qBAA3C;AAEA,SAASC,eAAT,EAA0BC,QAA1B,QAA0C,aAA1C;AAGA,SAASC,kBAAT,QAAmC,SAAnC;AACA,SAASC,YAAT,QAA6B,cAA7B;AACA,SAASC,aAAT,QAA8B,eAA9B;;AAEA,MAAMC,OAAO,GAAG,UACdC,IADc,EAEdC,GAFc,EAGdC,EAHc,EAIdC,EAJc;AAAA,MAKdC,EALc,uEAKT,CALS;AAAA,MAMdC,EANc,uEAMT,CANS;AAAA,SAQdL,IAAI,CAACM,OAAL,CACEN,IAAI,CAACO,QAAL,CACEN,GAAG,CAACO,IAAJ,CAASC,CAAT,GAAaP,EAAb,GAAkBE,EADpB,EAEEH,GAAG,CAACO,IAAJ,CAASE,CAAT,GAAaP,EAAb,GAAkBE,EAFpB,EAGEJ,GAAG,CAACO,IAAJ,CAASG,KAAT,GAAiB,IAAIT,EAHvB,EAIED,GAAG,CAACO,IAAJ,CAASI,MAAT,GAAkB,IAAIT,EAJxB,CADF,EAOEF,GAAG,CAACY,EAAJ,GAASX,EAPX,EAQED,GAAG,CAACa,EAAJ,GAASX,EARX,CARc;AAAA,CAAhB;;AAmBA,MAAMY,OAAO,GAAG,UACdf,IADc,EAEdC,GAFc,EAGdC,EAHc,EAIdC,EAJc;AAAA,MAKdC,EALc,uEAKT,CALS;AAAA,MAMdC,EANc,uEAMT,CANS;AAAA,SAOXN,OAAO,CAACC,IAAD,EAAOC,GAAP,EAAY,CAACC,EAAb,EAAiB,CAACC,EAAlB,EAAsBC,EAAtB,EAA0BC,EAA1B,CAPI;AAAA,CAAhB;;AASA,OAAO,MAAMW,aAAN,SAA4BpB,kBAA5B,CAGL;AACAqB,EAAAA,WAAW,CAACC,GAAD,EAAmBC,KAAnB,EAA0C;AACnD,UAAMD,GAAN,EAAWxB,eAAe,CAAC0B,OAA3B,EAAoCzB,QAAQ,CAAC0B,GAA7C,EAAkDF,KAAlD;AACD;;AAEDG,EAAAA,WAAW,GAAG;AACZ,WAAO,KAAKH,KAAZ;AACD;;AAPD;AAUF,OAAO,MAAMI,OAAN,SAAsBzB,aAAtB,CAA8C;AACnDmB,EAAAA,WAAW,CAACC,GAAD,EAAmBC,KAAnB,EAAoC;AAC7C,UAAMD,GAAN,EAAWvB,QAAQ,CAAC0B,GAApB,EAAyBF,KAAzB;AACD;;AAEDK,EAAAA,UAAU,OAA6C;AAAA,QAA5C;AAAEC,MAAAA,MAAF;AAAUC,MAAAA,KAAV;AAAiBC,MAAAA;AAAjB,KAA4C;AACrD,UAAM;AAAE1B,MAAAA,GAAG,EAAE2B;AAAP,QAAsB,KAAKT,KAAjC;AACA,UAAMlB,GAAG,GAAGR,OAAO,CAACmC,UAAD,CAAP,GACRA,UADQ,GAER,KAAK5B,IAAL,CAAUM,OAAV,CAAkBsB,UAAlB,EAA8B,CAA9B,EAAiC,CAAjC,CAFJ;;AAGA,UAAMC,OAAO,GAAG,KAAKC,SAAL,CACbC,GADa,CACRC,IAAD,IAAU;AACb,UAAIA,IAAI,YAAYhB,aAApB,EAAmC;AACjC,eAAOgB,IAAI,CAACV,WAAL,EAAP;AACD;;AACD,aAAO,IAAP;AACD,KANa,EAObW,MAPa,CAOLC,CAAD,IAA4BA,CAAC,KAAK,IAP5B,CAAhB;;AAQAL,IAAAA,OAAO,CACJI,MADH,CACWE,MAAD,IAAY,CAACA,MAAM,CAACC,KAD9B,EAEGL,GAFH,CAEQI,MAAD,IAAY;AACf,YAAM;AAAEE,QAAAA,KAAK,GAAG,OAAV;AAAmBC,QAAAA,IAAnB;AAAyBC,QAAAA,MAAM,GAAG,CAAlC;AAAqCrC,QAAAA,EAAE,GAAG,CAA1C;AAA6CC,QAAAA,EAAE,GAAG;AAAlD,UAAwDgC,MAA9D;AACA,YAAMK,MAAM,GAAG,KAAKxC,IAAL,CAAUyC,KAAV,EAAf;AACAD,MAAAA,MAAM,CAACE,QAAP,CAAgB7C,YAAY,CAAC,KAAKG,IAAN,EAAYqC,KAAZ,EAAmBV,OAAnB,CAA5B;AACAa,MAAAA,MAAM,CAACG,aAAP,CACE,KAAK3C,IAAL,CAAU4C,UAAV,CAAqBC,QAArB,CAA8BtD,SAAS,CAACuD,MAAxC,EAAgDR,IAAhD,EAAsD,IAAtD,CADF;AAGAb,MAAAA,MAAM,CAACsB,SAAP,CACEhD,OAAO,CAAC,KAAKC,IAAN,EAAYC,GAAZ,EAAiBsC,MAAjB,EAAyBA,MAAzB,EAAiCrC,EAAjC,EAAqCC,EAArC,CADT,EAEEqC,MAFF;AAID,KAbH;AAeAf,IAAAA,MAAM,CAACsB,SAAP,CAAiB9C,GAAjB,EAAsByB,KAAtB;AAEAG,IAAAA,OAAO,CACJI,MADH,CACWE,MAAD,IAAYA,MAAM,CAACC,KAD7B,EAEGL,GAFH,CAEQI,MAAD,IAAY;AACf,YAAM;AAAEE,QAAAA,KAAK,GAAG,OAAV;AAAmBC,QAAAA,IAAnB;AAAyBC,QAAAA,MAAM,GAAG,CAAlC;AAAqCrC,QAAAA,EAAE,GAAG,CAA1C;AAA6CC,QAAAA,EAAE,GAAG;AAAlD,UAAwDgC,MAA9D;AACA,YAAMa,KAAK,GAAG,KAAKhD,IAAL,CAAUiD,KAAV,CAAgB,KAAKC,IAAI,CAACC,GAAL,CAASjD,EAAT,CAArB,EAAmC,KAAKgD,IAAI,CAACC,GAAL,CAAShD,EAAT,CAAxC,CAAd;AACAsB,MAAAA,MAAM,CAAC2B,IAAP;AACA3B,MAAAA,MAAM,CAAC4B,SAAP,CAAiBpD,GAAjB,EAAsBT,MAAM,CAAC8D,SAA7B,EAAwC,KAAxC;AACA,YAAMd,MAAM,GAAG,KAAKxC,IAAL,CAAUyC,KAAV,EAAf;AACAD,MAAAA,MAAM,CAACE,QAAP,CAAgB7C,YAAY,CAAC,KAAKG,IAAN,EAAYqC,KAAZ,EAAmBV,OAAnB,CAA5B;AACAa,MAAAA,MAAM,CAACG,aAAP,CACE,KAAK3C,IAAL,CAAU4C,UAAV,CAAqBC,QAArB,CAA8BtD,SAAS,CAACuD,MAAxC,EAAgDR,IAAhD,EAAsD,IAAtD,CADF;AAGA,YAAMF,KAAK,GAAGrB,OAAO,CAAC,KAAKf,IAAN,EAAYC,GAAZ,EAAiBsC,MAAjB,EAAyBA,MAAzB,EAAiCrC,EAAjC,EAAqCC,EAArC,CAArB;AACA,YAAMoD,KAAK,GAAGxD,OAAO,CAAC,KAAKC,IAAN,EAAYC,GAAZ,EAAiB+C,KAAK,CAACvC,CAAvB,EAA0BuC,KAAK,CAACtC,CAAhC,CAArB;AACAe,MAAAA,MAAM,CAAC+B,UAAP,CAAkBD,KAAlB,EAAyBnB,KAAzB,EAAgCI,MAAhC;AACAf,MAAAA,MAAM,CAACgC,OAAP;AACD,KAhBH;AAiBD;;AApDkD","sourcesContent":["import type { SkRRect, Skia } from \"../../../skia/types\";\nimport { BlurStyle, ClipOp, isRRect } from \"../../../skia/types\";\nimport type { DrawingContext } from \"../../types\";\nimport { DeclarationType, NodeType } from \"../../types\";\nimport type { BoxShadowProps, BoxProps } from \"../../types/Drawings\";\nimport type { NodeContext } from \"../Node\";\nimport { JsiDeclarationNode } from \"../Node\";\nimport { processColor } from \"../datatypes\";\nimport { JsiRenderNode } from \"../RenderNode\";\n\nconst inflate = (\n Skia: Skia,\n box: SkRRect,\n dx: number,\n dy: number,\n tx = 0,\n ty = 0\n) =>\n Skia.RRectXY(\n Skia.XYWHRect(\n box.rect.x - dx + tx,\n box.rect.y - dy + ty,\n box.rect.width + 2 * dx,\n box.rect.height + 2 * dy\n ),\n box.rx + dx,\n box.ry + dy\n );\n\nconst deflate = (\n Skia: Skia,\n box: SkRRect,\n dx: number,\n dy: number,\n tx = 0,\n ty = 0\n) => inflate(Skia, box, -dx, -dy, tx, ty);\n\nexport class BoxShadowNode extends JsiDeclarationNode<\n BoxShadowProps,\n BoxShadowProps\n> {\n constructor(ctx: NodeContext, props: BoxShadowProps) {\n super(ctx, DeclarationType.Unknown, NodeType.Box, props);\n }\n\n materialize() {\n return this.props;\n }\n}\n\nexport class BoxNode extends JsiRenderNode<BoxProps> {\n constructor(ctx: NodeContext, props: BoxProps) {\n super(ctx, NodeType.Box, props);\n }\n\n renderNode({ canvas, paint, opacity }: DrawingContext) {\n const { box: defaultBox } = this.props;\n const box = isRRect(defaultBox)\n ? defaultBox\n : this.Skia.RRectXY(defaultBox, 0, 0);\n const shadows = this._children\n .map((node) => {\n if (node instanceof BoxShadowNode) {\n return node.materialize();\n }\n return null;\n })\n .filter((n): n is BoxShadowProps => n !== null);\n shadows\n .filter((shadow) => !shadow.inner)\n .map((shadow) => {\n const { color = \"black\", blur, spread = 0, dx = 0, dy = 0 } = shadow;\n const lPaint = this.Skia.Paint();\n lPaint.setColor(processColor(this.Skia, color, opacity));\n lPaint.setMaskFilter(\n this.Skia.MaskFilter.MakeBlur(BlurStyle.Normal, blur, true)\n );\n canvas.drawRRect(\n inflate(this.Skia, box, spread, spread, dx, dy),\n lPaint\n );\n });\n\n canvas.drawRRect(box, paint);\n\n shadows\n .filter((shadow) => shadow.inner)\n .map((shadow) => {\n const { color = \"black\", blur, spread = 0, dx = 0, dy = 0 } = shadow;\n const delta = this.Skia.Point(10 + Math.abs(dx), 10 + Math.abs(dy));\n canvas.save();\n canvas.clipRRect(box, ClipOp.Intersect, false);\n const lPaint = this.Skia.Paint();\n lPaint.setColor(processColor(this.Skia, color, opacity));\n lPaint.setMaskFilter(\n this.Skia.MaskFilter.MakeBlur(BlurStyle.Normal, blur, true)\n );\n const inner = deflate(this.Skia, box, spread, spread, dx, dy);\n const outer = inflate(this.Skia, box, delta.x, delta.y);\n canvas.drawDRRect(outer, inner, lPaint);\n canvas.restore();\n });\n }\n}\n"]}
@@ -0,0 +1,31 @@
1
+ import { NodeType } from "../../types";
2
+ import { processCircle } from "../datatypes";
3
+ import { JsiDrawingNode } from "../DrawingNode";
4
+ export class CircleNode extends JsiDrawingNode {
5
+ constructor(ctx, props) {
6
+ super(ctx, NodeType.Circle, props);
7
+ }
8
+
9
+ deriveProps() {
10
+ return processCircle(this.Skia, this.props).c;
11
+ }
12
+
13
+ draw(_ref) {
14
+ let {
15
+ canvas,
16
+ paint
17
+ } = _ref;
18
+
19
+ if (!this.derived) {
20
+ throw new Error("CircleNode: c is undefined");
21
+ }
22
+
23
+ const {
24
+ x,
25
+ y
26
+ } = this.derived;
27
+ canvas.drawCircle(x, y, this.props.r, paint);
28
+ }
29
+
30
+ }
31
+ //# sourceMappingURL=CircleNode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["CircleNode.ts"],"names":["NodeType","processCircle","JsiDrawingNode","CircleNode","constructor","ctx","props","Circle","deriveProps","Skia","c","draw","canvas","paint","derived","Error","x","y","drawCircle","r"],"mappings":"AAEA,SAASA,QAAT,QAAyB,aAAzB;AACA,SAASC,aAAT,QAA8B,cAA9B;AACA,SAASC,cAAT,QAA+B,gBAA/B;AAGA,OAAO,MAAMC,UAAN,SAAyBD,cAAzB,CAA8D;AACnEE,EAAAA,WAAW,CAACC,GAAD,EAAmBC,KAAnB,EAAuC;AAChD,UAAMD,GAAN,EAAWL,QAAQ,CAACO,MAApB,EAA4BD,KAA5B;AACD;;AAESE,EAAAA,WAAW,GAAG;AACtB,WAAOP,aAAa,CAAC,KAAKQ,IAAN,EAAY,KAAKH,KAAjB,CAAb,CAAqCI,CAA5C;AACD;;AAEDC,EAAAA,IAAI,OAAoC;AAAA,QAAnC;AAAEC,MAAAA,MAAF;AAAUC,MAAAA;AAAV,KAAmC;;AACtC,QAAI,CAAC,KAAKC,OAAV,EAAmB;AACjB,YAAM,IAAIC,KAAJ,CAAU,4BAAV,CAAN;AACD;;AACD,UAAM;AAAEC,MAAAA,CAAF;AAAKC,MAAAA;AAAL,QAAW,KAAKH,OAAtB;AACAF,IAAAA,MAAM,CAACM,UAAP,CAAkBF,CAAlB,EAAqBC,CAArB,EAAwB,KAAKX,KAAL,CAAWa,CAAnC,EAAsCN,KAAtC;AACD;;AAfkE","sourcesContent":["import type { SkPoint } from \"../../../skia/types\";\nimport type { CircleProps, DrawingContext } from \"../../types\";\nimport { NodeType } from \"../../types\";\nimport { processCircle } from \"../datatypes\";\nimport { JsiDrawingNode } from \"../DrawingNode\";\nimport type { NodeContext } from \"../Node\";\n\nexport class CircleNode extends JsiDrawingNode<CircleProps, SkPoint> {\n constructor(ctx: NodeContext, props: CircleProps) {\n super(ctx, NodeType.Circle, props);\n }\n\n protected deriveProps() {\n return processCircle(this.Skia, this.props).c;\n }\n\n draw({ canvas, paint }: DrawingContext) {\n if (!this.derived) {\n throw new Error(\"CircleNode: c is undefined\");\n }\n const { x, y } = this.derived;\n canvas.drawCircle(x, y, this.props.r, paint);\n }\n}\n"]}
@@ -0,0 +1,17 @@
1
+ import { NodeType } from "../../types";
2
+ import { JsiDrawingNode } from "../DrawingNode";
3
+ export class CustomDrawingNode extends JsiDrawingNode {
4
+ constructor(ctx, props) {
5
+ super(ctx, NodeType.Drawing, props);
6
+ }
7
+
8
+ deriveProps() {
9
+ return null;
10
+ }
11
+
12
+ draw(ctx) {
13
+ this.props.drawing(ctx);
14
+ }
15
+
16
+ }
17
+ //# sourceMappingURL=CustomDrawingNode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["CustomDrawingNode.ts"],"names":["NodeType","JsiDrawingNode","CustomDrawingNode","constructor","ctx","props","Drawing","deriveProps","draw","drawing"],"mappings":"AACA,SAASA,QAAT,QAAyB,aAAzB;AACA,SAASC,cAAT,QAA+B,gBAA/B;AAGA,OAAO,MAAMC,iBAAN,SAAgCD,cAAhC,CAGL;AACAE,EAAAA,WAAW,CAACC,GAAD,EAAmBC,KAAnB,EAAkD;AAC3D,UAAMD,GAAN,EAAWJ,QAAQ,CAACM,OAApB,EAA6BD,KAA7B;AACD;;AAEDE,EAAAA,WAAW,GAAG;AACZ,WAAO,IAAP;AACD;;AAEDC,EAAAA,IAAI,CAACJ,GAAD,EAAsB;AACxB,SAAKC,KAAL,CAAWI,OAAX,CAAmBL,GAAnB;AACD;;AAXD","sourcesContent":["import type { CustomDrawingNodeProps, DrawingContext } from \"../../types\";\nimport { NodeType } from \"../../types\";\nimport { JsiDrawingNode } from \"../DrawingNode\";\nimport type { NodeContext } from \"../Node\";\n\nexport class CustomDrawingNode extends JsiDrawingNode<\n CustomDrawingNodeProps,\n null\n> {\n constructor(ctx: NodeContext, props: CustomDrawingNodeProps) {\n super(ctx, NodeType.Drawing, props);\n }\n\n deriveProps() {\n return null;\n }\n\n draw(ctx: DrawingContext) {\n this.props.drawing(ctx);\n }\n}\n"]}
@@ -0,0 +1,25 @@
1
+ import { NodeType } from "../../types";
2
+ import { JsiDrawingNode } from "../DrawingNode";
3
+ export class DiffRectNode extends JsiDrawingNode {
4
+ constructor(ctx, props) {
5
+ super(ctx, NodeType.DiffRect, props);
6
+ }
7
+
8
+ deriveProps() {
9
+ return null;
10
+ }
11
+
12
+ draw(_ref) {
13
+ let {
14
+ canvas,
15
+ paint
16
+ } = _ref;
17
+ const {
18
+ outer,
19
+ inner
20
+ } = this.props;
21
+ canvas.drawDRRect(outer, inner, paint);
22
+ }
23
+
24
+ }
25
+ //# sourceMappingURL=DiffRectNode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["DiffRectNode.ts"],"names":["NodeType","JsiDrawingNode","DiffRectNode","constructor","ctx","props","DiffRect","deriveProps","draw","canvas","paint","outer","inner","drawDRRect"],"mappings":"AACA,SAASA,QAAT,QAAyB,aAAzB;AACA,SAASC,cAAT,QAA+B,gBAA/B;AAGA,OAAO,MAAMC,YAAN,SAA2BD,cAA3B,CAA+D;AACpEE,EAAAA,WAAW,CAACC,GAAD,EAAmBC,KAAnB,EAAyC;AAClD,UAAMD,GAAN,EAAWJ,QAAQ,CAACM,QAApB,EAA8BD,KAA9B;AACD;;AAEDE,EAAAA,WAAW,GAAG;AACZ,WAAO,IAAP;AACD;;AAEDC,EAAAA,IAAI,OAAoC;AAAA,QAAnC;AAAEC,MAAAA,MAAF;AAAUC,MAAAA;AAAV,KAAmC;AACtC,UAAM;AAAEC,MAAAA,KAAF;AAASC,MAAAA;AAAT,QAAmB,KAAKP,KAA9B;AACAI,IAAAA,MAAM,CAACI,UAAP,CAAkBF,KAAlB,EAAyBC,KAAzB,EAAgCF,KAAhC;AACD;;AAZmE","sourcesContent":["import type { DiffRectProps, DrawingContext } from \"../../types\";\nimport { NodeType } from \"../../types\";\nimport { JsiDrawingNode } from \"../DrawingNode\";\nimport type { NodeContext } from \"../Node\";\n\nexport class DiffRectNode extends JsiDrawingNode<DiffRectProps, null> {\n constructor(ctx: NodeContext, props: DiffRectProps) {\n super(ctx, NodeType.DiffRect, props);\n }\n\n deriveProps() {\n return null;\n }\n\n draw({ canvas, paint }: DrawingContext) {\n const { outer, inner } = this.props;\n canvas.drawDRRect(outer, inner, paint);\n }\n}\n"]}
@@ -0,0 +1,22 @@
1
+ import { NodeType } from "../../types";
2
+ import { JsiDrawingNode } from "../DrawingNode";
3
+ export class FillNode extends JsiDrawingNode {
4
+ constructor(ctx) {
5
+ let props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
6
+ super(ctx, NodeType.Fill, props);
7
+ }
8
+
9
+ deriveProps() {
10
+ return null;
11
+ }
12
+
13
+ draw(_ref) {
14
+ let {
15
+ canvas,
16
+ paint
17
+ } = _ref;
18
+ canvas.drawPaint(paint);
19
+ }
20
+
21
+ }
22
+ //# sourceMappingURL=FillNode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["FillNode.ts"],"names":["NodeType","JsiDrawingNode","FillNode","constructor","ctx","props","Fill","deriveProps","draw","canvas","paint","drawPaint"],"mappings":"AACA,SAASA,QAAT,QAAyB,aAAzB;AACA,SAASC,cAAT,QAA+B,gBAA/B;AAGA,OAAO,MAAMC,QAAN,SAAuBD,cAAvB,CAA8D;AACnEE,EAAAA,WAAW,CAACC,GAAD,EAAiD;AAAA,QAA9BC,KAA8B,uEAAJ,EAAI;AAC1D,UAAMD,GAAN,EAAWJ,QAAQ,CAACM,IAApB,EAA0BD,KAA1B;AACD;;AAEDE,EAAAA,WAAW,GAAG;AACZ,WAAO,IAAP;AACD;;AAEDC,EAAAA,IAAI,OAAoC;AAAA,QAAnC;AAAEC,MAAAA,MAAF;AAAUC,MAAAA;AAAV,KAAmC;AACtCD,IAAAA,MAAM,CAACE,SAAP,CAAiBD,KAAjB;AACD;;AAXkE","sourcesContent":["import type { DrawingContext, DrawingNodeProps } from \"../../types\";\nimport { NodeType } from \"../../types\";\nimport { JsiDrawingNode } from \"../DrawingNode\";\nimport type { NodeContext } from \"../Node\";\n\nexport class FillNode extends JsiDrawingNode<DrawingNodeProps, null> {\n constructor(ctx: NodeContext, props: DrawingNodeProps = {}) {\n super(ctx, NodeType.Fill, props);\n }\n\n deriveProps() {\n return null;\n }\n\n draw({ canvas, paint }: DrawingContext) {\n canvas.drawPaint(paint);\n }\n}\n"]}
@@ -0,0 +1,51 @@
1
+ import { NodeType } from "../../types";
2
+ import { fitRects, processRect } from "../datatypes";
3
+ import { JsiDrawingNode } from "../DrawingNode";
4
+ export class ImageNode extends JsiDrawingNode {
5
+ constructor(ctx, props) {
6
+ super(ctx, NodeType.Image, props);
7
+ }
8
+
9
+ deriveProps() {
10
+ const {
11
+ image,
12
+ fit
13
+ } = this.props;
14
+ const rect = processRect(this.Skia, this.props);
15
+ const {
16
+ src,
17
+ dst
18
+ } = fitRects(fit, {
19
+ x: 0,
20
+ y: 0,
21
+ width: image.width(),
22
+ height: image.height()
23
+ }, rect);
24
+ return {
25
+ src,
26
+ dst
27
+ };
28
+ }
29
+
30
+ draw(_ref) {
31
+ let {
32
+ canvas,
33
+ paint
34
+ } = _ref;
35
+ const {
36
+ image
37
+ } = this.props;
38
+
39
+ if (!this.derived) {
40
+ throw new Error("ImageNode: src and dst are undefined");
41
+ }
42
+
43
+ const {
44
+ src,
45
+ dst
46
+ } = this.derived;
47
+ canvas.drawImageRect(image, src, dst, paint);
48
+ }
49
+
50
+ }
51
+ //# sourceMappingURL=ImageNode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["ImageNode.ts"],"names":["NodeType","fitRects","processRect","JsiDrawingNode","ImageNode","constructor","ctx","props","Image","deriveProps","image","fit","rect","Skia","src","dst","x","y","width","height","draw","canvas","paint","derived","Error","drawImageRect"],"mappings":"AAEA,SAASA,QAAT,QAAyB,aAAzB;AACA,SAASC,QAAT,EAAmBC,WAAnB,QAAsC,cAAtC;AACA,SAASC,cAAT,QAA+B,gBAA/B;AAGA,OAAO,MAAMC,SAAN,SAAwBD,cAAxB,CAGL;AACAE,EAAAA,WAAW,CAACC,GAAD,EAAmBC,KAAnB,EAAsC;AAC/C,UAAMD,GAAN,EAAWN,QAAQ,CAACQ,KAApB,EAA2BD,KAA3B;AACD;;AAEDE,EAAAA,WAAW,GAAG;AACZ,UAAM;AAAEC,MAAAA,KAAF;AAASC,MAAAA;AAAT,QAAiB,KAAKJ,KAA5B;AACA,UAAMK,IAAI,GAAGV,WAAW,CAAC,KAAKW,IAAN,EAAY,KAAKN,KAAjB,CAAxB;AACA,UAAM;AAAEO,MAAAA,GAAF;AAAOC,MAAAA;AAAP,QAAed,QAAQ,CAC3BU,GAD2B,EAE3B;AACEK,MAAAA,CAAC,EAAE,CADL;AAEEC,MAAAA,CAAC,EAAE,CAFL;AAGEC,MAAAA,KAAK,EAAER,KAAK,CAACQ,KAAN,EAHT;AAIEC,MAAAA,MAAM,EAAET,KAAK,CAACS,MAAN;AAJV,KAF2B,EAQ3BP,IAR2B,CAA7B;AAUA,WAAO;AAAEE,MAAAA,GAAF;AAAOC,MAAAA;AAAP,KAAP;AACD;;AAEDK,EAAAA,IAAI,OAAoC;AAAA,QAAnC;AAAEC,MAAAA,MAAF;AAAUC,MAAAA;AAAV,KAAmC;AACtC,UAAM;AAAEZ,MAAAA;AAAF,QAAY,KAAKH,KAAvB;;AACA,QAAI,CAAC,KAAKgB,OAAV,EAAmB;AACjB,YAAM,IAAIC,KAAJ,CAAU,sCAAV,CAAN;AACD;;AACD,UAAM;AAAEV,MAAAA,GAAF;AAAOC,MAAAA;AAAP,QAAe,KAAKQ,OAA1B;AACAF,IAAAA,MAAM,CAACI,aAAP,CAAqBf,KAArB,EAA4BI,GAA5B,EAAiCC,GAAjC,EAAsCO,KAAtC;AACD;;AA5BD","sourcesContent":["import type { SkRect } from \"../../../skia/types\";\nimport type { DrawingContext, ImageProps } from \"../../types\";\nimport { NodeType } from \"../../types\";\nimport { fitRects, processRect } from \"../datatypes\";\nimport { JsiDrawingNode } from \"../DrawingNode\";\nimport type { NodeContext } from \"../Node\";\n\nexport class ImageNode extends JsiDrawingNode<\n ImageProps,\n { src: SkRect; dst: SkRect }\n> {\n constructor(ctx: NodeContext, props: ImageProps) {\n super(ctx, NodeType.Image, props);\n }\n\n deriveProps() {\n const { image, fit } = this.props;\n const rect = processRect(this.Skia, this.props);\n const { src, dst } = fitRects(\n fit,\n {\n x: 0,\n y: 0,\n width: image.width(),\n height: image.height(),\n },\n rect\n );\n return { src, dst };\n }\n\n draw({ canvas, paint }: DrawingContext) {\n const { image } = this.props;\n if (!this.derived) {\n throw new Error(\"ImageNode: src and dst are undefined\");\n }\n const { src, dst } = this.derived;\n canvas.drawImageRect(image, src, dst, paint);\n }\n}\n"]}
@@ -0,0 +1,33 @@
1
+ import { NodeType } from "../../types";
2
+ import { processRect } from "../datatypes";
3
+ import { JsiDrawingNode } from "../DrawingNode";
4
+ export class ImageSVGNode extends JsiDrawingNode {
5
+ constructor(ctx, props) {
6
+ super(ctx, NodeType.ImageSVG, props);
7
+ }
8
+
9
+ deriveProps() {
10
+ return null;
11
+ }
12
+
13
+ draw(_ref) {
14
+ let {
15
+ canvas
16
+ } = _ref;
17
+ const {
18
+ svg
19
+ } = this.props;
20
+ const {
21
+ x,
22
+ y,
23
+ width,
24
+ height
25
+ } = processRect(this.Skia, this.props);
26
+ canvas.save();
27
+ canvas.translate(x, y);
28
+ canvas.drawSvg(svg, width, height);
29
+ canvas.restore();
30
+ }
31
+
32
+ }
33
+ //# sourceMappingURL=ImageSVG.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["ImageSVG.ts"],"names":["NodeType","processRect","JsiDrawingNode","ImageSVGNode","constructor","ctx","props","ImageSVG","deriveProps","draw","canvas","svg","x","y","width","height","Skia","save","translate","drawSvg","restore"],"mappings":"AACA,SAASA,QAAT,QAAyB,aAAzB;AACA,SAASC,WAAT,QAA4B,cAA5B;AACA,SAASC,cAAT,QAA+B,gBAA/B;AAGA,OAAO,MAAMC,YAAN,SAA2BD,cAA3B,CAA+D;AACpEE,EAAAA,WAAW,CAACC,GAAD,EAAmBC,KAAnB,EAAyC;AAClD,UAAMD,GAAN,EAAWL,QAAQ,CAACO,QAApB,EAA8BD,KAA9B;AACD;;AAEDE,EAAAA,WAAW,GAAG;AACZ,WAAO,IAAP;AACD;;AAEDC,EAAAA,IAAI,OAA6B;AAAA,QAA5B;AAAEC,MAAAA;AAAF,KAA4B;AAC/B,UAAM;AAAEC,MAAAA;AAAF,QAAU,KAAKL,KAArB;AACA,UAAM;AAAEM,MAAAA,CAAF;AAAKC,MAAAA,CAAL;AAAQC,MAAAA,KAAR;AAAeC,MAAAA;AAAf,QAA0Bd,WAAW,CAAC,KAAKe,IAAN,EAAY,KAAKV,KAAjB,CAA3C;AACAI,IAAAA,MAAM,CAACO,IAAP;AACAP,IAAAA,MAAM,CAACQ,SAAP,CAAiBN,CAAjB,EAAoBC,CAApB;AACAH,IAAAA,MAAM,CAACS,OAAP,CAAeR,GAAf,EAAoBG,KAApB,EAA2BC,MAA3B;AACAL,IAAAA,MAAM,CAACU,OAAP;AACD;;AAhBmE","sourcesContent":["import type { DrawingContext, ImageSVGProps } from \"../../types\";\nimport { NodeType } from \"../../types\";\nimport { processRect } from \"../datatypes\";\nimport { JsiDrawingNode } from \"../DrawingNode\";\nimport type { NodeContext } from \"../Node\";\n\nexport class ImageSVGNode extends JsiDrawingNode<ImageSVGProps, null> {\n constructor(ctx: NodeContext, props: ImageSVGProps) {\n super(ctx, NodeType.ImageSVG, props);\n }\n\n deriveProps() {\n return null;\n }\n\n draw({ canvas }: DrawingContext) {\n const { svg } = this.props;\n const { x, y, width, height } = processRect(this.Skia, this.props);\n canvas.save();\n canvas.translate(x, y);\n canvas.drawSvg(svg, width, height);\n canvas.restore();\n }\n}\n"]}
@@ -0,0 +1,25 @@
1
+ import { NodeType } from "../../types";
2
+ import { JsiDrawingNode } from "../DrawingNode";
3
+ export class LineNode extends JsiDrawingNode {
4
+ constructor(ctx, props) {
5
+ super(ctx, NodeType.Line, props);
6
+ }
7
+
8
+ deriveProps() {
9
+ return null;
10
+ }
11
+
12
+ draw(_ref) {
13
+ let {
14
+ canvas,
15
+ paint
16
+ } = _ref;
17
+ const {
18
+ p1,
19
+ p2
20
+ } = this.props;
21
+ canvas.drawLine(p1.x, p1.y, p2.x, p2.y, paint);
22
+ }
23
+
24
+ }
25
+ //# sourceMappingURL=LineNode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["LineNode.ts"],"names":["NodeType","JsiDrawingNode","LineNode","constructor","ctx","props","Line","deriveProps","draw","canvas","paint","p1","p2","drawLine","x","y"],"mappings":"AACA,SAASA,QAAT,QAAyB,aAAzB;AACA,SAASC,cAAT,QAA+B,gBAA/B;AAGA,OAAO,MAAMC,QAAN,SAAuBD,cAAvB,CAAuD;AAC5DE,EAAAA,WAAW,CAACC,GAAD,EAAmBC,KAAnB,EAAqC;AAC9C,UAAMD,GAAN,EAAWJ,QAAQ,CAACM,IAApB,EAA0BD,KAA1B;AACD;;AAEDE,EAAAA,WAAW,GAAG;AACZ,WAAO,IAAP;AACD;;AAEDC,EAAAA,IAAI,OAAoC;AAAA,QAAnC;AAAEC,MAAAA,MAAF;AAAUC,MAAAA;AAAV,KAAmC;AACtC,UAAM;AAAEC,MAAAA,EAAF;AAAMC,MAAAA;AAAN,QAAa,KAAKP,KAAxB;AACAI,IAAAA,MAAM,CAACI,QAAP,CAAgBF,EAAE,CAACG,CAAnB,EAAsBH,EAAE,CAACI,CAAzB,EAA4BH,EAAE,CAACE,CAA/B,EAAkCF,EAAE,CAACG,CAArC,EAAwCL,KAAxC;AACD;;AAZ2D","sourcesContent":["import type { DrawingContext, LineProps } from \"../../types\";\nimport { NodeType } from \"../../types\";\nimport { JsiDrawingNode } from \"../DrawingNode\";\nimport type { NodeContext } from \"../Node\";\n\nexport class LineNode extends JsiDrawingNode<LineProps, null> {\n constructor(ctx: NodeContext, props: LineProps) {\n super(ctx, NodeType.Line, props);\n }\n\n deriveProps() {\n return null;\n }\n\n draw({ canvas, paint }: DrawingContext) {\n const { p1, p2 } = this.props;\n canvas.drawLine(p1.x, p1.y, p2.x, p2.y, paint);\n }\n}\n"]}
@@ -0,0 +1,27 @@
1
+ import { NodeType } from "../../types";
2
+ import { processRect } from "../datatypes";
3
+ import { JsiDrawingNode } from "../DrawingNode";
4
+ export class OvalNode extends JsiDrawingNode {
5
+ constructor(ctx, props) {
6
+ super(ctx, NodeType.Oval, props);
7
+ }
8
+
9
+ deriveProps() {
10
+ return processRect(this.Skia, this.props);
11
+ }
12
+
13
+ draw(_ref) {
14
+ let {
15
+ canvas,
16
+ paint
17
+ } = _ref;
18
+
19
+ if (this.derived === undefined) {
20
+ throw new Error("OvalNode: rect is undefined");
21
+ }
22
+
23
+ canvas.drawOval(this.derived, paint);
24
+ }
25
+
26
+ }
27
+ //# sourceMappingURL=OvalNode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["OvalNode.ts"],"names":["NodeType","processRect","JsiDrawingNode","OvalNode","constructor","ctx","props","Oval","deriveProps","Skia","draw","canvas","paint","derived","undefined","Error","drawOval"],"mappings":"AAEA,SAASA,QAAT,QAAyB,aAAzB;AACA,SAASC,WAAT,QAA4B,cAA5B;AACA,SAASC,cAAT,QAA+B,gBAA/B;AAGA,OAAO,MAAMC,QAAN,SAAuBD,cAAvB,CAAyD;AAC9DE,EAAAA,WAAW,CAACC,GAAD,EAAmBC,KAAnB,EAAqC;AAC9C,UAAMD,GAAN,EAAWL,QAAQ,CAACO,IAApB,EAA0BD,KAA1B;AACD;;AAEDE,EAAAA,WAAW,GAAG;AACZ,WAAOP,WAAW,CAAC,KAAKQ,IAAN,EAAY,KAAKH,KAAjB,CAAlB;AACD;;AAEDI,EAAAA,IAAI,OAAoC;AAAA,QAAnC;AAAEC,MAAAA,MAAF;AAAUC,MAAAA;AAAV,KAAmC;;AACtC,QAAI,KAAKC,OAAL,KAAiBC,SAArB,EAAgC;AAC9B,YAAM,IAAIC,KAAJ,CAAU,6BAAV,CAAN;AACD;;AACDJ,IAAAA,MAAM,CAACK,QAAP,CAAgB,KAAKH,OAArB,EAA8BD,KAA9B;AACD;;AAd6D","sourcesContent":["import type { SkRect } from \"../../../skia/types\";\nimport type { DrawingContext, OvalProps } from \"../../types\";\nimport { NodeType } from \"../../types\";\nimport { processRect } from \"../datatypes\";\nimport { JsiDrawingNode } from \"../DrawingNode\";\nimport type { NodeContext } from \"../Node\";\n\nexport class OvalNode extends JsiDrawingNode<OvalProps, SkRect> {\n constructor(ctx: NodeContext, props: OvalProps) {\n super(ctx, NodeType.Oval, props);\n }\n\n deriveProps() {\n return processRect(this.Skia, this.props);\n }\n\n draw({ canvas, paint }: DrawingContext) {\n if (this.derived === undefined) {\n throw new Error(\"OvalNode: rect is undefined\");\n }\n canvas.drawOval(this.derived, paint);\n }\n}\n"]}
@@ -0,0 +1,56 @@
1
+ import { BlendMode } from "../../../skia/types";
2
+ import { NodeType } from "../../types";
3
+ import { ALPHA, enumKey, processColor } from "../datatypes";
4
+ import { JsiDrawingNode } from "../DrawingNode";
5
+ export class PatchNode extends JsiDrawingNode {
6
+ constructor(ctx, props) {
7
+ super(ctx, NodeType.Patch, props);
8
+ }
9
+
10
+ deriveProps() {
11
+ const {
12
+ colors,
13
+ blendMode,
14
+ patch
15
+ } = this.props;
16
+ const defaultBlendMode = colors ? BlendMode.DstOver : BlendMode.SrcOver;
17
+ const mode = blendMode ? BlendMode[enumKey(blendMode)] : defaultBlendMode; // Patch requires a path with the following constraints:
18
+ // M tl
19
+ // C c1 c2 br
20
+ // C c1 c2 bl
21
+ // C c1 c2 tl (the redundant point in the last command is removed)
22
+
23
+ return {
24
+ mode,
25
+ points: [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],
26
+ colors: colors ? colors.map(c => processColor(this.Skia, c, 1)) : undefined
27
+ };
28
+ }
29
+
30
+ draw(_ref) {
31
+ let {
32
+ canvas,
33
+ paint,
34
+ opacity
35
+ } = _ref;
36
+
37
+ if (!this.derived) {
38
+ throw new Error("PatchNode: derived props not set");
39
+ }
40
+
41
+ const {
42
+ texture
43
+ } = this.props;
44
+ const {
45
+ colors,
46
+ points,
47
+ mode
48
+ } = this.derived;
49
+ canvas.drawPatch(points, opacity === 1 ? colors : colors && colors.map(c => {
50
+ c[ALPHA] = c[ALPHA] * opacity;
51
+ return c;
52
+ }), texture, mode, paint);
53
+ }
54
+
55
+ }
56
+ //# sourceMappingURL=PatchNode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["PatchNode.ts"],"names":["BlendMode","NodeType","ALPHA","enumKey","processColor","JsiDrawingNode","PatchNode","constructor","ctx","props","Patch","deriveProps","colors","blendMode","patch","defaultBlendMode","DstOver","SrcOver","mode","points","pos","c2","c1","map","c","Skia","undefined","draw","canvas","paint","opacity","derived","Error","texture","drawPatch"],"mappings":"AACA,SAASA,SAAT,QAA0B,qBAA1B;AAEA,SAASC,QAAT,QAAyB,aAAzB;AACA,SAASC,KAAT,EAAgBC,OAAhB,EAAyBC,YAAzB,QAA6C,cAA7C;AACA,SAASC,cAAT,QAA+B,gBAA/B;AAGA,OAAO,MAAMC,SAAN,SAAwBD,cAAxB,CAGL;AACAE,EAAAA,WAAW,CAACC,GAAD,EAAmBC,KAAnB,EAAsC;AAC/C,UAAMD,GAAN,EAAWP,QAAQ,CAACS,KAApB,EAA2BD,KAA3B;AACD;;AAEDE,EAAAA,WAAW,GAAG;AACZ,UAAM;AAAEC,MAAAA,MAAF;AAAUC,MAAAA,SAAV;AAAqBC,MAAAA;AAArB,QAA+B,KAAKL,KAA1C;AACA,UAAMM,gBAAgB,GAAGH,MAAM,GAAGZ,SAAS,CAACgB,OAAb,GAAuBhB,SAAS,CAACiB,OAAhE;AACA,UAAMC,IAAI,GAAGL,SAAS,GAAGb,SAAS,CAACG,OAAO,CAACU,SAAD,CAAR,CAAZ,GAAmCE,gBAAzD,CAHY,CAIZ;AACA;AACA;AACA;AACA;;AACA,WAAO;AACLG,MAAAA,IADK;AAELC,MAAAA,MAAM,EAAE,CACNL,KAAK,CAAC,CAAD,CAAL,CAASM,GADH,EAENN,KAAK,CAAC,CAAD,CAAL,CAASO,EAFH,EAGNP,KAAK,CAAC,CAAD,CAAL,CAASQ,EAHH,EAINR,KAAK,CAAC,CAAD,CAAL,CAASM,GAJH,EAKNN,KAAK,CAAC,CAAD,CAAL,CAASO,EALH,EAMNP,KAAK,CAAC,CAAD,CAAL,CAASQ,EANH,EAONR,KAAK,CAAC,CAAD,CAAL,CAASM,GAPH,EAQNN,KAAK,CAAC,CAAD,CAAL,CAASO,EARH,EASNP,KAAK,CAAC,CAAD,CAAL,CAASQ,EATH,EAUNR,KAAK,CAAC,CAAD,CAAL,CAASM,GAVH,EAWNN,KAAK,CAAC,CAAD,CAAL,CAASO,EAXH,EAYNP,KAAK,CAAC,CAAD,CAAL,CAASQ,EAZH,CAFH;AAgBLV,MAAAA,MAAM,EAAEA,MAAM,GACVA,MAAM,CAACW,GAAP,CAAYC,CAAD,IAAOpB,YAAY,CAAC,KAAKqB,IAAN,EAAYD,CAAZ,EAAe,CAAf,CAA9B,CADU,GAEVE;AAlBC,KAAP;AAoBD;;AAEDC,EAAAA,IAAI,OAA6C;AAAA,QAA5C;AAAEC,MAAAA,MAAF;AAAUC,MAAAA,KAAV;AAAiBC,MAAAA;AAAjB,KAA4C;;AAC/C,QAAI,CAAC,KAAKC,OAAV,EAAmB;AACjB,YAAM,IAAIC,KAAJ,CAAU,kCAAV,CAAN;AACD;;AACD,UAAM;AAAEC,MAAAA;AAAF,QAAc,KAAKxB,KAAzB;AACA,UAAM;AAAEG,MAAAA,MAAF;AAAUO,MAAAA,MAAV;AAAkBD,MAAAA;AAAlB,QAA2B,KAAKa,OAAtC;AACAH,IAAAA,MAAM,CAACM,SAAP,CACEf,MADF,EAEEW,OAAO,KAAK,CAAZ,GACIlB,MADJ,GAEIA,MAAM,IACJA,MAAM,CAACW,GAAP,CAAYC,CAAD,IAAO;AAChBA,MAAAA,CAAC,CAACtB,KAAD,CAAD,GAAWsB,CAAC,CAACtB,KAAD,CAAD,GAAW4B,OAAtB;AACA,aAAON,CAAP;AACD,KAHD,CALR,EASES,OATF,EAUEf,IAVF,EAWEW,KAXF;AAaD;;AAvDD","sourcesContent":["import type { SkColor, SkPoint } from \"../../../skia/types\";\nimport { BlendMode } from \"../../../skia/types\";\nimport type { DrawingContext, PatchProps } from \"../../types\";\nimport { NodeType } from \"../../types\";\nimport { ALPHA, enumKey, processColor } from \"../datatypes\";\nimport { JsiDrawingNode } from \"../DrawingNode\";\nimport type { NodeContext } from \"../Node\";\n\nexport class PatchNode extends JsiDrawingNode<\n PatchProps,\n { points: SkPoint[]; colors: SkColor[] | undefined; mode: BlendMode }\n> {\n constructor(ctx: NodeContext, props: PatchProps) {\n super(ctx, NodeType.Patch, props);\n }\n\n deriveProps() {\n const { colors, blendMode, patch } = this.props;\n const defaultBlendMode = colors ? BlendMode.DstOver : BlendMode.SrcOver;\n const mode = blendMode ? BlendMode[enumKey(blendMode)] : defaultBlendMode;\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 return {\n mode,\n points: [\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\n ? colors.map((c) => processColor(this.Skia, c, 1))\n : undefined,\n };\n }\n\n draw({ canvas, paint, opacity }: DrawingContext) {\n if (!this.derived) {\n throw new Error(\"PatchNode: derived props not set\");\n }\n const { texture } = this.props;\n const { colors, points, mode } = this.derived;\n canvas.drawPatch(\n points,\n opacity === 1\n ? colors\n : colors &&\n colors.map((c) => {\n c[ALPHA] = c[ALPHA] * opacity;\n return c;\n }),\n texture,\n mode,\n paint\n );\n }\n}\n"]}
@@ -0,0 +1,55 @@
1
+ import { FillType } from "../../../skia/types";
2
+ import { NodeType } from "../../types";
3
+ import { enumKey, processPath } from "../datatypes";
4
+ import { JsiDrawingNode } from "../DrawingNode";
5
+ export class PathNode extends JsiDrawingNode {
6
+ constructor(ctx, props) {
7
+ super(ctx, NodeType.Path, props);
8
+ }
9
+
10
+ deriveProps() {
11
+ const {
12
+ start,
13
+ end,
14
+ fillType,
15
+ stroke,
16
+ ...pathProps
17
+ } = this.props;
18
+ const hasStartOffset = start !== 0;
19
+ const hasEndOffset = end !== 1;
20
+ const hasStrokeOptions = stroke !== undefined;
21
+ const hasFillType = !!fillType;
22
+ const willMutatePath = hasStartOffset || hasEndOffset || hasStrokeOptions || hasFillType;
23
+ const pristinePath = processPath(this.Skia, pathProps.path);
24
+ const path = willMutatePath ? pristinePath.copy() : pristinePath;
25
+
26
+ if (hasFillType) {
27
+ path.setFillType(FillType[enumKey(fillType)]);
28
+ }
29
+
30
+ if (hasStrokeOptions) {
31
+ path.stroke(stroke);
32
+ }
33
+
34
+ if (hasStartOffset || hasEndOffset) {
35
+ path.trim(start, end, false);
36
+ }
37
+
38
+ return path;
39
+ }
40
+
41
+ draw(_ref) {
42
+ let {
43
+ canvas,
44
+ paint
45
+ } = _ref;
46
+
47
+ if (!this.derived) {
48
+ throw new Error("Path not initialized");
49
+ }
50
+
51
+ canvas.drawPath(this.derived, paint);
52
+ }
53
+
54
+ }
55
+ //# sourceMappingURL=PathNode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["PathNode.ts"],"names":["FillType","NodeType","enumKey","processPath","JsiDrawingNode","PathNode","constructor","ctx","props","Path","deriveProps","start","end","fillType","stroke","pathProps","hasStartOffset","hasEndOffset","hasStrokeOptions","undefined","hasFillType","willMutatePath","pristinePath","Skia","path","copy","setFillType","trim","draw","canvas","paint","derived","Error","drawPath"],"mappings":"AAAA,SAASA,QAAT,QAAyB,qBAAzB;AAGA,SAASC,QAAT,QAAyB,aAAzB;AACA,SAASC,OAAT,EAAkBC,WAAlB,QAAqC,cAArC;AACA,SAASC,cAAT,QAA+B,gBAA/B;AAGA,OAAO,MAAMC,QAAN,SAAuBD,cAAvB,CAAyD;AAC9DE,EAAAA,WAAW,CAACC,GAAD,EAAmBC,KAAnB,EAAqC;AAC9C,UAAMD,GAAN,EAAWN,QAAQ,CAACQ,IAApB,EAA0BD,KAA1B;AACD;;AAESE,EAAAA,WAAW,GAAG;AACtB,UAAM;AAAEC,MAAAA,KAAF;AAASC,MAAAA,GAAT;AAAcC,MAAAA,QAAd;AAAwBC,MAAAA,MAAxB;AAAgC,SAAGC;AAAnC,QAAiD,KAAKP,KAA5D;AACA,UAAMQ,cAAc,GAAGL,KAAK,KAAK,CAAjC;AACA,UAAMM,YAAY,GAAGL,GAAG,KAAK,CAA7B;AACA,UAAMM,gBAAgB,GAAGJ,MAAM,KAAKK,SAApC;AACA,UAAMC,WAAW,GAAG,CAAC,CAACP,QAAtB;AACA,UAAMQ,cAAc,GAClBL,cAAc,IAAIC,YAAlB,IAAkCC,gBAAlC,IAAsDE,WADxD;AAEA,UAAME,YAAY,GAAGnB,WAAW,CAAC,KAAKoB,IAAN,EAAYR,SAAS,CAACS,IAAtB,CAAhC;AACA,UAAMA,IAAI,GAAGH,cAAc,GAAGC,YAAY,CAACG,IAAb,EAAH,GAAyBH,YAApD;;AACA,QAAIF,WAAJ,EAAiB;AACfI,MAAAA,IAAI,CAACE,WAAL,CAAiB1B,QAAQ,CAACE,OAAO,CAACW,QAAD,CAAR,CAAzB;AACD;;AACD,QAAIK,gBAAJ,EAAsB;AACpBM,MAAAA,IAAI,CAACV,MAAL,CAAYA,MAAZ;AACD;;AACD,QAAIE,cAAc,IAAIC,YAAtB,EAAoC;AAClCO,MAAAA,IAAI,CAACG,IAAL,CAAUhB,KAAV,EAAiBC,GAAjB,EAAsB,KAAtB;AACD;;AACD,WAAOY,IAAP;AACD;;AAEDI,EAAAA,IAAI,OAAoC;AAAA,QAAnC;AAAEC,MAAAA,MAAF;AAAUC,MAAAA;AAAV,KAAmC;;AACtC,QAAI,CAAC,KAAKC,OAAV,EAAmB;AACjB,YAAM,IAAIC,KAAJ,CAAU,sBAAV,CAAN;AACD;;AACDH,IAAAA,MAAM,CAACI,QAAP,CAAgB,KAAKF,OAArB,EAA8BD,KAA9B;AACD;;AAhC6D","sourcesContent":["import { FillType } from \"../../../skia/types\";\nimport type { SkPath } from \"../../../skia/types\";\nimport type { DrawingContext, PathProps } from \"../../types\";\nimport { NodeType } from \"../../types\";\nimport { enumKey, processPath } from \"../datatypes\";\nimport { JsiDrawingNode } from \"../DrawingNode\";\nimport type { NodeContext } from \"../Node\";\n\nexport class PathNode extends JsiDrawingNode<PathProps, SkPath> {\n constructor(ctx: NodeContext, props: PathProps) {\n super(ctx, NodeType.Path, props);\n }\n\n protected deriveProps() {\n const { start, end, fillType, stroke, ...pathProps } = this.props;\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(this.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 return path;\n }\n\n draw({ canvas, paint }: DrawingContext) {\n if (!this.derived) {\n throw new Error(\"Path not initialized\");\n }\n canvas.drawPath(this.derived, paint);\n }\n}\n"]}
@@ -0,0 +1,23 @@
1
+ import { NodeType } from "../../types";
2
+ import { JsiDrawingNode } from "../DrawingNode";
3
+ export class PictureNode extends JsiDrawingNode {
4
+ constructor(ctx, props) {
5
+ super(ctx, NodeType.Picture, props);
6
+ }
7
+
8
+ deriveProps() {
9
+ return null;
10
+ }
11
+
12
+ draw(_ref) {
13
+ let {
14
+ canvas
15
+ } = _ref;
16
+ const {
17
+ picture
18
+ } = this.props;
19
+ canvas.drawPicture(picture);
20
+ }
21
+
22
+ }
23
+ //# sourceMappingURL=PictureNode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["PictureNode.ts"],"names":["NodeType","JsiDrawingNode","PictureNode","constructor","ctx","props","Picture","deriveProps","draw","canvas","picture","drawPicture"],"mappings":"AACA,SAASA,QAAT,QAAyB,aAAzB;AACA,SAASC,cAAT,QAA+B,gBAA/B;AAGA,OAAO,MAAMC,WAAN,SAA0BD,cAA1B,CAA6D;AAClEE,EAAAA,WAAW,CAACC,GAAD,EAAmBC,KAAnB,EAAwC;AACjD,UAAMD,GAAN,EAAWJ,QAAQ,CAACM,OAApB,EAA6BD,KAA7B;AACD;;AAEDE,EAAAA,WAAW,GAAG;AACZ,WAAO,IAAP;AACD;;AAEDC,EAAAA,IAAI,OAA6B;AAAA,QAA5B;AAAEC,MAAAA;AAAF,KAA4B;AAC/B,UAAM;AAAEC,MAAAA;AAAF,QAAc,KAAKL,KAAzB;AACAI,IAAAA,MAAM,CAACE,WAAP,CAAmBD,OAAnB;AACD;;AAZiE","sourcesContent":["import type { DrawingContext, PictureProps } from \"../../types\";\nimport { NodeType } from \"../../types\";\nimport { JsiDrawingNode } from \"../DrawingNode\";\nimport type { NodeContext } from \"../Node\";\n\nexport class PictureNode extends JsiDrawingNode<PictureProps, null> {\n constructor(ctx: NodeContext, props: PictureProps) {\n super(ctx, NodeType.Picture, props);\n }\n\n deriveProps() {\n return null;\n }\n\n draw({ canvas }: DrawingContext) {\n const { picture } = this.props;\n canvas.drawPicture(picture);\n }\n}\n"]}
@@ -0,0 +1,27 @@
1
+ import { PointMode } from "../../../skia/types";
2
+ import { NodeType } from "../../types";
3
+ import { enumKey } from "../datatypes";
4
+ import { JsiDrawingNode } from "../DrawingNode";
5
+ export class PointsNode extends JsiDrawingNode {
6
+ constructor(ctx, props) {
7
+ super(ctx, NodeType.Points, props);
8
+ }
9
+
10
+ deriveProps() {
11
+ return null;
12
+ }
13
+
14
+ draw(_ref) {
15
+ let {
16
+ canvas,
17
+ paint
18
+ } = _ref;
19
+ const {
20
+ points,
21
+ mode
22
+ } = this.props;
23
+ canvas.drawPoints(PointMode[enumKey(mode)], points, paint);
24
+ }
25
+
26
+ }
27
+ //# sourceMappingURL=PointsNode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["PointsNode.ts"],"names":["PointMode","NodeType","enumKey","JsiDrawingNode","PointsNode","constructor","ctx","props","Points","deriveProps","draw","canvas","paint","points","mode","drawPoints"],"mappings":"AAAA,SAASA,SAAT,QAA0B,qBAA1B;AAEA,SAASC,QAAT,QAAyB,aAAzB;AACA,SAASC,OAAT,QAAwB,cAAxB;AACA,SAASC,cAAT,QAA+B,gBAA/B;AAGA,OAAO,MAAMC,UAAN,SAAyBD,cAAzB,CAA2D;AAChEE,EAAAA,WAAW,CAACC,GAAD,EAAmBC,KAAnB,EAAuC;AAChD,UAAMD,GAAN,EAAWL,QAAQ,CAACO,MAApB,EAA4BD,KAA5B;AACD;;AAEDE,EAAAA,WAAW,GAAG;AACZ,WAAO,IAAP;AACD;;AAEDC,EAAAA,IAAI,OAAoC;AAAA,QAAnC;AAAEC,MAAAA,MAAF;AAAUC,MAAAA;AAAV,KAAmC;AACtC,UAAM;AAAEC,MAAAA,MAAF;AAAUC,MAAAA;AAAV,QAAmB,KAAKP,KAA9B;AACAI,IAAAA,MAAM,CAACI,UAAP,CAAkBf,SAAS,CAACE,OAAO,CAACY,IAAD,CAAR,CAA3B,EAA4CD,MAA5C,EAAoDD,KAApD;AACD;;AAZ+D","sourcesContent":["import { PointMode } from \"../../../skia/types\";\nimport type { DrawingContext, PointsProps } from \"../../types\";\nimport { NodeType } from \"../../types\";\nimport { enumKey } from \"../datatypes\";\nimport { JsiDrawingNode } from \"../DrawingNode\";\nimport type { NodeContext } from \"../Node\";\n\nexport class PointsNode extends JsiDrawingNode<PointsProps, null> {\n constructor(ctx: NodeContext, props: PointsProps) {\n super(ctx, NodeType.Points, props);\n }\n\n deriveProps() {\n return null;\n }\n\n draw({ canvas, paint }: DrawingContext) {\n const { points, mode } = this.props;\n canvas.drawPoints(PointMode[enumKey(mode)], points, paint);\n }\n}\n"]}
@@ -0,0 +1,31 @@
1
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+
3
+ import { NodeType } from "../../types";
4
+ import { processRRect } from "../datatypes";
5
+ import { JsiDrawingNode } from "../DrawingNode";
6
+ export class RRectNode extends JsiDrawingNode {
7
+ constructor(ctx, props) {
8
+ super(ctx, NodeType.RRect, props);
9
+
10
+ _defineProperty(this, "rect", void 0);
11
+ }
12
+
13
+ deriveProps() {
14
+ return processRRect(this.Skia, this.props);
15
+ }
16
+
17
+ draw(_ref) {
18
+ let {
19
+ canvas,
20
+ paint
21
+ } = _ref;
22
+
23
+ if (this.derived === undefined) {
24
+ throw new Error("RRectNode: rect is undefined");
25
+ }
26
+
27
+ canvas.drawRRect(this.derived, paint);
28
+ }
29
+
30
+ }
31
+ //# sourceMappingURL=RRectNode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["RRectNode.ts"],"names":["NodeType","processRRect","JsiDrawingNode","RRectNode","constructor","ctx","props","RRect","deriveProps","Skia","draw","canvas","paint","derived","undefined","Error","drawRRect"],"mappings":";;AAEA,SAASA,QAAT,QAAyB,aAAzB;AACA,SAASC,YAAT,QAA6B,cAA7B;AACA,SAASC,cAAT,QAA+B,gBAA/B;AAGA,OAAO,MAAMC,SAAN,SAAwBD,cAAxB,CAAkE;AAGvEE,EAAAA,WAAW,CAACC,GAAD,EAAmBC,KAAnB,EAA4C;AACrD,UAAMD,GAAN,EAAWL,QAAQ,CAACO,KAApB,EAA2BD,KAA3B;;AADqD;AAEtD;;AAESE,EAAAA,WAAW,GAAG;AACtB,WAAOP,YAAY,CAAC,KAAKQ,IAAN,EAAY,KAAKH,KAAjB,CAAnB;AACD;;AAEDI,EAAAA,IAAI,OAAoC;AAAA,QAAnC;AAAEC,MAAAA,MAAF;AAAUC,MAAAA;AAAV,KAAmC;;AACtC,QAAI,KAAKC,OAAL,KAAiBC,SAArB,EAAgC;AAC9B,YAAM,IAAIC,KAAJ,CAAU,8BAAV,CAAN;AACD;;AACDJ,IAAAA,MAAM,CAACK,SAAP,CAAiB,KAAKH,OAAtB,EAA+BD,KAA/B;AACD;;AAhBsE","sourcesContent":["import type { SkRRect } from \"../../../skia/types\";\nimport type { DrawingContext, RoundedRectProps } from \"../../types\";\nimport { NodeType } from \"../../types\";\nimport { processRRect } from \"../datatypes\";\nimport { JsiDrawingNode } from \"../DrawingNode\";\nimport type { NodeContext } from \"../Node\";\n\nexport class RRectNode extends JsiDrawingNode<RoundedRectProps, SkRRect> {\n rect?: SkRRect;\n\n constructor(ctx: NodeContext, props: RoundedRectProps) {\n super(ctx, NodeType.RRect, props);\n }\n\n protected deriveProps() {\n return processRRect(this.Skia, this.props);\n }\n\n draw({ canvas, paint }: DrawingContext) {\n if (this.derived === undefined) {\n throw new Error(\"RRectNode: rect is undefined\");\n }\n canvas.drawRRect(this.derived, paint);\n }\n}\n"]}