@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":["JsiSkDOM.ts"],"names":["FillNode","ImageNode","CircleNode","PathNode","LineNode","PatchNode","PointsNode","RectNode","RRectNode","VerticesNode","TextNode","OvalNode","CustomDrawingNode","TextPathNode","TextBlobNode","GlyphsNode","DiffRectNode","PictureNode","ImageSVGNode","BackdropFilterNode","BoxNode","BoxShadowNode","BlendImageFilterNode","BlurImageFilterNode","BlurMaskFilterNode","DisplacementMapImageFilterNode","DropShadowImageFilterNode","OffsetImageFilterNode","RuntimeShaderImageFilterNode","CornerPathEffectNode","DiscretePathEffectNode","DashPathEffectNode","Path1DPathEffectNode","Path2DPathEffectNode","SumPathEffectNode","Line2DPathEffectNode","BlendNode","MatrixColorFilterNode","LumaColorFilterNode","LinearToSRGBGammaColorFilterNode","SRGBToLinearGammaColorFilterNode","BlendColorFilterNode","LerpColorFilterNode","LinearGradientNode","ShaderNode","ImageShaderNode","TwoPointConicalGradientNode","TurbulenceNode","SweepGradientNode","RadialGradientNode","FractalNoiseNode","ColorNode","MorphologyImageFilterNode","GroupNode","PaintNode","JsiSkDOM","constructor","ctx","Group","props","Paint","Fill","Image","Circle","Path","CustomDrawing","Line","Oval","Patch","Points","Rect","RRect","Vertices","Text","TextPath","TextBlob","Glyphs","DiffRect","Picture","ImageSVG","BlurMaskFilter","BlendImageFilter","DropShadowImageFilter","DisplacementMapImageFilter","BlurImageFilter","OffsetImageFilter","MorphologyImageFilter","RuntimeShaderImageFilter","MatrixColorFilter","BlendColorFilter","LumaColorFilter","LinearToSRGBGammaColorFilter","SRGBToLinearGammaColorFilter","LerpColorFilter","Shader","ImageShader","ColorShader","SweepGradient","Turbulence","FractalNoise","LinearGradient","RadialGradient","TwoPointConicalGradient","CornerPathEffect","DiscretePathEffect","DashPathEffect","Path1DPathEffect","Path2DPathEffect","SumPathEffect","Line2DPathEffect","Blend","BackdropFilter","Box","BoxShadow"],"mappings":"AA2DA,SACEA,QADF,EAEEC,SAFF,EAGEC,UAHF,EAIEC,QAJF,EAKEC,QALF,EAMEC,SANF,EAOEC,UAPF,EAQEC,QARF,EASEC,SATF,EAUEC,YAVF,EAWEC,QAXF,EAYEC,QAZF,EAaEC,iBAbF,EAcEC,YAdF,EAeEC,YAfF,EAgBEC,UAhBF,EAiBEC,YAjBF,EAkBEC,WAlBF,EAmBEC,YAnBF,EAoBEC,kBApBF,EAqBEC,OArBF,EAsBEC,aAtBF,QAuBO,YAvBP;AAwBA,SAC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,\n MatrixColorFilterProps,\n CircleProps,\n BlurMaskFilterProps,\n LinearGradientProps,\n PaintProps,\n ShaderProps,\n ImageShaderProps,\n CustomDrawingNodeProps,\n LineProps,\n OvalProps,\n PatchProps,\n PointsProps,\n RectProps,\n RoundedRectProps,\n VerticesProps,\n TextProps,\n DiffRectProps,\n OffsetImageFilterProps,\n BlendColorFilterProps,\n TextPathProps,\n TextBlobProps,\n GlyphsProps,\n TwoPointConicalGradientProps,\n TurbulenceProps,\n SweepGradientProps,\n RadialGradientProps,\n FractalNoiseProps,\n ColorProps,\n PictureProps,\n ImageSVGProps,\n LerpColorFilterProps,\n DrawingNodeProps,\n BoxProps,\n BoxShadowProps,\n ChildrenProps,\n} from \"../types\";\nimport type {\n BlendImageFilterProps,\n BlendProps,\n DisplacementMapImageFilterProps,\n DropShadowImageFilterProps,\n MorphologyImageFilterProps,\n RuntimeShaderImageFilterProps,\n} from \"../types/ImageFilters\";\nimport type {\n CornerPathEffectProps,\n DashPathEffectProps,\n DiscretePathEffectProps,\n Line2DPathEffectProps,\n Path1DPathEffectProps,\n Path2DPathEffectProps,\n} from \"../types/PathEffects\";\n\nimport {\n FillNode,\n ImageNode,\n CircleNode,\n PathNode,\n LineNode,\n PatchNode,\n PointsNode,\n RectNode,\n RRectNode,\n VerticesNode,\n TextNode,\n OvalNode,\n CustomDrawingNode,\n TextPathNode,\n TextBlobNode,\n GlyphsNode,\n DiffRectNode,\n PictureNode,\n ImageSVGNode,\n BackdropFilterNode,\n BoxNode,\n BoxShadowNode,\n} from \"./drawings\";\nimport {\n BlendImageFilterNode,\n BlurImageFilterNode,\n BlurMaskFilterNode,\n DisplacementMapImageFilterNode,\n DropShadowImageFilterNode,\n OffsetImageFilterNode,\n RuntimeShaderImageFilterNode,\n CornerPathEffectNode,\n DiscretePathEffectNode,\n DashPathEffectNode,\n Path1DPathEffectNode,\n Path2DPathEffectNode,\n SumPathEffectNode,\n Line2DPathEffectNode,\n BlendNode,\n} from \"./paint\";\nimport {\n MatrixColorFilterNode,\n LumaColorFilterNode,\n LinearToSRGBGammaColorFilterNode,\n SRGBToLinearGammaColorFilterNode,\n BlendColorFilterNode,\n LerpColorFilterNode,\n} from \"./paint/ColorFilters\";\nimport {\n LinearGradientNode,\n ShaderNode,\n ImageShaderNode,\n TwoPointConicalGradientNode,\n TurbulenceNode,\n SweepGradientNode,\n RadialGradientNode,\n FractalNoiseNode,\n ColorNode,\n} from \"./paint/Shaders\";\nimport { MorphologyImageFilterNode } from \"./paint/ImageFilters\";\nimport { GroupNode } from \"./GroupNode\";\nimport { PaintNode } from \"./PaintNode\";\nimport type { NodeContext } from \"./Node\";\n\nexport class JsiSkDOM implements SkDOM {\n constructor(private ctx: NodeContext) {}\n\n Group(props?: GroupProps) {\n return new GroupNode(this.ctx, props ?? {});\n }\n\n Paint(props: PaintProps) {\n return new PaintNode(this.ctx, props);\n }\n\n // Drawings\n Fill(props?: DrawingNodeProps) {\n return new FillNode(this.ctx, props);\n }\n\n Image(props: ImageProps) {\n return new ImageNode(this.ctx, props);\n }\n\n Circle(props: CircleProps) {\n return new CircleNode(this.ctx, props);\n }\n\n Path(props: PathProps) {\n return new PathNode(this.ctx, props);\n }\n\n CustomDrawing(props: CustomDrawingNodeProps) {\n return new CustomDrawingNode(this.ctx, props);\n }\n\n Line(props: LineProps) {\n return new LineNode(this.ctx, props);\n }\n\n Oval(props: OvalProps) {\n return new OvalNode(this.ctx, props);\n }\n\n Patch(props: PatchProps) {\n return new PatchNode(this.ctx, props);\n }\n\n Points(props: PointsProps) {\n return new PointsNode(this.ctx, props);\n }\n\n Rect(props: RectProps) {\n return new RectNode(this.ctx, props);\n }\n\n RRect(props: RoundedRectProps) {\n return new RRectNode(this.ctx, props);\n }\n\n Vertices(props: VerticesProps) {\n return new VerticesNode(this.ctx, props);\n }\n\n Text(props: TextProps) {\n return new TextNode(this.ctx, props);\n }\n\n TextPath(props: TextPathProps) {\n return new TextPathNode(this.ctx, props);\n }\n\n TextBlob(props: TextBlobProps) {\n return new TextBlobNode(this.ctx, props);\n }\n\n Glyphs(props: GlyphsProps) {\n return new GlyphsNode(this.ctx, props);\n }\n\n DiffRect(props: DiffRectProps) {\n return new DiffRectNode(this.ctx, props);\n }\n\n Picture(props: PictureProps) {\n return new PictureNode(this.ctx, props);\n }\n\n ImageSVG(props: ImageSVGProps) {\n return new ImageSVGNode(this.ctx, props);\n }\n\n // BlurMaskFilters\n BlurMaskFilter(props: BlurMaskFilterProps) {\n return new BlurMaskFilterNode(this.ctx, props);\n }\n\n // ImageFilters\n BlendImageFilter(props: BlendImageFilterProps) {\n return new BlendImageFilterNode(this.ctx, props);\n }\n\n DropShadowImageFilter(props: DropShadowImageFilterProps) {\n return new DropShadowImageFilterNode(this.ctx, props);\n }\n\n DisplacementMapImageFilter(props: DisplacementMapImageFilterProps) {\n return new DisplacementMapImageFilterNode(this.ctx, props);\n }\n\n BlurImageFilter(props: BlurImageFilterProps) {\n return new BlurImageFilterNode(this.ctx, props);\n }\n\n OffsetImageFilter(props: OffsetImageFilterProps) {\n return new OffsetImageFilterNode(this.ctx, props);\n }\n\n MorphologyImageFilter(props: MorphologyImageFilterProps) {\n return new MorphologyImageFilterNode(this.ctx, props);\n }\n\n RuntimeShaderImageFilter(props: RuntimeShaderImageFilterProps) {\n return new RuntimeShaderImageFilterNode(this.ctx, props);\n }\n\n // Color Filters\n MatrixColorFilter(props: MatrixColorFilterProps) {\n return new MatrixColorFilterNode(this.ctx, props);\n }\n\n BlendColorFilter(props: BlendColorFilterProps) {\n return new BlendColorFilterNode(this.ctx, props);\n }\n\n LumaColorFilter() {\n return new LumaColorFilterNode(this.ctx);\n }\n\n LinearToSRGBGammaColorFilter() {\n return new LinearToSRGBGammaColorFilterNode(this.ctx);\n }\n\n SRGBToLinearGammaColorFilter() {\n return new SRGBToLinearGammaColorFilterNode(this.ctx);\n }\n\n LerpColorFilter(props: LerpColorFilterProps) {\n return new LerpColorFilterNode(this.ctx, props);\n }\n\n // Shaders\n Shader(props: ShaderProps) {\n return new ShaderNode(this.ctx, props);\n }\n\n ImageShader(props: ImageShaderProps) {\n return new ImageShaderNode(this.ctx, props);\n }\n\n ColorShader(props: ColorProps) {\n return new ColorNode(this.ctx, props);\n }\n\n SweepGradient(props: SweepGradientProps) {\n return new SweepGradientNode(this.ctx, props);\n }\n\n Turbulence(props: TurbulenceProps) {\n return new TurbulenceNode(this.ctx, props);\n }\n\n FractalNoise(props: FractalNoiseProps) {\n return new FractalNoiseNode(this.ctx, props);\n }\n\n LinearGradient(props: LinearGradientProps) {\n return new LinearGradientNode(this.ctx, props);\n }\n\n RadialGradient(props: RadialGradientProps) {\n return new RadialGradientNode(this.ctx, props);\n }\n\n TwoPointConicalGradient(props: TwoPointConicalGradientProps) {\n return new TwoPointConicalGradientNode(this.ctx, props);\n }\n\n // Path Effects\n CornerPathEffect(props: CornerPathEffectProps) {\n return new CornerPathEffectNode(this.ctx, props);\n }\n\n DiscretePathEffect(props: DiscretePathEffectProps) {\n return new DiscretePathEffectNode(this.ctx, props);\n }\n\n DashPathEffect(props: DashPathEffectProps) {\n return new DashPathEffectNode(this.ctx, props);\n }\n\n Path1DPathEffect(props: Path1DPathEffectProps) {\n return new Path1DPathEffectNode(this.ctx, props);\n }\n\n Path2DPathEffect(props: Path2DPathEffectProps) {\n return new Path2DPathEffectNode(this.ctx, props);\n }\n\n SumPathEffect() {\n return new SumPathEffectNode(this.ctx);\n }\n\n Line2DPathEffect(props: Line2DPathEffectProps) {\n return new Line2DPathEffectNode(this.ctx, props);\n }\n\n Blend(props: BlendProps) {\n return new BlendNode(this.ctx, props);\n }\n\n BackdropFilter(props: ChildrenProps) {\n return new BackdropFilterNode(this.ctx, props);\n }\n\n Box(props: BoxProps) {\n return new BoxNode(this.ctx, props);\n }\n\n BoxShadow(props: BoxShadowProps) {\n return new BoxShadowNode(this.ctx, props);\n }\n}\n"]}
@@ -0,0 +1,145 @@
1
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+
3
+ import { DeclarationType } from "../types";
4
+ export class JsiNode {
5
+ constructor(ctx, type, props) {
6
+ this.type = type;
7
+ this.props = props;
8
+
9
+ _defineProperty(this, "_children", []);
10
+
11
+ _defineProperty(this, "Skia", void 0);
12
+
13
+ _defineProperty(this, "depMgr", void 0);
14
+
15
+ this.Skia = ctx.Skia;
16
+ this.depMgr = ctx.depMgr;
17
+ }
18
+
19
+ setProps(props) {
20
+ this.props = props;
21
+ }
22
+
23
+ setProp(name, v) {
24
+ const hasChanged = this.props[name] !== v;
25
+ this.props[name] = v;
26
+ return hasChanged;
27
+ }
28
+
29
+ getProps() {
30
+ return this.props;
31
+ }
32
+
33
+ children() {
34
+ return this._children;
35
+ }
36
+
37
+ addChild(child) {
38
+ this._children.push(child);
39
+ }
40
+
41
+ dispose() {
42
+ this.depMgr.unsubscribeNode(this);
43
+
44
+ this._children.forEach(child => child.dispose());
45
+ }
46
+
47
+ removeChild(child) {
48
+ const index = this._children.indexOf(child);
49
+
50
+ if (index !== -1) {
51
+ const [node] = this._children.splice(index, 1);
52
+
53
+ node.dispose();
54
+ }
55
+ }
56
+
57
+ insertChildBefore(child, before) {
58
+ const index = this._children.indexOf(child);
59
+
60
+ if (index !== -1) {
61
+ this._children.splice(index, 1);
62
+ }
63
+
64
+ const beforeIndex = this._children.indexOf(before);
65
+
66
+ this._children.splice(beforeIndex, 0, child);
67
+ }
68
+
69
+ }
70
+ export class JsiDeclarationNode extends JsiNode {
71
+ constructor(ctx, declarationType, type, props) {
72
+ super(ctx, type, props);
73
+ this.declarationType = declarationType;
74
+
75
+ _defineProperty(this, "invalidate", () => {});
76
+ }
77
+
78
+ addChild(child) {
79
+ if (!(child instanceof JsiDeclarationNode)) {
80
+ throw new Error(`Cannot add child of type ${child.type} to ${this.type}`);
81
+ }
82
+
83
+ super.addChild(child);
84
+ this.invalidate();
85
+ }
86
+
87
+ insertChildBefore(child, before) {
88
+ if (!(child instanceof JsiDeclarationNode)) {
89
+ throw new Error(`Cannot add child of type ${child.type} to ${this.type}`);
90
+ }
91
+
92
+ super.insertChildBefore(child, before);
93
+ this.invalidate();
94
+ }
95
+
96
+ dispose() {
97
+ this.invalidate();
98
+ super.dispose();
99
+ }
100
+
101
+ setInvalidate(invalidate) {
102
+ this.invalidate = invalidate;
103
+ }
104
+
105
+ setProps(props) {
106
+ super.setProps(props);
107
+ this.invalidate();
108
+ }
109
+
110
+ setProp(name, v) {
111
+ const hasChanged = super.setProp(name, v);
112
+
113
+ if (hasChanged) {
114
+ this.invalidate();
115
+ }
116
+
117
+ return hasChanged;
118
+ }
119
+
120
+ isPaint() {
121
+ return this.declarationType === DeclarationType.Paint;
122
+ }
123
+
124
+ isImageFilter() {
125
+ return this.declarationType === DeclarationType.ImageFilter;
126
+ }
127
+
128
+ isColorFilter() {
129
+ return this.declarationType === DeclarationType.ColorFilter;
130
+ }
131
+
132
+ isShader() {
133
+ return this.declarationType === DeclarationType.Shader;
134
+ }
135
+
136
+ isMaskFilter() {
137
+ return this.declarationType === DeclarationType.MaskFilter;
138
+ }
139
+
140
+ isPathEffect() {
141
+ return this.declarationType === DeclarationType.PathEffect;
142
+ }
143
+
144
+ }
145
+ //# sourceMappingURL=Node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["Node.ts"],"names":["DeclarationType","JsiNode","constructor","ctx","type","props","Skia","depMgr","setProps","setProp","name","v","hasChanged","getProps","children","_children","addChild","child","push","dispose","unsubscribeNode","forEach","removeChild","index","indexOf","node","splice","insertChildBefore","before","beforeIndex","JsiDeclarationNode","declarationType","Error","invalidate","setInvalidate","isPaint","Paint","isImageFilter","ImageFilter","isColorFilter","ColorFilter","isShader","Shader","isMaskFilter","MaskFilter","isPathEffect","PathEffect"],"mappings":";;AAUA,SAASA,eAAT,QAAgC,UAAhC;AAQA,OAAO,MAAeC,OAAf,CAA6C;AAKlDC,EAAAA,WAAW,CAACC,GAAD,EAA0BC,IA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AACD,UAAD,EAAyB;AACpC,SAAKA,UAAL,GAAkBA,UAAlB;AACD;;AAEDzB,EAAAA,QAAQ,CAACH,KAAD,EAAW;AACjB,UAAMG,QAAN,CAAeH,KAAf;AACA,SAAK4B,UAAL;AACD;;AAEDxB,EAAAA,OAAO,CAAoBC,IAApB,EAA6BC,CAA7B,EAAsC;AAC3C,UAAMC,UAAU,GAAG,MAAMH,OAAN,CAAcC,IAAd,EAAoBC,CAApB,CAAnB;;AACA,QAAIC,UAAJ,EAAgB;AACd,WAAKqB,UAAL;AACD;;AACD,WAAOrB,UAAP;AACD;;AAEDuB,EAAAA,OAAO,GAA8C;AACnD,WAAO,KAAKJ,eAAL,KAAyB/B,eAAe,CAACoC,KAAhD;AACD;;AAEDC,EAAAA,aAAa,GAAoD;AAC/D,WAAO,KAAKN,eAAL,KAAyB/B,eAAe,CAACsC,WAAhD;AACD;;AAEDC,EAAAA,aAAa,GAAoD;AAC/D,WAAO,KAAKR,eAAL,KAAyB/B,eAAe,CAACwC,WAAhD;AACD;;AAEDC,EAAAA,QAAQ,GAA+C;AACrD,WAAO,KAAKV,eAAL,KAAyB/B,eAAe,CAAC0C,MAAhD;AACD;;AAEDC,EAAAA,YAAY,GAAmD;AAC7D,WAAO,KAAKZ,eAAL,KAAyB/B,eAAe,CAAC4C,UAAhD;AACD;;AAEDC,EAAAA,YAAY,GAAmD;AAC7D,WAAO,KAAKd,eAAL,KAAyB/B,eAAe,CAAC8C,UAAhD;AACD;;AA1EH","sourcesContent":["import type {\n SkColorFilter,\n Skia,\n SkImageFilter,\n SkMaskFilter,\n SkShader,\n SkPathEffect,\n SkPaint,\n} from \"../../skia/types\";\nimport type { Node, DeclarationNode, NodeType } from \"../types\";\nimport { DeclarationType } from \"../types\";\nimport type { DependencyManager } from \"../../renderer/DependencyManager\";\n\nexport interface NodeContext {\n Skia: Skia;\n depMgr: DependencyManager;\n}\n\nexport abstract class JsiNode<P> implements Node<P> {\n protected _children: JsiNode<unknown>[] = [];\n protected Skia: Skia;\n protected depMgr: DependencyManager;\n\n constructor(ctx: NodeContext, public type: NodeType, protected props: P) {\n this.Skia = ctx.Skia;\n this.depMgr = ctx.depMgr;\n }\n\n setProps(props: P) {\n this.props = props;\n }\n\n setProp<K extends keyof P>(name: K, v: P[K]) {\n const hasChanged = this.props[name] !== v;\n this.props[name] = v;\n return hasChanged;\n }\n\n getProps() {\n return this.props;\n }\n\n children() {\n return this._children;\n }\n\n addChild(child: Node<unknown>) {\n this._children.push(child as JsiNode<unknown>);\n }\n\n dispose() {\n this.depMgr.unsubscribeNode(this);\n this._children.forEach((child) => child.dispose());\n }\n\n removeChild(child: Node<unknown>) {\n const index = this._children.indexOf(child as JsiNode<unknown>);\n if (index !== -1) {\n const [node] = this._children.splice(index, 1);\n node.dispose();\n }\n }\n\n insertChildBefore(child: Node<unknown>, before: Node<unknown>) {\n const index = this._children.indexOf(child as JsiNode<unknown>);\n if (index !== -1) {\n this._children.splice(index, 1);\n }\n const beforeIndex = this._children.indexOf(before as JsiNode<unknown>);\n this._children.splice(beforeIndex, 0, child as JsiNode<unknown>);\n }\n}\n\nexport type Invalidate = () => void;\n\nexport abstract class JsiDeclarationNode<\n P,\n T,\n Nullable extends null | never = never\n >\n extends JsiNode<P>\n implements DeclarationNode<P, T, Nullable>\n{\n private invalidate: Invalidate = () => {};\n\n constructor(\n ctx: NodeContext,\n public declarationType: DeclarationType,\n type: NodeType,\n props: P\n ) {\n super(ctx, type, props);\n }\n\n abstract materialize(): T | Nullable;\n\n addChild(child: Node<unknown>): void {\n if (!(child instanceof JsiDeclarationNode)) {\n throw new Error(`Cannot add child of type ${child.type} to ${this.type}`);\n }\n super.addChild(child);\n this.invalidate();\n }\n\n insertChildBefore(child: Node<unknown>, before: Node<unknown>): void {\n if (!(child instanceof JsiDeclarationNode)) {\n throw new Error(`Cannot add child of type ${child.type} to ${this.type}`);\n }\n super.insertChildBefore(child, before);\n this.invalidate();\n }\n\n dispose() {\n this.invalidate();\n super.dispose();\n }\n\n setInvalidate(invalidate: Invalidate) {\n this.invalidate = invalidate;\n }\n\n setProps(props: P) {\n super.setProps(props);\n this.invalidate();\n }\n\n setProp<K extends keyof P>(name: K, v: P[K]) {\n const hasChanged = super.setProp(name, v);\n if (hasChanged) {\n this.invalidate();\n }\n return hasChanged;\n }\n\n isPaint(): this is DeclarationNode<unknown, SkPaint> {\n return this.declarationType === DeclarationType.Paint;\n }\n\n isImageFilter(): this is DeclarationNode<unknown, SkImageFilter> {\n return this.declarationType === DeclarationType.ImageFilter;\n }\n\n isColorFilter(): this is DeclarationNode<unknown, SkColorFilter> {\n return this.declarationType === DeclarationType.ColorFilter;\n }\n\n isShader(): this is DeclarationNode<unknown, SkShader> {\n return this.declarationType === DeclarationType.Shader;\n }\n\n isMaskFilter(): this is DeclarationNode<unknown, SkMaskFilter> {\n return this.declarationType === DeclarationType.MaskFilter;\n }\n\n isPathEffect(): this is DeclarationNode<unknown, SkPathEffect> {\n return this.declarationType === DeclarationType.PathEffect;\n }\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=PaintContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
@@ -0,0 +1,83 @@
1
+ import { StrokeCap, StrokeJoin, PaintStyle, BlendMode } from "../../skia/types";
2
+ import { DeclarationType, NodeType } from "../types";
3
+ import { enumKey } from "./datatypes";
4
+ import { JsiDeclarationNode } from "./Node";
5
+ export class PaintNode extends JsiDeclarationNode {
6
+ constructor(ctx) {
7
+ let props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
8
+ super(ctx, DeclarationType.Paint, NodeType.Paint, props);
9
+ }
10
+
11
+ materialize() {
12
+ const {
13
+ color,
14
+ strokeWidth,
15
+ blendMode,
16
+ style,
17
+ strokeJoin,
18
+ strokeCap,
19
+ strokeMiter,
20
+ opacity,
21
+ antiAlias
22
+ } = this.props;
23
+ const paint = this.Skia.Paint();
24
+
25
+ if (color !== undefined) {
26
+ paint.setColor(this.Skia.Color(color));
27
+ }
28
+
29
+ if (strokeWidth !== undefined) {
30
+ paint.setStrokeWidth(strokeWidth);
31
+ }
32
+
33
+ if (blendMode !== undefined) {
34
+ paint.setBlendMode(BlendMode[enumKey(blendMode)]);
35
+ }
36
+
37
+ if (style !== undefined) {
38
+ paint.setStyle(PaintStyle[enumKey(style)]);
39
+ }
40
+
41
+ if (strokeJoin !== undefined) {
42
+ paint.setStrokeJoin(StrokeJoin[enumKey(strokeJoin)]);
43
+ }
44
+
45
+ if (strokeCap !== undefined) {
46
+ paint.setStrokeCap(StrokeCap[enumKey(strokeCap)]);
47
+ }
48
+
49
+ if (strokeMiter !== undefined) {
50
+ paint.setStrokeMiter(strokeMiter);
51
+ }
52
+
53
+ if (opacity !== undefined) {
54
+ paint.setAlphaf(opacity);
55
+ }
56
+
57
+ if (antiAlias !== undefined) {
58
+ paint.setAntiAlias(antiAlias);
59
+ }
60
+
61
+ this._children.forEach(child => {
62
+ if (child instanceof JsiDeclarationNode) {
63
+ if (child.isShader()) {
64
+ paint.setShader(child.materialize());
65
+ } else if (child.isColorFilter()) {
66
+ paint.setColorFilter(child.materialize());
67
+ } else if (child.isImageFilter()) {
68
+ paint.setImageFilter(child.materialize());
69
+ } else if (child.isMaskFilter()) {
70
+ paint.setMaskFilter(child.materialize());
71
+ } else if (child.isPathEffect()) {
72
+ paint.setPathEffect(child.materialize());
73
+ } else {
74
+ throw new Error(`Unknown paint child ${child.type}`);
75
+ }
76
+ }
77
+ });
78
+
79
+ return paint;
80
+ }
81
+
82
+ }
83
+ //# sourceMappingURL=PaintNode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["PaintNode.ts"],"names":["StrokeCap","StrokeJoin","PaintStyle","BlendMode","DeclarationType","NodeType","enumKey","JsiDeclarationNode","PaintNode","constructor","ctx","props","Paint","materialize","color","strokeWidth","blendMode","style","strokeJoin","strokeCap","strokeMiter","opacity","antiAlias","paint","Skia","undefined","setColor","Color","setStrokeWidth","setBlendMode","setStyle","setStrokeJoin","setStrokeCap","setStrokeMiter","setAlphaf","setAntiAlias","_children","forEach","child","isShader","setShader","isColorFilter","setColorFilter","isImageFilter","setImageFilter","isMaskFilter","setMaskFilter","isPathEffect","setPathEffect","Error","type"],"mappings":"AACA,SAASA,SAAT,EAAoBC,UAApB,EAAgCC,UAAhC,EAA4CC,SAA5C,QAA6D,kBAA7D;AAEA,SAASC,eAAT,EAA0BC,QAA1B,QAA0C,UAA1C;AAEA,SAASC,OAAT,QAAwB,aAAxB;AAEA,SAASC,kBAAT,QAAmC,QAAnC;AAEA,OAAO,MAAMC,SAAN,SACGD,kBADH,CAGP;AACEE,EAAAA,WAAW,CAACC,GAAD,EAA2C;AAAA,QAAxBC,KAAwB,uEAAJ,EAAI;AACpD,UAAMD,GAAN,EAAWN,eAAe,CAACQ,KAA3B,EAAkCP,QAAQ,CAACO,KAA3C,EAAkDD,KAAlD;AACD;;AAEDE,EAAAA,WAAW,GAAG;AACZ,UAAM;AACJC,MAAAA,KADI;AAEJC,MAAAA,WAFI;AAGJC,MAAAA,SAHI;AAIJC,MAAAA,KAJI;AAKJC,MAAAA,UALI;AAMJC,MAAAA,SANI;AAOJC,MAAAA,WAPI;AAQJC,MAAAA,OARI;AASJC,MAAAA;AATI,QAUF,KAAKX,KAVT;AAWA,UAAMY,KAAK,GAAG,KAAKC,IAAL,CAAUZ,KAAV,EAAd;;AACA,QAAIE,KAAK,KAAKW,SAAd,EAAyB;AACvBF,MAAAA,KAAK,CAACG,QAAN,CAAe,KAAKF,IAAL,CAAUG,KAAV,CAAgBb,KAAhB,CAAf;AACD;;AACD,QAAIC,WAAW,KAAKU,SAApB,EAA+B;AAC7BF,MAAAA,KAAK,CAACK,cAAN,CAAqBb,WAArB;AACD;;AACD,QAAIC,SAAS,KAAKS,SAAlB,EAA6B;AAC3BF,MAAAA,KAAK,CAACM,YAAN,CAAmB1B,SAAS,CAACG,OAAO,CAACU,SAAD,CAAR,CA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CAACuB,aAAN,CAAoBR,KAAK,CAACzB,WAAN,EAApB;AACD,SAFM,MAEA,IAAIyB,KAAK,CAACS,YAAN,EAAJ,EAA0B;AAC/BxB,UAAAA,KAAK,CAACyB,aAAN,CAAoBV,KAAK,CAACzB,WAAN,EAApB;AACD,SAFM,MAEA;AACL,gBAAM,IAAIoC,KAAJ,CAAW,uBAAsBX,KAAK,CAACY,IAAK,EAA5C,CAAN;AACD;AACF;AACF,KAhBD;;AAiBA,WAAO3B,KAAP;AACD;;AA/DH","sourcesContent":["import type { SkPaint } from \"../../skia/types\";\nimport { StrokeCap, StrokeJoin, PaintStyle, BlendMode } from \"../../skia/types\";\nimport type { DeclarationNode, PaintProps } from \"../types\";\nimport { DeclarationType, NodeType } from \"../types\";\n\nimport { enumKey } from \"./datatypes\";\nimport type { NodeContext } from \"./Node\";\nimport { JsiDeclarationNode } from \"./Node\";\n\nexport class PaintNode\n extends JsiDeclarationNode<PaintProps, SkPaint>\n implements DeclarationNode<PaintProps, SkPaint>\n{\n constructor(ctx: NodeContext, props: PaintProps = {}) {\n super(ctx, DeclarationType.Paint, NodeType.Paint, props);\n }\n\n materialize() {\n const {\n color,\n strokeWidth,\n blendMode,\n style,\n strokeJoin,\n strokeCap,\n strokeMiter,\n opacity,\n antiAlias,\n } = this.props;\n const paint = this.Skia.Paint();\n if (color !== undefined) {\n paint.setColor(this.Skia.Color(color));\n }\n if (strokeWidth !== undefined) {\n paint.setStrokeWidth(strokeWidth);\n }\n if (blendMode !== undefined) {\n paint.setBlendMode(BlendMode[enumKey(blendMode)]);\n }\n if (style !== undefined) {\n paint.setStyle(PaintStyle[enumKey(style)]);\n }\n if (strokeJoin !== undefined) {\n paint.setStrokeJoin(StrokeJoin[enumKey(strokeJoin)]);\n }\n if (strokeCap !== undefined) {\n paint.setStrokeCap(StrokeCap[enumKey(strokeCap)]);\n }\n if (strokeMiter !== undefined) {\n paint.setStrokeMiter(strokeMiter);\n }\n if (opacity !== undefined) {\n paint.setAlphaf(opacity);\n }\n if (antiAlias !== undefined) {\n paint.setAntiAlias(antiAlias);\n }\n this._children.forEach((child) => {\n if (child instanceof JsiDeclarationNode) {\n if (child.isShader()) {\n paint.setShader(child.materialize());\n } else if (child.isColorFilter()) {\n paint.setColorFilter(child.materialize());\n } else if (child.isImageFilter()) {\n paint.setImageFilter(child.materialize());\n } else if (child.isMaskFilter()) {\n paint.setMaskFilter(child.materialize());\n } else if (child.isPathEffect()) {\n paint.setPathEffect(child.materialize());\n } else {\n throw new Error(`Unknown paint child ${child.type}`);\n }\n }\n });\n return paint;\n }\n}\n"]}
@@ -0,0 +1,329 @@
1
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+
3
+ import { StrokeCap, StrokeJoin, PaintStyle, BlendMode, ClipOp, isRRect } from "../../skia/types";
4
+ import { isPathDef, processPath, processTransformProps } from "./datatypes";
5
+ import { JsiNode, JsiDeclarationNode } from "./Node";
6
+ import { enumKey } from "./datatypes/Enum";
7
+ const paintProps = ["color", "strokeWidth", "blendMode", "strokeCap", "strokeJoin", "strokeMiter", "style", "antiAlias", "opacity"];
8
+ export class JsiRenderNode extends JsiNode {
9
+ constructor(ctx, type, props) {
10
+ super(ctx, type, props);
11
+
12
+ _defineProperty(this, "paintCache", null);
13
+
14
+ _defineProperty(this, "matrix", void 0);
15
+
16
+ _defineProperty(this, "clipRect", void 0);
17
+
18
+ _defineProperty(this, "clipRRect", void 0);
19
+
20
+ _defineProperty(this, "clipPath", void 0);
21
+
22
+ this.matrix = this.Skia.Matrix();
23
+ this.onPropChange();
24
+ }
25
+
26
+ setProps(props) {
27
+ super.setProps(props);
28
+ this.onPropChange();
29
+ this.paintCache = null;
30
+ }
31
+
32
+ setProp(key, value) {
33
+ const hasChanged = super.setProp(key, value);
34
+
35
+ if (hasChanged) {
36
+ this.onPropChange();
37
+
38
+ if (paintProps.includes(key)) {
39
+ this.paintCache = null;
40
+ }
41
+ }
42
+
43
+ return hasChanged;
44
+ }
45
+
46
+ onPropChange() {
47
+ this.matrix.identity();
48
+ this.clipPath = undefined;
49
+ this.clipRect = undefined;
50
+ this.clipRRect = undefined;
51
+ this.computeMatrix();
52
+ this.computeClip();
53
+ }
54
+
55
+ addChild(child) {
56
+ if (child instanceof JsiDeclarationNode) {
57
+ child.setInvalidate(() => this.paintCache = null);
58
+ }
59
+
60
+ super.addChild(child);
61
+ }
62
+
63
+ insertChildBefore(child, before) {
64
+ if (child instanceof JsiDeclarationNode) {
65
+ child.setInvalidate(() => this.paintCache = null);
66
+ }
67
+
68
+ super.insertChildBefore(child, before);
69
+ }
70
+
71
+ computeClip() {
72
+ const {
73
+ clip
74
+ } = this.props;
75
+
76
+ if (clip) {
77
+ if (isPathDef(clip)) {
78
+ this.clipPath = processPath(this.Skia, clip);
79
+ } else if (isRRect(clip)) {
80
+ this.clipRRect = clip;
81
+ } else {
82
+ this.clipRect = clip;
83
+ }
84
+ }
85
+ }
86
+
87
+ computeMatrix() {
88
+ processTransformProps(this.matrix, this.props);
89
+ }
90
+
91
+ getPaintCtx() {
92
+ let ctx;
93
+ const {
94
+ color,
95
+ strokeWidth,
96
+ blendMode,
97
+ style,
98
+ strokeJoin,
99
+ strokeCap,
100
+ strokeMiter,
101
+ opacity,
102
+ antiAlias
103
+ } = this.props;
104
+
105
+ if (color !== undefined || strokeWidth !== undefined || blendMode !== undefined || style !== undefined || strokeJoin !== undefined || strokeCap !== undefined || strokeMiter !== undefined || opacity !== undefined || antiAlias !== undefined) {
106
+ ctx = {};
107
+
108
+ if (color !== undefined) {
109
+ ctx.color = this.Skia.Color(color);
110
+ }
111
+
112
+ if (strokeWidth !== undefined) {
113
+ ctx.strokeWidth = strokeWidth;
114
+ }
115
+
116
+ if (blendMode !== undefined) {
117
+ ctx.blendMode = BlendMode[enumKey(blendMode)];
118
+ }
119
+
120
+ if (style !== undefined) {
121
+ ctx.style = PaintStyle[enumKey(style)];
122
+ }
123
+
124
+ if (strokeJoin !== undefined) {
125
+ ctx.strokeJoin = StrokeJoin[enumKey(strokeJoin)];
126
+ }
127
+
128
+ if (strokeCap !== undefined) {
129
+ ctx.strokeCap = StrokeCap[enumKey(strokeCap)];
130
+ }
131
+
132
+ if (strokeMiter !== undefined) {
133
+ ctx.strokeMiter = strokeMiter;
134
+ }
135
+
136
+ if (opacity !== undefined) {
137
+ ctx.opacity = opacity;
138
+ }
139
+
140
+ if (antiAlias !== undefined) {
141
+ ctx.antiAlias = antiAlias;
142
+ }
143
+ }
144
+
145
+ this._children.forEach(child => {
146
+ if (child instanceof JsiDeclarationNode) {
147
+ if (child.isColorFilter()) {
148
+ ctx = ctx || {};
149
+ const cf = child.materialize();
150
+ ctx.colorFilter = ctx.colorFilter ? this.Skia.ColorFilter.MakeCompose(cf, ctx.colorFilter) : cf;
151
+ } else if (child.isShader()) {
152
+ ctx = ctx || {};
153
+ const shader = child.materialize();
154
+ ctx.shader = shader;
155
+ } else if (child.isPathEffect()) {
156
+ ctx = ctx || {};
157
+ const pe = child.materialize();
158
+ ctx.pathEffect = ctx.pathEffect ? this.Skia.PathEffect.MakeCompose(pe, ctx.pathEffect) : pe;
159
+ } else if (child.isImageFilter()) {
160
+ ctx = ctx || {};
161
+ const filter = child.materialize();
162
+ ctx.imageFilter = ctx.imageFilter ? this.Skia.ImageFilter.MakeCompose(filter, ctx.imageFilter) : filter;
163
+ } else if (child.isMaskFilter()) {
164
+ ctx = ctx || {};
165
+ const filter = child.materialize();
166
+ ctx.maskFilter = filter;
167
+ }
168
+ }
169
+ });
170
+
171
+ return ctx;
172
+ }
173
+
174
+ render(parentCtx) {
175
+ const {
176
+ invertClip,
177
+ layer,
178
+ matrix,
179
+ transform
180
+ } = this.props;
181
+ const {
182
+ canvas
183
+ } = parentCtx;
184
+ const opacity = this.props.opacity ? parentCtx.opacity * this.props.opacity : parentCtx.opacity;
185
+
186
+ if (this.paintCache === null || this.paintCache.parent !== parentCtx.paint) {
187
+ const paintCtx = this.getPaintCtx();
188
+ const child = paintCtx ? concatPaint(parentCtx.paint, paintCtx, parentCtx.opacity) : parentCtx.paint;
189
+ this.paintCache = {
190
+ parent: parentCtx.paint,
191
+ child
192
+ };
193
+ }
194
+
195
+ const paint = this.paintCache.child; // TODO: can we only recreate a new context here if needed?
196
+
197
+ const ctx = { ...parentCtx,
198
+ opacity,
199
+ paint
200
+ };
201
+ const hasTransform = matrix !== undefined || transform !== undefined;
202
+ const hasClip = this.clipRect !== undefined;
203
+ const shouldSave = hasTransform || hasClip || !!layer;
204
+ const op = invertClip ? ClipOp.Difference : ClipOp.Intersect;
205
+
206
+ if (shouldSave) {
207
+ if (layer) {
208
+ if (typeof layer === "boolean") {
209
+ canvas.saveLayer();
210
+ } else if (isSkPaint(layer)) {
211
+ canvas.saveLayer(layer);
212
+ } else {
213
+ canvas.saveLayer(layer.current ? layer.current.materialize() : undefined);
214
+ }
215
+ } else {
216
+ canvas.save();
217
+ }
218
+ }
219
+
220
+ if (this.matrix) {
221
+ canvas.concat(this.matrix);
222
+ }
223
+
224
+ if (this.clipRect) {
225
+ canvas.clipRect(this.clipRect, op, true);
226
+ }
227
+
228
+ if (this.clipRRect) {
229
+ canvas.clipRRect(this.clipRRect, op, true);
230
+ }
231
+
232
+ if (this.clipPath) {
233
+ canvas.clipPath(this.clipPath, op, true);
234
+ }
235
+
236
+ this.renderNode(ctx);
237
+
238
+ if (shouldSave) {
239
+ canvas.restore();
240
+ }
241
+ }
242
+
243
+ }
244
+ export const isSkPaint = obj => "__typename__" in obj && obj.__typename__ === "Paint";
245
+
246
+ const concatPaint = (parent, _ref, opacity) => {
247
+ let {
248
+ color,
249
+ strokeWidth,
250
+ shader,
251
+ antiAlias,
252
+ blendMode,
253
+ colorFilter,
254
+ imageFilter,
255
+ maskFilter,
256
+ pathEffect,
257
+ opacity: alpha,
258
+ strokeCap,
259
+ strokeJoin,
260
+ strokeMiter,
261
+ style
262
+ } = _ref;
263
+ const paint = parent.copy();
264
+
265
+ if (color !== undefined) {
266
+ paint.setShader(null);
267
+ color[3] *= opacity;
268
+ paint.setColor(color);
269
+ } else {
270
+ const cl = paint.getColor();
271
+ cl[3] *= opacity;
272
+ paint.setColor(cl);
273
+ }
274
+
275
+ if (strokeWidth !== undefined) {
276
+ paint.setStrokeWidth(strokeWidth);
277
+ }
278
+
279
+ if (shader !== undefined) {
280
+ paint.setShader(shader);
281
+ }
282
+
283
+ if (antiAlias !== undefined) {
284
+ paint.setAntiAlias(antiAlias);
285
+ }
286
+
287
+ if (blendMode !== undefined) {
288
+ paint.setBlendMode(blendMode);
289
+ }
290
+
291
+ if (colorFilter !== undefined) {
292
+ paint.setColorFilter(colorFilter);
293
+ }
294
+
295
+ if (imageFilter !== undefined) {
296
+ paint.setImageFilter(imageFilter);
297
+ }
298
+
299
+ if (maskFilter !== undefined) {
300
+ paint.setMaskFilter(maskFilter);
301
+ }
302
+
303
+ if (pathEffect !== undefined) {
304
+ paint.setPathEffect(pathEffect);
305
+ }
306
+
307
+ if (alpha !== undefined) {
308
+ paint.setAlphaf(alpha * opacity);
309
+ }
310
+
311
+ if (strokeCap !== undefined) {
312
+ paint.setStrokeCap(strokeCap);
313
+ }
314
+
315
+ if (strokeJoin !== undefined) {
316
+ paint.setStrokeJoin(strokeJoin);
317
+ }
318
+
319
+ if (strokeMiter !== undefined) {
320
+ paint.setStrokeMiter(strokeMiter);
321
+ }
322
+
323
+ if (style !== undefined) {
324
+ paint.setStyle(style);
325
+ }
326
+
327
+ return paint;
328
+ };
329
+ //# sourceMappingURL=RenderNode.js.map