@shopify/react-native-skia 0.1.147 → 0.1.149

Sign up to get free protection for your applications and to get access to all the features.
Files changed (836) hide show
  1. package/cpp/api/JsiSkFont.h +4 -4
  2. package/cpp/rnskia/RNSkJsiViewApi.h +2 -2
  3. package/lib/commonjs/dom/nodes/DrawingNode.js +84 -0
  4. package/lib/commonjs/dom/nodes/DrawingNode.js.map +1 -0
  5. package/lib/commonjs/dom/nodes/GroupNode.js +28 -0
  6. package/lib/commonjs/dom/nodes/GroupNode.js.map +1 -0
  7. package/lib/commonjs/dom/nodes/JsiSkDOM.js +256 -0
  8. package/lib/commonjs/dom/nodes/JsiSkDOM.js.map +1 -0
  9. package/lib/commonjs/dom/nodes/Node.js +158 -0
  10. package/lib/commonjs/dom/nodes/Node.js.map +1 -0
  11. package/lib/commonjs/dom/nodes/PaintContext.js +6 -0
  12. package/lib/commonjs/dom/nodes/PaintContext.js.map +1 -0
  13. package/lib/commonjs/dom/nodes/PaintNode.js +96 -0
  14. package/lib/commonjs/dom/nodes/PaintNode.js.map +1 -0
  15. package/lib/commonjs/dom/nodes/RenderNode.js +346 -0
  16. package/lib/commonjs/dom/nodes/RenderNode.js.map +1 -0
  17. package/lib/commonjs/{renderer/processors/Circles.js → dom/nodes/datatypes/Circle.js} +4 -2
  18. package/lib/commonjs/dom/nodes/datatypes/Circle.js.map +1 -0
  19. package/lib/commonjs/{renderer/processors → dom/nodes/datatypes}/Color.js +0 -0
  20. package/lib/commonjs/{renderer/processors → dom/nodes/datatypes}/Color.js.map +1 -1
  21. package/lib/commonjs/dom/nodes/datatypes/Enum.js +11 -0
  22. package/lib/commonjs/dom/nodes/datatypes/Enum.js.map +1 -0
  23. package/lib/commonjs/{renderer/components/image/BoxFit.js → dom/nodes/datatypes/Fitting.js} +2 -2
  24. package/lib/commonjs/{renderer/components/image/BoxFit.js.map → dom/nodes/datatypes/Fitting.js.map} +1 -1
  25. package/lib/commonjs/dom/nodes/datatypes/Gradient.js +65 -0
  26. package/lib/commonjs/dom/nodes/datatypes/Gradient.js.map +1 -0
  27. package/lib/commonjs/{renderer/processors/Paths.js → dom/nodes/datatypes/Path.js} +2 -2
  28. package/lib/commonjs/dom/nodes/datatypes/Path.js.map +1 -0
  29. package/lib/commonjs/{renderer/processors → dom/nodes/datatypes}/Radius.js +0 -0
  30. package/lib/commonjs/dom/nodes/datatypes/Radius.js.map +1 -0
  31. package/lib/commonjs/{renderer/processors/Rects.js → dom/nodes/datatypes/Rect.js} +1 -1
  32. package/lib/commonjs/dom/nodes/datatypes/Rect.js.map +1 -0
  33. package/lib/commonjs/dom/nodes/datatypes/Transform.js +42 -0
  34. package/lib/commonjs/dom/nodes/datatypes/Transform.js.map +1 -0
  35. package/lib/commonjs/dom/nodes/datatypes/index.js +123 -0
  36. package/lib/commonjs/dom/nodes/datatypes/index.js.map +1 -0
  37. package/lib/commonjs/dom/nodes/drawings/BackdropFilterNode.js +38 -0
  38. package/lib/commonjs/dom/nodes/drawings/BackdropFilterNode.js.map +1 -0
  39. package/lib/commonjs/dom/nodes/drawings/Box.js +105 -0
  40. package/lib/commonjs/dom/nodes/drawings/Box.js.map +1 -0
  41. package/lib/commonjs/dom/nodes/drawings/CircleNode.js +43 -0
  42. package/lib/commonjs/dom/nodes/drawings/CircleNode.js.map +1 -0
  43. package/lib/commonjs/dom/nodes/drawings/CustomDrawingNode.js +28 -0
  44. package/lib/commonjs/dom/nodes/drawings/CustomDrawingNode.js.map +1 -0
  45. package/lib/commonjs/dom/nodes/drawings/DiffRectNode.js +36 -0
  46. package/lib/commonjs/dom/nodes/drawings/DiffRectNode.js.map +1 -0
  47. package/lib/commonjs/dom/nodes/drawings/FillNode.js +33 -0
  48. package/lib/commonjs/dom/nodes/drawings/FillNode.js.map +1 -0
  49. package/lib/commonjs/dom/nodes/drawings/ImageNode.js +63 -0
  50. package/lib/commonjs/dom/nodes/drawings/ImageNode.js.map +1 -0
  51. package/lib/commonjs/dom/nodes/drawings/ImageSVG.js +45 -0
  52. package/lib/commonjs/dom/nodes/drawings/ImageSVG.js.map +1 -0
  53. package/lib/commonjs/dom/nodes/drawings/LineNode.js +36 -0
  54. package/lib/commonjs/dom/nodes/drawings/LineNode.js.map +1 -0
  55. package/lib/commonjs/dom/nodes/drawings/OvalNode.js +39 -0
  56. package/lib/commonjs/dom/nodes/drawings/OvalNode.js.map +1 -0
  57. package/lib/commonjs/dom/nodes/drawings/PatchNode.js +69 -0
  58. package/lib/commonjs/dom/nodes/drawings/PatchNode.js.map +1 -0
  59. package/lib/commonjs/dom/nodes/drawings/PathNode.js +68 -0
  60. package/lib/commonjs/dom/nodes/drawings/PathNode.js.map +1 -0
  61. package/lib/commonjs/dom/nodes/drawings/PictureNode.js +34 -0
  62. package/lib/commonjs/dom/nodes/drawings/PictureNode.js.map +1 -0
  63. package/lib/commonjs/dom/nodes/drawings/PointsNode.js +40 -0
  64. package/lib/commonjs/dom/nodes/drawings/PointsNode.js.map +1 -0
  65. package/lib/commonjs/dom/nodes/drawings/RRectNode.js +43 -0
  66. package/lib/commonjs/dom/nodes/drawings/RRectNode.js.map +1 -0
  67. package/lib/commonjs/dom/nodes/drawings/RectNode.js +39 -0
  68. package/lib/commonjs/dom/nodes/drawings/RectNode.js.map +1 -0
  69. package/lib/commonjs/dom/nodes/drawings/Text.js +185 -0
  70. package/lib/commonjs/dom/nodes/drawings/Text.js.map +1 -0
  71. package/lib/commonjs/dom/nodes/drawings/VerticesNode.js +55 -0
  72. package/lib/commonjs/dom/nodes/drawings/VerticesNode.js.map +1 -0
  73. package/lib/commonjs/dom/nodes/drawings/index.js +240 -0
  74. package/lib/commonjs/dom/nodes/drawings/index.js.map +1 -0
  75. package/lib/commonjs/dom/nodes/index.js +45 -0
  76. package/lib/commonjs/dom/nodes/index.js.map +1 -0
  77. package/lib/commonjs/dom/nodes/paint/BlendNode.js +82 -0
  78. package/lib/commonjs/dom/nodes/paint/BlendNode.js.map +1 -0
  79. package/lib/commonjs/dom/nodes/paint/ColorFilters.js +152 -0
  80. package/lib/commonjs/dom/nodes/paint/ColorFilters.js.map +1 -0
  81. package/lib/commonjs/dom/nodes/paint/ImageFilters.js +225 -0
  82. package/lib/commonjs/dom/nodes/paint/ImageFilters.js.map +1 -0
  83. package/lib/commonjs/dom/nodes/paint/MaskFilters.js +33 -0
  84. package/lib/commonjs/dom/nodes/paint/MaskFilters.js.map +1 -0
  85. package/lib/commonjs/dom/nodes/paint/PathEffects.js +223 -0
  86. package/lib/commonjs/dom/nodes/paint/PathEffects.js.map +1 -0
  87. package/lib/commonjs/dom/nodes/paint/Shaders.js +242 -0
  88. package/lib/commonjs/dom/nodes/paint/Shaders.js.map +1 -0
  89. package/lib/commonjs/dom/nodes/paint/index.js +84 -0
  90. package/lib/commonjs/dom/nodes/paint/index.js.map +1 -0
  91. package/lib/commonjs/dom/types/ColorFilters.js +6 -0
  92. package/lib/commonjs/dom/types/ColorFilters.js.map +1 -0
  93. package/lib/commonjs/dom/types/Common.js +6 -0
  94. package/lib/commonjs/dom/types/Common.js.map +1 -0
  95. package/lib/commonjs/dom/types/DrawingContext.js +6 -0
  96. package/lib/commonjs/dom/types/DrawingContext.js.map +1 -0
  97. package/lib/commonjs/dom/types/Drawings.js +6 -0
  98. package/lib/commonjs/dom/types/Drawings.js.map +1 -0
  99. package/lib/commonjs/dom/types/ImageFilters.js +6 -0
  100. package/lib/commonjs/dom/types/ImageFilters.js.map +1 -0
  101. package/lib/commonjs/dom/types/MaskFilters.js +6 -0
  102. package/lib/commonjs/dom/types/MaskFilters.js.map +1 -0
  103. package/lib/commonjs/dom/types/Node.js +6 -0
  104. package/lib/commonjs/dom/types/Node.js.map +1 -0
  105. package/lib/commonjs/dom/types/NodeType.js +80 -0
  106. package/lib/commonjs/dom/types/NodeType.js.map +1 -0
  107. package/lib/commonjs/dom/types/PathEffects.js +6 -0
  108. package/lib/commonjs/dom/types/PathEffects.js.map +1 -0
  109. package/lib/commonjs/dom/types/Shaders.js +6 -0
  110. package/lib/commonjs/dom/types/Shaders.js.map +1 -0
  111. package/lib/commonjs/dom/types/SkDOM.js +6 -0
  112. package/lib/commonjs/dom/types/SkDOM.js.map +1 -0
  113. package/lib/commonjs/dom/types/index.js +149 -0
  114. package/lib/commonjs/dom/types/index.js.map +1 -0
  115. package/lib/commonjs/index.js +26 -0
  116. package/lib/commonjs/index.js.map +1 -1
  117. package/lib/commonjs/renderer/Canvas.js +7 -3
  118. package/lib/commonjs/renderer/Canvas.js.map +1 -1
  119. package/lib/commonjs/renderer/Container.js +39 -0
  120. package/lib/commonjs/renderer/Container.js.map +1 -0
  121. package/lib/commonjs/renderer/DependencyManager.js +17 -5
  122. package/lib/commonjs/renderer/DependencyManager.js.map +1 -1
  123. package/lib/commonjs/renderer/HostComponents.js +196 -0
  124. package/lib/commonjs/renderer/HostComponents.js.map +1 -0
  125. package/lib/commonjs/renderer/HostConfig.js +47 -125
  126. package/lib/commonjs/renderer/HostConfig.js.map +1 -1
  127. package/lib/commonjs/renderer/components/Blend.js +1 -46
  128. package/lib/commonjs/renderer/components/Blend.js.map +1 -1
  129. package/lib/commonjs/renderer/components/Drawing.js +1 -15
  130. package/lib/commonjs/renderer/components/Drawing.js.map +1 -1
  131. package/lib/commonjs/renderer/components/Group.js +1 -69
  132. package/lib/commonjs/renderer/components/Group.js.map +1 -1
  133. package/lib/commonjs/renderer/components/Paint.js +2 -14
  134. package/lib/commonjs/renderer/components/Paint.js.map +1 -1
  135. package/lib/commonjs/renderer/components/Picture.js +1 -19
  136. package/lib/commonjs/renderer/components/Picture.js.map +1 -1
  137. package/lib/commonjs/renderer/components/backdrop/BackdropBlur.js.map +1 -1
  138. package/lib/commonjs/renderer/components/backdrop/BackdropFilter.js +2 -32
  139. package/lib/commonjs/renderer/components/backdrop/BackdropFilter.js.map +1 -1
  140. package/lib/commonjs/renderer/components/colorFilters/BlendColor.js +1 -25
  141. package/lib/commonjs/renderer/components/colorFilters/BlendColor.js.map +1 -1
  142. package/lib/commonjs/renderer/components/colorFilters/Lerp.js +1 -23
  143. package/lib/commonjs/renderer/components/colorFilters/Lerp.js.map +1 -1
  144. package/lib/commonjs/renderer/components/colorFilters/LinearToSRGBGamma.js +1 -17
  145. package/lib/commonjs/renderer/components/colorFilters/LinearToSRGBGamma.js.map +1 -1
  146. package/lib/commonjs/renderer/components/colorFilters/LumaColorFilter.js +1 -17
  147. package/lib/commonjs/renderer/components/colorFilters/LumaColorFilter.js.map +1 -1
  148. package/lib/commonjs/renderer/components/colorFilters/Matrix.js +1 -20
  149. package/lib/commonjs/renderer/components/colorFilters/Matrix.js.map +1 -1
  150. package/lib/commonjs/renderer/components/colorFilters/SRGBToLinearGamma.js +1 -17
  151. package/lib/commonjs/renderer/components/colorFilters/SRGBToLinearGamma.js.map +1 -1
  152. package/lib/commonjs/renderer/components/image/Image.js +1 -35
  153. package/lib/commonjs/renderer/components/image/Image.js.map +1 -1
  154. package/lib/commonjs/renderer/components/image/ImageSVG.js +1 -30
  155. package/lib/commonjs/renderer/components/image/ImageSVG.js.map +1 -1
  156. package/lib/commonjs/renderer/components/image/ImageShader.js +1 -61
  157. package/lib/commonjs/renderer/components/image/ImageShader.js.map +1 -1
  158. package/lib/commonjs/renderer/components/image/index.js +0 -13
  159. package/lib/commonjs/renderer/components/image/index.js.map +1 -1
  160. package/lib/commonjs/renderer/components/imageFilters/Blur.js +1 -27
  161. package/lib/commonjs/renderer/components/imageFilters/Blur.js.map +1 -1
  162. package/lib/commonjs/renderer/components/imageFilters/DisplacementMap.js +1 -38
  163. package/lib/commonjs/renderer/components/imageFilters/DisplacementMap.js.map +1 -1
  164. package/lib/commonjs/renderer/components/imageFilters/Morphology.js +1 -25
  165. package/lib/commonjs/renderer/components/imageFilters/Morphology.js.map +1 -1
  166. package/lib/commonjs/renderer/components/imageFilters/Offset.js +1 -20
  167. package/lib/commonjs/renderer/components/imageFilters/Offset.js.map +1 -1
  168. package/lib/commonjs/renderer/components/imageFilters/RuntimeShader.js +1 -28
  169. package/lib/commonjs/renderer/components/imageFilters/RuntimeShader.js.map +1 -1
  170. package/lib/commonjs/renderer/components/imageFilters/Shadow.js +1 -39
  171. package/lib/commonjs/renderer/components/imageFilters/Shadow.js.map +1 -1
  172. package/lib/commonjs/renderer/components/index.js +0 -13
  173. package/lib/commonjs/renderer/components/index.js.map +1 -1
  174. package/lib/commonjs/renderer/components/maskFilters/Blur.js +1 -23
  175. package/lib/commonjs/renderer/components/maskFilters/Blur.js.map +1 -1
  176. package/lib/commonjs/renderer/components/pathEffects/Corner.js +1 -30
  177. package/lib/commonjs/renderer/components/pathEffects/Corner.js.map +1 -1
  178. package/lib/commonjs/renderer/components/pathEffects/Dash.js +1 -27
  179. package/lib/commonjs/renderer/components/pathEffects/Dash.js.map +1 -1
  180. package/lib/commonjs/renderer/components/pathEffects/Discrete.js +1 -28
  181. package/lib/commonjs/renderer/components/pathEffects/Discrete.js.map +1 -1
  182. package/lib/commonjs/renderer/components/pathEffects/Line2D.js +1 -31
  183. package/lib/commonjs/renderer/components/pathEffects/Line2D.js.map +1 -1
  184. package/lib/commonjs/renderer/components/pathEffects/Path1D.js +1 -37
  185. package/lib/commonjs/renderer/components/pathEffects/Path1D.js.map +1 -1
  186. package/lib/commonjs/renderer/components/pathEffects/Path2D.js +1 -33
  187. package/lib/commonjs/renderer/components/pathEffects/Path2D.js.map +1 -1
  188. package/lib/commonjs/renderer/components/pathEffects/Sum.js +1 -17
  189. package/lib/commonjs/renderer/components/pathEffects/Sum.js.map +1 -1
  190. package/lib/commonjs/renderer/components/shaders/Color.js +1 -19
  191. package/lib/commonjs/renderer/components/shaders/Color.js.map +1 -1
  192. package/lib/commonjs/renderer/components/shaders/FractalNoise.js +1 -22
  193. package/lib/commonjs/renderer/components/shaders/FractalNoise.js.map +1 -1
  194. package/lib/commonjs/renderer/components/shaders/LinearGradient.js +1 -28
  195. package/lib/commonjs/renderer/components/shaders/LinearGradient.js.map +1 -1
  196. package/lib/commonjs/renderer/components/shaders/RadialGradient.js +1 -28
  197. package/lib/commonjs/renderer/components/shaders/RadialGradient.js.map +1 -1
  198. package/lib/commonjs/renderer/components/shaders/Shader.js +1 -23
  199. package/lib/commonjs/renderer/components/shaders/Shader.js.map +1 -1
  200. package/lib/commonjs/renderer/components/shaders/SweepGradient.js +1 -29
  201. package/lib/commonjs/renderer/components/shaders/SweepGradient.js.map +1 -1
  202. package/lib/commonjs/renderer/components/shaders/Turbulence.js +1 -22
  203. package/lib/commonjs/renderer/components/shaders/Turbulence.js.map +1 -1
  204. package/lib/commonjs/renderer/components/shaders/TwoPointConicalGradient.js +1 -30
  205. package/lib/commonjs/renderer/components/shaders/TwoPointConicalGradient.js.map +1 -1
  206. package/lib/commonjs/renderer/components/shapes/Box.js +2 -102
  207. package/lib/commonjs/renderer/components/shapes/Box.js.map +1 -1
  208. package/lib/commonjs/renderer/components/shapes/Circle.js +1 -22
  209. package/lib/commonjs/renderer/components/shapes/Circle.js.map +1 -1
  210. package/lib/commonjs/renderer/components/shapes/DiffRect.js +1 -19
  211. package/lib/commonjs/renderer/components/shapes/DiffRect.js.map +1 -1
  212. package/lib/commonjs/renderer/components/shapes/Fill.js +1 -15
  213. package/lib/commonjs/renderer/components/shapes/Fill.js.map +1 -1
  214. package/lib/commonjs/renderer/components/shapes/FitBox.js +3 -3
  215. package/lib/commonjs/renderer/components/shapes/FitBox.js.map +1 -1
  216. package/lib/commonjs/renderer/components/shapes/Line.js +1 -19
  217. package/lib/commonjs/renderer/components/shapes/Line.js.map +1 -1
  218. package/lib/commonjs/renderer/components/shapes/Oval.js +1 -19
  219. package/lib/commonjs/renderer/components/shapes/Oval.js.map +1 -1
  220. package/lib/commonjs/renderer/components/shapes/Patch.js +1 -37
  221. package/lib/commonjs/renderer/components/shapes/Patch.js.map +1 -1
  222. package/lib/commonjs/renderer/components/shapes/Path.js +1 -47
  223. package/lib/commonjs/renderer/components/shapes/Path.js.map +1 -1
  224. package/lib/commonjs/renderer/components/shapes/Points.js +1 -26
  225. package/lib/commonjs/renderer/components/shapes/Points.js.map +1 -1
  226. package/lib/commonjs/renderer/components/shapes/Rect.js +1 -19
  227. package/lib/commonjs/renderer/components/shapes/Rect.js.map +1 -1
  228. package/lib/commonjs/renderer/components/shapes/RoundedRect.js +1 -19
  229. package/lib/commonjs/renderer/components/shapes/RoundedRect.js.map +1 -1
  230. package/lib/commonjs/renderer/components/shapes/Vertices.js +1 -36
  231. package/lib/commonjs/renderer/components/shapes/Vertices.js.map +1 -1
  232. package/lib/commonjs/renderer/components/text/Glyphs.js +1 -39
  233. package/lib/commonjs/renderer/components/text/Glyphs.js.map +1 -1
  234. package/lib/commonjs/renderer/components/text/Text.js +1 -24
  235. package/lib/commonjs/renderer/components/text/Text.js.map +1 -1
  236. package/lib/commonjs/renderer/components/text/TextBlob.js +1 -20
  237. package/lib/commonjs/renderer/components/text/TextBlob.js.map +1 -1
  238. package/lib/commonjs/renderer/components/text/TextPath.js +1 -71
  239. package/lib/commonjs/renderer/components/text/TextPath.js.map +1 -1
  240. package/lib/commonjs/renderer/index.js +0 -13
  241. package/lib/commonjs/renderer/index.js.map +1 -1
  242. package/lib/commonjs/renderer/processors/Animations/Animations.js.map +1 -1
  243. package/lib/commonjs/renderer/processors/index.js +0 -117
  244. package/lib/commonjs/renderer/processors/index.js.map +1 -1
  245. package/lib/commonjs/skia/core/Data.js +10 -1
  246. package/lib/commonjs/skia/core/Data.js.map +1 -1
  247. package/lib/commonjs/web/WithSkiaWeb.js +3 -1
  248. package/lib/commonjs/web/WithSkiaWeb.js.map +1 -1
  249. package/lib/module/dom/nodes/DrawingNode.js +72 -0
  250. package/lib/module/dom/nodes/DrawingNode.js.map +1 -0
  251. package/lib/module/dom/nodes/GroupNode.js +17 -0
  252. package/lib/module/dom/nodes/GroupNode.js.map +1 -0
  253. package/lib/module/dom/nodes/JsiSkDOM.js +240 -0
  254. package/lib/module/dom/nodes/JsiSkDOM.js.map +1 -0
  255. package/lib/module/dom/nodes/Node.js +145 -0
  256. package/lib/module/dom/nodes/Node.js.map +1 -0
  257. package/lib/module/dom/nodes/PaintContext.js +2 -0
  258. package/lib/module/dom/nodes/PaintContext.js.map +1 -0
  259. package/lib/module/dom/nodes/PaintNode.js +83 -0
  260. package/lib/module/dom/nodes/PaintNode.js.map +1 -0
  261. package/lib/module/dom/nodes/RenderNode.js +329 -0
  262. package/lib/module/dom/nodes/RenderNode.js.map +1 -0
  263. package/lib/module/{renderer/processors/Circles.js → dom/nodes/datatypes/Circle.js} +2 -3
  264. package/lib/module/dom/nodes/datatypes/Circle.js.map +1 -0
  265. package/lib/module/{renderer/processors → dom/nodes/datatypes}/Color.js +0 -0
  266. package/lib/module/{renderer/processors → dom/nodes/datatypes}/Color.js.map +1 -1
  267. package/lib/module/dom/nodes/datatypes/Enum.js +2 -0
  268. package/lib/module/dom/nodes/datatypes/Enum.js.map +1 -0
  269. package/lib/module/{renderer/components/image/BoxFit.js → dom/nodes/datatypes/Fitting.js} +2 -2
  270. package/lib/module/{renderer/components/image/BoxFit.js.map → dom/nodes/datatypes/Fitting.js.map} +1 -1
  271. package/lib/module/dom/nodes/datatypes/Gradient.js +47 -0
  272. package/lib/module/dom/nodes/datatypes/Gradient.js.map +1 -0
  273. package/lib/module/{renderer/processors/Paths.js → dom/nodes/datatypes/Path.js} +2 -2
  274. package/lib/module/dom/nodes/datatypes/Path.js.map +1 -0
  275. package/lib/module/{renderer/processors → dom/nodes/datatypes}/Radius.js +0 -0
  276. package/lib/module/dom/nodes/datatypes/Radius.js.map +1 -0
  277. package/lib/module/{renderer/processors/Rects.js → dom/nodes/datatypes/Rect.js} +1 -1
  278. package/lib/module/dom/nodes/datatypes/Rect.js.map +1 -0
  279. package/lib/module/dom/nodes/datatypes/Transform.js +32 -0
  280. package/lib/module/dom/nodes/datatypes/Transform.js.map +1 -0
  281. package/lib/module/dom/nodes/datatypes/index.js +10 -0
  282. package/lib/module/dom/nodes/datatypes/index.js.map +1 -0
  283. package/lib/module/dom/nodes/drawings/BackdropFilterNode.js +25 -0
  284. package/lib/module/dom/nodes/drawings/BackdropFilterNode.js.map +1 -0
  285. package/lib/module/dom/nodes/drawings/Box.js +89 -0
  286. package/lib/module/dom/nodes/drawings/Box.js.map +1 -0
  287. package/lib/module/dom/nodes/drawings/CircleNode.js +31 -0
  288. package/lib/module/dom/nodes/drawings/CircleNode.js.map +1 -0
  289. package/lib/module/dom/nodes/drawings/CustomDrawingNode.js +17 -0
  290. package/lib/module/dom/nodes/drawings/CustomDrawingNode.js.map +1 -0
  291. package/lib/module/dom/nodes/drawings/DiffRectNode.js +25 -0
  292. package/lib/module/dom/nodes/drawings/DiffRectNode.js.map +1 -0
  293. package/lib/module/dom/nodes/drawings/FillNode.js +22 -0
  294. package/lib/module/dom/nodes/drawings/FillNode.js.map +1 -0
  295. package/lib/module/dom/nodes/drawings/ImageNode.js +51 -0
  296. package/lib/module/dom/nodes/drawings/ImageNode.js.map +1 -0
  297. package/lib/module/dom/nodes/drawings/ImageSVG.js +33 -0
  298. package/lib/module/dom/nodes/drawings/ImageSVG.js.map +1 -0
  299. package/lib/module/dom/nodes/drawings/LineNode.js +25 -0
  300. package/lib/module/dom/nodes/drawings/LineNode.js.map +1 -0
  301. package/lib/module/dom/nodes/drawings/OvalNode.js +27 -0
  302. package/lib/module/dom/nodes/drawings/OvalNode.js.map +1 -0
  303. package/lib/module/dom/nodes/drawings/PatchNode.js +56 -0
  304. package/lib/module/dom/nodes/drawings/PatchNode.js.map +1 -0
  305. package/lib/module/dom/nodes/drawings/PathNode.js +55 -0
  306. package/lib/module/dom/nodes/drawings/PathNode.js.map +1 -0
  307. package/lib/module/dom/nodes/drawings/PictureNode.js +23 -0
  308. package/lib/module/dom/nodes/drawings/PictureNode.js.map +1 -0
  309. package/lib/module/dom/nodes/drawings/PointsNode.js +27 -0
  310. package/lib/module/dom/nodes/drawings/PointsNode.js.map +1 -0
  311. package/lib/module/dom/nodes/drawings/RRectNode.js +31 -0
  312. package/lib/module/dom/nodes/drawings/RRectNode.js.map +1 -0
  313. package/lib/module/dom/nodes/drawings/RectNode.js +27 -0
  314. package/lib/module/dom/nodes/drawings/RectNode.js.map +1 -0
  315. package/lib/module/dom/nodes/drawings/Text.js +164 -0
  316. package/lib/module/dom/nodes/drawings/Text.js.map +1 -0
  317. package/lib/module/dom/nodes/drawings/VerticesNode.js +42 -0
  318. package/lib/module/dom/nodes/drawings/VerticesNode.js.map +1 -0
  319. package/lib/module/dom/nodes/drawings/index.js +19 -0
  320. package/lib/module/dom/nodes/drawings/index.js.map +1 -0
  321. package/lib/module/dom/nodes/index.js +4 -0
  322. package/lib/module/dom/nodes/index.js.map +1 -0
  323. package/lib/module/dom/nodes/paint/BlendNode.js +66 -0
  324. package/lib/module/dom/nodes/paint/BlendNode.js.map +1 -0
  325. package/lib/module/dom/nodes/paint/ColorFilters.js +120 -0
  326. package/lib/module/dom/nodes/paint/ColorFilters.js.map +1 -0
  327. package/lib/module/dom/nodes/paint/ImageFilters.js +191 -0
  328. package/lib/module/dom/nodes/paint/ImageFilters.js.map +1 -0
  329. package/lib/module/dom/nodes/paint/MaskFilters.js +20 -0
  330. package/lib/module/dom/nodes/paint/MaskFilters.js.map +1 -0
  331. package/lib/module/dom/nodes/paint/PathEffects.js +192 -0
  332. package/lib/module/dom/nodes/paint/PathEffects.js.map +1 -0
  333. package/lib/module/dom/nodes/paint/Shaders.js +201 -0
  334. package/lib/module/dom/nodes/paint/Shaders.js.map +1 -0
  335. package/lib/module/dom/nodes/paint/index.js +7 -0
  336. package/lib/module/dom/nodes/paint/index.js.map +1 -0
  337. package/lib/module/dom/types/ColorFilters.js +2 -0
  338. package/lib/module/dom/types/ColorFilters.js.map +1 -0
  339. package/lib/module/dom/types/Common.js +2 -0
  340. package/lib/module/dom/types/Common.js.map +1 -0
  341. package/lib/module/dom/types/DrawingContext.js +2 -0
  342. package/lib/module/dom/types/DrawingContext.js.map +1 -0
  343. package/lib/module/dom/types/Drawings.js +2 -0
  344. package/lib/module/dom/types/Drawings.js.map +1 -0
  345. package/lib/module/dom/types/ImageFilters.js +2 -0
  346. package/lib/module/dom/types/ImageFilters.js.map +1 -0
  347. package/lib/module/dom/types/MaskFilters.js +2 -0
  348. package/lib/module/dom/types/MaskFilters.js.map +1 -0
  349. package/lib/module/dom/types/Node.js +2 -0
  350. package/lib/module/dom/types/Node.js.map +1 -0
  351. package/lib/module/dom/types/NodeType.js +72 -0
  352. package/lib/module/dom/types/NodeType.js.map +1 -0
  353. package/lib/module/dom/types/PathEffects.js +2 -0
  354. package/lib/module/dom/types/PathEffects.js.map +1 -0
  355. package/lib/module/dom/types/Shaders.js +2 -0
  356. package/lib/module/dom/types/Shaders.js.map +1 -0
  357. package/lib/module/dom/types/SkDOM.js +2 -0
  358. package/lib/module/dom/types/SkDOM.js.map +1 -0
  359. package/lib/module/dom/types/index.js +12 -0
  360. package/lib/module/dom/types/index.js.map +1 -0
  361. package/lib/module/index.js +2 -0
  362. package/lib/module/index.js.map +1 -1
  363. package/lib/module/renderer/Canvas.js +7 -3
  364. package/lib/module/renderer/Canvas.js.map +1 -1
  365. package/lib/module/renderer/Container.js +29 -0
  366. package/lib/module/renderer/Container.js.map +1 -0
  367. package/lib/module/renderer/DependencyManager.js +17 -5
  368. package/lib/module/renderer/DependencyManager.js.map +1 -1
  369. package/lib/module/renderer/HostComponents.js +185 -0
  370. package/lib/module/renderer/HostComponents.js.map +1 -0
  371. package/lib/module/renderer/HostConfig.js +47 -126
  372. package/lib/module/renderer/HostConfig.js.map +1 -1
  373. package/lib/module/renderer/components/Blend.js +1 -42
  374. package/lib/module/renderer/components/Blend.js.map +1 -1
  375. package/lib/module/renderer/components/Drawing.js +1 -13
  376. package/lib/module/renderer/components/Drawing.js.map +1 -1
  377. package/lib/module/renderer/components/Group.js +1 -65
  378. package/lib/module/renderer/components/Group.js.map +1 -1
  379. package/lib/module/renderer/components/Paint.js +3 -12
  380. package/lib/module/renderer/components/Paint.js.map +1 -1
  381. package/lib/module/renderer/components/Picture.js +1 -17
  382. package/lib/module/renderer/components/Picture.js.map +1 -1
  383. package/lib/module/renderer/components/backdrop/BackdropBlur.js.map +1 -1
  384. package/lib/module/renderer/components/backdrop/BackdropFilter.js +2 -30
  385. package/lib/module/renderer/components/backdrop/BackdropFilter.js.map +1 -1
  386. package/lib/module/renderer/components/colorFilters/BlendColor.js +1 -20
  387. package/lib/module/renderer/components/colorFilters/BlendColor.js.map +1 -1
  388. package/lib/module/renderer/components/colorFilters/Lerp.js +1 -19
  389. package/lib/module/renderer/components/colorFilters/Lerp.js.map +1 -1
  390. package/lib/module/renderer/components/colorFilters/LinearToSRGBGamma.js +1 -15
  391. package/lib/module/renderer/components/colorFilters/LinearToSRGBGamma.js.map +1 -1
  392. package/lib/module/renderer/components/colorFilters/LumaColorFilter.js +1 -15
  393. package/lib/module/renderer/components/colorFilters/LumaColorFilter.js.map +1 -1
  394. package/lib/module/renderer/components/colorFilters/Matrix.js +1 -17
  395. package/lib/module/renderer/components/colorFilters/Matrix.js.map +1 -1
  396. package/lib/module/renderer/components/colorFilters/SRGBToLinearGamma.js +1 -15
  397. package/lib/module/renderer/components/colorFilters/SRGBToLinearGamma.js.map +1 -1
  398. package/lib/module/renderer/components/image/Image.js +1 -31
  399. package/lib/module/renderer/components/image/Image.js.map +1 -1
  400. package/lib/module/renderer/components/image/ImageSVG.js +1 -27
  401. package/lib/module/renderer/components/image/ImageSVG.js.map +1 -1
  402. package/lib/module/renderer/components/image/ImageShader.js +1 -57
  403. package/lib/module/renderer/components/image/ImageShader.js.map +1 -1
  404. package/lib/module/renderer/components/image/index.js +0 -1
  405. package/lib/module/renderer/components/image/index.js.map +1 -1
  406. package/lib/module/renderer/components/imageFilters/Blur.js +1 -21
  407. package/lib/module/renderer/components/imageFilters/Blur.js.map +1 -1
  408. package/lib/module/renderer/components/imageFilters/DisplacementMap.js +1 -30
  409. package/lib/module/renderer/components/imageFilters/DisplacementMap.js.map +1 -1
  410. package/lib/module/renderer/components/imageFilters/Morphology.js +1 -21
  411. package/lib/module/renderer/components/imageFilters/Morphology.js.map +1 -1
  412. package/lib/module/renderer/components/imageFilters/Offset.js +1 -17
  413. package/lib/module/renderer/components/imageFilters/Offset.js.map +1 -1
  414. package/lib/module/renderer/components/imageFilters/RuntimeShader.js +1 -24
  415. package/lib/module/renderer/components/imageFilters/RuntimeShader.js.map +1 -1
  416. package/lib/module/renderer/components/imageFilters/Shadow.js +1 -34
  417. package/lib/module/renderer/components/imageFilters/Shadow.js.map +1 -1
  418. package/lib/module/renderer/components/index.js +0 -1
  419. package/lib/module/renderer/components/index.js.map +1 -1
  420. package/lib/module/renderer/components/maskFilters/Blur.js +1 -19
  421. package/lib/module/renderer/components/maskFilters/Blur.js.map +1 -1
  422. package/lib/module/renderer/components/pathEffects/Corner.js +1 -27
  423. package/lib/module/renderer/components/pathEffects/Corner.js.map +1 -1
  424. package/lib/module/renderer/components/pathEffects/Dash.js +1 -24
  425. package/lib/module/renderer/components/pathEffects/Dash.js.map +1 -1
  426. package/lib/module/renderer/components/pathEffects/Discrete.js +1 -25
  427. package/lib/module/renderer/components/pathEffects/Discrete.js.map +1 -1
  428. package/lib/module/renderer/components/pathEffects/Line2D.js +1 -28
  429. package/lib/module/renderer/components/pathEffects/Line2D.js.map +1 -1
  430. package/lib/module/renderer/components/pathEffects/Path1D.js +1 -32
  431. package/lib/module/renderer/components/pathEffects/Path1D.js.map +1 -1
  432. package/lib/module/renderer/components/pathEffects/Path2D.js +1 -29
  433. package/lib/module/renderer/components/pathEffects/Path2D.js.map +1 -1
  434. package/lib/module/renderer/components/pathEffects/Sum.js +1 -14
  435. package/lib/module/renderer/components/pathEffects/Sum.js.map +1 -1
  436. package/lib/module/renderer/components/shaders/Color.js +1 -16
  437. package/lib/module/renderer/components/shaders/Color.js.map +1 -1
  438. package/lib/module/renderer/components/shaders/FractalNoise.js +1 -20
  439. package/lib/module/renderer/components/shaders/FractalNoise.js.map +1 -1
  440. package/lib/module/renderer/components/shaders/LinearGradient.js +1 -25
  441. package/lib/module/renderer/components/shaders/LinearGradient.js.map +1 -1
  442. package/lib/module/renderer/components/shaders/RadialGradient.js +1 -25
  443. package/lib/module/renderer/components/shaders/RadialGradient.js.map +1 -1
  444. package/lib/module/renderer/components/shaders/Shader.js +1 -19
  445. package/lib/module/renderer/components/shaders/Shader.js.map +1 -1
  446. package/lib/module/renderer/components/shaders/SweepGradient.js +1 -26
  447. package/lib/module/renderer/components/shaders/SweepGradient.js.map +1 -1
  448. package/lib/module/renderer/components/shaders/Turbulence.js +1 -20
  449. package/lib/module/renderer/components/shaders/Turbulence.js.map +1 -1
  450. package/lib/module/renderer/components/shaders/TwoPointConicalGradient.js +1 -27
  451. package/lib/module/renderer/components/shaders/TwoPointConicalGradient.js.map +1 -1
  452. package/lib/module/renderer/components/shapes/Box.js +2 -97
  453. package/lib/module/renderer/components/shapes/Box.js.map +1 -1
  454. package/lib/module/renderer/components/shapes/Circle.js +1 -19
  455. package/lib/module/renderer/components/shapes/Circle.js.map +1 -1
  456. package/lib/module/renderer/components/shapes/DiffRect.js +1 -17
  457. package/lib/module/renderer/components/shapes/DiffRect.js.map +1 -1
  458. package/lib/module/renderer/components/shapes/Fill.js +1 -13
  459. package/lib/module/renderer/components/shapes/Fill.js.map +1 -1
  460. package/lib/module/renderer/components/shapes/FitBox.js +1 -1
  461. package/lib/module/renderer/components/shapes/FitBox.js.map +1 -1
  462. package/lib/module/renderer/components/shapes/Line.js +1 -17
  463. package/lib/module/renderer/components/shapes/Line.js.map +1 -1
  464. package/lib/module/renderer/components/shapes/Oval.js +1 -16
  465. package/lib/module/renderer/components/shapes/Oval.js.map +1 -1
  466. package/lib/module/renderer/components/shapes/Patch.js +1 -32
  467. package/lib/module/renderer/components/shapes/Patch.js.map +1 -1
  468. package/lib/module/renderer/components/shapes/Path.js +1 -43
  469. package/lib/module/renderer/components/shapes/Path.js.map +1 -1
  470. package/lib/module/renderer/components/shapes/Points.js +1 -20
  471. package/lib/module/renderer/components/shapes/Points.js.map +1 -1
  472. package/lib/module/renderer/components/shapes/Rect.js +1 -16
  473. package/lib/module/renderer/components/shapes/Rect.js.map +1 -1
  474. package/lib/module/renderer/components/shapes/RoundedRect.js +1 -16
  475. package/lib/module/renderer/components/shapes/RoundedRect.js.map +1 -1
  476. package/lib/module/renderer/components/shapes/Vertices.js +1 -31
  477. package/lib/module/renderer/components/shapes/Vertices.js.map +1 -1
  478. package/lib/module/renderer/components/text/Glyphs.js +1 -37
  479. package/lib/module/renderer/components/text/Glyphs.js.map +1 -1
  480. package/lib/module/renderer/components/text/Text.js +1 -22
  481. package/lib/module/renderer/components/text/Text.js.map +1 -1
  482. package/lib/module/renderer/components/text/TextBlob.js +1 -18
  483. package/lib/module/renderer/components/text/TextBlob.js.map +1 -1
  484. package/lib/module/renderer/components/text/TextPath.js +1 -69
  485. package/lib/module/renderer/components/text/TextPath.js.map +1 -1
  486. package/lib/module/renderer/index.js +0 -1
  487. package/lib/module/renderer/index.js.map +1 -1
  488. package/lib/module/renderer/processors/Animations/Animations.js.map +1 -1
  489. package/lib/module/renderer/processors/index.js +0 -9
  490. package/lib/module/renderer/processors/index.js.map +1 -1
  491. package/lib/module/skia/core/Data.js +11 -2
  492. package/lib/module/skia/core/Data.js.map +1 -1
  493. package/lib/module/web/WithSkiaWeb.js +3 -1
  494. package/lib/module/web/WithSkiaWeb.js.map +1 -1
  495. package/lib/typescript/src/dom/nodes/DrawingNode.d.ts +14 -0
  496. package/lib/typescript/src/dom/nodes/GroupNode.d.ts +8 -0
  497. package/lib/typescript/src/dom/nodes/JsiSkDOM.d.ts +70 -0
  498. package/lib/typescript/src/dom/nodes/Node.d.ts +43 -0
  499. package/lib/typescript/src/dom/nodes/PaintContext.d.ts +18 -0
  500. package/lib/typescript/src/dom/nodes/PaintNode.d.ts +8 -0
  501. package/lib/typescript/src/dom/nodes/RenderNode.d.ts +29 -0
  502. package/lib/typescript/src/dom/nodes/datatypes/Circle.d.ts +4 -0
  503. package/lib/typescript/src/{renderer/processors → dom/nodes/datatypes}/Color.d.ts +1 -1
  504. package/lib/typescript/src/dom/nodes/datatypes/Enum.d.ts +1 -0
  505. package/lib/typescript/src/{renderer/components/image/BoxFit.d.ts → dom/nodes/datatypes/Fitting.d.ts} +1 -1
  506. package/lib/typescript/src/{renderer/processors/Transform.d.ts → dom/nodes/datatypes/Gradient.d.ts} +11 -9
  507. package/lib/typescript/src/dom/nodes/datatypes/Path.d.ts +4 -0
  508. package/lib/typescript/src/dom/nodes/datatypes/Radius.d.ts +3 -0
  509. package/lib/typescript/src/dom/nodes/datatypes/Rect.d.ts +5 -0
  510. package/lib/typescript/src/dom/nodes/datatypes/Transform.d.ts +3 -0
  511. package/lib/typescript/src/dom/nodes/datatypes/index.d.ts +9 -0
  512. package/lib/typescript/src/dom/nodes/drawings/BackdropFilterNode.d.ts +8 -0
  513. package/lib/typescript/src/dom/nodes/drawings/Box.d.ts +13 -0
  514. package/lib/typescript/src/dom/nodes/drawings/CircleNode.d.ts +9 -0
  515. package/lib/typescript/src/dom/nodes/drawings/CustomDrawingNode.d.ts +8 -0
  516. package/lib/typescript/src/dom/nodes/drawings/DiffRectNode.d.ts +8 -0
  517. package/lib/typescript/src/dom/nodes/drawings/FillNode.d.ts +8 -0
  518. package/lib/typescript/src/dom/nodes/drawings/ImageNode.d.ts +25 -0
  519. package/lib/typescript/src/dom/nodes/drawings/ImageSVG.d.ts +8 -0
  520. package/lib/typescript/src/dom/nodes/drawings/LineNode.d.ts +8 -0
  521. package/lib/typescript/src/dom/nodes/drawings/OvalNode.d.ts +9 -0
  522. package/lib/typescript/src/dom/nodes/drawings/PatchNode.d.ts +18 -0
  523. package/lib/typescript/src/dom/nodes/drawings/PathNode.d.ts +9 -0
  524. package/lib/typescript/src/dom/nodes/drawings/PictureNode.d.ts +8 -0
  525. package/lib/typescript/src/dom/nodes/drawings/PointsNode.d.ts +8 -0
  526. package/lib/typescript/src/dom/nodes/drawings/RRectNode.d.ts +10 -0
  527. package/lib/typescript/src/dom/nodes/drawings/RectNode.d.ts +9 -0
  528. package/lib/typescript/src/dom/nodes/drawings/Text.d.ts +30 -0
  529. package/lib/typescript/src/dom/nodes/drawings/VerticesNode.d.ts +9 -0
  530. package/lib/typescript/src/dom/nodes/drawings/index.d.ts +18 -0
  531. package/lib/typescript/src/dom/nodes/index.d.ts +3 -0
  532. package/lib/typescript/src/dom/nodes/paint/BlendNode.d.ts +12 -0
  533. package/lib/typescript/src/dom/nodes/paint/ColorFilters.d.ts +36 -0
  534. package/lib/typescript/src/dom/nodes/paint/ImageFilters.d.ts +42 -0
  535. package/lib/typescript/src/dom/nodes/paint/MaskFilters.d.ts +8 -0
  536. package/lib/typescript/src/dom/nodes/paint/PathEffects.d.ts +42 -0
  537. package/lib/typescript/src/dom/nodes/paint/Shaders.d.ts +44 -0
  538. package/lib/typescript/src/dom/nodes/paint/index.d.ts +6 -0
  539. package/lib/typescript/src/dom/types/ColorFilters.d.ts +12 -0
  540. package/lib/typescript/src/dom/types/Common.d.ts +57 -0
  541. package/lib/typescript/src/dom/types/DrawingContext.d.ts +6 -0
  542. package/lib/typescript/src/dom/types/Drawings.d.ts +106 -0
  543. package/lib/typescript/src/dom/types/ImageFilters.d.ts +37 -0
  544. package/lib/typescript/src/dom/types/MaskFilters.d.ts +7 -0
  545. package/lib/typescript/src/dom/types/Node.d.ts +29 -0
  546. package/lib/typescript/src/dom/types/NodeType.d.ts +66 -0
  547. package/lib/typescript/src/dom/types/PathEffects.d.ts +28 -0
  548. package/lib/typescript/src/dom/types/Shaders.d.ts +59 -0
  549. package/lib/typescript/src/dom/types/SkDOM.d.ts +71 -0
  550. package/lib/typescript/src/dom/types/index.d.ts +11 -0
  551. package/lib/typescript/src/index.d.ts +2 -0
  552. package/lib/typescript/src/renderer/Canvas.d.ts +3 -3
  553. package/lib/typescript/src/renderer/Container.d.ts +12 -0
  554. package/lib/typescript/src/renderer/DependencyManager.d.ts +5 -4
  555. package/lib/typescript/src/renderer/HostComponents.d.ts +72 -0
  556. package/lib/typescript/src/renderer/HostConfig.d.ts +5 -13
  557. package/lib/typescript/src/renderer/components/Blend.d.ts +4 -9
  558. package/lib/typescript/src/renderer/components/Drawing.d.ts +2 -6
  559. package/lib/typescript/src/renderer/components/Group.d.ts +4 -9
  560. package/lib/typescript/src/renderer/components/Paint.d.ts +4 -8
  561. package/lib/typescript/src/renderer/components/Picture.d.ts +3 -5
  562. package/lib/typescript/src/renderer/components/backdrop/BackdropBlur.d.ts +2 -1
  563. package/lib/typescript/src/renderer/components/backdrop/BackdropFilter.d.ts +3 -3
  564. package/lib/typescript/src/renderer/components/colorFilters/BlendColor.d.ts +4 -10
  565. package/lib/typescript/src/renderer/components/colorFilters/Lerp.d.ts +4 -7
  566. package/lib/typescript/src/renderer/components/colorFilters/LinearToSRGBGamma.d.ts +3 -4
  567. package/lib/typescript/src/renderer/components/colorFilters/LumaColorFilter.d.ts +3 -4
  568. package/lib/typescript/src/renderer/components/colorFilters/Matrix.d.ts +4 -8
  569. package/lib/typescript/src/renderer/components/colorFilters/SRGBToLinearGamma.d.ts +3 -4
  570. package/lib/typescript/src/renderer/components/image/Image.d.ts +3 -11
  571. package/lib/typescript/src/renderer/components/image/ImageSVG.d.ts +2 -5
  572. package/lib/typescript/src/renderer/components/image/ImageShader.d.ts +3 -15
  573. package/lib/typescript/src/renderer/components/image/index.d.ts +0 -1
  574. package/lib/typescript/src/renderer/components/imageFilters/Blur.d.ts +4 -10
  575. package/lib/typescript/src/renderer/components/imageFilters/DisplacementMap.d.ts +4 -10
  576. package/lib/typescript/src/renderer/components/imageFilters/Morphology.d.ts +4 -8
  577. package/lib/typescript/src/renderer/components/imageFilters/Offset.d.ts +4 -8
  578. package/lib/typescript/src/renderer/components/imageFilters/RuntimeShader.d.ts +3 -7
  579. package/lib/typescript/src/renderer/components/imageFilters/Shadow.d.ts +3 -11
  580. package/lib/typescript/src/renderer/components/index.d.ts +0 -1
  581. package/lib/typescript/src/renderer/components/maskFilters/Blur.d.ts +3 -9
  582. package/lib/typescript/src/renderer/components/pathEffects/Corner.d.ts +4 -7
  583. package/lib/typescript/src/renderer/components/pathEffects/Dash.d.ts +4 -8
  584. package/lib/typescript/src/renderer/components/pathEffects/Discrete.d.ts +4 -9
  585. package/lib/typescript/src/renderer/components/pathEffects/Line2D.d.ts +4 -9
  586. package/lib/typescript/src/renderer/components/pathEffects/Path1D.d.ts +4 -13
  587. package/lib/typescript/src/renderer/components/pathEffects/Path2D.d.ts +4 -10
  588. package/lib/typescript/src/renderer/components/pathEffects/Sum.d.ts +3 -6
  589. package/lib/typescript/src/renderer/components/shaders/Color.d.ts +3 -6
  590. package/lib/typescript/src/renderer/components/shaders/FractalNoise.d.ts +3 -10
  591. package/lib/typescript/src/renderer/components/shaders/LinearGradient.d.ts +3 -8
  592. package/lib/typescript/src/renderer/components/shaders/RadialGradient.d.ts +3 -8
  593. package/lib/typescript/src/renderer/components/shaders/Shader.d.ts +4 -9
  594. package/lib/typescript/src/renderer/components/shaders/SweepGradient.d.ts +3 -9
  595. package/lib/typescript/src/renderer/components/shaders/Turbulence.d.ts +3 -10
  596. package/lib/typescript/src/renderer/components/shaders/TwoPointConicalGradient.d.ts +3 -10
  597. package/lib/typescript/src/renderer/components/shapes/Box.d.ts +4 -21
  598. package/lib/typescript/src/renderer/components/shapes/Circle.d.ts +3 -3
  599. package/lib/typescript/src/renderer/components/shapes/DiffRect.d.ts +3 -8
  600. package/lib/typescript/src/renderer/components/shapes/Fill.d.ts +3 -4
  601. package/lib/typescript/src/renderer/components/shapes/FitBox.d.ts +1 -1
  602. package/lib/typescript/src/renderer/components/shapes/Line.d.ts +3 -7
  603. package/lib/typescript/src/renderer/components/shapes/Oval.d.ts +3 -3
  604. package/lib/typescript/src/renderer/components/shapes/Patch.d.ts +3 -20
  605. package/lib/typescript/src/renderer/components/shapes/Path.d.ts +3 -16
  606. package/lib/typescript/src/renderer/components/shapes/Points.d.ts +3 -9
  607. package/lib/typescript/src/renderer/components/shapes/Rect.d.ts +3 -3
  608. package/lib/typescript/src/renderer/components/shapes/RoundedRect.d.ts +3 -3
  609. package/lib/typescript/src/renderer/components/shapes/Vertices.d.ts +3 -12
  610. package/lib/typescript/src/renderer/components/text/Glyphs.d.ts +3 -13
  611. package/lib/typescript/src/renderer/components/text/Text.d.ts +3 -8
  612. package/lib/typescript/src/renderer/components/text/TextBlob.d.ts +3 -8
  613. package/lib/typescript/src/renderer/components/text/TextPath.d.ts +3 -9
  614. package/lib/typescript/src/renderer/index.d.ts +0 -1
  615. package/lib/typescript/src/renderer/processors/Animations/Animations.d.ts +1 -0
  616. package/lib/typescript/src/renderer/processors/index.d.ts +0 -9
  617. package/package.json +1 -1
  618. package/src/dom/nodes/DrawingNode.ts +72 -0
  619. package/src/dom/nodes/GroupNode.ts +23 -0
  620. package/src/dom/nodes/JsiSkDOM.ts +353 -0
  621. package/src/dom/nodes/Node.ts +158 -0
  622. package/src/dom/nodes/PaintContext.ts +30 -0
  623. package/src/dom/nodes/PaintNode.ts +77 -0
  624. package/src/dom/nodes/RenderNode.ts +349 -0
  625. package/src/{renderer/processors/Circles.ts → dom/nodes/datatypes/Circle.ts} +3 -15
  626. package/src/{renderer/processors → dom/nodes/datatypes}/Color.ts +1 -1
  627. package/src/dom/nodes/datatypes/Enum.ts +2 -0
  628. package/src/{renderer/components/image/BoxFit.ts → dom/nodes/datatypes/Fitting.ts} +2 -11
  629. package/src/dom/nodes/datatypes/Gradient.ts +48 -0
  630. package/src/{renderer/processors/Paths.ts → dom/nodes/datatypes/Path.ts} +3 -4
  631. package/src/{renderer/processors → dom/nodes/datatypes}/Radius.ts +2 -3
  632. package/src/{renderer/processors/Rects.ts → dom/nodes/datatypes/Rect.ts} +2 -16
  633. package/src/dom/nodes/datatypes/Transform.ts +26 -0
  634. package/src/dom/nodes/datatypes/index.ts +9 -0
  635. package/src/dom/nodes/drawings/BackdropFilterNode.ts +30 -0
  636. package/src/dom/nodes/drawings/Box.ts +105 -0
  637. package/src/dom/nodes/drawings/CircleNode.ts +24 -0
  638. package/src/dom/nodes/drawings/CustomDrawingNode.ts +21 -0
  639. package/src/dom/nodes/drawings/DiffRectNode.ts +19 -0
  640. package/src/dom/nodes/drawings/FillNode.ts +18 -0
  641. package/src/dom/nodes/drawings/ImageNode.ts +40 -0
  642. package/src/dom/nodes/drawings/ImageSVG.ts +24 -0
  643. package/src/dom/nodes/drawings/LineNode.ts +19 -0
  644. package/src/dom/nodes/drawings/OvalNode.ts +23 -0
  645. package/src/dom/nodes/drawings/PatchNode.ts +68 -0
  646. package/src/dom/nodes/drawings/PathNode.ts +42 -0
  647. package/src/dom/nodes/drawings/PictureNode.ts +19 -0
  648. package/src/dom/nodes/drawings/PointsNode.ts +21 -0
  649. package/src/dom/nodes/drawings/RRectNode.ts +25 -0
  650. package/src/dom/nodes/drawings/RectNode.ts +23 -0
  651. package/src/dom/nodes/drawings/Text.ts +122 -0
  652. package/src/dom/nodes/drawings/VerticesNode.ts +35 -0
  653. package/src/dom/nodes/drawings/index.ts +18 -0
  654. package/src/dom/nodes/index.ts +3 -0
  655. package/src/dom/nodes/paint/BlendNode.ts +79 -0
  656. package/src/dom/nodes/paint/ColorFilters.ts +130 -0
  657. package/src/dom/nodes/paint/ImageFilters.ts +210 -0
  658. package/src/dom/nodes/paint/MaskFilters.ts +25 -0
  659. package/src/dom/nodes/paint/PathEffects.ts +192 -0
  660. package/src/dom/nodes/paint/Shaders.ts +228 -0
  661. package/src/dom/nodes/paint/index.ts +6 -0
  662. package/src/dom/types/ColorFilters.ts +16 -0
  663. package/src/dom/types/Common.ts +90 -0
  664. package/src/dom/types/DrawingContext.ts +7 -0
  665. package/src/dom/types/Drawings.ts +157 -0
  666. package/src/dom/types/ImageFilters.ts +53 -0
  667. package/src/dom/types/MaskFilters.ts +9 -0
  668. package/src/dom/types/Node.ts +46 -0
  669. package/src/dom/types/NodeType.ts +80 -0
  670. package/src/dom/types/PathEffects.ts +35 -0
  671. package/src/dom/types/Shaders.ts +86 -0
  672. package/src/dom/types/SkDOM.ts +202 -0
  673. package/src/dom/types/index.ts +11 -0
  674. package/src/index.ts +2 -0
  675. package/src/renderer/Canvas.tsx +7 -6
  676. package/src/renderer/Container.tsx +31 -0
  677. package/src/renderer/DependencyManager.tsx +23 -15
  678. package/src/renderer/HostComponents.ts +269 -0
  679. package/src/renderer/HostConfig.ts +60 -123
  680. package/src/renderer/components/Blend.tsx +4 -45
  681. package/src/renderer/components/Drawing.tsx +3 -12
  682. package/src/renderer/components/Group.tsx +4 -79
  683. package/src/renderer/components/Paint.tsx +7 -24
  684. package/src/renderer/components/Picture.tsx +4 -13
  685. package/src/renderer/components/backdrop/BackdropBlur.tsx +2 -1
  686. package/src/renderer/components/backdrop/BackdropFilter.tsx +5 -29
  687. package/src/renderer/components/colorFilters/BlendColor.tsx +4 -26
  688. package/src/renderer/components/colorFilters/Lerp.tsx +4 -23
  689. package/src/renderer/components/colorFilters/LinearToSRGBGamma.tsx +4 -16
  690. package/src/renderer/components/colorFilters/LumaColorFilter.tsx +4 -14
  691. package/src/renderer/components/colorFilters/Matrix.tsx +4 -19
  692. package/src/renderer/components/colorFilters/SRGBToLinearGamma.tsx +4 -16
  693. package/src/renderer/components/image/Image.tsx +4 -40
  694. package/src/renderer/components/image/ImageSVG.tsx +3 -19
  695. package/src/renderer/components/image/ImageShader.tsx +4 -69
  696. package/src/renderer/components/image/index.ts +0 -1
  697. package/src/renderer/components/imageFilters/Blur.tsx +4 -29
  698. package/src/renderer/components/imageFilters/DisplacementMap.tsx +6 -30
  699. package/src/renderer/components/imageFilters/Morphology.tsx +4 -25
  700. package/src/renderer/components/imageFilters/Offset.tsx +4 -19
  701. package/src/renderer/components/imageFilters/RuntimeShader.tsx +6 -27
  702. package/src/renderer/components/imageFilters/Shadow.tsx +4 -38
  703. package/src/renderer/components/index.ts +0 -1
  704. package/src/renderer/components/maskFilters/Blur.tsx +4 -23
  705. package/src/renderer/components/pathEffects/Corner.tsx +4 -27
  706. package/src/renderer/components/pathEffects/Dash.tsx +4 -23
  707. package/src/renderer/components/pathEffects/Discrete.tsx +4 -24
  708. package/src/renderer/components/pathEffects/Line2D.tsx +4 -29
  709. package/src/renderer/components/pathEffects/Path1D.tsx +4 -39
  710. package/src/renderer/components/pathEffects/Path2D.tsx +4 -31
  711. package/src/renderer/components/pathEffects/Sum.tsx +3 -17
  712. package/src/renderer/components/shaders/Color.tsx +4 -16
  713. package/src/renderer/components/shaders/FractalNoise.tsx +4 -26
  714. package/src/renderer/components/shaders/LinearGradient.tsx +4 -29
  715. package/src/renderer/components/shaders/RadialGradient.tsx +4 -29
  716. package/src/renderer/components/shaders/Shader.tsx +4 -24
  717. package/src/renderer/components/shaders/SweepGradient.tsx +4 -32
  718. package/src/renderer/components/shaders/Turbulence.tsx +4 -26
  719. package/src/renderer/components/shaders/TwoPointConicalGradient.tsx +4 -33
  720. package/src/renderer/components/shapes/Box.tsx +6 -109
  721. package/src/renderer/components/shapes/Circle.tsx +4 -16
  722. package/src/renderer/components/shapes/DiffRect.tsx +4 -17
  723. package/src/renderer/components/shapes/Fill.tsx +4 -11
  724. package/src/renderer/components/shapes/FitBox.tsx +2 -2
  725. package/src/renderer/components/shapes/Line.tsx +4 -13
  726. package/src/renderer/components/shapes/Oval.tsx +4 -18
  727. package/src/renderer/components/shapes/Patch.tsx +4 -59
  728. package/src/renderer/components/shapes/Path.tsx +4 -48
  729. package/src/renderer/components/shapes/Points.tsx +4 -20
  730. package/src/renderer/components/shapes/Rect.tsx +4 -18
  731. package/src/renderer/components/shapes/RoundedRect.tsx +4 -17
  732. package/src/renderer/components/shapes/Vertices.tsx +4 -37
  733. package/src/renderer/components/text/Glyphs.tsx +4 -39
  734. package/src/renderer/components/text/Text.tsx +4 -22
  735. package/src/renderer/components/text/TextBlob.tsx +4 -17
  736. package/src/renderer/components/text/TextPath.tsx +4 -59
  737. package/src/renderer/index.ts +0 -1
  738. package/src/renderer/processors/Animations/Animations.ts +5 -0
  739. package/src/renderer/processors/index.ts +0 -9
  740. package/src/skia/core/Data.ts +11 -2
  741. package/src/web/WithSkiaWeb.tsx +3 -1
  742. package/lib/commonjs/renderer/components/Compose.js +0 -40
  743. package/lib/commonjs/renderer/components/Compose.js.map +0 -1
  744. package/lib/commonjs/renderer/components/colorFilters/Compose.js +0 -24
  745. package/lib/commonjs/renderer/components/colorFilters/Compose.js.map +0 -1
  746. package/lib/commonjs/renderer/components/imageFilters/InnerShadow.js +0 -28
  747. package/lib/commonjs/renderer/components/imageFilters/InnerShadow.js.map +0 -1
  748. package/lib/commonjs/renderer/components/imageFilters/getInput.js +0 -33
  749. package/lib/commonjs/renderer/components/imageFilters/getInput.js.map +0 -1
  750. package/lib/commonjs/renderer/components/shaders/Gradient.js +0 -32
  751. package/lib/commonjs/renderer/components/shaders/Gradient.js.map +0 -1
  752. package/lib/commonjs/renderer/nodes/Container.js +0 -28
  753. package/lib/commonjs/renderer/nodes/Container.js.map +0 -1
  754. package/lib/commonjs/renderer/nodes/Declaration.js +0 -57
  755. package/lib/commonjs/renderer/nodes/Declaration.js.map +0 -1
  756. package/lib/commonjs/renderer/nodes/Drawing.js +0 -56
  757. package/lib/commonjs/renderer/nodes/Drawing.js.map +0 -1
  758. package/lib/commonjs/renderer/nodes/Node.js +0 -73
  759. package/lib/commonjs/renderer/nodes/Node.js.map +0 -1
  760. package/lib/commonjs/renderer/nodes/index.js +0 -58
  761. package/lib/commonjs/renderer/nodes/index.js.map +0 -1
  762. package/lib/commonjs/renderer/processors/Circles.js.map +0 -1
  763. package/lib/commonjs/renderer/processors/Clips.js +0 -24
  764. package/lib/commonjs/renderer/processors/Clips.js.map +0 -1
  765. package/lib/commonjs/renderer/processors/Font.js +0 -13
  766. package/lib/commonjs/renderer/processors/Font.js.map +0 -1
  767. package/lib/commonjs/renderer/processors/Paint.js +0 -98
  768. package/lib/commonjs/renderer/processors/Paint.js.map +0 -1
  769. package/lib/commonjs/renderer/processors/Paths.js.map +0 -1
  770. package/lib/commonjs/renderer/processors/Radius.js.map +0 -1
  771. package/lib/commonjs/renderer/processors/Rects.js.map +0 -1
  772. package/lib/commonjs/renderer/processors/Transform.js +0 -58
  773. package/lib/commonjs/renderer/processors/Transform.js.map +0 -1
  774. package/lib/module/renderer/components/Compose.js +0 -25
  775. package/lib/module/renderer/components/Compose.js.map +0 -1
  776. package/lib/module/renderer/components/colorFilters/Compose.js +0 -14
  777. package/lib/module/renderer/components/colorFilters/Compose.js.map +0 -1
  778. package/lib/module/renderer/components/imageFilters/InnerShadow.js +0 -17
  779. package/lib/module/renderer/components/imageFilters/InnerShadow.js.map +0 -1
  780. package/lib/module/renderer/components/imageFilters/getInput.js +0 -23
  781. package/lib/module/renderer/components/imageFilters/getInput.js.map +0 -1
  782. package/lib/module/renderer/components/shaders/Gradient.js +0 -20
  783. package/lib/module/renderer/components/shaders/Gradient.js.map +0 -1
  784. package/lib/module/renderer/nodes/Container.js +0 -18
  785. package/lib/module/renderer/nodes/Container.js.map +0 -1
  786. package/lib/module/renderer/nodes/Declaration.js +0 -36
  787. package/lib/module/renderer/nodes/Declaration.js.map +0 -1
  788. package/lib/module/renderer/nodes/Drawing.js +0 -37
  789. package/lib/module/renderer/nodes/Drawing.js.map +0 -1
  790. package/lib/module/renderer/nodes/Node.js +0 -63
  791. package/lib/module/renderer/nodes/Node.js.map +0 -1
  792. package/lib/module/renderer/nodes/index.js +0 -5
  793. package/lib/module/renderer/nodes/index.js.map +0 -1
  794. package/lib/module/renderer/processors/Circles.js.map +0 -1
  795. package/lib/module/renderer/processors/Clips.js +0 -13
  796. package/lib/module/renderer/processors/Clips.js.map +0 -1
  797. package/lib/module/renderer/processors/Font.js +0 -4
  798. package/lib/module/renderer/processors/Font.js.map +0 -1
  799. package/lib/module/renderer/processors/Paint.js +0 -84
  800. package/lib/module/renderer/processors/Paint.js.map +0 -1
  801. package/lib/module/renderer/processors/Paths.js.map +0 -1
  802. package/lib/module/renderer/processors/Radius.js.map +0 -1
  803. package/lib/module/renderer/processors/Rects.js.map +0 -1
  804. package/lib/module/renderer/processors/Transform.js +0 -42
  805. package/lib/module/renderer/processors/Transform.js.map +0 -1
  806. package/lib/typescript/src/renderer/components/Compose.d.ts +0 -6
  807. package/lib/typescript/src/renderer/components/colorFilters/Compose.d.ts +0 -3
  808. package/lib/typescript/src/renderer/components/imageFilters/InnerShadow.d.ts +0 -2
  809. package/lib/typescript/src/renderer/components/imageFilters/getInput.d.ts +0 -3
  810. package/lib/typescript/src/renderer/components/shaders/Gradient.d.ts +0 -17
  811. package/lib/typescript/src/renderer/nodes/Container.d.ts +0 -8
  812. package/lib/typescript/src/renderer/nodes/Declaration.d.ts +0 -22
  813. package/lib/typescript/src/renderer/nodes/Drawing.d.ts +0 -21
  814. package/lib/typescript/src/renderer/nodes/Node.d.ts +0 -24
  815. package/lib/typescript/src/renderer/nodes/index.d.ts +0 -4
  816. package/lib/typescript/src/renderer/processors/Circles.d.ts +0 -13
  817. package/lib/typescript/src/renderer/processors/Clips.d.ts +0 -4
  818. package/lib/typescript/src/renderer/processors/Font.d.ts +0 -7
  819. package/lib/typescript/src/renderer/processors/Paint.d.ts +0 -22
  820. package/lib/typescript/src/renderer/processors/Paths.d.ts +0 -4
  821. package/lib/typescript/src/renderer/processors/Radius.d.ts +0 -3
  822. package/lib/typescript/src/renderer/processors/Rects.d.ts +0 -20
  823. package/src/renderer/components/Compose.tsx +0 -26
  824. package/src/renderer/components/colorFilters/Compose.ts +0 -18
  825. package/src/renderer/components/imageFilters/InnerShadow.tsx +0 -38
  826. package/src/renderer/components/imageFilters/getInput.ts +0 -20
  827. package/src/renderer/components/shaders/Gradient.ts +0 -24
  828. package/src/renderer/nodes/Container.tsx +0 -17
  829. package/src/renderer/nodes/Declaration.tsx +0 -65
  830. package/src/renderer/nodes/Drawing.tsx +0 -65
  831. package/src/renderer/nodes/Node.ts +0 -59
  832. package/src/renderer/nodes/index.ts +0 -4
  833. package/src/renderer/processors/Clips.ts +0 -23
  834. package/src/renderer/processors/Font.ts +0 -8
  835. package/src/renderer/processors/Paint.ts +0 -118
  836. package/src/renderer/processors/Transform.ts +0 -50
@@ -1,37 +0,0 @@
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 { useCallback } from "react";
4
- import { isPaint } from "../../skia/types";
5
- import { processPaint } from "../processors";
6
- import { Node } from "./Node";
7
- export const createDrawing = cb => cb;
8
- export const useDrawing = (cb, deps) => // eslint-disable-next-line react-hooks/exhaustive-deps
9
- useCallback(cb, deps !== null && deps !== void 0 ? deps : []);
10
- export class DrawingNode extends Node {
11
- constructor(depMgr, onDraw, skipProcessing, props) {
12
- super(depMgr, props);
13
-
14
- _defineProperty(this, "onDraw", void 0);
15
-
16
- _defineProperty(this, "skipProcessing", void 0);
17
-
18
- this.onDraw = onDraw;
19
- this.skipProcessing = skipProcessing;
20
- }
21
-
22
- draw(ctx) {
23
- if (this.skipProcessing) {
24
- this.onDraw(ctx, this.props, this);
25
- } else {
26
- const declarations = this.visit(ctx);
27
- const paint = processPaint(ctx.Skia, ctx.paint.copy(), ctx.opacity, this.props, declarations);
28
- [paint, ...declarations.filter(isPaint)].forEach(currentPaint => {
29
- this.onDraw({ ...ctx,
30
- paint: currentPaint
31
- }, this.props, this);
32
- });
33
- }
34
- }
35
-
36
- }
37
- //# sourceMappingURL=Drawing.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["Drawing.tsx"],"names":["useCallback","isPaint","processPaint","Node","createDrawing","cb","useDrawing","deps","DrawingNode","constructor","depMgr","onDraw","skipProcessing","props","draw","ctx","declarations","visit","paint","Skia","copy","opacity","filter","forEach","currentPaint"],"mappings":";;AACA,SAASA,WAAT,QAA4B,OAA5B;AAIA,SAASC,OAAT,QAAwB,kBAAxB;AAEA,SAASC,YAAT,QAA6B,eAA7B;AAEA,SAASC,IAAT,QAAqB,QAArB;AAUA,OAAO,MAAMC,aAAa,GAAQC,EAAL,IAC3BA,EADK;AAGP,OAAO,MAAMC,UAAU,GAAG,CAAKD,EAAL,EAA4BE,IAA5B,KACxB;AACAP,WAAW,CAACK,EAAD,EAAKE,IAAL,aAAKA,IAAL,cAAKA,IAAL,GAAa,EAAb,CAFN;AAUP,OAAO,MAAMC,WAAN,SAA6BL,IAA7B,CAAqC;AAI1CM,EAAAA,WAAW,CACTC,MADS,EAETC,MAFS,EAGTC,cAHS,EAITC,KAJS,EAKT;AACA,UAAMH,MAAN,EAAcG,KAAd;;AADA;;AAAA;;AAEA,SAAKF,MAAL,GAAcA,MAAd;AACA,SAAKC,cAAL,GAAsBA,cAAtB;AACD;;AAEDE,EAAAA,IAAI,CAACC,GAAD,EAAsB;AACxB,QAAI,KAAKH,cAAT,EAAyB;AACvB,WAAKD,MAAL,CAAYI,GAAZ,EAAiB,KAAKF,KAAtB,EAA6B,IAA7B;AACD,KAFD,MAEO;AACL,YAAMG,YAAY,GAAG,KAAKC,KAAL,CAAWF,GAAX,CAArB;AACA,YAAMG,KAAK,GAAGhB,YAAY,CACxBa,GAAG,CAACI,IADoB,EAExBJ,GAAG,CAACG,KAAJ,CAAUE,IAAV,EAFwB,EAGxBL,GAAG,CAACM,OAHoB,EAIxB,KAAKR,KAJmB,EAKxBG,YALwB,CAA1B;AAOA,OAACE,KAAD,EAAQ,GAAGF,YAAY,CAACM,MAAb,CAAoBrB,OAApB,CAAX,EAAyCsB,OAAzC,CAAkDC,YAAD,IAAkB;AACjE,aAAKb,MAAL,CAAY,EAAE,GAAGI,GAAL;AAAUG,UAAAA,KAAK,EAAEM;AAAjB,SAAZ,EAA6C,KAAKX,KAAlD,EAAyD,IAAzD;AACD,OAFD;AAGD;AACF;;AA/ByC","sourcesContent":["import type { DependencyList, ReactNode } from \"react\";\nimport { useCallback } from \"react\";\n\nimport type { DrawingContext } from \"../DrawingContext\";\nimport type { AnimatedProps } from \"../processors/Animations/Animations\";\nimport { isPaint } from \"../../skia/types\";\nimport type { DependencyManager } from \"../DependencyManager\";\nimport { processPaint } from \"../processors\";\n\nimport { Node } from \"./Node\";\n\ntype DrawingCallback<P> = (\n ctx: DrawingContext,\n props: P,\n node: Node<P>\n) => void;\n\ntype OnDrawCallback<P> = (ctx: DrawingContext, props: P, node: Node<P>) => void;\n\nexport const createDrawing = <P,>(cb: OnDrawCallback<P>): DrawingCallback<P> =>\n cb;\n\nexport const useDrawing = <P,>(cb: OnDrawCallback<P>, deps?: DependencyList) =>\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useCallback(cb, deps ?? []);\n\nexport type DrawingProps<P> = {\n onDraw: DrawingCallback<P>;\n skipProcessing?: boolean;\n children?: ReactNode | ReactNode[];\n};\n\nexport class DrawingNode<P> extends Node<P> {\n onDraw: DrawingCallback<P>;\n skipProcessing: boolean;\n\n constructor(\n depMgr: DependencyManager,\n onDraw: DrawingCallback<P>,\n skipProcessing: boolean,\n props: AnimatedProps<P>\n ) {\n super(depMgr, props);\n this.onDraw = onDraw;\n this.skipProcessing = skipProcessing;\n }\n\n draw(ctx: DrawingContext) {\n if (this.skipProcessing) {\n this.onDraw(ctx, this.props, this);\n } else {\n const declarations = this.visit(ctx);\n const paint = processPaint(\n ctx.Skia,\n ctx.paint.copy(),\n ctx.opacity,\n this.props,\n declarations\n );\n [paint, ...declarations.filter(isPaint)].forEach((currentPaint) => {\n this.onDraw({ ...ctx, paint: currentPaint }, this.props, this);\n });\n }\n }\n}\n"]}
@@ -1,63 +0,0 @@
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
- export let NodeType;
4
-
5
- (function (NodeType) {
6
- NodeType["Declaration"] = "skDeclaration";
7
- NodeType["Drawing"] = "skDrawing";
8
- })(NodeType || (NodeType = {}));
9
-
10
- export class Node {
11
- // This cast is ok because we understand that the dependency manager will setup the initial props
12
- constructor(depMgr, props) {
13
- _defineProperty(this, "children", []);
14
-
15
- _defineProperty(this, "resolvedProps", {});
16
-
17
- _defineProperty(this, "memoizable", false);
18
-
19
- _defineProperty(this, "memoized", null);
20
-
21
- _defineProperty(this, "parent", void 0);
22
-
23
- _defineProperty(this, "depMgr", void 0);
24
-
25
- this.depMgr = depMgr;
26
- this.updatePropSubscriptions(props);
27
- }
28
-
29
- updatePropSubscriptions(props) {
30
- this.depMgr.subscribeNode(this, props);
31
- }
32
-
33
- set props(props) {
34
- this.depMgr.unsubscribeNode(this);
35
- this.updatePropSubscriptions(props);
36
- }
37
-
38
- get props() {
39
- return this.resolvedProps;
40
- }
41
-
42
- visit(ctx, children) {
43
- const returnedValues = [];
44
- (children !== null && children !== void 0 ? children : this.children).forEach(child => {
45
- if (child.memoized && child.memoizable) {
46
- returnedValues.push(child.memoized);
47
- } else {
48
- const ret = child.draw(ctx);
49
-
50
- if (ret) {
51
- returnedValues.push(ret);
52
-
53
- if (child.memoizable) {
54
- child.memoized = ret;
55
- }
56
- }
57
- }
58
- });
59
- return returnedValues;
60
- }
61
-
62
- }
63
- //# sourceMappingURL=Node.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["Node.ts"],"names":["NodeType","Node","constructor","depMgr","props","updatePropSubscriptions","subscribeNode","unsubscribeNode","resolvedProps","visit","ctx","children","returnedValues","forEach","child","memoized","memoizable","push","ret","draw"],"mappings":";;AAKA,WAAYA,QAAZ;;WAAYA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;GAAAA,Q,KAAAA,Q;;AAOZ,OAAO,MAAeC,IAAf,CAAiC;AAEtC;AAOAC,EAAAA,WAAW,CAACC,MAAD,EAA4BC,KAA5B,EAAqD;AAAA,sCARpC,EAQoC;;AAAA,2CAN7C,EAM6C;;AAAA,wCALnD,KAKmD;;AAAA,sCAJ3B,IAI2B;;AAAA;;AAAA;;AAC9D,SAAKD,MAAL,GAAcA,MAAd;AACA,SAAKE,uBAAL,CAA6BD,KAA7B;AACD;;AAIDC,EAAAA,uBAAuB,CAACD,KAAD,EAA0B;AAC/C,SAAKD,MAAL,CAAYG,aAAZ,CAA0B,IAA1B,EAAgCF,KAAhC;AACD;;AAEQ,MAALA,KAAK,CAACA,KAAD,EAA0B;AACjC,SAAKD,MAAL,CAAYI,eAAZ,CAA4B,IAA5B;AACA,SAAKF,uBAAL,CAA6BD,KAA7B;AACD;;AAEQ,MAALA,KAAK,GAAM;AACb,WAAO,KAAKI,aAAZ;AACD;;AAEDC,EAAAA,KAAK,CAACC,GAAD,EAAsBC,QAAtB,EAAyC;AAC5C,UAAMC,cAAkD,GAAG,EAA3D;AACA,KAACD,QAAD,aAACA,QAAD,cAACA,QAAD,GAAa,KAAKA,QAAlB,EAA4BE,OAA5B,CAAqCC,KAAD,IAAW;AAC7C,UAAIA,KAAK,CAACC,QAAN,IAAkBD,KAAK,CAACE,UAA5B,EAAwC;AACtCJ,QAAAA,cAAc,CAACK,IAAf,CAAoBH,KAAK,CAACC,QAA1B;AACD,OAFD,MAEO;AACL,cAAMG,GAAG,GAAGJ,KAAK,CAACK,IAAN,CAAWT,GAAX,CAAZ;;AACA,YAAIQ,GAAJ,EAAS;AACPN,UAAAA,cAAc,CAACK,IAAf,CAAoBC,GAApB;;AACA,cAAIJ,KAAK,CAACE,UAAV,EAAsB;AACpBF,YAAAA,KAAK,CAACC,QAAN,GAAiBG,GAAjB;AACD;AACF;AACF;AACF,KAZD;AAaA,WAAON,cAAP;AACD;;AA7CqC","sourcesContent":["import type { SkJSIInstance } from \"../../skia/types\";\nimport type { DependencyManager } from \"../DependencyManager\";\nimport type { DrawingContext } from \"../DrawingContext\";\nimport type { AnimatedProps } from \"../processors\";\n\nexport enum NodeType {\n Declaration = \"skDeclaration\",\n Drawing = \"skDrawing\",\n}\n\ntype DeclarationResult = SkJSIInstance<string> | null;\n\nexport abstract class Node<P = unknown> {\n readonly children: Node[] = [];\n // This cast is ok because we understand that the dependency manager will setup the initial props\n resolvedProps: P = {} as P;\n memoizable = false;\n memoized: DeclarationResult | null = null;\n parent?: Node;\n depMgr: DependencyManager;\n\n constructor(depMgr: DependencyManager, props: AnimatedProps<P>) {\n this.depMgr = depMgr;\n this.updatePropSubscriptions(props);\n }\n\n abstract draw(ctx: DrawingContext): void | DeclarationResult;\n\n updatePropSubscriptions(props: AnimatedProps<P>) {\n this.depMgr.subscribeNode(this, props);\n }\n\n set props(props: AnimatedProps<P>) {\n this.depMgr.unsubscribeNode(this);\n this.updatePropSubscriptions(props);\n }\n\n get props(): P {\n return this.resolvedProps;\n }\n\n visit(ctx: DrawingContext, children?: Node[]) {\n const returnedValues: Exclude<DeclarationResult, null>[] = [];\n (children ?? this.children).forEach((child) => {\n if (child.memoized && child.memoizable) {\n returnedValues.push(child.memoized);\n } else {\n const ret = child.draw(ctx);\n if (ret) {\n returnedValues.push(ret);\n if (child.memoizable) {\n child.memoized = ret;\n }\n }\n }\n });\n return returnedValues;\n }\n}\n"]}
@@ -1,5 +0,0 @@
1
- export * from "./Drawing";
2
- export * from "./Declaration";
3
- export * from "./Container";
4
- export * from "./Node";
5
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAd;AACA,cAAc,eAAd;AACA,cAAc,aAAd;AACA,cAAc,QAAd","sourcesContent":["export * from \"./Drawing\";\nexport * from \"./Declaration\";\nexport * from \"./Container\";\nexport * from \"./Node\";\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["Circles.ts"],"names":["isCircleScalarDef","def","cx","undefined","processCircle","Skia","c","Point","cy","r"],"mappings":"AAeA,MAAMA,iBAAiB,GAAIC,GAAD,IACxB;AACA;AACCA,GAAD,CAAaC,EAAb,KAAoBC,SAHtB;;AAKA,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, Vector } from \"../../skia/types\";\n\ninterface PointCircleDef {\n c: Vector;\n r: number;\n}\n\ninterface ScalarCircleDef {\n cx: number;\n cy: number;\n r: number;\n}\n\nexport type CircleDef = PointCircleDef | ScalarCircleDef;\n\nconst 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,13 +0,0 @@
1
- import { isRRect } from "../../skia/types";
2
- import { processPath, isPathDef } from "./Paths";
3
- export const processClip = (Skia, canvas, def, op) => {
4
- if (isPathDef(def)) {
5
- const path = processPath(Skia, def);
6
- canvas.clipPath(path, op, true);
7
- } else if (isRRect(def)) {
8
- canvas.clipRRect(def, op, true);
9
- } else {
10
- canvas.clipRect(def, op, true);
11
- }
12
- };
13
- //# sourceMappingURL=Clips.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["Clips.ts"],"names":["isRRect","processPath","isPathDef","processClip","Skia","canvas","def","op","path","clipPath","clipRRect","clipRect"],"mappings":"AAAA,SAASA,OAAT,QAAwB,kBAAxB;AAIA,SAASC,WAAT,EAAsBC,SAAtB,QAAuC,SAAvC;AAIA,OAAO,MAAMC,WAAW,GAAG,CACzBC,IADyB,EAEzBC,MAFyB,EAGzBC,GAHyB,EAIzBC,EAJyB,KAKtB;AACH,MAAIL,SAAS,CAACI,GAAD,CAAb,EAAoB;AAClB,UAAME,IAAI,GAAGP,WAAW,CAACG,IAAD,EAAOE,GAAP,CAAxB;AACAD,IAAAA,MAAM,CAACI,QAAP,CAAgBD,IAAhB,EAAsBD,EAAtB,EAA0B,IAA1B;AACD,GAHD,MAGO,IAAIP,OAAO,CAACM,GAAD,CAAX,EAAkB;AACvBD,IAAAA,MAAM,CAACK,SAAP,CAAiBJ,GAAjB,EAAsBC,EAAtB,EAA0B,IAA1B;AACD,GAFM,MAEA;AACLF,IAAAA,MAAM,CAACM,QAAP,CAAgBL,GAAhB,EAAqBC,EAArB,EAAyB,IAAzB;AACD;AACF,CAdM","sourcesContent":["import { isRRect } from \"../../skia/types\";\nimport type { SkCanvas, ClipOp, SkRect, SkRRect, Skia } from \"../../skia/types\";\n\nimport type { PathDef } from \"./Paths\";\nimport { processPath, isPathDef } from \"./Paths\";\n\nexport type ClipDef = SkRRect | SkRect | PathDef;\n\nexport const processClip = (\n Skia: Skia,\n canvas: SkCanvas,\n def: ClipDef,\n op: ClipOp\n) => {\n if (isPathDef(def)) {\n const path = processPath(Skia, def);\n canvas.clipPath(path, op, true);\n } else if (isRRect(def)) {\n canvas.clipRRect(def, op, true);\n } else {\n canvas.clipRect(def, op, true);\n }\n};\n"]}
@@ -1,4 +0,0 @@
1
- export const isFont = fontDef => // We have an issue to check property existence on JSI backed instances
2
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
3
- fontDef.font !== undefined;
4
- //# sourceMappingURL=Font.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["Font.ts"],"names":["isFont","fontDef","font","undefined"],"mappings":"AAIA,OAAO,MAAMA,MAAM,GAAIC,OAAD,IACpB;AACA;AACCA,OAAD,CAAiBC,IAAjB,KAA0BC,SAHrB","sourcesContent":["import type { SkFont } from \"../../skia/types\";\n\nexport type FontDef = { font: SkFont };\n\nexport const isFont = (fontDef: FontDef): fontDef is { font: SkFont } =>\n // We have an issue to check property existence on JSI backed instances\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (fontDef as any).font !== undefined;\n"]}
@@ -1,84 +0,0 @@
1
- import { BlendMode, PaintStyle, StrokeJoin, StrokeCap, isShader, isMaskFilter, isColorFilter, isPathEffect, isImageFilter } from "../../skia/types";
2
- import { processColor } from "./Color";
3
- export const enumKey = k => k.charAt(0).toUpperCase() + k.slice(1);
4
- export const processPaint = (Skia, paint, currentOpacity, _ref, children) => {
5
- let {
6
- paint: paintRef,
7
- color,
8
- blendMode,
9
- style,
10
- strokeWidth,
11
- strokeJoin,
12
- strokeCap,
13
- strokeMiter,
14
- opacity,
15
- antiAlias
16
- } = _ref;
17
-
18
- if (paintRef && paintRef.current) {
19
- return paintRef.current;
20
- }
21
-
22
- if (color !== undefined) {
23
- const c = processColor(Skia, color, currentOpacity);
24
- paint.setShader(null);
25
- paint.setColor(c);
26
- } else {
27
- const c = processColor(Skia, paint.getColor(), currentOpacity);
28
- paint.setColor(c);
29
- }
30
-
31
- if (blendMode !== undefined) {
32
- paint.setBlendMode(BlendMode[enumKey(blendMode)]);
33
- }
34
-
35
- if (style !== undefined) {
36
- paint.setStyle(PaintStyle[enumKey(style)]);
37
- }
38
-
39
- if (strokeJoin !== undefined) {
40
- paint.setStrokeJoin(StrokeJoin[enumKey(strokeJoin)]);
41
- }
42
-
43
- if (strokeCap !== undefined) {
44
- paint.setStrokeCap(StrokeCap[enumKey(strokeCap)]);
45
- }
46
-
47
- if (strokeMiter !== undefined) {
48
- paint.setStrokeMiter(strokeMiter);
49
- }
50
-
51
- if (strokeWidth !== undefined) {
52
- paint.setStrokeWidth(strokeWidth);
53
- }
54
-
55
- if (opacity !== undefined) {
56
- paint.setAlphaf(opacity);
57
- }
58
-
59
- if (antiAlias !== undefined) {
60
- paint.setAntiAlias(antiAlias);
61
- }
62
-
63
- children.forEach(child => {
64
- if (isShader(child)) {
65
- paint.setShader(child);
66
- } else if (isMaskFilter(child)) {
67
- paint.setMaskFilter(child);
68
- } else if (isColorFilter(child)) {
69
- paint.setColorFilter(child);
70
- } else if (isPathEffect(child)) {
71
- paint.setPathEffect(child);
72
- }
73
- });
74
- const filters = children.filter(isImageFilter);
75
-
76
- if (filters.length > 0) {
77
- paint.setImageFilter(filters.reverse().reduce(function () {
78
- return Skia.ImageFilter.MakeCompose(...arguments);
79
- }, null));
80
- }
81
-
82
- return paint;
83
- };
84
- //# sourceMappingURL=Paint.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["Paint.ts"],"names":["BlendMode","PaintStyle","StrokeJoin","StrokeCap","isShader","isMaskFilter","isColorFilter","isPathEffect","isImageFilter","processColor","enumKey","k","charAt","toUpperCase","slice","processPaint","Skia","paint","currentOpacity","children","paintRef","color","blendMode","style","strokeWidth","strokeJoin","strokeCap","strokeMiter","opacity","antiAlias","current","undefined","c","setShader","setColor","getColor","setBlendMode","setStyle","setStrokeJoin","setStrokeCap","setStrokeMiter","setStrokeWidth","setAlphaf","setAntiAlias","forEach","child","setMaskFilter","setColorFilter","setPathEffect","filters","filter","length","setImageFilter","reverse","reduce","ImageFilter","MakeCompose"],"mappings":"AAEA,SACEA,SADF,EAEEC,UAFF,EAGEC,UAHF,EAIEC,SAJF,EAKEC,QALF,EAMEC,YANF,EAOEC,aAPF,EAQEC,YARF,EASEC,aATF,QAUO,kBAVP;AAcA,SAASC,YAAT,QAA6B,SAA7B;AAqBA,OAAO,MAAMC,OAAO,GAAsBC,CAAnB,IACpBA,CAAC,CAACC,MAAF,CAAS,CAAT,EAAYC,WAAZ,KAA4BF,CAAC,CAACG,KAAF,CAAQ,CAAR,CADxB;AAGP,OAAO,MAAMC,YAAY,GAAG,CAC1BC,IAD0B,EAE1BC,KAF0B,EAG1BC,cAH0B,QAgB1BC,QAhB0B,KAiBvB;AAAA,MAbH;AACEF,IAAAA,KAAK,EAAEG,QADT;AAEEC,IAAAA,KAFF;AAGEC,IAAAA,SAHF;AAIEC,IAAAA,KAJF;AAKEC,IAAAA,WALF;AAMEC,IAAAA,UANF;AAOEC,IAAAA,SAPF;AAQEC,IAAAA,WARF;AASEC,IAAAA,OATF;AAUEC,IAAAA;AAVF,GAaG;;AACH,MAAIT,QAAQ,IAAIA,QAAQ,CAACU,OAAzB,EAAkC;AAChC,WAAOV,QAAQ,CAACU,OAAhB;AACD;;AACD,MAAIT,KAAK,KAAKU,SAAd,EAAyB;AACvB,UAAMC,CAAC,GAAGvB,YAAY,CAACO,IAAD,EAAOK,KAAP,EAAcH,cAAd,CAAtB;AACAD,IAAAA,KAAK,CAACgB,SAAN,CAAgB,IAAhB;AACAhB,IAAAA,KAAK,CAACiB,QAAN,CAAeF,CAAf;AACD,GAJD,MAIO;AACL,UAAMA,CAAC,GAAGvB,YAAY,CAACO,IAAD,EAAOC,KAAK,CAACkB,QAAN,EAAP,EAAyBjB,cAAzB,CAAtB;AACAD,IAAAA,KAAK,CAACiB,QAAN,CAAeF,CAAf;AACD;;AACD,MAAIV,SAAS,KAAKS,SAAlB,EAA6B;AAC3Bd,IAAAA,KAAK,CAACmB,YAAN,CAAmBpC,SAAS,CAACU,OAAO,CAACY,SAAD,CAAR,CAA5B;AACD;;AACD,MAAIC,KAAK,KAAKQ,SAAd,EAAyB;AACvBd,IAAAA,KAAK,CAACoB,QAAN,CAAepC,UAAU,CAACS,OAAO,CAACa,KAAD,CAAR,CAAzB;AACD;;AACD,MAAIE,UAAU,KAAKM,SAAnB,EAA8B;AAC5Bd,IAAAA,KAAK,CAACqB,aAAN,CAAoBpC,UAAU,CAACQ,OAAO,CAACe,UAAD,CAAR,CAA9B;AACD;;AACD,MAAIC,SAAS,KAAKK,SAAlB,EAA6B;AAC3Bd,IAAAA,KAAK,CAACsB,YAAN,CAAmBpC,SAAS,CAACO,OAAO,CAACgB,SAAD,CAAR,CAA5B;AACD;;AACD,MAAIC,WAAW,KAAKI,SAApB,EAA+B;AAC7Bd,IAAAA,KAAK,CAACuB,cAAN,CAAqBb,WAArB;AACD;;AACD,MAAIH,WAAW,KAAKO,SAApB,EAA+B;AAC7Bd,IAAAA,KAAK,CAACwB,cAAN,CAAqBjB,WAArB;AACD;;AACD,MAAII,OAAO,KAAKG,SAAhB,EAA2B;AACzBd,IAAAA,KAAK,CAACyB,SAAN,CAAgBd,OAAhB;AACD;;AACD,MAAIC,SAAS,KAAKE,SAAlB,EAA6B;AAC3Bd,IAAAA,KAAK,CAAC0B,YAAN,CAAmBd,SAAnB;AACD;;AACDV,EAAAA,QAAQ,CAACyB,OAAT,CAAkBC,KAAD,IAAW;AAC1B,QAAIzC,QAAQ,CAACyC,KAAD,CAAZ,EAAqB;AACnB5B,MAAAA,KAAK,CAACgB,SAAN,CAAgBY,KAAhB;AACD,KAFD,MAEO,IAAIxC,YAAY,CAACwC,KAAD,CAAhB,EAAyB;AAC9B5B,MAAAA,KAAK,CAAC6B,aAAN,CAAoBD,KAApB;AACD,KAFM,MAEA,IAAIvC,aAAa,CAACuC,KAAD,CAAjB,EAA0B;AAC/B5B,MAAAA,KAAK,CAAC8B,cAAN,CAAqBF,KAArB;AACD,KAFM,MAEA,IAAItC,YAAY,CAACsC,KAAD,CAAhB,EAAyB;AAC9B5B,MAAAA,KAAK,CAAC+B,aAAN,CAAoBH,KAApB;AACD;AACF,GAVD;AAWA,QAAMI,OAAO,GAAG9B,QAAQ,CAAC+B,MAAT,CAAgB1C,aAAhB,CAAhB;;AACA,MAAIyC,OAAO,CAACE,MAAR,GAAiB,CAArB,EAAwB;AACtBlC,IAAAA,KAAK,CAACmC,cAAN,CACEH,OAAO,CACJI,OADH,GAEGC,MAFH,CAGI;AAAA,aACEtC,IAAI,CAACuC,WAAL,CAAiBC,WAAjB,CAA6B,YAA7B,CADF;AAAA,KAHJ,EAKI,IALJ,CADF;AASD;;AACD,SAAOvC,KAAP;AACD,CA7EM","sourcesContent":["import type { ReactNode, RefObject } from \"react\";\n\nimport {\n BlendMode,\n PaintStyle,\n StrokeJoin,\n StrokeCap,\n isShader,\n isMaskFilter,\n isColorFilter,\n isPathEffect,\n isImageFilter,\n} from \"../../skia/types\";\nimport type { SkPaint, Color, SkImageFilter, Skia } from \"../../skia/types\";\nimport type { DeclarationResult } from \"../nodes\";\n\nimport { processColor } from \"./Color\";\nexport type SkEnum<T> = Uncapitalize<keyof T extends string ? keyof T : never>;\n\nexport interface ChildrenProps {\n children?: ReactNode | ReactNode[];\n}\n\n// TODO: rename to paint props?\nexport interface CustomPaintProps extends ChildrenProps {\n paint?: RefObject<SkPaint>;\n color?: Color;\n strokeWidth?: number;\n blendMode?: SkEnum<typeof BlendMode>;\n style?: SkEnum<typeof PaintStyle>;\n strokeJoin?: SkEnum<typeof StrokeJoin>;\n strokeCap?: SkEnum<typeof StrokeCap>;\n strokeMiter?: number;\n opacity?: number;\n antiAlias?: boolean;\n}\n\nexport const enumKey = <K extends string>(k: K) =>\n (k.charAt(0).toUpperCase() + k.slice(1)) as Capitalize<K>;\n\nexport const processPaint = (\n Skia: Skia,\n paint: SkPaint,\n currentOpacity: number,\n {\n paint: paintRef,\n color,\n blendMode,\n style,\n strokeWidth,\n strokeJoin,\n strokeCap,\n strokeMiter,\n opacity,\n antiAlias,\n }: CustomPaintProps,\n children: DeclarationResult[]\n) => {\n if (paintRef && paintRef.current) {\n return paintRef.current;\n }\n if (color !== undefined) {\n const c = processColor(Skia, color, currentOpacity);\n paint.setShader(null);\n paint.setColor(c);\n } else {\n const c = processColor(Skia, paint.getColor(), currentOpacity);\n paint.setColor(c);\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 (strokeWidth !== undefined) {\n paint.setStrokeWidth(strokeWidth);\n }\n if (opacity !== undefined) {\n paint.setAlphaf(opacity);\n }\n if (antiAlias !== undefined) {\n paint.setAntiAlias(antiAlias);\n }\n children.forEach((child) => {\n if (isShader(child)) {\n paint.setShader(child);\n } else if (isMaskFilter(child)) {\n paint.setMaskFilter(child);\n } else if (isColorFilter(child)) {\n paint.setColorFilter(child);\n } else if (isPathEffect(child)) {\n paint.setPathEffect(child);\n }\n });\n const filters = children.filter(isImageFilter);\n if (filters.length > 0) {\n paint.setImageFilter(\n filters\n .reverse()\n .reduce<SkImageFilter | null>(\n (...args: Parameters<typeof Skia.ImageFilter.MakeCompose>) =>\n Skia.ImageFilter.MakeCompose(...args),\n null\n )\n );\n }\n return paint;\n};\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["Paths.ts"],"names":["isPath","processPath","Skia","rawPath","path","Path","MakeFromSVGString","Error","isPathDef","def"],"mappings":"AACA,SAASA,MAAT,QAAuB,kBAAvB;AAIA,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 { SkPath, Skia } from \"../../skia/types\";\nimport { isPath } from \"../../skia/types\";\n\nexport type PathDef = string | SkPath;\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"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["Radius.ts"],"names":["processRadius","Skia","radius","Point"],"mappings":"AAIA,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\";\n\nexport type Radius = number | Vector;\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"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["Rects.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;;AAiBA,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, SkRRect, Vector } from \"../../skia/types\";\n\nimport type { Radius } from \"./Radius\";\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 interface RectCtor {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\nexport interface RRectCtor extends RectCtor {\n r: Radius;\n}\n\nexport type RectDef = RectCtor | { rect: SkRect };\nexport type RRectDef = RRectCtor | { rect: SkRRect };\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"]}
@@ -1,42 +0,0 @@
1
- import { processTransform } from "../../skia/types";
2
- export const processCanvasTransform = (canvas, _ref) => {
3
- let {
4
- transform,
5
- origin,
6
- matrix
7
- } = _ref;
8
-
9
- if (matrix) {
10
- if (origin) {
11
- canvas.translate(origin.x, origin.y);
12
- canvas.concat(matrix);
13
- canvas.translate(-origin.x, -origin.y);
14
- } else {
15
- canvas.concat(matrix);
16
- }
17
- } else if (transform) {
18
- processTransform(canvas, origin ? transformOrigin(origin, transform) : transform);
19
- }
20
- };
21
- export const localMatrix = (m, _ref2) => {
22
- let {
23
- transform,
24
- origin
25
- } = _ref2;
26
-
27
- if (transform) {
28
- return processTransform(m, origin ? transformOrigin(origin, transform) : transform);
29
- }
30
-
31
- return undefined;
32
- };
33
- export const transformOrigin = (origin, transform) => [{
34
- translateX: origin.x
35
- }, {
36
- translateY: origin.y
37
- }, ...transform, {
38
- translateX: -origin.x
39
- }, {
40
- translateY: -origin.y
41
- }];
42
- //# sourceMappingURL=Transform.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["Transform.ts"],"names":["processTransform","processCanvasTransform","canvas","transform","origin","matrix","translate","x","y","concat","transformOrigin","localMatrix","m","undefined","translateX","translateY"],"mappings":"AACA,SAASA,gBAAT,QAAiC,kBAAjC;AASA,OAAO,MAAMC,sBAAsB,GAAG,CACpCC,MADoC,WAGjC;AAAA,MADH;AAAEC,IAAAA,SAAF;AAAaC,IAAAA,MAAb;AAAqBC,IAAAA;AAArB,GACG;;AACH,MAAIA,MAAJ,EAAY;AACV,QAAID,MAAJ,EAAY;AACVF,MAAAA,MAAM,CAACI,SAAP,CAAiBF,MAAM,CAACG,CAAxB,EAA2BH,MAAM,CAACI,CAAlC;AACAN,MAAAA,MAAM,CAACO,MAAP,CAAcJ,MAAd;AACAH,MAAAA,MAAM,CAACI,SAAP,CAAiB,CAACF,MAAM,CAACG,CAAzB,EAA4B,CAACH,MAAM,CAACI,CAApC;AACD,KAJD,MAIO;AACLN,MAAAA,MAAM,CAACO,MAAP,CAAcJ,MAAd;AACD;AACF,GARD,MAQO,IAAIF,SAAJ,EAAe;AACpBH,IAAAA,gBAAgB,CACdE,MADc,EAEdE,MAAM,GAAGM,eAAe,CAACN,MAAD,EAASD,SAAT,CAAlB,GAAwCA,SAFhC,CAAhB;AAID;AACF,CAlBM;AAoBP,OAAO,MAAMQ,WAAW,GAAG,CACzBC,CADyB,YAGtB;AAAA,MADH;AAAET,IAAAA,SAAF;AAAaC,IAAAA;AAAb,GACG;;AACH,MAAID,SAAJ,EAAe;AACb,WAAOH,gBAAgB,CACrBY,CADqB,EAErBR,MAAM,GAAGM,eAAe,CAACN,MAAD,EAASD,SAAT,CAAlB,GAAwCA,SAFzB,CAAvB;AAID;;AACD,SAAOU,SAAP;AACD,CAXM;AAaP,OAAO,MAAMH,eAAe,GAAG,CAACN,MAAD,EAAiBD,SAAjB,KAA6C,CAC1E;AAAEW,EAAAA,UAAU,EAAEV,MAAM,CAACG;AAArB,CAD0E,EAE1E;AAAEQ,EAAAA,UAAU,EAAEX,MAAM,CAACI;AAArB,CAF0E,EAG1E,GAAGL,SAHuE,EAI1E;AAAEW,EAAAA,UAAU,EAAE,CAACV,MAAM,CAACG;AAAtB,CAJ0E,EAK1E;AAAEQ,EAAAA,UAAU,EAAE,CAACX,MAAM,CAACI;AAAtB,CAL0E,CAArE","sourcesContent":["import type { SkMatrix, Vector, Transforms2d } from \"../../skia/types\";\nimport { processTransform } from \"../../skia/types\";\nimport type { SkCanvas } from \"../../skia/types/Canvas\";\n\nexport interface TransformProps {\n transform?: Transforms2d;\n origin?: Vector;\n matrix?: SkMatrix;\n}\n\nexport const processCanvasTransform = (\n canvas: SkCanvas,\n { transform, origin, matrix }: TransformProps\n) => {\n if (matrix) {\n if (origin) {\n canvas.translate(origin.x, origin.y);\n canvas.concat(matrix);\n canvas.translate(-origin.x, -origin.y);\n } else {\n canvas.concat(matrix);\n }\n } else if (transform) {\n processTransform(\n canvas,\n origin ? transformOrigin(origin, transform) : transform\n );\n }\n};\n\nexport const localMatrix = (\n m: SkMatrix,\n { transform, origin }: TransformProps\n) => {\n if (transform) {\n return processTransform(\n m,\n origin ? transformOrigin(origin, transform) : transform\n );\n }\n return undefined;\n};\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"]}
@@ -1,6 +0,0 @@
1
- import type { ReactNode } from "react";
2
- import type { AnimatedProps } from "../processors/Animations/Animations";
3
- export interface ComposeProps {
4
- children: ReactNode | ReactNode[];
5
- }
6
- export declare const Compose: (props: AnimatedProps<ComposeProps>) => JSX.Element;
@@ -1,3 +0,0 @@
1
- import type { SkColorFilter, Skia } from "../../../skia/types";
2
- import type { DeclarationResult } from "../../nodes";
3
- export declare const composeColorFilter: (Skia: Skia, cf: SkColorFilter, children: DeclarationResult[]) => import("../../../skia/types").SkImageFilter | SkColorFilter;
@@ -1,2 +0,0 @@
1
- import type { SkColor, Skia, SkImageFilter } from "../../../skia/types";
2
- export declare const MakeInnerShadow: (Skia: Skia, shadowOnly: boolean | undefined, dx: number, dy: number, sigmaX: number, sigmaY: number, color: SkColor, input: SkImageFilter | null) => SkImageFilter;
@@ -1,3 +0,0 @@
1
- import type { DeclarationResult } from "../../nodes";
2
- import type { Skia } from "../../../skia/types";
3
- export declare const getInput: (Skia: Skia, children: DeclarationResult[]) => import("../../../skia/types").SkImageFilter | null;
@@ -1,17 +0,0 @@
1
- import { TileMode } from "../../../skia/types";
2
- import type { SkEnum } from "../../processors/Paint";
3
- import type { TransformProps } from "../../processors/Transform";
4
- import type { Color, Skia } from "../../../skia/types";
5
- export interface GradientProps extends TransformProps {
6
- colors: Color[];
7
- positions?: number[];
8
- mode?: SkEnum<typeof TileMode>;
9
- flags?: number;
10
- }
11
- export declare const processGradientProps: (Skia: Skia, { colors, positions, mode, flags, ...transform }: GradientProps) => {
12
- colors: Float32Array[];
13
- positions: number[] | null;
14
- mode: TileMode;
15
- flags: number | undefined;
16
- localMatrix: import("../../../skia/types").SkMatrix | undefined;
17
- };
@@ -1,8 +0,0 @@
1
- import type { DependencyManager } from "../DependencyManager";
2
- import type { DrawingContext } from "../DrawingContext";
3
- import { Node } from "./Node";
4
- export declare class Container extends Node {
5
- redraw: () => void;
6
- constructor(depMgr: DependencyManager, redraw: () => void);
7
- draw(ctx: DrawingContext): void;
8
- }
@@ -1,22 +0,0 @@
1
- import type { DependencyList } from "react";
2
- import type { DrawingContext } from "../DrawingContext";
3
- import type { AnimatedProps } from "../processors";
4
- import type { DependencyManager } from "../DependencyManager";
5
- import type { SkJSIInstance } from "../../skia/types";
6
- import { Node } from "./Node";
7
- export declare type DeclarationResult = SkJSIInstance<string> | null;
8
- declare type DeclarationCallback<T> = (props: T, children: DeclarationResult[], ctx: DrawingContext) => DeclarationResult;
9
- export declare const createDeclaration: <T>(cb: DeclarationCallback<T>) => DeclarationCallback<T>;
10
- export declare const useDeclaration: <P>(cb: DeclarationCallback<P>, deps?: DependencyList | undefined) => DeclarationCallback<P>;
11
- export declare const isDeclarationNode: <P>(node: Node) => node is DeclarationNode<P>;
12
- export interface DeclarationProps<P> {
13
- onDeclare: DeclarationCallback<P>;
14
- }
15
- export declare class DeclarationNode<P> extends Node<P> {
16
- private onDeclare;
17
- constructor(depMgr: DependencyManager, onDeclare: DeclarationCallback<P>, props: AnimatedProps<P>);
18
- set props(props: AnimatedProps<P>);
19
- get props(): P;
20
- draw(ctx: DrawingContext): DeclarationResult;
21
- }
22
- export {};
@@ -1,21 +0,0 @@
1
- import type { DependencyList, ReactNode } from "react";
2
- import type { DrawingContext } from "../DrawingContext";
3
- import type { AnimatedProps } from "../processors/Animations/Animations";
4
- import type { DependencyManager } from "../DependencyManager";
5
- import { Node } from "./Node";
6
- declare type DrawingCallback<P> = (ctx: DrawingContext, props: P, node: Node<P>) => void;
7
- declare type OnDrawCallback<P> = (ctx: DrawingContext, props: P, node: Node<P>) => void;
8
- export declare const createDrawing: <P>(cb: OnDrawCallback<P>) => DrawingCallback<P>;
9
- export declare const useDrawing: <P>(cb: OnDrawCallback<P>, deps?: DependencyList | undefined) => OnDrawCallback<P>;
10
- export declare type DrawingProps<P> = {
11
- onDraw: DrawingCallback<P>;
12
- skipProcessing?: boolean;
13
- children?: ReactNode | ReactNode[];
14
- };
15
- export declare class DrawingNode<P> extends Node<P> {
16
- onDraw: DrawingCallback<P>;
17
- skipProcessing: boolean;
18
- constructor(depMgr: DependencyManager, onDraw: DrawingCallback<P>, skipProcessing: boolean, props: AnimatedProps<P>);
19
- draw(ctx: DrawingContext): void;
20
- }
21
- export {};
@@ -1,24 +0,0 @@
1
- import type { SkJSIInstance } from "../../skia/types";
2
- import type { DependencyManager } from "../DependencyManager";
3
- import type { DrawingContext } from "../DrawingContext";
4
- import type { AnimatedProps } from "../processors";
5
- export declare enum NodeType {
6
- Declaration = "skDeclaration",
7
- Drawing = "skDrawing"
8
- }
9
- declare type DeclarationResult = SkJSIInstance<string> | null;
10
- export declare abstract class Node<P = unknown> {
11
- readonly children: Node[];
12
- resolvedProps: P;
13
- memoizable: boolean;
14
- memoized: DeclarationResult | null;
15
- parent?: Node;
16
- depMgr: DependencyManager;
17
- constructor(depMgr: DependencyManager, props: AnimatedProps<P>);
18
- abstract draw(ctx: DrawingContext): void | DeclarationResult;
19
- updatePropSubscriptions(props: AnimatedProps<P>): void;
20
- set props(props: AnimatedProps<P>);
21
- get props(): P;
22
- visit(ctx: DrawingContext, children?: Node[]): SkJSIInstance<string>[];
23
- }
24
- export {};
@@ -1,4 +0,0 @@
1
- export * from "./Drawing";
2
- export * from "./Declaration";
3
- export * from "./Container";
4
- export * from "./Node";
@@ -1,13 +0,0 @@
1
- import type { Skia, Vector } from "../../skia/types";
2
- interface PointCircleDef {
3
- c: Vector;
4
- r: number;
5
- }
6
- interface ScalarCircleDef {
7
- cx: number;
8
- cy: number;
9
- r: number;
10
- }
11
- export declare type CircleDef = PointCircleDef | ScalarCircleDef;
12
- export declare const processCircle: (Skia: Skia, def: CircleDef) => PointCircleDef;
13
- export {};
@@ -1,4 +0,0 @@
1
- import type { SkCanvas, ClipOp, SkRect, SkRRect, Skia } from "../../skia/types";
2
- import type { PathDef } from "./Paths";
3
- export declare type ClipDef = SkRRect | SkRect | PathDef;
4
- export declare const processClip: (Skia: Skia, canvas: SkCanvas, def: ClipDef, op: ClipOp) => void;
@@ -1,7 +0,0 @@
1
- import type { SkFont } from "../../skia/types";
2
- export declare type FontDef = {
3
- font: SkFont;
4
- };
5
- export declare const isFont: (fontDef: FontDef) => fontDef is {
6
- font: SkFont;
7
- };
@@ -1,22 +0,0 @@
1
- import type { ReactNode, RefObject } from "react";
2
- import { BlendMode, PaintStyle, StrokeJoin, StrokeCap } from "../../skia/types";
3
- import type { SkPaint, Color, Skia } from "../../skia/types";
4
- import type { DeclarationResult } from "../nodes";
5
- export declare type SkEnum<T> = Uncapitalize<keyof T extends string ? keyof T : never>;
6
- export interface ChildrenProps {
7
- children?: ReactNode | ReactNode[];
8
- }
9
- export interface CustomPaintProps extends ChildrenProps {
10
- paint?: RefObject<SkPaint>;
11
- color?: Color;
12
- strokeWidth?: number;
13
- blendMode?: SkEnum<typeof BlendMode>;
14
- style?: SkEnum<typeof PaintStyle>;
15
- strokeJoin?: SkEnum<typeof StrokeJoin>;
16
- strokeCap?: SkEnum<typeof StrokeCap>;
17
- strokeMiter?: number;
18
- opacity?: number;
19
- antiAlias?: boolean;
20
- }
21
- export declare const enumKey: <K extends string>(k: K) => Capitalize<K>;
22
- export declare const processPaint: (Skia: Skia, paint: SkPaint, currentOpacity: number, { paint: paintRef, color, blendMode, style, strokeWidth, strokeJoin, strokeCap, strokeMiter, opacity, antiAlias, }: CustomPaintProps, children: DeclarationResult[]) => SkPaint;
@@ -1,4 +0,0 @@
1
- import type { SkPath, Skia } from "../../skia/types";
2
- export declare type PathDef = string | SkPath;
3
- export declare const processPath: (Skia: Skia, rawPath: PathDef) => SkPath;
4
- export declare const isPathDef: (def: any) => def is PathDef;
@@ -1,3 +0,0 @@
1
- import type { Skia, Vector } from "../../skia/types";
2
- export declare type Radius = number | Vector;
3
- export declare const processRadius: (Skia: Skia, radius: Radius) => Vector;
@@ -1,20 +0,0 @@
1
- import type { Skia, SkRect, SkRRect, Vector } from "../../skia/types";
2
- import type { Radius } from "./Radius";
3
- export declare const isEdge: (pos: Vector, b: SkRect) => boolean;
4
- export interface RectCtor {
5
- x: number;
6
- y: number;
7
- width: number;
8
- height: number;
9
- }
10
- export interface RRectCtor extends RectCtor {
11
- r: Radius;
12
- }
13
- export declare type RectDef = RectCtor | {
14
- rect: SkRect;
15
- };
16
- export declare type RRectDef = RRectCtor | {
17
- rect: SkRRect;
18
- };
19
- export declare const processRect: (Skia: Skia, def: RectDef) => SkRect;
20
- export declare const processRRect: (Skia: Skia, def: RRectDef) => SkRRect;
@@ -1,26 +0,0 @@
1
- import React from "react";
2
- import type { ReactNode } from "react";
3
-
4
- import { isImageFilter, isColorFilter } from "../../skia/types";
5
- import { createDeclaration } from "../nodes/Declaration";
6
- import type { AnimatedProps } from "../processors/Animations/Animations";
7
-
8
- export interface ComposeProps {
9
- children: ReactNode | ReactNode[];
10
- }
11
-
12
- const onDeclare = createDeclaration((_, children, { Skia }) => {
13
- const [inner, outer] = children;
14
- if (isColorFilter(outer) && isColorFilter(inner)) {
15
- return Skia.ColorFilter.MakeCompose(outer, inner);
16
- } else if (isImageFilter(outer) && isImageFilter(inner)) {
17
- return Skia.ImageFilter.MakeCompose(outer, inner);
18
- }
19
- throw new Error(
20
- "ComposeFilter can only compose ColorFilters and ImageFilters"
21
- );
22
- });
23
-
24
- export const Compose = (props: AnimatedProps<ComposeProps>) => {
25
- return <skDeclaration onDeclare={onDeclare} {...props} />;
26
- };
@@ -1,18 +0,0 @@
1
- import type { SkColorFilter, Skia } from "../../../skia/types";
2
- import { isColorFilter, isImageFilter } from "../../../skia/types";
3
- import type { DeclarationResult } from "../../nodes";
4
-
5
- export const composeColorFilter = (
6
- Skia: Skia,
7
- cf: SkColorFilter,
8
- children: DeclarationResult[]
9
- ) => {
10
- const [col] = children.filter(isColorFilter);
11
- const [img] = children.filter(isImageFilter);
12
- if (col) {
13
- return Skia.ColorFilter.MakeCompose(cf, col);
14
- } else if (img) {
15
- return Skia.ImageFilter.MakeColorFilter(cf, img);
16
- }
17
- return cf;
18
- };