@shopify/react-native-skia 0.1.147 → 0.1.148

Sign up to get free protection for your applications and to get access to all the features.
Files changed (829) hide show
  1. package/lib/commonjs/dom/nodes/DrawingNode.js +84 -0
  2. package/lib/commonjs/dom/nodes/DrawingNode.js.map +1 -0
  3. package/lib/commonjs/dom/nodes/GroupNode.js +28 -0
  4. package/lib/commonjs/dom/nodes/GroupNode.js.map +1 -0
  5. package/lib/commonjs/dom/nodes/JsiSkDOM.js +256 -0
  6. package/lib/commonjs/dom/nodes/JsiSkDOM.js.map +1 -0
  7. package/lib/commonjs/dom/nodes/Node.js +158 -0
  8. package/lib/commonjs/dom/nodes/Node.js.map +1 -0
  9. package/lib/commonjs/dom/nodes/PaintContext.js +6 -0
  10. package/lib/commonjs/dom/nodes/PaintContext.js.map +1 -0
  11. package/lib/commonjs/dom/nodes/PaintNode.js +96 -0
  12. package/lib/commonjs/dom/nodes/PaintNode.js.map +1 -0
  13. package/lib/commonjs/dom/nodes/RenderNode.js +346 -0
  14. package/lib/commonjs/dom/nodes/RenderNode.js.map +1 -0
  15. package/lib/commonjs/{renderer/processors/Circles.js → dom/nodes/datatypes/Circle.js} +4 -2
  16. package/lib/commonjs/dom/nodes/datatypes/Circle.js.map +1 -0
  17. package/lib/commonjs/{renderer/processors → dom/nodes/datatypes}/Color.js +0 -0
  18. package/lib/commonjs/{renderer/processors → dom/nodes/datatypes}/Color.js.map +1 -1
  19. package/lib/commonjs/dom/nodes/datatypes/Enum.js +11 -0
  20. package/lib/commonjs/dom/nodes/datatypes/Enum.js.map +1 -0
  21. package/lib/commonjs/{renderer/components/image/BoxFit.js → dom/nodes/datatypes/Fitting.js} +2 -2
  22. package/lib/commonjs/{renderer/components/image/BoxFit.js.map → dom/nodes/datatypes/Fitting.js.map} +1 -1
  23. package/lib/commonjs/dom/nodes/datatypes/Gradient.js +65 -0
  24. package/lib/commonjs/dom/nodes/datatypes/Gradient.js.map +1 -0
  25. package/lib/commonjs/{renderer/processors/Paths.js → dom/nodes/datatypes/Path.js} +2 -2
  26. package/lib/commonjs/dom/nodes/datatypes/Path.js.map +1 -0
  27. package/lib/commonjs/{renderer/processors → dom/nodes/datatypes}/Radius.js +0 -0
  28. package/lib/commonjs/dom/nodes/datatypes/Radius.js.map +1 -0
  29. package/lib/commonjs/{renderer/processors/Rects.js → dom/nodes/datatypes/Rect.js} +1 -1
  30. package/lib/commonjs/dom/nodes/datatypes/Rect.js.map +1 -0
  31. package/lib/commonjs/dom/nodes/datatypes/Transform.js +42 -0
  32. package/lib/commonjs/dom/nodes/datatypes/Transform.js.map +1 -0
  33. package/lib/commonjs/dom/nodes/datatypes/index.js +123 -0
  34. package/lib/commonjs/dom/nodes/datatypes/index.js.map +1 -0
  35. package/lib/commonjs/dom/nodes/drawings/BackdropFilterNode.js +38 -0
  36. package/lib/commonjs/dom/nodes/drawings/BackdropFilterNode.js.map +1 -0
  37. package/lib/commonjs/dom/nodes/drawings/Box.js +105 -0
  38. package/lib/commonjs/dom/nodes/drawings/Box.js.map +1 -0
  39. package/lib/commonjs/dom/nodes/drawings/CircleNode.js +43 -0
  40. package/lib/commonjs/dom/nodes/drawings/CircleNode.js.map +1 -0
  41. package/lib/commonjs/dom/nodes/drawings/CustomDrawingNode.js +28 -0
  42. package/lib/commonjs/dom/nodes/drawings/CustomDrawingNode.js.map +1 -0
  43. package/lib/commonjs/dom/nodes/drawings/DiffRectNode.js +36 -0
  44. package/lib/commonjs/dom/nodes/drawings/DiffRectNode.js.map +1 -0
  45. package/lib/commonjs/dom/nodes/drawings/FillNode.js +33 -0
  46. package/lib/commonjs/dom/nodes/drawings/FillNode.js.map +1 -0
  47. package/lib/commonjs/dom/nodes/drawings/ImageNode.js +63 -0
  48. package/lib/commonjs/dom/nodes/drawings/ImageNode.js.map +1 -0
  49. package/lib/commonjs/dom/nodes/drawings/ImageSVG.js +45 -0
  50. package/lib/commonjs/dom/nodes/drawings/ImageSVG.js.map +1 -0
  51. package/lib/commonjs/dom/nodes/drawings/LineNode.js +36 -0
  52. package/lib/commonjs/dom/nodes/drawings/LineNode.js.map +1 -0
  53. package/lib/commonjs/dom/nodes/drawings/OvalNode.js +39 -0
  54. package/lib/commonjs/dom/nodes/drawings/OvalNode.js.map +1 -0
  55. package/lib/commonjs/dom/nodes/drawings/PatchNode.js +69 -0
  56. package/lib/commonjs/dom/nodes/drawings/PatchNode.js.map +1 -0
  57. package/lib/commonjs/dom/nodes/drawings/PathNode.js +68 -0
  58. package/lib/commonjs/dom/nodes/drawings/PathNode.js.map +1 -0
  59. package/lib/commonjs/dom/nodes/drawings/PictureNode.js +34 -0
  60. package/lib/commonjs/dom/nodes/drawings/PictureNode.js.map +1 -0
  61. package/lib/commonjs/dom/nodes/drawings/PointsNode.js +40 -0
  62. package/lib/commonjs/dom/nodes/drawings/PointsNode.js.map +1 -0
  63. package/lib/commonjs/dom/nodes/drawings/RRectNode.js +43 -0
  64. package/lib/commonjs/dom/nodes/drawings/RRectNode.js.map +1 -0
  65. package/lib/commonjs/dom/nodes/drawings/RectNode.js +39 -0
  66. package/lib/commonjs/dom/nodes/drawings/RectNode.js.map +1 -0
  67. package/lib/commonjs/dom/nodes/drawings/Text.js +185 -0
  68. package/lib/commonjs/dom/nodes/drawings/Text.js.map +1 -0
  69. package/lib/commonjs/dom/nodes/drawings/VerticesNode.js +55 -0
  70. package/lib/commonjs/dom/nodes/drawings/VerticesNode.js.map +1 -0
  71. package/lib/commonjs/dom/nodes/drawings/index.js +240 -0
  72. package/lib/commonjs/dom/nodes/drawings/index.js.map +1 -0
  73. package/lib/commonjs/dom/nodes/index.js +45 -0
  74. package/lib/commonjs/dom/nodes/index.js.map +1 -0
  75. package/lib/commonjs/dom/nodes/paint/BlendNode.js +82 -0
  76. package/lib/commonjs/dom/nodes/paint/BlendNode.js.map +1 -0
  77. package/lib/commonjs/dom/nodes/paint/ColorFilters.js +152 -0
  78. package/lib/commonjs/dom/nodes/paint/ColorFilters.js.map +1 -0
  79. package/lib/commonjs/dom/nodes/paint/ImageFilters.js +225 -0
  80. package/lib/commonjs/dom/nodes/paint/ImageFilters.js.map +1 -0
  81. package/lib/commonjs/dom/nodes/paint/MaskFilters.js +33 -0
  82. package/lib/commonjs/dom/nodes/paint/MaskFilters.js.map +1 -0
  83. package/lib/commonjs/dom/nodes/paint/PathEffects.js +223 -0
  84. package/lib/commonjs/dom/nodes/paint/PathEffects.js.map +1 -0
  85. package/lib/commonjs/dom/nodes/paint/Shaders.js +242 -0
  86. package/lib/commonjs/dom/nodes/paint/Shaders.js.map +1 -0
  87. package/lib/commonjs/dom/nodes/paint/index.js +84 -0
  88. package/lib/commonjs/dom/nodes/paint/index.js.map +1 -0
  89. package/lib/commonjs/dom/types/ColorFilters.js +6 -0
  90. package/lib/commonjs/dom/types/ColorFilters.js.map +1 -0
  91. package/lib/commonjs/dom/types/Common.js +6 -0
  92. package/lib/commonjs/dom/types/Common.js.map +1 -0
  93. package/lib/commonjs/dom/types/DrawingContext.js +6 -0
  94. package/lib/commonjs/dom/types/DrawingContext.js.map +1 -0
  95. package/lib/commonjs/dom/types/Drawings.js +6 -0
  96. package/lib/commonjs/dom/types/Drawings.js.map +1 -0
  97. package/lib/commonjs/dom/types/ImageFilters.js +6 -0
  98. package/lib/commonjs/dom/types/ImageFilters.js.map +1 -0
  99. package/lib/commonjs/dom/types/MaskFilters.js +6 -0
  100. package/lib/commonjs/dom/types/MaskFilters.js.map +1 -0
  101. package/lib/commonjs/dom/types/Node.js +6 -0
  102. package/lib/commonjs/dom/types/Node.js.map +1 -0
  103. package/lib/commonjs/dom/types/NodeType.js +80 -0
  104. package/lib/commonjs/dom/types/NodeType.js.map +1 -0
  105. package/lib/commonjs/dom/types/PathEffects.js +6 -0
  106. package/lib/commonjs/dom/types/PathEffects.js.map +1 -0
  107. package/lib/commonjs/dom/types/Shaders.js +6 -0
  108. package/lib/commonjs/dom/types/Shaders.js.map +1 -0
  109. package/lib/commonjs/dom/types/SkDOM.js +6 -0
  110. package/lib/commonjs/dom/types/SkDOM.js.map +1 -0
  111. package/lib/commonjs/dom/types/index.js +149 -0
  112. package/lib/commonjs/dom/types/index.js.map +1 -0
  113. package/lib/commonjs/index.js +26 -0
  114. package/lib/commonjs/index.js.map +1 -1
  115. package/lib/commonjs/renderer/Canvas.js +7 -3
  116. package/lib/commonjs/renderer/Canvas.js.map +1 -1
  117. package/lib/commonjs/renderer/Container.js +39 -0
  118. package/lib/commonjs/renderer/Container.js.map +1 -0
  119. package/lib/commonjs/renderer/DependencyManager.js +17 -5
  120. package/lib/commonjs/renderer/DependencyManager.js.map +1 -1
  121. package/lib/commonjs/renderer/HostComponents.js +196 -0
  122. package/lib/commonjs/renderer/HostComponents.js.map +1 -0
  123. package/lib/commonjs/renderer/HostConfig.js +47 -125
  124. package/lib/commonjs/renderer/HostConfig.js.map +1 -1
  125. package/lib/commonjs/renderer/components/Blend.js +1 -46
  126. package/lib/commonjs/renderer/components/Blend.js.map +1 -1
  127. package/lib/commonjs/renderer/components/Drawing.js +1 -15
  128. package/lib/commonjs/renderer/components/Drawing.js.map +1 -1
  129. package/lib/commonjs/renderer/components/Group.js +1 -69
  130. package/lib/commonjs/renderer/components/Group.js.map +1 -1
  131. package/lib/commonjs/renderer/components/Paint.js +2 -14
  132. package/lib/commonjs/renderer/components/Paint.js.map +1 -1
  133. package/lib/commonjs/renderer/components/Picture.js +1 -19
  134. package/lib/commonjs/renderer/components/Picture.js.map +1 -1
  135. package/lib/commonjs/renderer/components/backdrop/BackdropBlur.js.map +1 -1
  136. package/lib/commonjs/renderer/components/backdrop/BackdropFilter.js +2 -32
  137. package/lib/commonjs/renderer/components/backdrop/BackdropFilter.js.map +1 -1
  138. package/lib/commonjs/renderer/components/colorFilters/BlendColor.js +1 -25
  139. package/lib/commonjs/renderer/components/colorFilters/BlendColor.js.map +1 -1
  140. package/lib/commonjs/renderer/components/colorFilters/Lerp.js +1 -23
  141. package/lib/commonjs/renderer/components/colorFilters/Lerp.js.map +1 -1
  142. package/lib/commonjs/renderer/components/colorFilters/LinearToSRGBGamma.js +1 -17
  143. package/lib/commonjs/renderer/components/colorFilters/LinearToSRGBGamma.js.map +1 -1
  144. package/lib/commonjs/renderer/components/colorFilters/LumaColorFilter.js +1 -17
  145. package/lib/commonjs/renderer/components/colorFilters/LumaColorFilter.js.map +1 -1
  146. package/lib/commonjs/renderer/components/colorFilters/Matrix.js +1 -20
  147. package/lib/commonjs/renderer/components/colorFilters/Matrix.js.map +1 -1
  148. package/lib/commonjs/renderer/components/colorFilters/SRGBToLinearGamma.js +1 -17
  149. package/lib/commonjs/renderer/components/colorFilters/SRGBToLinearGamma.js.map +1 -1
  150. package/lib/commonjs/renderer/components/image/Image.js +1 -35
  151. package/lib/commonjs/renderer/components/image/Image.js.map +1 -1
  152. package/lib/commonjs/renderer/components/image/ImageSVG.js +1 -30
  153. package/lib/commonjs/renderer/components/image/ImageSVG.js.map +1 -1
  154. package/lib/commonjs/renderer/components/image/ImageShader.js +1 -61
  155. package/lib/commonjs/renderer/components/image/ImageShader.js.map +1 -1
  156. package/lib/commonjs/renderer/components/image/index.js +0 -13
  157. package/lib/commonjs/renderer/components/image/index.js.map +1 -1
  158. package/lib/commonjs/renderer/components/imageFilters/Blur.js +1 -27
  159. package/lib/commonjs/renderer/components/imageFilters/Blur.js.map +1 -1
  160. package/lib/commonjs/renderer/components/imageFilters/DisplacementMap.js +1 -38
  161. package/lib/commonjs/renderer/components/imageFilters/DisplacementMap.js.map +1 -1
  162. package/lib/commonjs/renderer/components/imageFilters/Morphology.js +1 -25
  163. package/lib/commonjs/renderer/components/imageFilters/Morphology.js.map +1 -1
  164. package/lib/commonjs/renderer/components/imageFilters/Offset.js +1 -20
  165. package/lib/commonjs/renderer/components/imageFilters/Offset.js.map +1 -1
  166. package/lib/commonjs/renderer/components/imageFilters/RuntimeShader.js +1 -28
  167. package/lib/commonjs/renderer/components/imageFilters/RuntimeShader.js.map +1 -1
  168. package/lib/commonjs/renderer/components/imageFilters/Shadow.js +1 -39
  169. package/lib/commonjs/renderer/components/imageFilters/Shadow.js.map +1 -1
  170. package/lib/commonjs/renderer/components/index.js +0 -13
  171. package/lib/commonjs/renderer/components/index.js.map +1 -1
  172. package/lib/commonjs/renderer/components/maskFilters/Blur.js +1 -23
  173. package/lib/commonjs/renderer/components/maskFilters/Blur.js.map +1 -1
  174. package/lib/commonjs/renderer/components/pathEffects/Corner.js +1 -30
  175. package/lib/commonjs/renderer/components/pathEffects/Corner.js.map +1 -1
  176. package/lib/commonjs/renderer/components/pathEffects/Dash.js +1 -27
  177. package/lib/commonjs/renderer/components/pathEffects/Dash.js.map +1 -1
  178. package/lib/commonjs/renderer/components/pathEffects/Discrete.js +1 -28
  179. package/lib/commonjs/renderer/components/pathEffects/Discrete.js.map +1 -1
  180. package/lib/commonjs/renderer/components/pathEffects/Line2D.js +1 -31
  181. package/lib/commonjs/renderer/components/pathEffects/Line2D.js.map +1 -1
  182. package/lib/commonjs/renderer/components/pathEffects/Path1D.js +1 -37
  183. package/lib/commonjs/renderer/components/pathEffects/Path1D.js.map +1 -1
  184. package/lib/commonjs/renderer/components/pathEffects/Path2D.js +1 -33
  185. package/lib/commonjs/renderer/components/pathEffects/Path2D.js.map +1 -1
  186. package/lib/commonjs/renderer/components/pathEffects/Sum.js +1 -17
  187. package/lib/commonjs/renderer/components/pathEffects/Sum.js.map +1 -1
  188. package/lib/commonjs/renderer/components/shaders/Color.js +1 -19
  189. package/lib/commonjs/renderer/components/shaders/Color.js.map +1 -1
  190. package/lib/commonjs/renderer/components/shaders/FractalNoise.js +1 -22
  191. package/lib/commonjs/renderer/components/shaders/FractalNoise.js.map +1 -1
  192. package/lib/commonjs/renderer/components/shaders/LinearGradient.js +1 -28
  193. package/lib/commonjs/renderer/components/shaders/LinearGradient.js.map +1 -1
  194. package/lib/commonjs/renderer/components/shaders/RadialGradient.js +1 -28
  195. package/lib/commonjs/renderer/components/shaders/RadialGradient.js.map +1 -1
  196. package/lib/commonjs/renderer/components/shaders/Shader.js +1 -23
  197. package/lib/commonjs/renderer/components/shaders/Shader.js.map +1 -1
  198. package/lib/commonjs/renderer/components/shaders/SweepGradient.js +1 -29
  199. package/lib/commonjs/renderer/components/shaders/SweepGradient.js.map +1 -1
  200. package/lib/commonjs/renderer/components/shaders/Turbulence.js +1 -22
  201. package/lib/commonjs/renderer/components/shaders/Turbulence.js.map +1 -1
  202. package/lib/commonjs/renderer/components/shaders/TwoPointConicalGradient.js +1 -30
  203. package/lib/commonjs/renderer/components/shaders/TwoPointConicalGradient.js.map +1 -1
  204. package/lib/commonjs/renderer/components/shapes/Box.js +2 -102
  205. package/lib/commonjs/renderer/components/shapes/Box.js.map +1 -1
  206. package/lib/commonjs/renderer/components/shapes/Circle.js +1 -22
  207. package/lib/commonjs/renderer/components/shapes/Circle.js.map +1 -1
  208. package/lib/commonjs/renderer/components/shapes/DiffRect.js +1 -19
  209. package/lib/commonjs/renderer/components/shapes/DiffRect.js.map +1 -1
  210. package/lib/commonjs/renderer/components/shapes/Fill.js +1 -15
  211. package/lib/commonjs/renderer/components/shapes/Fill.js.map +1 -1
  212. package/lib/commonjs/renderer/components/shapes/FitBox.js +3 -3
  213. package/lib/commonjs/renderer/components/shapes/FitBox.js.map +1 -1
  214. package/lib/commonjs/renderer/components/shapes/Line.js +1 -19
  215. package/lib/commonjs/renderer/components/shapes/Line.js.map +1 -1
  216. package/lib/commonjs/renderer/components/shapes/Oval.js +1 -19
  217. package/lib/commonjs/renderer/components/shapes/Oval.js.map +1 -1
  218. package/lib/commonjs/renderer/components/shapes/Patch.js +1 -37
  219. package/lib/commonjs/renderer/components/shapes/Patch.js.map +1 -1
  220. package/lib/commonjs/renderer/components/shapes/Path.js +1 -47
  221. package/lib/commonjs/renderer/components/shapes/Path.js.map +1 -1
  222. package/lib/commonjs/renderer/components/shapes/Points.js +1 -26
  223. package/lib/commonjs/renderer/components/shapes/Points.js.map +1 -1
  224. package/lib/commonjs/renderer/components/shapes/Rect.js +1 -19
  225. package/lib/commonjs/renderer/components/shapes/Rect.js.map +1 -1
  226. package/lib/commonjs/renderer/components/shapes/RoundedRect.js +1 -19
  227. package/lib/commonjs/renderer/components/shapes/RoundedRect.js.map +1 -1
  228. package/lib/commonjs/renderer/components/shapes/Vertices.js +1 -36
  229. package/lib/commonjs/renderer/components/shapes/Vertices.js.map +1 -1
  230. package/lib/commonjs/renderer/components/text/Glyphs.js +1 -39
  231. package/lib/commonjs/renderer/components/text/Glyphs.js.map +1 -1
  232. package/lib/commonjs/renderer/components/text/Text.js +1 -24
  233. package/lib/commonjs/renderer/components/text/Text.js.map +1 -1
  234. package/lib/commonjs/renderer/components/text/TextBlob.js +1 -20
  235. package/lib/commonjs/renderer/components/text/TextBlob.js.map +1 -1
  236. package/lib/commonjs/renderer/components/text/TextPath.js +1 -71
  237. package/lib/commonjs/renderer/components/text/TextPath.js.map +1 -1
  238. package/lib/commonjs/renderer/index.js +0 -13
  239. package/lib/commonjs/renderer/index.js.map +1 -1
  240. package/lib/commonjs/renderer/processors/Animations/Animations.js.map +1 -1
  241. package/lib/commonjs/renderer/processors/index.js +0 -117
  242. package/lib/commonjs/renderer/processors/index.js.map +1 -1
  243. package/lib/commonjs/web/WithSkiaWeb.js +3 -1
  244. package/lib/commonjs/web/WithSkiaWeb.js.map +1 -1
  245. package/lib/module/dom/nodes/DrawingNode.js +72 -0
  246. package/lib/module/dom/nodes/DrawingNode.js.map +1 -0
  247. package/lib/module/dom/nodes/GroupNode.js +17 -0
  248. package/lib/module/dom/nodes/GroupNode.js.map +1 -0
  249. package/lib/module/dom/nodes/JsiSkDOM.js +240 -0
  250. package/lib/module/dom/nodes/JsiSkDOM.js.map +1 -0
  251. package/lib/module/dom/nodes/Node.js +145 -0
  252. package/lib/module/dom/nodes/Node.js.map +1 -0
  253. package/lib/module/dom/nodes/PaintContext.js +2 -0
  254. package/lib/module/dom/nodes/PaintContext.js.map +1 -0
  255. package/lib/module/dom/nodes/PaintNode.js +83 -0
  256. package/lib/module/dom/nodes/PaintNode.js.map +1 -0
  257. package/lib/module/dom/nodes/RenderNode.js +329 -0
  258. package/lib/module/dom/nodes/RenderNode.js.map +1 -0
  259. package/lib/module/{renderer/processors/Circles.js → dom/nodes/datatypes/Circle.js} +2 -3
  260. package/lib/module/dom/nodes/datatypes/Circle.js.map +1 -0
  261. package/lib/module/{renderer/processors → dom/nodes/datatypes}/Color.js +0 -0
  262. package/lib/module/{renderer/processors → dom/nodes/datatypes}/Color.js.map +1 -1
  263. package/lib/module/dom/nodes/datatypes/Enum.js +2 -0
  264. package/lib/module/dom/nodes/datatypes/Enum.js.map +1 -0
  265. package/lib/module/{renderer/components/image/BoxFit.js → dom/nodes/datatypes/Fitting.js} +2 -2
  266. package/lib/module/{renderer/components/image/BoxFit.js.map → dom/nodes/datatypes/Fitting.js.map} +1 -1
  267. package/lib/module/dom/nodes/datatypes/Gradient.js +47 -0
  268. package/lib/module/dom/nodes/datatypes/Gradient.js.map +1 -0
  269. package/lib/module/{renderer/processors/Paths.js → dom/nodes/datatypes/Path.js} +2 -2
  270. package/lib/module/dom/nodes/datatypes/Path.js.map +1 -0
  271. package/lib/module/{renderer/processors → dom/nodes/datatypes}/Radius.js +0 -0
  272. package/lib/module/dom/nodes/datatypes/Radius.js.map +1 -0
  273. package/lib/module/{renderer/processors/Rects.js → dom/nodes/datatypes/Rect.js} +1 -1
  274. package/lib/module/dom/nodes/datatypes/Rect.js.map +1 -0
  275. package/lib/module/dom/nodes/datatypes/Transform.js +32 -0
  276. package/lib/module/dom/nodes/datatypes/Transform.js.map +1 -0
  277. package/lib/module/dom/nodes/datatypes/index.js +10 -0
  278. package/lib/module/dom/nodes/datatypes/index.js.map +1 -0
  279. package/lib/module/dom/nodes/drawings/BackdropFilterNode.js +25 -0
  280. package/lib/module/dom/nodes/drawings/BackdropFilterNode.js.map +1 -0
  281. package/lib/module/dom/nodes/drawings/Box.js +89 -0
  282. package/lib/module/dom/nodes/drawings/Box.js.map +1 -0
  283. package/lib/module/dom/nodes/drawings/CircleNode.js +31 -0
  284. package/lib/module/dom/nodes/drawings/CircleNode.js.map +1 -0
  285. package/lib/module/dom/nodes/drawings/CustomDrawingNode.js +17 -0
  286. package/lib/module/dom/nodes/drawings/CustomDrawingNode.js.map +1 -0
  287. package/lib/module/dom/nodes/drawings/DiffRectNode.js +25 -0
  288. package/lib/module/dom/nodes/drawings/DiffRectNode.js.map +1 -0
  289. package/lib/module/dom/nodes/drawings/FillNode.js +22 -0
  290. package/lib/module/dom/nodes/drawings/FillNode.js.map +1 -0
  291. package/lib/module/dom/nodes/drawings/ImageNode.js +51 -0
  292. package/lib/module/dom/nodes/drawings/ImageNode.js.map +1 -0
  293. package/lib/module/dom/nodes/drawings/ImageSVG.js +33 -0
  294. package/lib/module/dom/nodes/drawings/ImageSVG.js.map +1 -0
  295. package/lib/module/dom/nodes/drawings/LineNode.js +25 -0
  296. package/lib/module/dom/nodes/drawings/LineNode.js.map +1 -0
  297. package/lib/module/dom/nodes/drawings/OvalNode.js +27 -0
  298. package/lib/module/dom/nodes/drawings/OvalNode.js.map +1 -0
  299. package/lib/module/dom/nodes/drawings/PatchNode.js +56 -0
  300. package/lib/module/dom/nodes/drawings/PatchNode.js.map +1 -0
  301. package/lib/module/dom/nodes/drawings/PathNode.js +55 -0
  302. package/lib/module/dom/nodes/drawings/PathNode.js.map +1 -0
  303. package/lib/module/dom/nodes/drawings/PictureNode.js +23 -0
  304. package/lib/module/dom/nodes/drawings/PictureNode.js.map +1 -0
  305. package/lib/module/dom/nodes/drawings/PointsNode.js +27 -0
  306. package/lib/module/dom/nodes/drawings/PointsNode.js.map +1 -0
  307. package/lib/module/dom/nodes/drawings/RRectNode.js +31 -0
  308. package/lib/module/dom/nodes/drawings/RRectNode.js.map +1 -0
  309. package/lib/module/dom/nodes/drawings/RectNode.js +27 -0
  310. package/lib/module/dom/nodes/drawings/RectNode.js.map +1 -0
  311. package/lib/module/dom/nodes/drawings/Text.js +164 -0
  312. package/lib/module/dom/nodes/drawings/Text.js.map +1 -0
  313. package/lib/module/dom/nodes/drawings/VerticesNode.js +42 -0
  314. package/lib/module/dom/nodes/drawings/VerticesNode.js.map +1 -0
  315. package/lib/module/dom/nodes/drawings/index.js +19 -0
  316. package/lib/module/dom/nodes/drawings/index.js.map +1 -0
  317. package/lib/module/dom/nodes/index.js +4 -0
  318. package/lib/module/dom/nodes/index.js.map +1 -0
  319. package/lib/module/dom/nodes/paint/BlendNode.js +66 -0
  320. package/lib/module/dom/nodes/paint/BlendNode.js.map +1 -0
  321. package/lib/module/dom/nodes/paint/ColorFilters.js +120 -0
  322. package/lib/module/dom/nodes/paint/ColorFilters.js.map +1 -0
  323. package/lib/module/dom/nodes/paint/ImageFilters.js +191 -0
  324. package/lib/module/dom/nodes/paint/ImageFilters.js.map +1 -0
  325. package/lib/module/dom/nodes/paint/MaskFilters.js +20 -0
  326. package/lib/module/dom/nodes/paint/MaskFilters.js.map +1 -0
  327. package/lib/module/dom/nodes/paint/PathEffects.js +192 -0
  328. package/lib/module/dom/nodes/paint/PathEffects.js.map +1 -0
  329. package/lib/module/dom/nodes/paint/Shaders.js +201 -0
  330. package/lib/module/dom/nodes/paint/Shaders.js.map +1 -0
  331. package/lib/module/dom/nodes/paint/index.js +7 -0
  332. package/lib/module/dom/nodes/paint/index.js.map +1 -0
  333. package/lib/module/dom/types/ColorFilters.js +2 -0
  334. package/lib/module/dom/types/ColorFilters.js.map +1 -0
  335. package/lib/module/dom/types/Common.js +2 -0
  336. package/lib/module/dom/types/Common.js.map +1 -0
  337. package/lib/module/dom/types/DrawingContext.js +2 -0
  338. package/lib/module/dom/types/DrawingContext.js.map +1 -0
  339. package/lib/module/dom/types/Drawings.js +2 -0
  340. package/lib/module/dom/types/Drawings.js.map +1 -0
  341. package/lib/module/dom/types/ImageFilters.js +2 -0
  342. package/lib/module/dom/types/ImageFilters.js.map +1 -0
  343. package/lib/module/dom/types/MaskFilters.js +2 -0
  344. package/lib/module/dom/types/MaskFilters.js.map +1 -0
  345. package/lib/module/dom/types/Node.js +2 -0
  346. package/lib/module/dom/types/Node.js.map +1 -0
  347. package/lib/module/dom/types/NodeType.js +72 -0
  348. package/lib/module/dom/types/NodeType.js.map +1 -0
  349. package/lib/module/dom/types/PathEffects.js +2 -0
  350. package/lib/module/dom/types/PathEffects.js.map +1 -0
  351. package/lib/module/dom/types/Shaders.js +2 -0
  352. package/lib/module/dom/types/Shaders.js.map +1 -0
  353. package/lib/module/dom/types/SkDOM.js +2 -0
  354. package/lib/module/dom/types/SkDOM.js.map +1 -0
  355. package/lib/module/dom/types/index.js +12 -0
  356. package/lib/module/dom/types/index.js.map +1 -0
  357. package/lib/module/index.js +2 -0
  358. package/lib/module/index.js.map +1 -1
  359. package/lib/module/renderer/Canvas.js +7 -3
  360. package/lib/module/renderer/Canvas.js.map +1 -1
  361. package/lib/module/renderer/Container.js +29 -0
  362. package/lib/module/renderer/Container.js.map +1 -0
  363. package/lib/module/renderer/DependencyManager.js +17 -5
  364. package/lib/module/renderer/DependencyManager.js.map +1 -1
  365. package/lib/module/renderer/HostComponents.js +185 -0
  366. package/lib/module/renderer/HostComponents.js.map +1 -0
  367. package/lib/module/renderer/HostConfig.js +47 -126
  368. package/lib/module/renderer/HostConfig.js.map +1 -1
  369. package/lib/module/renderer/components/Blend.js +1 -42
  370. package/lib/module/renderer/components/Blend.js.map +1 -1
  371. package/lib/module/renderer/components/Drawing.js +1 -13
  372. package/lib/module/renderer/components/Drawing.js.map +1 -1
  373. package/lib/module/renderer/components/Group.js +1 -65
  374. package/lib/module/renderer/components/Group.js.map +1 -1
  375. package/lib/module/renderer/components/Paint.js +3 -12
  376. package/lib/module/renderer/components/Paint.js.map +1 -1
  377. package/lib/module/renderer/components/Picture.js +1 -17
  378. package/lib/module/renderer/components/Picture.js.map +1 -1
  379. package/lib/module/renderer/components/backdrop/BackdropBlur.js.map +1 -1
  380. package/lib/module/renderer/components/backdrop/BackdropFilter.js +2 -30
  381. package/lib/module/renderer/components/backdrop/BackdropFilter.js.map +1 -1
  382. package/lib/module/renderer/components/colorFilters/BlendColor.js +1 -20
  383. package/lib/module/renderer/components/colorFilters/BlendColor.js.map +1 -1
  384. package/lib/module/renderer/components/colorFilters/Lerp.js +1 -19
  385. package/lib/module/renderer/components/colorFilters/Lerp.js.map +1 -1
  386. package/lib/module/renderer/components/colorFilters/LinearToSRGBGamma.js +1 -15
  387. package/lib/module/renderer/components/colorFilters/LinearToSRGBGamma.js.map +1 -1
  388. package/lib/module/renderer/components/colorFilters/LumaColorFilter.js +1 -15
  389. package/lib/module/renderer/components/colorFilters/LumaColorFilter.js.map +1 -1
  390. package/lib/module/renderer/components/colorFilters/Matrix.js +1 -17
  391. package/lib/module/renderer/components/colorFilters/Matrix.js.map +1 -1
  392. package/lib/module/renderer/components/colorFilters/SRGBToLinearGamma.js +1 -15
  393. package/lib/module/renderer/components/colorFilters/SRGBToLinearGamma.js.map +1 -1
  394. package/lib/module/renderer/components/image/Image.js +1 -31
  395. package/lib/module/renderer/components/image/Image.js.map +1 -1
  396. package/lib/module/renderer/components/image/ImageSVG.js +1 -27
  397. package/lib/module/renderer/components/image/ImageSVG.js.map +1 -1
  398. package/lib/module/renderer/components/image/ImageShader.js +1 -57
  399. package/lib/module/renderer/components/image/ImageShader.js.map +1 -1
  400. package/lib/module/renderer/components/image/index.js +0 -1
  401. package/lib/module/renderer/components/image/index.js.map +1 -1
  402. package/lib/module/renderer/components/imageFilters/Blur.js +1 -21
  403. package/lib/module/renderer/components/imageFilters/Blur.js.map +1 -1
  404. package/lib/module/renderer/components/imageFilters/DisplacementMap.js +1 -30
  405. package/lib/module/renderer/components/imageFilters/DisplacementMap.js.map +1 -1
  406. package/lib/module/renderer/components/imageFilters/Morphology.js +1 -21
  407. package/lib/module/renderer/components/imageFilters/Morphology.js.map +1 -1
  408. package/lib/module/renderer/components/imageFilters/Offset.js +1 -17
  409. package/lib/module/renderer/components/imageFilters/Offset.js.map +1 -1
  410. package/lib/module/renderer/components/imageFilters/RuntimeShader.js +1 -24
  411. package/lib/module/renderer/components/imageFilters/RuntimeShader.js.map +1 -1
  412. package/lib/module/renderer/components/imageFilters/Shadow.js +1 -34
  413. package/lib/module/renderer/components/imageFilters/Shadow.js.map +1 -1
  414. package/lib/module/renderer/components/index.js +0 -1
  415. package/lib/module/renderer/components/index.js.map +1 -1
  416. package/lib/module/renderer/components/maskFilters/Blur.js +1 -19
  417. package/lib/module/renderer/components/maskFilters/Blur.js.map +1 -1
  418. package/lib/module/renderer/components/pathEffects/Corner.js +1 -27
  419. package/lib/module/renderer/components/pathEffects/Corner.js.map +1 -1
  420. package/lib/module/renderer/components/pathEffects/Dash.js +1 -24
  421. package/lib/module/renderer/components/pathEffects/Dash.js.map +1 -1
  422. package/lib/module/renderer/components/pathEffects/Discrete.js +1 -25
  423. package/lib/module/renderer/components/pathEffects/Discrete.js.map +1 -1
  424. package/lib/module/renderer/components/pathEffects/Line2D.js +1 -28
  425. package/lib/module/renderer/components/pathEffects/Line2D.js.map +1 -1
  426. package/lib/module/renderer/components/pathEffects/Path1D.js +1 -32
  427. package/lib/module/renderer/components/pathEffects/Path1D.js.map +1 -1
  428. package/lib/module/renderer/components/pathEffects/Path2D.js +1 -29
  429. package/lib/module/renderer/components/pathEffects/Path2D.js.map +1 -1
  430. package/lib/module/renderer/components/pathEffects/Sum.js +1 -14
  431. package/lib/module/renderer/components/pathEffects/Sum.js.map +1 -1
  432. package/lib/module/renderer/components/shaders/Color.js +1 -16
  433. package/lib/module/renderer/components/shaders/Color.js.map +1 -1
  434. package/lib/module/renderer/components/shaders/FractalNoise.js +1 -20
  435. package/lib/module/renderer/components/shaders/FractalNoise.js.map +1 -1
  436. package/lib/module/renderer/components/shaders/LinearGradient.js +1 -25
  437. package/lib/module/renderer/components/shaders/LinearGradient.js.map +1 -1
  438. package/lib/module/renderer/components/shaders/RadialGradient.js +1 -25
  439. package/lib/module/renderer/components/shaders/RadialGradient.js.map +1 -1
  440. package/lib/module/renderer/components/shaders/Shader.js +1 -19
  441. package/lib/module/renderer/components/shaders/Shader.js.map +1 -1
  442. package/lib/module/renderer/components/shaders/SweepGradient.js +1 -26
  443. package/lib/module/renderer/components/shaders/SweepGradient.js.map +1 -1
  444. package/lib/module/renderer/components/shaders/Turbulence.js +1 -20
  445. package/lib/module/renderer/components/shaders/Turbulence.js.map +1 -1
  446. package/lib/module/renderer/components/shaders/TwoPointConicalGradient.js +1 -27
  447. package/lib/module/renderer/components/shaders/TwoPointConicalGradient.js.map +1 -1
  448. package/lib/module/renderer/components/shapes/Box.js +2 -97
  449. package/lib/module/renderer/components/shapes/Box.js.map +1 -1
  450. package/lib/module/renderer/components/shapes/Circle.js +1 -19
  451. package/lib/module/renderer/components/shapes/Circle.js.map +1 -1
  452. package/lib/module/renderer/components/shapes/DiffRect.js +1 -17
  453. package/lib/module/renderer/components/shapes/DiffRect.js.map +1 -1
  454. package/lib/module/renderer/components/shapes/Fill.js +1 -13
  455. package/lib/module/renderer/components/shapes/Fill.js.map +1 -1
  456. package/lib/module/renderer/components/shapes/FitBox.js +1 -1
  457. package/lib/module/renderer/components/shapes/FitBox.js.map +1 -1
  458. package/lib/module/renderer/components/shapes/Line.js +1 -17
  459. package/lib/module/renderer/components/shapes/Line.js.map +1 -1
  460. package/lib/module/renderer/components/shapes/Oval.js +1 -16
  461. package/lib/module/renderer/components/shapes/Oval.js.map +1 -1
  462. package/lib/module/renderer/components/shapes/Patch.js +1 -32
  463. package/lib/module/renderer/components/shapes/Patch.js.map +1 -1
  464. package/lib/module/renderer/components/shapes/Path.js +1 -43
  465. package/lib/module/renderer/components/shapes/Path.js.map +1 -1
  466. package/lib/module/renderer/components/shapes/Points.js +1 -20
  467. package/lib/module/renderer/components/shapes/Points.js.map +1 -1
  468. package/lib/module/renderer/components/shapes/Rect.js +1 -16
  469. package/lib/module/renderer/components/shapes/Rect.js.map +1 -1
  470. package/lib/module/renderer/components/shapes/RoundedRect.js +1 -16
  471. package/lib/module/renderer/components/shapes/RoundedRect.js.map +1 -1
  472. package/lib/module/renderer/components/shapes/Vertices.js +1 -31
  473. package/lib/module/renderer/components/shapes/Vertices.js.map +1 -1
  474. package/lib/module/renderer/components/text/Glyphs.js +1 -37
  475. package/lib/module/renderer/components/text/Glyphs.js.map +1 -1
  476. package/lib/module/renderer/components/text/Text.js +1 -22
  477. package/lib/module/renderer/components/text/Text.js.map +1 -1
  478. package/lib/module/renderer/components/text/TextBlob.js +1 -18
  479. package/lib/module/renderer/components/text/TextBlob.js.map +1 -1
  480. package/lib/module/renderer/components/text/TextPath.js +1 -69
  481. package/lib/module/renderer/components/text/TextPath.js.map +1 -1
  482. package/lib/module/renderer/index.js +0 -1
  483. package/lib/module/renderer/index.js.map +1 -1
  484. package/lib/module/renderer/processors/Animations/Animations.js.map +1 -1
  485. package/lib/module/renderer/processors/index.js +0 -9
  486. package/lib/module/renderer/processors/index.js.map +1 -1
  487. package/lib/module/web/WithSkiaWeb.js +3 -1
  488. package/lib/module/web/WithSkiaWeb.js.map +1 -1
  489. package/lib/typescript/src/dom/nodes/DrawingNode.d.ts +14 -0
  490. package/lib/typescript/src/dom/nodes/GroupNode.d.ts +8 -0
  491. package/lib/typescript/src/dom/nodes/JsiSkDOM.d.ts +70 -0
  492. package/lib/typescript/src/dom/nodes/Node.d.ts +43 -0
  493. package/lib/typescript/src/dom/nodes/PaintContext.d.ts +18 -0
  494. package/lib/typescript/src/dom/nodes/PaintNode.d.ts +8 -0
  495. package/lib/typescript/src/dom/nodes/RenderNode.d.ts +29 -0
  496. package/lib/typescript/src/dom/nodes/datatypes/Circle.d.ts +4 -0
  497. package/lib/typescript/src/{renderer/processors → dom/nodes/datatypes}/Color.d.ts +1 -1
  498. package/lib/typescript/src/dom/nodes/datatypes/Enum.d.ts +1 -0
  499. package/lib/typescript/src/{renderer/components/image/BoxFit.d.ts → dom/nodes/datatypes/Fitting.d.ts} +1 -1
  500. package/lib/typescript/src/{renderer/processors/Transform.d.ts → dom/nodes/datatypes/Gradient.d.ts} +11 -9
  501. package/lib/typescript/src/dom/nodes/datatypes/Path.d.ts +4 -0
  502. package/lib/typescript/src/dom/nodes/datatypes/Radius.d.ts +3 -0
  503. package/lib/typescript/src/dom/nodes/datatypes/Rect.d.ts +5 -0
  504. package/lib/typescript/src/dom/nodes/datatypes/Transform.d.ts +3 -0
  505. package/lib/typescript/src/dom/nodes/datatypes/index.d.ts +9 -0
  506. package/lib/typescript/src/dom/nodes/drawings/BackdropFilterNode.d.ts +8 -0
  507. package/lib/typescript/src/dom/nodes/drawings/Box.d.ts +13 -0
  508. package/lib/typescript/src/dom/nodes/drawings/CircleNode.d.ts +9 -0
  509. package/lib/typescript/src/dom/nodes/drawings/CustomDrawingNode.d.ts +8 -0
  510. package/lib/typescript/src/dom/nodes/drawings/DiffRectNode.d.ts +8 -0
  511. package/lib/typescript/src/dom/nodes/drawings/FillNode.d.ts +8 -0
  512. package/lib/typescript/src/dom/nodes/drawings/ImageNode.d.ts +25 -0
  513. package/lib/typescript/src/dom/nodes/drawings/ImageSVG.d.ts +8 -0
  514. package/lib/typescript/src/dom/nodes/drawings/LineNode.d.ts +8 -0
  515. package/lib/typescript/src/dom/nodes/drawings/OvalNode.d.ts +9 -0
  516. package/lib/typescript/src/dom/nodes/drawings/PatchNode.d.ts +18 -0
  517. package/lib/typescript/src/dom/nodes/drawings/PathNode.d.ts +9 -0
  518. package/lib/typescript/src/dom/nodes/drawings/PictureNode.d.ts +8 -0
  519. package/lib/typescript/src/dom/nodes/drawings/PointsNode.d.ts +8 -0
  520. package/lib/typescript/src/dom/nodes/drawings/RRectNode.d.ts +10 -0
  521. package/lib/typescript/src/dom/nodes/drawings/RectNode.d.ts +9 -0
  522. package/lib/typescript/src/dom/nodes/drawings/Text.d.ts +30 -0
  523. package/lib/typescript/src/dom/nodes/drawings/VerticesNode.d.ts +9 -0
  524. package/lib/typescript/src/dom/nodes/drawings/index.d.ts +18 -0
  525. package/lib/typescript/src/dom/nodes/index.d.ts +3 -0
  526. package/lib/typescript/src/dom/nodes/paint/BlendNode.d.ts +12 -0
  527. package/lib/typescript/src/dom/nodes/paint/ColorFilters.d.ts +36 -0
  528. package/lib/typescript/src/dom/nodes/paint/ImageFilters.d.ts +42 -0
  529. package/lib/typescript/src/dom/nodes/paint/MaskFilters.d.ts +8 -0
  530. package/lib/typescript/src/dom/nodes/paint/PathEffects.d.ts +42 -0
  531. package/lib/typescript/src/dom/nodes/paint/Shaders.d.ts +44 -0
  532. package/lib/typescript/src/dom/nodes/paint/index.d.ts +6 -0
  533. package/lib/typescript/src/dom/types/ColorFilters.d.ts +12 -0
  534. package/lib/typescript/src/dom/types/Common.d.ts +57 -0
  535. package/lib/typescript/src/dom/types/DrawingContext.d.ts +6 -0
  536. package/lib/typescript/src/dom/types/Drawings.d.ts +106 -0
  537. package/lib/typescript/src/dom/types/ImageFilters.d.ts +37 -0
  538. package/lib/typescript/src/dom/types/MaskFilters.d.ts +7 -0
  539. package/lib/typescript/src/dom/types/Node.d.ts +29 -0
  540. package/lib/typescript/src/dom/types/NodeType.d.ts +66 -0
  541. package/lib/typescript/src/dom/types/PathEffects.d.ts +28 -0
  542. package/lib/typescript/src/dom/types/Shaders.d.ts +59 -0
  543. package/lib/typescript/src/dom/types/SkDOM.d.ts +71 -0
  544. package/lib/typescript/src/dom/types/index.d.ts +11 -0
  545. package/lib/typescript/src/index.d.ts +2 -0
  546. package/lib/typescript/src/renderer/Canvas.d.ts +3 -3
  547. package/lib/typescript/src/renderer/Container.d.ts +12 -0
  548. package/lib/typescript/src/renderer/DependencyManager.d.ts +5 -4
  549. package/lib/typescript/src/renderer/HostComponents.d.ts +72 -0
  550. package/lib/typescript/src/renderer/HostConfig.d.ts +5 -13
  551. package/lib/typescript/src/renderer/components/Blend.d.ts +4 -9
  552. package/lib/typescript/src/renderer/components/Drawing.d.ts +2 -6
  553. package/lib/typescript/src/renderer/components/Group.d.ts +4 -9
  554. package/lib/typescript/src/renderer/components/Paint.d.ts +4 -8
  555. package/lib/typescript/src/renderer/components/Picture.d.ts +3 -5
  556. package/lib/typescript/src/renderer/components/backdrop/BackdropBlur.d.ts +2 -1
  557. package/lib/typescript/src/renderer/components/backdrop/BackdropFilter.d.ts +3 -3
  558. package/lib/typescript/src/renderer/components/colorFilters/BlendColor.d.ts +4 -10
  559. package/lib/typescript/src/renderer/components/colorFilters/Lerp.d.ts +4 -7
  560. package/lib/typescript/src/renderer/components/colorFilters/LinearToSRGBGamma.d.ts +3 -4
  561. package/lib/typescript/src/renderer/components/colorFilters/LumaColorFilter.d.ts +3 -4
  562. package/lib/typescript/src/renderer/components/colorFilters/Matrix.d.ts +4 -8
  563. package/lib/typescript/src/renderer/components/colorFilters/SRGBToLinearGamma.d.ts +3 -4
  564. package/lib/typescript/src/renderer/components/image/Image.d.ts +3 -11
  565. package/lib/typescript/src/renderer/components/image/ImageSVG.d.ts +2 -5
  566. package/lib/typescript/src/renderer/components/image/ImageShader.d.ts +3 -15
  567. package/lib/typescript/src/renderer/components/image/index.d.ts +0 -1
  568. package/lib/typescript/src/renderer/components/imageFilters/Blur.d.ts +4 -10
  569. package/lib/typescript/src/renderer/components/imageFilters/DisplacementMap.d.ts +4 -10
  570. package/lib/typescript/src/renderer/components/imageFilters/Morphology.d.ts +4 -8
  571. package/lib/typescript/src/renderer/components/imageFilters/Offset.d.ts +4 -8
  572. package/lib/typescript/src/renderer/components/imageFilters/RuntimeShader.d.ts +3 -7
  573. package/lib/typescript/src/renderer/components/imageFilters/Shadow.d.ts +3 -11
  574. package/lib/typescript/src/renderer/components/index.d.ts +0 -1
  575. package/lib/typescript/src/renderer/components/maskFilters/Blur.d.ts +3 -9
  576. package/lib/typescript/src/renderer/components/pathEffects/Corner.d.ts +4 -7
  577. package/lib/typescript/src/renderer/components/pathEffects/Dash.d.ts +4 -8
  578. package/lib/typescript/src/renderer/components/pathEffects/Discrete.d.ts +4 -9
  579. package/lib/typescript/src/renderer/components/pathEffects/Line2D.d.ts +4 -9
  580. package/lib/typescript/src/renderer/components/pathEffects/Path1D.d.ts +4 -13
  581. package/lib/typescript/src/renderer/components/pathEffects/Path2D.d.ts +4 -10
  582. package/lib/typescript/src/renderer/components/pathEffects/Sum.d.ts +3 -6
  583. package/lib/typescript/src/renderer/components/shaders/Color.d.ts +3 -6
  584. package/lib/typescript/src/renderer/components/shaders/FractalNoise.d.ts +3 -10
  585. package/lib/typescript/src/renderer/components/shaders/LinearGradient.d.ts +3 -8
  586. package/lib/typescript/src/renderer/components/shaders/RadialGradient.d.ts +3 -8
  587. package/lib/typescript/src/renderer/components/shaders/Shader.d.ts +4 -9
  588. package/lib/typescript/src/renderer/components/shaders/SweepGradient.d.ts +3 -9
  589. package/lib/typescript/src/renderer/components/shaders/Turbulence.d.ts +3 -10
  590. package/lib/typescript/src/renderer/components/shaders/TwoPointConicalGradient.d.ts +3 -10
  591. package/lib/typescript/src/renderer/components/shapes/Box.d.ts +4 -21
  592. package/lib/typescript/src/renderer/components/shapes/Circle.d.ts +3 -3
  593. package/lib/typescript/src/renderer/components/shapes/DiffRect.d.ts +3 -8
  594. package/lib/typescript/src/renderer/components/shapes/Fill.d.ts +3 -4
  595. package/lib/typescript/src/renderer/components/shapes/FitBox.d.ts +1 -1
  596. package/lib/typescript/src/renderer/components/shapes/Line.d.ts +3 -7
  597. package/lib/typescript/src/renderer/components/shapes/Oval.d.ts +3 -3
  598. package/lib/typescript/src/renderer/components/shapes/Patch.d.ts +3 -20
  599. package/lib/typescript/src/renderer/components/shapes/Path.d.ts +3 -16
  600. package/lib/typescript/src/renderer/components/shapes/Points.d.ts +3 -9
  601. package/lib/typescript/src/renderer/components/shapes/Rect.d.ts +3 -3
  602. package/lib/typescript/src/renderer/components/shapes/RoundedRect.d.ts +3 -3
  603. package/lib/typescript/src/renderer/components/shapes/Vertices.d.ts +3 -12
  604. package/lib/typescript/src/renderer/components/text/Glyphs.d.ts +3 -13
  605. package/lib/typescript/src/renderer/components/text/Text.d.ts +3 -8
  606. package/lib/typescript/src/renderer/components/text/TextBlob.d.ts +3 -8
  607. package/lib/typescript/src/renderer/components/text/TextPath.d.ts +3 -9
  608. package/lib/typescript/src/renderer/index.d.ts +0 -1
  609. package/lib/typescript/src/renderer/processors/Animations/Animations.d.ts +1 -0
  610. package/lib/typescript/src/renderer/processors/index.d.ts +0 -9
  611. package/package.json +1 -1
  612. package/src/dom/nodes/DrawingNode.ts +72 -0
  613. package/src/dom/nodes/GroupNode.ts +23 -0
  614. package/src/dom/nodes/JsiSkDOM.ts +353 -0
  615. package/src/dom/nodes/Node.ts +158 -0
  616. package/src/dom/nodes/PaintContext.ts +30 -0
  617. package/src/dom/nodes/PaintNode.ts +77 -0
  618. package/src/dom/nodes/RenderNode.ts +349 -0
  619. package/src/{renderer/processors/Circles.ts → dom/nodes/datatypes/Circle.ts} +3 -15
  620. package/src/{renderer/processors → dom/nodes/datatypes}/Color.ts +1 -1
  621. package/src/dom/nodes/datatypes/Enum.ts +2 -0
  622. package/src/{renderer/components/image/BoxFit.ts → dom/nodes/datatypes/Fitting.ts} +2 -11
  623. package/src/dom/nodes/datatypes/Gradient.ts +48 -0
  624. package/src/{renderer/processors/Paths.ts → dom/nodes/datatypes/Path.ts} +3 -4
  625. package/src/{renderer/processors → dom/nodes/datatypes}/Radius.ts +2 -3
  626. package/src/{renderer/processors/Rects.ts → dom/nodes/datatypes/Rect.ts} +2 -16
  627. package/src/dom/nodes/datatypes/Transform.ts +26 -0
  628. package/src/dom/nodes/datatypes/index.ts +9 -0
  629. package/src/dom/nodes/drawings/BackdropFilterNode.ts +30 -0
  630. package/src/dom/nodes/drawings/Box.ts +105 -0
  631. package/src/dom/nodes/drawings/CircleNode.ts +24 -0
  632. package/src/dom/nodes/drawings/CustomDrawingNode.ts +21 -0
  633. package/src/dom/nodes/drawings/DiffRectNode.ts +19 -0
  634. package/src/dom/nodes/drawings/FillNode.ts +18 -0
  635. package/src/dom/nodes/drawings/ImageNode.ts +40 -0
  636. package/src/dom/nodes/drawings/ImageSVG.ts +24 -0
  637. package/src/dom/nodes/drawings/LineNode.ts +19 -0
  638. package/src/dom/nodes/drawings/OvalNode.ts +23 -0
  639. package/src/dom/nodes/drawings/PatchNode.ts +68 -0
  640. package/src/dom/nodes/drawings/PathNode.ts +42 -0
  641. package/src/dom/nodes/drawings/PictureNode.ts +19 -0
  642. package/src/dom/nodes/drawings/PointsNode.ts +21 -0
  643. package/src/dom/nodes/drawings/RRectNode.ts +25 -0
  644. package/src/dom/nodes/drawings/RectNode.ts +23 -0
  645. package/src/dom/nodes/drawings/Text.ts +122 -0
  646. package/src/dom/nodes/drawings/VerticesNode.ts +35 -0
  647. package/src/dom/nodes/drawings/index.ts +18 -0
  648. package/src/dom/nodes/index.ts +3 -0
  649. package/src/dom/nodes/paint/BlendNode.ts +79 -0
  650. package/src/dom/nodes/paint/ColorFilters.ts +130 -0
  651. package/src/dom/nodes/paint/ImageFilters.ts +210 -0
  652. package/src/dom/nodes/paint/MaskFilters.ts +25 -0
  653. package/src/dom/nodes/paint/PathEffects.ts +192 -0
  654. package/src/dom/nodes/paint/Shaders.ts +228 -0
  655. package/src/dom/nodes/paint/index.ts +6 -0
  656. package/src/dom/types/ColorFilters.ts +16 -0
  657. package/src/dom/types/Common.ts +90 -0
  658. package/src/dom/types/DrawingContext.ts +7 -0
  659. package/src/dom/types/Drawings.ts +157 -0
  660. package/src/dom/types/ImageFilters.ts +53 -0
  661. package/src/dom/types/MaskFilters.ts +9 -0
  662. package/src/dom/types/Node.ts +46 -0
  663. package/src/dom/types/NodeType.ts +80 -0
  664. package/src/dom/types/PathEffects.ts +35 -0
  665. package/src/dom/types/Shaders.ts +86 -0
  666. package/src/dom/types/SkDOM.ts +202 -0
  667. package/src/dom/types/index.ts +11 -0
  668. package/src/index.ts +2 -0
  669. package/src/renderer/Canvas.tsx +7 -6
  670. package/src/renderer/Container.tsx +31 -0
  671. package/src/renderer/DependencyManager.tsx +23 -15
  672. package/src/renderer/HostComponents.ts +269 -0
  673. package/src/renderer/HostConfig.ts +60 -123
  674. package/src/renderer/components/Blend.tsx +4 -45
  675. package/src/renderer/components/Drawing.tsx +3 -12
  676. package/src/renderer/components/Group.tsx +4 -79
  677. package/src/renderer/components/Paint.tsx +7 -24
  678. package/src/renderer/components/Picture.tsx +4 -13
  679. package/src/renderer/components/backdrop/BackdropBlur.tsx +2 -1
  680. package/src/renderer/components/backdrop/BackdropFilter.tsx +5 -29
  681. package/src/renderer/components/colorFilters/BlendColor.tsx +4 -26
  682. package/src/renderer/components/colorFilters/Lerp.tsx +4 -23
  683. package/src/renderer/components/colorFilters/LinearToSRGBGamma.tsx +4 -16
  684. package/src/renderer/components/colorFilters/LumaColorFilter.tsx +4 -14
  685. package/src/renderer/components/colorFilters/Matrix.tsx +4 -19
  686. package/src/renderer/components/colorFilters/SRGBToLinearGamma.tsx +4 -16
  687. package/src/renderer/components/image/Image.tsx +4 -40
  688. package/src/renderer/components/image/ImageSVG.tsx +3 -19
  689. package/src/renderer/components/image/ImageShader.tsx +4 -69
  690. package/src/renderer/components/image/index.ts +0 -1
  691. package/src/renderer/components/imageFilters/Blur.tsx +4 -29
  692. package/src/renderer/components/imageFilters/DisplacementMap.tsx +6 -30
  693. package/src/renderer/components/imageFilters/Morphology.tsx +4 -25
  694. package/src/renderer/components/imageFilters/Offset.tsx +4 -19
  695. package/src/renderer/components/imageFilters/RuntimeShader.tsx +6 -27
  696. package/src/renderer/components/imageFilters/Shadow.tsx +4 -38
  697. package/src/renderer/components/index.ts +0 -1
  698. package/src/renderer/components/maskFilters/Blur.tsx +4 -23
  699. package/src/renderer/components/pathEffects/Corner.tsx +4 -27
  700. package/src/renderer/components/pathEffects/Dash.tsx +4 -23
  701. package/src/renderer/components/pathEffects/Discrete.tsx +4 -24
  702. package/src/renderer/components/pathEffects/Line2D.tsx +4 -29
  703. package/src/renderer/components/pathEffects/Path1D.tsx +4 -39
  704. package/src/renderer/components/pathEffects/Path2D.tsx +4 -31
  705. package/src/renderer/components/pathEffects/Sum.tsx +3 -17
  706. package/src/renderer/components/shaders/Color.tsx +4 -16
  707. package/src/renderer/components/shaders/FractalNoise.tsx +4 -26
  708. package/src/renderer/components/shaders/LinearGradient.tsx +4 -29
  709. package/src/renderer/components/shaders/RadialGradient.tsx +4 -29
  710. package/src/renderer/components/shaders/Shader.tsx +4 -24
  711. package/src/renderer/components/shaders/SweepGradient.tsx +4 -32
  712. package/src/renderer/components/shaders/Turbulence.tsx +4 -26
  713. package/src/renderer/components/shaders/TwoPointConicalGradient.tsx +4 -33
  714. package/src/renderer/components/shapes/Box.tsx +6 -109
  715. package/src/renderer/components/shapes/Circle.tsx +4 -16
  716. package/src/renderer/components/shapes/DiffRect.tsx +4 -17
  717. package/src/renderer/components/shapes/Fill.tsx +4 -11
  718. package/src/renderer/components/shapes/FitBox.tsx +2 -2
  719. package/src/renderer/components/shapes/Line.tsx +4 -13
  720. package/src/renderer/components/shapes/Oval.tsx +4 -18
  721. package/src/renderer/components/shapes/Patch.tsx +4 -59
  722. package/src/renderer/components/shapes/Path.tsx +4 -48
  723. package/src/renderer/components/shapes/Points.tsx +4 -20
  724. package/src/renderer/components/shapes/Rect.tsx +4 -18
  725. package/src/renderer/components/shapes/RoundedRect.tsx +4 -17
  726. package/src/renderer/components/shapes/Vertices.tsx +4 -37
  727. package/src/renderer/components/text/Glyphs.tsx +4 -39
  728. package/src/renderer/components/text/Text.tsx +4 -22
  729. package/src/renderer/components/text/TextBlob.tsx +4 -17
  730. package/src/renderer/components/text/TextPath.tsx +4 -59
  731. package/src/renderer/index.ts +0 -1
  732. package/src/renderer/processors/Animations/Animations.ts +5 -0
  733. package/src/renderer/processors/index.ts +0 -9
  734. package/src/web/WithSkiaWeb.tsx +3 -1
  735. package/lib/commonjs/renderer/components/Compose.js +0 -40
  736. package/lib/commonjs/renderer/components/Compose.js.map +0 -1
  737. package/lib/commonjs/renderer/components/colorFilters/Compose.js +0 -24
  738. package/lib/commonjs/renderer/components/colorFilters/Compose.js.map +0 -1
  739. package/lib/commonjs/renderer/components/imageFilters/InnerShadow.js +0 -28
  740. package/lib/commonjs/renderer/components/imageFilters/InnerShadow.js.map +0 -1
  741. package/lib/commonjs/renderer/components/imageFilters/getInput.js +0 -33
  742. package/lib/commonjs/renderer/components/imageFilters/getInput.js.map +0 -1
  743. package/lib/commonjs/renderer/components/shaders/Gradient.js +0 -32
  744. package/lib/commonjs/renderer/components/shaders/Gradient.js.map +0 -1
  745. package/lib/commonjs/renderer/nodes/Container.js +0 -28
  746. package/lib/commonjs/renderer/nodes/Container.js.map +0 -1
  747. package/lib/commonjs/renderer/nodes/Declaration.js +0 -57
  748. package/lib/commonjs/renderer/nodes/Declaration.js.map +0 -1
  749. package/lib/commonjs/renderer/nodes/Drawing.js +0 -56
  750. package/lib/commonjs/renderer/nodes/Drawing.js.map +0 -1
  751. package/lib/commonjs/renderer/nodes/Node.js +0 -73
  752. package/lib/commonjs/renderer/nodes/Node.js.map +0 -1
  753. package/lib/commonjs/renderer/nodes/index.js +0 -58
  754. package/lib/commonjs/renderer/nodes/index.js.map +0 -1
  755. package/lib/commonjs/renderer/processors/Circles.js.map +0 -1
  756. package/lib/commonjs/renderer/processors/Clips.js +0 -24
  757. package/lib/commonjs/renderer/processors/Clips.js.map +0 -1
  758. package/lib/commonjs/renderer/processors/Font.js +0 -13
  759. package/lib/commonjs/renderer/processors/Font.js.map +0 -1
  760. package/lib/commonjs/renderer/processors/Paint.js +0 -98
  761. package/lib/commonjs/renderer/processors/Paint.js.map +0 -1
  762. package/lib/commonjs/renderer/processors/Paths.js.map +0 -1
  763. package/lib/commonjs/renderer/processors/Radius.js.map +0 -1
  764. package/lib/commonjs/renderer/processors/Rects.js.map +0 -1
  765. package/lib/commonjs/renderer/processors/Transform.js +0 -58
  766. package/lib/commonjs/renderer/processors/Transform.js.map +0 -1
  767. package/lib/module/renderer/components/Compose.js +0 -25
  768. package/lib/module/renderer/components/Compose.js.map +0 -1
  769. package/lib/module/renderer/components/colorFilters/Compose.js +0 -14
  770. package/lib/module/renderer/components/colorFilters/Compose.js.map +0 -1
  771. package/lib/module/renderer/components/imageFilters/InnerShadow.js +0 -17
  772. package/lib/module/renderer/components/imageFilters/InnerShadow.js.map +0 -1
  773. package/lib/module/renderer/components/imageFilters/getInput.js +0 -23
  774. package/lib/module/renderer/components/imageFilters/getInput.js.map +0 -1
  775. package/lib/module/renderer/components/shaders/Gradient.js +0 -20
  776. package/lib/module/renderer/components/shaders/Gradient.js.map +0 -1
  777. package/lib/module/renderer/nodes/Container.js +0 -18
  778. package/lib/module/renderer/nodes/Container.js.map +0 -1
  779. package/lib/module/renderer/nodes/Declaration.js +0 -36
  780. package/lib/module/renderer/nodes/Declaration.js.map +0 -1
  781. package/lib/module/renderer/nodes/Drawing.js +0 -37
  782. package/lib/module/renderer/nodes/Drawing.js.map +0 -1
  783. package/lib/module/renderer/nodes/Node.js +0 -63
  784. package/lib/module/renderer/nodes/Node.js.map +0 -1
  785. package/lib/module/renderer/nodes/index.js +0 -5
  786. package/lib/module/renderer/nodes/index.js.map +0 -1
  787. package/lib/module/renderer/processors/Circles.js.map +0 -1
  788. package/lib/module/renderer/processors/Clips.js +0 -13
  789. package/lib/module/renderer/processors/Clips.js.map +0 -1
  790. package/lib/module/renderer/processors/Font.js +0 -4
  791. package/lib/module/renderer/processors/Font.js.map +0 -1
  792. package/lib/module/renderer/processors/Paint.js +0 -84
  793. package/lib/module/renderer/processors/Paint.js.map +0 -1
  794. package/lib/module/renderer/processors/Paths.js.map +0 -1
  795. package/lib/module/renderer/processors/Radius.js.map +0 -1
  796. package/lib/module/renderer/processors/Rects.js.map +0 -1
  797. package/lib/module/renderer/processors/Transform.js +0 -42
  798. package/lib/module/renderer/processors/Transform.js.map +0 -1
  799. package/lib/typescript/src/renderer/components/Compose.d.ts +0 -6
  800. package/lib/typescript/src/renderer/components/colorFilters/Compose.d.ts +0 -3
  801. package/lib/typescript/src/renderer/components/imageFilters/InnerShadow.d.ts +0 -2
  802. package/lib/typescript/src/renderer/components/imageFilters/getInput.d.ts +0 -3
  803. package/lib/typescript/src/renderer/components/shaders/Gradient.d.ts +0 -17
  804. package/lib/typescript/src/renderer/nodes/Container.d.ts +0 -8
  805. package/lib/typescript/src/renderer/nodes/Declaration.d.ts +0 -22
  806. package/lib/typescript/src/renderer/nodes/Drawing.d.ts +0 -21
  807. package/lib/typescript/src/renderer/nodes/Node.d.ts +0 -24
  808. package/lib/typescript/src/renderer/nodes/index.d.ts +0 -4
  809. package/lib/typescript/src/renderer/processors/Circles.d.ts +0 -13
  810. package/lib/typescript/src/renderer/processors/Clips.d.ts +0 -4
  811. package/lib/typescript/src/renderer/processors/Font.d.ts +0 -7
  812. package/lib/typescript/src/renderer/processors/Paint.d.ts +0 -22
  813. package/lib/typescript/src/renderer/processors/Paths.d.ts +0 -4
  814. package/lib/typescript/src/renderer/processors/Radius.d.ts +0 -3
  815. package/lib/typescript/src/renderer/processors/Rects.d.ts +0 -20
  816. package/src/renderer/components/Compose.tsx +0 -26
  817. package/src/renderer/components/colorFilters/Compose.ts +0 -18
  818. package/src/renderer/components/imageFilters/InnerShadow.tsx +0 -38
  819. package/src/renderer/components/imageFilters/getInput.ts +0 -20
  820. package/src/renderer/components/shaders/Gradient.ts +0 -24
  821. package/src/renderer/nodes/Container.tsx +0 -17
  822. package/src/renderer/nodes/Declaration.tsx +0 -65
  823. package/src/renderer/nodes/Drawing.tsx +0 -65
  824. package/src/renderer/nodes/Node.ts +0 -59
  825. package/src/renderer/nodes/index.ts +0 -4
  826. package/src/renderer/processors/Clips.ts +0 -23
  827. package/src/renderer/processors/Font.ts +0 -8
  828. package/src/renderer/processors/Paint.ts +0 -118
  829. package/src/renderer/processors/Transform.ts +0 -50
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["RenderNode.ts"],"names":["StrokeCap","StrokeJoin","PaintStyle","BlendMode","ClipOp","isRRect","isPathDef","processPath","processTransformProps","JsiNode","JsiDeclarationNode","enumKey","paintProps","JsiRenderNode","constructor","ctx","type","props","matrix","Skia","Matrix","onPropChange","setProps","paintCache","setProp","key","value","hasChanged","includes","identity","clipPath","undefined","clipRect","clipRRect","computeMatrix","computeClip","addChild","child","setInvalidate","insertChildBefore","before","clip","getPaintCtx","color","strokeWidth","blendMode","style","strokeJoin","strokeCap","strokeMiter","opacity","antiAlias","Color","_children","forEach","isColorFilter","cf","materialize","colorFilter","ColorFilter","MakeCompose","isShader","shader","isPathEffect","pe","pathEffect","PathEffect","isImageFilter","filter","imageFilter","ImageFilter","isMaskFilter","maskFilter","render","parentCtx","invertClip","layer","transform","canvas","parent","paint","paintCtx","concatPaint","hasTransform","hasClip","shouldSave","op","Difference","Intersect","saveLayer","isSkPaint","current","save","concat","renderNode","restore","obj","__typename__","alpha","copy","setShader","setColor","cl","getColor","setStrokeWidth","setAntiAlias","setBlendMode","setColorFilter","setImageFilter","setMaskFilter","setPathEffect","setAlphaf","setStrokeCap","setStrokeJoin","setStrokeMiter","setStyle"],"mappings":";;AASA,SACEA,SADF,EAEEC,UAFF,EAGEC,UAHF,EAIEC,SAJF,EAKEC,MALF,EAMEC,OANF,QAOO,kBAPP;AAiBA,SAASC,SAAT,EAAoBC,WAApB,EAAiCC,qBAAjC,QAA8D,aAA9D;AAEA,SAASC,OAAT,EAAkBC,kBAAlB,QAA4C,QAA5C;AAEA,SAASC,OAAT,QAAwB,kBAAxB;AAEA,MAAMC,UAAU,GAAG,CACjB,OADiB,EAEjB,aAFiB,EAGjB,WAHiB,EAIjB,WAJiB,EAKjB,YALiB,EAMjB,aANiB,EAOjB,OAPiB,EAQjB,WARiB,EASjB,SATiB,CAAnB;AAiBA,OAAO,MAAeC,aAAf,SACGJ,OADH,CAGP;AAOEK,EAAAA,WAAW,CAACC,GAAD,EAAmBC,IAAnB,EAAmCC,KAAnC,EAA6C;AACtD,UAAMF,GAAN,EAAWC,IAAX,EAAiBC,KAAjB;;AADsD,wCANxB,IAMwB;;AAAA;;AAAA;;AAAA;;AAAA;;AAEtD,SAAKC,MAAL,GAAc,KAAKC,IAAL,CAAUC,MAAV,EAAd;AACA,SAAKC,YAAL;AACD;;AAEDC,EAAAA,QAAQ,CAACL,KAAD,EAAW;AACjB,UAAM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AU,KAAKlC,SAAnB,EAA8B;AAC5BiD,IAAAA,KAAK,CAAC8B,aAAN,CAAoB7C,UAApB;AACD;;AACD,MAAIiC,KAAK,KAAKnE,SAAd,EAAyB;AACvBiD,IAAAA,KAAK,CAAC+B,SAAN,CAAgBb,KAAK,GAAGhD,OAAxB;AACD;;AACD,MAAIF,SAAS,KAAKjB,SAAlB,EAA6B;AAC3BiD,IAAAA,KAAK,CAACgC,YAAN,CAAmBhE,SAAnB;AACD;;AACD,MAAID,UAAU,KAAKhB,SAAnB,EAA8B;AAC5BiD,IAAAA,KAAK,CAACiC,aAAN,CAAoBlE,UAApB;AACD;;AACD,MAAIE,WAAW,KAAKlB,SAApB,EAA+B;AAC7BiD,IAAAA,KAAK,CAACkC,cAAN,CAAqBjE,WAArB;AACD;;AACD,MAAIH,KAAK,KAAKf,SAAd,EAAyB;AACvBiD,IAAAA,KAAK,CAACmC,QAAN,CAAerE,KAAf;AACD;;AACD,SAAOkC,KAAP;AACD,CAtED","sourcesContent":["import type { RefObject } from \"react\";\n\nimport type {\n SkMatrix,\n SkRect,\n SkRRect,\n SkPath,\n SkPaint,\n} from \"../../skia/types\";\nimport {\n StrokeCap,\n StrokeJoin,\n PaintStyle,\n BlendMode,\n ClipOp,\n isRRect,\n} from \"../../skia/types\";\nimport type {\n RenderNode,\n GroupProps,\n DrawingContext,\n NodeType,\n Node,\n DeclarationNode,\n} from \"../types\";\n\nimport { isPathDef, processPath, processTransformProps } from \"./datatypes\";\nimport type { NodeContext } from \"./Node\";\nimport { JsiNode, JsiDeclarationNode } from \"./Node\";\nimport type { PaintContext } from \"./PaintContext\";\nimport { enumKey } from \"./datatypes/Enum\";\n\nconst paintProps = [\n \"color\",\n \"strokeWidth\",\n \"blendMode\",\n \"strokeCap\",\n \"strokeJoin\",\n \"strokeMiter\",\n \"style\",\n \"antiAlias\",\n \"opacity\",\n];\n\ninterface PaintCache {\n parent: SkPaint;\n child: SkPaint;\n}\n\nexport abstract class JsiRenderNode<P extends GroupProps>\n extends JsiNode<P>\n implements RenderNode<P>\n{\n paintCache: PaintCache | null = null;\n matrix: SkMatrix;\n clipRect?: SkRect;\n clipRRect?: SkRRect;\n clipPath?: SkPath;\n\n constructor(ctx: NodeContext, type: NodeType, props: P) {\n super(ctx, type, props);\n this.matrix = this.Skia.Matrix();\n this.onPropChange();\n }\n\n setProps(props: P) {\n super.setProps(props);\n this.onPropChange();\n this.paintCache = null;\n }\n\n setProp<K extends keyof P>(key: K, value: P[K]) {\n const hasChanged = super.setProp(key, value);\n if (hasChanged) {\n this.onPropChange();\n if (paintProps.includes(key as string)) {\n this.paintCache = null;\n }\n }\n return hasChanged;\n }\n\n protected onPropChange() {\n this.matrix.identity();\n this.clipPath = undefined;\n this.clipRect = undefined;\n this.clipRRect = undefined;\n this.computeMatrix();\n this.computeClip();\n }\n\n addChild(child: Node<unknown>) {\n if (child instanceof JsiDeclarationNode) {\n child.setInvalidate(() => (this.paintCache = null));\n }\n super.addChild(child);\n }\n\n insertChildBefore(child: Node<unknown>, before: Node<unknown>) {\n if (child instanceof JsiDeclarationNode) {\n child.setInvalidate(() => (this.paintCache = null));\n }\n super.insertChildBefore(child, before);\n }\n\n private computeClip() {\n const { clip } = this.props;\n if (clip) {\n if (isPathDef(clip)) {\n this.clipPath = processPath(this.Skia, clip);\n } else if (isRRect(clip)) {\n this.clipRRect = clip;\n } else {\n this.clipRect = clip;\n }\n }\n }\n\n private computeMatrix() {\n processTransformProps(this.matrix, this.props);\n }\n\n private getPaintCtx() {\n let ctx: PaintContext | undefined;\n const {\n color,\n strokeWidth,\n blendMode,\n style,\n strokeJoin,\n strokeCap,\n strokeMiter,\n opacity,\n antiAlias,\n } = this.props;\n if (\n color !== undefined ||\n strokeWidth !== undefined ||\n blendMode !== undefined ||\n style !== undefined ||\n strokeJoin !== undefined ||\n strokeCap !== undefined ||\n strokeMiter !== undefined ||\n opacity !== undefined ||\n antiAlias !== undefined\n ) {\n ctx = {};\n if (color !== undefined) {\n ctx.color = this.Skia.Color(color);\n }\n if (strokeWidth !== undefined) {\n ctx.strokeWidth = strokeWidth;\n }\n if (blendMode !== undefined) {\n ctx.blendMode = BlendMode[enumKey(blendMode)];\n }\n if (style !== undefined) {\n ctx.style = PaintStyle[enumKey(style)];\n }\n if (strokeJoin !== undefined) {\n ctx.strokeJoin = StrokeJoin[enumKey(strokeJoin)];\n }\n if (strokeCap !== undefined) {\n ctx.strokeCap = StrokeCap[enumKey(strokeCap)];\n }\n if (strokeMiter !== undefined) {\n ctx.strokeMiter = strokeMiter;\n }\n if (opacity !== undefined) {\n ctx.opacity = opacity;\n }\n if (antiAlias !== undefined) {\n ctx.antiAlias = antiAlias;\n }\n }\n this._children.forEach((child) => {\n if (child instanceof JsiDeclarationNode) {\n if (child.isColorFilter()) {\n ctx = ctx || {};\n const cf = child.materialize();\n ctx.colorFilter = ctx.colorFilter\n ? this.Skia.ColorFilter.MakeCompose(cf, ctx.colorFilter)\n : cf;\n } else if (child.isShader()) {\n ctx = ctx || {};\n const shader = child.materialize();\n ctx.shader = shader;\n } else if (child.isPathEffect()) {\n ctx = ctx || {};\n const pe = child.materialize();\n ctx.pathEffect = ctx.pathEffect\n ? this.Skia.PathEffect.MakeCompose(pe, ctx.pathEffect)\n : pe;\n } else if (child.isImageFilter()) {\n ctx = ctx || {};\n const filter = child.materialize();\n ctx.imageFilter = ctx.imageFilter\n ? this.Skia.ImageFilter.MakeCompose(filter, ctx.imageFilter)\n : filter;\n } else if (child.isMaskFilter()) {\n ctx = ctx || {};\n const filter = child.materialize();\n ctx.maskFilter = filter;\n }\n }\n });\n return ctx;\n }\n\n render(parentCtx: DrawingContext) {\n const { invertClip, layer, matrix, transform } = this.props;\n const { canvas } = parentCtx;\n\n const opacity = this.props.opacity\n ? parentCtx.opacity * this.props.opacity\n : parentCtx.opacity;\n\n if (\n this.paintCache === null ||\n this.paintCache.parent !== parentCtx.paint\n ) {\n const paintCtx = this.getPaintCtx();\n const child = paintCtx\n ? concatPaint(parentCtx.paint, paintCtx, parentCtx.opacity)\n : parentCtx.paint;\n this.paintCache = { parent: parentCtx.paint, child };\n }\n const paint = this.paintCache.child;\n // TODO: can we only recreate a new context here if needed?\n const ctx = { ...parentCtx, opacity, paint };\n const hasTransform = matrix !== undefined || transform !== undefined;\n const hasClip = this.clipRect !== undefined;\n const shouldSave = hasTransform || hasClip || !!layer;\n const op = invertClip ? ClipOp.Difference : ClipOp.Intersect;\n\n if (shouldSave) {\n if (layer) {\n if (typeof layer === \"boolean\") {\n canvas.saveLayer();\n } else if (isSkPaint(layer)) {\n canvas.saveLayer(layer);\n } else {\n canvas.saveLayer(\n layer.current ? layer.current.materialize() : undefined\n );\n }\n } else {\n canvas.save();\n }\n }\n\n if (this.matrix) {\n canvas.concat(this.matrix);\n }\n if (this.clipRect) {\n canvas.clipRect(this.clipRect, op, true);\n }\n if (this.clipRRect) {\n canvas.clipRRect(this.clipRRect, op, true);\n }\n if (this.clipPath) {\n canvas.clipPath(this.clipPath, op, true);\n }\n\n this.renderNode(ctx);\n\n if (shouldSave) {\n canvas.restore();\n }\n }\n\n abstract renderNode(ctx: DrawingContext): void;\n}\n\nexport const isSkPaint = (\n obj: RefObject<DeclarationNode<unknown, SkPaint>> | SkPaint\n): obj is SkPaint => \"__typename__\" in obj && obj.__typename__ === \"Paint\";\n\nconst concatPaint = (\n parent: SkPaint,\n {\n color,\n strokeWidth,\n shader,\n antiAlias,\n blendMode,\n colorFilter,\n imageFilter,\n maskFilter,\n pathEffect,\n opacity: alpha,\n strokeCap,\n strokeJoin,\n strokeMiter,\n style,\n }: PaintContext,\n opacity: number\n) => {\n const paint = parent.copy();\n if (color !== undefined) {\n paint.setShader(null);\n color[3] *= opacity;\n paint.setColor(color);\n } else {\n const cl = paint.getColor();\n cl[3] *= opacity;\n paint.setColor(cl);\n }\n if (strokeWidth !== undefined) {\n paint.setStrokeWidth(strokeWidth);\n }\n if (shader !== undefined) {\n paint.setShader(shader);\n }\n if (antiAlias !== undefined) {\n paint.setAntiAlias(antiAlias);\n }\n if (blendMode !== undefined) {\n paint.setBlendMode(blendMode);\n }\n if (colorFilter !== undefined) {\n paint.setColorFilter(colorFilter);\n }\n if (imageFilter !== undefined) {\n paint.setImageFilter(imageFilter);\n }\n if (maskFilter !== undefined) {\n paint.setMaskFilter(maskFilter);\n }\n if (pathEffect !== undefined) {\n paint.setPathEffect(pathEffect);\n }\n if (alpha !== undefined) {\n paint.setAlphaf(alpha * opacity);\n }\n if (strokeCap !== undefined) {\n paint.setStrokeCap(strokeCap);\n }\n if (strokeJoin !== undefined) {\n paint.setStrokeJoin(strokeJoin);\n }\n if (strokeMiter !== undefined) {\n paint.setStrokeMiter(strokeMiter);\n }\n if (style !== undefined) {\n paint.setStyle(style);\n }\n return paint;\n};\n"]}
@@ -1,7 +1,6 @@
1
- const isCircleScalarDef = def => // We have an issue to check property existence on JSI backed instances
1
+ export const isCircleScalarDef = def => // We have an issue to check property existence on JSI backed instances
2
2
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
3
3
  def.cx !== undefined;
4
-
5
4
  export const processCircle = (Skia, def) => {
6
5
  if (isCircleScalarDef(def)) {
7
6
  return {
@@ -12,4 +11,4 @@ export const processCircle = (Skia, def) => {
12
11
 
13
12
  return def;
14
13
  };
15
- //# sourceMappingURL=Circles.js.map
14
+ //# sourceMappingURL=Circle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["Circle.ts"],"names":["isCircleScalarDef","def","cx","undefined","processCircle","Skia","c","Point","cy","r"],"mappings":"AAGA,OAAO,MAAMA,iBAAiB,GAAIC,GAAD,IAC/B;AACA;AACCA,GAAD,CAAaC,EAAb,KAAoBC,SAHf;AAKP,OAAO,MAAMC,aAAa,GAAG,CAACC,IAAD,EAAaJ,GAAb,KAAgC;AAC3D,MAAID,iBAAiB,CAACC,GAAD,CAArB,EAA4B;AAC1B,WAAO;AAAEK,MAAAA,CAAC,EAAED,IAAI,CAACE,KAAL,CAAWN,GAAG,CAACC,EAAf,EAAmBD,GAAG,CAACO,EAAvB,CAAL;AAAiCC,MAAAA,CAAC,EAAER,GAAG,CAACQ;AAAxC,KAAP;AACD;;AACD,SAAOR,GAAP;AACD,CALM","sourcesContent":["import type { Skia } from \"../../../skia/types\";\nimport type { CircleDef, ScalarCircleDef } from \"../../types\";\n\nexport const isCircleScalarDef = (def: CircleDef): def is ScalarCircleDef =>\n // We have an issue to check property existence on JSI backed instances\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (def as any).cx !== undefined;\n\nexport const processCircle = (Skia: Skia, def: CircleDef) => {\n if (isCircleScalarDef(def)) {\n return { c: Skia.Point(def.cx, def.cy), r: def.r };\n }\n return def;\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["Color.ts"],"names":["RED","GREEN","BLUE","ALPHA","rgbaColor","r","g","b","a","Float32Array","processColor","Skia","cl","currentOpacity","color","Color"],"mappings":"AAEA,OAAO,MAAMA,GAAG,GAAG,CAAZ;AACP,OAAO,MAAMC,KAAK,GAAG,CAAd;AACP,OAAO,MAAMC,IAAI,GAAG,CAAb;AACP,OAAO,MAAMC,KAAK,GAAG,CAAd;AAEP,OAAO,MAAMC,SAAS,GAAG,CAACC,CAAD,EAAYC,CAAZ,EAAuBC,CAAvB,EAAkCC,CAAlC,KACvB,IAAIC,YAAJ,CAAiB,CAACJ,CAAD,EAAIC,CAAJ,EAAOC,CAAP,EAAUC,CAAV,CAAjB,CADK;AAGP,OAAO,MAAME,YAAY,GAAG,CAACC,IAAD,EAAaC,EAAb,EAAwBC,cAAxB,KAAmD;AAC7E,QAAMC,KAAK,GAAGH,IAAI,CAACI,KAAL,CAAWH,EAAX,CAAd;AACAE,EAAAA,KAAK,CAACX,KAAD,CAAL,IAAgBU,cAAhB;AACA,SAAOC,KAAP;AACD,CAJM","sourcesContent":["import type { Color, Skia } from \"../../skia/types\";\n\nexport const RED = 0;\nexport const GREEN = 1;\nexport const BLUE = 2;\nexport const ALPHA = 3;\n\nexport const rgbaColor = (r: number, g: number, b: number, a: number) =>\n new Float32Array([r, g, b, a]);\n\nexport const processColor = (Skia: Skia, cl: Color, currentOpacity: number) => {\n const color = Skia.Color(cl);\n color[ALPHA] *= currentOpacity;\n return color;\n};\n"]}
1
+ {"version":3,"sources":["Color.ts"],"names":["RED","GREEN","BLUE","ALPHA","rgbaColor","r","g","b","a","Float32Array","processColor","Skia","cl","currentOpacity","color","Color"],"mappings":"AAEA,OAAO,MAAMA,GAAG,GAAG,CAAZ;AACP,OAAO,MAAMC,KAAK,GAAG,CAAd;AACP,OAAO,MAAMC,IAAI,GAAG,CAAb;AACP,OAAO,MAAMC,KAAK,GAAG,CAAd;AAEP,OAAO,MAAMC,SAAS,GAAG,CAACC,CAAD,EAAYC,CAAZ,EAAuBC,CAAvB,EAAkCC,CAAlC,KACvB,IAAIC,YAAJ,CAAiB,CAACJ,CAAD,EAAIC,CAAJ,EAAOC,CAAP,EAAUC,CAAV,CAAjB,CADK;AAGP,OAAO,MAAME,YAAY,GAAG,CAACC,IAAD,EAAaC,EAAb,EAAwBC,cAAxB,KAAmD;AAC7E,QAAMC,KAAK,GAAGH,IAAI,CAACI,KAAL,CAAWH,EAAX,CAAd;AACAE,EAAAA,KAAK,CAACX,KAAD,CAAL,IAAgBU,cAAhB;AACA,SAAOC,KAAP;AACD,CAJM","sourcesContent":["import type { Color, Skia } from \"../../../skia/types\";\n\nexport const RED = 0;\nexport const GREEN = 1;\nexport const BLUE = 2;\nexport const ALPHA = 3;\n\nexport const rgbaColor = (r: number, g: number, b: number, a: number) =>\n new Float32Array([r, g, b, a]);\n\nexport const processColor = (Skia: Skia, cl: Color, currentOpacity: number) => {\n const color = Skia.Color(cl);\n color[ALPHA] *= currentOpacity;\n return color;\n};\n"]}
@@ -0,0 +1,2 @@
1
+ export const enumKey = k => k.charAt(0).toUpperCase() + k.slice(1);
2
+ //# sourceMappingURL=Enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["Enum.ts"],"names":["enumKey","k","charAt","toUpperCase","slice"],"mappings":"AAAA,OAAO,MAAMA,OAAO,GAAsBC,CAAnB,IACpBA,CAAC,CAACC,MAAF,CAAS,CAAT,EAAYC,WAAZ,KAA4BF,CAAC,CAACG,KAAF,CAAQ,CAAR,CADxB","sourcesContent":["export const enumKey = <K extends string>(k: K) =>\n (k.charAt(0).toUpperCase() + k.slice(1)) as Capitalize<K>;\n"]}
@@ -1,4 +1,4 @@
1
- import { exhaustiveCheck } from "../../typeddash";
1
+ import { exhaustiveCheck } from "../../../renderer/typeddash";
2
2
  export const size = function () {
3
3
  let width = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
4
4
  let height = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
@@ -141,4 +141,4 @@ const applyBoxFit = (fit, input, output) => {
141
141
  dst
142
142
  };
143
143
  };
144
- //# sourceMappingURL=BoxFit.js.map
144
+ //# sourceMappingURL=Fitting.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["BoxFit.ts"],"names":["exhaustiveCheck","size","width","height","rect2rect","src","dst","scaleX","scaleY","translateX","x","translateY","y","fitRects","fit","rect","sizes","applyBoxFit","inscribe","halfWidthDelta","halfHeightDelta","input","output","Math","min","aspectRatio"],"mappings":"AAAA,SAASA,eAAT,QAAgC,iBAAhC;AAkBA,OAAO,MAAMC,IAAI,GAAG;AAAA,MAACC,KAAD,uEAAS,CAAT;AAAA,MAAYC,MAAZ,uEAAqB,CAArB;AAAA,SAA4B;AAAED,IAAAA,KAAF;AAASC,IAAAA;AAAT,GAA5B;AAAA,CAAb;AAEP,OAAO,MAAMC,SAAS,GAAG,CAACC,GAAD,EAAcC,GAAd,KAA8B;AACrD,QAAMC,MAAM,GAAGD,GAAG,CAACJ,KAAJ,GAAYG,GAAG,CAACH,KAA/B;AACA,QAAMM,MAAM,GAAGF,GAAG,CAACH,MAAJ,GAAaE,GAAG,CAACF,MAAhC;AACA,QAAMM,UAAU,GAAGH,GAAG,CAACI,CAAJ,GAAQL,GAAG,CAACK,C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M,CAACpB,KAA7B,CADQ,EAERqB,IAAI,CAACC,GAAL,CAASH,KAAK,CAAClB,MAAf,EAAuBmB,MAAM,CAACnB,MAA9B,CAFQ,CAAV;AAIAG,MAAAA,GAAG,GAAGD,GAAN;AACA;;AACF,SAAK,WAAL;AACEA,MAAAA,GAAG,GAAGgB,KAAN;AACAf,MAAAA,GAAG,GAAGe,KAAN;AACA,YAAMI,WAAW,GAAGJ,KAAK,CAACnB,KAAN,GAAcmB,KAAK,CAAClB,MAAxC;;AACA,UAAIG,GAAG,CAACH,MAAJ,GAAamB,MAAM,CAACnB,MAAxB,EAAgC;AAC9BG,QAAAA,GAAG,GAAGL,IAAI,CAACqB,MAAM,CAACnB,MAAP,GAAgBsB,WAAjB,EAA8BH,MAAM,CAACnB,MAArC,CAAV;AACD;;AACD,UAAIG,GAAG,CAACJ,KAAJ,GAAYoB,MAAM,CAACpB,KAAvB,EAA8B;AAC5BI,QAAAA,GAAG,GAAGL,IAAI,CAACqB,MAAM,CAACpB,KAAR,EAAeoB,MAAM,CAACpB,KAAP,GAAeuB,WAA9B,CAAV;AACD;;AACD;;AACF;AACEzB,MAAAA,eAAe,CAACc,GAAD,CAAf;AAhDJ;;AAkDA,SAAO;AAAET,IAAAA,GAAF;AAAOC,IAAAA;AAAP,GAAP;AACD,CA9DD","sourcesContent":["import { exhaustiveCheck } from \"../../typeddash\";\nimport type { SkRect } from \"../../../skia/types\";\n\n// https://api.flutter.dev/flutter/painting/BoxFit-class.html\nexport type Fit =\n | \"cover\"\n | \"contain\"\n | \"fill\"\n | \"fitHeight\"\n | \"fitWidth\"\n | \"none\"\n | \"scaleDown\";\n\nexport interface Size {\n width: number;\n height: number;\n}\n\nexport const size = (width = 0, height = 0) => ({ width, height });\n\nexport const rect2rect = (src: SkRect, dst: SkRect) => {\n const scaleX = dst.width / src.width;\n const scaleY = dst.height / src.height;\n const translateX = dst.x - src.x * scaleX;\n const translateY = dst.y - src.y * scaleY;\n return [{ translateX }, { translateY }, { scaleX }, { scaleY }] as const;\n};\n\nexport const fitRects = (\n fit: Fit,\n rect: SkRect,\n { x, y, width, height }: SkRect\n) => {\n const sizes = applyBoxFit(\n fit,\n { width: rect.width, height: rect.height },\n { width, height }\n );\n const src = inscribe(sizes.src, rect);\n const dst = inscribe(sizes.dst, {\n x,\n y,\n width,\n height,\n });\n return { src, dst };\n};\n\nconst inscribe = (\n { width, height }: Size,\n rect: { x: number; y: number; width: number; height: number }\n) => {\n const halfWidthDelta = (rect.width - width) / 2.0;\n const halfHeightDelta = (rect.height - height) / 2.0;\n return {\n x: rect.x + halfWidthDelta,\n y: rect.y + halfHeightDelta,\n width,\n height,\n };\n};\n\nconst applyBoxFit = (fit: Fit, input: Size, output: Size) => {\n let src = size(),\n dst = size();\n if (\n input.height <= 0.0 ||\n input.width <= 0.0 ||\n output.height <= 0.0 ||\n output.width <= 0.0\n ) {\n return { src, dst };\n }\n switch (fit) {\n case \"fill\":\n src = input;\n dst = output;\n break;\n case \"contain\":\n src = input;\n if (output.width / output.height > src.width / src.height) {\n dst = size((src.width * output.height) / src.height, output.height);\n } else {\n dst = size(output.width, (src.height * output.width) / src.width);\n }\n break;\n case \"cover\":\n if (output.width / output.height > input.width / input.height) {\n src = size(input.width, (input.width * output.height) / output.width);\n } else {\n src = size((input.height * output.width) / output.height, input.height);\n }\n dst = output;\n break;\n case \"fitWidth\":\n src = size(input.width, (input.width * output.height) / output.width);\n dst = size(output.width, (src.height * output.width) / src.width);\n break;\n case \"fitHeight\":\n src = size((input.height * output.width) / output.height, input.height);\n dst = size((src.width * output.height) / src.height, output.height);\n break;\n case \"none\":\n src = size(\n Math.min(input.width, output.width),\n Math.min(input.height, output.height)\n );\n dst = src;\n break;\n case \"scaleDown\":\n src = input;\n dst = input;\n const aspectRatio = input.width / input.height;\n if (dst.height > output.height) {\n dst = size(output.height * aspectRatio, output.height);\n }\n if (dst.width > output.width) {\n dst = size(output.width, output.width / aspectRatio);\n }\n break;\n default:\n exhaustiveCheck(fit);\n }\n return { src, dst };\n};\n"]}
1
+ {"version":3,"sources":["Fitting.ts"],"names":["exhaustiveCheck","size","width","height","rect2rect","src","dst","scaleX","scaleY","translateX","x","translateY","y","fitRects","fit","rect","sizes","applyBoxFit","inscribe","halfWidthDelta","halfHeightDelta","input","output","Math","min","aspectRatio"],"mappings":"AAAA,SAASA,eAAT,QAAgC,6BAAhC;AASA,OAAO,MAAMC,IAAI,GAAG;AAAA,MAACC,KAAD,uEAAS,CAAT;AAAA,MAAYC,MAAZ,uEAAqB,CAArB;AAAA,SAA4B;AAAED,IAAAA,KAAF;AAASC,IAAAA;AAAT,GAA5B;AAAA,CAAb;AAEP,OAAO,MAAMC,SAAS,GAAG,CAACC,GAAD,EAAcC,GAAd,KAA8B;AACrD,QAAMC,MAAM,GAAGD,GAAG,CAACJ,KAAJ,GAAYG,GAAG,CAACH,KAA/B;AACA,QAAMM,MAAM,GAAGF,GAAG,CAACH,MAAJ,GAAaE,GAAG,CAACF,MAAhC;AACA,QAAMM,UAAU,GAAGH,GAAG,CAACI,CAAJ,GAAQL,GAAG,CAACK,CAAJ,GAAQH,MAAnC;AACA,QAAMI,UAAU,GAAGL,GAAG,CAACM,CAAJ,GAAQP,GAAG,CAACO,CAAJ,GAAQJ,MAAnC;AACA,SAAO,CAAC;AAAEC,IAAAA;AAAF,GAAD,EAAiB;AAAEE,IAAAA;AAAF,GAAjB,EAAiC;AAAEJ,IAAAA;AAAF,GAAjC,EAA6C;AAAEC,IAAAA;AAAF,GAA7C,CAAP;AACD,CANM;AAQP,OAAO,MAAMK,QAAQ,GAAG,CACtBC,GADsB,EAEtBC,IAFsB,WAInB;AAAA,MADH;AAAEL,IAAAA,CAAF;AAAKE,IAAAA,CAAL;AAAQV,IAAAA,KAAR;AAAeC,IAAAA;AAAf,GACG;AACH,QAAMa,KAAK,GAAGC,WAAW,CACvBH,GADuB,EAEvB;AAAEZ,IAAAA,KAAK,EAAEa,IAAI,CAACb,KAAd;AAAqBC,IAAAA,MAAM,E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B,EAA8B;AAC5BI,QAAAA,GAAG,GAAGL,IAAI,CAACqB,MAAM,CAACpB,KAAR,EAAeoB,MAAM,CAACpB,KAAP,GAAeuB,WAA9B,CAAV;AACD;;AACD;;AACF;AACEzB,MAAAA,eAAe,CAACc,GAAD,CAAf;AAhDJ;;AAkDA,SAAO;AAAET,IAAAA,GAAF;AAAOC,IAAAA;AAAP,GAAP;AACD,CA9DD","sourcesContent":["import { exhaustiveCheck } from \"../../../renderer/typeddash\";\nimport type { SkRect } from \"../../../skia/types\";\nimport type { Fit } from \"../../types\";\n\nexport interface Size {\n width: number;\n height: number;\n}\n\nexport const size = (width = 0, height = 0) => ({ width, height });\n\nexport const rect2rect = (src: SkRect, dst: SkRect) => {\n const scaleX = dst.width / src.width;\n const scaleY = dst.height / src.height;\n const translateX = dst.x - src.x * scaleX;\n const translateY = dst.y - src.y * scaleY;\n return [{ translateX }, { translateY }, { scaleX }, { scaleY }] as const;\n};\n\nexport const fitRects = (\n fit: Fit,\n rect: SkRect,\n { x, y, width, height }: SkRect\n) => {\n const sizes = applyBoxFit(\n fit,\n { width: rect.width, height: rect.height },\n { width, height }\n );\n const src = inscribe(sizes.src, rect);\n const dst = inscribe(sizes.dst, {\n x,\n y,\n width,\n height,\n });\n return { src, dst };\n};\n\nconst inscribe = (\n { width, height }: Size,\n rect: { x: number; y: number; width: number; height: number }\n) => {\n const halfWidthDelta = (rect.width - width) / 2.0;\n const halfHeightDelta = (rect.height - height) / 2.0;\n return {\n x: rect.x + halfWidthDelta,\n y: rect.y + halfHeightDelta,\n width,\n height,\n };\n};\n\nconst applyBoxFit = (fit: Fit, input: Size, output: Size) => {\n let src = size(),\n dst = size();\n if (\n input.height <= 0.0 ||\n input.width <= 0.0 ||\n output.height <= 0.0 ||\n output.width <= 0.0\n ) {\n return { src, dst };\n }\n switch (fit) {\n case \"fill\":\n src = input;\n dst = output;\n break;\n case \"contain\":\n src = input;\n if (output.width / output.height > src.width / src.height) {\n dst = size((src.width * output.height) / src.height, output.height);\n } else {\n dst = size(output.width, (src.height * output.width) / src.width);\n }\n break;\n case \"cover\":\n if (output.width / output.height > input.width / input.height) {\n src = size(input.width, (input.width * output.height) / output.width);\n } else {\n src = size((input.height * output.width) / output.height, input.height);\n }\n dst = output;\n break;\n case \"fitWidth\":\n src = size(input.width, (input.width * output.height) / output.width);\n dst = size(output.width, (src.height * output.width) / src.width);\n break;\n case \"fitHeight\":\n src = size((input.height * output.width) / output.height, input.height);\n dst = size((src.width * output.height) / src.height, output.height);\n break;\n case \"none\":\n src = size(\n Math.min(input.width, output.width),\n Math.min(input.height, output.height)\n );\n dst = src;\n break;\n case \"scaleDown\":\n src = input;\n dst = input;\n const aspectRatio = input.width / input.height;\n if (dst.height > output.height) {\n dst = size(output.height * aspectRatio, output.height);\n }\n if (dst.width > output.width) {\n dst = size(output.width, output.width / aspectRatio);\n }\n break;\n default:\n exhaustiveCheck(fit);\n }\n return { src, dst };\n};\n"]}
@@ -0,0 +1,47 @@
1
+ import { TileMode } from "../../../skia/types";
2
+ import { enumKey } from "./Enum";
3
+ import { processTransformProps } from "./Transform";
4
+ export const transformOrigin = (origin, transform) => [{
5
+ translateX: origin.x
6
+ }, {
7
+ translateY: origin.y
8
+ }, ...transform, {
9
+ translateX: -origin.x
10
+ }, {
11
+ translateY: -origin.y
12
+ }];
13
+ export const processGradientProps = (Skia, _ref) => {
14
+ let {
15
+ colors,
16
+ positions,
17
+ mode,
18
+ flags,
19
+ ...transform
20
+ } = _ref;
21
+ const localMatrix = Skia.Matrix();
22
+ processTransformProps(localMatrix, transform);
23
+ return {
24
+ colors: colors.map(color => Skia.Color(color)),
25
+ positions: positions !== null && positions !== void 0 ? positions : null,
26
+ mode: TileMode[enumKey(mode !== null && mode !== void 0 ? mode : "clamp")],
27
+ flags,
28
+ localMatrix
29
+ };
30
+ };
31
+ export const getRect = (Skia, props) => {
32
+ const {
33
+ x,
34
+ y,
35
+ width,
36
+ height
37
+ } = props;
38
+
39
+ if (props.rect) {
40
+ return props.rect;
41
+ } else if (x !== undefined && y !== undefined && width !== undefined && height !== undefined) {
42
+ return Skia.XYWHRect(x, y, width, height);
43
+ } else {
44
+ return undefined;
45
+ }
46
+ };
47
+ //# sourceMappingURL=Gradient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["Gradient.ts"],"names":["TileMode","enumKey","processTransformProps","transformOrigin","origin","transform","translateX","x","translateY","y","processGradientProps","Skia","colors","positions","mode","flags","localMatrix","Matrix","map","color","Color","getRect","props","width","height","rect","undefined","XYWHRect"],"mappings":"AACA,SAASA,QAAT,QAAyB,qBAAzB;AAGA,SAASC,OAAT,QAAwB,QAAxB;AACA,SAASC,qBAAT,QAAsC,aAAtC;AAEA,OAAO,MAAMC,eAAe,GAAG,CAACC,MAAD,EAAiBC,SAAjB,KAA6C,CAC1E;AAAEC,EAAAA,UAAU,EAAEF,MAAM,CAACG;AAArB,CAD0E,EAE1E;AAAEC,EAAAA,UAAU,EAAEJ,MAAM,CAACK;AAArB,CAF0E,EAG1E,GAAGJ,SAHuE,EAI1E;AAAEC,EAAAA,UAAU,EAAE,CAACF,MAAM,CAACG;AAAtB,CAJ0E,EAK1E;AAAEC,EAAAA,UAAU,EAAE,CAACJ,MAAM,CAACK;AAAtB,CAL0E,CAArE;AAQP,OAAO,MAAMC,oBAAoB,GAAG,CAClCC,IADkC,WAG/B;AAAA,MADH;AAAEC,IAAAA,MAAF;AAAUC,IAAAA,SAAV;AAAqBC,IAAAA,IAArB;AAA2BC,IAAAA,KAA3B;AAAkC,OAAGV;AAArC,GACG;AACH,QAAMW,WAAW,GAAGL,IAAI,CAACM,MAAL,EAApB;AACAf,EAAAA,qBAAqB,CAACc,WAAD,EAAcX,SAAd,CAArB;AACA,SAAO;AACLO,IAAAA,MAAM,EAAEA,MAAM,CAACM,GAAP,CAAYC,KAAD,IAAWR,IAAI,CAACS,KAAL,CAAWD,KAAX,CAAtB,CADH;AAELN,IAAAA,SAAS,EAAEA,SAAF,aAAEA,SAAF,cAAEA,SAAF,GAAe,IAFnB;AAGLC,IAAAA,IAAI,EAAEd,QAAQ,CAACC,OAAO,CAACa,IAAD,aAACA,IAAD,cAACA,IAAD,GAAS,OAAT,CAAR,CAHT;AAILC,IAAAA,KAJK;AAKLC,IAAAA;AALK,GAAP;AAOD,CAbM;AAeP,OAAO,MAAMK,OAAO,GAAG,CACrBV,IADqB,EAErBW,KAFqB,KAGE;AACvB,QAAM;AAAEf,IAAAA,CAAF;AAAKE,IAAAA,CAAL;AAAQc,IAAAA,KAAR;AAAeC,IAAAA;AAAf,MAA0BF,KAAhC;;AACA,MAAIA,KAAK,CAACG,IAAV,EAAgB;AACd,WAAOH,KAAK,CAACG,IAAb;AACD,GAFD,MAEO,IACLlB,CAAC,KAAKmB,SAAN,IACAjB,CAAC,KAAKiB,SADN,IAEAH,KAAK,KAAKG,SAFV,IAGAF,MAAM,KAAKE,SAJN,EAKL;AACA,WAAOf,IAAI,CAACgB,QAAL,CAAcpB,CAAd,EAAiBE,CAAjB,EAAoBc,KAApB,EAA2BC,MAA3B,CAAP;AACD,GAPM,MAOA;AACL,WAAOE,SAAP;AACD;AACF,CAjBM","sourcesContent":["import type { Skia, SkRect, Transforms2d, Vector } from \"../../../skia/types\";\nimport { TileMode } from \"../../../skia/types\";\nimport type { GradientProps, ImageShaderProps } from \"../../types\";\n\nimport { enumKey } from \"./Enum\";\nimport { processTransformProps } from \"./Transform\";\n\nexport const transformOrigin = (origin: Vector, transform: Transforms2d) => [\n { translateX: origin.x },\n { translateY: origin.y },\n ...transform,\n { translateX: -origin.x },\n { translateY: -origin.y },\n];\n\nexport const processGradientProps = (\n Skia: Skia,\n { colors, positions, mode, flags, ...transform }: GradientProps\n) => {\n const localMatrix = Skia.Matrix();\n processTransformProps(localMatrix, transform);\n return {\n colors: colors.map((color) => Skia.Color(color)),\n positions: positions ?? null,\n mode: TileMode[enumKey(mode ?? \"clamp\")],\n flags,\n localMatrix,\n };\n};\n\nexport const getRect = (\n Skia: Skia,\n props: Omit<ImageShaderProps, \"tx\" | \"ty\" | \"fm\" | \"mm\" | \"fit\" | \"image\">\n): SkRect | undefined => {\n const { x, y, width, height } = props;\n if (props.rect) {\n return props.rect;\n } else if (\n x !== undefined &&\n y !== undefined &&\n width !== undefined &&\n height !== undefined\n ) {\n return Skia.XYWHRect(x, y, width, height);\n } else {\n return undefined;\n }\n};\n"]}
@@ -1,4 +1,4 @@
1
- import { isPath } from "../../skia/types";
1
+ import { isPath } from "../../../skia/types";
2
2
  export const processPath = (Skia, rawPath) => {
3
3
  const path = typeof rawPath === "string" ? Skia.Path.MakeFromSVGString(rawPath) : rawPath;
4
4
 
@@ -10,4 +10,4 @@ export const processPath = (Skia, rawPath) => {
10
10
  }; // eslint-disable-next-line @typescript-eslint/no-explicit-any
11
11
 
12
12
  export const isPathDef = def => typeof def === "string" || isPath(def);
13
- //# sourceMappingURL=Paths.js.map
13
+ //# sourceMappingURL=Path.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["Path.ts"],"names":["isPath","processPath","Skia","rawPath","path","Path","MakeFromSVGString","Error","isPathDef","def"],"mappings":"AACA,SAASA,MAAT,QAAuB,qBAAvB;AAGA,OAAO,MAAMC,WAAW,GAAG,CAACC,IAAD,EAAaC,OAAb,KAAkC;AAC3D,QAAMC,IAAI,GACR,OAAOD,OAAP,KAAmB,QAAnB,GACID,IAAI,CAACG,IAAL,CAAUC,iBAAV,CAA4BH,OAA5B,CADJ,GAEIA,OAHN;;AAIA,MAAI,CAACC,IAAL,EAAW;AACT,UAAM,IAAIG,KAAJ,CAAU,mBAAmBJ,OAA7B,CAAN;AACD;;AACD,SAAOC,IAAP;AACD,CATM,C,CAWP;;AACA,OAAO,MAAMI,SAAS,GAAIC,GAAD,IACvB,OAAOA,GAAP,KAAe,QAAf,IAA2BT,MAAM,CAACS,GAAD,CAD5B","sourcesContent":["import type { Skia } from \"../../../skia/types\";\nimport { isPath } from \"../../../skia/types\";\nimport type { PathDef } from \"../../types\";\n\nexport const processPath = (Skia: Skia, rawPath: PathDef) => {\n const path =\n typeof rawPath === \"string\"\n ? Skia.Path.MakeFromSVGString(rawPath)\n : rawPath;\n if (!path) {\n throw new Error(\"Invalid path: \" + rawPath);\n }\n return path;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const isPathDef = (def: any): def is PathDef =>\n typeof def === \"string\" || isPath(def);\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["Radius.ts"],"names":["processRadius","Skia","radius","Point"],"mappings":"AAGA,OAAO,MAAMA,aAAa,GAAG,CAACC,IAAD,EAAaC,MAAb,KAAwC;AACnE,MAAI,OAAOA,MAAP,KAAkB,QAAtB,EAAgC;AAC9B,WAAOD,IAAI,CAACE,KAAL,CAAWD,MAAX,EAAmBA,MAAnB,CAAP;AACD;;AACD,SAAOA,MAAP;AACD,CALM","sourcesContent":["import type { Skia, Vector } from \"../../../skia/types\";\nimport type { Radius } from \"../../types\";\n\nexport const processRadius = (Skia: Skia, radius: Radius): Vector => {\n if (typeof radius === \"number\") {\n return Skia.Point(radius, radius);\n }\n return radius;\n};\n"]}
@@ -22,4 +22,4 @@ export const processRRect = (Skia, def) => {
22
22
  return def.rect;
23
23
  }
24
24
  };
25
- //# sourceMappingURL=Rects.js.map
25
+ //# sourceMappingURL=Rect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["Rect.ts"],"names":["processRadius","isEdge","pos","b","x","y","width","height","isRRectCtor","def","rect","undefined","isRectCtor","processRect","Skia","XYWHRect","processRRect","r","RRectXY"],"mappings":"AAAA;AAIA,SAASA,aAAT,QAA8B,UAA9B;AAEA,OAAO,MAAMC,MAAM,GAAG,CAACC,GAAD,EAAcC,CAAd,KACpBD,GAAG,CAACE,CAAJ,KAAUD,CAAC,CAACC,CAAZ,IAAiBF,GAAG,CAACG,CAAJ,KAAUF,CAAC,CAACE,CAA7B,IAAkCH,GAAG,CAACE,CAAJ,KAAUD,CAAC,CAACG,KAA9C,IAAuDJ,GAAG,CAACG,CAAJ,KAAUF,CAAC,CAACI,MAD9D,C,CAGP;;AACA,MAAMC,WAAW,GAAIC,GAAD,IACjBA,GAAD,CAAaC,IAAb,KAAsBC,SADxB,C,CAEA;;;AACA,MAAMC,UAAU,GAAIH,GAAD,IAChBA,GAAD,CAAaC,IAAb,KAAsBC,SADxB;;AAGA,OAAO,MAAME,WAAW,GAAG,CAACC,IAAD,EAAaL,GAAb,KAA8B;AACvD,MAAIG,UAAU,CAACH,GAAD,CAAd,EAAqB;AACnB,WAAOK,IAAI,CAACC,QAAL,CAAcN,GAAG,CAACL,CAAlB,EAAqBK,GAAG,CAACJ,CAAzB,EAA4BI,GAAG,CAACH,KAAhC,EAAuCG,GAAG,CAACF,MAA3C,CAAP;AACD,GAFD,MAEO;AACL,WAAOE,GAAG,CAACC,IAAX;AACD;AACF,CANM;AAQP,OAAO,MAAMM,YAAY,GAAG,CAACF,IAAD,EAAaL,GAAb,KAA+B;AACzD,MAAID,WAAW,CAACC,GAAD,CAAf,EAAsB;AACpB,UAAMQ,CAAC,GAAGjB,aAAa,CAACc,IAAD,EAAOL,GAAG,CAACQ,CAAX,CAAvB;AACA,WAAOH,IAAI,CAACI,OAAL,CACLJ,IAAI,CAACC,QAAL,CAAcN,GAAG,CAACL,CAAlB,EAAqBK,GAAG,CAACJ,CAAzB,EAA4BI,GAAG,CAACH,KAAhC,EAAuCG,GAAG,CAACF,MAA3C,CADK,EAELU,CAAC,CAACb,CAFG,EAGLa,CAAC,CAACZ,CAHG,CAAP;AAKD,GAPD,MAOO;AACL,WAAOI,GAAG,CAACC,IAAX;AACD;AACF,CAXM","sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { Skia, SkRect, Vector } from \"../../../skia/types\";\nimport type { RectCtor, RectDef, RRectCtor, RRectDef } from \"../../types\";\n\nimport { processRadius } from \"./Radius\";\n\nexport const isEdge = (pos: Vector, b: SkRect) =>\n pos.x === b.x || pos.y === b.y || pos.x === b.width || pos.y === b.height;\n\n// We have an issue to check property existence on JSI backed instances\nconst isRRectCtor = (def: RRectDef): def is RRectCtor =>\n (def as any).rect === undefined;\n// We have an issue to check property existence on JSI backed instances\nconst isRectCtor = (def: RectDef): def is RectCtor =>\n (def as any).rect === undefined;\n\nexport const processRect = (Skia: Skia, def: RectDef) => {\n if (isRectCtor(def)) {\n return Skia.XYWHRect(def.x, def.y, def.width, def.height);\n } else {\n return def.rect;\n }\n};\n\nexport const processRRect = (Skia: Skia, def: RRectDef) => {\n if (isRRectCtor(def)) {\n const r = processRadius(Skia, def.r);\n return Skia.RRectXY(\n Skia.XYWHRect(def.x, def.y, def.width, def.height),\n r.x,\n r.y\n );\n } else {\n return def.rect;\n }\n};\n"]}
@@ -0,0 +1,32 @@
1
+ import { processTransform } from "../../../skia/types";
2
+ export const processTransformProps = (m3, props) => {
3
+ const {
4
+ transform,
5
+ origin,
6
+ matrix
7
+ } = props;
8
+
9
+ if (matrix) {
10
+ if (origin) {
11
+ m3.translate(origin.x, origin.y);
12
+ m3.concat(matrix);
13
+ m3.translate(-origin.x, -origin.y);
14
+ } else {
15
+ m3.identity();
16
+ m3.concat(matrix);
17
+ }
18
+ } else if (transform) {
19
+ m3.identity();
20
+
21
+ if (origin) {
22
+ m3.translate(origin.x, origin.y);
23
+ }
24
+
25
+ processTransform(m3, transform);
26
+
27
+ if (origin) {
28
+ m3.translate(-origin.x, -origin.y);
29
+ }
30
+ }
31
+ };
32
+ //# sourceMappingURL=Transform.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["Transform.ts"],"names":["processTransform","processTransformProps","m3","props","transform","origin","matrix","translate","x","y","concat","identity"],"mappings":"AAEA,SAASA,gBAAT,QAAiC,qBAAjC;AAEA,OAAO,MAAMC,qBAAqB,GAAG,CAACC,EAAD,EAAeC,KAAf,KAAyC;AAC5E,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA,MAAb;AAAqBC,IAAAA;AAArB,MAAgCH,KAAtC;;AACA,MAAIG,MAAJ,EAAY;AACV,QAAID,MAAJ,EAAY;AACVH,MAAAA,EAAE,CAACK,SAAH,CAAaF,MAAM,CAACG,CAApB,EAAuBH,MAAM,CAACI,CAA9B;AACAP,MAAAA,EAAE,CAACQ,MAAH,CAAUJ,MAAV;AACAJ,MAAAA,EAAE,CAACK,SAAH,CAAa,CAACF,MAAM,CAACG,CAArB,EAAwB,CAACH,MAAM,CAACI,CAAhC;AACD,KAJD,MAIO;AACLP,MAAAA,EAAE,CAACS,QAAH;AACAT,MAAAA,EAAE,CAACQ,MAAH,CAAUJ,MAAV;AACD;AACF,GATD,MASO,IAAIF,SAAJ,EAAe;AACpBF,IAAAA,EAAE,CAACS,QAAH;;AACA,QAAIN,MAAJ,EAAY;AACVH,MAAAA,EAAE,CAACK,SAAH,CAAaF,MAAM,CAACG,CAApB,EAAuBH,MAAM,CAACI,CAA9B;AACD;;AACDT,IAAAA,gBAAgB,CAACE,EAAD,EAAKE,SAAL,CAAhB;;AACA,QAAIC,MAAJ,EAAY;AACVH,MAAAA,EAAE,CAACK,SAAH,CAAa,CAACF,MAAM,CAACG,CAArB,EAAwB,CAACH,MAAM,CAACI,CAAhC;AACD;AACF;AACF,CArBM","sourcesContent":["import type { TransformProps } from \"../../types\";\nimport type { SkMatrix } from \"../../../skia/types\";\nimport { processTransform } from \"../../../skia/types\";\n\nexport const processTransformProps = (m3: SkMatrix, props: TransformProps) => {\n const { transform, origin, matrix } = props;\n if (matrix) {\n if (origin) {\n m3.translate(origin.x, origin.y);\n m3.concat(matrix);\n m3.translate(-origin.x, -origin.y);\n } else {\n m3.identity();\n m3.concat(matrix);\n }\n } else if (transform) {\n m3.identity();\n if (origin) {\n m3.translate(origin.x, origin.y);\n }\n processTransform(m3, transform);\n if (origin) {\n m3.translate(-origin.x, -origin.y);\n }\n }\n};\n"]}
@@ -0,0 +1,10 @@
1
+ export * from "./Enum";
2
+ export * from "./Path";
3
+ export * from "./Fitting";
4
+ export * from "./Color";
5
+ export * from "./Rect";
6
+ export * from "./Radius";
7
+ export * from "./Circle";
8
+ export * from "./Gradient";
9
+ export * from "./Transform";
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAd;AACA,cAAc,QAAd;AACA,cAAc,WAAd;AACA,cAAc,SAAd;AACA,cAAc,QAAd;AACA,cAAc,UAAd;AACA,cAAc,UAAd;AACA,cAAc,YAAd;AACA,cAAc,aAAd","sourcesContent":["export * from \"./Enum\";\nexport * from \"./Path\";\nexport * from \"./Fitting\";\nexport * from \"./Color\";\nexport * from \"./Rect\";\nexport * from \"./Radius\";\nexport * from \"./Circle\";\nexport * from \"./Gradient\";\nexport * from \"./Transform\";\n"]}
@@ -0,0 +1,25 @@
1
+ import { isColorFilter } from "../../../skia/types";
2
+ import { NodeType } from "../../types";
3
+ import { JsiDrawingNode } from "../DrawingNode";
4
+ import { JsiDeclarationNode } from "../Node";
5
+ export class BackdropFilterNode extends JsiDrawingNode {
6
+ constructor(ctx, props) {
7
+ super(ctx, NodeType.BackdropFilter, props);
8
+ }
9
+
10
+ deriveProps() {
11
+ return null;
12
+ }
13
+
14
+ draw(_ref) {
15
+ let {
16
+ canvas
17
+ } = _ref;
18
+ const child = this._children[0];
19
+ const filter = child instanceof JsiDeclarationNode ? child.materialize() : null;
20
+ canvas.saveLayer(undefined, null, isColorFilter(filter) ? this.Skia.ImageFilter.MakeColorFilter(filter, null) : filter);
21
+ canvas.restore();
22
+ }
23
+
24
+ }
25
+ //# sourceMappingURL=BackdropFilterNode.js.map
@@ -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,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AAgDR,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