@shopify/react-native-skia 1.11.9-next.1 → 2.0.0-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (243) hide show
  1. package/android/CMakeLists.txt +153 -30
  2. package/cpp/skia/include/codec/SkCodec.h +2 -7
  3. package/cpp/skia/include/config/SkUserConfig.h +0 -11
  4. package/cpp/skia/include/core/SkCanvas.h +7 -11
  5. package/cpp/skia/include/core/SkColor.h +0 -10
  6. package/cpp/skia/include/core/SkColorSpace.h +2 -184
  7. package/cpp/skia/include/core/SkColorType.h +32 -114
  8. package/cpp/skia/include/core/SkFontScanner.h +8 -5
  9. package/cpp/skia/include/core/SkFontStyle.h +1 -1
  10. package/cpp/skia/include/core/SkMaskFilter.h +8 -0
  11. package/cpp/skia/include/core/SkMilestone.h +1 -1
  12. package/cpp/skia/include/core/SkPath.h +1 -1
  13. package/cpp/skia/include/core/SkRRect.h +1 -3
  14. package/cpp/skia/include/core/SkShader.h +3 -3
  15. package/cpp/skia/include/core/SkString.h +8 -8
  16. package/cpp/skia/include/core/SkSurface.h +0 -14
  17. package/cpp/skia/include/core/SkTypeface.h +7 -24
  18. package/cpp/skia/include/effects/SkGradientShader.h +1 -6
  19. package/cpp/skia/include/effects/SkRuntimeEffect.h +0 -1
  20. package/cpp/skia/include/encode/SkPngEncoder.h +0 -14
  21. package/cpp/skia/include/gpu/GpuTypes.h +0 -9
  22. package/cpp/skia/include/gpu/ganesh/GrContextOptions.h +133 -135
  23. package/cpp/skia/include/gpu/ganesh/GrDirectContext.h +0 -5
  24. package/cpp/skia/include/gpu/ganesh/GrDriverBugWorkarounds.h +3 -3
  25. package/cpp/skia/include/gpu/ganesh/GrTypes.h +9 -14
  26. package/cpp/skia/include/gpu/graphite/Context.h +2 -25
  27. package/cpp/skia/include/gpu/graphite/ContextOptions.h +5 -23
  28. package/cpp/skia/include/gpu/graphite/GraphiteTypes.h +1 -20
  29. package/cpp/skia/include/gpu/graphite/Image.h +0 -1
  30. package/cpp/skia/include/gpu/graphite/Recorder.h +0 -6
  31. package/cpp/skia/include/gpu/graphite/Recording.h +1 -3
  32. package/cpp/skia/include/gpu/graphite/mtl/MtlGraphiteTypes.h +36 -4
  33. package/cpp/skia/include/gpu/graphite/precompile/Precompile.h +2 -3
  34. package/cpp/skia/include/pathops/SkPathOps.h +1 -9
  35. package/cpp/skia/include/ports/SkFontMgr_FontConfigInterface.h +0 -3
  36. package/cpp/skia/include/private/SkPathRef.h +21 -15
  37. package/cpp/skia/include/private/base/SkAttributes.h +10 -16
  38. package/cpp/skia/include/private/base/SkMutex.h +0 -8
  39. package/cpp/skia/include/private/base/SkTArray.h +1 -1
  40. package/cpp/skia/include/private/base/SkTDArray.h +1 -1
  41. package/cpp/skia/include/private/base/SkTemplates.h +11 -24
  42. package/cpp/skia/include/private/gpu/ganesh/GrTypesPriv.h +1 -1
  43. package/cpp/skia/include/sksl/SkSLDebugTrace.h +3 -0
  44. package/cpp/skia/modules/skcms/src/Transform_inl.h +20 -20
  45. package/cpp/skia/modules/skcms/src/skcms_Transform.h +3 -4
  46. package/cpp/skia/modules/skcms/src/skcms_public.h +15 -19
  47. package/cpp/skia/modules/skresources/include/SkResources.h +1 -3
  48. package/cpp/skia/modules/svg/include/SkSVGCircle.h +1 -1
  49. package/cpp/skia/modules/svg/include/SkSVGContainer.h +1 -1
  50. package/cpp/skia/modules/svg/include/SkSVGFeLightSource.h +1 -1
  51. package/cpp/skia/modules/svg/include/SkSVGImage.h +2 -2
  52. package/cpp/skia/modules/svg/include/SkSVGPath.h +1 -1
  53. package/cpp/skia/modules/svg/include/SkSVGPoly.h +1 -1
  54. package/cpp/skia/modules/svg/include/SkSVGRect.h +1 -1
  55. package/cpp/skia/modules/svg/include/SkSVGRenderContext.h +0 -2
  56. package/cpp/skia/modules/svg/include/SkSVGShape.h +0 -1
  57. package/cpp/skia/modules/svg/include/SkSVGText.h +1 -1
  58. package/cpp/skia/modules/svg/include/SkSVGTransformableNode.h +0 -4
  59. package/cpp/skia/modules/svg/include/SkSVGUse.h +1 -1
  60. package/cpp/skia/src/core/SkLRUCache.h +13 -19
  61. package/cpp/skia/src/core/SkTHash.h +4 -50
  62. package/cpp/skia/src/gpu/ganesh/gl/GrGLDefines.h +0 -1
  63. package/lib/commonjs/Platform/Platform.web.js +1 -0
  64. package/lib/commonjs/Platform/Platform.web.js.map +1 -1
  65. package/lib/commonjs/renderer/Canvas.d.ts +1 -1
  66. package/lib/commonjs/renderer/Canvas.js +2 -4
  67. package/lib/commonjs/renderer/Canvas.js.map +1 -1
  68. package/lib/commonjs/renderer/__tests__/setup.d.ts +1 -0
  69. package/lib/commonjs/sksg/Elements.d.ts +1 -1
  70. package/lib/commonjs/sksg/Elements.js.map +1 -1
  71. package/lib/commonjs/sksg/HostConfig.d.ts +1 -1
  72. package/lib/commonjs/sksg/Reconciler.js +0 -1
  73. package/lib/commonjs/sksg/Reconciler.js.map +1 -1
  74. package/lib/module/Platform/Platform.web.js +2 -1
  75. package/lib/module/Platform/Platform.web.js.map +1 -1
  76. package/lib/module/dom/nodes/datatypes/Circle.js +2 -1
  77. package/lib/module/dom/nodes/datatypes/Circle.js.map +1 -1
  78. package/lib/module/dom/nodes/datatypes/Gradient.js +3 -3
  79. package/lib/module/dom/nodes/datatypes/Gradient.js.map +1 -1
  80. package/lib/module/dom/nodes/datatypes/Rect.js +5 -3
  81. package/lib/module/dom/nodes/datatypes/Rect.js.map +1 -1
  82. package/lib/module/external/reanimated/buffers.js +2 -1
  83. package/lib/module/external/reanimated/buffers.js.map +1 -1
  84. package/lib/module/external/reanimated/useAnimatedImageValue.js +1 -1
  85. package/lib/module/external/reanimated/useAnimatedImageValue.js.map +1 -1
  86. package/lib/module/external/reanimated/useVideo.js +23 -10
  87. package/lib/module/external/reanimated/useVideo.js.map +1 -1
  88. package/lib/module/renderer/Canvas.d.ts +1 -1
  89. package/lib/module/renderer/Canvas.js +3 -5
  90. package/lib/module/renderer/Canvas.js.map +1 -1
  91. package/lib/module/renderer/__tests__/setup.d.ts +1 -0
  92. package/lib/module/skia/core/Vector.js +1 -1
  93. package/lib/module/skia/core/Vector.js.map +1 -1
  94. package/lib/module/skia/web/CanvasKitWebGLBufferImpl.js +4 -1
  95. package/lib/module/skia/web/CanvasKitWebGLBufferImpl.js.map +1 -1
  96. package/lib/module/skia/web/Host.js +7 -1
  97. package/lib/module/skia/web/Host.js.map +1 -1
  98. package/lib/module/skia/web/JsiSkAnimatedImage.js +6 -3
  99. package/lib/module/skia/web/JsiSkAnimatedImage.js.map +1 -1
  100. package/lib/module/skia/web/JsiSkCanvas.js +6 -3
  101. package/lib/module/skia/web/JsiSkCanvas.js.map +1 -1
  102. package/lib/module/skia/web/JsiSkColorFilter.js +6 -3
  103. package/lib/module/skia/web/JsiSkColorFilter.js.map +1 -1
  104. package/lib/module/skia/web/JsiSkContourMeasure.js +6 -3
  105. package/lib/module/skia/web/JsiSkContourMeasure.js.map +1 -1
  106. package/lib/module/skia/web/JsiSkContourMeasureIter.js +6 -3
  107. package/lib/module/skia/web/JsiSkContourMeasureIter.js.map +1 -1
  108. package/lib/module/skia/web/JsiSkData.js +6 -3
  109. package/lib/module/skia/web/JsiSkData.js.map +1 -1
  110. package/lib/module/skia/web/JsiSkFont.js +6 -3
  111. package/lib/module/skia/web/JsiSkFont.js.map +1 -1
  112. package/lib/module/skia/web/JsiSkImage.js +12 -8
  113. package/lib/module/skia/web/JsiSkImage.js.map +1 -1
  114. package/lib/module/skia/web/JsiSkImageFilter.js +6 -3
  115. package/lib/module/skia/web/JsiSkImageFilter.js.map +1 -1
  116. package/lib/module/skia/web/JsiSkMaskFilter.js +6 -3
  117. package/lib/module/skia/web/JsiSkMaskFilter.js.map +1 -1
  118. package/lib/module/skia/web/JsiSkMatrix.js +8 -5
  119. package/lib/module/skia/web/JsiSkMatrix.js.map +1 -1
  120. package/lib/module/skia/web/JsiSkPaint.js +6 -3
  121. package/lib/module/skia/web/JsiSkPaint.js.map +1 -1
  122. package/lib/module/skia/web/JsiSkParagraphBuilder.js +3 -2
  123. package/lib/module/skia/web/JsiSkParagraphBuilder.js.map +1 -1
  124. package/lib/module/skia/web/JsiSkParagraphBuilderFactory.js +1 -1
  125. package/lib/module/skia/web/JsiSkParagraphBuilderFactory.js.map +1 -1
  126. package/lib/module/skia/web/JsiSkParagraphStyle.js +15 -15
  127. package/lib/module/skia/web/JsiSkParagraphStyle.js.map +1 -1
  128. package/lib/module/skia/web/JsiSkPath.js +6 -3
  129. package/lib/module/skia/web/JsiSkPath.js.map +1 -1
  130. package/lib/module/skia/web/JsiSkPathEffect.js +6 -3
  131. package/lib/module/skia/web/JsiSkPathEffect.js.map +1 -1
  132. package/lib/module/skia/web/JsiSkPicture.js +6 -3
  133. package/lib/module/skia/web/JsiSkPicture.js.map +1 -1
  134. package/lib/module/skia/web/JsiSkPictureRecorder.js +6 -3
  135. package/lib/module/skia/web/JsiSkPictureRecorder.js.map +1 -1
  136. package/lib/module/skia/web/JsiSkPoint.js +6 -3
  137. package/lib/module/skia/web/JsiSkPoint.js.map +1 -1
  138. package/lib/module/skia/web/JsiSkRRect.js +6 -3
  139. package/lib/module/skia/web/JsiSkRRect.js.map +1 -1
  140. package/lib/module/skia/web/JsiSkRSXform.js +6 -3
  141. package/lib/module/skia/web/JsiSkRSXform.js.map +1 -1
  142. package/lib/module/skia/web/JsiSkRect.js +6 -3
  143. package/lib/module/skia/web/JsiSkRect.js.map +1 -1
  144. package/lib/module/skia/web/JsiSkRuntimeEffect.js +6 -3
  145. package/lib/module/skia/web/JsiSkRuntimeEffect.js.map +1 -1
  146. package/lib/module/skia/web/JsiSkSVG.js +8 -5
  147. package/lib/module/skia/web/JsiSkSVG.js.map +1 -1
  148. package/lib/module/skia/web/JsiSkShader.js +6 -3
  149. package/lib/module/skia/web/JsiSkShader.js.map +1 -1
  150. package/lib/module/skia/web/JsiSkSurface.js +6 -3
  151. package/lib/module/skia/web/JsiSkSurface.js.map +1 -1
  152. package/lib/module/skia/web/JsiSkTextBlob.js +6 -3
  153. package/lib/module/skia/web/JsiSkTextBlob.js.map +1 -1
  154. package/lib/module/skia/web/JsiSkTypeface.js +6 -3
  155. package/lib/module/skia/web/JsiSkTypeface.js.map +1 -1
  156. package/lib/module/skia/web/JsiSkTypefaceFontProvider.js +4 -1
  157. package/lib/module/skia/web/JsiSkTypefaceFontProvider.js.map +1 -1
  158. package/lib/module/skia/web/JsiSkVertices.js +6 -3
  159. package/lib/module/skia/web/JsiSkVertices.js.map +1 -1
  160. package/lib/module/skia/web/JsiVideo.js +5 -2
  161. package/lib/module/skia/web/JsiVideo.js.map +1 -1
  162. package/lib/module/sksg/Container.js +8 -5
  163. package/lib/module/sksg/Container.js.map +1 -1
  164. package/lib/module/sksg/Elements.d.ts +1 -1
  165. package/lib/module/sksg/Elements.js.map +1 -1
  166. package/lib/module/sksg/HostConfig.d.ts +1 -1
  167. package/lib/module/sksg/Reconciler.js +5 -1
  168. package/lib/module/sksg/Reconciler.js.map +1 -1
  169. package/lib/module/sksg/Recorder/ReanimatedRecorder.js +5 -1
  170. package/lib/module/sksg/Recorder/ReanimatedRecorder.js.map +1 -1
  171. package/lib/module/sksg/Recorder/Recorder.js +6 -3
  172. package/lib/module/sksg/Recorder/Recorder.js.map +1 -1
  173. package/lib/module/sksg/Recorder/Visitor.js +1 -1
  174. package/lib/module/sksg/Recorder/Visitor.js.map +1 -1
  175. package/lib/module/sksg/Recorder/commands/Drawing.js +4 -2
  176. package/lib/module/sksg/Recorder/commands/Drawing.js.map +1 -1
  177. package/lib/module/sksg/Recorder/commands/Shaders.js +3 -2
  178. package/lib/module/sksg/Recorder/commands/Shaders.js.map +1 -1
  179. package/lib/module/views/SkiaBaseWebView.js +12 -9
  180. package/lib/module/views/SkiaBaseWebView.js.map +1 -1
  181. package/lib/module/views/SkiaPictureView.js +5 -1
  182. package/lib/module/views/SkiaPictureView.js.map +1 -1
  183. package/lib/module/views/SkiaPictureView.web.js +4 -1
  184. package/lib/module/views/SkiaPictureView.web.js.map +1 -1
  185. package/lib/module/web/LoadSkiaWeb.js +2 -1
  186. package/lib/module/web/LoadSkiaWeb.js.map +1 -1
  187. package/lib/module/web/WithSkiaWeb.js +1 -1
  188. package/lib/module/web/WithSkiaWeb.js.map +1 -1
  189. package/lib/typescript/lib/module/Platform/Platform.web.d.ts +1 -1
  190. package/lib/typescript/lib/module/mock/index.d.ts +22 -11
  191. package/lib/typescript/lib/module/renderer/Canvas.d.ts +1 -1
  192. package/lib/typescript/lib/module/skia/web/CanvasKitWebGLBufferImpl.d.ts +2 -2
  193. package/lib/typescript/lib/module/skia/web/JsiSkAnimatedImage.d.ts +0 -1
  194. package/lib/typescript/lib/module/skia/web/JsiSkCanvas.d.ts +0 -1
  195. package/lib/typescript/lib/module/skia/web/JsiSkColorFilter.d.ts +0 -1
  196. package/lib/typescript/lib/module/skia/web/JsiSkContourMeasure.d.ts +0 -1
  197. package/lib/typescript/lib/module/skia/web/JsiSkContourMeasureIter.d.ts +0 -1
  198. package/lib/typescript/lib/module/skia/web/JsiSkData.d.ts +0 -1
  199. package/lib/typescript/lib/module/skia/web/JsiSkFont.d.ts +0 -1
  200. package/lib/typescript/lib/module/skia/web/JsiSkImage.d.ts +0 -1
  201. package/lib/typescript/lib/module/skia/web/JsiSkImageFilter.d.ts +0 -1
  202. package/lib/typescript/lib/module/skia/web/JsiSkMaskFilter.d.ts +0 -1
  203. package/lib/typescript/lib/module/skia/web/JsiSkMatrix.d.ts +0 -1
  204. package/lib/typescript/lib/module/skia/web/JsiSkPaint.d.ts +0 -1
  205. package/lib/typescript/lib/module/skia/web/JsiSkPath.d.ts +0 -1
  206. package/lib/typescript/lib/module/skia/web/JsiSkPathEffect.d.ts +0 -1
  207. package/lib/typescript/lib/module/skia/web/JsiSkPicture.d.ts +0 -1
  208. package/lib/typescript/lib/module/skia/web/JsiSkPictureRecorder.d.ts +0 -1
  209. package/lib/typescript/lib/module/skia/web/JsiSkPoint.d.ts +0 -1
  210. package/lib/typescript/lib/module/skia/web/JsiSkRRect.d.ts +0 -1
  211. package/lib/typescript/lib/module/skia/web/JsiSkRSXform.d.ts +0 -1
  212. package/lib/typescript/lib/module/skia/web/JsiSkRect.d.ts +0 -1
  213. package/lib/typescript/lib/module/skia/web/JsiSkRuntimeEffect.d.ts +0 -1
  214. package/lib/typescript/lib/module/skia/web/JsiSkSVG.d.ts +0 -1
  215. package/lib/typescript/lib/module/skia/web/JsiSkShader.d.ts +0 -1
  216. package/lib/typescript/lib/module/skia/web/JsiSkSurface.d.ts +0 -1
  217. package/lib/typescript/lib/module/skia/web/JsiSkTextBlob.d.ts +0 -1
  218. package/lib/typescript/lib/module/skia/web/JsiSkTypeface.d.ts +0 -1
  219. package/lib/typescript/lib/module/skia/web/JsiSkTypefaceFontProvider.d.ts +0 -1
  220. package/lib/typescript/lib/module/skia/web/JsiSkVertices.d.ts +0 -1
  221. package/lib/typescript/lib/module/skia/web/JsiVideo.d.ts +2 -2
  222. package/lib/typescript/lib/module/sksg/Container.d.ts +15 -7
  223. package/lib/typescript/lib/module/sksg/Reconciler.d.ts +21 -15
  224. package/lib/typescript/lib/module/sksg/Recorder/ReanimatedRecorder.d.ts +0 -1
  225. package/lib/typescript/lib/module/sksg/Recorder/Recorder.d.ts +2 -5
  226. package/lib/typescript/lib/module/views/SkiaBaseWebView.d.ts +11 -12
  227. package/lib/typescript/lib/module/views/SkiaPictureView.d.ts +1 -1
  228. package/lib/typescript/lib/module/views/SkiaPictureView.web.d.ts +1 -1
  229. package/lib/typescript/src/renderer/Canvas.d.ts +1 -1
  230. package/lib/typescript/src/renderer/__tests__/setup.d.ts +1 -0
  231. package/lib/typescript/src/sksg/Elements.d.ts +1 -1
  232. package/lib/typescript/src/sksg/HostConfig.d.ts +1 -1
  233. package/package.json +3 -3
  234. package/src/Platform/Platform.web.tsx +2 -1
  235. package/src/__tests__/snapshots/screens/snapshot2-android-ci.png +0 -0
  236. package/src/__tests__/snapshots/screens/snapshot3-android-ci.png +0 -0
  237. package/src/renderer/Canvas.tsx +3 -3
  238. package/src/renderer/__tests__/setup.tsx +5 -1
  239. package/src/sksg/Elements.tsx +1 -1
  240. package/src/sksg/Reconciler.ts +1 -2
  241. package/cpp/skia/include/gpu/graphite/LogPriority.h +0 -36
  242. package/cpp/skia/include/gpu/graphite/PrecompileContext.h +0 -52
  243. package/cpp/skia/include/gpu/graphite/mtl/MtlGraphiteTypesUtils.h +0 -48
@@ -1,10 +1,13 @@
1
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
2
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
1
4
  import { HostObject } from "./Host";
2
5
  export class JsiSkTextBlob extends HostObject {
3
6
  constructor(CanvasKit, ref) {
4
7
  super(CanvasKit, ref, "TextBlob");
8
+ _defineProperty(this, "dispose", () => {
9
+ this.ref.delete();
10
+ });
5
11
  }
6
- dispose = () => {
7
- this.ref.delete();
8
- };
9
12
  }
10
13
  //# sourceMappingURL=JsiSkTextBlob.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["HostObject","JsiSkTextBlob","constructor","CanvasKit","ref","dispose","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,SAASA,UAAU,QAAQ,QAAQ;AAEnC,OAAO,MAAMC,aAAa,SAChBD,UAAU,CAEpB;EACEE,WAAWA,CAACC,SAAoB,EAAEC,GAAa,EAAE;IAC/C,KAAK,CAACD,SAAS,EAAEC,GAAG,EAAE,UAAU,CAAC;EACnC;EAEAC,OAAO,GAAGA,CAAA,KAAM;IACd,IAAI,CAACD,GAAG,CAACE,MAAM,CAAC,CAAC;EACnB,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"names":["HostObject","JsiSkTextBlob","constructor","CanvasKit","ref","_defineProperty","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,SAASA,UAAU,QAAQ,QAAQ;AAEnC,OAAO,MAAMC,aAAa,SAChBD,UAAU,CAEpB;EACEE,WAAWA,CAACC,SAAoB,EAAEC,GAAa,EAAE;IAC/C,KAAK,CAACD,SAAS,EAAEC,GAAG,EAAE,UAAU,CAAC;IAACC,eAAA,kBAG1B,MAAM;MACd,IAAI,CAACD,GAAG,CAACE,MAAM,CAAC,CAAC;IACnB,CAAC;EAJD;AAKF","ignoreList":[]}
@@ -1,7 +1,13 @@
1
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
2
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
1
4
  import { HostObject } from "./Host";
2
5
  export class JsiSkTypeface extends HostObject {
3
6
  constructor(CanvasKit, ref) {
4
7
  super(CanvasKit, ref, "Typeface");
8
+ _defineProperty(this, "dispose", () => {
9
+ this.ref.delete();
10
+ });
5
11
  }
6
12
  get bold() {
7
13
  console.warn("Typeface.bold is deprecated and will be removed in a future release. The property will return false.");
@@ -14,8 +20,5 @@ export class JsiSkTypeface extends HostObject {
14
20
  getGlyphIDs(str, numCodePoints) {
15
21
  return Array.from(this.ref.getGlyphIDs(str, numCodePoints));
16
22
  }
17
- dispose = () => {
18
- this.ref.delete();
19
- };
20
23
  }
21
24
  //# sourceMappingURL=JsiSkTypeface.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["HostObject","JsiSkTypeface","constructor","CanvasKit","ref","bold","console","warn","italic","getGlyphIDs","str","numCodePoints","Array","from","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 getGlyphIDs(str: string, numCodePoints?: number) {\n return Array.from(this.ref.getGlyphIDs(str, numCodePoints));\n }\n\n dispose = () => {\n this.ref.delete();\n };\n}\n"],"mappings":"AAIA,SAASA,UAAU,QAAQ,QAAQ;AAEnC,OAAO,MAAMC,aAAa,SAChBD,UAAU,CAEpB;EACEE,WAAWA,CAACC,SAAoB,EAAEC,GAAa,EAAE;IAC/C,KAAK,CAACD,SAAS,EAAEC,GAAG,EAAE,UAAU,CAAC;EACnC;EAEA,IAAIC,IAAIA,CAAA,EAAY;IAClBC,OAAO,CAACC,IAAI,CACV,sGACF,CAAC;IACD,OAAO,KAAK;EACd;EAEA,IAAIC,MAAMA,CAAA,EAAY;IACpBF,OAAO,CAACC,IAAI,CACV,wGACF,CAAC;IACD,OAAO,KAAK;EACd;EAEAE,WAAWA,CAACC,GAAW,EAAEC,aAAsB,EAAE;IAC/C,OAAOC,KAAK,CAACC,IAAI,CAAC,IAAI,CAACT,GAAG,CAACK,WAAW,CAACC,GAAG,EAAEC,aAAa,CAAC,CAAC;EAC7D;EAEAG,OAAO,GAAGA,CAAA,KAAM;IACd,IAAI,CAACV,GAAG,CAACW,MAAM,CAAC,CAAC;EACnB,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"names":["HostObject","JsiSkTypeface","constructor","CanvasKit","ref","_defineProperty","delete","bold","console","warn","italic","getGlyphIDs","str","numCodePoints","Array","from"],"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 getGlyphIDs(str: string, numCodePoints?: number) {\n return Array.from(this.ref.getGlyphIDs(str, numCodePoints));\n }\n\n dispose = () => {\n this.ref.delete();\n };\n}\n"],"mappings":";;;AAIA,SAASA,UAAU,QAAQ,QAAQ;AAEnC,OAAO,MAAMC,aAAa,SAChBD,UAAU,CAEpB;EACEE,WAAWA,CAACC,SAAoB,EAAEC,GAAa,EAAE;IAC/C,KAAK,CAACD,SAAS,EAAEC,GAAG,EAAE,UAAU,CAAC;IAACC,eAAA,kBAqB1B,MAAM;MACd,IAAI,CAACD,GAAG,CAACE,MAAM,CAAC,CAAC;IACnB,CAAC;EAtBD;EAEA,IAAIC,IAAIA,CAAA,EAAY;IAClBC,OAAO,CAACC,IAAI,CACV,sGACF,CAAC;IACD,OAAO,KAAK;EACd;EAEA,IAAIC,MAAMA,CAAA,EAAY;IACpBF,OAAO,CAACC,IAAI,CACV,wGACF,CAAC;IACD,OAAO,KAAK;EACd;EAEAE,WAAWA,CAACC,GAAW,EAAEC,aAAsB,EAAE;IAC/C,OAAOC,KAAK,CAACC,IAAI,CAAC,IAAI,CAACX,GAAG,CAACO,WAAW,CAACC,GAAG,EAAEC,aAAa,CAAC,CAAC;EAC7D;AAKF","ignoreList":[]}
@@ -1,8 +1,11 @@
1
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
2
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
1
4
  import { HostObject, NotImplementedOnRNWeb } from "./Host";
2
5
  export class JsiSkTypefaceFontProvider extends HostObject {
3
- allocatedPointers = [];
4
6
  constructor(CanvasKit, ref) {
5
7
  super(CanvasKit, ref, "FontMgr");
8
+ _defineProperty(this, "allocatedPointers", []);
6
9
  }
7
10
  matchFamilyStyle(_name, _style) {
8
11
  throw new NotImplementedOnRNWeb();
@@ -1 +1 @@
1
- {"version":3,"names":["HostObject","NotImplementedOnRNWeb","JsiSkTypefaceFontProvider","allocatedPointers","constructor","CanvasKit","ref","matchFamilyStyle","_name","_style","countFamilies","getFamilyName","index","registerFont","typeface","familyName","strLen","lengthBytesUTF8","strPtr","_malloc","stringToUTF8","_registerFont","dispose","ptr","_free","delete","str","encoder","TextEncoder","utf8","encode","length","outPtr","maxBytesToWrite","heap","HEAPU8","Error","i"],"sources":["JsiSkTypefaceFontProvider.ts"],"sourcesContent":["import type { CanvasKit, TypefaceFontProvider } from \"canvaskit-wasm\";\n\nimport type { SkTypefaceFontProvider } from \"../types/Paragraph/TypefaceFontProvider\";\nimport type { FontStyle, SkTypeface } from \"../types\";\n\nimport { HostObject, NotImplementedOnRNWeb } from \"./Host\";\n\nexport class JsiSkTypefaceFontProvider\n extends HostObject<TypefaceFontProvider, \"FontMgr\">\n implements SkTypefaceFontProvider\n{\n private allocatedPointers: number[] = [];\n\n constructor(CanvasKit: CanvasKit, ref: TypefaceFontProvider) {\n super(CanvasKit, ref, \"FontMgr\");\n }\n\n matchFamilyStyle(_name: string, _style: FontStyle): SkTypeface {\n throw new NotImplementedOnRNWeb();\n }\n countFamilies() {\n return this.ref.countFamilies();\n }\n getFamilyName(index: number) {\n return this.ref.getFamilyName(index);\n }\n registerFont(typeface: SkTypeface, familyName: string) {\n const strLen = lengthBytesUTF8(familyName) + 1;\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-expect-error\n const strPtr = this.CanvasKit._malloc(strLen);\n stringToUTF8(this.CanvasKit, familyName, strPtr, strLen);\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-expect-error\n this.ref._registerFont(typeface.ref, strPtr);\n }\n\n dispose() {\n for (const ptr of this.allocatedPointers) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-expect-error\n this.CanvasKit._free(ptr);\n }\n\n this.ref.delete();\n }\n}\n\nconst lengthBytesUTF8 = (str: string) => {\n // TextEncoder will give us the byte length in UTF8 form\n const encoder = new TextEncoder();\n const utf8 = encoder.encode(str);\n return utf8.length;\n};\n\nconst stringToUTF8 = (\n CanvasKit: CanvasKit,\n str: string,\n outPtr: number,\n maxBytesToWrite: number\n) => {\n // TextEncoder will give us the byte array in UTF8 form\n const encoder = new TextEncoder();\n const utf8 = encoder.encode(str);\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-expect-error\n const heap: Int8Array = CanvasKit.HEAPU8;\n\n // Check if there's enough space\n if (utf8.length > maxBytesToWrite) {\n throw new Error(\"Not enough space to write UTF8 encoded string\");\n }\n\n // Copy the bytes\n for (let i = 0; i < utf8.length; i++) {\n heap[outPtr + i] = utf8[i];\n }\n\n // Null terminate\n if (utf8.length < maxBytesToWrite) {\n heap[outPtr + utf8.length] = 0;\n }\n};\n"],"mappings":"AAKA,SAASA,UAAU,EAAEC,qBAAqB,QAAQ,QAAQ;AAE1D,OAAO,MAAMC,yBAAyB,SAC5BF,UAAU,CAEpB;EACUG,iBAAiB,GAAa,EAAE;EAExCC,WAAWA,CAACC,SAAoB,EAAEC,GAAyB,EAAE;IAC3D,KAAK,CAACD,SAAS,EAAEC,GAAG,EAAE,SAAS,CAAC;EAClC;EAEAC,gBAAgBA,CAACC,KAAa,EAAEC,MAAiB,EAAc;IAC7D,MAAM,IAAIR,qBAAqB,CAAC,CAAC;EACnC;EACAS,aAAaA,CAAA,EAAG;IACd,OAAO,IAAI,CAACJ,GAAG,CAACI,aAAa,CAAC,CAAC;EACjC;EACAC,aAAaA,CAACC,KAAa,EAAE;IAC3B,OAAO,IAAI,CAACN,GAAG,CAACK,aAAa,CAACC,KAAK,CAAC;EACtC;EACAC,YAAYA,CAACC,QAAoB,EAAEC,UAAkB,EAAE;IACrD,MAAMC,MAAM,GAAGC,eAAe,CAACF,UAAU,CAAC,GAAG,CAAC;;IAE9C;IACA;IACA,MAAMG,MAAM,GAAG,IAAI,CAACb,SAAS,CAACc,OAAO,CAACH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;IACjCC,IAAI,CAACF,MAAM,GAAGH,IAAI,CAACE,MAAM,CAAC,GAAG,CAAC;EAChC;AACF,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["HostObject","NotImplementedOnRNWeb","JsiSkTypefaceFontProvider","constructor","CanvasKit","ref","_defineProperty","matchFamilyStyle","_name","_style","countFamilies","getFamilyName","index","registerFont","typeface","familyName","strLen","lengthBytesUTF8","strPtr","_malloc","stringToUTF8","_registerFont","dispose","ptr","allocatedPointers","_free","delete","str","encoder","TextEncoder","utf8","encode","length","outPtr","maxBytesToWrite","heap","HEAPU8","Error","i"],"sources":["JsiSkTypefaceFontProvider.ts"],"sourcesContent":["import type { CanvasKit, TypefaceFontProvider } from \"canvaskit-wasm\";\n\nimport type { SkTypefaceFontProvider } from \"../types/Paragraph/TypefaceFontProvider\";\nimport type { FontStyle, SkTypeface } from \"../types\";\n\nimport { HostObject, NotImplementedOnRNWeb } from \"./Host\";\n\nexport class JsiSkTypefaceFontProvider\n extends HostObject<TypefaceFontProvider, \"FontMgr\">\n implements SkTypefaceFontProvider\n{\n private allocatedPointers: number[] = [];\n\n constructor(CanvasKit: CanvasKit, ref: TypefaceFontProvider) {\n super(CanvasKit, ref, \"FontMgr\");\n }\n\n matchFamilyStyle(_name: string, _style: FontStyle): SkTypeface {\n throw new NotImplementedOnRNWeb();\n }\n countFamilies() {\n return this.ref.countFamilies();\n }\n getFamilyName(index: number) {\n return this.ref.getFamilyName(index);\n }\n registerFont(typeface: SkTypeface, familyName: string) {\n const strLen = lengthBytesUTF8(familyName) + 1;\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-expect-error\n const strPtr = this.CanvasKit._malloc(strLen);\n stringToUTF8(this.CanvasKit, familyName, strPtr, strLen);\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-expect-error\n this.ref._registerFont(typeface.ref, strPtr);\n }\n\n dispose() {\n for (const ptr of this.allocatedPointers) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-expect-error\n this.CanvasKit._free(ptr);\n }\n\n this.ref.delete();\n }\n}\n\nconst lengthBytesUTF8 = (str: string) => {\n // TextEncoder will give us the byte length in UTF8 form\n const encoder = new TextEncoder();\n const utf8 = encoder.encode(str);\n return utf8.length;\n};\n\nconst stringToUTF8 = (\n CanvasKit: CanvasKit,\n str: string,\n outPtr: number,\n maxBytesToWrite: number\n) => {\n // TextEncoder will give us the byte array in UTF8 form\n const encoder = new TextEncoder();\n const utf8 = encoder.encode(str);\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-expect-error\n const heap: Int8Array = CanvasKit.HEAPU8;\n\n // Check if there's enough space\n if (utf8.length > maxBytesToWrite) {\n throw new Error(\"Not enough space to write UTF8 encoded string\");\n }\n\n // Copy the bytes\n for (let i = 0; i < utf8.length; i++) {\n heap[outPtr + i] = utf8[i];\n }\n\n // Null terminate\n if (utf8.length < maxBytesToWrite) {\n heap[outPtr + utf8.length] = 0;\n }\n};\n"],"mappings":";;;AAKA,SAASA,UAAU,EAAEC,qBAAqB,QAAQ,QAAQ;AAE1D,OAAO,MAAMC,yBAAyB,SAC5BF,UAAU,CAEpB;EAGEG,WAAWA,CAACC,SAAoB,EAAEC,GAAyB,EAAE;IAC3D,KAAK,CAACD,SAAS,EAAEC,GAAG,EAAE,SAAS,CAAC;IAACC,eAAA,4BAHG,EAAE;EAIxC;EAEAC,gBAAgBA,CAACC,KAAa,EAAEC,MAAiB,EAAc;IAC7D,MAAM,IAAIR,qBAAqB,CAAC,CAAC;EACnC;EACAS,aAAaA,CAAA,EAAG;IACd,OAAO,IAAI,CAACL,GAAG,CAACK,aAAa,CAAC,CAAC;EACjC;EACAC,aAAaA,CAACC,KAAa,EAAE;IAC3B,OAAO,IAAI,CAACP,GAAG,CAACM,aAAa,CAACC,KAAK,CAAC;EACtC;EACAC,YAAYA,CAACC,QAAoB,EAAEC,UAAkB,EAAE;IACrD,MAAMC,MAAM,GAAGC,eAAe,CAACF,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AAC,GAAGR,IAAI,CAACQ,CAAC,CAAC;EAC5B;;EAEA;EACA,IAAIR,IAAI,CAACE,MAAM,GAAGE,eAAe,EAAE;IACjCC,IAAI,CAACF,MAAM,GAAGH,IAAI,CAACE,MAAM,CAAC,GAAG,CAAC;EAChC;AACF,CAAC","ignoreList":[]}
@@ -1,12 +1,15 @@
1
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
2
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
1
4
  import { HostObject } from "./Host";
2
5
  import { JsiSkRect } from "./JsiSkRect";
3
6
  export class JsiSkVertices extends HostObject {
4
7
  constructor(CanvasKit, ref) {
5
8
  super(CanvasKit, ref, "Vertices");
9
+ _defineProperty(this, "dispose", () => {
10
+ this.ref.delete();
11
+ });
6
12
  }
7
- dispose = () => {
8
- this.ref.delete();
9
- };
10
13
  bounds() {
11
14
  return new JsiSkRect(this.CanvasKit, this.ref.bounds());
12
15
  }
@@ -1 +1 @@
1
- {"version":3,"names":["HostObject","JsiSkRect","JsiSkVertices","constructor","CanvasKit","ref","dispose","delete","bounds","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,SAASA,UAAU,QAAQ,QAAQ;AACnC,SAASC,SAAS,QAAQ,aAAa;AAEvC,OAAO,MAAMC,aAAa,SAChBF,UAAU,CAEpB;EACEG,WAAWA,CAACC,SAAoB,EAAEC,GAAa,EAAE;IAC/C,KAAK,CAACD,SAAS,EAAEC,GAAG,EAAE,UAAU,CAAC;EACnC;EAEAC,OAAO,GAAGA,CAAA,KAAM;IACd,IAAI,CAACD,GAAG,CAACE,MAAM,CAAC,CAAC;EACnB,CAAC;EAEDC,MAAMA,CAAA,EAAG;IACP,OAAO,IAAIP,SAAS,CAAC,IAAI,CAACG,SAAS,EAAE,IAAI,CAACC,GAAG,CAACG,MAAM,CAAC,CAAC,CAAC;EACzD;EAEAC,QAAQA,CAAA,EAAG;IACT,OAAO,IAAI,CAACJ,GAAG,CAACI,QAAQ,CAAC,CAAC;EAC5B;AACF","ignoreList":[]}
1
+ {"version":3,"names":["HostObject","JsiSkRect","JsiSkVertices","constructor","CanvasKit","ref","_defineProperty","delete","bounds","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,SAASA,UAAU,QAAQ,QAAQ;AACnC,SAASC,SAAS,QAAQ,aAAa;AAEvC,OAAO,MAAMC,aAAa,SAChBF,UAAU,CAEpB;EACEG,WAAWA,CAACC,SAAoB,EAAEC,GAAa,EAAE;IAC/C,KAAK,CAACD,SAAS,EAAEC,GAAG,EAAE,UAAU,CAAC;IAACC,eAAA,kBAG1B,MAAM;MACd,IAAI,CAACD,GAAG,CAACE,MAAM,CAAC,CAAC;IACnB,CAAC;EAJD;EAMAC,MAAMA,CAAA,EAAG;IACP,OAAO,IAAIP,SAAS,CAAC,IAAI,CAACG,SAAS,EAAE,IAAI,CAACC,GAAG,CAACG,MAAM,CAAC,CAAC,CAAC;EACzD;EAEAC,QAAQA,CAAA,EAAG;IACT,OAAO,IAAI,CAACJ,GAAG,CAACI,QAAQ,CAAC,CAAC;EAC5B;AACF","ignoreList":[]}
@@ -1,3 +1,6 @@
1
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
2
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
1
4
  import { CanvasKitWebGLBufferImpl } from "./CanvasKitWebGLBufferImpl";
2
5
  import { JsiSkImageFactory } from "./JsiSkImageFactory";
3
6
  export const createVideo = async (CanvasKit, url) => {
@@ -17,11 +20,11 @@ export const createVideo = async (CanvasKit, url) => {
17
20
  });
18
21
  };
19
22
  export class JsiVideo {
20
- __typename__ = "Video";
21
- webglBuffer = null;
22
23
  constructor(ImageFactory, videoElement) {
23
24
  this.ImageFactory = ImageFactory;
24
25
  this.videoElement = videoElement;
26
+ _defineProperty(this, "__typename__", "Video");
27
+ _defineProperty(this, "webglBuffer", null);
25
28
  document.body.appendChild(this.videoElement);
26
29
  }
27
30
  duration() {
@@ -1 +1 @@
1
- {"version":3,"names":["CanvasKitWebGLBufferImpl","JsiSkImageFactory","createVideo","CanvasKit","url","video","document","createElement","Promise","resolve","reject","src","style","display","crossOrigin","volume","addEventListener","body","appendChild","JsiVideo","Error","__typename__","webglBuffer","constructor","ImageFactory","videoElement","duration","framerate","setSurface","surface","nextImage","MakeImageFromNativeBuffer","seek","time","isNaN","currentTime","rotation","size","width","videoWidth","height","videoHeight","pause","play","setVolume","dispose","parentNode","removeChild"],"sources":["JsiVideo.ts"],"sourcesContent":["import type { CanvasKit, Surface } from \"canvaskit-wasm\";\n\nimport type { CanvasKitWebGLBuffer, Video, ImageFactory } from \"../types\";\n\nimport { CanvasKitWebGLBufferImpl } from \"./CanvasKitWebGLBufferImpl\";\nimport { JsiSkImageFactory } from \"./JsiSkImageFactory\";\n\nexport const createVideo = async (\n CanvasKit: CanvasKit,\n url: string\n): Promise<Video> => {\n const video = document.createElement(\"video\");\n return new Promise((resolve, reject) => {\n video.src = url;\n video.style.display = \"none\";\n video.crossOrigin = \"anonymous\";\n video.volume = 0;\n video.addEventListener(\"loadedmetadata\", () => {\n document.body.appendChild(video);\n resolve(new JsiVideo(new JsiSkImageFactory(CanvasKit), video));\n });\n video.addEventListener(\"error\", () => {\n reject(new Error(`Failed to load video from URL: ${url}`));\n });\n });\n};\n\nexport class JsiVideo implements Video {\n __typename__ = \"Video\" as const;\n\n private webglBuffer: CanvasKitWebGLBuffer | null = null;\n\n constructor(\n private ImageFactory: ImageFactory,\n private videoElement: HTMLVideoElement\n ) {\n document.body.appendChild(this.videoElement);\n }\n\n duration() {\n return this.videoElement.duration * 1000;\n }\n\n framerate(): number {\n throw new Error(\"Video.frame is not available on React Native Web\");\n }\n\n setSurface(surface: Surface) {\n // If we have the surface, we can use the WebGL buffer which is slightly faster\n // This is because WebGL cannot be shared across contextes.\n // This can be removed with WebGPU\n this.webglBuffer = new CanvasKitWebGLBufferImpl(surface, this.videoElement);\n }\n\n nextImage() {\n return this.ImageFactory.MakeImageFromNativeBuffer(\n this.webglBuffer ? this.webglBuffer : this.videoElement\n );\n }\n\n seek(time: number) {\n if (isNaN(time)) {\n throw new Error(`Invalid time: ${time}`);\n }\n this.videoElement.currentTime = time / 1000;\n }\n\n rotation() {\n return 0 as const;\n }\n\n size() {\n return {\n width: this.videoElement.videoWidth,\n height: this.videoElement.videoHeight,\n };\n }\n\n pause() {\n this.videoElement.pause();\n }\n\n play() {\n this.videoElement.play();\n }\n\n setVolume(volume: number) {\n this.videoElement.volume = volume;\n }\n\n dispose() {\n if (this.videoElement.parentNode) {\n this.videoElement.parentNode.removeChild(this.videoElement);\n }\n }\n}\n"],"mappings":"AAIA,SAASA,wBAAwB,QAAQ,4BAA4B;AACrE,SAASC,iBAAiB,QAAQ,qBAAqB;AAEvD,OAAO,MAAMC,WAAW,GAAG,MAAAA,CACzBC,SAAoB,EACpBC,GAAW,KACQ;EACnB,MAAMC,KAAK,GAAGC,QAAQ,CAACC,aAAa,CAAC,OAAO,CAAC;EAC7C,OAAO,IAAIC,OAAO,CAAC,CAACC,OAAO,EAAEC,MAAM,KAAK;IACtCL,KAAK,CAACM,GAAG,GAAGP,GAAG;IACfC,KAAK,CAACO,KAAK,CAACC,OAAO,GAAG,MAAM;IAC5BR,KAAK,CAACS,WAAW,GAAG,WAAW;IAC/BT,KAAK,CAACU,MAAM,GAAG,CAAC;IAChBV,KAAK,CAACW,gBAAgB,CAAC,gBAAgB,EAAE,MAAM;MAC7CV,QAAQ,CAACW,IAAI,CAACC,WAAW,CAACb,KAAK,CAAC;MAChCI,OAAO,CAAC,IAAIU,QAAQ,CAAC,IAAIlB,iBAAiB,CAACE,SAAS,CAAC,EAAEE,KAAK,CAAC,CAAC;IAChE,CAAC,CAAC;IACFA,KAAK,CAACW,gBAAgB,CAAC,OAAO,EAAE,MAAM;MACpCN,MAAM,CAAC,IAAIU,KAAK,CAAC,kCAAkChB,GAAG,EAAE,CAAC,CAAC;IAC5D,CAAC,C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ACjB,YAAY,CAACiB,KAAK,CAAC,CAAC;EAC3B;EAEAC,IAAIA,CAAA,EAAG;IACL,IAAI,CAAClB,YAAY,CAACkB,IAAI,CAAC,CAAC;EAC1B;EAEAC,SAASA,CAAC7B,MAAc,EAAE;IACxB,IAAI,CAACU,YAAY,CAACV,MAAM,GAAGA,MAAM;EACnC;EAEA8B,OAAOA,CAAA,EAAG;IACR,IAAI,IAAI,CAACpB,YAAY,CAACqB,UAAU,EAAE;MAChC,IAAI,CAACrB,YAAY,CAACqB,UAAU,CAACC,WAAW,CAAC,IAAI,CAACtB,YAAY,CAAC;IAC7D;EACF;AACF","ignoreList":[]}
1
+ {"version":3,"names":["CanvasKitWebGLBufferImpl","JsiSkImageFactory","createVideo","CanvasKit","url","video","document","createElement","Promise","resolve","reject","src","style","display","crossOrigin","volume","addEventListener","body","appendChild","JsiVideo","Error","constructor","ImageFactory","videoElement","_defineProperty","duration","framerate","setSurface","surface","webglBuffer","nextImage","MakeImageFromNativeBuffer","seek","time","isNaN","currentTime","rotation","size","width","videoWidth","height","videoHeight","pause","play","setVolume","dispose","parentNode","removeChild"],"sources":["JsiVideo.ts"],"sourcesContent":["import type { CanvasKit, Surface } from \"canvaskit-wasm\";\n\nimport type { CanvasKitWebGLBuffer, Video, ImageFactory } from \"../types\";\n\nimport { CanvasKitWebGLBufferImpl } from \"./CanvasKitWebGLBufferImpl\";\nimport { JsiSkImageFactory } from \"./JsiSkImageFactory\";\n\nexport const createVideo = async (\n CanvasKit: CanvasKit,\n url: string\n): Promise<Video> => {\n const video = document.createElement(\"video\");\n return new Promise((resolve, reject) => {\n video.src = url;\n video.style.display = \"none\";\n video.crossOrigin = \"anonymous\";\n video.volume = 0;\n video.addEventListener(\"loadedmetadata\", () => {\n document.body.appendChild(video);\n resolve(new JsiVideo(new JsiSkImageFactory(CanvasKit), video));\n });\n video.addEventListener(\"error\", () => {\n reject(new Error(`Failed to load video from URL: ${url}`));\n });\n });\n};\n\nexport class JsiVideo implements Video {\n __typename__ = \"Video\" as const;\n\n private webglBuffer: CanvasKitWebGLBuffer | null = null;\n\n constructor(\n private ImageFactory: ImageFactory,\n private videoElement: HTMLVideoElement\n ) {\n document.body.appendChild(this.videoElement);\n }\n\n duration() {\n return this.videoElement.duration * 1000;\n }\n\n framerate(): number {\n throw new Error(\"Video.frame is not available on React Native Web\");\n }\n\n setSurface(surface: Surface) {\n // If we have the surface, we can use the WebGL buffer which is slightly faster\n // This is because WebGL cannot be shared across contextes.\n // This can be removed with WebGPU\n this.webglBuffer = new CanvasKitWebGLBufferImpl(surface, this.videoElement);\n }\n\n nextImage() {\n return this.ImageFactory.MakeImageFromNativeBuffer(\n this.webglBuffer ? this.webglBuffer : this.videoElement\n );\n }\n\n seek(time: number) {\n if (isNaN(time)) {\n throw new Error(`Invalid time: ${time}`);\n }\n this.videoElement.currentTime = time / 1000;\n }\n\n rotation() {\n return 0 as const;\n }\n\n size() {\n return {\n width: this.videoElement.videoWidth,\n height: this.videoElement.videoHeight,\n };\n }\n\n pause() {\n this.videoElement.pause();\n }\n\n play() {\n this.videoElement.play();\n }\n\n setVolume(volume: number) {\n this.videoElement.volume = volume;\n }\n\n dispose() {\n if (this.videoElement.parentNode) {\n this.videoElement.parentNode.removeChild(this.videoElement);\n }\n }\n}\n"],"mappings":";;;AAIA,SAASA,wBAAwB,QAAQ,4BAA4B;AACrE,SAASC,iBAAiB,QAAQ,qBAAqB;AAEvD,OAAO,MAAMC,WAAW,GAAG,MAAAA,CACzBC,SAAoB,EACpBC,GAAW,KACQ;EACnB,MAAMC,KAAK,GAAGC,QAAQ,CAACC,aAAa,CAAC,OAAO,CAAC;EAC7C,OAAO,IAAIC,OAAO,CAAC,CAACC,OAAO,EAAEC,MAAM,KAAK;IACtCL,KAAK,CAACM,GAAG,GAAGP,GAAG;IACfC,KAAK,CAACO,KAAK,CAACC,OAAO,GAAG,MAAM;IAC5BR,KAAK,CAACS,WAAW,GAAG,WAAW;IAC/BT,KAAK,CAACU,MAAM,GA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AC,EAAE;MACf,MAAM,IAAIb,KAAK,CAAC,iBAAiBa,IAAI,EAAE,CAAC;IAC1C;IACA,IAAI,CAACV,YAAY,CAACY,WAAW,GAAGF,IAAI,GAAG,IAAI;EAC7C;EAEAG,QAAQA,CAAA,EAAG;IACT,OAAO,CAAC;EACV;EAEAC,IAAIA,CAAA,EAAG;IACL,OAAO;MACLC,KAAK,EAAE,IAAI,CAACf,YAAY,CAACgB,UAAU;MACnCC,MAAM,EAAE,IAAI,CAACjB,YAAY,CAACkB;IAC5B,CAAC;EACH;EAEAC,KAAKA,CAAA,EAAG;IACN,IAAI,CAACnB,YAAY,CAACmB,KAAK,CAAC,CAAC;EAC3B;EAEAC,IAAIA,CAAA,EAAG;IACL,IAAI,CAACpB,YAAY,CAACoB,IAAI,CAAC,CAAC;EAC1B;EAEAC,SAASA,CAAC7B,MAAc,EAAE;IACxB,IAAI,CAACQ,YAAY,CAACR,MAAM,GAAGA,MAAM;EACnC;EAEA8B,OAAOA,CAAA,EAAG;IACR,IAAI,IAAI,CAACtB,YAAY,CAACuB,UAAU,EAAE;MAChC,IAAI,CAACvB,YAAY,CAACuB,UAAU,CAACC,WAAW,CAAC,IAAI,CAACxB,YAAY,CAAC;IAC7D;EACF;AACF","ignoreList":[]}
@@ -1,3 +1,6 @@
1
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
2
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
1
4
  import Rea from "../external/reanimated/ReanimatedProxy";
2
5
  import { HAS_REANIMATED_3 } from "../external/reanimated/renderHelpers";
3
6
  import { Recorder } from "./Recorder/Recorder";
@@ -30,12 +33,12 @@ const nativeDrawOnscreen = (nativeId, recorder) => {
30
33
  SkiaViewApi.setJsiProperty(nativeId, "picture", picture);
31
34
  };
32
35
  export class Container {
33
- _root = [];
34
- recording = null;
35
- unmounted = false;
36
36
  constructor(Skia, nativeId) {
37
37
  this.Skia = Skia;
38
38
  this.nativeId = nativeId;
39
+ _defineProperty(this, "_root", []);
40
+ _defineProperty(this, "recording", null);
41
+ _defineProperty(this, "unmounted", false);
39
42
  }
40
43
  get root() {
41
44
  return this._root;
@@ -73,9 +76,9 @@ class StaticContainer extends Container {
73
76
  }
74
77
  }
75
78
  class ReanimatedContainer extends Container {
76
- mapperId = null;
77
79
  constructor(Skia, nativeId) {
78
80
  super(Skia, nativeId);
81
+ _defineProperty(this, "mapperId", null);
79
82
  }
80
83
  redraw() {
81
84
  if (this.mapperId !== null) {
@@ -114,9 +117,9 @@ class ReanimatedContainer extends Container {
114
117
  }
115
118
  }
116
119
  class NativeReanimatedContainer extends Container {
117
- mapperId = null;
118
120
  constructor(Skia, nativeId) {
119
121
  super(Skia, nativeId);
122
+ _defineProperty(this, "mapperId", null);
120
123
  }
121
124
  redraw() {
122
125
  if (this.mapperId !== null) {
@@ -1 +1 @@
1
- {"version":3,"names":["Rea","HAS_REANIMATED_3","Recorder","visit","replay","createDrawingContext","ReanimatedRecorder","drawOnscreen","Skia","nativeId","recording","rec","PictureRecorder","canvas","beginRecording","ctx","paintPool","commands","picture","finishRecordingAsPicture","SkiaViewApi","setJsiProperty","nativeDrawOnscreen","recorder","play","Container","_root","unmounted","constructor","root","value","unmount","drawOnCanvas","Error","StaticContainer","redraw","getRecording","isOnScreen","ReanimatedContainer","mapperId","stopMapper","record","animationValues","size","startMapper","Array","from","runOnUI","NativeReanimatedContainer","sharedValues","getSharedValues","sharedRecorder","getRecorder","length","applyUpdates","createContainer","web","global"],"sources":["Container.ts"],"sourcesContent":["import Rea from \"../external/reanimated/ReanimatedProxy\";\nimport type { Skia, SkCanvas } from \"../skia/types\";\nimport { HAS_REANIMATED_3 } from \"../external/reanimated/renderHelpers\";\nimport type { JsiRecorder } from \"../skia/types/Recorder\";\n\nimport type { Node } from \"./Node\";\nimport type { Recording } from \"./Recorder/Recorder\";\nimport { Recorder } from \"./Recorder/Recorder\";\nimport { visit } from \"./Recorder/Visitor\";\nimport { replay } from \"./Recorder/Player\";\nimport { createDrawingContext } from \"./Recorder/DrawingContext\";\nimport { ReanimatedRecorder } from \"./Recorder/ReanimatedRecorder\";\n\nimport \"../views/api\";\n\nconst drawOnscreen = (Skia: Skia, nativeId: number, recording: Recording) => {\n \"worklet\";\n\n const rec = Skia.PictureRecorder();\n const canvas = rec.beginRecording();\n //const start = performance.now();\n\n const ctx = createDrawingContext(Skia, recording.paintPool, canvas);\n replay(ctx, recording.commands);\n const picture = rec.finishRecordingAsPicture();\n //const end = performance.now();\n //console.log(\"Recording time: \", end - start);\n SkiaViewApi.setJsiProperty(nativeId, \"picture\", picture);\n};\n\nconst nativeDrawOnscreen = (nativeId: number, recorder: JsiRecorder) => {\n \"worklet\";\n\n //const start = performance.now();\n\n const picture = recorder.play();\n //const end = performance.now();\n //console.log(\"Recording time: \", end - start);\n SkiaViewApi.setJsiProperty(nativeId, \"picture\", picture);\n};\n\nexport abstract class Container {\n private _root: Node[] = [];\n protected recording: Recording | null = null;\n protected unmounted = false;\n\n constructor(protected Skia: Skia, protected nativeId: number) {}\n\n get root() {\n return this._root;\n }\n\n set root(value: Node[]) {\n this._root = value;\n }\n\n unmount() {\n this.unmounted = true;\n }\n\n drawOnCanvas(canvas: SkCanvas) {\n if (!this.recording) {\n throw new Error(\"No recording to draw\");\n }\n const ctx = createDrawingContext(\n this.Skia,\n this.recording.paintPool,\n canvas\n );\n replay(ctx, this.recording.commands);\n }\n\n abstract redraw(): void;\n}\n\nclass StaticContainer extends Container {\n constructor(Skia: Skia, nativeId: number) {\n super(Skia, nativeId);\n }\n\n redraw() {\n const recorder = new Recorder();\n visit(recorder, this.root);\n this.recording = recorder.getRecording();\n const isOnScreen = this.nativeId !== -1;\n if (isOnScreen) {\n const rec = this.Skia.PictureRecorder();\n const canvas = rec.beginRecording();\n this.drawOnCanvas(canvas);\n const picture = rec.finishRecordingAsPicture();\n SkiaViewApi.setJsiProperty(this.nativeId, \"picture\", picture);\n }\n }\n}\n\nclass ReanimatedContainer extends Container {\n private mapperId: number | null = null;\n\n constructor(Skia: Skia, nativeId: number) {\n super(Skia, nativeId);\n }\n\n redraw() {\n if (this.mapperId !== null) {\n Rea.stopMapper(this.mapperId);\n }\n if (this.unmounted) {\n return;\n }\n const recorder = new Recorder();\n visit(recorder, this.root);\n const record = recorder.getRecording();\n const { animationValues } = record;\n this.recording = {\n commands: record.commands,\n paintPool: record.paintPool,\n };\n const { nativeId, Skia, recording } = this;\n if (animationValues.size > 0) {\n this.mapperId = Rea.startMapper(() => {\n \"worklet\";\n drawOnscreen(Skia, nativeId, recording!);\n }, Array.from(animationValues));\n }\n Rea.runOnUI(() => {\n \"worklet\";\n drawOnscreen(Skia, nativeId, recording!);\n })();\n }\n}\n\nclass NativeReanimatedContainer extends Container {\n private mapperId: number | null = null;\n\n constructor(Skia: Skia, nativeId: number) {\n super(Skia, nativeId);\n }\n\n redraw() {\n if (this.mapperId !== null) {\n Rea.stopMapper(this.mapperId);\n }\n if (this.unmounted) {\n return;\n }\n const { nativeId, Skia } = this;\n const recorder = new ReanimatedRecorder(Skia);\n visit(recorder, this.root);\n const sharedValues = recorder.getSharedValues();\n const sharedRecorder = recorder.getRecorder();\n Rea.runOnUI(() => {\n \"worklet\";\n nativeDrawOnscreen(nativeId, sharedRecorder);\n })();\n if (sharedValues.length > 0) {\n this.mapperId = Rea.startMapper(() => {\n \"worklet\";\n sharedRecorder.applyUpdates(sharedValues);\n nativeDrawOnscreen(nativeId, sharedRecorder);\n }, sharedValues);\n }\n }\n}\n\nexport const createContainer = (Skia: Skia, nativeId: number) => {\n const web = global.SkiaViewApi && global.SkiaViewApi.web;\n if (HAS_REANIMATED_3 && nativeId !== -1) {\n if (!web) {\n return new NativeReanimatedContainer(Skia, nativeId);\n } else {\n return new ReanimatedContainer(Skia, nativeId);\n }\n } else {\n return new StaticContainer(Skia, nativeId);\n }\n};\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,wCAAwC;AAExD,SAASC,gBAAgB,QAAQ,sCAAsC;AAKvE,SAASC,QAAQ,QAAQ,qBAAqB;AAC9C,SAASC,KAAK,QAAQ,oBAAoB;AAC1C,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,oBAAoB,QAAQ,2BAA2B;AAChE,SAASC,kBAAkB,QAAQ,+BAA+B;AAElE,OAAO,cAAc;AAErB,MAAMC,YAAY,GAAGA,CAACC,IAAU,EAAEC,QAAgB,EAAEC,SAAoB,KAAK;EAC3E,SAAS;;EAET,MAAMC,GAAG,GAAGH,IAAI,CAACI,eAAe,CAAC,CAAC;EAClC,MAAMC,MAAM,GAAGF,GAAG,CAACG,cAAc,CAAC,CAAC;EACnC;;EAEA,MAAMC,GAAG,GAAGV,oBAAoB,CAACG,IAAI,EAAEE,SAAS,CAACM,SAAS,EAAEH,MAAM,CAAC;EACnET,MAAM,CAACW,GAAG,EAAEL,SAAS,CAACO,QAAQ,CAAC;EAC/B,MAAMC,OAAO,GAAGP,GAAG,CAACQ,wBAAwB,CAAC,CAAC;EAC9C;EACA;EACAC,WAAW,CAACC,cAAc,CAACZ,QAAQ,EAAE,SAAS,EAAES,OAAO,CAAC;AAC1D,CAAC;AAED,MAAMI,kBAAkB,GAAGA,CAACb,QAAgB,EAAEc,QAAqB,KAAK;EACtE,SAAS;;EAET;EAEA,MAAML,OAAO,GAAGK,QAAQ,CAACC,IAAI,CAAC,CAAC;EAC/B;EACA;EACAJ,WAAW,CAACC,cAAc,CAACZ,QAAQ,EAAE,SAAS,EAAES,OAAO,CAAC;AAC1D,CAAC;AAED,OAAO,MAAeO,SAAS,CAAC;EACtBC,KAAK,GAAW,EAAE;E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9C,CAAC,EAAEF,YAAY,CAAC;IAClB;EACF;AACF;AAEA,OAAO,MAAMM,eAAe,GAAGA,CAAC/C,IAAU,EAAEC,QAAgB,KAAK;EAC/D,MAAM+C,GAAG,GAAGC,MAAM,CAACrC,WAAW,IAAIqC,MAAM,CAACrC,WAAW,CAACoC,GAAG;EACxD,IAAIvD,gBAAgB,IAAIQ,QAAQ,KAAK,CAAC,CAAC,EAAE;IACvC,IAAI,CAAC+C,GAAG,EAAE;MACR,OAAO,IAAIR,yBAAyB,CAACxC,IAAI,EAAEC,QAAQ,CAAC;IACtD,CAAC,MAAM;MACL,OAAO,IAAI6B,mBAAmB,CAAC9B,IAAI,EAAEC,QAAQ,CAAC;IAChD;EACF,CAAC,MAAM;IACL,OAAO,IAAIyB,eAAe,CAAC1B,IAAI,EAAEC,QAAQ,CAAC;EAC5C;AACF,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["Rea","HAS_REANIMATED_3","Recorder","visit","replay","createDrawingContext","ReanimatedRecorder","drawOnscreen","Skia","nativeId","recording","rec","PictureRecorder","canvas","beginRecording","ctx","paintPool","commands","picture","finishRecordingAsPicture","SkiaViewApi","setJsiProperty","nativeDrawOnscreen","recorder","play","Container","constructor","_defineProperty","root","_root","value","unmount","unmounted","drawOnCanvas","Error","StaticContainer","redraw","getRecording","isOnScreen","ReanimatedContainer","mapperId","stopMapper","record","animationValues","size","startMapper","Array","from","runOnUI","NativeReanimatedContainer","sharedValues","getSharedValues","sharedRecorder","getRecorder","length","applyUpdates","createContainer","web","global"],"sources":["Container.ts"],"sourcesContent":["import Rea from \"../external/reanimated/ReanimatedProxy\";\nimport type { Skia, SkCanvas } from \"../skia/types\";\nimport { HAS_REANIMATED_3 } from \"../external/reanimated/renderHelpers\";\nimport type { JsiRecorder } from \"../skia/types/Recorder\";\n\nimport type { Node } from \"./Node\";\nimport type { Recording } from \"./Recorder/Recorder\";\nimport { Recorder } from \"./Recorder/Recorder\";\nimport { visit } from \"./Recorder/Visitor\";\nimport { replay } from \"./Recorder/Player\";\nimport { createDrawingContext } from \"./Recorder/DrawingContext\";\nimport { ReanimatedRecorder } from \"./Recorder/ReanimatedRecorder\";\n\nimport \"../views/api\";\n\nconst drawOnscreen = (Skia: Skia, nativeId: number, recording: Recording) => {\n \"worklet\";\n\n const rec = Skia.PictureRecorder();\n const canvas = rec.beginRecording();\n //const start = performance.now();\n\n const ctx = createDrawingContext(Skia, recording.paintPool, canvas);\n replay(ctx, recording.commands);\n const picture = rec.finishRecordingAsPicture();\n //const end = performance.now();\n //console.log(\"Recording time: \", end - start);\n SkiaViewApi.setJsiProperty(nativeId, \"picture\", picture);\n};\n\nconst nativeDrawOnscreen = (nativeId: number, recorder: JsiRecorder) => {\n \"worklet\";\n\n //const start = performance.now();\n\n const picture = recorder.play();\n //const end = performance.now();\n //console.log(\"Recording time: \", end - start);\n SkiaViewApi.setJsiProperty(nativeId, \"picture\", picture);\n};\n\nexport abstract class Container {\n private _root: Node[] = [];\n protected recording: Recording | null = null;\n protected unmounted = false;\n\n constructor(protected Skia: Skia, protected nativeId: number) {}\n\n get root() {\n return this._root;\n }\n\n set root(value: Node[]) {\n this._root = value;\n }\n\n unmount() {\n this.unmounted = true;\n }\n\n drawOnCanvas(canvas: SkCanvas) {\n if (!this.recording) {\n throw new Error(\"No recording to draw\");\n }\n const ctx = createDrawingContext(\n this.Skia,\n this.recording.paintPool,\n canvas\n );\n replay(ctx, this.recording.commands);\n }\n\n abstract redraw(): void;\n}\n\nclass StaticContainer extends Container {\n constructor(Skia: Skia, nativeId: number) {\n super(Skia, nativeId);\n }\n\n redraw() {\n const recorder = new Recorder();\n visit(recorder, this.root);\n this.recording = recorder.getRecording();\n const isOnScreen = this.nativeId !== -1;\n if (isOnScreen) {\n const rec = this.Skia.PictureRecorder();\n const canvas = rec.beginRecording();\n this.drawOnCanvas(canvas);\n const picture = rec.finishRecordingAsPicture();\n SkiaViewApi.setJsiProperty(this.nativeId, \"picture\", picture);\n }\n }\n}\n\nclass ReanimatedContainer extends Container {\n private mapperId: number | null = null;\n\n constructor(Skia: Skia, nativeId: number) {\n super(Skia, nativeId);\n }\n\n redraw() {\n if (this.mapperId !== null) {\n Rea.stopMapper(this.mapperId);\n }\n if (this.unmounted) {\n return;\n }\n const recorder = new Recorder();\n visit(recorder, this.root);\n const record = recorder.getRecording();\n const { animationValues } = record;\n this.recording = {\n commands: record.commands,\n paintPool: record.paintPool,\n };\n const { nativeId, Skia, recording } = this;\n if (animationValues.size > 0) {\n this.mapperId = Rea.startMapper(() => {\n \"worklet\";\n drawOnscreen(Skia, nativeId, recording!);\n }, Array.from(animationValues));\n }\n Rea.runOnUI(() => {\n \"worklet\";\n drawOnscreen(Skia, nativeId, recording!);\n })();\n }\n}\n\nclass NativeReanimatedContainer extends Container {\n private mapperId: number | null = null;\n\n constructor(Skia: Skia, nativeId: number) {\n super(Skia, nativeId);\n }\n\n redraw() {\n if (this.mapperId !== null) {\n Rea.stopMapper(this.mapperId);\n }\n if (this.unmounted) {\n return;\n }\n const { nativeId, Skia } = this;\n const recorder = new ReanimatedRecorder(Skia);\n visit(recorder, this.root);\n const sharedValues = recorder.getSharedValues();\n const sharedRecorder = recorder.getRecorder();\n Rea.runOnUI(() => {\n \"worklet\";\n nativeDrawOnscreen(nativeId, sharedRecorder);\n })();\n if (sharedValues.length > 0) {\n this.mapperId = Rea.startMapper(() => {\n \"worklet\";\n sharedRecorder.applyUpdates(sharedValues);\n nativeDrawOnscreen(nativeId, sharedRecorder);\n }, sharedValues);\n }\n }\n}\n\nexport const createContainer = (Skia: Skia, nativeId: number) => {\n const web = global.SkiaViewApi && global.SkiaViewApi.web;\n if (HAS_REANIMATED_3 && nativeId !== -1) {\n if (!web) {\n return new NativeReanimatedContainer(Skia, nativeId);\n } else {\n return new ReanimatedContainer(Skia, nativeId);\n }\n } else {\n return new StaticContainer(Skia, nativeId);\n }\n};\n"],"mappings":";;;AAAA,OAAOA,GAAG,MAAM,wCAAwC;AAExD,SAASC,gBAAgB,Q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,KAAK,CAAC,CAAC,EAAE;IACvC,IAAI,CAACgD,GAAG,EAAE;MACR,OAAO,IAAIR,yBAAyB,CAACzC,IAAI,EAAEC,QAAQ,CAAC;IACtD,CAAC,MAAM;MACL,OAAO,IAAI8B,mBAAmB,CAAC/B,IAAI,EAAEC,QAAQ,CAAC;IAChD;EACF,CAAC,MAAM;IACL,OAAO,IAAI0B,eAAe,CAAC3B,IAAI,EAAEC,QAAQ,CAAC;EAC5C;AACF,CAAC","ignoreList":[]}
@@ -1,6 +1,6 @@
1
1
  import type { FractalNoiseProps, CircleProps, DrawingNodeProps, ImageProps, PaintProps, PathProps, LineProps, OvalProps, DiffRectProps, PointsProps, RectProps, RoundedRectProps, TextProps, VerticesProps, BlurMaskFilterProps, BlendImageFilterProps, BlurImageFilterProps, DisplacementMapImageFilterProps, DropShadowImageFilterProps, OffsetImageFilterProps, RuntimeShaderImageFilterProps, MatrixColorFilterProps, ShaderProps, ImageShaderProps, LinearGradientProps, GroupProps, PatchProps, BlendColorFilterProps, DashPathEffectProps, DiscretePathEffectProps, CornerPathEffectProps, Line2DPathEffectProps, Path1DPathEffectProps, Path2DPathEffectProps, TextPathProps, TextBlobProps, GlyphsProps, TwoPointConicalGradientProps, TurbulenceProps, SweepGradientProps, RadialGradientProps, ColorProps, PictureProps, ImageSVGProps, LerpColorFilterProps, BoxProps, BoxShadowProps, ParagraphProps, AtlasProps, ChildrenProps, MorphologyImageFilterProps, BlendProps } from "../dom/types";
2
2
  import type { SkiaProps } from "../renderer";
3
- declare global {
3
+ declare module "react" {
4
4
  namespace JSX {
5
5
  interface IntrinsicElements {
6
6
  skGroup: SkiaProps<GroupProps>;
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["Elements.tsx"],"sourcesContent":["import type {\n FractalNoiseProps,\n CircleProps,\n DrawingNodeProps,\n ImageProps,\n PaintProps,\n PathProps,\n LineProps,\n OvalProps,\n DiffRectProps,\n PointsProps,\n RectProps,\n RoundedRectProps,\n TextProps,\n VerticesProps,\n BlurMaskFilterProps,\n BlendImageFilterProps,\n BlurImageFilterProps,\n DisplacementMapImageFilterProps,\n DropShadowImageFilterProps,\n OffsetImageFilterProps,\n RuntimeShaderImageFilterProps,\n MatrixColorFilterProps,\n ShaderProps,\n ImageShaderProps,\n LinearGradientProps,\n GroupProps,\n PatchProps,\n BlendColorFilterProps,\n DashPathEffectProps,\n DiscretePathEffectProps,\n CornerPathEffectProps,\n Line2DPathEffectProps,\n Path1DPathEffectProps,\n Path2DPathEffectProps,\n TextPathProps,\n TextBlobProps,\n GlyphsProps,\n TwoPointConicalGradientProps,\n TurbulenceProps,\n SweepGradientProps,\n RadialGradientProps,\n ColorProps,\n PictureProps,\n ImageSVGProps,\n LerpColorFilterProps,\n BoxProps,\n BoxShadowProps,\n ParagraphProps,\n AtlasProps,\n ChildrenProps,\n MorphologyImageFilterProps,\n BlendProps,\n} from \"../dom/types\";\nimport type { SkiaProps } from \"../renderer\";\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace JSX {\n interface IntrinsicElements {\n skGroup: SkiaProps<GroupProps>;\n skLayer: SkiaProps<ChildrenProps>;\n skPaint: SkiaProps<PaintProps>;\n\n // Drawings\n skFill: SkiaProps<DrawingNodeProps>;\n skImage: SkiaProps<ImageProps>;\n skCircle: SkiaProps<CircleProps>;\n skPath: SkiaProps<PathProps>;\n skLine: SkiaProps<LineProps>;\n skOval: SkiaProps<OvalProps>;\n skPatch: SkiaProps<PatchProps>;\n skPoints: SkiaProps<PointsProps>;\n skRect: SkiaProps<RectProps>;\n skRRect: SkiaProps<RoundedRectProps>;\n skAtlas: SkiaProps<AtlasProps>;\n skVertices: SkiaProps<VerticesProps>;\n skText: SkiaProps<TextProps>;\n skTextPath: SkiaProps<TextPathProps>;\n skTextBlob: SkiaProps<TextBlobProps>;\n skGlyphs: SkiaProps<GlyphsProps>;\n skDiffRect: SkiaProps<DiffRectProps>;\n skPicture: SkiaProps<PictureProps>;\n skImageSVG: SkiaProps<ImageSVGProps>;\n\n // BlurMaskFilters\n skBlurMaskFilter: SkiaProps<BlurMaskFilterProps>;\n\n // ImageFilters\n skBlendImageFilter: SkiaProps<BlendImageFilterProps>;\n skBlurImageFilter: SkiaProps<BlurImageFilterProps>;\n skOffsetImageFilter: SkiaProps<OffsetImageFilterProps>;\n skDropShadowImageFilter: SkiaProps<DropShadowImageFilterProps>;\n skDisplacementMapImageFilter: SkiaProps<DisplacementMapImageFilterProps>;\n skRuntimeShaderImageFilter: SkiaProps<RuntimeShaderImageFilterProps>;\n skMorphologyImageFilter: SkiaProps<MorphologyImageFilterProps>;\n\n // ColorFilters\n skMatrixColorFilter: SkiaProps<MatrixColorFilterProps>;\n skBlendColorFilter: SkiaProps<BlendColorFilterProps>;\n skLinearToSRGBGammaColorFilter: SkiaProps<ChildrenProps>;\n skSRGBToLinearGammaColorFilter: SkiaProps<ChildrenProps>;\n skLumaColorFilter: SkiaProps<ChildrenProps>;\n skLerpColorFilter: SkiaProps<LerpColorFilterProps>;\n\n // Shaders\n skShader: SkiaProps<ShaderProps>;\n skImageShader: SkiaProps<ImageShaderProps>;\n skColorShader: SkiaProps<ColorProps>;\n skTurbulence: SkiaProps<TurbulenceProps>;\n skFractalNoise: SkiaProps<FractalNoiseProps>;\n skLinearGradient: SkiaProps<LinearGradientProps>;\n skRadialGradient: SkiaProps<RadialGradientProps>;\n skSweepGradient: SkiaProps<SweepGradientProps>;\n skTwoPointConicalGradient: SkiaProps<TwoPointConicalGradientProps>;\n\n // Path Effects\n skDiscretePathEffect: SkiaProps<DiscretePathEffectProps>;\n skDashPathEffect: SkiaProps<DashPathEffectProps>;\n skPath1DPathEffect: SkiaProps<Path1DPathEffectProps>;\n skPath2DPathEffect: SkiaProps<Path2DPathEffectProps>;\n skCornerPathEffect: SkiaProps<CornerPathEffectProps>;\n skSumPathEffect: ChildrenProps;\n skLine2DPathEffect: SkiaProps<Line2DPathEffectProps>;\n\n // Mixed declarations/drawings\n skBlend: SkiaProps<BlendProps>;\n skBackdropFilter: SkiaProps<ChildrenProps>;\n skBox: SkiaProps<BoxProps>;\n skBoxShadow: SkiaProps<BoxShadowProps>;\n\n // Paragraph\n skParagraph: SkiaProps<ParagraphProps>;\n }\n }\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["Elements.tsx"],"sourcesContent":["import type {\n FractalNoiseProps,\n CircleProps,\n DrawingNodeProps,\n ImageProps,\n PaintProps,\n PathProps,\n LineProps,\n OvalProps,\n DiffRectProps,\n PointsProps,\n RectProps,\n RoundedRectProps,\n TextProps,\n VerticesProps,\n BlurMaskFilterProps,\n BlendImageFilterProps,\n BlurImageFilterProps,\n DisplacementMapImageFilterProps,\n DropShadowImageFilterProps,\n OffsetImageFilterProps,\n RuntimeShaderImageFilterProps,\n MatrixColorFilterProps,\n ShaderProps,\n ImageShaderProps,\n LinearGradientProps,\n GroupProps,\n PatchProps,\n BlendColorFilterProps,\n DashPathEffectProps,\n DiscretePathEffectProps,\n CornerPathEffectProps,\n Line2DPathEffectProps,\n Path1DPathEffectProps,\n Path2DPathEffectProps,\n TextPathProps,\n TextBlobProps,\n GlyphsProps,\n TwoPointConicalGradientProps,\n TurbulenceProps,\n SweepGradientProps,\n RadialGradientProps,\n ColorProps,\n PictureProps,\n ImageSVGProps,\n LerpColorFilterProps,\n BoxProps,\n BoxShadowProps,\n ParagraphProps,\n AtlasProps,\n ChildrenProps,\n MorphologyImageFilterProps,\n BlendProps,\n} from \"../dom/types\";\nimport type { SkiaProps } from \"../renderer\";\n\ndeclare module \"react\" {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace JSX {\n interface IntrinsicElements {\n skGroup: SkiaProps<GroupProps>;\n skLayer: SkiaProps<ChildrenProps>;\n skPaint: SkiaProps<PaintProps>;\n\n // Drawings\n skFill: SkiaProps<DrawingNodeProps>;\n skImage: SkiaProps<ImageProps>;\n skCircle: SkiaProps<CircleProps>;\n skPath: SkiaProps<PathProps>;\n skLine: SkiaProps<LineProps>;\n skOval: SkiaProps<OvalProps>;\n skPatch: SkiaProps<PatchProps>;\n skPoints: SkiaProps<PointsProps>;\n skRect: SkiaProps<RectProps>;\n skRRect: SkiaProps<RoundedRectProps>;\n skAtlas: SkiaProps<AtlasProps>;\n skVertices: SkiaProps<VerticesProps>;\n skText: SkiaProps<TextProps>;\n skTextPath: SkiaProps<TextPathProps>;\n skTextBlob: SkiaProps<TextBlobProps>;\n skGlyphs: SkiaProps<GlyphsProps>;\n skDiffRect: SkiaProps<DiffRectProps>;\n skPicture: SkiaProps<PictureProps>;\n skImageSVG: SkiaProps<ImageSVGProps>;\n\n // BlurMaskFilters\n skBlurMaskFilter: SkiaProps<BlurMaskFilterProps>;\n\n // ImageFilters\n skBlendImageFilter: SkiaProps<BlendImageFilterProps>;\n skBlurImageFilter: SkiaProps<BlurImageFilterProps>;\n skOffsetImageFilter: SkiaProps<OffsetImageFilterProps>;\n skDropShadowImageFilter: SkiaProps<DropShadowImageFilterProps>;\n skDisplacementMapImageFilter: SkiaProps<DisplacementMapImageFilterProps>;\n skRuntimeShaderImageFilter: SkiaProps<RuntimeShaderImageFilterProps>;\n skMorphologyImageFilter: SkiaProps<MorphologyImageFilterProps>;\n\n // ColorFilters\n skMatrixColorFilter: SkiaProps<MatrixColorFilterProps>;\n skBlendColorFilter: SkiaProps<BlendColorFilterProps>;\n skLinearToSRGBGammaColorFilter: SkiaProps<ChildrenProps>;\n skSRGBToLinearGammaColorFilter: SkiaProps<ChildrenProps>;\n skLumaColorFilter: SkiaProps<ChildrenProps>;\n skLerpColorFilter: SkiaProps<LerpColorFilterProps>;\n\n // Shaders\n skShader: SkiaProps<ShaderProps>;\n skImageShader: SkiaProps<ImageShaderProps>;\n skColorShader: SkiaProps<ColorProps>;\n skTurbulence: SkiaProps<TurbulenceProps>;\n skFractalNoise: SkiaProps<FractalNoiseProps>;\n skLinearGradient: SkiaProps<LinearGradientProps>;\n skRadialGradient: SkiaProps<RadialGradientProps>;\n skSweepGradient: SkiaProps<SweepGradientProps>;\n skTwoPointConicalGradient: SkiaProps<TwoPointConicalGradientProps>;\n\n // Path Effects\n skDiscretePathEffect: SkiaProps<DiscretePathEffectProps>;\n skDashPathEffect: SkiaProps<DashPathEffectProps>;\n skPath1DPathEffect: SkiaProps<Path1DPathEffectProps>;\n skPath2DPathEffect: SkiaProps<Path2DPathEffectProps>;\n skCornerPathEffect: SkiaProps<CornerPathEffectProps>;\n skSumPathEffect: ChildrenProps;\n skLine2DPathEffect: SkiaProps<Line2DPathEffectProps>;\n\n // Mixed declarations/drawings\n skBlend: SkiaProps<BlendProps>;\n skBackdropFilter: SkiaProps<ChildrenProps>;\n skBox: SkiaProps<BoxProps>;\n skBoxShadow: SkiaProps<BoxShadowProps>;\n\n // Paragraph\n skParagraph: SkiaProps<ParagraphProps>;\n }\n }\n}\n"],"mappings":"","ignoreList":[]}
@@ -2,7 +2,7 @@ import type { HostConfig } from "react-reconciler";
2
2
  import type { NodeType } from "../dom/types";
3
3
  import type { Node } from "./Node";
4
4
  import type { Container } from "./Container";
5
- export declare const debug: (message?: any, ...optionalParams: any[]) => void;
5
+ export declare const debug: (...args: Parameters<typeof console.log>) => void;
6
6
  type Instance = Node;
7
7
  type Props = object;
8
8
  type TextInstance = Node;
@@ -1,3 +1,6 @@
1
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
2
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
1
4
  import ReactReconciler from "react-reconciler";
2
5
  import { NodeType } from "../dom/types";
3
6
  import { debug, sksgHostConfig } from "./HostConfig";
@@ -12,6 +15,8 @@ skiaReconciler.injectIntoDevTools({
12
15
  export class SkiaSGRoot {
13
16
  constructor(Skia, nativeId = -1) {
14
17
  this.Skia = Skia;
18
+ _defineProperty(this, "root", void 0);
19
+ _defineProperty(this, "container", void 0);
15
20
  this.container = createContainer(Skia, nativeId);
16
21
  this.root = skiaReconciler.createContainer(this.container, 0, null, true, null, "", console.error, null);
17
22
  }
@@ -26,7 +31,6 @@ export class SkiaSGRoot {
26
31
  }
27
32
  updateContainer(element) {
28
33
  return new Promise(resolve => {
29
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
30
34
  skiaReconciler.updateContainer(element, this.root, null, () => {
31
35
  debug("updateContainer");
32
36
  resolve(true);
@@ -1 +1 @@
1
- {"version":3,"names":["ReactReconciler","NodeType","debug","sksgHostConfig","createContainer","skiaReconciler","injectIntoDevTools","bundleType","version","rendererPackageName","SkiaSGRoot","constructor","Skia","nativeId","container","root","console","error","sg","children","type","Group","props","isDeclaration","updateContainer","element","Promise","resolve","render","redraw","drawOnCanvas","canvas","getPicture","recorder","PictureRecorder","beginRecording","finishRecordingAsPicture","unmount"],"sources":["Reconciler.ts"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport type { OpaqueRoot } from \"react-reconciler\";\nimport ReactReconciler from \"react-reconciler\";\n\nimport type { SkCanvas, Skia } from \"../skia/types\";\nimport { NodeType } from \"../dom/types\";\n\nimport { debug, sksgHostConfig } from \"./HostConfig\";\nimport type { Container } from \"./Container\";\nimport { createContainer } from \"./Container\";\nimport \"./Elements\";\n\nconst skiaReconciler = ReactReconciler(sksgHostConfig);\n\nskiaReconciler.injectIntoDevTools({\n bundleType: 1,\n version: \"0.0.1\",\n rendererPackageName: \"react-native-skia\",\n});\n\nexport class SkiaSGRoot {\n private root: OpaqueRoot;\n private container: Container;\n\n constructor(public Skia: Skia, nativeId = -1) {\n this.container = createContainer(Skia, nativeId);\n this.root = skiaReconciler.createContainer(\n this.container,\n 0,\n null,\n true,\n null,\n \"\",\n console.error,\n null\n );\n }\n\n get sg() {\n const children = this.container.root;\n return { type: NodeType.Group, props: {}, children, isDeclaration: false };\n }\n\n private updateContainer(element: ReactNode) {\n return new Promise((resolve) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n skiaReconciler.updateContainer(element as any, this.root, null, () => {\n debug(\"updateContainer\");\n resolve(true);\n });\n });\n }\n\n async render(element: ReactNode) {\n await this.updateContainer(element);\n this.container.redraw();\n }\n\n drawOnCanvas(canvas: SkCanvas) {\n this.container.drawOnCanvas(canvas);\n }\n\n getPicture() {\n const recorder = this.Skia.PictureRecorder();\n const canvas = recorder.beginRecording();\n this.drawOnCanvas(canvas);\n return recorder.finishRecordingAsPicture();\n }\n\n unmount() {\n this.container.unmount();\n return new Promise((resolve) => {\n skiaReconciler.updateContainer(null, this.root, null, () => {\n debug(\"unmountContainer\");\n resolve(true);\n });\n });\n }\n}\n"],"mappings":"AAEA,OAAOA,eAAe,MAAM,kBAAkB;AAG9C,SAASC,QAAQ,QAAQ,cAAc;AAEvC,SAASC,KAAK,EAAEC,cAAc,QAAQ,cAAc;AAEpD,SAASC,eAAe,QAAQ,aAAa;AAC7C,OAAO,YAAY;AAEnB,MAAMC,cAAc,GAAGL,eAAe,CAACG,cAAc,CAAC;AAEtDE,cAAc,CAACC,kBAAkB,CAAC;EAChCC,UAAU,EAAE,CAAC;EACbC,OAAO,EAAE,OAAO;EAChBC,mBAAmB,EAAE;AACvB,CAAC,CAAC;AAEF,OAAO,MAAMC,UAAU,CAAC;EAItBC,WAAWA,CAAQC,IAAU,EAAEC,QAAQ,GAAG,CAAC,CAAC,EAAE;IAAA,KAA3BD,IAAU,GAAVA,IAAU;IAC3B,IAAI,CAACE,SAAS,GAAGV,eAAe,CAACQ,IAAI,EAAEC,QAAQ,CAAC;IAChD,IAAI,CAACE,IAAI,GAAGV,cAAc,CAACD,eAAe,CACxC,IAAI,CAACU,SAAS,EACd,CAAC,EACD,IAAI,EACJ,IAAI,EACJ,IAAI,E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IAAI,EAAE,IAAI,EAAE,MAAM;QAC1Db,KAAK,CAAC,kBAAkB,CAAC;QACzByB,OAAO,CAAC,IAAI,CAAC;MACf,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ;AACF","ignoreList":[]}
1
+ {"version":3,"names":["ReactReconciler","NodeType","debug","sksgHostConfig","createContainer","skiaReconciler","injectIntoDevTools","bundleType","version","rendererPackageName","SkiaSGRoot","constructor","Skia","nativeId","_defineProperty","container","root","console","error","sg","children","type","Group","props","isDeclaration","updateContainer","element","Promise","resolve","render","redraw","drawOnCanvas","canvas","getPicture","recorder","PictureRecorder","beginRecording","finishRecordingAsPicture","unmount"],"sources":["Reconciler.ts"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport type { OpaqueRoot } from \"react-reconciler\";\nimport ReactReconciler from \"react-reconciler\";\n\nimport type { SkCanvas, Skia } from \"../skia/types\";\nimport { NodeType } from \"../dom/types\";\n\nimport { debug, sksgHostConfig } from \"./HostConfig\";\nimport type { Container } from \"./Container\";\nimport { createContainer } from \"./Container\";\nimport \"./Elements\";\n\nconst skiaReconciler = ReactReconciler(sksgHostConfig);\n\nskiaReconciler.injectIntoDevTools({\n bundleType: 1,\n version: \"0.0.1\",\n rendererPackageName: \"react-native-skia\",\n});\n\nexport class SkiaSGRoot {\n private root: OpaqueRoot;\n private container: Container;\n\n constructor(public Skia: Skia, nativeId = -1) {\n this.container = createContainer(Skia, nativeId);\n this.root = skiaReconciler.createContainer(\n this.container,\n 0,\n null,\n true,\n null,\n \"\",\n console.error,\n null\n );\n }\n\n get sg() {\n const children = this.container.root;\n return { type: NodeType.Group, props: {}, children, isDeclaration: false };\n }\n\n private updateContainer(element: ReactNode) {\n return new Promise((resolve) => {\n skiaReconciler.updateContainer(element, this.root, null, () => {\n debug(\"updateContainer\");\n resolve(true);\n });\n });\n }\n\n async render(element: ReactNode) {\n await this.updateContainer(element);\n this.container.redraw();\n }\n\n drawOnCanvas(canvas: SkCanvas) {\n this.container.drawOnCanvas(canvas);\n }\n\n getPicture() {\n const recorder = this.Skia.PictureRecorder();\n const canvas = recorder.beginRecording();\n this.drawOnCanvas(canvas);\n return recorder.finishRecordingAsPicture();\n }\n\n unmount() {\n this.container.unmount();\n return new Promise((resolve) => {\n skiaReconciler.updateContainer(null, this.root, null, () => {\n debug(\"unmountContainer\");\n resolve(true);\n });\n });\n }\n}\n"],"mappings":";;;AAEA,OAAOA,eAAe,MAAM,kBAAkB;AAG9C,SAASC,QAAQ,QAAQ,cAAc;AAEvC,SAASC,KAAK,EAAEC,cAAc,QAAQ,cAAc;AAEpD,SAASC,eAAe,QAAQ,aAAa;AAC7C,OAAO,YAAY;AAEnB,MAAMC,cAAc,GAAGL,eAAe,CAACG,cAAc,CAAC;AAEtDE,cAAc,CAACC,kBAAkB,CAAC;EAChCC,UAAU,EAAE,CAAC;EACbC,OAAO,EAAE,OAAO;EAChBC,mBAAmB,EAAE;AACvB,CAAC,CAAC;AAEF,OAAO,MAAMC,UAAU,CAAC;EAItBC,WAAWA,CAAQC,IAAU,EAAEC,QAAQ,GAAG,CAAC,CAAC,EAAE;IAAA,KAA3BD,IAAU,GAAVA,IAAU;IAAAE,eAAA;IAAAA,eAAA;IAC3B,IAAI,CAACC,SAAS,GAAGX,eAAe,CAACQ,IAAI,EAAEC,QAAQ,CAAC;IAChD,IAAI,CAACG,IAAI,GAAGX,cAAc,CAACD,eAAe,CACxC,IAAI,CAACW,SAAS,EACd,CAAC,EACD,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,EAAE,EACFE,OAAO,CAACC,KAAK,EACb,IACF,CAAC;EACH;EAEA,IAAIC,EAAEA,CAAA,EAAG;IACP,MAAMC,QAAQ,GAAG,IAAI,CAACL,SAAS,CAACC,IAAI;IACpC,OAAO;MAAEK,IAAI,EAAEpB,QAAQ,CAACqB,KAAK;MAAEC,KAAK,EAAE,CAAC,CAAC;MAAEH,QAAQ;MAAEI,aAAa,EAAE;IAAM,CAAC;EAC5E;EAEQC,eAAeA,CAACC,OAAkB,EAAE;IAC1C,OAAO,IAAIC,OAAO,CAAEC,OAAO,IAAK;MAC9BvB,cAAc,CAACoB,eAAe,CAACC,OAAO,EAAE,IAAI,CAACV,IAAI,EAAE,IAAI,EAAE,MAAM;QAC7Dd,KAAK,CAAC,iBAAiB,CAAC;QACxB0B,OAAO,CAAC,IAAI,CAAC;MACf,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ;EAEA,MAAMC,MAAMA,CAACH,OAAkB,EAAE;IAC/B,MAAM,IAAI,CAACD,eAAe,CAACC,OAAO,CAAC;IACnC,IAAI,CAACX,SAAS,CAACe,MAAM,CAAC,CAAC;EACzB;EAEAC,YAAYA,CAACC,MAAgB,EAAE;IAC7B,IAAI,CAACjB,SAAS,CAACgB,YAAY,CAACC,MAAM,CAAC;EACrC;EAEAC,UAAUA,CAAA,EAAG;IACX,MAAMC,QAAQ,GAAG,IAAI,CAACtB,IAAI,CAACuB,eAAe,CAAC,CAAC;IAC5C,MAAMH,MAAM,GAAGE,QAAQ,CAACE,cAAc,CAAC,CAAC;IACxC,IAAI,CAACL,YAAY,CAACC,MAAM,CAAC;IACzB,OAAOE,QAAQ,CAACG,wBAAwB,CAAC,CAAC;EAC5C;EAEAC,OAAOA,CAAA,EAAG;IACR,IAAI,CAACvB,SAAS,CAACuB,OAAO,CAAC,CAAC;IACxB,OAAO,IAAIX,OAAO,CAAEC,OAAO,IAAK;MAC9BvB,cAAc,CAACoB,eAAe,CAAC,IAAI,EAAE,IAAI,CAACT,IAAI,EAAE,IAAI,EAAE,MAAM;QAC1Dd,KAAK,CAAC,kBAAkB,CAAC;QACzB0B,OAAO,CAAC,IAAI,CAAC;MACf,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ;AACF","ignoreList":[]}
@@ -1,7 +1,11 @@
1
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
2
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
1
4
  import { isSharedValue } from "../utils";
2
5
  export class ReanimatedRecorder {
3
- values = new Set();
4
6
  constructor(Skia) {
7
+ _defineProperty(this, "values", new Set());
8
+ _defineProperty(this, "recorder", void 0);
5
9
  this.recorder = Skia.Recorder();
6
10
  }
7
11
  processAnimationValues(props) {
@@ -1 +1 @@
1
- {"version":3,"names":["isSharedValue","ReanimatedRecorder","values","Set","constructor","Skia","recorder","Recorder","processAnimationValues","props","Object","forEach","value","has","name","size","add","getRecorder","getSharedValues","Array","from","saveGroup","restoreGroup","savePaint","restorePaint","restorePaintDeclaration","materializePaint","pushPathEffect","pathEffectType","pushImageFilter","imageFilterType","pushColorFilter","colorFilterType","pushShader","shaderType","pushBlurMaskFilter","composePathEffect","composeColorFilter","composeImageFilter","saveCTM","restoreCTM","drawPaint","saveLayer","saveBackdropFilter","drawBox","boxProps","shadows","shadow","map","s","drawImage","drawCircle","drawPoints","drawPath","drawRect","drawRRect","drawOval","drawLine","drawPatch","drawVertices","drawDiffRect","drawText","drawTextPath","drawTextBlob","drawGlyphs","drawPicture","drawImageSVG","drawParagraph","drawAtlas"],"sources":["ReanimatedRecorder.ts"],"sourcesContent":["import type { SharedValue } from \"react-native-reanimated\";\n\nimport type { BaseRecorder, JsiRecorder, Skia } from \"../../skia/types\";\nimport type {\n PaintProps,\n NodeType,\n BlurMaskFilterProps,\n CTMProps,\n BoxProps,\n BoxShadowProps,\n ImageProps,\n CircleProps,\n PointsProps,\n PathProps,\n RectProps,\n RoundedRectProps,\n OvalProps,\n LineProps,\n PatchProps,\n VerticesProps,\n DiffRectProps,\n TextProps,\n TextPathProps,\n TextBlobProps,\n GlyphsProps,\n PictureProps,\n ImageSVGProps,\n ParagraphProps,\n AtlasProps,\n} from \"../../dom/types\";\nimport type { AnimatedProps } from \"../../renderer\";\nimport { isSharedValue } from \"../utils\";\n\nexport class ReanimatedRecorder implements BaseRecorder {\n private values = new Set<SharedValue<unknown>>();\n private recorder: JsiRecorder;\n\n constructor(Skia: Skia) {\n this.recorder = Skia.Recorder();\n }\n\n private processAnimationValues(props?: Record<string, unknown>) {\n if (!props) {\n return;\n }\n Object.values(props).forEach((value) => {\n if (isSharedValue(value) && !this.values.has(value)) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-expect-error\n value.name = `variable${this.values.size}`;\n this.values.add(value as SharedValue<unknown>);\n }\n });\n }\n\n getRecorder() {\n return this.recorder;\n }\n\n getSharedValues() {\n return Array.from(this.values);\n }\n\n saveGroup(): void {\n this.recorder.saveGroup();\n }\n\n restoreGroup(): void {\n this.recorder.restoreGroup();\n }\n\n savePaint(props: AnimatedProps<PaintProps>): void {\n this.processAnimationValues(props);\n this.recorder.savePaint(props);\n }\n\n restorePaint(): void {\n this.recorder.restorePaint();\n }\n\n restorePaintDeclaration(): void {\n this.recorder.restorePaintDeclaration();\n }\n\n materializePaint(): void {\n this.recorder.materializePaint();\n }\n\n pushPathEffect(\n pathEffectType: NodeType,\n props: AnimatedProps<unknown>\n ): void {\n this.processAnimationValues(props);\n this.recorder.pushPathEffect(pathEffectType, props);\n }\n\n pushImageFilter(\n imageFilterType: NodeType,\n props: AnimatedProps<unknown>\n ): void {\n this.processAnimationValues(props);\n this.recorder.pushImageFilter(imageFilterType, props);\n }\n\n pushColorFilter(\n colorFilterType: NodeType,\n props: AnimatedProps<unknown>\n ): void {\n this.processAnimationValues(props);\n this.recorder.pushColorFilter(colorFilterType, props);\n }\n\n pushShader(shaderType: NodeType, props: AnimatedProps<unknown>): void {\n this.processAnimationValues(props);\n this.recorder.pushShader(shaderType, props);\n }\n\n pushBlurMaskFilter(props: AnimatedProps<BlurMaskFilterProps>): void {\n this.processAnimationValues(props);\n this.recorder.pushBlurMaskFilter(props);\n }\n\n composePathEffect(): void {\n this.recorder.composePathEffect();\n }\n\n composeColorFilter(): void {\n this.recorder.composeColorFilter();\n }\n\n composeImageFilter(): void {\n this.recorder.composeImageFilter();\n }\n\n saveCTM(props: AnimatedProps<CTMProps>): void {\n this.processAnimationValues(props);\n this.recorder.saveCTM(props);\n }\n\n restoreCTM(): void {\n this.recorder.restoreCTM();\n }\n\n drawPaint(): void {\n this.recorder.drawPaint();\n }\n\n saveLayer(): void {\n this.recorder.saveLayer();\n }\n\n saveBackdropFilter(): void {\n this.recorder.saveBackdropFilter();\n }\n\n drawBox(\n boxProps: AnimatedProps<BoxProps>,\n shadows: {\n props: BoxShadowProps;\n }[]\n ): void {\n this.processAnimationValues(boxProps);\n shadows.forEach((shadow) => {\n this.processAnimationValues(\n shadow.props as AnimatedProps<BoxShadowProps>\n );\n });\n this.recorder.drawBox(\n boxProps,\n // TODO: Fix this type BaseRecorder.drawBox()\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-expect-error\n shadows.map((s) => s.props)\n );\n }\n\n drawImage(props: AnimatedProps<ImageProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawImage(props);\n }\n\n drawCircle(props: AnimatedProps<CircleProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawCircle(props);\n }\n\n drawPoints(props: AnimatedProps<PointsProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawPoints(props);\n }\n\n drawPath(props: AnimatedProps<PathProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawPath(props);\n }\n\n drawRect(props: AnimatedProps<RectProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawRect(props);\n }\n\n drawRRect(props: AnimatedProps<RoundedRectProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawRRect(props);\n }\n\n drawOval(props: AnimatedProps<OvalProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawOval(props);\n }\n\n drawLine(props: AnimatedProps<LineProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawLine(props);\n }\n\n drawPatch(props: AnimatedProps<PatchProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawPatch(props);\n }\n\n drawVertices(props: AnimatedProps<VerticesProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawVertices(props);\n }\n\n drawDiffRect(props: AnimatedProps<DiffRectProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawDiffRect(props);\n }\n\n drawText(props: AnimatedProps<TextProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawText(props);\n }\n\n drawTextPath(props: AnimatedProps<TextPathProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawTextPath(props);\n }\n\n drawTextBlob(props: AnimatedProps<TextBlobProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawTextBlob(props);\n }\n\n drawGlyphs(props: AnimatedProps<GlyphsProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawGlyphs(props);\n }\n\n drawPicture(props: AnimatedProps<PictureProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawPicture(props);\n }\n\n drawImageSVG(props: AnimatedProps<ImageSVGProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawImageSVG(props);\n }\n\n drawParagraph(props: AnimatedProps<ParagraphProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawParagraph(props);\n }\n\n drawAtlas(props: AnimatedProps<AtlasProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawAtlas(props);\n }\n}\n"],"mappings":"AA+BA,SAASA,aAAa,QAAQ,UAAU;AAExC,OAAO,MAAMC,kBAAkB,CAAyB;EAC9CC,MAAM,GAAG,IAAIC,GAAG,CAAuB,CAAC;EAGhDC,WAAWA,CAACC,IAAU,EAAE;IACtB,IAAI,CAACC,QAAQ,GAAGD,IAAI,CAACE,QAAQ,CAAC,CAAC;EACjC;EAEQC,sBAAsBA,CAACC,KAA+B,EAAE;IAC9D,IAAI,CAACA,KAAK,EAAE;MACV;IACF;IACAC,M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AAQ,CAACwD,YAAY,CAACrD,KAAK,CAAC;EACnC;EAEAsD,YAAYA,CAACtD,KAAmC,EAAQ;IACtD,IAAI,CAACD,sBAAsB,CAACC,KAAK,CAAC;IAClC,IAAI,CAACH,QAAQ,CAACyD,YAAY,CAACtD,KAAK,CAAC;EACnC;EAEAuD,UAAUA,CAACvD,KAAiC,EAAQ;IAClD,IAAI,CAACD,sBAAsB,CAACC,KAAK,CAAC;IAClC,IAAI,CAACH,QAAQ,CAAC0D,UAAU,CAACvD,KAAK,CAAC;EACjC;EAEAwD,WAAWA,CAACxD,KAAkC,EAAQ;IACpD,IAAI,CAACD,sBAAsB,CAACC,KAAK,CAAC;IAClC,IAAI,CAACH,QAAQ,CAAC2D,WAAW,CAACxD,KAAK,CAAC;EAClC;EAEAyD,YAAYA,CAACzD,KAAmC,EAAQ;IACtD,IAAI,CAACD,sBAAsB,CAACC,KAAK,CAAC;IAClC,IAAI,CAACH,QAAQ,CAAC4D,YAAY,CAACzD,KAAK,CAAC;EACnC;EAEA0D,aAAaA,CAAC1D,KAAoC,EAAQ;IACxD,IAAI,CAACD,sBAAsB,CAACC,KAAK,CAAC;IAClC,IAAI,CAACH,QAAQ,CAAC6D,aAAa,CAAC1D,KAAK,CAAC;EACpC;EAEA2D,SAASA,CAAC3D,KAAgC,EAAQ;IAChD,IAAI,CAACD,sBAAsB,CAACC,KAAK,CAAC;IAClC,IAAI,CAACH,QAAQ,CAAC8D,SAAS,CAAC3D,KAAK,CAAC;EAChC;AACF","ignoreList":[]}
1
+ {"version":3,"names":["isSharedValue","ReanimatedRecorder","constructor","Skia","_defineProperty","Set","recorder","Recorder","processAnimationValues","props","Object","values","forEach","value","has","name","size","add","getRecorder","getSharedValues","Array","from","saveGroup","restoreGroup","savePaint","restorePaint","restorePaintDeclaration","materializePaint","pushPathEffect","pathEffectType","pushImageFilter","imageFilterType","pushColorFilter","colorFilterType","pushShader","shaderType","pushBlurMaskFilter","composePathEffect","composeColorFilter","composeImageFilter","saveCTM","restoreCTM","drawPaint","saveLayer","saveBackdropFilter","drawBox","boxProps","shadows","shadow","map","s","drawImage","drawCircle","drawPoints","drawPath","drawRect","drawRRect","drawOval","drawLine","drawPatch","drawVertices","drawDiffRect","drawText","drawTextPath","drawTextBlob","drawGlyphs","drawPicture","drawImageSVG","drawParagraph","drawAtlas"],"sources":["ReanimatedRecorder.ts"],"sourcesContent":["import type { SharedValue } from \"react-native-reanimated\";\n\nimport type { BaseRecorder, JsiRecorder, Skia } from \"../../skia/types\";\nimport type {\n PaintProps,\n NodeType,\n BlurMaskFilterProps,\n CTMProps,\n BoxProps,\n BoxShadowProps,\n ImageProps,\n CircleProps,\n PointsProps,\n PathProps,\n RectProps,\n RoundedRectProps,\n OvalProps,\n LineProps,\n PatchProps,\n VerticesProps,\n DiffRectProps,\n TextProps,\n TextPathProps,\n TextBlobProps,\n GlyphsProps,\n PictureProps,\n ImageSVGProps,\n ParagraphProps,\n AtlasProps,\n} from \"../../dom/types\";\nimport type { AnimatedProps } from \"../../renderer\";\nimport { isSharedValue } from \"../utils\";\n\nexport class ReanimatedRecorder implements BaseRecorder {\n private values = new Set<SharedValue<unknown>>();\n private recorder: JsiRecorder;\n\n constructor(Skia: Skia) {\n this.recorder = Skia.Recorder();\n }\n\n private processAnimationValues(props?: Record<string, unknown>) {\n if (!props) {\n return;\n }\n Object.values(props).forEach((value) => {\n if (isSharedValue(value) && !this.values.has(value)) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-expect-error\n value.name = `variable${this.values.size}`;\n this.values.add(value as SharedValue<unknown>);\n }\n });\n }\n\n getRecorder() {\n return this.recorder;\n }\n\n getSharedValues() {\n return Array.from(this.values);\n }\n\n saveGroup(): void {\n this.recorder.saveGroup();\n }\n\n restoreGroup(): void {\n this.recorder.restoreGroup();\n }\n\n savePaint(props: AnimatedProps<PaintProps>): void {\n this.processAnimationValues(props);\n this.recorder.savePaint(props);\n }\n\n restorePaint(): void {\n this.recorder.restorePaint();\n }\n\n restorePaintDeclaration(): void {\n this.recorder.restorePaintDeclaration();\n }\n\n materializePaint(): void {\n this.recorder.materializePaint();\n }\n\n pushPathEffect(\n pathEffectType: NodeType,\n props: AnimatedProps<unknown>\n ): void {\n this.processAnimationValues(props);\n this.recorder.pushPathEffect(pathEffectType, props);\n }\n\n pushImageFilter(\n imageFilterType: NodeType,\n props: AnimatedProps<unknown>\n ): void {\n this.processAnimationValues(props);\n this.recorder.pushImageFilter(imageFilterType, props);\n }\n\n pushColorFilter(\n colorFilterType: NodeType,\n props: AnimatedProps<unknown>\n ): void {\n this.processAnimationValues(props);\n this.recorder.pushColorFilter(colorFilterType, props);\n }\n\n pushShader(shaderType: NodeType, props: AnimatedProps<unknown>): void {\n this.processAnimationValues(props);\n this.recorder.pushShader(shaderType, props);\n }\n\n pushBlurMaskFilter(props: AnimatedProps<BlurMaskFilterProps>): void {\n this.processAnimationValues(props);\n this.recorder.pushBlurMaskFilter(props);\n }\n\n composePathEffect(): void {\n this.recorder.composePathEffect();\n }\n\n composeColorFilter(): void {\n this.recorder.composeColorFilter();\n }\n\n composeImageFilter(): void {\n this.recorder.composeImageFilter();\n }\n\n saveCTM(props: AnimatedProps<CTMProps>): void {\n this.processAnimationValues(props);\n this.recorder.saveCTM(props);\n }\n\n restoreCTM(): void {\n this.recorder.restoreCTM();\n }\n\n drawPaint(): void {\n this.recorder.drawPaint();\n }\n\n saveLayer(): void {\n this.recorder.saveLayer();\n }\n\n saveBackdropFilter(): void {\n this.recorder.saveBackdropFilter();\n }\n\n drawBox(\n boxProps: AnimatedProps<BoxProps>,\n shadows: {\n props: BoxShadowProps;\n }[]\n ): void {\n this.processAnimationValues(boxProps);\n shadows.forEach((shadow) => {\n this.processAnimationValues(\n shadow.props as AnimatedProps<BoxShadowProps>\n );\n });\n this.recorder.drawBox(\n boxProps,\n // TODO: Fix this type BaseRecorder.drawBox()\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-expect-error\n shadows.map((s) => s.props)\n );\n }\n\n drawImage(props: AnimatedProps<ImageProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawImage(props);\n }\n\n drawCircle(props: AnimatedProps<CircleProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawCircle(props);\n }\n\n drawPoints(props: AnimatedProps<PointsProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawPoints(props);\n }\n\n drawPath(props: AnimatedProps<PathProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawPath(props);\n }\n\n drawRect(props: AnimatedProps<RectProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawRect(props);\n }\n\n drawRRect(props: AnimatedProps<RoundedRectProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawRRect(props);\n }\n\n drawOval(props: AnimatedProps<OvalProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawOval(props);\n }\n\n drawLine(props: AnimatedProps<LineProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawLine(props);\n }\n\n drawPatch(props: AnimatedProps<PatchProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawPatch(props);\n }\n\n drawVertices(props: AnimatedProps<VerticesProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawVertices(props);\n }\n\n drawDiffRect(props: AnimatedProps<DiffRectProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawDiffRect(props);\n }\n\n drawText(props: AnimatedProps<TextProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawText(props);\n }\n\n drawTextPath(props: AnimatedProps<TextPathProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawTextPath(props);\n }\n\n drawTextBlob(props: AnimatedProps<TextBlobProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawTextBlob(props);\n }\n\n drawGlyphs(props: AnimatedProps<GlyphsProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawGlyphs(props);\n }\n\n drawPicture(props: AnimatedProps<PictureProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawPicture(props);\n }\n\n drawImageSVG(props: AnimatedProps<ImageSVGProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawImageSVG(props);\n }\n\n drawParagraph(props: AnimatedProps<ParagraphProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawParagraph(props);\n }\n\n drawAtlas(props: AnimatedProps<AtlasProps>): void {\n this.processAnimationValues(props);\n this.recorder.drawAtlas(props);\n }\n}\n"],"mappings":";;;AA+BA,SAASA,aAAa,QAAQ,UAAU;AAExC,OAAO,MAAMC,kBAAkB,CAAyB;EAItDC,WAAWA,CAACC,IAAU,EAAE;IAAAC,eAAA,iBAHP,IAAIC,GAAG,CAAuB,CAAC;IAAAD,eAAA;IAI9C,IAAI,CAACE,QAAQ,GAAGH,IAAI,CAACI,QAAQ,CAAC,CAAC;EACjC;EAEQC,sBAAsBA,CAACC,KAA+B,EAAE;IAC9D,IAAI,CAACA,KAAK,EAAE;MACV;IACF;IACAC,MAAM,CAACC,MAAM,CAACF,KAAK,CAAC,CAACG,OAAO,CAAEC,KAAK,IAAK;MACtC,IAAIb,aAAa,CAACa,KAAK,CAAC,IAAI,CAAC,IAAI,CAACF,MAAM,CAACG,GAAG,CAACD,KAAK,CAAC,EAAE;QACnD;QACA;QACAA,KAAK,CAACE,IAAI,GAAG,WAAW,IAAI,CAACJ,MAAM,CAACK,IAAI,EAAE;QAC1C,IAAI,CAACL,MAAM,CAACM,GAAG,CAACJ,KAA6B,CAAC;MAChD;IACF,CAAC,CAAC;EACJ;EAEAK,WAAWA,CAAA,EAAG;IACZ,OAAO,IAAI,CAACZ,QAAQ;EACtB;EAEAa,eAAeA,CAAA,EAAG;IAChB,OAAOC,KAAK,CAACC,IAAI,CAAC,IAAI,CAACV,MAAM,CAAC;EAChC;EAEAW,SAASA,CAAA,EAAS;IAChB,IAAI,CAAChB,QAAQ,CAACgB,SAAS,CAAC,CAAC;EAC3B;EAEAC,YAAYA,CAAA,EAAS;IACnB,IAAI,CAACjB,QAAQ,CAACiB,YAAY,CAAC,CAAC;EAC9B;EAEAC,SAASA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I,CAACD,sBAAsB,CAACC,KAAK,CAAC;IAClC,IAAI,CAACH,QAAQ,CAAC8D,aAAa,CAAC3D,KAAK,CAAC;EACpC;EAEA4D,SAASA,CAAC5D,KAAgC,EAAQ;IAChD,IAAI,CAACD,sBAAsB,CAACC,KAAK,CAAC;IAClC,IAAI,CAACH,QAAQ,CAAC+D,SAAS,CAAC5D,KAAK,CAAC;EAChC;AACF","ignoreList":[]}
@@ -1,12 +1,15 @@
1
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
2
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
1
4
  import { NodeType } from "../../dom/types";
2
5
  import { isSharedValue } from "../utils";
3
6
  import { isColorFilter, isImageFilter, isPathEffect, isShader } from "../Node";
4
7
  import { CommandType } from "./Core";
5
8
  export class Recorder {
6
- commands = [];
7
- cursors = [];
8
- animationValues = new Set();
9
9
  constructor() {
10
+ _defineProperty(this, "commands", []);
11
+ _defineProperty(this, "cursors", []);
12
+ _defineProperty(this, "animationValues", new Set());
10
13
  this.cursors.push(this.commands);
11
14
  }
12
15
  getRecording() {
@@ -1 +1 @@
1
- {"version":3,"names":["NodeType","isSharedValue","isColorFilter","isImageFilter","isPathEffect","isShader","CommandType","Recorder","commands","cursors","animationValues","Set","constructor","push","getRecording","paintPool","processProps","props","animatedProps","hasAnimatedProps","key","prop","add","undefined","command","length","saveGroup","children","type","Group","restoreGroup","pop","savePaint","SavePaint","restorePaint","RestorePaint","restorePaintDeclaration","RestorePaintDeclaration","materializePaint","MaterializePaint","pushPathEffect","pathEffectType","Error","PushPathEffect","pushImageFilter","imageFilterType","PushImageFilter","pushColorFilter","colorFilterType","PushColorFilter","pushShader","shaderType","Blend","PushShader","pushBlurMaskFilter","PushBlurMaskFilter","composePathEffect","ComposePathEffect","composeColorFilter","ComposeColorFilter","composeImageFilter","ComposeImageFilter","saveCTM","SaveCTM","restoreCTM","RestoreCTM","drawPaint","DrawPaint","saveLayer","SaveLayer","saveBackdropFilter","SaveBackdropFilter","drawBox","boxProps","shadows","forEach","shadow","DrawBox","drawImage","DrawImage","drawCircle","DrawCircle","drawPoints","DrawPoints","drawPath","DrawPath","drawRect","DrawRect","drawRRect","DrawRRect","drawOval","DrawOval","drawLine","DrawLine","drawPatch","DrawPatch","drawVertices","DrawVertices","drawDiffRect","DrawDiffRect","drawText","DrawText","drawTextPath","DrawTextPath","drawTextBlob","DrawTextBlob","drawGlyphs","DrawGlyphs","drawPicture","DrawPicture","drawImageSVG","DrawImageSVG","drawParagraph","DrawParagraph","drawAtlas","DrawAtlas"],"sources":["Recorder.ts"],"sourcesContent":["import type { SharedValue } from \"react-native-reanimated\";\n\nimport { NodeType } from \"../../dom/types\";\nimport type {\n BlurMaskFilterProps,\n CircleProps,\n CTMProps,\n ImageProps,\n PaintProps,\n PointsProps,\n PathProps,\n RectProps,\n RoundedRectProps,\n OvalProps,\n LineProps,\n PatchProps,\n VerticesProps,\n DiffRectProps,\n TextProps,\n TextPathProps,\n TextBlobProps,\n GlyphsProps,\n PictureProps,\n ImageSVGProps,\n ParagraphProps,\n AtlasProps,\n BoxProps,\n BoxShadowProps,\n} from \"../../dom/types\";\nimport type { AnimatedProps } from \"../../renderer\";\nimport { isSharedValue } from \"../utils\";\nimport { isColorFilter, isImageFilter, isPathEffect, isShader } from \"../Node\";\nimport type { SkPaint, BaseRecorder } from \"../../skia/types\";\n\nimport { CommandType } from \"./Core\";\nimport type { Command } from \"./Core\";\n\nexport interface Recording {\n commands: Command[];\n paintPool: SkPaint[];\n}\n\ninterface AnimationValues {\n animationValues: Set<SharedValue<unknown>>;\n}\n\nexport class Recorder implements BaseRecorder {\n commands: Command[] = [];\n cursors: Command[][] = [];\n animationValues: Set<SharedValue<unknown>> = new Set();\n\n constructor() {\n this.cursors.push(this.commands);\n }\n\n getRecording(): Recording & AnimationValues {\n return {\n commands: this.commands,\n paintPool: [],\n animationValues: this.animationValues,\n };\n }\n\n private processProps(props: Record<string, unknown>) {\n const animatedProps: Record<string, SharedValue<unknown>> = {};\n let hasAnimatedProps = false;\n\n for (const key in props) {\n const prop = props[key];\n if (isSharedValue(prop)) {\n this.animationValues.add(prop);\n animatedProps[key] = prop;\n hasAnimatedProps = true;\n }\n }\n\n return {\n props,\n animatedProps: hasAnimatedProps ? animatedProps : undefined,\n };\n }\n\n private add(command: Command) {\n if (command.props) {\n const { animatedProps } = this.processProps(\n command.props as Record<string, unknown>\n );\n if (animatedProps) {\n command.animatedProps = animatedProps;\n }\n }\n this.cursors[this.cursors.length - 1].push(command);\n }\n\n saveGroup() {\n const children: Command[] = [];\n this.add({ type: CommandType.Group, children });\n this.cursors.push(children);\n }\n\n restoreGroup() {\n this.cursors.pop();\n }\n\n savePaint(props: AnimatedProps<PaintProps>) {\n this.add({ type: CommandType.SavePaint, props });\n }\n\n restorePaint() {\n this.add({ type: CommandType.RestorePaint });\n }\n\n restorePaintDeclaration() {\n this.add({ type: CommandType.RestorePaintDeclaration });\n }\n\n materializePaint() {\n this.add({ type: CommandType.MaterializePaint });\n }\n\n pushPathEffect(pathEffectType: NodeType, props: AnimatedProps<unknown>) {\n if (!isPathEffect(pathEffectType)) {\n throw new Error(\"Invalid color filter type: \" + pathEffectType);\n }\n this.add({\n type: CommandType.PushPathEffect,\n pathEffectType,\n props,\n });\n }\n\n pushImageFilter(imageFilterType: NodeType, props: AnimatedProps<unknown>) {\n if (!isImageFilter(imageFilterType)) {\n throw new Error(\"Invalid color filter type: \" + imageFilterType);\n }\n this.add({\n type: CommandType.PushImageFilter,\n imageFilterType,\n props,\n });\n }\n\n pushColorFilter(colorFilterType: NodeType, props: AnimatedProps<unknown>) {\n if (!isColorFilter(colorFilterType)) {\n throw new Error(\"Invalid color filter type: \" + colorFilterType);\n }\n this.add({\n type: CommandType.PushColorFilter,\n colorFilterType,\n props,\n });\n }\n\n pushShader(shaderType: NodeType, props: AnimatedProps<unknown>) {\n if (!isShader(shaderType) && !(shaderType === NodeType.Blend)) {\n throw new Error(\"Invalid color filter type: \" + shaderType);\n }\n this.add({ type: CommandType.PushShader, shaderType, props });\n }\n\n pushBlurMaskFilter(props: AnimatedProps<BlurMaskFilterProps>) {\n this.add({ type: CommandType.PushBlurMaskFilter, props });\n }\n\n composePathEffect() {\n this.add({ type: CommandType.ComposePathEffect });\n }\n\n composeColorFilter() {\n this.add({ type: CommandType.ComposeColorFilter });\n }\n\n composeImageFilter() {\n this.add({ type: CommandType.ComposeImageFilter });\n }\n\n saveCTM(props: AnimatedProps<CTMProps>) {\n this.add({ type: CommandType.SaveCTM, props });\n }\n\n restoreCTM() {\n this.add({ type: CommandType.RestoreCTM });\n }\n\n drawPaint() {\n this.add({ type: CommandType.DrawPaint });\n }\n\n saveLayer() {\n this.add({ type: CommandType.SaveLayer });\n }\n\n saveBackdropFilter() {\n this.add({ type: CommandType.SaveBackdropFilter });\n }\n\n drawBox(\n boxProps: AnimatedProps<BoxProps>,\n shadows: {\n props: BoxShadowProps;\n animatedProps?: Record<string, SharedValue<unknown>>;\n }[]\n ) {\n shadows.forEach((shadow) => {\n if (shadow.props) {\n if (shadow.props) {\n const { animatedProps } = this.processProps(\n shadow.props as unknown as Record<string, unknown>\n );\n if (animatedProps) {\n shadow.animatedProps = animatedProps;\n }\n }\n }\n });\n this.add({ type: CommandType.DrawBox, props: boxProps, shadows });\n }\n\n drawImage(props: AnimatedProps<ImageProps>) {\n this.add({ type: CommandType.DrawImage, props });\n }\n\n drawCircle(props: AnimatedProps<CircleProps>) {\n this.add({ type: CommandType.DrawCircle, props });\n }\n drawPoints(props: AnimatedProps<PointsProps>) {\n this.add({ type: CommandType.DrawPoints, props });\n }\n\n drawPath(props: AnimatedProps<PathProps>) {\n this.add({ type: CommandType.DrawPath, props });\n }\n\n drawRect(props: AnimatedProps<RectProps>) {\n this.add({ type: CommandType.DrawRect, props });\n }\n\n drawRRect(props: AnimatedProps<RoundedRectProps>) {\n this.add({ type: CommandType.DrawRRect, props });\n }\n\n drawOval(props: AnimatedProps<OvalProps>) {\n this.add({ type: CommandType.DrawOval, props });\n }\n\n drawLine(props: AnimatedProps<LineProps>) {\n this.add({ type: CommandType.DrawLine, props });\n }\n\n drawPatch(props: AnimatedProps<PatchProps>) {\n this.add({ type: CommandType.DrawPatch, props });\n }\n\n drawVertices(props: AnimatedProps<VerticesProps>) {\n this.add({ type: CommandType.DrawVertices, props });\n }\n\n drawDiffRect(props: AnimatedProps<DiffRectProps>) {\n this.add({ type: CommandType.DrawDiffRect, props });\n }\n\n drawText(props: AnimatedProps<TextProps>) {\n this.add({ type: CommandType.DrawText, props });\n }\n\n drawTextPath(props: AnimatedProps<TextPathProps>) {\n this.add({ type: CommandType.DrawTextPath, props });\n }\n\n drawTextBlob(props: AnimatedProps<TextBlobProps>) {\n this.add({ type: CommandType.DrawTextBlob, props });\n }\n\n drawGlyphs(props: AnimatedProps<GlyphsProps>) {\n this.add({ type: CommandType.DrawGlyphs, props });\n }\n\n drawPicture(props: AnimatedProps<PictureProps>) {\n this.add({ type: CommandType.DrawPicture, props });\n }\n\n drawImageSVG(props: AnimatedProps<ImageSVGProps>) {\n this.add({ type: CommandType.DrawImageSVG, props });\n }\n\n drawParagraph(props: AnimatedProps<ParagraphProps>) {\n this.add({ type: CommandType.DrawParagraph, props });\n }\n\n drawAtlas(props: AnimatedProps<AtlasProps>) {\n this.add({ type: CommandType.DrawAtlas, props });\n }\n}\n"],"mappings":"AAEA,SAASA,QAAQ,QAAQ,iBAAiB;AA4B1C,SAASC,aAAa,QAAQ,UAAU;AACxC,SAASC,aAAa,EAAEC,aAAa,EAAEC,YAAY,EAAEC,QAAQ,Q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,SAASA,CAACjG,KAAgC,EAAE;IAC1C,IAAI,CAACK,GAAG,CAAC;MAAEM,IAAI,EAAEtB,WAAW,CAAC6G,SAAS;MAAElG;IAAM,CAAC,CAAC;EAClD;AACF","ignoreList":[]}
1
+ {"version":3,"names":["NodeType","isSharedValue","isColorFilter","isImageFilter","isPathEffect","isShader","CommandType","Recorder","constructor","_defineProperty","Set","cursors","push","commands","getRecording","paintPool","animationValues","processProps","props","animatedProps","hasAnimatedProps","key","prop","add","undefined","command","length","saveGroup","children","type","Group","restoreGroup","pop","savePaint","SavePaint","restorePaint","RestorePaint","restorePaintDeclaration","RestorePaintDeclaration","materializePaint","MaterializePaint","pushPathEffect","pathEffectType","Error","PushPathEffect","pushImageFilter","imageFilterType","PushImageFilter","pushColorFilter","colorFilterType","PushColorFilter","pushShader","shaderType","Blend","PushShader","pushBlurMaskFilter","PushBlurMaskFilter","composePathEffect","ComposePathEffect","composeColorFilter","ComposeColorFilter","composeImageFilter","ComposeImageFilter","saveCTM","SaveCTM","restoreCTM","RestoreCTM","drawPaint","DrawPaint","saveLayer","SaveLayer","saveBackdropFilter","SaveBackdropFilter","drawBox","boxProps","shadows","forEach","shadow","DrawBox","drawImage","DrawImage","drawCircle","DrawCircle","drawPoints","DrawPoints","drawPath","DrawPath","drawRect","DrawRect","drawRRect","DrawRRect","drawOval","DrawOval","drawLine","DrawLine","drawPatch","DrawPatch","drawVertices","DrawVertices","drawDiffRect","DrawDiffRect","drawText","DrawText","drawTextPath","DrawTextPath","drawTextBlob","DrawTextBlob","drawGlyphs","DrawGlyphs","drawPicture","DrawPicture","drawImageSVG","DrawImageSVG","drawParagraph","DrawParagraph","drawAtlas","DrawAtlas"],"sources":["Recorder.ts"],"sourcesContent":["import type { SharedValue } from \"react-native-reanimated\";\n\nimport { NodeType } from \"../../dom/types\";\nimport type {\n BlurMaskFilterProps,\n CircleProps,\n CTMProps,\n ImageProps,\n PaintProps,\n PointsProps,\n PathProps,\n RectProps,\n RoundedRectProps,\n OvalProps,\n LineProps,\n PatchProps,\n VerticesProps,\n DiffRectProps,\n TextProps,\n TextPathProps,\n TextBlobProps,\n GlyphsProps,\n PictureProps,\n ImageSVGProps,\n ParagraphProps,\n AtlasProps,\n BoxProps,\n BoxShadowProps,\n} from \"../../dom/types\";\nimport type { AnimatedProps } from \"../../renderer\";\nimport { isSharedValue } from \"../utils\";\nimport { isColorFilter, isImageFilter, isPathEffect, isShader } from \"../Node\";\nimport type { SkPaint, BaseRecorder } from \"../../skia/types\";\n\nimport { CommandType } from \"./Core\";\nimport type { Command } from \"./Core\";\n\nexport interface Recording {\n commands: Command[];\n paintPool: SkPaint[];\n}\n\ninterface AnimationValues {\n animationValues: Set<SharedValue<unknown>>;\n}\n\nexport class Recorder implements BaseRecorder {\n commands: Command[] = [];\n cursors: Command[][] = [];\n animationValues: Set<SharedValue<unknown>> = new Set();\n\n constructor() {\n this.cursors.push(this.commands);\n }\n\n getRecording(): Recording & AnimationValues {\n return {\n commands: this.commands,\n paintPool: [],\n animationValues: this.animationValues,\n };\n }\n\n private processProps(props: Record<string, unknown>) {\n const animatedProps: Record<string, SharedValue<unknown>> = {};\n let hasAnimatedProps = false;\n\n for (const key in props) {\n const prop = props[key];\n if (isSharedValue(prop)) {\n this.animationValues.add(prop);\n animatedProps[key] = prop;\n hasAnimatedProps = true;\n }\n }\n\n return {\n props,\n animatedProps: hasAnimatedProps ? animatedProps : undefined,\n };\n }\n\n private add(command: Command) {\n if (command.props) {\n const { animatedProps } = this.processProps(\n command.props as Record<string, unknown>\n );\n if (animatedProps) {\n command.animatedProps = animatedProps;\n }\n }\n this.cursors[this.cursors.length - 1].push(command);\n }\n\n saveGroup() {\n const children: Command[] = [];\n this.add({ type: CommandType.Group, children });\n this.cursors.push(children);\n }\n\n restoreGroup() {\n this.cursors.pop();\n }\n\n savePaint(props: AnimatedProps<PaintProps>) {\n this.add({ type: CommandType.SavePaint, props });\n }\n\n restorePaint() {\n this.add({ type: CommandType.RestorePaint });\n }\n\n restorePaintDeclaration() {\n this.add({ type: CommandType.RestorePaintDeclaration });\n }\n\n materializePaint() {\n this.add({ type: CommandType.MaterializePaint });\n }\n\n pushPathEffect(pathEffectType: NodeType, props: AnimatedProps<unknown>) {\n if (!isPathEffect(pathEffectType)) {\n throw new Error(\"Invalid color filter type: \" + pathEffectType);\n }\n this.add({\n type: CommandType.PushPathEffect,\n pathEffectType,\n props,\n });\n }\n\n pushImageFilter(imageFilterType: NodeType, props: AnimatedProps<unknown>) {\n if (!isImageFilter(imageFilterType)) {\n throw new Error(\"Invalid color filter type: \" + imageFilterType);\n }\n this.add({\n type: CommandType.PushImageFilter,\n imageFilterType,\n props,\n });\n }\n\n pushColorFilter(colorFilterType: NodeType, props: AnimatedProps<unknown>) {\n if (!isColorFilter(colorFilterType)) {\n throw new Error(\"Invalid color filter type: \" + colorFilterType);\n }\n this.add({\n type: CommandType.PushColorFilter,\n colorFilterType,\n props,\n });\n }\n\n pushShader(shaderType: NodeType, props: AnimatedProps<unknown>) {\n if (!isShader(shaderType) && !(shaderType === NodeType.Blend)) {\n throw new Error(\"Invalid color filter type: \" + shaderType);\n }\n this.add({ type: CommandType.PushShader, shaderType, props });\n }\n\n pushBlurMaskFilter(props: AnimatedProps<BlurMaskFilterProps>) {\n this.add({ type: CommandType.PushBlurMaskFilter, props });\n }\n\n composePathEffect() {\n this.add({ type: CommandType.ComposePathEffect });\n }\n\n composeColorFilter() {\n this.add({ type: CommandType.ComposeColorFilter });\n }\n\n composeImageFilter() {\n this.add({ type: CommandType.ComposeImageFilter });\n }\n\n saveCTM(props: AnimatedProps<CTMProps>) {\n this.add({ type: CommandType.SaveCTM, props });\n }\n\n restoreCTM() {\n this.add({ type: CommandType.RestoreCTM });\n }\n\n drawPaint() {\n this.add({ type: CommandType.DrawPaint });\n }\n\n saveLayer() {\n this.add({ type: CommandType.SaveLayer });\n }\n\n saveBackdropFilter() {\n this.add({ type: CommandType.SaveBackdropFilter });\n }\n\n drawBox(\n boxProps: AnimatedProps<BoxProps>,\n shadows: {\n props: BoxShadowProps;\n animatedProps?: Record<string, SharedValue<unknown>>;\n }[]\n ) {\n shadows.forEach((shadow) => {\n if (shadow.props) {\n if (shadow.props) {\n const { animatedProps } = this.processProps(\n shadow.props as unknown as Record<string, unknown>\n );\n if (animatedProps) {\n shadow.animatedProps = animatedProps;\n }\n }\n }\n });\n this.add({ type: CommandType.DrawBox, props: boxProps, shadows });\n }\n\n drawImage(props: AnimatedProps<ImageProps>) {\n this.add({ type: CommandType.DrawImage, props });\n }\n\n drawCircle(props: AnimatedProps<CircleProps>) {\n this.add({ type: CommandType.DrawCircle, props });\n }\n drawPoints(props: AnimatedProps<PointsProps>) {\n this.add({ type: CommandType.DrawPoints, props });\n }\n\n drawPath(props: AnimatedProps<PathProps>) {\n this.add({ type: CommandType.DrawPath, props });\n }\n\n drawRect(props: AnimatedProps<RectProps>) {\n this.add({ type: CommandType.DrawRect, props });\n }\n\n drawRRect(props: AnimatedProps<RoundedRectProps>) {\n this.add({ type: CommandType.DrawRRect, props });\n }\n\n drawOval(props: AnimatedProps<OvalProps>) {\n this.add({ type: CommandType.DrawOval, props });\n }\n\n drawLine(props: AnimatedProps<LineProps>) {\n this.add({ type: CommandType.DrawLine, props });\n }\n\n drawPatch(props: AnimatedProps<PatchProps>) {\n this.add({ type: CommandType.DrawPatch, props });\n }\n\n drawVertices(props: AnimatedProps<VerticesProps>) {\n this.add({ type: CommandType.DrawVertices, props });\n }\n\n drawDiffRect(props: AnimatedProps<DiffRectProps>) {\n this.add({ type: CommandType.DrawDiffRect, props });\n }\n\n drawText(props: AnimatedProps<TextProps>) {\n this.add({ type: CommandType.DrawText, props });\n }\n\n drawTextPath(props: AnimatedProps<TextPathProps>) {\n this.add({ type: CommandType.DrawTextPath, props });\n }\n\n drawTextBlob(props: AnimatedProps<TextBlobProps>) {\n this.add({ type: CommandType.DrawTextBlob, props });\n }\n\n drawGlyphs(props: AnimatedProps<GlyphsProps>) {\n this.add({ type: CommandType.DrawGlyphs, props });\n }\n\n drawPicture(props: AnimatedProps<PictureProps>) {\n this.add({ type: CommandType.DrawPicture, props });\n }\n\n drawImageSVG(props: AnimatedProps<ImageSVGProps>) {\n this.add({ type: CommandType.DrawImageSVG, props });\n }\n\n drawParagraph(props: AnimatedProps<ParagraphProps>) {\n this.add({ type: CommandType.DrawParagraph, props });\n }\n\n drawAtlas(props: AnimatedProps<AtlasProps>) {\n this.add({ type: CommandType.DrawAtlas, props });\n }\n}\n"],"mappings":";;;AAEA,SAASA,QAAQ,QAAQ,iBAAiB;AA4B1C,SAASC,aAAa,QAAQ,UAAU;AACxC,SAASC,aAAa,EAAEC,aAAa,EAAEC,YAAY,EAAEC,QAAQ,QAAQ,SAAS;AAG9E,SAASC,WAAW,QAAQ,QAAQ;AAYpC,OAAO,MAAMC,QAAQ,CAAyB;EAK5CC,WAAWA,CAAA,EAAG;IAAAC,eAAA,mBAJQ,EAAE;IAAAA,eAAA,kBACD,EAAE;IAAAA,eAAA,0BACoB,IAAIC,GAAG,CAAC,CAAC;IAGpD,IAAI,CAACC,OAAO,CAACC,IAAI,CAAC,IAAI,CAACC,QAAQ,CAAC;EAClC;EAEAC,YAAYA,CAAA,EAAgC;IAC1C,OAAO;MACLD,QAAQ,EAAE,IAAI,CAACA,QAAQ;MACvBE,SAAS,EAAE,EAAE;MACbC,eAAe,EAAE,IAAI,CAACA;IACxB,CAAC;EACH;EAEQC,YAAYA,CAACC,KAA8B,EAAE;IACnD,MAAMC,aAAmD,GAAG,CAAC,CAAC;IAC9D,IAAIC,gBAAgB,GAAG,KAAK;IAE5B,KAAK,MAAMC,GAAG,IAAIH,KAAK,EAAE;MACvB,MAAMI,IAAI,GAAGJ,KAAK,CAACG,GAAG,CAAC;MACvB,IAAIpB,aAAa,CAACqB,IAAI,CAAC,EAAE;QACvB,IAAI,CAACN,eAAe,CAACO,GAAG,CAACD,IAAI,CAAC;QAC9BH,aAAa,CAACE,GAAG,CAAC,GAAGC,IAAI;QACzBF,gBAA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D;EAEA2F,WAAWA,CAAC3F,KAAkC,EAAE;IAC9C,IAAI,CAACK,GAAG,CAAC;MAAEM,IAAI,EAAEvB,WAAW,CAACwG,WAAW;MAAE5F;IAAM,CAAC,CAAC;EACpD;EAEA6F,YAAYA,CAAC7F,KAAmC,EAAE;IAChD,IAAI,CAACK,GAAG,CAAC;MAAEM,IAAI,EAAEvB,WAAW,CAAC0G,YAAY;MAAE9F;IAAM,CAAC,CAAC;EACrD;EAEA+F,aAAaA,CAAC/F,KAAoC,EAAE;IAClD,IAAI,CAACK,GAAG,CAAC;MAAEM,IAAI,EAAEvB,WAAW,CAAC4G,aAAa;MAAEhG;IAAM,CAAC,CAAC;EACtD;EAEAiG,SAASA,CAACjG,KAAgC,EAAE;IAC1C,IAAI,CAACK,GAAG,CAAC;MAAEM,IAAI,EAAEvB,WAAW,CAAC8G,SAAS;MAAElG;IAAM,CAAC,CAAC;EAClD;AACF","ignoreList":[]}
@@ -176,7 +176,7 @@ const visitNode = (recorder, node) => {
176
176
  const paint = processPaint(props);
177
177
  const shouldPushPaint = paint || colorFilters.length > 0 || maskFilters.length > 0 || imageFilters.length > 0 || pathEffects.length > 0 || shaders.length > 0;
178
178
  if (shouldPushPaint) {
179
- recorder.savePaint(paint ?? {});
179
+ recorder.savePaint(paint !== null && paint !== void 0 ? paint : {});
180
180
  pushColorFilters(recorder, colorFilters);
181
181
  pushImageFilters(recorder, imageFilters);
182
182
  pushMaskFilters(recorder, maskFilters);