@shopify/react-native-skia 0.1.234 → 0.1.237

Sign up to get free protection for your applications and to get access to all the features.
Files changed (425) hide show
  1. package/cpp/api/JsiSkApi.h +2 -0
  2. package/cpp/api/JsiSkCanvas.h +36 -0
  3. package/cpp/api/JsiSkRSXform.h +35 -7
  4. package/cpp/api/JsiSkTypefaceFactory.h +2 -1
  5. package/cpp/rnskia/dom/JsiDomApi.h +2 -0
  6. package/cpp/rnskia/dom/nodes/JsiAtlasNode.h +60 -0
  7. package/cpp/rnskia/dom/props/RSXformProp.h +52 -0
  8. package/cpp/rnskia/dom/props/RectProp.h +31 -0
  9. package/cpp/skia/include/android/AHardwareBufferUtils.h +23 -0
  10. package/cpp/skia/include/android/GrAHardwareBufferUtils.h +2 -0
  11. package/cpp/skia/include/android/graphite/SurfaceAndroid.h +59 -0
  12. package/cpp/skia/include/codec/SkAvifDecoder.h +1 -1
  13. package/cpp/skia/include/codec/SkBmpDecoder.h +1 -1
  14. package/cpp/skia/include/codec/SkCodec.h +21 -3
  15. package/cpp/skia/include/codec/SkGifDecoder.h +1 -1
  16. package/cpp/skia/include/codec/SkIcoDecoder.h +1 -1
  17. package/cpp/skia/include/codec/SkJpegDecoder.h +1 -1
  18. package/cpp/skia/include/codec/SkJpegxlDecoder.h +1 -1
  19. package/cpp/skia/include/codec/SkPngDecoder.h +1 -1
  20. package/cpp/skia/include/codec/SkRawDecoder.h +1 -1
  21. package/cpp/skia/include/codec/SkWbmpDecoder.h +1 -1
  22. package/cpp/skia/include/codec/SkWebpDecoder.h +1 -1
  23. package/cpp/skia/include/config/SkUserConfig.h +3 -1
  24. package/cpp/skia/include/core/SkCanvas.h +66 -37
  25. package/cpp/skia/include/core/SkColorFilter.h +5 -2
  26. package/cpp/skia/include/core/SkContourMeasure.h +1 -0
  27. package/cpp/skia/include/core/SkDocument.h +1 -0
  28. package/cpp/skia/include/core/SkFont.h +14 -24
  29. package/cpp/skia/include/core/SkFontArguments.h +1 -1
  30. package/cpp/skia/include/core/SkFontMetrics.h +1 -1
  31. package/cpp/skia/include/core/SkFontMgr.h +0 -7
  32. package/cpp/skia/include/core/SkGraphics.h +13 -0
  33. package/cpp/skia/include/core/SkMesh.h +9 -13
  34. package/cpp/skia/include/core/SkMilestone.h +1 -1
  35. package/cpp/skia/include/core/SkPathMeasure.h +2 -0
  36. package/cpp/skia/include/core/SkSerialProcs.h +29 -11
  37. package/cpp/skia/include/core/SkSize.h +3 -3
  38. package/cpp/skia/include/core/SkStream.h +3 -13
  39. package/cpp/skia/include/core/SkSurface.h +6 -3
  40. package/cpp/skia/include/core/SkSurfaceProps.h +2 -4
  41. package/cpp/skia/include/core/SkTraceMemoryDump.h +15 -0
  42. package/cpp/skia/include/core/SkTypeface.h +8 -56
  43. package/cpp/skia/include/core/SkTypes.h +8 -0
  44. package/cpp/skia/include/core/SkVertices.h +1 -1
  45. package/cpp/skia/include/docs/SkMultiPictureDocument.h +53 -0
  46. package/cpp/skia/include/docs/SkPDFDocument.h +11 -0
  47. package/cpp/skia/include/effects/SkGradientShader.h +9 -0
  48. package/cpp/skia/include/effects/SkRuntimeEffect.h +3 -7
  49. package/cpp/skia/include/gpu/GrBackendSemaphore.h +33 -47
  50. package/cpp/skia/include/gpu/GrBackendSurface.h +2 -3
  51. package/cpp/skia/include/gpu/GrContextOptions.h +0 -6
  52. package/cpp/skia/include/gpu/GrContextThreadSafeProxy.h +44 -28
  53. package/cpp/skia/include/gpu/GrDirectContext.h +12 -31
  54. package/cpp/skia/include/gpu/GrTypes.h +1 -16
  55. package/cpp/skia/include/gpu/MutableTextureState.h +35 -80
  56. package/cpp/skia/include/gpu/ShaderErrorHandler.h +11 -1
  57. package/cpp/skia/include/gpu/ganesh/SkImageGanesh.h +2 -2
  58. package/cpp/skia/include/gpu/ganesh/SkSurfaceGanesh.h +1 -1
  59. package/cpp/skia/include/gpu/ganesh/gl/GrGLDirectContext.h +3 -2
  60. package/cpp/skia/include/gpu/ganesh/vk/GrVkBackendSemaphore.h +20 -0
  61. package/cpp/skia/include/gpu/ganesh/vk/GrVkDirectContext.h +30 -0
  62. package/cpp/skia/include/gpu/gl/GrGLFunctions.h +1 -1
  63. package/cpp/skia/include/gpu/gl/GrGLInterface.h +2 -0
  64. package/cpp/skia/include/gpu/gl/glx/GrGLMakeGLXInterface.h +6 -0
  65. package/cpp/skia/include/gpu/graphite/BackendSemaphore.h +3 -3
  66. package/cpp/skia/include/gpu/graphite/BackendTexture.h +39 -27
  67. package/cpp/skia/include/gpu/graphite/Context.h +39 -13
  68. package/cpp/skia/include/gpu/graphite/ContextOptions.h +2 -0
  69. package/cpp/skia/include/gpu/graphite/GraphiteTypes.h +2 -1
  70. package/cpp/skia/include/gpu/graphite/Image.h +106 -87
  71. package/cpp/skia/include/gpu/graphite/Recorder.h +24 -3
  72. package/cpp/skia/include/gpu/graphite/Surface.h +7 -2
  73. package/cpp/skia/include/gpu/graphite/dawn/DawnBackendContext.h +41 -2
  74. package/cpp/skia/include/gpu/graphite/dawn/DawnTypes.h +11 -6
  75. package/cpp/skia/include/gpu/graphite/mtl/MtlGraphiteTypes.h +1 -2
  76. package/cpp/skia/include/gpu/graphite/vk/VulkanGraphiteTypes.h +6 -6
  77. package/cpp/skia/include/gpu/mock/GrMockTypes.h +1 -0
  78. package/cpp/skia/include/gpu/vk/GrVkBackendContext.h +1 -1
  79. package/cpp/skia/include/gpu/vk/GrVkTypes.h +1 -44
  80. package/cpp/skia/include/gpu/vk/VulkanExtensions.h +1 -1
  81. package/cpp/skia/include/gpu/vk/VulkanMutableTextureState.h +25 -0
  82. package/cpp/skia/include/gpu/vk/VulkanTypes.h +44 -0
  83. package/cpp/skia/include/ports/SkFontConfigInterface.h +3 -6
  84. package/cpp/skia/include/private/SkEncodedInfo.h +5 -0
  85. package/cpp/skia/include/private/SkExif.h +102 -0
  86. package/cpp/skia/include/private/SkGainmapInfo.h +11 -1
  87. package/cpp/skia/include/private/base/SkAssert.h +16 -0
  88. package/cpp/skia/include/private/base/SkDeque.h +2 -7
  89. package/cpp/skia/include/private/base/SkLoadUserConfig.h +1 -1
  90. package/cpp/skia/include/private/base/SkTArray.h +69 -28
  91. package/cpp/skia/include/private/base/SkThreadAnnotations.h +18 -5
  92. package/cpp/skia/include/private/chromium/GrSurfaceCharacterization.h +26 -30
  93. package/cpp/skia/include/private/chromium/GrVkSecondaryCBDrawContext.h +4 -3
  94. package/cpp/skia/include/private/chromium/SkImageChromium.h +1 -1
  95. package/cpp/skia/include/private/gpu/ganesh/GrTypesPriv.h +8 -6
  96. package/cpp/skia/include/private/gpu/graphite/ContextOptionsPriv.h +29 -0
  97. package/cpp/skia/include/private/gpu/graphite/DawnTypesPriv.h +12 -9
  98. package/cpp/skia/include/private/gpu/graphite/VulkanGraphiteTypesPriv.h +16 -11
  99. package/cpp/skia/include/third_party/vulkan/vulkan/vk_platform.h +2 -2
  100. package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h264std.h +312 -0
  101. package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h264std_decode.h +77 -0
  102. package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h265std.h +446 -0
  103. package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h265std_decode.h +67 -0
  104. package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codecs_common.h +36 -0
  105. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan.h +9 -2
  106. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_android.h +31 -3
  107. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_core.h +10624 -5716
  108. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_ios.h +2 -1
  109. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_macos.h +2 -1
  110. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_win32.h +28 -1
  111. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_xcb.h +2 -1
  112. package/cpp/skia/include/utils/mac/SkCGUtils.h +23 -11
  113. package/cpp/skia/modules/skcms/skcms.h +2 -410
  114. package/cpp/skia/modules/skcms/src/Transform_inl.h +831 -704
  115. package/cpp/skia/modules/skcms/src/skcms_Transform.h +161 -0
  116. package/cpp/skia/modules/skcms/src/skcms_internals.h +136 -0
  117. package/cpp/skia/modules/skcms/src/skcms_public.h +404 -0
  118. package/cpp/skia/modules/skparagraph/include/FontArguments.h +1 -1
  119. package/cpp/skia/modules/skparagraph/include/FontCollection.h +2 -0
  120. package/cpp/skia/modules/skparagraph/include/Paragraph.h +2 -2
  121. package/cpp/skia/modules/skparagraph/include/TextStyle.h +4 -3
  122. package/cpp/skia/modules/skparagraph/include/TypefaceFontProvider.h +1 -3
  123. package/cpp/skia/modules/skresources/include/SkResources.h +28 -17
  124. package/cpp/skia/modules/skunicode/include/SkUnicode.h +12 -0
  125. package/cpp/skia/modules/svg/include/SkSVGDOM.h +4 -1
  126. package/cpp/skia/modules/svg/include/SkSVGRenderContext.h +4 -1
  127. package/cpp/skia/src/base/SkUTF.h +7 -0
  128. package/cpp/skia/src/core/SkTHash.h +20 -8
  129. package/lib/commonjs/dom/nodes/JsiSkDOM.d.ts +5 -3
  130. package/lib/commonjs/dom/nodes/JsiSkDOM.js +60 -57
  131. package/lib/commonjs/dom/nodes/JsiSkDOM.js.map +1 -1
  132. package/lib/commonjs/dom/nodes/drawings/AtlasNode.d.ts +8 -0
  133. package/lib/commonjs/dom/nodes/drawings/AtlasNode.js +47 -0
  134. package/lib/commonjs/dom/nodes/drawings/AtlasNode.js.map +1 -0
  135. package/lib/commonjs/dom/nodes/drawings/index.d.ts +1 -0
  136. package/lib/commonjs/dom/nodes/drawings/index.js +13 -0
  137. package/lib/commonjs/dom/nodes/drawings/index.js.map +1 -1
  138. package/lib/commonjs/dom/types/Drawings.d.ts +7 -1
  139. package/lib/commonjs/dom/types/Drawings.js.map +1 -1
  140. package/lib/commonjs/dom/types/NodeType.d.ts +1 -0
  141. package/lib/commonjs/dom/types/NodeType.js +1 -0
  142. package/lib/commonjs/dom/types/NodeType.js.map +1 -1
  143. package/lib/commonjs/dom/types/SkDOM.d.ts +2 -1
  144. package/lib/commonjs/dom/types/SkDOM.js.map +1 -1
  145. package/lib/commonjs/external/reanimated/buffers.d.ts +5 -0
  146. package/lib/commonjs/external/reanimated/buffers.js +48 -0
  147. package/lib/commonjs/external/reanimated/buffers.js.map +1 -0
  148. package/lib/commonjs/external/reanimated/index.d.ts +2 -0
  149. package/lib/commonjs/external/reanimated/index.js +26 -0
  150. package/lib/commonjs/external/reanimated/index.js.map +1 -1
  151. package/lib/commonjs/external/reanimated/interpolators.js +13 -1
  152. package/lib/commonjs/external/reanimated/interpolators.js.map +1 -1
  153. package/lib/commonjs/external/reanimated/moduleWrapper.d.ts +1 -0
  154. package/lib/commonjs/external/reanimated/moduleWrapper.js +5 -3
  155. package/lib/commonjs/external/reanimated/moduleWrapper.js.map +1 -1
  156. package/lib/commonjs/external/reanimated/textures.d.ts +5 -0
  157. package/lib/commonjs/external/reanimated/textures.js +38 -0
  158. package/lib/commonjs/external/reanimated/textures.js.map +1 -0
  159. package/lib/commonjs/external/reanimated/useAnimatedImageValue.js +8 -1
  160. package/lib/commonjs/external/reanimated/useAnimatedImageValue.js.map +1 -1
  161. package/lib/commonjs/headless/index.js +1 -1
  162. package/lib/commonjs/headless/index.js.map +1 -1
  163. package/lib/commonjs/mock/index.js +8 -0
  164. package/lib/commonjs/mock/index.js.map +1 -1
  165. package/lib/commonjs/renderer/Canvas.js +1 -1
  166. package/lib/commonjs/renderer/Canvas.js.map +1 -1
  167. package/lib/commonjs/renderer/Container.d.ts +1 -1
  168. package/lib/commonjs/renderer/Container.js +2 -1
  169. package/lib/commonjs/renderer/Container.js.map +1 -1
  170. package/lib/commonjs/renderer/HostComponents.d.ts +3 -1
  171. package/lib/commonjs/renderer/HostComponents.js +3 -0
  172. package/lib/commonjs/renderer/HostComponents.js.map +1 -1
  173. package/lib/commonjs/renderer/Offscreen.d.ts +4 -1
  174. package/lib/commonjs/renderer/Offscreen.js +28 -10
  175. package/lib/commonjs/renderer/Offscreen.js.map +1 -1
  176. package/lib/commonjs/renderer/Reconciler.d.ts +1 -1
  177. package/lib/commonjs/renderer/Reconciler.js +7 -4
  178. package/lib/commonjs/renderer/Reconciler.js.map +1 -1
  179. package/lib/commonjs/renderer/components/shapes/Atlas.d.ts +4 -0
  180. package/lib/commonjs/renderer/components/shapes/Atlas.js +17 -0
  181. package/lib/commonjs/renderer/components/shapes/Atlas.js.map +1 -0
  182. package/lib/commonjs/renderer/components/shapes/index.d.ts +1 -0
  183. package/lib/commonjs/renderer/components/shapes/index.js +13 -0
  184. package/lib/commonjs/renderer/components/shapes/index.js.map +1 -1
  185. package/lib/commonjs/skia/core/AnimatedImage.d.ts +1 -1
  186. package/lib/commonjs/skia/core/AnimatedImage.js +4 -1
  187. package/lib/commonjs/skia/core/AnimatedImage.js.map +1 -1
  188. package/lib/commonjs/skia/core/Data.d.ts +1 -1
  189. package/lib/commonjs/skia/core/Data.js +11 -4
  190. package/lib/commonjs/skia/core/Data.js.map +1 -1
  191. package/lib/commonjs/skia/core/Rect.d.ts +2 -2
  192. package/lib/commonjs/skia/types/Canvas.d.ts +16 -1
  193. package/lib/commonjs/skia/types/Canvas.js.map +1 -1
  194. package/lib/commonjs/skia/types/Image/Image.d.ts +8 -0
  195. package/lib/commonjs/skia/types/Image/Image.js.map +1 -1
  196. package/lib/commonjs/skia/types/Matrix4.d.ts +2 -2
  197. package/lib/commonjs/skia/types/Matrix4.js.map +1 -1
  198. package/lib/commonjs/skia/types/RSXform.d.ts +7 -1
  199. package/lib/commonjs/skia/types/RSXform.js.map +1 -1
  200. package/lib/commonjs/skia/types/Rect.d.ts +4 -0
  201. package/lib/commonjs/skia/types/Rect.js.map +1 -1
  202. package/lib/commonjs/skia/types/Shader/Shader.d.ts +1 -1
  203. package/lib/commonjs/skia/types/Shader/Shader.js.map +1 -1
  204. package/lib/commonjs/skia/types/Skia.d.ts +3 -2
  205. package/lib/commonjs/skia/types/Skia.js.map +1 -1
  206. package/lib/commonjs/skia/web/JsiSkCanvas.d.ts +2 -1
  207. package/lib/commonjs/skia/web/JsiSkCanvas.js +19 -0
  208. package/lib/commonjs/skia/web/JsiSkCanvas.js.map +1 -1
  209. package/lib/commonjs/skia/web/JsiSkRSXform.d.ts +8 -2
  210. package/lib/commonjs/skia/web/JsiSkRSXform.js +33 -2
  211. package/lib/commonjs/skia/web/JsiSkRSXform.js.map +1 -1
  212. package/lib/commonjs/skia/web/JsiSkRect.d.ts +3 -2
  213. package/lib/commonjs/skia/web/JsiSkRect.js +7 -0
  214. package/lib/commonjs/skia/web/JsiSkRect.js.map +1 -1
  215. package/lib/commonjs/skia/web/JsiSkTextBlobFactory.js +2 -1
  216. package/lib/commonjs/skia/web/JsiSkTextBlobFactory.js.map +1 -1
  217. package/lib/commonjs/skia/web/JsiSkia.js +5 -0
  218. package/lib/commonjs/skia/web/JsiSkia.js.map +1 -1
  219. package/lib/module/dom/nodes/JsiSkDOM.d.ts +5 -3
  220. package/lib/module/dom/nodes/JsiSkDOM.js +61 -57
  221. package/lib/module/dom/nodes/JsiSkDOM.js.map +1 -1
  222. package/lib/module/dom/nodes/drawings/AtlasNode.d.ts +8 -0
  223. package/lib/module/dom/nodes/drawings/AtlasNode.js +34 -0
  224. package/lib/module/dom/nodes/drawings/AtlasNode.js.map +1 -0
  225. package/lib/module/dom/nodes/drawings/index.d.ts +1 -0
  226. package/lib/module/dom/nodes/drawings/index.js +1 -0
  227. package/lib/module/dom/nodes/drawings/index.js.map +1 -1
  228. package/lib/module/dom/types/Drawings.d.ts +7 -1
  229. package/lib/module/dom/types/Drawings.js.map +1 -1
  230. package/lib/module/dom/types/NodeType.d.ts +1 -0
  231. package/lib/module/dom/types/NodeType.js +1 -0
  232. package/lib/module/dom/types/NodeType.js.map +1 -1
  233. package/lib/module/dom/types/SkDOM.d.ts +2 -1
  234. package/lib/module/dom/types/SkDOM.js.map +1 -1
  235. package/lib/module/external/reanimated/buffers.d.ts +5 -0
  236. package/lib/module/external/reanimated/buffers.js +27 -0
  237. package/lib/module/external/reanimated/buffers.js.map +1 -0
  238. package/lib/module/external/reanimated/index.d.ts +2 -0
  239. package/lib/module/external/reanimated/index.js +2 -0
  240. package/lib/module/external/reanimated/index.js.map +1 -1
  241. package/lib/module/external/reanimated/interpolators.js +13 -1
  242. package/lib/module/external/reanimated/interpolators.js.map +1 -1
  243. package/lib/module/external/reanimated/moduleWrapper.d.ts +1 -0
  244. package/lib/module/external/reanimated/moduleWrapper.js +3 -2
  245. package/lib/module/external/reanimated/moduleWrapper.js.map +1 -1
  246. package/lib/module/external/reanimated/textures.d.ts +5 -0
  247. package/lib/module/external/reanimated/textures.js +24 -0
  248. package/lib/module/external/reanimated/textures.js.map +1 -0
  249. package/lib/module/external/reanimated/useAnimatedImageValue.js +7 -1
  250. package/lib/module/external/reanimated/useAnimatedImageValue.js.map +1 -1
  251. package/lib/module/headless/index.js +1 -1
  252. package/lib/module/headless/index.js.map +1 -1
  253. package/lib/module/mock/index.js +8 -0
  254. package/lib/module/mock/index.js.map +1 -1
  255. package/lib/module/renderer/Canvas.js +1 -1
  256. package/lib/module/renderer/Canvas.js.map +1 -1
  257. package/lib/module/renderer/Container.d.ts +1 -1
  258. package/lib/module/renderer/Container.js +2 -1
  259. package/lib/module/renderer/Container.js.map +1 -1
  260. package/lib/module/renderer/HostComponents.d.ts +3 -1
  261. package/lib/module/renderer/HostComponents.js +3 -0
  262. package/lib/module/renderer/HostComponents.js.map +1 -1
  263. package/lib/module/renderer/Offscreen.d.ts +4 -1
  264. package/lib/module/renderer/Offscreen.js +19 -9
  265. package/lib/module/renderer/Offscreen.js.map +1 -1
  266. package/lib/module/renderer/Reconciler.d.ts +1 -1
  267. package/lib/module/renderer/Reconciler.js +7 -4
  268. package/lib/module/renderer/Reconciler.js.map +1 -1
  269. package/lib/module/renderer/components/shapes/Atlas.d.ts +4 -0
  270. package/lib/module/renderer/components/shapes/Atlas.js +5 -0
  271. package/lib/module/renderer/components/shapes/Atlas.js.map +1 -0
  272. package/lib/module/renderer/components/shapes/index.d.ts +1 -0
  273. package/lib/module/renderer/components/shapes/index.js +1 -0
  274. package/lib/module/renderer/components/shapes/index.js.map +1 -1
  275. package/lib/module/skia/core/AnimatedImage.d.ts +1 -1
  276. package/lib/module/skia/core/AnimatedImage.js +4 -1
  277. package/lib/module/skia/core/AnimatedImage.js.map +1 -1
  278. package/lib/module/skia/core/Data.d.ts +1 -1
  279. package/lib/module/skia/core/Data.js +11 -4
  280. package/lib/module/skia/core/Data.js.map +1 -1
  281. package/lib/module/skia/core/Rect.d.ts +2 -2
  282. package/lib/module/skia/types/Canvas.d.ts +16 -1
  283. package/lib/module/skia/types/Canvas.js.map +1 -1
  284. package/lib/module/skia/types/Image/Image.d.ts +8 -0
  285. package/lib/module/skia/types/Image/Image.js.map +1 -1
  286. package/lib/module/skia/types/Matrix4.d.ts +2 -2
  287. package/lib/module/skia/types/Matrix4.js.map +1 -1
  288. package/lib/module/skia/types/RSXform.d.ts +7 -1
  289. package/lib/module/skia/types/RSXform.js.map +1 -1
  290. package/lib/module/skia/types/Rect.d.ts +4 -0
  291. package/lib/module/skia/types/Rect.js.map +1 -1
  292. package/lib/module/skia/types/Shader/Shader.d.ts +1 -1
  293. package/lib/module/skia/types/Shader/Shader.js.map +1 -1
  294. package/lib/module/skia/types/Skia.d.ts +3 -2
  295. package/lib/module/skia/types/Skia.js.map +1 -1
  296. package/lib/module/skia/web/JsiSkCanvas.d.ts +2 -1
  297. package/lib/module/skia/web/JsiSkCanvas.js +18 -0
  298. package/lib/module/skia/web/JsiSkCanvas.js.map +1 -1
  299. package/lib/module/skia/web/JsiSkRSXform.d.ts +8 -2
  300. package/lib/module/skia/web/JsiSkRSXform.js +34 -3
  301. package/lib/module/skia/web/JsiSkRSXform.js.map +1 -1
  302. package/lib/module/skia/web/JsiSkRect.d.ts +3 -2
  303. package/lib/module/skia/web/JsiSkRect.js +7 -0
  304. package/lib/module/skia/web/JsiSkRect.js.map +1 -1
  305. package/lib/module/skia/web/JsiSkTextBlobFactory.js +2 -1
  306. package/lib/module/skia/web/JsiSkTextBlobFactory.js.map +1 -1
  307. package/lib/module/skia/web/JsiSkia.js +5 -0
  308. package/lib/module/skia/web/JsiSkia.js.map +1 -1
  309. package/lib/typescript/src/dom/nodes/JsiSkDOM.d.ts +5 -3
  310. package/lib/typescript/src/dom/nodes/drawings/AtlasNode.d.ts +8 -0
  311. package/lib/typescript/src/dom/nodes/drawings/index.d.ts +1 -0
  312. package/lib/typescript/src/dom/types/Drawings.d.ts +7 -1
  313. package/lib/typescript/src/dom/types/NodeType.d.ts +1 -0
  314. package/lib/typescript/src/dom/types/SkDOM.d.ts +2 -1
  315. package/lib/typescript/src/external/reanimated/buffers.d.ts +5 -0
  316. package/lib/typescript/src/external/reanimated/index.d.ts +2 -0
  317. package/lib/typescript/src/external/reanimated/moduleWrapper.d.ts +1 -0
  318. package/lib/typescript/src/external/reanimated/textures.d.ts +5 -0
  319. package/lib/typescript/src/renderer/Container.d.ts +1 -1
  320. package/lib/typescript/src/renderer/HostComponents.d.ts +3 -1
  321. package/lib/typescript/src/renderer/Offscreen.d.ts +4 -1
  322. package/lib/typescript/src/renderer/Reconciler.d.ts +1 -1
  323. package/lib/typescript/src/renderer/components/shapes/Atlas.d.ts +4 -0
  324. package/lib/typescript/src/renderer/components/shapes/index.d.ts +1 -0
  325. package/lib/typescript/src/skia/core/AnimatedImage.d.ts +1 -1
  326. package/lib/typescript/src/skia/core/Data.d.ts +1 -1
  327. package/lib/typescript/src/skia/core/Rect.d.ts +2 -2
  328. package/lib/typescript/src/skia/types/Canvas.d.ts +16 -1
  329. package/lib/typescript/src/skia/types/Image/Image.d.ts +8 -0
  330. package/lib/typescript/src/skia/types/Matrix4.d.ts +2 -2
  331. package/lib/typescript/src/skia/types/RSXform.d.ts +7 -1
  332. package/lib/typescript/src/skia/types/Rect.d.ts +4 -0
  333. package/lib/typescript/src/skia/types/Shader/Shader.d.ts +1 -1
  334. package/lib/typescript/src/skia/types/Skia.d.ts +3 -2
  335. package/lib/typescript/src/skia/web/JsiSkCanvas.d.ts +2 -1
  336. package/lib/typescript/src/skia/web/JsiSkRSXform.d.ts +8 -2
  337. package/lib/typescript/src/skia/web/JsiSkRect.d.ts +3 -2
  338. package/libs/android/arm64-v8a/libskia.a +0 -0
  339. package/libs/android/arm64-v8a/libskottie.a +0 -0
  340. package/libs/android/arm64-v8a/libskparagraph.a +0 -0
  341. package/libs/android/arm64-v8a/libsksg.a +0 -0
  342. package/libs/android/arm64-v8a/libskshaper.a +0 -0
  343. package/libs/android/arm64-v8a/libskunicode.a +0 -0
  344. package/libs/android/arm64-v8a/libsvg.a +0 -0
  345. package/libs/android/armeabi-v7a/libskia.a +0 -0
  346. package/libs/android/armeabi-v7a/libskottie.a +0 -0
  347. package/libs/android/armeabi-v7a/libskparagraph.a +0 -0
  348. package/libs/android/armeabi-v7a/libsksg.a +0 -0
  349. package/libs/android/armeabi-v7a/libskshaper.a +0 -0
  350. package/libs/android/armeabi-v7a/libskunicode.a +0 -0
  351. package/libs/android/armeabi-v7a/libsvg.a +0 -0
  352. package/libs/android/x86/libskia.a +0 -0
  353. package/libs/android/x86/libskottie.a +0 -0
  354. package/libs/android/x86/libskparagraph.a +0 -0
  355. package/libs/android/x86/libsksg.a +0 -0
  356. package/libs/android/x86/libskshaper.a +0 -0
  357. package/libs/android/x86/libskunicode.a +0 -0
  358. package/libs/android/x86/libsvg.a +0 -0
  359. package/libs/android/x86_64/libskia.a +0 -0
  360. package/libs/android/x86_64/libskottie.a +0 -0
  361. package/libs/android/x86_64/libskparagraph.a +0 -0
  362. package/libs/android/x86_64/libsksg.a +0 -0
  363. package/libs/android/x86_64/libskshaper.a +0 -0
  364. package/libs/android/x86_64/libskunicode.a +0 -0
  365. package/libs/android/x86_64/libsvg.a +0 -0
  366. package/libs/ios/libskia.xcframework/ios-arm64_arm64e/libskia.a +0 -0
  367. package/libs/ios/libskia.xcframework/ios-arm64_arm64e_x86_64-simulator/libskia.a +0 -0
  368. package/libs/ios/libskottie.xcframework/ios-arm64_arm64e/libskottie.a +0 -0
  369. package/libs/ios/libskottie.xcframework/ios-arm64_arm64e_x86_64-simulator/libskottie.a +0 -0
  370. package/libs/ios/libskparagraph.xcframework/ios-arm64_arm64e/libskparagraph.a +0 -0
  371. package/libs/ios/libskparagraph.xcframework/ios-arm64_arm64e_x86_64-simulator/libskparagraph.a +0 -0
  372. package/libs/ios/libsksg.xcframework/ios-arm64_arm64e/libsksg.a +0 -0
  373. package/libs/ios/libsksg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsksg.a +0 -0
  374. package/libs/ios/libskshaper.xcframework/Info.plist +5 -5
  375. package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e/libskshaper.a +0 -0
  376. package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e_x86_64-simulator/libskshaper.a +0 -0
  377. package/libs/ios/libskunicode.xcframework/ios-arm64_arm64e/libskunicode.a +0 -0
  378. package/libs/ios/libskunicode.xcframework/ios-arm64_arm64e_x86_64-simulator/libskunicode.a +0 -0
  379. package/libs/ios/libsvg.xcframework/Info.plist +5 -5
  380. package/libs/ios/libsvg.xcframework/ios-arm64_arm64e/libsvg.a +0 -0
  381. package/libs/ios/libsvg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsvg.a +0 -0
  382. package/package.json +1 -1
  383. package/src/dom/nodes/JsiSkDOM.ts +63 -56
  384. package/src/dom/nodes/drawings/AtlasNode.ts +24 -0
  385. package/src/dom/nodes/drawings/index.ts +1 -0
  386. package/src/dom/types/Drawings.ts +9 -0
  387. package/src/dom/types/NodeType.ts +1 -0
  388. package/src/dom/types/SkDOM.ts +2 -0
  389. package/src/external/reanimated/buffers.ts +53 -0
  390. package/src/external/reanimated/index.ts +2 -0
  391. package/src/external/reanimated/interpolators.ts +15 -2
  392. package/src/external/reanimated/moduleWrapper.ts +1 -0
  393. package/src/external/reanimated/textures.tsx +38 -0
  394. package/src/external/reanimated/useAnimatedImageValue.ts +15 -4
  395. package/src/headless/index.ts +1 -1
  396. package/src/mock/index.ts +8 -0
  397. package/src/renderer/Canvas.tsx +1 -1
  398. package/src/renderer/Container.tsx +3 -2
  399. package/src/renderer/HostComponents.ts +6 -1
  400. package/src/renderer/Offscreen.tsx +24 -11
  401. package/src/renderer/Reconciler.tsx +5 -2
  402. package/src/renderer/components/shapes/Atlas.tsx +8 -0
  403. package/src/renderer/components/shapes/index.ts +1 -0
  404. package/src/skia/core/AnimatedImage.ts +3 -2
  405. package/src/skia/core/Data.ts +8 -4
  406. package/src/skia/types/Canvas.ts +32 -1
  407. package/src/skia/types/Image/Image.ts +10 -0
  408. package/src/skia/types/Matrix4.ts +2 -2
  409. package/src/skia/types/RSXform.ts +7 -1
  410. package/src/skia/types/Rect.ts +6 -0
  411. package/src/skia/types/Shader/Shader.ts +6 -1
  412. package/src/skia/types/Skia.ts +10 -2
  413. package/src/skia/web/JsiSkCanvas.ts +60 -23
  414. package/src/skia/web/JsiSkRSXform.ts +28 -4
  415. package/src/skia/web/JsiSkRect.ts +12 -2
  416. package/src/skia/web/JsiSkTextBlobFactory.ts +5 -5
  417. package/src/skia/web/JsiSkia.ts +15 -0
  418. package/cpp/skia/include/gpu/GrSurfaceInfo.h +0 -142
  419. package/cpp/skia/include/private/gpu/ganesh/GrGLTypesPriv.h +0 -107
  420. package/cpp/skia/include/private/gpu/ganesh/GrMockTypesPriv.h +0 -32
  421. package/cpp/skia/include/private/gpu/ganesh/GrMtlTypesPriv.h +0 -83
  422. package/cpp/skia/include/private/gpu/ganesh/GrVkTypesPriv.h +0 -47
  423. package/cpp/skia/include/private/gpu/vk/VulkanTypesPriv.h +0 -57
  424. package/cpp/skia/include/utils/SkBase64.h +0 -53
  425. package/cpp/skia/modules/skcms/skcms_internal.h +0 -56
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useTextureValueFromPicture = exports.useTextureValue = void 0;
7
+
8
+ var _react = require("react");
9
+
10
+ var _Offscreen = require("../../renderer/Offscreen");
11
+
12
+ var _moduleWrapper = require("./moduleWrapper");
13
+
14
+ const createTextureValue = (texture, picture, size) => {
15
+ "worklet";
16
+
17
+ texture.value = (0, _Offscreen.drawAsImageFromPicture)(picture, size);
18
+ };
19
+
20
+ const useTextureValue = (element, size) => {
21
+ const picture = (0, _react.useMemo)(() => {
22
+ return (0, _Offscreen.drawAsPicture)(element);
23
+ }, [element]);
24
+ return useTextureValueFromPicture(picture, size);
25
+ };
26
+
27
+ exports.useTextureValue = useTextureValue;
28
+
29
+ const useTextureValueFromPicture = (picture, size) => {
30
+ const texture = (0, _moduleWrapper.useSharedValue)(null);
31
+ (0, _react.useEffect)(() => {
32
+ (0, _moduleWrapper.runOnUI)(createTextureValue)(texture, picture, size);
33
+ }, [texture, picture, size]);
34
+ return texture;
35
+ };
36
+
37
+ exports.useTextureValueFromPicture = useTextureValueFromPicture;
38
+ //# sourceMappingURL=textures.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createTextureValue","texture","picture","size","value","drawAsImageFromPicture","useTextureValue","element","useMemo","drawAsPicture","useTextureValueFromPicture","useSharedValue","useEffect","runOnUI"],"sources":["textures.tsx"],"sourcesContent":["import { useEffect, useMemo } from \"react\";\nimport type { ReactElement } from \"react\";\nimport type { SharedValue } from \"react-native-reanimated\";\n\nimport type { SkImage, SkPicture, SkSize } from \"../../skia/types\";\nimport {\n drawAsImageFromPicture,\n drawAsPicture,\n} from \"../../renderer/Offscreen\";\n\nimport { runOnUI, useSharedValue } from \"./moduleWrapper\";\n\nconst createTextureValue = (\n texture: SharedValue<SkImage | null>,\n picture: SkPicture,\n size: SkSize\n) => {\n \"worklet\";\n texture.value = drawAsImageFromPicture(picture, size);\n};\n\nexport const useTextureValue = (element: ReactElement, size: SkSize) => {\n const picture = useMemo(() => {\n return drawAsPicture(element);\n }, [element]);\n return useTextureValueFromPicture(picture, size);\n};\n\nexport const useTextureValueFromPicture = (\n picture: SkPicture,\n size: SkSize\n) => {\n const texture = useSharedValue<SkImage | null>(null);\n useEffect(() => {\n runOnUI(createTextureValue)(texture, picture, size);\n }, [texture, picture, size]);\n return texture;\n};\n"],"mappings":";;;;;;;AAAA;;AAKA;;AAKA;;AAEA,MAAMA,kBAAkB,GAAG,CACzBC,OADyB,EAEzBC,OAFyB,EAGzBC,IAHyB,KAItB;EACH;;EACAF,OAAO,CAACG,KAAR,GAAgB,IAAAC,iCAAA,EAAuBH,OAAvB,EAAgCC,IAAhC,CAAhB;AACD,CAPD;;AASO,MAAMG,eAAe,GAAG,CAACC,OAAD,EAAwBJ,IAAxB,KAAyC;EACtE,MAAMD,OAAO,GAAG,IAAAM,cAAA,EAAQ,MAAM;IAC5B,OAAO,IAAAC,wBAAA,EAAcF,OAAd,CAAP;EACD,CAFe,EAEb,CAACA,OAAD,CAFa,CAAhB;EAGA,OAAOG,0BAA0B,CAACR,OAAD,EAAUC,IAAV,CAAjC;AACD,CALM;;;;AAOA,MAAMO,0BAA0B,GAAG,CACxCR,OADwC,EAExCC,IAFwC,KAGrC;EACH,MAAMF,OAAO,GAAG,IAAAU,6BAAA,EAA+B,IAA/B,CAAhB;EACA,IAAAC,gBAAA,EAAU,MAAM;IACd,IAAAC,sBAAA,EAAQb,kBAAR,EAA4BC,OAA5B,EAAqCC,OAArC,EAA8CC,IAA9C;EACD,CAFD,EAEG,CAACF,OAAD,EAAUC,OAAV,EAAmBC,IAAnB,CAFH;EAGA,OAAOF,OAAP;AACD,CATM"}
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.useAnimatedImageValue = void 0;
7
7
 
8
+ var _react = require("react");
9
+
8
10
  var _AnimatedImage = require("../../skia/core/AnimatedImage");
9
11
 
10
12
  var _moduleWrapper = require("./moduleWrapper");
@@ -18,7 +20,7 @@ const useAnimatedImageValue = source => {
18
20
  const animatedImage = (0, _AnimatedImage.useAnimatedImage)(source, err => {
19
21
  console.error(err);
20
22
  throw new Error(`Could not load animated image - got '${err.message}'`);
21
- });
23
+ }, false);
22
24
  const frameDuration = (animatedImage === null || animatedImage === void 0 ? void 0 : animatedImage.currentFrameDuration()) || DEFAULT_FRAME_DURATION;
23
25
  (0, _moduleWrapper.useFrameCallback)(frameInfo => {
24
26
  if (!animatedImage) {
@@ -46,6 +48,11 @@ const useAnimatedImageValue = source => {
46
48
 
47
49
  lastTimestamp.value = timestamp; // eslint-disable-next-line react-hooks/exhaustive-deps
48
50
  }, true);
51
+ (0, _react.useEffect)(() => {
52
+ return () => {
53
+ animatedImage === null || animatedImage === void 0 ? void 0 : animatedImage.dispose();
54
+ }; // eslint-disable-next-line react-hooks/exhaustive-deps
55
+ }, []);
49
56
  return currentFrame;
50
57
  };
51
58
 
@@ -1 +1 @@
1
- {"version":3,"names":["DEFAULT_FRAME_DURATION","useAnimatedImageValue","source","throwOnMissingReanimated","currentFrame","useSharedValue","lastTimestamp","animatedImage","useAnimatedImage","err","console","error","Error","message","frameDuration","currentFrameDuration","useFrameCallback","frameInfo","value","timestamp","elapsed","decodeNextFrame","dispose","getCurrentFrame"],"sources":["useAnimatedImageValue.ts"],"sourcesContent":["import type { FrameInfo } from \"react-native-reanimated\";\n\nimport { useAnimatedImage } from \"../../skia/core/AnimatedImage\";\nimport type { DataSourceParam, SkImage } from \"../../skia/types\";\n\nimport {\n throwOnMissingReanimated,\n useFrameCallback,\n useSharedValue,\n} from \"./moduleWrapper\";\n\nconst DEFAULT_FRAME_DURATION = 60;\n\nexport const useAnimatedImageValue = (source: DataSourceParam) => {\n throwOnMissingReanimated();\n const currentFrame = useSharedValue<null | SkImage>(null);\n const lastTimestamp = useSharedValue(0);\n const animatedImage = useAnimatedImage(source, (err) => {\n console.error(err);\n throw new Error(`Could not load animated image - got '${err.message}'`);\n });\n const frameDuration =\n animatedImage?.currentFrameDuration() || DEFAULT_FRAME_DURATION;\n\n useFrameCallback((frameInfo: FrameInfo) => {\n if (!animatedImage) {\n currentFrame.value = null;\n return;\n }\n\n const { timestamp } = frameInfo;\n const elapsed = timestamp - lastTimestamp.value;\n\n // Check if it's time to switch frames based on GIF frame duration\n if (elapsed < frameDuration) {\n return;\n }\n\n // Update the current frame\n animatedImage.decodeNextFrame();\n if (currentFrame.value) {\n currentFrame.value.dispose();\n }\n currentFrame.value = animatedImage.getCurrentFrame();\n\n // Update the last timestamp\n lastTimestamp.value = timestamp;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, true);\n return currentFrame;\n};\n"],"mappings":";;;;;;;AAEA;;AAGA;;AAMA,MAAMA,sBAAsB,GAAG,EAA/B;;AAEO,MAAMC,qBAAqB,GAAIC,MAAD,IAA6B;EAChE,IAAAC,uCAAA;EACA,MAAMC,YAAY,GAAG,IAAAC,6BAAA,EAA+B,IAA/B,CAArB;EACA,MAAMC,aAAa,GAAG,IAAAD,6BAAA,EAAe,CAAf,CAAtB;EACA,MAAME,aAAa,GAAG,IAAAC,+BAAA,EAAiBN,MAAjB,EAA0BO,GAAD,IAAS;IACtDC,OAAO,CAACC,KAAR,CAAcF,GAAd;IACA,MAAM,IAAIG,KAAJ,CAAW,wCAAuCH,GAAG,CAACI,OAAQ,GAA9D,CAAN;EACD,CAHqB,CAAtB;EAIA,MAAMC,aAAa,GACjB,CAAAP,aAAa,SAAb,IAAAA,aAAa,WAAb,YAAAA,aAAa,CAAEQ,oBAAf,OAAyCf,sBAD3C;EAGA,IAAAgB,+BAAA,EAAkBC,SAAD,IAA0B;IACzC,IAAI,CAACV,aAAL,EAAoB;MAClBH,YAAY,CAACc,KAAb,GAAqB,IAArB;MACA;IACD;;IAED,MAAM;MAAEC;IAAF,IAAgBF,SAAtB;IACA,MAAMG,OAAO,GAAGD,SAAS,GAAGb,aAAa,CAACY,KAA1C,CAPyC,CASzC;;IACA,IAAIE,OAAO,GAAGN,aAAd,EAA6B;MAC3B;IACD,CAZwC,CAczC;;;IACAP,aAAa,CAACc,eAAd;;IACA,IAAIjB,YAAY,CAACc,KAAjB,EAAwB;MACtBd,YAAY,CAACc,KAAb,CAAmBI,OAAnB;IACD;;IACDlB,YAAY,CAACc,KAAb,GAAqBX,aAAa,CAACgB,eAAd,EAArB,CAnByC,CAqBzC;;IACAjB,aAAa,CAACY,KAAd,GAAsBC,SAAtB,CAtByC,CAuBzC;EACD,CAxBD,EAwBG,IAxBH;EAyBA,OAAOf,YAAP;AACD,CArCM"}
1
+ {"version":3,"names":["DEFAULT_FRAME_DURATION","useAnimatedImageValue","source","throwOnMissingReanimated","currentFrame","useSharedValue","lastTimestamp","animatedImage","useAnimatedImage","err","console","error","Error","message","frameDuration","currentFrameDuration","useFrameCallback","frameInfo","value","timestamp","elapsed","decodeNextFrame","dispose","getCurrentFrame","useEffect"],"sources":["useAnimatedImageValue.ts"],"sourcesContent":["import { useEffect } from \"react\";\nimport type { FrameInfo } from \"react-native-reanimated\";\n\nimport { useAnimatedImage } from \"../../skia/core/AnimatedImage\";\nimport type { DataSourceParam, SkImage } from \"../../skia/types\";\n\nimport {\n throwOnMissingReanimated,\n useFrameCallback,\n useSharedValue,\n} from \"./moduleWrapper\";\n\nconst DEFAULT_FRAME_DURATION = 60;\n\nexport const useAnimatedImageValue = (source: DataSourceParam) => {\n throwOnMissingReanimated();\n const currentFrame = useSharedValue<null | SkImage>(null);\n const lastTimestamp = useSharedValue(0);\n const animatedImage = useAnimatedImage(\n source,\n (err) => {\n console.error(err);\n throw new Error(`Could not load animated image - got '${err.message}'`);\n },\n false\n );\n const frameDuration =\n animatedImage?.currentFrameDuration() || DEFAULT_FRAME_DURATION;\n\n useFrameCallback((frameInfo: FrameInfo) => {\n if (!animatedImage) {\n currentFrame.value = null;\n return;\n }\n\n const { timestamp } = frameInfo;\n const elapsed = timestamp - lastTimestamp.value;\n\n // Check if it's time to switch frames based on GIF frame duration\n if (elapsed < frameDuration) {\n return;\n }\n\n // Update the current frame\n animatedImage.decodeNextFrame();\n if (currentFrame.value) {\n currentFrame.value.dispose();\n }\n currentFrame.value = animatedImage.getCurrentFrame();\n\n // Update the last timestamp\n lastTimestamp.value = timestamp;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, true);\n useEffect(() => {\n return () => {\n animatedImage?.dispose();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n return currentFrame;\n};\n"],"mappings":";;;;;;;AAAA;;AAGA;;AAGA;;AAMA,MAAMA,sBAAsB,GAAG,EAA/B;;AAEO,MAAMC,qBAAqB,GAAIC,MAAD,IAA6B;EAChE,IAAAC,uCAAA;EACA,MAAMC,YAAY,GAAG,IAAAC,6BAAA,EAA+B,IAA/B,CAArB;EACA,MAAMC,aAAa,GAAG,IAAAD,6BAAA,EAAe,CAAf,CAAtB;EACA,MAAME,aAAa,GAAG,IAAAC,+BAAA,EACpBN,MADoB,EAEnBO,GAAD,IAAS;IACPC,OAAO,CAACC,KAAR,CAAcF,GAAd;IACA,MAAM,IAAIG,KAAJ,CAAW,wCAAuCH,GAAG,CAACI,OAAQ,GAA9D,CAAN;EACD,CALmB,EAMpB,KANoB,CAAtB;EAQA,MAAMC,aAAa,GACjB,CAAAP,aAAa,SAAb,IAAAA,aAAa,WAAb,YAAAA,aAAa,CAAEQ,oBAAf,OAAyCf,sBAD3C;EAGA,IAAAgB,+BAAA,EAAkBC,SAAD,IAA0B;IACzC,IAAI,CAACV,aAAL,EAAoB;MAClBH,YAAY,CAACc,KAAb,GAAqB,IAArB;MACA;IACD;;IAED,MAAM;MAAEC;IAAF,IAAgBF,SAAtB;IACA,MAAMG,OAAO,GAAGD,SAAS,GAAGb,aAAa,CAACY,KAA1C,CAPyC,CASzC;;IACA,IAAIE,OAAO,GAAGN,aAAd,EAA6B;MAC3B;IACD,CAZwC,CAczC;;;IACAP,aAAa,CAACc,eAAd;;IACA,IAAIjB,YAAY,CAACc,KAAjB,EAAwB;MACtBd,YAAY,CAACc,KAAb,CAAmBI,OAAnB;IACD;;IACDlB,YAAY,CAACc,KAAb,GAAqBX,aAAa,CAACgB,eAAd,EAArB,CAnByC,CAqBzC;;IACAjB,aAAa,CAACY,KAAd,GAAsBC,SAAtB,CAtByC,CAuBzC;EACD,CAxBD,EAwBG,IAxBH;EAyBA,IAAAK,gBAAA,EAAU,MAAM;IACd,OAAO,MAAM;MACXjB,aAAa,SAAb,IAAAA,aAAa,WAAb,YAAAA,aAAa,CAAEe,OAAf;IACD,CAFD,CADc,CAId;EACD,CALD,EAKG,EALH;EAMA,OAAOlB,YAAP;AACD,CA/CM"}
@@ -50,7 +50,7 @@ const makeOffscreenSurface = (width, height) => {
50
50
  exports.makeOffscreenSurface = makeOffscreenSurface;
51
51
 
52
52
  const drawOffscreen = (surface, element) => {
53
- const root = new _Reconciler.SkiaRoot(Skia);
53
+ const root = new _Reconciler.SkiaRoot(Skia, false);
54
54
  root.render(element);
55
55
  const canvas = surface.getCanvas();
56
56
  const ctx = new _types.JsiDrawingContext(Skia, canvas);
@@ -1 +1 @@
1
- {"version":3,"names":["Skia","makeOffscreenSurface","width","height","JsiSkApi","CanvasKit","surface","Surface","MakeOffscreen","Error","drawOffscreen","element","root","SkiaRoot","render","canvas","getCanvas","ctx","JsiDrawingContext","dom","flush","makeImageSnapshot"],"sources":["index.ts"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nimport CanvasKitInit from \"canvaskit-wasm/bin/full/canvaskit\";\nimport type { ReactNode } from \"react\";\n\nimport { JsiSkApi } from \"../skia/web\";\nimport { SkiaRoot } from \"../renderer/Reconciler\";\nimport { JsiDrawingContext } from \"../dom/types\";\nimport type { SkSurface } from \"../skia\";\n\nexport * from \"../renderer/components\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nlet Skia: any;\n\nexport const makeOffscreenSurface = (width: number, height: number) => {\n if (!Skia) {\n Skia = JsiSkApi(CanvasKit);\n }\n const surface = Skia.Surface.MakeOffscreen(width, height);\n if (surface === null) {\n throw new Error(\"Couldn't create surface!\");\n }\n return surface;\n};\n\nexport const drawOffscreen = (surface: SkSurface, element: ReactNode) => {\n const root = new SkiaRoot(Skia);\n root.render(element);\n const canvas = surface.getCanvas();\n const ctx = new JsiDrawingContext(Skia, canvas);\n root.dom.render(ctx);\n surface.flush();\n return surface.makeImageSnapshot();\n};\n"],"mappings":";;;;;;;;;;;AAKA;;AACA;;AACA;;AAGA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AAVA;AACA;AAWA;AACA,IAAIA,IAAJ;;AAEO,MAAMC,oBAAoB,GAAG,CAACC,KAAD,EAAgBC,MAAhB,KAAmC;EACrE,IAAI,CAACH,IAAL,EAAW;IACTA,IAAI,GAAG,IAAAI,aAAA,EAASC,SAAT,CAAP;EACD;;EACD,MAAMC,OAAO,GAAGN,IAAI,CAACO,OAAL,CAAaC,aAAb,CAA2BN,KAA3B,EAAkCC,MAAlC,CAAhB;;EACA,IAAIG,OAAO,KAAK,IAAhB,EAAsB;IACpB,MAAM,IAAIG,KAAJ,CAAU,0BAAV,CAAN;EACD;;EACD,OAAOH,OAAP;AACD,CATM;;;;AAWA,MAAMI,aAAa,GAAG,CAACJ,OAAD,EAAqBK,OAArB,KAA4C;EACvE,MAAMC,IAAI,GAAG,IAAIC,oBAAJ,CAAab,IAAb,CAAb;EACAY,IAAI,CAACE,MAAL,CAAYH,OAAZ;EACA,MAAMI,MAAM,GAAGT,OAAO,CAACU,SAAR,EAAf;EACA,MAAMC,GAAG,GAAG,IAAIC,wBAAJ,CAAsBlB,IAAtB,EAA4Be,MAA5B,CAAZ;EACAH,IAAI,CAACO,GAAL,CAASL,MAAT,CAAgBG,GAAhB;EACAX,OAAO,CAACc,KAAR;EACA,OAAOd,OAAO,CAACe,iBAAR,EAAP;AACD,CARM"}
1
+ {"version":3,"names":["Skia","makeOffscreenSurface","width","height","JsiSkApi","CanvasKit","surface","Surface","MakeOffscreen","Error","drawOffscreen","element","root","SkiaRoot","render","canvas","getCanvas","ctx","JsiDrawingContext","dom","flush","makeImageSnapshot"],"sources":["index.ts"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nimport CanvasKitInit from \"canvaskit-wasm/bin/full/canvaskit\";\nimport type { ReactNode } from \"react\";\n\nimport { JsiSkApi } from \"../skia/web\";\nimport { SkiaRoot } from \"../renderer/Reconciler\";\nimport { JsiDrawingContext } from \"../dom/types\";\nimport type { SkSurface } from \"../skia\";\n\nexport * from \"../renderer/components\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nlet Skia: any;\n\nexport const makeOffscreenSurface = (width: number, height: number) => {\n if (!Skia) {\n Skia = JsiSkApi(CanvasKit);\n }\n const surface = Skia.Surface.MakeOffscreen(width, height);\n if (surface === null) {\n throw new Error(\"Couldn't create surface!\");\n }\n return surface;\n};\n\nexport const drawOffscreen = (surface: SkSurface, element: ReactNode) => {\n const root = new SkiaRoot(Skia, false);\n root.render(element);\n const canvas = surface.getCanvas();\n const ctx = new JsiDrawingContext(Skia, canvas);\n root.dom.render(ctx);\n surface.flush();\n return surface.makeImageSnapshot();\n};\n"],"mappings":";;;;;;;;;;;AAKA;;AACA;;AACA;;AAGA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AAVA;AACA;AAWA;AACA,IAAIA,IAAJ;;AAEO,MAAMC,oBAAoB,GAAG,CAACC,KAAD,EAAgBC,MAAhB,KAAmC;EACrE,IAAI,CAACH,IAAL,EAAW;IACTA,IAAI,GAAG,IAAAI,aAAA,EAASC,SAAT,CAAP;EACD;;EACD,MAAMC,OAAO,GAAGN,IAAI,CAACO,OAAL,CAAaC,aAAb,CAA2BN,KAA3B,EAAkCC,MAAlC,CAAhB;;EACA,IAAIG,OAAO,KAAK,IAAhB,EAAsB;IACpB,MAAM,IAAIG,KAAJ,CAAU,0BAAV,CAAN;EACD;;EACD,OAAOH,OAAP;AACD,CATM;;;;AAWA,MAAMI,aAAa,GAAG,CAACJ,OAAD,EAAqBK,OAArB,KAA4C;EACvE,MAAMC,IAAI,GAAG,IAAIC,oBAAJ,CAAab,IAAb,EAAmB,KAAnB,CAAb;EACAY,IAAI,CAACE,MAAL,CAAYH,OAAZ;EACA,MAAMI,MAAM,GAAGT,OAAO,CAACU,SAAR,EAAf;EACA,MAAMC,GAAG,GAAG,IAAIC,wBAAJ,CAAsBlB,IAAtB,EAA4Be,MAA5B,CAAZ;EACAH,IAAI,CAACO,GAAL,CAASL,MAAT,CAAgBG,GAAhB;EACAX,OAAO,CAACc,KAAR;EACA,OAAOd,OAAO,CAACe,iBAAR,EAAP;AACD,CARM"}
@@ -42,9 +42,17 @@ const Mock = CanvasKit => {
42
42
  // Reanimated hooks
43
43
  useClock: NoopSharedValue,
44
44
  usePathInterpolation: NoopSharedValue,
45
+ useTextureValue: NoopSharedValue,
46
+ useTextureValueFromPicture: NoopSharedValue,
47
+ useRSXformBuffer: NoopSharedValue,
48
+ usePointBuffer: NoopSharedValue,
49
+ useColorBuffer: NoopSharedValue,
50
+ useRectBuffer: NoopSharedValue,
51
+ useBuffer: NoopSharedValue,
45
52
  useRawData: Noop,
46
53
  useData: Noop,
47
54
  useFont: () => Skia.Font(undefined, 0),
55
+ useFonts: Noop,
48
56
  useTypeface: () => null,
49
57
  useImage: () => null,
50
58
  useSVG: () => null
@@ -1 +1 @@
1
- {"version":3,"names":["Noop","undefined","NoopValue","current","NoopSharedValue","value","Mock","CanvasKit","global","SkiaApi","JsiSkApi","Skia","require","Canvas","useValue","useComputedValue","useTouchHandler","useTiming","useLoop","useSpring","useClockValue","useValueEffect","useClock","usePathInterpolation","useRawData","useData","useFont","Font","useTypeface","useImage","useSVG"],"sources":["index.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport { JsiSkApi } from \"../skia/web\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst Noop: () => any = () => undefined;\nconst NoopValue = () => ({ current: 0 });\nconst NoopSharedValue = () => ({ value: 0 });\n\nexport const Mock = (CanvasKit: CanvasKit) => {\n global.SkiaApi = JsiSkApi(CanvasKit);\n const Skia = global.SkiaApi;\n return {\n Skia,\n ...require(\"../renderer/components\"),\n ...require(\"../skia\"),\n ...require(\"../animation\"),\n ...require(\"../dom/types\"),\n ...require(\"../dom/nodes\"),\n // We could use the real Canvas if we mock the SkiaView component for node\n Canvas: Noop,\n // Skia Animations\n useValue: NoopValue,\n useComputedValue: NoopValue,\n useTouchHandler: Noop,\n useTiming: NoopValue,\n useLoop: NoopValue,\n useSpring: NoopValue,\n useClockValue: NoopValue,\n useValueEffect: Noop,\n // Reanimated hooks\n useClock: NoopSharedValue,\n usePathInterpolation: NoopSharedValue,\n useRawData: Noop,\n useData: Noop,\n useFont: () => Skia.Font(undefined, 0),\n useTypeface: () => null,\n useImage: () => null,\n useSVG: () => null,\n };\n};\n"],"mappings":";;;;;;;AAEA;;AAEA;AACA,MAAMA,IAAe,GAAG,MAAMC,SAA9B;;AACA,MAAMC,SAAS,GAAG,OAAO;EAAEC,OAAO,EAAE;AAAX,CAAP,CAAlB;;AACA,MAAMC,eAAe,GAAG,OAAO;EAAEC,KAAK,EAAE;AAAT,CAAP,CAAxB;;AAEO,MAAMC,IAAI,GAAIC,SAAD,IAA0B;EAC5CC,MAAM,CAACC,OAAP,GAAiB,IAAAC,aAAA,EAASH,SAAT,CAAjB;EACA,MAAMI,IAAI,GAAGH,MAAM,CAACC,OAApB;EACA,OAAO;IACLE,IADK;IAEL,GAAGC,OAAO,CAAC,wBAAD,CAFL;IAGL,GAAGA,OAAO,CAAC,SAAD,CAHL;IAIL,GAAGA,OAAO,CAAC,cAAD,CAJL;IAKL,GAAGA,OAAO,CAAC,cAAD,CALL;IAML,GAAGA,OAAO,CAAC,cAAD,CANL;IAOL;IACAC,MAAM,EAAEb,IARH;IASL;IACAc,QAAQ,EAAEZ,SAVL;IAWLa,gBAAgB,EAAEb,SAXb;IAYLc,eAAe,EAAEhB,IAZZ;IAaLiB,SAAS,EAAEf,SAbN;IAcLgB,OAAO,EAAEhB,SAdJ;IAeLiB,SAAS,EAAEjB,SAfN;IAgBLkB,aAAa,EAAElB,SAhBV;IAiBLmB,cAAc,EAAErB,IAjBX;IAkBL;IACAsB,QAAQ,EAAElB,eAnBL;IAoBLmB,oBAAoB,EAAEnB,eApBjB;IAqBLoB,UAAU,EAAExB,IArBP;IAsBLyB,OAAO,EAAEzB,IAtBJ;IAuBL0B,OAAO,EAAE,MAAMf,IAAI,CAACgB,IAAL,CAAU1B,SAAV,EAAqB,CAArB,CAvBV;IAwBL2B,WAAW,EAAE,MAAM,IAxBd;IAyBLC,QAAQ,EAAE,MAAM,IAzBX;IA0BLC,MAAM,EAAE,MAAM;EA1BT,CAAP;AA4BD,CA/BM"}
1
+ {"version":3,"names":["Noop","undefined","NoopValue","current","NoopSharedValue","value","Mock","CanvasKit","global","SkiaApi","JsiSkApi","Skia","require","Canvas","useValue","useComputedValue","useTouchHandler","useTiming","useLoop","useSpring","useClockValue","useValueEffect","useClock","usePathInterpolation","useTextureValue","useTextureValueFromPicture","useRSXformBuffer","usePointBuffer","useColorBuffer","useRectBuffer","useBuffer","useRawData","useData","useFont","Font","useFonts","useTypeface","useImage","useSVG"],"sources":["index.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport { JsiSkApi } from \"../skia/web\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst Noop: () => any = () => undefined;\nconst NoopValue = () => ({ current: 0 });\nconst NoopSharedValue = () => ({ value: 0 });\n\nexport const Mock = (CanvasKit: CanvasKit) => {\n global.SkiaApi = JsiSkApi(CanvasKit);\n const Skia = global.SkiaApi;\n return {\n Skia,\n ...require(\"../renderer/components\"),\n ...require(\"../skia\"),\n ...require(\"../animation\"),\n ...require(\"../dom/types\"),\n ...require(\"../dom/nodes\"),\n // We could use the real Canvas if we mock the SkiaView component for node\n Canvas: Noop,\n // Skia Animations\n useValue: NoopValue,\n useComputedValue: NoopValue,\n useTouchHandler: Noop,\n useTiming: NoopValue,\n useLoop: NoopValue,\n useSpring: NoopValue,\n useClockValue: NoopValue,\n useValueEffect: Noop,\n // Reanimated hooks\n useClock: NoopSharedValue,\n usePathInterpolation: NoopSharedValue,\n useTextureValue: NoopSharedValue,\n useTextureValueFromPicture: NoopSharedValue,\n useRSXformBuffer: NoopSharedValue,\n usePointBuffer: NoopSharedValue,\n useColorBuffer: NoopSharedValue,\n useRectBuffer: NoopSharedValue,\n useBuffer: NoopSharedValue,\n useRawData: Noop,\n useData: Noop,\n useFont: () => Skia.Font(undefined, 0),\n useFonts: Noop,\n useTypeface: () => null,\n useImage: () => null,\n useSVG: () => null,\n };\n};\n"],"mappings":";;;;;;;AAEA;;AAEA;AACA,MAAMA,IAAe,GAAG,MAAMC,SAA9B;;AACA,MAAMC,SAAS,GAAG,OAAO;EAAEC,OAAO,EAAE;AAAX,CAAP,CAAlB;;AACA,MAAMC,eAAe,GAAG,OAAO;EAAEC,KAAK,EAAE;AAAT,CAAP,CAAxB;;AAEO,MAAMC,IAAI,GAAIC,SAAD,IAA0B;EAC5CC,MAAM,CAACC,OAAP,GAAiB,IAAAC,aAAA,EAASH,SAAT,CAAjB;EACA,MAAMI,IAAI,GAAGH,MAAM,CAACC,OAApB;EACA,OAAO;IACLE,IADK;IAEL,GAAGC,OAAO,CAAC,wBAAD,CAFL;IAGL,GAAGA,OAAO,CAAC,SAAD,CAHL;IAIL,GAAGA,OAAO,CAAC,cAAD,CAJL;IAKL,GAAGA,OAAO,CAAC,cAAD,CALL;IAML,GAAGA,OAAO,CAAC,cAAD,CANL;IAOL;IACAC,MAAM,EAAEb,IARH;IASL;IACAc,QAAQ,EAAEZ,SAVL;IAWLa,gBAAgB,EAAEb,SAXb;IAYLc,eAAe,EAAEhB,IAZZ;IAaLiB,SAAS,EAAEf,SAbN;IAcLgB,OAAO,EAAEhB,SAdJ;IAeLiB,SAAS,EAAEjB,SAfN;IAgBLkB,aAAa,EAAElB,SAhBV;IAiBLmB,cAAc,EAAErB,IAjBX;IAkBL;IACAsB,QAAQ,EAAElB,eAnBL;IAoBLmB,oBAAoB,EAAEnB,eApBjB;IAqBLoB,eAAe,EAAEpB,eArBZ;IAsBLqB,0BAA0B,EAAErB,eAtBvB;IAuBLsB,gBAAgB,EAAEtB,eAvBb;IAwBLuB,cAAc,EAAEvB,eAxBX;IAyBLwB,cAAc,EAAExB,eAzBX;IA0BLyB,aAAa,EAAEzB,eA1BV;IA2BL0B,SAAS,EAAE1B,eA3BN;IA4BL2B,UAAU,EAAE/B,IA5BP;IA6BLgC,OAAO,EAAEhC,IA7BJ;IA8BLiC,OAAO,EAAE,MAAMtB,IAAI,CAACuB,IAAL,CAAUjC,SAAV,EAAqB,CAArB,CA9BV;IA+BLkC,QAAQ,EAAEnC,IA/BL;IAgCLoC,WAAW,EAAE,MAAM,IAhCd;IAiCLC,QAAQ,EAAE,MAAM,IAjCX;IAkCLC,MAAM,EAAE,MAAM;EAlCT,CAAP;AAoCD,CAvCM"}
@@ -72,7 +72,7 @@ const Canvas = /*#__PURE__*/(0, _react.forwardRef)((_ref, forwardedRef) => {
72
72
  const id = ((_innerRef$current2 = innerRef.current) === null || _innerRef$current2 === void 0 ? void 0 : _innerRef$current2.nativeId) ?? -1;
73
73
  return id;
74
74
  }, [innerRef]);
75
- const root = (0, _react.useMemo)(() => new _Reconciler.SkiaRoot(_Skia.Skia, redraw, getNativeId), [redraw, getNativeId]); // Render effect
75
+ const root = (0, _react.useMemo)(() => new _Reconciler.SkiaRoot(_Skia.Skia, _HostComponents.NATIVE_DOM, redraw, getNativeId), [redraw, getNativeId]); // Render effect
76
76
 
77
77
  (0, _react.useEffect)(() => {
78
78
  root.render(children);
@@ -1 +1 @@
1
- {"version":3,"names":["useCanvasRef","useRef","useOnSizeEvent","resultValue","onLayout","useCallback","event","width","height","nativeEvent","layout","value","Canvas","forwardRef","forwardedRef","children","style","debug","mode","onTouch","onSize","_onSize","_onLayout","props","innerRef","ref","useCombinedRefs","redraw","current","getNativeId","id","nativeId","root","useMemo","SkiaRoot","Skia","useEffect","render","unmount","NATIVE_DOM","dom","refs","targetRef","React","forEach"],"sources":["Canvas.tsx"],"sourcesContent":["import React, {\n useEffect,\n useCallback,\n useMemo,\n forwardRef,\n useRef,\n} from \"react\";\nimport type {\n RefObject,\n ReactNode,\n MutableRefObject,\n ForwardedRef,\n FunctionComponent,\n} from \"react\";\nimport type { LayoutChangeEvent } from \"react-native\";\n\nimport { SkiaDomView } from \"../views\";\nimport { Skia } from \"../skia/Skia\";\nimport type { TouchHandler, SkiaBaseViewProps } from \"../views\";\nimport { SkiaJSDomView } from \"../views/SkiaJSDomView\";\n\nimport { SkiaRoot } from \"./Reconciler\";\nimport { NATIVE_DOM } from \"./HostComponents\";\n\nexport const useCanvasRef = () => useRef<SkiaDomView>(null);\n\nexport interface CanvasProps extends SkiaBaseViewProps {\n ref?: RefObject<SkiaDomView>;\n children: ReactNode;\n onTouch?: TouchHandler;\n}\n\nconst useOnSizeEvent = (\n resultValue: SkiaBaseViewProps[\"onSize\"],\n onLayout?: (event: LayoutChangeEvent) => void\n) => {\n return useCallback(\n (event: LayoutChangeEvent) => {\n if (onLayout) {\n onLayout(event);\n }\n const { width, height } = event.nativeEvent.layout;\n\n if (resultValue) {\n resultValue.value = { width, height };\n }\n },\n [onLayout, resultValue]\n );\n};\n\nexport const Canvas = forwardRef<SkiaDomView, CanvasProps>(\n (\n {\n children,\n style,\n debug,\n mode,\n onTouch,\n onSize: _onSize,\n onLayout: _onLayout,\n ...props\n },\n forwardedRef\n ) => {\n const onLayout = useOnSizeEvent(_onSize, _onLayout);\n const innerRef = useCanvasRef();\n const ref = useCombinedRefs(forwardedRef, innerRef);\n const redraw = useCallback(() => {\n innerRef.current?.redraw();\n }, [innerRef]);\n const getNativeId = useCallback(() => {\n const id = innerRef.current?.nativeId ?? -1;\n return id;\n }, [innerRef]);\n\n const root = useMemo(\n () => new SkiaRoot(Skia, redraw, getNativeId),\n [redraw, getNativeId]\n );\n\n // Render effect\n useEffect(() => {\n root.render(children);\n }, [children, root, redraw]);\n\n useEffect(() => {\n return () => {\n root.unmount();\n };\n }, [root]);\n\n if (NATIVE_DOM) {\n return (\n <SkiaDomView\n ref={ref}\n style={style}\n root={root.dom}\n onTouch={onTouch}\n onLayout={onLayout}\n mode={mode}\n debug={debug}\n {...props}\n />\n );\n } else {\n return (\n <SkiaJSDomView\n Skia={Skia}\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref={ref as any}\n style={style}\n root={root.dom}\n onTouch={onTouch}\n onLayout={onLayout}\n mode={mode}\n debug={debug}\n {...props}\n />\n );\n }\n }\n) as FunctionComponent<CanvasProps & React.RefAttributes<SkiaDomView>>;\n\n/**\n * Combines a list of refs into a single ref. This can be used to provide\n * both a forwarded ref and an internal ref keeping the same functionality\n * on both of the refs.\n * @param refs Array of refs to combine\n * @returns A single ref that can be used in a ref prop.\n */\nconst useCombinedRefs = <T,>(\n ...refs: Array<MutableRefObject<T> | ForwardedRef<T>>\n) => {\n const targetRef = React.useRef<T>(null);\n React.useEffect(() => {\n refs.forEach((ref) => {\n if (ref) {\n if (typeof ref === \"function\") {\n ref(targetRef.current);\n } else {\n ref.current = targetRef.current;\n }\n }\n });\n }, [refs]);\n return targetRef;\n};\n"],"mappings":";;;;;;;AAAA;;AAgBA;;AACA;;AAEA;;AAEA;;AACA;;;;;;;;AAEO,MAAMA,YAAY,GAAG,MAAM,IAAAC,aAAA,EAAoB,IAApB,CAA3B;;;;AAQP,MAAMC,cAAc,GAAG,CACrBC,WADqB,EAErBC,QAFqB,KAGlB;EACH,OAAO,IAAAC,kBAAA,EACJC,KAAD,IAA8B;IAC5B,IAAIF,QAAJ,EAAc;MACZA,QAAQ,CAACE,KAAD,CAAR;IACD;;IACD,MAAM;MAAEC,KAAF;MAASC;IAAT,IAAoBF,KAAK,CAACG,WAAN,CAAkBC,MAA5C;;IAEA,IAAIP,WAAJ,EAAiB;MACfA,W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eEvent","resultValue","onLayout","useCallback","event","width","height","nativeEvent","layout","value","Canvas","forwardRef","forwardedRef","children","style","debug","mode","onTouch","onSize","_onSize","_onLayout","props","innerRef","ref","useCombinedRefs","redraw","current","getNativeId","id","nativeId","root","useMemo","SkiaRoot","Skia","NATIVE_DOM","useEffect","render","unmount","dom","refs","targetRef","React","forEach"],"sources":["Canvas.tsx"],"sourcesContent":["import React, {\n useEffect,\n useCallback,\n useMemo,\n forwardRef,\n useRef,\n} from \"react\";\nimport type {\n RefObject,\n ReactNode,\n MutableRefObject,\n ForwardedRef,\n FunctionComponent,\n} from \"react\";\nimport type { LayoutChangeEvent } from \"react-native\";\n\nimport { SkiaDomView } from \"../views\";\nimport { Skia } from \"../skia/Skia\";\nimport type { TouchHandler, SkiaBaseViewProps } from \"../views\";\nimport { SkiaJSDomView } from \"../views/SkiaJSDomView\";\n\nimport { SkiaRoot } from \"./Reconciler\";\nimport { NATIVE_DOM } from \"./HostComponents\";\n\nexport const useCanvasRef = () => useRef<SkiaDomView>(null);\n\nexport interface CanvasProps extends SkiaBaseViewProps {\n ref?: RefObject<SkiaDomView>;\n children: ReactNode;\n onTouch?: TouchHandler;\n}\n\nconst useOnSizeEvent = (\n resultValue: SkiaBaseViewProps[\"onSize\"],\n onLayout?: (event: LayoutChangeEvent) => void\n) => {\n return useCallback(\n (event: LayoutChangeEvent) => {\n if (onLayout) {\n onLayout(event);\n }\n const { width, height } = event.nativeEvent.layout;\n\n if (resultValue) {\n resultValue.value = { width, height };\n }\n },\n [onLayout, resultValue]\n );\n};\n\nexport const Canvas = forwardRef<SkiaDomView, CanvasProps>(\n (\n {\n children,\n style,\n debug,\n mode,\n onTouch,\n onSize: _onSize,\n onLayout: _onLayout,\n ...props\n },\n forwardedRef\n ) => {\n const onLayout = useOnSizeEvent(_onSize, _onLayout);\n const innerRef = useCanvasRef();\n const ref = useCombinedRefs(forwardedRef, innerRef);\n const redraw = useCallback(() => {\n innerRef.current?.redraw();\n }, [innerRef]);\n const getNativeId = useCallback(() => {\n const id = innerRef.current?.nativeId ?? -1;\n return id;\n }, [innerRef]);\n\n const root = useMemo(\n () => new SkiaRoot(Skia, NATIVE_DOM, redraw, getNativeId),\n [redraw, getNativeId]\n );\n\n // Render effect\n useEffect(() => {\n root.render(children);\n }, [children, root, redraw]);\n\n useEffect(() => {\n return () => {\n root.unmount();\n };\n }, [root]);\n\n if (NATIVE_DOM) {\n return (\n <SkiaDomView\n ref={ref}\n style={style}\n root={root.dom}\n onTouch={onTouch}\n onLayout={onLayout}\n mode={mode}\n debug={debug}\n {...props}\n />\n );\n } else {\n return (\n <SkiaJSDomView\n Skia={Skia}\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref={ref as any}\n style={style}\n root={root.dom}\n onTouch={onTouch}\n onLayout={onLayout}\n mode={mode}\n debug={debug}\n {...props}\n />\n );\n }\n }\n) as FunctionComponent<CanvasProps & React.RefAttributes<SkiaDomView>>;\n\n/**\n * Combines a list of refs into a single ref. This can be used to provide\n * both a forwarded ref and an internal ref keeping the same functionality\n * on both of the refs.\n * @param refs Array of refs to combine\n * @returns A single ref that can be used in a ref prop.\n */\nconst useCombinedRefs = <T,>(\n ...refs: Array<MutableRefObject<T> | ForwardedRef<T>>\n) => {\n const targetRef = React.useRef<T>(null);\n React.useEffect(() => {\n refs.forEach((ref) => {\n if (ref) {\n if (typeof ref === \"function\") {\n ref(targetRef.current);\n } else {\n ref.current = targetRef.current;\n }\n }\n });\n }, [refs]);\n return targetRef;\n};\n"],"mappings":";;;;;;;AAAA;;AAgBA;;AACA;;AAEA;;AAEA;;AACA;;;;;;;;AAEO,MAAMA,YAAY,GAAG,MAAM,IAAAC,aAAA,EAAoB,IAApB,CAA3B;;;;AAQP,MAAMC,cAAc,GAAG,CACrBC,WADqB,EAErBC,QAFqB,KAGlB;EACH,OAAO,IAAAC,kBAAA,EACJC,KAAD,IAA8B;IAC5B,IAAIF,QAAJ,EAAc;MACZA,QAAQ,CAACE,KAAD,CAAR;IAC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AAxB;QACD;MACF;IACF,CARD;EASD,CAVD,EAUG,CAACa,IAAD,CAVH;;EAWA,OAAOC,SAAP;AACD,CAhBD"}
@@ -5,7 +5,7 @@ export declare class Container {
5
5
  getNativeId: () => number;
6
6
  private _root;
7
7
  Sk: SkDOM;
8
- constructor(Skia: Skia, redraw?: () => void, getNativeId?: () => number);
8
+ constructor(Skia: Skia, redraw: () => void, getNativeId: () => number, native: boolean);
9
9
  draw(ctx: DrawingContext): void;
10
10
  get root(): RenderNode<GroupProps>;
11
11
  }
@@ -13,6 +13,7 @@ class Container {
13
13
  constructor(Skia) {
14
14
  let redraw = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : () => {};
15
15
  let getNativeId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : () => 0;
16
+ let native = arguments.length > 3 ? arguments[3] : undefined;
16
17
  this.redraw = redraw;
17
18
  this.getNativeId = getNativeId;
18
19
 
@@ -22,7 +23,7 @@ class Container {
22
23
 
23
24
  this.Sk = new _nodes.JsiSkDOM({
24
25
  Skia
25
- });
26
+ }, native);
26
27
  this._root = this.Sk.Group();
27
28
  }
28
29
 
@@ -1 +1 @@
1
- {"version":3,"names":["Container","constructor","Skia","redraw","getNativeId","Sk","JsiSkDOM","_root","Group","draw","ctx","render","root"],"sources":["Container.tsx"],"sourcesContent":["import { JsiSkDOM } from \"../dom/nodes\";\nimport type {\n GroupProps,\n DrawingContext,\n RenderNode,\n SkDOM,\n} from \"../dom/types\";\nimport type { Skia } from \"../skia/types\";\n\nexport class Container {\n private _root: RenderNode<GroupProps>;\n public Sk: SkDOM;\n constructor(\n Skia: Skia,\n public redraw: () => void = () => {},\n public getNativeId: () => number = () => 0\n ) {\n this.Sk = new JsiSkDOM({ Skia });\n this._root = this.Sk.Group();\n }\n\n draw(ctx: DrawingContext) {\n this._root.render(ctx);\n }\n\n get root() {\n return this._root;\n }\n}\n"],"mappings":";;;;;;;AAAA;;;;AASO,MAAMA,SAAN,CAAgB;EAGrBC,WAAW,CACTC,IADS,EAIT;IAAA,IAFOC,MAEP,uEAF4B,MAAM,CAAE,CAEpC;IAAA,IADOC,WACP,uEADmC,MAAM,CACzC;IAAA,KAFOD,MAEP,GAFOA,MAEP;IAAA,KADOC,WACP,GADOA,WACP;;IAAA;;IAAA;;IACA,KAAKC,EAAL,GAAU,IAAIC,eAAJ,CAAa;MAAEJ;IAAF,CAAb,CAAV;IACA,KAAKK,KAAL,GAAa,KAAKF,EAAL,CAAQG,KAAR,EAAb;EACD;;EAEDC,IAAI,CAACC,GAAD,EAAsB;IACxB,KAAKH,KAAL,CAAWI,MAAX,CAAkBD,GAAlB;EACD;;EAEO,IAAJE,IAAI,GAAG;IACT,OAAO,KAAKL,KAAZ;EACD;;AAlBoB"}
1
+ {"version":3,"names":["Container","constructor","Skia","redraw","getNativeId","native","Sk","JsiSkDOM","_root","Group","draw","ctx","render","root"],"sources":["Container.tsx"],"sourcesContent":["import { JsiSkDOM } from \"../dom/nodes\";\nimport type {\n GroupProps,\n DrawingContext,\n RenderNode,\n SkDOM,\n} from \"../dom/types\";\nimport type { Skia } from \"../skia/types\";\n\nexport class Container {\n private _root: RenderNode<GroupProps>;\n public Sk: SkDOM;\n constructor(\n Skia: Skia,\n public redraw: () => void = () => {},\n public getNativeId: () => number = () => 0,\n native: boolean\n ) {\n this.Sk = new JsiSkDOM({ Skia }, native);\n this._root = this.Sk.Group();\n }\n\n draw(ctx: DrawingContext) {\n this._root.render(ctx);\n }\n\n get root() {\n return this._root;\n }\n}\n"],"mappings":";;;;;;;AAAA;;;;AASO,MAAMA,SAAN,CAAgB;EAGrBC,WAAW,CACTC,IADS,EAKT;IAAA,IAHOC,MAGP,uEAH4B,MAAM,CAAE,CAGpC;IAAA,IAFOC,WAEP,uEAFmC,MAAM,CAEzC;IAAA,IADAC,MACA;IAAA,KAHOF,MAGP,GAHOA,MAGP;IAAA,KAFOC,WAEP,GAFOA,WAEP;;IAAA;;IAAA;;IACA,KAAKE,EAAL,GAAU,IAAIC,eAAJ,CAAa;MAAEL;IAAF,CAAb,EAAuBG,MAAvB,CAAV;IACA,KAAKG,KAAL,GAAa,KAAKF,EAAL,CAAQG,KAAR,EAAb;EACD;;EAEDC,IAAI,CAACC,GAAD,EAAsB;IACxB,KAAKH,KAAL,CAAWI,MAAX,CAAkBD,GAAlB;EACD;;EAEO,IAAJE,IAAI,GAAG;IACT,OAAO,KAAKL,KAAZ;EACD;;AAnBoB"}
@@ -1,5 +1,5 @@
1
1
  import { NodeType } from "../dom/types";
2
- import type { DeclarationNode, FractalNoiseProps, RenderNode, 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 } from "../dom/types";
2
+ import type { DeclarationNode, FractalNoiseProps, RenderNode, 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 } from "../dom/types";
3
3
  import type { ChildrenProps } from "../dom/types/Common";
4
4
  import type { BlendProps, MorphologyImageFilterProps } from "../dom/types/ImageFilters";
5
5
  import type { SkRect, SkRRect } from "../skia/types";
@@ -22,6 +22,7 @@ declare global {
22
22
  PatchNode: (props: PatchProps) => RenderNode<PatchProps>;
23
23
  PointsNode: (props: PointsProps) => RenderNode<PointsProps>;
24
24
  DiffRectNode: (props: DiffRectProps) => RenderNode<DiffRectProps>;
25
+ AtlasNode: (props: AtlasProps) => RenderNode<AtlasProps>;
25
26
  BlurMaskFilterNode: (props: BlurMaskFilterProps) => DeclarationNode<BlurMaskFilterProps>;
26
27
  DashPathEffectNode: (props: DashPathEffectProps) => DeclarationNode<DashPathEffectProps>;
27
28
  DiscretePathEffectNode: (props: DiscretePathEffectProps) => DeclarationNode<DiscretePathEffectProps>;
@@ -81,6 +82,7 @@ declare global {
81
82
  skPoints: SkiaProps<PointsProps>;
82
83
  skRect: SkiaProps<RectProps>;
83
84
  skRRect: SkiaProps<RoundedRectProps>;
85
+ skAtlas: SkiaProps<AtlasProps>;
84
86
  skVertices: SkiaProps<VerticesProps>;
85
87
  skText: SkiaProps<TextProps>;
86
88
  skTextPath: SkiaProps<TextPathProps>;
@@ -75,6 +75,9 @@ const createNode = (container, type, props) => {
75
75
  case _types.NodeType.Glyphs:
76
76
  return Sk.Glyphs(props);
77
77
 
78
+ case _types.NodeType.Atlas:
79
+ return Sk.Atlas(props);
80
+
78
81
  case _types.NodeType.DiffRect:
79
82
  return Sk.DiffRect(props);
80
83
 
@@ -1 +1 @@
1
- {"version":3,"names":["shouldUseJSDomOnNative","NATIVE_DOM","global","SkiaDomApi","createNode","container","type","props","Sk","NodeType","Layer","Group","Paint","Fill","Image","Circle","Path","Line","Oval","Patch","Points","Rect","RRect","Vertices","Text","TextPath","TextBlob","Glyphs","DiffRect","Picture","ImageSVG","BlurMaskFilter","BlendImageFilter","BlurImageFilter","OffsetImageFilter","DropShadowImageFilter","DisplacementMapImageFilter","MorphologyImageFilter","RuntimeShaderImageFilter","MatrixColorFilter","BlendColorFilter","LerpColorFilter","LumaColorFilter","LinearToSRGBGammaColorFilter","SRGBToLinearGammaColorFilter","Shader","ImageShader","ColorShader","Turbulence","FractalNoise","LinearGradient","RadialGradient","SweepGradient","TwoPointConicalGradient","CornerPathEffect","DiscretePathEffect","DashPathEffect","Path1DPathEffect","Path2DPathEffect","SumPathEffect","Line2DPathEffect","Blend","BackdropFilter","Box","BoxShadow","Paragraph","exhaustiveCheck"],"sources":["HostComponents.ts"],"sourcesContent":["import { NodeType } from \"../dom/types\";\nimport type {\n DeclarationNode,\n FractalNoiseProps,\n RenderNode,\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} from \"../dom/types\";\nimport type { ChildrenProps } from \"../dom/types/Common\";\nimport type {\n BlendProps,\n MorphologyImageFilterProps,\n} from \"../dom/types/ImageFilters\";\nimport type { SkRect, SkRRect } from \"../skia/types\";\nimport type { JsiDrawingNode } from \"../dom/nodes/DrawingNode\";\n\nimport type { Container } from \"./Container\";\nimport { exhaustiveCheck } from \"./typeddash\";\nimport type { SkiaProps } from \"./processors\";\n\n// This flag should only be turned on for debugging/testing\nconst shouldUseJSDomOnNative = false;\nexport const NATIVE_DOM = shouldUseJSDomOnNative ? false : !!global.SkiaDomApi;\n\ndeclare global {\n var SkiaDomApi: {\n // FIXME: We need a better type for this\n RectNode: (props: RectProps) => JsiDrawingNode<RectProps, SkRect>;\n RRectNode: (\n props: RoundedRectProps\n ) => JsiDrawingNode<RoundedRectProps, SkRRect>;\n GroupNode: (props: GroupProps) => RenderNode<GroupProps>;\n PaintNode: (props: PaintProps) => DeclarationNode<PaintProps>;\n FillNode: (props: PaintProps) => RenderNode<PaintProps>;\n CircleNode: (props: CircleProps) => RenderNode<CircleProps>;\n PathNode: (props: PathProps) => RenderNode<PathProps>;\n LineNode: (props: LineProps) => RenderNode<LineProps>;\n ImageNode: (props: ImageProps) => RenderNode<ImageProps>;\n OvalNode: (props: OvalProps) => RenderNode<OvalProps>;\n PatchNode: (props: PatchProps) => RenderNode<PatchProps>;\n PointsNode: (props: PointsProps) => RenderNode<PointsProps>;\n DiffRectNode: (props: DiffRectProps) => RenderNode<DiffRectProps>;\n // Mask filters\n BlurMaskFilterNode: (\n props: BlurMaskFilterProps\n ) => DeclarationNode<BlurMaskFilterProps>;\n\n // Path effects\n DashPathEffectNode: (\n props: DashPathEffectProps\n ) => DeclarationNode<DashPathEffectProps>;\n DiscretePathEffectNode: (\n props: DiscretePathEffectProps\n ) => DeclarationNode<DiscretePathEffectProps>;\n CornerPathEffectNode: (\n props: CornerPathEffectProps\n ) => DeclarationNode<CornerPathEffectProps>;\n Path1DPathEffectNode: (\n props: Path1DPathEffectProps\n ) => DeclarationNode<Path1DPathEffectProps>;\n Path2DPathEffectNode: (\n props: Path2DPathEffectProps\n ) => DeclarationNode<Path2DPathEffectProps>;\n Line2DPathEffectNode: (\n props: Line2DPathEffectProps\n ) => DeclarationNode<Line2DPathEffectProps>;\n SumPathEffectNode: () => DeclarationNode<null>;\n\n // Image filters\n BlendImageFilterNode: (\n props: BlendImageFilterProps\n ) => DeclarationNode<BlendImageFilterProps>;\n DropShadowImageFilterNode: (\n props: DropShadowImageFilterProps\n ) => DeclarationNode<DropShadowImageFilterProps>;\n DisplacementMapImageFilterNode: (\n props: DisplacementMapImageFilterProps\n ) => DeclarationNode<DisplacementMapImageFilterProps>;\n BlurImageFilterNode: (\n props: BlurImageFilterProps\n ) => DeclarationNode<BlurImageFilterProps>;\n OffsetImageFilterNode: (\n props: OffsetImageFilterProps\n ) => DeclarationNode<OffsetImageFilterProps>;\n MorphologyImageFilterNode: (\n props: MorphologyImageFilterProps\n ) => DeclarationNode<MorphologyImageFilterProps>;\n RuntimeShaderImageFilterNode: (\n props: RuntimeShaderImageFilterProps\n ) => DeclarationNode<RuntimeShaderImageFilterProps>;\n\n // Color filters\n MatrixColorFilterNode: (\n props: MatrixColorFilterProps\n ) => DeclarationNode<MatrixColorFilterProps>;\n BlendColorFilterNode: (\n props: BlendColorFilterProps\n ) => DeclarationNode<BlendColorFilterProps>;\n LinearToSRGBGammaColorFilterNode: () => DeclarationNode<null>;\n SRGBToLinearGammaColorFilterNode: () => DeclarationNode<null>;\n LumaColorFilterNode: () => DeclarationNode<null>;\n LerpColorFilterNode: (\n props: LerpColorFilterProps\n ) => DeclarationNode<LerpColorFilterProps>;\n\n // Shaders\n ShaderNode: (props: ShaderProps) => DeclarationNode<ShaderProps>;\n ImageShaderNode: (\n props: ImageShaderProps\n ) => DeclarationNode<ImageShaderProps>;\n ColorShaderNode: (props: ColorProps) => DeclarationNode<ColorProps>;\n TurbulenceNode: (\n props: TurbulenceProps\n ) => DeclarationNode<TurbulenceProps>;\n FractalNoiseNode: (\n props: FractalNoiseProps\n ) => DeclarationNode<FractalNoiseProps>;\n LinearGradientNode: (\n props: LinearGradientProps\n ) => DeclarationNode<LinearGradientProps>;\n RadialGradientNode: (\n props: RadialGradientProps\n ) => DeclarationNode<RadialGradientProps>;\n SweepGradientNode: (\n props: SweepGradientProps\n ) => DeclarationNode<SweepGradientProps>;\n TwoPointConicalGradientNode: (\n props: TwoPointConicalGradientProps\n ) => DeclarationNode<TwoPointConicalGradientProps>;\n PictureNode: (props: PictureProps) => RenderNode<PictureProps>;\n ImageSVGNode: (props: ImageSVGProps) => RenderNode<ImageSVGProps>;\n VerticesNode: (props: VerticesProps) => RenderNode<VerticesProps>;\n TextNode: (prop: TextProps) => RenderNode<TextProps>;\n TextPathNode: (prop: TextPathProps) => RenderNode<TextPathProps>;\n TextBlobNode: (prop: TextBlobProps) => RenderNode<TextBlobProps>;\n GlyphsNode: (prop: GlyphsProps) => RenderNode<GlyphsProps>;\n BlendNode: (prop: BlendProps) => DeclarationNode<BlendProps>;\n BackdropFilterNode: (prop: ChildrenProps) => RenderNode<ChildrenProps>;\n BoxNode: (prop: BoxProps) => RenderNode<BoxProps>;\n BoxShadowNode: (prop: BoxShadowProps) => DeclarationNode<BoxShadowProps>;\n LayerNode: (prop: ChildrenProps) => RenderNode<ChildrenProps>;\n\n // Paragraph\n ParagraphNode: (props: ParagraphProps) => RenderNode<ParagraphProps>;\n };\n\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 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\nexport const createNode = (\n container: Container,\n type: NodeType,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n props: any\n) => {\n const { Sk } = container;\n switch (type) {\n case NodeType.Layer:\n return Sk.Layer(props);\n case NodeType.Group:\n return Sk.Group(props);\n case NodeType.Paint:\n return Sk.Paint(props);\n // Drawings\n case NodeType.Fill:\n return Sk.Fill(props);\n case NodeType.Image:\n return Sk.Image(props);\n case NodeType.Circle:\n return Sk.Circle(props);\n case NodeType.Path:\n return Sk.Path(props);\n case NodeType.Line:\n return Sk.Line(props);\n case NodeType.Oval:\n return Sk.Oval(props);\n case NodeType.Patch:\n return Sk.Patch(props);\n case NodeType.Points:\n return Sk.Points(props);\n case NodeType.Rect:\n return Sk.Rect(props);\n case NodeType.RRect:\n return Sk.RRect(props);\n case NodeType.Vertices:\n return Sk.Vertices(props);\n case NodeType.Text:\n return Sk.Text(props);\n case NodeType.TextPath:\n return Sk.TextPath(props);\n case NodeType.TextBlob:\n return Sk.TextBlob(props);\n case NodeType.Glyphs:\n return Sk.Glyphs(props);\n case NodeType.DiffRect:\n return Sk.DiffRect(props);\n case NodeType.Picture:\n return Sk.Picture(props);\n case NodeType.ImageSVG:\n return Sk.ImageSVG(props);\n // Mask Filter\n case NodeType.BlurMaskFilter:\n return Sk.BlurMaskFilter(props);\n // Image Filter\n case NodeType.BlendImageFilter:\n return Sk.BlendImageFilter(props);\n case NodeType.BlurImageFilter:\n return Sk.BlurImageFilter(props);\n case NodeType.OffsetImageFilter:\n return Sk.OffsetImageFilter(props);\n case NodeType.DropShadowImageFilter:\n return Sk.DropShadowImageFilter(props);\n case NodeType.DisplacementMapImageFilter:\n return Sk.DisplacementMapImageFilter(props);\n case NodeType.MorphologyImageFilter:\n return Sk.MorphologyImageFilter(props);\n case NodeType.RuntimeShaderImageFilter:\n return Sk.RuntimeShaderImageFilter(props);\n // Color Filter\n case NodeType.MatrixColorFilter:\n return Sk.MatrixColorFilter(props);\n case NodeType.BlendColorFilter:\n return Sk.BlendColorFilter(props);\n case NodeType.LerpColorFilter:\n return Sk.LerpColorFilter(props);\n case NodeType.LumaColorFilter:\n return Sk.LumaColorFilter();\n case NodeType.LinearToSRGBGammaColorFilter:\n return Sk.LinearToSRGBGammaColorFilter();\n case NodeType.SRGBToLinearGammaColorFilter:\n return Sk.SRGBToLinearGammaColorFilter();\n // Shader\n case NodeType.Shader:\n return Sk.Shader(props);\n case NodeType.ImageShader:\n return Sk.ImageShader(props);\n case NodeType.ColorShader:\n return Sk.ColorShader(props);\n case NodeType.Turbulence:\n return Sk.Turbulence(props);\n case NodeType.FractalNoise:\n return Sk.FractalNoise(props);\n case NodeType.LinearGradient:\n return Sk.LinearGradient(props);\n case NodeType.RadialGradient:\n return Sk.RadialGradient(props);\n case NodeType.SweepGradient:\n return Sk.SweepGradient(props);\n case NodeType.TwoPointConicalGradient:\n return Sk.TwoPointConicalGradient(props);\n // Path Effect\n case NodeType.CornerPathEffect:\n return Sk.CornerPathEffect(props);\n case NodeType.DiscretePathEffect:\n return Sk.DiscretePathEffect(props);\n case NodeType.DashPathEffect:\n return Sk.DashPathEffect(props);\n case NodeType.Path1DPathEffect:\n return Sk.Path1DPathEffect(props);\n case NodeType.Path2DPathEffect:\n return Sk.Path2DPathEffect(props);\n case NodeType.SumPathEffect:\n return Sk.SumPathEffect();\n case NodeType.Line2DPathEffect:\n return Sk.Line2DPathEffect(props);\n // Mixed\n case NodeType.Blend:\n return Sk.Blend(props);\n case NodeType.BackdropFilter:\n return Sk.BackdropFilter(props);\n case NodeType.Box:\n return Sk.Box(props);\n case NodeType.BoxShadow:\n return Sk.BoxShadow(props);\n // Paragraph\n case NodeType.Paragraph:\n return Sk.Paragraph(props);\n default:\n return exhaustiveCheck(type);\n }\n};\n"],"mappings":";;;;;;;AAAA;;AA8DA;;AAGA;AACA,MAAMA,sBAAsB,GAAG,KAA/B;AACO,MAAMC,UAAU,GAAGD,sBAAsB,GAAG,KAAH,GAAW,CAAC,CAACE,MAAM,CAACC,UAA7D;;;AA2MA,MAAMC,UAAU,GAAG,CACxBC,SADwB,EAExBC,IAFwB,EAIxBC,KAJwB,KAKrB;EACH,MAAM;IAAEC;EAAF,IAASH,SAAf;;EACA,QAAQC,IAAR;IACE,KAAKG,eAAA,CAASC,KAAd;MACE,OAAOF,EAAE,CAACE,KAAH,CAASH,KAAT,CAAP;;IACF,KAAKE,eAAA,CAASE,KAAd;MACE,OAAOH,EAAE,CAACG,KAAH,CAASJ,KAAT,CAAP;;IACF,KAAKE,eAAA,CAASG,KAAd;MACE,OAAOJ,EAAE,CAACI,KAAH,CAASL,KAAT,CAAP;IACF;;IACA,KAAKE,eAAA,CAASI,IAAd;MACE,OAAOL,EAAE,CAACK,IAAH,CAAQN,KAAR,CAAP;;IACF,KAAKE,eAAA,CAASK,KAAd;MACE,OAAON,EAAE,CAACM,KAAH,CAASP,KAAT,CAAP;;IACF,KAAKE,eAAA,CAASM,MAAd;MACE,OAAOP,EAAE,CAACO,MAAH,CAAUR,KAAV,CAAP;;IACF,KAAKE,eAAA,CAASO,IAAd;MACE,OAAOR,EAAE,CAACQ,IAAH,CAAQT,KAAR,CAAP;;IACF,KAAKE,eAAA,CAASQ,IAAd;MACE,OAAOT,EAAE,CAACS,IAAH,CAAQV,KAAR,CAAP;;IACF,KAAKE,eAAA,CAASS,IAAd;MACE,O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;IACA,KAAKE,eAAA,CAASoD,KAAd;MACE,OAAOrD,EAAE,CAACqD,KAAH,CAAStD,KAAT,CAAP;;IACF,KAAKE,eAAA,CAASqD,cAAd;MACE,OAAOtD,EAAE,CAACsD,cAAH,CAAkBvD,KAAlB,CAAP;;IACF,KAAKE,eAAA,CAASsD,GAAd;MACE,OAAOvD,EAAE,CAACuD,GAAH,CAAOxD,KAAP,CAAP;;IACF,KAAKE,eAAA,CAASuD,SAAd;MACE,OAAOxD,EAAE,CAACwD,SAAH,CAAazD,KAAb,CAAP;IACF;;IACA,KAAKE,eAAA,CAASwD,SAAd;MACE,OAAOzD,EAAE,CAACyD,SAAH,CAAa1D,KAAb,CAAP;;IACF;MACE,OAAO,IAAA2D,0BAAA,EAAgB5D,IAAhB,CAAP;EA1HJ;AA4HD,CAnIM"}
1
+ {"version":3,"names":["shouldUseJSDomOnNative","NATIVE_DOM","global","SkiaDomApi","createNode","container","type","props","Sk","NodeType","Layer","Group","Paint","Fill","Image","Circle","Path","Line","Oval","Patch","Points","Rect","RRect","Vertices","Text","TextPath","TextBlob","Glyphs","Atlas","DiffRect","Picture","ImageSVG","BlurMaskFilter","BlendImageFilter","BlurImageFilter","OffsetImageFilter","DropShadowImageFilter","DisplacementMapImageFilter","MorphologyImageFilter","RuntimeShaderImageFilter","MatrixColorFilter","BlendColorFilter","LerpColorFilter","LumaColorFilter","LinearToSRGBGammaColorFilter","SRGBToLinearGammaColorFilter","Shader","ImageShader","ColorShader","Turbulence","FractalNoise","LinearGradient","RadialGradient","SweepGradient","TwoPointConicalGradient","CornerPathEffect","DiscretePathEffect","DashPathEffect","Path1DPathEffect","Path2DPathEffect","SumPathEffect","Line2DPathEffect","Blend","BackdropFilter","Box","BoxShadow","Paragraph","exhaustiveCheck"],"sources":["HostComponents.ts"],"sourcesContent":["import { NodeType } from \"../dom/types\";\nimport type {\n DeclarationNode,\n FractalNoiseProps,\n RenderNode,\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} from \"../dom/types\";\nimport type { ChildrenProps } from \"../dom/types/Common\";\nimport type {\n BlendProps,\n MorphologyImageFilterProps,\n} from \"../dom/types/ImageFilters\";\nimport type { SkRect, SkRRect } from \"../skia/types\";\nimport type { JsiDrawingNode } from \"../dom/nodes/DrawingNode\";\n\nimport type { Container } from \"./Container\";\nimport { exhaustiveCheck } from \"./typeddash\";\nimport type { SkiaProps } from \"./processors\";\n\n// This flag should only be turned on for debugging/testing\nconst shouldUseJSDomOnNative = false;\nexport const NATIVE_DOM = shouldUseJSDomOnNative ? false : !!global.SkiaDomApi;\n\ndeclare global {\n var SkiaDomApi: {\n RectNode: (props: RectProps) => JsiDrawingNode<RectProps, SkRect>;\n RRectNode: (\n props: RoundedRectProps\n ) => JsiDrawingNode<RoundedRectProps, SkRRect>;\n GroupNode: (props: GroupProps) => RenderNode<GroupProps>;\n PaintNode: (props: PaintProps) => DeclarationNode<PaintProps>;\n FillNode: (props: PaintProps) => RenderNode<PaintProps>;\n CircleNode: (props: CircleProps) => RenderNode<CircleProps>;\n PathNode: (props: PathProps) => RenderNode<PathProps>;\n LineNode: (props: LineProps) => RenderNode<LineProps>;\n ImageNode: (props: ImageProps) => RenderNode<ImageProps>;\n OvalNode: (props: OvalProps) => RenderNode<OvalProps>;\n PatchNode: (props: PatchProps) => RenderNode<PatchProps>;\n PointsNode: (props: PointsProps) => RenderNode<PointsProps>;\n DiffRectNode: (props: DiffRectProps) => RenderNode<DiffRectProps>;\n AtlasNode: (props: AtlasProps) => RenderNode<AtlasProps>;\n\n // Mask filters\n BlurMaskFilterNode: (\n props: BlurMaskFilterProps\n ) => DeclarationNode<BlurMaskFilterProps>;\n\n // Path effects\n DashPathEffectNode: (\n props: DashPathEffectProps\n ) => DeclarationNode<DashPathEffectProps>;\n DiscretePathEffectNode: (\n props: DiscretePathEffectProps\n ) => DeclarationNode<DiscretePathEffectProps>;\n CornerPathEffectNode: (\n props: CornerPathEffectProps\n ) => DeclarationNode<CornerPathEffectProps>;\n Path1DPathEffectNode: (\n props: Path1DPathEffectProps\n ) => DeclarationNode<Path1DPathEffectProps>;\n Path2DPathEffectNode: (\n props: Path2DPathEffectProps\n ) => DeclarationNode<Path2DPathEffectProps>;\n Line2DPathEffectNode: (\n props: Line2DPathEffectProps\n ) => DeclarationNode<Line2DPathEffectProps>;\n SumPathEffectNode: () => DeclarationNode<null>;\n\n // Image filters\n BlendImageFilterNode: (\n props: BlendImageFilterProps\n ) => DeclarationNode<BlendImageFilterProps>;\n DropShadowImageFilterNode: (\n props: DropShadowImageFilterProps\n ) => DeclarationNode<DropShadowImageFilterProps>;\n DisplacementMapImageFilterNode: (\n props: DisplacementMapImageFilterProps\n ) => DeclarationNode<DisplacementMapImageFilterProps>;\n BlurImageFilterNode: (\n props: BlurImageFilterProps\n ) => DeclarationNode<BlurImageFilterProps>;\n OffsetImageFilterNode: (\n props: OffsetImageFilterProps\n ) => DeclarationNode<OffsetImageFilterProps>;\n MorphologyImageFilterNode: (\n props: MorphologyImageFilterProps\n ) => DeclarationNode<MorphologyImageFilterProps>;\n RuntimeShaderImageFilterNode: (\n props: RuntimeShaderImageFilterProps\n ) => DeclarationNode<RuntimeShaderImageFilterProps>;\n\n // Color filters\n MatrixColorFilterNode: (\n props: MatrixColorFilterProps\n ) => DeclarationNode<MatrixColorFilterProps>;\n BlendColorFilterNode: (\n props: BlendColorFilterProps\n ) => DeclarationNode<BlendColorFilterProps>;\n LinearToSRGBGammaColorFilterNode: () => DeclarationNode<null>;\n SRGBToLinearGammaColorFilterNode: () => DeclarationNode<null>;\n LumaColorFilterNode: () => DeclarationNode<null>;\n LerpColorFilterNode: (\n props: LerpColorFilterProps\n ) => DeclarationNode<LerpColorFilterProps>;\n\n // Shaders\n ShaderNode: (props: ShaderProps) => DeclarationNode<ShaderProps>;\n ImageShaderNode: (\n props: ImageShaderProps\n ) => DeclarationNode<ImageShaderProps>;\n ColorShaderNode: (props: ColorProps) => DeclarationNode<ColorProps>;\n TurbulenceNode: (\n props: TurbulenceProps\n ) => DeclarationNode<TurbulenceProps>;\n FractalNoiseNode: (\n props: FractalNoiseProps\n ) => DeclarationNode<FractalNoiseProps>;\n LinearGradientNode: (\n props: LinearGradientProps\n ) => DeclarationNode<LinearGradientProps>;\n RadialGradientNode: (\n props: RadialGradientProps\n ) => DeclarationNode<RadialGradientProps>;\n SweepGradientNode: (\n props: SweepGradientProps\n ) => DeclarationNode<SweepGradientProps>;\n TwoPointConicalGradientNode: (\n props: TwoPointConicalGradientProps\n ) => DeclarationNode<TwoPointConicalGradientProps>;\n PictureNode: (props: PictureProps) => RenderNode<PictureProps>;\n ImageSVGNode: (props: ImageSVGProps) => RenderNode<ImageSVGProps>;\n VerticesNode: (props: VerticesProps) => RenderNode<VerticesProps>;\n TextNode: (prop: TextProps) => RenderNode<TextProps>;\n TextPathNode: (prop: TextPathProps) => RenderNode<TextPathProps>;\n TextBlobNode: (prop: TextBlobProps) => RenderNode<TextBlobProps>;\n GlyphsNode: (prop: GlyphsProps) => RenderNode<GlyphsProps>;\n BlendNode: (prop: BlendProps) => DeclarationNode<BlendProps>;\n BackdropFilterNode: (prop: ChildrenProps) => RenderNode<ChildrenProps>;\n BoxNode: (prop: BoxProps) => RenderNode<BoxProps>;\n BoxShadowNode: (prop: BoxShadowProps) => DeclarationNode<BoxShadowProps>;\n LayerNode: (prop: ChildrenProps) => RenderNode<ChildrenProps>;\n\n // Paragraph\n ParagraphNode: (props: ParagraphProps) => RenderNode<ParagraphProps>;\n };\n\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\nexport const createNode = (\n container: Container,\n type: NodeType,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n props: any\n) => {\n const { Sk } = container;\n switch (type) {\n case NodeType.Layer:\n return Sk.Layer(props);\n case NodeType.Group:\n return Sk.Group(props);\n case NodeType.Paint:\n return Sk.Paint(props);\n // Drawings\n case NodeType.Fill:\n return Sk.Fill(props);\n case NodeType.Image:\n return Sk.Image(props);\n case NodeType.Circle:\n return Sk.Circle(props);\n case NodeType.Path:\n return Sk.Path(props);\n case NodeType.Line:\n return Sk.Line(props);\n case NodeType.Oval:\n return Sk.Oval(props);\n case NodeType.Patch:\n return Sk.Patch(props);\n case NodeType.Points:\n return Sk.Points(props);\n case NodeType.Rect:\n return Sk.Rect(props);\n case NodeType.RRect:\n return Sk.RRect(props);\n case NodeType.Vertices:\n return Sk.Vertices(props);\n case NodeType.Text:\n return Sk.Text(props);\n case NodeType.TextPath:\n return Sk.TextPath(props);\n case NodeType.TextBlob:\n return Sk.TextBlob(props);\n case NodeType.Glyphs:\n return Sk.Glyphs(props);\n case NodeType.Atlas:\n return Sk.Atlas(props);\n case NodeType.DiffRect:\n return Sk.DiffRect(props);\n case NodeType.Picture:\n return Sk.Picture(props);\n case NodeType.ImageSVG:\n return Sk.ImageSVG(props);\n // Mask Filter\n case NodeType.BlurMaskFilter:\n return Sk.BlurMaskFilter(props);\n // Image Filter\n case NodeType.BlendImageFilter:\n return Sk.BlendImageFilter(props);\n case NodeType.BlurImageFilter:\n return Sk.BlurImageFilter(props);\n case NodeType.OffsetImageFilter:\n return Sk.OffsetImageFilter(props);\n case NodeType.DropShadowImageFilter:\n return Sk.DropShadowImageFilter(props);\n case NodeType.DisplacementMapImageFilter:\n return Sk.DisplacementMapImageFilter(props);\n case NodeType.MorphologyImageFilter:\n return Sk.MorphologyImageFilter(props);\n case NodeType.RuntimeShaderImageFilter:\n return Sk.RuntimeShaderImageFilter(props);\n // Color Filter\n case NodeType.MatrixColorFilter:\n return Sk.MatrixColorFilter(props);\n case NodeType.BlendColorFilter:\n return Sk.BlendColorFilter(props);\n case NodeType.LerpColorFilter:\n return Sk.LerpColorFilter(props);\n case NodeType.LumaColorFilter:\n return Sk.LumaColorFilter();\n case NodeType.LinearToSRGBGammaColorFilter:\n return Sk.LinearToSRGBGammaColorFilter();\n case NodeType.SRGBToLinearGammaColorFilter:\n return Sk.SRGBToLinearGammaColorFilter();\n // Shader\n case NodeType.Shader:\n return Sk.Shader(props);\n case NodeType.ImageShader:\n return Sk.ImageShader(props);\n case NodeType.ColorShader:\n return Sk.ColorShader(props);\n case NodeType.Turbulence:\n return Sk.Turbulence(props);\n case NodeType.FractalNoise:\n return Sk.FractalNoise(props);\n case NodeType.LinearGradient:\n return Sk.LinearGradient(props);\n case NodeType.RadialGradient:\n return Sk.RadialGradient(props);\n case NodeType.SweepGradient:\n return Sk.SweepGradient(props);\n case NodeType.TwoPointConicalGradient:\n return Sk.TwoPointConicalGradient(props);\n // Path Effect\n case NodeType.CornerPathEffect:\n return Sk.CornerPathEffect(props);\n case NodeType.DiscretePathEffect:\n return Sk.DiscretePathEffect(props);\n case NodeType.DashPathEffect:\n return Sk.DashPathEffect(props);\n case NodeType.Path1DPathEffect:\n return Sk.Path1DPathEffect(props);\n case NodeType.Path2DPathEffect:\n return Sk.Path2DPathEffect(props);\n case NodeType.SumPathEffect:\n return Sk.SumPathEffect();\n case NodeType.Line2DPathEffect:\n return Sk.Line2DPathEffect(props);\n // Mixed\n case NodeType.Blend:\n return Sk.Blend(props);\n case NodeType.BackdropFilter:\n return Sk.BackdropFilter(props);\n case NodeType.Box:\n return Sk.Box(props);\n case NodeType.BoxShadow:\n return Sk.BoxShadow(props);\n // Paragraph\n case NodeType.Paragraph:\n return Sk.Paragraph(props);\n default:\n return exhaustiveCheck(type);\n }\n};\n"],"mappings":";;;;;;;AAAA;;AA+DA;;AAGA;AACA,MAAMA,sBAAsB,GAAG,KAA/B;AACO,MAAMC,UAAU,GAAGD,sBAAsB,GAAG,KAAH,GAAW,CAAC,CAACE,MAAM,CAACC,UAA7D;;;AA6MA,MAAMC,UAAU,GAAG,CACxBC,SADwB,EAExBC,IAFwB,EAIxBC,KAJwB,KAKrB;EACH,MAAM;IAAEC;EAAF,IAASH,SAAf;;EACA,QAAQC,IAAR;IAC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A,EAAgB7D,IAAhB,CAAP;EA5HJ;AA8HD,CArIM"}
@@ -1,2 +1,5 @@
1
1
  import type { ReactElement } from "react";
2
- export declare const drawAsImage: (element: ReactElement, width: number, height: number) => import("../skia").SkImage;
2
+ import type { SkPicture, SkSize } from "../skia/types";
3
+ export declare const drawAsPicture: (element: ReactElement) => SkPicture;
4
+ export declare const drawAsImage: (element: ReactElement, size: SkSize) => import("../skia").SkImage;
5
+ export declare const drawAsImageFromPicture: (picture: SkPicture, size: SkSize) => import("../skia").SkImage;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.drawAsImage = void 0;
6
+ exports.drawAsPicture = exports.drawAsImageFromPicture = exports.drawAsImage = void 0;
7
7
 
8
8
  var _types = require("../dom/types");
9
9
 
@@ -11,21 +11,39 @@ var _skia = require("../skia");
11
11
 
12
12
  var _Reconciler = require("./Reconciler");
13
13
 
14
- const drawAsImage = (element, width, height) => {
15
- const surface = _skia.Skia.Surface.MakeOffscreen(width, height);
14
+ const drawAsPicture = element => {
15
+ const recorder = _skia.Skia.PictureRecorder();
16
16
 
17
- if (!surface) {
18
- throw new Error("Could not create offscreen surface");
19
- }
20
-
21
- const canvas = surface.getCanvas();
22
- const root = new _Reconciler.SkiaRoot(_skia.Skia);
17
+ const canvas = recorder.beginRecording();
18
+ const root = new _Reconciler.SkiaRoot(_skia.Skia, false);
23
19
  root.render(element);
24
20
  const ctx = new _types.JsiDrawingContext(_skia.Skia, canvas);
25
21
  root.dom.render(ctx);
22
+ const picture = recorder.finishRecordingAsPicture();
23
+ return picture;
24
+ };
25
+
26
+ exports.drawAsPicture = drawAsPicture;
27
+
28
+ const drawAsImage = (element, size) => {
29
+ return drawAsImageFromPicture(drawAsPicture(element), size);
30
+ }; // TODO: We're not sure yet why PixelRatio is not needed here.
31
+
32
+
33
+ exports.drawAsImage = drawAsImage;
34
+ const pd = 1;
35
+
36
+ const drawAsImageFromPicture = (picture, size) => {
37
+ "worklet";
38
+
39
+ const surface = _skia.Skia.Surface.MakeOffscreen(size.width * pd, size.height * pd);
40
+
41
+ const canvas = surface.getCanvas();
42
+ canvas.scale(pd, pd);
43
+ canvas.drawPicture(picture);
26
44
  surface.flush();
27
45
  return surface.makeImageSnapshot();
28
46
  };
29
47
 
30
- exports.drawAsImage = drawAsImage;
48
+ exports.drawAsImageFromPicture = drawAsImageFromPicture;
31
49
  //# sourceMappingURL=Offscreen.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["drawAsImage","element","width","height","surface","Skia","Surface","MakeOffscreen","Error","canvas","getCanvas","root","SkiaRoot","render","ctx","JsiDrawingContext","dom","flush","makeImageSnapshot"],"sources":["Offscreen.tsx"],"sourcesContent":["import type { ReactElement } from \"react\";\n\nimport { JsiDrawingContext } from \"../dom/types\";\nimport { Skia } from \"../skia\";\n\nimport { SkiaRoot } from \"./Reconciler\";\n\nexport const drawAsImage = (\n element: ReactElement,\n width: number,\n height: number\n) => {\n const surface = Skia.Surface.MakeOffscreen(width, height);\n if (!surface) {\n throw new Error(\"Could not create offscreen surface\");\n }\n const canvas = surface.getCanvas();\n const root = new SkiaRoot(Skia);\n root.render(element);\n const ctx = new JsiDrawingContext(Skia, canvas);\n root.dom.render(ctx);\n surface.flush();\n return surface.makeImageSnapshot();\n};\n"],"mappings":";;;;;;;AAEA;;AACA;;AAEA;;AAEO,MAAMA,WAAW,GAAG,CACzBC,OADyB,EAEzBC,KAFyB,EAGzBC,MAHyB,KAItB;EACH,MAAMC,OAAO,GAAGC,UAAA,CAAKC,OAAL,CAAaC,aAAb,CAA2BL,KAA3B,EAAkCC,MAAlC,CAAhB;;EACA,IAAI,CAACC,OAAL,EAAc;IACZ,MAAM,IAAII,KAAJ,CAAU,oCAAV,CAAN;EACD;;EACD,MAAMC,MAAM,GAAGL,OAAO,CAACM,SAAR,EAAf;EACA,MAAMC,IAAI,GAAG,IAAIC,oBAAJ,CAAaP,UAAb,CAAb;EACAM,IAAI,CAACE,MAAL,CAAYZ,OAAZ;EACA,MAAMa,GAAG,GAAG,IAAIC,wBAAJ,CAAsBV,UAAtB,EAA4BI,MAA5B,CAAZ;EACAE,IAAI,CAACK,GAAL,CAASH,MAAT,CAAgBC,GAAhB;EACAV,OAAO,CAACa,KAAR;EACA,OAAOb,OAAO,CAACc,iBAAR,EAAP;AACD,CAhBM"}
1
+ {"version":3,"names":["drawAsPicture","element","recorder","Skia","PictureRecorder","canvas","beginRecording","root","SkiaRoot","render","ctx","JsiDrawingContext","dom","picture","finishRecordingAsPicture","drawAsImage","size","drawAsImageFromPicture","pd","surface","Surface","MakeOffscreen","width","height","getCanvas","scale","drawPicture","flush","makeImageSnapshot"],"sources":["Offscreen.tsx"],"sourcesContent":["import type { ReactElement } from \"react\";\n\nimport { JsiDrawingContext } from \"../dom/types\";\nimport type { SkPicture, SkSize } from \"../skia/types\";\nimport { Skia } from \"../skia\";\n\nimport { SkiaRoot } from \"./Reconciler\";\n\nexport const drawAsPicture = (element: ReactElement) => {\n const recorder = Skia.PictureRecorder();\n const canvas = recorder.beginRecording();\n const root = new SkiaRoot(Skia, false);\n root.render(element);\n const ctx = new JsiDrawingContext(Skia, canvas);\n root.dom.render(ctx);\n const picture = recorder.finishRecordingAsPicture();\n return picture;\n};\n\nexport const drawAsImage = (element: ReactElement, size: SkSize) => {\n return drawAsImageFromPicture(drawAsPicture(element), size);\n};\n\n// TODO: We're not sure yet why PixelRatio is not needed here.\nconst pd = 1;\nexport const drawAsImageFromPicture = (picture: SkPicture, size: SkSize) => {\n \"worklet\";\n const surface = Skia.Surface.MakeOffscreen(\n size.width * pd,\n size.height * pd\n )!;\n const canvas = surface.getCanvas();\n canvas.scale(pd, pd);\n canvas.drawPicture(picture);\n surface.flush();\n return surface.makeImageSnapshot();\n};\n"],"mappings":";;;;;;;AAEA;;AAEA;;AAEA;;AAEO,MAAMA,aAAa,GAAIC,OAAD,IAA2B;EACtD,MAAMC,QAAQ,GAAGC,UAAA,CAAKC,eAAL,EAAjB;;EACA,MAAMC,MAAM,GAAGH,QAAQ,CAACI,cAAT,EAAf;EACA,MAAMC,IAAI,GAAG,IAAIC,oBAAJ,CAAaL,UAAb,EAAmB,KAAnB,CAAb;EACAI,IAAI,CAACE,MAAL,CAAYR,OAAZ;EACA,MAAMS,GAAG,GAAG,IAAIC,wBAAJ,CAAsBR,UAAtB,EAA4BE,MAA5B,CAAZ;EACAE,IAAI,CAACK,GAAL,CAASH,MAAT,CAAgBC,GAAhB;EACA,MAAMG,OAAO,GAAGX,QAAQ,CAACY,wBAAT,EAAhB;EACA,OAAOD,OAAP;AACD,CATM;;;;AAWA,MAAME,WAAW,GAAG,CAACd,OAAD,EAAwBe,IAAxB,KAAyC;EAClE,OAAOC,sBAAsB,CAACjB,aAAa,CAACC,OAAD,CAAd,EAAyBe,IAAzB,CAA7B;AACD,CAFM,C,CAIP;;;;AACA,MAAME,EAAE,GAAG,CAAX;;AACO,MAAMD,sBAAsB,GAAG,CAACJ,OAAD,EAAqBG,IAArB,KAAsC;EAC1E;;EACA,MAAMG,OAAO,GAAGhB,UAAA,CAAKiB,OAAL,CAAaC,aAAb,CACdL,IAAI,CAACM,KAAL,GAAaJ,EADC,EAEdF,IAAI,CAACO,MAAL,GAAcL,EAFA,CAAhB;;EAIA,MAAMb,MAAM,GAAGc,OAAO,CAACK,SAAR,EAAf;EACAnB,MAAM,CAACoB,KAAP,CAAaP,EAAb,EAAiBA,EAAjB;EACAb,MAAM,CAACqB,WAAP,CAAmBb,OAAnB;EACAM,OAAO,CAACQ,KAAR;EACA,OAAOR,OAAO,CAACS,iBAAR,EAAP;AACD,CAXM"}
@@ -3,7 +3,7 @@ import type { Skia } from "../skia/types";
3
3
  export declare class SkiaRoot {
4
4
  private root;
5
5
  private container;
6
- constructor(Skia: Skia, redraw?: () => void, getNativeId?: () => number);
6
+ constructor(Skia: Skia, native?: boolean, redraw?: () => void, getNativeId?: () => number);
7
7
  render(element: ReactNode): void;
8
8
  unmount(): void;
9
9
  get dom(): import("..").RenderNode<import("..").GroupProps>;
@@ -24,14 +24,15 @@ skiaReconciler.injectIntoDevTools({
24
24
 
25
25
  class SkiaRoot {
26
26
  constructor(Skia) {
27
- let redraw = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : () => {};
28
- let getNativeId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : () => 0;
27
+ let native = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
28
+ let redraw = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : () => {};
29
+ let getNativeId = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : () => 0;
29
30
 
30
31
  _defineProperty(this, "root", void 0);
31
32
 
32
33
  _defineProperty(this, "container", void 0);
33
34
 
34
- this.container = new _Container.Container(Skia, redraw, getNativeId);
35
+ this.container = new _Container.Container(Skia, redraw, getNativeId, native);
35
36
  this.root = skiaReconciler.createContainer(this.container, 0, null, true, null, "", console.error, null);
36
37
  }
37
38
 
@@ -43,7 +44,9 @@ class SkiaRoot {
43
44
  }
44
45
 
45
46
  unmount() {
46
- skiaReconciler.updateContainer(null, this.root, null, () => {});
47
+ skiaReconciler.updateContainer(null, this.root, null, () => {
48
+ (0, _HostConfig.debug)("unmountContainer");
49
+ });
47
50
  }
48
51
 
49
52
  get dom() {
@@ -1 +1 @@
1
- {"version":3,"names":["skiaReconciler","ReactReconciler","skHostConfig","injectIntoDevTools","bundleType","version","rendererPackageName","SkiaRoot","constructor","Skia","redraw","getNativeId","container","Container","root","createContainer","console","error","render","element","updateContainer","hostDebug","unmount","dom"],"sources":["Reconciler.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport type { OpaqueRoot } from \"react-reconciler\";\nimport ReactReconciler from \"react-reconciler\";\n\nimport type { Skia } from \"../skia/types\";\n\nimport { skHostConfig, debug as hostDebug } from \"./HostConfig\";\nimport { Container } from \"./Container\";\n\nconst skiaReconciler = ReactReconciler(skHostConfig);\n\nskiaReconciler.injectIntoDevTools({\n bundleType: 1,\n version: \"0.0.1\",\n rendererPackageName: \"react-native-skia\",\n});\n\nexport class SkiaRoot {\n private root: OpaqueRoot;\n private container: Container;\n\n constructor(\n Skia: Skia,\n redraw: () => void = () => {},\n getNativeId: () => number = () => 0\n ) {\n this.container = new Container(Skia, redraw, getNativeId);\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 render(element: ReactNode) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n skiaReconciler.updateContainer(element as any, this.root, null, () => {\n hostDebug(\"updateContainer\");\n });\n }\n\n unmount() {\n skiaReconciler.updateContainer(null, this.root, null, () => {});\n }\n\n get dom() {\n return this.container.root;\n }\n}\n"],"mappings":";;;;;;;AAEA;;AAIA;;AACA;;;;;;AAEA,MAAMA,cAAc,GAAG,IAAAC,wBAAA,EAAgBC,wBAAhB,CAAvB;AAEAF,cAAc,CAACG,kBAAf,CAAkC;EAChCC,UAAU,EAAE,CADoB;EAEhCC,OAAO,EAAE,OAFuB;EAGhCC,mBAAmB,EAAE;AAHW,CAAlC;;AAMO,MAAMC,QAAN,CAAe;EAIpBC,WAAW,CACTC,IADS,EAIT;IAAA,IAFAC,MAEA,uEAFqB,MAAM,CAAE,CAE7B;IAAA,IADAC,WACA,uEAD4B,MAAM,CAClC;;IAAA;;IAAA;;IACA,KAAKC,SAAL,GAAiB,IAAIC,oBAAJ,CAAcJ,IAAd,EAAoBC,MAApB,EAA4BC,WAA5B,CAAjB;IACA,KAAKG,IAAL,GAAYd,cAAc,CAACe,eAAf,CACV,KAAKH,SADK,EAEV,CAFU,EAGV,IAHU,EAIV,IAJU,EAKV,IALU,EAMV,EANU,EAOVI,OAAO,CAACC,KAPE,EAQV,IARU,CAAZ;EAUD;;EAEDC,MAAM,CAACC,OAAD,EAAqB;IACzB;IACAnB,cAAc,CAACoB,eAAf,CAA+BD,OAA/B,EAA+C,KAAKL,IAApD,EAA0D,IAA1D,EAAgE,MAAM;MACpE,IAAAO,iBAAA,EAAU,iBAAV;IACD,CAFD;EAGD;;EAEDC,OAAO,GAAG;IACRtB,cAAc,CAACoB,eAAf,CAA+B,IAA/B,EAAqC,KAAKN,IAA1C,EAAgD,IAAhD,EAAsD,MAAM,CAAE,CAA9D;EACD;;EAEM,IAAHS,GAAG,GAAG;IACR,OAAO,KAAKX,SAAL,CAAeE,IAAtB;EACD;;AAnCmB"}
1
+ {"version":3,"names":["skiaReconciler","ReactReconciler","skHostConfig","injectIntoDevTools","bundleType","version","rendererPackageName","SkiaRoot","constructor","Skia","native","redraw","getNativeId","container","Container","root","createContainer","console","error","render","element","updateContainer","hostDebug","unmount","dom"],"sources":["Reconciler.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport type { OpaqueRoot } from \"react-reconciler\";\nimport ReactReconciler from \"react-reconciler\";\n\nimport type { Skia } from \"../skia/types\";\n\nimport { skHostConfig, debug as hostDebug } from \"./HostConfig\";\nimport { Container } from \"./Container\";\n\nconst skiaReconciler = ReactReconciler(skHostConfig);\n\nskiaReconciler.injectIntoDevTools({\n bundleType: 1,\n version: \"0.0.1\",\n rendererPackageName: \"react-native-skia\",\n});\n\nexport class SkiaRoot {\n private root: OpaqueRoot;\n private container: Container;\n\n constructor(\n Skia: Skia,\n native = false,\n redraw: () => void = () => {},\n getNativeId: () => number = () => 0\n ) {\n this.container = new Container(Skia, redraw, getNativeId, native);\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 render(element: ReactNode) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n skiaReconciler.updateContainer(element as any, this.root, null, () => {\n hostDebug(\"updateContainer\");\n });\n }\n\n unmount() {\n skiaReconciler.updateContainer(null, this.root, null, () => {\n hostDebug(\"unmountContainer\");\n });\n }\n\n get dom() {\n return this.container.root;\n }\n}\n"],"mappings":";;;;;;;AAEA;;AAIA;;AACA;;;;;;AAEA,MAAMA,cAAc,GAAG,IAAAC,wBAAA,EAAgBC,wBAAhB,CAAvB;AAEAF,cAAc,CAACG,kBAAf,CAAkC;EAChCC,UAAU,EAAE,CADoB;EAEhCC,OAAO,EAAE,OAFuB;EAGhCC,mBAAmB,EAAE;AAHW,CAAlC;;AAMO,MAAMC,QAAN,CAAe;EAIpBC,WAAW,CACTC,IADS,EAKT;IAAA,IAHAC,MAGA,uEAHS,KAGT;IAAA,IAFAC,MAEA,uEAFqB,MAAM,CAAE,CAE7B;IAAA,IADAC,WACA,uEAD4B,MAAM,CAClC;;IAAA;;IAAA;;IACA,KAAKC,SAAL,GAAiB,IAAIC,oBAAJ,CAAcL,IAAd,EAAoBE,MAApB,EAA4BC,WAA5B,EAAyCF,MAAzC,CAAjB;IACA,KAAKK,IAAL,GAAYf,cAAc,CAACgB,eAAf,CACV,KAAKH,SADK,EAEV,CAFU,EAGV,IAHU,EAIV,IAJU,EAKV,IALU,EAMV,EANU,EAOVI,OAAO,CAACC,KAPE,EAQV,IARU,CAAZ;EAUD;;EAEDC,MAAM,CAACC,OAAD,EAAqB;IACzB;IACApB,cAAc,CAACqB,eAAf,CAA+BD,OAA/B,EAA+C,KAAKL,IAApD,EAA0D,IAA1D,EAAgE,MAAM;MACpE,IAAAO,iBAAA,EAAU,iBAAV;IACD,CAFD;EAGD;;EAEDC,OAAO,GAAG;IACRvB,cAAc,CAACqB,eAAf,CAA+B,IAA/B,EAAqC,KAAKN,IAA1C,EAAgD,IAAhD,EAAsD,MAAM;MAC1D,IAAAO,iBAAA,EAAU,kBAAV;IACD,CAFD;EAGD;;EAEM,IAAHE,GAAG,GAAG;IACR,OAAO,KAAKX,SAAL,CAAeE,IAAtB;EACD;;AAtCmB"}
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import type { AtlasProps } from "../../../dom/types";
3
+ import type { SkiaProps } from "../../processors";
4
+ export declare const Atlas: (props: SkiaProps<AtlasProps>) => React.JSX.Element;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Atlas = void 0;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+
12
+ const Atlas = props => {
13
+ return /*#__PURE__*/_react.default.createElement("skAtlas", props);
14
+ };
15
+
16
+ exports.Atlas = Atlas;
17
+ //# sourceMappingURL=Atlas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Atlas","props"],"sources":["Atlas.tsx"],"sourcesContent":["import React from \"react\";\n\nimport type { AtlasProps } from \"../../../dom/types\";\nimport type { SkiaProps } from \"../../processors\";\n\nexport const Atlas = (props: SkiaProps<AtlasProps>) => {\n return <skAtlas {...props} />;\n};\n"],"mappings":";;;;;;;AAAA;;;;AAKO,MAAMA,KAAK,GAAIC,KAAD,IAAkC;EACrD,oBAAO,wCAAaA,KAAb,CAAP;AACD,CAFM"}
@@ -11,3 +11,4 @@ export * from "./Vertices";
11
11
  export * from "./Fill";
12
12
  export * from "./FitBox";
13
13
  export * from "./Box";
14
+ export * from "./Atlas";
@@ -172,4 +172,17 @@ Object.keys(_Box).forEach(function (key) {
172
172
  }
173
173
  });
174
174
  });
175
+
176
+ var _Atlas = require("./Atlas");
177
+
178
+ Object.keys(_Atlas).forEach(function (key) {
179
+ if (key === "default" || key === "__esModule") return;
180
+ if (key in exports && exports[key] === _Atlas[key]) return;
181
+ Object.defineProperty(exports, key, {
182
+ enumerable: true,
183
+ get: function () {
184
+ return _Atlas[key];
185
+ }
186
+ });
187
+ });
175
188
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./Circle\";\nexport * from \"./Rect\";\nexport * from \"./RoundedRect\";\nexport * from \"./DiffRect\";\nexport * from \"./Line\";\nexport * from \"./Path\";\nexport * from \"./Oval\";\nexport * from \"./Points\";\nexport * from \"./Patch\";\nexport * from \"./Vertices\";\nexport * from \"./Fill\";\nexport * from \"./FitBox\";\nexport * from \"./Box\";\n"],"mappings":";;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./Circle\";\nexport * from \"./Rect\";\nexport * from \"./RoundedRect\";\nexport * from \"./DiffRect\";\nexport * from \"./Line\";\nexport * from \"./Path\";\nexport * from \"./Oval\";\nexport * from \"./Points\";\nexport * from \"./Patch\";\nexport * from \"./Vertices\";\nexport * from \"./Fill\";\nexport * from \"./FitBox\";\nexport * from \"./Box\";\nexport * from \"./Atlas\";\n"],"mappings":";;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
@@ -2,4 +2,4 @@ import type { DataSourceParam } from "../types";
2
2
  /**
3
3
  * Returns a Skia Animated Image object
4
4
  * */
5
- export declare const useAnimatedImage: (source: DataSourceParam, onError?: ((err: Error) => void) | undefined) => import("../types").SkAnimatedImage | null;
5
+ export declare const useAnimatedImage: (source: DataSourceParam, onError?: ((err: Error) => void) | undefined, managed?: boolean) => import("../types").SkAnimatedImage | null;