@shopify/react-native-skia 0.1.190 → 0.1.192

Sign up to get free protection for your applications and to get access to all the features.
Files changed (357) hide show
  1. package/cpp/api/JsiSkColorFilter.h +2 -17
  2. package/cpp/api/JsiSkContourMeasure.h +3 -17
  3. package/cpp/api/JsiSkContourMeasureIter.h +3 -18
  4. package/cpp/api/JsiSkData.h +1 -18
  5. package/cpp/api/JsiSkFont.h +4 -14
  6. package/cpp/api/JsiSkHostObjects.h +85 -10
  7. package/cpp/api/JsiSkImage.h +1 -12
  8. package/cpp/api/JsiSkImageFilter.h +1 -17
  9. package/cpp/api/JsiSkMaskFilter.h +1 -17
  10. package/cpp/api/JsiSkMatrix.h +3 -6
  11. package/cpp/api/JsiSkPaint.h +3 -15
  12. package/cpp/api/JsiSkPath.h +2 -15
  13. package/cpp/api/JsiSkPathEffect.h +2 -17
  14. package/cpp/api/JsiSkPicture.h +4 -18
  15. package/cpp/api/JsiSkPictureRecorder.h +4 -1
  16. package/cpp/api/JsiSkPoint.h +6 -1
  17. package/cpp/api/JsiSkRRect.h +6 -1
  18. package/cpp/api/JsiSkRSXform.h +4 -6
  19. package/cpp/api/JsiSkRect.h +6 -2
  20. package/cpp/api/JsiSkRuntimeEffect.h +4 -7
  21. package/cpp/api/JsiSkRuntimeShaderBuilder.h +2 -10
  22. package/cpp/api/JsiSkSVG.h +1 -10
  23. package/cpp/api/JsiSkShader.h +2 -16
  24. package/cpp/api/JsiSkSurface.h +3 -16
  25. package/cpp/api/JsiSkTextBlob.h +2 -18
  26. package/cpp/api/JsiSkTypeface.h +1 -22
  27. package/cpp/api/JsiSkVertices.h +3 -17
  28. package/cpp/rnskia/dom/nodes/JsiImageSvgNode.h +24 -3
  29. package/cpp/rnskia/dom/nodes/JsiPathNode.h +11 -11
  30. package/cpp/rnskia/values/RNSkReadonlyValue.h +2 -2
  31. package/cpp/rnskia/values/RNSkValue.h +1 -1
  32. package/lib/commonjs/Platform/Platform.web.js +1 -1
  33. package/lib/commonjs/Platform/Platform.web.js.map +1 -1
  34. package/lib/commonjs/dom/nodes/drawings/ImageSVG.d.ts +7 -2
  35. package/lib/commonjs/dom/nodes/drawings/ImageSVG.js +29 -7
  36. package/lib/commonjs/dom/nodes/drawings/ImageSVG.js.map +1 -1
  37. package/lib/commonjs/dom/nodes/drawings/PathNode.js +6 -2
  38. package/lib/commonjs/dom/nodes/drawings/PathNode.js.map +1 -1
  39. package/lib/commonjs/dom/types/Drawings.d.ts +7 -2
  40. package/lib/commonjs/dom/types/Drawings.js.map +1 -1
  41. package/lib/commonjs/renderer/Canvas.js +17 -1
  42. package/lib/commonjs/renderer/Canvas.js.map +1 -1
  43. package/lib/commonjs/renderer/processors/math/Math.d.ts +1 -0
  44. package/lib/commonjs/renderer/processors/math/Math.js +9 -1
  45. package/lib/commonjs/renderer/processors/math/Math.js.map +1 -1
  46. package/lib/commonjs/skia/core/Data.d.ts +2 -2
  47. package/lib/commonjs/skia/core/Data.js.map +1 -1
  48. package/lib/commonjs/skia/types/Data/Data.d.ts +2 -2
  49. package/lib/commonjs/skia/types/Data/Data.js.map +1 -1
  50. package/lib/commonjs/skia/types/Image/Image.d.ts +2 -2
  51. package/lib/commonjs/skia/types/Image/Image.js.map +1 -1
  52. package/lib/commonjs/skia/types/JsiInstance.d.ts +4 -4
  53. package/lib/commonjs/skia/types/JsiInstance.js.map +1 -1
  54. package/lib/commonjs/skia/types/SVG/SVG.d.ts +2 -2
  55. package/lib/commonjs/skia/types/SVG/SVG.js.map +1 -1
  56. package/lib/commonjs/skia/types/Typeface/Typeface.d.ts +2 -2
  57. package/lib/commonjs/skia/types/Typeface/Typeface.js.map +1 -1
  58. package/lib/commonjs/skia/web/Host.d.ts +1 -0
  59. package/lib/commonjs/skia/web/Host.js +2 -0
  60. package/lib/commonjs/skia/web/Host.js.map +1 -1
  61. package/lib/commonjs/skia/web/JsiSkCanvas.d.ts +1 -0
  62. package/lib/commonjs/skia/web/JsiSkCanvas.js +6 -0
  63. package/lib/commonjs/skia/web/JsiSkCanvas.js.map +1 -1
  64. package/lib/commonjs/skia/web/JsiSkColorFilter.d.ts +1 -0
  65. package/lib/commonjs/skia/web/JsiSkColorFilter.js +6 -0
  66. package/lib/commonjs/skia/web/JsiSkColorFilter.js.map +1 -1
  67. package/lib/commonjs/skia/web/JsiSkContourMeasure.d.ts +1 -0
  68. package/lib/commonjs/skia/web/JsiSkContourMeasure.js +6 -0
  69. package/lib/commonjs/skia/web/JsiSkContourMeasure.js.map +1 -1
  70. package/lib/commonjs/skia/web/JsiSkContourMeasureIter.d.ts +1 -0
  71. package/lib/commonjs/skia/web/JsiSkContourMeasureIter.js +6 -0
  72. package/lib/commonjs/skia/web/JsiSkContourMeasureIter.js.map +1 -1
  73. package/lib/commonjs/skia/web/JsiSkData.d.ts +1 -1
  74. package/lib/commonjs/skia/web/JsiSkData.js +4 -2
  75. package/lib/commonjs/skia/web/JsiSkData.js.map +1 -1
  76. package/lib/commonjs/skia/web/JsiSkFont.d.ts +1 -0
  77. package/lib/commonjs/skia/web/JsiSkFont.js +6 -0
  78. package/lib/commonjs/skia/web/JsiSkFont.js.map +1 -1
  79. package/lib/commonjs/skia/web/JsiSkImage.d.ts +1 -1
  80. package/lib/commonjs/skia/web/JsiSkImage.js +6 -4
  81. package/lib/commonjs/skia/web/JsiSkImage.js.map +1 -1
  82. package/lib/commonjs/skia/web/JsiSkImageFilter.d.ts +1 -0
  83. package/lib/commonjs/skia/web/JsiSkImageFilter.js +6 -0
  84. package/lib/commonjs/skia/web/JsiSkImageFilter.js.map +1 -1
  85. package/lib/commonjs/skia/web/JsiSkMaskFilter.d.ts +1 -0
  86. package/lib/commonjs/skia/web/JsiSkMaskFilter.js +6 -0
  87. package/lib/commonjs/skia/web/JsiSkMaskFilter.js.map +1 -1
  88. package/lib/commonjs/skia/web/JsiSkMatrix.d.ts +1 -0
  89. package/lib/commonjs/skia/web/JsiSkMatrix.js +5 -0
  90. package/lib/commonjs/skia/web/JsiSkMatrix.js.map +1 -1
  91. package/lib/commonjs/skia/web/JsiSkPaint.d.ts +1 -0
  92. package/lib/commonjs/skia/web/JsiSkPaint.js +6 -0
  93. package/lib/commonjs/skia/web/JsiSkPaint.js.map +1 -1
  94. package/lib/commonjs/skia/web/JsiSkPath.d.ts +1 -0
  95. package/lib/commonjs/skia/web/JsiSkPath.js +6 -0
  96. package/lib/commonjs/skia/web/JsiSkPath.js.map +1 -1
  97. package/lib/commonjs/skia/web/JsiSkPathEffect.d.ts +1 -0
  98. package/lib/commonjs/skia/web/JsiSkPathEffect.js +6 -0
  99. package/lib/commonjs/skia/web/JsiSkPathEffect.js.map +1 -1
  100. package/lib/commonjs/skia/web/JsiSkPicture.d.ts +1 -0
  101. package/lib/commonjs/skia/web/JsiSkPicture.js +6 -1
  102. package/lib/commonjs/skia/web/JsiSkPicture.js.map +1 -1
  103. package/lib/commonjs/skia/web/JsiSkPictureRecorder.d.ts +1 -0
  104. package/lib/commonjs/skia/web/JsiSkPictureRecorder.js +6 -0
  105. package/lib/commonjs/skia/web/JsiSkPictureRecorder.js.map +1 -1
  106. package/lib/commonjs/skia/web/JsiSkPoint.d.ts +1 -0
  107. package/lib/commonjs/skia/web/JsiSkPoint.js +5 -0
  108. package/lib/commonjs/skia/web/JsiSkPoint.js.map +1 -1
  109. package/lib/commonjs/skia/web/JsiSkRRect.d.ts +1 -0
  110. package/lib/commonjs/skia/web/JsiSkRRect.js +5 -0
  111. package/lib/commonjs/skia/web/JsiSkRRect.js.map +1 -1
  112. package/lib/commonjs/skia/web/JsiSkRSXform.d.ts +1 -0
  113. package/lib/commonjs/skia/web/JsiSkRSXform.js +5 -0
  114. package/lib/commonjs/skia/web/JsiSkRSXform.js.map +1 -1
  115. package/lib/commonjs/skia/web/JsiSkRect.d.ts +1 -0
  116. package/lib/commonjs/skia/web/JsiSkRect.js +5 -0
  117. package/lib/commonjs/skia/web/JsiSkRect.js.map +1 -1
  118. package/lib/commonjs/skia/web/JsiSkRuntimeEffect.d.ts +1 -0
  119. package/lib/commonjs/skia/web/JsiSkRuntimeEffect.js +6 -0
  120. package/lib/commonjs/skia/web/JsiSkRuntimeEffect.js.map +1 -1
  121. package/lib/commonjs/skia/web/JsiSkShader.d.ts +1 -0
  122. package/lib/commonjs/skia/web/JsiSkShader.js +6 -0
  123. package/lib/commonjs/skia/web/JsiSkShader.js.map +1 -1
  124. package/lib/commonjs/skia/web/JsiSkSurface.d.ts +1 -0
  125. package/lib/commonjs/skia/web/JsiSkSurface.js +6 -0
  126. package/lib/commonjs/skia/web/JsiSkSurface.js.map +1 -1
  127. package/lib/commonjs/skia/web/JsiSkTextBlob.d.ts +1 -0
  128. package/lib/commonjs/skia/web/JsiSkTextBlob.js +6 -0
  129. package/lib/commonjs/skia/web/JsiSkTextBlob.js.map +1 -1
  130. package/lib/commonjs/skia/web/JsiSkTypeface.d.ts +1 -1
  131. package/lib/commonjs/skia/web/JsiSkTypeface.js +6 -4
  132. package/lib/commonjs/skia/web/JsiSkTypeface.js.map +1 -1
  133. package/lib/commonjs/skia/web/JsiSkVertices.d.ts +1 -0
  134. package/lib/commonjs/skia/web/JsiSkVertices.js +6 -0
  135. package/lib/commonjs/skia/web/JsiSkVertices.js.map +1 -1
  136. package/lib/commonjs/values/hooks/useComputedValue.js +1 -1
  137. package/lib/commonjs/values/hooks/useComputedValue.js.map +1 -1
  138. package/lib/commonjs/values/types.d.ts +1 -1
  139. package/lib/commonjs/values/types.js.map +1 -1
  140. package/lib/commonjs/values/web/RNSkComputedValue.d.ts +1 -1
  141. package/lib/commonjs/values/web/RNSkComputedValue.js +1 -1
  142. package/lib/commonjs/values/web/RNSkComputedValue.js.map +1 -1
  143. package/lib/commonjs/values/web/RNSkReadonlyValue.d.ts +1 -1
  144. package/lib/commonjs/values/web/RNSkReadonlyValue.js +1 -1
  145. package/lib/commonjs/values/web/RNSkReadonlyValue.js.map +1 -1
  146. package/lib/commonjs/views/SkiaBaseWebView.js +9 -4
  147. package/lib/commonjs/views/SkiaBaseWebView.js.map +1 -1
  148. package/lib/commonjs/views/SkiaDomView.web.js +14 -4
  149. package/lib/commonjs/views/SkiaDomView.web.js.map +1 -1
  150. package/lib/commonjs/views/types.d.ts +2 -1
  151. package/lib/commonjs/views/types.js.map +1 -1
  152. package/lib/module/Platform/Platform.web.js +1 -1
  153. package/lib/module/Platform/Platform.web.js.map +1 -1
  154. package/lib/module/dom/nodes/drawings/ImageSVG.d.ts +7 -2
  155. package/lib/module/dom/nodes/drawings/ImageSVG.js +29 -6
  156. package/lib/module/dom/nodes/drawings/ImageSVG.js.map +1 -1
  157. package/lib/module/dom/nodes/drawings/PathNode.js +5 -2
  158. package/lib/module/dom/nodes/drawings/PathNode.js.map +1 -1
  159. package/lib/module/dom/types/Drawings.d.ts +7 -2
  160. package/lib/module/dom/types/Drawings.js.map +1 -1
  161. package/lib/module/renderer/Canvas.js +15 -1
  162. package/lib/module/renderer/Canvas.js.map +1 -1
  163. package/lib/module/renderer/processors/math/Math.d.ts +1 -0
  164. package/lib/module/renderer/processors/math/Math.js +5 -0
  165. package/lib/module/renderer/processors/math/Math.js.map +1 -1
  166. package/lib/module/skia/core/Data.d.ts +2 -2
  167. package/lib/module/skia/core/Data.js.map +1 -1
  168. package/lib/module/skia/types/Data/Data.d.ts +2 -2
  169. package/lib/module/skia/types/Data/Data.js.map +1 -1
  170. package/lib/module/skia/types/Image/Image.d.ts +2 -2
  171. package/lib/module/skia/types/Image/Image.js.map +1 -1
  172. package/lib/module/skia/types/JsiInstance.d.ts +4 -4
  173. package/lib/module/skia/types/JsiInstance.js.map +1 -1
  174. package/lib/module/skia/types/SVG/SVG.d.ts +2 -2
  175. package/lib/module/skia/types/SVG/SVG.js.map +1 -1
  176. package/lib/module/skia/types/Typeface/Typeface.d.ts +2 -2
  177. package/lib/module/skia/types/Typeface/Typeface.js.map +1 -1
  178. package/lib/module/skia/web/Host.d.ts +1 -0
  179. package/lib/module/skia/web/Host.js +2 -0
  180. package/lib/module/skia/web/Host.js.map +1 -1
  181. package/lib/module/skia/web/JsiSkCanvas.d.ts +1 -0
  182. package/lib/module/skia/web/JsiSkCanvas.js +6 -0
  183. package/lib/module/skia/web/JsiSkCanvas.js.map +1 -1
  184. package/lib/module/skia/web/JsiSkColorFilter.d.ts +1 -0
  185. package/lib/module/skia/web/JsiSkColorFilter.js +6 -0
  186. package/lib/module/skia/web/JsiSkColorFilter.js.map +1 -1
  187. package/lib/module/skia/web/JsiSkContourMeasure.d.ts +1 -0
  188. package/lib/module/skia/web/JsiSkContourMeasure.js +6 -0
  189. package/lib/module/skia/web/JsiSkContourMeasure.js.map +1 -1
  190. package/lib/module/skia/web/JsiSkContourMeasureIter.d.ts +1 -0
  191. package/lib/module/skia/web/JsiSkContourMeasureIter.js +6 -0
  192. package/lib/module/skia/web/JsiSkContourMeasureIter.js.map +1 -1
  193. package/lib/module/skia/web/JsiSkData.d.ts +1 -1
  194. package/lib/module/skia/web/JsiSkData.js +4 -2
  195. package/lib/module/skia/web/JsiSkData.js.map +1 -1
  196. package/lib/module/skia/web/JsiSkFont.d.ts +1 -0
  197. package/lib/module/skia/web/JsiSkFont.js +6 -0
  198. package/lib/module/skia/web/JsiSkFont.js.map +1 -1
  199. package/lib/module/skia/web/JsiSkImage.d.ts +1 -1
  200. package/lib/module/skia/web/JsiSkImage.js +6 -4
  201. package/lib/module/skia/web/JsiSkImage.js.map +1 -1
  202. package/lib/module/skia/web/JsiSkImageFilter.d.ts +1 -0
  203. package/lib/module/skia/web/JsiSkImageFilter.js +6 -0
  204. package/lib/module/skia/web/JsiSkImageFilter.js.map +1 -1
  205. package/lib/module/skia/web/JsiSkMaskFilter.d.ts +1 -0
  206. package/lib/module/skia/web/JsiSkMaskFilter.js +6 -0
  207. package/lib/module/skia/web/JsiSkMaskFilter.js.map +1 -1
  208. package/lib/module/skia/web/JsiSkMatrix.d.ts +1 -0
  209. package/lib/module/skia/web/JsiSkMatrix.js +5 -0
  210. package/lib/module/skia/web/JsiSkMatrix.js.map +1 -1
  211. package/lib/module/skia/web/JsiSkPaint.d.ts +1 -0
  212. package/lib/module/skia/web/JsiSkPaint.js +6 -0
  213. package/lib/module/skia/web/JsiSkPaint.js.map +1 -1
  214. package/lib/module/skia/web/JsiSkPath.d.ts +1 -0
  215. package/lib/module/skia/web/JsiSkPath.js +6 -0
  216. package/lib/module/skia/web/JsiSkPath.js.map +1 -1
  217. package/lib/module/skia/web/JsiSkPathEffect.d.ts +1 -0
  218. package/lib/module/skia/web/JsiSkPathEffect.js +6 -0
  219. package/lib/module/skia/web/JsiSkPathEffect.js.map +1 -1
  220. package/lib/module/skia/web/JsiSkPicture.d.ts +1 -0
  221. package/lib/module/skia/web/JsiSkPicture.js +6 -0
  222. package/lib/module/skia/web/JsiSkPicture.js.map +1 -1
  223. package/lib/module/skia/web/JsiSkPictureRecorder.d.ts +1 -0
  224. package/lib/module/skia/web/JsiSkPictureRecorder.js +6 -0
  225. package/lib/module/skia/web/JsiSkPictureRecorder.js.map +1 -1
  226. package/lib/module/skia/web/JsiSkPoint.d.ts +1 -0
  227. package/lib/module/skia/web/JsiSkPoint.js +5 -0
  228. package/lib/module/skia/web/JsiSkPoint.js.map +1 -1
  229. package/lib/module/skia/web/JsiSkRRect.d.ts +1 -0
  230. package/lib/module/skia/web/JsiSkRRect.js +5 -0
  231. package/lib/module/skia/web/JsiSkRRect.js.map +1 -1
  232. package/lib/module/skia/web/JsiSkRSXform.d.ts +1 -0
  233. package/lib/module/skia/web/JsiSkRSXform.js +5 -0
  234. package/lib/module/skia/web/JsiSkRSXform.js.map +1 -1
  235. package/lib/module/skia/web/JsiSkRect.d.ts +1 -0
  236. package/lib/module/skia/web/JsiSkRect.js +5 -0
  237. package/lib/module/skia/web/JsiSkRect.js.map +1 -1
  238. package/lib/module/skia/web/JsiSkRuntimeEffect.d.ts +1 -0
  239. package/lib/module/skia/web/JsiSkRuntimeEffect.js +6 -0
  240. package/lib/module/skia/web/JsiSkRuntimeEffect.js.map +1 -1
  241. package/lib/module/skia/web/JsiSkShader.d.ts +1 -0
  242. package/lib/module/skia/web/JsiSkShader.js +6 -0
  243. package/lib/module/skia/web/JsiSkShader.js.map +1 -1
  244. package/lib/module/skia/web/JsiSkSurface.d.ts +1 -0
  245. package/lib/module/skia/web/JsiSkSurface.js +6 -0
  246. package/lib/module/skia/web/JsiSkSurface.js.map +1 -1
  247. package/lib/module/skia/web/JsiSkTextBlob.d.ts +1 -0
  248. package/lib/module/skia/web/JsiSkTextBlob.js +6 -0
  249. package/lib/module/skia/web/JsiSkTextBlob.js.map +1 -1
  250. package/lib/module/skia/web/JsiSkTypeface.d.ts +1 -1
  251. package/lib/module/skia/web/JsiSkTypeface.js +6 -4
  252. package/lib/module/skia/web/JsiSkTypeface.js.map +1 -1
  253. package/lib/module/skia/web/JsiSkVertices.d.ts +1 -0
  254. package/lib/module/skia/web/JsiSkVertices.js +6 -0
  255. package/lib/module/skia/web/JsiSkVertices.js.map +1 -1
  256. package/lib/module/values/hooks/useComputedValue.js +1 -1
  257. package/lib/module/values/hooks/useComputedValue.js.map +1 -1
  258. package/lib/module/values/types.d.ts +1 -1
  259. package/lib/module/values/types.js.map +1 -1
  260. package/lib/module/values/web/RNSkComputedValue.d.ts +1 -1
  261. package/lib/module/values/web/RNSkComputedValue.js +1 -1
  262. package/lib/module/values/web/RNSkComputedValue.js.map +1 -1
  263. package/lib/module/values/web/RNSkReadonlyValue.d.ts +1 -1
  264. package/lib/module/values/web/RNSkReadonlyValue.js +1 -1
  265. package/lib/module/values/web/RNSkReadonlyValue.js.map +1 -1
  266. package/lib/module/views/SkiaBaseWebView.js +9 -4
  267. package/lib/module/views/SkiaBaseWebView.js.map +1 -1
  268. package/lib/module/views/SkiaDomView.web.js +13 -4
  269. package/lib/module/views/SkiaDomView.web.js.map +1 -1
  270. package/lib/module/views/types.d.ts +2 -1
  271. package/lib/module/views/types.js.map +1 -1
  272. package/lib/typescript/src/dom/nodes/drawings/ImageSVG.d.ts +7 -2
  273. package/lib/typescript/src/dom/types/Drawings.d.ts +7 -2
  274. package/lib/typescript/src/renderer/processors/math/Math.d.ts +1 -0
  275. package/lib/typescript/src/skia/core/Data.d.ts +2 -2
  276. package/lib/typescript/src/skia/types/Data/Data.d.ts +2 -2
  277. package/lib/typescript/src/skia/types/Image/Image.d.ts +2 -2
  278. package/lib/typescript/src/skia/types/JsiInstance.d.ts +4 -4
  279. package/lib/typescript/src/skia/types/SVG/SVG.d.ts +2 -2
  280. package/lib/typescript/src/skia/types/Typeface/Typeface.d.ts +2 -2
  281. package/lib/typescript/src/skia/web/Host.d.ts +1 -0
  282. package/lib/typescript/src/skia/web/JsiSkCanvas.d.ts +1 -0
  283. package/lib/typescript/src/skia/web/JsiSkColorFilter.d.ts +1 -0
  284. package/lib/typescript/src/skia/web/JsiSkContourMeasure.d.ts +1 -0
  285. package/lib/typescript/src/skia/web/JsiSkContourMeasureIter.d.ts +1 -0
  286. package/lib/typescript/src/skia/web/JsiSkData.d.ts +1 -1
  287. package/lib/typescript/src/skia/web/JsiSkFont.d.ts +1 -0
  288. package/lib/typescript/src/skia/web/JsiSkImage.d.ts +1 -1
  289. package/lib/typescript/src/skia/web/JsiSkImageFilter.d.ts +1 -0
  290. package/lib/typescript/src/skia/web/JsiSkMaskFilter.d.ts +1 -0
  291. package/lib/typescript/src/skia/web/JsiSkMatrix.d.ts +1 -0
  292. package/lib/typescript/src/skia/web/JsiSkPaint.d.ts +1 -0
  293. package/lib/typescript/src/skia/web/JsiSkPath.d.ts +1 -0
  294. package/lib/typescript/src/skia/web/JsiSkPathEffect.d.ts +1 -0
  295. package/lib/typescript/src/skia/web/JsiSkPicture.d.ts +1 -0
  296. package/lib/typescript/src/skia/web/JsiSkPictureRecorder.d.ts +1 -0
  297. package/lib/typescript/src/skia/web/JsiSkPoint.d.ts +1 -0
  298. package/lib/typescript/src/skia/web/JsiSkRRect.d.ts +1 -0
  299. package/lib/typescript/src/skia/web/JsiSkRSXform.d.ts +1 -0
  300. package/lib/typescript/src/skia/web/JsiSkRect.d.ts +1 -0
  301. package/lib/typescript/src/skia/web/JsiSkRuntimeEffect.d.ts +1 -0
  302. package/lib/typescript/src/skia/web/JsiSkShader.d.ts +1 -0
  303. package/lib/typescript/src/skia/web/JsiSkSurface.d.ts +1 -0
  304. package/lib/typescript/src/skia/web/JsiSkTextBlob.d.ts +1 -0
  305. package/lib/typescript/src/skia/web/JsiSkTypeface.d.ts +1 -1
  306. package/lib/typescript/src/skia/web/JsiSkVertices.d.ts +1 -0
  307. package/lib/typescript/src/values/types.d.ts +1 -1
  308. package/lib/typescript/src/values/web/RNSkComputedValue.d.ts +1 -1
  309. package/lib/typescript/src/values/web/RNSkReadonlyValue.d.ts +1 -1
  310. package/lib/typescript/src/views/types.d.ts +2 -1
  311. package/package.json +4 -1
  312. package/scripts/install-npm.js +2 -3
  313. package/src/Platform/Platform.web.tsx +1 -1
  314. package/src/dom/nodes/drawings/ImageSVG.ts +17 -6
  315. package/src/dom/nodes/drawings/PathNode.ts +10 -1
  316. package/src/dom/types/Drawings.ts +7 -2
  317. package/src/renderer/Canvas.tsx +21 -1
  318. package/src/renderer/processors/math/Math.ts +5 -0
  319. package/src/skia/core/Data.ts +3 -3
  320. package/src/skia/types/Data/Data.ts +2 -2
  321. package/src/skia/types/Image/Image.ts +2 -2
  322. package/src/skia/types/JsiInstance.ts +4 -4
  323. package/src/skia/types/SVG/SVG.ts +2 -2
  324. package/src/skia/types/Typeface/Typeface.ts +2 -2
  325. package/src/skia/web/Host.ts +2 -0
  326. package/src/skia/web/JsiSkCanvas.ts +4 -0
  327. package/src/skia/web/JsiSkColorFilter.ts +4 -0
  328. package/src/skia/web/JsiSkContourMeasure.ts +4 -0
  329. package/src/skia/web/JsiSkContourMeasureIter.ts +4 -0
  330. package/src/skia/web/JsiSkData.ts +3 -3
  331. package/src/skia/web/JsiSkFont.ts +4 -0
  332. package/src/skia/web/JsiSkImage.ts +2 -2
  333. package/src/skia/web/JsiSkImageFilter.ts +4 -0
  334. package/src/skia/web/JsiSkMaskFilter.ts +4 -0
  335. package/src/skia/web/JsiSkMatrix.ts +4 -0
  336. package/src/skia/web/JsiSkPaint.ts +4 -0
  337. package/src/skia/web/JsiSkPath.ts +4 -0
  338. package/src/skia/web/JsiSkPathEffect.ts +4 -0
  339. package/src/skia/web/JsiSkPicture.ts +4 -0
  340. package/src/skia/web/JsiSkPictureRecorder.ts +4 -0
  341. package/src/skia/web/JsiSkPoint.ts +4 -0
  342. package/src/skia/web/JsiSkRRect.ts +4 -0
  343. package/src/skia/web/JsiSkRSXform.ts +4 -0
  344. package/src/skia/web/JsiSkRect.ts +4 -0
  345. package/src/skia/web/JsiSkRuntimeEffect.ts +4 -0
  346. package/src/skia/web/JsiSkShader.ts +4 -0
  347. package/src/skia/web/JsiSkSurface.ts +4 -0
  348. package/src/skia/web/JsiSkTextBlob.ts +4 -0
  349. package/src/skia/web/JsiSkTypeface.ts +2 -2
  350. package/src/skia/web/JsiSkVertices.ts +4 -0
  351. package/src/values/hooks/useComputedValue.ts +1 -1
  352. package/src/values/types.ts +1 -1
  353. package/src/values/web/RNSkComputedValue.ts +1 -1
  354. package/src/values/web/RNSkReadonlyValue.ts +1 -1
  355. package/src/views/SkiaBaseWebView.tsx +9 -4
  356. package/src/views/SkiaDomView.web.tsx +6 -1
  357. package/src/views/types.ts +2 -1
@@ -1 +1 @@
1
- {"version":3,"names":["JsiSkRRect","BaseHostObject","fromValue","CanvasKit","rect","JsiSkRect","ref","RRectXY","rx","ry","constructor","Infinity","width","height","scale","Math","min","Float32Array","of"],"sources":["JsiSkRRect.ts"],"sourcesContent":["import type { CanvasKit, RRect } from \"canvaskit-wasm\";\n\nimport type { SkRect, SkRRect } from \"../types\";\n\nimport { BaseHostObject } from \"./Host\";\nimport { JsiSkRect } from \"./JsiSkRect\";\n\nexport class JsiSkRRect\n extends BaseHostObject<RRect, \"RRect\">\n implements SkRRect\n{\n static fromValue(CanvasKit: CanvasKit, rect: SkRRect) {\n if (rect instanceof JsiSkRect) {\n return rect.ref;\n }\n return CanvasKit.RRectXY(\n JsiSkRect.fromValue(CanvasKit, rect.rect),\n rect.rx,\n rect.ry\n );\n }\n\n constructor(CanvasKit: CanvasKit, rect: SkRect, rx: number, ry: number) {\n // based on https://github.com/google/skia/blob/main/src/core/SkRRect.cpp#L51\n if (rx === Infinity || ry === Infinity) {\n rx = ry = 0;\n }\n if (rect.width < rx + rx || rect.height < ry + ry) {\n // At most one of these two divides will be by zero, and neither numerator is zero.\n const scale = Math.min(rect.width / (rx + rx), rect.height / (ry + ry));\n rx *= scale;\n ry *= scale;\n }\n const ref = CanvasKit.RRectXY(JsiSkRect.fromValue(CanvasKit, rect), rx, ry);\n super(CanvasKit, ref, \"RRect\");\n }\n\n get rx() {\n return this.ref[4];\n }\n\n get ry() {\n return this.ref[5];\n }\n\n get rect() {\n return new JsiSkRect(\n this.CanvasKit,\n Float32Array.of(this.ref[0], this.ref[1], this.ref[2], this.ref[3])\n );\n }\n}\n"],"mappings":";;;;;;;AAIA;;AACA;;AAEO,MAAMA,UAAN,SACGC,oBADH,CAGP;EACkB,OAATC,SAAS,CAACC,SAAD,EAAuBC,IAAvB,EAAsC;IACpD,IAAIA,IAAI,YAAYC,oBAApB,EAA+B;MAC7B,OAAOD,IAAI,CAACE,GAAZ;IACD;;IACD,OAAOH,SAAS,CAACI,OAAV,CACLF,oBAAA,CAAUH,SAAV,CAAoBC,SAApB,EAA+BC,IAAI,CAACA,IAApC,CADK,EAELA,IAAI,CAACI,EAFA,EAGLJ,IAAI,CAACK,EAHA,CAAP;EAKD;;EAEDC,WAAW,CAACP,SAAD,EAAuBC,IAAvB,EAAqCI,EAArC,EAAiDC,EAAjD,EAA6D;IACtE;IACA,IAAID,EAAE,KAAKG,QAAP,IAAmBF,EAAE,KAAKE,QAA9B,EAAwC;MACtCH,EAAE,GAAGC,EAAE,GAAG,CAAV;IACD;;IACD,IAAIL,IAAI,CAACQ,KAAL,GAAaJ,EAAE,GAAGA,EAAlB,IAAwBJ,IAAI,CAACS,MAAL,GAAcJ,EAAE,GAAGA,EAA/C,EAAmD;MACjD;MACA,MAAMK,KAAK,GAAGC,IAAI,CAACC,GAAL,CAASZ,IAAI,CAACQ,KAAL,IAAcJ,EAAE,GAAGA,EAAnB,CAAT,EAAiCJ,IAAI,CAACS,MAAL,IAAeJ,EAAE,GAAGA,EAApB,CAAjC,CAAd;MACAD,EAAE,IAAIM,KAAN;MACAL,EAAE,IAAIK,KAAN;IACD;;IACD,MAAMR,GAAG,GAAGH,SAAS,CAACI,OAAV,CAAkBF,oBAAA,CAAUH,SAAV,CAAoBC,SAApB,EAA+BC,IAA/B,CAAlB,EAAwDI,EAAxD,EAA4DC,EAA5D,CAAZ;IACA,MAAMN,SAAN,EAAiBG,GAAjB,EAAsB,OAAtB;EACD;;EAEK,IAAFE,EAAE,GAAG;IACP,OAAO,KAAKF,GAAL,CAAS,CAAT,CAAP;EACD;;EAEK,IAAFG,EAAE,GAAG;IACP,OAAO,KAAKH,GAAL,CAAS,CAAT,CAAP;EACD;;EAEO,IAAJF,IAAI,GAAG;IACT,OAAO,IAAIC,oBAAJ,CACL,KAAKF,SADA,EAELc,YAAY,CAACC,EAAb,CAAgB,KAAKZ,GAAL,CAAS,CAAT,CAAhB,EAA6B,KAAKA,GAAL,CAAS,CAAT,CAA7B,EAA0C,KAAKA,GAAL,CAAS,CAAT,CAA1C,EAAuD,KAAKA,GAAL,CAAS,CAAT,CAAvD,CAFK,CAAP;EAID;;AAxCH"}
1
+ {"version":3,"names":["JsiSkRRect","BaseHostObject","fromValue","CanvasKit","rect","JsiSkRect","ref","RRectXY","rx","ry","constructor","Infinity","width","height","scale","Math","min","Float32Array","of"],"sources":["JsiSkRRect.ts"],"sourcesContent":["import type { CanvasKit, RRect } from \"canvaskit-wasm\";\n\nimport type { SkRect, SkRRect } from \"../types\";\n\nimport { BaseHostObject } from \"./Host\";\nimport { JsiSkRect } from \"./JsiSkRect\";\n\nexport class JsiSkRRect\n extends BaseHostObject<RRect, \"RRect\">\n implements SkRRect\n{\n dispose = () => {\n // Float32Array\n };\n\n static fromValue(CanvasKit: CanvasKit, rect: SkRRect) {\n if (rect instanceof JsiSkRect) {\n return rect.ref;\n }\n return CanvasKit.RRectXY(\n JsiSkRect.fromValue(CanvasKit, rect.rect),\n rect.rx,\n rect.ry\n );\n }\n\n constructor(CanvasKit: CanvasKit, rect: SkRect, rx: number, ry: number) {\n // based on https://github.com/google/skia/blob/main/src/core/SkRRect.cpp#L51\n if (rx === Infinity || ry === Infinity) {\n rx = ry = 0;\n }\n if (rect.width < rx + rx || rect.height < ry + ry) {\n // At most one of these two divides will be by zero, and neither numerator is zero.\n const scale = Math.min(rect.width / (rx + rx), rect.height / (ry + ry));\n rx *= scale;\n ry *= scale;\n }\n const ref = CanvasKit.RRectXY(JsiSkRect.fromValue(CanvasKit, rect), rx, ry);\n super(CanvasKit, ref, \"RRect\");\n }\n\n get rx() {\n return this.ref[4];\n }\n\n get ry() {\n return this.ref[5];\n }\n\n get rect() {\n return new JsiSkRect(\n this.CanvasKit,\n Float32Array.of(this.ref[0], this.ref[1], this.ref[2], this.ref[3])\n );\n }\n}\n"],"mappings":";;;;;;;AAIA;;AACA;;;;AAEO,MAAMA,UAAN,SACGC,oBADH,CAGP;EAKkB,OAATC,SAAS,CAACC,SAAD,EAAuBC,IAAvB,EAAsC;IACpD,IAAIA,IAAI,YAAYC,oBAApB,EAA+B;MAC7B,OAAOD,IAAI,CAACE,GAAZ;IACD;;IACD,OAAOH,SAAS,CAACI,OAAV,CACLF,oBAAA,CAAUH,SAAV,CAAoBC,SAApB,EAA+BC,IAAI,CAACA,IAApC,CADK,EAELA,IAAI,CAACI,EAFA,EAGLJ,IAAI,CAACK,EAHA,CAAP;EAKD;;EAEDC,WAAW,CAACP,SAAD,EAAuBC,IAAvB,EAAqCI,EAArC,EAAiDC,EAAjD,EAA6D;IACtE;IACA,IAAID,EAAE,KAAKG,QAAP,IAAmBF,EAAE,KAAKE,QAA9B,EAAwC;MACtCH,EAAE,GAAGC,EAAE,GAAG,CAAV;IACD;;IACD,IAAIL,IAAI,CAACQ,KAAL,GAAaJ,EAAE,GAAGA,EAAlB,IAAwBJ,IAAI,CAACS,MAAL,GAAcJ,EAAE,GAAGA,EAA/C,EAAmD;MACjD;MACA,MAAMK,KAAK,GAAGC,IAAI,CAACC,GAAL,CAASZ,IAAI,CAACQ,KAAL,IAAcJ,EAAE,GAAGA,EAAnB,CAAT,EAAiCJ,IAAI,CAACS,MAAL,IAAeJ,EAAE,GAAGA,EAApB,CAAjC,CAAd;MACAD,EAAE,IAAIM,KAAN;MACAL,EAAE,IAAIK,KAAN;IACD;;IACD,MAAMR,GAAG,GAAGH,SAAS,CAACI,OAAV,CAAkBF,oBAAA,CAAUH,SAAV,CAAoBC,SAApB,EAA+BC,IAA/B,CAAlB,EAAwDI,EAAxD,EAA4DC,EAA5D,CAAZ;IACA,MAAMN,SAAN,EAAiBG,GAAjB,EAAsB,OAAtB;;IAZsE,iCAf9D,MAAM,CACd;IACD,CAauE;EAavE;;EAEK,IAAFE,EAAE,GAAG;IACP,OAAO,KAAKF,GAAL,CAAS,CAAT,CAAP;EACD;;EAEK,IAAFG,EAAE,GAAG;IACP,OAAO,KAAKH,GAAL,CAAS,CAAT,CAAP;EACD;;EAEO,IAAJF,IAAI,GAAG;IACT,OAAO,IAAIC,oBAAJ,CACL,KAAKF,SADA,EAELc,YAAY,CAACC,EAAb,CAAgB,KAAKZ,GAAL,CAAS,CAAT,CAAhB,EAA6B,KAAKA,GAAL,CAAS,CAAT,CAA7B,EAA0C,KAAKA,GAAL,CAAS,CAAT,CAA1C,EAAuD,KAAKA,GAAL,CAAS,CAAT,CAAvD,CAFK,CAAP;EAID;;AA5CH"}
@@ -4,4 +4,5 @@ import { HostObject } from "./Host";
4
4
  export declare type RSXform = Float32Array;
5
5
  export declare class JsiSkRSXform extends HostObject<RSXform, "RSXform"> implements SkRSXform {
6
6
  constructor(CanvasKit: CanvasKit, ref: RSXform);
7
+ dispose: () => void;
7
8
  }
@@ -7,9 +7,14 @@ exports.JsiSkRSXform = void 0;
7
7
 
8
8
  var _Host = require("./Host");
9
9
 
10
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
11
+
10
12
  class JsiSkRSXform extends _Host.HostObject {
11
13
  constructor(CanvasKit, ref) {
12
14
  super(CanvasKit, ref, "RSXform");
15
+
16
+ _defineProperty(this, "dispose", () => {// Do nothing in the web implementation
17
+ });
13
18
  }
14
19
 
15
20
  }
@@ -1 +1 @@
1
- {"version":3,"names":["JsiSkRSXform","HostObject","constructor","CanvasKit","ref"],"sources":["JsiSkRSXform.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type { SkRSXform } from \"../types\";\n\nimport { HostObject } from \"./Host\";\n\nexport type RSXform = Float32Array;\n\nexport class JsiSkRSXform\n extends HostObject<RSXform, \"RSXform\">\n implements SkRSXform\n{\n constructor(CanvasKit: CanvasKit, ref: RSXform) {\n super(CanvasKit, ref, \"RSXform\");\n }\n}\n"],"mappings":";;;;;;;AAIA;;AAIO,MAAMA,YAAN,SACGC,gBADH,CAGP;EACEC,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAqC;IAC9C,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,SAAtB;EACD;;AAHH"}
1
+ {"version":3,"names":["JsiSkRSXform","HostObject","constructor","CanvasKit","ref"],"sources":["JsiSkRSXform.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type { SkRSXform } from \"../types\";\n\nimport { HostObject } from \"./Host\";\n\nexport type RSXform = Float32Array;\n\nexport class JsiSkRSXform\n extends HostObject<RSXform, \"RSXform\">\n implements SkRSXform\n{\n constructor(CanvasKit: CanvasKit, ref: RSXform) {\n super(CanvasKit, ref, \"RSXform\");\n }\n\n dispose = () => {\n // Do nothing in the web implementation\n };\n}\n"],"mappings":";;;;;;;AAIA;;;;AAIO,MAAMA,YAAN,SACGC,gBADH,CAGP;EACEC,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAqC;IAC9C,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,SAAtB;;IAD8C,iCAItC,MAAM,CACd;IACD,CAN+C;EAE/C;;AAHH"}
@@ -3,6 +3,7 @@ import type { SkRect } from "../types";
3
3
  import { BaseHostObject } from "./Host";
4
4
  export declare class JsiSkRect extends BaseHostObject<Rect, "Rect"> implements SkRect {
5
5
  static fromValue(CanvasKit: CanvasKit, rect: SkRect): Float32Array;
6
+ dispose: () => void;
6
7
  constructor(CanvasKit: CanvasKit, ref: Rect);
7
8
  get x(): number;
8
9
  get y(): number;
@@ -7,6 +7,8 @@ exports.JsiSkRect = void 0;
7
7
 
8
8
  var _Host = require("./Host");
9
9
 
10
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
11
+
10
12
  class JsiSkRect extends _Host.BaseHostObject {
11
13
  static fromValue(CanvasKit, rect) {
12
14
  if (rect instanceof JsiSkRect) {
@@ -18,6 +20,9 @@ class JsiSkRect extends _Host.BaseHostObject {
18
20
 
19
21
  constructor(CanvasKit, ref) {
20
22
  super(CanvasKit, ref, "Rect");
23
+
24
+ _defineProperty(this, "dispose", () => {// Float32Array
25
+ });
21
26
  }
22
27
 
23
28
  get x() {
@@ -1 +1 @@
1
- {"version":3,"names":["JsiSkRect","BaseHostObject","fromValue","CanvasKit","rect","ref","XYWHRect","x","y","width","height","constructor"],"sources":["JsiSkRect.ts"],"sourcesContent":["import type { CanvasKit, Rect } from \"canvaskit-wasm\";\n\nimport type { SkRect } from \"../types\";\n\nimport { BaseHostObject } from \"./Host\";\n\nexport class JsiSkRect extends BaseHostObject<Rect, \"Rect\"> implements SkRect {\n static fromValue(CanvasKit: CanvasKit, rect: SkRect) {\n if (rect instanceof JsiSkRect) {\n return rect.ref;\n }\n return CanvasKit.XYWHRect(rect.x, rect.y, rect.width, rect.height);\n }\n\n constructor(CanvasKit: CanvasKit, ref: Rect) {\n super(CanvasKit, ref, \"Rect\");\n }\n\n get x() {\n return this.ref[0];\n }\n\n get y() {\n return this.ref[1];\n }\n\n get width() {\n return this.ref[2] - this.ref[0];\n }\n\n get height() {\n return this.ref[3] - this.ref[1];\n }\n}\n"],"mappings":";;;;;;;AAIA;;AAEO,MAAMA,SAAN,SAAwBC,oBAAxB,CAAuE;EAC5D,OAATC,SAAS,CAACC,SAAD,EAAuBC,IAAvB,EAAqC;IACnD,IAAIA,IAAI,YAAYJ,SAApB,EAA+B;MAC7B,OAAOI,IAAI,CAACC,GAAZ;IACD;;IACD,OAAOF,SAAS,CAACG,QAAV,CAAmBF,IAAI,CAACG,CAAxB,EAA2BH,IAAI,CAACI,CAAhC,EAAmCJ,IAAI,CAACK,KAAxC,EAA+CL,IAAI,CAACM,MAApD,CAAP;EACD;;EAEDC,WAAW,CAACR,SAAD,EAAuBE,GAAvB,EAAkC;IAC3C,MAAMF,SAAN,EAAiBE,GAAjB,EAAsB,MAAtB;EACD;;EAEI,IAADE,CAAC,GAAG;IACN,OAAO,KAAKF,GAAL,CAAS,CAAT,CAAP;EACD;;EAEI,IAADG,CAAC,GAAG;IACN,OAAO,KAAKH,GAAL,CAAS,CAAT,CAAP;EACD;;EAEQ,IAALI,KAAK,GAAG;IACV,OAAO,KAAKJ,GAAL,CAAS,CAAT,IAAc,KAAKA,GAAL,CAAS,CAAT,CAArB;EACD;;EAES,IAANK,MAAM,GAAG;IACX,OAAO,KAAKL,GAAL,CAAS,CAAT,IAAc,KAAKA,GAAL,CAAS,CAAT,CAArB;EACD;;AA1B2E"}
1
+ {"version":3,"names":["JsiSkRect","BaseHostObject","fromValue","CanvasKit","rect","ref","XYWHRect","x","y","width","height","constructor"],"sources":["JsiSkRect.ts"],"sourcesContent":["import type { CanvasKit, Rect } from \"canvaskit-wasm\";\n\nimport type { SkRect } from \"../types\";\n\nimport { BaseHostObject } from \"./Host\";\n\nexport class JsiSkRect extends BaseHostObject<Rect, \"Rect\"> implements SkRect {\n static fromValue(CanvasKit: CanvasKit, rect: SkRect) {\n if (rect instanceof JsiSkRect) {\n return rect.ref;\n }\n return CanvasKit.XYWHRect(rect.x, rect.y, rect.width, rect.height);\n }\n\n dispose = () => {\n // Float32Array\n };\n\n constructor(CanvasKit: CanvasKit, ref: Rect) {\n super(CanvasKit, ref, \"Rect\");\n }\n\n get x() {\n return this.ref[0];\n }\n\n get y() {\n return this.ref[1];\n }\n\n get width() {\n return this.ref[2] - this.ref[0];\n }\n\n get height() {\n return this.ref[3] - this.ref[1];\n }\n}\n"],"mappings":";;;;;;;AAIA;;;;AAEO,MAAMA,SAAN,SAAwBC,oBAAxB,CAAuE;EAC5D,OAATC,SAAS,CAACC,SAAD,EAAuBC,IAAvB,EAAqC;IACnD,IAAIA,IAAI,YAAYJ,SAApB,EAA+B;MAC7B,OAAOI,IAAI,CAACC,GAAZ;IACD;;IACD,OAAOF,SAAS,CAACG,QAAV,CAAmBF,IAAI,CAACG,CAAxB,EAA2BH,IAAI,CAACI,CAAhC,EAAmCJ,IAAI,CAACK,KAAxC,EAA+CL,IAAI,CAACM,MAApD,CAAP;EACD;;EAMDC,WAAW,CAACR,SAAD,EAAuBE,GAAvB,EAAkC;IAC3C,MAAMF,SAAN,EAAiBE,GAAjB,EAAsB,MAAtB;;IAD2C,iCAJnC,MAAM,CACd;IACD,CAE4C;EAE5C;;EAEI,IAADE,CAAC,GAAG;IACN,OAAO,KAAKF,GAAL,CAAS,CAAT,CAAP;EACD;;EAEI,IAADG,CAAC,GAAG;IACN,OAAO,KAAKH,GAAL,CAAS,CAAT,CAAP;EACD;;EAEQ,IAALI,KAAK,GAAG;IACV,OAAO,KAAKJ,GAAL,CAAS,CAAT,IAAc,KAAKA,GAAL,CAAS,CAAT,CAArB;EACD;;EAES,IAANK,MAAM,GAAG;IACX,OAAO,KAAKL,GAAL,CAAS,CAAT,IAAc,KAAKA,GAAL,CAAS,CAAT,CAArB;EACD;;AA9B2E"}
@@ -6,6 +6,7 @@ import { JsiSkShader } from "./JsiSkShader";
6
6
  export declare class JsiSkRuntimeEffect extends HostObject<RuntimeEffect, "RuntimeEffect"> implements SkRuntimeEffect {
7
7
  private sksl;
8
8
  constructor(CanvasKit: CanvasKit, ref: RuntimeEffect, sksl: string);
9
+ dispose: () => void;
9
10
  source(): string;
10
11
  makeShader(uniforms: number[], localMatrix?: SkMatrix): JsiSkShader;
11
12
  makeShaderWithChildren(uniforms: number[], children?: SkShader[], localMatrix?: SkMatrix): JsiSkShader;
@@ -11,10 +11,16 @@ var _JsiSkMatrix = require("./JsiSkMatrix");
11
11
 
12
12
  var _JsiSkShader = require("./JsiSkShader");
13
13
 
14
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
15
+
14
16
  class JsiSkRuntimeEffect extends _Host.HostObject {
15
17
  constructor(CanvasKit, ref, sksl) {
16
18
  super(CanvasKit, ref, "RuntimeEffect");
17
19
  this.sksl = sksl;
20
+
21
+ _defineProperty(this, "dispose", () => {
22
+ this.ref.delete();
23
+ });
18
24
  }
19
25
 
20
26
  source() {
@@ -1 +1 @@
1
- {"version":3,"names":["JsiSkRuntimeEffect","HostObject","constructor","CanvasKit","ref","sksl","source","makeShader","uniforms","localMatrix","JsiSkShader","undefined","JsiSkMatrix","fromValue","makeShaderWithChildren","children","map","child","getUniform","index","getUniformCount","getUniformFloatCount","getUniformName"],"sources":["JsiSkRuntimeEffect.ts"],"sourcesContent":["import type { CanvasKit, RuntimeEffect } from \"canvaskit-wasm\";\n\nimport type { SkMatrix, SkShader } from \"../types\";\nimport type { SkRuntimeEffect } from \"../types/RuntimeEffect/RuntimeEffect\";\n\nimport { HostObject } from \"./Host\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkShader } from \"./JsiSkShader\";\n\nexport class JsiSkRuntimeEffect\n extends HostObject<RuntimeEffect, \"RuntimeEffect\">\n implements SkRuntimeEffect\n{\n constructor(CanvasKit: CanvasKit, ref: RuntimeEffect, private sksl: string) {\n super(CanvasKit, ref, \"RuntimeEffect\");\n }\n\n source() {\n return this.sksl;\n }\n\n makeShader(uniforms: number[], localMatrix?: SkMatrix) {\n return new JsiSkShader(\n this.CanvasKit,\n this.ref.makeShader(\n uniforms,\n localMatrix !== undefined\n ? JsiSkMatrix.fromValue(localMatrix)\n : localMatrix\n )\n );\n }\n\n makeShaderWithChildren(\n uniforms: number[],\n children?: SkShader[],\n localMatrix?: SkMatrix\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.ref.makeShaderWithChildren(\n uniforms,\n children?.map((child) => JsiSkShader.fromValue(child)),\n localMatrix !== undefined\n ? JsiSkMatrix.fromValue(localMatrix)\n : localMatrix\n )\n );\n }\n\n getUniform(index: number) {\n return this.ref.getUniform(index);\n }\n\n getUniformCount() {\n return this.ref.getUniformCount();\n }\n\n getUniformFloatCount() {\n return this.ref.getUniformFloatCount();\n }\n\n getUniformName(index: number) {\n return this.ref.getUniformName(index);\n }\n}\n"],"mappings":";;;;;;;AAKA;;AACA;;AACA;;AAEO,MAAMA,kBAAN,SACGC,gBADH,CAGP;EACEC,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAmDC,IAAnD,EAAiE;IAC1E,MAAMF,SAAN,EAAiBC,GAAjB,EAAsB,eAAtB;IAD0E,KAAdC,IAAc,GAAdA,IAAc;EAE3E;;EAEDC,MAAM,GAAG;IACP,OAAO,KAAKD,IAAZ;EACD;;EAEDE,UAAU,CAACC,QAAD,EAAqBC,WAArB,EAA6C;IACrD,OAAO,IAAIC,wBAAJ,CACL,KAAKP,SADA,EAEL,KAAKC,GAAL,CAASG,UAAT,CACEC,QADF,EAEEC,WAAW,KAAKE,SAAhB,GACIC,wBAAA,CAAYC,SAAZ,CAAsBJ,WAAtB,CADJ,GAEIA,WAJN,CAFK,CAAP;EASD;;EAEDK,sBAAsB,CACpBN,QADoB,EAEpBO,QAFoB,EAGpBN,WAHoB,EAIpB;IACA,OAAO,IAAIC,wBAAJ,CACL,KAAKP,SADA,EAEL,KAAKC,GAAL,CAASU,sBAAT,CACEN,QADF,EAEEO,QAFF,aAEEA,QAFF,uBAEEA,QAAQ,CAAEC,GAAV,CAAeC,KAAD,IAAWP,wBAAA,CAAYG,SAAZ,CAAsBI,KAAtB,CAAzB,CAFF,EAGER,WAAW,KAAKE,SAAhB,GACIC,wBAAA,CAAYC,SAAZ,CAAsBJ,WAAtB,CADJ,GAEIA,WALN,CAFK,CAAP;EAUD;;EAEDS,UAAU,CAACC,KAAD,EAAgB;IACxB,OAAO,KAAKf,GAAL,CAASc,UAAT,CAAoBC,KAApB,CAAP;EACD;;EAEDC,eAAe,GAAG;IAChB,OAAO,KAAKhB,GAAL,CAASgB,eAAT,EAAP;EACD;;EAEDC,oBAAoB,GAAG;IACrB,OAAO,KAAKjB,GAAL,CAASiB,oBAAT,EAAP;EACD;;EAEDC,cAAc,CAACH,KAAD,EAAgB;IAC5B,OAAO,KAAKf,GAAL,CAASkB,cAAT,CAAwBH,KAAxB,CAAP;EACD;;AApDH"}
1
+ {"version":3,"names":["JsiSkRuntimeEffect","HostObject","constructor","CanvasKit","ref","sksl","delete","source","makeShader","uniforms","localMatrix","JsiSkShader","undefined","JsiSkMatrix","fromValue","makeShaderWithChildren","children","map","child","getUniform","index","getUniformCount","getUniformFloatCount","getUniformName"],"sources":["JsiSkRuntimeEffect.ts"],"sourcesContent":["import type { CanvasKit, RuntimeEffect } from \"canvaskit-wasm\";\n\nimport type { SkMatrix, SkShader } from \"../types\";\nimport type { SkRuntimeEffect } from \"../types/RuntimeEffect/RuntimeEffect\";\n\nimport { HostObject } from \"./Host\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkShader } from \"./JsiSkShader\";\n\nexport class JsiSkRuntimeEffect\n extends HostObject<RuntimeEffect, \"RuntimeEffect\">\n implements SkRuntimeEffect\n{\n constructor(CanvasKit: CanvasKit, ref: RuntimeEffect, private sksl: string) {\n super(CanvasKit, ref, \"RuntimeEffect\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n\n source() {\n return this.sksl;\n }\n\n makeShader(uniforms: number[], localMatrix?: SkMatrix) {\n return new JsiSkShader(\n this.CanvasKit,\n this.ref.makeShader(\n uniforms,\n localMatrix !== undefined\n ? JsiSkMatrix.fromValue(localMatrix)\n : localMatrix\n )\n );\n }\n\n makeShaderWithChildren(\n uniforms: number[],\n children?: SkShader[],\n localMatrix?: SkMatrix\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.ref.makeShaderWithChildren(\n uniforms,\n children?.map((child) => JsiSkShader.fromValue(child)),\n localMatrix !== undefined\n ? JsiSkMatrix.fromValue(localMatrix)\n : localMatrix\n )\n );\n }\n\n getUniform(index: number) {\n return this.ref.getUniform(index);\n }\n\n getUniformCount() {\n return this.ref.getUniformCount();\n }\n\n getUniformFloatCount() {\n return this.ref.getUniformFloatCount();\n }\n\n getUniformName(index: number) {\n return this.ref.getUniformName(index);\n }\n}\n"],"mappings":";;;;;;;AAKA;;AACA;;AACA;;;;AAEO,MAAMA,kBAAN,SACGC,gBADH,CAGP;EACEC,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAmDC,IAAnD,EAAiE;IAC1E,MAAMF,SAAN,EAAiBC,GAAjB,EAAsB,eAAtB;IAD0E,KAAdC,IAAc,GAAdA,IAAc;;IAAA,iCAIlE,MAAM;MACd,KAAKD,GAAL,CAASE,MAAT;IACD,CAN2E;EAE3E;;EAMDC,MAAM,GAAG;IACP,OAAO,KAAKF,IAAZ;EACD;;EAEDG,UAAU,CAACC,QAAD,EAAqBC,WAArB,EAA6C;IACrD,OAAO,IAAIC,wBAAJ,CACL,KAAKR,SADA,EAEL,KAAKC,GAAL,CAASI,UAAT,CACEC,QADF,EAEEC,WAAW,KAAKE,SAAhB,GACIC,wBAAA,CAAYC,SAAZ,CAAsBJ,WAAtB,CADJ,GAEIA,WAJN,CAFK,CAAP;EASD;;EAEDK,sBAAsB,CACpBN,QADoB,EAEpBO,QAFoB,EAGpBN,WAHoB,EAIpB;IACA,OAAO,IAAIC,wBAAJ,CACL,KAAKR,SADA,EAEL,KAAKC,GAAL,CAASW,sBAAT,CACEN,QADF,EAEEO,QAFF,aAEEA,QAFF,uBAEEA,QAAQ,CAAEC,GAAV,CAAeC,KAAD,IAAWP,wBAAA,CAAYG,SAAZ,CAAsBI,KAAtB,CAAzB,CAFF,EAGER,WAAW,KAAKE,SAAhB,GACIC,wBAAA,CAAYC,SAAZ,CAAsBJ,WAAtB,CADJ,GAEIA,WALN,CAFK,CAAP;EAUD;;EAEDS,UAAU,CAACC,KAAD,EAAgB;IACxB,OAAO,KAAKhB,GAAL,CAASe,UAAT,CAAoBC,KAApB,CAAP;EACD;;EAEDC,eAAe,GAAG;IAChB,OAAO,KAAKjB,GAAL,CAASiB,eAAT,EAAP;EACD;;EAEDC,oBAAoB,GAAG;IACrB,OAAO,KAAKlB,GAAL,CAASkB,oBAAT,EAAP;EACD;;EAEDC,cAAc,CAACH,KAAD,EAAgB;IAC5B,OAAO,KAAKhB,GAAL,CAASmB,cAAT,CAAwBH,KAAxB,CAAP;EACD;;AAxDH"}
@@ -3,4 +3,5 @@ import type { SkShader } from "../types";
3
3
  import { HostObject } from "./Host";
4
4
  export declare class JsiSkShader extends HostObject<Shader, "Shader"> implements SkShader {
5
5
  constructor(CanvasKit: CanvasKit, ref: Shader);
6
+ dispose: () => void;
6
7
  }
@@ -7,9 +7,15 @@ exports.JsiSkShader = void 0;
7
7
 
8
8
  var _Host = require("./Host");
9
9
 
10
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
11
+
10
12
  class JsiSkShader extends _Host.HostObject {
11
13
  constructor(CanvasKit, ref) {
12
14
  super(CanvasKit, ref, "Shader");
15
+
16
+ _defineProperty(this, "dispose", () => {
17
+ this.ref.delete();
18
+ });
13
19
  }
14
20
 
15
21
  }
@@ -1 +1 @@
1
- {"version":3,"names":["JsiSkShader","HostObject","constructor","CanvasKit","ref"],"sources":["JsiSkShader.ts"],"sourcesContent":["import type { CanvasKit, Shader } from \"canvaskit-wasm\";\n\nimport type { SkShader } from \"../types\";\n\nimport { HostObject } from \"./Host\";\n\nexport class JsiSkShader\n extends HostObject<Shader, \"Shader\">\n implements SkShader\n{\n constructor(CanvasKit: CanvasKit, ref: Shader) {\n super(CanvasKit, ref, \"Shader\");\n }\n}\n"],"mappings":";;;;;;;AAIA;;AAEO,MAAMA,WAAN,SACGC,gBADH,CAGP;EACEC,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAoC;IAC7C,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,QAAtB;EACD;;AAHH"}
1
+ {"version":3,"names":["JsiSkShader","HostObject","constructor","CanvasKit","ref","delete"],"sources":["JsiSkShader.ts"],"sourcesContent":["import type { CanvasKit, Shader } from \"canvaskit-wasm\";\n\nimport type { SkShader } from \"../types\";\n\nimport { HostObject } from \"./Host\";\n\nexport class JsiSkShader\n extends HostObject<Shader, \"Shader\">\n implements SkShader\n{\n constructor(CanvasKit: CanvasKit, ref: Shader) {\n super(CanvasKit, ref, \"Shader\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n}\n"],"mappings":";;;;;;;AAIA;;;;AAEO,MAAMA,WAAN,SACGC,gBADH,CAGP;EACEC,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAoC;IAC7C,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,QAAtB;;IAD6C,iCAIrC,MAAM;MACd,KAAKA,GAAL,CAASC,MAAT;IACD,CAN8C;EAE9C;;AAHH"}
@@ -3,6 +3,7 @@ import type { SkCanvas, SkImage, SkRect, SkSurface } from "../types";
3
3
  import { HostObject } from "./Host";
4
4
  export declare class JsiSkSurface extends HostObject<Surface, "Surface"> implements SkSurface {
5
5
  constructor(CanvasKit: CanvasKit, ref: Surface);
6
+ dispose: () => void;
6
7
  flush(): void;
7
8
  getCanvas(): SkCanvas;
8
9
  makeImageSnapshot(bounds?: SkRect): SkImage;
@@ -13,9 +13,15 @@ var _JsiSkImage = require("./JsiSkImage");
13
13
 
14
14
  var _JsiSkRect = require("./JsiSkRect");
15
15
 
16
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
17
+
16
18
  class JsiSkSurface extends _Host.HostObject {
17
19
  constructor(CanvasKit, ref) {
18
20
  super(CanvasKit, ref, "Surface");
21
+
22
+ _defineProperty(this, "dispose", () => {
23
+ this.ref.delete();
24
+ });
19
25
  }
20
26
 
21
27
  flush() {
@@ -1 +1 @@
1
- {"version":3,"names":["JsiSkSurface","HostObject","constructor","CanvasKit","ref","flush","getCanvas","JsiSkCanvas","makeImageSnapshot","bounds","image","Array","from","JsiSkRect","fromValue","undefined","JsiSkImage"],"sources":["JsiSkSurface.ts"],"sourcesContent":["import type { CanvasKit, Surface } from \"canvaskit-wasm\";\n\nimport type { SkCanvas, SkImage, SkRect, SkSurface } from \"../types\";\n\nimport { HostObject } from \"./Host\";\nimport { JsiSkCanvas } from \"./JsiSkCanvas\";\nimport { JsiSkImage } from \"./JsiSkImage\";\nimport { JsiSkRect } from \"./JsiSkRect\";\n\nexport class JsiSkSurface\n extends HostObject<Surface, \"Surface\">\n implements SkSurface\n{\n constructor(CanvasKit: CanvasKit, ref: Surface) {\n super(CanvasKit, ref, \"Surface\");\n }\n\n flush() {\n this.ref.flush();\n }\n\n getCanvas(): SkCanvas {\n return new JsiSkCanvas(this.CanvasKit, this.ref.getCanvas());\n }\n\n makeImageSnapshot(bounds?: SkRect): SkImage {\n const image = this.ref.makeImageSnapshot(\n bounds\n ? Array.from(JsiSkRect.fromValue(this.CanvasKit, bounds))\n : undefined\n );\n return new JsiSkImage(this.CanvasKit, image);\n }\n}\n"],"mappings":";;;;;;;AAIA;;AACA;;AACA;;AACA;;AAEO,MAAMA,YAAN,SACGC,gBADH,CAGP;EACEC,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAqC;IAC9C,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,SAAtB;EACD;;EAEDC,KAAK,GAAG;IACN,KAAKD,GAAL,CAASC,KAAT;EACD;;EAEDC,SAAS,GAAa;IACpB,OAAO,IAAIC,wBAAJ,CAAgB,KAAKJ,SAArB,EAAgC,KAAKC,GAAL,CAASE,SAAT,EAAhC,CAAP;EACD;;EAEDE,iBAAiB,CAACC,MAAD,EAA2B;IAC1C,MAAMC,KAAK,GAAG,KAAKN,GAAL,CAASI,iBAAT,CACZC,MAAM,GACFE,KAAK,CAACC,IAAN,CAAWC,oBAAA,CAAUC,SAAV,CAAoB,KAAKX,SAAzB,EAAoCM,MAApC,CAAX,CADE,GAEFM,SAHQ,CAAd;IAKA,OAAO,IAAIC,sBAAJ,CAAe,KAAKb,SAApB,EAA+BO,KAA/B,CAAP;EACD;;AApBH"}
1
+ {"version":3,"names":["JsiSkSurface","HostObject","constructor","CanvasKit","ref","delete","flush","getCanvas","JsiSkCanvas","makeImageSnapshot","bounds","image","Array","from","JsiSkRect","fromValue","undefined","JsiSkImage"],"sources":["JsiSkSurface.ts"],"sourcesContent":["import type { CanvasKit, Surface } from \"canvaskit-wasm\";\n\nimport type { SkCanvas, SkImage, SkRect, SkSurface } from \"../types\";\n\nimport { HostObject } from \"./Host\";\nimport { JsiSkCanvas } from \"./JsiSkCanvas\";\nimport { JsiSkImage } from \"./JsiSkImage\";\nimport { JsiSkRect } from \"./JsiSkRect\";\n\nexport class JsiSkSurface\n extends HostObject<Surface, \"Surface\">\n implements SkSurface\n{\n constructor(CanvasKit: CanvasKit, ref: Surface) {\n super(CanvasKit, ref, \"Surface\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n\n flush() {\n this.ref.flush();\n }\n\n getCanvas(): SkCanvas {\n return new JsiSkCanvas(this.CanvasKit, this.ref.getCanvas());\n }\n\n makeImageSnapshot(bounds?: SkRect): SkImage {\n const image = this.ref.makeImageSnapshot(\n bounds\n ? Array.from(JsiSkRect.fromValue(this.CanvasKit, bounds))\n : undefined\n );\n return new JsiSkImage(this.CanvasKit, image);\n }\n}\n"],"mappings":";;;;;;;AAIA;;AACA;;AACA;;AACA;;;;AAEO,MAAMA,YAAN,SACGC,gBADH,CAGP;EACEC,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAqC;IAC9C,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,SAAtB;;IAD8C,iCAItC,MAAM;MACd,KAAKA,GAAL,CAASC,MAAT;IACD,CAN+C;EAE/C;;EAMDC,KAAK,GAAG;IACN,KAAKF,GAAL,CAASE,KAAT;EACD;;EAEDC,SAAS,GAAa;IACpB,OAAO,IAAIC,wBAAJ,CAAgB,KAAKL,SAArB,EAAgC,KAAKC,GAAL,CAASG,SAAT,EAAhC,CAAP;EACD;;EAEDE,iBAAiB,CAACC,MAAD,EAA2B;IAC1C,MAAMC,KAAK,GAAG,KAAKP,GAAL,CAASK,iBAAT,CACZC,MAAM,GACFE,KAAK,CAACC,IAAN,CAAWC,oBAAA,CAAUC,SAAV,CAAoB,KAAKZ,SAAzB,EAAoCO,MAApC,CAAX,CADE,GAEFM,SAHQ,CAAd;IAKA,OAAO,IAAIC,sBAAJ,CAAe,KAAKd,SAApB,EAA+BQ,KAA/B,CAAP;EACD;;AAxBH"}
@@ -3,4 +3,5 @@ import type { SkTextBlob } from "../types";
3
3
  import { HostObject } from "./Host";
4
4
  export declare class JsiSkTextBlob extends HostObject<TextBlob, "TextBlob"> implements SkTextBlob {
5
5
  constructor(CanvasKit: CanvasKit, ref: TextBlob);
6
+ dispose: () => void;
6
7
  }
@@ -7,9 +7,15 @@ exports.JsiSkTextBlob = void 0;
7
7
 
8
8
  var _Host = require("./Host");
9
9
 
10
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
11
+
10
12
  class JsiSkTextBlob extends _Host.HostObject {
11
13
  constructor(CanvasKit, ref) {
12
14
  super(CanvasKit, ref, "TextBlob");
15
+
16
+ _defineProperty(this, "dispose", () => {
17
+ this.ref.delete();
18
+ });
13
19
  }
14
20
 
15
21
  }
@@ -1 +1 @@
1
- {"version":3,"names":["JsiSkTextBlob","HostObject","constructor","CanvasKit","ref"],"sources":["JsiSkTextBlob.ts"],"sourcesContent":["import type { CanvasKit, TextBlob } from \"canvaskit-wasm\";\n\nimport type { SkTextBlob } from \"../types\";\n\nimport { HostObject } from \"./Host\";\n\nexport class JsiSkTextBlob\n extends HostObject<TextBlob, \"TextBlob\">\n implements SkTextBlob\n{\n constructor(CanvasKit: CanvasKit, ref: TextBlob) {\n super(CanvasKit, ref, \"TextBlob\");\n }\n}\n"],"mappings":";;;;;;;AAIA;;AAEO,MAAMA,aAAN,SACGC,gBADH,CAGP;EACEC,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAsC;IAC/C,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,UAAtB;EACD;;AAHH"}
1
+ {"version":3,"names":["JsiSkTextBlob","HostObject","constructor","CanvasKit","ref","delete"],"sources":["JsiSkTextBlob.ts"],"sourcesContent":["import type { CanvasKit, TextBlob } from \"canvaskit-wasm\";\n\nimport type { SkTextBlob } from \"../types\";\n\nimport { HostObject } from \"./Host\";\n\nexport class JsiSkTextBlob\n extends HostObject<TextBlob, \"TextBlob\">\n implements SkTextBlob\n{\n constructor(CanvasKit: CanvasKit, ref: TextBlob) {\n super(CanvasKit, ref, \"TextBlob\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n}\n"],"mappings":";;;;;;;AAIA;;;;AAEO,MAAMA,aAAN,SACGC,gBADH,CAGP;EACEC,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAsC;IAC/C,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,UAAtB;;IAD+C,iCAIvC,MAAM;MACd,KAAKA,GAAL,CAASC,MAAT;IACD,CANgD;EAEhD;;AAHH"}
@@ -5,5 +5,5 @@ export declare class JsiSkTypeface extends HostObject<Typeface, "Typeface"> impl
5
5
  constructor(CanvasKit: CanvasKit, ref: Typeface);
6
6
  get bold(): boolean;
7
7
  get italic(): boolean;
8
- dispose(): void;
8
+ dispose: () => void;
9
9
  }
@@ -7,9 +7,15 @@ exports.JsiSkTypeface = void 0;
7
7
 
8
8
  var _Host = require("./Host");
9
9
 
10
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
11
+
10
12
  class JsiSkTypeface extends _Host.HostObject {
11
13
  constructor(CanvasKit, ref) {
12
14
  super(CanvasKit, ref, "Typeface");
15
+
16
+ _defineProperty(this, "dispose", () => {
17
+ this.ref.delete();
18
+ });
13
19
  }
14
20
 
15
21
  get bold() {
@@ -22,10 +28,6 @@ class JsiSkTypeface extends _Host.HostObject {
22
28
  return false;
23
29
  }
24
30
 
25
- dispose() {
26
- this.ref.delete();
27
- }
28
-
29
31
  }
30
32
 
31
33
  exports.JsiSkTypeface = JsiSkTypeface;
@@ -1 +1 @@
1
- {"version":3,"names":["JsiSkTypeface","HostObject","constructor","CanvasKit","ref","bold","console","warn","italic","dispose","delete"],"sources":["JsiSkTypeface.ts"],"sourcesContent":["import type { CanvasKit, Typeface } from \"canvaskit-wasm\";\n\nimport type { SkTypeface } from \"../types\";\n\nimport { HostObject } from \"./Host\";\n\nexport class JsiSkTypeface\n extends HostObject<Typeface, \"Typeface\">\n implements SkTypeface\n{\n constructor(CanvasKit: CanvasKit, ref: Typeface) {\n super(CanvasKit, ref, \"Typeface\");\n }\n\n get bold(): boolean {\n console.warn(\n \"Typeface.bold is deprecated and will be removed in a future release. The property will return false.\"\n );\n return false;\n }\n\n get italic(): boolean {\n console.warn(\n \"Typeface.italic is deprecated and will be removed in a future release. The property will return false.\"\n );\n return false;\n }\n\n dispose() {\n this.ref.delete();\n }\n}\n"],"mappings":";;;;;;;AAIA;;AAEO,MAAMA,aAAN,SACGC,gBADH,CAGP;EACEC,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAsC;IAC/C,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,UAAtB;EACD;;EAEO,IAAJC,IAAI,GAAY;IAClBC,OAAO,CAACC,IAAR,CACE,sGADF;IAGA,OAAO,KAAP;EACD;;EAES,IAANC,MAAM,GAAY;IACpBF,OAAO,CAACC,IAAR,CACE,wGADF;IAGA,OAAO,KAAP;EACD;;EAEDE,OAAO,GAAG;IACR,KAAKL,GAAL,CAASM,MAAT;EACD;;AArBH"}
1
+ {"version":3,"names":["JsiSkTypeface","HostObject","constructor","CanvasKit","ref","delete","bold","console","warn","italic"],"sources":["JsiSkTypeface.ts"],"sourcesContent":["import type { CanvasKit, Typeface } from \"canvaskit-wasm\";\n\nimport type { SkTypeface } from \"../types\";\n\nimport { HostObject } from \"./Host\";\n\nexport class JsiSkTypeface\n extends HostObject<Typeface, \"Typeface\">\n implements SkTypeface\n{\n constructor(CanvasKit: CanvasKit, ref: Typeface) {\n super(CanvasKit, ref, \"Typeface\");\n }\n\n get bold(): boolean {\n console.warn(\n \"Typeface.bold is deprecated and will be removed in a future release. The property will return false.\"\n );\n return false;\n }\n\n get italic(): boolean {\n console.warn(\n \"Typeface.italic is deprecated and will be removed in a future release. The property will return false.\"\n );\n return false;\n }\n\n dispose = () => {\n this.ref.delete();\n };\n}\n"],"mappings":";;;;;;;AAIA;;;;AAEO,MAAMA,aAAN,SACGC,gBADH,CAGP;EACEC,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAsC;IAC/C,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,UAAtB;;IAD+C,iCAkBvC,MAAM;MACd,KAAKA,GAAL,CAASC,MAAT;IACD,CApBgD;EAEhD;;EAEO,IAAJC,IAAI,GAAY;IAClBC,OAAO,CAACC,IAAR,CACE,sGADF;IAGA,OAAO,KAAP;EACD;;EAES,IAANC,MAAM,GAAY;IACpBF,OAAO,CAACC,IAAR,CACE,wGADF;IAGA,OAAO,KAAP;EACD;;AAjBH"}
@@ -4,6 +4,7 @@ import { HostObject } from "./Host";
4
4
  import { JsiSkRect } from "./JsiSkRect";
5
5
  export declare class JsiSkVertices extends HostObject<Vertices, "Vertices"> implements SkVertices {
6
6
  constructor(CanvasKit: CanvasKit, ref: Vertices);
7
+ dispose: () => void;
7
8
  bounds(): JsiSkRect;
8
9
  uniqueID(): number;
9
10
  }
@@ -9,9 +9,15 @@ var _Host = require("./Host");
9
9
 
10
10
  var _JsiSkRect = require("./JsiSkRect");
11
11
 
12
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
13
+
12
14
  class JsiSkVertices extends _Host.HostObject {
13
15
  constructor(CanvasKit, ref) {
14
16
  super(CanvasKit, ref, "Vertices");
17
+
18
+ _defineProperty(this, "dispose", () => {
19
+ this.ref.delete();
20
+ });
15
21
  }
16
22
 
17
23
  bounds() {
@@ -1 +1 @@
1
- {"version":3,"names":["JsiSkVertices","HostObject","constructor","CanvasKit","ref","bounds","JsiSkRect","uniqueID"],"sources":["JsiSkVertices.ts"],"sourcesContent":["import type { CanvasKit, Vertices } from \"canvaskit-wasm\";\n\nimport type { SkVertices } from \"../types\";\n\nimport { HostObject } from \"./Host\";\nimport { JsiSkRect } from \"./JsiSkRect\";\n\nexport class JsiSkVertices\n extends HostObject<Vertices, \"Vertices\">\n implements SkVertices\n{\n constructor(CanvasKit: CanvasKit, ref: Vertices) {\n super(CanvasKit, ref, \"Vertices\");\n }\n\n bounds() {\n return new JsiSkRect(this.CanvasKit, this.ref.bounds());\n }\n\n uniqueID() {\n return this.ref.uniqueID();\n }\n}\n"],"mappings":";;;;;;;AAIA;;AACA;;AAEO,MAAMA,aAAN,SACGC,gBADH,CAGP;EACEC,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAsC;IAC/C,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,UAAtB;EACD;;EAEDC,MAAM,GAAG;IACP,OAAO,IAAIC,oBAAJ,CAAc,KAAKH,SAAnB,EAA8B,KAAKC,GAAL,CAASC,MAAT,EAA9B,CAAP;EACD;;EAEDE,QAAQ,GAAG;IACT,OAAO,KAAKH,GAAL,CAASG,QAAT,EAAP;EACD;;AAXH"}
1
+ {"version":3,"names":["JsiSkVertices","HostObject","constructor","CanvasKit","ref","delete","bounds","JsiSkRect","uniqueID"],"sources":["JsiSkVertices.ts"],"sourcesContent":["import type { CanvasKit, Vertices } from \"canvaskit-wasm\";\n\nimport type { SkVertices } from \"../types\";\n\nimport { HostObject } from \"./Host\";\nimport { JsiSkRect } from \"./JsiSkRect\";\n\nexport class JsiSkVertices\n extends HostObject<Vertices, \"Vertices\">\n implements SkVertices\n{\n constructor(CanvasKit: CanvasKit, ref: Vertices) {\n super(CanvasKit, ref, \"Vertices\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n\n bounds() {\n return new JsiSkRect(this.CanvasKit, this.ref.bounds());\n }\n\n uniqueID() {\n return this.ref.uniqueID();\n }\n}\n"],"mappings":";;;;;;;AAIA;;AACA;;;;AAEO,MAAMA,aAAN,SACGC,gBADH,CAGP;EACEC,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAsC;IAC/C,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,UAAtB;;IAD+C,iCAIvC,MAAM;MACd,KAAKA,GAAL,CAASC,MAAT;IACD,CANgD;EAEhD;;EAMDC,MAAM,GAAG;IACP,OAAO,IAAIC,oBAAJ,CAAc,KAAKJ,SAAnB,EAA8B,KAAKC,GAAL,CAASE,MAAT,EAA9B,CAAP;EACD;;EAEDE,QAAQ,GAAG;IACT,OAAO,KAAKJ,GAAL,CAASI,QAAT,EAAP;EACD;;AAfH"}
@@ -21,7 +21,7 @@ var _Animations = require("../../renderer/processors/Animations");
21
21
  const useComputedValue = (cb, values) => {
22
22
  const value = (0, _react.useMemo)(() => _api.ValueApi.createComputedValue(cb, values.filter(_Animations.isValue)), // eslint-disable-next-line react-hooks/exhaustive-deps
23
23
  values);
24
- (0, _react.useEffect)(() => () => value.__invalidate(), [value]);
24
+ (0, _react.useEffect)(() => () => value.dispose(), [value]);
25
25
  return value;
26
26
  };
27
27
 
@@ -1 +1 @@
1
- {"version":3,"names":["useComputedValue","cb","values","value","useMemo","ValueApi","createComputedValue","filter","isValue","useEffect","__invalidate"],"sources":["useComputedValue.ts"],"sourcesContent":["import { useEffect, useMemo } from \"react\";\n\nimport { ValueApi } from \"../api\";\nimport { isValue } from \"../../renderer/processors/Animations\";\n\n/**\n * Creates a new computed value - a value that will calculate its value depending\n * on other values.\n * @param cb Callback to calculate new value\n * @param values Dependant values\n * @returns A readonly value\n */\nexport const useComputedValue = <R>(cb: () => R, values: unknown[]) => {\n const value = useMemo(\n () => ValueApi.createComputedValue<R>(cb, values.filter(isValue)),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n values\n );\n useEffect(() => () => value.__invalidate(), [value]);\n return value;\n};\n"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,gBAAgB,GAAG,CAAIC,EAAJ,EAAiBC,MAAjB,KAAuC;EACrE,MAAMC,KAAK,GAAG,IAAAC,cAAA,EACZ,MAAMC,aAAA,CAASC,mBAAT,CAAgCL,EAAhC,EAAoCC,MAAM,CAACK,MAAP,CAAcC,mBAAd,CAApC,CADM,EAEZ;EACAN,MAHY,CAAd;EAKA,IAAAO,gBAAA,EAAU,MAAM,MAAMN,KAAK,CAACO,YAAN,EAAtB,EAA4C,CAACP,KAAD,CAA5C;EACA,OAAOA,KAAP;AACD,CARM"}
1
+ {"version":3,"names":["useComputedValue","cb","values","value","useMemo","ValueApi","createComputedValue","filter","isValue","useEffect","dispose"],"sources":["useComputedValue.ts"],"sourcesContent":["import { useEffect, useMemo } from \"react\";\n\nimport { ValueApi } from \"../api\";\nimport { isValue } from \"../../renderer/processors/Animations\";\n\n/**\n * Creates a new computed value - a value that will calculate its value depending\n * on other values.\n * @param cb Callback to calculate new value\n * @param values Dependant values\n * @returns A readonly value\n */\nexport const useComputedValue = <R>(cb: () => R, values: unknown[]) => {\n const value = useMemo(\n () => ValueApi.createComputedValue<R>(cb, values.filter(isValue)),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n values\n );\n useEffect(() => () => value.dispose(), [value]);\n return value;\n};\n"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,gBAAgB,GAAG,CAAIC,EAAJ,EAAiBC,MAAjB,KAAuC;EACrE,MAAMC,KAAK,GAAG,IAAAC,cAAA,EACZ,MAAMC,aAAA,CAASC,mBAAT,CAAgCL,EAAhC,EAAoCC,MAAM,CAACK,MAAP,CAAcC,mBAAd,CAApC,CADM,EAEZ;EACAN,MAHY,CAAd;EAKA,IAAAO,gBAAA,EAAU,MAAM,MAAMN,KAAK,CAACO,OAAN,EAAtB,EAAuC,CAACP,KAAD,CAAvC;EACA,OAAOA,KAAP;AACD,CARM"}
@@ -11,7 +11,7 @@ export interface SkiaValue<T = number> {
11
11
  /**
12
12
  * Invalidates the value. Has different meaning depending on the type of the value.
13
13
  */
14
- __invalidate: () => void;
14
+ dispose: () => void;
15
15
  /**
16
16
  * Field to make typechecking easier
17
17
  */
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["export interface SkiaValue<T = number> {\n /**\n * Gets the value hold by the Value object\n */\n readonly current: T;\n /**\n * Adds a listener that is called when value changes.\n * Returns unsubscribe method.\n */\n addListener: (cb: (value: T) => void) => () => void;\n /**\n * Invalidates the value. Has different meaning depending on the type of the value.\n */\n __invalidate: () => void;\n /**\n * Field to make typechecking easier\n */\n __typename__: \"RNSkValue\";\n}\n\nexport interface SkiaMutableValue<T = number> extends SkiaValue<T> {\n /**\n * Get/sets the value hold by the Value object\n */\n current: T;\n /**\n * Get/sets the animation controlling the value\n * */\n animation: SkiaAnimation | undefined;\n}\n\nexport interface SkiaClockValue extends SkiaValue<number> {\n start: () => void;\n stop: () => void;\n}\n\nexport interface SkiaAnimation extends SkiaClockValue {\n cancel: () => void;\n}\n\nexport interface AnimationState {\n current: number;\n finished: boolean;\n}\n\nexport interface ISkiaValueApi {\n /**\n * Creates a new value that holds the initial value and that\n * can be changed.\n */\n createValue: <T>(initialValue: T) => SkiaMutableValue<T>;\n /**\n * Creates a computed value. This is a calculated value that returns the result of\n * a function that is called with the values of the dependencies.\n */\n createComputedValue: <R>(\n cb: () => R,\n values: Array<SkiaValue<unknown>>\n ) => SkiaValue<R>;\n /**\n * Creates a clock value where the value is the number of milliseconds elapsed\n * since the clock was created\n */\n createClockValue: () => SkiaClockValue;\n /**\n * Creates an animation that is driven from a clock and updated every frame.\n * @param cb Callback to calculate next value from time.\n * @returns An animation object that can control a value.\n */\n createAnimation: <S extends AnimationState = AnimationState>(\n cb: (t: number, state: S | undefined) => S\n ) => SkiaAnimation;\n}\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["export interface SkiaValue<T = number> {\n /**\n * Gets the value hold by the Value object\n */\n readonly current: T;\n /**\n * Adds a listener that is called when value changes.\n * Returns unsubscribe method.\n */\n addListener: (cb: (value: T) => void) => () => void;\n /**\n * Invalidates the value. Has different meaning depending on the type of the value.\n */\n dispose: () => void;\n /**\n * Field to make typechecking easier\n */\n __typename__: \"RNSkValue\";\n}\n\nexport interface SkiaMutableValue<T = number> extends SkiaValue<T> {\n /**\n * Get/sets the value hold by the Value object\n */\n current: T;\n /**\n * Get/sets the animation controlling the value\n * */\n animation: SkiaAnimation | undefined;\n}\n\nexport interface SkiaClockValue extends SkiaValue<number> {\n start: () => void;\n stop: () => void;\n}\n\nexport interface SkiaAnimation extends SkiaClockValue {\n cancel: () => void;\n}\n\nexport interface AnimationState {\n current: number;\n finished: boolean;\n}\n\nexport interface ISkiaValueApi {\n /**\n * Creates a new value that holds the initial value and that\n * can be changed.\n */\n createValue: <T>(initialValue: T) => SkiaMutableValue<T>;\n /**\n * Creates a computed value. This is a calculated value that returns the result of\n * a function that is called with the values of the dependencies.\n */\n createComputedValue: <R>(\n cb: () => R,\n values: Array<SkiaValue<unknown>>\n ) => SkiaValue<R>;\n /**\n * Creates a clock value where the value is the number of milliseconds elapsed\n * since the clock was created\n */\n createClockValue: () => SkiaClockValue;\n /**\n * Creates an animation that is driven from a clock and updated every frame.\n * @param cb Callback to calculate next value from time.\n * @returns An animation object that can control a value.\n */\n createAnimation: <S extends AnimationState = AnimationState>(\n cb: (t: number, state: S | undefined) => S\n ) => SkiaAnimation;\n}\n"],"mappings":""}
@@ -6,5 +6,5 @@ export declare class RNSkComputedValue<T> extends RNSkReadonlyValue<T> {
6
6
  private _callback;
7
7
  private _unsubscribers;
8
8
  unsubscribe(): void;
9
- __invalidate(): void;
9
+ dispose(): void;
10
10
  }
@@ -47,7 +47,7 @@ class RNSkComputedValue extends _RNSkReadonlyValue.RNSkReadonlyValue {
47
47
  this._unsubscribers = [];
48
48
  }
49
49
 
50
- __invalidate() {
50
+ dispose() {
51
51
  this._unsubscribers.forEach(unsubscribe => unsubscribe());
52
52
 
53
53
  this._unsubscribers = [];
@@ -1 +1 @@
1
- {"version":3,"names":["RNSkComputedValue","RNSkReadonlyValue","constructor","callback","dependencies","unsubscribers","notifyUpdateRef","current","undefined","forEach","dep","push","addListener","_unsubscribers","dependecyUpdated","bind","_callback","update","unsubscribe","__invalidate"],"sources":["RNSkComputedValue.ts"],"sourcesContent":["import type { DependencyList } from \"react\";\n\nimport { RNSkReadonlyValue } from \"./RNSkReadonlyValue\";\n\nexport class RNSkComputedValue<T> extends RNSkReadonlyValue<T> {\n constructor(callback: () => T, dependencies: DependencyList) {\n // Initialize dependencies - we can't call this yet, since\n // super if not called and it requires a start value to be set.\n const unsubscribers: Array<() => void> = [];\n const notifyUpdateRef: { current: (() => void) | undefined } = {\n current: undefined,\n };\n dependencies.forEach((dep) => {\n if (\n dep &&\n typeof dep === \"object\" &&\n \"__typename__\" in dep &&\n \"addListener\" in dep\n ) {\n unsubscribers.push(\n (dep as RNSkReadonlyValue<unknown>).addListener(() =>\n notifyUpdateRef.current?.()\n )\n );\n }\n });\n super(callback());\n this._unsubscribers = unsubscribers;\n notifyUpdateRef.current = this.dependecyUpdated.bind(this);\n this._callback = callback;\n }\n\n private dependecyUpdated() {\n this.update(this._callback());\n }\n\n private _callback: () => T;\n private _unsubscribers: Array<() => void>;\n\n public unsubscribe() {\n this._unsubscribers.forEach((unsubscribe) => unsubscribe());\n this._unsubscribers = [];\n }\n\n public __invalidate(): void {\n this._unsubscribers.forEach((unsubscribe) => unsubscribe());\n this._unsubscribers = [];\n }\n}\n"],"mappings":";;;;;;;AAEA;;;;AAEO,MAAMA,iBAAN,SAAmCC,oCAAnC,CAAwD;EAC7DC,WAAW,CAACC,QAAD,EAAoBC,YAApB,EAAkD;IAC3D;IACA;IACA,MAAMC,aAAgC,GAAG,EAAzC;IACA,MAAMC,eAAsD,GAAG;MAC7DC,OAAO,EAAEC;IADoD,CAA/D;IAGAJ,YAAY,CAACK,OAAb,CAAsBC,GAAD,IAAS;MAC5B,IACEA,GAAG,IACH,OAAOA,GAAP,KAAe,QADf,IAEA,kBAAkBA,GAFlB,IAGA,iBAAiBA,GAJnB,EAKE;QACAL,aAAa,CAACM,IAAd,CACGD,GAAD,CAAoCE,WAApC,CAAgD;UAAA;;UAAA,gCAC9CN,eAAe,CAACC,OAD8B,0DAC9C,2BAAAD,eAAe,CAD+B;QAAA,CAAhD,CADF;MAKD;IACF,CAbD;IAcA,MAAMH,QAAQ,EAAd;;IArB2D;;IAAA;;IAsB3D,KAAKU,cAAL,GAAsBR,aAAtB;IACAC,eAAe,CAACC,OAAhB,GAA0B,KAAKO,gBAAL,CAAsBC,IAAtB,CAA2B,IAA3B,CAA1B;IACA,KAAKC,SAAL,GAAiBb,QAAjB;EACD;;EAEOW,gBAAgB,GAAG;IACzB,KAAKG,MAAL,CAAY,KAAKD,SAAL,EAAZ;EACD;;EAKME,WAAW,GAAG;IACnB,KAAKL,cAAL,CAAoBJ,OAApB,CAA6BS,WAAD,IAAiBA,WAAW,EAAxD;;IACA,KAAKL,cAAL,GAAsB,EAAtB;EACD;;EAEMM,YAAY,GAAS;IAC1B,KAAKN,cAAL,CAAoBJ,OAApB,CAA6BS,WAAD,IAAiBA,WAAW,EAAxD;;IACA,KAAKL,cAAL,GAAsB,EAAtB;EACD;;AA3C4D"}
1
+ {"version":3,"names":["RNSkComputedValue","RNSkReadonlyValue","constructor","callback","dependencies","unsubscribers","notifyUpdateRef","current","undefined","forEach","dep","push","addListener","_unsubscribers","dependecyUpdated","bind","_callback","update","unsubscribe","dispose"],"sources":["RNSkComputedValue.ts"],"sourcesContent":["import type { DependencyList } from \"react\";\n\nimport { RNSkReadonlyValue } from \"./RNSkReadonlyValue\";\n\nexport class RNSkComputedValue<T> extends RNSkReadonlyValue<T> {\n constructor(callback: () => T, dependencies: DependencyList) {\n // Initialize dependencies - we can't call this yet, since\n // super if not called and it requires a start value to be set.\n const unsubscribers: Array<() => void> = [];\n const notifyUpdateRef: { current: (() => void) | undefined } = {\n current: undefined,\n };\n dependencies.forEach((dep) => {\n if (\n dep &&\n typeof dep === \"object\" &&\n \"__typename__\" in dep &&\n \"addListener\" in dep\n ) {\n unsubscribers.push(\n (dep as RNSkReadonlyValue<unknown>).addListener(() =>\n notifyUpdateRef.current?.()\n )\n );\n }\n });\n super(callback());\n this._unsubscribers = unsubscribers;\n notifyUpdateRef.current = this.dependecyUpdated.bind(this);\n this._callback = callback;\n }\n\n private dependecyUpdated() {\n this.update(this._callback());\n }\n\n private _callback: () => T;\n private _unsubscribers: Array<() => void>;\n\n public unsubscribe() {\n this._unsubscribers.forEach((unsubscribe) => unsubscribe());\n this._unsubscribers = [];\n }\n\n public dispose(): void {\n this._unsubscribers.forEach((unsubscribe) => unsubscribe());\n this._unsubscribers = [];\n }\n}\n"],"mappings":";;;;;;;AAEA;;;;AAEO,MAAMA,iBAAN,SAAmCC,oCAAnC,CAAwD;EAC7DC,WAAW,CAACC,QAAD,EAAoBC,YAApB,EAAkD;IAC3D;IACA;IACA,MAAMC,aAAgC,GAAG,EAAzC;IACA,MAAMC,eAAsD,GAAG;MAC7DC,OAAO,EAAEC;IADoD,CAA/D;IAGAJ,YAAY,CAACK,OAAb,CAAsBC,GAAD,IAAS;MAC5B,IACEA,GAAG,IACH,OAAOA,GAAP,KAAe,QADf,IAEA,kBAAkBA,GAFlB,IAGA,iBAAiBA,GAJnB,EAKE;QACAL,aAAa,CAACM,IAAd,CACGD,GAAD,CAAoCE,WAApC,CAAgD;UAAA;;UAAA,gCAC9CN,eAAe,CAACC,OAD8B,0DAC9C,2BAAAD,eAAe,CAD+B;QAAA,CAAhD,CADF;MAKD;IACF,CAbD;IAcA,MAAMH,QAAQ,EAAd;;IArB2D;;IAAA;;IAsB3D,KAAKU,cAAL,GAAsBR,aAAtB;IACAC,eAAe,CAACC,OAAhB,GAA0B,KAAKO,gBAAL,CAAsBC,IAAtB,CAA2B,IAA3B,CAA1B;IACA,KAAKC,SAAL,GAAiBb,QAAjB;EACD;;EAEOW,gBAAgB,GAAG;IACzB,KAAKG,MAAL,CAAY,KAAKD,SAAL,EAAZ;EACD;;EAKME,WAAW,GAAG;IACnB,KAAKL,cAAL,CAAoBJ,OAApB,CAA6BS,WAAD,IAAiBA,WAAW,EAAxD;;IACA,KAAKL,cAAL,GAAsB,EAAtB;EACD;;EAEMM,OAAO,GAAS;IACrB,KAAKN,cAAL,CAAoBJ,OAApB,CAA6BS,WAAD,IAAiBA,WAAW,EAAxD;;IACA,KAAKL,cAAL,GAAsB,EAAtB;EACD;;AA3C4D"}
@@ -8,5 +8,5 @@ export declare class RNSkReadonlyValue<T> implements SkiaValue<T> {
8
8
  readonly __typename__ = "RNSkValue";
9
9
  get current(): T;
10
10
  addListener(cb: (value: T) => void): () => void;
11
- __invalidate(): void;
11
+ dispose(): void;
12
12
  }
@@ -41,7 +41,7 @@ class RNSkReadonlyValue {
41
41
  };
42
42
  }
43
43
 
44
- __invalidate() {
44
+ dispose() {
45
45
  this._listeners = [];
46
46
  }
47
47
 
@@ -1 +1 @@
1
- {"version":3,"names":["RNSkReadonlyValue","constructor","value","_current","notifyListeners","_listeners","forEach","cb","update","nextValue","current","addListener","push","splice","indexOf","__invalidate"],"sources":["RNSkReadonlyValue.ts"],"sourcesContent":["import type { SkiaValue } from \"../types\";\n\nexport class RNSkReadonlyValue<T> implements SkiaValue<T> {\n constructor(value: T) {\n this._current = value;\n }\n\n private _current: T;\n private _listeners: Array<(value: T) => void> = [];\n\n private notifyListeners(): void {\n this._listeners.forEach((cb) => cb(this._current));\n }\n\n protected update(nextValue: T): void {\n if (this._current !== nextValue) {\n this._current = nextValue;\n this.notifyListeners();\n }\n }\n\n public readonly __typename__ = \"RNSkValue\";\n\n public get current(): T {\n return this._current;\n }\n\n public addListener(cb: (value: T) => void) {\n this._listeners.push(cb);\n return () => {\n this._listeners.splice(this._listeners.indexOf(cb), 1);\n };\n }\n\n public __invalidate(): void {\n this._listeners = [];\n }\n}\n"],"mappings":";;;;;;;;;AAEO,MAAMA,iBAAN,CAAmD;EACxDC,WAAW,CAACC,KAAD,EAAW;IAAA;;IAAA,oCAK0B,EAL1B;;IAAA,sCAkBS,WAlBT;;IACpB,KAAKC,QAAL,GAAgBD,KAAhB;EACD;;EAKOE,eAAe,GAAS;IAC9B,KAAKC,UAAL,CAAgBC,OAAhB,CAAyBC,EAAD,IAAQA,EAAE,CAAC,KAAKJ,QAAN,CAAlC;EACD;;EAESK,MAAM,CAACC,SAAD,EAAqB;IACnC,IAAI,KAAKN,QAAL,KAAkBM,SAAtB,EAAiC;MAC/B,KAAKN,QAAL,GAAgBM,SAAhB;MACA,KAAKL,eAAL;IACD;EACF;;EAIiB,IAAPM,OAAO,GAAM;IACtB,OAAO,KAAKP,QAAZ;EACD;;EAEMQ,WAAW,CAACJ,EAAD,EAAyB;IACzC,KAAKF,UAAL,CAAgBO,IAAhB,CAAqBL,EAArB;;IACA,OAAO,MAAM;MACX,KAAKF,UAAL,CAAgBQ,MAAhB,CAAuB,KAAKR,UAAL,CAAgBS,OAAhB,CAAwBP,EAAxB,CAAvB,EAAoD,CAApD;IACD,CAFD;EAGD;;EAEMQ,YAAY,GAAS;IAC1B,KAAKV,UAAL,GAAkB,EAAlB;EACD;;AAlCuD"}
1
+ {"version":3,"names":["RNSkReadonlyValue","constructor","value","_current","notifyListeners","_listeners","forEach","cb","update","nextValue","current","addListener","push","splice","indexOf","dispose"],"sources":["RNSkReadonlyValue.ts"],"sourcesContent":["import type { SkiaValue } from \"../types\";\n\nexport class RNSkReadonlyValue<T> implements SkiaValue<T> {\n constructor(value: T) {\n this._current = value;\n }\n\n private _current: T;\n private _listeners: Array<(value: T) => void> = [];\n\n private notifyListeners(): void {\n this._listeners.forEach((cb) => cb(this._current));\n }\n\n protected update(nextValue: T): void {\n if (this._current !== nextValue) {\n this._current = nextValue;\n this.notifyListeners();\n }\n }\n\n public readonly __typename__ = \"RNSkValue\";\n\n public get current(): T {\n return this._current;\n }\n\n public addListener(cb: (value: T) => void) {\n this._listeners.push(cb);\n return () => {\n this._listeners.splice(this._listeners.indexOf(cb), 1);\n };\n }\n\n public dispose(): void {\n this._listeners = [];\n }\n}\n"],"mappings":";;;;;;;;;AAEO,MAAMA,iBAAN,CAAmD;EACxDC,WAAW,CAACC,KAAD,EAAW;IAAA;;IAAA,oCAK0B,EAL1B;;IAAA,sCAkBS,WAlBT;;IACpB,KAAKC,QAAL,GAAgBD,KAAhB;EACD;;EAKOE,eAAe,GAAS;IAC9B,KAAKC,UAAL,CAAgBC,OAAhB,CAAyBC,EAAD,IAAQA,EAAE,CAAC,KAAKJ,QAAN,CAAlC;EACD;;EAESK,MAAM,CAACC,SAAD,EAAqB;IACnC,IAAI,KAAKN,QAAL,KAAkBM,SAAtB,EAAiC;MAC/B,KAAKN,QAAL,GAAgBM,SAAhB;MACA,KAAKL,eAAL;IACD;EACF;;EAIiB,IAAPM,OAAO,GAAM;IACtB,OAAO,KAAKP,QAAZ;EACD;;EAEMQ,WAAW,CAACJ,EAAD,EAAyB;IACzC,KAAKF,UAAL,CAAgBO,IAAhB,CAAqBL,EAArB;;IACA,OAAO,MAAM;MACX,KAAKF,UAAL,CAAgBQ,MAAhB,CAAuB,KAAKR,UAAL,CAAgBS,OAAhB,CAAwBP,EAAxB,CAAvB,EAAoD,CAApD;IACD,CAFD;EAGD;;EAEMQ,OAAO,GAAS;IACrB,KAAKV,UAAL,GAAkB,EAAlB;EACD;;AAlCuD"}
@@ -110,12 +110,17 @@ class SkiaBaseWebView extends _react.default.Component {
110
110
  }
111
111
 
112
112
  componentWillUnmount() {
113
- var _this$_canvasRef$curr, _this$_canvasRef$curr2, _this$_canvasRef$curr3;
114
-
115
113
  this.unsubscribeAll();
116
- cancelAnimationFrame(this.requestId); // https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_lose_context
114
+ cancelAnimationFrame(this.requestId); // eslint-disable-next-line max-len
115
+ // https://stackoverflow.com/questions/23598471/how-do-i-clean-up-and-unload-a-webgl-canvas-context-from-gpu-after-use
116
+ // https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_lose_context
117
+ // We delete the context, only if the context has been intialized
118
+
119
+ if (this._surface) {
120
+ var _this$_canvasRef$curr, _this$_canvasRef$curr2, _this$_canvasRef$curr3;
117
121
 
118
- (_this$_canvasRef$curr = this._canvasRef.current) === null || _this$_canvasRef$curr === void 0 ? void 0 : (_this$_canvasRef$curr2 = _this$_canvasRef$curr.getContext("webgl2")) === null || _this$_canvasRef$curr2 === void 0 ? void 0 : (_this$_canvasRef$curr3 = _this$_canvasRef$curr2.getExtension("WEBGL_lose_context")) === null || _this$_canvasRef$curr3 === void 0 ? void 0 : _this$_canvasRef$curr3.loseContext();
122
+ (_this$_canvasRef$curr = this._canvasRef.current) === null || _this$_canvasRef$curr === void 0 ? void 0 : (_this$_canvasRef$curr2 = _this$_canvasRef$curr.getContext("webgl2")) === null || _this$_canvasRef$curr2 === void 0 ? void 0 : (_this$_canvasRef$curr3 = _this$_canvasRef$curr2.getExtension("WEBGL_lose_context")) === null || _this$_canvasRef$curr3 === void 0 ? void 0 : _this$_canvasRef$curr3.loseContext();
123
+ }
119
124
  }
120
125
  /**
121
126
  * Creates a snapshot from the canvas in the surface
@@ -1 +1 @@
1
- {"version":3,"names":["pd","Platform","PixelRatio","SkiaBaseWebView","React","Component","constructor","props","createRef","createTouchHandler","TouchType","Start","Active","Cancelled","End","onLayoutEvent","bind","_mode","mode","unsubscribeAll","_unsubscriptions","forEach","u","evt","CanvasKit","global","canvas","_canvasRef","current","width","clientWidth","height","clientHeight","surface","MakeWebGLCanvasSurface","Error","_surface","JsiSkSurface","_canvas","getCanvas","redraw","onLayout","getSize","componentDidMount","tick","componentDidUpdate","componentWillUnmount","cancelAnimationFrame","requestId","getContext","getExtension","loseContext","makeImageSnapshot","rect","clear","TRANSPARENT","renderInCanvas","ref","flush","_redrawRequests","touches","_touches","Float32Array","of","save","scale","restore","requestAnimationFrame","setDrawMode","registerValues","_values","v","push","addListener","handleTouchEvent","touchType","id","pointerId","x","clientX","currentTarget","getClientRects","left","y","clientY","top","force","pressure","type","timestamp","Date","now","render","debug","viewProps","display","flex","onStart","onActive","onEnd","onCancel"],"sources":["SkiaBaseWebView.tsx"],"sourcesContent":["/* global HTMLCanvasElement */\nimport React from \"react\";\nimport type { PointerEvent } from \"react\";\nimport type { LayoutChangeEvent } from \"react-native\";\n\nimport type { SkRect, SkCanvas } from \"../skia/types\";\nimport type { SkiaValue } from \"../values\";\nimport { JsiSkSurface } from \"../skia/web/JsiSkSurface\";\nimport { Platform } from \"../Platform\";\n\nimport type { DrawMode, SkiaBaseViewProps, TouchInfo } from \"./types\";\nimport { TouchType } from \"./types\";\n\nconst pd = Platform.PixelRatio;\n\nexport abstract class SkiaBaseWebView<\n TProps extends SkiaBaseViewProps\n> extends React.Component<TProps> {\n constructor(props: TProps) {\n super(props);\n this._mode = props.mode ?? \"default\";\n }\n\n private _surface: JsiSkSurface | null = null;\n private _unsubscriptions: Array<() => void> = [];\n private _touches: Array<TouchInfo> = [];\n private _canvas: SkCanvas | null = null;\n private _canvasRef = React.createRef<HTMLCanvasElement>();\n private _mode: DrawMode;\n private _redrawRequests = 0;\n private requestId = 0;\n\n protected width = 0;\n protected height = 0;\n\n private unsubscribeAll() {\n this._unsubscriptions.forEach((u) => u());\n this._unsubscriptions = [];\n }\n\n private onLayoutEvent(evt: LayoutChangeEvent) {\n const { CanvasKit } = global;\n // Reset canvas / surface on layout change\n const canvas = this._canvasRef.current;\n if (canvas) {\n this.width = canvas.clientWidth;\n this.height = canvas.clientHeight;\n canvas.width = this.width * pd;\n canvas.height = this.height * pd;\n const surface = CanvasKit.MakeWebGLCanvasSurface(canvas);\n if (!surface) {\n throw new Error(\"Could not create surface\");\n }\n this._surface = new JsiSkSurface(CanvasKit, surface);\n this._canvas = this._surface.getCanvas();\n this.redraw();\n }\n // Call onLayout callback if it exists\n if (this.props.onLayout) {\n this.props.onLayout(evt);\n }\n }\n\n protected getSize() {\n return { width: this.width, height: this.height };\n }\n\n componentDidMount() {\n // Start render loop\n this.tick();\n }\n\n componentDidUpdate() {\n this.redraw();\n }\n\n componentWillUnmount() {\n this.unsubscribeAll();\n cancelAnimationFrame(this.requestId);\n // https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_lose_context\n this._canvasRef.current\n ?.getContext(\"webgl2\")\n ?.getExtension(\"WEBGL_lose_context\")\n ?.loseContext();\n }\n\n /**\n * Creates a snapshot from the canvas in the surface\n * @param rect Rect to use as bounds. Optional.\n * @returns An Image object.\n */\n public makeImageSnapshot(rect?: SkRect) {\n this._canvas!.clear(CanvasKit.TRANSPARENT);\n this.renderInCanvas(this._canvas!, []);\n this._surface?.ref.flush();\n return this._surface?.makeImageSnapshot(rect);\n }\n\n /**\n * Override to render\n */\n protected abstract renderInCanvas(\n canvas: SkCanvas,\n touches: TouchInfo[]\n ): void;\n\n /**\n * Sends a redraw request to the native SkiaView.\n */\n private tick() {\n if (this._mode === \"continuous\" || this._redrawRequests > 0) {\n this._redrawRequests = 0;\n if (this._canvas) {\n const touches = [...this._touches];\n this._touches = [];\n const canvas = this._canvas!;\n canvas.clear(Float32Array.of(0, 0, 0, 0));\n canvas.save();\n canvas.scale(pd, pd);\n this.renderInCanvas(canvas, touches);\n canvas.restore();\n this._surface?.ref.flush();\n }\n }\n this.requestId = requestAnimationFrame(this.tick.bind(this));\n }\n\n public redraw() {\n this._redrawRequests++;\n }\n\n /**\n * Updates the drawing mode for the skia view. This is the same\n * as declaratively setting the mode property on the SkiaView.\n * There are two drawing modes, \"continuous\" and \"default\",\n * where the continuous mode will continuously redraw the view and\n * the default mode will only redraw when any of the regular react\n * properties are changed like size and margins.\n * @param mode Drawing mode to use.\n */\n public setDrawMode(mode: DrawMode) {\n this._mode = mode;\n this.tick();\n }\n\n /**\n * Registers one or move values as a dependant value of the Skia View. The view will\n * The view will redraw itself when any of the values change.\n * @param values Values to register\n */\n public registerValues(_values: SkiaValue<unknown>[]) {\n // Unsubscribe from dependency values\n this.unsubscribeAll();\n // Register redraw dependencies on values\n _values.forEach((v) => {\n this._unsubscriptions.push(\n v.addListener(() => {\n this.redraw();\n })\n );\n });\n }\n\n private handleTouchEvent(evt: PointerEvent, touchType: TouchType) {\n this._touches.push({\n id: evt.pointerId,\n x: evt.clientX - evt.currentTarget.getClientRects()[0].left,\n y: evt.clientY - evt.currentTarget.getClientRects()[0].top,\n force: evt.pressure,\n type: touchType,\n timestamp: Date.now(),\n });\n this.redraw();\n }\n\n createTouchHandler(touchType: TouchType) {\n return (evt: PointerEvent) => this.handleTouchEvent(evt, touchType);\n }\n\n private onStart = this.createTouchHandler(TouchType.Start);\n private onActive = this.createTouchHandler(TouchType.Active);\n private onCancel = this.createTouchHandler(TouchType.Cancelled);\n private onEnd = this.createTouchHandler(TouchType.End);\n private onLayout = this.onLayoutEvent.bind(this);\n\n render() {\n const { mode, debug = false, ...viewProps } = this.props;\n return (\n <Platform.View {...viewProps} onLayout={this.onLayout}>\n <canvas\n ref={this._canvasRef}\n style={{ display: \"flex\", flex: 1 }}\n onPointerDown={this.onStart}\n onPointerMove={this.onActive}\n onPointerUp={this.onEnd}\n onPointerCancel={this.onCancel}\n onPointerLeave={this.onEnd}\n onPointerOut={this.onEnd}\n />\n </Platform.View>\n );\n }\n}\n"],"mappings":"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"}
1
+ {"version":3,"names":["pd","Platform","PixelRatio","SkiaBaseWebView","React","Component","constructor","props","createRef","createTouchHandler","TouchType","Start","Active","Cancelled","End","onLayoutEvent","bind","_mode","mode","unsubscribeAll","_unsubscriptions","forEach","u","evt","CanvasKit","global","canvas","_canvasRef","current","width","clientWidth","height","clientHeight","surface","MakeWebGLCanvasSurface","Error","_surface","JsiSkSurface","_canvas","getCanvas","redraw","onLayout","getSize","componentDidMount","tick","componentDidUpdate","componentWillUnmount","cancelAnimationFrame","requestId","getContext","getExtension","loseContext","makeImageSnapshot","rect","clear","TRANSPARENT","renderInCanvas","ref","flush","_redrawRequests","touches","_touches","Float32Array","of","save","scale","restore","requestAnimationFrame","setDrawMode","registerValues","_values","v","push","addListener","handleTouchEvent","touchType","id","pointerId","x","clientX","currentTarget","getClientRects","left","y","clientY","top","force","pressure","type","timestamp","Date","now","render","debug","viewProps","display","flex","onStart","onActive","onEnd","onCancel"],"sources":["SkiaBaseWebView.tsx"],"sourcesContent":["/* global HTMLCanvasElement */\nimport React from \"react\";\nimport type { PointerEvent } from \"react\";\nimport type { LayoutChangeEvent } from \"react-native\";\n\nimport type { SkRect, SkCanvas } from \"../skia/types\";\nimport type { SkiaValue } from \"../values\";\nimport { JsiSkSurface } from \"../skia/web/JsiSkSurface\";\nimport { Platform } from \"../Platform\";\n\nimport type { DrawMode, SkiaBaseViewProps, TouchInfo } from \"./types\";\nimport { TouchType } from \"./types\";\n\nconst pd = Platform.PixelRatio;\n\nexport abstract class SkiaBaseWebView<\n TProps extends SkiaBaseViewProps\n> extends React.Component<TProps> {\n constructor(props: TProps) {\n super(props);\n this._mode = props.mode ?? \"default\";\n }\n\n private _surface: JsiSkSurface | null = null;\n private _unsubscriptions: Array<() => void> = [];\n private _touches: Array<TouchInfo> = [];\n private _canvas: SkCanvas | null = null;\n private _canvasRef = React.createRef<HTMLCanvasElement>();\n private _mode: DrawMode;\n private _redrawRequests = 0;\n private requestId = 0;\n\n protected width = 0;\n protected height = 0;\n\n private unsubscribeAll() {\n this._unsubscriptions.forEach((u) => u());\n this._unsubscriptions = [];\n }\n\n private onLayoutEvent(evt: LayoutChangeEvent) {\n const { CanvasKit } = global;\n // Reset canvas / surface on layout change\n const canvas = this._canvasRef.current;\n if (canvas) {\n this.width = canvas.clientWidth;\n this.height = canvas.clientHeight;\n canvas.width = this.width * pd;\n canvas.height = this.height * pd;\n const surface = CanvasKit.MakeWebGLCanvasSurface(canvas);\n if (!surface) {\n throw new Error(\"Could not create surface\");\n }\n this._surface = new JsiSkSurface(CanvasKit, surface);\n this._canvas = this._surface.getCanvas();\n this.redraw();\n }\n // Call onLayout callback if it exists\n if (this.props.onLayout) {\n this.props.onLayout(evt);\n }\n }\n\n protected getSize() {\n return { width: this.width, height: this.height };\n }\n\n componentDidMount() {\n // Start render loop\n this.tick();\n }\n\n componentDidUpdate() {\n this.redraw();\n }\n\n componentWillUnmount() {\n this.unsubscribeAll();\n cancelAnimationFrame(this.requestId);\n // eslint-disable-next-line max-len\n // https://stackoverflow.com/questions/23598471/how-do-i-clean-up-and-unload-a-webgl-canvas-context-from-gpu-after-use\n // https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_lose_context\n // We delete the context, only if the context has been intialized\n if (this._surface) {\n this._canvasRef.current\n ?.getContext(\"webgl2\")\n ?.getExtension(\"WEBGL_lose_context\")\n ?.loseContext();\n }\n }\n\n /**\n * Creates a snapshot from the canvas in the surface\n * @param rect Rect to use as bounds. Optional.\n * @returns An Image object.\n */\n public makeImageSnapshot(rect?: SkRect) {\n this._canvas!.clear(CanvasKit.TRANSPARENT);\n this.renderInCanvas(this._canvas!, []);\n this._surface?.ref.flush();\n return this._surface?.makeImageSnapshot(rect);\n }\n\n /**\n * Override to render\n */\n protected abstract renderInCanvas(\n canvas: SkCanvas,\n touches: TouchInfo[]\n ): void;\n\n /**\n * Sends a redraw request to the native SkiaView.\n */\n private tick() {\n if (this._mode === \"continuous\" || this._redrawRequests > 0) {\n this._redrawRequests = 0;\n if (this._canvas) {\n const touches = [...this._touches];\n this._touches = [];\n const canvas = this._canvas!;\n canvas.clear(Float32Array.of(0, 0, 0, 0));\n canvas.save();\n canvas.scale(pd, pd);\n this.renderInCanvas(canvas, touches);\n canvas.restore();\n this._surface?.ref.flush();\n }\n }\n this.requestId = requestAnimationFrame(this.tick.bind(this));\n }\n\n public redraw() {\n this._redrawRequests++;\n }\n\n /**\n * Updates the drawing mode for the skia view. This is the same\n * as declaratively setting the mode property on the SkiaView.\n * There are two drawing modes, \"continuous\" and \"default\",\n * where the continuous mode will continuously redraw the view and\n * the default mode will only redraw when any of the regular react\n * properties are changed like size and margins.\n * @param mode Drawing mode to use.\n */\n public setDrawMode(mode: DrawMode) {\n this._mode = mode;\n this.tick();\n }\n\n /**\n * Registers one or move values as a dependant value of the Skia View. The view will\n * The view will redraw itself when any of the values change.\n * @param values Values to register\n */\n public registerValues(_values: SkiaValue<unknown>[]) {\n // Unsubscribe from dependency values\n this.unsubscribeAll();\n // Register redraw dependencies on values\n _values.forEach((v) => {\n this._unsubscriptions.push(\n v.addListener(() => {\n this.redraw();\n })\n );\n });\n }\n\n private handleTouchEvent(evt: PointerEvent, touchType: TouchType) {\n this._touches.push({\n id: evt.pointerId,\n x: evt.clientX - evt.currentTarget.getClientRects()[0].left,\n y: evt.clientY - evt.currentTarget.getClientRects()[0].top,\n force: evt.pressure,\n type: touchType,\n timestamp: Date.now(),\n });\n this.redraw();\n }\n\n createTouchHandler(touchType: TouchType) {\n return (evt: PointerEvent) => this.handleTouchEvent(evt, touchType);\n }\n\n private onStart = this.createTouchHandler(TouchType.Start);\n private onActive = this.createTouchHandler(TouchType.Active);\n private onCancel = this.createTouchHandler(TouchType.Cancelled);\n private onEnd = this.createTouchHandler(TouchType.End);\n private onLayout = this.onLayoutEvent.bind(this);\n\n render() {\n const { mode, debug = false, ...viewProps } = this.props;\n return (\n <Platform.View {...viewProps} onLayout={this.onLayout}>\n <canvas\n ref={this._canvasRef}\n style={{ display: \"flex\", flex: 1 }}\n onPointerDown={this.onStart}\n onPointerMove={this.onActive}\n onPointerUp={this.onEnd}\n onPointerCancel={this.onCancel}\n onPointerLeave={this.onEnd}\n onPointerOut={this.onEnd}\n />\n </Platform.View>\n );\n }\n}\n"],"mappings":"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"}
@@ -9,6 +9,8 @@ var _skia = require("../skia");
9
9
 
10
10
  var _DrawingContext = require("../dom/types/DrawingContext");
11
11
 
12
+ var _Animations = require("../renderer/processors/Animations/Animations");
13
+
12
14
  var _SkiaBaseWebView = require("./SkiaBaseWebView");
13
15
 
14
16
  class SkiaDomView extends _SkiaBaseWebView.SkiaBaseWebView {
@@ -26,10 +28,18 @@ class SkiaDomView extends _SkiaBaseWebView.SkiaBaseWebView {
26
28
  width,
27
29
  height
28
30
  } = this.getSize();
29
- this.props.onSize.current = {
30
- width,
31
- height
32
- };
31
+
32
+ if ((0, _Animations.isValue)(this.props.onSize)) {
33
+ this.props.onSize.current = {
34
+ width,
35
+ height
36
+ };
37
+ } else {
38
+ this.props.onSize.value = {
39
+ width,
40
+ height
41
+ };
42
+ }
33
43
  }
34
44
 
35
45
  if (this.props.root) {
@@ -1 +1 @@
1
- {"version":3,"names":["SkiaDomView","SkiaBaseWebView","constructor","props","renderInCanvas","canvas","touches","onTouch","onSize","width","height","getSize","current","root","ctx","JsiDrawingContext","Skia","render"],"sources":["SkiaDomView.web.tsx"],"sourcesContent":["import { Skia } from \"../skia\";\nimport type { SkCanvas } from \"../skia/types\";\nimport { JsiDrawingContext } from \"../dom/types/DrawingContext\";\n\nimport { SkiaBaseWebView } from \"./SkiaBaseWebView\";\nimport type { SkiaDomViewProps, TouchInfo } from \"./types\";\n\nexport class SkiaDomView extends SkiaBaseWebView<SkiaDomViewProps> {\n constructor(props: SkiaDomViewProps) {\n super(props);\n }\n\n protected renderInCanvas(canvas: SkCanvas, touches: TouchInfo[]): void {\n if (this.props.onTouch) {\n this.props.onTouch([touches]);\n }\n if (this.props.onSize) {\n const { width, height } = this.getSize();\n this.props.onSize.current = { width, height };\n }\n if (this.props.root) {\n const ctx = new JsiDrawingContext(Skia, canvas);\n this.props.root.render(ctx);\n }\n }\n}\n"],"mappings":";;;;;;;AAAA;;AAEA;;AAEA;;AAGO,MAAMA,WAAN,SAA0BC,gCAA1B,CAA4D;EACjEC,WAAW,CAACC,KAAD,EAA0B;IACnC,MAAMA,KAAN;EACD;;EAESC,cAAc,CAACC,MAAD,EAAmBC,OAAnB,EAA+C;IACrE,IAAI,KAAKH,KAAL,CAAWI,OAAf,EAAwB;MACtB,KAAKJ,KAAL,CAAWI,OAAX,CAAmB,CAACD,OAAD,CAAnB;IACD;;IACD,IAAI,KAAKH,KAAL,CAAWK,MAAf,EAAuB;MACrB,MAAM;QAAEC,KAAF;QAASC;MAAT,IAAoB,KAAKC,OAAL,EAA1B;MACA,KAAKR,KAAL,CAAWK,MAAX,CAAkBI,OAAlB,GAA4B;QAAEH,KAAF;QAASC;MAAT,CAA5B;IACD;;IACD,IAAI,KAAKP,KAAL,CAAWU,IAAf,EAAqB;MACnB,MAAMC,GAAG,GAAG,IAAIC,iCAAJ,CAAsBC,UAAtB,EAA4BX,MAA5B,CAAZ;MACA,KAAKF,KAAL,CAAWU,IAAX,CAAgBI,MAAhB,CAAuBH,GAAvB;IACD;EACF;;AAjBgE"}
1
+ {"version":3,"names":["SkiaDomView","SkiaBaseWebView","constructor","props","renderInCanvas","canvas","touches","onTouch","onSize","width","height","getSize","isValue","current","value","root","ctx","JsiDrawingContext","Skia","render"],"sources":["SkiaDomView.web.tsx"],"sourcesContent":["import { Skia } from \"../skia\";\nimport type { SkCanvas } from \"../skia/types\";\nimport { JsiDrawingContext } from \"../dom/types/DrawingContext\";\nimport { isValue } from \"../renderer/processors/Animations/Animations\";\n\nimport { SkiaBaseWebView } from \"./SkiaBaseWebView\";\nimport type { SkiaDomViewProps, TouchInfo } from \"./types\";\n\nexport class SkiaDomView extends SkiaBaseWebView<SkiaDomViewProps> {\n constructor(props: SkiaDomViewProps) {\n super(props);\n }\n\n protected renderInCanvas(canvas: SkCanvas, touches: TouchInfo[]): void {\n if (this.props.onTouch) {\n this.props.onTouch([touches]);\n }\n if (this.props.onSize) {\n const { width, height } = this.getSize();\n if (isValue(this.props.onSize)) {\n this.props.onSize.current = { width, height };\n } else {\n this.props.onSize.value = { width, height };\n }\n }\n if (this.props.root) {\n const ctx = new JsiDrawingContext(Skia, canvas);\n this.props.root.render(ctx);\n }\n }\n}\n"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AAEA;;AAGO,MAAMA,WAAN,SAA0BC,gCAA1B,CAA4D;EACjEC,WAAW,CAACC,KAAD,EAA0B;IACnC,MAAMA,KAAN;EACD;;EAESC,cAAc,CAACC,MAAD,EAAmBC,OAAnB,EAA+C;IACrE,IAAI,KAAKH,KAAL,CAAWI,OAAf,EAAwB;MACtB,KAAKJ,KAAL,CAAWI,OAAX,CAAmB,CAACD,OAAD,CAAnB;IACD;;IACD,IAAI,KAAKH,KAAL,CAAWK,MAAf,EAAuB;MACrB,MAAM;QAAEC,KAAF;QAASC;MAAT,IAAoB,KAAKC,OAAL,EAA1B;;MACA,IAAI,IAAAC,mBAAA,EAAQ,KAAKT,KAAL,CAAWK,MAAnB,CAAJ,EAAgC;QAC9B,KAAKL,KAAL,CAAWK,MAAX,CAAkBK,OAAlB,GAA4B;UAAEJ,KAAF;UAASC;QAAT,CAA5B;MACD,CAFD,MAEO;QACL,KAAKP,KAAL,CAAWK,MAAX,CAAkBM,KAAlB,GAA0B;UAAEL,KAAF;UAASC;QAAT,CAA1B;MACD;IACF;;IACD,IAAI,KAAKP,KAAL,CAAWY,IAAf,EAAqB;MACnB,MAAMC,GAAG,GAAG,IAAIC,iCAAJ,CAAsBC,UAAtB,EAA4Bb,MAA5B,CAAZ;MACA,KAAKF,KAAL,CAAWY,IAAX,CAAgBI,MAAhB,CAAuBH,GAAvB;IACD;EACF;;AArBgE"}
@@ -2,6 +2,7 @@ import type { ViewProps } from "react-native";
2
2
  import type { GroupProps, RenderNode } from "../dom/types";
3
3
  import type { SkCanvas, SkImage, SkPicture, SkRect, SkSize } from "../skia/types";
4
4
  import type { SkiaMutableValue, SkiaValue } from "../values";
5
+ import type { SharedValueType } from "../renderer/processors/Animations/Animations";
5
6
  export declare type DrawMode = "continuous" | "default";
6
7
  export declare type NativeSkiaViewProps = ViewProps & {
7
8
  mode?: DrawMode;
@@ -70,7 +71,7 @@ export interface SkiaBaseViewProps extends ViewProps {
70
71
  * Pass an animated value to the onSize property to get updates when
71
72
  * the Skia view is resized.
72
73
  */
73
- onSize?: SkiaMutableValue<SkSize>;
74
+ onSize?: SkiaMutableValue<SkSize> | SharedValueType<SkSize>;
74
75
  }
75
76
  export interface SkiaDrawViewProps extends SkiaBaseViewProps {
76
77
  /**