@shopify/react-native-skia 0.1.147 → 0.1.148

Sign up to get free protection for your applications and to get access to all the features.
Files changed (829) hide show
  1. package/lib/commonjs/dom/nodes/DrawingNode.js +84 -0
  2. package/lib/commonjs/dom/nodes/DrawingNode.js.map +1 -0
  3. package/lib/commonjs/dom/nodes/GroupNode.js +28 -0
  4. package/lib/commonjs/dom/nodes/GroupNode.js.map +1 -0
  5. package/lib/commonjs/dom/nodes/JsiSkDOM.js +256 -0
  6. package/lib/commonjs/dom/nodes/JsiSkDOM.js.map +1 -0
  7. package/lib/commonjs/dom/nodes/Node.js +158 -0
  8. package/lib/commonjs/dom/nodes/Node.js.map +1 -0
  9. package/lib/commonjs/dom/nodes/PaintContext.js +6 -0
  10. package/lib/commonjs/dom/nodes/PaintContext.js.map +1 -0
  11. package/lib/commonjs/dom/nodes/PaintNode.js +96 -0
  12. package/lib/commonjs/dom/nodes/PaintNode.js.map +1 -0
  13. package/lib/commonjs/dom/nodes/RenderNode.js +346 -0
  14. package/lib/commonjs/dom/nodes/RenderNode.js.map +1 -0
  15. package/lib/commonjs/{renderer/processors/Circles.js → dom/nodes/datatypes/Circle.js} +4 -2
  16. package/lib/commonjs/dom/nodes/datatypes/Circle.js.map +1 -0
  17. package/lib/commonjs/{renderer/processors → dom/nodes/datatypes}/Color.js +0 -0
  18. package/lib/commonjs/{renderer/processors → dom/nodes/datatypes}/Color.js.map +1 -1
  19. package/lib/commonjs/dom/nodes/datatypes/Enum.js +11 -0
  20. package/lib/commonjs/dom/nodes/datatypes/Enum.js.map +1 -0
  21. package/lib/commonjs/{renderer/components/image/BoxFit.js → dom/nodes/datatypes/Fitting.js} +2 -2
  22. package/lib/commonjs/{renderer/components/image/BoxFit.js.map → dom/nodes/datatypes/Fitting.js.map} +1 -1
  23. package/lib/commonjs/dom/nodes/datatypes/Gradient.js +65 -0
  24. package/lib/commonjs/dom/nodes/datatypes/Gradient.js.map +1 -0
  25. package/lib/commonjs/{renderer/processors/Paths.js → dom/nodes/datatypes/Path.js} +2 -2
  26. package/lib/commonjs/dom/nodes/datatypes/Path.js.map +1 -0
  27. package/lib/commonjs/{renderer/processors → dom/nodes/datatypes}/Radius.js +0 -0
  28. package/lib/commonjs/dom/nodes/datatypes/Radius.js.map +1 -0
  29. package/lib/commonjs/{renderer/processors/Rects.js → dom/nodes/datatypes/Rect.js} +1 -1
  30. package/lib/commonjs/dom/nodes/datatypes/Rect.js.map +1 -0
  31. package/lib/commonjs/dom/nodes/datatypes/Transform.js +42 -0
  32. package/lib/commonjs/dom/nodes/datatypes/Transform.js.map +1 -0
  33. package/lib/commonjs/dom/nodes/datatypes/index.js +123 -0
  34. package/lib/commonjs/dom/nodes/datatypes/index.js.map +1 -0
  35. package/lib/commonjs/dom/nodes/drawings/BackdropFilterNode.js +38 -0
  36. package/lib/commonjs/dom/nodes/drawings/BackdropFilterNode.js.map +1 -0
  37. package/lib/commonjs/dom/nodes/drawings/Box.js +105 -0
  38. package/lib/commonjs/dom/nodes/drawings/Box.js.map +1 -0
  39. package/lib/commonjs/dom/nodes/drawings/CircleNode.js +43 -0
  40. package/lib/commonjs/dom/nodes/drawings/CircleNode.js.map +1 -0
  41. package/lib/commonjs/dom/nodes/drawings/CustomDrawingNode.js +28 -0
  42. package/lib/commonjs/dom/nodes/drawings/CustomDrawingNode.js.map +1 -0
  43. package/lib/commonjs/dom/nodes/drawings/DiffRectNode.js +36 -0
  44. package/lib/commonjs/dom/nodes/drawings/DiffRectNode.js.map +1 -0
  45. package/lib/commonjs/dom/nodes/drawings/FillNode.js +33 -0
  46. package/lib/commonjs/dom/nodes/drawings/FillNode.js.map +1 -0
  47. package/lib/commonjs/dom/nodes/drawings/ImageNode.js +63 -0
  48. package/lib/commonjs/dom/nodes/drawings/ImageNode.js.map +1 -0
  49. package/lib/commonjs/dom/nodes/drawings/ImageSVG.js +45 -0
  50. package/lib/commonjs/dom/nodes/drawings/ImageSVG.js.map +1 -0
  51. package/lib/commonjs/dom/nodes/drawings/LineNode.js +36 -0
  52. package/lib/commonjs/dom/nodes/drawings/LineNode.js.map +1 -0
  53. package/lib/commonjs/dom/nodes/drawings/OvalNode.js +39 -0
  54. package/lib/commonjs/dom/nodes/drawings/OvalNode.js.map +1 -0
  55. package/lib/commonjs/dom/nodes/drawings/PatchNode.js +69 -0
  56. package/lib/commonjs/dom/nodes/drawings/PatchNode.js.map +1 -0
  57. package/lib/commonjs/dom/nodes/drawings/PathNode.js +68 -0
  58. package/lib/commonjs/dom/nodes/drawings/PathNode.js.map +1 -0
  59. package/lib/commonjs/dom/nodes/drawings/PictureNode.js +34 -0
  60. package/lib/commonjs/dom/nodes/drawings/PictureNode.js.map +1 -0
  61. package/lib/commonjs/dom/nodes/drawings/PointsNode.js +40 -0
  62. package/lib/commonjs/dom/nodes/drawings/PointsNode.js.map +1 -0
  63. package/lib/commonjs/dom/nodes/drawings/RRectNode.js +43 -0
  64. package/lib/commonjs/dom/nodes/drawings/RRectNode.js.map +1 -0
  65. package/lib/commonjs/dom/nodes/drawings/RectNode.js +39 -0
  66. package/lib/commonjs/dom/nodes/drawings/RectNode.js.map +1 -0
  67. package/lib/commonjs/dom/nodes/drawings/Text.js +185 -0
  68. package/lib/commonjs/dom/nodes/drawings/Text.js.map +1 -0
  69. package/lib/commonjs/dom/nodes/drawings/VerticesNode.js +55 -0
  70. package/lib/commonjs/dom/nodes/drawings/VerticesNode.js.map +1 -0
  71. package/lib/commonjs/dom/nodes/drawings/index.js +240 -0
  72. package/lib/commonjs/dom/nodes/drawings/index.js.map +1 -0
  73. package/lib/commonjs/dom/nodes/index.js +45 -0
  74. package/lib/commonjs/dom/nodes/index.js.map +1 -0
  75. package/lib/commonjs/dom/nodes/paint/BlendNode.js +82 -0
  76. package/lib/commonjs/dom/nodes/paint/BlendNode.js.map +1 -0
  77. package/lib/commonjs/dom/nodes/paint/ColorFilters.js +152 -0
  78. package/lib/commonjs/dom/nodes/paint/ColorFilters.js.map +1 -0
  79. package/lib/commonjs/dom/nodes/paint/ImageFilters.js +225 -0
  80. package/lib/commonjs/dom/nodes/paint/ImageFilters.js.map +1 -0
  81. package/lib/commonjs/dom/nodes/paint/MaskFilters.js +33 -0
  82. package/lib/commonjs/dom/nodes/paint/MaskFilters.js.map +1 -0
  83. package/lib/commonjs/dom/nodes/paint/PathEffects.js +223 -0
  84. package/lib/commonjs/dom/nodes/paint/PathEffects.js.map +1 -0
  85. package/lib/commonjs/dom/nodes/paint/Shaders.js +242 -0
  86. package/lib/commonjs/dom/nodes/paint/Shaders.js.map +1 -0
  87. package/lib/commonjs/dom/nodes/paint/index.js +84 -0
  88. package/lib/commonjs/dom/nodes/paint/index.js.map +1 -0
  89. package/lib/commonjs/dom/types/ColorFilters.js +6 -0
  90. package/lib/commonjs/dom/types/ColorFilters.js.map +1 -0
  91. package/lib/commonjs/dom/types/Common.js +6 -0
  92. package/lib/commonjs/dom/types/Common.js.map +1 -0
  93. package/lib/commonjs/dom/types/DrawingContext.js +6 -0
  94. package/lib/commonjs/dom/types/DrawingContext.js.map +1 -0
  95. package/lib/commonjs/dom/types/Drawings.js +6 -0
  96. package/lib/commonjs/dom/types/Drawings.js.map +1 -0
  97. package/lib/commonjs/dom/types/ImageFilters.js +6 -0
  98. package/lib/commonjs/dom/types/ImageFilters.js.map +1 -0
  99. package/lib/commonjs/dom/types/MaskFilters.js +6 -0
  100. package/lib/commonjs/dom/types/MaskFilters.js.map +1 -0
  101. package/lib/commonjs/dom/types/Node.js +6 -0
  102. package/lib/commonjs/dom/types/Node.js.map +1 -0
  103. package/lib/commonjs/dom/types/NodeType.js +80 -0
  104. package/lib/commonjs/dom/types/NodeType.js.map +1 -0
  105. package/lib/commonjs/dom/types/PathEffects.js +6 -0
  106. package/lib/commonjs/dom/types/PathEffects.js.map +1 -0
  107. package/lib/commonjs/dom/types/Shaders.js +6 -0
  108. package/lib/commonjs/dom/types/Shaders.js.map +1 -0
  109. package/lib/commonjs/dom/types/SkDOM.js +6 -0
  110. package/lib/commonjs/dom/types/SkDOM.js.map +1 -0
  111. package/lib/commonjs/dom/types/index.js +149 -0
  112. package/lib/commonjs/dom/types/index.js.map +1 -0
  113. package/lib/commonjs/index.js +26 -0
  114. package/lib/commonjs/index.js.map +1 -1
  115. package/lib/commonjs/renderer/Canvas.js +7 -3
  116. package/lib/commonjs/renderer/Canvas.js.map +1 -1
  117. package/lib/commonjs/renderer/Container.js +39 -0
  118. package/lib/commonjs/renderer/Container.js.map +1 -0
  119. package/lib/commonjs/renderer/DependencyManager.js +17 -5
  120. package/lib/commonjs/renderer/DependencyManager.js.map +1 -1
  121. package/lib/commonjs/renderer/HostComponents.js +196 -0
  122. package/lib/commonjs/renderer/HostComponents.js.map +1 -0
  123. package/lib/commonjs/renderer/HostConfig.js +47 -125
  124. package/lib/commonjs/renderer/HostConfig.js.map +1 -1
  125. package/lib/commonjs/renderer/components/Blend.js +1 -46
  126. package/lib/commonjs/renderer/components/Blend.js.map +1 -1
  127. package/lib/commonjs/renderer/components/Drawing.js +1 -15
  128. package/lib/commonjs/renderer/components/Drawing.js.map +1 -1
  129. package/lib/commonjs/renderer/components/Group.js +1 -69
  130. package/lib/commonjs/renderer/components/Group.js.map +1 -1
  131. package/lib/commonjs/renderer/components/Paint.js +2 -14
  132. package/lib/commonjs/renderer/components/Paint.js.map +1 -1
  133. package/lib/commonjs/renderer/components/Picture.js +1 -19
  134. package/lib/commonjs/renderer/components/Picture.js.map +1 -1
  135. package/lib/commonjs/renderer/components/backdrop/BackdropBlur.js.map +1 -1
  136. package/lib/commonjs/renderer/components/backdrop/BackdropFilter.js +2 -32
  137. package/lib/commonjs/renderer/components/backdrop/BackdropFilter.js.map +1 -1
  138. package/lib/commonjs/renderer/components/colorFilters/BlendColor.js +1 -25
  139. package/lib/commonjs/renderer/components/colorFilters/BlendColor.js.map +1 -1
  140. package/lib/commonjs/renderer/components/colorFilters/Lerp.js +1 -23
  141. package/lib/commonjs/renderer/components/colorFilters/Lerp.js.map +1 -1
  142. package/lib/commonjs/renderer/components/colorFilters/LinearToSRGBGamma.js +1 -17
  143. package/lib/commonjs/renderer/components/colorFilters/LinearToSRGBGamma.js.map +1 -1
  144. package/lib/commonjs/renderer/components/colorFilters/LumaColorFilter.js +1 -17
  145. package/lib/commonjs/renderer/components/colorFilters/LumaColorFilter.js.map +1 -1
  146. package/lib/commonjs/renderer/components/colorFilters/Matrix.js +1 -20
  147. package/lib/commonjs/renderer/components/colorFilters/Matrix.js.map +1 -1
  148. package/lib/commonjs/renderer/components/colorFilters/SRGBToLinearGamma.js +1 -17
  149. package/lib/commonjs/renderer/components/colorFilters/SRGBToLinearGamma.js.map +1 -1
  150. package/lib/commonjs/renderer/components/image/Image.js +1 -35
  151. package/lib/commonjs/renderer/components/image/Image.js.map +1 -1
  152. package/lib/commonjs/renderer/components/image/ImageSVG.js +1 -30
  153. package/lib/commonjs/renderer/components/image/ImageSVG.js.map +1 -1
  154. package/lib/commonjs/renderer/components/image/ImageShader.js +1 -61
  155. package/lib/commonjs/renderer/components/image/ImageShader.js.map +1 -1
  156. package/lib/commonjs/renderer/components/image/index.js +0 -13
  157. package/lib/commonjs/renderer/components/image/index.js.map +1 -1
  158. package/lib/commonjs/renderer/components/imageFilters/Blur.js +1 -27
  159. package/lib/commonjs/renderer/components/imageFilters/Blur.js.map +1 -1
  160. package/lib/commonjs/renderer/components/imageFilters/DisplacementMap.js +1 -38
  161. package/lib/commonjs/renderer/components/imageFilters/DisplacementMap.js.map +1 -1
  162. package/lib/commonjs/renderer/components/imageFilters/Morphology.js +1 -25
  163. package/lib/commonjs/renderer/components/imageFilters/Morphology.js.map +1 -1
  164. package/lib/commonjs/renderer/components/imageFilters/Offset.js +1 -20
  165. package/lib/commonjs/renderer/components/imageFilters/Offset.js.map +1 -1
  166. package/lib/commonjs/renderer/components/imageFilters/RuntimeShader.js +1 -28
  167. package/lib/commonjs/renderer/components/imageFilters/RuntimeShader.js.map +1 -1
  168. package/lib/commonjs/renderer/components/imageFilters/Shadow.js +1 -39
  169. package/lib/commonjs/renderer/components/imageFilters/Shadow.js.map +1 -1
  170. package/lib/commonjs/renderer/components/index.js +0 -13
  171. package/lib/commonjs/renderer/components/index.js.map +1 -1
  172. package/lib/commonjs/renderer/components/maskFilters/Blur.js +1 -23
  173. package/lib/commonjs/renderer/components/maskFilters/Blur.js.map +1 -1
  174. package/lib/commonjs/renderer/components/pathEffects/Corner.js +1 -30
  175. package/lib/commonjs/renderer/components/pathEffects/Corner.js.map +1 -1
  176. package/lib/commonjs/renderer/components/pathEffects/Dash.js +1 -27
  177. package/lib/commonjs/renderer/components/pathEffects/Dash.js.map +1 -1
  178. package/lib/commonjs/renderer/components/pathEffects/Discrete.js +1 -28
  179. package/lib/commonjs/renderer/components/pathEffects/Discrete.js.map +1 -1
  180. package/lib/commonjs/renderer/components/pathEffects/Line2D.js +1 -31
  181. package/lib/commonjs/renderer/components/pathEffects/Line2D.js.map +1 -1
  182. package/lib/commonjs/renderer/components/pathEffects/Path1D.js +1 -37
  183. package/lib/commonjs/renderer/components/pathEffects/Path1D.js.map +1 -1
  184. package/lib/commonjs/renderer/components/pathEffects/Path2D.js +1 -33
  185. package/lib/commonjs/renderer/components/pathEffects/Path2D.js.map +1 -1
  186. package/lib/commonjs/renderer/components/pathEffects/Sum.js +1 -17
  187. package/lib/commonjs/renderer/components/pathEffects/Sum.js.map +1 -1
  188. package/lib/commonjs/renderer/components/shaders/Color.js +1 -19
  189. package/lib/commonjs/renderer/components/shaders/Color.js.map +1 -1
  190. package/lib/commonjs/renderer/components/shaders/FractalNoise.js +1 -22
  191. package/lib/commonjs/renderer/components/shaders/FractalNoise.js.map +1 -1
  192. package/lib/commonjs/renderer/components/shaders/LinearGradient.js +1 -28
  193. package/lib/commonjs/renderer/components/shaders/LinearGradient.js.map +1 -1
  194. package/lib/commonjs/renderer/components/shaders/RadialGradient.js +1 -28
  195. package/lib/commonjs/renderer/components/shaders/RadialGradient.js.map +1 -1
  196. package/lib/commonjs/renderer/components/shaders/Shader.js +1 -23
  197. package/lib/commonjs/renderer/components/shaders/Shader.js.map +1 -1
  198. package/lib/commonjs/renderer/components/shaders/SweepGradient.js +1 -29
  199. package/lib/commonjs/renderer/components/shaders/SweepGradient.js.map +1 -1
  200. package/lib/commonjs/renderer/components/shaders/Turbulence.js +1 -22
  201. package/lib/commonjs/renderer/components/shaders/Turbulence.js.map +1 -1
  202. package/lib/commonjs/renderer/components/shaders/TwoPointConicalGradient.js +1 -30
  203. package/lib/commonjs/renderer/components/shaders/TwoPointConicalGradient.js.map +1 -1
  204. package/lib/commonjs/renderer/components/shapes/Box.js +2 -102
  205. package/lib/commonjs/renderer/components/shapes/Box.js.map +1 -1
  206. package/lib/commonjs/renderer/components/shapes/Circle.js +1 -22
  207. package/lib/commonjs/renderer/components/shapes/Circle.js.map +1 -1
  208. package/lib/commonjs/renderer/components/shapes/DiffRect.js +1 -19
  209. package/lib/commonjs/renderer/components/shapes/DiffRect.js.map +1 -1
  210. package/lib/commonjs/renderer/components/shapes/Fill.js +1 -15
  211. package/lib/commonjs/renderer/components/shapes/Fill.js.map +1 -1
  212. package/lib/commonjs/renderer/components/shapes/FitBox.js +3 -3
  213. package/lib/commonjs/renderer/components/shapes/FitBox.js.map +1 -1
  214. package/lib/commonjs/renderer/components/shapes/Line.js +1 -19
  215. package/lib/commonjs/renderer/components/shapes/Line.js.map +1 -1
  216. package/lib/commonjs/renderer/components/shapes/Oval.js +1 -19
  217. package/lib/commonjs/renderer/components/shapes/Oval.js.map +1 -1
  218. package/lib/commonjs/renderer/components/shapes/Patch.js +1 -37
  219. package/lib/commonjs/renderer/components/shapes/Patch.js.map +1 -1
  220. package/lib/commonjs/renderer/components/shapes/Path.js +1 -47
  221. package/lib/commonjs/renderer/components/shapes/Path.js.map +1 -1
  222. package/lib/commonjs/renderer/components/shapes/Points.js +1 -26
  223. package/lib/commonjs/renderer/components/shapes/Points.js.map +1 -1
  224. package/lib/commonjs/renderer/components/shapes/Rect.js +1 -19
  225. package/lib/commonjs/renderer/components/shapes/Rect.js.map +1 -1
  226. package/lib/commonjs/renderer/components/shapes/RoundedRect.js +1 -19
  227. package/lib/commonjs/renderer/components/shapes/RoundedRect.js.map +1 -1
  228. package/lib/commonjs/renderer/components/shapes/Vertices.js +1 -36
  229. package/lib/commonjs/renderer/components/shapes/Vertices.js.map +1 -1
  230. package/lib/commonjs/renderer/components/text/Glyphs.js +1 -39
  231. package/lib/commonjs/renderer/components/text/Glyphs.js.map +1 -1
  232. package/lib/commonjs/renderer/components/text/Text.js +1 -24
  233. package/lib/commonjs/renderer/components/text/Text.js.map +1 -1
  234. package/lib/commonjs/renderer/components/text/TextBlob.js +1 -20
  235. package/lib/commonjs/renderer/components/text/TextBlob.js.map +1 -1
  236. package/lib/commonjs/renderer/components/text/TextPath.js +1 -71
  237. package/lib/commonjs/renderer/components/text/TextPath.js.map +1 -1
  238. package/lib/commonjs/renderer/index.js +0 -13
  239. package/lib/commonjs/renderer/index.js.map +1 -1
  240. package/lib/commonjs/renderer/processors/Animations/Animations.js.map +1 -1
  241. package/lib/commonjs/renderer/processors/index.js +0 -117
  242. package/lib/commonjs/renderer/processors/index.js.map +1 -1
  243. package/lib/commonjs/web/WithSkiaWeb.js +3 -1
  244. package/lib/commonjs/web/WithSkiaWeb.js.map +1 -1
  245. package/lib/module/dom/nodes/DrawingNode.js +72 -0
  246. package/lib/module/dom/nodes/DrawingNode.js.map +1 -0
  247. package/lib/module/dom/nodes/GroupNode.js +17 -0
  248. package/lib/module/dom/nodes/GroupNode.js.map +1 -0
  249. package/lib/module/dom/nodes/JsiSkDOM.js +240 -0
  250. package/lib/module/dom/nodes/JsiSkDOM.js.map +1 -0
  251. package/lib/module/dom/nodes/Node.js +145 -0
  252. package/lib/module/dom/nodes/Node.js.map +1 -0
  253. package/lib/module/dom/nodes/PaintContext.js +2 -0
  254. package/lib/module/dom/nodes/PaintContext.js.map +1 -0
  255. package/lib/module/dom/nodes/PaintNode.js +83 -0
  256. package/lib/module/dom/nodes/PaintNode.js.map +1 -0
  257. package/lib/module/dom/nodes/RenderNode.js +329 -0
  258. package/lib/module/dom/nodes/RenderNode.js.map +1 -0
  259. package/lib/module/{renderer/processors/Circles.js → dom/nodes/datatypes/Circle.js} +2 -3
  260. package/lib/module/dom/nodes/datatypes/Circle.js.map +1 -0
  261. package/lib/module/{renderer/processors → dom/nodes/datatypes}/Color.js +0 -0
  262. package/lib/module/{renderer/processors → dom/nodes/datatypes}/Color.js.map +1 -1
  263. package/lib/module/dom/nodes/datatypes/Enum.js +2 -0
  264. package/lib/module/dom/nodes/datatypes/Enum.js.map +1 -0
  265. package/lib/module/{renderer/components/image/BoxFit.js → dom/nodes/datatypes/Fitting.js} +2 -2
  266. package/lib/module/{renderer/components/image/BoxFit.js.map → dom/nodes/datatypes/Fitting.js.map} +1 -1
  267. package/lib/module/dom/nodes/datatypes/Gradient.js +47 -0
  268. package/lib/module/dom/nodes/datatypes/Gradient.js.map +1 -0
  269. package/lib/module/{renderer/processors/Paths.js → dom/nodes/datatypes/Path.js} +2 -2
  270. package/lib/module/dom/nodes/datatypes/Path.js.map +1 -0
  271. package/lib/module/{renderer/processors → dom/nodes/datatypes}/Radius.js +0 -0
  272. package/lib/module/dom/nodes/datatypes/Radius.js.map +1 -0
  273. package/lib/module/{renderer/processors/Rects.js → dom/nodes/datatypes/Rect.js} +1 -1
  274. package/lib/module/dom/nodes/datatypes/Rect.js.map +1 -0
  275. package/lib/module/dom/nodes/datatypes/Transform.js +32 -0
  276. package/lib/module/dom/nodes/datatypes/Transform.js.map +1 -0
  277. package/lib/module/dom/nodes/datatypes/index.js +10 -0
  278. package/lib/module/dom/nodes/datatypes/index.js.map +1 -0
  279. package/lib/module/dom/nodes/drawings/BackdropFilterNode.js +25 -0
  280. package/lib/module/dom/nodes/drawings/BackdropFilterNode.js.map +1 -0
  281. package/lib/module/dom/nodes/drawings/Box.js +89 -0
  282. package/lib/module/dom/nodes/drawings/Box.js.map +1 -0
  283. package/lib/module/dom/nodes/drawings/CircleNode.js +31 -0
  284. package/lib/module/dom/nodes/drawings/CircleNode.js.map +1 -0
  285. package/lib/module/dom/nodes/drawings/CustomDrawingNode.js +17 -0
  286. package/lib/module/dom/nodes/drawings/CustomDrawingNode.js.map +1 -0
  287. package/lib/module/dom/nodes/drawings/DiffRectNode.js +25 -0
  288. package/lib/module/dom/nodes/drawings/DiffRectNode.js.map +1 -0
  289. package/lib/module/dom/nodes/drawings/FillNode.js +22 -0
  290. package/lib/module/dom/nodes/drawings/FillNode.js.map +1 -0
  291. package/lib/module/dom/nodes/drawings/ImageNode.js +51 -0
  292. package/lib/module/dom/nodes/drawings/ImageNode.js.map +1 -0
  293. package/lib/module/dom/nodes/drawings/ImageSVG.js +33 -0
  294. package/lib/module/dom/nodes/drawings/ImageSVG.js.map +1 -0
  295. package/lib/module/dom/nodes/drawings/LineNode.js +25 -0
  296. package/lib/module/dom/nodes/drawings/LineNode.js.map +1 -0
  297. package/lib/module/dom/nodes/drawings/OvalNode.js +27 -0
  298. package/lib/module/dom/nodes/drawings/OvalNode.js.map +1 -0
  299. package/lib/module/dom/nodes/drawings/PatchNode.js +56 -0
  300. package/lib/module/dom/nodes/drawings/PatchNode.js.map +1 -0
  301. package/lib/module/dom/nodes/drawings/PathNode.js +55 -0
  302. package/lib/module/dom/nodes/drawings/PathNode.js.map +1 -0
  303. package/lib/module/dom/nodes/drawings/PictureNode.js +23 -0
  304. package/lib/module/dom/nodes/drawings/PictureNode.js.map +1 -0
  305. package/lib/module/dom/nodes/drawings/PointsNode.js +27 -0
  306. package/lib/module/dom/nodes/drawings/PointsNode.js.map +1 -0
  307. package/lib/module/dom/nodes/drawings/RRectNode.js +31 -0
  308. package/lib/module/dom/nodes/drawings/RRectNode.js.map +1 -0
  309. package/lib/module/dom/nodes/drawings/RectNode.js +27 -0
  310. package/lib/module/dom/nodes/drawings/RectNode.js.map +1 -0
  311. package/lib/module/dom/nodes/drawings/Text.js +164 -0
  312. package/lib/module/dom/nodes/drawings/Text.js.map +1 -0
  313. package/lib/module/dom/nodes/drawings/VerticesNode.js +42 -0
  314. package/lib/module/dom/nodes/drawings/VerticesNode.js.map +1 -0
  315. package/lib/module/dom/nodes/drawings/index.js +19 -0
  316. package/lib/module/dom/nodes/drawings/index.js.map +1 -0
  317. package/lib/module/dom/nodes/index.js +4 -0
  318. package/lib/module/dom/nodes/index.js.map +1 -0
  319. package/lib/module/dom/nodes/paint/BlendNode.js +66 -0
  320. package/lib/module/dom/nodes/paint/BlendNode.js.map +1 -0
  321. package/lib/module/dom/nodes/paint/ColorFilters.js +120 -0
  322. package/lib/module/dom/nodes/paint/ColorFilters.js.map +1 -0
  323. package/lib/module/dom/nodes/paint/ImageFilters.js +191 -0
  324. package/lib/module/dom/nodes/paint/ImageFilters.js.map +1 -0
  325. package/lib/module/dom/nodes/paint/MaskFilters.js +20 -0
  326. package/lib/module/dom/nodes/paint/MaskFilters.js.map +1 -0
  327. package/lib/module/dom/nodes/paint/PathEffects.js +192 -0
  328. package/lib/module/dom/nodes/paint/PathEffects.js.map +1 -0
  329. package/lib/module/dom/nodes/paint/Shaders.js +201 -0
  330. package/lib/module/dom/nodes/paint/Shaders.js.map +1 -0
  331. package/lib/module/dom/nodes/paint/index.js +7 -0
  332. package/lib/module/dom/nodes/paint/index.js.map +1 -0
  333. package/lib/module/dom/types/ColorFilters.js +2 -0
  334. package/lib/module/dom/types/ColorFilters.js.map +1 -0
  335. package/lib/module/dom/types/Common.js +2 -0
  336. package/lib/module/dom/types/Common.js.map +1 -0
  337. package/lib/module/dom/types/DrawingContext.js +2 -0
  338. package/lib/module/dom/types/DrawingContext.js.map +1 -0
  339. package/lib/module/dom/types/Drawings.js +2 -0
  340. package/lib/module/dom/types/Drawings.js.map +1 -0
  341. package/lib/module/dom/types/ImageFilters.js +2 -0
  342. package/lib/module/dom/types/ImageFilters.js.map +1 -0
  343. package/lib/module/dom/types/MaskFilters.js +2 -0
  344. package/lib/module/dom/types/MaskFilters.js.map +1 -0
  345. package/lib/module/dom/types/Node.js +2 -0
  346. package/lib/module/dom/types/Node.js.map +1 -0
  347. package/lib/module/dom/types/NodeType.js +72 -0
  348. package/lib/module/dom/types/NodeType.js.map +1 -0
  349. package/lib/module/dom/types/PathEffects.js +2 -0
  350. package/lib/module/dom/types/PathEffects.js.map +1 -0
  351. package/lib/module/dom/types/Shaders.js +2 -0
  352. package/lib/module/dom/types/Shaders.js.map +1 -0
  353. package/lib/module/dom/types/SkDOM.js +2 -0
  354. package/lib/module/dom/types/SkDOM.js.map +1 -0
  355. package/lib/module/dom/types/index.js +12 -0
  356. package/lib/module/dom/types/index.js.map +1 -0
  357. package/lib/module/index.js +2 -0
  358. package/lib/module/index.js.map +1 -1
  359. package/lib/module/renderer/Canvas.js +7 -3
  360. package/lib/module/renderer/Canvas.js.map +1 -1
  361. package/lib/module/renderer/Container.js +29 -0
  362. package/lib/module/renderer/Container.js.map +1 -0
  363. package/lib/module/renderer/DependencyManager.js +17 -5
  364. package/lib/module/renderer/DependencyManager.js.map +1 -1
  365. package/lib/module/renderer/HostComponents.js +185 -0
  366. package/lib/module/renderer/HostComponents.js.map +1 -0
  367. package/lib/module/renderer/HostConfig.js +47 -126
  368. package/lib/module/renderer/HostConfig.js.map +1 -1
  369. package/lib/module/renderer/components/Blend.js +1 -42
  370. package/lib/module/renderer/components/Blend.js.map +1 -1
  371. package/lib/module/renderer/components/Drawing.js +1 -13
  372. package/lib/module/renderer/components/Drawing.js.map +1 -1
  373. package/lib/module/renderer/components/Group.js +1 -65
  374. package/lib/module/renderer/components/Group.js.map +1 -1
  375. package/lib/module/renderer/components/Paint.js +3 -12
  376. package/lib/module/renderer/components/Paint.js.map +1 -1
  377. package/lib/module/renderer/components/Picture.js +1 -17
  378. package/lib/module/renderer/components/Picture.js.map +1 -1
  379. package/lib/module/renderer/components/backdrop/BackdropBlur.js.map +1 -1
  380. package/lib/module/renderer/components/backdrop/BackdropFilter.js +2 -30
  381. package/lib/module/renderer/components/backdrop/BackdropFilter.js.map +1 -1
  382. package/lib/module/renderer/components/colorFilters/BlendColor.js +1 -20
  383. package/lib/module/renderer/components/colorFilters/BlendColor.js.map +1 -1
  384. package/lib/module/renderer/components/colorFilters/Lerp.js +1 -19
  385. package/lib/module/renderer/components/colorFilters/Lerp.js.map +1 -1
  386. package/lib/module/renderer/components/colorFilters/LinearToSRGBGamma.js +1 -15
  387. package/lib/module/renderer/components/colorFilters/LinearToSRGBGamma.js.map +1 -1
  388. package/lib/module/renderer/components/colorFilters/LumaColorFilter.js +1 -15
  389. package/lib/module/renderer/components/colorFilters/LumaColorFilter.js.map +1 -1
  390. package/lib/module/renderer/components/colorFilters/Matrix.js +1 -17
  391. package/lib/module/renderer/components/colorFilters/Matrix.js.map +1 -1
  392. package/lib/module/renderer/components/colorFilters/SRGBToLinearGamma.js +1 -15
  393. package/lib/module/renderer/components/colorFilters/SRGBToLinearGamma.js.map +1 -1
  394. package/lib/module/renderer/components/image/Image.js +1 -31
  395. package/lib/module/renderer/components/image/Image.js.map +1 -1
  396. package/lib/module/renderer/components/image/ImageSVG.js +1 -27
  397. package/lib/module/renderer/components/image/ImageSVG.js.map +1 -1
  398. package/lib/module/renderer/components/image/ImageShader.js +1 -57
  399. package/lib/module/renderer/components/image/ImageShader.js.map +1 -1
  400. package/lib/module/renderer/components/image/index.js +0 -1
  401. package/lib/module/renderer/components/image/index.js.map +1 -1
  402. package/lib/module/renderer/components/imageFilters/Blur.js +1 -21
  403. package/lib/module/renderer/components/imageFilters/Blur.js.map +1 -1
  404. package/lib/module/renderer/components/imageFilters/DisplacementMap.js +1 -30
  405. package/lib/module/renderer/components/imageFilters/DisplacementMap.js.map +1 -1
  406. package/lib/module/renderer/components/imageFilters/Morphology.js +1 -21
  407. package/lib/module/renderer/components/imageFilters/Morphology.js.map +1 -1
  408. package/lib/module/renderer/components/imageFilters/Offset.js +1 -17
  409. package/lib/module/renderer/components/imageFilters/Offset.js.map +1 -1
  410. package/lib/module/renderer/components/imageFilters/RuntimeShader.js +1 -24
  411. package/lib/module/renderer/components/imageFilters/RuntimeShader.js.map +1 -1
  412. package/lib/module/renderer/components/imageFilters/Shadow.js +1 -34
  413. package/lib/module/renderer/components/imageFilters/Shadow.js.map +1 -1
  414. package/lib/module/renderer/components/index.js +0 -1
  415. package/lib/module/renderer/components/index.js.map +1 -1
  416. package/lib/module/renderer/components/maskFilters/Blur.js +1 -19
  417. package/lib/module/renderer/components/maskFilters/Blur.js.map +1 -1
  418. package/lib/module/renderer/components/pathEffects/Corner.js +1 -27
  419. package/lib/module/renderer/components/pathEffects/Corner.js.map +1 -1
  420. package/lib/module/renderer/components/pathEffects/Dash.js +1 -24
  421. package/lib/module/renderer/components/pathEffects/Dash.js.map +1 -1
  422. package/lib/module/renderer/components/pathEffects/Discrete.js +1 -25
  423. package/lib/module/renderer/components/pathEffects/Discrete.js.map +1 -1
  424. package/lib/module/renderer/components/pathEffects/Line2D.js +1 -28
  425. package/lib/module/renderer/components/pathEffects/Line2D.js.map +1 -1
  426. package/lib/module/renderer/components/pathEffects/Path1D.js +1 -32
  427. package/lib/module/renderer/components/pathEffects/Path1D.js.map +1 -1
  428. package/lib/module/renderer/components/pathEffects/Path2D.js +1 -29
  429. package/lib/module/renderer/components/pathEffects/Path2D.js.map +1 -1
  430. package/lib/module/renderer/components/pathEffects/Sum.js +1 -14
  431. package/lib/module/renderer/components/pathEffects/Sum.js.map +1 -1
  432. package/lib/module/renderer/components/shaders/Color.js +1 -16
  433. package/lib/module/renderer/components/shaders/Color.js.map +1 -1
  434. package/lib/module/renderer/components/shaders/FractalNoise.js +1 -20
  435. package/lib/module/renderer/components/shaders/FractalNoise.js.map +1 -1
  436. package/lib/module/renderer/components/shaders/LinearGradient.js +1 -25
  437. package/lib/module/renderer/components/shaders/LinearGradient.js.map +1 -1
  438. package/lib/module/renderer/components/shaders/RadialGradient.js +1 -25
  439. package/lib/module/renderer/components/shaders/RadialGradient.js.map +1 -1
  440. package/lib/module/renderer/components/shaders/Shader.js +1 -19
  441. package/lib/module/renderer/components/shaders/Shader.js.map +1 -1
  442. package/lib/module/renderer/components/shaders/SweepGradient.js +1 -26
  443. package/lib/module/renderer/components/shaders/SweepGradient.js.map +1 -1
  444. package/lib/module/renderer/components/shaders/Turbulence.js +1 -20
  445. package/lib/module/renderer/components/shaders/Turbulence.js.map +1 -1
  446. package/lib/module/renderer/components/shaders/TwoPointConicalGradient.js +1 -27
  447. package/lib/module/renderer/components/shaders/TwoPointConicalGradient.js.map +1 -1
  448. package/lib/module/renderer/components/shapes/Box.js +2 -97
  449. package/lib/module/renderer/components/shapes/Box.js.map +1 -1
  450. package/lib/module/renderer/components/shapes/Circle.js +1 -19
  451. package/lib/module/renderer/components/shapes/Circle.js.map +1 -1
  452. package/lib/module/renderer/components/shapes/DiffRect.js +1 -17
  453. package/lib/module/renderer/components/shapes/DiffRect.js.map +1 -1
  454. package/lib/module/renderer/components/shapes/Fill.js +1 -13
  455. package/lib/module/renderer/components/shapes/Fill.js.map +1 -1
  456. package/lib/module/renderer/components/shapes/FitBox.js +1 -1
  457. package/lib/module/renderer/components/shapes/FitBox.js.map +1 -1
  458. package/lib/module/renderer/components/shapes/Line.js +1 -17
  459. package/lib/module/renderer/components/shapes/Line.js.map +1 -1
  460. package/lib/module/renderer/components/shapes/Oval.js +1 -16
  461. package/lib/module/renderer/components/shapes/Oval.js.map +1 -1
  462. package/lib/module/renderer/components/shapes/Patch.js +1 -32
  463. package/lib/module/renderer/components/shapes/Patch.js.map +1 -1
  464. package/lib/module/renderer/components/shapes/Path.js +1 -43
  465. package/lib/module/renderer/components/shapes/Path.js.map +1 -1
  466. package/lib/module/renderer/components/shapes/Points.js +1 -20
  467. package/lib/module/renderer/components/shapes/Points.js.map +1 -1
  468. package/lib/module/renderer/components/shapes/Rect.js +1 -16
  469. package/lib/module/renderer/components/shapes/Rect.js.map +1 -1
  470. package/lib/module/renderer/components/shapes/RoundedRect.js +1 -16
  471. package/lib/module/renderer/components/shapes/RoundedRect.js.map +1 -1
  472. package/lib/module/renderer/components/shapes/Vertices.js +1 -31
  473. package/lib/module/renderer/components/shapes/Vertices.js.map +1 -1
  474. package/lib/module/renderer/components/text/Glyphs.js +1 -37
  475. package/lib/module/renderer/components/text/Glyphs.js.map +1 -1
  476. package/lib/module/renderer/components/text/Text.js +1 -22
  477. package/lib/module/renderer/components/text/Text.js.map +1 -1
  478. package/lib/module/renderer/components/text/TextBlob.js +1 -18
  479. package/lib/module/renderer/components/text/TextBlob.js.map +1 -1
  480. package/lib/module/renderer/components/text/TextPath.js +1 -69
  481. package/lib/module/renderer/components/text/TextPath.js.map +1 -1
  482. package/lib/module/renderer/index.js +0 -1
  483. package/lib/module/renderer/index.js.map +1 -1
  484. package/lib/module/renderer/processors/Animations/Animations.js.map +1 -1
  485. package/lib/module/renderer/processors/index.js +0 -9
  486. package/lib/module/renderer/processors/index.js.map +1 -1
  487. package/lib/module/web/WithSkiaWeb.js +3 -1
  488. package/lib/module/web/WithSkiaWeb.js.map +1 -1
  489. package/lib/typescript/src/dom/nodes/DrawingNode.d.ts +14 -0
  490. package/lib/typescript/src/dom/nodes/GroupNode.d.ts +8 -0
  491. package/lib/typescript/src/dom/nodes/JsiSkDOM.d.ts +70 -0
  492. package/lib/typescript/src/dom/nodes/Node.d.ts +43 -0
  493. package/lib/typescript/src/dom/nodes/PaintContext.d.ts +18 -0
  494. package/lib/typescript/src/dom/nodes/PaintNode.d.ts +8 -0
  495. package/lib/typescript/src/dom/nodes/RenderNode.d.ts +29 -0
  496. package/lib/typescript/src/dom/nodes/datatypes/Circle.d.ts +4 -0
  497. package/lib/typescript/src/{renderer/processors → dom/nodes/datatypes}/Color.d.ts +1 -1
  498. package/lib/typescript/src/dom/nodes/datatypes/Enum.d.ts +1 -0
  499. package/lib/typescript/src/{renderer/components/image/BoxFit.d.ts → dom/nodes/datatypes/Fitting.d.ts} +1 -1
  500. package/lib/typescript/src/{renderer/processors/Transform.d.ts → dom/nodes/datatypes/Gradient.d.ts} +11 -9
  501. package/lib/typescript/src/dom/nodes/datatypes/Path.d.ts +4 -0
  502. package/lib/typescript/src/dom/nodes/datatypes/Radius.d.ts +3 -0
  503. package/lib/typescript/src/dom/nodes/datatypes/Rect.d.ts +5 -0
  504. package/lib/typescript/src/dom/nodes/datatypes/Transform.d.ts +3 -0
  505. package/lib/typescript/src/dom/nodes/datatypes/index.d.ts +9 -0
  506. package/lib/typescript/src/dom/nodes/drawings/BackdropFilterNode.d.ts +8 -0
  507. package/lib/typescript/src/dom/nodes/drawings/Box.d.ts +13 -0
  508. package/lib/typescript/src/dom/nodes/drawings/CircleNode.d.ts +9 -0
  509. package/lib/typescript/src/dom/nodes/drawings/CustomDrawingNode.d.ts +8 -0
  510. package/lib/typescript/src/dom/nodes/drawings/DiffRectNode.d.ts +8 -0
  511. package/lib/typescript/src/dom/nodes/drawings/FillNode.d.ts +8 -0
  512. package/lib/typescript/src/dom/nodes/drawings/ImageNode.d.ts +25 -0
  513. package/lib/typescript/src/dom/nodes/drawings/ImageSVG.d.ts +8 -0
  514. package/lib/typescript/src/dom/nodes/drawings/LineNode.d.ts +8 -0
  515. package/lib/typescript/src/dom/nodes/drawings/OvalNode.d.ts +9 -0
  516. package/lib/typescript/src/dom/nodes/drawings/PatchNode.d.ts +18 -0
  517. package/lib/typescript/src/dom/nodes/drawings/PathNode.d.ts +9 -0
  518. package/lib/typescript/src/dom/nodes/drawings/PictureNode.d.ts +8 -0
  519. package/lib/typescript/src/dom/nodes/drawings/PointsNode.d.ts +8 -0
  520. package/lib/typescript/src/dom/nodes/drawings/RRectNode.d.ts +10 -0
  521. package/lib/typescript/src/dom/nodes/drawings/RectNode.d.ts +9 -0
  522. package/lib/typescript/src/dom/nodes/drawings/Text.d.ts +30 -0
  523. package/lib/typescript/src/dom/nodes/drawings/VerticesNode.d.ts +9 -0
  524. package/lib/typescript/src/dom/nodes/drawings/index.d.ts +18 -0
  525. package/lib/typescript/src/dom/nodes/index.d.ts +3 -0
  526. package/lib/typescript/src/dom/nodes/paint/BlendNode.d.ts +12 -0
  527. package/lib/typescript/src/dom/nodes/paint/ColorFilters.d.ts +36 -0
  528. package/lib/typescript/src/dom/nodes/paint/ImageFilters.d.ts +42 -0
  529. package/lib/typescript/src/dom/nodes/paint/MaskFilters.d.ts +8 -0
  530. package/lib/typescript/src/dom/nodes/paint/PathEffects.d.ts +42 -0
  531. package/lib/typescript/src/dom/nodes/paint/Shaders.d.ts +44 -0
  532. package/lib/typescript/src/dom/nodes/paint/index.d.ts +6 -0
  533. package/lib/typescript/src/dom/types/ColorFilters.d.ts +12 -0
  534. package/lib/typescript/src/dom/types/Common.d.ts +57 -0
  535. package/lib/typescript/src/dom/types/DrawingContext.d.ts +6 -0
  536. package/lib/typescript/src/dom/types/Drawings.d.ts +106 -0
  537. package/lib/typescript/src/dom/types/ImageFilters.d.ts +37 -0
  538. package/lib/typescript/src/dom/types/MaskFilters.d.ts +7 -0
  539. package/lib/typescript/src/dom/types/Node.d.ts +29 -0
  540. package/lib/typescript/src/dom/types/NodeType.d.ts +66 -0
  541. package/lib/typescript/src/dom/types/PathEffects.d.ts +28 -0
  542. package/lib/typescript/src/dom/types/Shaders.d.ts +59 -0
  543. package/lib/typescript/src/dom/types/SkDOM.d.ts +71 -0
  544. package/lib/typescript/src/dom/types/index.d.ts +11 -0
  545. package/lib/typescript/src/index.d.ts +2 -0
  546. package/lib/typescript/src/renderer/Canvas.d.ts +3 -3
  547. package/lib/typescript/src/renderer/Container.d.ts +12 -0
  548. package/lib/typescript/src/renderer/DependencyManager.d.ts +5 -4
  549. package/lib/typescript/src/renderer/HostComponents.d.ts +72 -0
  550. package/lib/typescript/src/renderer/HostConfig.d.ts +5 -13
  551. package/lib/typescript/src/renderer/components/Blend.d.ts +4 -9
  552. package/lib/typescript/src/renderer/components/Drawing.d.ts +2 -6
  553. package/lib/typescript/src/renderer/components/Group.d.ts +4 -9
  554. package/lib/typescript/src/renderer/components/Paint.d.ts +4 -8
  555. package/lib/typescript/src/renderer/components/Picture.d.ts +3 -5
  556. package/lib/typescript/src/renderer/components/backdrop/BackdropBlur.d.ts +2 -1
  557. package/lib/typescript/src/renderer/components/backdrop/BackdropFilter.d.ts +3 -3
  558. package/lib/typescript/src/renderer/components/colorFilters/BlendColor.d.ts +4 -10
  559. package/lib/typescript/src/renderer/components/colorFilters/Lerp.d.ts +4 -7
  560. package/lib/typescript/src/renderer/components/colorFilters/LinearToSRGBGamma.d.ts +3 -4
  561. package/lib/typescript/src/renderer/components/colorFilters/LumaColorFilter.d.ts +3 -4
  562. package/lib/typescript/src/renderer/components/colorFilters/Matrix.d.ts +4 -8
  563. package/lib/typescript/src/renderer/components/colorFilters/SRGBToLinearGamma.d.ts +3 -4
  564. package/lib/typescript/src/renderer/components/image/Image.d.ts +3 -11
  565. package/lib/typescript/src/renderer/components/image/ImageSVG.d.ts +2 -5
  566. package/lib/typescript/src/renderer/components/image/ImageShader.d.ts +3 -15
  567. package/lib/typescript/src/renderer/components/image/index.d.ts +0 -1
  568. package/lib/typescript/src/renderer/components/imageFilters/Blur.d.ts +4 -10
  569. package/lib/typescript/src/renderer/components/imageFilters/DisplacementMap.d.ts +4 -10
  570. package/lib/typescript/src/renderer/components/imageFilters/Morphology.d.ts +4 -8
  571. package/lib/typescript/src/renderer/components/imageFilters/Offset.d.ts +4 -8
  572. package/lib/typescript/src/renderer/components/imageFilters/RuntimeShader.d.ts +3 -7
  573. package/lib/typescript/src/renderer/components/imageFilters/Shadow.d.ts +3 -11
  574. package/lib/typescript/src/renderer/components/index.d.ts +0 -1
  575. package/lib/typescript/src/renderer/components/maskFilters/Blur.d.ts +3 -9
  576. package/lib/typescript/src/renderer/components/pathEffects/Corner.d.ts +4 -7
  577. package/lib/typescript/src/renderer/components/pathEffects/Dash.d.ts +4 -8
  578. package/lib/typescript/src/renderer/components/pathEffects/Discrete.d.ts +4 -9
  579. package/lib/typescript/src/renderer/components/pathEffects/Line2D.d.ts +4 -9
  580. package/lib/typescript/src/renderer/components/pathEffects/Path1D.d.ts +4 -13
  581. package/lib/typescript/src/renderer/components/pathEffects/Path2D.d.ts +4 -10
  582. package/lib/typescript/src/renderer/components/pathEffects/Sum.d.ts +3 -6
  583. package/lib/typescript/src/renderer/components/shaders/Color.d.ts +3 -6
  584. package/lib/typescript/src/renderer/components/shaders/FractalNoise.d.ts +3 -10
  585. package/lib/typescript/src/renderer/components/shaders/LinearGradient.d.ts +3 -8
  586. package/lib/typescript/src/renderer/components/shaders/RadialGradient.d.ts +3 -8
  587. package/lib/typescript/src/renderer/components/shaders/Shader.d.ts +4 -9
  588. package/lib/typescript/src/renderer/components/shaders/SweepGradient.d.ts +3 -9
  589. package/lib/typescript/src/renderer/components/shaders/Turbulence.d.ts +3 -10
  590. package/lib/typescript/src/renderer/components/shaders/TwoPointConicalGradient.d.ts +3 -10
  591. package/lib/typescript/src/renderer/components/shapes/Box.d.ts +4 -21
  592. package/lib/typescript/src/renderer/components/shapes/Circle.d.ts +3 -3
  593. package/lib/typescript/src/renderer/components/shapes/DiffRect.d.ts +3 -8
  594. package/lib/typescript/src/renderer/components/shapes/Fill.d.ts +3 -4
  595. package/lib/typescript/src/renderer/components/shapes/FitBox.d.ts +1 -1
  596. package/lib/typescript/src/renderer/components/shapes/Line.d.ts +3 -7
  597. package/lib/typescript/src/renderer/components/shapes/Oval.d.ts +3 -3
  598. package/lib/typescript/src/renderer/components/shapes/Patch.d.ts +3 -20
  599. package/lib/typescript/src/renderer/components/shapes/Path.d.ts +3 -16
  600. package/lib/typescript/src/renderer/components/shapes/Points.d.ts +3 -9
  601. package/lib/typescript/src/renderer/components/shapes/Rect.d.ts +3 -3
  602. package/lib/typescript/src/renderer/components/shapes/RoundedRect.d.ts +3 -3
  603. package/lib/typescript/src/renderer/components/shapes/Vertices.d.ts +3 -12
  604. package/lib/typescript/src/renderer/components/text/Glyphs.d.ts +3 -13
  605. package/lib/typescript/src/renderer/components/text/Text.d.ts +3 -8
  606. package/lib/typescript/src/renderer/components/text/TextBlob.d.ts +3 -8
  607. package/lib/typescript/src/renderer/components/text/TextPath.d.ts +3 -9
  608. package/lib/typescript/src/renderer/index.d.ts +0 -1
  609. package/lib/typescript/src/renderer/processors/Animations/Animations.d.ts +1 -0
  610. package/lib/typescript/src/renderer/processors/index.d.ts +0 -9
  611. package/package.json +1 -1
  612. package/src/dom/nodes/DrawingNode.ts +72 -0
  613. package/src/dom/nodes/GroupNode.ts +23 -0
  614. package/src/dom/nodes/JsiSkDOM.ts +353 -0
  615. package/src/dom/nodes/Node.ts +158 -0
  616. package/src/dom/nodes/PaintContext.ts +30 -0
  617. package/src/dom/nodes/PaintNode.ts +77 -0
  618. package/src/dom/nodes/RenderNode.ts +349 -0
  619. package/src/{renderer/processors/Circles.ts → dom/nodes/datatypes/Circle.ts} +3 -15
  620. package/src/{renderer/processors → dom/nodes/datatypes}/Color.ts +1 -1
  621. package/src/dom/nodes/datatypes/Enum.ts +2 -0
  622. package/src/{renderer/components/image/BoxFit.ts → dom/nodes/datatypes/Fitting.ts} +2 -11
  623. package/src/dom/nodes/datatypes/Gradient.ts +48 -0
  624. package/src/{renderer/processors/Paths.ts → dom/nodes/datatypes/Path.ts} +3 -4
  625. package/src/{renderer/processors → dom/nodes/datatypes}/Radius.ts +2 -3
  626. package/src/{renderer/processors/Rects.ts → dom/nodes/datatypes/Rect.ts} +2 -16
  627. package/src/dom/nodes/datatypes/Transform.ts +26 -0
  628. package/src/dom/nodes/datatypes/index.ts +9 -0
  629. package/src/dom/nodes/drawings/BackdropFilterNode.ts +30 -0
  630. package/src/dom/nodes/drawings/Box.ts +105 -0
  631. package/src/dom/nodes/drawings/CircleNode.ts +24 -0
  632. package/src/dom/nodes/drawings/CustomDrawingNode.ts +21 -0
  633. package/src/dom/nodes/drawings/DiffRectNode.ts +19 -0
  634. package/src/dom/nodes/drawings/FillNode.ts +18 -0
  635. package/src/dom/nodes/drawings/ImageNode.ts +40 -0
  636. package/src/dom/nodes/drawings/ImageSVG.ts +24 -0
  637. package/src/dom/nodes/drawings/LineNode.ts +19 -0
  638. package/src/dom/nodes/drawings/OvalNode.ts +23 -0
  639. package/src/dom/nodes/drawings/PatchNode.ts +68 -0
  640. package/src/dom/nodes/drawings/PathNode.ts +42 -0
  641. package/src/dom/nodes/drawings/PictureNode.ts +19 -0
  642. package/src/dom/nodes/drawings/PointsNode.ts +21 -0
  643. package/src/dom/nodes/drawings/RRectNode.ts +25 -0
  644. package/src/dom/nodes/drawings/RectNode.ts +23 -0
  645. package/src/dom/nodes/drawings/Text.ts +122 -0
  646. package/src/dom/nodes/drawings/VerticesNode.ts +35 -0
  647. package/src/dom/nodes/drawings/index.ts +18 -0
  648. package/src/dom/nodes/index.ts +3 -0
  649. package/src/dom/nodes/paint/BlendNode.ts +79 -0
  650. package/src/dom/nodes/paint/ColorFilters.ts +130 -0
  651. package/src/dom/nodes/paint/ImageFilters.ts +210 -0
  652. package/src/dom/nodes/paint/MaskFilters.ts +25 -0
  653. package/src/dom/nodes/paint/PathEffects.ts +192 -0
  654. package/src/dom/nodes/paint/Shaders.ts +228 -0
  655. package/src/dom/nodes/paint/index.ts +6 -0
  656. package/src/dom/types/ColorFilters.ts +16 -0
  657. package/src/dom/types/Common.ts +90 -0
  658. package/src/dom/types/DrawingContext.ts +7 -0
  659. package/src/dom/types/Drawings.ts +157 -0
  660. package/src/dom/types/ImageFilters.ts +53 -0
  661. package/src/dom/types/MaskFilters.ts +9 -0
  662. package/src/dom/types/Node.ts +46 -0
  663. package/src/dom/types/NodeType.ts +80 -0
  664. package/src/dom/types/PathEffects.ts +35 -0
  665. package/src/dom/types/Shaders.ts +86 -0
  666. package/src/dom/types/SkDOM.ts +202 -0
  667. package/src/dom/types/index.ts +11 -0
  668. package/src/index.ts +2 -0
  669. package/src/renderer/Canvas.tsx +7 -6
  670. package/src/renderer/Container.tsx +31 -0
  671. package/src/renderer/DependencyManager.tsx +23 -15
  672. package/src/renderer/HostComponents.ts +269 -0
  673. package/src/renderer/HostConfig.ts +60 -123
  674. package/src/renderer/components/Blend.tsx +4 -45
  675. package/src/renderer/components/Drawing.tsx +3 -12
  676. package/src/renderer/components/Group.tsx +4 -79
  677. package/src/renderer/components/Paint.tsx +7 -24
  678. package/src/renderer/components/Picture.tsx +4 -13
  679. package/src/renderer/components/backdrop/BackdropBlur.tsx +2 -1
  680. package/src/renderer/components/backdrop/BackdropFilter.tsx +5 -29
  681. package/src/renderer/components/colorFilters/BlendColor.tsx +4 -26
  682. package/src/renderer/components/colorFilters/Lerp.tsx +4 -23
  683. package/src/renderer/components/colorFilters/LinearToSRGBGamma.tsx +4 -16
  684. package/src/renderer/components/colorFilters/LumaColorFilter.tsx +4 -14
  685. package/src/renderer/components/colorFilters/Matrix.tsx +4 -19
  686. package/src/renderer/components/colorFilters/SRGBToLinearGamma.tsx +4 -16
  687. package/src/renderer/components/image/Image.tsx +4 -40
  688. package/src/renderer/components/image/ImageSVG.tsx +3 -19
  689. package/src/renderer/components/image/ImageShader.tsx +4 -69
  690. package/src/renderer/components/image/index.ts +0 -1
  691. package/src/renderer/components/imageFilters/Blur.tsx +4 -29
  692. package/src/renderer/components/imageFilters/DisplacementMap.tsx +6 -30
  693. package/src/renderer/components/imageFilters/Morphology.tsx +4 -25
  694. package/src/renderer/components/imageFilters/Offset.tsx +4 -19
  695. package/src/renderer/components/imageFilters/RuntimeShader.tsx +6 -27
  696. package/src/renderer/components/imageFilters/Shadow.tsx +4 -38
  697. package/src/renderer/components/index.ts +0 -1
  698. package/src/renderer/components/maskFilters/Blur.tsx +4 -23
  699. package/src/renderer/components/pathEffects/Corner.tsx +4 -27
  700. package/src/renderer/components/pathEffects/Dash.tsx +4 -23
  701. package/src/renderer/components/pathEffects/Discrete.tsx +4 -24
  702. package/src/renderer/components/pathEffects/Line2D.tsx +4 -29
  703. package/src/renderer/components/pathEffects/Path1D.tsx +4 -39
  704. package/src/renderer/components/pathEffects/Path2D.tsx +4 -31
  705. package/src/renderer/components/pathEffects/Sum.tsx +3 -17
  706. package/src/renderer/components/shaders/Color.tsx +4 -16
  707. package/src/renderer/components/shaders/FractalNoise.tsx +4 -26
  708. package/src/renderer/components/shaders/LinearGradient.tsx +4 -29
  709. package/src/renderer/components/shaders/RadialGradient.tsx +4 -29
  710. package/src/renderer/components/shaders/Shader.tsx +4 -24
  711. package/src/renderer/components/shaders/SweepGradient.tsx +4 -32
  712. package/src/renderer/components/shaders/Turbulence.tsx +4 -26
  713. package/src/renderer/components/shaders/TwoPointConicalGradient.tsx +4 -33
  714. package/src/renderer/components/shapes/Box.tsx +6 -109
  715. package/src/renderer/components/shapes/Circle.tsx +4 -16
  716. package/src/renderer/components/shapes/DiffRect.tsx +4 -17
  717. package/src/renderer/components/shapes/Fill.tsx +4 -11
  718. package/src/renderer/components/shapes/FitBox.tsx +2 -2
  719. package/src/renderer/components/shapes/Line.tsx +4 -13
  720. package/src/renderer/components/shapes/Oval.tsx +4 -18
  721. package/src/renderer/components/shapes/Patch.tsx +4 -59
  722. package/src/renderer/components/shapes/Path.tsx +4 -48
  723. package/src/renderer/components/shapes/Points.tsx +4 -20
  724. package/src/renderer/components/shapes/Rect.tsx +4 -18
  725. package/src/renderer/components/shapes/RoundedRect.tsx +4 -17
  726. package/src/renderer/components/shapes/Vertices.tsx +4 -37
  727. package/src/renderer/components/text/Glyphs.tsx +4 -39
  728. package/src/renderer/components/text/Text.tsx +4 -22
  729. package/src/renderer/components/text/TextBlob.tsx +4 -17
  730. package/src/renderer/components/text/TextPath.tsx +4 -59
  731. package/src/renderer/index.ts +0 -1
  732. package/src/renderer/processors/Animations/Animations.ts +5 -0
  733. package/src/renderer/processors/index.ts +0 -9
  734. package/src/web/WithSkiaWeb.tsx +3 -1
  735. package/lib/commonjs/renderer/components/Compose.js +0 -40
  736. package/lib/commonjs/renderer/components/Compose.js.map +0 -1
  737. package/lib/commonjs/renderer/components/colorFilters/Compose.js +0 -24
  738. package/lib/commonjs/renderer/components/colorFilters/Compose.js.map +0 -1
  739. package/lib/commonjs/renderer/components/imageFilters/InnerShadow.js +0 -28
  740. package/lib/commonjs/renderer/components/imageFilters/InnerShadow.js.map +0 -1
  741. package/lib/commonjs/renderer/components/imageFilters/getInput.js +0 -33
  742. package/lib/commonjs/renderer/components/imageFilters/getInput.js.map +0 -1
  743. package/lib/commonjs/renderer/components/shaders/Gradient.js +0 -32
  744. package/lib/commonjs/renderer/components/shaders/Gradient.js.map +0 -1
  745. package/lib/commonjs/renderer/nodes/Container.js +0 -28
  746. package/lib/commonjs/renderer/nodes/Container.js.map +0 -1
  747. package/lib/commonjs/renderer/nodes/Declaration.js +0 -57
  748. package/lib/commonjs/renderer/nodes/Declaration.js.map +0 -1
  749. package/lib/commonjs/renderer/nodes/Drawing.js +0 -56
  750. package/lib/commonjs/renderer/nodes/Drawing.js.map +0 -1
  751. package/lib/commonjs/renderer/nodes/Node.js +0 -73
  752. package/lib/commonjs/renderer/nodes/Node.js.map +0 -1
  753. package/lib/commonjs/renderer/nodes/index.js +0 -58
  754. package/lib/commonjs/renderer/nodes/index.js.map +0 -1
  755. package/lib/commonjs/renderer/processors/Circles.js.map +0 -1
  756. package/lib/commonjs/renderer/processors/Clips.js +0 -24
  757. package/lib/commonjs/renderer/processors/Clips.js.map +0 -1
  758. package/lib/commonjs/renderer/processors/Font.js +0 -13
  759. package/lib/commonjs/renderer/processors/Font.js.map +0 -1
  760. package/lib/commonjs/renderer/processors/Paint.js +0 -98
  761. package/lib/commonjs/renderer/processors/Paint.js.map +0 -1
  762. package/lib/commonjs/renderer/processors/Paths.js.map +0 -1
  763. package/lib/commonjs/renderer/processors/Radius.js.map +0 -1
  764. package/lib/commonjs/renderer/processors/Rects.js.map +0 -1
  765. package/lib/commonjs/renderer/processors/Transform.js +0 -58
  766. package/lib/commonjs/renderer/processors/Transform.js.map +0 -1
  767. package/lib/module/renderer/components/Compose.js +0 -25
  768. package/lib/module/renderer/components/Compose.js.map +0 -1
  769. package/lib/module/renderer/components/colorFilters/Compose.js +0 -14
  770. package/lib/module/renderer/components/colorFilters/Compose.js.map +0 -1
  771. package/lib/module/renderer/components/imageFilters/InnerShadow.js +0 -17
  772. package/lib/module/renderer/components/imageFilters/InnerShadow.js.map +0 -1
  773. package/lib/module/renderer/components/imageFilters/getInput.js +0 -23
  774. package/lib/module/renderer/components/imageFilters/getInput.js.map +0 -1
  775. package/lib/module/renderer/components/shaders/Gradient.js +0 -20
  776. package/lib/module/renderer/components/shaders/Gradient.js.map +0 -1
  777. package/lib/module/renderer/nodes/Container.js +0 -18
  778. package/lib/module/renderer/nodes/Container.js.map +0 -1
  779. package/lib/module/renderer/nodes/Declaration.js +0 -36
  780. package/lib/module/renderer/nodes/Declaration.js.map +0 -1
  781. package/lib/module/renderer/nodes/Drawing.js +0 -37
  782. package/lib/module/renderer/nodes/Drawing.js.map +0 -1
  783. package/lib/module/renderer/nodes/Node.js +0 -63
  784. package/lib/module/renderer/nodes/Node.js.map +0 -1
  785. package/lib/module/renderer/nodes/index.js +0 -5
  786. package/lib/module/renderer/nodes/index.js.map +0 -1
  787. package/lib/module/renderer/processors/Circles.js.map +0 -1
  788. package/lib/module/renderer/processors/Clips.js +0 -13
  789. package/lib/module/renderer/processors/Clips.js.map +0 -1
  790. package/lib/module/renderer/processors/Font.js +0 -4
  791. package/lib/module/renderer/processors/Font.js.map +0 -1
  792. package/lib/module/renderer/processors/Paint.js +0 -84
  793. package/lib/module/renderer/processors/Paint.js.map +0 -1
  794. package/lib/module/renderer/processors/Paths.js.map +0 -1
  795. package/lib/module/renderer/processors/Radius.js.map +0 -1
  796. package/lib/module/renderer/processors/Rects.js.map +0 -1
  797. package/lib/module/renderer/processors/Transform.js +0 -42
  798. package/lib/module/renderer/processors/Transform.js.map +0 -1
  799. package/lib/typescript/src/renderer/components/Compose.d.ts +0 -6
  800. package/lib/typescript/src/renderer/components/colorFilters/Compose.d.ts +0 -3
  801. package/lib/typescript/src/renderer/components/imageFilters/InnerShadow.d.ts +0 -2
  802. package/lib/typescript/src/renderer/components/imageFilters/getInput.d.ts +0 -3
  803. package/lib/typescript/src/renderer/components/shaders/Gradient.d.ts +0 -17
  804. package/lib/typescript/src/renderer/nodes/Container.d.ts +0 -8
  805. package/lib/typescript/src/renderer/nodes/Declaration.d.ts +0 -22
  806. package/lib/typescript/src/renderer/nodes/Drawing.d.ts +0 -21
  807. package/lib/typescript/src/renderer/nodes/Node.d.ts +0 -24
  808. package/lib/typescript/src/renderer/nodes/index.d.ts +0 -4
  809. package/lib/typescript/src/renderer/processors/Circles.d.ts +0 -13
  810. package/lib/typescript/src/renderer/processors/Clips.d.ts +0 -4
  811. package/lib/typescript/src/renderer/processors/Font.d.ts +0 -7
  812. package/lib/typescript/src/renderer/processors/Paint.d.ts +0 -22
  813. package/lib/typescript/src/renderer/processors/Paths.d.ts +0 -4
  814. package/lib/typescript/src/renderer/processors/Radius.d.ts +0 -3
  815. package/lib/typescript/src/renderer/processors/Rects.d.ts +0 -20
  816. package/src/renderer/components/Compose.tsx +0 -26
  817. package/src/renderer/components/colorFilters/Compose.ts +0 -18
  818. package/src/renderer/components/imageFilters/InnerShadow.tsx +0 -38
  819. package/src/renderer/components/imageFilters/getInput.ts +0 -20
  820. package/src/renderer/components/shaders/Gradient.ts +0 -24
  821. package/src/renderer/nodes/Container.tsx +0 -17
  822. package/src/renderer/nodes/Declaration.tsx +0 -65
  823. package/src/renderer/nodes/Drawing.tsx +0 -65
  824. package/src/renderer/nodes/Node.ts +0 -59
  825. package/src/renderer/nodes/index.ts +0 -4
  826. package/src/renderer/processors/Clips.ts +0 -23
  827. package/src/renderer/processors/Font.ts +0 -8
  828. package/src/renderer/processors/Paint.ts +0 -118
  829. package/src/renderer/processors/Transform.ts +0 -50
@@ -5,10 +5,14 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.skHostConfig = exports.debug = void 0;
7
7
 
8
- var _nodes = require("./nodes");
8
+ var _HostComponents = require("./HostComponents");
9
+
10
+ var _processors = require("./processors");
9
11
 
10
12
  var _typeddash = require("./typeddash");
11
13
 
14
+ /* eslint-disable @typescript-eslint/no-explicit-any */
15
+
12
16
  /*global NodeJS*/
13
17
  const DEBUG = false;
14
18
 
@@ -20,102 +24,16 @@ const debug = function () {
20
24
 
21
25
  exports.debug = debug;
22
26
 
23
- const allChildrenAreMemoized = node => {
24
- if (!node.memoizable) {
25
- return false;
26
- }
27
-
28
- for (const child of node.children) {
29
- if (!child.memoized) {
30
- return false;
31
- }
32
- }
33
-
34
- return true;
35
- };
36
-
37
- const bustBranchMemoization = parent => {
38
- if (parent.memoizable) {
39
- let ancestor = parent;
40
-
41
- while (ancestor) {
42
- ancestor.memoized = null;
43
- ancestor = ancestor.parent;
44
- }
45
- }
46
- };
47
-
48
- const bustBranchMemoizable = parent => {
49
- if (parent.memoizable) {
50
- let ancestor = parent;
51
-
52
- while (ancestor) {
53
- ancestor.memoizable = false;
54
- ancestor = ancestor.parent;
55
- }
56
- }
57
- };
58
-
59
27
  const appendNode = (parent, child) => {
60
- child.parent = parent;
61
- bustBranchMemoization(parent);
62
-
63
- if (!child.memoizable) {
64
- bustBranchMemoizable(parent);
65
- }
66
-
67
- if (!parent.memoizable) {
68
- child.memoizable = false;
69
- }
70
-
71
- parent.children.push(child);
28
+ parent.addChild(child);
72
29
  };
73
30
 
74
31
  const removeNode = (parent, child) => {
75
- bustBranchMemoization(parent);
76
- const index = parent.children.indexOf(child);
77
- parent.children.splice(index, 1);
78
- child.depMgr.unsubscribeNode(child); // unsubscribe to all children as well
79
-
80
- for (const c of child.children) {
81
- removeNode(child, c);
82
- }
32
+ return parent.removeChild(child);
83
33
  };
84
34
 
85
35
  const insertBefore = (parent, child, before) => {
86
- bustBranchMemoization(parent);
87
- const index = parent.children.indexOf(child);
88
-
89
- if (index !== -1) {
90
- parent.children.splice(index, 1);
91
- }
92
-
93
- const beforeIndex = parent.children.indexOf(before);
94
- parent.children.splice(beforeIndex, 0, child);
95
- };
96
-
97
- const createNode = (container, type, props) => {
98
- switch (type) {
99
- case _nodes.NodeType.Drawing:
100
- const {
101
- onDraw,
102
- skipProcessing,
103
- ...p1
104
- } = props;
105
- return new _nodes.DrawingNode(container.depMgr, onDraw, skipProcessing, p1);
106
-
107
- case _nodes.NodeType.Declaration:
108
- const {
109
- onDeclare,
110
- ...p2
111
- } = props;
112
- return new _nodes.DeclarationNode(container.depMgr, onDeclare, p2);
113
-
114
- default:
115
- // TODO: here we need to throw a nice error message
116
- // This is the error that will show up when the user uses nodes not supported by Skia (View, Audio, etc)
117
- return (0, _typeddash.exhaustiveCheck)(type);
118
- }
36
+ parent.insertChildBefore(child, before);
119
37
  };
120
38
 
121
39
  const skHostConfig = {
@@ -134,7 +52,7 @@ const skHostConfig = {
134
52
 
135
53
  appendChildToContainer(container, child) {
136
54
  debug("appendChildToContainer", container, child);
137
- appendNode(container, child);
55
+ appendNode(container.root, child);
138
56
  },
139
57
 
140
58
  appendChild(parent, child) {
@@ -162,9 +80,13 @@ const skHostConfig = {
162
80
  throw new Error("Text nodes are not supported yet");
163
81
  },
164
82
 
165
- createInstance(type, props, container, _hostContext, _internalInstanceHandle) {
83
+ createInstance(type, pristineProps, container, _hostContext, _internalInstanceHandle) {
166
84
  debug("createInstance", type);
167
- return createNode(container, type, props);
85
+ const props = { ...pristineProps
86
+ };
87
+ const node = (0, _HostComponents.createNode)(container, type, materialize(props));
88
+ container.depMgr.subscribeNode(node, props);
89
+ return node;
168
90
  },
169
91
 
170
92
  appendInitialChild(parentInstance, child) {
@@ -187,10 +109,6 @@ const skHostConfig = {
187
109
  return null;
188
110
  },
189
111
 
190
- finalizeContainerChildren: () => {
191
- debug("finalizeContainerChildren");
192
- },
193
-
194
112
  resetAfterCommit(container) {
195
113
  debug("resetAfterCommit");
196
114
  container.redraw();
@@ -201,50 +119,39 @@ const skHostConfig = {
201
119
  return node;
202
120
  },
203
121
 
204
- prepareUpdate: (instance, type, oldProps, newProps, _rootContainerInstance, _hostContext) => {
122
+ prepareUpdate: (_instance, type, oldProps, newProps, rootContainerInstance, _hostContext) => {
205
123
  debug("prepareUpdate");
206
124
  const propsAreEqual = (0, _typeddash.shallowEq)(oldProps, newProps);
207
125
 
208
- if (propsAreEqual && !instance.memoizable) {
126
+ if (propsAreEqual) {
209
127
  return null;
210
128
  }
211
129
 
212
130
  debug("update ", type);
213
- return true;
131
+ return rootContainerInstance;
214
132
  },
215
133
 
216
- commitUpdate(instance, _updatePayload, type, prevProps, nextProps, _internalHandle) {
134
+ commitUpdate(instance, updatePayload, type, prevProps, nextProps, _internalHandle) {
217
135
  debug("commitUpdate: ", type);
218
136
 
219
- if ((0, _typeddash.shallowEq)(prevProps, nextProps) && allChildrenAreMemoized(instance)) {
137
+ if ((0, _typeddash.shallowEq)(prevProps, nextProps)) {
220
138
  return;
221
139
  }
222
140
 
223
- bustBranchMemoization(instance);
224
-
225
- if (instance instanceof _nodes.DrawingNode) {
226
- const {
227
- onDraw,
228
- skipProcessing,
229
- ...props
230
- } = nextProps;
231
- instance.props = props;
232
- } else if (instance instanceof _nodes.DeclarationNode) {
233
- const {
234
- onDeclare,
235
- ...props
236
- } = nextProps;
237
- instance.props = props;
238
- } else {
239
- throw new Error("Unsupported instance commitUpdate " + instance.constructor.name);
240
- }
141
+ const props = { ...nextProps
142
+ };
143
+ updatePayload.depMgr.unsubscribeNode(instance);
144
+ instance.setProps(materialize(props));
145
+ updatePayload.depMgr.subscribeNode(instance, props);
241
146
  },
242
147
 
243
148
  commitTextUpdate: (_textInstance, _oldText, _newText) => {// textInstance.instance = newText;
244
149
  },
245
150
  clearContainer: container => {
246
151
  debug("clearContainer");
247
- container.children.splice(0);
152
+ container.root.children().forEach(child => {
153
+ container.root.removeChild(child);
154
+ });
248
155
  },
249
156
  preparePortalMount: () => {
250
157
  debug("preparePortalMount");
@@ -252,15 +159,30 @@ const skHostConfig = {
252
159
  removeChild: (parent, child) => {
253
160
  removeNode(parent, child);
254
161
  },
255
- removeChildFromContainer: (parent, child) => {
256
- removeNode(parent, child);
162
+ removeChildFromContainer: (container, child) => {
163
+ removeNode(container.root, child);
257
164
  },
258
- insertInContainerBefore: (parent, child, before) => {
259
- insertBefore(parent, child, before);
165
+ insertInContainerBefore: (container, child, before) => {
166
+ insertBefore(container.root, child, before);
260
167
  },
261
168
  insertBefore: (parent, child, before) => {
262
169
  insertBefore(parent, child, before);
263
170
  }
264
171
  };
265
172
  exports.skHostConfig = skHostConfig;
173
+
174
+ const materialize = props => {
175
+ const result = { ...props
176
+ };
177
+ (0, _typeddash.mapKeys)(props).forEach(key => {
178
+ const prop = props[key];
179
+
180
+ if ((0, _processors.isValue)(prop)) {
181
+ result[key] = prop.current;
182
+ } else if ((0, _processors.isSelector)(prop)) {
183
+ result[key] = prop.selector(prop.value.current);
184
+ }
185
+ });
186
+ return result;
187
+ };
266
188
  //# sourceMappingURL=HostConfig.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["HostConfig.ts"],"names":["DEBUG","debug","console","log","allChildrenAreMemoized","node","memoizable","child","children","memoized","bustBranchMemoization","parent","ancestor","bustBranchMemoizable","appendNode","push","removeNode","index","indexOf","splice","depMgr","unsubscribeNode","c","insertBefore","before","beforeIndex","createNode","container","type","props","NodeType","Drawing","onDraw","skipProcessing","p1","DrawingNode","Declaration","onDeclare","p2","DeclarationNode","skHostConfig","now","Date","supportsMutation","isPrimaryRenderer","supportsPersistence","supportsHydration","scheduleTimeout","setTimeout","cancelTimeout","clearTimeout","noTimeout","appendChildToContainer","appendChild","getRootHostContext","_rootContainerInstance","getChildHostContext","_parentHostContext","_type","shouldSetTextContent","_props","createTextInstance","_text","_hostContext","_internalInstanceHandle","Error","createInstance","appendInitialChild","parentInstance","finalizeInitialChildren","commitMount","prepareForCommit","_containerInfo","finalizeContainerChildren","resetAfterCommit","redraw","getPublicInstance","prepareUpdate","instance","oldProps","newProps","propsAreEqual","commitUpdate","_updatePayload","prevProps","nextProps","_internalHandle","constructor","name","commitTextUpdate","_textInstance","_oldText","_newText","clearContainer","preparePortalMount","removeChild","removeChildFromContainer","insertInContainerBefore"],"mappings":";;;;;;;AAIA;;AACA;;AALA;AAOA,MAAMA,KAAK,GAAG,KAAd;;AACO,MAAMC,KAAK,GAAG,YAA6C;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,EAAgBiB,MAAhB,CAAZ;AACD;AAhLyC,CAArC","sourcesContent":["/*global NodeJS*/\nimport type { HostConfig } from \"react-reconciler\";\n\nimport type { Node, Container, DeclarationProps, DrawingProps } from \"./nodes\";\nimport { DeclarationNode, DrawingNode, NodeType } from \"./nodes\";\nimport { exhaustiveCheck, shallowEq } from \"./typeddash\";\n\nconst DEBUG = false;\nexport const debug = (...args: Parameters<typeof console.log>) => {\n if (DEBUG) {\n console.log(...args);\n }\n};\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace JSX {\n interface IntrinsicElements {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n skDeclaration: DeclarationProps<any>;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n skDrawing: DrawingProps<any>;\n }\n }\n}\n\ntype Instance = Node;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype Props = any;\ntype TextInstance = Node;\ntype SuspenseInstance = Instance;\ntype HydratableInstance = Instance;\ntype PublicInstance = Instance;\ntype HostContext = null;\ntype UpdatePayload = true;\ntype ChildSet = unknown;\ntype TimeoutHandle = NodeJS.Timeout;\ntype NoTimeout = -1;\n\ntype SkiaHostConfig = HostConfig<\n NodeType,\n Props,\n Container,\n Instance,\n TextInstance,\n SuspenseInstance,\n HydratableInstance,\n PublicInstance,\n HostContext,\n UpdatePayload,\n ChildSet,\n TimeoutHandle,\n NoTimeout\n>;\n\nconst allChildrenAreMemoized = (node: Instance) => {\n if (!node.memoizable) {\n return false;\n }\n for (const child of node.children) {\n if (!child.memoized) {\n return false;\n }\n }\n return true;\n};\n\nconst bustBranchMemoization = (parent: Node) => {\n if (parent.memoizable) {\n let ancestor: Node | undefined = parent;\n while (ancestor) {\n ancestor.memoized = null;\n ancestor = ancestor.parent;\n }\n }\n};\n\nconst bustBranchMemoizable = (parent: Node) => {\n if (parent.memoizable) {\n let ancestor: Node | undefined = parent;\n while (ancestor) {\n ancestor.memoizable = false;\n ancestor = ancestor.parent;\n }\n }\n};\n\nconst appendNode = (parent: Node, child: Node) => {\n child.parent = parent;\n bustBranchMemoization(parent);\n if (!child.memoizable) {\n bustBranchMemoizable(parent);\n }\n if (!parent.memoizable) {\n child.memoizable = false;\n }\n parent.children.push(child);\n};\n\nconst removeNode = (parent: Node, child: Node) => {\n bustBranchMemoization(parent);\n const index = parent.children.indexOf(child);\n parent.children.splice(index, 1);\n child.depMgr.unsubscribeNode(child);\n // unsubscribe to all children as well\n for (const c of child.children) {\n removeNode(child, c);\n }\n};\n\nconst insertBefore = (parent: Node, child: Node, before: Node) => {\n bustBranchMemoization(parent);\n const index = parent.children.indexOf(child);\n if (index !== -1) {\n parent.children.splice(index, 1);\n }\n const beforeIndex = parent.children.indexOf(before);\n parent.children.splice(beforeIndex, 0, child);\n};\n\nconst createNode = (container: Container, type: NodeType, props: Props) => {\n switch (type) {\n case NodeType.Drawing:\n const { onDraw, skipProcessing, ...p1 } = props;\n return new DrawingNode(container.depMgr, onDraw, skipProcessing, p1);\n case NodeType.Declaration:\n const { onDeclare, ...p2 } = props;\n return new DeclarationNode(container.depMgr, onDeclare, p2);\n default:\n // TODO: here we need to throw a nice error message\n // This is the error that will show up when the user uses nodes not supported by Skia (View, Audio, etc)\n return exhaustiveCheck(type);\n }\n};\n\nexport const skHostConfig: SkiaHostConfig = {\n /**\n * This function is used by the reconciler in order to calculate current time for prioritising work.\n */\n now: Date.now,\n\n supportsMutation: true,\n isPrimaryRenderer: false,\n supportsPersistence: false,\n supportsHydration: false,\n //supportsMicrotask: true,\n\n scheduleTimeout: setTimeout,\n cancelTimeout: clearTimeout,\n noTimeout: -1,\n\n appendChildToContainer(container, child) {\n debug(\"appendChildToContainer\", container, child);\n appendNode(container, child);\n },\n\n appendChild(parent, child) {\n debug(\"appendChild\", parent, child);\n appendNode(parent, child);\n },\n\n getRootHostContext: (_rootContainerInstance: Node) => {\n debug(\"getRootHostContext\");\n return null;\n },\n\n getChildHostContext(_parentHostContext, _type, _rootContainerInstance) {\n debug(\"getChildHostContext\");\n return null;\n },\n\n shouldSetTextContent(_type, _props) {\n return false;\n },\n\n createTextInstance(\n _text,\n _rootContainerInstance,\n _hostContext,\n _internalInstanceHandle\n ) {\n debug(\"createTextInstance\");\n // return SpanNode({}, text) as SkNode;\n throw new Error(\"Text nodes are not supported yet\");\n },\n\n createInstance(\n type,\n props,\n container,\n _hostContext,\n _internalInstanceHandle\n ) {\n debug(\"createInstance\", type);\n return createNode(container, type, props) as Node;\n },\n\n appendInitialChild(parentInstance, child) {\n debug(\"appendInitialChild\");\n appendNode(parentInstance, child);\n },\n\n finalizeInitialChildren(\n parentInstance,\n _type,\n _props,\n _rootContainerInstance,\n _hostContext\n ) {\n debug(\"finalizeInitialChildren\", parentInstance);\n return false;\n },\n\n commitMount() {\n // if finalizeInitialChildren = true\n debug(\"commitMount\");\n },\n\n prepareForCommit(_containerInfo) {\n debug(\"prepareForCommit\");\n return null;\n },\n\n finalizeContainerChildren: () => {\n debug(\"finalizeContainerChildren\");\n },\n\n resetAfterCommit(container) {\n debug(\"resetAfterCommit\");\n container.redraw();\n },\n\n getPublicInstance(node: Instance) {\n debug(\"getPublicInstance\");\n return node;\n },\n\n prepareUpdate: (\n instance,\n type,\n oldProps,\n newProps,\n _rootContainerInstance,\n _hostContext\n ) => {\n debug(\"prepareUpdate\");\n const propsAreEqual = shallowEq(oldProps, newProps);\n if (propsAreEqual && !instance.memoizable) {\n return null;\n }\n debug(\"update \", type);\n return true;\n },\n\n commitUpdate(\n instance,\n _updatePayload,\n type,\n prevProps,\n nextProps,\n _internalHandle\n ) {\n debug(\"commitUpdate: \", type);\n if (shallowEq(prevProps, nextProps) && allChildrenAreMemoized(instance)) {\n return;\n }\n bustBranchMemoization(instance);\n if (instance instanceof DrawingNode) {\n const { onDraw, skipProcessing, ...props } = nextProps;\n instance.props = props;\n } else if (instance instanceof DeclarationNode) {\n const { onDeclare, ...props } = nextProps;\n instance.props = props;\n } else {\n throw new Error(\n \"Unsupported instance commitUpdate \" + instance.constructor.name\n );\n }\n },\n\n commitTextUpdate: (\n _textInstance: TextInstance,\n _oldText: string,\n _newText: string\n ) => {\n // textInstance.instance = newText;\n },\n\n clearContainer: (container) => {\n debug(\"clearContainer\");\n container.children.splice(0);\n },\n\n preparePortalMount: () => {\n debug(\"preparePortalMount\");\n },\n\n removeChild: (parent, child) => {\n removeNode(parent, child);\n },\n\n removeChildFromContainer: (parent, child) => {\n removeNode(parent, child);\n },\n\n insertInContainerBefore: (parent, child, before) => {\n insertBefore(parent, child, before);\n },\n\n insertBefore: (parent, child, before) => {\n insertBefore(parent, child, before);\n },\n};\n"]}
1
+ {"version":3,"sources":["HostConfig.ts"],"names":["DEBUG","debug","console","log","appendNode","parent","child","addChild","removeNode","removeChild","insertBefore","before","insertChildBefore","skHostConfig","now","Date","supportsMutation","isPrimaryRenderer","supportsPersistence","supportsHydration","scheduleTimeout","setTimeout","cancelTimeout","clearTimeout","noTimeout","appendChildToContainer","container","root","appendChild","getRootHostContext","_rootContainerInstance","getChildHostContext","_parentHostContext","_type","shouldSetTextContent","_props","createTextInstance","_text","_hostContext","_internalInstanceHandle","Error","createInstance","type","pristineProps","props","node","materialize","depMgr","subscribeNode","appendInitialChild","parentInstance","finalizeInitialChildren","commitMount","prepareForCommit","_containerInfo","resetAfterCommit","redraw","getPublicInstance","prepareUpdate","_instance","oldProps","newProps","rootContainerInstance","propsAreEqual","commitUpdate","instance","updatePayload","prevProps","nextProps","_internalHandle","unsubscribeNode","setProps","commitTextUpdate","_textInstance","_oldText","_newText","clearContainer","children","forEach","preparePortalMount","removeChildFromContainer","insertInContainerBefore","result","key","prop","current","selector","value"],"mappings":";;;;;;;AAQA;;AAEA;;AACA;;AAXA;;AACA;AAYA,MAAMA,KAAK,GAAG,KAAd;;AACO,MAAMC,KAAK,GAAG,YAA6C;AAChE,MAAID,KAAJ,EAAW;AACTE,IAAAA,OAAO,CAACC,GAAR,CAAY,YAAZ;AACD;AACF,CAJM;;;;AAmCP,MAAMC,UAA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AClD,QAAMsC,MAAM,GAAG,EAAE,GAAGtC;AAAL,GAAf;AACA,0BAAQA,KAAR,EAAekC,OAAf,CAAwBK,GAAD,IAAS;AAC9B,UAAMC,IAAI,GAAGxC,KAAK,CAACuC,GAAD,CAAlB;;AACA,QAAI,yBAAQC,IAAR,CAAJ,EAAmB;AACjBF,MAAAA,MAAM,CAACC,GAAD,CAAN,GAAeC,IAAD,CAAmCC,OAAjD;AACD,KAFD,MAEO,IAAI,4BAAWD,IAAX,CAAJ,EAAsB;AAC3BF,MAAAA,MAAM,CAACC,GAAD,CAAN,GAAcC,IAAI,CAACE,QAAL,CAAcF,IAAI,CAACG,KAAL,CAAWF,OAAzB,CAAd;AACD;AACF,GAPD;AASA,SAAOH,MAAP;AACD,CAZD","sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/*global NodeJS*/\nimport type { HostConfig } from \"react-reconciler\";\n\nimport type { NodeType, Node } from \"../dom/types\";\nimport type { SkiaValue } from \"../values\";\n\nimport type { Container } from \"./Container\";\nimport { createNode } from \"./HostComponents\";\nimport type { AnimatedProps } from \"./processors\";\nimport { isSelector, isValue } from \"./processors\";\nimport { mapKeys, shallowEq } from \"./typeddash\";\n\nconst DEBUG = false;\nexport const debug = (...args: Parameters<typeof console.log>) => {\n if (DEBUG) {\n console.log(...args);\n }\n};\n\ntype Instance = Node<unknown>;\n\ntype Props = any;\ntype TextInstance = Node<unknown>;\ntype SuspenseInstance = Instance;\ntype HydratableInstance = Instance;\ntype PublicInstance = Instance;\ntype HostContext = null;\ntype UpdatePayload = Container;\ntype ChildSet = unknown;\ntype TimeoutHandle = NodeJS.Timeout;\ntype NoTimeout = -1;\n\ntype SkiaHostConfig = HostConfig<\n NodeType,\n Props,\n Container,\n Instance,\n TextInstance,\n SuspenseInstance,\n HydratableInstance,\n PublicInstance,\n HostContext,\n UpdatePayload,\n ChildSet,\n TimeoutHandle,\n NoTimeout\n>;\n\nconst appendNode = (parent: Node<unknown>, child: Node<unknown>) => {\n parent.addChild(child);\n};\n\nconst removeNode = (parent: Node<unknown>, child: Node<unknown>) => {\n return parent.removeChild(child);\n};\n\nconst insertBefore = (\n parent: Node<unknown>,\n child: Node<unknown>,\n before: Node<unknown>\n) => {\n parent.insertChildBefore(child, before);\n};\n\nexport const skHostConfig: SkiaHostConfig = {\n /**\n * This function is used by the reconciler in order to calculate current time for prioritising work.\n */\n now: Date.now,\n\n supportsMutation: true,\n isPrimaryRenderer: false,\n supportsPersistence: false,\n supportsHydration: false,\n //supportsMicrotask: true,\n\n scheduleTimeout: setTimeout,\n cancelTimeout: clearTimeout,\n noTimeout: -1,\n\n appendChildToContainer(container, child) {\n debug(\"appendChildToContainer\", container, child);\n appendNode(container.root, child);\n },\n\n appendChild(parent, child) {\n debug(\"appendChild\", parent, child);\n appendNode(parent, child);\n },\n\n getRootHostContext: (_rootContainerInstance: Container) => {\n debug(\"getRootHostContext\");\n return null;\n },\n\n getChildHostContext(_parentHostContext, _type, _rootContainerInstance) {\n debug(\"getChildHostContext\");\n return null;\n },\n\n shouldSetTextContent(_type, _props) {\n return false;\n },\n\n createTextInstance(\n _text,\n _rootContainerInstance,\n _hostContext,\n _internalInstanceHandle\n ) {\n debug(\"createTextInstance\");\n // return SpanNode({}, text) as SkNode;\n throw new Error(\"Text nodes are not supported yet\");\n },\n\n createInstance(\n type,\n pristineProps,\n container,\n _hostContext,\n _internalInstanceHandle\n ) {\n debug(\"createInstance\", type);\n const props = { ...pristineProps };\n const node = createNode(container, type, materialize(props));\n container.depMgr.subscribeNode(node, props);\n return node;\n },\n\n appendInitialChild(parentInstance, child) {\n debug(\"appendInitialChild\");\n appendNode(parentInstance, child);\n },\n\n finalizeInitialChildren(\n parentInstance,\n _type,\n _props,\n _rootContainerInstance,\n _hostContext\n ) {\n debug(\"finalizeInitialChildren\", parentInstance);\n return false;\n },\n\n commitMount() {\n // if finalizeInitialChildren = true\n debug(\"commitMount\");\n },\n\n prepareForCommit(_containerInfo) {\n debug(\"prepareForCommit\");\n return null;\n },\n\n resetAfterCommit(container) {\n debug(\"resetAfterCommit\");\n container.redraw();\n },\n\n getPublicInstance(node: Instance) {\n debug(\"getPublicInstance\");\n return node;\n },\n\n prepareUpdate: (\n _instance,\n type,\n oldProps,\n newProps,\n rootContainerInstance,\n _hostContext\n ) => {\n debug(\"prepareUpdate\");\n const propsAreEqual = shallowEq(oldProps, newProps);\n if (propsAreEqual) {\n return null;\n }\n debug(\"update \", type);\n return rootContainerInstance;\n },\n\n commitUpdate(\n instance,\n updatePayload,\n type,\n prevProps,\n nextProps,\n _internalHandle\n ) {\n debug(\"commitUpdate: \", type);\n if (shallowEq(prevProps, nextProps)) {\n return;\n }\n const props = { ...nextProps };\n updatePayload.depMgr.unsubscribeNode(instance);\n instance.setProps(materialize(props));\n updatePayload.depMgr.subscribeNode(instance, props);\n },\n\n commitTextUpdate: (\n _textInstance: TextInstance,\n _oldText: string,\n _newText: string\n ) => {\n // textInstance.instance = newText;\n },\n\n clearContainer: (container) => {\n debug(\"clearContainer\");\n container.root.children().forEach((child) => {\n container.root.removeChild(child);\n });\n },\n\n preparePortalMount: () => {\n debug(\"preparePortalMount\");\n },\n\n removeChild: (parent, child) => {\n removeNode(parent, child);\n },\n\n removeChildFromContainer: (container, child) => {\n removeNode(container.root, child);\n },\n\n insertInContainerBefore: (container, child, before) => {\n insertBefore(container.root, child, before);\n },\n\n insertBefore: (parent, child, before) => {\n insertBefore(parent, child, before);\n },\n};\n\nconst materialize = <P>(props: AnimatedProps<P>) => {\n const result = { ...props };\n mapKeys(props).forEach((key) => {\n const prop = props[key];\n if (isValue(prop)) {\n result[key] = (prop as SkiaValue<P[typeof key]>).current;\n } else if (isSelector(prop)) {\n result[key] = prop.selector(prop.value.current) as P[typeof key];\n }\n });\n\n return result as any;\n};\n"]}
@@ -7,55 +7,10 @@ exports.Blend = void 0;
7
7
 
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
 
10
- var _types = require("../../skia/types");
11
-
12
- var _nodes = require("../nodes");
13
-
14
- var _Paint = require("../processors/Paint");
15
-
16
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
11
 
18
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
19
-
20
- const childrenAreImageFilters = children => children.every(child => (0, _types.isImageFilter)(child));
21
-
22
- const childrenAreShaders = children => children.every(child => (0, _types.isShader)(child));
23
-
24
- const onDeclare = (0, _nodes.createDeclaration)((_ref, children, _ref2) => {
25
- let {
26
- mode
27
- } = _ref;
28
- let {
29
- Skia
30
- } = _ref2;
31
-
32
- const blend = _types.BlendMode[(0, _Paint.enumKey)(mode)];
33
-
34
- if (childrenAreImageFilters(children)) {
35
- return children.reverse().reduce((inner, outer) => {
36
- if (inner === null) {
37
- return outer;
38
- }
39
-
40
- return Skia.ImageFilter.MakeBlend(blend, outer, inner);
41
- }, null);
42
- } else if (childrenAreShaders(children)) {
43
- return children.reverse().reduce((inner, outer) => {
44
- if (inner === null) {
45
- return outer;
46
- }
47
-
48
- return Skia.Shader.MakeBlend(blend, outer, inner);
49
- }, null);
50
- }
51
-
52
- throw new Error("<Blend /> can only blend Shaders or ImageFilters");
53
- });
54
-
55
12
  const Blend = props => {
56
- return /*#__PURE__*/_react.default.createElement("skDeclaration", _extends({
57
- onDeclare: onDeclare
58
- }, props));
13
+ return /*#__PURE__*/_react.default.createElement("skBlend", props);
59
14
  };
60
15
 
61
16
  exports.Blend = Blend;
@@ -1 +1 @@
1
- {"version":3,"sources":["Blend.tsx"],"names":["childrenAreImageFilters","children","every","child","childrenAreShaders","onDeclare","mode","Skia","blend","BlendMode","reverse","reduce","inner","outer","ImageFilter","MakeBlend","Shader","Error","Blend","props"],"mappings":";;;;;;;AACA;;AAGA;;AACA;;AAEA;;;;;;AAGA,MAAMA,uBAAuB,GAC3BC,QAD8B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cesContent":["import type { ReactNode } from \"react\";\nimport React from \"react\";\n\nimport type { SkImageFilter, SkShader } from \"../../skia/types\";\nimport { isImageFilter, BlendMode, isShader } from \"../../skia/types\";\nimport { createDeclaration } from \"../nodes\";\nimport type { AnimatedProps, SkEnum } from \"../processors\";\nimport { enumKey } from \"../processors/Paint\";\nimport type { DeclarationResult } from \"../nodes/Declaration\";\n\nconst childrenAreImageFilters = (\n children: DeclarationResult[]\n): children is SkImageFilter[] =>\n children.every((child) => isImageFilter(child));\n\nconst childrenAreShaders = (\n children: DeclarationResult[]\n): children is SkShader[] => children.every((child) => isShader(child));\n\ninterface BlendProps {\n mode: SkEnum<typeof BlendMode>;\n children?: ReactNode | ReactNode[];\n}\n\nconst onDeclare = createDeclaration<BlendProps>(\n ({ mode }, children, { Skia }) => {\n const blend = BlendMode[enumKey(mode)];\n if (childrenAreImageFilters(children)) {\n return children.reverse().reduce<SkImageFilter | null>((inner, outer) => {\n if (inner === null) {\n return outer;\n }\n return Skia.ImageFilter.MakeBlend(blend, outer, inner);\n }, null);\n } else if (childrenAreShaders(children)) {\n return children.reverse().reduce<SkShader | null>((inner, outer) => {\n if (inner === null) {\n return outer;\n }\n return Skia.Shader.MakeBlend(blend, outer, inner);\n }, null);\n }\n throw new Error(\"<Blend /> can only blend Shaders or ImageFilters\");\n }\n);\n\nexport const Blend = (props: AnimatedProps<BlendProps>) => {\n return <skDeclaration onDeclare={onDeclare} {...props} />;\n};\n"]}
1
+ {"version":3,"sources":["Blend.tsx"],"names":["Blend","props"],"mappings":";;;;;;;AAAA;;;;AAKO,MAAMA,KAAK,GAAIC,KAAD,IAAkC;AACrD,sBAAO,wCAAaA,KAAb,CAAP;AACD,CAFM","sourcesContent":["import React from \"react\";\n\nimport type { BlendProps } from \"../../dom/types\";\nimport type { SkiaProps } from \"../processors\";\n\nexport const Blend = (props: SkiaProps<BlendProps>) => {\n return <skBlend {...props} />;\n};\n"]}
@@ -7,24 +7,10 @@ exports.Drawing = void 0;
7
7
 
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
 
10
- var _Drawing = require("../nodes/Drawing");
11
-
12
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
11
 
14
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
15
-
16
- const onDraw = (0, _Drawing.createDrawing)((ctx, _ref) => {
17
- let {
18
- drawing
19
- } = _ref;
20
- drawing(ctx);
21
- });
22
-
23
12
  const Drawing = props => {
24
- return /*#__PURE__*/_react.default.createElement("skDrawing", _extends({
25
- onDraw: onDraw,
26
- skipProcessing: true
27
- }, props));
13
+ return /*#__PURE__*/_react.default.createElement("skDrawing", props);
28
14
  };
29
15
 
30
16
  exports.Drawing = Drawing;
@@ -1 +1 @@
1
- {"version":3,"sources":["Drawing.tsx"],"names":["onDraw","ctx","drawing","Drawing","props"],"mappings":";;;;;;;AAAA;;AAGA;;;;;;AAMA,MAAMA,MAAM,GAAG,4BAA4B,CAACC,GAAD,WAAsB;AAAA,MAAhB;AAAEC,IAAAA;AAAF,GAAgB;AAC/DA,EAAAA,OAAO,CAACD,GAAD,CAAP;AACD,CAFc,CAAf;;AAIO,MAAME,OAAO,GAAIC,KAAD,IAAyB;AAC9C,sBAAO;AAAW,IAAA,MAAM,EAAEJ,MAAnB;AAA2B,IAAA,cAAc;AAAzC,KAA8CI,KAA9C,EAAP;AACD,CAFM","sourcesContent":["import React from \"react\";\n\nimport type { DrawingContext } from \"../DrawingContext\";\nimport { createDrawing } from \"../nodes/Drawing\";\n\ninterface DrawingProps {\n drawing: (ctx: DrawingContext) => void;\n}\n\nconst onDraw = createDrawing<DrawingProps>((ctx, { drawing }) => {\n drawing(ctx);\n});\n\nexport const Drawing = (props: DrawingProps) => {\n return <skDrawing onDraw={onDraw} skipProcessing {...props} />;\n};\n"]}
1
+ {"version":3,"sources":["Drawing.tsx"],"names":["Drawing","props"],"mappings":";;;;;;;AAAA;;;;AAIO,MAAMA,OAAO,GAAIC,KAAD,IAAmC;AACxD,sBAAO,0CAAeA,KAAf,CAAP;AACD,CAFM","sourcesContent":["import React from \"react\";\n\nimport type { CustomDrawingNodeProps } from \"../../dom/types\";\n\nexport const Drawing = (props: CustomDrawingNodeProps) => {\n return <skDrawing {...props} />;\n};\n"]}
@@ -7,78 +7,10 @@ exports.Group = void 0;
7
7
 
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
 
10
- var _types = require("../../skia/types");
11
-
12
- var _processors = require("../processors");
13
-
14
- var _nodes = require("../nodes");
15
-
16
- var _Declaration = require("../nodes/Declaration");
17
-
18
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
11
 
20
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
21
-
22
- const isSkPaint = obj => "__typename__" in obj && obj.__typename__ === "Paint";
23
-
24
- const onDraw = (0, _nodes.createDrawing)((ctx, _ref, node) => {
25
- let {
26
- layer,
27
- clip,
28
- invertClip,
29
- ...groupProps
30
- } = _ref;
31
- const {
32
- canvas,
33
- opacity,
34
- Skia
35
- } = ctx;
36
- const declarations = node.children.filter(_Declaration.isDeclarationNode).map(child => child.draw(ctx));
37
- const drawings = node.children.filter(child => child instanceof _nodes.DrawingNode);
38
- const paint = (0, _processors.processPaint)(ctx.Skia, ctx.paint.copy(), opacity, groupProps, declarations);
39
- const hasTransform = !!groupProps.transform || !!groupProps.matrix;
40
- const hasClip = !!clip;
41
- const shouldSave = hasTransform || hasClip || !!layer;
42
-
43
- if (shouldSave) {
44
- if (layer) {
45
- if (typeof layer === "boolean") {
46
- canvas.saveLayer();
47
- } else if (isSkPaint(layer)) {
48
- canvas.saveLayer(layer);
49
- } else {
50
- var _layer$current;
51
-
52
- canvas.saveLayer((_layer$current = layer.current) !== null && _layer$current !== void 0 ? _layer$current : undefined);
53
- }
54
- } else {
55
- canvas.save();
56
- }
57
-
58
- (0, _processors.processCanvasTransform)(canvas, groupProps);
59
-
60
- if (clip) {
61
- const op = invertClip ? _types.ClipOp.Difference : _types.ClipOp.Intersect;
62
- (0, _processors.processClip)(Skia, canvas, clip, op);
63
- }
64
- }
65
-
66
- node.visit({ ...ctx,
67
- paint,
68
- opacity: groupProps.opacity ? groupProps.opacity * opacity : opacity
69
- }, drawings);
70
-
71
- if (shouldSave) {
72
- canvas.restore();
73
- }
74
- });
75
-
76
12
  const Group = props => {
77
- return /*#__PURE__*/_react.default.createElement("skDrawing", _extends({
78
- onDraw: onDraw
79
- }, props, {
80
- skipProcessing: true
81
- }));
13
+ return /*#__PURE__*/_react.default.createElement("skGroup", props);
82
14
  };
83
15
 
84
16
  exports.Group = Group;
@@ -1 +1 @@
1
- {"version":3,"sources":["Group.tsx"],"names":["isSkPaint","obj","__typename__","onDraw","ctx","node","layer","clip","invertClip","groupProps","canvas","opacity","Skia","declarations","children","filter","isDeclarationNode","map","child","draw","drawings","DrawingNode","paint","copy","hasTransform","transform","matrix","hasClip","shouldSave","saveLayer","current","undefined","save","op","ClipOp","Difference","Intersect","visit","restore","Group","props"],"mappings":";;;;;;;AAAA;;AAIA;;AACA;;AAWA;;AACA;;;;;;AAEA,MAAMA,SAAS,GAAIC,GAAD,IAChB,kBAAkBA,GAAlB,IAAyBA,GAAG,CAACC,YAAJ,KAAqB,OADhD;;AASA,MAAMC,MAAM,GAAG,0BACb,CAACC,GAAD,QAAkDC,IAAlD,KAA2D;AAAA,MAArD;AAAEC,IAAAA,KAAF;AAASC,IAAAA,IAAT;AAAeC,IAAAA,UAAf;AAA2B,OAAGC;AAA9B,GAAqD;AACzD,QAAM;AAAEC,IAAAA,MAAF;AAAUC,IAAAA,OAAV;AAAmBC,IAAAA;AAAnB,MAA4BR,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0B,EAAhC;AACD;AACF;;AACD5B,EAAAA,IAAI,CAACgC,KAAL,CACE,EACE,GAAGjC,GADL;AAEEkB,IAAAA,KAFF;AAGEX,IAAAA,OAAO,EAAEF,UAAU,CAACE,OAAX,GAAqBF,UAAU,CAACE,OAAX,GAAqBA,OAA1C,GAAoDA;AAH/D,GADF,EAMES,QANF;;AAQA,MAAIQ,UAAJ,EAAgB;AACdlB,IAAAA,MAAM,CAAC4B,OAAP;AACD;AACF,CAjDY,CAAf;;AAoDO,MAAMC,KAAK,GAAIC,KAAD,IAAsC;AACzD,sBAAO;AAAW,IAAA,MAAM,EAAErC;AAAnB,KAA+BqC,KAA/B;AAAsC,IAAA,cAAc;AAApD,KAAP;AACD,CAFM","sourcesContent":["import React from \"react\";\nimport type { RefObject } from \"react\";\n\nimport type { SkPaint } from \"../../skia/types\";\nimport { ClipOp } from \"../../skia/types\";\nimport {\n processCanvasTransform,\n processPaint,\n processClip,\n} from \"../processors\";\nimport type {\n CustomPaintProps,\n TransformProps,\n AnimatedProps,\n ClipDef,\n} from \"../processors\";\nimport { createDrawing, DrawingNode } from \"../nodes\";\nimport { isDeclarationNode } from \"../nodes/Declaration\";\n\nconst isSkPaint = (obj: RefObject<SkPaint> | SkPaint): obj is SkPaint =>\n \"__typename__\" in obj && obj.__typename__ === \"Paint\";\n\nexport interface GroupProps extends CustomPaintProps, TransformProps {\n clip?: ClipDef;\n invertClip?: boolean;\n layer?: RefObject<SkPaint> | SkPaint | boolean;\n}\n\nconst onDraw = createDrawing<GroupProps>(\n (ctx, { layer, clip, invertClip, ...groupProps }, node) => {\n const { canvas, opacity, Skia } = ctx;\n const declarations = node.children\n .filter(isDeclarationNode)\n .map((child) => child.draw(ctx));\n\n const drawings = node.children.filter(\n (child) => child instanceof DrawingNode\n );\n const paint = processPaint(\n ctx.Skia,\n ctx.paint.copy(),\n opacity,\n groupProps,\n declarations\n );\n const hasTransform = !!groupProps.transform || !!groupProps.matrix;\n const hasClip = !!clip;\n const shouldSave = hasTransform || hasClip || !!layer;\n if (shouldSave) {\n if (layer) {\n if (typeof layer === \"boolean\") {\n canvas.saveLayer();\n } else if (isSkPaint(layer)) {\n canvas.saveLayer(layer);\n } else {\n canvas.saveLayer(layer.current ?? undefined);\n }\n } else {\n canvas.save();\n }\n processCanvasTransform(canvas, groupProps);\n if (clip) {\n const op = invertClip ? ClipOp.Difference : ClipOp.Intersect;\n processClip(Skia, canvas, clip, op);\n }\n }\n node.visit(\n {\n ...ctx,\n paint,\n opacity: groupProps.opacity ? groupProps.opacity * opacity : opacity,\n },\n drawings\n );\n if (shouldSave) {\n canvas.restore();\n }\n }\n);\n\nexport const Group = (props: AnimatedProps<GroupProps>) => {\n return <skDrawing onDraw={onDraw} {...props} skipProcessing />;\n};\n"]}
1
+ {"version":3,"sources":["Group.tsx"],"names":["Group","props"],"mappings":";;;;;;;AAAA;;;;AAKO,MAAMA,KAAK,GAAIC,KAAD,IAAkC;AACrD,sBAAO,wCAAaA,KAAb,CAAP;AACD,CAFM","sourcesContent":["import React from \"react\";\n\nimport type { SkiaProps } from \"../processors\";\nimport type { GroupProps } from \"../../dom/types\";\n\nexport const Group = (props: SkiaProps<GroupProps>) => {\n return <skGroup {...props} />;\n};\n"]}
@@ -7,12 +7,6 @@ exports.usePaintRef = exports.Paint = void 0;
7
7
 
8
8
  var _react = _interopRequireWildcard(require("react"));
9
9
 
10
- var _processors = require("../processors");
11
-
12
- var _nodes = require("../nodes");
13
-
14
- var _useCanvas = require("../useCanvas");
15
-
16
10
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
17
11
 
18
12
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -23,14 +17,8 @@ const usePaintRef = () => (0, _react.useRef)(null);
23
17
 
24
18
  exports.usePaintRef = usePaintRef;
25
19
  const Paint = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
26
- const {
27
- Skia
28
- } = (0, _useCanvas.useCanvas)();
29
- const paint = (0, _react.useMemo)(() => Skia.Paint(), [Skia]);
30
- (0, _react.useImperativeHandle)(ref, () => paint, [paint]);
31
- const onDeclare = (0, _react.useMemo)(() => (0, _nodes.createDeclaration)((paintProps, children, ctx) => (0, _processors.processPaint)(ctx.Skia, paint, ctx.opacity, paintProps, children)), [paint]);
32
- return /*#__PURE__*/_react.default.createElement("skDeclaration", _extends({
33
- onDeclare: onDeclare
20
+ return /*#__PURE__*/_react.default.createElement("skPaint", _extends({
21
+ ref: ref
34
22
  }, props));
35
23
  });
36
24
  exports.Paint = Paint;
@@ -1 +1 @@
1
- {"version":3,"sources":["Paint.tsx"],"names":["usePaintRef","Paint","props","ref","Skia","paint","onDeclare","paintProps","children","ctx","opacity"],"mappings":";;;;;;;AACA;;AAIA;;AACA;;AACA;;;;;;;;AAEO,MAAMA,WAAW,GAAG,MAAM,mBAAgB,IAAhB,CAA1B;;;AAMA,MAAMC,KAAK,gBAAG,uBACnB,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACd,QAAM;AAAEC,IAAAA;AAAF,MAAW,2BAAjB;AACA,QAAMC,KAAK,GAAG,oBAAQ,MAAMD,IAAI,CAACH,KAAL,EAAd,EAA4B,CAACG,IAAD,CAA5B,CAAd;AACA,kCAAoBD,GAApB,EAAyB,MAAME,KAA/B,EAAsC,CAACA,KAAD,CAAtC;AACA,QAAMC,SAAS,GAAG,oBAChB,MACE,8BAA8B,CAACC,UAAD,EAAaC,QAAb,EAAuBC,GAAvB,KAC5B,8BAAaA,GAAG,CAACL,IAAjB,EAAuBC,KAAvB,EAA8BI,GAAG,CAACC,OAAlC,EAA2CH,UAA3C,EAAuDC,QAAvD,CADF,CAFc,EAKhB,CAACH,KAAD,CALgB,CAAlB;AAOA,sBAAO;AAAe,IAAA,SAAS,EAAEC;AAA1B,KAAyCJ,KAAzC,EAAP;AACD,CAbkB,CAAd","sourcesContent":["import type { ReactNode } from \"react\";\nimport React, { useRef, useMemo, forwardRef, useImperativeHandle } from \"react\";\n\nimport type { SkPaint } from \"../../skia/types\";\nimport type { CustomPaintProps, AnimatedProps } from \"../processors\";\nimport { processPaint } from \"../processors\";\nimport { createDeclaration } from \"../nodes\";\nimport { useCanvas } from \"../useCanvas\";\n\nexport const usePaintRef = () => useRef<SkPaint>(null);\n\nexport interface PaintProps extends Omit<CustomPaintProps, \"paint\"> {\n children?: ReactNode | ReactNode[];\n}\n\nexport const Paint = forwardRef<SkPaint, AnimatedProps<PaintProps>>(\n (props, ref) => {\n const { Skia } = useCanvas();\n const paint = useMemo(() => Skia.Paint(), [Skia]);\n useImperativeHandle(ref, () => paint, [paint]);\n const onDeclare = useMemo(\n () =>\n createDeclaration<PaintProps>((paintProps, children, ctx) =>\n processPaint(ctx.Skia, paint, ctx.opacity, paintProps, children)\n ),\n [paint]\n );\n return <skDeclaration onDeclare={onDeclare} {...props} />;\n }\n);\n"]}
1
+ {"version":3,"sources":["Paint.tsx"],"names":["usePaintRef","Paint","props","ref"],"mappings":";;;;;;;AAAA;;;;;;;;AAMO,MAAMA,WAAW,GAAG,MAAM,mBAAkB,IAAlB,CAA1B;;;AAEA,MAAMC,KAAK,gBAAG,uBACnB,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACd,sBAAO;AAAS,IAAA,GAAG,EAAEA;AAAd,KAAuBD,KAAvB,EAAP;AACD,CAHkB,CAAd","sourcesContent":["import React, { useRef, forwardRef } from \"react\";\n\nimport type { SkiaProps } from \"../processors\";\nimport type { DrawingNodeProps } from \"../../dom/types\";\nimport type { PaintNode } from \"../../dom/nodes/PaintNode\";\n\nexport const usePaintRef = () => useRef<PaintNode>(null);\n\nexport const Paint = forwardRef<PaintNode, SkiaProps<DrawingNodeProps>>(\n (props, ref) => {\n return <skPaint ref={ref} {...props} />;\n }\n);\n"]}
@@ -7,28 +7,10 @@ exports.Picture = void 0;
7
7
 
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
 
10
- var _Drawing = require("../nodes/Drawing");
11
-
12
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
11
 
14
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
15
-
16
- const onDraw = (0, _Drawing.createDrawing)((ctx, _ref) => {
17
- let {
18
- picture
19
- } = _ref;
20
- const {
21
- canvas
22
- } = ctx;
23
- canvas.drawPicture(picture);
24
- });
25
-
26
12
  const Picture = props => {
27
- return /*#__PURE__*/_react.default.createElement("skDrawing", _extends({
28
- onDraw: onDraw
29
- }, props, {
30
- skipProcessing: true
31
- }));
13
+ return /*#__PURE__*/_react.default.createElement("skPicture", props);
32
14
  };
33
15
 
34
16
  exports.Picture = Picture;
@@ -1 +1 @@
1
- {"version":3,"sources":["Picture.tsx"],"names":["onDraw","ctx","picture","canvas","drawPicture","Picture","props"],"mappings":";;;;;;;AAAA;;AAGA;;;;;;AAMA,MAAMA,MAAM,GAAG,4BAA4B,CAACC,GAAD,WAAsB;AAAA,MAAhB;AAAEC,IAAAA;AAAF,GAAgB;AAC/D,QAAM;AAAEC,IAAAA;AAAF,MAAaF,GAAnB;AACAE,EAAAA,MAAM,CAACC,WAAP,CAAmBF,OAAnB;AACD,CAHc,CAAf;;AAKO,MAAMG,OAAO,GAAIC,KAAD,IAAyB;AAC9C,sBAAO;AAAW,IAAA,MAAM,EAAEN;AAAnB,KAA+BM,KAA/B;AAAsC,IAAA,cAAc;AAApD,KAAP;AACD,CAFM","sourcesContent":["import React from \"react\";\n\nimport type { SkPicture } from \"../../skia/types\";\nimport { createDrawing } from \"../nodes/Drawing\";\n\nexport interface PictureProps {\n picture: SkPicture;\n}\n\nconst onDraw = createDrawing<PictureProps>((ctx, { picture }) => {\n const { canvas } = ctx;\n canvas.drawPicture(picture);\n});\n\nexport const Picture = (props: PictureProps) => {\n return <skDrawing onDraw={onDraw} {...props} skipProcessing />;\n};\n"]}
1
+ {"version":3,"sources":["Picture.tsx"],"names":["Picture","props"],"mappings":";;;;;;;AAAA;;;;AAKO,MAAMA,OAAO,GAAIC,KAAD,IAAoC;AACzD,sBAAO,0CAAeA,KAAf,CAAP;AACD,CAFM","sourcesContent":["import React from \"react\";\n\nimport type { PictureProps } from \"../../dom/types\";\nimport type { SkiaProps } from \"../processors\";\n\nexport const Picture = (props: SkiaProps<PictureProps>) => {\n return <skPicture {...props} />;\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["BackdropBlur.tsx"],"names":["BackdropBlur","blur","children","props"],"mappings":";;;;;;;AAAA;;AAEA;;AAIA;;;;;;AAMO,MAAMA,YAAY,GAAG,QAIY;AAAA,MAJX;AAC3BC,IAAAA,IAD2B;AAE3BC,IAAAA,QAF2B;AAG3B,OAAGC;AAHwB,GAIW;AACtC,sBACE,6BAAC,8BAAD;AAAgB,IAAA,MAAM,eAAE,6BAAC,kBAAD;AAAM,MAAA,IAAI,EAAEF,IAAZ;AAAkB,MAAA,IAAI,EAAC;AAAvB;AAAxB,KAA+DE,KAA/D,GACGD,QADH,CADF;AAKD,CAVM","sourcesContent":["import React from \"react\";\n\nimport { Blur } from \"../imageFilters\";\nimport type { AnimatedProps, Radius } from \"../../processors\";\n\nimport type { BackdropFilterProps } from \"./BackdropFilter\";\nimport { BackdropFilter } from \"./BackdropFilter\";\n\ninterface BackdropBlurProps extends Omit<BackdropFilterProps, \"filter\"> {\n blur: Radius;\n}\n\nexport const BackdropBlur = ({\n blur,\n children,\n ...props\n}: AnimatedProps<BackdropBlurProps>) => {\n return (\n <BackdropFilter filter={<Blur blur={blur} mode=\"clamp\" />} {...props}>\n {children}\n </BackdropFilter>\n );\n};\n"]}
1
+ {"version":3,"sources":["BackdropBlur.tsx"],"names":["BackdropBlur","blur","children","props"],"mappings":";;;;;;;AAAA;;AAEA;;AAKA;;;;;;AAMO,MAAMA,YAAY,GAAG,QAIY;AAAA,MAJX;AAC3BC,IAAAA,IAD2B;AAE3BC,IAAAA,QAF2B;AAG3B,OAAGC;AAHwB,GAIW;AACtC,sBACE,6BAAC,8BAAD;AAAgB,IAAA,MAAM,eAAE,6BAAC,kBAAD;AAAM,MAAA,IAAI,EAAEF,IAAZ;AAAkB,MAAA,IAAI,EAAC;AAAvB;AAAxB,KAA+DE,KAA/D,GACGD,QADH,CADF;AAKD,CAVM","sourcesContent":["import React from \"react\";\n\nimport { Blur } from \"../imageFilters\";\nimport type { AnimatedProps } from \"../../processors\";\nimport type { Radius } from \"../../../dom/types\";\n\nimport type { BackdropFilterProps } from \"./BackdropFilter\";\nimport { BackdropFilter } from \"./BackdropFilter\";\n\ninterface BackdropBlurProps extends Omit<BackdropFilterProps, \"filter\"> {\n blur: Radius;\n}\n\nexport const BackdropBlur = ({\n blur,\n children,\n ...props\n}: AnimatedProps<BackdropBlurProps>) => {\n return (\n <BackdropFilter filter={<Blur blur={blur} mode=\"clamp\" />} {...props}>\n {children}\n </BackdropFilter>\n );\n};\n"]}