@shopify/react-native-skia 0.1.130 → 0.1.133

Sign up to get free protection for your applications and to get access to all the features.
Files changed (963) hide show
  1. package/README.md +8 -0
  2. package/android/cpp/jni/JniSkiaDrawView.cpp +3 -2
  3. package/android/cpp/rnskia-android/RNSkDrawViewImpl.cpp +5 -0
  4. package/android/src/main/java/com/shopify/reactnative/skia/SkiaDrawView.java +2 -1
  5. package/cpp/api/JsiSkCanvas.h +2 -2
  6. package/cpp/api/JsiSkFont.h +6 -2
  7. package/cpp/api/JsiSkImage.h +2 -19
  8. package/cpp/api/JsiSkMatrix.h +40 -27
  9. package/cpp/api/JsiSkPaint.h +8 -33
  10. package/cpp/api/JsiSkPath.h +71 -65
  11. package/cpp/api/JsiSkPathFactory.h +14 -1
  12. package/cpp/api/JsiSkRuntimeShaderBuilder.h +18 -0
  13. package/cpp/api/JsiSkTypeface.h +11 -2
  14. package/cpp/api/JsiSkTypefaceFactory.h +5 -1
  15. package/cpp/rnskia/RNSkInfoParameter.h +2 -0
  16. package/cpp/utils/RNSkLog.h +27 -0
  17. package/ios/RNSkia-iOS/SkiaDrawView.mm +2 -1
  18. package/lib/commonjs/animation/functions/index.js +47 -17
  19. package/lib/commonjs/animation/functions/index.js.map +1 -1
  20. package/lib/commonjs/animation/functions/interpolatePaths.js +45 -0
  21. package/lib/commonjs/animation/functions/interpolatePaths.js.map +1 -0
  22. package/lib/commonjs/animation/functions/interpolateVector.js +20 -0
  23. package/lib/commonjs/animation/functions/interpolateVector.js.map +1 -0
  24. package/lib/commonjs/index.js +13 -0
  25. package/lib/commonjs/index.js.map +1 -1
  26. package/lib/commonjs/renderer/Canvas.js +19 -35
  27. package/lib/commonjs/renderer/Canvas.js.map +1 -1
  28. package/lib/commonjs/renderer/HostConfig.js +2 -2
  29. package/lib/commonjs/renderer/HostConfig.js.map +1 -1
  30. package/lib/commonjs/renderer/components/Blend.js +10 -7
  31. package/lib/commonjs/renderer/components/Blend.js.map +1 -1
  32. package/lib/commonjs/renderer/components/Compose.js +9 -6
  33. package/lib/commonjs/renderer/components/Compose.js.map +1 -1
  34. package/lib/commonjs/renderer/components/Group.js +7 -6
  35. package/lib/commonjs/renderer/components/Group.js.map +1 -1
  36. package/lib/commonjs/renderer/components/Mask.js +13 -10
  37. package/lib/commonjs/renderer/components/Mask.js.map +1 -1
  38. package/lib/commonjs/renderer/components/Paint.js +7 -4
  39. package/lib/commonjs/renderer/components/Paint.js.map +1 -1
  40. package/lib/commonjs/renderer/components/Picture.js.map +1 -1
  41. package/lib/commonjs/renderer/components/backdrop/BackdropFilter.js +1 -1
  42. package/lib/commonjs/renderer/components/backdrop/BackdropFilter.js.map +1 -1
  43. package/lib/commonjs/renderer/components/colorFilters/BlendColor.js +7 -6
  44. package/lib/commonjs/renderer/components/colorFilters/BlendColor.js.map +1 -1
  45. package/lib/commonjs/renderer/components/colorFilters/Compose.js +6 -6
  46. package/lib/commonjs/renderer/components/colorFilters/Compose.js.map +1 -1
  47. package/lib/commonjs/renderer/components/colorFilters/Lerp.js +8 -7
  48. package/lib/commonjs/renderer/components/colorFilters/Lerp.js.map +1 -1
  49. package/lib/commonjs/renderer/components/colorFilters/LinearToSRGBGamma.js +6 -6
  50. package/lib/commonjs/renderer/components/colorFilters/LinearToSRGBGamma.js.map +1 -1
  51. package/lib/commonjs/renderer/components/colorFilters/LumaColorFilter.js +6 -6
  52. package/lib/commonjs/renderer/components/colorFilters/LumaColorFilter.js.map +1 -1
  53. package/lib/commonjs/renderer/components/colorFilters/Matrix.js +6 -7
  54. package/lib/commonjs/renderer/components/colorFilters/Matrix.js.map +1 -1
  55. package/lib/commonjs/renderer/components/colorFilters/SRGBToLinearGamma.js +6 -6
  56. package/lib/commonjs/renderer/components/colorFilters/SRGBToLinearGamma.js.map +1 -1
  57. package/lib/commonjs/renderer/components/image/BoxFit.js +7 -9
  58. package/lib/commonjs/renderer/components/image/BoxFit.js.map +1 -1
  59. package/lib/commonjs/renderer/components/image/Image.js +3 -2
  60. package/lib/commonjs/renderer/components/image/Image.js.map +1 -1
  61. package/lib/commonjs/renderer/components/image/ImageSVG.js +3 -2
  62. package/lib/commonjs/renderer/components/image/ImageSVG.js.map +1 -1
  63. package/lib/commonjs/renderer/components/image/ImageShader.js +9 -6
  64. package/lib/commonjs/renderer/components/image/ImageShader.js.map +1 -1
  65. package/lib/commonjs/renderer/components/imageFilters/Blur.js +7 -4
  66. package/lib/commonjs/renderer/components/imageFilters/Blur.js.map +1 -1
  67. package/lib/commonjs/renderer/components/imageFilters/DisplacementMap.js +10 -7
  68. package/lib/commonjs/renderer/components/imageFilters/DisplacementMap.js.map +1 -1
  69. package/lib/commonjs/renderer/components/imageFilters/InnerShadow.js +10 -15
  70. package/lib/commonjs/renderer/components/imageFilters/InnerShadow.js.map +1 -1
  71. package/lib/commonjs/renderer/components/imageFilters/Morphology.js +7 -6
  72. package/lib/commonjs/renderer/components/imageFilters/Morphology.js.map +1 -1
  73. package/lib/commonjs/renderer/components/imageFilters/Offset.js +5 -4
  74. package/lib/commonjs/renderer/components/imageFilters/Offset.js.map +1 -1
  75. package/lib/commonjs/renderer/components/imageFilters/RuntimeShader.js +13 -6
  76. package/lib/commonjs/renderer/components/imageFilters/RuntimeShader.js.map +1 -1
  77. package/lib/commonjs/renderer/components/imageFilters/Shadow.js +8 -7
  78. package/lib/commonjs/renderer/components/imageFilters/Shadow.js.map +1 -1
  79. package/lib/commonjs/renderer/components/imageFilters/getInput.js +7 -7
  80. package/lib/commonjs/renderer/components/imageFilters/getInput.js.map +1 -1
  81. package/lib/commonjs/renderer/components/maskFilters/Blur.js +6 -3
  82. package/lib/commonjs/renderer/components/maskFilters/Blur.js.map +1 -1
  83. package/lib/commonjs/renderer/components/pathEffects/Corner.js +8 -6
  84. package/lib/commonjs/renderer/components/pathEffects/Corner.js.map +1 -1
  85. package/lib/commonjs/renderer/components/pathEffects/Dash.js +8 -6
  86. package/lib/commonjs/renderer/components/pathEffects/Dash.js.map +1 -1
  87. package/lib/commonjs/renderer/components/pathEffects/Discrete.js +8 -6
  88. package/lib/commonjs/renderer/components/pathEffects/Discrete.js.map +1 -1
  89. package/lib/commonjs/renderer/components/pathEffects/Line2D.js +8 -6
  90. package/lib/commonjs/renderer/components/pathEffects/Line2D.js.map +1 -1
  91. package/lib/commonjs/renderer/components/pathEffects/Path1D.js +8 -6
  92. package/lib/commonjs/renderer/components/pathEffects/Path1D.js.map +1 -1
  93. package/lib/commonjs/renderer/components/pathEffects/Path2D.js +8 -6
  94. package/lib/commonjs/renderer/components/pathEffects/Path2D.js.map +1 -1
  95. package/lib/commonjs/renderer/components/pathEffects/Sum.js +7 -4
  96. package/lib/commonjs/renderer/components/pathEffects/Sum.js.map +1 -1
  97. package/lib/commonjs/renderer/components/shaders/Color.js +7 -4
  98. package/lib/commonjs/renderer/components/shaders/Color.js.map +1 -1
  99. package/lib/commonjs/renderer/components/shaders/FractalNoise.js +5 -4
  100. package/lib/commonjs/renderer/components/shaders/FractalNoise.js.map +1 -1
  101. package/lib/commonjs/renderer/components/shaders/Gradient.js +5 -5
  102. package/lib/commonjs/renderer/components/shaders/Gradient.js.map +1 -1
  103. package/lib/commonjs/renderer/components/shaders/LinearGradient.js +6 -5
  104. package/lib/commonjs/renderer/components/shaders/LinearGradient.js.map +1 -1
  105. package/lib/commonjs/renderer/components/shaders/RadialGradient.js +6 -5
  106. package/lib/commonjs/renderer/components/shaders/RadialGradient.js.map +1 -1
  107. package/lib/commonjs/renderer/components/shaders/Shader.js +6 -43
  108. package/lib/commonjs/renderer/components/shaders/Shader.js.map +1 -1
  109. package/lib/commonjs/renderer/components/shaders/SweepGradient.js +6 -5
  110. package/lib/commonjs/renderer/components/shaders/SweepGradient.js.map +1 -1
  111. package/lib/commonjs/renderer/components/shaders/Turbulence.js +5 -4
  112. package/lib/commonjs/renderer/components/shaders/Turbulence.js.map +1 -1
  113. package/lib/commonjs/renderer/components/shaders/TwoPointConicalGradient.js +6 -5
  114. package/lib/commonjs/renderer/components/shaders/TwoPointConicalGradient.js.map +1 -1
  115. package/lib/commonjs/renderer/components/shapes/Box.js +26 -29
  116. package/lib/commonjs/renderer/components/shapes/Box.js.map +1 -1
  117. package/lib/commonjs/renderer/components/shapes/Circle.js +7 -5
  118. package/lib/commonjs/renderer/components/shapes/Circle.js.map +1 -1
  119. package/lib/commonjs/renderer/components/shapes/DiffRect.js.map +1 -1
  120. package/lib/commonjs/renderer/components/shapes/FitBox.js.map +1 -1
  121. package/lib/commonjs/renderer/components/shapes/Line.js.map +1 -1
  122. package/lib/commonjs/renderer/components/shapes/Oval.js +3 -2
  123. package/lib/commonjs/renderer/components/shapes/Oval.js.map +1 -1
  124. package/lib/commonjs/renderer/components/shapes/Patch.js +8 -5
  125. package/lib/commonjs/renderer/components/shapes/Patch.js.map +1 -1
  126. package/lib/commonjs/renderer/components/shapes/Path.js +5 -4
  127. package/lib/commonjs/renderer/components/shapes/Path.js.map +1 -1
  128. package/lib/commonjs/renderer/components/shapes/Points.js +2 -2
  129. package/lib/commonjs/renderer/components/shapes/Points.js.map +1 -1
  130. package/lib/commonjs/renderer/components/shapes/Rect.js +3 -2
  131. package/lib/commonjs/renderer/components/shapes/Rect.js.map +1 -1
  132. package/lib/commonjs/renderer/components/shapes/RoundedRect.js +3 -2
  133. package/lib/commonjs/renderer/components/shapes/RoundedRect.js.map +1 -1
  134. package/lib/commonjs/renderer/components/shapes/Vertices.js +9 -8
  135. package/lib/commonjs/renderer/components/shapes/Vertices.js.map +1 -1
  136. package/lib/commonjs/renderer/components/text/Glyphs.js +3 -2
  137. package/lib/commonjs/renderer/components/text/Glyphs.js.map +1 -1
  138. package/lib/commonjs/renderer/components/text/Text.js +3 -2
  139. package/lib/commonjs/renderer/components/text/Text.js.map +1 -1
  140. package/lib/commonjs/renderer/components/text/TextBlob.js.map +1 -1
  141. package/lib/commonjs/renderer/components/text/TextPath.js +7 -11
  142. package/lib/commonjs/renderer/components/text/TextPath.js.map +1 -1
  143. package/lib/commonjs/renderer/index.js +13 -13
  144. package/lib/commonjs/renderer/index.js.map +1 -1
  145. package/lib/commonjs/renderer/nodes/Declaration.js.map +1 -1
  146. package/lib/commonjs/renderer/nodes/Drawing.js +5 -5
  147. package/lib/commonjs/renderer/nodes/Drawing.js.map +1 -1
  148. package/lib/commonjs/renderer/nodes/Node.js.map +1 -1
  149. package/lib/commonjs/renderer/processors/Animations/Animations.js.map +1 -1
  150. package/lib/commonjs/renderer/processors/Circles.js +2 -4
  151. package/lib/commonjs/renderer/processors/Circles.js.map +1 -1
  152. package/lib/commonjs/renderer/processors/Clips.js +5 -5
  153. package/lib/commonjs/renderer/processors/Clips.js.map +1 -1
  154. package/lib/commonjs/{skia/core → renderer/processors}/Color.js +2 -6
  155. package/lib/commonjs/renderer/processors/Color.js.map +1 -0
  156. package/lib/commonjs/renderer/processors/Font.js +4 -4
  157. package/lib/commonjs/renderer/processors/Font.js.map +1 -1
  158. package/lib/commonjs/renderer/processors/Paint.js +18 -14
  159. package/lib/commonjs/renderer/processors/Paint.js.map +1 -1
  160. package/lib/commonjs/renderer/processors/Paths.js +4 -4
  161. package/lib/commonjs/renderer/processors/Paths.js.map +1 -1
  162. package/lib/commonjs/renderer/processors/Radius.js +2 -4
  163. package/lib/commonjs/renderer/processors/Radius.js.map +1 -1
  164. package/lib/commonjs/renderer/processors/Rects.js +8 -59
  165. package/lib/commonjs/renderer/processors/Rects.js.map +1 -1
  166. package/lib/commonjs/renderer/processors/Transform.js +26 -17
  167. package/lib/commonjs/renderer/processors/Transform.js.map +1 -1
  168. package/lib/commonjs/renderer/processors/index.js +26 -13
  169. package/lib/commonjs/renderer/processors/index.js.map +1 -1
  170. package/lib/commonjs/renderer/processors/math/Coordinates.js.map +1 -1
  171. package/lib/commonjs/renderer/processors/math/Transforms.js.map +1 -1
  172. package/lib/commonjs/renderer/processors/math/index.js +0 -26
  173. package/lib/commonjs/renderer/processors/math/index.js.map +1 -1
  174. package/lib/commonjs/renderer/useCanvas.js +30 -0
  175. package/lib/commonjs/renderer/useCanvas.js.map +1 -0
  176. package/lib/commonjs/skia/NativeSetup.js +1 -1
  177. package/lib/commonjs/skia/NativeSetup.js.map +1 -1
  178. package/lib/commonjs/skia/Skia.web.js +12 -0
  179. package/lib/commonjs/skia/Skia.web.js.map +1 -0
  180. package/lib/commonjs/skia/core/Data.js +9 -4
  181. package/lib/commonjs/skia/core/Data.js.map +1 -1
  182. package/lib/commonjs/skia/core/Font.js +2 -4
  183. package/lib/commonjs/skia/core/Font.js.map +1 -1
  184. package/lib/commonjs/skia/core/Matrix.js +15 -0
  185. package/lib/commonjs/skia/core/Matrix.js.map +1 -0
  186. package/lib/commonjs/skia/core/Paint.js +4 -12
  187. package/lib/commonjs/skia/core/Paint.js.map +1 -1
  188. package/lib/commonjs/skia/core/Path.js +14 -2
  189. package/lib/commonjs/skia/core/Path.js.map +1 -1
  190. package/lib/commonjs/skia/core/RRect.js +13 -0
  191. package/lib/commonjs/skia/core/RRect.js.map +1 -0
  192. package/lib/commonjs/skia/core/Rect.js +47 -0
  193. package/lib/commonjs/skia/core/Rect.js.map +1 -0
  194. package/lib/commonjs/skia/core/Vector.js +49 -0
  195. package/lib/commonjs/skia/core/Vector.js.map +1 -0
  196. package/lib/commonjs/skia/core/index.js +51 -25
  197. package/lib/commonjs/skia/core/index.js.map +1 -1
  198. package/lib/commonjs/skia/types/Font/Font.js.map +1 -1
  199. package/lib/commonjs/skia/types/Image/Image.js +5 -5
  200. package/lib/commonjs/skia/types/Image/Image.js.map +1 -1
  201. package/lib/commonjs/skia/types/Image/ImageFactory.js.map +1 -1
  202. package/lib/commonjs/skia/types/Matrix.js +58 -1
  203. package/lib/commonjs/skia/types/Matrix.js.map +1 -1
  204. package/lib/commonjs/skia/types/Paint/Paint.js +3 -3
  205. package/lib/commonjs/skia/types/Paint/Paint.js.map +1 -1
  206. package/lib/commonjs/skia/types/Path/Path.js.map +1 -1
  207. package/lib/commonjs/skia/types/Point.js.map +1 -1
  208. package/lib/commonjs/skia/types/RRect.js +7 -0
  209. package/lib/commonjs/skia/types/RRect.js.map +1 -1
  210. package/lib/commonjs/skia/types/Shader/Shader.js +45 -1
  211. package/lib/commonjs/skia/types/Shader/Shader.js.map +1 -1
  212. package/lib/commonjs/skia/web/{api/Host.js → Host.js} +10 -1
  213. package/lib/commonjs/skia/web/Host.js.map +1 -0
  214. package/lib/commonjs/skia/web/{api/JsiSkCanvas.js → JsiSkCanvas.js} +21 -7
  215. package/lib/commonjs/skia/web/JsiSkCanvas.js.map +1 -0
  216. package/lib/commonjs/skia/web/{api/JsiSkColor.js → JsiSkColor.js} +163 -4
  217. package/lib/commonjs/skia/web/JsiSkColor.js.map +1 -0
  218. package/lib/commonjs/skia/web/{api/JsiSkColorFilter.js → JsiSkColorFilter.js} +0 -0
  219. package/lib/commonjs/skia/web/{api/JsiSkColorFilter.js.map → JsiSkColorFilter.js.map} +1 -1
  220. package/lib/commonjs/skia/web/JsiSkColorFilterFactory.js +48 -0
  221. package/lib/commonjs/skia/web/JsiSkColorFilterFactory.js.map +1 -0
  222. package/lib/commonjs/skia/web/JsiSkContourMeasure.js +42 -0
  223. package/lib/commonjs/skia/web/JsiSkContourMeasure.js.map +1 -0
  224. package/lib/commonjs/skia/web/JsiSkContourMeasureIter.js +30 -0
  225. package/lib/commonjs/skia/web/JsiSkContourMeasureIter.js.map +1 -0
  226. package/lib/commonjs/skia/web/JsiSkData.js +18 -0
  227. package/lib/commonjs/skia/web/JsiSkData.js.map +1 -0
  228. package/lib/commonjs/skia/web/JsiSkDataFactory.js +44 -0
  229. package/lib/commonjs/skia/web/JsiSkDataFactory.js.map +1 -0
  230. package/lib/commonjs/skia/web/JsiSkFont.js +113 -0
  231. package/lib/commonjs/skia/web/JsiSkFont.js.map +1 -0
  232. package/lib/commonjs/skia/web/JsiSkFontMgr.js +33 -0
  233. package/lib/commonjs/skia/web/JsiSkFontMgr.js.map +1 -0
  234. package/lib/commonjs/skia/web/JsiSkFontMgrFactory.js +25 -0
  235. package/lib/commonjs/skia/web/JsiSkFontMgrFactory.js.map +1 -0
  236. package/lib/commonjs/skia/web/{api/JsiSkImage.js → JsiSkImage.js} +10 -6
  237. package/lib/commonjs/skia/web/JsiSkImage.js.map +1 -0
  238. package/lib/commonjs/skia/web/JsiSkImageFactory.js +47 -0
  239. package/lib/commonjs/skia/web/JsiSkImageFactory.js.map +1 -0
  240. package/lib/commonjs/skia/web/JsiSkImageFilter.js +18 -0
  241. package/lib/commonjs/skia/web/JsiSkImageFilter.js.map +1 -0
  242. package/lib/commonjs/skia/web/JsiSkImageFilterFactory.js +68 -0
  243. package/lib/commonjs/skia/web/JsiSkImageFilterFactory.js.map +1 -0
  244. package/lib/commonjs/skia/web/JsiSkMaskFilter.js +18 -0
  245. package/lib/commonjs/skia/web/JsiSkMaskFilter.js.map +1 -0
  246. package/lib/commonjs/skia/web/JsiSkMaskFilterFactory.js +24 -0
  247. package/lib/commonjs/skia/web/JsiSkMaskFilterFactory.js.map +1 -0
  248. package/lib/commonjs/skia/web/JsiSkMatrix.js +38 -0
  249. package/lib/commonjs/skia/web/JsiSkMatrix.js.map +1 -0
  250. package/lib/commonjs/skia/web/{api/JsiSkPaint.js → JsiSkPaint.js} +4 -9
  251. package/lib/commonjs/skia/web/JsiSkPaint.js.map +1 -0
  252. package/lib/commonjs/skia/web/JsiSkPath.js +337 -0
  253. package/lib/commonjs/skia/web/JsiSkPath.js.map +1 -0
  254. package/lib/commonjs/skia/web/JsiSkPathEffect.js +18 -0
  255. package/lib/commonjs/skia/web/JsiSkPathEffect.js.map +1 -0
  256. package/lib/commonjs/skia/web/JsiSkPathEffectFactory.js +78 -0
  257. package/lib/commonjs/skia/web/JsiSkPathEffectFactory.js.map +1 -0
  258. package/lib/commonjs/skia/web/JsiSkPathFactory.js +58 -0
  259. package/lib/commonjs/skia/web/JsiSkPathFactory.js.map +1 -0
  260. package/lib/commonjs/skia/web/JsiSkPicture.js +29 -0
  261. package/lib/commonjs/skia/web/JsiSkPicture.js.map +1 -0
  262. package/lib/commonjs/skia/web/JsiSkPictureFactory.js +30 -0
  263. package/lib/commonjs/skia/web/JsiSkPictureFactory.js.map +1 -0
  264. package/lib/commonjs/skia/web/JsiSkPictureRecorder.js +30 -0
  265. package/lib/commonjs/skia/web/JsiSkPictureRecorder.js.map +1 -0
  266. package/lib/commonjs/skia/web/JsiSkPoint.js +26 -0
  267. package/lib/commonjs/skia/web/JsiSkPoint.js.map +1 -0
  268. package/lib/commonjs/skia/web/JsiSkRRect.js +32 -0
  269. package/lib/commonjs/skia/web/JsiSkRRect.js.map +1 -0
  270. package/lib/commonjs/skia/web/JsiSkRSXform.js +18 -0
  271. package/lib/commonjs/skia/web/JsiSkRSXform.js.map +1 -0
  272. package/lib/commonjs/skia/web/{api/JsiSkRect.js → JsiSkRect.js} +8 -0
  273. package/lib/commonjs/skia/web/JsiSkRect.js.map +1 -0
  274. package/lib/commonjs/skia/web/JsiSkRuntimeEffect.js +44 -0
  275. package/lib/commonjs/skia/web/JsiSkRuntimeEffect.js.map +1 -0
  276. package/lib/commonjs/skia/web/JsiSkRuntimeEffectFactory.js +30 -0
  277. package/lib/commonjs/skia/web/JsiSkRuntimeEffectFactory.js.map +1 -0
  278. package/lib/commonjs/skia/web/JsiSkSVGFactory.js +26 -0
  279. package/lib/commonjs/skia/web/JsiSkSVGFactory.js.map +1 -0
  280. package/lib/commonjs/skia/web/JsiSkShader.js +18 -0
  281. package/lib/commonjs/skia/web/JsiSkShader.js.map +1 -0
  282. package/lib/commonjs/skia/web/JsiSkShaderFactory.js +52 -0
  283. package/lib/commonjs/skia/web/JsiSkShaderFactory.js.map +1 -0
  284. package/lib/commonjs/skia/web/{api/JsiSkSurface.js → JsiSkSurface.js} +0 -0
  285. package/lib/commonjs/skia/web/{api/JsiSkSurface.js.map → JsiSkSurface.js.map} +1 -1
  286. package/lib/commonjs/skia/web/{api/JsiSkSurfaceFactory.js → JsiSkSurfaceFactory.js} +0 -0
  287. package/lib/commonjs/skia/web/{api/JsiSkSurfaceFactory.js.map → JsiSkSurfaceFactory.js.map} +1 -1
  288. package/lib/commonjs/skia/web/JsiSkTextBlob.js +18 -0
  289. package/lib/commonjs/skia/web/JsiSkTextBlob.js.map +1 -0
  290. package/lib/commonjs/skia/web/JsiSkTextBlobFactory.js +36 -0
  291. package/lib/commonjs/skia/web/JsiSkTextBlobFactory.js.map +1 -0
  292. package/lib/commonjs/skia/web/JsiSkTypeface.js +28 -0
  293. package/lib/commonjs/skia/web/JsiSkTypeface.js.map +1 -0
  294. package/lib/commonjs/skia/web/JsiSkTypefaceFactory.js +30 -0
  295. package/lib/commonjs/skia/web/JsiSkTypefaceFactory.js.map +1 -0
  296. package/lib/commonjs/skia/web/JsiSkVertices.js +28 -0
  297. package/lib/commonjs/skia/web/JsiSkVertices.js.map +1 -0
  298. package/lib/commonjs/skia/web/JsiSkVerticesFactory.js +49 -0
  299. package/lib/commonjs/skia/web/JsiSkVerticesFactory.js.map +1 -0
  300. package/lib/commonjs/skia/web/JsiSkia.js +97 -0
  301. package/lib/commonjs/skia/web/JsiSkia.js.map +1 -0
  302. package/lib/commonjs/skia/web/index.js +4 -4
  303. package/lib/commonjs/skia/web/index.js.map +1 -1
  304. package/lib/commonjs/values/web/api.js +2 -2
  305. package/lib/commonjs/values/web/api.js.map +1 -1
  306. package/lib/commonjs/views/SkiaView.web.js +216 -0
  307. package/lib/commonjs/views/SkiaView.web.js.map +1 -0
  308. package/lib/commonjs/views/types.js.map +1 -1
  309. package/lib/commonjs/views/useTouchHandler.js +70 -46
  310. package/lib/commonjs/views/useTouchHandler.js.map +1 -1
  311. package/lib/commonjs/web/index.js +22 -0
  312. package/lib/commonjs/web/index.js.map +1 -0
  313. package/lib/module/animation/functions/index.js +4 -2
  314. package/lib/module/animation/functions/index.js.map +1 -1
  315. package/lib/module/animation/functions/interpolatePaths.js +36 -0
  316. package/lib/module/animation/functions/interpolatePaths.js.map +1 -0
  317. package/lib/module/animation/functions/interpolateVector.js +7 -0
  318. package/lib/module/animation/functions/interpolateVector.js.map +1 -0
  319. package/lib/module/index.js +1 -0
  320. package/lib/module/index.js.map +1 -1
  321. package/lib/module/renderer/Canvas.js +15 -26
  322. package/lib/module/renderer/Canvas.js.map +1 -1
  323. package/lib/module/renderer/HostConfig.js +2 -2
  324. package/lib/module/renderer/HostConfig.js.map +1 -1
  325. package/lib/module/renderer/components/Blend.js +5 -2
  326. package/lib/module/renderer/components/Blend.js.map +1 -1
  327. package/lib/module/renderer/components/Compose.js +5 -2
  328. package/lib/module/renderer/components/Compose.js.map +1 -1
  329. package/lib/module/renderer/components/Group.js +7 -6
  330. package/lib/module/renderer/components/Group.js.map +1 -1
  331. package/lib/module/renderer/components/Mask.js +7 -3
  332. package/lib/module/renderer/components/Mask.js.map +1 -1
  333. package/lib/module/renderer/components/Paint.js +6 -3
  334. package/lib/module/renderer/components/Paint.js.map +1 -1
  335. package/lib/module/renderer/components/Picture.js.map +1 -1
  336. package/lib/module/renderer/components/backdrop/BackdropFilter.js +1 -1
  337. package/lib/module/renderer/components/backdrop/BackdropFilter.js.map +1 -1
  338. package/lib/module/renderer/components/colorFilters/BlendColor.js +6 -3
  339. package/lib/module/renderer/components/colorFilters/BlendColor.js.map +1 -1
  340. package/lib/module/renderer/components/colorFilters/Compose.js +2 -2
  341. package/lib/module/renderer/components/colorFilters/Compose.js.map +1 -1
  342. package/lib/module/renderer/components/colorFilters/Lerp.js +6 -3
  343. package/lib/module/renderer/components/colorFilters/Lerp.js.map +1 -1
  344. package/lib/module/renderer/components/colorFilters/LinearToSRGBGamma.js +5 -3
  345. package/lib/module/renderer/components/colorFilters/LinearToSRGBGamma.js.map +1 -1
  346. package/lib/module/renderer/components/colorFilters/LumaColorFilter.js +5 -3
  347. package/lib/module/renderer/components/colorFilters/LumaColorFilter.js.map +1 -1
  348. package/lib/module/renderer/components/colorFilters/Matrix.js +5 -3
  349. package/lib/module/renderer/components/colorFilters/Matrix.js.map +1 -1
  350. package/lib/module/renderer/components/colorFilters/SRGBToLinearGamma.js +5 -3
  351. package/lib/module/renderer/components/colorFilters/SRGBToLinearGamma.js.map +1 -1
  352. package/lib/module/renderer/components/image/BoxFit.js +7 -8
  353. package/lib/module/renderer/components/image/BoxFit.js.map +1 -1
  354. package/lib/module/renderer/components/image/Image.js +3 -2
  355. package/lib/module/renderer/components/image/Image.js.map +1 -1
  356. package/lib/module/renderer/components/image/ImageSVG.js +3 -2
  357. package/lib/module/renderer/components/image/ImageSVG.js.map +1 -1
  358. package/lib/module/renderer/components/image/ImageShader.js +10 -7
  359. package/lib/module/renderer/components/image/ImageShader.js.map +1 -1
  360. package/lib/module/renderer/components/imageFilters/Blur.js +7 -4
  361. package/lib/module/renderer/components/imageFilters/Blur.js.map +1 -1
  362. package/lib/module/renderer/components/imageFilters/DisplacementMap.js +7 -4
  363. package/lib/module/renderer/components/imageFilters/DisplacementMap.js.map +1 -1
  364. package/lib/module/renderer/components/imageFilters/InnerShadow.js +3 -3
  365. package/lib/module/renderer/components/imageFilters/InnerShadow.js.map +1 -1
  366. package/lib/module/renderer/components/imageFilters/Morphology.js +6 -4
  367. package/lib/module/renderer/components/imageFilters/Morphology.js.map +1 -1
  368. package/lib/module/renderer/components/imageFilters/Offset.js +5 -3
  369. package/lib/module/renderer/components/imageFilters/Offset.js.map +1 -1
  370. package/lib/module/renderer/components/imageFilters/RuntimeShader.js +13 -4
  371. package/lib/module/renderer/components/imageFilters/RuntimeShader.js.map +1 -1
  372. package/lib/module/renderer/components/imageFilters/Shadow.js +6 -5
  373. package/lib/module/renderer/components/imageFilters/Shadow.js.map +1 -1
  374. package/lib/module/renderer/components/imageFilters/getInput.js +2 -2
  375. package/lib/module/renderer/components/imageFilters/getInput.js.map +1 -1
  376. package/lib/module/renderer/components/maskFilters/Blur.js +5 -2
  377. package/lib/module/renderer/components/maskFilters/Blur.js.map +1 -1
  378. package/lib/module/renderer/components/pathEffects/Corner.js +5 -2
  379. package/lib/module/renderer/components/pathEffects/Corner.js.map +1 -1
  380. package/lib/module/renderer/components/pathEffects/Dash.js +5 -2
  381. package/lib/module/renderer/components/pathEffects/Dash.js.map +1 -1
  382. package/lib/module/renderer/components/pathEffects/Discrete.js +5 -2
  383. package/lib/module/renderer/components/pathEffects/Discrete.js.map +1 -1
  384. package/lib/module/renderer/components/pathEffects/Line2D.js +5 -2
  385. package/lib/module/renderer/components/pathEffects/Line2D.js.map +1 -1
  386. package/lib/module/renderer/components/pathEffects/Path1D.js +6 -3
  387. package/lib/module/renderer/components/pathEffects/Path1D.js.map +1 -1
  388. package/lib/module/renderer/components/pathEffects/Path2D.js +6 -3
  389. package/lib/module/renderer/components/pathEffects/Path2D.js.map +1 -1
  390. package/lib/module/renderer/components/pathEffects/Sum.js +5 -2
  391. package/lib/module/renderer/components/pathEffects/Sum.js.map +1 -1
  392. package/lib/module/renderer/components/shaders/Color.js +6 -3
  393. package/lib/module/renderer/components/shaders/Color.js.map +1 -1
  394. package/lib/module/renderer/components/shaders/FractalNoise.js +4 -2
  395. package/lib/module/renderer/components/shaders/FractalNoise.js.map +1 -1
  396. package/lib/module/renderer/components/shaders/Gradient.js +3 -3
  397. package/lib/module/renderer/components/shaders/Gradient.js.map +1 -1
  398. package/lib/module/renderer/components/shaders/LinearGradient.js +5 -3
  399. package/lib/module/renderer/components/shaders/LinearGradient.js.map +1 -1
  400. package/lib/module/renderer/components/shaders/RadialGradient.js +5 -3
  401. package/lib/module/renderer/components/shaders/RadialGradient.js.map +1 -1
  402. package/lib/module/renderer/components/shaders/Shader.js +6 -44
  403. package/lib/module/renderer/components/shaders/Shader.js.map +1 -1
  404. package/lib/module/renderer/components/shaders/SweepGradient.js +5 -3
  405. package/lib/module/renderer/components/shaders/SweepGradient.js.map +1 -1
  406. package/lib/module/renderer/components/shaders/Turbulence.js +4 -2
  407. package/lib/module/renderer/components/shaders/Turbulence.js.map +1 -1
  408. package/lib/module/renderer/components/shaders/TwoPointConicalGradient.js +5 -3
  409. package/lib/module/renderer/components/shaders/TwoPointConicalGradient.js.map +1 -1
  410. package/lib/module/renderer/components/shapes/Box.js +20 -19
  411. package/lib/module/renderer/components/shapes/Box.js.map +1 -1
  412. package/lib/module/renderer/components/shapes/Circle.js +7 -4
  413. package/lib/module/renderer/components/shapes/Circle.js.map +1 -1
  414. package/lib/module/renderer/components/shapes/DiffRect.js.map +1 -1
  415. package/lib/module/renderer/components/shapes/FitBox.js.map +1 -1
  416. package/lib/module/renderer/components/shapes/Line.js.map +1 -1
  417. package/lib/module/renderer/components/shapes/Oval.js +3 -2
  418. package/lib/module/renderer/components/shapes/Oval.js.map +1 -1
  419. package/lib/module/renderer/components/shapes/Patch.js +5 -3
  420. package/lib/module/renderer/components/shapes/Patch.js.map +1 -1
  421. package/lib/module/renderer/components/shapes/Path.js +4 -3
  422. package/lib/module/renderer/components/shapes/Path.js.map +1 -1
  423. package/lib/module/renderer/components/shapes/Points.js +1 -1
  424. package/lib/module/renderer/components/shapes/Points.js.map +1 -1
  425. package/lib/module/renderer/components/shapes/Rect.js +3 -2
  426. package/lib/module/renderer/components/shapes/Rect.js.map +1 -1
  427. package/lib/module/renderer/components/shapes/RoundedRect.js +3 -2
  428. package/lib/module/renderer/components/shapes/RoundedRect.js.map +1 -1
  429. package/lib/module/renderer/components/shapes/Vertices.js +5 -3
  430. package/lib/module/renderer/components/shapes/Vertices.js.map +1 -1
  431. package/lib/module/renderer/components/text/Glyphs.js +3 -2
  432. package/lib/module/renderer/components/text/Glyphs.js.map +1 -1
  433. package/lib/module/renderer/components/text/Text.js +3 -2
  434. package/lib/module/renderer/components/text/Text.js.map +1 -1
  435. package/lib/module/renderer/components/text/TextBlob.js.map +1 -1
  436. package/lib/module/renderer/components/text/TextPath.js +3 -3
  437. package/lib/module/renderer/components/text/TextPath.js.map +1 -1
  438. package/lib/module/renderer/index.js +1 -1
  439. package/lib/module/renderer/index.js.map +1 -1
  440. package/lib/module/renderer/nodes/Declaration.js.map +1 -1
  441. package/lib/module/renderer/nodes/Drawing.js +3 -3
  442. package/lib/module/renderer/nodes/Drawing.js.map +1 -1
  443. package/lib/module/renderer/nodes/Node.js.map +1 -1
  444. package/lib/module/renderer/processors/Animations/Animations.js.map +1 -1
  445. package/lib/module/renderer/processors/Circles.js +2 -4
  446. package/lib/module/renderer/processors/Circles.js.map +1 -1
  447. package/lib/module/renderer/processors/Clips.js +3 -3
  448. package/lib/module/renderer/processors/Clips.js.map +1 -1
  449. package/lib/module/{skia/core → renderer/processors}/Color.js +1 -2
  450. package/lib/module/renderer/processors/Color.js.map +1 -0
  451. package/lib/module/renderer/processors/Font.js +3 -2
  452. package/lib/module/renderer/processors/Font.js.map +1 -1
  453. package/lib/module/renderer/processors/Paint.js +8 -5
  454. package/lib/module/renderer/processors/Paint.js.map +1 -1
  455. package/lib/module/renderer/processors/Paths.js +2 -2
  456. package/lib/module/renderer/processors/Paths.js.map +1 -1
  457. package/lib/module/renderer/processors/Radius.js +2 -3
  458. package/lib/module/renderer/processors/Radius.js.map +1 -1
  459. package/lib/module/renderer/processors/Rects.js +7 -26
  460. package/lib/module/renderer/processors/Rects.js.map +1 -1
  461. package/lib/module/renderer/processors/Transform.js +24 -16
  462. package/lib/module/renderer/processors/Transform.js.map +1 -1
  463. package/lib/module/renderer/processors/index.js +2 -1
  464. package/lib/module/renderer/processors/index.js.map +1 -1
  465. package/lib/module/renderer/processors/math/Coordinates.js.map +1 -1
  466. package/lib/module/renderer/processors/math/Transforms.js.map +1 -1
  467. package/lib/module/renderer/processors/math/index.js +0 -2
  468. package/lib/module/renderer/processors/math/index.js.map +1 -1
  469. package/lib/module/renderer/useCanvas.js +13 -0
  470. package/lib/module/renderer/useCanvas.js.map +1 -0
  471. package/lib/module/skia/NativeSetup.js +2 -2
  472. package/lib/module/skia/NativeSetup.js.map +1 -1
  473. package/lib/module/skia/Skia.web.js +3 -0
  474. package/lib/module/skia/Skia.web.js.map +1 -0
  475. package/lib/module/skia/core/Data.js +11 -5
  476. package/lib/module/skia/core/Data.js.map +1 -1
  477. package/lib/module/skia/core/Font.js +2 -4
  478. package/lib/module/skia/core/Font.js.map +1 -1
  479. package/lib/module/skia/core/Matrix.js +4 -0
  480. package/lib/module/skia/core/Matrix.js.map +1 -0
  481. package/lib/module/skia/core/Paint.js +3 -7
  482. package/lib/module/skia/core/Paint.js.map +1 -1
  483. package/lib/module/skia/core/Path.js +11 -2
  484. package/lib/module/skia/core/Path.js.map +1 -1
  485. package/lib/module/skia/core/RRect.js +3 -0
  486. package/lib/module/skia/core/RRect.js.map +1 -0
  487. package/lib/module/skia/core/Rect.js +17 -0
  488. package/lib/module/skia/core/Rect.js.map +1 -0
  489. package/lib/module/{renderer/processors/math → skia/core}/Vector.js +2 -7
  490. package/lib/module/skia/core/Vector.js.map +1 -0
  491. package/lib/module/skia/core/index.js +5 -3
  492. package/lib/module/skia/core/index.js.map +1 -1
  493. package/lib/module/skia/types/Font/Font.js.map +1 -1
  494. package/lib/module/skia/types/Image/Image.js +5 -5
  495. package/lib/module/skia/types/Image/Image.js.map +1 -1
  496. package/lib/module/skia/types/Image/ImageFactory.js.map +1 -1
  497. package/lib/module/skia/types/Matrix.js +55 -0
  498. package/lib/module/skia/types/Matrix.js.map +1 -1
  499. package/lib/module/skia/types/Paint/Paint.js +3 -3
  500. package/lib/module/skia/types/Paint/Paint.js.map +1 -1
  501. package/lib/module/skia/types/Path/Path.js.map +1 -1
  502. package/lib/module/skia/types/Point.js.map +1 -1
  503. package/lib/module/skia/types/RRect.js +3 -1
  504. package/lib/module/skia/types/RRect.js.map +1 -1
  505. package/lib/module/skia/types/Shader/Shader.js +42 -0
  506. package/lib/module/skia/types/Shader/Shader.js.map +1 -1
  507. package/lib/module/skia/web/{api/Host.js → Host.js} +6 -0
  508. package/lib/module/skia/web/Host.js.map +1 -0
  509. package/lib/module/skia/web/{api/JsiSkCanvas.js → JsiSkCanvas.js} +20 -7
  510. package/lib/module/skia/web/JsiSkCanvas.js.map +1 -0
  511. package/lib/module/skia/web/{api/JsiSkColor.js → JsiSkColor.js} +164 -4
  512. package/lib/module/skia/web/JsiSkColor.js.map +1 -0
  513. package/lib/module/skia/web/{api/JsiSkColorFilter.js → JsiSkColorFilter.js} +0 -0
  514. package/lib/module/skia/web/{api/JsiSkColorFilter.js.map → JsiSkColorFilter.js.map} +1 -1
  515. package/lib/module/skia/web/JsiSkColorFilterFactory.js +37 -0
  516. package/lib/module/skia/web/JsiSkColorFilterFactory.js.map +1 -0
  517. package/lib/module/skia/web/JsiSkContourMeasure.js +31 -0
  518. package/lib/module/skia/web/JsiSkContourMeasure.js.map +1 -0
  519. package/lib/module/skia/web/JsiSkContourMeasureIter.js +19 -0
  520. package/lib/module/skia/web/JsiSkContourMeasureIter.js.map +1 -0
  521. package/lib/module/skia/web/JsiSkData.js +8 -0
  522. package/lib/module/skia/web/JsiSkData.js.map +1 -0
  523. package/lib/module/skia/web/JsiSkDataFactory.js +33 -0
  524. package/lib/module/skia/web/JsiSkDataFactory.js.map +1 -0
  525. package/lib/module/skia/web/JsiSkFont.js +101 -0
  526. package/lib/module/skia/web/JsiSkFont.js.map +1 -0
  527. package/lib/module/skia/web/JsiSkFontMgr.js +23 -0
  528. package/lib/module/skia/web/JsiSkFontMgr.js.map +1 -0
  529. package/lib/module/skia/web/JsiSkFontMgrFactory.js +14 -0
  530. package/lib/module/skia/web/JsiSkFontMgrFactory.js.map +1 -0
  531. package/lib/module/skia/web/JsiSkImage.js +49 -0
  532. package/lib/module/skia/web/JsiSkImage.js.map +1 -0
  533. package/lib/module/skia/web/JsiSkImageFactory.js +36 -0
  534. package/lib/module/skia/web/JsiSkImageFactory.js.map +1 -0
  535. package/lib/module/skia/web/JsiSkImageFilter.js +8 -0
  536. package/lib/module/skia/web/JsiSkImageFilter.js.map +1 -0
  537. package/lib/module/skia/web/JsiSkImageFilterFactory.js +57 -0
  538. package/lib/module/skia/web/JsiSkImageFilterFactory.js.map +1 -0
  539. package/lib/module/skia/web/JsiSkMaskFilter.js +8 -0
  540. package/lib/module/skia/web/JsiSkMaskFilter.js.map +1 -0
  541. package/lib/module/skia/web/JsiSkMaskFilterFactory.js +13 -0
  542. package/lib/module/skia/web/JsiSkMaskFilterFactory.js.map +1 -0
  543. package/lib/module/skia/web/JsiSkMatrix.js +28 -0
  544. package/lib/module/skia/web/JsiSkMatrix.js.map +1 -0
  545. package/lib/module/skia/web/{api/JsiSkPaint.js → JsiSkPaint.js} +5 -10
  546. package/lib/module/skia/web/JsiSkPaint.js.map +1 -0
  547. package/lib/module/skia/web/JsiSkPath.js +324 -0
  548. package/lib/module/skia/web/JsiSkPath.js.map +1 -0
  549. package/lib/module/skia/web/JsiSkPathEffect.js +8 -0
  550. package/lib/module/skia/web/JsiSkPathEffect.js.map +1 -0
  551. package/lib/module/skia/web/JsiSkPathEffectFactory.js +67 -0
  552. package/lib/module/skia/web/JsiSkPathEffectFactory.js.map +1 -0
  553. package/lib/module/skia/web/JsiSkPathFactory.js +47 -0
  554. package/lib/module/skia/web/JsiSkPathFactory.js.map +1 -0
  555. package/lib/module/skia/web/JsiSkPicture.js +18 -0
  556. package/lib/module/skia/web/JsiSkPicture.js.map +1 -0
  557. package/lib/module/skia/web/JsiSkPictureFactory.js +19 -0
  558. package/lib/module/skia/web/JsiSkPictureFactory.js.map +1 -0
  559. package/lib/module/skia/web/JsiSkPictureRecorder.js +18 -0
  560. package/lib/module/skia/web/JsiSkPictureRecorder.js.map +1 -0
  561. package/lib/module/skia/web/JsiSkPoint.js +16 -0
  562. package/lib/module/skia/web/JsiSkPoint.js.map +1 -0
  563. package/lib/module/skia/web/JsiSkRRect.js +21 -0
  564. package/lib/module/skia/web/JsiSkRRect.js.map +1 -0
  565. package/lib/module/skia/web/JsiSkRSXform.js +8 -0
  566. package/lib/module/skia/web/JsiSkRSXform.js.map +1 -0
  567. package/lib/module/skia/web/{api/JsiSkRect.js → JsiSkRect.js} +8 -0
  568. package/lib/module/skia/web/JsiSkRect.js.map +1 -0
  569. package/lib/module/skia/web/JsiSkRuntimeEffect.js +33 -0
  570. package/lib/module/skia/web/JsiSkRuntimeEffect.js.map +1 -0
  571. package/lib/module/skia/web/JsiSkRuntimeEffectFactory.js +19 -0
  572. package/lib/module/skia/web/JsiSkRuntimeEffectFactory.js.map +1 -0
  573. package/lib/module/skia/web/JsiSkSVGFactory.js +16 -0
  574. package/lib/module/skia/web/JsiSkSVGFactory.js.map +1 -0
  575. package/lib/module/skia/web/JsiSkShader.js +8 -0
  576. package/lib/module/skia/web/JsiSkShader.js.map +1 -0
  577. package/lib/module/skia/web/JsiSkShaderFactory.js +41 -0
  578. package/lib/module/skia/web/JsiSkShaderFactory.js.map +1 -0
  579. package/lib/module/skia/web/{api/JsiSkSurface.js → JsiSkSurface.js} +0 -0
  580. package/lib/module/skia/web/{api/JsiSkSurface.js.map → JsiSkSurface.js.map} +1 -1
  581. package/lib/module/skia/web/{api/JsiSkSurfaceFactory.js → JsiSkSurfaceFactory.js} +0 -0
  582. package/lib/module/skia/web/{api/JsiSkSurfaceFactory.js.map → JsiSkSurfaceFactory.js.map} +1 -1
  583. package/lib/module/skia/web/JsiSkTextBlob.js +8 -0
  584. package/lib/module/skia/web/JsiSkTextBlob.js.map +1 -0
  585. package/lib/module/skia/web/JsiSkTextBlobFactory.js +25 -0
  586. package/lib/module/skia/web/JsiSkTextBlobFactory.js.map +1 -0
  587. package/lib/module/skia/web/JsiSkTypeface.js +18 -0
  588. package/lib/module/skia/web/JsiSkTypeface.js.map +1 -0
  589. package/lib/module/skia/web/JsiSkTypefaceFactory.js +19 -0
  590. package/lib/module/skia/web/JsiSkTypefaceFactory.js.map +1 -0
  591. package/lib/module/skia/web/JsiSkVertices.js +17 -0
  592. package/lib/module/skia/web/JsiSkVertices.js.map +1 -0
  593. package/lib/module/skia/web/JsiSkVerticesFactory.js +39 -0
  594. package/lib/module/skia/web/JsiSkVerticesFactory.js.map +1 -0
  595. package/lib/module/skia/web/JsiSkia.js +61 -0
  596. package/lib/module/skia/web/JsiSkia.js.map +1 -0
  597. package/lib/module/skia/web/index.js +1 -1
  598. package/lib/module/skia/web/index.js.map +1 -1
  599. package/lib/module/values/web/api.js +2 -2
  600. package/lib/module/values/web/api.js.map +1 -1
  601. package/lib/module/views/SkiaView.web.js +202 -0
  602. package/lib/module/views/SkiaView.web.js.map +1 -0
  603. package/lib/module/views/types.js.map +1 -1
  604. package/lib/module/views/useTouchHandler.js +64 -43
  605. package/lib/module/views/useTouchHandler.js.map +1 -1
  606. package/lib/module/web/index.js +10 -0
  607. package/lib/module/web/index.js.map +1 -0
  608. package/lib/typescript/src/animation/functions/index.d.ts +4 -2
  609. package/lib/typescript/src/animation/functions/interpolatePaths.d.ts +17 -0
  610. package/lib/typescript/src/animation/functions/interpolateVector.d.ts +10 -0
  611. package/lib/typescript/src/index.d.ts +1 -0
  612. package/lib/typescript/src/renderer/Canvas.d.ts +3 -14
  613. package/lib/typescript/src/renderer/DrawingContext.d.ts +3 -3
  614. package/lib/typescript/src/renderer/components/Blend.d.ts +1 -1
  615. package/lib/typescript/src/renderer/components/Group.d.ts +1 -1
  616. package/lib/typescript/src/renderer/components/Paint.d.ts +1 -1
  617. package/lib/typescript/src/renderer/components/Picture.d.ts +1 -1
  618. package/lib/typescript/src/renderer/components/colorFilters/BlendColor.d.ts +2 -2
  619. package/lib/typescript/src/renderer/components/colorFilters/Compose.d.ts +2 -2
  620. package/lib/typescript/src/renderer/components/image/BoxFit.d.ts +13 -3
  621. package/lib/typescript/src/renderer/components/image/Image.d.ts +1 -1
  622. package/lib/typescript/src/renderer/components/image/ImageSVG.d.ts +1 -1
  623. package/lib/typescript/src/renderer/components/image/ImageShader.d.ts +2 -2
  624. package/lib/typescript/src/renderer/components/imageFilters/Blur.d.ts +1 -1
  625. package/lib/typescript/src/renderer/components/imageFilters/DisplacementMap.d.ts +1 -1
  626. package/lib/typescript/src/renderer/components/imageFilters/InnerShadow.d.ts +2 -2
  627. package/lib/typescript/src/renderer/components/imageFilters/RuntimeShader.d.ts +2 -1
  628. package/lib/typescript/src/renderer/components/imageFilters/Shadow.d.ts +1 -1
  629. package/lib/typescript/src/renderer/components/imageFilters/getInput.d.ts +2 -1
  630. package/lib/typescript/src/renderer/components/maskFilters/Blur.d.ts +1 -1
  631. package/lib/typescript/src/renderer/components/pathEffects/Line2D.d.ts +1 -1
  632. package/lib/typescript/src/renderer/components/pathEffects/Path1D.d.ts +1 -1
  633. package/lib/typescript/src/renderer/components/pathEffects/Path2D.d.ts +1 -1
  634. package/lib/typescript/src/renderer/components/shaders/Color.d.ts +1 -1
  635. package/lib/typescript/src/renderer/components/shaders/Gradient.d.ts +4 -4
  636. package/lib/typescript/src/renderer/components/shaders/LinearGradient.d.ts +2 -1
  637. package/lib/typescript/src/renderer/components/shaders/RadialGradient.d.ts +2 -1
  638. package/lib/typescript/src/renderer/components/shaders/Shader.d.ts +2 -8
  639. package/lib/typescript/src/renderer/components/shaders/SweepGradient.d.ts +2 -1
  640. package/lib/typescript/src/renderer/components/shaders/TwoPointConicalGradient.d.ts +2 -1
  641. package/lib/typescript/src/renderer/components/shapes/Box.d.ts +1 -1
  642. package/lib/typescript/src/renderer/components/shapes/Circle.d.ts +4 -1
  643. package/lib/typescript/src/renderer/components/shapes/DiffRect.d.ts +1 -1
  644. package/lib/typescript/src/renderer/components/shapes/FitBox.d.ts +1 -1
  645. package/lib/typescript/src/renderer/components/shapes/Line.d.ts +2 -1
  646. package/lib/typescript/src/renderer/components/shapes/Patch.d.ts +3 -3
  647. package/lib/typescript/src/renderer/components/shapes/Path.d.ts +1 -1
  648. package/lib/typescript/src/renderer/components/shapes/Points.d.ts +2 -2
  649. package/lib/typescript/src/renderer/components/shapes/Vertices.d.ts +2 -2
  650. package/lib/typescript/src/renderer/components/text/Glyphs.d.ts +1 -1
  651. package/lib/typescript/src/renderer/components/text/TextBlob.d.ts +1 -1
  652. package/lib/typescript/src/renderer/components/text/TextPath.d.ts +1 -1
  653. package/lib/typescript/src/renderer/index.d.ts +1 -1
  654. package/lib/typescript/src/renderer/nodes/Declaration.d.ts +1 -1
  655. package/lib/typescript/src/renderer/nodes/Node.d.ts +1 -1
  656. package/lib/typescript/src/renderer/processors/Animations/Animations.d.ts +0 -2
  657. package/lib/typescript/src/renderer/processors/Circles.d.ts +2 -2
  658. package/lib/typescript/src/renderer/processors/Clips.d.ts +2 -2
  659. package/lib/typescript/src/{skia/core → renderer/processors}/Color.d.ts +2 -2
  660. package/lib/typescript/src/renderer/processors/Font.d.ts +2 -2
  661. package/lib/typescript/src/renderer/processors/Paint.d.ts +3 -3
  662. package/lib/typescript/src/renderer/processors/Paths.d.ts +2 -2
  663. package/lib/typescript/src/renderer/processors/Radius.d.ts +2 -2
  664. package/lib/typescript/src/renderer/processors/Rects.d.ts +3 -14
  665. package/lib/typescript/src/renderer/processors/Transform.d.ts +3 -4
  666. package/lib/typescript/src/renderer/processors/index.d.ts +2 -1
  667. package/lib/typescript/src/renderer/processors/math/Coordinates.d.ts +1 -1
  668. package/lib/typescript/src/renderer/processors/math/Transforms.d.ts +1 -1
  669. package/lib/typescript/src/renderer/processors/math/index.d.ts +0 -2
  670. package/lib/typescript/src/renderer/useCanvas.d.ts +14 -0
  671. package/lib/typescript/src/skia/Skia.web.d.ts +1 -0
  672. package/lib/typescript/src/skia/core/Data.d.ts +4 -4
  673. package/lib/typescript/src/skia/core/Matrix.d.ts +2 -0
  674. package/lib/typescript/src/skia/core/Paint.d.ts +0 -1
  675. package/lib/typescript/src/skia/core/RRect.d.ts +2 -0
  676. package/lib/typescript/src/skia/core/Rect.d.ts +8 -0
  677. package/lib/typescript/src/skia/core/Vector.d.ts +12 -0
  678. package/lib/typescript/src/skia/core/index.d.ts +5 -3
  679. package/lib/typescript/src/skia/types/ContourMeasure.d.ts +2 -4
  680. package/lib/typescript/src/skia/types/Data/Data.d.ts +1 -1
  681. package/lib/typescript/src/skia/types/Data/DataFactory.d.ts +4 -4
  682. package/lib/typescript/src/skia/types/Font/Font.d.ts +8 -9
  683. package/lib/typescript/src/skia/types/FontMgr/FontMgr.d.ts +1 -1
  684. package/lib/typescript/src/skia/types/FontMgr/FontMgrFactory.d.ts +2 -2
  685. package/lib/typescript/src/skia/types/Image/Image.d.ts +5 -5
  686. package/lib/typescript/src/skia/types/Image/ImageFactory.d.ts +3 -3
  687. package/lib/typescript/src/skia/types/Matrix.d.ts +15 -14
  688. package/lib/typescript/src/skia/types/Paint/Paint.d.ts +3 -3
  689. package/lib/typescript/src/skia/types/Path/Path.d.ts +27 -22
  690. package/lib/typescript/src/skia/types/Path/PathFactory.d.ts +5 -0
  691. package/lib/typescript/src/skia/types/Picture/Picture.d.ts +2 -2
  692. package/lib/typescript/src/skia/types/Point.d.ts +1 -0
  693. package/lib/typescript/src/skia/types/RRect.d.ts +1 -0
  694. package/lib/typescript/src/skia/types/RuntimeEffect/RuntimeEffect.d.ts +3 -1
  695. package/lib/typescript/src/skia/types/SVG/SVGFactory.d.ts +2 -2
  696. package/lib/typescript/src/skia/types/Shader/Shader.d.ts +8 -0
  697. package/lib/typescript/src/skia/types/Skia.d.ts +1 -1
  698. package/lib/typescript/src/skia/types/Typeface/TypefaceFactory.d.ts +2 -2
  699. package/lib/typescript/src/skia/web/{api/Host.d.ts → Host.d.ts} +4 -1
  700. package/lib/typescript/src/skia/web/{api/JsiSkCanvas.d.ts → JsiSkCanvas.d.ts} +1 -1
  701. package/lib/typescript/src/skia/web/JsiSkColor.d.ts +2 -0
  702. package/lib/typescript/src/skia/web/{api/JsiSkColorFilter.d.ts → JsiSkColorFilter.d.ts} +1 -1
  703. package/lib/typescript/src/skia/web/JsiSkColorFilterFactory.d.ts +14 -0
  704. package/lib/typescript/src/skia/web/JsiSkContourMeasure.d.ts +16 -0
  705. package/lib/typescript/src/skia/web/JsiSkContourMeasureIter.d.ts +8 -0
  706. package/lib/typescript/src/skia/web/JsiSkData.d.ts +8 -0
  707. package/lib/typescript/src/skia/web/JsiSkDataFactory.d.ts +19 -0
  708. package/lib/typescript/src/skia/web/JsiSkFont.d.ts +33 -0
  709. package/lib/typescript/src/skia/web/JsiSkFontMgr.d.ts +9 -0
  710. package/lib/typescript/src/skia/web/JsiSkFontMgrFactory.d.ts +8 -0
  711. package/lib/typescript/src/skia/web/{api/JsiSkImage.d.ts → JsiSkImage.d.ts} +4 -4
  712. package/lib/typescript/src/skia/web/JsiSkImageFactory.d.ts +10 -0
  713. package/lib/typescript/src/skia/web/JsiSkImageFilter.d.ts +6 -0
  714. package/lib/typescript/src/skia/web/JsiSkImageFilterFactory.d.ts +19 -0
  715. package/lib/typescript/src/skia/web/JsiSkMaskFilter.d.ts +6 -0
  716. package/lib/typescript/src/skia/web/JsiSkMaskFilterFactory.d.ts +9 -0
  717. package/lib/typescript/src/skia/web/JsiSkMatrix.d.ts +11 -0
  718. package/lib/typescript/src/skia/web/{api/JsiSkPaint.d.ts → JsiSkPaint.d.ts} +1 -1
  719. package/lib/typescript/src/skia/web/JsiSkPath.d.ts +56 -0
  720. package/lib/typescript/src/skia/web/JsiSkPathEffect.d.ts +6 -0
  721. package/lib/typescript/src/skia/web/JsiSkPathEffectFactory.d.ts +15 -0
  722. package/lib/typescript/src/skia/web/JsiSkPathFactory.d.ts +13 -0
  723. package/lib/typescript/src/skia/web/JsiSkPicture.d.ts +9 -0
  724. package/lib/typescript/src/skia/web/JsiSkPictureFactory.d.ts +8 -0
  725. package/lib/typescript/src/skia/web/JsiSkPictureRecorder.d.ts +11 -0
  726. package/lib/typescript/src/skia/web/JsiSkPoint.d.ts +8 -0
  727. package/lib/typescript/src/skia/web/JsiSkRRect.d.ts +10 -0
  728. package/lib/typescript/src/skia/web/JsiSkRSXform.d.ts +8 -0
  729. package/lib/typescript/src/skia/web/{api/JsiSkRect.d.ts → JsiSkRect.d.ts} +2 -1
  730. package/lib/typescript/src/skia/web/JsiSkRuntimeEffect.d.ts +14 -0
  731. package/lib/typescript/src/skia/web/JsiSkRuntimeEffectFactory.d.ts +8 -0
  732. package/lib/typescript/src/skia/web/JsiSkSVGFactory.d.ts +9 -0
  733. package/lib/typescript/src/skia/web/JsiSkShader.d.ts +6 -0
  734. package/lib/typescript/src/skia/web/JsiSkShaderFactory.d.ts +16 -0
  735. package/lib/typescript/src/skia/web/{api/JsiSkSurface.d.ts → JsiSkSurface.d.ts} +1 -1
  736. package/lib/typescript/src/skia/web/{api/JsiSkSurfaceFactory.d.ts → JsiSkSurfaceFactory.d.ts} +1 -1
  737. package/lib/typescript/src/skia/web/JsiSkTextBlob.d.ts +6 -0
  738. package/lib/typescript/src/skia/web/JsiSkTextBlobFactory.d.ts +12 -0
  739. package/lib/typescript/src/skia/web/JsiSkTypeface.d.ts +8 -0
  740. package/lib/typescript/src/skia/web/JsiSkTypefaceFactory.d.ts +8 -0
  741. package/lib/typescript/src/skia/web/JsiSkVertices.d.ts +9 -0
  742. package/lib/typescript/src/skia/web/JsiSkVerticesFactory.d.ts +4 -0
  743. package/lib/typescript/src/skia/web/JsiSkia.d.ts +3 -0
  744. package/lib/typescript/src/skia/web/index.d.ts +1 -1
  745. package/lib/typescript/src/views/SkiaView.web.d.ts +56 -0
  746. package/lib/typescript/src/views/types.d.ts +1 -0
  747. package/lib/typescript/src/views/useTouchHandler.d.ts +11 -1
  748. package/lib/typescript/src/web/index.d.ts +5 -0
  749. package/package.json +4 -5
  750. package/src/animation/functions/index.ts +4 -2
  751. package/src/animation/functions/interpolatePaths.ts +38 -0
  752. package/src/animation/functions/interpolateVector.ts +26 -0
  753. package/src/index.ts +1 -0
  754. package/src/renderer/Canvas.tsx +13 -35
  755. package/src/renderer/DrawingContext.ts +3 -4
  756. package/src/renderer/HostConfig.ts +2 -2
  757. package/src/renderer/components/Blend.tsx +12 -10
  758. package/src/renderer/components/Compose.tsx +2 -2
  759. package/src/renderer/components/Group.tsx +11 -6
  760. package/src/renderer/components/Mask.tsx +5 -3
  761. package/src/renderer/components/Paint.tsx +5 -4
  762. package/src/renderer/components/Picture.tsx +1 -1
  763. package/src/renderer/components/backdrop/BackdropFilter.tsx +1 -1
  764. package/src/renderer/components/colorFilters/BlendColor.tsx +4 -4
  765. package/src/renderer/components/colorFilters/Compose.ts +3 -2
  766. package/src/renderer/components/colorFilters/Lerp.tsx +3 -2
  767. package/src/renderer/components/colorFilters/LinearToSRGBGamma.tsx +2 -3
  768. package/src/renderer/components/colorFilters/LumaColorFilter.tsx +2 -3
  769. package/src/renderer/components/colorFilters/Matrix.tsx +2 -3
  770. package/src/renderer/components/colorFilters/SRGBToLinearGamma.tsx +2 -3
  771. package/src/renderer/components/image/BoxFit.ts +7 -13
  772. package/src/renderer/components/image/Image.tsx +3 -3
  773. package/src/renderer/components/image/ImageSVG.tsx +3 -3
  774. package/src/renderer/components/image/ImageShader.tsx +8 -7
  775. package/src/renderer/components/imageFilters/Blur.tsx +12 -10
  776. package/src/renderer/components/imageFilters/DisplacementMap.tsx +4 -4
  777. package/src/renderer/components/imageFilters/InnerShadow.tsx +4 -3
  778. package/src/renderer/components/imageFilters/Morphology.tsx +3 -4
  779. package/src/renderer/components/imageFilters/Offset.tsx +5 -4
  780. package/src/renderer/components/imageFilters/RuntimeShader.tsx +12 -4
  781. package/src/renderer/components/imageFilters/Shadow.tsx +10 -6
  782. package/src/renderer/components/imageFilters/getInput.ts +3 -2
  783. package/src/renderer/components/maskFilters/Blur.tsx +2 -2
  784. package/src/renderer/components/pathEffects/Corner.tsx +2 -2
  785. package/src/renderer/components/pathEffects/Dash.tsx +2 -2
  786. package/src/renderer/components/pathEffects/Discrete.tsx +2 -2
  787. package/src/renderer/components/pathEffects/Line2D.tsx +3 -3
  788. package/src/renderer/components/pathEffects/Path1D.tsx +3 -3
  789. package/src/renderer/components/pathEffects/Path2D.tsx +4 -4
  790. package/src/renderer/components/pathEffects/Sum.tsx +7 -5
  791. package/src/renderer/components/shaders/Color.tsx +7 -5
  792. package/src/renderer/components/shaders/FractalNoise.tsx +1 -2
  793. package/src/renderer/components/shaders/Gradient.ts +7 -10
  794. package/src/renderer/components/shaders/LinearGradient.tsx +4 -4
  795. package/src/renderer/components/shaders/RadialGradient.tsx +4 -4
  796. package/src/renderer/components/shaders/Shader.tsx +6 -56
  797. package/src/renderer/components/shaders/SweepGradient.tsx +4 -4
  798. package/src/renderer/components/shaders/Turbulence.tsx +1 -2
  799. package/src/renderer/components/shaders/TwoPointConicalGradient.tsx +4 -4
  800. package/src/renderer/components/shapes/Box.tsx +36 -17
  801. package/src/renderer/components/shapes/Circle.tsx +3 -4
  802. package/src/renderer/components/shapes/DiffRect.tsx +1 -1
  803. package/src/renderer/components/shapes/FitBox.tsx +1 -1
  804. package/src/renderer/components/shapes/Line.tsx +2 -1
  805. package/src/renderer/components/shapes/Oval.tsx +6 -4
  806. package/src/renderer/components/shapes/Patch.tsx +6 -10
  807. package/src/renderer/components/shapes/Path.tsx +3 -3
  808. package/src/renderer/components/shapes/Points.tsx +2 -2
  809. package/src/renderer/components/shapes/Rect.tsx +6 -4
  810. package/src/renderer/components/shapes/RoundedRect.tsx +2 -2
  811. package/src/renderer/components/shapes/Vertices.tsx +5 -4
  812. package/src/renderer/components/text/Glyphs.tsx +6 -3
  813. package/src/renderer/components/text/Text.tsx +2 -2
  814. package/src/renderer/components/text/TextBlob.tsx +1 -1
  815. package/src/renderer/components/text/TextPath.tsx +3 -4
  816. package/src/renderer/index.ts +1 -1
  817. package/src/renderer/nodes/Declaration.tsx +1 -1
  818. package/src/renderer/nodes/Drawing.tsx +3 -2
  819. package/src/renderer/nodes/Node.ts +1 -1
  820. package/src/renderer/processors/Animations/Animations.ts +0 -3
  821. package/src/renderer/processors/Circles.ts +4 -4
  822. package/src/renderer/processors/Clips.ts +9 -4
  823. package/src/{skia/core → renderer/processors}/Color.ts +2 -3
  824. package/src/renderer/processors/Font.ts +10 -3
  825. package/src/renderer/processors/Paint.ts +12 -7
  826. package/src/renderer/processors/Paths.ts +3 -3
  827. package/src/renderer/processors/Radius.ts +3 -4
  828. package/src/renderer/processors/Rects.ts +10 -45
  829. package/src/renderer/processors/Transform.ts +28 -19
  830. package/src/renderer/processors/index.ts +2 -1
  831. package/src/renderer/processors/math/Coordinates.ts +1 -1
  832. package/src/renderer/processors/math/Transforms.ts +2 -1
  833. package/src/renderer/processors/math/index.ts +0 -2
  834. package/src/renderer/useCanvas.ts +21 -0
  835. package/src/skia/NativeSetup.ts +2 -2
  836. package/src/skia/Skia.web.ts +3 -0
  837. package/src/skia/core/Data.ts +17 -14
  838. package/src/skia/core/Font.ts +2 -4
  839. package/src/skia/core/Matrix.ts +6 -0
  840. package/src/skia/core/Paint.ts +2 -6
  841. package/src/skia/core/Path.ts +14 -6
  842. package/src/skia/core/RRect.tsx +5 -0
  843. package/src/skia/core/Rect.ts +33 -0
  844. package/src/skia/core/Vector.ts +11 -0
  845. package/src/skia/core/index.ts +5 -3
  846. package/src/skia/types/ContourMeasure.tsx +2 -4
  847. package/src/skia/types/Data/Data.ts +1 -1
  848. package/src/skia/types/Data/DataFactory.ts +4 -4
  849. package/src/skia/types/Font/Font.ts +9 -14
  850. package/src/skia/types/FontMgr/FontMgr.ts +1 -1
  851. package/src/skia/types/FontMgr/FontMgrFactory.ts +2 -2
  852. package/src/skia/types/Image/Image.ts +4 -4
  853. package/src/skia/types/Image/ImageFactory.ts +3 -3
  854. package/src/skia/types/Matrix.ts +79 -14
  855. package/src/skia/types/Paint/Paint.ts +1 -1
  856. package/src/skia/types/Path/Path.ts +33 -23
  857. package/src/skia/types/Path/PathFactory.ts +7 -0
  858. package/src/skia/types/Picture/Picture.ts +2 -2
  859. package/src/skia/types/Point.ts +2 -0
  860. package/src/skia/types/RRect.ts +5 -0
  861. package/src/skia/types/RuntimeEffect/RuntimeEffect.ts +4 -1
  862. package/src/skia/types/SVG/SVGFactory.ts +2 -2
  863. package/src/skia/types/Shader/Shader.ts +59 -0
  864. package/src/skia/types/Skia.ts +1 -1
  865. package/src/skia/types/Typeface/TypefaceFactory.ts +2 -2
  866. package/src/skia/web/{api/Host.ts → Host.ts} +7 -1
  867. package/src/skia/web/{api/JsiSkCanvas.ts → JsiSkCanvas.ts} +20 -12
  868. package/src/skia/web/{api/JsiSkColor.ts → JsiSkColor.ts} +152 -6
  869. package/src/skia/web/{api/JsiSkColorFilter.ts → JsiSkColorFilter.ts} +1 -1
  870. package/src/skia/web/JsiSkColorFilterFactory.ts +67 -0
  871. package/src/skia/web/JsiSkContourMeasure.ts +35 -0
  872. package/src/skia/web/JsiSkContourMeasureIter.ts +23 -0
  873. package/src/skia/web/JsiSkData.ts +13 -0
  874. package/src/skia/web/JsiSkDataFactory.ts +35 -0
  875. package/src/skia/web/JsiSkFont.ts +128 -0
  876. package/src/skia/web/JsiSkFontMgr.ts +38 -0
  877. package/src/skia/web/JsiSkFontMgrFactory.ts +18 -0
  878. package/src/skia/web/JsiSkImage.ts +87 -0
  879. package/src/skia/web/JsiSkImageFactory.ts +40 -0
  880. package/src/skia/web/JsiSkImageFilter.ts +14 -0
  881. package/src/skia/web/JsiSkImageFilterFactory.ts +144 -0
  882. package/src/skia/web/JsiSkMaskFilter.ts +14 -0
  883. package/src/skia/web/JsiSkMaskFilterFactory.ts +20 -0
  884. package/src/skia/web/JsiSkMatrix.ts +54 -0
  885. package/src/skia/web/{api/JsiSkPaint.ts → JsiSkPaint.ts} +7 -6
  886. package/src/skia/web/JsiSkPath.ts +386 -0
  887. package/src/skia/web/JsiSkPathEffect.ts +14 -0
  888. package/src/skia/web/JsiSkPathEffectFactory.ts +85 -0
  889. package/src/skia/web/JsiSkPathFactory.ts +54 -0
  890. package/src/skia/web/JsiSkPicture.ts +45 -0
  891. package/src/skia/web/JsiSkPictureFactory.ts +20 -0
  892. package/src/skia/web/JsiSkPictureRecorder.ts +31 -0
  893. package/src/skia/web/JsiSkPoint.ts +19 -0
  894. package/src/skia/web/JsiSkRRect.ts +27 -0
  895. package/src/skia/web/JsiSkRSXform.ts +16 -0
  896. package/src/skia/web/{api/JsiSkRect.ts → JsiSkRect.ts} +11 -1
  897. package/src/skia/web/JsiSkRuntimeEffect.ts +57 -0
  898. package/src/skia/web/JsiSkRuntimeEffectFactory.ts +23 -0
  899. package/src/skia/web/JsiSkSVGFactory.ts +20 -0
  900. package/src/skia/web/JsiSkShader.ts +14 -0
  901. package/src/skia/web/JsiSkShaderFactory.ts +181 -0
  902. package/src/skia/web/{api/JsiSkSurface.ts → JsiSkSurface.ts} +1 -1
  903. package/src/skia/web/{api/JsiSkSurfaceFactory.ts → JsiSkSurfaceFactory.ts} +1 -1
  904. package/src/skia/web/JsiSkTextBlob.ts +14 -0
  905. package/src/skia/web/JsiSkTextBlobFactory.ts +49 -0
  906. package/src/skia/web/JsiSkTypeface.ts +28 -0
  907. package/src/skia/web/JsiSkTypefaceFactory.tsx +20 -0
  908. package/src/skia/web/JsiSkVertices.ts +23 -0
  909. package/src/skia/web/JsiSkVerticesFactory.ts +41 -0
  910. package/src/skia/web/JsiSkia.ts +98 -0
  911. package/src/skia/web/index.ts +1 -1
  912. package/src/values/web/api.ts +2 -2
  913. package/src/views/SkiaView.web.tsx +190 -0
  914. package/src/views/types.ts +1 -0
  915. package/src/views/useTouchHandler.ts +82 -51
  916. package/src/web/index.ts +15 -0
  917. package/lib/commonjs/renderer/processors/math/Matrix3.js +0 -66
  918. package/lib/commonjs/renderer/processors/math/Matrix3.js.map +0 -1
  919. package/lib/commonjs/renderer/processors/math/Vector.js +0 -60
  920. package/lib/commonjs/renderer/processors/math/Vector.js.map +0 -1
  921. package/lib/commonjs/skia/core/Color.js.map +0 -1
  922. package/lib/commonjs/skia/core/Shader.js +0 -18
  923. package/lib/commonjs/skia/core/Shader.js.map +0 -1
  924. package/lib/commonjs/skia/web/api/Host.js.map +0 -1
  925. package/lib/commonjs/skia/web/api/JsiSkCanvas.js.map +0 -1
  926. package/lib/commonjs/skia/web/api/JsiSkColor.js.map +0 -1
  927. package/lib/commonjs/skia/web/api/JsiSkImage.js.map +0 -1
  928. package/lib/commonjs/skia/web/api/JsiSkPaint.js.map +0 -1
  929. package/lib/commonjs/skia/web/api/JsiSkRect.js.map +0 -1
  930. package/lib/commonjs/skia/web/api/index.js +0 -26
  931. package/lib/commonjs/skia/web/api/index.js.map +0 -1
  932. package/lib/module/renderer/processors/math/Matrix3.js +0 -55
  933. package/lib/module/renderer/processors/math/Matrix3.js.map +0 -1
  934. package/lib/module/renderer/processors/math/Vector.js.map +0 -1
  935. package/lib/module/skia/core/Color.js.map +0 -1
  936. package/lib/module/skia/core/Shader.js +0 -7
  937. package/lib/module/skia/core/Shader.js.map +0 -1
  938. package/lib/module/skia/web/api/Host.js.map +0 -1
  939. package/lib/module/skia/web/api/JsiSkCanvas.js.map +0 -1
  940. package/lib/module/skia/web/api/JsiSkColor.js.map +0 -1
  941. package/lib/module/skia/web/api/JsiSkImage.js +0 -46
  942. package/lib/module/skia/web/api/JsiSkImage.js.map +0 -1
  943. package/lib/module/skia/web/api/JsiSkPaint.js.map +0 -1
  944. package/lib/module/skia/web/api/JsiSkRect.js.map +0 -1
  945. package/lib/module/skia/web/api/index.js +0 -13
  946. package/lib/module/skia/web/api/index.js.map +0 -1
  947. package/lib/typescript/src/renderer/processors/math/Matrix3.d.ts +0 -10
  948. package/lib/typescript/src/renderer/processors/math/Vector.d.ts +0 -23
  949. package/lib/typescript/src/skia/core/Shader.d.ts +0 -1
  950. package/lib/typescript/src/skia/web/api/JsiSkColor.d.ts +0 -3
  951. package/lib/typescript/src/skia/web/api/index.d.ts +0 -10
  952. package/src/animation/timing/functions/__tests__/timing.spec.ts +0 -29
  953. package/src/renderer/processors/math/Matrix3.ts +0 -73
  954. package/src/renderer/processors/math/Vector.ts +0 -38
  955. package/src/skia/__tests__/Rects.spec.ts +0 -40
  956. package/src/skia/__tests__/snapshots/lightblue-rect.png +0 -0
  957. package/src/skia/core/Shader.ts +0 -9
  958. package/src/skia/web/api/JsiSkImage.ts +0 -66
  959. package/src/skia/web/api/index.ts +0 -15
  960. package/src/values/web/__tests__/RNSkAnimation.spec.ts +0 -21
  961. package/src/values/web/__tests__/RNSkDerivedValue.spec.ts +0 -15
  962. package/src/values/web/__tests__/RNSkReadonlyValue.spec.ts +0 -8
  963. package/src/values/web/__tests__/RNSkValue.spec.ts +0 -11
@@ -9,8 +9,6 @@ var _react = _interopRequireDefault(require("react"));
9
9
 
10
10
  var _nodes = require("../../nodes");
11
11
 
12
- var _Skia = require("../../../skia/Skia");
13
-
14
12
  var _Font = require("../../processors/Font");
15
13
 
16
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -21,7 +19,8 @@ const onDraw = (0, _nodes.createDrawing)((_ref, _ref2) => {
21
19
  let {
22
20
  canvas,
23
21
  paint,
24
- fontMgr
22
+ fontMgr,
23
+ Skia
25
24
  } = _ref;
26
25
  let {
27
26
  text,
@@ -29,19 +28,17 @@ const onDraw = (0, _nodes.createDrawing)((_ref, _ref2) => {
29
28
  path: pathDef,
30
29
  ...fontDef
31
30
  } = _ref2;
32
- const path = typeof pathDef === "string" ? _Skia.Skia.Path.MakeFromSVGString(pathDef) : pathDef;
31
+ const path = typeof pathDef === "string" ? Skia.Path.MakeFromSVGString(pathDef) : pathDef;
33
32
 
34
33
  if (path === null) {
35
34
  throw new Error("Invalid path: " + pathDef);
36
35
  }
37
36
 
38
- const font = (0, _Font.processFont)(fontMgr, fontDef);
37
+ const font = (0, _Font.processFont)(Skia, fontMgr, fontDef);
39
38
  const ids = font.getGlyphIDs(text);
40
39
  const widths = font.getGlyphWidths(ids, paint);
41
40
  const rsx = [];
42
-
43
- const meas = _Skia.Skia.ContourMeasureIter(path, false, 1);
44
-
41
+ const meas = Skia.ContourMeasureIter(path, false, 1);
45
42
  let cont = meas.next();
46
43
  let dist = initialOffset;
47
44
 
@@ -73,12 +70,11 @@ const onDraw = (0, _nodes.createDrawing)((_ref, _ref2) => {
73
70
  } = cont.getPosTan(dist);
74
71
  const adjustedX = px - width / 2 * tx;
75
72
  const adjustedY = py - width / 2 * ty;
76
- rsx.push(_Skia.Skia.RSXform(tx, ty, adjustedX, adjustedY));
73
+ rsx.push(Skia.RSXform(tx, ty, adjustedX, adjustedY));
77
74
  dist += width / 2;
78
75
  }
79
76
 
80
- const blob = _Skia.Skia.TextBlob.MakeFromRSXform(text, rsx, font);
81
-
77
+ const blob = Skia.TextBlob.MakeFromRSXform(text, rsx, font);
82
78
  canvas.drawTextBlob(blob, 0, 0, paint);
83
79
  });
84
80
 
@@ -1 +1 @@
1
- {"version":3,"sources":["TextPath.tsx"],"names":["onDraw","canvas","paint","fontMgr","text","initialOffset","path","pathDef","fontDef","Skia","Path","MakeFromSVGString","Error","font","ids","getGlyphIDs","widths","getGlyphWidths","rsx","meas","ContourMeasureIter","cont","next","dist","i","length","width","substring","px","py","tx","ty","getPosTan","adjustedX","adjustedY","push","RSXform","blob","TextBlob","MakeFromRSXform","drawTextBlob","TextPath","props","defaultProps"],"mappings":";;;;;;;AAAA;;AAGA;;AAEA;;AAEA;;;;;;AASA,MAAMA,MAAM,GAAG,0BACb,iBAGK;AAAA,MAFH;AAAEC,IAAAA,MAAF;AAAUC,IAAAA,KAAV;AAAiBC,IAAAA;AAAjB,GAEG;AAAA,MADH;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,aAAR;AAAuBC,IAAAA,IAAI,EAAEC,OAA7B;AAAsC,OAAGC;AAAzC,GACG;AACH,QAAMF,IAAI,GACR,OAAOC,OAAP,KAAmB,QAAnB,GACIE,WAAKC,IAAL,CAAUC,iBAAV,CAA4BJ,OAA5B,CADJ,GAEIA,OAHN;;AAIA,MAAID,IAAI,KAAK,IAAb,EAAmB;AACjB,UAAM,IAAIM,KAAJ,CAAU,mBAAmBL,OAA7B,CAAN;AACD;;AACD,QAAMM,IAAI,GAAG,uBAAYV,OAAZ,EAAqBK,OAArB,CAAb;AACA,QAAMM,GAAG,GAAGD,IAAI,CAACE,WAAL,CAAiBX,IAAjB,CAAZ;AACA,QAAMY,MAAM,GAAGH,IAAI,CAACI,cAAL,CAAoBH,GAApB,EAAyBZ,KAAzB,CAAf;AACA,QAAMgB,GAAgB,GAAG,EAAzB;;AACA,QAAMC,IAAI,GAAGV,WAAKW,kBAAL,CAAwBd,IAAxB,EAA8B,KAA9B,EAAqC,CAArC,CAAb;;AACA,MAAIe,IAAI,GAAGF,IAAI,CAACG,IAAL,EAAX;AACA,MAAIC,IAAI,GAAGlB,aAAX;;AACA,OAAK,IAAImB,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGpB,IAAI,CAACqB,MAAT,IAAmBJ,IAAnC,EAAyCG,CAAC,EAA1C,EAA8C;AAC5C,UAAME,KAAK,GAAGV,MAAM,CAACQ,CAAD,CAApB;AACAD,IAAAA,IAAI,IAAIG,KAAK,GAAG,CAAhB;;AACA,QAAIH,IAAI,GAAGF,IAAI,CAACI,MAAL,EAAX,EAA0B;AACxB;AACAJ,MAAAA,IAAI,GAAGF,IAAI,CAACG,IAAL,EAAP;;AACA,UAAI,CAACD,IAAL,EAAW;AACT;AACA;AACAjB,QAAAA,IAAI,GAAGA,IAAI,CAACuB,SAAL,CAAe,CAAf,EAAkBH,CAAlB,CAAP;AACA;AACD;;AACDD,MAAAA,IAAI,GAAGG,KAAK,GAAG,CAAf;AACD,KAb2C,CAc5C;AACA;;;AACA,UAAM;AAAEE,MAAAA,EAAF;AAAMC,MAAAA,EAAN;AAAUC,MAAAA,EAAV;AAAcC,MAAAA;AAAd,QAAqBV,IAAI,CAACW,SAAL,CAAeT,IAAf,CAA3B;AACA,UAAMU,SAAS,GAAGL,EAAE,GAAIF,KAAK,GAAG,CAAT,GAAcI,EAArC;AACA,UAAMI,SAAS,GAAGL,EAAE,GAAIH,KAAK,GAAG,CAAT,GAAcK,EAArC;AACAb,IAAAA,GAAG,CAACiB,IAAJ,CAAS1B,WAAK2B,OAAL,CAAaN,EAAb,EAAiBC,EAAjB,EAAqBE,SAArB,EAAgCC,SAAhC,CAAT;AACAX,IAAAA,IAAI,IAAIG,KAAK,GAAG,CAAhB;AACD;;AACD,QAAMW,IAAI,GAAG5B,WAAK6B,QAAL,CAAcC,eAAd,CAA8BnC,IAA9B,EAAoCc,GAApC,EAAyCL,IAAzC,CAAb;;AACAZ,EAAAA,MAAM,CAACuC,YAAP,CAAoBH,IAApB,EAA0B,CAA1B,EAA6B,CAA7B,EAAgCnC,KAAhC;AACD,CA3CY,CAAf;;AA8CO,MAAMuC,QAAQ,GAAIC,KAAD,IAAyC;AAC/D,sBAAO;AAAW,IAAA,MAAM,EAAE1C;AAAnB,KAA+B0C,KAA/B,EAAP;AACD,CAFM;;;AAIPD,QAAQ,CAACE,YAAT,GAAwB;AACtBtC,EAAAA,aAAa,EAAE;AADO,CAAxB","sourcesContent":["import React from \"react\";\n\nimport type { CustomPaintProps, AnimatedProps } from \"../../processors\";\nimport { createDrawing } from \"../../nodes\";\nimport type { SkPath, SkRSXform } from \"../../../skia\";\nimport { Skia } from \"../../../skia/Skia\";\nimport type { FontDef } from \"../../processors/Font\";\nimport { processFont } from \"../../processors/Font\";\n\nexport type TextPathProps = CustomPaintProps &\n FontDef & {\n text: string;\n path: SkPath | string;\n initialOffset: number;\n };\n\nconst onDraw = createDrawing<TextPathProps>(\n (\n { canvas, paint, fontMgr },\n { text, initialOffset, path: pathDef, ...fontDef }\n ) => {\n const path =\n typeof pathDef === \"string\"\n ? Skia.Path.MakeFromSVGString(pathDef)\n : pathDef;\n if (path === null) {\n throw new Error(\"Invalid path: \" + pathDef);\n }\n const font = processFont(fontMgr, fontDef);\n const ids = font.getGlyphIDs(text);\n const widths = font.getGlyphWidths(ids, paint);\n const rsx: SkRSXform[] = [];\n const meas = Skia.ContourMeasureIter(path, false, 1);\n let cont = meas.next();\n let dist = initialOffset;\n for (let i = 0; i < text.length && cont; i++) {\n const width = widths[i];\n dist += width / 2;\n if (dist > cont.length()) {\n // jump to next contour\n cont = meas.next();\n if (!cont) {\n // We have come to the end of the path - terminate the string\n // right here.\n text = text.substring(0, i);\n break;\n }\n dist = width / 2;\n }\n // Gives us the (x, y) coordinates as well as the cos/sin of the tangent\n // line at that position.\n const { px, py, tx, ty } = cont.getPosTan(dist);\n const adjustedX = px - (width / 2) * tx;\n const adjustedY = py - (width / 2) * ty;\n rsx.push(Skia.RSXform(tx, ty, adjustedX, adjustedY));\n dist += width / 2;\n }\n const blob = Skia.TextBlob.MakeFromRSXform(text, rsx, font);\n canvas.drawTextBlob(blob, 0, 0, paint);\n }\n);\n\nexport const TextPath = (props: AnimatedProps<TextPathProps>) => {\n return <skDrawing onDraw={onDraw} {...props} />;\n};\n\nTextPath.defaultProps = {\n initialOffset: 0,\n};\n"]}
1
+ {"version":3,"sources":["TextPath.tsx"],"names":["onDraw","canvas","paint","fontMgr","Skia","text","initialOffset","path","pathDef","fontDef","Path","MakeFromSVGString","Error","font","ids","getGlyphIDs","widths","getGlyphWidths","rsx","meas","ContourMeasureIter","cont","next","dist","i","length","width","substring","px","py","tx","ty","getPosTan","adjustedX","adjustedY","push","RSXform","blob","TextBlob","MakeFromRSXform","drawTextBlob","TextPath","props","defaultProps"],"mappings":"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","sourcesContent":["import React from \"react\";\n\nimport type { CustomPaintProps, AnimatedProps } from \"../../processors\";\nimport { createDrawing } from \"../../nodes\";\nimport type { SkPath, SkRSXform } from \"../../../skia/types\";\nimport type { FontDef } from \"../../processors/Font\";\nimport { processFont } from \"../../processors/Font\";\n\nexport type TextPathProps = CustomPaintProps &\n FontDef & {\n text: string;\n path: SkPath | string;\n initialOffset: number;\n };\n\nconst onDraw = createDrawing<TextPathProps>(\n (\n { canvas, paint, fontMgr, Skia },\n { text, initialOffset, path: pathDef, ...fontDef }\n ) => {\n const path =\n typeof pathDef === \"string\"\n ? Skia.Path.MakeFromSVGString(pathDef)\n : pathDef;\n if (path === null) {\n throw new Error(\"Invalid path: \" + pathDef);\n }\n const font = processFont(Skia, fontMgr, fontDef);\n const ids = font.getGlyphIDs(text);\n const widths = font.getGlyphWidths(ids, paint);\n const rsx: SkRSXform[] = [];\n const meas = Skia.ContourMeasureIter(path, false, 1);\n let cont = meas.next();\n let dist = initialOffset;\n for (let i = 0; i < text.length && cont; i++) {\n const width = widths[i];\n dist += width / 2;\n if (dist > cont.length()) {\n // jump to next contour\n cont = meas.next();\n if (!cont) {\n // We have come to the end of the path - terminate the string\n // right here.\n text = text.substring(0, i);\n break;\n }\n dist = width / 2;\n }\n // Gives us the (x, y) coordinates as well as the cos/sin of the tangent\n // line at that position.\n const { px, py, tx, ty } = cont.getPosTan(dist);\n const adjustedX = px - (width / 2) * tx;\n const adjustedY = py - (width / 2) * ty;\n rsx.push(Skia.RSXform(tx, ty, adjustedX, adjustedY));\n dist += width / 2;\n }\n const blob = Skia.TextBlob.MakeFromRSXform(text, rsx, font);\n canvas.drawTextBlob(blob, 0, 0, paint);\n }\n);\n\nexport const TextPath = (props: AnimatedProps<TextPathProps>) => {\n return <skDrawing onDraw={onDraw} {...props} />;\n};\n\nTextPath.defaultProps = {\n initialOffset: 0,\n};\n"]}
@@ -4,19 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
 
7
- var _Canvas = require("./Canvas");
8
-
9
- Object.keys(_Canvas).forEach(function (key) {
10
- if (key === "default" || key === "__esModule") return;
11
- if (key in exports && exports[key] === _Canvas[key]) return;
12
- Object.defineProperty(exports, key, {
13
- enumerable: true,
14
- get: function () {
15
- return _Canvas[key];
16
- }
17
- });
18
- });
19
-
20
7
  var _components = require("./components");
21
8
 
22
9
  Object.keys(_components).forEach(function (key) {
@@ -68,4 +55,17 @@ Object.keys(_DependencyManager).forEach(function (key) {
68
55
  }
69
56
  });
70
57
  });
58
+
59
+ var _useCanvas = require("./useCanvas");
60
+
61
+ Object.keys(_useCanvas).forEach(function (key) {
62
+ if (key === "default" || key === "__esModule") return;
63
+ if (key in exports && exports[key] === _useCanvas[key]) return;
64
+ Object.defineProperty(exports, key, {
65
+ enumerable: true,
66
+ get: function () {
67
+ return _useCanvas[key];
68
+ }
69
+ });
70
+ });
71
71
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export * from \"./Canvas\";\nexport * from \"./components\";\nexport * from \"./nodes\";\nexport * from \"./useContextBridge\";\nexport * from \"./DependencyManager\";\n"]}
1
+ {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export * from \"./components\";\nexport * from \"./nodes\";\nexport * from \"./useContextBridge\";\nexport * from \"./DependencyManager\";\nexport * from \"./useCanvas\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["Declaration.tsx"],"names":["createDeclaration","cb","useDeclaration","deps","isDeclarationNode","node","DeclarationNode","Node","constructor","depMgr","onDeclare","props","memoizable","_props","draw","ctx","children","visit","obj"],"mappings":";;;;;;;AACA;;AAIA;;AAIA;;;;AAUO,MAAMA,iBAAiB,GAC5BC,EAD+B,IAEJA,EAFtB;;;;AAIA,MAAMC,cAAc,GAAG,CAC5BD,EAD4B,EAE5BE,IAF4B,KAI5B;AACA,wBAAYF,EAAZ,EAAgBE,IAAhB,aAAgBA,IAAhB,cAAgBA,IAAhB,GAAwB,EAAxB,CALK;;;;AAOA,MAAMC,iBAAiB,GAC5BC,IAD+B,IAEMA,IAAI,YAAYC,eAFhD;;;;AAQA,MAAMA,eAAN,SAAiCC,UAAjC,CAAyC;AAG9CC,EAAAA,WAAW,CACTC,MADS,EAETC,SAFS,EAGTC,KAHS,EAIT;AACA,UAAMF,MAAN,EAAcE,KAAd;;AADA;;AAEA,UAAMC,UAAN,GAAmB,CAAC,4BAAWD,KAAX,CAApB;AACA,SAAKD,SAAL,GAAiBA,SAAjB;AACD;;AAEQ,MAALC,KAAK,CAACA,KAAD,EAA0B;AACjC,SAAKC,UAAL,GAAkB,CAAC,4BAAWD,KAAX,CAAnB;AACA,UAAMA,KAAN,GAAcA,KAAd;AACD;;AAEQ,MAALA,KAAK,GAAG;AACV,WAAO,KAAKE,MAAZ;AACD;;AAEDC,EAAAA,IAAI,CAACC,GAAD,EAAsB;AACxB,UAAMC,QAAQ,GAAG,KAAKC,KAAL,CAAWF,GAAX,CAAjB;AACA,UAAMJ,KAAK,GAAG,6BAAY,KAAKA,KAAjB,CAAd;AACA,UAAMO,GAAG,GAAG,KAAKR,SAAL,CAAeC,KAAf,EAAsBK,QAAtB,EAAgCD,GAAhC,CAAZ;AACA,WAAOG,GAAP;AACD;;AA3B6C","sourcesContent":["import type { DependencyList } from \"react\";\nimport { useCallback } from \"react\";\n\nimport type { DrawingContext } from \"../DrawingContext\";\nimport type { AnimatedProps } from \"../processors\";\nimport { isAnimated, materialize } from \"../processors\";\nimport type { DependencyManager } from \"../DependencyManager\";\nimport type { SkJSIInstance } from \"../../skia\";\n\nimport { Node } from \"./Node\";\n\nexport type DeclarationResult = SkJSIInstance<string> | null;\n\ntype DeclarationCallback<T> = (\n props: T,\n children: DeclarationResult[],\n ctx: DrawingContext\n) => DeclarationResult;\n\nexport const createDeclaration = <T,>(\n cb: DeclarationCallback<T>\n): DeclarationCallback<T> => cb;\n\nexport const useDeclaration = <P,>(\n cb: DeclarationCallback<P>,\n deps?: DependencyList\n) =>\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useCallback(cb, deps ?? []);\n\nexport const isDeclarationNode = (\n node: Node\n): node is DeclarationNode<unknown> => node instanceof DeclarationNode;\n\nexport interface DeclarationProps<P> {\n onDeclare: DeclarationCallback<P>;\n}\n\nexport class DeclarationNode<P> extends Node<P> {\n private onDeclare: DeclarationCallback<P>;\n\n constructor(\n depMgr: DependencyManager,\n onDeclare: DeclarationCallback<P>,\n props: AnimatedProps<P>\n ) {\n super(depMgr, props);\n super.memoizable = !isAnimated(props);\n this.onDeclare = onDeclare;\n }\n\n set props(props: AnimatedProps<P>) {\n this.memoizable = !isAnimated(props);\n super.props = props;\n }\n\n get props() {\n return this._props;\n }\n\n draw(ctx: DrawingContext) {\n const children = this.visit(ctx);\n const props = materialize(this.props);\n const obj = this.onDeclare(props, children, ctx);\n return obj;\n }\n}\n"]}
1
+ {"version":3,"sources":["Declaration.tsx"],"names":["createDeclaration","cb","useDeclaration","deps","isDeclarationNode","node","DeclarationNode","Node","constructor","depMgr","onDeclare","props","memoizable","_props","draw","ctx","children","visit","obj"],"mappings":";;;;;;;AACA;;AAIA;;AAIA;;;;AAUO,MAAMA,iBAAiB,GAC5BC,EAD+B,IAEJA,EAFtB;;;;AAIA,MAAMC,cAAc,GAAG,CAC5BD,EAD4B,EAE5BE,IAF4B,KAI5B;AACA,wBAAYF,EAAZ,EAAgBE,IAAhB,aAAgBA,IAAhB,cAAgBA,IAAhB,GAAwB,EAAxB,CALK;;;;AAOA,MAAMC,iBAAiB,GAC5BC,IAD+B,IAEMA,IAAI,YAAYC,eAFhD;;;;AAQA,MAAMA,eAAN,SAAiCC,UAAjC,CAAyC;AAG9CC,EAAAA,WAAW,CACTC,MADS,EAETC,SAFS,EAGTC,KAHS,EAIT;AACA,UAAMF,MAAN,EAAcE,KAAd;;AADA;;AAEA,UAAMC,UAAN,GAAmB,CAAC,4BAAWD,KAAX,CAApB;AACA,SAAKD,SAAL,GAAiBA,SAAjB;AACD;;AAEQ,MAALC,KAAK,CAACA,KAAD,EAA0B;AACjC,SAAKC,UAAL,GAAkB,CAAC,4BAAWD,KAAX,CAAnB;AACA,UAAMA,KAAN,GAAcA,KAAd;AACD;;AAEQ,MAALA,KAAK,GAAG;AACV,WAAO,KAAKE,MAAZ;AACD;;AAEDC,EAAAA,IAAI,CAACC,GAAD,EAAsB;AACxB,UAAMC,QAAQ,GAAG,KAAKC,KAAL,CAAWF,GAAX,CAAjB;AACA,UAAMJ,KAAK,GAAG,6BAAY,KAAKA,KAAjB,CAAd;AACA,UAAMO,GAAG,GAAG,KAAKR,SAAL,CAAeC,KAAf,EAAsBK,QAAtB,EAAgCD,GAAhC,CAAZ;AACA,WAAOG,GAAP;AACD;;AA3B6C","sourcesContent":["import type { DependencyList } from \"react\";\nimport { useCallback } from \"react\";\n\nimport type { DrawingContext } from \"../DrawingContext\";\nimport type { AnimatedProps } from \"../processors\";\nimport { isAnimated, materialize } from \"../processors\";\nimport type { DependencyManager } from \"../DependencyManager\";\nimport type { SkJSIInstance } from \"../../skia/types\";\n\nimport { Node } from \"./Node\";\n\nexport type DeclarationResult = SkJSIInstance<string> | null;\n\ntype DeclarationCallback<T> = (\n props: T,\n children: DeclarationResult[],\n ctx: DrawingContext\n) => DeclarationResult;\n\nexport const createDeclaration = <T,>(\n cb: DeclarationCallback<T>\n): DeclarationCallback<T> => cb;\n\nexport const useDeclaration = <P,>(\n cb: DeclarationCallback<P>,\n deps?: DependencyList\n) =>\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useCallback(cb, deps ?? []);\n\nexport const isDeclarationNode = (\n node: Node\n): node is DeclarationNode<unknown> => node instanceof DeclarationNode;\n\nexport interface DeclarationProps<P> {\n onDeclare: DeclarationCallback<P>;\n}\n\nexport class DeclarationNode<P> extends Node<P> {\n private onDeclare: DeclarationCallback<P>;\n\n constructor(\n depMgr: DependencyManager,\n onDeclare: DeclarationCallback<P>,\n props: AnimatedProps<P>\n ) {\n super(depMgr, props);\n super.memoizable = !isAnimated(props);\n this.onDeclare = onDeclare;\n }\n\n set props(props: AnimatedProps<P>) {\n this.memoizable = !isAnimated(props);\n super.props = props;\n }\n\n get props() {\n return this._props;\n }\n\n draw(ctx: DrawingContext) {\n const children = this.visit(ctx);\n const props = materialize(this.props);\n const obj = this.onDeclare(props, children, ctx);\n return obj;\n }\n}\n"]}
@@ -7,11 +7,11 @@ exports.useDrawing = exports.createDrawing = exports.DrawingNode = void 0;
7
7
 
8
8
  var _react = require("react");
9
9
 
10
- var _processors = require("../processors");
11
-
12
10
  var _Animations = require("../processors/Animations/Animations");
13
11
 
14
- var _skia = require("../../skia");
12
+ var _types = require("../../skia/types");
13
+
14
+ var _processors = require("../processors");
15
15
 
16
16
  var _Node = require("./Node");
17
17
 
@@ -45,8 +45,8 @@ class DrawingNode extends _Node.Node {
45
45
  this.onDraw(ctx, drawingProps, this);
46
46
  } else {
47
47
  const declarations = this.visit(ctx);
48
- const paint = (0, _processors.processPaint)(ctx.paint.copy(), ctx.opacity, drawingProps, declarations);
49
- [paint, ...declarations.filter(_skia.isPaint)].forEach(currentPaint => {
48
+ const paint = (0, _processors.processPaint)(ctx.Skia, ctx.paint.copy(), ctx.opacity, drawingProps, declarations);
49
+ [paint, ...declarations.filter(_types.isPaint)].forEach(currentPaint => {
50
50
  this.onDraw({ ...ctx,
51
51
  paint: currentPaint
52
52
  }, drawingProps, this);
@@ -1 +1 @@
1
- {"version":3,"sources":["Drawing.tsx"],"names":["createDrawing","cb","useDrawing","deps","DrawingNode","Node","constructor","depMgr","onDraw","skipProcessing","props","draw","ctx","drawingProps","declarations","visit","paint","copy","opacity","filter","isPaint","forEach","currentPaint"],"mappings":";;;;;;;AACA;;AAGA;;AAEA;;AACA;;AAGA;;;;AAUO,MAAMA,aAAa,GAAQC,EAAL,IAC3BA,EADK;;;;AAGA,MAAMC,UAAU,GAAG,CAAKD,EAAL,EAA4BE,IAA5B,KACxB;AACA,wBAAYF,EAAZ,EAAgBE,IAAhB,aAAgBA,IAAhB,cAAgBA,IAAhB,GAAwB,EAAxB,CAFK;;;;AAUA,MAAMC,WAAN,SAA6BC,UAA7B,CAAqC;AAI1CC,EAAAA,WAAW,CACTC,MADS,EAETC,MAFS,EAGTC,cAHS,EAITC,KAJS,EAKT;AACA,UAAMH,MAAN,EAAcG,KAAd;;AADA;;AAAA;;AAEA,SAAKF,MAAL,GAAcA,MAAd;AACA,SAAKC,cAAL,GAAsBA,cAAtB;AACD;;AAEDE,EAAAA,IAAI,CAACC,GAAD,EAAsB;AACxB,UAAMC,YAAY,GAAG,6BAAY,KAAKH,KAAjB,CAArB;;AACA,QAAI,KAAKD,cAAT,EAAyB;AACvB,WAAKD,MAAL,CAAYI,GAAZ,EAAiBC,YAAjB,EAA+B,IAA/B;AACD,KAFD,MAEO;AACL,YAAMC,YAAY,GAAG,KAAKC,KAAL,CAAWH,GAAX,CAArB;AACA,YAAMI,KAAK,GAAG,8BACZJ,GAAG,CAACI,KAAJ,CAAUC,IAAV,EADY,EAEZL,GAAG,CAACM,OAFQ,EAGZL,YAHY,EAIZC,YAJY,CAAd;AAMA,OAACE,KAAD,EAAQ,GAAGF,YAAY,CAACK,MAAb,CAAoBC,aAApB,CAAX,EAAyCC,OAAzC,CAAkDC,YAAD,IAAkB;AACjE,aAAKd,MAAL,CAAY,EAAE,GAAGI,GAAL;AAAUI,UAAAA,KAAK,EAAEM;AAAjB,SAAZ,EAA6CT,YAA7C,EAA2D,IAA3D;AACD,OAFD;AAGD;AACF;;AA/ByC","sourcesContent":["import type { DependencyList, ReactNode } from \"react\";\nimport { useCallback } from \"react\";\n\nimport type { DrawingContext } from \"../DrawingContext\";\nimport { processPaint } from \"../processors\";\nimport type { AnimatedProps } from \"../processors/Animations/Animations\";\nimport { materialize } from \"../processors/Animations/Animations\";\nimport { isPaint } from \"../../skia\";\nimport type { DependencyManager } from \"../DependencyManager\";\n\nimport { Node } from \"./Node\";\n\ntype DrawingCallback<P> = (\n ctx: DrawingContext,\n props: P,\n node: Node<P>\n) => void;\n\ntype OnDrawCallback<P> = (ctx: DrawingContext, props: P, node: Node<P>) => void;\n\nexport const createDrawing = <P,>(cb: OnDrawCallback<P>): DrawingCallback<P> =>\n cb;\n\nexport const useDrawing = <P,>(cb: OnDrawCallback<P>, deps?: DependencyList) =>\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useCallback(cb, deps ?? []);\n\nexport type DrawingProps<T> = {\n onDraw: DrawingCallback<T>;\n skipProcessing?: boolean;\n children?: ReactNode | ReactNode[];\n};\n\nexport class DrawingNode<P> extends Node<P> {\n onDraw: DrawingCallback<P>;\n skipProcessing: boolean;\n\n constructor(\n depMgr: DependencyManager,\n onDraw: DrawingCallback<P>,\n skipProcessing: boolean,\n props: AnimatedProps<P>\n ) {\n super(depMgr, props);\n this.onDraw = onDraw;\n this.skipProcessing = skipProcessing;\n }\n\n draw(ctx: DrawingContext) {\n const drawingProps = materialize(this.props);\n if (this.skipProcessing) {\n this.onDraw(ctx, drawingProps, this);\n } else {\n const declarations = this.visit(ctx);\n const paint = processPaint(\n ctx.paint.copy(),\n ctx.opacity,\n drawingProps,\n declarations\n );\n [paint, ...declarations.filter(isPaint)].forEach((currentPaint) => {\n this.onDraw({ ...ctx, paint: currentPaint }, drawingProps, this);\n });\n }\n }\n}\n"]}
1
+ {"version":3,"sources":["Drawing.tsx"],"names":["createDrawing","cb","useDrawing","deps","DrawingNode","Node","constructor","depMgr","onDraw","skipProcessing","props","draw","ctx","drawingProps","declarations","visit","paint","Skia","copy","opacity","filter","isPaint","forEach","currentPaint"],"mappings":";;;;;;;AACA;;AAIA;;AACA;;AAEA;;AAEA;;;;AAUO,MAAMA,aAAa,GAAQC,EAAL,IAC3BA,EADK;;;;AAGA,MAAMC,UAAU,GAAG,CAAKD,EAAL,EAA4BE,IAA5B,KACxB;AACA,wBAAYF,EAAZ,EAAgBE,IAAhB,aAAgBA,IAAhB,cAAgBA,IAAhB,GAAwB,EAAxB,CAFK;;;;AAUA,MAAMC,WAAN,SAA6BC,UAA7B,CAAqC;AAI1CC,EAAAA,WAAW,CACTC,MADS,EAETC,MAFS,EAGTC,cAHS,EAITC,KAJS,EAKT;AACA,UAAMH,MAAN,EAAcG,KAAd;;AADA;;AAAA;;AAEA,SAAKF,MAAL,GAAcA,MAAd;AACA,SAAKC,cAAL,GAAsBA,cAAtB;AACD;;AAEDE,EAAAA,IAAI,CAACC,GAAD,EAAsB;AACxB,UAAMC,YAAY,GAAG,6BAAY,KAAKH,KAAjB,CAArB;;AACA,QAAI,KAAKD,cAAT,EAAyB;AACvB,WAAKD,MAAL,CAAYI,GAAZ,EAAiBC,YAAjB,EAA+B,IAA/B;AACD,KAFD,MAEO;AACL,YAAMC,YAAY,GAAG,KAAKC,KAAL,CAAWH,GAAX,CAArB;AACA,YAAMI,KAAK,GAAG,8BACZJ,GAAG,CAACK,IADQ,EAEZL,GAAG,CAACI,KAAJ,CAAUE,IAAV,EAFY,EAGZN,GAAG,CAACO,OAHQ,EAIZN,YAJY,EAKZC,YALY,CAAd;AAOA,OAACE,KAAD,EAAQ,GAAGF,YAAY,CAACM,MAAb,CAAoBC,cAApB,CAAX,EAAyCC,OAAzC,CAAkDC,YAAD,IAAkB;AACjE,aAAKf,MAAL,CAAY,EAAE,GAAGI,GAAL;AAAUI,UAAAA,KAAK,EAAEO;AAAjB,SAAZ,EAA6CV,YAA7C,EAA2D,IAA3D;AACD,OAFD;AAGD;AACF;;AAhCyC","sourcesContent":["import type { DependencyList, ReactNode } from \"react\";\nimport { useCallback } from \"react\";\n\nimport type { DrawingContext } from \"../DrawingContext\";\nimport type { AnimatedProps } from \"../processors/Animations/Animations\";\nimport { materialize } from \"../processors/Animations/Animations\";\nimport { isPaint } from \"../../skia/types\";\nimport type { DependencyManager } from \"../DependencyManager\";\nimport { processPaint } from \"../processors\";\n\nimport { Node } from \"./Node\";\n\ntype DrawingCallback<P> = (\n ctx: DrawingContext,\n props: P,\n node: Node<P>\n) => void;\n\ntype OnDrawCallback<P> = (ctx: DrawingContext, props: P, node: Node<P>) => void;\n\nexport const createDrawing = <P,>(cb: OnDrawCallback<P>): DrawingCallback<P> =>\n cb;\n\nexport const useDrawing = <P,>(cb: OnDrawCallback<P>, deps?: DependencyList) =>\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useCallback(cb, deps ?? []);\n\nexport type DrawingProps<T> = {\n onDraw: DrawingCallback<T>;\n skipProcessing?: boolean;\n children?: ReactNode | ReactNode[];\n};\n\nexport class DrawingNode<P> extends Node<P> {\n onDraw: DrawingCallback<P>;\n skipProcessing: boolean;\n\n constructor(\n depMgr: DependencyManager,\n onDraw: DrawingCallback<P>,\n skipProcessing: boolean,\n props: AnimatedProps<P>\n ) {\n super(depMgr, props);\n this.onDraw = onDraw;\n this.skipProcessing = skipProcessing;\n }\n\n draw(ctx: DrawingContext) {\n const drawingProps = materialize(this.props);\n if (this.skipProcessing) {\n this.onDraw(ctx, drawingProps, this);\n } else {\n const declarations = this.visit(ctx);\n const paint = processPaint(\n ctx.Skia,\n ctx.paint.copy(),\n ctx.opacity,\n drawingProps,\n declarations\n );\n [paint, ...declarations.filter(isPaint)].forEach((currentPaint) => {\n this.onDraw({ ...ctx, paint: currentPaint }, drawingProps, this);\n });\n }\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["Node.ts"],"names":["NodeType","Node","constructor","depMgr","props","_props","unSubscribeNode","subscribeNode","visit","ctx","children","returnedValues","forEach","child","memoized","memoizable","push","ret","draw"],"mappings":";;;;;;;;;IAKYA,Q;;;WAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;GAAAA,Q,wBAAAA,Q;;AAOL,MAAeC,IAAf,CAAiC;AAQtCC,EAAAA,WAAW,CAACC,MAAD,EAA4BC,KAA5B,EAAqD;AAAA,sCAPpC,EAOoC;;AAAA;;AAAA,wCALnD,KAKmD;;AAAA,sCAJ3B,IAI2B;;AAAA;;AAAA;;AAC9D,SAAKC,MAAL,GAAcD,KAAd;AACA,SAAKD,MAAL,GAAcA,MAAd;AACA,SAAKA,MAAL,CAAYG,eAAZ,CAA4B,IAA5B;AACA,SAAKH,MAAL,CAAYI,aAAZ,CAA0B,IAA1B,EAAgCH,KAAhC;AACD;;AAIQ,MAALA,KAAK,CAACA,KAAD,EAA0B;AACjC,SAAKD,MAAL,CAAYG,eAAZ,CAA4B,IAA5B;AACA,SAAKH,MAAL,CAAYI,aAAZ,CAA0B,IAA1B,EAAgCH,KAAhC;AACA,SAAKC,MAAL,GAAcD,KAAd;AACD;;AAEQ,MAALA,KAAK,GAAG;AACV,WAAO,KAAKC,MAAZ;AACD;;AAEDG,EAAAA,KAAK,CAACC,GAAD,EAAsBC,QAAtB,EAAyC;AAC5C,UAAMC,cAAkD,GAAG,EAA3D;AACA,KAACD,QAAD,aAACA,QAAD,cAACA,QAAD,GAAa,KAAKA,QAAlB,EAA4BE,OAA5B,CAAqCC,KAAD,IAAW;AAC7C,UAAIA,KAAK,CAACC,QAAN,IAAkBD,KAAK,CAACE,UAA5B,EAAwC;AACtCJ,QAAAA,cAAc,CAACK,IAAf,CAAoBH,KAAK,CAACC,QAA1B;AACD,OAFD,MAEO;AACL,cAAMG,GAAG,GAAGJ,KAAK,CAACK,IAAN,CAAWT,GAAX,CAAZ;;AACA,YAAIQ,GAAJ,EAAS;AACPN,UAAAA,cAAc,CAACK,IAAf,CAAoBC,GAApB;;AACA,cAAIJ,KAAK,CAACE,UAAV,EAAsB;AACpBF,YAAAA,KAAK,CAACC,QAAN,GAAiBG,GAAjB;AACD;AACF;AACF;AACF,KAZD;AAaA,WAAON,cAAP;AACD;;AA3CqC","sourcesContent":["import type { SkJSIInstance } from \"../../skia\";\nimport type { DependencyManager } from \"../DependencyManager\";\nimport type { DrawingContext } from \"../DrawingContext\";\nimport type { AnimatedProps } from \"../processors\";\n\nexport enum NodeType {\n Declaration = \"skDeclaration\",\n Drawing = \"skDrawing\",\n}\n\ntype DeclarationResult = SkJSIInstance<string> | null;\n\nexport abstract class Node<P = unknown> {\n readonly children: Node[] = [];\n _props: AnimatedProps<P>;\n memoizable = false;\n memoized: DeclarationResult | null = null;\n parent?: Node;\n depMgr: DependencyManager;\n\n constructor(depMgr: DependencyManager, props: AnimatedProps<P>) {\n this._props = props;\n this.depMgr = depMgr;\n this.depMgr.unSubscribeNode(this);\n this.depMgr.subscribeNode(this, props);\n }\n\n abstract draw(ctx: DrawingContext): void | DeclarationResult;\n\n set props(props: AnimatedProps<P>) {\n this.depMgr.unSubscribeNode(this);\n this.depMgr.subscribeNode(this, props);\n this._props = props;\n }\n\n get props() {\n return this._props;\n }\n\n visit(ctx: DrawingContext, children?: Node[]) {\n const returnedValues: Exclude<DeclarationResult, null>[] = [];\n (children ?? this.children).forEach((child) => {\n if (child.memoized && child.memoizable) {\n returnedValues.push(child.memoized);\n } else {\n const ret = child.draw(ctx);\n if (ret) {\n returnedValues.push(ret);\n if (child.memoizable) {\n child.memoized = ret;\n }\n }\n }\n });\n return returnedValues;\n }\n}\n"]}
1
+ {"version":3,"sources":["Node.ts"],"names":["NodeType","Node","constructor","depMgr","props","_props","unSubscribeNode","subscribeNode","visit","ctx","children","returnedValues","forEach","child","memoized","memoizable","push","ret","draw"],"mappings":";;;;;;;;;IAKYA,Q;;;WAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;GAAAA,Q,wBAAAA,Q;;AAOL,MAAeC,IAAf,CAAiC;AAQtCC,EAAAA,WAAW,CAACC,MAAD,EAA4BC,KAA5B,EAAqD;AAAA,sCAPpC,EAOoC;;AAAA;;AAAA,wCALnD,KAKmD;;AAAA,sCAJ3B,IAI2B;;AAAA;;AAAA;;AAC9D,SAAKC,MAAL,GAAcD,KAAd;AACA,SAAKD,MAAL,GAAcA,MAAd;AACA,SAAKA,MAAL,CAAYG,eAAZ,CAA4B,IAA5B;AACA,SAAKH,MAAL,CAAYI,aAAZ,CAA0B,IAA1B,EAAgCH,KAAhC;AACD;;AAIQ,MAALA,KAAK,CAACA,KAAD,EAA0B;AACjC,SAAKD,MAAL,CAAYG,eAAZ,CAA4B,IAA5B;AACA,SAAKH,MAAL,CAAYI,aAAZ,CAA0B,IAA1B,EAAgCH,KAAhC;AACA,SAAKC,MAAL,GAAcD,KAAd;AACD;;AAEQ,MAALA,KAAK,GAAG;AACV,WAAO,KAAKC,MAAZ;AACD;;AAEDG,EAAAA,KAAK,CAACC,GAAD,EAAsBC,QAAtB,EAAyC;AAC5C,UAAMC,cAAkD,GAAG,EAA3D;AACA,KAACD,QAAD,aAACA,QAAD,cAACA,QAAD,GAAa,KAAKA,QAAlB,EAA4BE,OAA5B,CAAqCC,KAAD,IAAW;AAC7C,UAAIA,KAAK,CAACC,QAAN,IAAkBD,KAAK,CAACE,UAA5B,EAAwC;AACtCJ,QAAAA,cAAc,CAACK,IAAf,CAAoBH,KAAK,CAACC,QAA1B;AACD,OAFD,MAEO;AACL,cAAMG,GAAG,GAAGJ,KAAK,CAACK,IAAN,CAAWT,GAAX,CAAZ;;AACA,YAAIQ,GAAJ,EAAS;AACPN,UAAAA,cAAc,CAACK,IAAf,CAAoBC,GAApB;;AACA,cAAIJ,KAAK,CAACE,UAAV,EAAsB;AACpBF,YAAAA,KAAK,CAACC,QAAN,GAAiBG,GAAjB;AACD;AACF;AACF;AACF,KAZD;AAaA,WAAON,cAAP;AACD;;AA3CqC","sourcesContent":["import type { SkJSIInstance } from \"../../skia/types\";\nimport type { DependencyManager } from \"../DependencyManager\";\nimport type { DrawingContext } from \"../DrawingContext\";\nimport type { AnimatedProps } from \"../processors\";\n\nexport enum NodeType {\n Declaration = \"skDeclaration\",\n Drawing = \"skDrawing\",\n}\n\ntype DeclarationResult = SkJSIInstance<string> | null;\n\nexport abstract class Node<P = unknown> {\n readonly children: Node[] = [];\n _props: AnimatedProps<P>;\n memoizable = false;\n memoized: DeclarationResult | null = null;\n parent?: Node;\n depMgr: DependencyManager;\n\n constructor(depMgr: DependencyManager, props: AnimatedProps<P>) {\n this._props = props;\n this.depMgr = depMgr;\n this.depMgr.unSubscribeNode(this);\n this.depMgr.subscribeNode(this, props);\n }\n\n abstract draw(ctx: DrawingContext): void | DeclarationResult;\n\n set props(props: AnimatedProps<P>) {\n this.depMgr.unSubscribeNode(this);\n this.depMgr.subscribeNode(this, props);\n this._props = props;\n }\n\n get props() {\n return this._props;\n }\n\n visit(ctx: DrawingContext, children?: Node[]) {\n const returnedValues: Exclude<DeclarationResult, null>[] = [];\n (children ?? this.children).forEach((child) => {\n if (child.memoized && child.memoizable) {\n returnedValues.push(child.memoized);\n } else {\n const ret = child.draw(ctx);\n if (ret) {\n returnedValues.push(ret);\n if (child.memoizable) {\n child.memoized = ret;\n }\n }\n }\n });\n return returnedValues;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["Animations.ts"],"names":["isValue","value","undefined","__typename__","isAnimated","props","Object","values","materialize","result","forEach","key","current"],"mappings":";;;;;;;AAEA;;AAIO,MAAMA,OAAO,GAAIC,KAAD,IAAiD;AACtE,MAAIA,KAAK,KAAKC,SAAV,IAAuBD,KAAK,KAAK,IAArC,EAA2C;AACzC,WAAO,KAAP;AACD;;AACD,MAAI;AACF,QACE,OAAOA,KAAP,KAAiB,QAAjB,IACA,kBAAkBA,KADlB,IAECA,KAAD,CAAyCE,YAAzC,KAA0D,WAH5D,EAIE;AACA,aAAO,IAAP;AACD;AACF,GARD,CAQE,MAAM,CAAE;;AACV,SAAO,KAAP;AACD,CAdM;;;;AAgBA,MAAMC,UAAU,GAAOC,KAAJ,IAAgC;AACxD,OAAK,MAAMJ,KAAX,IAAoBK,MAAM,CAACC,MAAP,CAAcF,KAAd,CAApB,EAA0C;AACxC,QAAIL,OAAO,CAACC,KAAD,CAAX,EAAoB;AAClB,aAAO,IAAP;AACD;AACF;;AACD,SAAO,KAAP;AACD,CAPM;;;;AASA,MAAMO,WAAW,GAAOH,KAAJ,IAAgC;AACzD,QAAMI,MAAM,GAAG,EAAE,GAAGJ;AAAL,GAAf;AACA,0BAAQA,KAAR,EAAeK,OAAf,CAAwBC,GAAD,IAAS;AAC9B,UAAMV,KAAK,GAAGI,KAAK,CAACM,GAAD,CAAnB;;AACA,QAAIX,OAAO,CAACC,KAAD,CAAX,EAAoB;AAClBQ,MAAAA,MAAM,CAACE,GAAD,CAAN,GAAeV,KAAD,CAAoCW,OAAlD;AACD;AACF,GALD;AAMA,SAAOH,MAAP;AACD,CATM","sourcesContent":["import type { SkiaValue } from \"../../../values\";\nimport type { DrawingContext } from \"../../DrawingContext\";\nimport { mapKeys } from \"../../typeddash\";\n\nexport type FrameValue<T> = (ctx: DrawingContext) => T;\n\nexport const isValue = (value: unknown): value is SkiaValue<unknown> => {\n if (value === undefined || value === null) {\n return false;\n }\n try {\n if (\n typeof value === \"object\" &&\n \"__typename__\" in value &&\n (value as unknown as SkiaValue<unknown>).__typename__ === \"RNSkValue\"\n ) {\n return true;\n }\n } catch {}\n return false;\n};\n\nexport const isAnimated = <T>(props: AnimatedProps<T>) => {\n for (const value of Object.values(props)) {\n if (isValue(value)) {\n return true;\n }\n }\n return false;\n};\n\nexport const materialize = <T>(props: AnimatedProps<T>) => {\n const result = { ...props };\n mapKeys(props).forEach((key) => {\n const value = props[key];\n if (isValue(value)) {\n result[key] = (value as SkiaValue<T[typeof key]>).current;\n }\n });\n return result as T;\n};\n\nexport type AnimatedProps<T> = {\n [K in keyof T]: T[K] | SkiaValue<T[K]>;\n};\n"]}
1
+ {"version":3,"sources":["Animations.ts"],"names":["isValue","value","undefined","__typename__","isAnimated","props","Object","values","materialize","result","forEach","key","current"],"mappings":";;;;;;;AACA;;AAEO,MAAMA,OAAO,GAAIC,KAAD,IAAiD;AACtE,MAAIA,KAAK,KAAKC,SAAV,IAAuBD,KAAK,KAAK,IAArC,EAA2C;AACzC,WAAO,KAAP;AACD;;AACD,MAAI;AACF,QACE,OAAOA,KAAP,KAAiB,QAAjB,IACA,kBAAkBA,KADlB,IAECA,KAAD,CAAyCE,YAAzC,KAA0D,WAH5D,EAIE;AACA,aAAO,IAAP;AACD;AACF,GARD,CAQE,MAAM,CAAE;;AACV,SAAO,KAAP;AACD,CAdM;;;;AAgBA,MAAMC,UAAU,GAAOC,KAAJ,IAAgC;AACxD,OAAK,MAAMJ,KAAX,IAAoBK,MAAM,CAACC,MAAP,CAAcF,KAAd,CAApB,EAA0C;AACxC,QAAIL,OAAO,CAACC,KAAD,CAAX,EAAoB;AAClB,aAAO,IAAP;AACD;AACF;;AACD,SAAO,KAAP;AACD,CAPM;;;;AASA,MAAMO,WAAW,GAAOH,KAAJ,IAAgC;AACzD,QAAMI,MAAM,GAAG,EAAE,GAAGJ;AAAL,GAAf;AACA,0BAAQA,KAAR,EAAeK,OAAf,CAAwBC,GAAD,IAAS;AAC9B,UAAMV,KAAK,GAAGI,KAAK,CAACM,GAAD,CAAnB;;AACA,QAAIX,OAAO,CAACC,KAAD,CAAX,EAAoB;AAClBQ,MAAAA,MAAM,CAACE,GAAD,CAAN,GAAeV,KAAD,CAAoCW,OAAlD;AACD;AACF,GALD;AAMA,SAAOH,MAAP;AACD,CATM","sourcesContent":["import type { SkiaValue } from \"../../../values\";\nimport { mapKeys } from \"../../typeddash\";\n\nexport const isValue = (value: unknown): value is SkiaValue<unknown> => {\n if (value === undefined || value === null) {\n return false;\n }\n try {\n if (\n typeof value === \"object\" &&\n \"__typename__\" in value &&\n (value as unknown as SkiaValue<unknown>).__typename__ === \"RNSkValue\"\n ) {\n return true;\n }\n } catch {}\n return false;\n};\n\nexport const isAnimated = <T>(props: AnimatedProps<T>) => {\n for (const value of Object.values(props)) {\n if (isValue(value)) {\n return true;\n }\n }\n return false;\n};\n\nexport const materialize = <T>(props: AnimatedProps<T>) => {\n const result = { ...props };\n mapKeys(props).forEach((key) => {\n const value = props[key];\n if (isValue(value)) {\n result[key] = (value as SkiaValue<T[typeof key]>).current;\n }\n });\n return result as T;\n};\n\nexport type AnimatedProps<T> = {\n [K in keyof T]: T[K] | SkiaValue<T[K]>;\n};\n"]}
@@ -5,16 +5,14 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.processCircle = void 0;
7
7
 
8
- var _Vector = require("./math/Vector");
9
-
10
8
  const isCircleScalarDef = def => // We have an issue to check property existence on JSI backed instances
11
9
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
12
10
  def.cx !== undefined;
13
11
 
14
- const processCircle = def => {
12
+ const processCircle = (Skia, def) => {
15
13
  if (isCircleScalarDef(def)) {
16
14
  return {
17
- c: (0, _Vector.vec)(def.cx, def.cy),
15
+ c: Skia.Point(def.cx, def.cy),
18
16
  r: def.r
19
17
  };
20
18
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["Circles.ts"],"names":["isCircleScalarDef","def","cx","undefined","processCircle","c","cy","r"],"mappings":";;;;;;;AACA;;AAeA,MAAMA,iBAAiB,GAAIC,GAAD,IACxB;AACA;AACCA,GAAD,CAAaC,EAAb,KAAoBC,SAHtB;;AAIO,MAAMC,aAAa,GAAIH,GAAD,IAAoB;AAC/C,MAAID,iBAAiB,CAACC,GAAD,CAArB,EAA4B;AAC1B,WAAO;AAAEI,MAAAA,CAAC,EAAE,iBAAIJ,GAAG,CAACC,EAAR,EAAYD,GAAG,CAACK,EAAhB,CAAL;AAA0BC,MAAAA,CAAC,EAAEN,GAAG,CAACM;AAAjC,KAAP;AACD;;AACD,SAAON,GAAP;AACD,CALM","sourcesContent":["import type { Vector } from \"./math/Vector\";\nimport { vec } from \"./math/Vector\";\n\ninterface PointCircleDef {\n c: Vector;\n r: number;\n}\n\ninterface ScalarCircleDef {\n cx: number;\n cy: number;\n r: number;\n}\n\nexport type CircleDef = PointCircleDef | ScalarCircleDef;\n\nconst isCircleScalarDef = (def: CircleDef): def is ScalarCircleDef =>\n // We have an issue to check property existence on JSI backed instances\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (def as any).cx !== undefined;\nexport const processCircle = (def: CircleDef) => {\n if (isCircleScalarDef(def)) {\n return { c: vec(def.cx, def.cy), r: def.r };\n }\n return def;\n};\n"]}
1
+ {"version":3,"sources":["Circles.ts"],"names":["isCircleScalarDef","def","cx","undefined","processCircle","Skia","c","Point","cy","r"],"mappings":";;;;;;;AAeA,MAAMA,iBAAiB,GAAIC,GAAD,IACxB;AACA;AACCA,GAAD,CAAaC,EAAb,KAAoBC,SAHtB;;AAKO,MAAMC,aAAa,GAAG,CAACC,IAAD,EAAaJ,GAAb,KAAgC;AAC3D,MAAID,iBAAiB,CAACC,GAAD,CAArB,EAA4B;AAC1B,WAAO;AAAEK,MAAAA,CAAC,EAAED,IAAI,CAACE,KAAL,CAAWN,GAAG,CAACC,EAAf,EAAmBD,GAAG,CAACO,EAAvB,CAAL;AAAiCC,MAAAA,CAAC,EAAER,GAAG,CAACQ;AAAxC,KAAP;AACD;;AACD,SAAOR,GAAP;AACD,CALM","sourcesContent":["import type { Skia, Vector } from \"../../skia/types\";\n\ninterface PointCircleDef {\n c: Vector;\n r: number;\n}\n\ninterface ScalarCircleDef {\n cx: number;\n cy: number;\n r: number;\n}\n\nexport type CircleDef = PointCircleDef | ScalarCircleDef;\n\nconst isCircleScalarDef = (def: CircleDef): def is ScalarCircleDef =>\n // We have an issue to check property existence on JSI backed instances\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (def as any).cx !== undefined;\n\nexport const processCircle = (Skia: Skia, def: CircleDef) => {\n if (isCircleScalarDef(def)) {\n return { c: Skia.Point(def.cx, def.cy), r: def.r };\n }\n return def;\n};\n"]}
@@ -5,15 +5,15 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.processClip = void 0;
7
7
 
8
- var _Paths = require("./Paths");
8
+ var _types = require("../../skia/types");
9
9
 
10
- var _Rects = require("./Rects");
10
+ var _Paths = require("./Paths");
11
11
 
12
- const processClip = (canvas, def, op) => {
12
+ const processClip = (Skia, canvas, def, op) => {
13
13
  if ((0, _Paths.isPathDef)(def)) {
14
- const path = (0, _Paths.processPath)(def);
14
+ const path = (0, _Paths.processPath)(Skia, def);
15
15
  canvas.clipPath(path, op, true);
16
- } else if ((0, _Rects.isRRect)(def)) {
16
+ } else if ((0, _types.isRRect)(def)) {
17
17
  canvas.clipRRect(def, op, true);
18
18
  } else {
19
19
  canvas.clipRect(def, op, true);
@@ -1 +1 @@
1
- {"version":3,"sources":["Clips.ts"],"names":["processClip","canvas","def","op","path","clipPath","clipRRect","clipRect"],"mappings":";;;;;;;AAGA;;AACA;;AAIO,MAAMA,WAAW,GAAG,CAACC,MAAD,EAAmBC,GAAnB,EAAiCC,EAAjC,KAAgD;AACzE,MAAI,sBAAUD,GAAV,CAAJ,EAAoB;AAClB,UAAME,IAAI,GAAG,wBAAYF,GAAZ,CAAb;AACAD,IAAAA,MAAM,CAACI,QAAP,CAAgBD,IAAhB,EAAsBD,EAAtB,EAA0B,IAA1B;AACD,GAHD,MAGO,IAAI,oBAAQD,GAAR,CAAJ,EAAkB;AACvBD,IAAAA,MAAM,CAACK,SAAP,CAAiBJ,GAAjB,EAAsBC,EAAtB,EAA0B,IAA1B;AACD,GAFM,MAEA;AACLF,IAAAA,MAAM,CAACM,QAAP,CAAgBL,GAAhB,EAAqBC,EAArB,EAAyB,IAAzB;AACD;AACF,CATM","sourcesContent":["import type { SkCanvas, ClipOp, SkRect, SkRRect } from \"../../skia\";\n\nimport type { PathDef } from \"./Paths\";\nimport { processPath, isPathDef } from \"./Paths\";\nimport { isRRect } from \"./Rects\";\n\nexport type ClipDef = SkRRect | SkRect | PathDef;\n\nexport const processClip = (canvas: SkCanvas, def: ClipDef, op: ClipOp) => {\n if (isPathDef(def)) {\n const path = processPath(def);\n canvas.clipPath(path, op, true);\n } else if (isRRect(def)) {\n canvas.clipRRect(def, op, true);\n } else {\n canvas.clipRect(def, op, true);\n }\n};\n"]}
1
+ {"version":3,"sources":["Clips.ts"],"names":["processClip","Skia","canvas","def","op","path","clipPath","clipRRect","clipRect"],"mappings":";;;;;;;AAAA;;AAIA;;AAIO,MAAMA,WAAW,GAAG,CACzBC,IADyB,EAEzBC,MAFyB,EAGzBC,GAHyB,EAIzBC,EAJyB,KAKtB;AACH,MAAI,sBAAUD,GAAV,CAAJ,EAAoB;AAClB,UAAME,IAAI,GAAG,wBAAYJ,IAAZ,EAAkBE,GAAlB,CAAb;AACAD,IAAAA,MAAM,CAACI,QAAP,CAAgBD,IAAhB,EAAsBD,EAAtB,EAA0B,IAA1B;AACD,GAHD,MAGO,IAAI,oBAAQD,GAAR,CAAJ,EAAkB;AACvBD,IAAAA,MAAM,CAACK,SAAP,CAAiBJ,GAAjB,EAAsBC,EAAtB,EAA0B,IAA1B;AACD,GAFM,MAEA;AACLF,IAAAA,MAAM,CAACM,QAAP,CAAgBL,GAAhB,EAAqBC,EAArB,EAAyB,IAAzB;AACD;AACF,CAdM","sourcesContent":["import { isRRect } from \"../../skia/types\";\nimport type { SkCanvas, ClipOp, SkRect, SkRRect, Skia } from \"../../skia/types\";\n\nimport type { PathDef } from \"./Paths\";\nimport { processPath, isPathDef } from \"./Paths\";\n\nexport type ClipDef = SkRRect | SkRect | PathDef;\n\nexport const processClip = (\n Skia: Skia,\n canvas: SkCanvas,\n def: ClipDef,\n op: ClipOp\n) => {\n if (isPathDef(def)) {\n const path = processPath(Skia, def);\n canvas.clipPath(path, op, true);\n } else if (isRRect(def)) {\n canvas.clipRRect(def, op, true);\n } else {\n canvas.clipRect(def, op, true);\n }\n};\n"]}
@@ -4,9 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.rgbaColor = exports.processColor = exports.RED = exports.GREEN = exports.BLUE = exports.ALPHA = void 0;
7
-
8
- var _Skia = require("../Skia");
9
-
10
7
  const RED = 0;
11
8
  exports.RED = RED;
12
9
  const GREEN = 1;
@@ -20,9 +17,8 @@ const rgbaColor = (r, g, b, a) => new Float32Array([r, g, b, a]);
20
17
 
21
18
  exports.rgbaColor = rgbaColor;
22
19
 
23
- const processColor = (cl, currentOpacity) => {
24
- const color = _Skia.Skia.Color(cl);
25
-
20
+ const processColor = (Skia, cl, currentOpacity) => {
21
+ const color = Skia.Color(cl);
26
22
  color[ALPHA] *= currentOpacity;
27
23
  return color;
28
24
  };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["Color.ts"],"names":["RED","GREEN","BLUE","ALPHA","rgbaColor","r","g","b","a","Float32Array","processColor","Skia","cl","currentOpacity","color","Color"],"mappings":";;;;;;AAEO,MAAMA,GAAG,GAAG,CAAZ;;AACA,MAAMC,KAAK,GAAG,CAAd;;AACA,MAAMC,IAAI,GAAG,CAAb;;AACA,MAAMC,KAAK,GAAG,CAAd;;;AAEA,MAAMC,SAAS,GAAG,CAACC,CAAD,EAAYC,CAAZ,EAAuBC,CAAvB,EAAkCC,CAAlC,KACvB,IAAIC,YAAJ,CAAiB,CAACJ,CAAD,EAAIC,CAAJ,EAAOC,CAAP,EAAUC,CAAV,CAAjB,CADK;;;;AAGA,MAAME,YAAY,GAAG,CAACC,IAAD,EAAaC,EAAb,EAAwBC,cAAxB,KAAmD;AAC7E,QAAMC,KAAK,GAAGH,IAAI,CAACI,KAAL,CAAWH,EAAX,CAAd;AACAE,EAAAA,KAAK,CAACX,KAAD,CAAL,IAAgBU,cAAhB;AACA,SAAOC,KAAP;AACD,CAJM","sourcesContent":["import type { Color, Skia } from \"../../skia/types\";\n\nexport const RED = 0;\nexport const GREEN = 1;\nexport const BLUE = 2;\nexport const ALPHA = 3;\n\nexport const rgbaColor = (r: number, g: number, b: number, a: number) =>\n new Float32Array([r, g, b, a]);\n\nexport const processColor = (Skia: Skia, cl: Color, currentOpacity: number) => {\n const color = Skia.Color(cl);\n color[ALPHA] *= currentOpacity;\n return color;\n};\n"]}
@@ -5,20 +5,20 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.processFont = exports.isFont = void 0;
7
7
 
8
- var _Skia = require("../../skia/Skia");
9
-
10
8
  const isFont = fontDef => // We have an issue to check property existence on JSI backed instances
11
9
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
12
10
  fontDef.font !== undefined;
13
11
 
14
12
  exports.isFont = isFont;
15
13
 
16
- const processFont = (fontMgr, fontDef) => {
14
+ const processFont = (Skia, fontMgr, fontDef) => {
17
15
  let selectedFont;
18
16
 
19
17
  if (isFont(fontDef)) {
20
18
  selectedFont = fontDef.font;
21
19
  } else {
20
+ console.warn( // eslint-disable-next-line max-len
21
+ "Using system fonts is deprecated. Please use the font property instead: https://shopify.github.io/react-native-skia/docs/text/fonts");
22
22
  const {
23
23
  familyName,
24
24
  size
@@ -29,7 +29,7 @@ const processFont = (fontMgr, fontDef) => {
29
29
  throw new Error(`No typeface found for ${familyName}`);
30
30
  }
31
31
 
32
- selectedFont = _Skia.Skia.Font(typeface, size);
32
+ selectedFont = Skia.Font(typeface, size);
33
33
  }
34
34
 
35
35
  return selectedFont;
@@ -1 +1 @@
1
- {"version":3,"sources":["Font.ts"],"names":["isFont","fontDef","font","undefined","processFont","fontMgr","selectedFont","familyName","size","typeface","matchFamilyStyle","Error","Skia","Font"],"mappings":";;;;;;;AACA;;AAIO,MAAMA,MAAM,GAAIC,OAAD,IACpB;AACA;AACCA,OAAD,CAAiBC,IAAjB,KAA0BC,SAHrB;;;;AAKA,MAAMC,WAAW,GAAG,CAACC,OAAD,EAAmBJ,OAAnB,KAAwC;AACjE,MAAIK,YAAJ;;AACA,MAAIN,MAAM,CAACC,OAAD,CAAV,EAAqB;AACnBK,IAAAA,YAAY,GAAGL,OAAO,CAACC,IAAvB;AACD,GAFD,MAEO;AACL,UAAM;AAAEK,MAAAA,UAAF;AAAcC,MAAAA;AAAd,QAAuBP,OAA7B;AACA,UAAMQ,QAAQ,GAAGJ,OAAO,CAACK,gBAAR,CAAyBH,UAAzB,CAAjB;;AACA,QAAIE,QAAQ,KAAK,IAAjB,EAAuB;AACrB,YAAM,IAAIE,KAAJ,CAAW,yBAAwBJ,UAAW,EAA9C,CAAN;AACD;;AACDD,IAAAA,YAAY,GAAGM,WAAKC,IAAL,CAAUJ,QAAV,EAAoBD,IAApB,CAAf;AACD;;AACD,SAAOF,YAAP;AACD,CAbM","sourcesContent":["import type { FontMgr, SkFont } from \"../../skia\";\nimport { Skia } from \"../../skia/Skia\";\n\nexport type FontDef = { font: SkFont } | { familyName: string; size: number };\n\nexport const isFont = (fontDef: FontDef): fontDef is { font: SkFont } =>\n // We have an issue to check property existence on JSI backed instances\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (fontDef as any).font !== undefined;\n\nexport const processFont = (fontMgr: FontMgr, fontDef: FontDef) => {\n let selectedFont: SkFont;\n if (isFont(fontDef)) {\n selectedFont = fontDef.font;\n } else {\n const { familyName, size } = fontDef;\n const typeface = fontMgr.matchFamilyStyle(familyName);\n if (typeface === null) {\n throw new Error(`No typeface found for ${familyName}`);\n }\n selectedFont = Skia.Font(typeface, size);\n }\n return selectedFont;\n};\n"]}
1
+ {"version":3,"sources":["Font.ts"],"names":["isFont","fontDef","font","undefined","processFont","Skia","fontMgr","selectedFont","console","warn","familyName","size","typeface","matchFamilyStyle","Error","Font"],"mappings":";;;;;;;AAIO,MAAMA,MAAM,GAAIC,OAAD,IACpB;AACA;AACCA,OAAD,CAAiBC,IAAjB,KAA0BC,SAHrB;;;;AAKA,MAAMC,WAAW,GAAG,CACzBC,IADyB,EAEzBC,OAFyB,EAGzBL,OAHyB,KAItB;AACH,MAAIM,YAAJ;;AACA,MAAIP,MAAM,CAACC,OAAD,CAAV,EAAqB;AACnBM,IAAAA,YAAY,GAAGN,OAAO,CAACC,IAAvB;AACD,GAFD,MAEO;AACLM,IAAAA,OAAO,CAACC,IAAR,EACE;AACA,yIAFF;AAIA,UAAM;AAAEC,MAAAA,UAAF;AAAcC,MAAAA;AAAd,QAAuBV,OAA7B;AACA,UAAMW,QAAQ,GAAGN,OAAO,CAACO,gBAAR,CAAyBH,UAAzB,CAAjB;;AACA,QAAIE,QAAQ,KAAK,IAAjB,EAAuB;AACrB,YAAM,IAAIE,KAAJ,CAAW,yBAAwBJ,UAAW,EAA9C,CAAN;AACD;;AACDH,IAAAA,YAAY,GAAGF,IAAI,CAACU,IAAL,CAAUH,QAAV,EAAoBD,IAApB,CAAf;AACD;;AACD,SAAOJ,YAAP;AACD,CArBM","sourcesContent":["import type { SkFontMgr, SkFont, Skia } from \"../../skia/types\";\n\nexport type FontDef = { font: SkFont } | { familyName: string; size: number };\n\nexport const isFont = (fontDef: FontDef): fontDef is { font: SkFont } =>\n // We have an issue to check property existence on JSI backed instances\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (fontDef as any).font !== undefined;\n\nexport const processFont = (\n Skia: Skia,\n fontMgr: SkFontMgr,\n fontDef: FontDef\n) => {\n let selectedFont: SkFont;\n if (isFont(fontDef)) {\n selectedFont = fontDef.font;\n } else {\n console.warn(\n // eslint-disable-next-line max-len\n \"Using system fonts is deprecated. Please use the font property instead: https://shopify.github.io/react-native-skia/docs/text/fonts\"\n );\n const { familyName, size } = fontDef;\n const typeface = fontMgr.matchFamilyStyle(familyName);\n if (typeface === null) {\n throw new Error(`No typeface found for ${familyName}`);\n }\n selectedFont = Skia.Font(typeface, size);\n }\n return selectedFont;\n};\n"]}
@@ -5,13 +5,15 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.processPaint = exports.enumKey = void 0;
7
7
 
8
- var _skia = require("../../skia");
8
+ var _types = require("../../skia/types");
9
+
10
+ var _Color = require("./Color");
9
11
 
10
12
  const enumKey = k => k.charAt(0).toUpperCase() + k.slice(1);
11
13
 
12
14
  exports.enumKey = enumKey;
13
15
 
14
- const processPaint = (paint, currentOpacity, _ref, children) => {
16
+ const processPaint = (Skia, paint, currentOpacity, _ref, children) => {
15
17
  let {
16
18
  paint: paintRef,
17
19
  color,
@@ -30,28 +32,28 @@ const processPaint = (paint, currentOpacity, _ref, children) => {
30
32
  }
31
33
 
32
34
  if (color !== undefined) {
33
- const c = (0, _skia.processColor)(color, currentOpacity);
35
+ const c = (0, _Color.processColor)(Skia, color, currentOpacity);
34
36
  paint.setShader(null);
35
37
  paint.setColor(c);
36
38
  } else {
37
- const c = (0, _skia.processColor)(paint.getColor(), currentOpacity);
39
+ const c = (0, _Color.processColor)(Skia, paint.getColor(), currentOpacity);
38
40
  paint.setColor(c);
39
41
  }
40
42
 
41
43
  if (blendMode !== undefined) {
42
- paint.setBlendMode(_skia.BlendMode[enumKey(blendMode)]);
44
+ paint.setBlendMode(_types.BlendMode[enumKey(blendMode)]);
43
45
  }
44
46
 
45
47
  if (style !== undefined) {
46
- paint.setStyle(_skia.PaintStyle[enumKey(style)]);
48
+ paint.setStyle(_types.PaintStyle[enumKey(style)]);
47
49
  }
48
50
 
49
51
  if (strokeJoin !== undefined) {
50
- paint.setStrokeJoin(_skia.StrokeJoin[enumKey(strokeJoin)]);
52
+ paint.setStrokeJoin(_types.StrokeJoin[enumKey(strokeJoin)]);
51
53
  }
52
54
 
53
55
  if (strokeCap !== undefined) {
54
- paint.setStrokeCap(_skia.StrokeCap[enumKey(strokeCap)]);
56
+ paint.setStrokeCap(_types.StrokeCap[enumKey(strokeCap)]);
55
57
  }
56
58
 
57
59
  if (strokeMiter !== undefined) {
@@ -71,20 +73,22 @@ const processPaint = (paint, currentOpacity, _ref, children) => {
71
73
  }
72
74
 
73
75
  children.forEach(child => {
74
- if ((0, _skia.isShader)(child)) {
76
+ if ((0, _types.isShader)(child)) {
75
77
  paint.setShader(child);
76
- } else if ((0, _skia.isMaskFilter)(child)) {
78
+ } else if ((0, _types.isMaskFilter)(child)) {
77
79
  paint.setMaskFilter(child);
78
- } else if ((0, _skia.isColorFilter)(child)) {
80
+ } else if ((0, _types.isColorFilter)(child)) {
79
81
  paint.setColorFilter(child);
80
- } else if ((0, _skia.isPathEffect)(child)) {
82
+ } else if ((0, _types.isPathEffect)(child)) {
81
83
  paint.setPathEffect(child);
82
84
  }
83
85
  });
84
- const filters = children.filter(_skia.isImageFilter);
86
+ const filters = children.filter(_types.isImageFilter);
85
87
 
86
88
  if (filters.length > 0) {
87
- paint.setImageFilter(filters.reverse().reduce(_skia.Skia.ImageFilter.MakeCompose, null));
89
+ paint.setImageFilter(filters.reverse().reduce(function () {
90
+ return Skia.ImageFilter.MakeCompose(...arguments);
91
+ }, null));
88
92
  }
89
93
 
90
94
  return paint;
@@ -1 +1 @@
1
- {"version":3,"sources":["Paint.ts"],"names":["enumKey","k","charAt","toUpperCase","slice","processPaint","paint","currentOpacity","children","paintRef","color","blendMode","style","strokeWidth","strokeJoin","strokeCap","strokeMiter","opacity","antiAlias","current","undefined","c","setShader","setColor","getColor","setBlendMode","BlendMode","setStyle","PaintStyle","setStrokeJoin","StrokeJoin","setStrokeCap","StrokeCap","setStrokeMiter","setStrokeWidth","setAlphaf","setAntiAlias","forEach","child","setMaskFilter","setColorFilter","setPathEffect","filters","filter","isImageFilter","length","setImageFilter","reverse","reduce","Skia","ImageFilter","MakeCompose"],"mappings":"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","sourcesContent":["import type { ReactNode, RefObject } from \"react\";\n\nimport {\n BlendMode,\n PaintStyle,\n StrokeJoin,\n StrokeCap,\n processColor,\n isShader,\n isMaskFilter,\n isColorFilter,\n isPathEffect,\n isImageFilter,\n Skia,\n} from \"../../skia\";\nimport type { SkPaint, Color, SkImageFilter } from \"../../skia\";\nimport type { DeclarationResult } from \"../nodes\";\nexport type SkEnum<T> = Uncapitalize<keyof T extends string ? keyof T : never>;\n\nexport interface ChildrenProps {\n children?: ReactNode | ReactNode[];\n}\n\n// TODO: rename to paint props?\nexport interface CustomPaintProps extends ChildrenProps {\n paint?: RefObject<SkPaint>;\n color?: Color;\n strokeWidth?: number;\n blendMode?: SkEnum<typeof BlendMode>;\n style?: SkEnum<typeof PaintStyle>;\n strokeJoin?: SkEnum<typeof StrokeJoin>;\n strokeCap?: SkEnum<typeof StrokeCap>;\n strokeMiter?: number;\n opacity?: number;\n antiAlias?: boolean;\n}\n\nexport const enumKey = <K extends string>(k: K) =>\n (k.charAt(0).toUpperCase() + k.slice(1)) as Capitalize<K>;\n\nexport const processPaint = (\n paint: SkPaint,\n currentOpacity: number,\n {\n paint: paintRef,\n color,\n blendMode,\n style,\n strokeWidth,\n strokeJoin,\n strokeCap,\n strokeMiter,\n opacity,\n antiAlias,\n }: CustomPaintProps,\n children: DeclarationResult[]\n) => {\n if (paintRef && paintRef.current) {\n return paintRef.current;\n }\n if (color !== undefined) {\n const c = processColor(color, currentOpacity);\n paint.setShader(null);\n paint.setColor(c);\n } else {\n const c = processColor(paint.getColor(), currentOpacity);\n paint.setColor(c);\n }\n if (blendMode !== undefined) {\n paint.setBlendMode(BlendMode[enumKey(blendMode)]);\n }\n if (style !== undefined) {\n paint.setStyle(PaintStyle[enumKey(style)]);\n }\n if (strokeJoin !== undefined) {\n paint.setStrokeJoin(StrokeJoin[enumKey(strokeJoin)]);\n }\n if (strokeCap !== undefined) {\n paint.setStrokeCap(StrokeCap[enumKey(strokeCap)]);\n }\n if (strokeMiter !== undefined) {\n paint.setStrokeMiter(strokeMiter);\n }\n if (strokeWidth !== undefined) {\n paint.setStrokeWidth(strokeWidth);\n }\n if (opacity !== undefined) {\n paint.setAlphaf(opacity);\n }\n if (antiAlias !== undefined) {\n paint.setAntiAlias(antiAlias);\n }\n children.forEach((child) => {\n if (isShader(child)) {\n paint.setShader(child);\n } else if (isMaskFilter(child)) {\n paint.setMaskFilter(child);\n } else if (isColorFilter(child)) {\n paint.setColorFilter(child);\n } else if (isPathEffect(child)) {\n paint.setPathEffect(child);\n }\n });\n const filters = children.filter(isImageFilter);\n if (filters.length > 0) {\n paint.setImageFilter(\n filters\n .reverse()\n .reduce<SkImageFilter | null>(Skia.ImageFilter.MakeCompose, null)\n );\n }\n return paint;\n};\n"]}
1
+ {"version":3,"sources":["Paint.ts"],"names":["enumKey","k","charAt","toUpperCase","slice","processPaint","Skia","paint","currentOpacity","children","paintRef","color","blendMode","style","strokeWidth","strokeJoin","strokeCap","strokeMiter","opacity","antiAlias","current","undefined","c","setShader","setColor","getColor","setBlendMode","BlendMode","setStyle","PaintStyle","setStrokeJoin","StrokeJoin","setStrokeCap","StrokeCap","setStrokeMiter","setStrokeWidth","setAlphaf","setAntiAlias","forEach","child","setMaskFilter","setColorFilter","setPathEffect","filters","filter","isImageFilter","length","setImageFilter","reverse","reduce","ImageFilter","MakeCompose"],"mappings":"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","sourcesContent":["import type { ReactNode, RefObject } from \"react\";\n\nimport {\n BlendMode,\n PaintStyle,\n StrokeJoin,\n StrokeCap,\n isShader,\n isMaskFilter,\n isColorFilter,\n isPathEffect,\n isImageFilter,\n} from \"../../skia/types\";\nimport type { SkPaint, Color, SkImageFilter, Skia } from \"../../skia/types\";\nimport type { DeclarationResult } from \"../nodes\";\n\nimport { processColor } from \"./Color\";\nexport type SkEnum<T> = Uncapitalize<keyof T extends string ? keyof T : never>;\n\nexport interface ChildrenProps {\n children?: ReactNode | ReactNode[];\n}\n\n// TODO: rename to paint props?\nexport interface CustomPaintProps extends ChildrenProps {\n paint?: RefObject<SkPaint>;\n color?: Color;\n strokeWidth?: number;\n blendMode?: SkEnum<typeof BlendMode>;\n style?: SkEnum<typeof PaintStyle>;\n strokeJoin?: SkEnum<typeof StrokeJoin>;\n strokeCap?: SkEnum<typeof StrokeCap>;\n strokeMiter?: number;\n opacity?: number;\n antiAlias?: boolean;\n}\n\nexport const enumKey = <K extends string>(k: K) =>\n (k.charAt(0).toUpperCase() + k.slice(1)) as Capitalize<K>;\n\nexport const processPaint = (\n Skia: Skia,\n paint: SkPaint,\n currentOpacity: number,\n {\n paint: paintRef,\n color,\n blendMode,\n style,\n strokeWidth,\n strokeJoin,\n strokeCap,\n strokeMiter,\n opacity,\n antiAlias,\n }: CustomPaintProps,\n children: DeclarationResult[]\n) => {\n if (paintRef && paintRef.current) {\n return paintRef.current;\n }\n if (color !== undefined) {\n const c = processColor(Skia, color, currentOpacity);\n paint.setShader(null);\n paint.setColor(c);\n } else {\n const c = processColor(Skia, paint.getColor(), currentOpacity);\n paint.setColor(c);\n }\n if (blendMode !== undefined) {\n paint.setBlendMode(BlendMode[enumKey(blendMode)]);\n }\n if (style !== undefined) {\n paint.setStyle(PaintStyle[enumKey(style)]);\n }\n if (strokeJoin !== undefined) {\n paint.setStrokeJoin(StrokeJoin[enumKey(strokeJoin)]);\n }\n if (strokeCap !== undefined) {\n paint.setStrokeCap(StrokeCap[enumKey(strokeCap)]);\n }\n if (strokeMiter !== undefined) {\n paint.setStrokeMiter(strokeMiter);\n }\n if (strokeWidth !== undefined) {\n paint.setStrokeWidth(strokeWidth);\n }\n if (opacity !== undefined) {\n paint.setAlphaf(opacity);\n }\n if (antiAlias !== undefined) {\n paint.setAntiAlias(antiAlias);\n }\n children.forEach((child) => {\n if (isShader(child)) {\n paint.setShader(child);\n } else if (isMaskFilter(child)) {\n paint.setMaskFilter(child);\n } else if (isColorFilter(child)) {\n paint.setColorFilter(child);\n } else if (isPathEffect(child)) {\n paint.setPathEffect(child);\n }\n });\n const filters = children.filter(isImageFilter);\n if (filters.length > 0) {\n paint.setImageFilter(\n filters\n .reverse()\n .reduce<SkImageFilter | null>(\n (...args: Parameters<typeof Skia.ImageFilter.MakeCompose>) =>\n Skia.ImageFilter.MakeCompose(...args),\n null\n )\n );\n }\n return paint;\n};\n"]}
@@ -5,10 +5,10 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.processPath = exports.isPathDef = void 0;
7
7
 
8
- var _skia = require("../../skia");
8
+ var _types = require("../../skia/types");
9
9
 
10
- const processPath = rawPath => {
11
- const path = typeof rawPath === "string" ? _skia.Skia.Path.MakeFromSVGString(rawPath) : rawPath;
10
+ const processPath = (Skia, rawPath) => {
11
+ const path = typeof rawPath === "string" ? Skia.Path.MakeFromSVGString(rawPath) : rawPath;
12
12
 
13
13
  if (!path) {
14
14
  throw new Error("Invalid path: " + rawPath);
@@ -20,7 +20,7 @@ const processPath = rawPath => {
20
20
 
21
21
  exports.processPath = processPath;
22
22
 
23
- const isPathDef = def => typeof def === "string" || (0, _skia.isPath)(def);
23
+ const isPathDef = def => typeof def === "string" || (0, _types.isPath)(def);
24
24
 
25
25
  exports.isPathDef = isPathDef;
26
26
  //# sourceMappingURL=Paths.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["Paths.ts"],"names":["processPath","rawPath","path","Skia","Path","MakeFromSVGString","Error","isPathDef","def"],"mappings":";;;;;;;AACA;;AAIO,MAAMA,WAAW,GAAIC,OAAD,IAAsB;AAC/C,QAAMC,IAAI,GACR,OAAOD,OAAP,KAAmB,QAAnB,GACIE,WAAKC,IAAL,CAAUC,iBAAV,CAA4BJ,OAA5B,CADJ,GAEIA,OAHN;;AAIA,MAAI,CAACC,IAAL,EAAW;AACT,UAAM,IAAII,KAAJ,CAAU,mBAAmBL,OAA7B,CAAN;AACD;;AACD,SAAOC,IAAP;AACD,CATM,C,CAWP;;;;;AACO,MAAMK,SAAS,GAAIC,GAAD,IACvB,OAAOA,GAAP,KAAe,QAAf,IAA2B,kBAAOA,GAAP,CADtB","sourcesContent":["import type { SkPath } from \"../../skia\";\nimport { Skia, isPath } from \"../../skia\";\n\nexport type PathDef = string | SkPath;\n\nexport const processPath = (rawPath: PathDef) => {\n const path =\n typeof rawPath === \"string\"\n ? Skia.Path.MakeFromSVGString(rawPath)\n : rawPath;\n if (!path) {\n throw new Error(\"Invalid path: \" + rawPath);\n }\n return path;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const isPathDef = (def: any): def is PathDef =>\n typeof def === \"string\" || isPath(def);\n"]}
1
+ {"version":3,"sources":["Paths.ts"],"names":["processPath","Skia","rawPath","path","Path","MakeFromSVGString","Error","isPathDef","def"],"mappings":";;;;;;;AACA;;AAIO,MAAMA,WAAW,GAAG,CAACC,IAAD,EAAaC,OAAb,KAAkC;AAC3D,QAAMC,IAAI,GACR,OAAOD,OAAP,KAAmB,QAAnB,GACID,IAAI,CAACG,IAAL,CAAUC,iBAAV,CAA4BH,OAA5B,CADJ,GAEIA,OAHN;;AAIA,MAAI,CAACC,IAAL,EAAW;AACT,UAAM,IAAIG,KAAJ,CAAU,mBAAmBJ,OAA7B,CAAN;AACD;;AACD,SAAOC,IAAP;AACD,CATM,C,CAWP;;;;;AACO,MAAMI,SAAS,GAAIC,GAAD,IACvB,OAAOA,GAAP,KAAe,QAAf,IAA2B,mBAAOA,GAAP,CADtB","sourcesContent":["import type { SkPath, Skia } from \"../../skia/types\";\nimport { isPath } from \"../../skia/types\";\n\nexport type PathDef = string | SkPath;\n\nexport const processPath = (Skia: Skia, rawPath: PathDef) => {\n const path =\n typeof rawPath === \"string\"\n ? Skia.Path.MakeFromSVGString(rawPath)\n : rawPath;\n if (!path) {\n throw new Error(\"Invalid path: \" + rawPath);\n }\n return path;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const isPathDef = (def: any): def is PathDef =>\n typeof def === \"string\" || isPath(def);\n"]}
@@ -5,11 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.processRadius = void 0;
7
7
 
8
- var _math = require("./math");
9
-
10
- const processRadius = radius => {
8
+ const processRadius = (Skia, radius) => {
11
9
  if (typeof radius === "number") {
12
- return (0, _math.vec)(radius, radius);
10
+ return Skia.Point(radius, radius);
13
11
  }
14
12
 
15
13
  return radius;
@@ -1 +1 @@
1
- {"version":3,"sources":["Radius.ts"],"names":["processRadius","radius"],"mappings":";;;;;;;AACA;;AAIO,MAAMA,aAAa,GAAIC,MAAD,IAA4B;AACvD,MAAI,OAAOA,MAAP,KAAkB,QAAtB,EAAgC;AAC9B,WAAO,eAAIA,MAAJ,EAAYA,MAAZ,CAAP;AACD;;AACD,SAAOA,MAAP;AACD,CALM","sourcesContent":["import type { Vector } from \"./math\";\nimport { vec } from \"./math\";\n\nexport type Radius = number | Vector;\n\nexport const processRadius = (radius: Radius): Vector => {\n if (typeof radius === \"number\") {\n return vec(radius, radius);\n }\n return radius;\n};\n"]}
1
+ {"version":3,"sources":["Radius.ts"],"names":["processRadius","Skia","radius","Point"],"mappings":";;;;;;;AAIO,MAAMA,aAAa,GAAG,CAACC,IAAD,EAAaC,MAAb,KAAwC;AACnE,MAAI,OAAOA,MAAP,KAAkB,QAAtB,EAAgC;AAC9B,WAAOD,IAAI,CAACE,KAAL,CAAWD,MAAX,EAAmBA,MAAnB,CAAP;AACD;;AACD,SAAOA,MAAP;AACD,CALM","sourcesContent":["import type { Skia, Vector } from \"../../skia/types\";\n\nexport type Radius = number | Vector;\n\nexport const processRadius = (Skia: Skia, radius: Radius): Vector => {\n if (typeof radius === \"number\") {\n return Skia.Point(radius, radius);\n }\n return radius;\n};\n"]}