@shopify/react-native-skia 0.1.163 → 0.1.165

Sign up to get free protection for your applications and to get access to all the features.
Files changed (303) hide show
  1. package/cpp/api/JsiSkPaint.h +6 -0
  2. package/cpp/api/JsiSkRuntimeEffect.h +7 -2
  3. package/cpp/jsi/JsiHostObject.h +25 -25
  4. package/cpp/rnskia/RNSkDomView.cpp +1 -1
  5. package/cpp/rnskia/RNSkPlatformContext.h +2 -6
  6. package/cpp/rnskia/dom/base/DrawingContext.cpp +23 -41
  7. package/cpp/rnskia/dom/base/DrawingContext.h +6 -19
  8. package/cpp/rnskia/dom/base/JsiDomDeclarationNode.h +12 -2
  9. package/cpp/rnskia/dom/base/JsiDomDrawingNode.h +4 -4
  10. package/cpp/rnskia/dom/base/JsiDomNode.h +68 -10
  11. package/cpp/rnskia/dom/base/JsiDomRenderNode.h +26 -61
  12. package/cpp/rnskia/dom/base/NodeProp.h +2 -1
  13. package/cpp/rnskia/dom/base/NodePropsContainer.h +10 -0
  14. package/cpp/rnskia/dom/nodes/JsiBlendNode.h +1 -2
  15. package/cpp/rnskia/dom/nodes/JsiBlurMaskNode.h +3 -6
  16. package/cpp/rnskia/dom/nodes/JsiBoxNode.h +2 -4
  17. package/cpp/rnskia/dom/nodes/JsiBoxShadowNode.h +1 -2
  18. package/cpp/rnskia/dom/nodes/JsiCircleNode.h +2 -5
  19. package/cpp/rnskia/dom/nodes/JsiColorFilterNodes.h +4 -8
  20. package/cpp/rnskia/dom/nodes/JsiCustomDrawingNode.h +2 -5
  21. package/cpp/rnskia/dom/nodes/JsiDiffRectNode.h +2 -7
  22. package/cpp/rnskia/dom/nodes/JsiGlyphsNode.h +4 -8
  23. package/cpp/rnskia/dom/nodes/JsiImageFilterNodes.h +20 -38
  24. package/cpp/rnskia/dom/nodes/JsiImageNode.h +1 -1
  25. package/cpp/rnskia/dom/nodes/JsiImageSvgNode.h +2 -4
  26. package/cpp/rnskia/dom/nodes/JsiLineNode.h +2 -7
  27. package/cpp/rnskia/dom/nodes/JsiOvalNode.h +1 -3
  28. package/cpp/rnskia/dom/nodes/JsiPaintNode.h +2 -3
  29. package/cpp/rnskia/dom/nodes/JsiPatchNode.h +4 -8
  30. package/cpp/rnskia/dom/nodes/JsiPathEffectNodes.h +14 -28
  31. package/cpp/rnskia/dom/nodes/JsiPathNode.h +6 -16
  32. package/cpp/rnskia/dom/nodes/JsiPictureNode.h +1 -2
  33. package/cpp/rnskia/dom/nodes/JsiPointsNode.h +2 -5
  34. package/cpp/rnskia/dom/nodes/JsiRRectNode.h +1 -2
  35. package/cpp/rnskia/dom/nodes/JsiRectNode.h +1 -2
  36. package/cpp/rnskia/dom/nodes/JsiShaderNodes.h +37 -69
  37. package/cpp/rnskia/dom/nodes/JsiTextBlobNode.h +3 -6
  38. package/cpp/rnskia/dom/nodes/JsiTextNode.h +4 -8
  39. package/cpp/rnskia/dom/nodes/JsiTextPathNode.h +1 -2
  40. package/cpp/rnskia/dom/nodes/JsiVerticesNode.h +2 -4
  41. package/cpp/rnskia/dom/props/CircleProp.h +2 -0
  42. package/cpp/rnskia/dom/props/ColorProp.h +9 -4
  43. package/cpp/rnskia/dom/props/ImageProps.h +3 -2
  44. package/cpp/rnskia/dom/props/PaintProps.h +15 -7
  45. package/cpp/rnskia/dom/props/RectProp.h +11 -4
  46. package/cpp/rnskia/dom/props/TransformProp.h +0 -2
  47. package/cpp/rnskia/dom/props/UniformsProp.h +86 -123
  48. package/cpp/rnskia/values/RNSkReadonlyValue.h +2 -6
  49. package/cpp/utils/RNSkLog.h +1 -1
  50. package/lib/commonjs/dom/nodes/RenderNode.js +12 -16
  51. package/lib/commonjs/dom/nodes/RenderNode.js.map +1 -1
  52. package/lib/commonjs/dom/nodes/datatypes/Circle.js +6 -1
  53. package/lib/commonjs/dom/nodes/datatypes/Circle.js.map +1 -1
  54. package/lib/commonjs/dom/nodes/datatypes/Rect.js +3 -3
  55. package/lib/commonjs/dom/nodes/datatypes/Rect.js.map +1 -1
  56. package/lib/commonjs/dom/nodes/datatypes/index.js +0 -13
  57. package/lib/commonjs/dom/nodes/datatypes/index.js.map +1 -1
  58. package/lib/commonjs/dom/nodes/drawings/Box.js +6 -6
  59. package/lib/commonjs/dom/nodes/drawings/Box.js.map +1 -1
  60. package/lib/commonjs/dom/nodes/drawings/ImageNode.js +2 -2
  61. package/lib/commonjs/dom/nodes/drawings/ImageNode.js.map +1 -1
  62. package/lib/commonjs/dom/nodes/drawings/PatchNode.js +3 -7
  63. package/lib/commonjs/dom/nodes/drawings/PatchNode.js.map +1 -1
  64. package/lib/commonjs/dom/nodes/drawings/VerticesNode.js +1 -1
  65. package/lib/commonjs/dom/nodes/drawings/VerticesNode.js.map +1 -1
  66. package/lib/commonjs/dom/nodes/paint/ColorFilters.js +1 -3
  67. package/lib/commonjs/dom/nodes/paint/ColorFilters.js.map +1 -1
  68. package/lib/commonjs/dom/nodes/paint/ImageFilters.js +1 -1
  69. package/lib/commonjs/dom/nodes/paint/ImageFilters.js.map +1 -1
  70. package/lib/commonjs/dom/nodes/paint/Shaders.js +1 -3
  71. package/lib/commonjs/dom/nodes/paint/Shaders.js.map +1 -1
  72. package/lib/commonjs/dom/types/Common.js.map +1 -1
  73. package/lib/commonjs/dom/types/DrawingContext.js.map +1 -1
  74. package/lib/commonjs/dom/types/Drawings.js.map +1 -1
  75. package/lib/commonjs/renderer/DrawingContext.js.map +1 -1
  76. package/lib/commonjs/renderer/components/Mask.js +2 -6
  77. package/lib/commonjs/renderer/components/Mask.js.map +1 -1
  78. package/lib/commonjs/renderer/components/image/Image.js +0 -5
  79. package/lib/commonjs/renderer/components/image/Image.js.map +1 -1
  80. package/lib/commonjs/renderer/components/image/ImageShader.js +20 -10
  81. package/lib/commonjs/renderer/components/image/ImageShader.js.map +1 -1
  82. package/lib/commonjs/renderer/components/imageFilters/Blur.js +10 -5
  83. package/lib/commonjs/renderer/components/imageFilters/Blur.js.map +1 -1
  84. package/lib/commonjs/renderer/components/imageFilters/Morphology.js +10 -5
  85. package/lib/commonjs/renderer/components/imageFilters/Morphology.js.map +1 -1
  86. package/lib/commonjs/renderer/components/imageFilters/Offset.js +12 -6
  87. package/lib/commonjs/renderer/components/imageFilters/Offset.js.map +1 -1
  88. package/lib/commonjs/renderer/components/maskFilters/Blur.js +12 -6
  89. package/lib/commonjs/renderer/components/maskFilters/Blur.js.map +1 -1
  90. package/lib/commonjs/renderer/components/pathEffects/Discrete.js +10 -5
  91. package/lib/commonjs/renderer/components/pathEffects/Discrete.js.map +1 -1
  92. package/lib/commonjs/renderer/components/shaders/FractalNoise.js +14 -7
  93. package/lib/commonjs/renderer/components/shaders/FractalNoise.js.map +1 -1
  94. package/lib/commonjs/renderer/components/shaders/Shader.js +10 -5
  95. package/lib/commonjs/renderer/components/shaders/Shader.js.map +1 -1
  96. package/lib/commonjs/renderer/components/shaders/Turbulence.js +14 -7
  97. package/lib/commonjs/renderer/components/shaders/Turbulence.js.map +1 -1
  98. package/lib/commonjs/renderer/components/shapes/Circle.js +0 -6
  99. package/lib/commonjs/renderer/components/shapes/Circle.js.map +1 -1
  100. package/lib/commonjs/renderer/components/shapes/FitBox.js +1 -4
  101. package/lib/commonjs/renderer/components/shapes/FitBox.js.map +1 -1
  102. package/lib/commonjs/renderer/components/shapes/Oval.js +0 -4
  103. package/lib/commonjs/renderer/components/shapes/Oval.js.map +1 -1
  104. package/lib/commonjs/renderer/components/shapes/Path.js +12 -6
  105. package/lib/commonjs/renderer/components/shapes/Path.js.map +1 -1
  106. package/lib/commonjs/renderer/components/shapes/Points.js +10 -5
  107. package/lib/commonjs/renderer/components/shapes/Points.js.map +1 -1
  108. package/lib/commonjs/renderer/components/shapes/RoundedRect.js +0 -3
  109. package/lib/commonjs/renderer/components/shapes/RoundedRect.js.map +1 -1
  110. package/lib/commonjs/renderer/components/shapes/Vertices.js +10 -5
  111. package/lib/commonjs/renderer/components/shapes/Vertices.js.map +1 -1
  112. package/lib/commonjs/renderer/components/text/Glyphs.js +12 -6
  113. package/lib/commonjs/renderer/components/text/Glyphs.js.map +1 -1
  114. package/lib/commonjs/renderer/components/text/Text.js +12 -6
  115. package/lib/commonjs/renderer/components/text/Text.js.map +1 -1
  116. package/lib/commonjs/renderer/components/text/TextBlob.js +12 -6
  117. package/lib/commonjs/renderer/components/text/TextBlob.js.map +1 -1
  118. package/lib/commonjs/renderer/components/text/TextPath.js +10 -5
  119. package/lib/commonjs/renderer/components/text/TextPath.js.map +1 -1
  120. package/lib/commonjs/renderer/processors/Animations/Animations.js.map +1 -1
  121. package/lib/commonjs/skia/types/Paint/Paint.js.map +1 -1
  122. package/lib/commonjs/skia/types/RuntimeEffect/RuntimeEffect.js.map +1 -1
  123. package/lib/commonjs/skia/types/Shader/Shader.js +3 -2
  124. package/lib/commonjs/skia/types/Shader/Shader.js.map +1 -1
  125. package/lib/commonjs/skia/web/JsiSkPaint.js +4 -0
  126. package/lib/commonjs/skia/web/JsiSkPaint.js.map +1 -1
  127. package/lib/commonjs/skia/web/JsiSkRuntimeEffect.js +6 -1
  128. package/lib/commonjs/skia/web/JsiSkRuntimeEffect.js.map +1 -1
  129. package/lib/commonjs/skia/web/JsiSkRuntimeEffectFactory.js +1 -1
  130. package/lib/commonjs/skia/web/JsiSkRuntimeEffectFactory.js.map +1 -1
  131. package/lib/commonjs/web/LoadSkiaWeb.js +1 -1
  132. package/lib/commonjs/web/LoadSkiaWeb.js.map +1 -1
  133. package/lib/module/dom/nodes/RenderNode.js +12 -16
  134. package/lib/module/dom/nodes/RenderNode.js.map +1 -1
  135. package/lib/module/dom/nodes/datatypes/Circle.js +8 -1
  136. package/lib/module/dom/nodes/datatypes/Circle.js.map +1 -1
  137. package/lib/module/dom/nodes/datatypes/Rect.js +7 -3
  138. package/lib/module/dom/nodes/datatypes/Rect.js.map +1 -1
  139. package/lib/module/dom/nodes/datatypes/index.js +0 -1
  140. package/lib/module/dom/nodes/datatypes/index.js.map +1 -1
  141. package/lib/module/dom/nodes/drawings/Box.js +6 -5
  142. package/lib/module/dom/nodes/drawings/Box.js.map +1 -1
  143. package/lib/module/dom/nodes/drawings/ImageNode.js +4 -2
  144. package/lib/module/dom/nodes/drawings/ImageNode.js.map +1 -1
  145. package/lib/module/dom/nodes/drawings/PatchNode.js +4 -8
  146. package/lib/module/dom/nodes/drawings/PatchNode.js.map +1 -1
  147. package/lib/module/dom/nodes/drawings/VerticesNode.js +2 -2
  148. package/lib/module/dom/nodes/drawings/VerticesNode.js.map +1 -1
  149. package/lib/module/dom/nodes/paint/ColorFilters.js +1 -2
  150. package/lib/module/dom/nodes/paint/ColorFilters.js.map +1 -1
  151. package/lib/module/dom/nodes/paint/ImageFilters.js +2 -2
  152. package/lib/module/dom/nodes/paint/ImageFilters.js.map +1 -1
  153. package/lib/module/dom/nodes/paint/Shaders.js +1 -2
  154. package/lib/module/dom/nodes/paint/Shaders.js.map +1 -1
  155. package/lib/module/dom/types/Common.js.map +1 -1
  156. package/lib/module/dom/types/DrawingContext.js.map +1 -1
  157. package/lib/module/dom/types/Drawings.js.map +1 -1
  158. package/lib/module/renderer/DrawingContext.js.map +1 -1
  159. package/lib/module/renderer/components/Mask.js +2 -6
  160. package/lib/module/renderer/components/Mask.js.map +1 -1
  161. package/lib/module/renderer/components/image/Image.js +0 -5
  162. package/lib/module/renderer/components/image/Image.js.map +1 -1
  163. package/lib/module/renderer/components/image/ImageShader.js +20 -10
  164. package/lib/module/renderer/components/image/ImageShader.js.map +1 -1
  165. package/lib/module/renderer/components/imageFilters/Blur.js +10 -5
  166. package/lib/module/renderer/components/imageFilters/Blur.js.map +1 -1
  167. package/lib/module/renderer/components/imageFilters/Morphology.js +10 -5
  168. package/lib/module/renderer/components/imageFilters/Morphology.js.map +1 -1
  169. package/lib/module/renderer/components/imageFilters/Offset.js +12 -6
  170. package/lib/module/renderer/components/imageFilters/Offset.js.map +1 -1
  171. package/lib/module/renderer/components/maskFilters/Blur.js +12 -6
  172. package/lib/module/renderer/components/maskFilters/Blur.js.map +1 -1
  173. package/lib/module/renderer/components/pathEffects/Discrete.js +10 -5
  174. package/lib/module/renderer/components/pathEffects/Discrete.js.map +1 -1
  175. package/lib/module/renderer/components/shaders/FractalNoise.js +14 -7
  176. package/lib/module/renderer/components/shaders/FractalNoise.js.map +1 -1
  177. package/lib/module/renderer/components/shaders/Shader.js +10 -5
  178. package/lib/module/renderer/components/shaders/Shader.js.map +1 -1
  179. package/lib/module/renderer/components/shaders/Turbulence.js +14 -7
  180. package/lib/module/renderer/components/shaders/Turbulence.js.map +1 -1
  181. package/lib/module/renderer/components/shapes/Circle.js +0 -6
  182. package/lib/module/renderer/components/shapes/Circle.js.map +1 -1
  183. package/lib/module/renderer/components/shapes/FitBox.js +1 -4
  184. package/lib/module/renderer/components/shapes/FitBox.js.map +1 -1
  185. package/lib/module/renderer/components/shapes/Oval.js +0 -4
  186. package/lib/module/renderer/components/shapes/Oval.js.map +1 -1
  187. package/lib/module/renderer/components/shapes/Path.js +12 -6
  188. package/lib/module/renderer/components/shapes/Path.js.map +1 -1
  189. package/lib/module/renderer/components/shapes/Points.js +10 -5
  190. package/lib/module/renderer/components/shapes/Points.js.map +1 -1
  191. package/lib/module/renderer/components/shapes/RoundedRect.js +0 -3
  192. package/lib/module/renderer/components/shapes/RoundedRect.js.map +1 -1
  193. package/lib/module/renderer/components/shapes/Vertices.js +10 -5
  194. package/lib/module/renderer/components/shapes/Vertices.js.map +1 -1
  195. package/lib/module/renderer/components/text/Glyphs.js +12 -6
  196. package/lib/module/renderer/components/text/Glyphs.js.map +1 -1
  197. package/lib/module/renderer/components/text/Text.js +12 -6
  198. package/lib/module/renderer/components/text/Text.js.map +1 -1
  199. package/lib/module/renderer/components/text/TextBlob.js +12 -6
  200. package/lib/module/renderer/components/text/TextBlob.js.map +1 -1
  201. package/lib/module/renderer/components/text/TextPath.js +10 -5
  202. package/lib/module/renderer/components/text/TextPath.js.map +1 -1
  203. package/lib/module/renderer/processors/Animations/Animations.js.map +1 -1
  204. package/lib/module/skia/types/Paint/Paint.js.map +1 -1
  205. package/lib/module/skia/types/RuntimeEffect/RuntimeEffect.js.map +1 -1
  206. package/lib/module/skia/types/Shader/Shader.js +3 -2
  207. package/lib/module/skia/types/Shader/Shader.js.map +1 -1
  208. package/lib/module/skia/web/JsiSkPaint.js +4 -0
  209. package/lib/module/skia/web/JsiSkPaint.js.map +1 -1
  210. package/lib/module/skia/web/JsiSkRuntimeEffect.js +6 -1
  211. package/lib/module/skia/web/JsiSkRuntimeEffect.js.map +1 -1
  212. package/lib/module/skia/web/JsiSkRuntimeEffectFactory.js +1 -1
  213. package/lib/module/skia/web/JsiSkRuntimeEffectFactory.js.map +1 -1
  214. package/lib/module/web/LoadSkiaWeb.js +1 -1
  215. package/lib/module/web/LoadSkiaWeb.js.map +1 -1
  216. package/lib/typescript/src/dom/nodes/datatypes/Circle.d.ts +4 -1
  217. package/lib/typescript/src/dom/nodes/datatypes/index.d.ts +0 -1
  218. package/lib/typescript/src/dom/nodes/drawings/Box.d.ts +1 -1
  219. package/lib/typescript/src/dom/nodes/drawings/PatchNode.d.ts +1 -1
  220. package/lib/typescript/src/dom/types/Common.d.ts +4 -4
  221. package/lib/typescript/src/dom/types/DrawingContext.d.ts +0 -1
  222. package/lib/typescript/src/dom/types/Drawings.d.ts +1 -1
  223. package/lib/typescript/src/renderer/DrawingContext.d.ts +3 -5
  224. package/lib/typescript/src/renderer/components/Mask.d.ts +3 -9
  225. package/lib/typescript/src/renderer/components/image/Image.d.ts +1 -8
  226. package/lib/typescript/src/renderer/components/image/ImageShader.d.ts +2 -12
  227. package/lib/typescript/src/renderer/components/imageFilters/Blur.d.ts +2 -7
  228. package/lib/typescript/src/renderer/components/imageFilters/Morphology.d.ts +2 -7
  229. package/lib/typescript/src/renderer/components/imageFilters/Offset.d.ts +2 -8
  230. package/lib/typescript/src/renderer/components/maskFilters/Blur.d.ts +2 -8
  231. package/lib/typescript/src/renderer/components/pathEffects/Discrete.d.ts +2 -7
  232. package/lib/typescript/src/renderer/components/shaders/FractalNoise.d.ts +2 -9
  233. package/lib/typescript/src/renderer/components/shaders/Shader.d.ts +2 -7
  234. package/lib/typescript/src/renderer/components/shaders/Turbulence.d.ts +2 -9
  235. package/lib/typescript/src/renderer/components/shapes/Circle.d.ts +1 -9
  236. package/lib/typescript/src/renderer/components/shapes/FitBox.d.ts +2 -7
  237. package/lib/typescript/src/renderer/components/shapes/Oval.d.ts +1 -7
  238. package/lib/typescript/src/renderer/components/shapes/Path.d.ts +2 -8
  239. package/lib/typescript/src/renderer/components/shapes/Points.d.ts +2 -7
  240. package/lib/typescript/src/renderer/components/shapes/RoundedRect.d.ts +1 -6
  241. package/lib/typescript/src/renderer/components/shapes/Vertices.d.ts +2 -7
  242. package/lib/typescript/src/renderer/components/text/Glyphs.d.ts +2 -8
  243. package/lib/typescript/src/renderer/components/text/Text.d.ts +2 -8
  244. package/lib/typescript/src/renderer/components/text/TextBlob.d.ts +2 -8
  245. package/lib/typescript/src/renderer/components/text/TextPath.d.ts +2 -7
  246. package/lib/typescript/src/renderer/processors/Animations/Animations.d.ts +5 -0
  247. package/lib/typescript/src/skia/types/Paint/Paint.d.ts +4 -0
  248. package/lib/typescript/src/skia/types/RuntimeEffect/RuntimeEffect.d.ts +4 -0
  249. package/lib/typescript/src/skia/types/Shader/Shader.d.ts +1 -1
  250. package/lib/typescript/src/skia/web/JsiSkPaint.d.ts +1 -0
  251. package/lib/typescript/src/skia/web/JsiSkRuntimeEffect.d.ts +3 -1
  252. package/package.json +1 -1
  253. package/src/dom/nodes/RenderNode.ts +11 -21
  254. package/src/dom/nodes/datatypes/Circle.ts +1 -1
  255. package/src/dom/nodes/datatypes/Rect.ts +3 -3
  256. package/src/dom/nodes/datatypes/index.ts +0 -1
  257. package/src/dom/nodes/drawings/Box.ts +7 -4
  258. package/src/dom/nodes/drawings/ImageNode.ts +2 -1
  259. package/src/dom/nodes/drawings/PatchNode.ts +4 -18
  260. package/src/dom/nodes/drawings/VerticesNode.ts +2 -2
  261. package/src/dom/nodes/paint/ColorFilters.ts +1 -2
  262. package/src/dom/nodes/paint/ImageFilters.ts +2 -2
  263. package/src/dom/nodes/paint/Shaders.ts +1 -2
  264. package/src/dom/types/Common.ts +4 -4
  265. package/src/dom/types/DrawingContext.ts +0 -1
  266. package/src/dom/types/Drawings.ts +1 -1
  267. package/src/renderer/DrawingContext.ts +5 -5
  268. package/src/renderer/components/Mask.tsx +8 -8
  269. package/src/renderer/components/image/Image.tsx +0 -6
  270. package/src/renderer/components/image/ImageShader.tsx +24 -12
  271. package/src/renderer/components/imageFilters/Blur.tsx +6 -7
  272. package/src/renderer/components/imageFilters/Morphology.tsx +6 -7
  273. package/src/renderer/components/imageFilters/Offset.tsx +7 -8
  274. package/src/renderer/components/maskFilters/Blur.tsx +7 -8
  275. package/src/renderer/components/pathEffects/Discrete.tsx +6 -9
  276. package/src/renderer/components/shaders/FractalNoise.tsx +18 -9
  277. package/src/renderer/components/shaders/Shader.tsx +6 -7
  278. package/src/renderer/components/shaders/Turbulence.tsx +15 -9
  279. package/src/renderer/components/shapes/Circle.tsx +0 -4
  280. package/src/renderer/components/shapes/FitBox.tsx +2 -6
  281. package/src/renderer/components/shapes/Oval.tsx +0 -5
  282. package/src/renderer/components/shapes/Path.tsx +7 -8
  283. package/src/renderer/components/shapes/Points.tsx +6 -7
  284. package/src/renderer/components/shapes/RoundedRect.tsx +0 -4
  285. package/src/renderer/components/shapes/Vertices.tsx +6 -7
  286. package/src/renderer/components/text/Glyphs.tsx +7 -8
  287. package/src/renderer/components/text/Text.tsx +7 -8
  288. package/src/renderer/components/text/TextBlob.tsx +7 -8
  289. package/src/renderer/components/text/TextPath.tsx +6 -7
  290. package/src/renderer/processors/Animations/Animations.ts +9 -3
  291. package/src/skia/types/Paint/Paint.ts +5 -0
  292. package/src/skia/types/RuntimeEffect/RuntimeEffect.ts +5 -0
  293. package/src/skia/types/Shader/Shader.ts +5 -3
  294. package/src/skia/web/JsiSkPaint.ts +4 -0
  295. package/src/skia/web/JsiSkRuntimeEffect.ts +5 -1
  296. package/src/skia/web/JsiSkRuntimeEffectFactory.ts +1 -1
  297. package/src/web/LoadSkiaWeb.tsx +1 -1
  298. package/lib/commonjs/dom/nodes/datatypes/Color.js +0 -27
  299. package/lib/commonjs/dom/nodes/datatypes/Color.js.map +0 -1
  300. package/lib/module/dom/nodes/datatypes/Color.js +0 -11
  301. package/lib/module/dom/nodes/datatypes/Color.js.map +0 -1
  302. package/lib/typescript/src/dom/nodes/datatypes/Color.d.ts +0 -7
  303. package/src/dom/nodes/datatypes/Color.ts +0 -15
@@ -9,13 +9,13 @@ export interface ChildrenProps {
9
9
  children?: ReactNode | ReactNode[];
10
10
  }
11
11
  export interface RectCtor {
12
- x: number;
13
- y: number;
12
+ x?: number;
13
+ y?: number;
14
14
  width: number;
15
15
  height: number;
16
16
  }
17
17
  export interface RRectCtor extends RectCtor {
18
- r: Radius;
18
+ r?: Radius;
19
19
  }
20
20
  export declare type RectDef = RectCtor | {
21
21
  rect: SkRect;
@@ -24,7 +24,7 @@ export declare type RRectDef = RRectCtor | {
24
24
  rect: SkRRect;
25
25
  };
26
26
  export interface PointCircleDef {
27
- c: Vector;
27
+ c?: Vector;
28
28
  r: number;
29
29
  }
30
30
  export interface ScalarCircleDef {
@@ -2,5 +2,4 @@ import type { SkCanvas, SkPaint } from "../../skia/types";
2
2
  export interface DrawingContext {
3
3
  canvas: SkCanvas;
4
4
  paint: SkPaint;
5
- opacity: number;
6
5
  }
@@ -5,7 +5,7 @@ export interface DrawingNodeProps extends GroupProps {
5
5
  paint?: SkPaint;
6
6
  }
7
7
  export declare type ImageProps = DrawingNodeProps & RectDef & {
8
- fit: Fit;
8
+ fit?: Fit;
9
9
  image: SkImage;
10
10
  };
11
11
  export declare type CircleProps = CircleDef & DrawingNodeProps;
@@ -1,10 +1,8 @@
1
1
  import type { RefObject } from "react";
2
2
  import type { DrawingInfo, SkiaView } from "../views";
3
- import type { SkCanvas, SkPaint, Skia, Vector } from "../skia/types";
4
- export interface DrawingContext extends Omit<DrawingInfo, "touches"> {
5
- canvas: SkCanvas;
6
- paint: SkPaint;
7
- opacity: number;
3
+ import type { Skia, Vector } from "../skia/types";
4
+ import type { DrawingContext as DOMDrawingContext } from "../dom/types";
5
+ export interface DrawingContext extends Omit<DrawingInfo, "touches">, DOMDrawingContext {
8
6
  center: Vector;
9
7
  ref: RefObject<SkiaView>;
10
8
  Skia: Skia;
@@ -1,15 +1,9 @@
1
1
  import type { ReactNode } from "react";
2
2
  interface MaskProps {
3
- mode: "luminance" | "alpha";
4
- clip: boolean;
3
+ mode?: "luminance" | "alpha";
4
+ clip?: boolean;
5
5
  mask: ReactNode | ReactNode[];
6
6
  children: ReactNode | ReactNode[];
7
7
  }
8
- export declare const Mask: {
9
- ({ children, mask, mode, clip }: MaskProps): JSX.Element;
10
- defaultProps: {
11
- mode: string;
12
- clip: boolean;
13
- };
14
- };
8
+ export declare const Mask: ({ children, mask, mode, clip, }: MaskProps) => JSX.Element;
15
9
  export {};
@@ -1,11 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import type { SkiaProps } from "../../processors";
3
3
  import type { ImageProps } from "../../../dom/types";
4
- export declare const Image: {
5
- (props: SkiaProps<ImageProps>): JSX.Element;
6
- defaultProps: {
7
- x: number;
8
- y: number;
9
- fit: string;
10
- };
11
- };
4
+ export declare const Image: (props: SkiaProps<ImageProps>) => JSX.Element;
@@ -1,14 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import type { ImageShaderProps } from "../../../dom/types";
3
- import type { SkiaProps } from "../../processors";
4
- export declare const ImageShader: {
5
- (props: SkiaProps<ImageShaderProps>): JSX.Element;
6
- defaultProps: {
7
- readonly tx: "decal";
8
- readonly ty: "decal";
9
- readonly fm: "nearest";
10
- readonly mm: "none";
11
- readonly fit: "none";
12
- readonly transform: readonly [];
13
- };
14
- };
3
+ import type { SkiaDefaultProps } from "../../processors";
4
+ export declare const ImageShader: ({ tx, ty, fm, mm, fit, transform, ...props }: SkiaDefaultProps<ImageShaderProps, "tx" | "ty" | "fm" | "mm" | "fit" | "transform">) => JSX.Element;
@@ -1,9 +1,4 @@
1
1
  /// <reference types="react" />
2
- import type { SkiaProps } from "../../processors/Animations/Animations";
2
+ import type { SkiaDefaultProps } from "../../processors/Animations/Animations";
3
3
  import type { BlurImageFilterProps } from "../../../dom/types";
4
- export declare const Blur: {
5
- (props: SkiaProps<BlurImageFilterProps>): JSX.Element;
6
- defaultProps: {
7
- mode: string;
8
- };
9
- };
4
+ export declare const Blur: ({ mode, ...props }: SkiaDefaultProps<BlurImageFilterProps, "mode">) => JSX.Element;
@@ -1,9 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import type { MorphologyImageFilterProps } from "../../../dom/types";
3
- import type { SkiaProps } from "../../processors";
4
- export declare const Morphology: {
5
- (props: SkiaProps<MorphologyImageFilterProps>): JSX.Element;
6
- defaultProps: {
7
- operator: string;
8
- };
9
- };
3
+ import type { SkiaDefaultProps } from "../../processors";
4
+ export declare const Morphology: ({ operator, ...props }: SkiaDefaultProps<MorphologyImageFilterProps, "operator">) => JSX.Element;
@@ -1,10 +1,4 @@
1
1
  /// <reference types="react" />
2
- import type { SkiaProps } from "../../processors/Animations/Animations";
2
+ import type { SkiaDefaultProps } from "../../processors/Animations/Animations";
3
3
  import type { OffsetImageFilterProps } from "../../../dom/types";
4
- export declare const Offset: {
5
- (props: SkiaProps<OffsetImageFilterProps>): JSX.Element;
6
- defaultProps: {
7
- x: number;
8
- y: number;
9
- };
10
- };
4
+ export declare const Offset: ({ x, y, ...props }: SkiaDefaultProps<OffsetImageFilterProps, "x" | "y">) => JSX.Element;
@@ -1,10 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import type { BlurMaskFilterProps } from "../../../dom/types";
3
- import type { SkiaProps } from "../../processors/Animations/Animations";
4
- export declare const BlurMask: {
5
- (props: SkiaProps<BlurMaskFilterProps>): JSX.Element;
6
- defaultProps: {
7
- style: string;
8
- respectCTM: boolean;
9
- };
10
- };
3
+ import type { SkiaDefaultProps } from "../../processors/Animations/Animations";
4
+ export declare const BlurMask: ({ style, respectCTM, ...props }: SkiaDefaultProps<BlurMaskFilterProps, "style" | "respectCTM">) => JSX.Element;
@@ -1,9 +1,4 @@
1
1
  /// <reference types="react" />
2
- import type { SkiaProps } from "../../processors/Animations/Animations";
2
+ import type { SkiaDefaultProps } from "../../processors/Animations/Animations";
3
3
  import type { DiscretePathEffectProps } from "../../../dom/types";
4
- export declare const DiscretePathEffect: {
5
- (props: SkiaProps<DiscretePathEffectProps>): JSX.Element;
6
- defaultProps: {
7
- seed: number;
8
- };
9
- };
4
+ export declare const DiscretePathEffect: ({ seed, ...props }: SkiaDefaultProps<DiscretePathEffectProps, "seed">) => JSX.Element;
@@ -1,11 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import type { FractalNoiseProps } from "../../../dom/types";
3
- import type { SkiaProps } from "../../processors/Animations/Animations";
4
- export declare const FractalNoise: {
5
- (props: SkiaProps<FractalNoiseProps>): JSX.Element;
6
- defaultProps: {
7
- seed: number;
8
- tileWidth: number;
9
- tileHeight: number;
10
- };
11
- };
3
+ import type { SkiaDefaultProps } from "../../processors/Animations/Animations";
4
+ export declare const FractalNoise: ({ seed, tileWidth, tileHeight, ...props }: SkiaDefaultProps<FractalNoiseProps, "seed" | "tileHeight" | "tileWidth">) => JSX.Element;
@@ -1,9 +1,4 @@
1
1
  /// <reference types="react" />
2
- import type { SkiaProps } from "../../processors";
2
+ import type { SkiaDefaultProps } from "../../processors";
3
3
  import type { ShaderProps } from "../../../dom/types";
4
- export declare const Shader: {
5
- (props: SkiaProps<ShaderProps>): JSX.Element;
6
- defaultProps: {
7
- uniforms: never[];
8
- };
9
- };
4
+ export declare const Shader: ({ uniforms, ...props }: SkiaDefaultProps<ShaderProps, "uniforms">) => JSX.Element;
@@ -1,11 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import type { TurbulenceProps } from "../../../dom/types";
3
- import type { SkiaProps } from "../../processors/Animations/Animations";
4
- export declare const Turbulence: {
5
- (props: SkiaProps<TurbulenceProps>): JSX.Element;
6
- defaultProps: {
7
- seed: number;
8
- tileWidth: number;
9
- tileHeight: number;
10
- };
11
- };
3
+ import type { SkiaDefaultProps } from "../../processors/Animations/Animations";
4
+ export declare const Turbulence: ({ seed, tileWidth, tileHeight, ...props }: SkiaDefaultProps<TurbulenceProps, "seed" | "tileWidth" | "tileHeight">) => JSX.Element;
@@ -1,12 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import type { SkiaProps } from "../../processors";
3
3
  import type { CircleProps } from "../../../dom/types";
4
- export declare const Circle: {
5
- (props: SkiaProps<CircleProps>): JSX.Element;
6
- defaultProps: {
7
- c: {
8
- x: number;
9
- y: number;
10
- };
11
- };
12
- };
4
+ export declare const Circle: (props: SkiaProps<CircleProps>) => JSX.Element;
@@ -2,7 +2,7 @@ import type { ReactNode } from "react";
2
2
  import type { Fit } from "../../../dom/nodes";
3
3
  import type { SkRect } from "../../../skia/types";
4
4
  interface FitProps {
5
- fit: Fit;
5
+ fit?: Fit;
6
6
  src: SkRect;
7
7
  dst: SkRect;
8
8
  children: ReactNode | ReactNode[];
@@ -16,10 +16,5 @@ export declare const fitbox: (fit: Fit, src: SkRect, dst: SkRect) => readonly [{
16
16
  }, {
17
17
  readonly scaleY: number;
18
18
  }];
19
- export declare const FitBox: {
20
- ({ fit, src, dst, children }: FitProps): JSX.Element;
21
- defaultProps: {
22
- fit: string;
23
- };
24
- };
19
+ export declare const FitBox: ({ fit, src, dst, children }: FitProps) => JSX.Element;
25
20
  export {};
@@ -1,10 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import type { OvalProps } from "../../../dom/types";
3
3
  import type { SkiaProps } from "../../processors";
4
- export declare const Oval: {
5
- (props: SkiaProps<OvalProps>): JSX.Element;
6
- defaultProps: {
7
- x: number;
8
- y: number;
9
- };
10
- };
4
+ export declare const Oval: (props: SkiaProps<OvalProps>) => JSX.Element;
@@ -1,10 +1,4 @@
1
1
  /// <reference types="react" />
2
- import type { SkiaProps } from "../../processors";
2
+ import type { SkiaDefaultProps } from "../../processors";
3
3
  import type { PathProps } from "../../../dom/types";
4
- export declare const Path: {
5
- (props: SkiaProps<PathProps>): JSX.Element;
6
- defaultProps: {
7
- start: number;
8
- end: number;
9
- };
10
- };
4
+ export declare const Path: ({ start, end, ...props }: SkiaDefaultProps<PathProps, "start" | "end">) => JSX.Element;
@@ -1,9 +1,4 @@
1
1
  /// <reference types="react" />
2
- import type { SkiaProps } from "../../processors/Animations/Animations";
2
+ import type { SkiaDefaultProps } from "../../processors/Animations/Animations";
3
3
  import type { PointsProps } from "../../../dom/types";
4
- export declare const Points: {
5
- (props: SkiaProps<PointsProps>): JSX.Element;
6
- defaultProps: {
7
- mode: string;
8
- };
9
- };
4
+ export declare const Points: ({ mode, ...props }: SkiaDefaultProps<PointsProps, "mode">) => JSX.Element;
@@ -1,9 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import type { RoundedRectProps } from "../../../dom/types";
3
3
  import type { SkiaProps } from "../../processors";
4
- export declare const RoundedRect: {
5
- (props: SkiaProps<RoundedRectProps>): JSX.Element;
6
- defaultProps: {
7
- r: number;
8
- };
9
- };
4
+ export declare const RoundedRect: (props: SkiaProps<RoundedRectProps>) => JSX.Element;
@@ -1,9 +1,4 @@
1
1
  /// <reference types="react" />
2
- import type { SkiaProps } from "../../processors";
2
+ import type { SkiaDefaultProps } from "../../processors";
3
3
  import type { VerticesProps } from "../../../dom/types";
4
- export declare const Vertices: {
5
- (props: SkiaProps<VerticesProps>): JSX.Element;
6
- defaultProps: {
7
- mode: string;
8
- };
9
- };
4
+ export declare const Vertices: ({ mode, ...props }: SkiaDefaultProps<VerticesProps, "mode">) => JSX.Element;
@@ -1,10 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import type { GlyphsProps } from "../../../dom/types";
3
- import type { SkiaProps } from "../../processors/Animations/Animations";
4
- export declare const Glyphs: {
5
- (props: SkiaProps<GlyphsProps>): JSX.Element;
6
- defaultProps: {
7
- x: number;
8
- y: number;
9
- };
10
- };
3
+ import type { SkiaDefaultProps } from "../../processors/Animations/Animations";
4
+ export declare const Glyphs: ({ x, y, ...props }: SkiaDefaultProps<GlyphsProps, "x" | "y">) => JSX.Element;
@@ -1,10 +1,4 @@
1
1
  /// <reference types="react" />
2
- import type { SkiaProps } from "../../processors";
2
+ import type { SkiaDefaultProps } from "../../processors";
3
3
  import type { TextProps } from "../../../dom/types";
4
- export declare const Text: {
5
- (props: SkiaProps<TextProps>): JSX.Element;
6
- defaultProps: {
7
- x: number;
8
- y: number;
9
- };
10
- };
4
+ export declare const Text: ({ x, y, ...props }: SkiaDefaultProps<TextProps, "x" | "y">) => JSX.Element;
@@ -1,10 +1,4 @@
1
1
  /// <reference types="react" />
2
- import type { SkiaProps } from "../../processors";
2
+ import type { SkiaDefaultProps } from "../../processors";
3
3
  import type { TextBlobProps } from "../../../dom/types";
4
- export declare const TextBlob: {
5
- (props: SkiaProps<TextBlobProps>): JSX.Element;
6
- defaultProps: {
7
- x: number;
8
- y: number;
9
- };
10
- };
4
+ export declare const TextBlob: ({ x, y, ...props }: SkiaDefaultProps<TextBlobProps, "x" | "y">) => JSX.Element;
@@ -1,9 +1,4 @@
1
1
  /// <reference types="react" />
2
- import type { SkiaProps } from "../../processors";
2
+ import type { SkiaDefaultProps } from "../../processors";
3
3
  import type { TextPathProps } from "../../../dom/types";
4
- export declare const TextPath: {
5
- (props: SkiaProps<TextPathProps>): JSX.Element;
6
- defaultProps: {
7
- initialOffset: number;
8
- };
9
- };
4
+ export declare const TextPath: ({ initialOffset, ...props }: SkiaDefaultProps<TextPathProps, "initialOffset">) => JSX.Element;
@@ -10,3 +10,8 @@ export declare type AnimatedProps<T, O extends keyof T | never = never> = {
10
10
  [K in keyof T]: K extends "children" ? T[K] : K extends O ? T[K] : AnimatedProp<T[K]>;
11
11
  };
12
12
  export declare type SkiaProps<P = object, O extends keyof P | never = never> = AnimatedProps<P, O>;
13
+ declare type WithOptional<T extends object, N extends keyof T> = Omit<T, N> & {
14
+ [K in N]?: T[K];
15
+ };
16
+ export declare type SkiaDefaultProps<T extends object, N extends keyof T> = WithOptional<SkiaProps<T>, N>;
17
+ export {};
@@ -22,6 +22,10 @@ export declare enum StrokeJoin {
22
22
  }
23
23
  export declare const isPaint: (obj: SkJSIInstance<string> | null) => obj is SkPaint;
24
24
  export interface SkPaint extends SkJSIInstance<"Paint"> {
25
+ /**
26
+ * Retrieves alpha from the color used when stroking and filling.
27
+ */
28
+ getAlphaf(): number;
25
29
  /**
26
30
  * Returns a copy of this paint.
27
31
  */
@@ -45,4 +45,8 @@ export interface SkRuntimeEffect extends SkJSIInstance<"RuntimeEffect"> {
45
45
  * @param index
46
46
  */
47
47
  getUniformName(index: number): string;
48
+ /**
49
+ * Returns the SkSL source of the runtime effect shader.
50
+ */
51
+ source(): string;
48
52
  }
@@ -4,7 +4,7 @@ import type { SkRuntimeEffect, SkRuntimeShaderBuilder } from "../RuntimeEffect";
4
4
  export declare const isShader: (obj: SkJSIInstance<string> | null) => obj is SkShader;
5
5
  export declare type SkShader = SkJSIInstance<"Shader">;
6
6
  export declare type UniformValue = number | Vector | readonly number[];
7
- export declare type Uniform = UniformValue | readonly UniformValue[];
7
+ export declare type Uniform = UniformValue | readonly UniformValue[] | Float32Array;
8
8
  export interface Uniforms {
9
9
  [name: string]: Uniform;
10
10
  }
@@ -5,6 +5,7 @@ export declare class JsiSkPaint extends HostObject<Paint, "Paint"> implements Sk
5
5
  constructor(CanvasKit: CanvasKit, ref: Paint);
6
6
  copy(): JsiSkPaint;
7
7
  reset(): void;
8
+ getAlphaf(): number;
8
9
  getColor(): Float32Array;
9
10
  getStrokeCap(): number;
10
11
  getStrokeJoin(): number;
@@ -4,7 +4,9 @@ import type { SkRuntimeEffect } from "../types/RuntimeEffect/RuntimeEffect";
4
4
  import { HostObject } from "./Host";
5
5
  import { JsiSkShader } from "./JsiSkShader";
6
6
  export declare class JsiSkRuntimeEffect extends HostObject<RuntimeEffect, "RuntimeEffect"> implements SkRuntimeEffect {
7
- constructor(CanvasKit: CanvasKit, ref: RuntimeEffect);
7
+ private sksl;
8
+ constructor(CanvasKit: CanvasKit, ref: RuntimeEffect, sksl: string);
9
+ source(): string;
8
10
  makeShader(uniforms: number[], localMatrix?: SkMatrix): JsiSkShader;
9
11
  makeShaderWithChildren(uniforms: number[], children?: SkShader[], localMatrix?: SkMatrix): JsiSkShader;
10
12
  getUniform(index: number): import("canvaskit-wasm").SkSLUniform;
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "setup-skia-web": "./scripts/setup-canvaskit.js"
8
8
  },
9
9
  "title": "React Native Skia",
10
- "version": "0.1.163",
10
+ "version": "0.1.165",
11
11
  "description": "High-performance React Native Graphics using Skia",
12
12
  "main": "lib/module/index.js",
13
13
  "files": [
@@ -141,7 +141,7 @@ export abstract class JsiRenderNode<P extends GroupProps>
141
141
  opacity !== undefined ||
142
142
  antiAlias !== undefined
143
143
  ) {
144
- ctx = {};
144
+ ctx = { opacity: 1 };
145
145
  if (color !== undefined) {
146
146
  ctx.color = this.Skia.Color(color);
147
147
  }
@@ -208,24 +208,19 @@ export abstract class JsiRenderNode<P extends GroupProps>
208
208
  const { invertClip, layer, matrix, transform } = this.props;
209
209
  const { canvas } = parentCtx;
210
210
 
211
- const opacity =
212
- this.props.opacity !== undefined
213
- ? parentCtx.opacity * this.props.opacity
214
- : parentCtx.opacity;
215
-
216
211
  if (
217
212
  this.paintCache === null ||
218
213
  this.paintCache.parent !== parentCtx.paint
219
214
  ) {
220
215
  const paintCtx = this.getPaintCtx();
221
216
  const child = paintCtx
222
- ? concatPaint(parentCtx.paint, paintCtx, parentCtx.opacity)
217
+ ? concatPaint(parentCtx.paint.copy(), paintCtx)
223
218
  : parentCtx.paint;
224
219
  this.paintCache = { parent: parentCtx.paint, child };
225
220
  }
226
221
  const paint = this.paintCache.child;
227
222
  // TODO: can we only recreate a new context here if needed?
228
- const ctx = { ...parentCtx, opacity, paint };
223
+ const ctx = { ...parentCtx, paint };
229
224
  const hasTransform = matrix !== undefined || transform !== undefined;
230
225
  const hasClip =
231
226
  this.clipRect !== undefined ||
@@ -267,7 +262,7 @@ export abstract class JsiRenderNode<P extends GroupProps>
267
262
  }
268
263
 
269
264
  const concatPaint = (
270
- parent: SkPaint,
265
+ paint: SkPaint,
271
266
  {
272
267
  color,
273
268
  strokeWidth,
@@ -278,23 +273,21 @@ const concatPaint = (
278
273
  imageFilter,
279
274
  maskFilter,
280
275
  pathEffect,
281
- opacity: alpha,
276
+ opacity,
282
277
  strokeCap,
283
278
  strokeJoin,
284
279
  strokeMiter,
285
280
  style,
286
- }: PaintContext,
287
- opacity: number
281
+ }: PaintContext
288
282
  ) => {
289
- const paint = parent.copy();
283
+ if (opacity !== undefined) {
284
+ paint.setAlphaf(paint.getAlphaf() * opacity);
285
+ }
290
286
  if (color !== undefined) {
287
+ const currentOpacity = paint.getAlphaf();
291
288
  paint.setShader(null);
292
- color[3] *= opacity;
293
289
  paint.setColor(color);
294
- } else {
295
- const cl = paint.getColor();
296
- cl[3] = opacity;
297
- paint.setColor(cl);
290
+ paint.setAlphaf(currentOpacity * paint.getAlphaf());
298
291
  }
299
292
  if (strokeWidth !== undefined) {
300
293
  paint.setStrokeWidth(strokeWidth);
@@ -320,9 +313,6 @@ const concatPaint = (
320
313
  if (pathEffect !== undefined) {
321
314
  paint.setPathEffect(pathEffect);
322
315
  }
323
- if (alpha !== undefined) {
324
- paint.setAlphaf(alpha * opacity);
325
- }
326
316
  if (strokeCap !== undefined) {
327
317
  paint.setStrokeCap(strokeCap);
328
318
  }
@@ -10,5 +10,5 @@ export const processCircle = (Skia: Skia, def: CircleDef) => {
10
10
  if (isCircleScalarDef(def)) {
11
11
  return { c: Skia.Point(def.cx, def.cy), r: def.r };
12
12
  }
13
- return def;
13
+ return { ...def, c: def.c ?? { x: 0, y: 0 } };
14
14
  };
@@ -16,7 +16,7 @@ const isRectCtor = (def: RectDef): def is RectCtor =>
16
16
 
17
17
  export const processRect = (Skia: Skia, def: RectDef) => {
18
18
  if (isRectCtor(def)) {
19
- return Skia.XYWHRect(def.x, def.y, def.width, def.height);
19
+ return Skia.XYWHRect(def.x ?? 0, def.y ?? 0, def.width, def.height);
20
20
  } else {
21
21
  return def.rect;
22
22
  }
@@ -24,9 +24,9 @@ export const processRect = (Skia: Skia, def: RectDef) => {
24
24
 
25
25
  export const processRRect = (Skia: Skia, def: RRectDef) => {
26
26
  if (isRRectCtor(def)) {
27
- const r = processRadius(Skia, def.r);
27
+ const r = processRadius(Skia, def.r ?? 0);
28
28
  return Skia.RRectXY(
29
- Skia.XYWHRect(def.x, def.y, def.width, def.height),
29
+ Skia.XYWHRect(def.x ?? 0, def.y ?? 0, def.width, def.height),
30
30
  r.x,
31
31
  r.y
32
32
  );
@@ -1,7 +1,6 @@
1
1
  export * from "./Enum";
2
2
  export * from "./Path";
3
3
  export * from "./Fitting";
4
- export * from "./Color";
5
4
  export * from "./Rect";
6
5
  export * from "./Radius";
7
6
  export * from "./Circle";
@@ -5,7 +5,6 @@ import { DeclarationType, NodeType } from "../../types";
5
5
  import type { BoxShadowProps, BoxProps } from "../../types/Drawings";
6
6
  import type { NodeContext } from "../Node";
7
7
  import { JsiDeclarationNode } from "../Node";
8
- import { processColor } from "../datatypes";
9
8
  import { JsiRenderNode } from "../RenderNode";
10
9
 
11
10
  const inflate = (
@@ -54,8 +53,9 @@ export class BoxNode extends JsiRenderNode<BoxProps> {
54
53
  super(ctx, NodeType.Box, props);
55
54
  }
56
55
 
57
- renderNode({ canvas, paint, opacity }: DrawingContext) {
56
+ renderNode({ canvas, paint }: DrawingContext) {
58
57
  const { box: defaultBox } = this.props;
58
+ const opacity = paint.getAlphaf();
59
59
  const box = isRRect(defaultBox)
60
60
  ? defaultBox
61
61
  : this.Skia.RRectXY(defaultBox, 0, 0);
@@ -72,7 +72,8 @@ export class BoxNode extends JsiRenderNode<BoxProps> {
72
72
  .map((shadow) => {
73
73
  const { color = "black", blur, spread = 0, dx = 0, dy = 0 } = shadow;
74
74
  const lPaint = this.Skia.Paint();
75
- lPaint.setColor(processColor(this.Skia, color, opacity));
75
+ lPaint.setColor(this.Skia.Color(color));
76
+ lPaint.setAlphaf(paint.getAlphaf() * opacity);
76
77
  lPaint.setMaskFilter(
77
78
  this.Skia.MaskFilter.MakeBlur(BlurStyle.Normal, blur, true)
78
79
  );
@@ -92,7 +93,9 @@ export class BoxNode extends JsiRenderNode<BoxProps> {
92
93
  canvas.save();
93
94
  canvas.clipRRect(box, ClipOp.Intersect, false);
94
95
  const lPaint = this.Skia.Paint();
95
- lPaint.setColor(processColor(this.Skia, color, opacity));
96
+ lPaint.setColor(this.Skia.Color(color));
97
+ lPaint.setAlphaf(paint.getAlphaf() * opacity);
98
+
96
99
  lPaint.setMaskFilter(
97
100
  this.Skia.MaskFilter.MakeBlur(BlurStyle.Normal, blur, true)
98
101
  );
@@ -14,7 +14,8 @@ export class ImageNode extends JsiDrawingNode<
14
14
  }
15
15
 
16
16
  deriveProps() {
17
- const { image, fit } = this.props;
17
+ const { image } = this.props;
18
+ const fit = this.props.fit ?? "contain";
18
19
  const rect = processRect(this.Skia, this.props);
19
20
  const { src, dst } = fitRects(
20
21
  fit,