@shopify/react-native-skia 0.1.141 → 0.1.145

Sign up to get free protection for your applications and to get access to all the features.
Files changed (282) hide show
  1. package/android/cpp/rnskia-android/RNSkDrawViewImpl.cpp +2 -2
  2. package/android/cpp/rnskia-android/RNSkDrawViewImpl.h +1 -1
  3. package/android/cpp/rnskia-android/SkiaOpenGLRenderer.cpp +15 -16
  4. package/android/cpp/rnskia-android/SkiaOpenGLRenderer.h +2 -2
  5. package/android/src/main/java/com/shopify/reactnative/skia/SkiaDrawView.java +69 -27
  6. package/cpp/api/JsiSkPaint.h +6 -0
  7. package/cpp/api/JsiSkPathFactory.h +1 -1
  8. package/cpp/api/JsiSkPicture.h +7 -1
  9. package/cpp/rnskia/RNSkDrawView.cpp +66 -66
  10. package/cpp/rnskia/RNSkDrawView.h +22 -6
  11. package/cpp/rnskia/RNSkJsiViewApi.h +2 -2
  12. package/cpp/rnskia/values/RNSkComputedValue.h +10 -7
  13. package/cpp/rnskia/values/RNSkReadonlyValue.h +21 -2
  14. package/cpp/rnskia/values/RNSkValue.h +1 -0
  15. package/ios/RNSkia-iOS/RNSkDrawViewImpl.h +1 -1
  16. package/ios/RNSkia-iOS/RNSkDrawViewImpl.mm +2 -2
  17. package/ios/RNSkia-iOS/SkiaDrawView.mm +4 -0
  18. package/lib/commonjs/mock/index.js +3 -1
  19. package/lib/commonjs/mock/index.js.map +1 -1
  20. package/lib/commonjs/renderer/Canvas.js +17 -7
  21. package/lib/commonjs/renderer/Canvas.js.map +1 -1
  22. package/lib/commonjs/renderer/DependencyManager.js +144 -36
  23. package/lib/commonjs/renderer/DependencyManager.js.map +1 -1
  24. package/lib/commonjs/renderer/HostConfig.js +1 -1
  25. package/lib/commonjs/renderer/HostConfig.js.map +1 -1
  26. package/lib/commonjs/renderer/components/Blend.js +20 -5
  27. package/lib/commonjs/renderer/components/Blend.js.map +1 -1
  28. package/lib/commonjs/renderer/components/backdrop/BackdropFilter.js.map +1 -1
  29. package/lib/commonjs/renderer/components/imageFilters/Morphology.js +1 -1
  30. package/lib/commonjs/renderer/components/imageFilters/Morphology.js.map +1 -1
  31. package/lib/commonjs/renderer/components/imageFilters/Shadow.js +1 -1
  32. package/lib/commonjs/renderer/components/imageFilters/Shadow.js.map +1 -1
  33. package/lib/commonjs/renderer/nodes/Declaration.js +2 -3
  34. package/lib/commonjs/renderer/nodes/Declaration.js.map +1 -1
  35. package/lib/commonjs/renderer/nodes/Drawing.js +3 -7
  36. package/lib/commonjs/renderer/nodes/Drawing.js.map +1 -1
  37. package/lib/commonjs/renderer/nodes/Node.js +9 -7
  38. package/lib/commonjs/renderer/nodes/Node.js.map +1 -1
  39. package/lib/commonjs/renderer/processors/Animations/Animations.js +14 -20
  40. package/lib/commonjs/renderer/processors/Animations/Animations.js.map +1 -1
  41. package/lib/commonjs/skia/core/Data.js +10 -22
  42. package/lib/commonjs/skia/core/Data.js.map +1 -1
  43. package/lib/commonjs/skia/core/Font.js +2 -3
  44. package/lib/commonjs/skia/core/Font.js.map +1 -1
  45. package/lib/commonjs/skia/core/Image.js.map +1 -1
  46. package/lib/commonjs/skia/core/SVG.js.map +1 -1
  47. package/lib/commonjs/skia/core/Typeface.js.map +1 -1
  48. package/lib/commonjs/skia/types/Data/Data.js +5 -0
  49. package/lib/commonjs/skia/types/Data/Data.js.map +1 -1
  50. package/lib/commonjs/skia/types/Paint/Paint.js.map +1 -1
  51. package/lib/commonjs/skia/web/Host.js +12 -21
  52. package/lib/commonjs/skia/web/Host.js.map +1 -1
  53. package/lib/commonjs/skia/web/JsiSkCanvas.js +50 -28
  54. package/lib/commonjs/skia/web/JsiSkCanvas.js.map +1 -1
  55. package/lib/commonjs/skia/web/JsiSkColorFilterFactory.js +4 -4
  56. package/lib/commonjs/skia/web/JsiSkColorFilterFactory.js.map +1 -1
  57. package/lib/commonjs/skia/web/JsiSkFont.js +7 -3
  58. package/lib/commonjs/skia/web/JsiSkFont.js.map +1 -1
  59. package/lib/commonjs/skia/web/JsiSkImage.js +4 -2
  60. package/lib/commonjs/skia/web/JsiSkImage.js.map +1 -1
  61. package/lib/commonjs/skia/web/JsiSkImageFactory.js +4 -2
  62. package/lib/commonjs/skia/web/JsiSkImageFactory.js.map +1 -1
  63. package/lib/commonjs/skia/web/JsiSkImageFilterFactory.js +61 -19
  64. package/lib/commonjs/skia/web/JsiSkImageFilterFactory.js.map +1 -1
  65. package/lib/commonjs/skia/web/JsiSkMatrix.js +1 -1
  66. package/lib/commonjs/skia/web/JsiSkMatrix.js.map +1 -1
  67. package/lib/commonjs/skia/web/JsiSkPaint.js +19 -6
  68. package/lib/commonjs/skia/web/JsiSkPaint.js.map +1 -1
  69. package/lib/commonjs/skia/web/JsiSkPath.js +16 -60
  70. package/lib/commonjs/skia/web/JsiSkPath.js.map +1 -1
  71. package/lib/commonjs/skia/web/JsiSkPathEffectFactory.js +7 -3
  72. package/lib/commonjs/skia/web/JsiSkPathEffectFactory.js.map +1 -1
  73. package/lib/commonjs/skia/web/JsiSkPathFactory.js +1 -1
  74. package/lib/commonjs/skia/web/JsiSkPathFactory.js.map +1 -1
  75. package/lib/commonjs/skia/web/JsiSkPicture.js +5 -1
  76. package/lib/commonjs/skia/web/JsiSkPicture.js.map +1 -1
  77. package/lib/commonjs/skia/web/JsiSkPictureRecorder.js +3 -1
  78. package/lib/commonjs/skia/web/JsiSkPictureRecorder.js.map +1 -1
  79. package/lib/commonjs/skia/web/JsiSkPoint.js +9 -1
  80. package/lib/commonjs/skia/web/JsiSkPoint.js.map +1 -1
  81. package/lib/commonjs/skia/web/JsiSkRRect.js +9 -1
  82. package/lib/commonjs/skia/web/JsiSkRRect.js.map +1 -1
  83. package/lib/commonjs/skia/web/JsiSkRSXform.js.map +1 -1
  84. package/lib/commonjs/skia/web/JsiSkRect.js +3 -3
  85. package/lib/commonjs/skia/web/JsiSkRect.js.map +1 -1
  86. package/lib/commonjs/skia/web/JsiSkRuntimeEffect.js +4 -2
  87. package/lib/commonjs/skia/web/JsiSkRuntimeEffect.js.map +1 -1
  88. package/lib/commonjs/skia/web/JsiSkShaderFactory.js +10 -6
  89. package/lib/commonjs/skia/web/JsiSkShaderFactory.js.map +1 -1
  90. package/lib/commonjs/skia/web/JsiSkSurface.js +3 -1
  91. package/lib/commonjs/skia/web/JsiSkSurface.js.map +1 -1
  92. package/lib/commonjs/skia/web/JsiSkTextBlobFactory.js +8 -4
  93. package/lib/commonjs/skia/web/JsiSkTextBlobFactory.js.map +1 -1
  94. package/lib/commonjs/skia/web/JsiSkTypefaceFactory.js +1 -1
  95. package/lib/commonjs/skia/web/JsiSkTypefaceFactory.js.map +1 -1
  96. package/lib/commonjs/skia/web/JsiSkia.js +12 -6
  97. package/lib/commonjs/skia/web/JsiSkia.js.map +1 -1
  98. package/lib/commonjs/values/hooks/useComputedValue.js +6 -2
  99. package/lib/commonjs/values/hooks/useComputedValue.js.map +1 -1
  100. package/lib/commonjs/values/index.js +13 -0
  101. package/lib/commonjs/values/index.js.map +1 -1
  102. package/lib/commonjs/values/selector.js +24 -0
  103. package/lib/commonjs/values/selector.js.map +1 -0
  104. package/lib/commonjs/values/web/RNSkComputedValue.js +8 -0
  105. package/lib/commonjs/values/web/RNSkComputedValue.js.map +1 -1
  106. package/lib/commonjs/values/web/RNSkReadonlyValue.js +4 -0
  107. package/lib/commonjs/values/web/RNSkReadonlyValue.js.map +1 -1
  108. package/lib/module/mock/index.js +2 -1
  109. package/lib/module/mock/index.js.map +1 -1
  110. package/lib/module/renderer/Canvas.js +17 -6
  111. package/lib/module/renderer/Canvas.js.map +1 -1
  112. package/lib/module/renderer/DependencyManager.js +141 -34
  113. package/lib/module/renderer/DependencyManager.js.map +1 -1
  114. package/lib/module/renderer/HostConfig.js +1 -1
  115. package/lib/module/renderer/HostConfig.js.map +1 -1
  116. package/lib/module/renderer/components/Blend.js +21 -5
  117. package/lib/module/renderer/components/Blend.js.map +1 -1
  118. package/lib/module/renderer/components/backdrop/BackdropFilter.js.map +1 -1
  119. package/lib/module/renderer/components/imageFilters/Morphology.js +1 -1
  120. package/lib/module/renderer/components/imageFilters/Morphology.js.map +1 -1
  121. package/lib/module/renderer/components/imageFilters/Shadow.js +1 -1
  122. package/lib/module/renderer/components/imageFilters/Shadow.js.map +1 -1
  123. package/lib/module/renderer/nodes/Declaration.js +3 -4
  124. package/lib/module/renderer/nodes/Declaration.js.map +1 -1
  125. package/lib/module/renderer/nodes/Drawing.js +3 -6
  126. package/lib/module/renderer/nodes/Drawing.js.map +1 -1
  127. package/lib/module/renderer/nodes/Node.js +9 -7
  128. package/lib/module/renderer/nodes/Node.js.map +1 -1
  129. package/lib/module/renderer/processors/Animations/Animations.js +9 -15
  130. package/lib/module/renderer/processors/Animations/Animations.js.map +1 -1
  131. package/lib/module/skia/core/Data.js +10 -20
  132. package/lib/module/skia/core/Data.js.map +1 -1
  133. package/lib/module/skia/core/Font.js +2 -3
  134. package/lib/module/skia/core/Font.js.map +1 -1
  135. package/lib/module/skia/core/Image.js.map +1 -1
  136. package/lib/module/skia/core/SVG.js.map +1 -1
  137. package/lib/module/skia/core/Typeface.js.map +1 -1
  138. package/lib/module/skia/types/Data/Data.js +1 -1
  139. package/lib/module/skia/types/Data/Data.js.map +1 -1
  140. package/lib/module/skia/types/Paint/Paint.js.map +1 -1
  141. package/lib/module/skia/web/Host.js +9 -9
  142. package/lib/module/skia/web/Host.js.map +1 -1
  143. package/lib/module/skia/web/JsiSkCanvas.js +40 -29
  144. package/lib/module/skia/web/JsiSkCanvas.js.map +1 -1
  145. package/lib/module/skia/web/JsiSkColorFilterFactory.js +5 -5
  146. package/lib/module/skia/web/JsiSkColorFilterFactory.js.map +1 -1
  147. package/lib/module/skia/web/JsiSkFont.js +6 -4
  148. package/lib/module/skia/web/JsiSkFont.js.map +1 -1
  149. package/lib/module/skia/web/JsiSkImage.js +4 -3
  150. package/lib/module/skia/web/JsiSkImage.js.map +1 -1
  151. package/lib/module/skia/web/JsiSkImageFactory.js +4 -3
  152. package/lib/module/skia/web/JsiSkImageFactory.js.map +1 -1
  153. package/lib/module/skia/web/JsiSkImageFilterFactory.js +61 -20
  154. package/lib/module/skia/web/JsiSkImageFilterFactory.js.map +1 -1
  155. package/lib/module/skia/web/JsiSkMatrix.js +2 -2
  156. package/lib/module/skia/web/JsiSkMatrix.js.map +1 -1
  157. package/lib/module/skia/web/JsiSkPaint.js +15 -7
  158. package/lib/module/skia/web/JsiSkPaint.js.map +1 -1
  159. package/lib/module/skia/web/JsiSkPath.js +15 -62
  160. package/lib/module/skia/web/JsiSkPath.js.map +1 -1
  161. package/lib/module/skia/web/JsiSkPathEffectFactory.js +6 -4
  162. package/lib/module/skia/web/JsiSkPathEffectFactory.js.map +1 -1
  163. package/lib/module/skia/web/JsiSkPathFactory.js +2 -2
  164. package/lib/module/skia/web/JsiSkPathFactory.js.map +1 -1
  165. package/lib/module/skia/web/JsiSkPicture.js +4 -2
  166. package/lib/module/skia/web/JsiSkPicture.js.map +1 -1
  167. package/lib/module/skia/web/JsiSkPictureRecorder.js +3 -2
  168. package/lib/module/skia/web/JsiSkPictureRecorder.js.map +1 -1
  169. package/lib/module/skia/web/JsiSkPoint.js +10 -2
  170. package/lib/module/skia/web/JsiSkPoint.js.map +1 -1
  171. package/lib/module/skia/web/JsiSkRRect.js +10 -2
  172. package/lib/module/skia/web/JsiSkRRect.js.map +1 -1
  173. package/lib/module/skia/web/JsiSkRSXform.js.map +1 -1
  174. package/lib/module/skia/web/JsiSkRect.js +4 -4
  175. package/lib/module/skia/web/JsiSkRect.js.map +1 -1
  176. package/lib/module/skia/web/JsiSkRuntimeEffect.js +4 -3
  177. package/lib/module/skia/web/JsiSkRuntimeEffect.js.map +1 -1
  178. package/lib/module/skia/web/JsiSkShaderFactory.js +9 -7
  179. package/lib/module/skia/web/JsiSkShaderFactory.js.map +1 -1
  180. package/lib/module/skia/web/JsiSkSurface.js +3 -2
  181. package/lib/module/skia/web/JsiSkSurface.js.map +1 -1
  182. package/lib/module/skia/web/JsiSkTextBlobFactory.js +7 -5
  183. package/lib/module/skia/web/JsiSkTextBlobFactory.js.map +1 -1
  184. package/lib/module/skia/web/JsiSkTypefaceFactory.js +2 -2
  185. package/lib/module/skia/web/JsiSkTypefaceFactory.js.map +1 -1
  186. package/lib/module/skia/web/JsiSkia.js +10 -5
  187. package/lib/module/skia/web/JsiSkia.js.map +1 -1
  188. package/lib/module/values/hooks/useComputedValue.js +7 -3
  189. package/lib/module/values/hooks/useComputedValue.js.map +1 -1
  190. package/lib/module/values/index.js +1 -0
  191. package/lib/module/values/index.js.map +1 -1
  192. package/lib/module/values/selector.js +15 -0
  193. package/lib/module/values/selector.js.map +1 -0
  194. package/lib/module/values/web/RNSkComputedValue.js +8 -0
  195. package/lib/module/values/web/RNSkComputedValue.js.map +1 -1
  196. package/lib/module/values/web/RNSkReadonlyValue.js +4 -0
  197. package/lib/module/values/web/RNSkReadonlyValue.js.map +1 -1
  198. package/lib/typescript/src/renderer/Canvas.d.ts +1 -1
  199. package/lib/typescript/src/renderer/DependencyManager.d.ts +40 -14
  200. package/lib/typescript/src/renderer/nodes/Declaration.d.ts +2 -2
  201. package/lib/typescript/src/renderer/nodes/Drawing.d.ts +2 -2
  202. package/lib/typescript/src/renderer/nodes/Node.d.ts +3 -2
  203. package/lib/typescript/src/renderer/processors/Animations/Animations.d.ts +7 -3
  204. package/lib/typescript/src/skia/core/Data.d.ts +3 -5
  205. package/lib/typescript/src/skia/core/Font.d.ts +2 -2
  206. package/lib/typescript/src/skia/core/Image.d.ts +2 -2
  207. package/lib/typescript/src/skia/core/SVG.d.ts +2 -2
  208. package/lib/typescript/src/skia/core/Typeface.d.ts +2 -2
  209. package/lib/typescript/src/skia/types/Data/Data.d.ts +10 -3
  210. package/lib/typescript/src/skia/types/Paint/Paint.d.ts +5 -0
  211. package/lib/typescript/src/skia/types/Picture/Picture.d.ts +2 -1
  212. package/lib/typescript/src/skia/web/Host.d.ts +6 -8
  213. package/lib/typescript/src/skia/web/JsiSkImageFilterFactory.d.ts +8 -8
  214. package/lib/typescript/src/skia/web/JsiSkPaint.d.ts +1 -0
  215. package/lib/typescript/src/skia/web/JsiSkPoint.d.ts +3 -2
  216. package/lib/typescript/src/skia/web/JsiSkRRect.d.ts +3 -2
  217. package/lib/typescript/src/skia/web/JsiSkRSXform.d.ts +1 -2
  218. package/lib/typescript/src/skia/web/JsiSkRect.d.ts +3 -3
  219. package/lib/typescript/src/skia/web/JsiSkTextBlobFactory.d.ts +2 -1
  220. package/lib/typescript/src/values/index.d.ts +1 -0
  221. package/lib/typescript/src/values/selector.d.ts +14 -0
  222. package/lib/typescript/src/values/types.d.ts +4 -0
  223. package/lib/typescript/src/values/web/RNSkComputedValue.d.ts +1 -0
  224. package/lib/typescript/src/values/web/RNSkReadonlyValue.d.ts +1 -0
  225. package/libs/ios/libskia.xcframework/Info.plist +5 -5
  226. package/libs/ios/libskia.xcframework/ios-arm64_arm64e/libskia.a +0 -0
  227. package/libs/ios/libskia.xcframework/ios-arm64_arm64e_x86_64-simulator/libskia.a +0 -0
  228. package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e/libskshaper.a +0 -0
  229. package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e_x86_64-simulator/libskshaper.a +0 -0
  230. package/libs/ios/libsvg.xcframework/ios-arm64_arm64e/libsvg.a +0 -0
  231. package/libs/ios/libsvg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsvg.a +0 -0
  232. package/package.json +3 -3
  233. package/src/mock/index.ts +2 -1
  234. package/src/renderer/Canvas.tsx +19 -7
  235. package/src/renderer/DependencyManager.tsx +171 -37
  236. package/src/renderer/HostConfig.ts +1 -1
  237. package/src/renderer/components/Blend.tsx +25 -5
  238. package/src/renderer/components/backdrop/BackdropFilter.tsx +1 -1
  239. package/src/renderer/components/imageFilters/Morphology.tsx +2 -2
  240. package/src/renderer/components/imageFilters/Shadow.tsx +2 -2
  241. package/src/renderer/nodes/Declaration.tsx +6 -8
  242. package/src/renderer/nodes/Drawing.tsx +5 -7
  243. package/src/renderer/nodes/Node.ts +11 -9
  244. package/src/renderer/processors/Animations/Animations.ts +23 -14
  245. package/src/skia/core/Data.ts +20 -51
  246. package/src/skia/core/Font.ts +4 -5
  247. package/src/skia/core/Image.ts +2 -2
  248. package/src/skia/core/SVG.ts +2 -2
  249. package/src/skia/core/Typeface.ts +2 -2
  250. package/src/skia/types/Data/Data.ts +11 -1
  251. package/src/skia/types/Paint/Paint.ts +6 -0
  252. package/src/skia/types/Picture/Picture.ts +2 -1
  253. package/src/skia/web/Host.ts +12 -22
  254. package/src/skia/web/JsiSkCanvas.ts +99 -56
  255. package/src/skia/web/JsiSkColorFilterFactory.ts +15 -5
  256. package/src/skia/web/JsiSkFont.ts +11 -4
  257. package/src/skia/web/JsiSkImage.ts +4 -3
  258. package/src/skia/web/JsiSkImageFactory.ts +6 -3
  259. package/src/skia/web/JsiSkImageFilterFactory.ts +124 -52
  260. package/src/skia/web/JsiSkMatrix.ts +4 -2
  261. package/src/skia/web/JsiSkPaint.ts +15 -7
  262. package/src/skia/web/JsiSkPath.ts +30 -56
  263. package/src/skia/web/JsiSkPathEffectFactory.ts +10 -5
  264. package/src/skia/web/JsiSkPathFactory.ts +3 -3
  265. package/src/skia/web/JsiSkPicture.ts +5 -3
  266. package/src/skia/web/JsiSkPictureRecorder.ts +3 -2
  267. package/src/skia/web/JsiSkPoint.ts +12 -2
  268. package/src/skia/web/JsiSkRRect.ts +16 -2
  269. package/src/skia/web/JsiSkRSXform.ts +1 -1
  270. package/src/skia/web/JsiSkRect.ts +4 -7
  271. package/src/skia/web/JsiSkRuntimeEffect.ts +9 -4
  272. package/src/skia/web/JsiSkShaderFactory.ts +24 -15
  273. package/src/skia/web/JsiSkSurface.ts +7 -2
  274. package/src/skia/web/JsiSkTextBlobFactory.ts +14 -8
  275. package/src/skia/web/JsiSkTypefaceFactory.tsx +4 -2
  276. package/src/skia/web/JsiSkia.ts +17 -5
  277. package/src/values/hooks/useComputedValue.ts +6 -3
  278. package/src/values/index.ts +1 -0
  279. package/src/values/selector.ts +24 -0
  280. package/src/values/types.ts +4 -0
  281. package/src/values/web/RNSkComputedValue.ts +6 -0
  282. package/src/values/web/RNSkReadonlyValue.ts +4 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["JsiSkRRect.ts"],"names":["JsiSkRRect","HostObject","constructor","CanvasKit","ref","rx","ry","rect","JsiSkRect","Float32Array","of"],"mappings":";;;;;;;AAIA;;AACA;;AAEO,MAAMA,UAAN,SAAyBC,gBAAzB,CAAuE;AAC5EC,EAAAA,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAmC;AAC5C,UAAMD,SAAN,EAAiBC,GAAjB,EAAsB,OAAtB;AACD;;AAEK,MAAFC,EAAE,GAAG;AACP,WAAO,KAAKD,GAAL,CAAS,CAAT,CAAP;AACD;;AAEK,MAAFE,EAAE,GAAG;AACP,WAAO,KAAKF,GAAL,CAAS,CAAT,CAAP;AACD;;AAEO,MAAJG,IAAI,GAAG;AACT,WAAO,IAAIC,oBAAJ,CACL,KAAKL,SADA,EAELM,YAAY,CAACC,EAAb,CAAgB,KAAKN,GAAL,CAAS,CAAT,CAAhB,EAA6B,KAAKA,GAAL,CAAS,CAAT,CAA7B,EAA0C,KAAKA,GAAL,CAAS,CAAT,CAA1C,EAAuD,KAAKA,GAAL,CAAS,CAAT,CAAvD,CAFK,CAAP;AAID;;AAlB2E","sourcesContent":["import type { CanvasKit, RRect } from \"canvaskit-wasm\";\n\nimport type { SkRRect } from \"../types\";\n\nimport { HostObject } from \"./Host\";\nimport { JsiSkRect } from \"./JsiSkRect\";\n\nexport class JsiSkRRect extends HostObject<RRect, \"RRect\"> implements SkRRect {\n constructor(CanvasKit: CanvasKit, ref: RRect) {\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"]}
1
+ {"version":3,"sources":["JsiSkRRect.ts"],"names":["JsiSkRRect","BaseHostObject","fromValue","CanvasKit","rect","JsiSkRect","ref","RRectXY","rx","ry","constructor","Float32Array","of"],"mappings":";;;;;;;AAIA;;AACA;;AAEO,MAAMA,UAAN,SACGC,oBADH,CAGP;AACkB,SAATC,SAAS,CAACC,SAAD,EAAuBC,IAAvB,EAAsC;AACpD,QAAIA,IAAI,YAAYC,oBAApB,EAA+B;AAC7B,aAAOD,IAAI,CAACE,GAAZ;AACD;;AACD,WAAOH,SAAS,CAACI,OAAV,CACLF,qBAAUH,SAAV,CAAoBC,SAApB,EAA+BC,IAAI,CAACA,IAApC,CADK,EAELA,IAAI,CAACI,EAFA,EAGLJ,IAAI,CAACK,EAHA,CAAP;AAKD;;AAEDC,EAAAA,WAAW,CAACP,SAAD,EAAuBG,GAAvB,EAAmC;AAC5C,UAAMH,SAAN,EAAiBG,GAAjB,EAAsB,OAAtB;AACD;;AAEK,MAAFE,EAAE,GAAG;AACP,WAAO,KAAKF,GAAL,CAAS,CAAT,CAAP;AACD;;AAEK,MAAFG,EAAE,GAAG;AACP,WAAO,KAAKH,GAAL,CAAS,CAAT,CAAP;AACD;;AAEO,MAAJF,IAAI,GAAG;AACT,WAAO,IAAIC,oBAAJ,CACL,KAAKF,SADA,EAELQ,YAAY,CAACC,EAAb,CAAgB,KAAKN,GAAL,CAAS,CAAT,CAAhB,EAA6B,KAAKA,GAAL,CAAS,CAAT,CAA7B,EAA0C,KAAKA,GAAL,CAAS,CAAT,CAA1C,EAAuD,KAAKA,GAAL,CAAS,CAAT,CAAvD,CAFK,CAAP;AAID;;AA7BH","sourcesContent":["import type { CanvasKit, RRect } from \"canvaskit-wasm\";\n\nimport type { 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, ref: RRect) {\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"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["JsiSkRSXform.ts"],"names":["JsiSkRSXform","HostObject","constructor","CanvasKit","ref"],"mappings":";;;;;;;AAIA;;AAIO,MAAMA,YAAN,SACGC,gBADH,CAGP;AACEC,EAAAA,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAqC;AAC9C,UAAMD,SAAN,EAAiBC,GAAjB,EAAsB,SAAtB;AACD;;AAHH","sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type { SkRSXform } from \"../types\";\n\nimport { HostObject } from \"./Host\";\n\ntype 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"]}
1
+ {"version":3,"sources":["JsiSkRSXform.ts"],"names":["JsiSkRSXform","HostObject","constructor","CanvasKit","ref"],"mappings":";;;;;;;AAIA;;AAIO,MAAMA,YAAN,SACGC,gBADH,CAGP;AACEC,EAAAA,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAqC;AAC9C,UAAMD,SAAN,EAAiBC,GAAjB,EAAsB,SAAtB;AACD;;AAHH","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"]}
@@ -7,13 +7,13 @@ exports.JsiSkRect = void 0;
7
7
 
8
8
  var _Host = require("./Host");
9
9
 
10
- class JsiSkRect extends _Host.HostObject {
10
+ class JsiSkRect extends _Host.BaseHostObject {
11
11
  static fromValue(CanvasKit, rect) {
12
12
  if (rect instanceof JsiSkRect) {
13
- return rect;
13
+ return rect.ref;
14
14
  }
15
15
 
16
- return new JsiSkRect(CanvasKit, CanvasKit.XYWHRect(rect.x, rect.y, rect.width, rect.height));
16
+ return CanvasKit.XYWHRect(rect.x, rect.y, rect.width, rect.height);
17
17
  }
18
18
 
19
19
  constructor(CanvasKit, ref) {
@@ -1 +1 @@
1
- {"version":3,"sources":["JsiSkRect.ts"],"names":["JsiSkRect","HostObject","fromValue","CanvasKit","rect","XYWHRect","x","y","width","height","constructor","ref"],"mappings":";;;;;;;AAIA;;AAEO,MAAMA,SAAN,SAAwBC,gBAAxB,CAAmE;AACxD,SAATC,SAAS,CAACC,SAAD,EAAuBC,IAAvB,EAAqC;AACnD,QAAIA,IAAI,YAAYJ,SAApB,EAA+B;AAC7B,aAAOI,IAAP;AACD;;AACD,WAAO,IAAIJ,SAAJ,CACLG,SADK,EAELA,SAAS,CAACE,QAAV,CAAmBD,IAAI,CAACE,CAAxB,EAA2BF,IAAI,CAACG,CAAhC,EAAmCH,IAAI,CAACI,KAAxC,EAA+CJ,IAAI,CAACK,MAApD,CAFK,CAAP;AAID;;AAEDC,EAAAA,WAAW,CAACP,SAAD,EAAuBQ,GAAvB,EAAkC;AAC3C,UAAMR,SAAN,EAAiBQ,GAAjB,EAAsB,MAAtB;AACD;;AAEI,MAADL,CAAC,GAAG;AACN,WAAO,KAAKK,GAAL,CAAS,CAAT,CAAP;AACD;;AAEI,MAADJ,CAAC,GAAG;AACN,WAAO,KAAKI,GAAL,CAAS,CAAT,CAAP;AACD;;AAEQ,MAALH,KAAK,GAAG;AACV,WAAO,KAAKG,GAAL,CAAS,CAAT,IAAc,KAAKA,GAAL,CAAS,CAAT,CAArB;AACD;;AAES,MAANF,MAAM,GAAG;AACX,WAAO,KAAKE,GAAL,CAAS,CAAT,IAAc,KAAKA,GAAL,CAAS,CAAT,CAArB;AACD;;AA7BuE","sourcesContent":["import type { CanvasKit, Rect } from \"canvaskit-wasm\";\n\nimport type { SkRect } from \"../types\";\n\nimport { HostObject } from \"./Host\";\n\nexport class JsiSkRect extends HostObject<Rect, \"Rect\"> implements SkRect {\n static fromValue(CanvasKit: CanvasKit, rect: SkRect) {\n if (rect instanceof JsiSkRect) {\n return rect;\n }\n return new JsiSkRect(\n CanvasKit,\n CanvasKit.XYWHRect(rect.x, rect.y, rect.width, rect.height)\n );\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"]}
1
+ {"version":3,"sources":["JsiSkRect.ts"],"names":["JsiSkRect","BaseHostObject","fromValue","CanvasKit","rect","ref","XYWHRect","x","y","width","height","constructor"],"mappings":";;;;;;;AAIA;;AAEO,MAAMA,SAAN,SAAwBC,oBAAxB,CAAuE;AAC5D,SAATC,SAAS,CAACC,SAAD,EAAuBC,IAAvB,EAAqC;AACnD,QAAIA,IAAI,YAAYJ,SAApB,EAA+B;AAC7B,aAAOI,IAAI,CAACC,GAAZ;AACD;;AACD,WAAOF,SAAS,CAACG,QAAV,CAAmBF,IAAI,CAACG,CAAxB,EAA2BH,IAAI,CAACI,CAAhC,EAAmCJ,IAAI,CAACK,KAAxC,EAA+CL,IAAI,CAACM,MAApD,CAAP;AACD;;AAEDC,EAAAA,WAAW,CAACR,SAAD,EAAuBE,GAAvB,EAAkC;AAC3C,UAAMF,SAAN,EAAiBE,GAAjB,EAAsB,MAAtB;AACD;;AAEI,MAADE,CAAC,GAAG;AACN,WAAO,KAAKF,GAAL,CAAS,CAAT,CAAP;AACD;;AAEI,MAADG,CAAC,GAAG;AACN,WAAO,KAAKH,GAAL,CAAS,CAAT,CAAP;AACD;;AAEQ,MAALI,KAAK,GAAG;AACV,WAAO,KAAKJ,GAAL,CAAS,CAAT,IAAc,KAAKA,GAAL,CAAS,CAAT,CAArB;AACD;;AAES,MAANK,MAAM,GAAG;AACX,WAAO,KAAKL,GAAL,CAAS,CAAT,IAAc,KAAKA,GAAL,CAAS,CAAT,CAArB;AACD;;AA1B2E","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"]}
@@ -7,6 +7,8 @@ exports.JsiSkRuntimeEffect = void 0;
7
7
 
8
8
  var _Host = require("./Host");
9
9
 
10
+ var _JsiSkMatrix = require("./JsiSkMatrix");
11
+
10
12
  var _JsiSkShader = require("./JsiSkShader");
11
13
 
12
14
  class JsiSkRuntimeEffect extends _Host.HostObject {
@@ -15,11 +17,11 @@ class JsiSkRuntimeEffect extends _Host.HostObject {
15
17
  }
16
18
 
17
19
  makeShader(uniforms, localMatrix) {
18
- return new _JsiSkShader.JsiSkShader(this.CanvasKit, this.ref.makeShader(uniforms, localMatrix !== undefined ? (0, _Host.toValue)(localMatrix) : localMatrix));
20
+ return new _JsiSkShader.JsiSkShader(this.CanvasKit, this.ref.makeShader(uniforms, localMatrix !== undefined ? _JsiSkMatrix.JsiSkMatrix.fromValue(localMatrix) : localMatrix));
19
21
  }
20
22
 
21
23
  makeShaderWithChildren(uniforms, children, localMatrix) {
22
- return new _JsiSkShader.JsiSkShader(this.CanvasKit, this.ref.makeShaderWithChildren(uniforms, children === null || children === void 0 ? void 0 : children.map(child => (0, _Host.toValue)(child)), localMatrix !== undefined ? (0, _Host.toValue)(localMatrix) : localMatrix));
24
+ return new _JsiSkShader.JsiSkShader(this.CanvasKit, this.ref.makeShaderWithChildren(uniforms, children === null || children === void 0 ? void 0 : children.map(child => _JsiSkShader.JsiSkShader.fromValue(child)), localMatrix !== undefined ? _JsiSkMatrix.JsiSkMatrix.fromValue(localMatrix) : localMatrix));
23
25
  }
24
26
 
25
27
  getUniform(index) {
@@ -1 +1 @@
1
- {"version":3,"sources":["JsiSkRuntimeEffect.ts"],"names":["JsiSkRuntimeEffect","HostObject","constructor","CanvasKit","ref","makeShader","uniforms","localMatrix","JsiSkShader","undefined","makeShaderWithChildren","children","map","child","getUniform","index","getUniformCount","getUniformFloatCount","getUniformName"],"mappings":";;;;;;;AAKA;;AACA;;AAEO,MAAMA,kBAAN,SACGC,gBADH,CAGP;AACEC,EAAAA,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAA2C;AACpD,UAAMD,SAAN,EAAiBC,GAAjB,EAAsB,eAAtB;AACD;;AAEDC,EAAAA,UAAU,CAACC,QAAD,EAAqBC,WAArB,EAA6C;AACrD,WAAO,IAAIC,wBAAJ,CACL,KAAKL,SADA,EAEL,KAAKC,GAAL,CAASC,UAAT,CACEC,QADF,EAEEC,WAAW,KAAKE,SAAhB,GAA4B,mBAAQF,WAAR,CAA5B,GAAmDA,WAFrD,CAFK,CAAP;AAOD;;AAEDG,EAAAA,sBAAsB,CACpBJ,QADoB,EAEpBK,QAFoB,EAGpBJ,WAHoB,EAIpB;AACA,WAAO,IAAIC,wBAAJ,CACL,KAAKL,SADA,EAEL,KAAKC,GAAL,CAASM,sBAAT,CACEJ,QADF,EAEEK,QAFF,aAEEA,QAFF,uBAEEA,QAAQ,CAAEC,GAAV,CAAeC,KAAD,IAAW,mBAAQA,KAAR,CAAzB,CAFF,EAGEN,WAAW,KAAKE,SAAhB,GAA4B,mBAAQF,WAAR,CAA5B,GAAmDA,WAHrD,CAFK,CAAP;AAQD;;AAEDO,EAAAA,UAAU,CAACC,KAAD,EAAgB;AACxB,WAAO,KAAKX,GAAL,CAASU,UAAT,CAAoBC,KAApB,CAAP;AACD;;AAEDC,EAAAA,eAAe,GAAG;AAChB,WAAO,KAAKZ,GAAL,CAASY,eAAT,EAAP;AACD;;AAEDC,EAAAA,oBAAoB,GAAG;AACrB,WAAO,KAAKb,GAAL,CAASa,oBAAT,EAAP;AACD;;AAEDC,EAAAA,cAAc,CAACH,KAAD,EAAgB;AAC5B,WAAO,KAAKX,GAAL,CAASc,cAAT,CAAwBH,KAAxB,CAAP;AACD;;AA5CH","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, toValue } from \"./Host\";\nimport { JsiSkShader } from \"./JsiSkShader\";\n\nexport class JsiSkRuntimeEffect\n extends HostObject<RuntimeEffect, \"RuntimeEffect\">\n implements SkRuntimeEffect\n{\n constructor(CanvasKit: CanvasKit, ref: RuntimeEffect) {\n super(CanvasKit, ref, \"RuntimeEffect\");\n }\n\n makeShader(uniforms: number[], localMatrix?: SkMatrix) {\n return new JsiSkShader(\n this.CanvasKit,\n this.ref.makeShader(\n uniforms,\n localMatrix !== undefined ? toValue(localMatrix) : 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) => toValue(child)),\n localMatrix !== undefined ? toValue(localMatrix) : 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"]}
1
+ {"version":3,"sources":["JsiSkRuntimeEffect.ts"],"names":["JsiSkRuntimeEffect","HostObject","constructor","CanvasKit","ref","makeShader","uniforms","localMatrix","JsiSkShader","undefined","JsiSkMatrix","fromValue","makeShaderWithChildren","children","map","child","getUniform","index","getUniformCount","getUniformFloatCount","getUniformName"],"mappings":";;;;;;;AAKA;;AACA;;AACA;;AAEO,MAAMA,kBAAN,SACGC,gBADH,CAGP;AACEC,EAAAA,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAA2C;AACpD,UAAMD,SAAN,EAAiBC,GAAjB,EAAsB,eAAtB;AACD;;AAEDC,EAAAA,UAAU,CAACC,QAAD,EAAqBC,WAArB,EAA6C;AACrD,WAAO,IAAIC,wBAAJ,CACL,KAAKL,SADA,EAEL,KAAKC,GAAL,CAASC,UAAT,CACEC,QADF,EAEEC,WAAW,KAAKE,SAAhB,GACIC,yBAAYC,SAAZ,CAAsBJ,WAAtB,CADJ,GAEIA,WAJN,CAFK,CAAP;AASD;;AAEDK,EAAAA,sBAAsB,CACpBN,QADoB,EAEpBO,QAFoB,EAGpBN,WAHoB,EAIpB;AACA,WAAO,IAAIC,wBAAJ,CACL,KAAKL,SADA,EAEL,KAAKC,GAAL,CAASQ,sBAAT,CACEN,QADF,EAEEO,QAFF,aAEEA,QAFF,uBAEEA,QAAQ,CAAEC,GAAV,CAAeC,KAAD,IAAWP,yBAAYG,SAAZ,CAAsBI,KAAtB,CAAzB,CAFF,EAGER,WAAW,KAAKE,SAAhB,GACIC,yBAAYC,SAAZ,CAAsBJ,WAAtB,CADJ,GAEIA,WALN,CAFK,CAAP;AAUD;;AAEDS,EAAAA,UAAU,CAACC,KAAD,EAAgB;AACxB,WAAO,KAAKb,GAAL,CAASY,UAAT,CAAoBC,KAApB,CAAP;AACD;;AAEDC,EAAAA,eAAe,GAAG;AAChB,WAAO,KAAKd,GAAL,CAASc,eAAT,EAAP;AACD;;AAEDC,EAAAA,oBAAoB,GAAG;AACrB,WAAO,KAAKf,GAAL,CAASe,oBAAT,EAAP;AACD;;AAEDC,EAAAA,cAAc,CAACH,KAAD,EAAgB;AAC5B,WAAO,KAAKb,GAAL,CAASgB,cAAT,CAAwBH,KAAxB,CAAP;AACD;;AAhDH","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) {\n super(CanvasKit, ref, \"RuntimeEffect\");\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"]}
@@ -7,6 +7,10 @@ exports.JsiSkShaderFactory = void 0;
7
7
 
8
8
  var _Host = require("./Host");
9
9
 
10
+ var _JsiSkMatrix = require("./JsiSkMatrix");
11
+
12
+ var _JsiSkPoint = require("./JsiSkPoint");
13
+
10
14
  var _JsiSkShader = require("./JsiSkShader");
11
15
 
12
16
  class JsiSkShaderFactory extends _Host.Host {
@@ -15,19 +19,19 @@ class JsiSkShaderFactory extends _Host.Host {
15
19
  }
16
20
 
17
21
  MakeLinearGradient(start, end, colors, pos, mode, localMatrix, flags) {
18
- return new _JsiSkShader.JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeLinearGradient((0, _Host.toValue)(start), (0, _Host.toValue)(end), colors, pos, (0, _Host.ckEnum)(mode), localMatrix === undefined ? undefined : (0, _Host.toValue)(localMatrix), flags));
22
+ return new _JsiSkShader.JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeLinearGradient(_JsiSkPoint.JsiSkPoint.fromValue(start), _JsiSkPoint.JsiSkPoint.fromValue(end), colors, pos, (0, _Host.ckEnum)(mode), localMatrix === undefined ? undefined : _JsiSkMatrix.JsiSkMatrix.fromValue(localMatrix), flags));
19
23
  }
20
24
 
21
25
  MakeRadialGradient(center, radius, colors, pos, mode, localMatrix, flags) {
22
- return new _JsiSkShader.JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeRadialGradient((0, _Host.toValue)(center), radius, colors, pos, (0, _Host.ckEnum)(mode), localMatrix === undefined ? undefined : (0, _Host.toValue)(localMatrix), flags));
26
+ return new _JsiSkShader.JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeRadialGradient(_JsiSkPoint.JsiSkPoint.fromValue(center), radius, colors, pos, (0, _Host.ckEnum)(mode), localMatrix === undefined ? undefined : _JsiSkMatrix.JsiSkMatrix.fromValue(localMatrix), flags));
23
27
  }
24
28
 
25
29
  MakeTwoPointConicalGradient(start, startRadius, end, endRadius, colors, pos, mode, localMatrix, flags) {
26
- return new _JsiSkShader.JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeTwoPointConicalGradient((0, _Host.toValue)(start), startRadius, (0, _Host.toValue)(end), endRadius, colors, pos, (0, _Host.ckEnum)(mode), localMatrix === undefined ? undefined : (0, _Host.toValue)(localMatrix), flags));
30
+ return new _JsiSkShader.JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeTwoPointConicalGradient(_JsiSkPoint.JsiSkPoint.fromValue(start), startRadius, _JsiSkPoint.JsiSkPoint.fromValue(end), endRadius, colors, pos, (0, _Host.ckEnum)(mode), localMatrix === undefined ? undefined : _JsiSkMatrix.JsiSkMatrix.fromValue(localMatrix), flags));
27
31
  }
28
32
 
29
33
  MakeSweepGradient(cx, cy, colors, pos, mode, localMatrix, flags, startAngleInDegrees, endAngleInDegrees) {
30
- return new _JsiSkShader.JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeSweepGradient(cx, cy, colors, pos, (0, _Host.ckEnum)(mode), localMatrix === undefined || localMatrix === null ? undefined : (0, _Host.toValue)(localMatrix), flags, startAngleInDegrees, endAngleInDegrees));
34
+ return new _JsiSkShader.JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeSweepGradient(cx, cy, colors, pos, (0, _Host.ckEnum)(mode), localMatrix === undefined || localMatrix === null ? undefined : _JsiSkMatrix.JsiSkMatrix.fromValue(localMatrix), flags, startAngleInDegrees, endAngleInDegrees));
31
35
  }
32
36
 
33
37
  MakeTurbulence(baseFreqX, baseFreqY, octaves, seed, tileW, tileH) {
@@ -39,11 +43,11 @@ class JsiSkShaderFactory extends _Host.Host {
39
43
  }
40
44
 
41
45
  MakeBlend(mode, one, two) {
42
- return new _JsiSkShader.JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeBlend((0, _Host.ckEnum)(mode), (0, _Host.toValue)(one), (0, _Host.toValue)(two)));
46
+ return new _JsiSkShader.JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeBlend((0, _Host.ckEnum)(mode), _JsiSkShader.JsiSkShader.fromValue(one), _JsiSkShader.JsiSkShader.fromValue(two)));
43
47
  }
44
48
 
45
49
  MakeColor(color) {
46
- return new _JsiSkShader.JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeColor((0, _Host.toValue)(color), this.CanvasKit.ColorSpace.SRGB));
50
+ return new _JsiSkShader.JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeColor(color, this.CanvasKit.ColorSpace.SRGB));
47
51
  }
48
52
 
49
53
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["JsiSkShaderFactory.ts"],"names":["JsiSkShaderFactory","Host","constructor","CanvasKit","MakeLinearGradient","start","end","colors","pos","mode","localMatrix","flags","JsiSkShader","Shader","undefined","MakeRadialGradient","center","radius","MakeTwoPointConicalGradient","startRadius","endRadius","MakeSweepGradient","cx","cy","startAngleInDegrees","endAngleInDegrees","MakeTurbulence","baseFreqX","baseFreqY","octaves","seed","tileW","tileH","MakeFractalNoise","MakeBlend","one","two","MakeColor","color","ColorSpace","SRGB"],"mappings":"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","sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type {\n BlendMode,\n SkColor,\n SkMatrix,\n SkPoint,\n SkShader,\n TileMode,\n} from \"../types\";\nimport type { ShaderFactory } from \"../types/Shader/ShaderFactory\";\n\nimport { Host, toValue, ckEnum } from \"./Host\";\nimport { JsiSkShader } from \"./JsiSkShader\";\n\nexport class JsiSkShaderFactory extends Host implements ShaderFactory {\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n MakeLinearGradient(\n start: SkPoint,\n end: SkPoint,\n colors: SkColor[],\n pos: number[] | null,\n mode: TileMode,\n localMatrix?: SkMatrix,\n flags?: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeLinearGradient(\n toValue(start),\n toValue(end),\n colors,\n pos,\n ckEnum(mode),\n localMatrix === undefined ? undefined : toValue(localMatrix),\n flags\n )\n );\n }\n\n MakeRadialGradient(\n center: SkPoint,\n radius: number,\n colors: SkColor[],\n pos: number[] | null,\n mode: TileMode,\n localMatrix?: SkMatrix,\n flags?: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeRadialGradient(\n toValue(center),\n radius,\n colors,\n pos,\n ckEnum(mode),\n localMatrix === undefined ? undefined : toValue(localMatrix),\n flags\n )\n );\n }\n\n MakeTwoPointConicalGradient(\n start: SkPoint,\n startRadius: number,\n end: SkPoint,\n endRadius: number,\n colors: SkColor[],\n pos: number[] | null,\n mode: TileMode,\n localMatrix?: SkMatrix,\n flags?: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeTwoPointConicalGradient(\n toValue(start),\n startRadius,\n toValue(end),\n endRadius,\n colors,\n pos,\n ckEnum(mode),\n localMatrix === undefined ? undefined : toValue(localMatrix),\n flags\n )\n );\n }\n\n MakeSweepGradient(\n cx: number,\n cy: number,\n colors: SkColor[],\n pos: number[] | null,\n mode: TileMode,\n localMatrix?: SkMatrix | null,\n flags?: number,\n startAngleInDegrees?: number,\n endAngleInDegrees?: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeSweepGradient(\n cx,\n cy,\n colors,\n pos,\n ckEnum(mode),\n localMatrix === undefined || localMatrix === null\n ? undefined\n : toValue(localMatrix),\n flags,\n startAngleInDegrees,\n endAngleInDegrees\n )\n );\n }\n\n MakeTurbulence(\n baseFreqX: number,\n baseFreqY: number,\n octaves: number,\n seed: number,\n tileW: number,\n tileH: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeTurbulence(\n baseFreqX,\n baseFreqY,\n octaves,\n seed,\n tileW,\n tileH\n )\n );\n }\n\n MakeFractalNoise(\n baseFreqX: number,\n baseFreqY: number,\n octaves: number,\n seed: number,\n tileW: number,\n tileH: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeFractalNoise(\n baseFreqX,\n baseFreqY,\n octaves,\n seed,\n tileW,\n tileH\n )\n );\n }\n\n MakeBlend(mode: BlendMode, one: SkShader, two: SkShader) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeBlend(ckEnum(mode), toValue(one), toValue(two))\n );\n }\n\n MakeColor(color: SkColor) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeColor(\n toValue(color),\n this.CanvasKit.ColorSpace.SRGB\n )\n );\n }\n}\n"]}
1
+ {"version":3,"sources":["JsiSkShaderFactory.ts"],"names":["JsiSkShaderFactory","Host","constructor","CanvasKit","MakeLinearGradient","start","end","colors","pos","mode","localMatrix","flags","JsiSkShader","Shader","JsiSkPoint","fromValue","undefined","JsiSkMatrix","MakeRadialGradient","center","radius","MakeTwoPointConicalGradient","startRadius","endRadius","MakeSweepGradient","cx","cy","startAngleInDegrees","endAngleInDegrees","MakeTurbulence","baseFreqX","baseFreqY","octaves","seed","tileW","tileH","MakeFractalNoise","MakeBlend","one","two","MakeColor","color","ColorSpace","SRGB"],"mappings":"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","sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type {\n BlendMode,\n SkColor,\n SkMatrix,\n SkPoint,\n SkShader,\n TileMode,\n} from \"../types\";\nimport type { ShaderFactory } from \"../types/Shader/ShaderFactory\";\n\nimport { Host, ckEnum } from \"./Host\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkPoint } from \"./JsiSkPoint\";\nimport { JsiSkShader } from \"./JsiSkShader\";\n\nexport class JsiSkShaderFactory extends Host implements ShaderFactory {\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n MakeLinearGradient(\n start: SkPoint,\n end: SkPoint,\n colors: SkColor[],\n pos: number[] | null,\n mode: TileMode,\n localMatrix?: SkMatrix,\n flags?: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeLinearGradient(\n JsiSkPoint.fromValue(start),\n JsiSkPoint.fromValue(end),\n colors,\n pos,\n ckEnum(mode),\n localMatrix === undefined\n ? undefined\n : JsiSkMatrix.fromValue(localMatrix),\n flags\n )\n );\n }\n\n MakeRadialGradient(\n center: SkPoint,\n radius: number,\n colors: SkColor[],\n pos: number[] | null,\n mode: TileMode,\n localMatrix?: SkMatrix,\n flags?: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeRadialGradient(\n JsiSkPoint.fromValue(center),\n radius,\n colors,\n pos,\n ckEnum(mode),\n localMatrix === undefined\n ? undefined\n : JsiSkMatrix.fromValue(localMatrix),\n flags\n )\n );\n }\n\n MakeTwoPointConicalGradient(\n start: SkPoint,\n startRadius: number,\n end: SkPoint,\n endRadius: number,\n colors: SkColor[],\n pos: number[] | null,\n mode: TileMode,\n localMatrix?: SkMatrix,\n flags?: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeTwoPointConicalGradient(\n JsiSkPoint.fromValue(start),\n startRadius,\n JsiSkPoint.fromValue(end),\n endRadius,\n colors,\n pos,\n ckEnum(mode),\n localMatrix === undefined\n ? undefined\n : JsiSkMatrix.fromValue(localMatrix),\n flags\n )\n );\n }\n\n MakeSweepGradient(\n cx: number,\n cy: number,\n colors: SkColor[],\n pos: number[] | null,\n mode: TileMode,\n localMatrix?: SkMatrix | null,\n flags?: number,\n startAngleInDegrees?: number,\n endAngleInDegrees?: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeSweepGradient(\n cx,\n cy,\n colors,\n pos,\n ckEnum(mode),\n localMatrix === undefined || localMatrix === null\n ? undefined\n : JsiSkMatrix.fromValue(localMatrix),\n flags,\n startAngleInDegrees,\n endAngleInDegrees\n )\n );\n }\n\n MakeTurbulence(\n baseFreqX: number,\n baseFreqY: number,\n octaves: number,\n seed: number,\n tileW: number,\n tileH: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeTurbulence(\n baseFreqX,\n baseFreqY,\n octaves,\n seed,\n tileW,\n tileH\n )\n );\n }\n\n MakeFractalNoise(\n baseFreqX: number,\n baseFreqY: number,\n octaves: number,\n seed: number,\n tileW: number,\n tileH: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeFractalNoise(\n baseFreqX,\n baseFreqY,\n octaves,\n seed,\n tileW,\n tileH\n )\n );\n }\n\n MakeBlend(mode: BlendMode, one: SkShader, two: SkShader) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeBlend(\n ckEnum(mode),\n JsiSkShader.fromValue(one),\n JsiSkShader.fromValue(two)\n )\n );\n }\n\n MakeColor(color: SkColor) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeColor(color, this.CanvasKit.ColorSpace.SRGB)\n );\n }\n}\n"]}
@@ -11,6 +11,8 @@ var _JsiSkCanvas = require("./JsiSkCanvas");
11
11
 
12
12
  var _JsiSkImage = require("./JsiSkImage");
13
13
 
14
+ var _JsiSkRect = require("./JsiSkRect");
15
+
14
16
  class JsiSkSurface extends _Host.HostObject {
15
17
  constructor(CanvasKit, ref) {
16
18
  super(CanvasKit, ref, "Surface");
@@ -21,7 +23,7 @@ class JsiSkSurface extends _Host.HostObject {
21
23
  }
22
24
 
23
25
  makeImageSnapshot(bounds) {
24
- const image = this.ref.makeImageSnapshot((0, _Host.toUndefinedableValue)(bounds));
26
+ const image = this.ref.makeImageSnapshot(bounds ? Array.from(_JsiSkRect.JsiSkRect.fromValue(this.CanvasKit, bounds)) : undefined);
25
27
  return new _JsiSkImage.JsiSkImage(this.CanvasKit, image);
26
28
  }
27
29
 
@@ -1 +1 @@
1
- {"version":3,"sources":["JsiSkSurface.ts"],"names":["JsiSkSurface","HostObject","constructor","CanvasKit","ref","getCanvas","JsiSkCanvas","makeImageSnapshot","bounds","image","JsiSkImage"],"mappings":";;;;;;;AAIA;;AACA;;AACA;;AAEO,MAAMA,YAAN,SACGC,gBADH,CAGP;AACEC,EAAAA,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAqC;AAC9C,UAAMD,SAAN,EAAiBC,GAAjB,EAAsB,SAAtB;AACD;;AAEDC,EAAAA,SAAS,GAAa;AACpB,WAAO,IAAIC,wBAAJ,CAAgB,KAAKH,SAArB,EAAgC,KAAKC,GAAL,CAASC,SAAT,EAAhC,CAAP;AACD;;AAEDE,EAAAA,iBAAiB,CAACC,MAAD,EAA2B;AAC1C,UAAMC,KAAK,GAAG,KAAKL,GAAL,CAASG,iBAAT,CAA2B,gCAAqBC,MAArB,CAA3B,CAAd;AACA,WAAO,IAAIE,sBAAJ,CAAe,KAAKP,SAApB,EAA+BM,KAA/B,CAAP;AACD;;AAZH","sourcesContent":["import type { CanvasKit, Surface } from \"canvaskit-wasm\";\n\nimport type { SkCanvas, SkImage, SkRect, SkSurface } from \"../types\";\n\nimport { HostObject, toUndefinedableValue } from \"./Host\";\nimport { JsiSkCanvas } from \"./JsiSkCanvas\";\nimport { JsiSkImage } from \"./JsiSkImage\";\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 getCanvas(): SkCanvas {\n return new JsiSkCanvas(this.CanvasKit, this.ref.getCanvas());\n }\n\n makeImageSnapshot(bounds?: SkRect): SkImage {\n const image = this.ref.makeImageSnapshot(toUndefinedableValue(bounds));\n return new JsiSkImage(this.CanvasKit, image);\n }\n}\n"]}
1
+ {"version":3,"sources":["JsiSkSurface.ts"],"names":["JsiSkSurface","HostObject","constructor","CanvasKit","ref","getCanvas","JsiSkCanvas","makeImageSnapshot","bounds","image","Array","from","JsiSkRect","fromValue","undefined","JsiSkImage"],"mappings":";;;;;;;AAIA;;AACA;;AACA;;AACA;;AAEO,MAAMA,YAAN,SACGC,gBADH,CAGP;AACEC,EAAAA,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAqC;AAC9C,UAAMD,SAAN,EAAiBC,GAAjB,EAAsB,SAAtB;AACD;;AAEDC,EAAAA,SAAS,GAAa;AACpB,WAAO,IAAIC,wBAAJ,CAAgB,KAAKH,SAArB,EAAgC,KAAKC,GAAL,CAASC,SAAT,EAAhC,CAAP;AACD;;AAEDE,EAAAA,iBAAiB,CAACC,MAAD,EAA2B;AAC1C,UAAMC,KAAK,GAAG,KAAKL,GAAL,CAASG,iBAAT,CACZC,MAAM,GACFE,KAAK,CAACC,IAAN,CAAWC,qBAAUC,SAAV,CAAoB,KAAKV,SAAzB,EAAoCK,MAApC,CAAX,CADE,GAEFM,SAHQ,CAAd;AAKA,WAAO,IAAIC,sBAAJ,CAAe,KAAKZ,SAApB,EAA+BM,KAA/B,CAAP;AACD;;AAhBH","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 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"]}
@@ -7,27 +7,31 @@ exports.JsiSkTextBlobFactory = void 0;
7
7
 
8
8
  var _Host = require("./Host");
9
9
 
10
+ var _JsiSkFont = require("./JsiSkFont");
11
+
10
12
  var _JsiSkTextBlob = require("./JsiSkTextBlob");
11
13
 
14
+ var _JsiSkRSXform = require("./JsiSkRSXform");
15
+
12
16
  class JsiSkTextBlobFactory extends _Host.Host {
13
17
  constructor(CanvasKit) {
14
18
  super(CanvasKit);
15
19
  }
16
20
 
17
21
  MakeFromText(str, font) {
18
- return new _JsiSkTextBlob.JsiSkTextBlob(this.CanvasKit, this.CanvasKit.TextBlob.MakeFromText(str, (0, _Host.toValue)(font)));
22
+ return new _JsiSkTextBlob.JsiSkTextBlob(this.CanvasKit, this.CanvasKit.TextBlob.MakeFromText(str, _JsiSkFont.JsiSkFont.fromValue(font)));
19
23
  }
20
24
 
21
25
  MakeFromGlyphs(glyphs, font) {
22
- return new _JsiSkTextBlob.JsiSkTextBlob(this.CanvasKit, this.CanvasKit.TextBlob.MakeFromGlyphs(glyphs, (0, _Host.toValue)(font)));
26
+ return new _JsiSkTextBlob.JsiSkTextBlob(this.CanvasKit, this.CanvasKit.TextBlob.MakeFromGlyphs(glyphs, _JsiSkFont.JsiSkFont.fromValue(font)));
23
27
  }
24
28
 
25
29
  MakeFromRSXform(str, rsxforms, font) {
26
- return new _JsiSkTextBlob.JsiSkTextBlob(this.CanvasKit, this.CanvasKit.TextBlob.MakeFromRSXform(str, rsxforms.map(f => Array.from((0, _Host.toValue)(f))).flat(), (0, _Host.toValue)(font)));
30
+ return new _JsiSkTextBlob.JsiSkTextBlob(this.CanvasKit, this.CanvasKit.TextBlob.MakeFromRSXform(str, rsxforms.map(f => Array.from(_JsiSkRSXform.JsiSkRSXform.fromValue(f))).flat(), _JsiSkFont.JsiSkFont.fromValue(font)));
27
31
  }
28
32
 
29
33
  MakeFromRSXformGlyphs(glyphs, rsxforms, font) {
30
- return new _JsiSkTextBlob.JsiSkTextBlob(this.CanvasKit, this.CanvasKit.TextBlob.MakeFromRSXformGlyphs(glyphs, rsxforms.map(f => (0, _Host.toValue)(f)), (0, _Host.toValue)(font)));
34
+ return new _JsiSkTextBlob.JsiSkTextBlob(this.CanvasKit, this.CanvasKit.TextBlob.MakeFromRSXformGlyphs(glyphs, rsxforms.map(f => _JsiSkRSXform.JsiSkRSXform.fromValue(f)), _JsiSkFont.JsiSkFont.fromValue(font)));
31
35
  }
32
36
 
33
37
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["JsiSkTextBlobFactory.ts"],"names":["JsiSkTextBlobFactory","Host","constructor","CanvasKit","MakeFromText","str","font","JsiSkTextBlob","TextBlob","MakeFromGlyphs","glyphs","MakeFromRSXform","rsxforms","map","f","Array","from","flat","MakeFromRSXformGlyphs"],"mappings":";;;;;;;AAKA;;AACA;;AAEO,MAAMA,oBAAN,SAAmCC,UAAnC,CAAmE;AACxEC,EAAAA,WAAW,CAACC,SAAD,EAAuB;AAChC,UAAMA,SAAN;AACD;;AAEDC,EAAAA,YAAY,CAACC,GAAD,EAAcC,IAAd,EAA4B;AACtC,WAAO,IAAIC,4BAAJ,CACL,KAAKJ,SADA,EAEL,KAAKA,SAAL,CAAeK,QAAf,CAAwBJ,YAAxB,CAAqCC,GAArC,EAA0C,mBAAQC,IAAR,CAA1C,CAFK,CAAP;AAID;;AAEDG,EAAAA,cAAc,CAACC,MAAD,EAAmBJ,IAAnB,EAAiC;AAC7C,WAAO,IAAIC,4BAAJ,CACL,KAAKJ,SADA,EAEL,KAAKA,SAAL,CAAeK,QAAf,CAAwBC,cAAxB,CAAuCC,MAAvC,EAA+C,mBAAQJ,IAAR,CAA/C,CAFK,CAAP;AAID;;AAEDK,EAAAA,eAAe,CAACN,GAAD,EAAcO,QAAd,EAAqCN,IAArC,EAAmD;AAChE,WAAO,IAAIC,4BAAJ,CACL,KAAKJ,SADA,EAEL,KAAKA,SAAL,CAAeK,QAAf,CAAwBG,eAAxB,CACEN,GADF,EAEEO,QAAQ,CAACC,GAAT,CAAcC,CAAD,IAAOC,KAAK,CAACC,IAAN,CAAW,mBAAsBF,CAAtB,CAAX,CAApB,EAA0DG,IAA1D,EAFF,EAGE,mBAAQX,IAAR,CAHF,CAFK,CAAP;AAQD;;AAEDY,EAAAA,qBAAqB,CAACR,MAAD,EAAmBE,QAAnB,EAA0CN,IAA1C,EAAwD;AAC3E,WAAO,IAAIC,4BAAJ,CACL,KAAKJ,SADA,EAEL,KAAKA,SAAL,CAAeK,QAAf,CAAwBU,qBAAxB,CACER,MADF,EAEEE,QAAQ,CAACC,GAAT,CAAcC,CAAD,IAAO,mBAAQA,CAAR,CAApB,CAFF,EAGE,mBAAQR,IAAR,CAHF,CAFK,CAAP;AAQD;;AAvCuE","sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type { SkFont, SkRSXform } from \"../types\";\nimport type { TextBlobFactory } from \"../types/TextBlob\";\n\nimport { Host, toValue } from \"./Host\";\nimport { JsiSkTextBlob } from \"./JsiSkTextBlob\";\n\nexport class JsiSkTextBlobFactory extends Host implements TextBlobFactory {\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n MakeFromText(str: string, font: SkFont) {\n return new JsiSkTextBlob(\n this.CanvasKit,\n this.CanvasKit.TextBlob.MakeFromText(str, toValue(font))\n );\n }\n\n MakeFromGlyphs(glyphs: number[], font: SkFont) {\n return new JsiSkTextBlob(\n this.CanvasKit,\n this.CanvasKit.TextBlob.MakeFromGlyphs(glyphs, toValue(font))\n );\n }\n\n MakeFromRSXform(str: string, rsxforms: SkRSXform[], font: SkFont) {\n return new JsiSkTextBlob(\n this.CanvasKit,\n this.CanvasKit.TextBlob.MakeFromRSXform(\n str,\n rsxforms.map((f) => Array.from(toValue<Float32Array>(f))).flat(),\n toValue(font)\n )\n );\n }\n\n MakeFromRSXformGlyphs(glyphs: number[], rsxforms: SkRSXform[], font: SkFont) {\n return new JsiSkTextBlob(\n this.CanvasKit,\n this.CanvasKit.TextBlob.MakeFromRSXformGlyphs(\n glyphs,\n rsxforms.map((f) => toValue(f)),\n toValue(font)\n )\n );\n }\n}\n"]}
1
+ {"version":3,"sources":["JsiSkTextBlobFactory.ts"],"names":["JsiSkTextBlobFactory","Host","constructor","CanvasKit","MakeFromText","str","font","JsiSkTextBlob","TextBlob","JsiSkFont","fromValue","MakeFromGlyphs","glyphs","MakeFromRSXform","rsxforms","map","f","Array","from","JsiSkRSXform","flat","MakeFromRSXformGlyphs"],"mappings":";;;;;;;AAMA;;AACA;;AACA;;AAEA;;AAEO,MAAMA,oBAAN,SAAmCC,UAAnC,CAAmE;AACxEC,EAAAA,WAAW,CAACC,SAAD,EAAuB;AAChC,UAAMA,SAAN;AACD;;AAEDC,EAAAA,YAAY,CAACC,GAAD,EAAcC,IAAd,EAA4B;AACtC,WAAO,IAAIC,4BAAJ,CACL,KAAKJ,SADA,EAEL,KAAKA,SAAL,CAAeK,QAAf,CAAwBJ,YAAxB,CAAqCC,GAArC,EAA0CI,qBAAUC,SAAV,CAAoBJ,IAApB,CAA1C,CAFK,CAAP;AAID;;AAEDK,EAAAA,cAAc,CAACC,MAAD,EAAmBN,IAAnB,EAAiC;AAC7C,WAAO,IAAIC,4BAAJ,CACL,KAAKJ,SADA,EAEL,KAAKA,SAAL,CAAeK,QAAf,CAAwBG,cAAxB,CAAuCC,MAAvC,EAA+CH,qBAAUC,SAAV,CAAoBJ,IAApB,CAA/C,CAFK,CAAP;AAID;;AAEDO,EAAAA,eAAe,CAACR,GAAD,EAAcS,QAAd,EAAqCR,IAArC,EAAmD;AAChE,WAAO,IAAIC,4BAAJ,CACL,KAAKJ,SADA,EAEL,KAAKA,SAAL,CAAeK,QAAf,CAAwBK,eAAxB,CACER,GADF,EAEES,QAAQ,CACLC,GADH,CACQC,CAAD,IAAOC,KAAK,CAACC,IAAN,CAAWC,2BAAaT,SAAb,CAAgCM,CAAhC,CAAX,CADd,EAEGI,IAFH,EAFF,EAKEX,qBAAUC,SAAV,CAAoBJ,IAApB,CALF,CAFK,CAAP;AAUD;;AAEDe,EAAAA,qBAAqB,CAACT,MAAD,EAAmBE,QAAnB,EAA0CR,IAA1C,EAAwD;AAC3E,WAAO,IAAIC,4BAAJ,CACL,KAAKJ,SADA,EAEL,KAAKA,SAAL,CAAeK,QAAf,CAAwBa,qBAAxB,CACET,MADF,EAEEE,QAAQ,CAACC,GAAT,CAAcC,CAAD,IAAOG,2BAAaT,SAAb,CAAuBM,CAAvB,CAApB,CAFF,EAGEP,qBAAUC,SAAV,CAAoBJ,IAApB,CAHF,CAFK,CAAP;AAQD;;AAzCuE","sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type { SkFont } from \"../types\";\nimport type { TextBlobFactory } from \"../types/TextBlob\";\nimport type { SkRSXform } from \"../types/RSXform\";\n\nimport { Host } from \"./Host\";\nimport { JsiSkFont } from \"./JsiSkFont\";\nimport { JsiSkTextBlob } from \"./JsiSkTextBlob\";\nimport type { RSXform } from \"./JsiSkRSXform\";\nimport { JsiSkRSXform } from \"./JsiSkRSXform\";\n\nexport class JsiSkTextBlobFactory extends Host implements TextBlobFactory {\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n MakeFromText(str: string, font: SkFont) {\n return new JsiSkTextBlob(\n this.CanvasKit,\n this.CanvasKit.TextBlob.MakeFromText(str, JsiSkFont.fromValue(font))\n );\n }\n\n MakeFromGlyphs(glyphs: number[], font: SkFont) {\n return new JsiSkTextBlob(\n this.CanvasKit,\n this.CanvasKit.TextBlob.MakeFromGlyphs(glyphs, JsiSkFont.fromValue(font))\n );\n }\n\n MakeFromRSXform(str: string, rsxforms: SkRSXform[], font: SkFont) {\n return new JsiSkTextBlob(\n this.CanvasKit,\n this.CanvasKit.TextBlob.MakeFromRSXform(\n str,\n rsxforms\n .map((f) => Array.from(JsiSkRSXform.fromValue<RSXform>(f)))\n .flat(),\n JsiSkFont.fromValue(font)\n )\n );\n }\n\n MakeFromRSXformGlyphs(glyphs: number[], rsxforms: SkRSXform[], font: SkFont) {\n return new JsiSkTextBlob(\n this.CanvasKit,\n this.CanvasKit.TextBlob.MakeFromRSXformGlyphs(\n glyphs,\n rsxforms.map((f) => JsiSkRSXform.fromValue(f)),\n JsiSkFont.fromValue(font)\n )\n );\n }\n}\n"]}
@@ -15,7 +15,7 @@ class JsiSkTypefaceFactory extends _Host.Host {
15
15
  }
16
16
 
17
17
  MakeFreeTypeFaceFromData(data) {
18
- const tf = this.CanvasKit.Typeface.MakeFreeTypeFaceFromData((0, _Host.toValue)(data));
18
+ const tf = this.CanvasKit.Typeface.MakeFreeTypeFaceFromData(_JsiSkTypeface.JsiSkTypeface.fromValue(data));
19
19
 
20
20
  if (tf === null) {
21
21
  return null;
@@ -1 +1 @@
1
- {"version":3,"sources":["JsiSkTypefaceFactory.tsx"],"names":["JsiSkTypefaceFactory","Host","constructor","CanvasKit","MakeFreeTypeFaceFromData","data","tf","Typeface","JsiSkTypeface"],"mappings":";;;;;;;AAIA;;AACA;;AAEO,MAAMA,oBAAN,SAAmCC,UAAnC,CAAmE;AACxEC,EAAAA,WAAW,CAACC,SAAD,EAAuB;AAChC,UAAMA,SAAN;AACD;;AAEDC,EAAAA,wBAAwB,CAACC,IAAD,EAAe;AACrC,UAAMC,EAAE,GAAG,KAAKH,SAAL,CAAeI,QAAf,CAAwBH,wBAAxB,CAAiD,mBAAQC,IAAR,CAAjD,CAAX;;AACA,QAAIC,EAAE,KAAK,IAAX,EAAiB;AACf,aAAO,IAAP;AACD;;AACD,WAAO,IAAIE,4BAAJ,CAAkB,KAAKL,SAAvB,EAAkCG,EAAlC,CAAP;AACD;;AAXuE","sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type { SkData, TypefaceFactory } from \"../types\";\n\nimport { Host, toValue } from \"./Host\";\nimport { JsiSkTypeface } from \"./JsiSkTypeface\";\n\nexport class JsiSkTypefaceFactory extends Host implements TypefaceFactory {\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n MakeFreeTypeFaceFromData(data: SkData) {\n const tf = this.CanvasKit.Typeface.MakeFreeTypeFaceFromData(toValue(data));\n if (tf === null) {\n return null;\n }\n return new JsiSkTypeface(this.CanvasKit, tf);\n }\n}\n"]}
1
+ {"version":3,"sources":["JsiSkTypefaceFactory.tsx"],"names":["JsiSkTypefaceFactory","Host","constructor","CanvasKit","MakeFreeTypeFaceFromData","data","tf","Typeface","JsiSkTypeface","fromValue"],"mappings":";;;;;;;AAIA;;AACA;;AAEO,MAAMA,oBAAN,SAAmCC,UAAnC,CAAmE;AACxEC,EAAAA,WAAW,CAACC,SAAD,EAAuB;AAChC,UAAMA,SAAN;AACD;;AAEDC,EAAAA,wBAAwB,CAACC,IAAD,EAAe;AACrC,UAAMC,EAAE,GAAG,KAAKH,SAAL,CAAeI,QAAf,CAAwBH,wBAAxB,CACTI,6BAAcC,SAAd,CAAwBJ,IAAxB,CADS,CAAX;;AAGA,QAAIC,EAAE,KAAK,IAAX,EAAiB;AACf,aAAO,IAAP;AACD;;AACD,WAAO,IAAIE,4BAAJ,CAAkB,KAAKL,SAAvB,EAAkCG,EAAlC,CAAP;AACD;;AAbuE","sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type { SkData, TypefaceFactory } from \"../types\";\n\nimport { Host } from \"./Host\";\nimport { JsiSkTypeface } from \"./JsiSkTypeface\";\n\nexport class JsiSkTypefaceFactory extends Host implements TypefaceFactory {\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n MakeFreeTypeFaceFromData(data: SkData) {\n const tf = this.CanvasKit.Typeface.MakeFreeTypeFaceFromData(\n JsiSkTypeface.fromValue(data)\n );\n if (tf === null) {\n return null;\n }\n return new JsiSkTypeface(this.CanvasKit, tf);\n }\n}\n"]}
@@ -19,8 +19,6 @@ var _JsiSkRRect = require("./JsiSkRRect");
19
19
 
20
20
  var _JsiSkRSXform = require("./JsiSkRSXform");
21
21
 
22
- var _Host = require("./Host");
23
-
24
22
  var _JsiSkContourMeasureIter = require("./JsiSkContourMeasureIter");
25
23
 
26
24
  var _JsiSkPictureRecorder = require("./JsiSkPictureRecorder");
@@ -57,22 +55,30 @@ var _JsiSkFont = require("./JsiSkFont");
57
55
 
58
56
  var _JsiSkVerticesFactory = require("./JsiSkVerticesFactory");
59
57
 
58
+ var _JsiSkPath = require("./JsiSkPath");
59
+
60
+ var _JsiSkTypeface = require("./JsiSkTypeface");
61
+
60
62
  const JsiSkApi = CanvasKit => ({
61
63
  Point: (x, y) => new _JsiSkPoint.JsiSkPoint(CanvasKit, Float32Array.of(x, y)),
62
64
  RuntimeShaderBuilder: _ => {
63
65
  throw new Error("Not implemented on React Native Web");
64
66
  },
65
- RRectXY: (rect, rx, ry) => new _JsiSkRRect.JsiSkRRect(CanvasKit, CanvasKit.RRectXY((0, _Host.toValue)(rect), rx, ry)),
67
+ RRectXY: (rect, rx, ry) => new _JsiSkRRect.JsiSkRRect(CanvasKit, CanvasKit.RRectXY(_JsiSkRect.JsiSkRect.fromValue(CanvasKit, rect), rx, ry)),
66
68
  RSXform: (scos, ssin, tx, ty) => new _JsiSkRSXform.JsiSkRSXform(CanvasKit, Float32Array.of(scos, ssin, tx, ty)),
67
69
  Color: _JsiSkColor.Color,
68
- ContourMeasureIter: (path, forceClosed, resScale) => new _JsiSkContourMeasureIter.JsiSkContourMeasureIter(CanvasKit, new CanvasKit.ContourMeasureIter((0, _Host.toValue)(path), forceClosed, resScale)),
69
- Paint: () => new _JsiSkPaint.JsiSkPaint(CanvasKit, new CanvasKit.Paint()),
70
+ ContourMeasureIter: (path, forceClosed, resScale) => new _JsiSkContourMeasureIter.JsiSkContourMeasureIter(CanvasKit, new CanvasKit.ContourMeasureIter(_JsiSkPath.JsiSkPath.fromValue(path), forceClosed, resScale)),
71
+ Paint: () => {
72
+ const paint = new _JsiSkPaint.JsiSkPaint(CanvasKit, new CanvasKit.Paint());
73
+ paint.setAntiAlias(true);
74
+ return paint;
75
+ },
70
76
  PictureRecorder: () => new _JsiSkPictureRecorder.JsiSkPictureRecorder(CanvasKit, new CanvasKit.PictureRecorder()),
71
77
  Picture: new _JsiSkPictureFactory.JsiSkPictureFactory(CanvasKit),
72
78
  Path: new _JsiSkPathFactory.JsiSkPathFactory(CanvasKit),
73
79
  Matrix: matrix => new _JsiSkMatrix.JsiSkMatrix(CanvasKit, matrix ? Float32Array.of(...matrix) : Float32Array.of(...CanvasKit.Matrix.identity())),
74
80
  ColorFilter: new _JsiSkColorFilterFactory.JsiSkColorFilterFactory(CanvasKit),
75
- Font: (typeface, size) => new _JsiSkFont.JsiSkFont(CanvasKit, new CanvasKit.Font(typeface === undefined ? null : (0, _Host.toValue)(typeface), size)),
81
+ Font: (typeface, size) => new _JsiSkFont.JsiSkFont(CanvasKit, new CanvasKit.Font(typeface === undefined ? null : _JsiSkTypeface.JsiSkTypeface.fromValue(typeface), size)),
76
82
  Typeface: new _JsiSkTypefaceFactory.JsiSkTypefaceFactory(CanvasKit),
77
83
  MaskFilter: new _JsiSkMaskFilterFactory.JsiSkMaskFilterFactory(CanvasKit),
78
84
  RuntimeEffect: new _JsiSkRuntimeEffectFactory.JsiSkRuntimeEffectFactory(CanvasKit),
@@ -1 +1 @@
1
- {"version":3,"sources":["JsiSkia.ts"],"names":["JsiSkApi","CanvasKit","Point","x","y","JsiSkPoint","Float32Array","of","RuntimeShaderBuilder","_","Error","RRectXY","rect","rx","ry","JsiSkRRect","RSXform","scos","ssin","tx","ty","JsiSkRSXform","Color","ContourMeasureIter","path","forceClosed","resScale","JsiSkContourMeasureIter","Paint","JsiSkPaint","PictureRecorder","JsiSkPictureRecorder","Picture","JsiSkPictureFactory","Path","JsiSkPathFactory","Matrix","matrix","JsiSkMatrix","identity","ColorFilter","JsiSkColorFilterFactory","Font","typeface","size","JsiSkFont","undefined","Typeface","JsiSkTypefaceFactory","MaskFilter","JsiSkMaskFilterFactory","RuntimeEffect","JsiSkRuntimeEffectFactory","ImageFilter","JsiSkImageFilterFactory","Shader","JsiSkShaderFactory","PathEffect","JsiSkPathEffectFactory","MakeVertices","bind","Data","JsiSkDataFactory","Image","JsiSkImageFactory","SVG","JsiSkSVGFactory","TextBlob","JsiSkTextBlobFactory","XYWHRect","width","height","JsiSkRect","Surface","JsiSkSurfaceFactory"],"mappings":";;;;;;;AAYA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEO,MAAMA,QAAQ,GAAIC,SAAD,KAAiC;AACvDC,EAAAA,KAAK,EAAE,CAACC,CAAD,EAAYC,CAAZ,KACL,IAAIC,sBAAJ,CAAeJ,SAAf,EAA0BK,YAAY,CAACC,EAAb,CAAgBJ,CAAhB,EAAmBC,CAAnB,CAA1B,CAFqD;AAGvDI,EAAAA,oBAAoB,EAAGC,CAAD,IAAgD;AACpE,UAAM,IAAIC,KAAJ,CAAU,qCAAV,CAAN;AACD,GALsD;AAMvDC,EAAAA,OAAO,EAAE,CAACC,IAAD,EAAeC,EAAf,EAA2BC,EAA3B,KACP,IAAIC,sBAAJ,CAAed,SAAf,EAA0BA,SAAS,CAACU,OAAV,CAAkB,mBAAQC,IAAR,CAAlB,EAAiCC,EAAjC,EAAqCC,EAArC,CAA1B,CAPqD;AAQvDE,EAAAA,OAAO,EAAE,CAACC,IAAD,EAAeC,IAAf,EAA6BC,EAA7B,EAAyCC,EAAzC,KACP,IAAIC,0BAAJ,CAAiBpB,SAAjB,EAA4BK,YAAY,CAACC,EAAb,CAAgBU,IAAhB,EAAsBC,IAAtB,EAA4BC,EAA5B,EAAgCC,EAAhC,CAA5B,CATqD;AAUvDE,EAAAA,KAAK,EAALA,iBAVuD;AAWvDC,EAAAA,kBAAkB,EAAE,CAClBC,IADkB,EAElBC,WAFkB,EAGlBC,QAHkB,KAKlB,IAAIC,gDAAJ,CACE1B,SADF,EAEE,IAAIA,SAAS,CAACsB,kBAAd,CAAiC,mBAAQC,IAAR,CAAjC,EAAgDC,WAAhD,EAA6DC,QAA7D,CAFF,CAhBqD;AAoBvDE,EAAAA,KAAK,EAAE,MAAM,IAAIC,sBAAJ,CAAe5B,SAAf,EAA0B,IAAIA,SAAS,CAAC2B,KAAd,EAA1B,CApB0C;AAqBvDE,EAAAA,eAAe,EAAE,MACf,IAAIC,0CAAJ,CAAyB9B,SAAzB,EAAoC,IAAIA,SAAS,CAAC6B,eAAd,EAApC,CAtBqD;AAuBvDE,EAAAA,OAAO,EAAE,IAAIC,wCAAJ,CAAwBhC,SAAxB,CAvB8C;AAwBvDiC,EAAAA,IAAI,EAAE,IAAIC,kCAAJ,CAAqBlC,SAArB,CAxBiD;AAyBvDmC,EAAAA,MAAM,EAAGC,MAAD,IACN,IAAIC,wBAAJ,CACErC,SADF,EAEEoC,MAAM,GACF/B,YAAY,CAACC,EAAb,CAAgB,GAAG8B,MAAnB,CADE,GAEF/B,YAAY,CAACC,EAAb,CAAgB,GAAGN,SAAS,CAACmC,MAAV,CAAiBG,QAAjB,EAAnB,CAJN,CA1BqD;AAgCvDC,EAAAA,WAAW,EAAE,IAAIC,gDAAJ,CAA4BxC,SAA5B,CAhC0C;AAiCvDyC,EAAAA,IAAI,EAAE,CAACC,QAAD,EAAwBC,IAAxB,KACJ,IAAIC,oBAAJ,CACE5C,SADF,EAEE,IAAIA,SAAS,CAACyC,IAAd,CACEC,QAAQ,KAAKG,SAAb,GAAyB,IAAzB,GAAgC,mBAAQH,QAAR,CADlC,EAEEC,IAFF,CAFF,CAlCqD;AAyCvDG,EAAAA,QAAQ,EAAE,IAAIC,0CAAJ,CAAyB/C,SAAzB,CAzC6C;AA0CvDgD,EAAAA,UAAU,EAAE,IAAIC,8CAAJ,CAA2BjD,SAA3B,CA1C2C;AA2CvDkD,EAAAA,aAAa,EAAE,IAAIC,oDAAJ,CAA8BnD,SAA9B,CA3CwC;AA4CvDoD,EAAAA,WAAW,EAAE,IAAIC,gDAAJ,CAA4BrD,SAA5B,CA5C0C;AA6CvDsD,EAAAA,MAAM,EAAE,IAAIC,sCAAJ,CAAuBvD,SAAvB,CA7C+C;AA8CvDwD,EAAAA,UAAU,EAAE,IAAIC,8CAAJ,CAA2BzD,SAA3B,CA9C2C;AA+CvD0D,EAAAA,YAAY,EAAEA,mCAAaC,IAAb,CAAkB,IAAlB,EAAwB3D,SAAxB,CA/CyC;AAgDvD4D,EAAAA,IAAI,EAAE,IAAIC,kCAAJ,CAAqB7D,SAArB,CAhDiD;AAiDvD8D,EAAAA,KAAK,EAAE,IAAIC,oCAAJ,CAAsB/D,SAAtB,CAjDgD;AAkDvDgE,EAAAA,GAAG,EAAE,IAAIC,gCAAJ,CAAoBjE,SAApB,CAlDkD;AAmDvDkE,EAAAA,QAAQ,EAAE,IAAIC,0CAAJ,CAAyBnE,SAAzB,CAnD6C;AAoDvDoE,EAAAA,QAAQ,EAAE,CAAClE,CAAD,EAAYC,CAAZ,EAAuBkE,KAAvB,EAAsCC,MAAtC,KAAyD;AACjE,WAAO,IAAIC,oBAAJ,CAAcvE,SAAd,EAAyBA,SAAS,CAACoE,QAAV,CAAmBlE,CAAnB,EAAsBC,CAAtB,EAAyBkE,KAAzB,EAAgCC,MAAhC,CAAzB,CAAP;AACD,GAtDsD;AAuDvDE,EAAAA,OAAO,EAAE,IAAIC,wCAAJ,CAAwBzE,SAAxB;AAvD8C,CAAjC,CAAjB","sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type {\n SkContourMeasureIter,\n Skia,\n SkPath,\n SkRect,\n SkRuntimeEffect,\n SkRuntimeShaderBuilder,\n SkTypeface,\n} from \"../types\";\n\nimport { JsiSkPoint } from \"./JsiSkPoint\";\nimport { JsiSkPaint } from \"./JsiSkPaint\";\nimport { JsiSkRect } from \"./JsiSkRect\";\nimport { Color } from \"./JsiSkColor\";\nimport { JsiSkSurfaceFactory } from \"./JsiSkSurfaceFactory\";\nimport { JsiSkRRect } from \"./JsiSkRRect\";\nimport { JsiSkRSXform } from \"./JsiSkRSXform\";\nimport { toValue } from \"./Host\";\nimport { JsiSkContourMeasureIter } from \"./JsiSkContourMeasureIter\";\nimport { JsiSkPictureRecorder } from \"./JsiSkPictureRecorder\";\nimport { JsiSkPictureFactory } from \"./JsiSkPictureFactory\";\nimport { JsiSkPathFactory } from \"./JsiSkPathFactory\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkColorFilterFactory } from \"./JsiSkColorFilterFactory\";\nimport { JsiSkTypefaceFactory } from \"./JsiSkTypefaceFactory\";\nimport { JsiSkMaskFilterFactory } from \"./JsiSkMaskFilterFactory\";\nimport { JsiSkRuntimeEffectFactory } from \"./JsiSkRuntimeEffectFactory\";\nimport { JsiSkImageFilterFactory } from \"./JsiSkImageFilterFactory\";\nimport { JsiSkShaderFactory } from \"./JsiSkShaderFactory\";\nimport { JsiSkPathEffectFactory } from \"./JsiSkPathEffectFactory\";\nimport { JsiSkDataFactory } from \"./JsiSkDataFactory\";\nimport { JsiSkImageFactory } from \"./JsiSkImageFactory\";\nimport { JsiSkSVGFactory } from \"./JsiSkSVGFactory\";\nimport { JsiSkTextBlobFactory } from \"./JsiSkTextBlobFactory\";\nimport { JsiSkFont } from \"./JsiSkFont\";\nimport { MakeVertices } from \"./JsiSkVerticesFactory\";\n\nexport const JsiSkApi = (CanvasKit: CanvasKit): Skia => ({\n Point: (x: number, y: number) =>\n new JsiSkPoint(CanvasKit, Float32Array.of(x, y)),\n RuntimeShaderBuilder: (_: SkRuntimeEffect): SkRuntimeShaderBuilder => {\n throw new Error(\"Not implemented on React Native Web\");\n },\n RRectXY: (rect: SkRect, rx: number, ry: number) =>\n new JsiSkRRect(CanvasKit, CanvasKit.RRectXY(toValue(rect), rx, ry)),\n RSXform: (scos: number, ssin: number, tx: number, ty: number) =>\n new JsiSkRSXform(CanvasKit, Float32Array.of(scos, ssin, tx, ty)),\n Color,\n ContourMeasureIter: (\n path: SkPath,\n forceClosed: boolean,\n resScale: number\n ): SkContourMeasureIter =>\n new JsiSkContourMeasureIter(\n CanvasKit,\n new CanvasKit.ContourMeasureIter(toValue(path), forceClosed, resScale)\n ),\n Paint: () => new JsiSkPaint(CanvasKit, new CanvasKit.Paint()),\n PictureRecorder: () =>\n new JsiSkPictureRecorder(CanvasKit, new CanvasKit.PictureRecorder()),\n Picture: new JsiSkPictureFactory(CanvasKit),\n Path: new JsiSkPathFactory(CanvasKit),\n Matrix: (matrix?: readonly number[]) =>\n new JsiSkMatrix(\n CanvasKit,\n matrix\n ? Float32Array.of(...matrix)\n : Float32Array.of(...CanvasKit.Matrix.identity())\n ),\n ColorFilter: new JsiSkColorFilterFactory(CanvasKit),\n Font: (typeface?: SkTypeface, size?: number) =>\n new JsiSkFont(\n CanvasKit,\n new CanvasKit.Font(\n typeface === undefined ? null : toValue(typeface),\n size\n )\n ),\n Typeface: new JsiSkTypefaceFactory(CanvasKit),\n MaskFilter: new JsiSkMaskFilterFactory(CanvasKit),\n RuntimeEffect: new JsiSkRuntimeEffectFactory(CanvasKit),\n ImageFilter: new JsiSkImageFilterFactory(CanvasKit),\n Shader: new JsiSkShaderFactory(CanvasKit),\n PathEffect: new JsiSkPathEffectFactory(CanvasKit),\n MakeVertices: MakeVertices.bind(null, CanvasKit),\n Data: new JsiSkDataFactory(CanvasKit),\n Image: new JsiSkImageFactory(CanvasKit),\n SVG: new JsiSkSVGFactory(CanvasKit),\n TextBlob: new JsiSkTextBlobFactory(CanvasKit),\n XYWHRect: (x: number, y: number, width: number, height: number) => {\n return new JsiSkRect(CanvasKit, CanvasKit.XYWHRect(x, y, width, height));\n },\n Surface: new JsiSkSurfaceFactory(CanvasKit),\n});\n"]}
1
+ {"version":3,"sources":["JsiSkia.ts"],"names":["JsiSkApi","CanvasKit","Point","x","y","JsiSkPoint","Float32Array","of","RuntimeShaderBuilder","_","Error","RRectXY","rect","rx","ry","JsiSkRRect","JsiSkRect","fromValue","RSXform","scos","ssin","tx","ty","JsiSkRSXform","Color","ContourMeasureIter","path","forceClosed","resScale","JsiSkContourMeasureIter","JsiSkPath","Paint","paint","JsiSkPaint","setAntiAlias","PictureRecorder","JsiSkPictureRecorder","Picture","JsiSkPictureFactory","Path","JsiSkPathFactory","Matrix","matrix","JsiSkMatrix","identity","ColorFilter","JsiSkColorFilterFactory","Font","typeface","size","JsiSkFont","undefined","JsiSkTypeface","Typeface","JsiSkTypefaceFactory","MaskFilter","JsiSkMaskFilterFactory","RuntimeEffect","JsiSkRuntimeEffectFactory","ImageFilter","JsiSkImageFilterFactory","Shader","JsiSkShaderFactory","PathEffect","JsiSkPathEffectFactory","MakeVertices","bind","Data","JsiSkDataFactory","Image","JsiSkImageFactory","SVG","JsiSkSVGFactory","TextBlob","JsiSkTextBlobFactory","XYWHRect","width","height","Surface","JsiSkSurfaceFactory"],"mappings":"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","sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type {\n SkContourMeasureIter,\n Skia,\n SkPath,\n SkRect,\n SkRuntimeEffect,\n SkRuntimeShaderBuilder,\n SkTypeface,\n} from \"../types\";\n\nimport { JsiSkPoint } from \"./JsiSkPoint\";\nimport { JsiSkPaint } from \"./JsiSkPaint\";\nimport { JsiSkRect } from \"./JsiSkRect\";\nimport { Color } from \"./JsiSkColor\";\nimport { JsiSkSurfaceFactory } from \"./JsiSkSurfaceFactory\";\nimport { JsiSkRRect } from \"./JsiSkRRect\";\nimport { JsiSkRSXform } from \"./JsiSkRSXform\";\nimport { JsiSkContourMeasureIter } from \"./JsiSkContourMeasureIter\";\nimport { JsiSkPictureRecorder } from \"./JsiSkPictureRecorder\";\nimport { JsiSkPictureFactory } from \"./JsiSkPictureFactory\";\nimport { JsiSkPathFactory } from \"./JsiSkPathFactory\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkColorFilterFactory } from \"./JsiSkColorFilterFactory\";\nimport { JsiSkTypefaceFactory } from \"./JsiSkTypefaceFactory\";\nimport { JsiSkMaskFilterFactory } from \"./JsiSkMaskFilterFactory\";\nimport { JsiSkRuntimeEffectFactory } from \"./JsiSkRuntimeEffectFactory\";\nimport { JsiSkImageFilterFactory } from \"./JsiSkImageFilterFactory\";\nimport { JsiSkShaderFactory } from \"./JsiSkShaderFactory\";\nimport { JsiSkPathEffectFactory } from \"./JsiSkPathEffectFactory\";\nimport { JsiSkDataFactory } from \"./JsiSkDataFactory\";\nimport { JsiSkImageFactory } from \"./JsiSkImageFactory\";\nimport { JsiSkSVGFactory } from \"./JsiSkSVGFactory\";\nimport { JsiSkTextBlobFactory } from \"./JsiSkTextBlobFactory\";\nimport { JsiSkFont } from \"./JsiSkFont\";\nimport { MakeVertices } from \"./JsiSkVerticesFactory\";\nimport { JsiSkPath } from \"./JsiSkPath\";\nimport { JsiSkTypeface } from \"./JsiSkTypeface\";\n\nexport const JsiSkApi = (CanvasKit: CanvasKit): Skia => ({\n Point: (x: number, y: number) =>\n new JsiSkPoint(CanvasKit, Float32Array.of(x, y)),\n RuntimeShaderBuilder: (_: SkRuntimeEffect): SkRuntimeShaderBuilder => {\n throw new Error(\"Not implemented on React Native Web\");\n },\n RRectXY: (rect: SkRect, rx: number, ry: number) =>\n new JsiSkRRect(\n CanvasKit,\n CanvasKit.RRectXY(JsiSkRect.fromValue(CanvasKit, rect), rx, ry)\n ),\n RSXform: (scos: number, ssin: number, tx: number, ty: number) =>\n new JsiSkRSXform(CanvasKit, Float32Array.of(scos, ssin, tx, ty)),\n Color,\n ContourMeasureIter: (\n path: SkPath,\n forceClosed: boolean,\n resScale: number\n ): SkContourMeasureIter =>\n new JsiSkContourMeasureIter(\n CanvasKit,\n new CanvasKit.ContourMeasureIter(\n JsiSkPath.fromValue(path),\n forceClosed,\n resScale\n )\n ),\n Paint: () => {\n const paint = new JsiSkPaint(CanvasKit, new CanvasKit.Paint());\n paint.setAntiAlias(true);\n return paint;\n },\n PictureRecorder: () =>\n new JsiSkPictureRecorder(CanvasKit, new CanvasKit.PictureRecorder()),\n Picture: new JsiSkPictureFactory(CanvasKit),\n Path: new JsiSkPathFactory(CanvasKit),\n Matrix: (matrix?: readonly number[]) =>\n new JsiSkMatrix(\n CanvasKit,\n matrix\n ? Float32Array.of(...matrix)\n : Float32Array.of(...CanvasKit.Matrix.identity())\n ),\n ColorFilter: new JsiSkColorFilterFactory(CanvasKit),\n Font: (typeface?: SkTypeface, size?: number) =>\n new JsiSkFont(\n CanvasKit,\n new CanvasKit.Font(\n typeface === undefined ? null : JsiSkTypeface.fromValue(typeface),\n size\n )\n ),\n Typeface: new JsiSkTypefaceFactory(CanvasKit),\n MaskFilter: new JsiSkMaskFilterFactory(CanvasKit),\n RuntimeEffect: new JsiSkRuntimeEffectFactory(CanvasKit),\n ImageFilter: new JsiSkImageFilterFactory(CanvasKit),\n Shader: new JsiSkShaderFactory(CanvasKit),\n PathEffect: new JsiSkPathEffectFactory(CanvasKit),\n MakeVertices: MakeVertices.bind(null, CanvasKit),\n Data: new JsiSkDataFactory(CanvasKit),\n Image: new JsiSkImageFactory(CanvasKit),\n SVG: new JsiSkSVGFactory(CanvasKit),\n TextBlob: new JsiSkTextBlobFactory(CanvasKit),\n XYWHRect: (x: number, y: number, width: number, height: number) => {\n return new JsiSkRect(CanvasKit, CanvasKit.XYWHRect(x, y, width, height));\n },\n Surface: new JsiSkSurfaceFactory(CanvasKit),\n});\n"]}
@@ -18,8 +18,12 @@ var _Animations = require("../../renderer/processors/Animations");
18
18
  * @param values Dependant values
19
19
  * @returns A readonly value
20
20
  */
21
- const useComputedValue = (cb, values) => (0, _react.useMemo)(() => _api.ValueApi.createComputedValue(cb, values.filter(_Animations.isValue)), // eslint-disable-next-line react-hooks/exhaustive-deps
22
- values);
21
+ const useComputedValue = (cb, values) => {
22
+ const value = (0, _react.useMemo)(() => _api.ValueApi.createComputedValue(cb, values.filter(_Animations.isValue)), // eslint-disable-next-line react-hooks/exhaustive-deps
23
+ values);
24
+ (0, _react.useEffect)(() => () => value.__invalidate(), [value]);
25
+ return value;
26
+ };
23
27
 
24
28
  exports.useComputedValue = useComputedValue;
25
29
  //# sourceMappingURL=useComputedValue.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["useComputedValue.ts"],"names":["useComputedValue","cb","values","ValueApi","createComputedValue","filter","isValue"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,gBAAgB,GAAG,CAAIC,EAAJ,EAAiBC,MAAjB,KAC9B,oBACE,MAAMC,cAASC,mBAAT,CAAgCH,EAAhC,EAAoCC,MAAM,CAACG,MAAP,CAAcC,mBAAd,CAApC,CADR,EAEE;AACAJ,MAHF,CADK","sourcesContent":["import { 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 useMemo(\n () => ValueApi.createComputedValue<R>(cb, values.filter(isValue)),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n values\n );\n"]}
1
+ {"version":3,"sources":["useComputedValue.ts"],"names":["useComputedValue","cb","values","value","ValueApi","createComputedValue","filter","isValue","__invalidate"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,gBAAgB,GAAG,CAAIC,EAAJ,EAAiBC,MAAjB,KAAuC;AACrE,QAAMC,KAAK,GAAG,oBACZ,MAAMC,cAASC,mBAAT,CAAgCJ,EAAhC,EAAoCC,MAAM,CAACI,MAAP,CAAcC,mBAAd,CAApC,CADM,EAEZ;AACAL,EAAAA,MAHY,CAAd;AAKA,wBAAU,MAAM,MAAMC,KAAK,CAACK,YAAN,EAAtB,EAA4C,CAACL,KAAD,CAA5C;AACA,SAAOA,KAAP;AACD,CARM","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"]}
@@ -42,4 +42,17 @@ Object.keys(_api).forEach(function (key) {
42
42
  }
43
43
  });
44
44
  });
45
+
46
+ var _selector = require("./selector");
47
+
48
+ Object.keys(_selector).forEach(function (key) {
49
+ if (key === "default" || key === "__esModule") return;
50
+ if (key in exports && exports[key] === _selector[key]) return;
51
+ Object.defineProperty(exports, key, {
52
+ enumerable: true,
53
+ get: function () {
54
+ return _selector[key];
55
+ }
56
+ });
57
+ });
45
58
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export * from \"./types\";\nexport * from \"./hooks\";\nexport * from \"./api\";\n"]}
1
+ {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export * from \"./types\";\nexport * from \"./hooks\";\nexport * from \"./api\";\nexport * from \"./selector\";\n"]}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Selector = void 0;
7
+
8
+ /**
9
+ * Wraps a Skia Value with a selector function. The selector function can access the
10
+ * inner values of the Skia Value so that we can dynamically ready array values and
11
+ * object values when doing animations in Skia.
12
+ * @param value Dependant value
13
+ * @param selector Selector function to calculate new value from the Skia Value's value
14
+ * @returns A descriptor that will be used by the reconciler to calculate the value
15
+ */
16
+ const Selector = (value, selector) => {
17
+ return {
18
+ selector,
19
+ value
20
+ };
21
+ };
22
+
23
+ exports.Selector = Selector;
24
+ //# sourceMappingURL=selector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["selector.ts"],"names":["Selector","value","selector"],"mappings":";;;;;;;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,QAAQ,GAAG,CACtBC,KADsB,EAEtBC,QAFsB,KAGY;AAClC,SAAO;AACLA,IAAAA,QADK;AAELD,IAAAA;AAFK,GAAP;AAID,CARM","sourcesContent":["import type { SkiaValue } from \"./types\";\n\nexport type SkiaSelector<TReturn, TInput = unknown> = {\n value: SkiaValue<TInput>;\n selector: (v: TInput) => TReturn;\n};\n\n/**\n * Wraps a Skia Value with a selector function. The selector function can access the\n * inner values of the Skia Value so that we can dynamically ready array values and\n * object values when doing animations in Skia.\n * @param value Dependant value\n * @param selector Selector function to calculate new value from the Skia Value's value\n * @returns A descriptor that will be used by the reconciler to calculate the value\n */\nexport const Selector = <TInput, TReturn>(\n value: SkiaValue<TInput>,\n selector: (v: TInput) => TReturn\n): SkiaSelector<TReturn, TInput> => {\n return {\n selector,\n value,\n };\n};\n"]}
@@ -43,6 +43,14 @@ class RNSkComputedValue extends _RNSkReadonlyValue.RNSkReadonlyValue {
43
43
 
44
44
  unsubscribe() {
45
45
  this._unsubscribers.forEach(unsubscribe => unsubscribe());
46
+
47
+ this._unsubscribers = [];
48
+ }
49
+
50
+ __invalidate() {
51
+ this._unsubscribers.forEach(unsubscribe => unsubscribe());
52
+
53
+ this._unsubscribers = [];
46
54
  }
47
55
 
48
56
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["RNSkComputedValue.ts"],"names":["RNSkComputedValue","RNSkReadonlyValue","constructor","callback","dependencies","unsubscribers","notifyUpdateRef","current","undefined","forEach","dep","push","addListener","_unsubscribers","dependecyUpdated","bind","_callback","update","unsubscribe"],"mappings":";;;;;;;AAEA;;;;AAEO,MAAMA,iBAAN,SAAmCC,oCAAnC,CAAwD;AAC7DC,EAAAA,WAAW,CAACC,QAAD,EAAoBC,YAApB,EAAkD;AAC3D;AACA;AACA,UAAMC,aAAgC,GAAG,EAAzC;AACA,UAAMC,eAAsD,GAAG;AAC7DC,MAAAA,OAAO,EAAEC;AADoD,KAA/D;AAGAJ,IAAAA,YAAY,CAACK,OAAb,CAAsBC,GAAD,IAAS;AAC5B,UAAI,kBAAkBA,GAAlB,IAAyB,iBAAiBA,GAA9C,EAAmD;AACjDL,QAAAA,aAAa,CAACM,IAAd,CACGD,GAAD,CAAoCE,WAApC,CAAgD;AAAA;;AAAA,0CAC9CN,eAAe,CAACC,OAD8B,0DAC9C,2BAAAD,eAAe,CAD+B;AAAA,SAAhD,CADF;AAKD;AACF,KARD;AASA,UAAMH,QAAQ,EAAd;;AAhB2D;;AAAA;;AAiB3D,SAAKU,cAAL,GAAsBR,aAAtB;AACAC,IAAAA,eAAe,CAACC,OAAhB,GAA0B,KAAKO,gBAAL,CAAsBC,IAAtB,CAA2B,IAA3B,CAA1B;AACA,SAAKC,SAAL,GAAiBb,QAAjB;AACD;;AAEOW,EAAAA,gBAAgB,GAAG;AACzB,SAAKG,MAAL,CAAY,KAAKD,SAAL,EAAZ;AACD;;AAKME,EAAAA,WAAW,GAAG;AACnB,SAAKL,cAAL,CAAoBJ,OAApB,CAA6BS,WAAD,IAAiBA,WAAW,EAAxD;AACD;;AAhC4D","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 (\"__typename__\" in dep && \"addListener\" in dep) {\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 }\n}\n"]}
1
+ {"version":3,"sources":["RNSkComputedValue.ts"],"names":["RNSkComputedValue","RNSkReadonlyValue","constructor","callback","dependencies","unsubscribers","notifyUpdateRef","current","undefined","forEach","dep","push","addListener","_unsubscribers","dependecyUpdated","bind","_callback","update","unsubscribe","__invalidate"],"mappings":";;;;;;;AAEA;;;;AAEO,MAAMA,iBAAN,SAAmCC,oCAAnC,CAAwD;AAC7DC,EAAAA,WAAW,CAACC,QAAD,EAAoBC,YAApB,EAAkD;AAC3D;AACA;AACA,UAAMC,aAAgC,GAAG,EAAzC;AACA,UAAMC,eAAsD,GAAG;AAC7DC,MAAAA,OAAO,EAAEC;AADoD,KAA/D;AAGAJ,IAAAA,YAAY,CAACK,OAAb,CAAsBC,GAAD,IAAS;AAC5B,UAAI,kBAAkBA,GAAlB,IAAyB,iBAAiBA,GAA9C,EAAmD;AACjDL,QAAAA,aAAa,CAACM,IAAd,CACGD,GAAD,CAAoCE,WAApC,CAAgD;AAAA;;AAAA,0CAC9CN,eAAe,CAACC,OAD8B,0DAC9C,2BAAAD,eAAe,CAD+B;AAAA,SAAhD,CADF;AAKD;AACF,KARD;AASA,UAAMH,QAAQ,EAAd;;AAhB2D;;AAAA;;AAiB3D,SAAKU,cAAL,GAAsBR,aAAtB;AACAC,IAAAA,eAAe,CAACC,OAAhB,GAA0B,KAAKO,gBAAL,CAAsBC,IAAtB,CAA2B,IAA3B,CAA1B;AACA,SAAKC,SAAL,GAAiBb,QAAjB;AACD;;AAEOW,EAAAA,gBAAgB,GAAG;AACzB,SAAKG,MAAL,CAAY,KAAKD,SAAL,EAAZ;AACD;;AAKME,EAAAA,WAAW,GAAG;AACnB,SAAKL,cAAL,CAAoBJ,OAApB,CAA6BS,WAAD,IAAiBA,WAAW,EAAxD;;AACA,SAAKL,cAAL,GAAsB,EAAtB;AACD;;AAEMM,EAAAA,YAAY,GAAS;AAC1B,SAAKN,cAAL,CAAoBJ,OAApB,CAA6BS,WAAD,IAAiBA,WAAW,EAAxD;;AACA,SAAKL,cAAL,GAAsB,EAAtB;AACD;;AAtC4D","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 (\"__typename__\" in dep && \"addListener\" in dep) {\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"]}
@@ -39,6 +39,10 @@ class RNSkReadonlyValue {
39
39
  };
40
40
  }
41
41
 
42
+ __invalidate() {
43
+ this._listeners = [];
44
+ }
45
+
42
46
  }
43
47
 
44
48
  exports.RNSkReadonlyValue = RNSkReadonlyValue;
@@ -1 +1 @@
1
- {"version":3,"sources":["RNSkReadonlyValue.ts"],"names":["RNSkReadonlyValue","constructor","value","_current","notifyListeners","_listeners","forEach","cb","update","nextValue","current","addListener","push","splice","indexOf"],"mappings":";;;;;;;;;AAEO,MAAMA,iBAAN,CAAmD;AACxDC,EAAAA,WAAW,CAACC,KAAD,EAAW;AAAA;;AAAA,wCAK0B,EAL1B;;AAAA,0CAgBS,WAhBT;;AACpB,SAAKC,QAAL,GAAgBD,KAAhB;AACD;;AAKOE,EAAAA,eAAe,GAAS;AAC9B,SAAKC,UAAL,CAAgBC,OAAhB,CAAyBC,EAAD,IAAQA,EAAE,CAAC,KAAKJ,QAAN,CAAlC;AACD;;AAESK,EAAAA,MAAM,CAACC,SAAD,EAAqB;AACnC,SAAKN,QAAL,GAAgBM,SAAhB;AACA,SAAKL,eAAL;AACD;;AAIiB,MAAPM,OAAO,GAAM;AACtB,WAAO,KAAKP,QAAZ;AACD;;AAEMQ,EAAAA,WAAW,CAACJ,EAAD,EAAyB;AACzC,SAAKF,UAAL,CAAgBO,IAAhB,CAAqBL,EAArB;;AACA,WAAO,MAAM;AACX,WAAKF,UAAL,CAAgBQ,MAAhB,CAAuB,KAAKR,UAAL,CAAgBS,OAAhB,CAAwBP,EAAxB,CAAvB,EAAoD,CAApD;AACD,KAFD;AAGD;;AA5BuD","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 this._current = nextValue;\n this.notifyListeners();\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"]}
1
+ {"version":3,"sources":["RNSkReadonlyValue.ts"],"names":["RNSkReadonlyValue","constructor","value","_current","notifyListeners","_listeners","forEach","cb","update","nextValue","current","addListener","push","splice","indexOf","__invalidate"],"mappings":";;;;;;;;;AAEO,MAAMA,iBAAN,CAAmD;AACxDC,EAAAA,WAAW,CAACC,KAAD,EAAW;AAAA;;AAAA,wCAK0B,EAL1B;;AAAA,0CAgBS,WAhBT;;AACpB,SAAKC,QAAL,GAAgBD,KAAhB;AACD;;AAKOE,EAAAA,eAAe,GAAS;AAC9B,SAAKC,UAAL,CAAgBC,OAAhB,CAAyBC,EAAD,IAAQA,EAAE,CAAC,KAAKJ,QAAN,CAAlC;AACD;;AAESK,EAAAA,MAAM,CAACC,SAAD,EAAqB;AACnC,SAAKN,QAAL,GAAgBM,SAAhB;AACA,SAAKL,eAAL;AACD;;AAIiB,MAAPM,OAAO,GAAM;AACtB,WAAO,KAAKP,QAAZ;AACD;;AAEMQ,EAAAA,WAAW,CAACJ,EAAD,EAAyB;AACzC,SAAKF,UAAL,CAAgBO,IAAhB,CAAqBL,EAArB;;AACA,WAAO,MAAM;AACX,WAAKF,UAAL,CAAgBQ,MAAhB,CAAuB,KAAKR,UAAL,CAAgBS,OAAhB,CAAwBP,EAAxB,CAAvB,EAAoD,CAApD;AACD,KAFD;AAGD;;AAEMQ,EAAAA,YAAY,GAAS;AAC1B,SAAKV,UAAL,GAAkB,EAAlB;AACD;;AAhCuD","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 this._current = nextValue;\n this.notifyListeners();\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"]}
@@ -1,6 +1,7 @@
1
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
2
  import * as Values from "../values/web";
3
3
  import * as ValuesHooks from "../values/hooks";
4
+ import { Selector } from "../values/selector";
4
5
  import * as BaseSkia from "../skia/types";
5
6
  import { useSharedValueEffect } from "../external/reanimated/useSharedValueEffect";
6
7
  import * as timingFunctions from "../animation/timing";
@@ -39,7 +40,6 @@ export const Mock = {
39
40
  Skia,
40
41
  ...BaseSkia,
41
42
  // 2. Hooks
42
- useDataCollection: Noop,
43
43
  useRawData: Noop,
44
44
  useData: Noop,
45
45
  useFont: Noop,
@@ -88,6 +88,7 @@ export const Mock = {
88
88
  // ValueExports
89
89
  ...Values,
90
90
  ...ValuesHooks,
91
+ Selector,
91
92
  // Animations
92
93
  ...timingFunctions,
93
94
  ...springFunctions,