@shopify/react-native-skia 0.1.128 → 0.1.129

Sign up to get free protection for your applications and to get access to all the features.
Files changed (780) hide show
  1. package/lib/commonjs/animation/decay/runDecay.js.map +1 -1
  2. package/lib/commonjs/animation/functions/interpolateColors.js.map +1 -1
  3. package/lib/commonjs/animation/spring/runSpring.js.map +1 -1
  4. package/lib/commonjs/animation/spring/useSpring.js.map +1 -1
  5. package/lib/commonjs/animation/timing/createTiming.js.map +1 -1
  6. package/lib/commonjs/animation/timing/runTiming.js.map +1 -1
  7. package/lib/commonjs/animation/timing/useTiming.js.map +1 -1
  8. package/lib/commonjs/index.js.map +1 -1
  9. package/lib/commonjs/renderer/Canvas.js +1 -3
  10. package/lib/commonjs/renderer/Canvas.js.map +1 -1
  11. package/lib/commonjs/renderer/DependencyManager.js.map +1 -1
  12. package/lib/commonjs/renderer/components/Blend.js +1 -3
  13. package/lib/commonjs/renderer/components/Blend.js.map +1 -1
  14. package/lib/commonjs/renderer/components/Compose.js +2 -6
  15. package/lib/commonjs/renderer/components/Compose.js.map +1 -1
  16. package/lib/commonjs/renderer/components/colorFilters/Lerp.js +1 -3
  17. package/lib/commonjs/renderer/components/colorFilters/Lerp.js.map +1 -1
  18. package/lib/commonjs/renderer/components/imageFilters/DisplacementMap.js +2 -4
  19. package/lib/commonjs/renderer/components/imageFilters/DisplacementMap.js.map +1 -1
  20. package/lib/commonjs/renderer/components/imageFilters/InnerShadow.js.map +1 -1
  21. package/lib/commonjs/renderer/components/imageFilters/RuntimeShader.js.map +1 -1
  22. package/lib/commonjs/renderer/components/imageFilters/Shadow.js +1 -3
  23. package/lib/commonjs/renderer/components/imageFilters/Shadow.js.map +1 -1
  24. package/lib/commonjs/renderer/components/maskFilters/Blur.js +1 -3
  25. package/lib/commonjs/renderer/components/maskFilters/Blur.js.map +1 -1
  26. package/lib/commonjs/renderer/components/pathEffects/Corner.js +1 -3
  27. package/lib/commonjs/renderer/components/pathEffects/Corner.js.map +1 -1
  28. package/lib/commonjs/renderer/components/pathEffects/Dash.js +1 -3
  29. package/lib/commonjs/renderer/components/pathEffects/Dash.js.map +1 -1
  30. package/lib/commonjs/renderer/components/pathEffects/Discrete.js +1 -3
  31. package/lib/commonjs/renderer/components/pathEffects/Discrete.js.map +1 -1
  32. package/lib/commonjs/renderer/components/pathEffects/Line2D.js +1 -3
  33. package/lib/commonjs/renderer/components/pathEffects/Line2D.js.map +1 -1
  34. package/lib/commonjs/renderer/components/pathEffects/Path1D.js +2 -4
  35. package/lib/commonjs/renderer/components/pathEffects/Path1D.js.map +1 -1
  36. package/lib/commonjs/renderer/components/pathEffects/Path2D.js +1 -3
  37. package/lib/commonjs/renderer/components/pathEffects/Path2D.js.map +1 -1
  38. package/lib/commonjs/renderer/components/pathEffects/Sum.js +1 -3
  39. package/lib/commonjs/renderer/components/pathEffects/Sum.js.map +1 -1
  40. package/lib/commonjs/renderer/components/shaders/Gradient.js.map +1 -1
  41. package/lib/commonjs/renderer/components/shapes/Box.js.map +1 -1
  42. package/lib/commonjs/renderer/components/shapes/DiffRect.js.map +1 -1
  43. package/lib/commonjs/renderer/components/shapes/Patch.js +1 -3
  44. package/lib/commonjs/renderer/components/shapes/Patch.js.map +1 -1
  45. package/lib/commonjs/renderer/components/text/TextBlob.js.map +1 -1
  46. package/lib/commonjs/renderer/components/text/TextPath.js.map +1 -1
  47. package/lib/commonjs/renderer/index.js +13 -0
  48. package/lib/commonjs/renderer/index.js.map +1 -1
  49. package/lib/commonjs/renderer/nodes/Declaration.js.map +1 -1
  50. package/lib/commonjs/renderer/nodes/Node.js.map +1 -1
  51. package/lib/commonjs/renderer/processors/Animations/Animations.js.map +1 -1
  52. package/lib/commonjs/renderer/processors/Clips.js.map +1 -1
  53. package/lib/commonjs/renderer/processors/Font.js.map +1 -1
  54. package/lib/commonjs/renderer/processors/Rects.js +5 -1
  55. package/lib/commonjs/renderer/processors/Rects.js.map +1 -1
  56. package/lib/commonjs/renderer/processors/Transform.js.map +1 -1
  57. package/lib/commonjs/skia/Skia.js +2 -36
  58. package/lib/commonjs/skia/Skia.js.map +1 -1
  59. package/lib/commonjs/skia/{Color.js → core/Color.js} +1 -1
  60. package/lib/commonjs/skia/core/Color.js.map +1 -0
  61. package/lib/commonjs/skia/{Data → core}/Data.js +29 -8
  62. package/lib/commonjs/skia/core/Data.js.map +1 -0
  63. package/lib/commonjs/skia/{Font/useFont.js → core/Font.js} +4 -4
  64. package/lib/commonjs/skia/core/Font.js.map +1 -0
  65. package/lib/commonjs/skia/{Image/useImage.js → core/Image.js} +4 -4
  66. package/lib/commonjs/skia/core/Image.js.map +1 -0
  67. package/lib/commonjs/skia/{Paint/usePaint.js → core/Paint.js} +14 -4
  68. package/lib/commonjs/skia/core/Paint.js.map +1 -0
  69. package/lib/commonjs/skia/{Path/usePath.js → core/Path.js} +1 -1
  70. package/lib/commonjs/skia/core/Path.js.map +1 -0
  71. package/lib/commonjs/skia/{Picture/usePicture.js → core/Picture.js} +1 -1
  72. package/lib/commonjs/skia/core/Picture.js.map +1 -0
  73. package/lib/commonjs/skia/core/SVG.js +15 -0
  74. package/lib/commonjs/skia/core/SVG.js.map +1 -0
  75. package/lib/commonjs/skia/{Shader/useShader.js → core/Shader.js} +1 -1
  76. package/lib/commonjs/skia/core/Shader.js.map +1 -0
  77. package/lib/commonjs/skia/{Typeface/useTypeface.js → core/Typeface.js} +3 -3
  78. package/lib/commonjs/skia/core/Typeface.js.map +1 -0
  79. package/lib/commonjs/skia/core/index.js +136 -0
  80. package/lib/commonjs/skia/core/index.js.map +1 -0
  81. package/lib/commonjs/skia/index.js +8 -302
  82. package/lib/commonjs/skia/index.js.map +1 -1
  83. package/lib/commonjs/skia/{Canvas.js → types/Canvas.js} +0 -0
  84. package/lib/commonjs/skia/{Canvas.js.map → types/Canvas.js.map} +0 -0
  85. package/lib/commonjs/skia/types/Color.js +2 -0
  86. package/lib/commonjs/skia/{ColorFilter/ColorFilterFactory.js.map → types/Color.js.map} +0 -0
  87. package/lib/commonjs/skia/{ColorFilter → types/ColorFilter}/ColorFilter.js +0 -0
  88. package/lib/commonjs/skia/{ColorFilter → types/ColorFilter}/ColorFilter.js.map +0 -0
  89. package/lib/commonjs/skia/{ColorFilter → types/ColorFilter}/ColorFilterFactory.js +0 -0
  90. package/lib/{module/skia → commonjs/skia/types}/ColorFilter/ColorFilterFactory.js.map +0 -0
  91. package/lib/commonjs/skia/{ColorFilter → types/ColorFilter}/index.js +0 -0
  92. package/lib/commonjs/skia/{ColorFilter → types/ColorFilter}/index.js.map +0 -0
  93. package/lib/commonjs/skia/{ContourMeasure.js → types/ContourMeasure.js} +0 -0
  94. package/lib/commonjs/skia/{ContourMeasure.js.map → types/ContourMeasure.js.map} +0 -0
  95. package/lib/commonjs/skia/types/Data/Data.js +6 -0
  96. package/lib/commonjs/skia/{Data/DataFactory.js.map → types/Data/Data.js.map} +0 -0
  97. package/lib/commonjs/skia/{Data → types/Data}/DataFactory.js +0 -0
  98. package/lib/{module/skia → commonjs/skia/types}/Data/DataFactory.js.map +0 -0
  99. package/lib/commonjs/skia/{Data → types/Data}/index.js +0 -0
  100. package/lib/commonjs/skia/{Data → types/Data}/index.js.map +0 -0
  101. package/lib/commonjs/skia/{Font → types/Font}/Font.js +0 -0
  102. package/lib/commonjs/skia/types/Font/Font.js.map +1 -0
  103. package/lib/commonjs/skia/{Font → types/Font}/index.js +0 -13
  104. package/lib/commonjs/skia/{FontMgr → types/Font}/index.js.map +1 -1
  105. package/lib/commonjs/skia/{FontMgr → types/FontMgr}/FontMgr.js +0 -0
  106. package/lib/commonjs/skia/{FontMgr → types/FontMgr}/FontMgr.js.map +0 -0
  107. package/lib/commonjs/skia/{FontMgr → types/FontMgr}/FontMgrFactory.js +0 -0
  108. package/lib/commonjs/skia/{FontMgr → types/FontMgr}/FontMgrFactory.js.map +0 -0
  109. package/lib/commonjs/skia/{FontMgr → types/FontMgr}/index.js +13 -0
  110. package/lib/commonjs/skia/types/FontMgr/index.js.map +1 -0
  111. package/lib/commonjs/skia/{Image → types/Image}/Image.js +0 -0
  112. package/lib/commonjs/skia/{Image → types/Image}/Image.js.map +1 -1
  113. package/lib/commonjs/skia/{Image → types/Image}/ImageFactory.js +0 -0
  114. package/lib/commonjs/skia/{Image → types/Image}/ImageFactory.js.map +0 -0
  115. package/lib/commonjs/skia/{Image → types/Image}/index.js +0 -13
  116. package/lib/commonjs/skia/types/Image/index.js.map +1 -0
  117. package/lib/commonjs/skia/{ImageFilter → types/ImageFilter}/ImageFilter.js +0 -0
  118. package/lib/commonjs/skia/{ImageFilter → types/ImageFilter}/ImageFilter.js.map +0 -0
  119. package/lib/commonjs/skia/{ImageFilter → types/ImageFilter}/ImageFilterFactory.js +0 -0
  120. package/lib/commonjs/skia/types/ImageFilter/ImageFilterFactory.js.map +1 -0
  121. package/lib/commonjs/skia/{ImageFilter → types/ImageFilter}/index.js +0 -0
  122. package/lib/commonjs/skia/{ImageFilter → types/ImageFilter}/index.js.map +0 -0
  123. package/lib/commonjs/skia/{JsiInstance.js → types/JsiInstance.js} +0 -0
  124. package/lib/commonjs/skia/{JsiInstance.js.map → types/JsiInstance.js.map} +0 -0
  125. package/lib/commonjs/skia/{MaskFilter.js → types/MaskFilter.js} +0 -0
  126. package/lib/commonjs/skia/types/MaskFilter.js.map +1 -0
  127. package/lib/commonjs/skia/{Matrix.js → types/Matrix.js} +0 -0
  128. package/lib/commonjs/skia/{Matrix.js.map → types/Matrix.js.map} +0 -0
  129. package/lib/commonjs/skia/{Paint → types/Paint}/BlendMode.js +0 -0
  130. package/lib/commonjs/skia/{Paint → types/Paint}/BlendMode.js.map +0 -0
  131. package/lib/commonjs/skia/{Paint → types/Paint}/Paint.js +1 -13
  132. package/lib/commonjs/skia/types/Paint/Paint.js.map +1 -0
  133. package/lib/commonjs/skia/{Paint → types/Paint}/index.js +0 -13
  134. package/lib/commonjs/skia/types/Paint/index.js.map +1 -0
  135. package/lib/commonjs/skia/{Path → types/Path}/Path.js +0 -0
  136. package/lib/commonjs/skia/{Path → types/Path}/Path.js.map +0 -0
  137. package/lib/commonjs/skia/{Path → types/Path}/PathFactory.js +0 -0
  138. package/lib/commonjs/skia/{Path → types/Path}/PathFactory.js.map +0 -0
  139. package/lib/commonjs/skia/{Path → types/Path}/index.js +0 -13
  140. package/lib/commonjs/skia/types/Path/index.js.map +1 -0
  141. package/lib/commonjs/skia/{PathEffect.js → types/PathEffect.js} +0 -0
  142. package/lib/commonjs/skia/types/PathEffect.js.map +1 -0
  143. package/lib/commonjs/skia/{Picture → types/Picture}/Picture.js +0 -0
  144. package/lib/commonjs/skia/{Picture → types/Picture}/Picture.js.map +0 -0
  145. package/lib/commonjs/skia/{Picture → types/Picture}/PictureFactory.js +0 -0
  146. package/lib/commonjs/skia/{Picture → types/Picture}/PictureFactory.js.map +0 -0
  147. package/lib/commonjs/skia/{Picture → types/Picture}/PictureRecorder.js +0 -0
  148. package/lib/commonjs/skia/{Picture → types/Picture}/PictureRecorder.js.map +0 -0
  149. package/lib/commonjs/skia/{Picture → types/Picture}/index.js +0 -13
  150. package/lib/commonjs/skia/{Paint → types/Picture}/index.js.map +1 -1
  151. package/lib/commonjs/skia/{Point.js → types/Point.js} +0 -0
  152. package/lib/commonjs/skia/{Point.js.map → types/Point.js.map} +0 -0
  153. package/lib/commonjs/skia/{RRect.js → types/RRect.js} +0 -0
  154. package/lib/commonjs/skia/{RRect.js.map → types/RRect.js.map} +0 -0
  155. package/lib/commonjs/skia/{RSXform.js → types/RSXform.js} +0 -0
  156. package/lib/commonjs/skia/{RSXform.js.map → types/RSXform.js.map} +0 -0
  157. package/lib/commonjs/skia/{Rect.js → types/Rect.js} +0 -0
  158. package/lib/commonjs/skia/{Rect.js.map → types/Rect.js.map} +0 -0
  159. package/lib/commonjs/skia/{RuntimeEffect → types/RuntimeEffect}/RuntimeEffect.js +0 -0
  160. package/lib/commonjs/skia/{RuntimeEffect → types/RuntimeEffect}/RuntimeEffect.js.map +0 -0
  161. package/lib/commonjs/skia/{RuntimeEffect → types/RuntimeEffect}/RuntimeEffectFactory.js +0 -0
  162. package/lib/commonjs/skia/{RuntimeEffect → types/RuntimeEffect}/RuntimeEffectFactory.js.map +0 -0
  163. package/lib/commonjs/skia/{RuntimeEffect → types/RuntimeEffect}/index.js +0 -0
  164. package/lib/commonjs/skia/{RuntimeEffect → types/RuntimeEffect}/index.js.map +0 -0
  165. package/lib/commonjs/skia/{SVG → types/SVG}/SVG.js +0 -0
  166. package/lib/commonjs/skia/{SVG → types/SVG}/SVG.js.map +0 -0
  167. package/lib/commonjs/skia/{SVG → types/SVG}/SVGFactory.js +0 -0
  168. package/lib/commonjs/skia/{SVG → types/SVG}/SVGFactory.js.map +0 -0
  169. package/lib/commonjs/skia/{SVG → types/SVG}/index.js +0 -13
  170. package/lib/commonjs/skia/{Font → types/SVG}/index.js.map +1 -1
  171. package/lib/commonjs/skia/{Shader → types/Shader}/Shader.js +0 -0
  172. package/lib/commonjs/skia/{Shader → types/Shader}/Shader.js.map +0 -0
  173. package/lib/commonjs/skia/{Shader → types/Shader}/ShaderFactory.js +0 -0
  174. package/lib/commonjs/skia/{Shader → types/Shader}/ShaderFactory.js.map +0 -0
  175. package/lib/commonjs/skia/{Shader → types/Shader}/index.js +0 -13
  176. package/lib/commonjs/skia/types/Shader/index.js.map +1 -0
  177. package/lib/commonjs/skia/types/Skia.js +6 -0
  178. package/lib/commonjs/skia/{Surface/Surface.js.map → types/Skia.js.map} +0 -0
  179. package/lib/commonjs/skia/{Surface → types/Surface}/Surface.js +0 -0
  180. package/lib/{module/skia → commonjs/skia/types}/Surface/Surface.js.map +0 -0
  181. package/lib/commonjs/skia/{Surface → types/Surface}/SurfaceFactory.js +0 -0
  182. package/lib/commonjs/skia/{Surface → types/Surface}/SurfaceFactory.js.map +0 -0
  183. package/lib/commonjs/skia/{Surface → types/Surface}/index.js +0 -0
  184. package/lib/commonjs/skia/{Surface → types/Surface}/index.js.map +0 -0
  185. package/lib/commonjs/skia/{TextBlob.js → types/TextBlob.js} +0 -0
  186. package/lib/commonjs/skia/{TextBlob.js.map → types/TextBlob.js.map} +0 -0
  187. package/lib/commonjs/skia/{Typeface → types/Typeface}/Typeface.js +0 -0
  188. package/lib/commonjs/skia/{Typeface → types/Typeface}/Typeface.js.map +0 -0
  189. package/lib/commonjs/skia/{Typeface → types/Typeface}/TypefaceFactory.js +0 -0
  190. package/lib/commonjs/skia/{Typeface → types/Typeface}/TypefaceFactory.js.map +0 -0
  191. package/lib/commonjs/skia/{Typeface → types/Typeface}/index.js +0 -13
  192. package/lib/commonjs/skia/types/Typeface/index.js.map +1 -0
  193. package/lib/commonjs/skia/{Vertices → types/Vertices}/Vertices.js +0 -0
  194. package/lib/commonjs/skia/{Vertices → types/Vertices}/Vertices.js.map +0 -0
  195. package/lib/commonjs/skia/{Vertices → types/Vertices}/index.js +0 -0
  196. package/lib/commonjs/skia/{Vertices → types/Vertices}/index.js.map +0 -0
  197. package/lib/commonjs/skia/types/index.js +370 -0
  198. package/lib/commonjs/skia/types/index.js.map +1 -0
  199. package/lib/commonjs/skia/web/api/Host.js +66 -0
  200. package/lib/commonjs/skia/web/api/Host.js.map +1 -0
  201. package/lib/commonjs/skia/web/api/JsiSkCanvas.js +170 -0
  202. package/lib/commonjs/skia/web/api/JsiSkCanvas.js.map +1 -0
  203. package/lib/commonjs/skia/web/api/JsiSkColor.js +180 -0
  204. package/lib/commonjs/skia/web/api/JsiSkColor.js.map +1 -0
  205. package/lib/commonjs/skia/web/api/JsiSkColorFilter.js +18 -0
  206. package/lib/commonjs/skia/web/api/JsiSkColorFilter.js.map +1 -0
  207. package/lib/commonjs/skia/web/api/JsiSkImage.js +56 -0
  208. package/lib/commonjs/skia/web/api/JsiSkImage.js.map +1 -0
  209. package/lib/commonjs/skia/web/api/JsiSkPaint.js +106 -0
  210. package/lib/commonjs/skia/web/api/JsiSkPaint.js.map +1 -0
  211. package/lib/commonjs/skia/web/api/JsiSkRect.js +34 -0
  212. package/lib/commonjs/skia/web/api/JsiSkRect.js.map +1 -0
  213. package/lib/commonjs/skia/web/api/JsiSkSurface.js +31 -0
  214. package/lib/commonjs/skia/web/api/JsiSkSurface.js.map +1 -0
  215. package/lib/commonjs/skia/web/api/JsiSkSurfaceFactory.js +30 -0
  216. package/lib/commonjs/skia/web/api/JsiSkSurfaceFactory.js.map +1 -0
  217. package/lib/commonjs/skia/web/api/index.js +26 -0
  218. package/lib/commonjs/skia/web/api/index.js.map +1 -0
  219. package/lib/commonjs/skia/web/index.js +19 -0
  220. package/lib/commonjs/skia/web/index.js.map +1 -0
  221. package/lib/commonjs/values/hooks/useValue.js.map +1 -1
  222. package/lib/commonjs/values/hooks/useValueEffect.js.map +1 -1
  223. package/lib/commonjs/values/web/RNSkReadonlyValue.js.map +1 -1
  224. package/lib/commonjs/values/web/api.js.map +1 -1
  225. package/lib/commonjs/views/SkiaView.js.map +1 -1
  226. package/lib/commonjs/views/types.js.map +1 -1
  227. package/lib/module/animation/decay/runDecay.js.map +1 -1
  228. package/lib/module/animation/functions/interpolateColors.js.map +1 -1
  229. package/lib/module/animation/spring/runSpring.js.map +1 -1
  230. package/lib/module/animation/spring/useSpring.js.map +1 -1
  231. package/lib/module/animation/timing/createTiming.js.map +1 -1
  232. package/lib/module/animation/timing/runTiming.js.map +1 -1
  233. package/lib/module/animation/timing/useTiming.js.map +1 -1
  234. package/lib/module/index.js.map +1 -1
  235. package/lib/module/renderer/Canvas.js +1 -2
  236. package/lib/module/renderer/Canvas.js.map +1 -1
  237. package/lib/module/renderer/DependencyManager.js.map +1 -1
  238. package/lib/module/renderer/components/Blend.js +1 -2
  239. package/lib/module/renderer/components/Blend.js.map +1 -1
  240. package/lib/module/renderer/components/Compose.js +1 -3
  241. package/lib/module/renderer/components/Compose.js.map +1 -1
  242. package/lib/module/renderer/components/colorFilters/Lerp.js +1 -2
  243. package/lib/module/renderer/components/colorFilters/Lerp.js.map +1 -1
  244. package/lib/module/renderer/components/imageFilters/DisplacementMap.js +1 -2
  245. package/lib/module/renderer/components/imageFilters/DisplacementMap.js.map +1 -1
  246. package/lib/module/renderer/components/imageFilters/InnerShadow.js.map +1 -1
  247. package/lib/module/renderer/components/imageFilters/RuntimeShader.js.map +1 -1
  248. package/lib/module/renderer/components/imageFilters/Shadow.js +1 -2
  249. package/lib/module/renderer/components/imageFilters/Shadow.js.map +1 -1
  250. package/lib/module/renderer/components/maskFilters/Blur.js +1 -2
  251. package/lib/module/renderer/components/maskFilters/Blur.js.map +1 -1
  252. package/lib/module/renderer/components/pathEffects/Corner.js +1 -2
  253. package/lib/module/renderer/components/pathEffects/Corner.js.map +1 -1
  254. package/lib/module/renderer/components/pathEffects/Dash.js +1 -2
  255. package/lib/module/renderer/components/pathEffects/Dash.js.map +1 -1
  256. package/lib/module/renderer/components/pathEffects/Discrete.js +1 -2
  257. package/lib/module/renderer/components/pathEffects/Discrete.js.map +1 -1
  258. package/lib/module/renderer/components/pathEffects/Line2D.js +1 -2
  259. package/lib/module/renderer/components/pathEffects/Line2D.js.map +1 -1
  260. package/lib/module/renderer/components/pathEffects/Path1D.js +1 -2
  261. package/lib/module/renderer/components/pathEffects/Path1D.js.map +1 -1
  262. package/lib/module/renderer/components/pathEffects/Path2D.js +1 -2
  263. package/lib/module/renderer/components/pathEffects/Path2D.js.map +1 -1
  264. package/lib/module/renderer/components/pathEffects/Sum.js +1 -2
  265. package/lib/module/renderer/components/pathEffects/Sum.js.map +1 -1
  266. package/lib/module/renderer/components/shaders/Gradient.js.map +1 -1
  267. package/lib/module/renderer/components/shapes/Box.js.map +1 -1
  268. package/lib/module/renderer/components/shapes/DiffRect.js.map +1 -1
  269. package/lib/module/renderer/components/shapes/Patch.js +1 -2
  270. package/lib/module/renderer/components/shapes/Patch.js.map +1 -1
  271. package/lib/module/renderer/components/text/TextBlob.js.map +1 -1
  272. package/lib/module/renderer/components/text/TextPath.js.map +1 -1
  273. package/lib/module/renderer/index.js +1 -0
  274. package/lib/module/renderer/index.js.map +1 -1
  275. package/lib/module/renderer/nodes/Declaration.js.map +1 -1
  276. package/lib/module/renderer/nodes/Node.js.map +1 -1
  277. package/lib/module/renderer/processors/Animations/Animations.js.map +1 -1
  278. package/lib/module/renderer/processors/Clips.js.map +1 -1
  279. package/lib/module/renderer/processors/Font.js.map +1 -1
  280. package/lib/module/renderer/processors/Rects.js +1 -0
  281. package/lib/module/renderer/processors/Rects.js.map +1 -1
  282. package/lib/module/renderer/processors/Transform.js.map +1 -1
  283. package/lib/module/skia/Skia.js +2 -35
  284. package/lib/module/skia/Skia.js.map +1 -1
  285. package/lib/module/skia/{Color.js → core/Color.js} +1 -2
  286. package/lib/module/skia/core/Color.js.map +1 -0
  287. package/lib/module/skia/core/Data.js +56 -0
  288. package/lib/module/skia/core/Data.js.map +1 -0
  289. package/lib/module/skia/{Font/useFont.js → core/Font.js} +5 -5
  290. package/lib/module/skia/core/Font.js.map +1 -0
  291. package/lib/module/skia/core/Image.js +8 -0
  292. package/lib/module/skia/core/Image.js.map +1 -0
  293. package/lib/module/skia/{Paint/usePaint.js → core/Paint.js} +8 -3
  294. package/lib/module/skia/core/Paint.js.map +1 -0
  295. package/lib/module/skia/{Path/usePath.js → core/Path.js} +1 -1
  296. package/lib/module/skia/core/Path.js.map +1 -0
  297. package/lib/module/skia/{Picture/usePicture.js → core/Picture.js} +1 -1
  298. package/lib/module/skia/core/Picture.js.map +1 -0
  299. package/lib/module/skia/core/SVG.js +4 -0
  300. package/lib/module/skia/core/SVG.js.map +1 -0
  301. package/lib/module/skia/{Shader/useShader.js → core/Shader.js} +1 -1
  302. package/lib/module/skia/core/Shader.js.map +1 -0
  303. package/lib/module/skia/core/Typeface.js +8 -0
  304. package/lib/module/skia/core/Typeface.js.map +1 -0
  305. package/lib/module/skia/core/index.js +11 -0
  306. package/lib/module/skia/core/index.js.map +1 -0
  307. package/lib/module/skia/index.js +2 -23
  308. package/lib/module/skia/index.js.map +1 -1
  309. package/lib/module/skia/{Canvas.js → types/Canvas.js} +0 -0
  310. package/lib/module/skia/{Canvas.js.map → types/Canvas.js.map} +0 -0
  311. package/lib/module/skia/types/Color.js +2 -0
  312. package/lib/module/skia/{ContourMeasure.js.map → types/Color.js.map} +0 -0
  313. package/lib/module/skia/{ColorFilter → types/ColorFilter}/ColorFilter.js +0 -0
  314. package/lib/module/skia/{ColorFilter → types/ColorFilter}/ColorFilter.js.map +0 -0
  315. package/lib/module/skia/{ColorFilter → types/ColorFilter}/ColorFilterFactory.js +0 -0
  316. package/lib/module/skia/{FontMgr/FontMgr.js.map → types/ColorFilter/ColorFilterFactory.js.map} +0 -0
  317. package/lib/module/skia/{ColorFilter → types/ColorFilter}/index.js +0 -0
  318. package/lib/module/skia/{ColorFilter → types/ColorFilter}/index.js.map +0 -0
  319. package/lib/module/skia/{ContourMeasure.js → types/ContourMeasure.js} +0 -0
  320. package/lib/module/skia/{FontMgr/FontMgrFactory.js.map → types/ContourMeasure.js.map} +0 -0
  321. package/lib/module/skia/types/Data/Data.js +2 -0
  322. package/lib/module/skia/{JsiInstance.js.map → types/Data/Data.js.map} +0 -0
  323. package/lib/module/skia/{Data → types/Data}/DataFactory.js +0 -0
  324. package/lib/module/skia/{Path/PathFactory.js.map → types/Data/DataFactory.js.map} +0 -0
  325. package/lib/module/skia/{Data → types/Data}/index.js +0 -0
  326. package/lib/module/skia/{Data → types/Data}/index.js.map +0 -0
  327. package/lib/module/skia/{Font → types/Font}/Font.js +0 -0
  328. package/lib/module/skia/types/Font/Font.js.map +1 -0
  329. package/lib/module/skia/types/Font/index.js +2 -0
  330. package/lib/module/skia/types/Font/index.js.map +1 -0
  331. package/lib/module/skia/{FontMgr → types/FontMgr}/FontMgr.js +0 -0
  332. package/lib/module/skia/{Picture/Picture.js.map → types/FontMgr/FontMgr.js.map} +0 -0
  333. package/lib/module/skia/{FontMgr → types/FontMgr}/FontMgrFactory.js +0 -0
  334. package/lib/module/skia/{Picture/PictureFactory.js.map → types/FontMgr/FontMgrFactory.js.map} +0 -0
  335. package/lib/module/skia/types/FontMgr/index.js +3 -0
  336. package/lib/module/skia/types/FontMgr/index.js.map +1 -0
  337. package/lib/module/skia/{Image → types/Image}/Image.js +0 -0
  338. package/lib/module/skia/{Image → types/Image}/Image.js.map +1 -1
  339. package/lib/module/skia/{Image → types/Image}/ImageFactory.js +0 -0
  340. package/lib/module/skia/{Image → types/Image}/ImageFactory.js.map +0 -0
  341. package/lib/module/skia/types/Image/index.js +3 -0
  342. package/lib/module/skia/types/Image/index.js.map +1 -0
  343. package/lib/module/skia/{ImageFilter → types/ImageFilter}/ImageFilter.js +0 -0
  344. package/lib/module/skia/{ImageFilter → types/ImageFilter}/ImageFilter.js.map +0 -0
  345. package/lib/module/skia/{ImageFilter → types/ImageFilter}/ImageFilterFactory.js +0 -0
  346. package/lib/module/skia/types/ImageFilter/ImageFilterFactory.js.map +1 -0
  347. package/lib/module/skia/{ImageFilter → types/ImageFilter}/index.js +0 -0
  348. package/lib/module/skia/{ImageFilter → types/ImageFilter}/index.js.map +0 -0
  349. package/lib/module/skia/{JsiInstance.js → types/JsiInstance.js} +0 -0
  350. package/lib/module/skia/{Picture/PictureRecorder.js.map → types/JsiInstance.js.map} +0 -0
  351. package/lib/module/skia/{MaskFilter.js → types/MaskFilter.js} +0 -0
  352. package/lib/module/skia/types/MaskFilter.js.map +1 -0
  353. package/lib/module/skia/{Matrix.js → types/Matrix.js} +0 -0
  354. package/lib/module/skia/{Matrix.js.map → types/Matrix.js.map} +0 -0
  355. package/lib/module/skia/{Paint → types/Paint}/BlendMode.js +0 -0
  356. package/lib/module/skia/{Paint → types/Paint}/BlendMode.js.map +0 -0
  357. package/lib/module/skia/{Paint → types/Paint}/Paint.js +0 -6
  358. package/lib/module/skia/types/Paint/Paint.js.map +1 -0
  359. package/lib/module/skia/types/Paint/index.js +3 -0
  360. package/lib/module/skia/types/Paint/index.js.map +1 -0
  361. package/lib/module/skia/{Path → types/Path}/Path.js +0 -0
  362. package/lib/module/skia/{Path → types/Path}/Path.js.map +0 -0
  363. package/lib/module/skia/{Path → types/Path}/PathFactory.js +0 -0
  364. package/lib/module/skia/{RRect.js.map → types/Path/PathFactory.js.map} +0 -0
  365. package/lib/module/skia/types/Path/index.js +3 -0
  366. package/lib/module/skia/types/Path/index.js.map +1 -0
  367. package/lib/module/skia/{PathEffect.js → types/PathEffect.js} +0 -0
  368. package/lib/module/skia/types/PathEffect.js.map +1 -0
  369. package/lib/module/skia/{Picture → types/Picture}/Picture.js +0 -0
  370. package/lib/module/skia/{RSXform.js.map → types/Picture/Picture.js.map} +0 -0
  371. package/lib/module/skia/{Picture → types/Picture}/PictureFactory.js +0 -0
  372. package/lib/module/skia/{Rect.js.map → types/Picture/PictureFactory.js.map} +0 -0
  373. package/lib/module/skia/{Picture → types/Picture}/PictureRecorder.js +0 -0
  374. package/lib/module/skia/{RuntimeEffect/RuntimeEffect.js.map → types/Picture/PictureRecorder.js.map} +0 -0
  375. package/lib/module/skia/{Picture → types/Picture}/index.js +0 -1
  376. package/lib/module/skia/types/Picture/index.js.map +1 -0
  377. package/lib/module/skia/{Point.js → types/Point.js} +0 -0
  378. package/lib/module/skia/{Point.js.map → types/Point.js.map} +0 -0
  379. package/lib/module/skia/{RRect.js → types/RRect.js} +0 -0
  380. package/lib/module/skia/{RuntimeEffect/RuntimeEffectFactory.js.map → types/RRect.js.map} +0 -0
  381. package/lib/module/skia/{RSXform.js → types/RSXform.js} +0 -0
  382. package/lib/module/skia/{SVG/SVG.js.map → types/RSXform.js.map} +0 -0
  383. package/lib/module/skia/{Rect.js → types/Rect.js} +0 -0
  384. package/lib/module/skia/{SVG/SVGFactory.js.map → types/Rect.js.map} +0 -0
  385. package/lib/module/skia/{RuntimeEffect → types/RuntimeEffect}/RuntimeEffect.js +0 -0
  386. package/lib/module/skia/{Shader/ShaderFactory.js.map → types/RuntimeEffect/RuntimeEffect.js.map} +0 -0
  387. package/lib/module/skia/{RuntimeEffect → types/RuntimeEffect}/RuntimeEffectFactory.js +0 -0
  388. package/lib/module/skia/{Surface/SurfaceFactory.js.map → types/RuntimeEffect/RuntimeEffectFactory.js.map} +0 -0
  389. package/lib/module/skia/{RuntimeEffect → types/RuntimeEffect}/index.js +0 -0
  390. package/lib/module/skia/{RuntimeEffect → types/RuntimeEffect}/index.js.map +0 -0
  391. package/lib/module/skia/{SVG → types/SVG}/SVG.js +0 -0
  392. package/lib/module/skia/{TextBlob.js.map → types/SVG/SVG.js.map} +0 -0
  393. package/lib/module/skia/{SVG → types/SVG}/SVGFactory.js +0 -0
  394. package/lib/module/skia/{Typeface/Typeface.js.map → types/SVG/SVGFactory.js.map} +0 -0
  395. package/lib/module/skia/types/SVG/index.js +3 -0
  396. package/lib/module/skia/types/SVG/index.js.map +1 -0
  397. package/lib/module/skia/{Shader → types/Shader}/Shader.js +0 -0
  398. package/lib/module/skia/{Shader → types/Shader}/Shader.js.map +0 -0
  399. package/lib/module/skia/{Shader → types/Shader}/ShaderFactory.js +0 -0
  400. package/lib/module/skia/{Typeface/TypefaceFactory.js.map → types/Shader/ShaderFactory.js.map} +0 -0
  401. package/lib/module/skia/types/Shader/index.js +3 -0
  402. package/lib/module/skia/types/Shader/index.js.map +1 -0
  403. package/lib/module/skia/types/Skia.js +2 -0
  404. package/lib/module/skia/types/Skia.js.map +1 -0
  405. package/lib/module/skia/{Surface → types/Surface}/Surface.js +0 -0
  406. package/lib/module/skia/types/Surface/Surface.js.map +1 -0
  407. package/lib/module/skia/{Surface → types/Surface}/SurfaceFactory.js +0 -0
  408. package/lib/module/skia/types/Surface/SurfaceFactory.js.map +1 -0
  409. package/lib/module/skia/{Surface → types/Surface}/index.js +0 -0
  410. package/lib/module/skia/{Surface → types/Surface}/index.js.map +0 -0
  411. package/lib/module/skia/{TextBlob.js → types/TextBlob.js} +0 -0
  412. package/lib/module/skia/types/TextBlob.js.map +1 -0
  413. package/lib/module/skia/{Typeface → types/Typeface}/Typeface.js +0 -0
  414. package/lib/module/skia/types/Typeface/Typeface.js.map +1 -0
  415. package/lib/module/skia/{Typeface → types/Typeface}/TypefaceFactory.js +0 -0
  416. package/lib/module/skia/types/Typeface/TypefaceFactory.js.map +1 -0
  417. package/lib/module/skia/types/Typeface/index.js +3 -0
  418. package/lib/module/skia/types/Typeface/index.js.map +1 -0
  419. package/lib/module/skia/{Vertices → types/Vertices}/Vertices.js +0 -0
  420. package/lib/module/skia/{Vertices → types/Vertices}/Vertices.js.map +0 -0
  421. package/lib/module/skia/{Vertices → types/Vertices}/index.js +0 -0
  422. package/lib/module/skia/{Vertices → types/Vertices}/index.js.map +0 -0
  423. package/lib/module/skia/types/index.js +29 -0
  424. package/lib/module/skia/types/index.js.map +1 -0
  425. package/lib/module/skia/web/api/Host.js +36 -0
  426. package/lib/module/skia/web/api/Host.js.map +1 -0
  427. package/lib/module/skia/web/api/JsiSkCanvas.js +160 -0
  428. package/lib/module/skia/web/api/JsiSkCanvas.js.map +1 -0
  429. package/lib/module/skia/web/api/JsiSkColor.js +170 -0
  430. package/lib/module/skia/web/api/JsiSkColor.js.map +1 -0
  431. package/lib/module/skia/web/api/JsiSkColorFilter.js +8 -0
  432. package/lib/module/skia/web/api/JsiSkColorFilter.js.map +1 -0
  433. package/lib/module/skia/web/api/JsiSkImage.js +46 -0
  434. package/lib/module/skia/web/api/JsiSkImage.js.map +1 -0
  435. package/lib/module/skia/web/api/JsiSkPaint.js +96 -0
  436. package/lib/module/skia/web/api/JsiSkPaint.js.map +1 -0
  437. package/lib/module/skia/web/api/JsiSkRect.js +24 -0
  438. package/lib/module/skia/web/api/JsiSkRect.js.map +1 -0
  439. package/lib/module/skia/web/api/JsiSkSurface.js +19 -0
  440. package/lib/module/skia/web/api/JsiSkSurface.js.map +1 -0
  441. package/lib/module/skia/web/api/JsiSkSurfaceFactory.js +19 -0
  442. package/lib/module/skia/web/api/JsiSkSurfaceFactory.js.map +1 -0
  443. package/lib/module/skia/web/api/index.js +13 -0
  444. package/lib/module/skia/web/api/index.js.map +1 -0
  445. package/lib/module/skia/web/index.js +2 -0
  446. package/lib/module/skia/web/index.js.map +1 -0
  447. package/lib/module/values/hooks/useValue.js.map +1 -1
  448. package/lib/module/values/hooks/useValueEffect.js.map +1 -1
  449. package/lib/module/values/web/RNSkReadonlyValue.js.map +1 -1
  450. package/lib/module/values/web/api.js.map +1 -1
  451. package/lib/module/views/SkiaView.js.map +1 -1
  452. package/lib/module/views/types.js.map +1 -1
  453. package/lib/typescript/src/animation/decay/runDecay.d.ts +2 -2
  454. package/lib/typescript/src/animation/spring/runSpring.d.ts +2 -2
  455. package/lib/typescript/src/animation/spring/useSpring.d.ts +2 -2
  456. package/lib/typescript/src/animation/timing/createTiming.d.ts +2 -2
  457. package/lib/typescript/src/animation/timing/runTiming.d.ts +2 -2
  458. package/lib/typescript/src/animation/timing/useLoop.d.ts +1 -1
  459. package/lib/typescript/src/animation/timing/useTiming.d.ts +2 -2
  460. package/lib/typescript/src/renderer/Canvas.d.ts +4 -4
  461. package/lib/typescript/src/renderer/DependencyManager.d.ts +2 -2
  462. package/lib/typescript/src/renderer/DrawingContext.d.ts +1 -2
  463. package/lib/typescript/src/renderer/components/colorFilters/Compose.d.ts +1 -1
  464. package/lib/typescript/src/renderer/components/imageFilters/DisplacementMap.d.ts +1 -1
  465. package/lib/typescript/src/renderer/components/imageFilters/InnerShadow.d.ts +1 -2
  466. package/lib/typescript/src/renderer/components/imageFilters/RuntimeShader.d.ts +1 -1
  467. package/lib/typescript/src/renderer/components/imageFilters/Shadow.d.ts +1 -1
  468. package/lib/typescript/src/renderer/components/maskFilters/Blur.d.ts +1 -1
  469. package/lib/typescript/src/renderer/components/pathEffects/Line2D.d.ts +1 -1
  470. package/lib/typescript/src/renderer/components/pathEffects/Path1D.d.ts +1 -1
  471. package/lib/typescript/src/renderer/components/pathEffects/Path2D.d.ts +1 -1
  472. package/lib/typescript/src/renderer/components/shaders/Gradient.d.ts +1 -1
  473. package/lib/typescript/src/renderer/components/shapes/Box.d.ts +1 -2
  474. package/lib/typescript/src/renderer/components/shapes/DiffRect.d.ts +1 -1
  475. package/lib/typescript/src/renderer/components/text/TextBlob.d.ts +1 -1
  476. package/lib/typescript/src/renderer/components/text/TextPath.d.ts +1 -1
  477. package/lib/typescript/src/renderer/index.d.ts +1 -0
  478. package/lib/typescript/src/renderer/nodes/Declaration.d.ts +1 -1
  479. package/lib/typescript/src/renderer/nodes/Node.d.ts +1 -1
  480. package/lib/typescript/src/renderer/processors/Animations/Animations.d.ts +3 -3
  481. package/lib/typescript/src/renderer/processors/Clips.d.ts +1 -2
  482. package/lib/typescript/src/renderer/processors/Font.d.ts +1 -2
  483. package/lib/typescript/src/renderer/processors/Rects.d.ts +2 -0
  484. package/lib/typescript/src/renderer/processors/Transform.d.ts +1 -1
  485. package/lib/typescript/src/skia/Skia.d.ts +2 -35
  486. package/lib/typescript/src/skia/{Color.d.ts → core/Color.d.ts} +1 -2
  487. package/lib/typescript/src/skia/core/Data.d.ts +5 -0
  488. package/lib/typescript/src/skia/core/Font.d.ts +5 -0
  489. package/lib/typescript/src/skia/core/Image.d.ts +5 -0
  490. package/lib/typescript/src/skia/{Paint/usePaint.d.ts → core/Paint.d.ts} +2 -1
  491. package/lib/typescript/src/skia/{Path/usePath.d.ts → core/Path.d.ts} +1 -2
  492. package/lib/typescript/src/skia/{Picture/usePicture.d.ts → core/Picture.d.ts} +1 -3
  493. package/lib/typescript/src/skia/core/SVG.d.ts +2 -0
  494. package/lib/typescript/src/skia/{Shader/useShader.d.ts → core/Shader.d.ts} +0 -0
  495. package/lib/typescript/src/skia/core/Typeface.d.ts +5 -0
  496. package/lib/typescript/src/skia/core/index.d.ts +10 -0
  497. package/lib/typescript/src/skia/index.d.ts +2 -23
  498. package/lib/typescript/src/skia/{Canvas.d.ts → types/Canvas.d.ts} +0 -0
  499. package/lib/typescript/src/skia/types/Color.d.ts +2 -0
  500. package/lib/typescript/src/skia/{ColorFilter → types/ColorFilter}/ColorFilter.d.ts +0 -0
  501. package/lib/typescript/src/skia/{ColorFilter → types/ColorFilter}/ColorFilterFactory.d.ts +1 -1
  502. package/lib/typescript/src/skia/{ColorFilter → types/ColorFilter}/index.d.ts +0 -0
  503. package/lib/typescript/src/skia/{ContourMeasure.d.ts → types/ContourMeasure.d.ts} +0 -0
  504. package/lib/typescript/src/skia/types/Data/Data.d.ts +5 -0
  505. package/lib/typescript/src/skia/{Data → types/Data}/DataFactory.d.ts +0 -0
  506. package/lib/typescript/src/skia/{Data → types/Data}/index.d.ts +0 -0
  507. package/lib/typescript/src/skia/{Font → types/Font}/Font.d.ts +1 -1
  508. package/lib/typescript/src/skia/types/Font/index.d.ts +1 -0
  509. package/lib/typescript/src/skia/{FontMgr → types/FontMgr}/FontMgr.d.ts +1 -1
  510. package/lib/typescript/src/skia/{FontMgr → types/FontMgr}/FontMgrFactory.d.ts +0 -0
  511. package/lib/typescript/src/skia/{FontMgr → types/FontMgr}/index.d.ts +1 -0
  512. package/lib/typescript/src/skia/{Image → types/Image}/Image.d.ts +2 -2
  513. package/lib/typescript/src/skia/{Image → types/Image}/ImageFactory.d.ts +0 -0
  514. package/lib/typescript/src/skia/{Image → types/Image}/index.d.ts +0 -1
  515. package/lib/typescript/src/skia/{ImageFilter → types/ImageFilter}/ImageFilter.d.ts +0 -0
  516. package/lib/typescript/src/skia/{ImageFilter → types/ImageFilter}/ImageFilterFactory.d.ts +2 -2
  517. package/lib/typescript/src/skia/{ImageFilter → types/ImageFilter}/index.d.ts +0 -0
  518. package/lib/typescript/src/skia/{JsiInstance.d.ts → types/JsiInstance.d.ts} +0 -0
  519. package/lib/typescript/src/skia/{MaskFilter.d.ts → types/MaskFilter.d.ts} +3 -3
  520. package/lib/typescript/src/skia/{Matrix.d.ts → types/Matrix.d.ts} +0 -0
  521. package/lib/typescript/src/skia/{Paint → types/Paint}/BlendMode.d.ts +0 -0
  522. package/lib/typescript/src/skia/{Paint → types/Paint}/Paint.d.ts +5 -6
  523. package/lib/typescript/src/skia/{Paint → types/Paint}/index.d.ts +0 -1
  524. package/lib/typescript/src/skia/{Path → types/Path}/Path.d.ts +0 -0
  525. package/lib/typescript/src/skia/{Path → types/Path}/PathFactory.d.ts +0 -0
  526. package/lib/typescript/src/skia/{Path → types/Path}/index.d.ts +0 -1
  527. package/lib/typescript/src/skia/{PathEffect.d.ts → types/PathEffect.d.ts} +10 -10
  528. package/lib/typescript/src/skia/{Picture → types/Picture}/Picture.d.ts +0 -0
  529. package/lib/typescript/src/skia/{Picture → types/Picture}/PictureFactory.d.ts +0 -0
  530. package/lib/typescript/src/skia/{Picture → types/Picture}/PictureRecorder.d.ts +0 -0
  531. package/lib/typescript/src/skia/{Picture → types/Picture}/index.d.ts +0 -1
  532. package/lib/typescript/src/skia/{Point.d.ts → types/Point.d.ts} +0 -0
  533. package/lib/typescript/src/skia/{RRect.d.ts → types/RRect.d.ts} +0 -0
  534. package/lib/typescript/src/skia/{RSXform.d.ts → types/RSXform.d.ts} +0 -0
  535. package/lib/typescript/src/skia/{Rect.d.ts → types/Rect.d.ts} +0 -0
  536. package/lib/typescript/src/skia/{RuntimeEffect → types/RuntimeEffect}/RuntimeEffect.d.ts +0 -0
  537. package/lib/typescript/src/skia/{RuntimeEffect → types/RuntimeEffect}/RuntimeEffectFactory.d.ts +0 -0
  538. package/lib/typescript/src/skia/{RuntimeEffect → types/RuntimeEffect}/index.d.ts +0 -0
  539. package/lib/typescript/src/skia/{SVG → types/SVG}/SVG.d.ts +0 -0
  540. package/lib/typescript/src/skia/{SVG → types/SVG}/SVGFactory.d.ts +1 -1
  541. package/lib/typescript/src/skia/{SVG → types/SVG}/index.d.ts +0 -1
  542. package/lib/typescript/src/skia/{Shader → types/Shader}/Shader.d.ts +0 -0
  543. package/lib/typescript/src/skia/{Shader → types/Shader}/ShaderFactory.d.ts +0 -0
  544. package/lib/typescript/src/skia/{Shader → types/Shader}/index.d.ts +0 -1
  545. package/lib/typescript/src/skia/{SkiaApi.d.ts → types/Skia.d.ts} +2 -5
  546. package/lib/typescript/src/skia/{Surface → types/Surface}/Surface.d.ts +0 -0
  547. package/lib/typescript/src/skia/{Surface → types/Surface}/SurfaceFactory.d.ts +0 -0
  548. package/lib/typescript/src/skia/{Surface → types/Surface}/index.d.ts +0 -0
  549. package/lib/typescript/src/skia/{TextBlob.d.ts → types/TextBlob.d.ts} +0 -0
  550. package/lib/typescript/src/skia/{Typeface → types/Typeface}/Typeface.d.ts +0 -0
  551. package/lib/typescript/src/skia/{Typeface → types/Typeface}/TypefaceFactory.d.ts +1 -1
  552. package/lib/typescript/src/skia/{Typeface → types/Typeface}/index.d.ts +0 -1
  553. package/lib/typescript/src/skia/{Vertices → types/Vertices}/Vertices.d.ts +0 -0
  554. package/lib/typescript/src/skia/{Vertices → types/Vertices}/index.d.ts +0 -0
  555. package/lib/typescript/src/skia/types/index.d.ts +28 -0
  556. package/lib/typescript/src/skia/web/api/Host.d.ts +18 -0
  557. package/lib/typescript/src/skia/web/api/JsiSkCanvas.d.ts +44 -0
  558. package/lib/typescript/src/skia/web/api/JsiSkColor.d.ts +3 -0
  559. package/lib/typescript/src/skia/web/api/JsiSkColorFilter.d.ts +6 -0
  560. package/lib/typescript/src/skia/web/api/JsiSkImage.d.ts +12 -0
  561. package/lib/typescript/src/skia/web/api/JsiSkPaint.d.ts +26 -0
  562. package/lib/typescript/src/skia/web/api/JsiSkRect.d.ts +10 -0
  563. package/lib/typescript/src/skia/web/api/JsiSkSurface.d.ts +8 -0
  564. package/lib/typescript/src/skia/web/api/JsiSkSurfaceFactory.d.ts +8 -0
  565. package/lib/typescript/src/skia/web/api/index.d.ts +10 -0
  566. package/lib/typescript/src/skia/web/index.d.ts +1 -0
  567. package/lib/typescript/src/values/api.d.ts +1 -1
  568. package/lib/typescript/src/values/api.web.d.ts +1 -1
  569. package/lib/typescript/src/values/hooks/useDerivedValue.d.ts +1 -1
  570. package/lib/typescript/src/values/hooks/useValue.d.ts +2 -2
  571. package/lib/typescript/src/values/hooks/useValueEffect.d.ts +2 -2
  572. package/lib/typescript/src/values/types.d.ts +5 -5
  573. package/lib/typescript/src/values/web/RNSkReadonlyValue.d.ts +2 -2
  574. package/lib/typescript/src/views/SkiaView.d.ts +4 -4
  575. package/lib/typescript/src/views/types.d.ts +3 -4
  576. package/package.json +5 -3
  577. package/src/animation/decay/runDecay.ts +5 -2
  578. package/src/animation/functions/interpolateColors.ts +1 -2
  579. package/src/animation/spring/runSpring.ts +2 -2
  580. package/src/animation/spring/useSpring.ts +2 -2
  581. package/src/animation/timing/createTiming.ts +2 -2
  582. package/src/animation/timing/runTiming.ts +2 -2
  583. package/src/animation/timing/useTiming.ts +2 -2
  584. package/src/index.ts +0 -1
  585. package/src/renderer/Canvas.tsx +4 -5
  586. package/src/renderer/DependencyManager.tsx +2 -2
  587. package/src/renderer/DrawingContext.ts +1 -2
  588. package/src/renderer/components/Blend.tsx +1 -2
  589. package/src/renderer/components/Compose.tsx +1 -3
  590. package/src/renderer/components/colorFilters/Lerp.tsx +1 -2
  591. package/src/renderer/components/imageFilters/DisplacementMap.tsx +1 -2
  592. package/src/renderer/components/imageFilters/InnerShadow.tsx +1 -2
  593. package/src/renderer/components/imageFilters/RuntimeShader.tsx +1 -1
  594. package/src/renderer/components/imageFilters/Shadow.tsx +2 -3
  595. package/src/renderer/components/maskFilters/Blur.tsx +1 -2
  596. package/src/renderer/components/pathEffects/Corner.tsx +1 -2
  597. package/src/renderer/components/pathEffects/Dash.tsx +1 -2
  598. package/src/renderer/components/pathEffects/Discrete.tsx +1 -2
  599. package/src/renderer/components/pathEffects/Line2D.tsx +2 -3
  600. package/src/renderer/components/pathEffects/Path1D.tsx +1 -2
  601. package/src/renderer/components/pathEffects/Path2D.tsx +2 -3
  602. package/src/renderer/components/pathEffects/Sum.tsx +1 -2
  603. package/src/renderer/components/shaders/Gradient.ts +1 -1
  604. package/src/renderer/components/shapes/Box.tsx +1 -3
  605. package/src/renderer/components/shapes/DiffRect.tsx +1 -1
  606. package/src/renderer/components/shapes/Patch.tsx +1 -2
  607. package/src/renderer/components/text/TextBlob.tsx +1 -1
  608. package/src/renderer/components/text/TextPath.tsx +1 -2
  609. package/src/renderer/index.ts +1 -0
  610. package/src/renderer/nodes/Declaration.tsx +1 -1
  611. package/src/renderer/nodes/Node.ts +1 -1
  612. package/src/renderer/processors/Animations/Animations.ts +5 -8
  613. package/src/renderer/processors/Clips.ts +1 -2
  614. package/src/renderer/processors/Font.ts +1 -2
  615. package/src/renderer/processors/Rects.ts +4 -0
  616. package/src/renderer/processors/Transform.ts +1 -1
  617. package/src/skia/Skia.ts +2 -38
  618. package/src/skia/__tests__/Rects.spec.ts +40 -0
  619. package/src/skia/__tests__/snapshots/lightblue-rect.png +0 -0
  620. package/src/skia/{Color.ts → core/Color.ts} +2 -6
  621. package/src/skia/core/Data.ts +78 -0
  622. package/src/skia/{Font/useFont.ts → core/Font.ts} +8 -5
  623. package/src/skia/core/Image.ts +12 -0
  624. package/src/skia/{Paint/usePaint.ts → core/Paint.ts} +7 -2
  625. package/src/skia/{Path/usePath.ts → core/Path.ts} +1 -3
  626. package/src/skia/{Picture/usePicture.ts → core/Picture.ts} +1 -4
  627. package/src/skia/core/SVG.ts +9 -0
  628. package/src/skia/{Shader/useShader.ts → core/Shader.ts} +0 -0
  629. package/src/skia/core/Typeface.ts +11 -0
  630. package/src/skia/core/index.ts +10 -0
  631. package/src/skia/index.ts +2 -23
  632. package/src/skia/{Canvas.ts → types/Canvas.ts} +0 -0
  633. package/src/skia/types/Color.ts +4 -0
  634. package/src/skia/{ColorFilter → types/ColorFilter}/ColorFilter.ts +0 -0
  635. package/src/skia/{ColorFilter → types/ColorFilter}/ColorFilterFactory.ts +1 -1
  636. package/src/skia/{ColorFilter → types/ColorFilter}/index.ts +0 -0
  637. package/src/skia/{ContourMeasure.tsx → types/ContourMeasure.tsx} +0 -0
  638. package/src/skia/types/Data/Data.ts +5 -0
  639. package/src/skia/{Data → types/Data}/DataFactory.ts +0 -0
  640. package/src/skia/{Data → types/Data}/index.ts +0 -0
  641. package/src/skia/{Font → types/Font}/Font.ts +1 -1
  642. package/src/skia/types/Font/index.ts +1 -0
  643. package/src/skia/{FontMgr → types/FontMgr}/FontMgr.ts +1 -1
  644. package/src/skia/{FontMgr → types/FontMgr}/FontMgrFactory.ts +1 -6
  645. package/src/skia/{FontMgr → types/FontMgr}/index.ts +1 -0
  646. package/src/skia/{Image → types/Image}/Image.ts +2 -2
  647. package/src/skia/{Image → types/Image}/ImageFactory.ts +0 -0
  648. package/src/skia/{Image → types/Image}/index.ts +0 -1
  649. package/src/skia/{ImageFilter → types/ImageFilter}/ImageFilter.ts +0 -0
  650. package/src/skia/{ImageFilter → types/ImageFilter}/ImageFilterFactory.ts +2 -2
  651. package/src/skia/{ImageFilter → types/ImageFilter}/index.ts +0 -0
  652. package/src/skia/{JsiInstance.ts → types/JsiInstance.ts} +0 -0
  653. package/src/skia/{MaskFilter.ts → types/MaskFilter.ts} +3 -3
  654. package/src/skia/{Matrix.ts → types/Matrix.ts} +0 -0
  655. package/src/skia/{Paint → types/Paint}/BlendMode.ts +0 -0
  656. package/src/skia/{Paint → types/Paint}/Paint.ts +5 -12
  657. package/src/skia/{Paint → types/Paint}/index.ts +0 -1
  658. package/src/skia/{Path → types/Path}/Path.ts +0 -0
  659. package/src/skia/{Path → types/Path}/PathFactory.ts +0 -0
  660. package/src/skia/{Path → types/Path}/index.ts +0 -1
  661. package/src/skia/{PathEffect.ts → types/PathEffect.ts} +14 -10
  662. package/src/skia/{Picture → types/Picture}/Picture.ts +0 -0
  663. package/src/skia/{Picture → types/Picture}/PictureFactory.ts +0 -0
  664. package/src/skia/{Picture → types/Picture}/PictureRecorder.ts +0 -0
  665. package/src/skia/{Picture → types/Picture}/index.ts +0 -1
  666. package/src/skia/{Point.ts → types/Point.ts} +0 -0
  667. package/src/skia/{RRect.ts → types/RRect.ts} +0 -0
  668. package/src/skia/{RSXform.ts → types/RSXform.ts} +0 -0
  669. package/src/skia/{Rect.ts → types/Rect.ts} +0 -0
  670. package/src/skia/{RuntimeEffect → types/RuntimeEffect}/RuntimeEffect.ts +0 -0
  671. package/src/skia/{RuntimeEffect → types/RuntimeEffect}/RuntimeEffectFactory.ts +0 -0
  672. package/src/skia/{RuntimeEffect → types/RuntimeEffect}/index.ts +0 -0
  673. package/src/skia/{SVG → types/SVG}/SVG.ts +0 -0
  674. package/src/skia/{SVG → types/SVG}/SVGFactory.ts +1 -1
  675. package/src/skia/{SVG → types/SVG}/index.ts +0 -1
  676. package/src/skia/{Shader → types/Shader}/Shader.ts +0 -0
  677. package/src/skia/{Shader → types/Shader}/ShaderFactory.ts +0 -0
  678. package/src/skia/{Shader → types/Shader}/index.ts +0 -1
  679. package/src/skia/{SkiaApi.ts → types/Skia.ts} +6 -8
  680. package/src/skia/{Surface → types/Surface}/Surface.ts +0 -0
  681. package/src/skia/{Surface → types/Surface}/SurfaceFactory.ts +0 -0
  682. package/src/skia/{Surface → types/Surface}/index.ts +0 -0
  683. package/src/skia/{TextBlob.ts → types/TextBlob.ts} +0 -0
  684. package/src/skia/{Typeface → types/Typeface}/Typeface.ts +0 -0
  685. package/src/skia/{Typeface → types/Typeface}/TypefaceFactory.ts +1 -1
  686. package/src/skia/{Typeface → types/Typeface}/index.ts +0 -1
  687. package/src/skia/{Vertices → types/Vertices}/Vertices.tsx +0 -0
  688. package/src/skia/{Vertices → types/Vertices}/index.ts +0 -0
  689. package/src/skia/types/index.ts +28 -0
  690. package/src/skia/web/api/Host.ts +50 -0
  691. package/src/skia/web/api/JsiSkCanvas.ts +322 -0
  692. package/src/skia/web/api/JsiSkColor.ts +181 -0
  693. package/src/skia/web/api/JsiSkColorFilter.ts +14 -0
  694. package/src/skia/web/api/JsiSkImage.ts +66 -0
  695. package/src/skia/web/api/JsiSkPaint.ts +103 -0
  696. package/src/skia/web/api/JsiSkRect.ts +27 -0
  697. package/src/skia/web/api/JsiSkSurface.ts +25 -0
  698. package/src/skia/web/api/JsiSkSurfaceFactory.ts +20 -0
  699. package/src/skia/web/api/index.ts +15 -0
  700. package/src/skia/web/index.ts +1 -0
  701. package/src/values/hooks/useValue.ts +2 -2
  702. package/src/values/hooks/useValueEffect.ts +2 -5
  703. package/src/values/types.ts +6 -6
  704. package/src/values/web/RNSkReadonlyValue.ts +2 -2
  705. package/src/values/web/api.ts +4 -4
  706. package/src/views/SkiaView.tsx +3 -3
  707. package/src/views/types.ts +3 -4
  708. package/lib/commonjs/skia/Color.js.map +0 -1
  709. package/lib/commonjs/skia/Data/Data.js.map +0 -1
  710. package/lib/commonjs/skia/Font/Font.js.map +0 -1
  711. package/lib/commonjs/skia/Font/useFont.js.map +0 -1
  712. package/lib/commonjs/skia/Image/index.js.map +0 -1
  713. package/lib/commonjs/skia/Image/useImage.js.map +0 -1
  714. package/lib/commonjs/skia/ImageFilter/ImageFilterFactory.js.map +0 -1
  715. package/lib/commonjs/skia/MaskFilter.js.map +0 -1
  716. package/lib/commonjs/skia/Paint/Paint.js.map +0 -1
  717. package/lib/commonjs/skia/Paint/usePaint.js.map +0 -1
  718. package/lib/commonjs/skia/Path/index.js.map +0 -1
  719. package/lib/commonjs/skia/Path/usePath.js.map +0 -1
  720. package/lib/commonjs/skia/PathEffect.js.map +0 -1
  721. package/lib/commonjs/skia/Picture/index.js.map +0 -1
  722. package/lib/commonjs/skia/Picture/usePicture.js.map +0 -1
  723. package/lib/commonjs/skia/SVG/index.js.map +0 -1
  724. package/lib/commonjs/skia/SVG/useSvg.js +0 -15
  725. package/lib/commonjs/skia/SVG/useSvg.js.map +0 -1
  726. package/lib/commonjs/skia/Shader/index.js.map +0 -1
  727. package/lib/commonjs/skia/Shader/useShader.js.map +0 -1
  728. package/lib/commonjs/skia/SkiaApi.js +0 -4
  729. package/lib/commonjs/skia/SkiaApi.js.map +0 -1
  730. package/lib/commonjs/skia/Typeface/index.js.map +0 -1
  731. package/lib/commonjs/skia/Typeface/useTypeface.js.map +0 -1
  732. package/lib/module/skia/Color.js.map +0 -1
  733. package/lib/module/skia/Data/Data.js +0 -35
  734. package/lib/module/skia/Data/Data.js.map +0 -1
  735. package/lib/module/skia/Font/Font.js.map +0 -1
  736. package/lib/module/skia/Font/index.js +0 -3
  737. package/lib/module/skia/Font/index.js.map +0 -1
  738. package/lib/module/skia/Font/useFont.js.map +0 -1
  739. package/lib/module/skia/FontMgr/index.js +0 -2
  740. package/lib/module/skia/FontMgr/index.js.map +0 -1
  741. package/lib/module/skia/Image/index.js +0 -4
  742. package/lib/module/skia/Image/index.js.map +0 -1
  743. package/lib/module/skia/Image/useImage.js +0 -8
  744. package/lib/module/skia/Image/useImage.js.map +0 -1
  745. package/lib/module/skia/ImageFilter/ImageFilterFactory.js.map +0 -1
  746. package/lib/module/skia/MaskFilter.js.map +0 -1
  747. package/lib/module/skia/Paint/Paint.js.map +0 -1
  748. package/lib/module/skia/Paint/index.js +0 -4
  749. package/lib/module/skia/Paint/index.js.map +0 -1
  750. package/lib/module/skia/Paint/usePaint.js.map +0 -1
  751. package/lib/module/skia/Path/index.js +0 -4
  752. package/lib/module/skia/Path/index.js.map +0 -1
  753. package/lib/module/skia/Path/usePath.js.map +0 -1
  754. package/lib/module/skia/PathEffect.js.map +0 -1
  755. package/lib/module/skia/Picture/index.js.map +0 -1
  756. package/lib/module/skia/Picture/usePicture.js.map +0 -1
  757. package/lib/module/skia/SVG/index.js +0 -4
  758. package/lib/module/skia/SVG/index.js.map +0 -1
  759. package/lib/module/skia/SVG/useSvg.js +0 -4
  760. package/lib/module/skia/SVG/useSvg.js.map +0 -1
  761. package/lib/module/skia/Shader/index.js +0 -4
  762. package/lib/module/skia/Shader/index.js.map +0 -1
  763. package/lib/module/skia/Shader/useShader.js.map +0 -1
  764. package/lib/module/skia/SkiaApi.js +0 -2
  765. package/lib/module/skia/SkiaApi.js.map +0 -1
  766. package/lib/module/skia/Typeface/index.js +0 -4
  767. package/lib/module/skia/Typeface/index.js.map +0 -1
  768. package/lib/module/skia/Typeface/useTypeface.js +0 -8
  769. package/lib/module/skia/Typeface/useTypeface.js.map +0 -1
  770. package/lib/typescript/src/skia/Data/Data.d.ts +0 -9
  771. package/lib/typescript/src/skia/Font/index.d.ts +0 -2
  772. package/lib/typescript/src/skia/Font/useFont.d.ts +0 -6
  773. package/lib/typescript/src/skia/Image/useImage.d.ts +0 -5
  774. package/lib/typescript/src/skia/SVG/useSvg.d.ts +0 -2
  775. package/lib/typescript/src/skia/Typeface/useTypeface.d.ts +0 -5
  776. package/src/skia/Data/Data.ts +0 -61
  777. package/src/skia/Font/index.ts +0 -2
  778. package/src/skia/Image/useImage.ts +0 -9
  779. package/src/skia/SVG/useSvg.ts +0 -6
  780. package/src/skia/Typeface/useTypeface.ts +0 -9
@@ -1 +1 @@
1
- {"version":3,"sources":["Line2D.tsx"],"names":["React","Skia","createDeclaration","isPathEffect","onDeclare","children","width","matrix","child","filter","pe","PathEffect","MakeLine2D","MakeCompose","Line2DPathEffect","props"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAGA,SAASC,IAAT,QAAqB,eAArB;AACA,SAASC,iBAAT,QAAkC,yBAAlC;AAEA,SAASC,YAAT,QAA6B,0BAA7B;AASA,MAAMC,SAAS,GAAGF,iBAAiB,CACjC,OAAoBG,QAApB,KAAiC;AAAA,MAAhC;AAAEC,IAAAA,KAAF;AAASC,IAAAA;AAAT,GAAgC;AAC/B,QAAM,CAACC,KAAD,IAAUH,QAAQ,CAACI,MAAT,CAAgBN,YAAhB,CAAhB;AACA,QAAMO,EAAE,GAAGT,IAAI,CAACU,UAAL,CAAgBC,UAAhB,CAA2BN,KAA3B,EAAkCC,MAAlC,CAAX;;AACA,MAAIC,KAAJ,EAAW;AACT,QAAI,CAACE,EAAL,EAAS;AACP,aAAOF,KAAP;AACD;;AACD,WAAOP,IAAI,CAACU,UAAL,CAAgBE,WAAhB,CAA4BH,EAA5B,EAAgCF,KAAhC,CAAP;AACD;;AACD,SAAOE,EAAP;AACD,CAXgC,CAAnC;AAcA,OAAO,MAAMI,gBAAgB,GAC3BC,KAD8B,IAE3B;AACH,sBAAO;AAAe,IAAA,SAAS,EAAEX;AAA1B,KAAyCW,KAAzC,EAAP;AACD,CAJM","sourcesContent":["import React from \"react\";\nimport type { ReactNode } from \"react\";\n\nimport { Skia } from \"../../../skia\";\nimport { createDeclaration } from \"../../nodes/Declaration\";\nimport type { AnimatedProps } from \"../../processors/Animations/Animations\";\nimport { isPathEffect } from \"../../../skia/PathEffect\";\nimport type { SkMatrix } from \"../../../skia/Matrix\";\n\nexport interface Line2DPathEffectProps {\n children?: ReactNode | ReactNode[];\n width: number;\n matrix: SkMatrix;\n}\n\nconst onDeclare = createDeclaration<Line2DPathEffectProps>(\n ({ width, matrix }, children) => {\n const [child] = children.filter(isPathEffect);\n const pe = Skia.PathEffect.MakeLine2D(width, matrix);\n if (child) {\n if (!pe) {\n return child;\n }\n return Skia.PathEffect.MakeCompose(pe, child);\n }\n return pe;\n }\n);\n\nexport const Line2DPathEffect = (\n props: AnimatedProps<Line2DPathEffectProps>\n) => {\n return <skDeclaration onDeclare={onDeclare} {...props} />;\n};\n"]}
1
+ {"version":3,"sources":["Line2D.tsx"],"names":["React","Skia","isPathEffect","createDeclaration","onDeclare","children","width","matrix","child","filter","pe","PathEffect","MakeLine2D","MakeCompose","Line2DPathEffect","props"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAGA,SAASC,IAAT,EAAeC,YAAf,QAAmC,eAAnC;AACA,SAASC,iBAAT,QAAkC,yBAAlC;AAUA,MAAMC,SAAS,GAAGD,iBAAiB,CACjC,OAAoBE,QAApB,KAAiC;AAAA,MAAhC;AAAEC,IAAAA,KAAF;AAASC,IAAAA;AAAT,GAAgC;AAC/B,QAAM,CAACC,KAAD,IAAUH,QAAQ,CAACI,MAAT,CAAgBP,YAAhB,CAAhB;AACA,QAAMQ,EAAE,GAAGT,IAAI,CAACU,UAAL,CAAgBC,UAAhB,CAA2BN,KAA3B,EAAkCC,MAAlC,CAAX;;AACA,MAAIC,KAAJ,EAAW;AACT,QAAI,CAACE,EAAL,EAAS;AACP,aAAOF,KAAP;AACD;;AACD,WAAOP,IAAI,CAACU,UAAL,CAAgBE,WAAhB,CAA4BH,EAA5B,EAAgCF,KAAhC,CAAP;AACD;;AACD,SAAOE,EAAP;AACD,CAXgC,CAAnC;AAcA,OAAO,MAAMI,gBAAgB,GAC3BC,KAD8B,IAE3B;AACH,sBAAO;AAAe,IAAA,SAAS,EAAEX;AAA1B,KAAyCW,KAAzC,EAAP;AACD,CAJM","sourcesContent":["import React from \"react\";\nimport type { ReactNode } from \"react\";\n\nimport { Skia, isPathEffect } from \"../../../skia\";\nimport { createDeclaration } from \"../../nodes/Declaration\";\nimport type { AnimatedProps } from \"../../processors/Animations/Animations\";\nimport type { SkMatrix } from \"../../../skia\";\n\nexport interface Line2DPathEffectProps {\n children?: ReactNode | ReactNode[];\n width: number;\n matrix: SkMatrix;\n}\n\nconst onDeclare = createDeclaration<Line2DPathEffectProps>(\n ({ width, matrix }, children) => {\n const [child] = children.filter(isPathEffect);\n const pe = Skia.PathEffect.MakeLine2D(width, matrix);\n if (child) {\n if (!pe) {\n return child;\n }\n return Skia.PathEffect.MakeCompose(pe, child);\n }\n return pe;\n }\n);\n\nexport const Line2DPathEffect = (\n props: AnimatedProps<Line2DPathEffectProps>\n) => {\n return <skDeclaration onDeclare={onDeclare} {...props} />;\n};\n"]}
@@ -1,9 +1,8 @@
1
1
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
2
 
3
3
  import React from "react";
4
- import { Skia } from "../../../skia";
4
+ import { Skia, Path1DEffectStyle, isPathEffect } from "../../../skia";
5
5
  import { createDeclaration } from "../../nodes/Declaration";
6
- import { Path1DEffectStyle, isPathEffect } from "../../../skia/PathEffect";
7
6
  import { enumKey } from "../../processors/Paint";
8
7
  import { processPath } from "../../processors/Paths";
9
8
  const onDeclare = createDeclaration((_ref, children) => {
@@ -1 +1 @@
1
- {"version":3,"sources":["Path1D.tsx"],"names":["React","Skia","createDeclaration","Path1DEffectStyle","isPathEffect","enumKey","processPath","onDeclare","children","path","advance","phase","style","child","filter","pe","PathEffect","MakePath1D","MakeCompose","Path1DPathEffect","props"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAGA,SAASC,IAAT,QAAqB,eAArB;AACA,SAASC,iBAAT,QAAkC,yBAAlC;AAEA,SAASC,iBAAT,EAA4BC,YAA5B,QAAgD,0BAAhD;AAEA,SAASC,OAAT,QAAwB,wBAAxB;AAEA,SAASC,WAAT,QAA4B,wBAA5B;AAUA,MAAMC,SAAS,GAAGL,iBAAiB,CACjC,OAAkCM,QAAlC,KAA+C;AAAA,MAA9C;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,OAAR;AAAiBC,IAAAA,KAAjB;AAAwBC,IAAAA;AAAxB,GAA8C;AAC7C,QAAM,CAACC,KAAD,IAAUL,QAAQ,CAACM,MAAT,CAAgBV,YAAhB,CAAhB;AACA,QAAMW,EAAE,GAAGd,IAAI,CAACe,UAAL,CAAgBC,UAAhB,CACTX,WAAW,CAACG,IAAD,CADF,EAETC,OAFS,EAGTC,KAHS,EAITR,iBAAiB,CAACE,OAAO,CAACO,KAAD,CAAR,CAJR,CAAX;;AAMA,MAAIC,KAAJ,EAAW;AACT,QAAI,CAACE,EAAL,EAAS;AACP,aAAOF,KAAP;AACD;;AACD,WAAOZ,IAAI,CAACe,UAAL,CAAgBE,WAAhB,CAA4BH,EAA5B,EAAgCF,KAAhC,CAAP;AACD;;AACD,SAAOE,EAAP;AACD,CAhBgC,CAAnC;AAmBA,OAAO,MAAMI,gBAAgB,GAC3BC,KAD8B,IAE3B;AACH,sBAAO;AAAe,IAAA,SAAS,EAAEb;AAA1B,KAAyCa,KAAzC,EAAP;AACD,CAJM","sourcesContent":["import React from \"react\";\nimport type { ReactNode } from \"react\";\n\nimport { Skia } from \"../../../skia\";\nimport { createDeclaration } from \"../../nodes/Declaration\";\nimport type { AnimatedProps } from \"../../processors/Animations/Animations\";\nimport { Path1DEffectStyle, isPathEffect } from \"../../../skia/PathEffect\";\nimport type { SkEnum } from \"../../processors/Paint\";\nimport { enumKey } from \"../../processors/Paint\";\nimport type { PathDef } from \"../../processors/Paths\";\nimport { processPath } from \"../../processors/Paths\";\n\nexport interface Path1DPathEffectProps {\n path: PathDef;\n children?: ReactNode | ReactNode[];\n advance: number;\n phase: number;\n style: SkEnum<typeof Path1DEffectStyle>;\n}\n\nconst onDeclare = createDeclaration<Path1DPathEffectProps>(\n ({ path, advance, phase, style }, children) => {\n const [child] = children.filter(isPathEffect);\n const pe = Skia.PathEffect.MakePath1D(\n processPath(path),\n advance,\n phase,\n Path1DEffectStyle[enumKey(style)]\n );\n if (child) {\n if (!pe) {\n return child;\n }\n return Skia.PathEffect.MakeCompose(pe, child);\n }\n return pe;\n }\n);\n\nexport const Path1DPathEffect = (\n props: AnimatedProps<Path1DPathEffectProps>\n) => {\n return <skDeclaration onDeclare={onDeclare} {...props} />;\n};\n"]}
1
+ {"version":3,"sources":["Path1D.tsx"],"names":["React","Skia","Path1DEffectStyle","isPathEffect","createDeclaration","enumKey","processPath","onDeclare","children","path","advance","phase","style","child","filter","pe","PathEffect","MakePath1D","MakeCompose","Path1DPathEffect","props"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAGA,SAASC,IAAT,EAAeC,iBAAf,EAAkCC,YAAlC,QAAsD,eAAtD;AACA,SAASC,iBAAT,QAAkC,yBAAlC;AAGA,SAASC,OAAT,QAAwB,wBAAxB;AAEA,SAASC,WAAT,QAA4B,wBAA5B;AAUA,MAAMC,SAAS,GAAGH,iBAAiB,CACjC,OAAkCI,QAAlC,KAA+C;AAAA,MAA9C;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,OAAR;AAAiBC,IAAAA,KAAjB;AAAwBC,IAAAA;AAAxB,GAA8C;AAC7C,QAAM,CAACC,KAAD,IAAUL,QAAQ,CAACM,MAAT,CAAgBX,YAAhB,CAAhB;AACA,QAAMY,EAAE,GAAGd,IAAI,CAACe,UAAL,CAAgBC,UAAhB,CACTX,WAAW,CAACG,IAAD,CADF,EAETC,OAFS,EAGTC,KAHS,EAITT,iBAAiB,CAACG,OAAO,CAACO,KAAD,CAAR,CAJR,CAAX;;AAMA,MAAIC,KAAJ,EAAW;AACT,QAAI,CAACE,EAAL,EAAS;AACP,aAAOF,KAAP;AACD;;AACD,WAAOZ,IAAI,CAACe,UAAL,CAAgBE,WAAhB,CAA4BH,EAA5B,EAAgCF,KAAhC,CAAP;AACD;;AACD,SAAOE,EAAP;AACD,CAhBgC,CAAnC;AAmBA,OAAO,MAAMI,gBAAgB,GAC3BC,KAD8B,IAE3B;AACH,sBAAO;AAAe,IAAA,SAAS,EAAEb;AAA1B,KAAyCa,KAAzC,EAAP;AACD,CAJM","sourcesContent":["import React from \"react\";\nimport type { ReactNode } from \"react\";\n\nimport { Skia, Path1DEffectStyle, isPathEffect } from \"../../../skia\";\nimport { createDeclaration } from \"../../nodes/Declaration\";\nimport type { AnimatedProps } from \"../../processors/Animations/Animations\";\nimport type { SkEnum } from \"../../processors/Paint\";\nimport { enumKey } from \"../../processors/Paint\";\nimport type { PathDef } from \"../../processors/Paths\";\nimport { processPath } from \"../../processors/Paths\";\n\nexport interface Path1DPathEffectProps {\n path: PathDef;\n children?: ReactNode | ReactNode[];\n advance: number;\n phase: number;\n style: SkEnum<typeof Path1DEffectStyle>;\n}\n\nconst onDeclare = createDeclaration<Path1DPathEffectProps>(\n ({ path, advance, phase, style }, children) => {\n const [child] = children.filter(isPathEffect);\n const pe = Skia.PathEffect.MakePath1D(\n processPath(path),\n advance,\n phase,\n Path1DEffectStyle[enumKey(style)]\n );\n if (child) {\n if (!pe) {\n return child;\n }\n return Skia.PathEffect.MakeCompose(pe, child);\n }\n return pe;\n }\n);\n\nexport const Path1DPathEffect = (\n props: AnimatedProps<Path1DPathEffectProps>\n) => {\n return <skDeclaration onDeclare={onDeclare} {...props} />;\n};\n"]}
@@ -1,9 +1,8 @@
1
1
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
2
 
3
3
  import React from "react";
4
- import { Skia } from "../../../skia";
4
+ import { Skia, isPathEffect } from "../../../skia";
5
5
  import { createDeclaration } from "../../nodes/Declaration";
6
- import { isPathEffect } from "../../../skia/PathEffect";
7
6
  import { processPath } from "../../processors/Paths";
8
7
  const onDeclare = createDeclaration((_ref, children) => {
9
8
  let {
@@ -1 +1 @@
1
- {"version":3,"sources":["Path2D.tsx"],"names":["React","Skia","createDeclaration","isPathEffect","processPath","onDeclare","children","path","matrix","child","filter","pe","PathEffect","MakePath2D","MakeCompose","Path2DPathEffect","props"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAGA,SAASC,IAAT,QAAqB,eAArB;AACA,SAASC,iBAAT,QAAkC,yBAAlC;AAEA,SAASC,YAAT,QAA6B,0BAA7B;AAGA,SAASC,WAAT,QAA4B,wBAA5B;AAQA,MAAMC,SAAS,GAAGH,iBAAiB,CACjC,OAAmBI,QAAnB,KAAgC;AAAA,MAA/B;AAAEC,IAAAA,IAAF;AAAQC,IAAAA;AAAR,GAA+B;AAC9B,QAAM,CAACC,KAAD,IAAUH,QAAQ,CAACI,MAAT,CAAgBP,YAAhB,CAAhB;AACA,QAAMQ,EAAE,GAAGV,IAAI,CAACW,UAAL,CAAgBC,UAAhB,CAA2BL,MAA3B,EAAmCJ,WAAW,CAACG,IAAD,CAA9C,CAAX;;AACA,MAAIE,KAAJ,EAAW;AACT,QAAI,CAACE,EAAL,EAAS;AACP,aAAOF,KAAP;AACD;;AACD,WAAOR,IAAI,CAACW,UAAL,CAAgBE,WAAhB,CAA4BH,EAA5B,EAAgCF,KAAhC,CAAP;AACD;;AACD,SAAOE,EAAP;AACD,CAXgC,CAAnC;AAcA,OAAO,MAAMI,gBAAgB,GAC3BC,KAD8B,IAE3B;AACH,sBAAO;AAAe,IAAA,SAAS,EAAEX;AAA1B,KAAyCW,KAAzC,EAAP;AACD,CAJM","sourcesContent":["import React from \"react\";\nimport type { ReactNode } from \"react\";\n\nimport { Skia } from \"../../../skia\";\nimport { createDeclaration } from \"../../nodes/Declaration\";\nimport type { AnimatedProps } from \"../../processors/Animations/Animations\";\nimport { isPathEffect } from \"../../../skia/PathEffect\";\nimport type { SkMatrix } from \"../../../skia/Matrix\";\nimport type { PathDef } from \"../../processors/Paths\";\nimport { processPath } from \"../../processors/Paths\";\n\nexport interface Path2DPathEffectProps {\n children?: ReactNode | ReactNode[];\n matrix: SkMatrix;\n path: PathDef;\n}\n\nconst onDeclare = createDeclaration<Path2DPathEffectProps>(\n ({ path, matrix }, children) => {\n const [child] = children.filter(isPathEffect);\n const pe = Skia.PathEffect.MakePath2D(matrix, processPath(path));\n if (child) {\n if (!pe) {\n return child;\n }\n return Skia.PathEffect.MakeCompose(pe, child);\n }\n return pe;\n }\n);\n\nexport const Path2DPathEffect = (\n props: AnimatedProps<Path2DPathEffectProps>\n) => {\n return <skDeclaration onDeclare={onDeclare} {...props} />;\n};\n"]}
1
+ {"version":3,"sources":["Path2D.tsx"],"names":["React","Skia","isPathEffect","createDeclaration","processPath","onDeclare","children","path","matrix","child","filter","pe","PathEffect","MakePath2D","MakeCompose","Path2DPathEffect","props"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAGA,SAASC,IAAT,EAAeC,YAAf,QAAmC,eAAnC;AACA,SAASC,iBAAT,QAAkC,yBAAlC;AAIA,SAASC,WAAT,QAA4B,wBAA5B;AAQA,MAAMC,SAAS,GAAGF,iBAAiB,CACjC,OAAmBG,QAAnB,KAAgC;AAAA,MAA/B;AAAEC,IAAAA,IAAF;AAAQC,IAAAA;AAAR,GAA+B;AAC9B,QAAM,CAACC,KAAD,IAAUH,QAAQ,CAACI,MAAT,CAAgBR,YAAhB,CAAhB;AACA,QAAMS,EAAE,GAAGV,IAAI,CAACW,UAAL,CAAgBC,UAAhB,CAA2BL,MAA3B,EAAmCJ,WAAW,CAACG,IAAD,CAA9C,CAAX;;AACA,MAAIE,KAAJ,EAAW;AACT,QAAI,CAACE,EAAL,EAAS;AACP,aAAOF,KAAP;AACD;;AACD,WAAOR,IAAI,CAACW,UAAL,CAAgBE,WAAhB,CAA4BH,EAA5B,EAAgCF,KAAhC,CAAP;AACD;;AACD,SAAOE,EAAP;AACD,CAXgC,CAAnC;AAcA,OAAO,MAAMI,gBAAgB,GAC3BC,KAD8B,IAE3B;AACH,sBAAO;AAAe,IAAA,SAAS,EAAEX;AAA1B,KAAyCW,KAAzC,EAAP;AACD,CAJM","sourcesContent":["import React from \"react\";\nimport type { ReactNode } from \"react\";\n\nimport { Skia, isPathEffect } from \"../../../skia\";\nimport { createDeclaration } from \"../../nodes/Declaration\";\nimport type { AnimatedProps } from \"../../processors/Animations/Animations\";\nimport type { SkMatrix } from \"../../../skia\";\nimport type { PathDef } from \"../../processors/Paths\";\nimport { processPath } from \"../../processors/Paths\";\n\nexport interface Path2DPathEffectProps {\n children?: ReactNode | ReactNode[];\n matrix: SkMatrix;\n path: PathDef;\n}\n\nconst onDeclare = createDeclaration<Path2DPathEffectProps>(\n ({ path, matrix }, children) => {\n const [child] = children.filter(isPathEffect);\n const pe = Skia.PathEffect.MakePath2D(matrix, processPath(path));\n if (child) {\n if (!pe) {\n return child;\n }\n return Skia.PathEffect.MakeCompose(pe, child);\n }\n return pe;\n }\n);\n\nexport const Path2DPathEffect = (\n props: AnimatedProps<Path2DPathEffectProps>\n) => {\n return <skDeclaration onDeclare={onDeclare} {...props} />;\n};\n"]}
@@ -1,9 +1,8 @@
1
1
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
2
 
3
3
  import React from "react";
4
- import { Skia } from "../../../skia";
4
+ import { Skia, isPathEffect } from "../../../skia";
5
5
  import { createDeclaration } from "../../nodes/Declaration";
6
- import { isPathEffect } from "../../../skia/PathEffect";
7
6
  const onDeclare = createDeclaration((_, children) => {
8
7
  const [outer, inner] = children.filter(isPathEffect);
9
8
  return Skia.PathEffect.MakeCompose(outer, inner);
@@ -1 +1 @@
1
- {"version":3,"sources":["Sum.tsx"],"names":["React","Skia","createDeclaration","isPathEffect","onDeclare","_","children","outer","inner","filter","PathEffect","MakeCompose","SumPathEffect","props"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAGA,SAASC,IAAT,QAAqB,eAArB;AACA,SAASC,iBAAT,QAAkC,yBAAlC;AAEA,SAASC,YAAT,QAA6B,0BAA7B;AAMA,MAAMC,SAAS,GAAGF,iBAAiB,CAAqB,CAACG,CAAD,EAAIC,QAAJ,KAAiB;AACvE,QAAM,CAACC,KAAD,EAAQC,KAAR,IAAiBF,QAAQ,CAACG,MAAT,CAAgBN,YAAhB,CAAvB;AACA,SAAOF,IAAI,CAACS,UAAL,CAAgBC,WAAhB,CAA4BJ,KAA5B,EAAmCC,KAAnC,CAAP;AACD,CAHkC,CAAnC;AAKA,OAAO,MAAMI,aAAa,GAAIC,KAAD,IAA8C;AACzE,sBAAO;AAAe,IAAA,SAAS,EAAET;AAA1B,KAAyCS,KAAzC,EAAP;AACD,CAFM","sourcesContent":["import React from \"react\";\nimport type { ReactNode } from \"react\";\n\nimport { Skia } from \"../../../skia\";\nimport { createDeclaration } from \"../../nodes/Declaration\";\nimport type { AnimatedProps } from \"../../processors/Animations/Animations\";\nimport { isPathEffect } from \"../../../skia/PathEffect\";\n\nexport interface SumPathEffectProps {\n children?: ReactNode | ReactNode[];\n}\n\nconst onDeclare = createDeclaration<SumPathEffectProps>((_, children) => {\n const [outer, inner] = children.filter(isPathEffect);\n return Skia.PathEffect.MakeCompose(outer, inner);\n});\n\nexport const SumPathEffect = (props: AnimatedProps<SumPathEffectProps>) => {\n return <skDeclaration onDeclare={onDeclare} {...props} />;\n};\n"]}
1
+ {"version":3,"sources":["Sum.tsx"],"names":["React","Skia","isPathEffect","createDeclaration","onDeclare","_","children","outer","inner","filter","PathEffect","MakeCompose","SumPathEffect","props"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAGA,SAASC,IAAT,EAAeC,YAAf,QAAmC,eAAnC;AACA,SAASC,iBAAT,QAAkC,yBAAlC;AAOA,MAAMC,SAAS,GAAGD,iBAAiB,CAAqB,CAACE,CAAD,EAAIC,QAAJ,KAAiB;AACvE,QAAM,CAACC,KAAD,EAAQC,KAAR,IAAiBF,QAAQ,CAACG,MAAT,CAAgBP,YAAhB,CAAvB;AACA,SAAOD,IAAI,CAACS,UAAL,CAAgBC,WAAhB,CAA4BJ,KAA5B,EAAmCC,KAAnC,CAAP;AACD,CAHkC,CAAnC;AAKA,OAAO,MAAMI,aAAa,GAAIC,KAAD,IAA8C;AACzE,sBAAO;AAAe,IAAA,SAAS,EAAET;AAA1B,KAAyCS,KAAzC,EAAP;AACD,CAFM","sourcesContent":["import React from \"react\";\nimport type { ReactNode } from \"react\";\n\nimport { Skia, isPathEffect } from \"../../../skia\";\nimport { createDeclaration } from \"../../nodes/Declaration\";\nimport type { AnimatedProps } from \"../../processors/Animations/Animations\";\n\nexport interface SumPathEffectProps {\n children?: ReactNode | ReactNode[];\n}\n\nconst onDeclare = createDeclaration<SumPathEffectProps>((_, children) => {\n const [outer, inner] = children.filter(isPathEffect);\n return Skia.PathEffect.MakeCompose(outer, inner);\n});\n\nexport const SumPathEffect = (props: AnimatedProps<SumPathEffectProps>) => {\n return <skDeclaration onDeclare={onDeclare} {...props} />;\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["Gradient.ts"],"names":["Skia","TileMode","enumKey","localMatrix","processGradientProps","colors","positions","mode","flags","transform","map","color","Color"],"mappings":"AAAA,SAASA,IAAT,EAAeC,QAAf,QAA+B,eAA/B;AAGA,SAASC,OAAT,QAAwB,wBAAxB;AACA,SAASC,WAAT,QAA4B,4BAA5B;AAUA,OAAO,MAAMC,oBAAoB,GAAG;AAAA,MAAC;AACnCC,IAAAA,MADmC;AAEnCC,IAAAA,SAFmC;AAGnCC,IAAAA,IAHmC;AAInCC,IAAAA,KAJmC;AAKnC,OAAGC;AALgC,GAAD;AAAA,SAMd;AACpBJ,IAAAA,MAAM,EAAEA,MAAM,CAACK,GAAP,CAAYC,KAAD,IAAWX,IAAI,CAACY,KAAL,CAAWD,KAAX,CAAtB,CADY;AAEpBL,IAAAA,SAAS,EAAEA,SAAF,aAAEA,SAAF,cAAEA,SAAF,GAAe,IAFJ;AAGpBC,IAAAA,IAAI,EAAEN,QAAQ,CAACC,OAAO,CAACK,IAAD,aAACA,IAAD,cAACA,IAAD,GAAS,OAAT,CAAR,CAHM;AAIpBC,IAAAA,KAJoB;AAKpBL,IAAAA,WAAW,EAAEA,WAAW,CAACM,SAAD;AALJ,GANc;AAAA,CAA7B","sourcesContent":["import { Skia, TileMode } from \"../../../skia\";\nimport type { SkEnum } from \"../../processors/Paint\";\nimport type { TransformProps } from \"../../processors/Transform\";\nimport { enumKey } from \"../../processors/Paint\";\nimport { localMatrix } from \"../../processors/Transform\";\nimport type { Color } from \"../../../skia/Color\";\n\nexport interface GradientProps extends TransformProps {\n colors: Color[];\n positions?: number[];\n mode?: SkEnum<typeof TileMode>;\n flags?: number;\n}\n\nexport const processGradientProps = ({\n colors,\n positions,\n mode,\n flags,\n ...transform\n}: GradientProps) => ({\n colors: colors.map((color) => Skia.Color(color)),\n positions: positions ?? null,\n mode: TileMode[enumKey(mode ?? \"clamp\")],\n flags,\n localMatrix: localMatrix(transform),\n});\n"]}
1
+ {"version":3,"sources":["Gradient.ts"],"names":["Skia","TileMode","enumKey","localMatrix","processGradientProps","colors","positions","mode","flags","transform","map","color","Color"],"mappings":"AAAA,SAASA,IAAT,EAAeC,QAAf,QAA+B,eAA/B;AAGA,SAASC,OAAT,QAAwB,wBAAxB;AACA,SAASC,WAAT,QAA4B,4BAA5B;AAUA,OAAO,MAAMC,oBAAoB,GAAG;AAAA,MAAC;AACnCC,IAAAA,MADmC;AAEnCC,IAAAA,SAFmC;AAGnCC,IAAAA,IAHmC;AAInCC,IAAAA,KAJmC;AAKnC,OAAGC;AALgC,GAAD;AAAA,SAMd;AACpBJ,IAAAA,MAAM,EAAEA,MAAM,CAACK,GAAP,CAAYC,KAAD,IAAWX,IAAI,CAACY,KAAL,CAAWD,KAAX,CAAtB,CADY;AAEpBL,IAAAA,SAAS,EAAEA,SAAF,aAAEA,SAAF,cAAEA,SAAF,GAAe,IAFJ;AAGpBC,IAAAA,IAAI,EAAEN,QAAQ,CAACC,OAAO,CAACK,IAAD,aAACA,IAAD,cAACA,IAAD,GAAS,OAAT,CAAR,CAHM;AAIpBC,IAAAA,KAJoB;AAKpBL,IAAAA,WAAW,EAAEA,WAAW,CAACM,SAAD;AALJ,GANc;AAAA,CAA7B","sourcesContent":["import { Skia, TileMode } from \"../../../skia\";\nimport type { SkEnum } from \"../../processors/Paint\";\nimport type { TransformProps } from \"../../processors/Transform\";\nimport { enumKey } from \"../../processors/Paint\";\nimport { localMatrix } from \"../../processors/Transform\";\nimport type { Color } from \"../../../skia\";\n\nexport interface GradientProps extends TransformProps {\n colors: Color[];\n positions?: number[];\n mode?: SkEnum<typeof TileMode>;\n flags?: number;\n}\n\nexport const processGradientProps = ({\n colors,\n positions,\n mode,\n flags,\n ...transform\n}: GradientProps) => ({\n colors: colors.map((color) => Skia.Color(color)),\n positions: positions ?? null,\n mode: TileMode[enumKey(mode ?? \"clamp\")],\n flags,\n localMatrix: localMatrix(transform),\n});\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["Box.tsx"],"names":["React","ClipOp","BlurStyle","Skia","processColor","createDrawing","add","vec","rrect","rect","isRRect","createDeclaration","inflate","box","dx","dy","tx","ty","x","y","width","height","rx","ry","deflate","onDeclare","spread","blur","color","inner","__typename__","BoxShadow","props","isBoxShadow","s","onDraw","ctx","node","defaultBox","canvas","paint","opacity","shadows","visit","filter","shadow","map","lPaint","Paint","setColor","setMaskFilter","MaskFilter","MakeBlur","Normal","drawRRect","delta","Math","abs","save","clipRRect","Intersect","outer","drawDRRect","restore","Box","defaultProps"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAGA,SAASC,MAAT,EAAiBC,SAAjB,EAA4BC,IAA5B,EAAkCC,YAAlC,QAAsD,eAAtD;AACA,SAASC,aAAT,QAA8B,aAA9B;AAEA,SAASC,GAAT,EAAcC,GAAd,EAAmBC,KAAnB,QAAgC,kBAAhC;AACA,SAASC,IAAT,EAAeC,OAAf,QAA8B,wBAA9B;AACA,SAASC,iBAAT,QAAkC,yBAAlC;;AAIA,MAAMC,OAAO,GAAG,UAACC,GAAD,EAAeC,EAAf,EAA2BC,EAA3B;AAAA,MAAuCC,EAAvC,uEAA4C,CAA5C;AAAA,MAA+CC,EAA/C,uEAAoD,CAApD;AAAA,SACdT,KAAK,CACHC,IAAI,CACFI,GAAG,CAACJ,IAAJ,CAASS,CAAT,GAAaJ,EAAb,GAAkBE,EADhB,EAEFH,GAAG,CAACJ,IAAJ,CAASU,CAAT,GAAaJ,EAAb,GAAkBE,EAFhB,EAGFJ,GAAG,CAACJ,IAAJ,CAASW,KAAT,GAAiB,IAAIN,EAHnB,EAIFD,GAAG,CAACJ,IAAJ,CAASY,MAAT,GAAkB,IAAIN,EAJpB,CADD,EAOHF,GAAG,CAACS,EAAJ,GAASR,EAPN,EAQHD,GAAG,CAACU,EAAJ,GAASR,EARN,CADS;AAAA,CAAhB;;AAYA,MAAMS,OAAO,GAAG,UAACX,GAAD,EAAeC,EAAf,EAA2BC,EAA3B;AAAA,MAAuCC,EAAvC,uEAA4C,CAA5C;AAAA,MAA+CC,EAA/C,uEAAoD,CAApD;AAAA,SACdL,OAAO,CAACC,GAAD,EAAM,CAACC,EAAP,EAAW,CAACC,EAAZ,EAAgBC,EAAhB,EAAoBC,EAApB,CADO;AAAA,CAAhB;;AAcA,MAAMQ,SAAS,GAAGd,iBAAi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AC6C,KAAL,EAAf;AACAD,IAAAA,MAAM,CAACE,QAAP,CAAgB7C,YAAY,CAACwB,KAAD,EAAQa,OAAR,CAA5B;AACAM,IAAAA,MAAM,CAACG,aAAP,CACE/C,IAAI,CAACgD,UAAL,CAAgBC,QAAhB,CAAyBlD,SAAS,CAACmD,MAAnC,EAA2C1B,IAA3C,EAAiD,IAAjD,CADF;AAGA,UAAME,KAAK,GAAGL,OAAO,CAACX,GAAD,EAAMa,MAAN,EAAcA,MAAd,EAAsBZ,EAAtB,EAA0BC,EAA1B,CAArB;AACA,UAAM8C,KAAK,GAAGjD,OAAO,CAACC,GAAD,EAAM0C,KAAK,CAACrC,CAAZ,EAAeqC,KAAK,CAACpC,CAArB,CAArB;AACAoB,IAAAA,MAAM,CAACuB,UAAP,CAAkBD,KAAlB,EAAyBhC,KAAzB,EAAgCkB,MAAhC;AACAR,IAAAA,MAAM,CAACwB,OAAP;AACD,GAhBH;AAiBD,CAlC2B,CAA5B;AAoCA,OAAO,MAAMC,GAAG,GAAIhC,KAAD,IAAoC;AACrD,sBAAO;AAAW,IAAA,MAAM,EAAEG;AAAnB,KAA+BH,KAA/B,EAAP;AACD,CAFM;AAIPgC,GAAG,CAACC,YAAJ,GAAmB;AACjBvB,EAAAA,OAAO,EAAE;AADQ,CAAnB","sourcesContent":["import React from \"react\";\n\nimport type { Color, SkRRect } from \"../../../skia\";\nimport { ClipOp, BlurStyle, Skia, processColor } from \"../../../skia\";\nimport { createDrawing } from \"../../nodes\";\nimport type { AnimatedProps, CustomPaintProps } from \"../../processors\";\nimport { add, vec, rrect } from \"../../processors\";\nimport { rect, isRRect } from \"../../processors/Rects\";\nimport { createDeclaration } from \"../../nodes/Declaration\";\nimport type { SkJSIInstance } from \"../../../skia/JsiInstance\";\nimport type { SkRect } from \"../../../skia/Rect\";\n\nconst inflate = (box: SkRRect, dx: number, dy: number, tx = 0, ty = 0) =>\n rrect(\n rect(\n box.rect.x - dx + tx,\n box.rect.y - dy + ty,\n box.rect.width + 2 * dx,\n box.rect.height + 2 * dy\n ),\n box.rx + dx,\n box.ry + dy\n );\n\nconst deflate = (box: SkRRect, dx: number, dy: number, tx = 0, ty = 0) =>\n inflate(box, -dx, -dy, tx, ty);\n\ninterface BoxShadowProps {\n dx?: number;\n dy?: number;\n spread?: number;\n blur: number;\n color?: Color;\n inner?: boolean;\n}\n\ninterface BoxShadowDecl extends BoxShadowProps, SkJSIInstance<\"BoxShadow\"> {}\n\nconst onDeclare = createDeclaration<BoxShadowProps>(\n ({ dx, dy, spread, blur, color, inner }) => {\n return { dx, dy, spread, blur, color, inner, __typename__: \"BoxShadow\" };\n }\n);\n\nexport const BoxShadow = (props: AnimatedProps<BoxShadowProps>) => {\n return <skDeclaration onDeclare={onDeclare} {...props} />;\n};\n\nconst isBoxShadow = (s: SkJSIInstance<string>): s is BoxShadowDecl =>\n s.__typename__ === \"BoxShadow\";\n\ninterface BoxProps extends CustomPaintProps {\n box: SkRRect | SkRect;\n}\n\nconst onDraw = createDrawing<BoxProps>((ctx, { box: defaultBox }, node) => {\n const box = isRRect(defaultBox) ? defaultBox : rrect(defaultBox, 0, 0);\n const { canvas, paint, opacity } = ctx;\n const shadows = node.visit(ctx).filter<BoxShadowDecl>(isBoxShadow);\n shadows\n .filter((shadow) => !shadow.inner)\n .map((shadow) => {\n const { color = \"black\", blur, spread = 0, dx = 0, dy = 0 } = shadow;\n const lPaint = Skia.Paint();\n lPaint.setColor(processColor(color, opacity));\n lPaint.setMaskFilter(\n Skia.MaskFilter.MakeBlur(BlurStyle.Normal, blur, true)\n );\n canvas.drawRRect(inflate(box, spread, spread, dx, dy), lPaint);\n });\n canvas.drawRRect(box, paint);\n\n shadows\n .filter((shadow) => shadow.inner)\n .map((shadow) => {\n const { color = \"black\", blur, spread = 0, dx = 0, dy = 0 } = shadow;\n const delta = add(vec(10, 10), vec(Math.abs(dx), Math.abs(dy)));\n canvas.save();\n canvas.clipRRect(box, ClipOp.Intersect, false);\n const lPaint = Skia.Paint();\n lPaint.setColor(processColor(color, opacity));\n lPaint.setMaskFilter(\n Skia.MaskFilter.MakeBlur(BlurStyle.Normal, blur, true)\n );\n const inner = deflate(box, spread, spread, dx, dy);\n const outer = inflate(box, delta.x, delta.y);\n canvas.drawDRRect(outer, inner, lPaint);\n canvas.restore();\n });\n});\n\nexport const Box = (props: AnimatedProps<BoxProps>) => {\n return <skDrawing onDraw={onDraw} {...props} />;\n};\n\nBox.defaultProps = {\n shadows: [],\n};\n"]}
1
+ {"version":3,"sources":["Box.tsx"],"names":["React","ClipOp","BlurStyle","Skia","processColor","createDrawing","add","vec","rrect","rect","isRRect","createDeclaration","inflate","box","dx","dy","tx","ty","x","y","width","height","rx","ry","deflate","onDeclare","spread","blur","color","inner","__typename__","BoxShadow","props","isBoxShadow","s","onDraw","ctx","node","defaultBox","canvas","paint","opacity","shadows","visit","filter","shadow","map","lPaint","Paint","setColor","setMaskFilter","MaskFilter","MakeBlur","Normal","drawRRect","delta","Math","abs","save","clipRRect","Intersect","outer","drawDRRect","restore","Box","defaultProps"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAGA,SAASC,MAAT,EAAiBC,SAAjB,EAA4BC,IAA5B,EAAkCC,YAAlC,QAAsD,eAAtD;AACA,SAASC,aAAT,QAA8B,aAA9B;AAEA,SAASC,GAAT,EAAcC,GAAd,EAAmBC,KAAnB,QAAgC,kBAAhC;AACA,SAASC,IAAT,EAAeC,OAAf,QAA8B,wBAA9B;AACA,SAASC,iBAAT,QAAkC,yBAAlC;;AAEA,MAAMC,OAAO,GAAG,UAACC,GAAD,EAAeC,EAAf,EAA2BC,EAA3B;AAAA,MAAuCC,EAAvC,uEAA4C,CAA5C;AAAA,MAA+CC,EAA/C,uEAAoD,CAApD;AAAA,SACdT,KAAK,CACHC,IAAI,CACFI,GAAG,CAACJ,IAAJ,CAASS,CAAT,GAAaJ,EAAb,GAAkBE,EADhB,EAEFH,GAAG,CAACJ,IAAJ,CAASU,CAAT,GAAaJ,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B,KAA+BH,KAA/B,EAAP;AACD,CAFM;AAIPgC,GAAG,CAACC,YAAJ,GAAmB;AACjBvB,EAAAA,OAAO,EAAE;AADQ,CAAnB","sourcesContent":["import React from \"react\";\n\nimport type { Color, SkRRect, SkJSIInstance, SkRect } from \"../../../skia\";\nimport { ClipOp, BlurStyle, Skia, processColor } from \"../../../skia\";\nimport { createDrawing } from \"../../nodes\";\nimport type { AnimatedProps, CustomPaintProps } from \"../../processors\";\nimport { add, vec, rrect } from \"../../processors\";\nimport { rect, isRRect } from \"../../processors/Rects\";\nimport { createDeclaration } from \"../../nodes/Declaration\";\n\nconst inflate = (box: SkRRect, dx: number, dy: number, tx = 0, ty = 0) =>\n rrect(\n rect(\n box.rect.x - dx + tx,\n box.rect.y - dy + ty,\n box.rect.width + 2 * dx,\n box.rect.height + 2 * dy\n ),\n box.rx + dx,\n box.ry + dy\n );\n\nconst deflate = (box: SkRRect, dx: number, dy: number, tx = 0, ty = 0) =>\n inflate(box, -dx, -dy, tx, ty);\n\ninterface BoxShadowProps {\n dx?: number;\n dy?: number;\n spread?: number;\n blur: number;\n color?: Color;\n inner?: boolean;\n}\n\ninterface BoxShadowDecl extends BoxShadowProps, SkJSIInstance<\"BoxShadow\"> {}\n\nconst onDeclare = createDeclaration<BoxShadowProps>(\n ({ dx, dy, spread, blur, color, inner }) => {\n return { dx, dy, spread, blur, color, inner, __typename__: \"BoxShadow\" };\n }\n);\n\nexport const BoxShadow = (props: AnimatedProps<BoxShadowProps>) => {\n return <skDeclaration onDeclare={onDeclare} {...props} />;\n};\n\nconst isBoxShadow = (s: SkJSIInstance<string>): s is BoxShadowDecl =>\n s.__typename__ === \"BoxShadow\";\n\ninterface BoxProps extends CustomPaintProps {\n box: SkRRect | SkRect;\n}\n\nconst onDraw = createDrawing<BoxProps>((ctx, { box: defaultBox }, node) => {\n const box = isRRect(defaultBox) ? defaultBox : rrect(defaultBox, 0, 0);\n const { canvas, paint, opacity } = ctx;\n const shadows = node.visit(ctx).filter<BoxShadowDecl>(isBoxShadow);\n shadows\n .filter((shadow) => !shadow.inner)\n .map((shadow) => {\n const { color = \"black\", blur, spread = 0, dx = 0, dy = 0 } = shadow;\n const lPaint = Skia.Paint();\n lPaint.setColor(processColor(color, opacity));\n lPaint.setMaskFilter(\n Skia.MaskFilter.MakeBlur(BlurStyle.Normal, blur, true)\n );\n canvas.drawRRect(inflate(box, spread, spread, dx, dy), lPaint);\n });\n canvas.drawRRect(box, paint);\n\n shadows\n .filter((shadow) => shadow.inner)\n .map((shadow) => {\n const { color = \"black\", blur, spread = 0, dx = 0, dy = 0 } = shadow;\n const delta = add(vec(10, 10), vec(Math.abs(dx), Math.abs(dy)));\n canvas.save();\n canvas.clipRRect(box, ClipOp.Intersect, false);\n const lPaint = Skia.Paint();\n lPaint.setColor(processColor(color, opacity));\n lPaint.setMaskFilter(\n Skia.MaskFilter.MakeBlur(BlurStyle.Normal, blur, true)\n );\n const inner = deflate(box, spread, spread, dx, dy);\n const outer = inflate(box, delta.x, delta.y);\n canvas.drawDRRect(outer, inner, lPaint);\n canvas.restore();\n });\n});\n\nexport const Box = (props: AnimatedProps<BoxProps>) => {\n return <skDrawing onDraw={onDraw} {...props} />;\n};\n\nBox.defaultProps = {\n shadows: [],\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["DiffRect.tsx"],"names":["React","createDrawing","onDraw","canvas","paint","inner","outer","drawDRRect","DiffRect","props"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAKA,SAASC,aAAT,QAA8B,qBAA9B;AAOA,MAAMC,MAAM,GAAGD,aAAa,CAC1B,iBAAyC;AAAA,MAAxC;AAAEE,IAAAA,MAAF;AAAUC,IAAAA;AAAV,GAAwC;AAAA,MAArB;AAAEC,IAAAA,KAAF;AAASC,IAAAA;AAAT,GAAqB;AACvCH,EAAAA,MAAM,CAACI,UAAP,CAAkBD,KAAlB,EAAyBD,KAAzB,EAAgCD,KAAhC;AACD,CAHyB,CAA5B;AAMA,OAAO,MAAMI,QAAQ,GAAIC,KAAD,IAAyC;AAC/D,sBAAO;AAAW,IAAA,MAAM,EAAEP;AAAnB,KAA+BO,KAA/B,EAAP;AACD,CAFM","sourcesContent":["import React from \"react\";\n\nimport type { CustomPaintProps } from \"../../processors\";\nimport type { SkRRect } from \"../../../skia/RRect\";\nimport type { AnimatedProps } from \"../../processors/Animations/Animations\";\nimport { createDrawing } from \"../../nodes/Drawing\";\n\nexport interface DiffRectProps extends CustomPaintProps {\n inner: SkRRect;\n outer: SkRRect;\n}\n\nconst onDraw = createDrawing<DiffRectProps>(\n ({ canvas, paint }, { inner, outer }) => {\n canvas.drawDRRect(outer, inner, paint);\n }\n);\n\nexport const DiffRect = (props: AnimatedProps<DiffRectProps>) => {\n return <skDrawing onDraw={onDraw} {...props} />;\n};\n"]}
1
+ {"version":3,"sources":["DiffRect.tsx"],"names":["React","createDrawing","onDraw","canvas","paint","inner","outer","drawDRRect","DiffRect","props"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAKA,SAASC,aAAT,QAA8B,qBAA9B;AAOA,MAAMC,MAAM,GAAGD,aAAa,CAC1B,iBAAyC;AAAA,MAAxC;AAAEE,IAAAA,MAAF;AAAUC,IAAAA;AAAV,GAAwC;AAAA,MAArB;AAAEC,IAAAA,KAAF;AAASC,IAAAA;AAAT,GAAqB;AACvCH,EAAAA,MAAM,CAACI,UAAP,CAAkBD,KAAlB,EAAyBD,KAAzB,EAAgCD,KAAhC;AACD,CAHyB,CAA5B;AAMA,OAAO,MAAMI,QAAQ,GAAIC,KAAD,IAAyC;AAC/D,sBAAO;AAAW,IAAA,MAAM,EAAEP;AAAnB,KAA+BO,KAA/B,EAAP;AACD,CAFM","sourcesContent":["import React from \"react\";\n\nimport type { CustomPaintProps } from \"../../processors\";\nimport type { SkRRect } from \"../../../skia\";\nimport type { AnimatedProps } from \"../../processors/Animations/Animations\";\nimport { createDrawing } from \"../../nodes/Drawing\";\n\nexport interface DiffRectProps extends CustomPaintProps {\n inner: SkRRect;\n outer: SkRRect;\n}\n\nconst onDraw = createDrawing<DiffRectProps>(\n ({ canvas, paint }, { inner, outer }) => {\n canvas.drawDRRect(outer, inner, paint);\n }\n);\n\nexport const DiffRect = (props: AnimatedProps<DiffRectProps>) => {\n return <skDrawing onDraw={onDraw} {...props} />;\n};\n"]}
@@ -2,9 +2,8 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
2
2
 
3
3
  import React from "react";
4
4
  import { enumKey } from "../../processors";
5
- import { BlendMode } from "../../../skia";
5
+ import { BlendMode, processColor } from "../../../skia";
6
6
  import { createDrawing } from "../../nodes";
7
- import { processColor } from "../../../skia/Color";
8
7
  const onDraw = createDrawing((_ref, _ref2) => {
9
8
  let {
10
9
  canvas,
@@ -1 +1 @@
1
- {"version":3,"sources":["Patch.tsx"],"names":["React","enumKey","BlendMode","createDrawing","processColor","onDraw","canvas","paint","opacity","colors","patch","texture","blendMode","defaultBlendMode","DstOver","SrcOver","mode","drawPatch","pos","c2","c1","map","c","undefined","Patch","props"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAQA,SAASC,OAAT,QAAwB,kBAAxB;AAEA,SAASC,SAAT,QAA0B,eAA1B;AACA,SAASC,aAAT,QAA8B,aAA9B;AACA,SAASC,YAAT,QAA6B,qBAA7B;AAoBA,MAAMC,MAAM,GAAGF,aAAa,CAC1B,iBAAuE;AAAA,MAAtE;AAAEG,IAAAA,MAAF;AAAUC,IAAAA,KAAV;AAAiBC,IAAAA;AAAjB,GAAsE;AAAA,MAA1C;AAAEC,IAAAA,MAAF;AAAUC,IAAAA,KAAV;AAAiBC,IAAAA,OAAjB;AAA0BC,IAAAA;AAA1B,GAA0C;AACrE;AACA,QAAMC,gBAAgB,GAAGJ,MAAM,GAAGP,SAAS,CAACY,OAAb,GAAuBZ,SAAS,CAACa,OAAhE;AACA,QAAMC,IAAI,GAAGJ,SAAS,GAAGV,SAAS,CAACD,OAAO,CAACW,SAAD,CAAR,CAAZ,GAAmCC,gBAAzD;AACAP,EAAAA,MAAM,CAACW,SAAP,EACE;AACA;AACA;AACA;AACA;AACA,GACEP,KAAK,CAAC,CAAD,CAAL,CAASQ,GADX,EAEER,KAAK,CAAC,CAAD,CAAL,CAASS,EAFX,EAGET,KAAK,CAAC,CAAD,CAAL,CAASU,EAHX,EAIEV,KAAK,CAAC,CAAD,CAAL,CAASQ,GAJX,EAKER,KAAK,CAAC,CAAD,CAAL,CAASS,EALX,EAMET,KAAK,CAAC,CAAD,CAAL,CAASU,EANX,EAOEV,KAAK,CAAC,CAAD,CAAL,CAASQ,GAPX,EAQER,KAAK,CAAC,CAAD,CAAL,CAASS,EARX,EASET,KAAK,CAAC,CAAD,CAAL,CAASU,EATX,EAUEV,KAAK,CAAC,CAAD,CAAL,CAASQ,GAVX,EAWER,KAAK,CAAC,CAAD,CAAL,CAASS,EAXX,EAYET,KAAK,CAAC,CAAD,CAAL,CAASU,EAZX,CANF,EAoBEX,MAAM,GAAGA,MAAM,CAACY,GAAP,CAAYC,CAAD,IAAOlB,YAAY,CAACkB,CAAD,EAAId,OAAJ,CAA9B,CAAH,GAAiDe,SApBzD,EAqBEZ,OArBF,EAsBEK,IAtBF,EAuBET,KAvBF;AAyBD,CA9ByB,CAA5B;AAiCA,OAAO,MAAMiB,KAAK,GAAIC,KAAD,IAAsC;AACzD,sBAAO;AAAW,IAAA,MAAM,EAAEpB;AAAnB,KAA+BoB,KAA/B,EAAP;AACD,CAFM","sourcesContent":["import React from \"react\";\n\nimport type {\n CustomPaintProps,\n SkEnum,\n Vector,\n AnimatedProps,\n} from \"../../processors\";\nimport { enumKey } from \"../../processors\";\nimport type { SkPoint, Color } from \"../../../skia\";\nimport { BlendMode } from \"../../../skia\";\nimport { createDrawing } from \"../../nodes\";\nimport { processColor } from \"../../../skia/Color\";\n\nexport interface CubicBezierHandle {\n pos: Vector;\n c1: Vector;\n c2: Vector;\n}\n\nexport interface PatchProps extends CustomPaintProps {\n colors?: readonly Color[];\n patch: readonly [\n CubicBezierHandle,\n CubicBezierHandle,\n CubicBezierHandle,\n CubicBezierHandle\n ];\n texture?: readonly [SkPoint, SkPoint, SkPoint, SkPoint];\n blendMode?: SkEnum<typeof BlendMode>;\n}\n\nconst onDraw = createDrawing<PatchProps>(\n ({ canvas, paint, opacity }, { colors, patch, texture, blendMode }) => {\n // If the colors are provided, the default blendMode is set to dstOver, if not, the default is set to srcOver\n const defaultBlendMode = colors ? BlendMode.DstOver : BlendMode.SrcOver;\n const mode = blendMode ? BlendMode[enumKey(blendMode)] : defaultBlendMode;\n canvas.drawPatch(\n // Patch requires a path with the following constraints:\n // M tl\n // C c1 c2 br\n // C c1 c2 bl\n // C c1 c2 tl (the redundant point in the last command is removed)\n [\n patch[0].pos,\n patch[0].c2,\n patch[1].c1,\n patch[1].pos,\n patch[1].c2,\n patch[2].c1,\n patch[2].pos,\n patch[2].c2,\n patch[3].c1,\n patch[3].pos,\n patch[3].c2,\n patch[0].c1,\n ],\n colors ? colors.map((c) => processColor(c, opacity)) : undefined,\n texture,\n mode,\n paint\n );\n }\n);\n\nexport const Patch = (props: AnimatedProps<PatchProps>) => {\n return <skDrawing onDraw={onDraw} {...props} />;\n};\n"]}
1
+ {"version":3,"sources":["Patch.tsx"],"names":["React","enumKey","BlendMode","processColor","createDrawing","onDraw","canvas","paint","opacity","colors","patch","texture","blendMode","defaultBlendMode","DstOver","SrcOver","mode","drawPatch","pos","c2","c1","map","c","undefined","Patch","props"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAQA,SAASC,OAAT,QAAwB,kBAAxB;AAEA,SAASC,SAAT,EAAoBC,YAApB,QAAwC,eAAxC;AACA,SAASC,aAAT,QAA8B,aAA9B;AAoBA,MAAMC,MAAM,GAAGD,aAAa,CAC1B,iBAAuE;AAAA,MAAtE;AAAEE,IAAAA,MAAF;AAAUC,IAAAA,KAAV;AAAiBC,IAAAA;AAAjB,GAAsE;AAAA,MAA1C;AAAEC,IAAAA,MAAF;AAAUC,IAAAA,KAAV;AAAiBC,IAAAA,OAAjB;AAA0BC,IAAAA;AAA1B,GAA0C;AACrE;AACA,QAAMC,gBAAgB,GAAGJ,MAAM,GAAGP,SAAS,CAACY,OAAb,GAAuBZ,SAAS,CAACa,OAAhE;AACA,QAAMC,IAAI,GAAGJ,SAAS,GAAGV,SAAS,CAACD,OAAO,CAACW,SAAD,CAAR,CAAZ,GAAmCC,gBAAzD;AACAP,EAAAA,MAAM,CAACW,SAAP,EACE;AACA;AACA;AACA;AACA;AACA,GACEP,KAAK,CAAC,CAAD,CAAL,CAASQ,GADX,EAEER,KAAK,CAAC,CAAD,CAAL,CAASS,EAFX,EAGET,KAAK,CAAC,CAAD,CAAL,CAASU,EAHX,EAIEV,KAAK,CAAC,CAAD,CAAL,CAASQ,GAJX,EAKER,KAAK,CAAC,CAAD,CAAL,CAASS,EALX,EAMET,KAAK,CAAC,CAAD,CAAL,CAASU,EANX,EAOEV,KAAK,CAAC,CAAD,CAAL,CAASQ,GAPX,EAQER,KAAK,CAAC,CAAD,CAAL,CAASS,EARX,EASET,KAAK,CAAC,CAAD,CAAL,CAASU,EATX,EAUEV,KAAK,CAAC,CAAD,CAAL,CAASQ,GAVX,EAWER,KAAK,CAAC,CAAD,CAAL,CAASS,EAXX,EAYET,KAAK,CAAC,CAAD,CAAL,CAASU,EAZX,CANF,EAoBEX,MAAM,GAAGA,MAAM,CAACY,GAAP,CAAYC,CAAD,IAAOnB,YAAY,CAACmB,CAAD,EAAId,OAAJ,CAA9B,CAAH,GAAiDe,SApBzD,EAqBEZ,OArBF,EAsBEK,IAtBF,EAuBET,KAvBF;AAyBD,CA9ByB,CAA5B;AAiCA,OAAO,MAAMiB,KAAK,GAAIC,KAAD,IAAsC;AACzD,sBAAO;AAAW,IAAA,MAAM,EAAEpB;AAAnB,KAA+BoB,KAA/B,EAAP;AACD,CAFM","sourcesContent":["import React from \"react\";\n\nimport type {\n CustomPaintProps,\n SkEnum,\n Vector,\n AnimatedProps,\n} from \"../../processors\";\nimport { enumKey } from \"../../processors\";\nimport type { SkPoint, Color } from \"../../../skia\";\nimport { BlendMode, processColor } from \"../../../skia\";\nimport { createDrawing } from \"../../nodes\";\n\nexport interface CubicBezierHandle {\n pos: Vector;\n c1: Vector;\n c2: Vector;\n}\n\nexport interface PatchProps extends CustomPaintProps {\n colors?: readonly Color[];\n patch: readonly [\n CubicBezierHandle,\n CubicBezierHandle,\n CubicBezierHandle,\n CubicBezierHandle\n ];\n texture?: readonly [SkPoint, SkPoint, SkPoint, SkPoint];\n blendMode?: SkEnum<typeof BlendMode>;\n}\n\nconst onDraw = createDrawing<PatchProps>(\n ({ canvas, paint, opacity }, { colors, patch, texture, blendMode }) => {\n // If the colors are provided, the default blendMode is set to dstOver, if not, the default is set to srcOver\n const defaultBlendMode = colors ? BlendMode.DstOver : BlendMode.SrcOver;\n const mode = blendMode ? BlendMode[enumKey(blendMode)] : defaultBlendMode;\n canvas.drawPatch(\n // Patch requires a path with the following constraints:\n // M tl\n // C c1 c2 br\n // C c1 c2 bl\n // C c1 c2 tl (the redundant point in the last command is removed)\n [\n patch[0].pos,\n patch[0].c2,\n patch[1].c1,\n patch[1].pos,\n patch[1].c2,\n patch[2].c1,\n patch[2].pos,\n patch[2].c2,\n patch[3].c1,\n patch[3].pos,\n patch[3].c2,\n patch[0].c1,\n ],\n colors ? colors.map((c) => processColor(c, opacity)) : undefined,\n texture,\n mode,\n paint\n );\n }\n);\n\nexport const Patch = (props: AnimatedProps<PatchProps>) => {\n return <skDrawing onDraw={onDraw} {...props} />;\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["TextBlob.tsx"],"names":["React","createDrawing","onDraw","canvas","paint","blob","x","y","drawTextBlob","TextBlob","props","defaultProps"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAGA,SAASC,aAAT,QAA8B,qBAA9B;AASA,MAAMC,MAAM,GAAGD,aAAa,CAC1B,iBAAuC;AAAA,MAAtC;AAAEE,IAAAA,MAAF;AAAUC,IAAAA;AAAV,GAAsC;AAAA,MAAnB;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,CAAR;AAAWC,IAAAA;AAAX,GAAmB;AACrCJ,EAAAA,MAAM,CAACK,YAAP,CAAoBH,IAApB,EAA0BC,CAA1B,EAA6BC,CAA7B,EAAgCH,KAAhC;AACD,CAHyB,CAA5B;AAMA,OAAO,MAAMK,QAAQ,GAAIC,KAAD,IAAyC;AAC/D,sBAAO;AAAW,IAAA,MAAM,EAAER;AAAnB,KAA+BQ,KAA/B,EAAP;AACD,CAFM;AAIPD,QAAQ,CAACE,YAAT,GAAwB;AACtBL,EAAAA,CAAC,EAAE,CADmB;AAEtBC,EAAAA,CAAC,EAAE;AAFmB,CAAxB","sourcesContent":["import React from \"react\";\n\nimport type { CustomPaintProps, AnimatedProps } from \"../../processors\";\nimport { createDrawing } from \"../../nodes/Drawing\";\nimport type { SkTextBlob } from \"../../../skia/TextBlob\";\n\nexport interface TextBlobProps extends CustomPaintProps {\n blob: SkTextBlob;\n x: number;\n y: number;\n}\n\nconst onDraw = createDrawing<TextBlobProps>(\n ({ canvas, paint }, { blob, x, y }) => {\n canvas.drawTextBlob(blob, x, y, paint);\n }\n);\n\nexport const TextBlob = (props: AnimatedProps<TextBlobProps>) => {\n return <skDrawing onDraw={onDraw} {...props} />;\n};\n\nTextBlob.defaultProps = {\n x: 0,\n y: 0,\n};\n"]}
1
+ {"version":3,"sources":["TextBlob.tsx"],"names":["React","createDrawing","onDraw","canvas","paint","blob","x","y","drawTextBlob","TextBlob","props","defaultProps"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAGA,SAASC,aAAT,QAA8B,qBAA9B;AASA,MAAMC,MAAM,GAAGD,aAAa,CAC1B,iBAAuC;AAAA,MAAtC;AAAEE,IAAAA,MAAF;AAAUC,IAAAA;AAAV,GAAsC;AAAA,MAAnB;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,CAAR;AAAWC,IAAAA;AAAX,GAAmB;AACrCJ,EAAAA,MAAM,CAACK,YAAP,CAAoBH,IAApB,EAA0BC,CAA1B,EAA6BC,CAA7B,EAAgCH,KAAhC;AACD,CAHyB,CAA5B;AAMA,OAAO,MAAMK,QAAQ,GAAIC,KAAD,IAAyC;AAC/D,sBAAO;AAAW,IAAA,MAAM,EAAER;AAAnB,KAA+BQ,KAA/B,EAAP;AACD,CAFM;AAIPD,QAAQ,CAACE,YAAT,GAAwB;AACtBL,EAAAA,CAAC,EAAE,CADmB;AAEtBC,EAAAA,CAAC,EAAE;AAFmB,CAAxB","sourcesContent":["import React from \"react\";\n\nimport type { CustomPaintProps, AnimatedProps } from \"../../processors\";\nimport { createDrawing } from \"../../nodes/Drawing\";\nimport type { SkTextBlob } from \"../../../skia\";\n\nexport interface TextBlobProps extends CustomPaintProps {\n blob: SkTextBlob;\n x: number;\n y: number;\n}\n\nconst onDraw = createDrawing<TextBlobProps>(\n ({ canvas, paint }, { blob, x, y }) => {\n canvas.drawTextBlob(blob, x, y, paint);\n }\n);\n\nexport const TextBlob = (props: AnimatedProps<TextBlobProps>) => {\n return <skDrawing onDraw={onDraw} {...props} />;\n};\n\nTextBlob.defaultProps = {\n x: 0,\n y: 0,\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["TextPath.tsx"],"names":["React","createDrawing","Skia","processFont","onDraw","canvas","paint","fontMgr","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":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAGA,SAASC,aAAT,QAA8B,aAA9B;AAGA,SAASC,IAAT,QAAqB,oBAArB;AAEA,SAASC,WAAT,QAA4B,uBAA5B;AASA,MAAMC,MAAM,GAAGH,aAA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AACA;AACAhB,QAAAA,IAAI,GAAGA,IAAI,CAACsB,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,CAASpC,IAAI,CAACqC,OAAL,CAAaN,EAAb,EAAiBC,EAAjB,EAAqBE,SAArB,EAAgCC,SAAhC,CAAT;AACAX,IAAAA,IAAI,IAAIG,KAAK,GAAG,CAAhB;AACD;;AACD,QAAMW,IAAI,GAAGtC,IAAI,CAACuC,QAAL,CAAcC,eAAd,CAA8BlC,IAA9B,EAAoCa,GAApC,EAAyCL,IAAzC,CAAb;AACAX,EAAAA,MAAM,CAACsC,YAAP,CAAoBH,IAApB,EAA0B,CAA1B,EAA6B,CAA7B,EAAgClC,KAAhC;AACD,CA3CyB,CAA5B;AA8CA,OAAO,MAAMsC,QAAQ,GAAIC,KAAD,IAAyC;AAC/D,sBAAO;AAAW,IAAA,MAAM,EAAEzC;AAAnB,KAA+ByC,KAA/B,EAAP;AACD,CAFM;AAIPD,QAAQ,CAACE,YAAT,GAAwB;AACtBrC,EAAAA,aAAa,EAAE;AADO,CAAxB","sourcesContent":["import React from \"react\";\n\nimport type { CustomPaintProps, AnimatedProps } from \"../../processors\";\nimport { createDrawing } from \"../../nodes\";\nimport type { SkPath } from \"../../../skia/Path\";\nimport type { SkRSXform } from \"../../../skia/RSXform\";\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":["React","createDrawing","Skia","processFont","onDraw","canvas","paint","fontMgr","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":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAGA,SAASC,aAAT,QAA8B,aAA9B;AAEA,SAASC,IAAT,QAAqB,oBAArB;AAEA,SAASC,WAAT,QAA4B,uBAA5B;AASA,MAAMC,MAAM,GAAGH,aAAa,CAC1B,iBAGK;AAAA,MAFH;AAAEI,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,GACIT,IAAI,CAACW,IAAL,CAAUC,iBAAV,CAA4BH,OAA5B,CADJ,GAEIA,OAHN;;AAIA,MAAID,IAAI,KAAK,IAAb,EAAmB;AACjB,UAAM,IAAIK,KAAJ,CAAU,mBAAmBJ,OAA7B,CAAN;AACD;;AACD,QAAMK,IAAI,GAAGb,WAAW,CAACI,OAAD,EAAUK,OAAV,CAAxB;AACA,QAAMK,GAAG,GAAGD,IAAI,CAACE,WAAL,CAAiBV,IAAjB,CAAZ;AACA,QAAMW,MAAM,GAAGH,IAAI,CAACI,cAAL,CAAoBH,GAApB,EAAyBX,KAAzB,CAAf;AACA,QAAMe,GAAgB,GAAG,EAAzB;AACA,QAAMC,IAAI,GAAGpB,IAAI,CAACqB,kBAAL,CAAwBb,IAAxB,EAA8B,KAA9B,EAAqC,CAArC,CAAb;AACA,MAAIc,IAAI,GAAGF,IAAI,CAACG,IAAL,EAAX;AACA,MAAIC,IAAI,GAAGjB,aAAX;;AACA,OAAK,IAAIkB,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGnB,IAAI,CAACoB,MAAT,IAAmBJ,IAAnC,EAAyCG,CAAC,EAA1C,EAA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IPD,QAAQ,CAACE,YAAT,GAAwB;AACtBrC,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"]}
@@ -2,4 +2,5 @@ export * from "./Canvas";
2
2
  export * from "./components";
3
3
  export * from "./nodes";
4
4
  export * from "./useContextBridge";
5
+ export * from "./DependencyManager";
5
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAd;AACA,cAAc,cAAd;AACA,cAAc,SAAd;AACA,cAAc,oBAAd","sourcesContent":["export * from \"./Canvas\";\nexport * from \"./components\";\nexport * from \"./nodes\";\nexport * from \"./useContextBridge\";\n"]}
1
+ {"version":3,"sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAd;AACA,cAAc,cAAd;AACA,cAAc,SAAd;AACA,cAAc,oBAAd;AACA,cAAc,qBAAd","sourcesContent":["export * from \"./Canvas\";\nexport * from \"./components\";\nexport * from \"./nodes\";\nexport * from \"./useContextBridge\";\nexport * from \"./DependencyManager\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["Declaration.tsx"],"names":["useCallback","isAnimated","materialize","Node","createDeclaration","cb","useDeclaration","deps","isDeclarationNode","node","DeclarationNode","constructor","depMgr","onDeclare","props","memoizable","_props","draw","ctx","children","visit","obj"],"mappings":";;AACA,SAASA,WAAT,QAA4B,OAA5B;AAKA,SAASC,UAAT,EAAqBC,WAArB,QAAwC,eAAxC;AAGA,SAASC,IAAT,QAAqB,QAArB;AAUA,OAAO,MAAMC,iBAAiB,GAC5BC,EAD+B,IAEJA,EAFtB;AAIP,OAAO,MAAMC,cAAc,GAAG,CAC5BD,EAD4B,EAE5BE,IAF4B,KAI5B;AACAP,WAAW,CAACK,EAAD,EAAKE,IAAL,aAAKA,IAAL,cAAKA,IAAL,GAAa,EAAb,CALN;AAOP,OAAO,MAAMC,iBAAiB,GAC5BC,IAD+B,IAEMA,IAAI,YAAYC,eAFhD;AAQP,OAAO,MAAMA,eAAN,SAAiCP,IAAjC,CAAyC;AAG9CQ,EAAAA,WAAW,CACTC,MADS,EAETC,SAFS,EAGTC,KAHS,EAIT;AACA,UAAMF,MAAN,EAAcE,KAAd;;AADA;;AAEA,UAAMC,UAAN,GAAmB,CAACd,UAAU,CAACa,KAAD,CAA9B;AACA,SAAKD,SAAL,GAAiBA,SAAjB;AACD;;AAEQ,MAALC,KAAK,CAACA,KAAD,EAA0B;AACjC,SAAKC,UAAL,GAAkB,CAACd,UAAU,CAACa,KAAD,CAA7B;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,GAAGZ,WAAW,CAAC,KAAKY,KAAN,CAAzB;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 { SkJSIInstance } from \"../../skia/JsiInstance\";\nimport type { AnimatedProps } from \"../processors\";\nimport { isAnimated, materialize } from \"../processors\";\nimport type { DependencyManager } from \"../DependencyManager\";\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":["useCallback","isAnimated","materialize","Node","createDeclaration","cb","useDeclaration","deps","isDeclarationNode","node","DeclarationNode","constructor","depMgr","onDeclare","props","memoizable","_props","draw","ctx","children","visit","obj"],"mappings":";;AACA,SAASA,WAAT,QAA4B,OAA5B;AAIA,SAASC,UAAT,EAAqBC,WAArB,QAAwC,eAAxC;AAIA,SAASC,IAAT,QAAqB,QAArB;AAUA,OAAO,MAAMC,iBAAiB,GAC5BC,EAD+B,IAEJA,EAFtB;AAIP,OAAO,MAAMC,cAAc,GAAG,CAC5BD,EAD4B,EAE5BE,IAF4B,KAI5B;AACAP,WAAW,CAACK,EAAD,EAAKE,IAAL,aAAKA,IAAL,cAAKA,IAAL,GAAa,EAAb,CALN;AAOP,OAAO,MAAMC,iBAAiB,GAC5BC,IAD+B,IAEMA,IAAI,YAAYC,eAFhD;AAQP,OAAO,MAAMA,eAAN,SAAiCP,IAAjC,CAAyC;AAG9CQ,EAAAA,WAAW,CACTC,MADS,EAETC,SAFS,EAGTC,KAHS,EAIT;AACA,UAAMF,MAAN,EAAcE,KAAd;;AADA;;AAEA,UAAMC,UAAN,GAAmB,CAACd,UAAU,CAACa,KAAD,CAA9B;AACA,SAAKD,SAAL,GAAiBA,SAAjB;AACD;;AAEQ,MAALC,KAAK,CAACA,KAAD,EAA0B;AACjC,SAAKC,UAAL,GAAkB,CAACd,UAAU,CAACa,KAAD,CAA7B;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,GAAGZ,WAAW,CAAC,KAAKY,KAAN,CAAzB;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 +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":";;AAKA,WAAYA,QAAZ;;WAAYA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;GAAAA,Q,KAAAA,Q;;AAOZ,OAAO,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/JsiInstance\";\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":";;AAKA,WAAYA,QAAZ;;WAAYA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;GAAAA,Q,KAAAA,Q;;AAOZ,OAAO,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 +1 @@
1
- {"version":3,"sources":["Animations.ts"],"names":["mapKeys","isValue","value","undefined","__typename__","isAnimated","props","Object","values","materialize","result","forEach","key","current"],"mappings":"AAEA,SAASA,OAAT,QAAwB,iBAAxB;AAIA,OAAO,MAAMC,OAAO,GAClBC,KADqB,IAEmB;AACxC,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,CAAiDE,YAAjD,KACE,WAJJ,EAKE;AACA,aAAO,IAAP;AACD;AACF,GATD,CASE,MAAM,CAAE;;AACV,SAAO,KAAP;AACD,CAjBM;AAmBP,OAAO,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;AASP,OAAO,MAAMO,WAAW,GAAOH,KAAJ,IAAgC;AACzD,QAAMI,MAAM,GAAG,EAAE,GAAGJ;AAAL,GAAf;AACAN,EAAAA,OAAO,CAACM,KAAD,CAAP,CAAeK,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,CAA4CW,OAA1D;AACD;AACF,GALD;AAMA,SAAOH,MAAP;AACD,CATM","sourcesContent":["import type { SkiaReadonlyValue } from \"../../../values\";\nimport type { DrawingContext } from \"../../DrawingContext\";\nimport { mapKeys } from \"../../typeddash\";\n\nexport type FrameValue<T> = (ctx: DrawingContext) => T;\n\nexport const isValue = (\n value: unknown\n): value is SkiaReadonlyValue<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 SkiaReadonlyValue<unknown>).__typename__ ===\n \"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 SkiaReadonlyValue<T[typeof key]>).current;\n }\n });\n return result as T;\n};\n\nexport type AnimatedProps<T> = {\n [K in keyof T]: T[K] | SkiaReadonlyValue<T[K]>;\n};\n"]}
1
+ {"version":3,"sources":["Animations.ts"],"names":["mapKeys","isValue","value","undefined","__typename__","isAnimated","props","Object","values","materialize","result","forEach","key","current"],"mappings":"AAEA,SAASA,OAAT,QAAwB,iBAAxB;AAIA,OAAO,MAAMC,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;AAgBP,OAAO,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;AASP,OAAO,MAAMO,WAAW,GAAOH,KAAJ,IAAgC;AACzD,QAAMI,MAAM,GAAG,EAAE,GAAGJ;AAAL,GAAf;AACAN,EAAAA,OAAO,CAACM,KAAD,CAAP,CAAeK,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 +1 @@
1
- {"version":3,"sources":["Clips.ts"],"names":["processPath","isPathDef","isRRect","processClip","canvas","def","op","path","clipPath","clipRRect","clipRect"],"mappings":"AAIA,SAASA,WAAT,EAAsBC,SAAtB,QAAuC,SAAvC;AACA,SAASC,OAAT,QAAwB,SAAxB;AAIA,OAAO,MAAMC,WAAW,GAAG,CAACC,MAAD,EAAmBC,GAAnB,EAAiCC,EAAjC,KAAgD;AACzE,MAAIL,SAAS,CAACI,GAAD,CAAb,EAAoB;AAClB,UAAME,IAAI,GAAGP,WAAW,CAACK,GAAD,CAAxB;AACAD,IAAAA,MAAM,CAACI,QAAP,CAAgBD,IAAhB,EAAsBD,EAAtB,EAA0B,IAA1B;AACD,GAHD,MAGO,IAAIJ,OAAO,CAACG,GAAD,CAAX,EAAkB;AACvBD,IAAAA,MAAM,CAACK,SAAP,CAAiBJ,GAAjB,EAAsBC,EAAtB,EAA0B,IAA1B;AACD,GAFM,MAEA;AACLF,IAAAA,MAAM,CAACM,QAAP,CAAgBL,GAAhB,EAAqBC,EAArB,EAAyB,IAAzB;AACD;AACF,CATM","sourcesContent":["import type { SkCanvas, ClipOp } from \"../../skia/Canvas\";\nimport type { 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":["processPath","isPathDef","isRRect","processClip","canvas","def","op","path","clipPath","clipRRect","clipRect"],"mappings":"AAGA,SAASA,WAAT,EAAsBC,SAAtB,QAAuC,SAAvC;AACA,SAASC,OAAT,QAAwB,SAAxB;AAIA,OAAO,MAAMC,WAAW,GAAG,CAACC,MAAD,EAAmBC,GAAnB,EAAiCC,EAAjC,KAAgD;AACzE,MAAIL,SAAS,CAACI,GAAD,CAAb,EAAoB;AAClB,UAAME,IAAI,GAAGP,WAAW,CAACK,GAAD,CAAxB;AACAD,IAAAA,MAAM,CAACI,QAAP,CAAgBD,IAAhB,EAAsBD,EAAtB,EAA0B,IAA1B;AACD,GAHD,MAGO,IAAIJ,OAAO,CAACG,GAAD,CAAX,EAAkB;AACvBD,IAAAA,MAAM,CAACK,SAAP,CAAiBJ,GAAjB,EAAsBC,EAAtB,EAA0B,IAA1B;AACD,GAFM,MAEA;AACLF,IAAAA,MAAM,CAACM,QAAP,CAAgBL,GAAhB,EAAqBC,EAArB,EAAyB,IAAzB;AACD;AACF,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 +1 @@
1
- {"version":3,"sources":["Font.ts"],"names":["Skia","isFont","fontDef","font","undefined","processFont","fontMgr","selectedFont","familyName","size","typeface","matchFamilyStyle","Error","Font"],"mappings":"AACA,SAASA,IAAT,QAAqB,iBAArB;AAKA,OAAO,MAAMC,MAAM,GAAIC,OAAD,IACpB;AACA;AACCA,OAAD,CAAiBC,IAAjB,KAA0BC,SAHrB;AAKP,OAAO,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,GAAGP,IAAI,CAACa,IAAL,CAAUH,QAAV,EAAoBD,IAApB,CAAf;AACD;;AACD,SAAOF,YAAP;AACD,CAbM","sourcesContent":["import type { SkFont } from \"../../skia\";\nimport { Skia } from \"../../skia/Skia\";\nimport type { FontMgr } from \"../../skia/FontMgr/FontMgr\";\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":["Skia","isFont","fontDef","font","undefined","processFont","fontMgr","selectedFont","familyName","size","typeface","matchFamilyStyle","Error","Font"],"mappings":"AACA,SAASA,IAAT,QAAqB,iBAArB;AAIA,OAAO,MAAMC,MAAM,GAAIC,OAAD,IACpB;AACA;AACCA,OAAD,CAAiBC,IAAjB,KAA0BC,SAHrB;AAKP,OAAO,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,GAAGP,IAAI,CAACa,IAAL,CAAUH,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"]}
@@ -12,6 +12,7 @@ export const bounds = rects => {
12
12
  const height = Math.max(...rects.map(r => r.y + r.height));
13
13
  return rect(x, y, width, height);
14
14
  };
15
+ export const isEdge = (pos, b) => pos.x === b.x || pos.y === b.y || pos.x === b.width || pos.y === b.height;
15
16
  export const topLeft = r => isRRect(r) ? vec(r.rect.x, r.rect.y) : vec(r.x, r.y);
16
17
  export const topRight = r => isRRect(r) ? vec(r.rect.x + r.rect.width, r.rect.y) : vec(r.x + r.width, r.y);
17
18
  export const bottomLeft = r => isRRect(r) ? vec(r.rect.x, r.rect.y + r.rect.height) : vec(r.x, r.y + r.height);
@@ -1 +1 @@
1
- {"version":3,"sources":["Rects.ts"],"names":["Skia","vec","processRadius","point","x","y","Point","rect","width","height","XYWHRect","rrect","r","rx","ry","RRectXY","bounds","rects","Math","min","map","max","topLeft","isRRect","topRight","bottomLeft","bottomRight","center","isRRectCtor","def","undefined","isRectCtor","processRect","processRRect"],"mappings":"AAAA;AAEA,SAASA,IAAT,QAAqB,YAArB;AAEA,S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AAL,EAA4CG,CAAC,CAACR,CAA9C,EAAiDQ,CAAC,CAACP,CAAnD,CAAZ;AACD,GAHD,MAGO;AACL,WAAOwB,GAAG,CAACtB,IAAX;AACD;AACF,CAPM","sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { SkRect, SkRRect } from \"../../skia\";\nimport { Skia } from \"../../skia\";\n\nimport { vec } from \"./math/Vector\";\nimport type { Radius } from \"./Radius\";\nimport { processRadius } from \"./Radius\";\n\nexport const point = (x: number, y: number) => Skia.Point(x, y);\n\nexport const rect = (x: number, y: number, width: number, height: number) =>\n Skia.XYWHRect(x, y, width, height);\n\nexport const rrect = (r: SkRect, rx: number, ry: number) =>\n Skia.RRectXY(r, rx, ry);\n\nexport const bounds = (rects: SkRect[]) => {\n const x = Math.min(...rects.map((r) => r.x));\n const y = Math.min(...rects.map((r) => r.y));\n const width = Math.max(...rects.map((r) => r.x + r.width));\n const height = Math.max(...rects.map((r) => r.y + r.height));\n return rect(x, y, width, height);\n};\n\nexport const topLeft = (r: SkRect | SkRRect) =>\n isRRect(r) ? vec(r.rect.x, r.rect.y) : vec(r.x, r.y);\nexport const topRight = (r: SkRect | SkRRect) =>\n isRRect(r) ? vec(r.rect.x + r.rect.width, r.rect.y) : vec(r.x + r.width, r.y);\nexport const bottomLeft = (r: SkRect | SkRRect) =>\n isRRect(r)\n ? vec(r.rect.x, r.rect.y + r.rect.height)\n : vec(r.x, r.y + r.height);\nexport const bottomRight = (r: SkRect | SkRRect) =>\n isRRect(r)\n ? vec(r.rect.x + r.rect.width, r.rect.y + r.rect.height)\n : vec(r.x + r.width, r.y + r.height);\nexport const center = (r: SkRect | SkRRect) =>\n isRRect(r)\n ? vec(r.rect.x + r.rect.width / 2, r.rect.y + r.rect.height / 2)\n : vec(r.x + r.width / 2, r.y + r.height / 2);\n\n// We have an issue to check property existence on JSI backed instances\nconst isRRectCtor = (def: RRectDef): def is RRectCtor =>\n (def as any).rect === undefined;\n// We have an issue to check property existence on JSI backed instances\nconst isRectCtor = (def: RectDef): def is RectCtor =>\n (def as any).rect === undefined;\n// We have an issue to check property existence on JSI backed instances\nexport const isRRect = (def: SkRect | SkRRect): def is SkRRect =>\n (def as any).rect !== undefined;\n\nexport interface RectCtor {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\nexport interface RRectCtor extends RectCtor {\n r: Radius;\n}\n\nexport type RectDef = RectCtor | { rect: SkRect };\nexport type RRectDef = RRectCtor | { rect: SkRRect };\n\nexport const processRect = (def: RectDef) => {\n if (isRectCtor(def)) {\n return rect(def.x, def.y, def.width, def.height);\n } else {\n return def.rect;\n }\n};\n\nexport const processRRect = (def: RRectDef) => {\n if (isRRectCtor(def)) {\n const r = processRadius(def.r);\n return rrect(rect(def.x, def.y, def.width, def.height), r.x, r.y);\n } else {\n return def.rect;\n }\n};\n"]}
1
+ {"version":3,"sources":["Rects.ts"],"names":["Skia","vec","processRadius","point","x","y","Point","rect","width","height","XYWHRect","rrect","r","rx","ry","RRectXY","bounds","rects","Math","min","map","max","isEdge","pos","b","topLeft","isRRect","topRight","bottomLeft","bottomRight","center","isRRectCtor","def","undefined","isRectCtor","processRect","processRRect"],"mappings":"AAAA;AAEA,SAASA,IAAT,QAAqB,YAArB;AAGA,SAASC,GAAT,QAAoB,eAApB;AAEA,SAASC,aAAT,QAA8B,UAA9B;AAEA,OAAO,MAAMC,KAAK,GAAG,CAACC,CAAD,EAAYC,CAAZ,KAA0BL,IAAI,CAACM,KAAL,CAAWF,CAAX,EAAcC,CAAd,CAAxC;AAEP,OAAO,MAAME,IAAI,GAAG,CAACH,CAAD,EAAYC,CAAZ,EAAuBG,KAAvB,EAAsCC,MAAtC,KAClBT,IAAI,CAACU,QAAL,CAAcN,CAAd,EAAiBC,CAAjB,EAAoBG,KAApB,EAA2BC,MAA3B,CADK;AAGP,OAAO,MAAME,KAAK,GAAG,CAACC,CAAD,EAAYC,EAAZ,EAAwBC,EAAxB,KACnBd,IAAI,CAACe,OAAL,CAAaH,CA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ript-eslint/no-explicit-any */\nimport type { SkRect, SkRRect } from \"../../skia\";\nimport { Skia } from \"../../skia\";\n\nimport type { Vector } from \"./math/Vector\";\nimport { vec } from \"./math/Vector\";\nimport type { Radius } from \"./Radius\";\nimport { processRadius } from \"./Radius\";\n\nexport const point = (x: number, y: number) => Skia.Point(x, y);\n\nexport const rect = (x: number, y: number, width: number, height: number) =>\n Skia.XYWHRect(x, y, width, height);\n\nexport const rrect = (r: SkRect, rx: number, ry: number) =>\n Skia.RRectXY(r, rx, ry);\n\nexport const bounds = (rects: SkRect[]) => {\n const x = Math.min(...rects.map((r) => r.x));\n const y = Math.min(...rects.map((r) => r.y));\n const width = Math.max(...rects.map((r) => r.x + r.width));\n const height = Math.max(...rects.map((r) => r.y + r.height));\n return rect(x, y, width, height);\n};\n\nexport const isEdge = (pos: Vector, b: SkRect) =>\n pos.x === b.x || pos.y === b.y || pos.x === b.width || pos.y === b.height;\n\nexport const topLeft = (r: SkRect | SkRRect) =>\n isRRect(r) ? vec(r.rect.x, r.rect.y) : vec(r.x, r.y);\nexport const topRight = (r: SkRect | SkRRect) =>\n isRRect(r) ? vec(r.rect.x + r.rect.width, r.rect.y) : vec(r.x + r.width, r.y);\nexport const bottomLeft = (r: SkRect | SkRRect) =>\n isRRect(r)\n ? vec(r.rect.x, r.rect.y + r.rect.height)\n : vec(r.x, r.y + r.height);\nexport const bottomRight = (r: SkRect | SkRRect) =>\n isRRect(r)\n ? vec(r.rect.x + r.rect.width, r.rect.y + r.rect.height)\n : vec(r.x + r.width, r.y + r.height);\nexport const center = (r: SkRect | SkRRect) =>\n isRRect(r)\n ? vec(r.rect.x + r.rect.width / 2, r.rect.y + r.rect.height / 2)\n : vec(r.x + r.width / 2, r.y + r.height / 2);\n\n// We have an issue to check property existence on JSI backed instances\nconst isRRectCtor = (def: RRectDef): def is RRectCtor =>\n (def as any).rect === undefined;\n// We have an issue to check property existence on JSI backed instances\nconst isRectCtor = (def: RectDef): def is RectCtor =>\n (def as any).rect === undefined;\n// We have an issue to check property existence on JSI backed instances\nexport const isRRect = (def: SkRect | SkRRect): def is SkRRect =>\n (def as any).rect !== undefined;\n\nexport interface RectCtor {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\nexport interface RRectCtor extends RectCtor {\n r: Radius;\n}\n\nexport type RectDef = RectCtor | { rect: SkRect };\nexport type RRectDef = RRectCtor | { rect: SkRRect };\n\nexport const processRect = (def: RectDef) => {\n if (isRectCtor(def)) {\n return rect(def.x, def.y, def.width, def.height);\n } else {\n return def.rect;\n }\n};\n\nexport const processRRect = (def: RRectDef) => {\n if (isRRectCtor(def)) {\n const r = processRadius(def.r);\n return rrect(rect(def.x, def.y, def.width, def.height), r.x, r.y);\n } else {\n return def.rect;\n }\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["Transform.ts"],"names":["neg","processTransform2d","processTransform","canvas","transform","origin","matrix","concat","m3","transformOrigin","localMatrix","undefined","translate","a","translateX","x","translateY","y"],"mappings":"AAGA,SAASA,GAAT,EAAcC,kBAAd,QAAwC,QAAxC;AASA,OAAO,MAAMC,gBAAgB,GAAG,iBAG3B;AAAA,MAFH;AAAEC,IAAAA;AAAF,GAEG;AAAA,MADH;AAAEC,IAAAA,SAAF;AAAaC,IAAAA,MAAb;AAAqBC,IAAAA;AAArB,GACG;;AACH,MAAIF,SAAJ,EAAe;AACb,QAAIE,MAAJ,EAAY;AACVH,MAAAA,MAAM,CAACI,MAAP,CAAcD,MAAd;AACD,KAFD,MAEO;AACL,YAAME,EAAE,GAAGP,kBAAkB,CAC3BI,MAAM,GAAGI,eAAe,CAACJ,MAAD,EAASD,SAAT,CAAlB,GAAwCA,SADnB,CAA7B;AAGAD,MAAAA,MAAM,CAACI,MAAP,CAAcC,EAAd;AACD;AACF;AACF,CAdM;AAgBP,OAAO,MAAME,WAAW,GAAG,SAA2C;AAAA,MAA1C;AAAEN,IAAAA,SAAF;AAAaC,IAAAA;AAAb,GAA0C;;AACpE,MAAID,SAAJ,EAAe;AACb,WAAOH,kBAAkB,CACvBI,MAAM,GAAGI,eAAe,CAACJ,MAAD,EAASD,SAAT,CAAlB,GAAwCA,SADvB,CAAzB;AAGD;;AACD,SAAOO,SAAP;AACD,CAPM;;AASP,MAAMC,SAAS,GAAIC,CAAD,IAAe,CAAC;AAAEC,EAAAA,UAAU,EAAED,CAAC,CAACE;AAAhB,CAAD,EAAsB;AAAEC,EAAAA,UAAU,EAAEH,CAAC,CAACI;AAAhB,CAAtB,CAAjC;;AAEA,OAAO,MAAMR,eAAe,GAAG,CAACJ,MAAD,EAAiBD,SAAjB,KAA6C,CAC1E,GAAGQ,SAAS,CAACP,MAAD,CAD8D,EAE1E,GAAGD,SAFuE,EAG1E,GAAGQ,SAAS,CAACZ,GAAG,CAACK,MAAD,CAAJ,CAH8D,CAArE","sourcesContent":["import type { DrawingContext } from \"../DrawingContext\";\nimport type { SkMatrix } from \"../../skia/Matrix\";\n\nimport { neg, processTransform2d } from \"./math\";\nimport type { Transforms2d, Vector } from \"./math\";\n\nexport interface TransformProps {\n transform?: Transforms2d;\n origin?: Vector;\n matrix?: SkMatrix;\n}\n\nexport const processTransform = (\n { canvas }: DrawingContext,\n { transform, origin, matrix }: TransformProps\n) => {\n if (transform) {\n if (matrix) {\n canvas.concat(matrix);\n } else {\n const m3 = processTransform2d(\n origin ? transformOrigin(origin, transform) : transform\n );\n canvas.concat(m3);\n }\n }\n};\n\nexport const localMatrix = ({ transform, origin }: TransformProps) => {\n if (transform) {\n return processTransform2d(\n origin ? transformOrigin(origin, transform) : transform\n );\n }\n return undefined;\n};\n\nconst translate = (a: Vector) => [{ translateX: a.x }, { translateY: a.y }];\n\nexport const transformOrigin = (origin: Vector, transform: Transforms2d) => [\n ...translate(origin),\n ...transform,\n ...translate(neg(origin)),\n];\n"]}
1
+ {"version":3,"sources":["Transform.ts"],"names":["neg","processTransform2d","processTransform","canvas","transform","origin","matrix","concat","m3","transformOrigin","localMatrix","undefined","translate","a","translateX","x","translateY","y"],"mappings":"AAGA,SAASA,GAAT,EAAcC,kBAAd,QAAwC,QAAxC;AASA,OAAO,MAAMC,gBAAgB,GAAG,iBAG3B;AAAA,MAFH;AAAEC,IAAAA;AAAF,GAEG;AAAA,MADH;AAAEC,IAAAA,SAAF;AAAaC,IAAAA,MAAb;AAAqBC,IAAAA;AAArB,GACG;;AACH,MAAIF,SAAJ,EAAe;AACb,QAAIE,MAAJ,EAAY;AACVH,MAAAA,MAAM,CAACI,MAAP,CAAcD,MAAd;AACD,KAFD,MAEO;AACL,YAAME,EAAE,GAAGP,kBAAkB,CAC3BI,MAAM,GAAGI,eAAe,CAACJ,MAAD,EAASD,SAAT,CAAlB,GAAwCA,SADnB,CAA7B;AAGAD,MAAAA,MAAM,CAACI,MAAP,CAAcC,EAAd;AACD;AACF;AACF,CAdM;AAgBP,OAAO,MAAME,WAAW,GAAG,SAA2C;AAAA,MAA1C;AAAEN,IAAAA,SAAF;AAAaC,IAAAA;AAAb,GAA0C;;AACpE,MAAID,SAAJ,EAAe;AACb,WAAOH,kBAAkB,CACvBI,MAAM,GAAGI,eAAe,CAACJ,MAAD,EAASD,SAAT,CAAlB,GAAwCA,SADvB,CAAzB;AAGD;;AACD,SAAOO,SAAP;AACD,CAPM;;AASP,MAAMC,SAAS,GAAIC,CAAD,IAAe,CAAC;AAAEC,EAAAA,UAAU,EAAED,CAAC,CAACE;AAAhB,CAAD,EAAsB;AAAEC,EAAAA,UAAU,EAAEH,CAAC,CAACI;AAAhB,CAAtB,CAAjC;;AAEA,OAAO,MAAMR,eAAe,GAAG,CAACJ,MAAD,EAAiBD,SAAjB,KAA6C,CAC1E,GAAGQ,SAAS,CAACP,MAAD,CAD8D,EAE1E,GAAGD,SAFuE,EAG1E,GAAGQ,SAAS,CAACZ,GAAG,CAACK,MAAD,CAAJ,CAH8D,CAArE","sourcesContent":["import type { DrawingContext } from \"../DrawingContext\";\nimport type { SkMatrix } from \"../../skia/types\";\n\nimport { neg, processTransform2d } from \"./math\";\nimport type { Transforms2d, Vector } from \"./math\";\n\nexport interface TransformProps {\n transform?: Transforms2d;\n origin?: Vector;\n matrix?: SkMatrix;\n}\n\nexport const processTransform = (\n { canvas }: DrawingContext,\n { transform, origin, matrix }: TransformProps\n) => {\n if (transform) {\n if (matrix) {\n canvas.concat(matrix);\n } else {\n const m3 = processTransform2d(\n origin ? transformOrigin(origin, transform) : transform\n );\n canvas.concat(m3);\n }\n }\n};\n\nexport const localMatrix = ({ transform, origin }: TransformProps) => {\n if (transform) {\n return processTransform2d(\n origin ? transformOrigin(origin, transform) : transform\n );\n }\n return undefined;\n};\n\nconst translate = (a: Vector) => [{ translateX: a.x }, { translateY: a.y }];\n\nexport const transformOrigin = (origin: Vector, transform: Transforms2d) => [\n ...translate(origin),\n ...transform,\n ...translate(neg(origin)),\n];\n"]}
@@ -1,40 +1,7 @@
1
1
  /*global SkiaApi*/
2
- import "./NativeSetup";
3
2
 
4
3
  /**
5
- * Declares the implemented API with overrides.
4
+ * Declares the SkiaApi as an available object in the global scope
6
5
  */
7
- export const Skia = {
8
- // Factories
9
- Typeface: SkiaApi.Typeface,
10
- MaskFilter: SkiaApi.MaskFilter,
11
- RuntimeEffect: SkiaApi.RuntimeEffect,
12
- Shader: SkiaApi.Shader,
13
- ImageFilter: SkiaApi.ImageFilter,
14
- PathEffect: SkiaApi.PathEffect,
15
- Data: SkiaApi.Data,
16
- SVG: SkiaApi.SVG,
17
- FontMgr: SkiaApi.FontMgr,
18
- TextBlob: SkiaApi.TextBlob,
19
- // Constructors
20
- Matrix: SkiaApi.Matrix,
21
- Font: SkiaApi.Font,
22
- Point: SkiaApi.Point,
23
- XYWHRect: SkiaApi.XYWHRect,
24
- RRectXY: SkiaApi.RRectXY,
25
- RuntimeShaderBuilder: SkiaApi.RuntimeShaderBuilder,
26
- Paint: SkiaApi.Paint,
27
- PictureRecorder: SkiaApi.PictureRecorder,
28
- Picture: SkiaApi.Picture,
29
- Path: SkiaApi.Path,
30
- ColorFilter: SkiaApi.ColorFilter,
31
- ContourMeasureIter: SkiaApi.ContourMeasureIter,
32
- Color: SkiaApi.Color,
33
- RSXform: SkiaApi.RSXform,
34
- // For the following methods the factory symmetry is broken to be comptatible with CanvasKit
35
- MakeSurface: SkiaApi.Surface.Make,
36
- MakeImageFromEncoded: SkiaApi.Image.MakeImageFromEncoded,
37
- MakeImage: SkiaApi.Image.MakeImage,
38
- MakeVertices: SkiaApi.MakeVertices
39
- };
6
+ export const Skia = SkiaApi;
40
7
  //# sourceMappingURL=Skia.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["Skia.ts"],"names":["Skia","Typeface","SkiaApi","MaskFilter","RuntimeEffect","Shader","ImageFilter","PathEffect","Data","SVG","FontMgr","TextBlob","Matrix","Font","Point","XYWHRect","RRectXY","RuntimeShaderBuilder","Paint","PictureRecorder","Picture","Path","ColorFilter","ContourMeasureIter","Color","RSXform","MakeSurface","Surface","Make","MakeImageFromEncoded","Image","MakeImage","MakeVertices"],"mappings":"AAAA;AACA,OAAO,eAAP;;AAUA;AACA;AACA;AACA,OAAO,MAAMA,IAAI,GAAG;AAClB;AACAC,EAAAA,QAAQ,EAAEC,OAAO,CAACD,QAFA;AAGlBE,EAAAA,UAAU,EAAED,OAAO,CAACC,UAHF;AAIlBC,EAAAA,aAAa,EAAEF,OAAO,CAACE,aAJL;AAKlBC,EAAAA,MAAM,EAAEH,OAAO,CAACG,MALE;AAMlBC,EAAAA,WAAW,EAAEJ,OAAO,CAACI,WANH;AAOlBC,EAAAA,UAAU,EAAEL,OAAO,CAACK,UAPF;AAQlBC,EAAAA,IAAI,EAAEN,OAAO,CAACM,IARI;AASlBC,EAAAA,GAAG,EAAEP,OAAO,CAACO,GATK;AAUlBC,EAAAA,OAAO,EAAER,OAAO,CAACQ,OAVC;AAWlBC,EAAAA,QAAQ,EAAET,OAAO,CAACS,QAXA;AAYlB;AACAC,EAAAA,MAAM,EAAEV,OAAO,CAACU,MAbE;AAclBC,EAAAA,IAAI,EAAEX,OAAO,CAACW,IAdI;AAelBC,EAAAA,KAAK,EAAEZ,OAAO,CAACY,KAfG;AAgBlBC,EAAAA,QAAQ,EAAEb,OAAO,CAACa,QAhBA;AAiBlBC,EAAAA,OAAO,EAAEd,OAAO,CAACc,OAjBC;AAkBlBC,EAAAA,oBAAoB,EAAEf,OAAO,CAACe,oBAlBZ;AAmBlBC,EAAAA,KAAK,EAAEhB,OAAO,CAACgB,KAnBG;AAoBlBC,EAAAA,eAAe,EAAEjB,OAAO,CAACiB,eApBP;AAqBlBC,EAAAA,OAAO,EAAElB,OAAO,CAACkB,OArBC;AAsBlBC,EAAAA,IAAI,EAAEnB,OAAO,CAACmB,IAtBI;AAuBlBC,EAAAA,WAAW,EAAEpB,OAAO,CAACoB,WAvBH;AAwBlBC,EAAAA,kBAAkB,EAAErB,OAAO,CAACqB,kBAxBV;AAyBlBC,EAAAA,KAAK,EAAEtB,OAAO,CAACsB,KAzBG;AA0BlBC,EAAAA,OAAO,EAAEvB,OAAO,CAACuB,OA1BC;AA2BlB;AACAC,EAAAA,WAAW,EAAExB,OAAO,CAACyB,OAAR,CAAgBC,IA5BX;AA6BlBC,EAAAA,oBAAoB,EAAE3B,OAAO,CAAC4B,KAAR,CAAcD,oBA7BlB;AA8BlBE,EAAAA,SAAS,EAAE7B,OAAO,CAAC4B,KAAR,CAAcC,SA9BP;AA+BlBC,EAAAA,YAAY,EAAE9B,OAAO,CAAC8B;AA/BJ,CAAb","sourcesContent":["/*global SkiaApi*/\nimport \"./NativeSetup\";\nimport type { SkiaApi as SkSkiaApi } from \"./SkiaApi\";\n\n/**\n * Declares the SkiaApi as an available object in the global scope\n */\ndeclare global {\n var SkiaApi: SkSkiaApi;\n}\n\n/**\n * Declares the implemented API with overrides.\n */\nexport const Skia = {\n // Factories\n Typeface: SkiaApi.Typeface,\n MaskFilter: SkiaApi.MaskFilter,\n RuntimeEffect: SkiaApi.RuntimeEffect,\n Shader: SkiaApi.Shader,\n ImageFilter: SkiaApi.ImageFilter,\n PathEffect: SkiaApi.PathEffect,\n Data: SkiaApi.Data,\n SVG: SkiaApi.SVG,\n FontMgr: SkiaApi.FontMgr,\n TextBlob: SkiaApi.TextBlob,\n // Constructors\n Matrix: SkiaApi.Matrix,\n Font: SkiaApi.Font,\n Point: SkiaApi.Point,\n XYWHRect: SkiaApi.XYWHRect,\n RRectXY: SkiaApi.RRectXY,\n RuntimeShaderBuilder: SkiaApi.RuntimeShaderBuilder,\n Paint: SkiaApi.Paint,\n PictureRecorder: SkiaApi.PictureRecorder,\n Picture: SkiaApi.Picture,\n Path: SkiaApi.Path,\n ColorFilter: SkiaApi.ColorFilter,\n ContourMeasureIter: SkiaApi.ContourMeasureIter,\n Color: SkiaApi.Color,\n RSXform: SkiaApi.RSXform,\n // For the following methods the factory symmetry is broken to be comptatible with CanvasKit\n MakeSurface: SkiaApi.Surface.Make,\n MakeImageFromEncoded: SkiaApi.Image.MakeImageFromEncoded,\n MakeImage: SkiaApi.Image.MakeImage,\n MakeVertices: SkiaApi.MakeVertices,\n};\n"]}
1
+ {"version":3,"sources":["Skia.ts"],"names":["Skia","SkiaApi"],"mappings":"AAAA;;AAGA;AACA;AACA;AAKA,OAAO,MAAMA,IAAI,GAAGC,OAAb","sourcesContent":["/*global SkiaApi*/\nimport type { Skia as SkSkiaApi } from \"./types\";\n\n/**\n * Declares the SkiaApi as an available object in the global scope\n */\ndeclare global {\n var SkiaApi: SkSkiaApi;\n}\n\nexport const Skia = SkiaApi;\n"]}
@@ -1,5 +1,4 @@
1
- import { Skia } from "./Skia"; // This is the JSI color
2
-
1
+ import { Skia } from "../Skia";
3
2
  export const RED = 0;
4
3
  export const GREEN = 1;
5
4
  export const BLUE = 2;
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["Color.ts"],"names":["Skia","RED","GREEN","BLUE","ALPHA","rgbaColor","r","g","b","a","Float32Array","processColor","cl","currentOpacity","color","Color"],"mappings":"AAAA,SAASA,IAAT,QAAqB,SAArB;AAGA,OAAO,MAAMC,GAAG,GAAG,CAAZ;AACP,OAAO,MAAMC,KAAK,GAAG,CAAd;AACP,OAAO,MAAMC,IAAI,GAAG,CAAb;AACP,OAAO,MAAMC,KAAK,GAAG,CAAd;AAEP,OAAO,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;AAGP,OAAO,MAAME,YAAY,GAAG,CAACC,EAAD,EAAYC,cAAZ,KAAuC;AACjE,QAAMC,KAAK,GAAGd,IAAI,CAACe,KAAL,CAAWH,EAAX,CAAd;AACAE,EAAAA,KAAK,CAACV,KAAD,CAAL,IAAgBS,cAAhB;AACA,SAAOC,KAAP;AACD,CAJM","sourcesContent":["import { Skia } from \"../Skia\";\nimport type { Color } from \"../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 = (cl: Color, currentOpacity: number) => {\n const color = Skia.Color(cl);\n color[ALPHA] *= currentOpacity;\n return color;\n};\n"]}
@@ -0,0 +1,56 @@
1
+ import { useRef, useEffect, useState } from "react";
2
+ import { Image } from "react-native";
3
+ import { Skia } from "../Skia";
4
+ export const useDataCollection = function (sources, factory) {
5
+ let deps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
6
+ const [data, setData] = useState(null);
7
+ useEffect(() => {
8
+ const bytesOrURIs = sources.map(source => {
9
+ if (source instanceof Uint8Array) {
10
+ return source;
11
+ }
12
+
13
+ return typeof source === "string" ? source : Image.resolveAssetSource(source).uri;
14
+ });
15
+ Promise.all(bytesOrURIs.map(bytesOrURI => bytesOrURI instanceof Uint8Array ? Skia.Data.fromBytes(bytesOrURI) : Skia.Data.fromURI(bytesOrURI))).then(d => setData(factory(d))); // eslint-disable-next-line react-hooks/exhaustive-deps
16
+ }, deps);
17
+ return data;
18
+ };
19
+ export const useRawData = (source, factory, onError) => {
20
+ const [data, setData] = useState(null);
21
+ const prevSourceRef = useRef();
22
+ useEffect(() => {
23
+ // Track to avoid re-fetching the same data
24
+ if (prevSourceRef.current !== source) {
25
+ prevSourceRef.current = source;
26
+
27
+ if (source !== null && source !== undefined) {
28
+ const factoryWrapper = data2 => {
29
+ const factoryResult = factory(data2);
30
+
31
+ if (factoryResult === null) {
32
+ onError && onError(new Error("Could not load data"));
33
+ setData(null);
34
+ } else {
35
+ setData(factoryResult);
36
+ }
37
+ };
38
+
39
+ if (source instanceof Uint8Array) {
40
+ factoryWrapper(Skia.Data.fromBytes(source));
41
+ } else {
42
+ const uri = typeof source === "string" ? source : Image.resolveAssetSource(source).uri;
43
+ Skia.Data.fromURI(uri).then(d => factoryWrapper(d));
44
+ }
45
+ }
46
+ } else {
47
+ setData(null);
48
+ }
49
+ }, [factory, onError, source]);
50
+ return data;
51
+ };
52
+
53
+ const identity = data => data;
54
+
55
+ export const useData = (source, onError) => useRawData(source, identity, onError);
56
+ //# sourceMappingURL=Data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["Data.ts"],"names":["useRef","useEffect","useState","Image","Skia","useDataCollection","sources","factory","deps","data","setData","bytesOrURIs","map","source","Uint8Array","resolveAssetSource","uri","Promise","all","bytesOrURI","Data","fromBytes","fromURI","then","d","useRawData","onError","prevSourceRef","current","undefined","factoryWrapper","data2","factoryResult","Error","identity","useData"],"mappings":"AACA,SAASA,MAAT,EAAiBC,SAAjB,EAA4BC,QAA5B,QAA4C,OAA5C;AACA,SAASC,KAAT,QAAsB,cAAtB;AAEA,SAASC,IAAT,QAAqB,SAArB;AAGA,OAAO,MAAMC,iBAAiB,GAAG,UAC/BC,OAD+B,EAE/BC,OAF+B,EAI5B;AAAA,MADHC,IACG,uEADoB,EACpB;AACH,QAAM,CAACC,IAAD,EAAOC,OAAP,IAAkBR,QAAQ,C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C1BN,YAAAA,OAAO,IAAIA,OAAO,CAAC,IAAIO,KAAJ,CAAU,qBAAV,CAAD,CAAlB;AACAvB,YAAAA,OAAO,CAAC,IAAD,CAAP;AACD,WAHD,MAGO;AACLA,YAAAA,OAAO,CAACsB,aAAD,CAAP;AACD;AACF,SARD;;AASA,YAAInB,MAAM,YAAYC,UAAtB,EAAkC;AAChCgB,UAAAA,cAAc,CAAC1B,IAAI,CAACgB,IAAL,CAAUC,SAAV,CAAoBR,MAApB,CAAD,CAAd;AACD,SAFD,MAEO;AACL,gBAAMG,GAAG,GACP,OAAOH,MAAP,KAAkB,QAAlB,GACIA,MADJ,GAEIV,KAAK,CAACY,kBAAN,CAAyBF,MAAzB,EAAiCG,GAHvC;AAIAZ,UAAAA,IAAI,CAACgB,IAAL,CAAUE,OAAV,CAAkBN,GAAlB,EAAuBO,IAAvB,CAA6BC,CAAD,IAAOM,cAAc,CAACN,CAAD,CAAjD;AACD;AACF;AACF,KAtBD,MAsBO;AACLd,MAAAA,OAAO,CAAC,IAAD,CAAP;AACD;AACF,GA3BQ,EA2BN,CAACH,OAAD,EAAUmB,OAAV,EAAmBb,MAAnB,CA3BM,CAAT;AA4BA,SAAOJ,IAAP;AACD,CApCM;;AAsCP,MAAMyB,QAAQ,GAAIzB,IAAD,IAAgBA,IAAjC;;AAEA,OAAO,MAAM0B,OAAO,GAAG,CACrBtB,MADqB,EAErBa,OAFqB,KAGlBD,UAAU,CAACZ,MAAD,EAASqB,QAAT,EAAmBR,OAAnB,CAHR","sourcesContent":["import type { DependencyList } from \"react\";\nimport { useRef, useEffect, useState } from \"react\";\nimport { Image } from \"react-native\";\n\nimport { Skia } from \"../Skia\";\nimport type { Data, DataSource } from \"../types\";\n\nexport const useDataCollection = <T>(\n sources: DataSource[],\n factory: (data: Data[]) => T,\n deps: DependencyList = []\n) => {\n const [data, setData] = useState<T | null>(null);\n useEffect(() => {\n const bytesOrURIs = sources.map((source) => {\n if (source instanceof Uint8Array) {\n return source;\n }\n return typeof source === \"string\"\n ? source\n : Image.resolveAssetSource(source).uri;\n });\n Promise.all(\n bytesOrURIs.map((bytesOrURI) =>\n bytesOrURI instanceof Uint8Array\n ? Skia.Data.fromBytes(bytesOrURI)\n : Skia.Data.fromURI(bytesOrURI)\n )\n ).then((d) => setData(factory(d)));\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, deps);\n return data;\n};\n\nexport const useRawData = <T>(\n source: DataSource | null | undefined,\n factory: (data: Data) => T,\n onError?: (err: Error) => void\n) => {\n const [data, setData] = useState<T | null>(null);\n const prevSourceRef = useRef<DataSource | null | undefined>();\n useEffect(() => {\n // Track to avoid re-fetching the same data\n if (prevSourceRef.current !== source) {\n prevSourceRef.current = source;\n if (source !== null && source !== undefined) {\n const factoryWrapper = (data2: Data) => {\n const factoryResult = factory(data2);\n if (factoryResult === null) {\n onError && onError(new Error(\"Could not load data\"));\n setData(null);\n } else {\n setData(factoryResult);\n }\n };\n if (source instanceof Uint8Array) {\n factoryWrapper(Skia.Data.fromBytes(source));\n } else {\n const uri =\n typeof source === \"string\"\n ? source\n : Image.resolveAssetSource(source).uri;\n Skia.Data.fromURI(uri).then((d) => factoryWrapper(d));\n }\n }\n } else {\n setData(null);\n }\n }, [factory, onError, source]);\n return data;\n};\n\nconst identity = (data: Data) => data;\n\nexport const useData = (\n source: DataSource | null | undefined,\n onError?: (err: Error) => void\n) => useRawData(source, identity, onError);\n"]}
@@ -1,13 +1,13 @@
1
1
  /*global SkiaApi*/
2
2
  import { useMemo } from "react";
3
3
  import { Skia } from "../Skia";
4
- import { useTypeface } from "../Typeface";
5
-
4
+ import { useTypeface } from "./Typeface";
6
5
  /**
7
6
  * Returns a Skia Font object
8
7
  * */
9
- export const useFont = (font, size) => {
10
- const typeface = useTypeface(font);
8
+
9
+ export const useFont = (font, size, onError) => {
10
+ const typeface = useTypeface(font, onError);
11
11
  return useMemo(() => {
12
12
  if (typeface === null) {
13
13
  return null;
@@ -21,4 +21,4 @@ export const useFont = (font, size) => {
21
21
 
22
22
  }, [typeface]);
23
23
  };
24
- //# sourceMappingURL=useFont.js.map
24
+ //# sourceMappingURL=Font.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["Font.ts"],"names":["useMemo","Skia","useTypeface","useFont","font","size","onError","typeface","Font"],"mappings":"AAAA;AACA,SAASA,OAAT,QAAwB,OAAxB;AAEA,SAASC,IAAT,QAAqB,SAArB;AAGA,SAASC,WAAT,QAA4B,YAA5B;AAEA;AACA;AACA;;AACA,OAAO,MAAMC,OAAO,GAAG,CACrBC,IADqB,EAErBC,IAFqB,EAGrBC,OAHqB,KAIH;AAClB,QAAMC,QAAQ,GAAGL,WAAW,CAACE,IAAD,EAAOE,OAAP,CAA5B;AACA,SAAON,OAAO,CAAC,MAAM;AACnB,QAAIO,QAAQ,KAAK,IAAjB,EAAuB;AACrB,aAAO,IAAP;AACD,KAFD,MAEO,IAAIA,QAAQ,IAAIF,IAAhB,EAAsB;AAC3B,aAAOJ,IAAI,CAACO,IAAL,CAAUD,QAAV,EAAoBF,IAApB,CAAP;AACD,KAFM,MAEA,IAAIE,QAAQ,IAAI,CAACF,IAAjB,EAAuB;AAC5B,aAAOJ,IAAI,CAACO,IAAL,CAAUD,QAAV,CAAP;AACD,KAFM,MAEA;AACL,aAAON,IAAI,CAACO,IAAL,EAAP;AACD,KATkB,CAUnB;;AACD,GAXa,EAWX,CAACD,QAAD,CAXW,CAAd;AAYD,CAlBM","sourcesContent":["/*global SkiaApi*/\nimport { useMemo } from \"react\";\n\nimport { Skia } from \"../Skia\";\nimport type { DataSource, SkFont } from \"../types\";\n\nimport { useTypeface } from \"./Typeface\";\n\n/**\n * Returns a Skia Font object\n * */\nexport const useFont = (\n font: DataSource | null | undefined,\n size?: number,\n onError?: (err: Error) => void\n): SkFont | null => {\n const typeface = useTypeface(font, onError);\n return useMemo(() => {\n if (typeface === null) {\n return null;\n } else if (typeface && size) {\n return Skia.Font(typeface, size);\n } else if (typeface && !size) {\n return Skia.Font(typeface);\n } else {\n return Skia.Font();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [typeface]);\n};\n"]}
@@ -0,0 +1,8 @@
1
+ import { Skia } from "../Skia";
2
+ import { useRawData } from "./Data";
3
+ /**
4
+ * Returns a Skia Image object
5
+ * */
6
+
7
+ export const useImage = (source, onError) => useRawData(source, Skia.Image.MakeImageFromEncoded, onError);
8
+ //# sourceMappingURL=Image.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["Image.ts"],"names":["Skia","useRawData","useImage","source","onError","Image","MakeImageFromEncoded"],"mappings":"AAAA,SAASA,IAAT,QAAqB,SAArB;AAGA,SAASC,UAAT,QAA2B,QAA3B;AAEA;AACA;AACA;;AACA,OAAO,MAAMC,QAAQ,GAAG,CACtBC,MADsB,EAEtBC,OAFsB,KAGnBH,UAAU,CAACE,MAAD,EAASH,IAAI,CAACK,KAAL,CAAWC,oBAApB,EAA0CF,OAA1C,CAHR","sourcesContent":["import { Skia } from \"../Skia\";\nimport type { DataSource } from \"../types\";\n\nimport { useRawData } from \"./Data\";\n\n/**\n * Returns a Skia Image object\n * */\nexport const useImage = (\n source: DataSource | null | undefined,\n onError?: (err: Error) => void\n) => useRawData(source, Skia.Image.MakeImageFromEncoded, onError);\n"]}