@shopify/react-native-skia 0.1.150 → 0.1.152

Sign up to get free protection for your applications and to get access to all the features.
Files changed (774) hide show
  1. package/android/CMakeLists.txt +4 -5
  2. package/android/cpp/jni/JniLoad.cpp +7 -5
  3. package/android/cpp/jni/JniSkiaManager.cpp +2 -15
  4. package/android/cpp/jni/include/JniSkiaBaseView.h +68 -0
  5. package/android/cpp/jni/include/JniSkiaDrawView.h +64 -47
  6. package/android/cpp/jni/include/JniSkiaManager.h +8 -10
  7. package/android/cpp/jni/include/JniSkiaPictureView.h +96 -0
  8. package/android/cpp/rnskia-android/{RNSkPlatformContextImpl.h → RNSkAndroidPlatformContext.h} +4 -4
  9. package/android/cpp/rnskia-android/RNSkAndroidView.h +100 -0
  10. package/android/cpp/rnskia-android/RNSkOpenGLCanvasProvider.cpp +91 -0
  11. package/android/cpp/rnskia-android/RNSkOpenGLCanvasProvider.h +39 -0
  12. package/android/cpp/rnskia-android/SkiaOpenGLRenderer.cpp +15 -6
  13. package/android/cpp/rnskia-android/SkiaOpenGLRenderer.h +5 -4
  14. package/android/src/main/java/com/shopify/reactnative/skia/PlatformContext.java +5 -11
  15. package/android/src/main/java/com/shopify/reactnative/skia/RNSkiaPackage.java +1 -2
  16. package/android/src/main/java/com/shopify/reactnative/skia/SkiaBaseView.java +143 -0
  17. package/android/src/main/java/com/shopify/reactnative/skia/SkiaDrawView.java +17 -145
  18. package/android/src/main/java/com/shopify/reactnative/skia/{RNSkiaViewManager.java → SkiaDrawViewManager.java} +4 -15
  19. package/android/src/main/java/com/shopify/reactnative/skia/SkiaManager.java +1 -10
  20. package/android/src/main/java/com/shopify/reactnative/skia/SkiaPictureView.java +45 -0
  21. package/android/src/main/java/com/shopify/reactnative/skia/SkiaPictureViewManager.java +64 -0
  22. package/cpp/jsi/JsiValueWrapper.h +11 -0
  23. package/cpp/rnskia/RNSkInfoParameter.h +4 -14
  24. package/cpp/rnskia/RNSkJsView.cpp +211 -0
  25. package/cpp/rnskia/RNSkJsView.h +115 -0
  26. package/cpp/rnskia/RNSkJsiViewApi.h +6 -6
  27. package/cpp/rnskia/RNSkManager.cpp +7 -7
  28. package/cpp/rnskia/RNSkManager.h +7 -7
  29. package/cpp/rnskia/RNSkPictureView.h +124 -0
  30. package/cpp/rnskia/RNSkView.h +287 -0
  31. package/ios/RNSkia-iOS/RNSkMetalCanvasProvider.h +38 -0
  32. package/ios/RNSkia-iOS/{RNSkDrawViewImpl.mm → RNSkMetalCanvasProvider.mm} +40 -23
  33. package/ios/RNSkia-iOS/{PlatformContext.h → RNSkiOSPlatformContext.h} +4 -4
  34. package/ios/RNSkia-iOS/{PlatformContext.mm → RNSkiOSPlatformContext.mm} +5 -5
  35. package/ios/RNSkia-iOS/RNSkiOSView.h +34 -0
  36. package/ios/RNSkia-iOS/SkiaDrawViewManager.mm +19 -11
  37. package/ios/RNSkia-iOS/SkiaManager.mm +3 -3
  38. package/ios/RNSkia-iOS/SkiaPictureViewManager.h +8 -0
  39. package/ios/RNSkia-iOS/SkiaPictureViewManager.mm +51 -0
  40. package/ios/RNSkia-iOS/SkiaUIView.h +26 -0
  41. package/ios/RNSkia-iOS/{SkiaDrawView.mm → SkiaUIView.mm} +29 -23
  42. package/lib/commonjs/animation/decay/decay.js.map +1 -1
  43. package/lib/commonjs/animation/decay/index.js.map +1 -1
  44. package/lib/commonjs/animation/decay/runDecay.js.map +1 -1
  45. package/lib/commonjs/animation/decay/types.js.map +1 -1
  46. package/lib/commonjs/animation/functions/index.js.map +1 -1
  47. package/lib/commonjs/animation/functions/interpolate.js.map +1 -1
  48. package/lib/commonjs/animation/functions/interpolateColors.js.map +1 -1
  49. package/lib/commonjs/animation/functions/interpolatePaths.js.map +1 -1
  50. package/lib/commonjs/animation/functions/interpolateVector.js.map +1 -1
  51. package/lib/commonjs/animation/index.js.map +1 -1
  52. package/lib/commonjs/animation/spring/Spring.js.map +1 -1
  53. package/lib/commonjs/animation/spring/functions/index.js.map +1 -1
  54. package/lib/commonjs/animation/spring/functions/spring.js.map +1 -1
  55. package/lib/commonjs/animation/spring/index.js.map +1 -1
  56. package/lib/commonjs/animation/spring/runSpring.js +1 -1
  57. package/lib/commonjs/animation/spring/runSpring.js.map +1 -1
  58. package/lib/commonjs/animation/spring/types.js.map +1 -1
  59. package/lib/commonjs/animation/spring/useSpring.js +1 -1
  60. package/lib/commonjs/animation/spring/useSpring.js.map +1 -1
  61. package/lib/commonjs/animation/timing/Easing.js.map +1 -1
  62. package/lib/commonjs/animation/timing/createTiming.js +2 -6
  63. package/lib/commonjs/animation/timing/createTiming.js.map +1 -1
  64. package/lib/commonjs/animation/timing/functions/bezier.js.map +1 -1
  65. package/lib/commonjs/animation/timing/functions/getResolvedParams.js +6 -10
  66. package/lib/commonjs/animation/timing/functions/getResolvedParams.js.map +1 -1
  67. package/lib/commonjs/animation/timing/functions/index.js.map +1 -1
  68. package/lib/commonjs/animation/timing/functions/timing.js.map +1 -1
  69. package/lib/commonjs/animation/timing/functions/types.js.map +1 -1
  70. package/lib/commonjs/animation/timing/index.js.map +1 -1
  71. package/lib/commonjs/animation/timing/runTiming.js.map +1 -1
  72. package/lib/commonjs/animation/timing/useLoop.js.map +1 -1
  73. package/lib/commonjs/animation/timing/useTiming.js +1 -3
  74. package/lib/commonjs/animation/timing/useTiming.js.map +1 -1
  75. package/lib/commonjs/animation/types.js.map +1 -1
  76. package/lib/commonjs/dom/nodes/DrawingNode.js.map +1 -1
  77. package/lib/commonjs/dom/nodes/GroupNode.js.map +1 -1
  78. package/lib/commonjs/dom/nodes/JsiSkDOM.js +1 -1
  79. package/lib/commonjs/dom/nodes/JsiSkDOM.js.map +1 -1
  80. package/lib/commonjs/dom/nodes/Node.js.map +1 -1
  81. package/lib/commonjs/dom/nodes/PaintContext.js.map +1 -1
  82. package/lib/commonjs/dom/nodes/PaintNode.js.map +1 -1
  83. package/lib/commonjs/dom/nodes/RenderNode.js.map +1 -1
  84. package/lib/commonjs/dom/nodes/datatypes/Circle.js.map +1 -1
  85. package/lib/commonjs/dom/nodes/datatypes/Color.js.map +1 -1
  86. package/lib/commonjs/dom/nodes/datatypes/Enum.js.map +1 -1
  87. package/lib/commonjs/dom/nodes/datatypes/Fitting.js.map +1 -1
  88. package/lib/commonjs/dom/nodes/datatypes/Gradient.js +2 -2
  89. package/lib/commonjs/dom/nodes/datatypes/Gradient.js.map +1 -1
  90. package/lib/commonjs/dom/nodes/datatypes/Path.js.map +1 -1
  91. package/lib/commonjs/dom/nodes/datatypes/Radius.js.map +1 -1
  92. package/lib/commonjs/dom/nodes/datatypes/Rect.js.map +1 -1
  93. package/lib/commonjs/dom/nodes/datatypes/Transform.js.map +1 -1
  94. package/lib/commonjs/dom/nodes/datatypes/index.js.map +1 -1
  95. package/lib/commonjs/dom/nodes/drawings/BackdropFilterNode.js.map +1 -1
  96. package/lib/commonjs/dom/nodes/drawings/Box.js.map +1 -1
  97. package/lib/commonjs/dom/nodes/drawings/CircleNode.js.map +1 -1
  98. package/lib/commonjs/dom/nodes/drawings/CustomDrawingNode.js.map +1 -1
  99. package/lib/commonjs/dom/nodes/drawings/DiffRectNode.js.map +1 -1
  100. package/lib/commonjs/dom/nodes/drawings/FillNode.js.map +1 -1
  101. package/lib/commonjs/dom/nodes/drawings/ImageNode.js.map +1 -1
  102. package/lib/commonjs/dom/nodes/drawings/ImageSVG.js.map +1 -1
  103. package/lib/commonjs/dom/nodes/drawings/LineNode.js.map +1 -1
  104. package/lib/commonjs/dom/nodes/drawings/OvalNode.js.map +1 -1
  105. package/lib/commonjs/dom/nodes/drawings/PatchNode.js.map +1 -1
  106. package/lib/commonjs/dom/nodes/drawings/PathNode.js.map +1 -1
  107. package/lib/commonjs/dom/nodes/drawings/PictureNode.js.map +1 -1
  108. package/lib/commonjs/dom/nodes/drawings/PointsNode.js.map +1 -1
  109. package/lib/commonjs/dom/nodes/drawings/RRectNode.js.map +1 -1
  110. package/lib/commonjs/dom/nodes/drawings/RectNode.js.map +1 -1
  111. package/lib/commonjs/dom/nodes/drawings/Text.js.map +1 -1
  112. package/lib/commonjs/dom/nodes/drawings/VerticesNode.js.map +1 -1
  113. package/lib/commonjs/dom/nodes/drawings/index.js.map +1 -1
  114. package/lib/commonjs/dom/nodes/index.js.map +1 -1
  115. package/lib/commonjs/dom/nodes/paint/BlendNode.js.map +1 -1
  116. package/lib/commonjs/dom/nodes/paint/ColorFilters.js.map +1 -1
  117. package/lib/commonjs/dom/nodes/paint/ImageFilters.js.map +1 -1
  118. package/lib/commonjs/dom/nodes/paint/MaskFilters.js.map +1 -1
  119. package/lib/commonjs/dom/nodes/paint/PathEffects.js.map +1 -1
  120. package/lib/commonjs/dom/nodes/paint/Shaders.js +2 -4
  121. package/lib/commonjs/dom/nodes/paint/Shaders.js.map +1 -1
  122. package/lib/commonjs/dom/nodes/paint/index.js.map +1 -1
  123. package/lib/commonjs/dom/types/ColorFilters.js.map +1 -1
  124. package/lib/commonjs/dom/types/Common.js.map +1 -1
  125. package/lib/commonjs/dom/types/DrawingContext.js.map +1 -1
  126. package/lib/commonjs/dom/types/Drawings.js.map +1 -1
  127. package/lib/commonjs/dom/types/ImageFilters.js.map +1 -1
  128. package/lib/commonjs/dom/types/MaskFilters.js.map +1 -1
  129. package/lib/commonjs/dom/types/Node.js.map +1 -1
  130. package/lib/commonjs/dom/types/NodeType.js.map +1 -1
  131. package/lib/commonjs/dom/types/PathEffects.js.map +1 -1
  132. package/lib/commonjs/dom/types/Shaders.js.map +1 -1
  133. package/lib/commonjs/dom/types/SkDOM.js.map +1 -1
  134. package/lib/commonjs/dom/types/index.js.map +1 -1
  135. package/lib/commonjs/external/index.js.map +1 -1
  136. package/lib/commonjs/external/reanimated/index.js.map +1 -1
  137. package/lib/commonjs/external/reanimated/useSharedValueEffect.js.map +1 -1
  138. package/lib/commonjs/index.js.map +1 -1
  139. package/lib/commonjs/mock/index.js +6 -10
  140. package/lib/commonjs/mock/index.js.map +1 -1
  141. package/lib/commonjs/renderer/Canvas.js.map +1 -1
  142. package/lib/commonjs/renderer/Container.js.map +1 -1
  143. package/lib/commonjs/renderer/DependencyManager.js.map +1 -1
  144. package/lib/commonjs/renderer/DrawingContext.js.map +1 -1
  145. package/lib/commonjs/renderer/HostComponents.js.map +1 -1
  146. package/lib/commonjs/renderer/HostConfig.js +0 -2
  147. package/lib/commonjs/renderer/HostConfig.js.map +1 -1
  148. package/lib/commonjs/renderer/components/Blend.js.map +1 -1
  149. package/lib/commonjs/renderer/components/Drawing.js.map +1 -1
  150. package/lib/commonjs/renderer/components/Group.js.map +1 -1
  151. package/lib/commonjs/renderer/components/Mask.js.map +1 -1
  152. package/lib/commonjs/renderer/components/Paint.js +1 -1
  153. package/lib/commonjs/renderer/components/Paint.js.map +1 -1
  154. package/lib/commonjs/renderer/components/Picture.js.map +1 -1
  155. package/lib/commonjs/renderer/components/backdrop/BackdropBlur.js +1 -1
  156. package/lib/commonjs/renderer/components/backdrop/BackdropBlur.js.map +1 -1
  157. package/lib/commonjs/renderer/components/backdrop/BackdropFilter.js.map +1 -1
  158. package/lib/commonjs/renderer/components/backdrop/index.js.map +1 -1
  159. package/lib/commonjs/renderer/components/colorFilters/BlendColor.js.map +1 -1
  160. package/lib/commonjs/renderer/components/colorFilters/Lerp.js.map +1 -1
  161. package/lib/commonjs/renderer/components/colorFilters/LinearToSRGBGamma.js.map +1 -1
  162. package/lib/commonjs/renderer/components/colorFilters/LumaColorFilter.js.map +1 -1
  163. package/lib/commonjs/renderer/components/colorFilters/Matrix.js.map +1 -1
  164. package/lib/commonjs/renderer/components/colorFilters/SRGBToLinearGamma.js.map +1 -1
  165. package/lib/commonjs/renderer/components/colorFilters/index.js.map +1 -1
  166. package/lib/commonjs/renderer/components/image/Image.js.map +1 -1
  167. package/lib/commonjs/renderer/components/image/ImageSVG.js.map +1 -1
  168. package/lib/commonjs/renderer/components/image/ImageShader.js.map +1 -1
  169. package/lib/commonjs/renderer/components/image/index.js.map +1 -1
  170. package/lib/commonjs/renderer/components/imageFilters/Blur.js.map +1 -1
  171. package/lib/commonjs/renderer/components/imageFilters/DisplacementMap.js.map +1 -1
  172. package/lib/commonjs/renderer/components/imageFilters/Morphology.js.map +1 -1
  173. package/lib/commonjs/renderer/components/imageFilters/Offset.js.map +1 -1
  174. package/lib/commonjs/renderer/components/imageFilters/RuntimeShader.js.map +1 -1
  175. package/lib/commonjs/renderer/components/imageFilters/Shadow.js.map +1 -1
  176. package/lib/commonjs/renderer/components/imageFilters/index.js.map +1 -1
  177. package/lib/commonjs/renderer/components/index.js.map +1 -1
  178. package/lib/commonjs/renderer/components/maskFilters/Blur.js.map +1 -1
  179. package/lib/commonjs/renderer/components/maskFilters/index.js.map +1 -1
  180. package/lib/commonjs/renderer/components/pathEffects/Corner.js.map +1 -1
  181. package/lib/commonjs/renderer/components/pathEffects/Dash.js.map +1 -1
  182. package/lib/commonjs/renderer/components/pathEffects/Discrete.js.map +1 -1
  183. package/lib/commonjs/renderer/components/pathEffects/Line2D.js.map +1 -1
  184. package/lib/commonjs/renderer/components/pathEffects/Path1D.js.map +1 -1
  185. package/lib/commonjs/renderer/components/pathEffects/Path2D.js.map +1 -1
  186. package/lib/commonjs/renderer/components/pathEffects/Sum.js.map +1 -1
  187. package/lib/commonjs/renderer/components/pathEffects/index.js.map +1 -1
  188. package/lib/commonjs/renderer/components/shaders/Color.js.map +1 -1
  189. package/lib/commonjs/renderer/components/shaders/FractalNoise.js.map +1 -1
  190. package/lib/commonjs/renderer/components/shaders/LinearGradient.js.map +1 -1
  191. package/lib/commonjs/renderer/components/shaders/RadialGradient.js.map +1 -1
  192. package/lib/commonjs/renderer/components/shaders/Shader.js.map +1 -1
  193. package/lib/commonjs/renderer/components/shaders/ShaderLib.js.map +1 -1
  194. package/lib/commonjs/renderer/components/shaders/SweepGradient.js.map +1 -1
  195. package/lib/commonjs/renderer/components/shaders/Turbulence.js.map +1 -1
  196. package/lib/commonjs/renderer/components/shaders/TwoPointConicalGradient.js.map +1 -1
  197. package/lib/commonjs/renderer/components/shaders/index.js.map +1 -1
  198. package/lib/commonjs/renderer/components/shapes/Box.js.map +1 -1
  199. package/lib/commonjs/renderer/components/shapes/Circle.js.map +1 -1
  200. package/lib/commonjs/renderer/components/shapes/DiffRect.js.map +1 -1
  201. package/lib/commonjs/renderer/components/shapes/Fill.js.map +1 -1
  202. package/lib/commonjs/renderer/components/shapes/FitBox.js.map +1 -1
  203. package/lib/commonjs/renderer/components/shapes/Line.js.map +1 -1
  204. package/lib/commonjs/renderer/components/shapes/Oval.js.map +1 -1
  205. package/lib/commonjs/renderer/components/shapes/Patch.js.map +1 -1
  206. package/lib/commonjs/renderer/components/shapes/Path.js.map +1 -1
  207. package/lib/commonjs/renderer/components/shapes/Points.js.map +1 -1
  208. package/lib/commonjs/renderer/components/shapes/Rect.js.map +1 -1
  209. package/lib/commonjs/renderer/components/shapes/RoundedRect.js.map +1 -1
  210. package/lib/commonjs/renderer/components/shapes/Vertices.js.map +1 -1
  211. package/lib/commonjs/renderer/components/shapes/index.js.map +1 -1
  212. package/lib/commonjs/renderer/components/text/Glyphs.js.map +1 -1
  213. package/lib/commonjs/renderer/components/text/Text.js.map +1 -1
  214. package/lib/commonjs/renderer/components/text/TextBlob.js.map +1 -1
  215. package/lib/commonjs/renderer/components/text/TextPath.js.map +1 -1
  216. package/lib/commonjs/renderer/components/text/index.js.map +1 -1
  217. package/lib/commonjs/renderer/index.js.map +1 -1
  218. package/lib/commonjs/renderer/processors/Animations/Animations.js.map +1 -1
  219. package/lib/commonjs/renderer/processors/Animations/index.js.map +1 -1
  220. package/lib/commonjs/renderer/processors/index.js.map +1 -1
  221. package/lib/commonjs/renderer/processors/math/Coordinates.js.map +1 -1
  222. package/lib/commonjs/renderer/processors/math/Math.js.map +1 -1
  223. package/lib/commonjs/renderer/processors/math/Transforms.js.map +1 -1
  224. package/lib/commonjs/renderer/processors/math/index.js.map +1 -1
  225. package/lib/commonjs/renderer/typeddash.js.map +1 -1
  226. package/lib/commonjs/renderer/useCanvas.js.map +1 -1
  227. package/lib/commonjs/renderer/useContextBridge.js.map +1 -1
  228. package/lib/commonjs/skia/NativeSetup.js.map +1 -1
  229. package/lib/commonjs/skia/Skia.js.map +1 -1
  230. package/lib/commonjs/skia/Skia.web.js.map +1 -1
  231. package/lib/commonjs/skia/core/Data.js.map +1 -1
  232. package/lib/commonjs/skia/core/Font.js.map +1 -1
  233. package/lib/commonjs/skia/core/Image.js.map +1 -1
  234. package/lib/commonjs/skia/core/Matrix.js.map +1 -1
  235. package/lib/commonjs/skia/core/Picture.js.map +1 -1
  236. package/lib/commonjs/skia/core/RRect.js.map +1 -1
  237. package/lib/commonjs/skia/core/Rect.js.map +1 -1
  238. package/lib/commonjs/skia/core/SVG.js.map +1 -1
  239. package/lib/commonjs/skia/core/Typeface.js.map +1 -1
  240. package/lib/commonjs/skia/core/Vector.js +1 -1
  241. package/lib/commonjs/skia/core/Vector.js.map +1 -1
  242. package/lib/commonjs/skia/core/index.js.map +1 -1
  243. package/lib/commonjs/skia/index.js.map +1 -1
  244. package/lib/commonjs/skia/types/Canvas.js.map +1 -1
  245. package/lib/commonjs/skia/types/Color.js.map +1 -1
  246. package/lib/commonjs/skia/types/ColorFilter/ColorFilter.js.map +1 -1
  247. package/lib/commonjs/skia/types/ColorFilter/ColorFilterFactory.js.map +1 -1
  248. package/lib/commonjs/skia/types/ColorFilter/index.js.map +1 -1
  249. package/lib/commonjs/skia/types/ContourMeasure.js.map +1 -1
  250. package/lib/commonjs/skia/types/Data/Data.js.map +1 -1
  251. package/lib/commonjs/skia/types/Data/DataFactory.js.map +1 -1
  252. package/lib/commonjs/skia/types/Data/index.js.map +1 -1
  253. package/lib/commonjs/skia/types/Font/Font.js.map +1 -1
  254. package/lib/commonjs/skia/types/Font/index.js.map +1 -1
  255. package/lib/commonjs/skia/types/Image/Image.js.map +1 -1
  256. package/lib/commonjs/skia/types/Image/ImageFactory.js.map +1 -1
  257. package/lib/commonjs/skia/types/Image/index.js.map +1 -1
  258. package/lib/commonjs/skia/types/ImageFilter/ImageFilter.js.map +1 -1
  259. package/lib/commonjs/skia/types/ImageFilter/ImageFilterFactory.js.map +1 -1
  260. package/lib/commonjs/skia/types/ImageFilter/index.js.map +1 -1
  261. package/lib/commonjs/skia/types/JsiInstance.js.map +1 -1
  262. package/lib/commonjs/skia/types/MaskFilter.js.map +1 -1
  263. package/lib/commonjs/skia/types/Matrix.js.map +1 -1
  264. package/lib/commonjs/skia/types/Paint/BlendMode.js.map +1 -1
  265. package/lib/commonjs/skia/types/Paint/Paint.js.map +1 -1
  266. package/lib/commonjs/skia/types/Paint/index.js.map +1 -1
  267. package/lib/commonjs/skia/types/Path/Path.js.map +1 -1
  268. package/lib/commonjs/skia/types/Path/PathFactory.js.map +1 -1
  269. package/lib/commonjs/skia/types/Path/index.js.map +1 -1
  270. package/lib/commonjs/skia/types/PathEffect.js.map +1 -1
  271. package/lib/commonjs/skia/types/Picture/Picture.js.map +1 -1
  272. package/lib/commonjs/skia/types/Picture/PictureFactory.js.map +1 -1
  273. package/lib/commonjs/skia/types/Picture/PictureRecorder.js.map +1 -1
  274. package/lib/commonjs/skia/types/Picture/index.js.map +1 -1
  275. package/lib/commonjs/skia/types/Point.js.map +1 -1
  276. package/lib/commonjs/skia/types/RRect.js.map +1 -1
  277. package/lib/commonjs/skia/types/RSXform.js.map +1 -1
  278. package/lib/commonjs/skia/types/Rect.js.map +1 -1
  279. package/lib/commonjs/skia/types/RuntimeEffect/RuntimeEffect.js.map +1 -1
  280. package/lib/commonjs/skia/types/RuntimeEffect/RuntimeEffectFactory.js.map +1 -1
  281. package/lib/commonjs/skia/types/RuntimeEffect/index.js.map +1 -1
  282. package/lib/commonjs/skia/types/SVG/SVG.js.map +1 -1
  283. package/lib/commonjs/skia/types/SVG/SVGFactory.js.map +1 -1
  284. package/lib/commonjs/skia/types/SVG/index.js.map +1 -1
  285. package/lib/commonjs/skia/types/Shader/Shader.js.map +1 -1
  286. package/lib/commonjs/skia/types/Shader/ShaderFactory.js.map +1 -1
  287. package/lib/commonjs/skia/types/Shader/index.js.map +1 -1
  288. package/lib/commonjs/skia/types/Skia.js.map +1 -1
  289. package/lib/commonjs/skia/types/Surface/Surface.js.map +1 -1
  290. package/lib/commonjs/skia/types/Surface/SurfaceFactory.js.map +1 -1
  291. package/lib/commonjs/skia/types/Surface/index.js.map +1 -1
  292. package/lib/commonjs/skia/types/TextBlob.js.map +1 -1
  293. package/lib/commonjs/skia/types/Typeface/Typeface.js.map +1 -1
  294. package/lib/commonjs/skia/types/Typeface/TypefaceFactory.js.map +1 -1
  295. package/lib/commonjs/skia/types/Typeface/index.js.map +1 -1
  296. package/lib/commonjs/skia/types/Vertices/Vertices.js.map +1 -1
  297. package/lib/commonjs/skia/types/Vertices/index.js.map +1 -1
  298. package/lib/commonjs/skia/types/index.js.map +1 -1
  299. package/lib/commonjs/skia/web/Host.js +1 -1
  300. package/lib/commonjs/skia/web/Host.js.map +1 -1
  301. package/lib/commonjs/skia/web/JsiSkCanvas.js.map +1 -1
  302. package/lib/commonjs/skia/web/JsiSkColor.js.map +1 -1
  303. package/lib/commonjs/skia/web/JsiSkColorFilter.js.map +1 -1
  304. package/lib/commonjs/skia/web/JsiSkColorFilterFactory.js.map +1 -1
  305. package/lib/commonjs/skia/web/JsiSkContourMeasure.js.map +1 -1
  306. package/lib/commonjs/skia/web/JsiSkContourMeasureIter.js.map +1 -1
  307. package/lib/commonjs/skia/web/JsiSkData.js.map +1 -1
  308. package/lib/commonjs/skia/web/JsiSkDataFactory.js.map +1 -1
  309. package/lib/commonjs/skia/web/JsiSkFont.js.map +1 -1
  310. package/lib/commonjs/skia/web/JsiSkImage.js.map +1 -1
  311. package/lib/commonjs/skia/web/JsiSkImageFactory.js.map +1 -1
  312. package/lib/commonjs/skia/web/JsiSkImageFilter.js.map +1 -1
  313. package/lib/commonjs/skia/web/JsiSkImageFilterFactory.js.map +1 -1
  314. package/lib/commonjs/skia/web/JsiSkMaskFilter.js.map +1 -1
  315. package/lib/commonjs/skia/web/JsiSkMaskFilterFactory.js.map +1 -1
  316. package/lib/commonjs/skia/web/JsiSkMatrix.js +1 -1
  317. package/lib/commonjs/skia/web/JsiSkMatrix.js.map +1 -1
  318. package/lib/commonjs/skia/web/JsiSkPaint.js.map +1 -1
  319. package/lib/commonjs/skia/web/JsiSkPath.js.map +1 -1
  320. package/lib/commonjs/skia/web/JsiSkPathEffect.js.map +1 -1
  321. package/lib/commonjs/skia/web/JsiSkPathEffectFactory.js.map +1 -1
  322. package/lib/commonjs/skia/web/JsiSkPathFactory.js.map +1 -1
  323. package/lib/commonjs/skia/web/JsiSkPicture.js.map +1 -1
  324. package/lib/commonjs/skia/web/JsiSkPictureFactory.js.map +1 -1
  325. package/lib/commonjs/skia/web/JsiSkPictureRecorder.js.map +1 -1
  326. package/lib/commonjs/skia/web/JsiSkPoint.js.map +1 -1
  327. package/lib/commonjs/skia/web/JsiSkRRect.js.map +1 -1
  328. package/lib/commonjs/skia/web/JsiSkRSXform.js.map +1 -1
  329. package/lib/commonjs/skia/web/JsiSkRect.js.map +1 -1
  330. package/lib/commonjs/skia/web/JsiSkRuntimeEffect.js.map +1 -1
  331. package/lib/commonjs/skia/web/JsiSkRuntimeEffectFactory.js.map +1 -1
  332. package/lib/commonjs/skia/web/JsiSkSVGFactory.js.map +1 -1
  333. package/lib/commonjs/skia/web/JsiSkShader.js.map +1 -1
  334. package/lib/commonjs/skia/web/JsiSkShaderFactory.js.map +1 -1
  335. package/lib/commonjs/skia/web/JsiSkSurface.js.map +1 -1
  336. package/lib/commonjs/skia/web/JsiSkSurfaceFactory.js.map +1 -1
  337. package/lib/commonjs/skia/web/JsiSkTextBlob.js.map +1 -1
  338. package/lib/commonjs/skia/web/JsiSkTextBlobFactory.js.map +1 -1
  339. package/lib/commonjs/skia/web/JsiSkTypeface.js.map +1 -1
  340. package/lib/commonjs/skia/web/JsiSkTypefaceFactory.js.map +1 -1
  341. package/lib/commonjs/skia/web/JsiSkVertices.js.map +1 -1
  342. package/lib/commonjs/skia/web/JsiSkVerticesFactory.js.map +1 -1
  343. package/lib/commonjs/skia/web/JsiSkia.js.map +1 -1
  344. package/lib/commonjs/skia/web/index.js.map +1 -1
  345. package/lib/commonjs/values/api.js.map +1 -1
  346. package/lib/commonjs/values/api.web.js.map +1 -1
  347. package/lib/commonjs/values/hooks/index.js.map +1 -1
  348. package/lib/commonjs/values/hooks/useClockValue.js.map +1 -1
  349. package/lib/commonjs/values/hooks/useComputedValue.js.map +1 -1
  350. package/lib/commonjs/values/hooks/useValue.js.map +1 -1
  351. package/lib/commonjs/values/hooks/useValueEffect.js.map +1 -1
  352. package/lib/commonjs/values/index.js.map +1 -1
  353. package/lib/commonjs/values/selector.js.map +1 -1
  354. package/lib/commonjs/values/types.js.map +1 -1
  355. package/lib/commonjs/values/web/RNSkAnimation.js +2 -2
  356. package/lib/commonjs/values/web/RNSkAnimation.js.map +1 -1
  357. package/lib/commonjs/values/web/RNSkClockValue.js.map +1 -1
  358. package/lib/commonjs/values/web/RNSkComputedValue.js +1 -1
  359. package/lib/commonjs/values/web/RNSkComputedValue.js.map +1 -1
  360. package/lib/commonjs/values/web/RNSkReadonlyValue.js.map +1 -1
  361. package/lib/commonjs/values/web/RNSkValue.js.map +1 -1
  362. package/lib/commonjs/values/web/api.js.map +1 -1
  363. package/lib/commonjs/values/web/index.js.map +1 -1
  364. package/lib/commonjs/views/SkiaBaseWebView.js +213 -0
  365. package/lib/commonjs/views/SkiaBaseWebView.js.map +1 -0
  366. package/lib/commonjs/views/SkiaPictureView.js +112 -0
  367. package/lib/commonjs/views/SkiaPictureView.js.map +1 -0
  368. package/lib/commonjs/views/SkiaPictureView.web.js +31 -0
  369. package/lib/commonjs/views/SkiaPictureView.web.js.map +1 -0
  370. package/lib/commonjs/views/SkiaView.js +2 -2
  371. package/lib/commonjs/views/SkiaView.js.map +1 -1
  372. package/lib/commonjs/views/SkiaView.web.js +14 -203
  373. package/lib/commonjs/views/SkiaView.web.js.map +1 -1
  374. package/lib/commonjs/views/api.js.map +1 -1
  375. package/lib/commonjs/views/index.js +13 -0
  376. package/lib/commonjs/views/index.js.map +1 -1
  377. package/lib/commonjs/views/types.js.map +1 -1
  378. package/lib/commonjs/views/useDrawCallback.js.map +1 -1
  379. package/lib/commonjs/views/useTouchHandler.js +6 -6
  380. package/lib/commonjs/views/useTouchHandler.js.map +1 -1
  381. package/lib/commonjs/web/LoadSkiaWeb.js.map +1 -1
  382. package/lib/commonjs/web/WithSkiaWeb.js +1 -1
  383. package/lib/commonjs/web/WithSkiaWeb.js.map +1 -1
  384. package/lib/commonjs/web/index.js.map +1 -1
  385. package/lib/module/animation/decay/decay.js.map +1 -1
  386. package/lib/module/animation/decay/index.js.map +1 -1
  387. package/lib/module/animation/decay/runDecay.js.map +1 -1
  388. package/lib/module/animation/decay/types.js.map +1 -1
  389. package/lib/module/animation/functions/index.js.map +1 -1
  390. package/lib/module/animation/functions/interpolate.js.map +1 -1
  391. package/lib/module/animation/functions/interpolateColors.js.map +1 -1
  392. package/lib/module/animation/functions/interpolatePaths.js.map +1 -1
  393. package/lib/module/animation/functions/interpolateVector.js.map +1 -1
  394. package/lib/module/animation/index.js.map +1 -1
  395. package/lib/module/animation/spring/Spring.js.map +1 -1
  396. package/lib/module/animation/spring/functions/index.js.map +1 -1
  397. package/lib/module/animation/spring/functions/spring.js.map +1 -1
  398. package/lib/module/animation/spring/index.js.map +1 -1
  399. package/lib/module/animation/spring/runSpring.js +1 -1
  400. package/lib/module/animation/spring/runSpring.js.map +1 -1
  401. package/lib/module/animation/spring/types.js.map +1 -1
  402. package/lib/module/animation/spring/useSpring.js +1 -1
  403. package/lib/module/animation/spring/useSpring.js.map +1 -1
  404. package/lib/module/animation/timing/Easing.js.map +1 -1
  405. package/lib/module/animation/timing/createTiming.js +2 -6
  406. package/lib/module/animation/timing/createTiming.js.map +1 -1
  407. package/lib/module/animation/timing/functions/bezier.js.map +1 -1
  408. package/lib/module/animation/timing/functions/getResolvedParams.js +6 -10
  409. package/lib/module/animation/timing/functions/getResolvedParams.js.map +1 -1
  410. package/lib/module/animation/timing/functions/index.js.map +1 -1
  411. package/lib/module/animation/timing/functions/timing.js.map +1 -1
  412. package/lib/module/animation/timing/functions/types.js.map +1 -1
  413. package/lib/module/animation/timing/index.js.map +1 -1
  414. package/lib/module/animation/timing/runTiming.js.map +1 -1
  415. package/lib/module/animation/timing/useLoop.js.map +1 -1
  416. package/lib/module/animation/timing/useTiming.js +1 -3
  417. package/lib/module/animation/timing/useTiming.js.map +1 -1
  418. package/lib/module/animation/types.js.map +1 -1
  419. package/lib/module/dom/nodes/DrawingNode.js.map +1 -1
  420. package/lib/module/dom/nodes/GroupNode.js.map +1 -1
  421. package/lib/module/dom/nodes/JsiSkDOM.js +1 -1
  422. package/lib/module/dom/nodes/JsiSkDOM.js.map +1 -1
  423. package/lib/module/dom/nodes/Node.js.map +1 -1
  424. package/lib/module/dom/nodes/PaintContext.js.map +1 -1
  425. package/lib/module/dom/nodes/PaintNode.js.map +1 -1
  426. package/lib/module/dom/nodes/RenderNode.js.map +1 -1
  427. package/lib/module/dom/nodes/datatypes/Circle.js.map +1 -1
  428. package/lib/module/dom/nodes/datatypes/Color.js.map +1 -1
  429. package/lib/module/dom/nodes/datatypes/Enum.js.map +1 -1
  430. package/lib/module/dom/nodes/datatypes/Fitting.js.map +1 -1
  431. package/lib/module/dom/nodes/datatypes/Gradient.js +2 -2
  432. package/lib/module/dom/nodes/datatypes/Gradient.js.map +1 -1
  433. package/lib/module/dom/nodes/datatypes/Path.js.map +1 -1
  434. package/lib/module/dom/nodes/datatypes/Radius.js.map +1 -1
  435. package/lib/module/dom/nodes/datatypes/Rect.js.map +1 -1
  436. package/lib/module/dom/nodes/datatypes/Transform.js.map +1 -1
  437. package/lib/module/dom/nodes/datatypes/index.js.map +1 -1
  438. package/lib/module/dom/nodes/drawings/BackdropFilterNode.js.map +1 -1
  439. package/lib/module/dom/nodes/drawings/Box.js.map +1 -1
  440. package/lib/module/dom/nodes/drawings/CircleNode.js.map +1 -1
  441. package/lib/module/dom/nodes/drawings/CustomDrawingNode.js.map +1 -1
  442. package/lib/module/dom/nodes/drawings/DiffRectNode.js.map +1 -1
  443. package/lib/module/dom/nodes/drawings/FillNode.js.map +1 -1
  444. package/lib/module/dom/nodes/drawings/ImageNode.js.map +1 -1
  445. package/lib/module/dom/nodes/drawings/ImageSVG.js.map +1 -1
  446. package/lib/module/dom/nodes/drawings/LineNode.js.map +1 -1
  447. package/lib/module/dom/nodes/drawings/OvalNode.js.map +1 -1
  448. package/lib/module/dom/nodes/drawings/PatchNode.js.map +1 -1
  449. package/lib/module/dom/nodes/drawings/PathNode.js.map +1 -1
  450. package/lib/module/dom/nodes/drawings/PictureNode.js.map +1 -1
  451. package/lib/module/dom/nodes/drawings/PointsNode.js.map +1 -1
  452. package/lib/module/dom/nodes/drawings/RRectNode.js.map +1 -1
  453. package/lib/module/dom/nodes/drawings/RectNode.js.map +1 -1
  454. package/lib/module/dom/nodes/drawings/Text.js.map +1 -1
  455. package/lib/module/dom/nodes/drawings/VerticesNode.js.map +1 -1
  456. package/lib/module/dom/nodes/drawings/index.js.map +1 -1
  457. package/lib/module/dom/nodes/index.js.map +1 -1
  458. package/lib/module/dom/nodes/paint/BlendNode.js.map +1 -1
  459. package/lib/module/dom/nodes/paint/ColorFilters.js.map +1 -1
  460. package/lib/module/dom/nodes/paint/ImageFilters.js.map +1 -1
  461. package/lib/module/dom/nodes/paint/MaskFilters.js.map +1 -1
  462. package/lib/module/dom/nodes/paint/PathEffects.js.map +1 -1
  463. package/lib/module/dom/nodes/paint/Shaders.js +2 -4
  464. package/lib/module/dom/nodes/paint/Shaders.js.map +1 -1
  465. package/lib/module/dom/nodes/paint/index.js.map +1 -1
  466. package/lib/module/dom/types/ColorFilters.js.map +1 -1
  467. package/lib/module/dom/types/Common.js.map +1 -1
  468. package/lib/module/dom/types/DrawingContext.js.map +1 -1
  469. package/lib/module/dom/types/Drawings.js.map +1 -1
  470. package/lib/module/dom/types/ImageFilters.js.map +1 -1
  471. package/lib/module/dom/types/MaskFilters.js.map +1 -1
  472. package/lib/module/dom/types/Node.js.map +1 -1
  473. package/lib/module/dom/types/NodeType.js.map +1 -1
  474. package/lib/module/dom/types/PathEffects.js.map +1 -1
  475. package/lib/module/dom/types/Shaders.js.map +1 -1
  476. package/lib/module/dom/types/SkDOM.js.map +1 -1
  477. package/lib/module/dom/types/index.js.map +1 -1
  478. package/lib/module/external/index.js.map +1 -1
  479. package/lib/module/external/reanimated/index.js.map +1 -1
  480. package/lib/module/external/reanimated/useSharedValueEffect.js.map +1 -1
  481. package/lib/module/index.js.map +1 -1
  482. package/lib/module/mock/index.js +6 -10
  483. package/lib/module/mock/index.js.map +1 -1
  484. package/lib/module/renderer/Canvas.js.map +1 -1
  485. package/lib/module/renderer/Container.js.map +1 -1
  486. package/lib/module/renderer/DependencyManager.js.map +1 -1
  487. package/lib/module/renderer/DrawingContext.js.map +1 -1
  488. package/lib/module/renderer/HostComponents.js.map +1 -1
  489. package/lib/module/renderer/HostConfig.js +0 -2
  490. package/lib/module/renderer/HostConfig.js.map +1 -1
  491. package/lib/module/renderer/components/Blend.js.map +1 -1
  492. package/lib/module/renderer/components/Drawing.js.map +1 -1
  493. package/lib/module/renderer/components/Group.js.map +1 -1
  494. package/lib/module/renderer/components/Mask.js.map +1 -1
  495. package/lib/module/renderer/components/Paint.js +1 -1
  496. package/lib/module/renderer/components/Paint.js.map +1 -1
  497. package/lib/module/renderer/components/Picture.js.map +1 -1
  498. package/lib/module/renderer/components/backdrop/BackdropBlur.js +1 -1
  499. package/lib/module/renderer/components/backdrop/BackdropBlur.js.map +1 -1
  500. package/lib/module/renderer/components/backdrop/BackdropFilter.js.map +1 -1
  501. package/lib/module/renderer/components/backdrop/index.js.map +1 -1
  502. package/lib/module/renderer/components/colorFilters/BlendColor.js.map +1 -1
  503. package/lib/module/renderer/components/colorFilters/Lerp.js.map +1 -1
  504. package/lib/module/renderer/components/colorFilters/LinearToSRGBGamma.js.map +1 -1
  505. package/lib/module/renderer/components/colorFilters/LumaColorFilter.js.map +1 -1
  506. package/lib/module/renderer/components/colorFilters/Matrix.js.map +1 -1
  507. package/lib/module/renderer/components/colorFilters/SRGBToLinearGamma.js.map +1 -1
  508. package/lib/module/renderer/components/colorFilters/index.js.map +1 -1
  509. package/lib/module/renderer/components/image/Image.js.map +1 -1
  510. package/lib/module/renderer/components/image/ImageSVG.js.map +1 -1
  511. package/lib/module/renderer/components/image/ImageShader.js.map +1 -1
  512. package/lib/module/renderer/components/image/index.js.map +1 -1
  513. package/lib/module/renderer/components/imageFilters/Blur.js.map +1 -1
  514. package/lib/module/renderer/components/imageFilters/DisplacementMap.js.map +1 -1
  515. package/lib/module/renderer/components/imageFilters/Morphology.js.map +1 -1
  516. package/lib/module/renderer/components/imageFilters/Offset.js.map +1 -1
  517. package/lib/module/renderer/components/imageFilters/RuntimeShader.js.map +1 -1
  518. package/lib/module/renderer/components/imageFilters/Shadow.js.map +1 -1
  519. package/lib/module/renderer/components/imageFilters/index.js.map +1 -1
  520. package/lib/module/renderer/components/index.js.map +1 -1
  521. package/lib/module/renderer/components/maskFilters/Blur.js.map +1 -1
  522. package/lib/module/renderer/components/maskFilters/index.js.map +1 -1
  523. package/lib/module/renderer/components/pathEffects/Corner.js.map +1 -1
  524. package/lib/module/renderer/components/pathEffects/Dash.js.map +1 -1
  525. package/lib/module/renderer/components/pathEffects/Discrete.js.map +1 -1
  526. package/lib/module/renderer/components/pathEffects/Line2D.js.map +1 -1
  527. package/lib/module/renderer/components/pathEffects/Path1D.js.map +1 -1
  528. package/lib/module/renderer/components/pathEffects/Path2D.js.map +1 -1
  529. package/lib/module/renderer/components/pathEffects/Sum.js.map +1 -1
  530. package/lib/module/renderer/components/pathEffects/index.js.map +1 -1
  531. package/lib/module/renderer/components/shaders/Color.js.map +1 -1
  532. package/lib/module/renderer/components/shaders/FractalNoise.js.map +1 -1
  533. package/lib/module/renderer/components/shaders/LinearGradient.js.map +1 -1
  534. package/lib/module/renderer/components/shaders/RadialGradient.js.map +1 -1
  535. package/lib/module/renderer/components/shaders/Shader.js.map +1 -1
  536. package/lib/module/renderer/components/shaders/ShaderLib.js.map +1 -1
  537. package/lib/module/renderer/components/shaders/SweepGradient.js.map +1 -1
  538. package/lib/module/renderer/components/shaders/Turbulence.js.map +1 -1
  539. package/lib/module/renderer/components/shaders/TwoPointConicalGradient.js.map +1 -1
  540. package/lib/module/renderer/components/shaders/index.js.map +1 -1
  541. package/lib/module/renderer/components/shapes/Box.js.map +1 -1
  542. package/lib/module/renderer/components/shapes/Circle.js.map +1 -1
  543. package/lib/module/renderer/components/shapes/DiffRect.js.map +1 -1
  544. package/lib/module/renderer/components/shapes/Fill.js.map +1 -1
  545. package/lib/module/renderer/components/shapes/FitBox.js.map +1 -1
  546. package/lib/module/renderer/components/shapes/Line.js.map +1 -1
  547. package/lib/module/renderer/components/shapes/Oval.js.map +1 -1
  548. package/lib/module/renderer/components/shapes/Patch.js.map +1 -1
  549. package/lib/module/renderer/components/shapes/Path.js.map +1 -1
  550. package/lib/module/renderer/components/shapes/Points.js.map +1 -1
  551. package/lib/module/renderer/components/shapes/Rect.js.map +1 -1
  552. package/lib/module/renderer/components/shapes/RoundedRect.js.map +1 -1
  553. package/lib/module/renderer/components/shapes/Vertices.js.map +1 -1
  554. package/lib/module/renderer/components/shapes/index.js.map +1 -1
  555. package/lib/module/renderer/components/text/Glyphs.js.map +1 -1
  556. package/lib/module/renderer/components/text/Text.js.map +1 -1
  557. package/lib/module/renderer/components/text/TextBlob.js.map +1 -1
  558. package/lib/module/renderer/components/text/TextPath.js.map +1 -1
  559. package/lib/module/renderer/components/text/index.js.map +1 -1
  560. package/lib/module/renderer/index.js.map +1 -1
  561. package/lib/module/renderer/processors/Animations/Animations.js.map +1 -1
  562. package/lib/module/renderer/processors/Animations/index.js.map +1 -1
  563. package/lib/module/renderer/processors/index.js.map +1 -1
  564. package/lib/module/renderer/processors/math/Coordinates.js.map +1 -1
  565. package/lib/module/renderer/processors/math/Math.js.map +1 -1
  566. package/lib/module/renderer/processors/math/Transforms.js.map +1 -1
  567. package/lib/module/renderer/processors/math/index.js.map +1 -1
  568. package/lib/module/renderer/typeddash.js.map +1 -1
  569. package/lib/module/renderer/useCanvas.js.map +1 -1
  570. package/lib/module/renderer/useContextBridge.js.map +1 -1
  571. package/lib/module/skia/NativeSetup.js.map +1 -1
  572. package/lib/module/skia/Skia.js.map +1 -1
  573. package/lib/module/skia/Skia.web.js.map +1 -1
  574. package/lib/module/skia/core/Data.js.map +1 -1
  575. package/lib/module/skia/core/Font.js.map +1 -1
  576. package/lib/module/skia/core/Image.js.map +1 -1
  577. package/lib/module/skia/core/Matrix.js.map +1 -1
  578. package/lib/module/skia/core/Picture.js.map +1 -1
  579. package/lib/module/skia/core/RRect.js.map +1 -1
  580. package/lib/module/skia/core/Rect.js.map +1 -1
  581. package/lib/module/skia/core/SVG.js.map +1 -1
  582. package/lib/module/skia/core/Typeface.js.map +1 -1
  583. package/lib/module/skia/core/Vector.js +1 -1
  584. package/lib/module/skia/core/Vector.js.map +1 -1
  585. package/lib/module/skia/core/index.js.map +1 -1
  586. package/lib/module/skia/index.js.map +1 -1
  587. package/lib/module/skia/types/Canvas.js.map +1 -1
  588. package/lib/module/skia/types/Color.js.map +1 -1
  589. package/lib/module/skia/types/ColorFilter/ColorFilter.js.map +1 -1
  590. package/lib/module/skia/types/ColorFilter/ColorFilterFactory.js.map +1 -1
  591. package/lib/module/skia/types/ColorFilter/index.js.map +1 -1
  592. package/lib/module/skia/types/ContourMeasure.js.map +1 -1
  593. package/lib/module/skia/types/Data/Data.js.map +1 -1
  594. package/lib/module/skia/types/Data/DataFactory.js.map +1 -1
  595. package/lib/module/skia/types/Data/index.js.map +1 -1
  596. package/lib/module/skia/types/Font/Font.js.map +1 -1
  597. package/lib/module/skia/types/Font/index.js.map +1 -1
  598. package/lib/module/skia/types/Image/Image.js.map +1 -1
  599. package/lib/module/skia/types/Image/ImageFactory.js.map +1 -1
  600. package/lib/module/skia/types/Image/index.js.map +1 -1
  601. package/lib/module/skia/types/ImageFilter/ImageFilter.js.map +1 -1
  602. package/lib/module/skia/types/ImageFilter/ImageFilterFactory.js.map +1 -1
  603. package/lib/module/skia/types/ImageFilter/index.js.map +1 -1
  604. package/lib/module/skia/types/JsiInstance.js.map +1 -1
  605. package/lib/module/skia/types/MaskFilter.js.map +1 -1
  606. package/lib/module/skia/types/Matrix.js.map +1 -1
  607. package/lib/module/skia/types/Paint/BlendMode.js.map +1 -1
  608. package/lib/module/skia/types/Paint/Paint.js.map +1 -1
  609. package/lib/module/skia/types/Paint/index.js.map +1 -1
  610. package/lib/module/skia/types/Path/Path.js.map +1 -1
  611. package/lib/module/skia/types/Path/PathFactory.js.map +1 -1
  612. package/lib/module/skia/types/Path/index.js.map +1 -1
  613. package/lib/module/skia/types/PathEffect.js.map +1 -1
  614. package/lib/module/skia/types/Picture/Picture.js.map +1 -1
  615. package/lib/module/skia/types/Picture/PictureFactory.js.map +1 -1
  616. package/lib/module/skia/types/Picture/PictureRecorder.js.map +1 -1
  617. package/lib/module/skia/types/Picture/index.js.map +1 -1
  618. package/lib/module/skia/types/Point.js.map +1 -1
  619. package/lib/module/skia/types/RRect.js.map +1 -1
  620. package/lib/module/skia/types/RSXform.js.map +1 -1
  621. package/lib/module/skia/types/Rect.js.map +1 -1
  622. package/lib/module/skia/types/RuntimeEffect/RuntimeEffect.js.map +1 -1
  623. package/lib/module/skia/types/RuntimeEffect/RuntimeEffectFactory.js.map +1 -1
  624. package/lib/module/skia/types/RuntimeEffect/index.js.map +1 -1
  625. package/lib/module/skia/types/SVG/SVG.js.map +1 -1
  626. package/lib/module/skia/types/SVG/SVGFactory.js.map +1 -1
  627. package/lib/module/skia/types/SVG/index.js.map +1 -1
  628. package/lib/module/skia/types/Shader/Shader.js.map +1 -1
  629. package/lib/module/skia/types/Shader/ShaderFactory.js.map +1 -1
  630. package/lib/module/skia/types/Shader/index.js.map +1 -1
  631. package/lib/module/skia/types/Skia.js.map +1 -1
  632. package/lib/module/skia/types/Surface/Surface.js.map +1 -1
  633. package/lib/module/skia/types/Surface/SurfaceFactory.js.map +1 -1
  634. package/lib/module/skia/types/Surface/index.js.map +1 -1
  635. package/lib/module/skia/types/TextBlob.js.map +1 -1
  636. package/lib/module/skia/types/Typeface/Typeface.js.map +1 -1
  637. package/lib/module/skia/types/Typeface/TypefaceFactory.js.map +1 -1
  638. package/lib/module/skia/types/Typeface/index.js.map +1 -1
  639. package/lib/module/skia/types/Vertices/Vertices.js.map +1 -1
  640. package/lib/module/skia/types/Vertices/index.js.map +1 -1
  641. package/lib/module/skia/types/index.js.map +1 -1
  642. package/lib/module/skia/web/Host.js +1 -1
  643. package/lib/module/skia/web/Host.js.map +1 -1
  644. package/lib/module/skia/web/JsiSkCanvas.js.map +1 -1
  645. package/lib/module/skia/web/JsiSkColor.js.map +1 -1
  646. package/lib/module/skia/web/JsiSkColorFilter.js.map +1 -1
  647. package/lib/module/skia/web/JsiSkColorFilterFactory.js.map +1 -1
  648. package/lib/module/skia/web/JsiSkContourMeasure.js.map +1 -1
  649. package/lib/module/skia/web/JsiSkContourMeasureIter.js.map +1 -1
  650. package/lib/module/skia/web/JsiSkData.js.map +1 -1
  651. package/lib/module/skia/web/JsiSkDataFactory.js.map +1 -1
  652. package/lib/module/skia/web/JsiSkFont.js.map +1 -1
  653. package/lib/module/skia/web/JsiSkImage.js.map +1 -1
  654. package/lib/module/skia/web/JsiSkImageFactory.js.map +1 -1
  655. package/lib/module/skia/web/JsiSkImageFilter.js.map +1 -1
  656. package/lib/module/skia/web/JsiSkImageFilterFactory.js.map +1 -1
  657. package/lib/module/skia/web/JsiSkMaskFilter.js.map +1 -1
  658. package/lib/module/skia/web/JsiSkMaskFilterFactory.js.map +1 -1
  659. package/lib/module/skia/web/JsiSkMatrix.js +1 -1
  660. package/lib/module/skia/web/JsiSkMatrix.js.map +1 -1
  661. package/lib/module/skia/web/JsiSkPaint.js.map +1 -1
  662. package/lib/module/skia/web/JsiSkPath.js.map +1 -1
  663. package/lib/module/skia/web/JsiSkPathEffect.js.map +1 -1
  664. package/lib/module/skia/web/JsiSkPathEffectFactory.js.map +1 -1
  665. package/lib/module/skia/web/JsiSkPathFactory.js.map +1 -1
  666. package/lib/module/skia/web/JsiSkPicture.js.map +1 -1
  667. package/lib/module/skia/web/JsiSkPictureFactory.js.map +1 -1
  668. package/lib/module/skia/web/JsiSkPictureRecorder.js.map +1 -1
  669. package/lib/module/skia/web/JsiSkPoint.js.map +1 -1
  670. package/lib/module/skia/web/JsiSkRRect.js.map +1 -1
  671. package/lib/module/skia/web/JsiSkRSXform.js.map +1 -1
  672. package/lib/module/skia/web/JsiSkRect.js.map +1 -1
  673. package/lib/module/skia/web/JsiSkRuntimeEffect.js.map +1 -1
  674. package/lib/module/skia/web/JsiSkRuntimeEffectFactory.js.map +1 -1
  675. package/lib/module/skia/web/JsiSkSVGFactory.js.map +1 -1
  676. package/lib/module/skia/web/JsiSkShader.js.map +1 -1
  677. package/lib/module/skia/web/JsiSkShaderFactory.js.map +1 -1
  678. package/lib/module/skia/web/JsiSkSurface.js.map +1 -1
  679. package/lib/module/skia/web/JsiSkSurfaceFactory.js.map +1 -1
  680. package/lib/module/skia/web/JsiSkTextBlob.js.map +1 -1
  681. package/lib/module/skia/web/JsiSkTextBlobFactory.js.map +1 -1
  682. package/lib/module/skia/web/JsiSkTypeface.js.map +1 -1
  683. package/lib/module/skia/web/JsiSkTypefaceFactory.js.map +1 -1
  684. package/lib/module/skia/web/JsiSkVertices.js.map +1 -1
  685. package/lib/module/skia/web/JsiSkVerticesFactory.js.map +1 -1
  686. package/lib/module/skia/web/JsiSkia.js.map +1 -1
  687. package/lib/module/skia/web/index.js.map +1 -1
  688. package/lib/module/values/api.js.map +1 -1
  689. package/lib/module/values/api.web.js.map +1 -1
  690. package/lib/module/values/hooks/index.js.map +1 -1
  691. package/lib/module/values/hooks/useClockValue.js.map +1 -1
  692. package/lib/module/values/hooks/useComputedValue.js.map +1 -1
  693. package/lib/module/values/hooks/useValue.js.map +1 -1
  694. package/lib/module/values/hooks/useValueEffect.js.map +1 -1
  695. package/lib/module/values/index.js.map +1 -1
  696. package/lib/module/values/selector.js.map +1 -1
  697. package/lib/module/values/types.js.map +1 -1
  698. package/lib/module/values/web/RNSkAnimation.js +2 -2
  699. package/lib/module/values/web/RNSkAnimation.js.map +1 -1
  700. package/lib/module/values/web/RNSkClockValue.js.map +1 -1
  701. package/lib/module/values/web/RNSkComputedValue.js +1 -1
  702. package/lib/module/values/web/RNSkComputedValue.js.map +1 -1
  703. package/lib/module/values/web/RNSkReadonlyValue.js.map +1 -1
  704. package/lib/module/values/web/RNSkValue.js.map +1 -1
  705. package/lib/module/values/web/api.js.map +1 -1
  706. package/lib/module/values/web/index.js.map +1 -1
  707. package/lib/module/views/SkiaBaseWebView.js +198 -0
  708. package/lib/module/views/SkiaBaseWebView.js.map +1 -0
  709. package/lib/module/views/SkiaPictureView.js +94 -0
  710. package/lib/module/views/SkiaPictureView.js.map +1 -0
  711. package/lib/module/views/SkiaPictureView.web.js +19 -0
  712. package/lib/module/views/SkiaPictureView.web.js.map +1 -0
  713. package/lib/module/views/SkiaView.js +2 -2
  714. package/lib/module/views/SkiaView.js.map +1 -1
  715. package/lib/module/views/SkiaView.web.js +15 -201
  716. package/lib/module/views/SkiaView.web.js.map +1 -1
  717. package/lib/module/views/api.js.map +1 -1
  718. package/lib/module/views/index.js +1 -0
  719. package/lib/module/views/index.js.map +1 -1
  720. package/lib/module/views/types.js.map +1 -1
  721. package/lib/module/views/useDrawCallback.js.map +1 -1
  722. package/lib/module/views/useTouchHandler.js +6 -6
  723. package/lib/module/views/useTouchHandler.js.map +1 -1
  724. package/lib/module/web/LoadSkiaWeb.js.map +1 -1
  725. package/lib/module/web/WithSkiaWeb.js +1 -1
  726. package/lib/module/web/WithSkiaWeb.js.map +1 -1
  727. package/lib/module/web/index.js.map +1 -1
  728. package/lib/typescript/src/animation/decay/runDecay.d.ts +1 -1
  729. package/lib/typescript/src/animation/spring/runSpring.d.ts +1 -1
  730. package/lib/typescript/src/animation/spring/useSpring.d.ts +1 -1
  731. package/lib/typescript/src/animation/timing/createTiming.d.ts +1 -1
  732. package/lib/typescript/src/animation/timing/functions/getResolvedParams.d.ts +1 -1
  733. package/lib/typescript/src/animation/timing/runTiming.d.ts +1 -1
  734. package/lib/typescript/src/animation/timing/useLoop.d.ts +1 -1
  735. package/lib/typescript/src/animation/timing/useTiming.d.ts +1 -1
  736. package/lib/typescript/src/mock/index.d.ts +1 -1
  737. package/lib/typescript/src/renderer/Canvas.d.ts +1 -1
  738. package/lib/typescript/src/renderer/HostConfig.d.ts +1 -1
  739. package/lib/typescript/src/renderer/components/Paint.d.ts +1 -1
  740. package/lib/typescript/src/renderer/components/backdrop/BackdropFilter.d.ts +1 -1
  741. package/lib/typescript/src/renderer/processors/Animations/Animations.d.ts +4 -4
  742. package/lib/typescript/src/renderer/typeddash.d.ts +2 -2
  743. package/lib/typescript/src/skia/core/Font.d.ts +1 -1
  744. package/lib/typescript/src/skia/core/Vector.d.ts +2 -2
  745. package/lib/typescript/src/skia/types/Shader/Shader.d.ts +1 -1
  746. package/lib/typescript/src/skia/web/JsiSkVerticesFactory.d.ts +2 -2
  747. package/lib/typescript/src/views/SkiaBaseWebView.d.ts +58 -0
  748. package/lib/typescript/src/views/SkiaPictureView.d.ts +27 -0
  749. package/lib/typescript/src/views/SkiaPictureView.web.d.ts +7 -0
  750. package/lib/typescript/src/views/SkiaView.d.ts +4 -4
  751. package/lib/typescript/src/views/SkiaView.web.d.ts +6 -53
  752. package/lib/typescript/src/views/index.d.ts +1 -0
  753. package/lib/typescript/src/views/types.d.ts +7 -2
  754. package/lib/typescript/src/web/LoadSkiaWeb.d.ts +2 -2
  755. package/package.json +6 -6
  756. package/src/renderer/HostConfig.ts +3 -4
  757. package/src/renderer/components/backdrop/BackdropFilter.tsx +1 -1
  758. package/src/renderer/processors/Animations/Animations.ts +11 -4
  759. package/src/renderer/typeddash.ts +3 -2
  760. package/src/values/web/RNSkComputedValue.ts +6 -1
  761. package/src/views/SkiaBaseWebView.tsx +177 -0
  762. package/src/views/SkiaPictureView.tsx +93 -0
  763. package/src/views/SkiaPictureView.web.tsx +23 -0
  764. package/src/views/SkiaView.tsx +6 -7
  765. package/src/views/SkiaView.web.tsx +18 -167
  766. package/src/views/index.ts +1 -0
  767. package/src/views/types.ts +9 -2
  768. package/android/cpp/jni/JniSkiaDrawView.cpp +0 -113
  769. package/android/cpp/rnskia-android/RNSkDrawViewImpl.cpp +0 -73
  770. package/android/cpp/rnskia-android/RNSkDrawViewImpl.h +0 -48
  771. package/cpp/rnskia/RNSkDrawView.cpp +0 -315
  772. package/cpp/rnskia/RNSkDrawView.h +0 -226
  773. package/ios/RNSkia-iOS/RNSkDrawViewImpl.h +0 -52
  774. package/ios/RNSkia-iOS/SkiaDrawView.h +0 -23
@@ -62,8 +62,6 @@ class ImageShaderNode extends ShaderDeclaration {
62
62
  const rct = (0, _datatypes.getRect)(this.Skia, imageShaderProps);
63
63
 
64
64
  if (rct) {
65
- var _imageShaderProps$tra;
66
-
67
65
  const rects = (0, _datatypes.fitRects)(fit, {
68
66
  x: 0,
69
67
  y: 0,
@@ -71,7 +69,7 @@ class ImageShaderNode extends ShaderDeclaration {
71
69
  height: image.height()
72
70
  }, rct);
73
71
  const m3 = (0, _datatypes.rect2rect)(rects.src, rects.dst);
74
- imageShaderProps.transform = [...((_imageShaderProps$tra = imageShaderProps.transform) !== null && _imageShaderProps$tra !== void 0 ? _imageShaderProps$tra : []), ...m3];
72
+ imageShaderProps.transform = [...(imageShaderProps.transform ?? []), ...m3];
75
73
  }
76
74
 
77
75
  const lm = this.Skia.Matrix();
@@ -158,7 +156,7 @@ class LinearGradientNode extends ShaderDeclaration {
158
156
  localMatrix,
159
157
  flags
160
158
  } = (0, _datatypes.processGradientProps)(this.Skia, this.props);
161
- return this.Skia.Shader.MakeLinearGradient(start, end, colors, positions !== null && positions !== void 0 ? positions : null, mode, localMatrix, flags);
159
+ return this.Skia.Shader.MakeLinearGradient(start, end, colors, positions ?? null, mode, localMatrix, flags);
162
160
  }
163
161
 
164
162
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["Shaders.ts"],"names":["ShaderDeclaration","JsiDeclarationNode","constructor","ctx","type","props","DeclarationType","Shader","ShaderNode","NodeType","materialize","source","uniforms","transform","m3","Skia","Matrix","makeShaderWithChildren","children","filter","child","isShader","map","ImageShaderNode","ImageShader","fit","image","tx","ty","fm","mm","imageShaderProps","rct","rects","x","y","width","height","src","dst","lm","makeShaderOptions","TileMode","FilterMode","MipmapMode","ColorNode","ColorShader","color","MakeColor","TurbulenceNode","Turbulence","freqX","freqY","octaves","seed","tileWidth","tileHeight","MakeTurbulence","FractalNoiseNode","FractalNoise","MakeFractalNoise","LinearGradientNode","LinearGradient","start","end","colors","positions","mode","localMatrix","flags","MakeLinearGradient","RadialGradientNode","RadialGradient","c","r","MakeRadialGradient","SweepGradientNode","SweepGradient","MakeSweepGradient","TwoPointConicalGradientNode","TwoPointConicalGradient","startR","endR","MakeTwoPointConicalGradient"],"mappings":";;;;;;;AAAA;;AAQA;;AAYA;;AACA;;AACA;;AASO,MAAeA,iBAAf,SAA4CC,wBAA5C,CAGL;AACAC,EAAAA,WAAW,CAACC,GAAD,EAAmBC,IAAnB,EAAmCC,KAAnC,EAA6C;AACtD,UAAMF,GAAN,EAAWG,wBAAgBC,MAA3B,EAAmCH,IAAnC,EAAyCC,KAAzC;AACD;;AAHD;;;;AAMK,MAAMG,UAAN,SAAyBR,iBAAzB,CAAwD;AAC7DE,EAAAA,WAAW,CAACC,GAAD,EAAmBE,KAAnB,EAAuC;AAChD,UAAMF,GAAN,EAAWM,iBAASF,MAApB,EAA4BF,KAA5B;AACD;;AAEDK,EAAAA,WAAW,GAAG;AACZ,UAAM;AAAEC,MAAAA,MAAF;AAAUC,MAAAA,QAAV;AAAoB,SAAGC;AAAvB,QAAqC,KAAKR,KAAhD;AACA,UAAMS,EAAE,GAAG,KAAKC,IAAL,CAAUC,MAAV,EAAX;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CAAP;AAWD;;AApB0E;;;;AAuBtE,MAAMe,2BAAN,SAA0C/E,iBAA1C,CAA0F;AAC/FE,EAAAA,WAAW,CAACC,GAAD,EAAmBE,KAAnB,EAAwD;AACjE,UAAMF,GAAN,EAAWM,iBAASuE,uBAApB,EAA6C3E,KAA7C;AACD;;AAEDK,EAAAA,WAAW,GAAG;AACZ,UAAM;AAAEuE,MAAAA,MAAF;AAAUC,MAAAA,IAAV;AAAgBnB,MAAAA,KAAhB;AAAuBC,MAAAA;AAAvB,QAA+B,KAAK3D,KAA1C;AACA,UAAM;AAAE4D,MAAAA,MAAF;AAAUC,MAAAA,SAAV;AAAqBC,MAAAA,IAArB;AAA2BC,MAAAA,WAA3B;AAAwCC,MAAAA;AAAxC,QACJ,qCAAqB,KAAKtD,IAA1B,EAAgC,KAAKV,KAArC,CADF;AAEA,WAAO,KAAKU,IAAL,CAAUR,MAAV,CAAiB4E,2BAAjB,CACLpB,KADK,EAELkB,MAFK,EAGLjB,GAHK,EAILkB,IAJK,EAKLjB,MALK,EAMLC,SANK,EAOLC,IAPK,EAQLC,WARK,EASLC,KATK,CAAP;AAWD;;AApB8F","sourcesContent":["import {\n processUniforms,\n FilterMode,\n MipmapMode,\n TileMode,\n} from \"../../../skia/types\";\nimport type { SkShader } from \"../../../skia/types\";\nimport type { NodeContext } from \"../Node\";\nimport { JsiDeclarationNode } from \"../Node\";\nimport type {\n ColorProps,\n FractalNoiseProps,\n ImageShaderProps,\n LinearGradientProps,\n RadialGradientProps,\n ShaderProps,\n SweepGradientProps,\n TurbulenceProps,\n TwoPointConicalGradientProps,\n} from \"../../types\";\nimport { DeclarationType, NodeType } from \"../../types\";\nimport { processColor } from \"../datatypes/Color\";\nimport {\n enumKey,\n fitRects,\n getRect,\n processGradientProps,\n processTransformProps,\n rect2rect,\n} from \"../datatypes\";\n\nexport abstract class ShaderDeclaration<P> extends JsiDeclarationNode<\n P,\n SkShader\n> {\n constructor(ctx: NodeContext, type: NodeType, props: P) {\n super(ctx, DeclarationType.Shader, type, props);\n }\n}\n\nexport class ShaderNode extends ShaderDeclaration<ShaderProps> {\n constructor(ctx: NodeContext, props: ShaderProps) {\n super(ctx, NodeType.Shader, props);\n }\n\n materialize() {\n const { source, uniforms, ...transform } = this.props;\n const m3 = this.Skia.Matrix();\n processTransformProps(m3, transform);\n return source.makeShaderWithChildren(\n processUniforms(source, uniforms),\n this.children()\n .filter(\n (child): child is JsiDeclarationNode<unknown, SkShader> =>\n child instanceof JsiDeclarationNode && child.isShader()\n )\n .map((child) => child.materialize()),\n m3\n );\n }\n}\n\nexport class ImageShaderNode extends ShaderDeclaration<ImageShaderProps> {\n constructor(ctx: NodeContext, props: ImageShaderProps) {\n super(ctx, NodeType.ImageShader, props);\n }\n\n materialize() {\n const { fit, image, tx, ty, fm, mm, ...imageShaderProps } = this.props;\n const rct = getRect(this.Skia, imageShaderProps);\n if (rct) {\n const rects = fitRects(\n fit,\n { x: 0, y: 0, width: image.width(), height: image.height() },\n rct\n );\n const m3 = rect2rect(rects.src, rects.dst);\n imageShaderProps.transform = [\n ...(imageShaderProps.transform ?? []),\n ...m3,\n ];\n }\n const lm = this.Skia.Matrix();\n processTransformProps(lm, imageShaderProps);\n return image.makeShaderOptions(\n TileMode[enumKey(tx)],\n TileMode[enumKey(ty)],\n FilterMode[enumKey(fm)],\n MipmapMode[enumKey(mm)],\n lm\n );\n }\n}\n\nexport class ColorNode extends ShaderDeclaration<ColorProps> {\n constructor(ctx: NodeContext, props: ColorProps) {\n super(ctx, NodeType.ColorShader, props);\n }\n\n materialize() {\n const { color } = this.props;\n return this.Skia.Shader.MakeColor(processColor(this.Skia, color, 1));\n }\n}\n\nexport class TurbulenceNode extends ShaderDeclaration<TurbulenceProps> {\n constructor(ctx: NodeContext, props: TurbulenceProps) {\n super(ctx, NodeType.Turbulence, props);\n }\n\n materialize() {\n const { freqX, freqY, octaves, seed, tileWidth, tileHeight } = this.props;\n return this.Skia.Shader.MakeTurbulence(\n freqX,\n freqY,\n octaves,\n seed,\n tileWidth,\n tileHeight\n );\n }\n}\n\nexport class FractalNoiseNode extends ShaderDeclaration<FractalNoiseProps> {\n constructor(ctx: NodeContext, props: FractalNoiseProps) {\n super(ctx, NodeType.FractalNoise, props);\n }\n\n materialize() {\n const { freqX, freqY, octaves, seed, tileWidth, tileHeight } = this.props;\n return this.Skia.Shader.MakeFractalNoise(\n freqX,\n freqY,\n octaves,\n seed,\n tileWidth,\n tileHeight\n );\n }\n}\n\nexport class LinearGradientNode extends ShaderDeclaration<LinearGradientProps> {\n constructor(ctx: NodeContext, props: LinearGradientProps) {\n super(ctx, NodeType.LinearGradient, props);\n }\n\n materialize() {\n const { start, end } = this.props;\n const { colors, positions, mode, localMatrix, flags } =\n processGradientProps(this.Skia, this.props);\n return this.Skia.Shader.MakeLinearGradient(\n start,\n end,\n colors,\n positions ?? null,\n mode,\n localMatrix,\n flags\n );\n }\n}\n\nexport class RadialGradientNode extends ShaderDeclaration<RadialGradientProps> {\n constructor(ctx: NodeContext, props: RadialGradientProps) {\n super(ctx, NodeType.RadialGradient, props);\n }\n\n materialize() {\n const { c, r } = this.props;\n const { colors, positions, mode, localMatrix, flags } =\n processGradientProps(this.Skia, this.props);\n return this.Skia.Shader.MakeRadialGradient(\n c,\n r,\n colors,\n positions,\n mode,\n localMatrix,\n flags\n );\n }\n}\n\nexport class SweepGradientNode extends ShaderDeclaration<SweepGradientProps> {\n constructor(ctx: NodeContext, props: SweepGradientProps) {\n super(ctx, NodeType.SweepGradient, props);\n }\n\n materialize() {\n const { c, start, end } = this.props;\n const { colors, positions, mode, localMatrix, flags } =\n processGradientProps(this.Skia, this.props);\n return this.Skia.Shader.MakeSweepGradient(\n c.x,\n c.y,\n colors,\n positions,\n mode,\n localMatrix,\n flags,\n start,\n end\n );\n }\n}\n\nexport class TwoPointConicalGradientNode extends ShaderDeclaration<TwoPointConicalGradientProps> {\n constructor(ctx: NodeContext, props: TwoPointConicalGradientProps) {\n super(ctx, NodeType.TwoPointConicalGradient, props);\n }\n\n materialize() {\n const { startR, endR, start, end } = this.props;\n const { colors, positions, mode, localMatrix, flags } =\n processGradientProps(this.Skia, this.props);\n return this.Skia.Shader.MakeTwoPointConicalGradient(\n start,\n startR,\n end,\n endR,\n colors,\n positions,\n mode,\n localMatrix,\n flags\n );\n }\n}\n"]}
1
+ {"version":3,"names":["ShaderDeclaration","JsiDeclarationNode","constructor","ctx","type","props","DeclarationType","Shader","ShaderNode","NodeType","materialize","source","uniforms","transform","m3","Skia","Matrix","processTransformProps","makeShaderWithChildren","processUniforms","children","filter","child","isShader","map","ImageShaderNode","ImageShader","fit","image","tx","ty","fm","mm","imageShaderProps","rct","getRect","rects","fitRects","x","y","width","height","rect2rect","src","dst","lm","makeShaderOptions","TileMode","enumKey","FilterMode","MipmapMode","ColorNode","ColorShader","color","MakeColor","processColor","TurbulenceNode","Turbulence","freqX","freqY","octaves","seed","tileWidth","tileHeight","MakeTurbulence","FractalNoiseNode","FractalNoise","MakeFractalNoise","LinearGradientNode","LinearGradient","start","end","colors","positions","mode","localMatrix","flags","processGradientProps","MakeLinearGradient","RadialGradientNode","RadialGradient","c","r","MakeRadialGradient","SweepGradientNode","SweepGradient","MakeSweepGradient","TwoPointConicalGradientNode","TwoPointConicalGradient","startR","endR","MakeTwoPointConicalGradient"],"sources":["Shaders.ts"],"sourcesContent":["import {\n processUniforms,\n FilterMode,\n MipmapMode,\n TileMode,\n} from \"../../../skia/types\";\nimport type { SkShader } from \"../../../skia/types\";\nimport type { NodeContext } from \"../Node\";\nimport { JsiDeclarationNode } from \"../Node\";\nimport type {\n ColorProps,\n FractalNoiseProps,\n ImageShaderProps,\n LinearGradientProps,\n RadialGradientProps,\n ShaderProps,\n SweepGradientProps,\n TurbulenceProps,\n TwoPointConicalGradientProps,\n} from \"../../types\";\nimport { DeclarationType, NodeType } from \"../../types\";\nimport { processColor } from \"../datatypes/Color\";\nimport {\n enumKey,\n fitRects,\n getRect,\n processGradientProps,\n processTransformProps,\n rect2rect,\n} from \"../datatypes\";\n\nexport abstract class ShaderDeclaration<P> extends JsiDeclarationNode<\n P,\n SkShader\n> {\n constructor(ctx: NodeContext, type: NodeType, props: P) {\n super(ctx, DeclarationType.Shader, type, props);\n }\n}\n\nexport class ShaderNode extends ShaderDeclaration<ShaderProps> {\n constructor(ctx: NodeContext, props: ShaderProps) {\n super(ctx, NodeType.Shader, props);\n }\n\n materialize() {\n const { source, uniforms, ...transform } = this.props;\n const m3 = this.Skia.Matrix();\n processTransformProps(m3, transform);\n return source.makeShaderWithChildren(\n processUniforms(source, uniforms),\n this.children()\n .filter(\n (child): child is JsiDeclarationNode<unknown, SkShader> =>\n child instanceof JsiDeclarationNode && child.isShader()\n )\n .map((child) => child.materialize()),\n m3\n );\n }\n}\n\nexport class ImageShaderNode extends ShaderDeclaration<ImageShaderProps> {\n constructor(ctx: NodeContext, props: ImageShaderProps) {\n super(ctx, NodeType.ImageShader, props);\n }\n\n materialize() {\n const { fit, image, tx, ty, fm, mm, ...imageShaderProps } = this.props;\n const rct = getRect(this.Skia, imageShaderProps);\n if (rct) {\n const rects = fitRects(\n fit,\n { x: 0, y: 0, width: image.width(), height: image.height() },\n rct\n );\n const m3 = rect2rect(rects.src, rects.dst);\n imageShaderProps.transform = [\n ...(imageShaderProps.transform ?? []),\n ...m3,\n ];\n }\n const lm = this.Skia.Matrix();\n processTransformProps(lm, imageShaderProps);\n return image.makeShaderOptions(\n TileMode[enumKey(tx)],\n TileMode[enumKey(ty)],\n FilterMode[enumKey(fm)],\n MipmapMode[enumKey(mm)],\n lm\n );\n }\n}\n\nexport class ColorNode extends ShaderDeclaration<ColorProps> {\n constructor(ctx: NodeContext, props: ColorProps) {\n super(ctx, NodeType.ColorShader, props);\n }\n\n materialize() {\n const { color } = this.props;\n return this.Skia.Shader.MakeColor(processColor(this.Skia, color, 1));\n }\n}\n\nexport class TurbulenceNode extends ShaderDeclaration<TurbulenceProps> {\n constructor(ctx: NodeContext, props: TurbulenceProps) {\n super(ctx, NodeType.Turbulence, props);\n }\n\n materialize() {\n const { freqX, freqY, octaves, seed, tileWidth, tileHeight } = this.props;\n return this.Skia.Shader.MakeTurbulence(\n freqX,\n freqY,\n octaves,\n seed,\n tileWidth,\n tileHeight\n );\n }\n}\n\nexport class FractalNoiseNode extends ShaderDeclaration<FractalNoiseProps> {\n constructor(ctx: NodeContext, props: FractalNoiseProps) {\n super(ctx, NodeType.FractalNoise, props);\n }\n\n materialize() {\n const { freqX, freqY, octaves, seed, tileWidth, tileHeight } = this.props;\n return this.Skia.Shader.MakeFractalNoise(\n freqX,\n freqY,\n octaves,\n seed,\n tileWidth,\n tileHeight\n );\n }\n}\n\nexport class LinearGradientNode extends ShaderDeclaration<LinearGradientProps> {\n constructor(ctx: NodeContext, props: LinearGradientProps) {\n super(ctx, NodeType.LinearGradient, props);\n }\n\n materialize() {\n const { start, end } = this.props;\n const { colors, positions, mode, localMatrix, flags } =\n processGradientProps(this.Skia, this.props);\n return this.Skia.Shader.MakeLinearGradient(\n start,\n end,\n colors,\n positions ?? null,\n mode,\n localMatrix,\n flags\n );\n }\n}\n\nexport class RadialGradientNode extends ShaderDeclaration<RadialGradientProps> {\n constructor(ctx: NodeContext, props: RadialGradientProps) {\n super(ctx, NodeType.RadialGradient, props);\n }\n\n materialize() {\n const { c, r } = this.props;\n const { colors, positions, mode, localMatrix, flags } =\n processGradientProps(this.Skia, this.props);\n return this.Skia.Shader.MakeRadialGradient(\n c,\n r,\n colors,\n positions,\n mode,\n localMatrix,\n flags\n );\n }\n}\n\nexport class SweepGradientNode extends ShaderDeclaration<SweepGradientProps> {\n constructor(ctx: NodeContext, props: SweepGradientProps) {\n super(ctx, NodeType.SweepGradient, props);\n }\n\n materialize() {\n const { c, start, end } = this.props;\n const { colors, positions, mode, localMatrix, flags } =\n processGradientProps(this.Skia, this.props);\n return this.Skia.Shader.MakeSweepGradient(\n c.x,\n c.y,\n colors,\n positions,\n mode,\n localMatrix,\n flags,\n start,\n end\n );\n }\n}\n\nexport class TwoPointConicalGradientNode extends ShaderDeclaration<TwoPointConicalGradientProps> {\n constructor(ctx: NodeContext, props: TwoPointConicalGradientProps) {\n super(ctx, NodeType.TwoPointConicalGradient, props);\n }\n\n materialize() {\n const { startR, endR, start, end } = this.props;\n const { colors, positions, mode, localMatrix, flags } =\n processGradientProps(this.Skia, this.props);\n return this.Skia.Shader.MakeTwoPointConicalGradient(\n start,\n startR,\n end,\n endR,\n colors,\n positions,\n mode,\n localMatrix,\n flags\n );\n }\n}\n"],"mappings":";;;;;;;AAAA;;AAQA;;AAYA;;AACA;;AACA;;AASO,MAAeA,iBAAf,SAA4CC,wBAA5C,CAGL;EACAC,WAAW,CAACC,GAAD,EAAmBC,IAAnB,EAAmCC,KAAnC,EAA6C;IACtD,MAAMF,GAAN,EAAWG,uBAAA,CAAgBC,MAA3B,EAAmCH,IAAnC,EAAyCC,KAAzC;EACD;;AAHD;;;;AAMK,MAAMG,UAAN,SAAyBR,iBAAzB,CAAwD;EAC7DE,WAAW,CAACC,GAAD,EAAmBE,KAAnB,EAAuC;IAChD,MAAMF,GAAN,EAAWM,gBAAA,CAASF,MAApB,EAA4BF,KAA5B;EACD;;EAEDK,WAAW,GAAG;IACZ,MAAM;MAAEC,MAAF;MAAUC,QAAV;MAAoB,GAAGC;IAAvB,IAAqC,KAAKR,KAAhD;IACA,MAAMS,EAAE,GAAG,KAAKC,IAAL,CAAUC,MAAV,EAAX;IACA,IAAAC,gCAAA,EAAsBH,EAAtB,EAA0BD,SAA1B;IACA,OAAOF,MAAM,CAACO,sBAAP,CACL,IAAAC,sBAAA,EAAgBR,MAAhB,EAAwBC,QAAxB,CADK,EAEL,KAAKQ,QAAL,GACGC,MADH,CAEKC,KAAD,IACEA,KAAK,YAAYrB,wBAAjB,IAAuCqB,KAAK,CAACC,QAAN,EAH7C,EAKGC,GALH,CAKQF,KAAD,IAAWA,KAAK,CAACZ,WAAN,EALlB,CAFK,EAQLI,EARK,CAAP;EAUD;;AAnB4D;;;;AAsBxD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GLlB,GAHK,EAILmB,IAJK,EAKLlB,MALK,EAMLC,SANK,EAOLC,IAPK,EAQLC,WARK,EASLC,KATK,CAAP;EAWD;;AApB8F"}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export * from \"./Shaders\";\nexport * from \"./MaskFilters\";\nexport * from \"./ColorFilters\";\nexport * from \"./ImageFilters\";\nexport * from \"./PathEffects\";\nexport * from \"./BlendNode\";\n"]}
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./Shaders\";\nexport * from \"./MaskFilters\";\nexport * from \"./ColorFilters\";\nexport * from \"./ImageFilters\";\nexport * from \"./PathEffects\";\nexport * from \"./BlendNode\";\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"}
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
1
+ {"version":3,"names":[],"sources":["ColorFilters.ts"],"sourcesContent":["import type { BlendMode, Color } from \"../../skia/types\";\n\nimport type { ChildrenProps, SkEnum } from \"./Common\";\n\nexport interface MatrixColorFilterProps extends ChildrenProps {\n matrix: number[];\n}\n\nexport interface BlendColorFilterProps extends ChildrenProps {\n mode: SkEnum<typeof BlendMode>;\n color: Color;\n}\n\nexport interface LerpColorFilterProps extends ChildrenProps {\n t: number;\n}\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
1
+ {"version":3,"names":[],"sources":["Common.ts"],"sourcesContent":["import type { ReactNode, RefObject } from \"react\";\n\nimport type {\n BlendMode,\n Color,\n PaintStyle,\n SkMatrix,\n SkPaint,\n SkPath,\n SkRect,\n SkRRect,\n StrokeCap,\n StrokeJoin,\n Transforms2d,\n Vector,\n} from \"../../skia/types\";\n\nimport type { DeclarationNode } from \"./Node\";\n\nexport type SkEnum<T> = Uncapitalize<keyof T extends string ? keyof T : never>;\n\nexport type PathDef = string | SkPath;\n\nexport type ClipDef = SkRRect | SkRect | PathDef;\n\nexport type Fit =\n | \"cover\"\n | \"contain\"\n | \"fill\"\n | \"fitHeight\"\n | \"fitWidth\"\n | \"none\"\n | \"scaleDown\";\n\nexport type Radius = number | Vector;\n\nexport interface ChildrenProps {\n children?: ReactNode | ReactNode[];\n}\n\nexport interface RectCtor {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\nexport interface RRectCtor extends RectCtor {\n r: Radius;\n}\n\nexport type RectDef = RectCtor | { rect: SkRect };\nexport type RRectDef = RRectCtor | { rect: SkRRect };\n\nexport interface PointCircleDef {\n c: Vector;\n r: number;\n}\n\nexport interface ScalarCircleDef {\n cx: number;\n cy: number;\n r: number;\n}\n\nexport type CircleDef = PointCircleDef | ScalarCircleDef;\n\nexport interface TransformProps {\n transform?: Transforms2d;\n origin?: Vector;\n matrix?: SkMatrix;\n}\n\nexport interface PaintProps extends ChildrenProps {\n color?: Color;\n strokeWidth?: number;\n blendMode?: SkEnum<typeof BlendMode>;\n style?: SkEnum<typeof PaintStyle>;\n strokeJoin?: SkEnum<typeof StrokeJoin>;\n strokeCap?: SkEnum<typeof StrokeCap>;\n strokeMiter?: number;\n opacity?: number;\n antiAlias?: boolean;\n}\n\nexport interface GroupProps extends PaintProps, TransformProps {\n clip?: ClipDef;\n invertClip?: boolean;\n layer?: RefObject<DeclarationNode<unknown, SkPaint>> | SkPaint | boolean;\n}\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
1
+ {"version":3,"names":[],"sources":["DrawingContext.ts"],"sourcesContent":["import type { SkCanvas, SkPaint } from \"../../skia/types\";\n\nexport interface DrawingContext {\n canvas: SkCanvas;\n paint: SkPaint;\n opacity: number;\n}\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
1
+ {"version":3,"names":[],"sources":["Drawings.ts"],"sourcesContent":["import type { RefObject } from \"react\";\n\nimport type {\n FillType,\n SkImage,\n StrokeOpts,\n Vector,\n Color,\n SkPoint,\n BlendMode,\n PointMode,\n VertexMode,\n SkFont,\n SkRRect,\n SkTextBlob,\n SkPicture,\n SkSVG,\n SkPaint,\n SkRect,\n} from \"../../skia/types\";\n\nimport type {\n CircleDef,\n Fit,\n GroupProps,\n PathDef,\n RectDef,\n RRectDef,\n SkEnum,\n} from \"./Common\";\nimport type { DrawingContext } from \"./DrawingContext\";\nimport type { DeclarationNode } from \"./Node\";\n\nexport interface DrawingNodeProps extends GroupProps {\n paint?: SkPaint | RefObject<DeclarationNode<unknown, SkPaint>>;\n}\n\nexport type ImageProps = DrawingNodeProps &\n RectDef & {\n fit: Fit;\n image: SkImage;\n };\n\nexport type CircleProps = CircleDef & DrawingNodeProps;\n\nexport interface PathProps extends DrawingNodeProps {\n path: PathDef;\n start: number;\n end: number;\n stroke?: StrokeOpts;\n fillType?: SkEnum<typeof FillType>;\n}\n\nexport interface CustomDrawingNodeProps extends DrawingNodeProps {\n drawing: (ctx: DrawingContext) => void;\n}\n\nexport interface LineProps extends DrawingNodeProps {\n p1: Vector;\n p2: Vector;\n}\n\nexport type OvalProps = RectDef & DrawingNodeProps;\n\nexport type RectProps = RectDef & DrawingNodeProps;\n\nexport type RoundedRectProps = RRectDef & DrawingNodeProps;\n\nexport interface CubicBezierHandle {\n pos: Vector;\n c1: Vector;\n c2: Vector;\n}\n\nexport interface PatchProps extends DrawingNodeProps {\n colors?: Color[];\n patch: [\n CubicBezierHandle,\n CubicBezierHandle,\n CubicBezierHandle,\n CubicBezierHandle\n ];\n texture?: readonly [SkPoint, SkPoint, SkPoint, SkPoint];\n blendMode?: SkEnum<typeof BlendMode>;\n}\n\nexport interface VerticesProps extends DrawingNodeProps {\n colors?: string[];\n vertices: SkPoint[];\n textures?: SkPoint[];\n mode: SkEnum<typeof VertexMode>;\n blendMode?: SkEnum<typeof BlendMode>;\n indices?: number[];\n}\n\nexport type ImageSVGProps = RectDef & {\n svg: SkSVG;\n} & DrawingNodeProps;\n\nexport interface PictureProps extends DrawingNodeProps {\n picture: SkPicture;\n}\n\nexport interface PointsProps extends DrawingNodeProps {\n points: SkPoint[];\n mode: SkEnum<typeof PointMode>;\n}\n\nexport interface DiffRectProps extends DrawingNodeProps {\n inner: SkRRect;\n outer: SkRRect;\n}\n\nexport interface TextProps extends DrawingNodeProps {\n font: SkFont;\n text: string;\n x: number;\n y: number;\n}\n\nexport interface TextPathProps extends DrawingNodeProps {\n font: SkFont;\n text: string;\n path: PathDef;\n initialOffset: number;\n}\n\nexport interface TextBlobProps extends DrawingNodeProps {\n blob: SkTextBlob;\n x: number;\n y: number;\n}\n\nexport interface Glyph {\n id: number;\n pos: SkPoint;\n}\n\nexport interface GlyphsProps extends DrawingNodeProps {\n font: SkFont;\n x: number;\n y: number;\n glyphs: Glyph[];\n}\n\nexport interface BoxProps extends DrawingNodeProps {\n box: SkRRect | SkRect;\n}\n\nexport interface BoxShadowProps {\n dx?: number;\n dy?: number;\n spread?: number;\n blur: number;\n color?: Color;\n inner?: boolean;\n}\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
1
+ {"version":3,"names":[],"sources":["ImageFilters.ts"],"sourcesContent":["import type {\n BlendMode,\n Color,\n ColorChannel,\n SkRuntimeEffect,\n TileMode,\n Uniforms,\n} from \"../../skia/types\";\n\nimport type { Radius, SkEnum, ChildrenProps } from \"./Common\";\n\nexport interface BlurImageFilterProps extends ChildrenProps {\n blur: Radius;\n mode: SkEnum<typeof TileMode>;\n}\n\nexport interface OffsetImageFilterProps extends ChildrenProps {\n x: number;\n y: number;\n}\n\nexport interface RuntimeShaderImageFilterProps extends ChildrenProps {\n source: SkRuntimeEffect;\n uniforms?: Uniforms;\n}\n\nexport interface BlendImageFilterProps extends ChildrenProps {\n mode: BlendMode;\n}\n\nexport interface MorphologyImageFilterProps extends ChildrenProps {\n operator: \"erode\" | \"dilate\";\n radius: Radius;\n}\n\nexport interface DropShadowImageFilterProps extends ChildrenProps {\n dx: number;\n dy: number;\n blur: number;\n color: Color;\n inner?: boolean;\n shadowOnly?: boolean;\n}\n\nexport interface DisplacementMapImageFilterProps extends ChildrenProps {\n channelX: SkEnum<typeof ColorChannel>;\n channelY: SkEnum<typeof ColorChannel>;\n scale: number;\n}\n\nexport interface BlendProps extends ChildrenProps {\n mode: SkEnum<typeof BlendMode>;\n}\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
1
+ {"version":3,"names":[],"sources":["MaskFilters.ts"],"sourcesContent":["import type { BlurStyle } from \"../../skia/types\";\n\nimport type { SkEnum } from \"./Common\";\n\nexport interface BlurMaskFilterProps {\n style: SkEnum<typeof BlurStyle>;\n blur: number;\n respectCTM: boolean;\n}\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
1
+ {"version":3,"names":[],"sources":["Node.ts"],"sourcesContent":["import type {\n SkColorFilter,\n SkImageFilter,\n SkMaskFilter,\n SkPaint,\n SkPathEffect,\n SkShader,\n} from \"../../skia/types\";\n\nimport type { GroupProps } from \"./Common\";\nimport type { DrawingContext } from \"./DrawingContext\";\nimport type { DeclarationType, NodeType } from \"./NodeType\";\n\nexport interface Node<P> {\n type: NodeType;\n\n setProps(props: P): void;\n setProp<K extends keyof P>(name: K, v: P[K]): boolean;\n getProps(): P;\n\n children(): Node<unknown>[];\n addChild(child: Node<unknown>): void;\n removeChild(child: Node<unknown>): void;\n insertChildBefore(child: Node<unknown>, before: Node<unknown>): void;\n}\n\nexport type Invalidate = () => void;\n\nexport interface DeclarationNode<P, T, Nullable extends null | never = never>\n extends Node<P> {\n declarationType: DeclarationType;\n materialize(): T | Nullable;\n\n setInvalidate(invalidate: Invalidate): void;\n\n isPaint(): this is DeclarationNode<unknown, SkPaint>;\n isImageFilter(): this is DeclarationNode<unknown, SkImageFilter>;\n isColorFilter(): this is DeclarationNode<unknown, SkColorFilter>;\n isShader(): this is DeclarationNode<unknown, SkShader>;\n isMaskFilter(): this is DeclarationNode<unknown, SkMaskFilter>;\n isPathEffect(): this is DeclarationNode<unknown, SkPathEffect>;\n}\n\nexport interface RenderNode<P extends GroupProps> extends Node<P> {\n render(ctx: DrawingContext): void;\n}\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"sources":["NodeType.ts"],"names":["NodeType","DeclarationType"],"mappings":";;;;;;IAAkBA,Q;;;WAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAA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Noise\",\n LinearGradient = \"skLinearGradient\",\n RadialGradient = \"skRadialGradient\",\n SweepGradient = \"skSweepGradient\",\n TwoPointConicalGradient = \"skTwoPointConicalGradient\",\n\n // Mask Filters\n BlurMaskFilter = \"skBlurMaskFilter\",\n\n // Path Effects\n DiscretePathEffect = \"skDiscretePathEffect\",\n DashPathEffect = \"skDashPathEffect\",\n Path1DPathEffect = \"skPath1DPathEffect\",\n Path2DPathEffect = \"skPath2DPathEffect\",\n CornerPathEffect = \"skCornerPathEffect\",\n SumPathEffect = \"skSumPathEffect\",\n Line2DPathEffect = \"skLine2DPathEffect\",\n\n // Color Filters\n MatrixColorFilter = \"skMatrixColorFilter\",\n BlendColorFilter = \"skBlendColorFilter\",\n LinearToSRGBGammaColorFilter = \"skLinearToSRGBGammaColorFilter\",\n SRGBToLinearGammaColorFilter = \"skSRGBToLinearGammaColorFilter\",\n LumaColorFilter = \"skLumaColorFilter\",\n LerpColorFilter = \"skLerpColorFilter\",\n\n // Image Filters\n OffsetImageFilter = \"skOffsetImageFilter\",\n DisplacementMapImageFilter = \"skDisplacementMapImageFilter\",\n BlurImageFilter = \"skBlurImageFilter\",\n DropShadowImageFilter = \"skDropShadowImageFilter\",\n MorphologyImageFilter = \"skMorphologyImageFilter\",\n BlendImageFilter = \"skBlendImageFilter\",\n RuntimeShaderImageFilter = \"skRuntimeShaderImageFilter\",\n\n // Mixed\n Blend = \"skBlend\",\n BackdropFilter = \"skBackdropFilter\",\n Box = \"skBox\",\n BoxShadow = \"skBoxShadow\",\n\n // Drawings\n Group = \"skGroup\",\n Drawing = \"skDrawing\",\n Paint = \"skPaint\",\n Circle = \"skCircle\",\n Fill = \"skFill\",\n Image = \"skImage\",\n Points = \"skPoints\",\n Path = \"skPath\",\n Rect = \"skRect\",\n RRect = \"skRRect\",\n Oval = \"skOval\",\n Line = \"skLine\",\n Patch = \"skPatch\",\n Vertices = \"skVertices\",\n DiffRect = \"skDiffRect\",\n Text = \"skText\",\n TextPath = \"skTextPath\",\n TextBlob = \"skTextBlob\",\n Glyphs = \"skGlyphs\",\n Picture = \"skPicture\",\n ImageSVG = \"skImageSVG\",\n}\n\nexport const enum DeclarationType {\n Paint,\n Shader,\n ImageFilter,\n ColorFilter,\n PathEffect,\n MaskFilter,\n Unknown,\n}\n"]}
1
+ {"version":3,"names":["NodeType","DeclarationType"],"sources":["NodeType.ts"],"sourcesContent":["export const enum NodeType {\n // Shaders\n Shader = \"skShader\",\n ImageShader = \"skImageShader\",\n ColorShader = \"skColorShader\",\n Turbulence = \"skTurbulence\",\n FractalNoise = \"skFractalNoise\",\n LinearGradient = \"skLinearGradient\",\n RadialGradient = \"skRadialGradient\",\n SweepGradient = \"skSweepGradient\",\n TwoPointConicalGradient = \"skTwoPointConicalGradient\",\n\n // Mask Filters\n BlurMaskFilter = \"skBlurMaskFilter\",\n\n // Path Effects\n DiscretePathEffect = \"skDiscretePathEffect\",\n DashPathEffect = \"skDashPathEffect\",\n Path1DPathEffect = \"skPath1DPathEffect\",\n Path2DPathEffect = \"skPath2DPathEffect\",\n CornerPathEffect = \"skCornerPathEffect\",\n SumPathEffect = \"skSumPathEffect\",\n Line2DPathEffect = \"skLine2DPathEffect\",\n\n // Color Filters\n MatrixColorFilter = \"skMatrixColorFilter\",\n BlendColorFilter = \"skBlendColorFilter\",\n LinearToSRGBGammaColorFilter = \"skLinearToSRGBGammaColorFilter\",\n SRGBToLinearGammaColorFilter = \"skSRGBToLinearGammaColorFilter\",\n LumaColorFilter = \"skLumaColorFilter\",\n LerpColorFilter = \"skLerpColorFilter\",\n\n // Image Filters\n OffsetImageFilter = \"skOffsetImageFilter\",\n DisplacementMapImageFilter = \"skDisplacementMapImageFilter\",\n BlurImageFilter = \"skBlurImageFilter\",\n DropShadowImageFilter = \"skDropShadowImageFilter\",\n MorphologyImageFilter = \"skMorphologyImageFilter\",\n BlendImageFilter = \"skBlendImageFilter\",\n RuntimeShaderImageFilter = \"skRuntimeShaderImageFilter\",\n\n // Mixed\n Blend = \"skBlend\",\n BackdropFilter = \"skBackdropFilter\",\n Box = \"skBox\",\n BoxShadow = \"skBoxShadow\",\n\n // Drawings\n Group = \"skGroup\",\n Drawing = \"skDrawing\",\n Paint = \"skPaint\",\n Circle = \"skCircle\",\n Fill = \"skFill\",\n Image = \"skImage\",\n Points = \"skPoints\",\n Path = \"skPath\",\n Rect = \"skRect\",\n RRect = \"skRRect\",\n Oval = \"skOval\",\n Line = \"skLine\",\n Patch = \"skPatch\",\n Vertices = \"skVertices\",\n DiffRect = \"skDiffRect\",\n Text = \"skText\",\n TextPath = \"skTextPath\",\n TextBlob = \"skTextBlob\",\n Glyphs = \"skGlyphs\",\n Picture = \"skPicture\",\n ImageSVG = \"skImageSVG\",\n}\n\nexport const enum DeclarationType {\n Paint,\n Shader,\n ImageFilter,\n ColorFilter,\n PathEffect,\n MaskFilter,\n Unknown,\n}\n"],"mappings":";;;;;;IAAkBA,Q;;;WAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;GAAAA,Q,wBAAAA,Q;;IAuEAC,e;;;WAAAA,e;EAAAA,e,CAAAA,e;EAAAA,e,CAAAA,e;EAAAA,e,CAAAA,e;EAAAA,e,CAAAA,e;EAAAA,e,CAAAA,e;EAAAA,e,CAAAA,e;EAAAA,e,CAAAA,e;GAAAA,e,+BAAAA,e"}
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
1
+ {"version":3,"names":[],"sources":["PathEffects.ts"],"sourcesContent":["import type { Path1DEffectStyle, SkMatrix } from \"../../skia/types\";\n\nimport type { ChildrenProps, PathDef, SkEnum } from \"./Common\";\n\nexport interface CornerPathEffectProps extends ChildrenProps {\n r: number;\n}\n\nexport interface DiscretePathEffectProps extends ChildrenProps {\n length: number;\n deviation: number;\n seed: number;\n}\n\nexport interface DashPathEffectProps extends ChildrenProps {\n intervals: number[];\n phase?: number;\n}\n\nexport interface Path1DPathEffectProps extends ChildrenProps {\n path: PathDef;\n advance: number;\n phase: number;\n style: SkEnum<typeof Path1DEffectStyle>;\n}\n\nexport interface Path2DPathEffectProps extends ChildrenProps {\n matrix: SkMatrix;\n path: PathDef;\n}\n\nexport interface Line2DPathEffectProps extends ChildrenProps {\n width: number;\n matrix: SkMatrix;\n}\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
1
+ {"version":3,"names":[],"sources":["Shaders.ts"],"sourcesContent":["import type {\n Color,\n FilterMode,\n MipmapMode,\n SkImage,\n SkRect,\n SkRuntimeEffect,\n TileMode,\n Uniforms,\n Vector,\n} from \"../../skia/types\";\n\nimport type {\n SkEnum,\n TransformProps,\n ChildrenProps,\n RectCtor,\n Fit,\n} from \"./Common\";\n\nexport interface ShaderProps extends TransformProps, ChildrenProps {\n source: SkRuntimeEffect;\n uniforms: Uniforms;\n}\n\nexport interface ImageShaderProps extends TransformProps, Partial<RectCtor> {\n tx: SkEnum<typeof TileMode>;\n ty: SkEnum<typeof TileMode>;\n fm: SkEnum<typeof FilterMode>;\n mm: SkEnum<typeof MipmapMode>;\n fit: Fit;\n rect?: SkRect;\n image: SkImage;\n}\n\nexport interface ColorProps {\n color: Color;\n}\n\nexport interface TurbulenceProps {\n freqX: number;\n freqY: number;\n octaves: number;\n seed: number;\n tileWidth: number;\n tileHeight: number;\n}\n\nexport interface FractalNoiseProps {\n freqX: number;\n freqY: number;\n octaves: number;\n seed: number;\n tileWidth: number;\n tileHeight: number;\n}\n\nexport interface GradientProps extends TransformProps {\n colors: Color[];\n positions?: number[];\n mode?: SkEnum<typeof TileMode>;\n flags?: number;\n}\n\nexport interface LinearGradientProps extends GradientProps {\n start: Vector;\n end: Vector;\n}\n\nexport interface RadialGradientProps extends GradientProps {\n c: Vector;\n r: number;\n}\n\nexport interface SweepGradientProps extends GradientProps {\n c: Vector;\n start?: number;\n end?: number;\n}\n\nexport interface TwoPointConicalGradientProps extends GradientProps {\n start: Vector;\n startR: number;\n end: Vector;\n endR: number;\n}\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
1
+ {"version":3,"names":[],"sources":["SkDOM.ts"],"sourcesContent":["import type {\n SkImageFilter,\n SkMaskFilter,\n SkShader,\n SkColorFilter,\n SkPathEffect,\n SkPaint,\n} from \"../../skia/types\";\n\nimport type { ChildrenProps, GroupProps, PaintProps } from \"./Common\";\nimport type {\n BlendImageFilterProps,\n BlurImageFilterProps,\n DropShadowImageFilterProps,\n OffsetImageFilterProps,\n RuntimeShaderImageFilterProps,\n DisplacementMapImageFilterProps,\n MorphologyImageFilterProps,\n BlendProps,\n} from \"./ImageFilters\";\nimport type { DeclarationNode, RenderNode } from \"./Node\";\nimport type {\n BlendColorFilterProps,\n MatrixColorFilterProps,\n LerpColorFilterProps,\n} from \"./ColorFilters\";\nimport type {\n ImageProps,\n CircleProps,\n PathProps,\n CustomDrawingNodeProps,\n LineProps,\n OvalProps,\n PatchProps,\n PointsProps,\n RectProps,\n RoundedRectProps,\n VerticesProps,\n TextProps,\n DiffRectProps,\n TextPathProps,\n TextBlobProps,\n GlyphsProps,\n PictureProps,\n ImageSVGProps,\n DrawingNodeProps,\n BoxProps,\n BoxShadowProps,\n} from \"./Drawings\";\nimport type { BlurMaskFilterProps } from \"./MaskFilters\";\nimport type {\n FractalNoiseProps,\n SweepGradientProps,\n ImageShaderProps,\n LinearGradientProps,\n ShaderProps,\n TurbulenceProps,\n TwoPointConicalGradientProps,\n RadialGradientProps,\n ColorProps,\n} from \"./Shaders\";\nimport type {\n CornerPathEffectProps,\n DashPathEffectProps,\n DiscretePathEffectProps,\n Line2DPathEffectProps,\n Path1DPathEffectProps,\n Path2DPathEffectProps,\n} from \"./PathEffects\";\n\ntype ImageFilterNode<P> = DeclarationNode<P, SkImageFilter>;\n\ntype PathEffectNode<P> = DeclarationNode<P, SkPathEffect>;\ntype NullablePathEffectNode<P> = DeclarationNode<P, SkPathEffect, null>;\n\ntype DrawingNode<P extends GroupProps> = RenderNode<P>;\n\nexport interface SkDOM {\n Group(props?: GroupProps): RenderNode<GroupProps>;\n Paint(props: PaintProps): DeclarationNode<PaintProps, SkPaint>;\n\n // Drawings\n Fill(props?: DrawingNodeProps): DrawingNode<DrawingNodeProps>;\n Image(props: ImageProps): DrawingNode<ImageProps>;\n Circle(props: CircleProps): DrawingNode<CircleProps>;\n Path(props: PathProps): DrawingNode<PathProps>;\n CustomDrawing(\n props: CustomDrawingNodeProps\n ): DrawingNode<CustomDrawingNodeProps>;\n Line(props: LineProps): DrawingNode<LineProps>;\n Oval(props: OvalProps): DrawingNode<OvalProps>;\n Patch(props: PatchProps): DrawingNode<PatchProps>;\n Points(props: PointsProps): DrawingNode<PointsProps>;\n Rect(props: RectProps): DrawingNode<RectProps>;\n RRect(props: RoundedRectProps): DrawingNode<RoundedRectProps>;\n Vertices(props: VerticesProps): DrawingNode<VerticesProps>;\n Text(props: TextProps): DrawingNode<TextProps>;\n TextPath(props: TextPathProps): DrawingNode<TextPathProps>;\n TextBlob(props: TextBlobProps): DrawingNode<TextBlobProps>;\n Glyphs(props: GlyphsProps): DrawingNode<GlyphsProps>;\n DiffRect(props: DiffRectProps): DrawingNode<DiffRectProps>;\n Picture(props: PictureProps): DrawingNode<PictureProps>;\n ImageSVG(props: ImageSVGProps): DrawingNode<ImageSVGProps>;\n\n // BlurMaskFilters\n BlurMaskFilter(\n props: BlurMaskFilterProps\n ): DeclarationNode<BlurMaskFilterProps, SkMaskFilter>;\n\n // ImageFilters\n BlendImageFilter(\n props: BlendImageFilterProps\n ): ImageFilterNode<BlendImageFilterProps>;\n BlurImageFilter(\n props: BlurImageFilterProps\n ): ImageFilterNode<BlurImageFilterProps>;\n OffsetImageFilter(\n props: OffsetImageFilterProps\n ): ImageFilterNode<OffsetImageFilterProps>;\n DropShadowImageFilter(\n props: DropShadowImageFilterProps\n ): ImageFilterNode<DropShadowImageFilterProps>;\n MorphologyImageFilter(\n props: MorphologyImageFilterProps\n ): ImageFilterNode<MorphologyImageFilterProps>;\n DisplacementMapImageFilter(\n props: DisplacementMapImageFilterProps\n ): ImageFilterNode<DisplacementMapImageFilterProps>;\n RuntimeShaderImageFilter(\n props: RuntimeShaderImageFilterProps\n ): ImageFilterNode<RuntimeShaderImageFilterProps>;\n\n // ColorFilters\n MatrixColorFilter(\n props: MatrixColorFilterProps\n ): DeclarationNode<MatrixColorFilterProps, SkColorFilter>;\n BlendColorFilter(\n props: BlendColorFilterProps\n ): DeclarationNode<BlendColorFilterProps, SkColorFilter>;\n LumaColorFilter(): DeclarationNode<null, SkColorFilter>;\n LinearToSRGBGammaColorFilter(): DeclarationNode<null, SkColorFilter>;\n SRGBToLinearGammaColorFilter(): DeclarationNode<null, SkColorFilter>;\n LerpColorFilter(\n props: LerpColorFilterProps\n ): DeclarationNode<LerpColorFilterProps, SkColorFilter>;\n\n // Shaders\n Shader(props: ShaderProps): DeclarationNode<ShaderProps, SkShader>;\n ImageShader(\n props: ImageShaderProps\n ): DeclarationNode<ImageShaderProps, SkShader>;\n ColorShader(props: ColorProps): DeclarationNode<ColorProps, SkShader>;\n Turbulence(\n props: TurbulenceProps\n ): DeclarationNode<TurbulenceProps, SkShader>;\n FractalNoise(\n props: FractalNoiseProps\n ): DeclarationNode<FractalNoiseProps, SkShader>;\n LinearGradient(\n props: LinearGradientProps\n ): DeclarationNode<LinearGradientProps, SkShader>;\n RadialGradient(\n props: RadialGradientProps\n ): DeclarationNode<RadialGradientProps, SkShader>;\n SweepGradient(\n props: SweepGradientProps\n ): DeclarationNode<SweepGradientProps, SkShader>;\n TwoPointConicalGradient(\n props: TwoPointConicalGradientProps\n ): DeclarationNode<TwoPointConicalGradientProps, SkShader>;\n\n // Path Effects\n CornerPathEffect(\n props: CornerPathEffectProps\n ): NullablePathEffectNode<CornerPathEffectProps>;\n DiscretePathEffect(\n props: DiscretePathEffectProps\n ): PathEffectNode<DiscretePathEffectProps>;\n DashPathEffect(\n props: DashPathEffectProps\n ): PathEffectNode<DashPathEffectProps>;\n Path1DPathEffect(\n props: Path1DPathEffectProps\n ): NullablePathEffectNode<Path1DPathEffectProps>;\n Path2DPathEffect(\n props: Path2DPathEffectProps\n ): NullablePathEffectNode<Path2DPathEffectProps>;\n SumPathEffect(): NullablePathEffectNode<null>;\n Line2DPathEffect(\n props: Line2DPathEffectProps\n ): NullablePathEffectNode<Line2DPathEffectProps>;\n\n // Mixed\n Blend(\n props: BlendProps\n ): DeclarationNode<BlendProps, SkShader | SkImageFilter>;\n BackdropFilter(props: ChildrenProps): RenderNode<ChildrenProps>;\n Box(props: BoxProps): RenderNode<BoxProps>;\n BoxShadow(\n props: BoxShadowProps\n ): DeclarationNode<BoxShadowProps, BoxShadowProps>;\n}\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export * from \"./DrawingContext\";\nexport * from \"./Node\";\nexport * from \"./NodeType\";\nexport * from \"./SkDOM\";\nexport * from \"./Common\";\nexport * from \"./Drawings\";\nexport * from \"./ImageFilters\";\nexport * from \"./ColorFilters\";\nexport * from \"./MaskFilters\";\nexport * from \"./PathEffects\";\nexport * from \"./Shaders\";\n"]}
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./DrawingContext\";\nexport * from \"./Node\";\nexport * from \"./NodeType\";\nexport * from \"./SkDOM\";\nexport * from \"./Common\";\nexport * from \"./Drawings\";\nexport * from \"./ImageFilters\";\nexport * from \"./ColorFilters\";\nexport * from \"./MaskFilters\";\nexport * from \"./PathEffects\";\nexport * from \"./Shaders\";\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"}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export * from \"./reanimated\";\n"]}
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./reanimated\";\n"],"mappings":";;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export * from \"./useSharedValueEffect\";\n"]}
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./useSharedValueEffect\";\n"],"mappings":";;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["useSharedValueEffect.ts"],"names":["Reanimated","Core","require","e","useSharedValueWrapper","useSharedValue","undefined","value","useSharedValueEffect","cb","values","input","runOnJS","startMapper","stopMapper","console","warn","mapperId"],"mappings":";;;;;;;AAGA;;;;AAEA;AACA,IAAIA,UAAJ;AACA,IAAIC,IAAJ;;AAGA,IAAI;AACFD,EAAAA,UAAU,GAAGE,OAAO,CAAC,yBAAD,CAApB;AACAD,EAAAA,IAAI,GAAGC,OAAO,CAAC,8CAAD,CAAd;AACD,CAHD,CAGE,OAAOC,CAAP,EAAU,CACV;AACD;;AAMD,MAAMC,qBAAqB,GACzB,gBAAAJ,UAAU,UAAV,kDAAYK,cAAZ,MAA+BC,SAA/B,GACKC,KAAD,IAAmB,oBAAQ,OAAO;AAAEA,EAAAA;AAAF,CAAP,CAAR,EAA2B,CAACA,KAAD,CAA3B,CADvB,GAEIP,UAAU,CAACK,cAHjB;AAKA;AACA;AACA;AACA;AACA;AACA;;AACO,MAAMG,oBAAoB,GAAG,UAClCC,EADkC,EAElCF,KAFkC,EAI/B;AAAA,oCADAG,MACA;AADAA,IAAAA,MACA;AAAA;;AACH,QAAMC,KAAK,GAAGP,qBAAqB,CAAC,CAAD,CAAnC;AACA,QAAM;AAAEQ,IAAAA,OAAF;AAAWC,IAAAA,WAAX;AAAwBC,IAAAA;AAAxB,MAAuC,oBAAQ,MAAM;AACzD,QAAId,UAAU,IAAIC,IAAlB,EAAwB;AACtB,YAAM;AAAEW,QAAAA;AAAF,UAAcZ,UAApB;AACA,YAAM;AAAEa,QAAAA,WAAF;AAAeC,QAAAA;AAAf,UAA8Bb,IAApC;AACA,aAAO;AAAEW,QAAAA,OAAF;AAAWC,QAAAA,WAAX;AAAwBC,QAAAA;AAAxB,OAAP;AACD,KAJD,MAIO;AACLC,MAAAA,OAAO,CAACC,IAAR,CACE,iFADF;AAGA,aAAO;AACLJ,QAAAA,OAAO,EAAEN,SADJ;AAELO,QAAAA,WAAW,EAAEP,SAFR;AAGLQ,QAAAA,UAAU,EAAER;AAHP,OAAP;AAKD;AACF,GAf4C,EAe1C,EAf0C,CAA7C;AAiBA,wBAAU,MAAM;AACd,QACEO,WAAW,KAAKP,SAAhB,IACAM,OAAO,KAAKN,SADZ,IAEAQ,UAAU,KAAKR,SAHjB,EAIE;AACA;AACA,YAAMW,QAAQ,GAAGJ,WAAW,CAC1B,MAAM;AACJ;;AACAD,QAAAA,OAAO,CAACH,EAAD,CAAP;AACD,OAJyB,EAK1B,CAACF,KAAD,EAAQ,GAAGG,MAAX,CAL0B,EAM1B,CAACC,KAAD,CAN0B,CAA5B,CAFA,CAUA;;AACA,aAAO,MAAM;AACX,YAAIG,UAAU,IAAIG,QAAQ,KAAKX,SAA/B,EAA0C;AACxCQ,UAAAA,UAAU,CAACG,QAAD,CAAV;AACD;AACF,OAJD;AAKD;;AACD,WAAO,MAAM,CAAE,CAAf,CAtBc,CAuBd;AACD,GAxBD,EAwBG,CAACN,KAAD,EAAQC,OAAR,EAAiBC,WAAjB,EAA8BC,UAA9B,EAA0CP,KAA1C,EAAiD,GAAGG,MAApD,CAxBH;AAyBD,CAhDM","sourcesContent":["/* eslint-disable @typescript-eslint/no-shadow */\n/* eslint-disable @typescript-eslint/consistent-type-imports */\n/* eslint-disable @typescript-eslint/ban-ts-comment */\nimport { useEffect, useMemo } from \"react\";\n\n// @ts-ignore\nlet Reanimated: typeof import(\"react-native-reanimated\") | undefined;\nlet Core: // @ts-ignore\ntypeof import(\"react-native-reanimated/lib/reanimated2/core\") | undefined;\n\ntry {\n Reanimated = require(\"react-native-reanimated\");\n Core = require(\"react-native-reanimated/lib/reanimated2/core\");\n} catch (e) {\n // Ignore\n}\n\ntype SharedValueTypeWrapper<T = number> = {\n value: T;\n};\n\nconst useSharedValueWrapper =\n Reanimated?.useSharedValue === undefined\n ? (value: number) => useMemo(() => ({ value }), [value])\n : Reanimated.useSharedValue;\n\n/**\n * Connects a shared value from reanimated to a SkiaView or Canvas\n * so whenever the shared value changes the SkiaView will redraw.\n * @param cb Callback that will be called whenever the shared value changes.\n * @param values One or more shared values to listen for.\n */\nexport const useSharedValueEffect = <T = number>(\n cb: () => void,\n value: SharedValueTypeWrapper<T>,\n ...values: SharedValueTypeWrapper<T>[]\n) => {\n const input = useSharedValueWrapper(0);\n const { runOnJS, startMapper, stopMapper } = useMemo(() => {\n if (Reanimated && Core) {\n const { runOnJS } = Reanimated;\n const { startMapper, stopMapper } = Core;\n return { runOnJS, startMapper, stopMapper };\n } else {\n console.warn(\n \"Reanimated was not found and the useSharedValueEffect hook will have no effect.\"\n );\n return {\n runOnJS: undefined,\n startMapper: undefined,\n stopMapper: undefined,\n };\n }\n }, []);\n\n useEffect(() => {\n if (\n startMapper !== undefined &&\n runOnJS !== undefined &&\n stopMapper !== undefined\n ) {\n // Start a mapper in Reanimated\n const mapperId = startMapper(\n () => {\n \"worklet\";\n runOnJS(cb)();\n },\n [value, ...values],\n [input]\n );\n // Return unregistering the mapper\n return () => {\n if (stopMapper && mapperId !== undefined) {\n stopMapper(mapperId);\n }\n };\n }\n return () => {};\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [input, runOnJS, startMapper, stopMapper, value, ...values]);\n};\n"]}
1
+ {"version":3,"names":["Reanimated","Core","require","e","useSharedValueWrapper","useSharedValue","undefined","value","useMemo","useSharedValueEffect","cb","values","input","runOnJS","startMapper","stopMapper","console","warn","useEffect","mapperId"],"sources":["useSharedValueEffect.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-shadow */\n/* eslint-disable @typescript-eslint/consistent-type-imports */\n/* eslint-disable @typescript-eslint/ban-ts-comment */\nimport { useEffect, useMemo } from \"react\";\n\n// @ts-ignore\nlet Reanimated: typeof import(\"react-native-reanimated\") | undefined;\nlet Core: // @ts-ignore\ntypeof import(\"react-native-reanimated/lib/reanimated2/core\") | undefined;\n\ntry {\n Reanimated = require(\"react-native-reanimated\");\n Core = require(\"react-native-reanimated/lib/reanimated2/core\");\n} catch (e) {\n // Ignore\n}\n\ntype SharedValueTypeWrapper<T = number> = {\n value: T;\n};\n\nconst useSharedValueWrapper =\n Reanimated?.useSharedValue === undefined\n ? (value: number) => useMemo(() => ({ value }), [value])\n : Reanimated.useSharedValue;\n\n/**\n * Connects a shared value from reanimated to a SkiaView or Canvas\n * so whenever the shared value changes the SkiaView will redraw.\n * @param cb Callback that will be called whenever the shared value changes.\n * @param values One or more shared values to listen for.\n */\nexport const useSharedValueEffect = <T = number>(\n cb: () => void,\n value: SharedValueTypeWrapper<T>,\n ...values: SharedValueTypeWrapper<T>[]\n) => {\n const input = useSharedValueWrapper(0);\n const { runOnJS, startMapper, stopMapper } = useMemo(() => {\n if (Reanimated && Core) {\n const { runOnJS } = Reanimated;\n const { startMapper, stopMapper } = Core;\n return { runOnJS, startMapper, stopMapper };\n } else {\n console.warn(\n \"Reanimated was not found and the useSharedValueEffect hook will have no effect.\"\n );\n return {\n runOnJS: undefined,\n startMapper: undefined,\n stopMapper: undefined,\n };\n }\n }, []);\n\n useEffect(() => {\n if (\n startMapper !== undefined &&\n runOnJS !== undefined &&\n stopMapper !== undefined\n ) {\n // Start a mapper in Reanimated\n const mapperId = startMapper(\n () => {\n \"worklet\";\n runOnJS(cb)();\n },\n [value, ...values],\n [input]\n );\n // Return unregistering the mapper\n return () => {\n if (stopMapper && mapperId !== undefined) {\n stopMapper(mapperId);\n }\n };\n }\n return () => {};\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [input, runOnJS, startMapper, stopMapper, value, ...values]);\n};\n"],"mappings":";;;;;;;AAGA;;;;AAEA;AACA,IAAIA,UAAJ;AACA,IAAIC,IAAJ;;AAGA,IAAI;EACFD,UAAU,GAAGE,OAAO,CAAC,yBAAD,CAApB;EACAD,IAAI,GAAGC,OAAO,CAAC,8CAAD,CAAd;AACD,CAHD,CAGE,OAAOC,CAAP,EAAU,CACV;AACD;;AAMD,MAAMC,qBAAqB,GACzB,gBAAAJ,UAAU,UAAV,kDAAYK,cAAZ,MAA+BC,SAA/B,GACKC,KAAD,IAAm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Bc,CAuBd;EACD,CAxBD,EAwBG,CAACP,KAAD,EAAQC,OAAR,EAAiBC,WAAjB,EAA8BC,UAA9B,EAA0CR,KAA1C,EAAiD,GAAGI,MAApD,CAxBH;AAyBD,CAhDM"}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["import \"./skia/NativeSetup\";\nexport * from \"./renderer\";\nexport * from \"./renderer/Canvas\";\nexport * from \"./views\";\nexport * from \"./skia\";\nexport * from \"./external\";\nexport * from \"./values\";\nexport * from \"./animation\";\nexport * from \"./dom/types\";\nexport * from \"./dom/nodes\";\n"]}
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["import \"./skia/NativeSetup\";\nexport * from \"./renderer\";\nexport * from \"./renderer/Canvas\";\nexport * from \"./views\";\nexport * from \"./skia\";\nexport * from \"./external\";\nexport * from \"./values\";\nexport * from \"./animation\";\nexport * from \"./dom/types\";\nexport * from \"./dom/nodes\";\n"],"mappings":";;;;;;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"}
@@ -50,14 +50,10 @@ const Noop = () => {};
50
50
  const Skia = new Stub();
51
51
  exports.Skia = Skia;
52
52
 
53
- const vec = (x, y) => {
54
- var _ref;
55
-
56
- return {
57
- x: x !== null && x !== void 0 ? x : 0,
58
- y: (_ref = y !== null && y !== void 0 ? y : x) !== null && _ref !== void 0 ? _ref : 0
59
- };
60
- };
53
+ const vec = (x, y) => ({
54
+ x: x ?? 0,
55
+ y: y ?? x ?? 0
56
+ });
61
57
 
62
58
  exports.vec = vec;
63
59
  const Mock = {
@@ -92,11 +88,11 @@ const Mock = {
92
88
  sub: (a, b) => vec(a.x - b.x, a.y - b.y),
93
89
  neg: a => vec(-a.x, -a.y),
94
90
  dist: (a, b) => Math.hypot(a.x - b.x, a.y - b.y),
95
- translate: _ref2 => {
91
+ translate: _ref => {
96
92
  let {
97
93
  x,
98
94
  y
99
- } = _ref2;
95
+ } = _ref;
100
96
  return [{
101
97
  translateX: x
102
98
  }, {
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":["Stub","constructor","Proxy","get","apply","set","Noop","Skia","vec","x","y","Mock","BaseSkia","useRawData","useData","useFont","useTypeface","useImage","useSVG","usePicture","createPicture","rect","width","height","rrect","r","rx","ry","point","add","a","b","sub","neg","dist","Math","hypot","translate","translateX","translateY","bounds","topLeft","topRight","bottomLeft","bottomRight","center","processTransform2d","useSharedValueEffect","Values","ValuesHooks","Selector","timingFunctions","springFunctions","decayFunctions","interpolateFn","interpolatePathFn","interpolateVectorFn","interpolateColors","_value","_inputRange","_outputRange","Float32Array","of","mixColors","_v","_x","_y","ShaderLib","createDrawing","createDeclaration"],"mappings":";;;;;;;AAGA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAlBA;AAoBA,MAAMA,IAAN,CAAW;AACTC,EAAAA,WAAW,GAAG;AACZ,WAAO,IAAIC,KAAJ,CAAU,MAAM,CAAE,CAAlB,EAAoB;AACzBC,MAAAA,GAAG,EAAE,MAAM,IAAIH,IAAJ,EADc;AAEzBI,MAAAA,KAAK,EAAE,MAAM,IAAIJ,IAAJ,EAFY;AAGzBK,MAAAA,GAAG,EAAE,MAAM;AAHc,KAApB,CAAP;AAKD;;AAPQ;;AAUX,MAAMC,IAAe,GAAG,MAAM,CAAE,CAAhC;;AAEO,MAAMC,IAAa,GAAG,IAAIP,IAAJ,EAAtB;;;AAEA,MAAMQ,GAAG,GAAG,CAACC,CAAD,EAAaC,CAAb;AAAA;;AAAA,SAA6B;AAAED,IAAAA,CAAC,EAAEA,CAAF,aAAEA,CAAF,cAAEA,CAAF,GAAO,CAAV;AAAaC,IAAAA,CAAC,UAAEA,CAAF,aAAEA,CAAF,cAAEA,CAAF,GAAOD,CAAP,uCAAY;AAA1B,GAA7B;AAAA,CAAZ;;;AAEA,MAAME,IAOV,GAAG;AACJ;AACA;AACAJ,EAAAA,IAHI;AAIJ,KAAGK,QAJC;AAKJ;AACAC,EAAAA,UAAU,EAA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AzB,CA5D7C;AA6DJK,EAAAA,SAAS,EAATA,oBA7DI;AA8DJC,EAAAA,aAAa,EAAE9D,IA9DX;AA+DJ+D,EAAAA,iBAAiB,EAAE/D;AA/Df,CAPC","sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport type { Color, Skia as SkiaApi, SkRect, Vector } from \"../skia/types\";\nimport * as Values from \"../values/web\";\nimport * as ValuesHooks from \"../values/hooks\";\nimport { Selector } from \"../values/selector\";\nimport * as BaseSkia from \"../skia/types\";\nimport type * as SkiaExports from \"../skia\";\nimport type * as ExternalExports from \"../external\";\nimport type * as ValueExports from \"../values\";\nimport type * as AnimationExports from \"../animation\";\nimport { useSharedValueEffect } from \"../external/reanimated/useSharedValueEffect\";\nimport * as timingFunctions from \"../animation/timing\";\nimport * as springFunctions from \"../animation/spring\";\nimport * as decayFunctions from \"../animation/decay\";\nimport * as interpolateFn from \"../animation/functions/interpolate\";\nimport * as interpolatePathFn from \"../animation/functions/interpolatePaths\";\nimport * as interpolateVectorFn from \"../animation/functions/interpolateVector\";\nimport { ShaderLib } from \"../renderer/components/shaders/ShaderLib\";\n\nclass Stub {\n constructor() {\n return new Proxy(() => {}, {\n get: () => new Stub(),\n apply: () => new Stub(),\n set: () => true,\n });\n }\n}\n\nconst Noop: () => any = () => {};\n\nexport const Skia: SkiaApi = new Stub() as any;\n\nexport const vec = (x?: number, y?: number) => ({ x: x ?? 0, y: y ?? x ?? 0 });\n\nexport const Mock: typeof SkiaExports &\n typeof ExternalExports &\n typeof ValueExports &\n typeof AnimationExports & {\n createDrawing: () => any;\n createDeclaration: () => any;\n ShaderLib: typeof ShaderLib;\n } = {\n // SkiaExports\n // 1. Skia API. BaseSkia contains the enums, and functions like isPaint etc\n Skia,\n ...BaseSkia,\n // 2. Hooks\n useRawData: Noop,\n useData: Noop,\n useFont: Noop,\n useTypeface: Noop,\n useImage: Noop,\n useSVG: Noop,\n usePicture: Noop,\n createPicture: Noop,\n // 3. Point/Rect/Transform utilities\n vec,\n rect: (x: number, y: number, width: number, height: number) => ({\n x,\n y,\n width,\n height,\n }),\n rrect: (r: SkRect, rx: number, ry: number) => ({\n rect: r,\n rx,\n ry,\n }),\n point: vec,\n add: (a: Vector, b: Vector) => vec(a.x + b.x, a.y + b.y),\n sub: (a: Vector, b: Vector) => vec(a.x - b.x, a.y - b.y),\n neg: (a: Vector) => vec(-a.x, -a.y),\n dist: (a: Vector, b: Vector) => Math.hypot(a.x - b.x, a.y - b.y),\n translate: ({ x, y }: Vector) =>\n [{ translateX: x }, { translateY: y }] as const,\n\n bounds: Noop,\n topLeft: Noop,\n topRight: Noop,\n bottomLeft: Noop,\n bottomRight: Noop,\n center: Noop,\n processTransform2d: Noop,\n // ExternalExports\n useSharedValueEffect,\n // ValueExports\n ...Values,\n ...ValuesHooks,\n Selector,\n // Animations\n ...timingFunctions,\n ...springFunctions,\n ...decayFunctions,\n ...interpolateFn,\n ...interpolatePathFn,\n ...interpolateVectorFn,\n interpolateColors: (\n _value: number,\n _inputRange: number[],\n _outputRange: Color[]\n ) => Float32Array.of(0, 0, 0, 0),\n mixColors: (_v: number, _x: Color, _y: Color) => Float32Array.of(0, 0, 0, 0),\n ShaderLib,\n createDrawing: Noop,\n createDeclaration: Noop,\n};\n"]}
1
+ {"version":3,"names":["Stub","constructor","Proxy","get","apply","set","Noop","Skia","vec","x","y","Mock","BaseSkia","useRawData","useData","useFont","useTypeface","useImage","useSVG","usePicture","createPicture","rect","width","height","rrect","r","rx","ry","point","add","a","b","sub","neg","dist","Math","hypot","translate","translateX","translateY","bounds","topLeft","topRight","bottomLeft","bottomRight","center","processTransform2d","useSharedValueEffect","Values","ValuesHooks","Selector","timingFunctions","springFunctions","decayFunctions","interpolateFn","interpolatePathFn","interpolateVectorFn","interpolateColors","_value","_inputRange","_outputRange","Float32Array","of","mixColors","_v","_x","_y","ShaderLib","createDrawing","createDeclaration"],"sources":["index.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport type { Color, Skia as SkiaApi, SkRect, Vector } from \"../skia/types\";\nimport * as Values from \"../values/web\";\nimport * as ValuesHooks from \"../values/hooks\";\nimport { Selector } from \"../values/selector\";\nimport * as BaseSkia from \"../skia/types\";\nimport type * as SkiaExports from \"../skia\";\nimport type * as ExternalExports from \"../external\";\nimport type * as ValueExports from \"../values\";\nimport type * as AnimationExports from \"../animation\";\nimport { useSharedValueEffect } from \"../external/reanimated/useSharedValueEffect\";\nimport * as timingFunctions from \"../animation/timing\";\nimport * as springFunctions from \"../animation/spring\";\nimport * as decayFunctions from \"../animation/decay\";\nimport * as interpolateFn from \"../animation/functions/interpolate\";\nimport * as interpolatePathFn from \"../animation/functions/interpolatePaths\";\nimport * as interpolateVectorFn from \"../animation/functions/interpolateVector\";\nimport { ShaderLib } from \"../renderer/components/shaders/ShaderLib\";\n\nclass Stub {\n constructor() {\n return new Proxy(() => {}, {\n get: () => new Stub(),\n apply: () => new Stub(),\n set: () => true,\n });\n }\n}\n\nconst Noop: () => any = () => {};\n\nexport const Skia: SkiaApi = new Stub() as any;\n\nexport const vec = (x?: number, y?: number) => ({ x: x ?? 0, y: y ?? x ?? 0 });\n\nexport const Mock: typeof SkiaExports &\n typeof ExternalExports &\n typeof ValueExports &\n typeof AnimationExports & {\n createDrawing: () => any;\n createDeclaration: () => any;\n ShaderLib: typeof ShaderLib;\n } = {\n // SkiaExports\n // 1. Skia API. BaseSkia contains the enums, and functions like isPaint etc\n Skia,\n ...BaseSkia,\n // 2. Hooks\n useRawData: Noop,\n useData: Noop,\n useFont: Noop,\n useTypeface: Noop,\n useImage: Noop,\n useSVG: Noop,\n usePicture: Noop,\n createPicture: Noop,\n // 3. Point/Rect/Transform utilities\n vec,\n rect: (x: number, y: number, width: number, height: number) => ({\n x,\n y,\n width,\n height,\n }),\n rrect: (r: SkRect, rx: number, ry: number) => ({\n rect: r,\n rx,\n ry,\n }),\n point: vec,\n add: (a: Vector, b: Vector) => vec(a.x + b.x, a.y + b.y),\n sub: (a: Vector, b: Vector) => vec(a.x - b.x, a.y - b.y),\n neg: (a: Vector) => vec(-a.x, -a.y),\n dist: (a: Vector, b: Vector) => Math.hypot(a.x - b.x, a.y - b.y),\n translate: ({ x, y }: Vector) =>\n [{ translateX: x }, { translateY: y }] as const,\n\n bounds: Noop,\n topLeft: Noop,\n topRight: Noop,\n bottomLeft: Noop,\n bottomRight: Noop,\n center: Noop,\n processTransform2d: Noop,\n // ExternalExports\n useSharedValueEffect,\n // ValueExports\n ...Values,\n ...ValuesHooks,\n Selector,\n // Animations\n ...timingFunctions,\n ...springFunctions,\n ...decayFunctions,\n ...interpolateFn,\n ...interpolatePathFn,\n ...interpolateVectorFn,\n interpolateColors: (\n _value: number,\n _inputRange: number[],\n _outputRange: Color[]\n ) => Float32Array.of(0, 0, 0, 0),\n mixColors: (_v: number, _x: Color, _y: Color) => Float32Array.of(0, 0, 0, 0),\n ShaderLib,\n createDrawing: Noop,\n createDeclaration: Noop,\n};\n"],"mappings":";;;;;;;AAGA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAlBA;AAoBA,MAAMA,IAAN,CAAW;EACTC,WAAW,GAAG;IACZ,OAAO,IAAIC,KAAJ,CAAU,MAAM,CAAE,CAAlB,EAAoB;MACzBC,GAAG,EAAE,MAAM,IAAIH,IAAJ,EADc;MAEzBI,KAAK,EAAE,MAAM,IAAIJ,IAAJ,EAFY;MAGzBK,GAAG,EAAE,MAAM;IAHc,CAApB,CAAP;EAKD;;AAPQ;;AAUX,MAAMC,IAAe,GAAG,MAAM,CAAE,CAAhC;;AAEO,MAAMC,IAAa,GAAG,IAAIP,IAAJ,EAAtB;;;AAEA,MAAMQ,GAAG,GAAG,CAACC,CAAD,EAAaC,CAAb,MAA6B;EAAED,CAAC,EAAEA,CAAC,IAAI,CAAV;EAAaC,CAAC,EAAEA,CAAC,IAAID,CAAL,IAAU;AAA1B,CAA7B,CAAZ;;;AAEA,MA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ools","bundleType","version","rendererPackageName","render","element","root","container","updateContainer","depMgr","update","useCanvasRef","Canvas","forwardedRef","children","style","debug","mode","onTouch","size","width","height","canvasCtx","Skia","innerRef","ref","useCombinedRefs","tick","setTick","redraw","t","registerValues","values","current","Error","Container","DependencyManager","createContainer","paint","Paint","onDraw","canvas","info","timestamp","touches","reset","ctx","opacity","center","x","y","draw","remove","refs","targetRef","React","useRef","useEffect","forEach"],"mappings":";;;;;;;AAAA;;AAgBA;;AAEA;;AAEA;;AACA;;AAGA;;AAEA;;AACA;;AACA;;;;;;;;AAHA;AAKO,MAAMA,cAAc,GAAG,8BAAgBC,wBAAhB,CAAvB;;AAEPD,cAAc,CAACE,kBAAf,CAAkC;AAChCC,EAAAA,UAAU,EAAE,CADoB;AAEhCC,EAAAA,OAAO,EAAE,OAFuB;AAGhCC,EAAAA,mBAAmB,EAAE;AAHW,CAAlC;;AAMA,MAAMC,MAAM,GAAG,CAACC,OAAD,EAAqBC,IAArB,EAAuCC,SAAvC,KAAgE;AAC7ET,EAAAA,cAAc,CAACU,eAAf,CAA+BH,OAA/B,EAAwCC,IAAxC,EAA8C,IAA9C,EAAoD,MAAM;AACxD,2BAAU,iBAAV;AACAC,IAAAA,SAAS,CAACE,MAAV,CAAiBC,MAAjB;AACD,GAHD;AAID,CALD;;AAOO,MAAMC,YAAY,GAAG,MAAM,mBAAiB,IAAjB,CAA3B;;;AAQA,MAAMC,MAAM,gBAAG,uBACpB,OAA4CC,YAA5C,KAA6D;AAAA,MAA5D;AAAEC,IAAAA,QAAF;AAAYC,IAAAA,KAAZ;AAAmBC,IAAAA,KAAnB;AAA0BC,IAAAA,IAA1B;AAAgCC,IAAAA;AAAhC,GAA4D;AAC3D,QAAMC,IAAI,GAAG,wBAAS;AAAEC,IAAAA,KAAK,EAAE,CAAT;AAAYC,IAAAA,MAAM,EAAE;AAApB,GAAT,CAAb;AACA,QAAMC,SAAS,GAAG,oBAAQ,OAAO;AAAEC,IAAAA,IAAI,EAAJA,UA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DC,QAAAA,SAAS,CAACE,MAAV,CAAiB2C,MAAjB;AACD,OAFD;AAGD,KAJD;AAKD,GAND,EAMG,CAAC7C,SAAD,EAAYD,IAAZ,CANH;AAQA,sBACE,6BAAC,eAAD;AACE,IAAA,GAAG,EAAEmB,GADP;AAEE,IAAA,KAAK,EAAEV,KAFT;AAGE,IAAA,MAAM,EAAEyB,MAHV;AAIE,IAAA,IAAI,EAAEvB,IAJR;AAKE,IAAA,KAAK,EAAED;AALT,IADF;AASD,CAxFmB,CAAf;AA2FP;AACA;AACA;AACA;AACA;AACA;AACA;;;;AACA,MAAMU,eAAe,GAAG,YAEnB;AAAA,oCADA2B,IACA;AADAA,IAAAA,IACA;AAAA;;AACH,QAAMC,SAAS,GAAGC,eAAMC,MAAN,CAAgB,IAAhB,CAAlB;;AACAD,iBAAME,SAAN,CAAgB,MAAM;AACpBJ,IAAAA,IAAI,CAACK,OAAL,CAAcjC,GAAD,IAAS;AACpB,UAAIA,GAAJ,EAAS;AACP,YAAI,OAAOA,GAAP,KAAe,UAAnB,EAA+B;AAC7BA,UAAAA,GAAG,CAAC6B,SAAS,CAACrB,OAAX,CAAH;AACD,SAFD,MAEO;AACLR,UAAAA,GAAG,CAACQ,OAAJ,GAAcqB,SAAS,CAACrB,OAAxB;AACD;AACF;AACF,KARD;AASD,GAVD,EAUG,CAACoB,IAAD,CAVH;;AAWA,SAAOC,SAAP;AACD,CAhBD","sourcesContent":["import React, {\n useEffect,\n useState,\n useCallback,\n useMemo,\n forwardRef,\n useRef,\n} from \"react\";\nimport type {\n RefObject,\n ReactNode,\n ComponentProps,\n MutableRefObject,\n ForwardedRef,\n} from \"react\";\nimport type { OpaqueRoot } from \"react-reconciler\";\nimport ReactReconciler from \"react-reconciler\";\n\nimport { SkiaView, useDrawCallback } from \"../views\";\nimport type { TouchHandler } from \"../views\";\nimport { useValue } from \"../values/hooks/useValue\";\nimport { Skia } from \"../skia/Skia\";\nimport type { SkiaValue } from \"../values\";\n\nimport { debug as hostDebug, skHostConfig } from \"./HostConfig\";\n// import { debugTree } from \"./nodes\";\nimport { Container } from \"./Container\";\nimport { DependencyManager } from \"./DependencyManager\";\nimport { CanvasProvider } from \"./useCanvas\";\n\nexport const skiaReconciler = ReactReconciler(skHostConfig);\n\nskiaReconciler.injectIntoDevTools({\n bundleType: 1,\n version: \"0.0.1\",\n rendererPackageName: \"react-native-skia\",\n});\n\nconst render = (element: ReactNode, root: OpaqueRoot, container: Container) => {\n skiaReconciler.updateContainer(element, root, null, () => {\n hostDebug(\"updateContainer\");\n container.depMgr.update();\n });\n};\n\nexport const useCanvasRef = () => useRef<SkiaView>(null);\n\nexport interface CanvasProps extends ComponentProps<typeof SkiaView> {\n ref?: RefObject<SkiaView>;\n children: ReactNode;\n onTouch?: TouchHandler;\n}\n\nexport const Canvas = forwardRef<SkiaView, CanvasProps>(\n ({ children, style, debug, mode, onTouch }, forwardedRef) => {\n const size = useValue({ width: 0, height: 0 });\n const canvasCtx = useMemo(() => ({ Skia, size }), [size]);\n const innerRef = useCanvasRef();\n const ref = useCombinedRefs(forwardedRef, innerRef);\n const [tick, setTick] = useState(0);\n const redraw = useCallback(() => {\n setTick((t) => t + 1);\n }, []);\n\n const registerValues = useCallback(\n (values: Array<SkiaValue<unknown>>) => {\n if (ref.current === null) {\n throw new Error(\"Canvas ref is not set\");\n }\n return ref.current.registerValues(values);\n },\n [ref]\n );\n\n const container = useMemo(() => {\n return new Container(Skia, new DependencyManager(registerValues), redraw);\n }, [redraw, registerValues]);\n\n const root = useMemo(\n () => skiaReconciler.createContainer(container, 0, false, null),\n [container]\n );\n // Render effect\n useEffect(() => {\n render(\n <CanvasProvider value={canvasCtx}>{children}</CanvasProvider>,\n root,\n container\n );\n }, [children, root, redraw, container, canvasCtx]);\n\n const paint = useMemo(() => Skia.Paint(), []);\n\n // Draw callback\n const onDraw = useDrawCallback(\n (canvas, info) => {\n // TODO: if tree is empty (count === 1) maybe we should not render?\n const { width, height, timestamp } = info;\n if (onTouch) {\n onTouch(info.touches);\n }\n if (\n width !== canvasCtx.size.current.width ||\n height !== canvasCtx.size.current.height\n ) {\n canvasCtx.size.current = { width, height };\n }\n paint.reset();\n const ctx = {\n width,\n height,\n timestamp,\n canvas,\n paint,\n opacity: 1,\n ref,\n center: { x: width / 2, y: height / 2 },\n Skia,\n };\n container.draw(ctx);\n },\n [tick, onTouch]\n );\n\n useEffect(() => {\n return () => {\n skiaReconciler.updateContainer(null, root, null, () => {\n container.depMgr.remove();\n });\n };\n }, [container, root]);\n\n return (\n <SkiaView\n ref={ref}\n style={style}\n onDraw={onDraw}\n mode={mode}\n debug={debug}\n />\n );\n }\n);\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"]}
1
+ {"version":3,"names":["skiaReconciler","ReactReconciler","skHostConfig","injectIntoDevTools","bundleType","version","rendererPackageName","render","element","root","container","updateContainer","hostDebug","depMgr","update","useCanvasRef","useRef","Canvas","forwardRef","forwardedRef","children","style","debug","mode","onTouch","size","useValue","width","height","canvasCtx","useMemo","Skia","innerRef","ref","useCombinedRefs","tick","setTick","useState","redraw","useCallback","t","registerValues","values","current","Error","Container","DependencyManager","createContainer","useEffect","paint","Paint","onDraw","useDrawCallback","canvas","info","timestamp","touches","reset","ctx","opacity","center","x","y","draw","remove","refs","targetRef","React","forEach"],"sources":["Canvas.tsx"],"sourcesContent":["import React, {\n useEffect,\n useState,\n useCallback,\n useMemo,\n forwardRef,\n useRef,\n} from \"react\";\nimport type {\n RefObject,\n ReactNode,\n ComponentProps,\n MutableRefObject,\n ForwardedRef,\n} from \"react\";\nimport type { OpaqueRoot } from \"react-reconciler\";\nimport ReactReconciler from \"react-reconciler\";\n\nimport { SkiaView, useDrawCallback } from \"../views\";\nimport type { TouchHandler } from \"../views\";\nimport { useValue } from \"../values/hooks/useValue\";\nimport { Skia } from \"../skia/Skia\";\nimport type { SkiaValue } from \"../values\";\n\nimport { debug as hostDebug, skHostConfig } from \"./HostConfig\";\n// import { debugTree } from \"./nodes\";\nimport { Container } from \"./Container\";\nimport { DependencyManager } from \"./DependencyManager\";\nimport { CanvasProvider } from \"./useCanvas\";\n\nexport const skiaReconciler = ReactReconciler(skHostConfig);\n\nskiaReconciler.injectIntoDevTools({\n bundleType: 1,\n version: \"0.0.1\",\n rendererPackageName: \"react-native-skia\",\n});\n\nconst render = (element: ReactNode, root: OpaqueRoot, container: Container) => {\n skiaReconciler.updateContainer(element, root, null, () => {\n hostDebug(\"updateContainer\");\n container.depMgr.update();\n });\n};\n\nexport const useCanvasRef = () => useRef<SkiaView>(null);\n\nexport interface CanvasProps extends ComponentProps<typeof SkiaView> {\n ref?: RefObject<SkiaView>;\n children: ReactNode;\n onTouch?: TouchHandler;\n}\n\nexport const Canvas = forwardRef<SkiaView, CanvasProps>(\n ({ children, style, debug, mode, onTouch }, forwardedRef) => {\n const size = useValue({ width: 0, height: 0 });\n const canvasCtx = useMemo(() => ({ Skia, size }), [size]);\n const innerRef = useCanvasRef();\n const ref = useCombinedRefs(forwardedRef, innerRef);\n const [tick, setTick] = useState(0);\n const redraw = useCallback(() => {\n setTick((t) => t + 1);\n }, []);\n\n const registerValues = useCallback(\n (values: Array<SkiaValue<unknown>>) => {\n if (ref.current === null) {\n throw new Error(\"Canvas ref is not set\");\n }\n return ref.current.registerValues(values);\n },\n [ref]\n );\n\n const container = useMemo(() => {\n return new Container(Skia, new DependencyManager(registerValues), redraw);\n }, [redraw, registerValues]);\n\n const root = useMemo(\n () => skiaReconciler.createContainer(container, 0, false, null),\n [container]\n );\n // Render effect\n useEffect(() => {\n render(\n <CanvasProvider value={canvasCtx}>{children}</CanvasProvider>,\n root,\n container\n );\n }, [children, root, redraw, container, canvasCtx]);\n\n const paint = useMemo(() => Skia.Paint(), []);\n\n // Draw callback\n const onDraw = useDrawCallback(\n (canvas, info) => {\n // TODO: if tree is empty (count === 1) maybe we should not render?\n const { width, height, timestamp } = info;\n if (onTouch) {\n onTouch(info.touches);\n }\n if (\n width !== canvasCtx.size.current.width ||\n height !== canvasCtx.size.current.height\n ) {\n canvasCtx.size.current = { width, height };\n }\n paint.reset();\n const ctx = {\n width,\n height,\n timestamp,\n canvas,\n paint,\n opacity: 1,\n ref,\n center: { x: width / 2, y: height / 2 },\n Skia,\n };\n container.draw(ctx);\n },\n [tick, onTouch]\n );\n\n useEffect(() => {\n return () => {\n skiaReconciler.updateContainer(null, root, null, () => {\n container.depMgr.remove();\n });\n };\n }, [container, root]);\n\n return (\n <SkiaView\n ref={ref}\n style={style}\n onDraw={onDraw}\n mode={mode}\n debug={debug}\n />\n );\n }\n);\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;;AAEA;;AAEA;;AACA;;AAGA;;AAEA;;AACA;;AACA;;;;;;;;AAHA;AAKO,MAAMA,cAAc,GAAG,IAAAC,wBAAA,EAAgBC,wBAAhB,CAAvB;;AAEPF,cAAc,CAACG,kBAAf,CAAkC;EAChCC,UAAU,EAAE,CADoB;EAEhCC,O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;MACpB,IAAIA,GAAJ,EAAS;QACP,IAAI,OAAOA,GAAP,KAAe,UAAnB,EAA+B;UAC7BA,GAAG,CAACiC,SAAS,CAACvB,OAAX,CAAH;QACD,CAFD,MAEO;UACLV,GAAG,CAACU,OAAJ,GAAcuB,SAAS,CAACvB,OAAxB;QACD;MACF;IACF,CARD;EASD,CAVD,EAUG,CAACsB,IAAD,CAVH;;EAWA,OAAOC,SAAP;AACD,CAhBD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["Container.tsx"],"names":["Container","constructor","Skia","depMgr","redraw","Sk","JsiSkDOM","_root","Group","draw","ctx","render","root"],"mappings":";;;;;;;AAAA;;;;AAWO,MAAMA,SAAN,CAAgB;AAGrBC,EAAAA,WAAW,CACTC,IADS,EAEFC,MAFE,EAGFC,MAHE,EAIT;AAAA,SAFOD,MAEP,GAFOA,MAEP;AAAA,SADOC,MACP,GADOA,MACP;;AAAA;;AAAA;;AACA,SAAKC,EAAL,GAAU,IAAIC,eAAJ,CAAa;AAAEJ,MAAAA,IAAF;AAAQC,MAAAA;AAAR,KAAb,CAAV;AACA,SAAKI,KAAL,GAAa,KAAKF,EAAL,CAAQG,KAAR,EAAb;AACD;;AAEDC,EAAAA,IAAI,CAACC,GAAD,EAAsB;AACxB,SAAKH,KAAL,CAAWI,MAAX,CAAkBD,GAAlB;AACD;;AAEO,MAAJE,IAAI,GAAG;AACT,WAAO,KAAKL,KAAZ;AACD;;AAlBoB","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\nimport type { DependencyManager } from \"./DependencyManager\";\n\nexport class Container {\n private _root: RenderNode<GroupProps>;\n public Sk: SkDOM;\n constructor(\n Skia: Skia,\n public depMgr: DependencyManager,\n public redraw: () => void\n ) {\n this.Sk = new JsiSkDOM({ Skia, depMgr });\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"]}
1
+ {"version":3,"names":["Container","constructor","Skia","depMgr","redraw","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\nimport type { DependencyManager } from \"./DependencyManager\";\n\nexport class Container {\n private _root: RenderNode<GroupProps>;\n public Sk: SkDOM;\n constructor(\n Skia: Skia,\n public depMgr: DependencyManager,\n public redraw: () => void\n ) {\n this.Sk = new JsiSkDOM({ Skia, depMgr });\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;;;;AAWO,MAAMA,SAAN,CAAgB;EAGrBC,WAAW,CACTC,IADS,EAEFC,MAFE,EAGFC,MAHE,EAIT;IAAA,KAFOD,MAEP,GAFOA,MAEP;IAAA,KADOC,MACP,GADOA,MACP;;IAAA;;IAAA;;IACA,KAAKC,EAAL,GAAU,IAAIC,eAAJ,CAAa;MAAEJ,IAAF;MAAQC;IAAR,CAAb,CAAV;IACA,KAAKI,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 +1 @@
1
- {"version":3,"sources":["DependencyManager.tsx"],"names":["DependencyManager","constructor","registerValues","Map","unsubscribeNodes","nodes","forEach","n","unsubscribeNode","node","subscriptions","Array","from","values","filter","p","has","si","delete","size","unsubscribe","Error","element","entries","find","_","sub","subscribeNode","props","propSubscriptions","initializePropertySubscriptions","length","ps","subscriptionState","get","value","addListener","v","mutators","m","set","map","mutator","update","unregisterDependantValues","keys","remove","clear","nodePropSubscriptions","key","propvalue","push","setProp","current","selector"],"mappings":";;;;;;;AAIA;;AACA;;;;AAUO,MAAMA,iBAAN,CAAwB;AAK7BC,EAAAA,WAAW,CACTC,cADS,EAET;AAAA;;AAAA,2CAL0D,IAAIC,GAAJ,EAK1D;;AAAA,uDAJ8C,IAI9C;;AACA,SAAKD,cAAL,GAAsBA,cAAtB;AACD;;AAEDE,EAAAA,gBAAgB,CAACC,KAAD,EAAyB;AACvCA,IAAAA,KAAK,CAACC,OAAN,CAAeC,CAAD,IAAO,KAAKC,eAAL,CAAqBD,CAArB,CAArB;AACD;AAED;AACF;AACA;AACA;AACA;AACA;AACA;;;AACEC,EAAAA,eAAe,CAACC,IAAD,EAAsB;AACnC,UAAMC,aAAa,GAAGC,KAAK,CAACC,IAAN,CAAW,KAAKF,aAAL,CAAmBG,MAAnB,EAAX,EAAwCC,MAAxC,CAAgDC,CAAD,IACnEA,CAAC,CAACV,KAAF,CAAQW,GAAR,CAAYP,IAAZ,CADoB,CAAtB;;AAIA,QAAIC,aAAJ,EAAmB;AACjBA,MAAAA,aAAa,CAACJ,OAAd,CAAuBW,EAAD,IAAQ;AAC5B;AACAA,QAAAA,EAAE,CAACZ,KAAH,CAASa,MAAT,CAAgBT,IAAhB,EAF4B,CAI5B;;AACA,YAAIQ,EAAE,CAACZ,KAAH,CAASc,IAAT,KAAkB,CAAtB,EAAyB;AACvB;AACA;AACA,cAAI,CAACF,EAAE,CAACG,WAAR,EAAqB;AACnB,kBAAM,IAAIC,KAAJ,CAAU,6CAAV,CAAN;AACD;;AACDJ,UAAAA,EAAE,CAACG,WAAH,IAAkBH,EAAE,CAACG,WAAH,EAAlB,CANuB,CAQvB;;AACA,gBAAME,OAAO,GAAGX,KAAK,CAACC,IAAN,CAAW,KAAKF,aAAL,CAAmBa,OAAnB,EAAX,EAAyCC,IAAzC,CACd;AAAA,gBAAC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D,IAAS;AAC9B,QAAIA,GAAG,KAAK,UAAZ,EAAwB;AACtB;AACD;;AACD,UAAMC,SAAS,GAAGtB,KAAK,CAACqB,GAAD,CAAvB;;AAEA,QAAI,yBAAQC,SAAR,CAAJ,EAAwB;AACtB;AACAF,MAAAA,qBAAqB,CAACG,IAAtB,CAA2B;AACzBhB,QAAAA,KAAK,EAAEe,SADkB;AAEzBR,QAAAA,OAAO,EAAGL,CAAD,IAAO;AACd5B,UAAAA,IAAI,CAAC2C,OAAL,CAAaH,GAAb,EAAkBZ,CAAlB;AACD;AAJwB,OAA3B,EAFsB,CAQtB;;AACA5B,MAAAA,IAAI,CAAC2C,OAAL,CAAaH,GAAb,EAAmBC,SAAD,CAAwCG,OAA1D;AACD,KAVD,MAUO,IAAI,4BAAWH,SAAX,CAAJ,EAA2B;AAChC;AACAF,MAAAA,qBAAqB,CAACG,IAAtB,CAA2B;AACzBhB,QAAAA,KAAK,EAAEe,SAAS,CAACf,KADQ;AAEzBO,QAAAA,OAAO,EAAGL,CAAD,IAAO;AACd5B,UAAAA,IAAI,CAAC2C,OAAL,CAAaH,GAAb,EAAkBC,SAAS,CAACI,QAAV,CAAmBjB,CAAnB,CAAlB;AACD;AAJwB,OAA3B,EAFgC,CAQhC;;AACA5B,MAAAA,IAAI,CAAC2C,OAAL,CACEH,GADF,EAEEC,SAAS,CAACI,QAAV,CAAmBJ,SAAS,CAACf,KAAV,CAAgBkB,OAAnC,CAFF;AAID,KAbM,MAaA;AACL;AACA5C,MAAAA,IAAI,CAAC2C,OAAL,CAAaH,GAAb,EAAkBC,SAAlB;AACD;AACF,GAjCD;AAmCA,SAAOF,qBAAP;AACD,CA7CD","sourcesContent":["import type { Node } from \"../dom/types\";\nimport type { SkiaValue } from \"../values\";\n\nimport type { AnimatedProps } from \"./processors\";\nimport { isSelector, isValue } from \"./processors\";\nimport { mapKeys } from \"./typeddash\";\n\ntype Unsubscribe = () => void;\ntype Mutator = (value: unknown) => void;\n\ntype SubscriptionState = {\n nodes: Map<Node<unknown>, Mutator[]>;\n unsubscribe: null | Unsubscribe;\n};\n\nexport class DependencyManager {\n registerValues: (values: Array<SkiaValue<unknown>>) => () => void;\n subscriptions: Map<SkiaValue<unknown>, SubscriptionState> = new Map();\n unregisterDependantValues: null | Unsubscribe = null;\n\n constructor(\n registerValues: (values: Array<SkiaValue<unknown>>) => () => void\n ) {\n this.registerValues = registerValues;\n }\n\n unsubscribeNodes(nodes: Node<unknown>[]) {\n nodes.forEach((n) => this.unsubscribeNode(n));\n }\n\n /**\n * Call to unsubscribe all value listeners from the given node based\n * on the current list of subscriptions for the node. This function\n * is typically called when the node is unmounted or when one or more\n * properties have changed.\n * @param node Node to unsubscribe value listeners from\n */\n unsubscribeNode(node: Node<unknown>) {\n const subscriptions = Array.from(this.subscriptions.values()).filter((p) =>\n p.nodes.has(node)\n );\n\n if (subscriptions) {\n subscriptions.forEach((si) => {\n // Delete node from subscription\n si.nodes.delete(node);\n\n // Remove subscription if there are no listeneres left on the value\n if (si.nodes.size === 0) {\n // There are no more nodes subscribing to this value, we can call\n // unsubscribe on it.\n if (!si.unsubscribe) {\n throw new Error(\"Failed to unsubscribe to value subscription\");\n }\n si.unsubscribe && si.unsubscribe();\n\n // Remove from subscription states as well\n const element = Array.from(this.subscriptions.entries()).find(\n ([_, sub]) => sub === si\n );\n if (!element) {\n throw new Error(\"Failed to find value subscription\");\n }\n if (!this.subscriptions.delete(element[0])) {\n throw new Error(\"Failed to delete value subscription\");\n }\n }\n });\n }\n }\n\n /**\n * Adds listeners to the provided values so that the node is notified\n * when a value changes. This is done in an optimized way so that this\n * class only needs to listen to the value once and then forwards the\n * change to the node and its listener. This method is typically called\n * when the node is mounted and when one or more props on the node changes.\n * @param node Node to subscribe to value changes for\n * @param props Node's properties\n * @param onResolveProp Callback when a property value changes\n */\n subscribeNode<P>(node: Node<unknown>, props: AnimatedProps<P>) {\n // Get mutators from node's properties\n const propSubscriptions = initializePropertySubscriptions(node, props);\n if (propSubscriptions.length === 0) {\n return;\n }\n\n // Install all mutators for the node\n propSubscriptions.forEach((ps) => {\n // Do we already have a state for this SkiaValue\n let subscriptionState = this.subscriptions.get(ps.value);\n if (!subscriptionState) {\n // Let's create a new subscription state for the skia value\n subscriptionState = {\n nodes: new Map(),\n unsubscribe: null,\n };\n // Add single subscription to the new value\n subscriptionState.unsubscribe = ps.value.addListener((v) => {\n subscriptionState!.nodes.forEach((mutators) =>\n mutators.forEach((m) => m(v))\n );\n });\n this.subscriptions.set(ps.value, subscriptionState);\n }\n // subscription mutators\n subscriptionState.nodes.set(\n node,\n propSubscriptions\n .filter((m) => m.value === ps.value)\n .map((m) => m.mutator)\n );\n });\n }\n\n /**\n * Called when the hosting container is mounted or updated. This ensures that we have\n * a ref to the underlying SkiaView so that we can registers redraw listeners\n * on values used in the current View automatically.\n */\n update() {\n // Remove any previous registrations\n if (this.unregisterDependantValues) {\n this.unregisterDependantValues();\n }\n\n // Register redraw requests on the SkiaView for each unique value\n this.unregisterDependantValues = this.registerValues(\n Array.from(this.subscriptions.keys())\n );\n }\n\n /**\n * Called when the hosting container is unmounted or recreated. This ensures that we remove\n * all subscriptions to Skia values so that we don't have any listeners left after\n * the component is removed.\n */\n remove() {\n // 1) Unregister redraw requests\n if (this.unregisterDependantValues) {\n this.unregisterDependantValues();\n this.unregisterDependantValues = null;\n }\n\n // 2) Unregister nodes\n Array.from(this.subscriptions.values()).forEach((si) => {\n Array.from(si.nodes.keys()).forEach((node) => this.unsubscribeNode(node));\n });\n\n // 3) Clear the rest of the subscriptions\n this.subscriptions.clear();\n }\n}\n\nconst initializePropertySubscriptions = <P,>(\n node: Node<P>,\n props: AnimatedProps<P>\n) => {\n const nodePropSubscriptions: Array<{\n value: SkiaValue<unknown>;\n mutator: Mutator;\n }> = [];\n\n mapKeys(props).forEach((key) => {\n if (key === \"children\") {\n return;\n }\n const propvalue = props[key];\n\n if (isValue(propvalue)) {\n // Subscribe to changes\n nodePropSubscriptions.push({\n value: propvalue,\n mutator: (v) => {\n node.setProp(key, v as P[typeof key]);\n },\n });\n // Set initial value\n node.setProp(key, (propvalue as SkiaValue<P[typeof key]>).current);\n } else if (isSelector(propvalue)) {\n // Subscribe to changes\n nodePropSubscriptions.push({\n value: propvalue.value,\n mutator: (v) => {\n node.setProp(key, propvalue.selector(v) as P[typeof key]);\n },\n });\n // Set initial value\n node.setProp(\n key,\n propvalue.selector(propvalue.value.current) as P[typeof key]\n );\n } else {\n // Set initial value\n node.setProp(key, propvalue as P[typeof key]);\n }\n });\n\n return nodePropSubscriptions;\n};\n"]}
1
+ {"version":3,"names":["DependencyManager","constructor","registerValues","Map","unsubscribeNodes","nodes","forEach","n","unsubscribeNode","node","subscriptions","Array","from","values","filter","p","has","si","delete","size","unsubscribe","Error","element","entries","find","_","sub","subscribeNode","props","propSubscriptions","initializePropertySubscriptions","length","ps","subscriptionState","get","value","addListener","v","mutators","m","set","map","mutator","update","unregisterDependantValues","keys","remove","clear","nodePropSubscriptions","mapKeys","key","propvalue","isValue","push","setProp","current","isSelector","selector"],"sources":["DependencyManager.tsx"],"sourcesContent":["import type { Node } from \"../dom/types\";\nimport type { SkiaValue } from \"../values\";\n\nimport type { AnimatedProps } from \"./processors\";\nimport { isSelector, isValue } from \"./processors\";\nimport { mapKeys } from \"./typeddash\";\n\ntype Unsubscribe = () => void;\ntype Mutator = (value: unknown) => void;\n\ntype SubscriptionState = {\n nodes: Map<Node<unknown>, Mutator[]>;\n unsubscribe: null | Unsubscribe;\n};\n\nexport class DependencyManager {\n registerValues: (values: Array<SkiaValue<unknown>>) => () => void;\n subscriptions: Map<SkiaValue<unknown>, SubscriptionState> = new Map();\n unregisterDependantValues: null | Unsubscribe = null;\n\n constructor(\n registerValues: (values: Array<SkiaValue<unknown>>) => () => void\n ) {\n this.registerValues = registerValues;\n }\n\n unsubscribeNodes(nodes: Node<unknown>[]) {\n nodes.forEach((n) => this.unsubscribeNode(n));\n }\n\n /**\n * Call to unsubscribe all value listeners from the given node based\n * on the current list of subscriptions for the node. This function\n * is typically called when the node is unmounted or when one or more\n * properties have changed.\n * @param node Node to unsubscribe value listeners from\n */\n unsubscribeNode(node: Node<unknown>) {\n const subscriptions = Array.from(this.subscriptions.values()).filter((p) =>\n p.nodes.has(node)\n );\n\n if (subscriptions) {\n subscriptions.forEach((si) => {\n // Delete node from subscription\n si.nodes.delete(node);\n\n // Remove subscription if there are no listeneres left on the value\n if (si.nodes.size === 0) {\n // There are no more nodes subscribing to this value, we can call\n // unsubscribe on it.\n if (!si.unsubscribe) {\n throw new Error(\"Failed to unsubscribe to value subscription\");\n }\n si.unsubscribe && si.unsubscribe();\n\n // Remove from subscription states as well\n const element = Array.from(this.subscriptions.entries()).find(\n ([_, sub]) => sub === si\n );\n if (!element) {\n throw new Error(\"Failed to find value subscription\");\n }\n if (!this.subscriptions.delete(element[0])) {\n throw new Error(\"Failed to delete value subscription\");\n }\n }\n });\n }\n }\n\n /**\n * Adds listeners to the provided values so that the node is notified\n * when a value changes. This is done in an optimized way so that this\n * class only needs to listen to the value once and then forwards the\n * change to the node and its listener. This method is typically called\n * when the node is mounted and when one or more props on the node changes.\n * @param node Node to subscribe to value changes for\n * @param props Node's properties\n * @param onResolveProp Callback when a property value changes\n */\n subscribeNode<P>(node: Node<unknown>, props: AnimatedProps<P>) {\n // Get mutators from node's properties\n const propSubscriptions = initializePropertySubscriptions(node, props);\n if (propSubscriptions.length === 0) {\n return;\n }\n\n // Install all mutators for the node\n propSubscriptions.forEach((ps) => {\n // Do we already have a state for this SkiaValue\n let subscriptionState = this.subscriptions.get(ps.value);\n if (!subscriptionState) {\n // Let's create a new subscription state for the skia value\n subscriptionState = {\n nodes: new Map(),\n unsubscribe: null,\n };\n // Add single subscription to the new value\n subscriptionState.unsubscribe = ps.value.addListener((v) => {\n subscriptionState!.nodes.forEach((mutators) =>\n mutators.forEach((m) => m(v))\n );\n });\n this.subscriptions.set(ps.value, subscriptionState);\n }\n // subscription mutators\n subscriptionState.nodes.set(\n node,\n propSubscriptions\n .filter((m) => m.value === ps.value)\n .map((m) => m.mutator)\n );\n });\n }\n\n /**\n * Called when the hosting container is mounted or updated. This ensures that we have\n * a ref to the underlying SkiaView so that we can registers redraw listeners\n * on values used in the current View automatically.\n */\n update() {\n // Remove any previous registrations\n if (this.unregisterDependantValues) {\n this.unregisterDependantValues();\n }\n\n // Register redraw requests on the SkiaView for each unique value\n this.unregisterDependantValues = this.registerValues(\n Array.from(this.subscriptions.keys())\n );\n }\n\n /**\n * Called when the hosting container is unmounted or recreated. This ensures that we remove\n * all subscriptions to Skia values so that we don't have any listeners left after\n * the component is removed.\n */\n remove() {\n // 1) Unregister redraw requests\n if (this.unregisterDependantValues) {\n this.unregisterDependantValues();\n this.unregisterDependantValues = null;\n }\n\n // 2) Unregister nodes\n Array.from(this.subscriptions.values()).forEach((si) => {\n Array.from(si.nodes.keys()).forEach((node) => this.unsubscribeNode(node));\n });\n\n // 3) Clear the rest of the subscriptions\n this.subscriptions.clear();\n }\n}\n\nconst initializePropertySubscriptions = <P,>(\n node: Node<P>,\n props: AnimatedProps<P>\n) => {\n const nodePropSubscriptions: Array<{\n value: SkiaValue<unknown>;\n mutator: Mutator;\n }> = [];\n\n mapKeys(props).forEach((key) => {\n if (key === \"children\") {\n return;\n }\n const propvalue = props[key];\n\n if (isValue(propvalue)) {\n // Subscribe to changes\n nodePropSubscriptions.push({\n value: propvalue,\n mutator: (v) => {\n node.setProp(key, v as P[typeof key]);\n },\n });\n // Set initial value\n node.setProp(key, (propvalue as SkiaValue<P[typeof key]>).current);\n } else if (isSelector(propvalue)) {\n // Subscribe to changes\n nodePropSubscriptions.push({\n value: propvalue.value,\n mutator: (v) => {\n node.setProp(key, propvalue.selector(v) as P[typeof key]);\n },\n });\n // Set initial value\n node.setProp(\n key,\n propvalue.selector(propvalue.value.current) as P[typeof key]\n );\n } else {\n // Set initial value\n node.setProp(key, propvalue as P[typeof key]);\n }\n });\n\n return nodePropSubscriptions;\n};\n"],"mappings":";;;;;;;AAIA;;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AGL,CAAD,IAAO;UACd5B,IAAI,CAAC6C,OAAL,CAAaJ,GAAb,EAAkBb,CAAlB;QACD;MAJwB,CAA3B,EAFsB,CAQtB;;MACA5B,IAAI,CAAC6C,OAAL,CAAaJ,GAAb,EAAmBC,SAAD,CAAwCI,OAA1D;IACD,CAVD,MAUO,IAAI,IAAAC,sBAAA,EAAWL,SAAX,CAAJ,EAA2B;MAChC;MACAH,qBAAqB,CAACK,IAAtB,CAA2B;QACzBlB,KAAK,EAAEgB,SAAS,CAAChB,KADQ;QAEzBO,OAAO,EAAGL,CAAD,IAAO;UACd5B,IAAI,CAAC6C,OAAL,CAAaJ,GAAb,EAAkBC,SAAS,CAACM,QAAV,CAAmBpB,CAAnB,CAAlB;QACD;MAJwB,CAA3B,EAFgC,CAQhC;;MACA5B,IAAI,CAAC6C,OAAL,CACEJ,GADF,EAEEC,SAAS,CAACM,QAAV,CAAmBN,SAAS,CAAChB,KAAV,CAAgBoB,OAAnC,CAFF;IAID,CAbM,MAaA;MACL;MACA9C,IAAI,CAAC6C,OAAL,CAAaJ,GAAb,EAAkBC,SAAlB;IACD;EACF,CAjCD;EAmCA,OAAOH,qBAAP;AACD,CA7CD"}
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
1
+ {"version":3,"names":[],"sources":["DrawingContext.ts"],"sourcesContent":["import type { RefObject } from \"react\";\n\nimport type { DrawingInfo, SkiaView } from \"../views\";\nimport type { SkCanvas, SkPaint, Skia, Vector } from \"../skia/types\";\n\nexport interface DrawingContext extends Omit<DrawingInfo, \"touches\"> {\n canvas: SkCanvas;\n paint: SkPaint;\n opacity: number;\n center: Vector;\n ref: RefObject<SkiaView>;\n Skia: Skia;\n}\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"sources":["HostComponents.ts"],"names":["createNode","container","type","props","Sk","NodeType","Group","Paint","Fill","Image","Circle","Path","Drawing","CustomDrawing","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"],"mappings":";;;;;;;AAEA;;AA0DA;;AAgFO,MAAMA,UAAU,GAAG,CACxBC,SADwB,EAExBC,IAFwB,EAIxBC,KAJwB,KAKrB;AACH,QAAM;AAAEC,IAAAA;AAAF,MAASH,SAAf;;AACA,UAAQC,IAAR;AACE,SAAKG,gBAASC,KAAd;AACE,aAAOF,EAAE,CAACE,KAAH,CAASH,KAAT,CAAP;;AACF,SAAKE,gBAASE,KAAd;AACE,aAAOH,EAAE,CAACG,KAAH,CAASJ,KAAT,CAAP;AACF;;AACA,SAAKE,gBAASG,IAAd;AACE,aAAOJ,EAAE,CAACI,IAAH,CAAQL,KAAR,CAAP;;AACF,SAAKE,gBAASI,KAAd;AACE,aAAOL,EAAE,CAACK,KAAH,CAASN,KAAT,CAAP;;AACF,SAAKE,gBAASK,MAAd;AACE,aAAON,EAAE,CAACM,MAAH,CAAUP,KAAV,CAAP;;AACF,SAAKE,gBAASM,IAAd;AACE,aAAOP,EAAE,CAACO,IAAH,CAAQR,KAAR,CAAP;;AACF,SAAKE,gBAASO,OAAd;AACE,aAAOR,EAAE,CAACS,aAAH,CAAiBV,KAAjB,CAAP;;AACF,SAAKE,gBAASS,IAAd;AACE,aAAOV,EAAE,CAACU,IAAH,CAAQX,KAAR,CAAP;;AACF,SAAKE,gBAASU,IAAd;AACE,aAAOX,E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EAAE,CAACwD,GAAH,CAAOzD,KAAP,CAAP;;AACF,SAAKE,gBAASwD,SAAd;AACE,aAAOzD,EAAE,CAACyD,SAAH,CAAa1D,KAAb,CAAP;;AACF;AACE,aAAO,gCAAgBD,IAAhB,CAAP;AAvHJ;AAyHD,CAhIM","sourcesContent":["import type { ForwardedRef } from \"react\";\n\nimport { NodeType } from \"../dom/types\";\nimport type {\n CircleProps,\n DrawingNodeProps,\n ImageProps,\n PaintProps,\n PathProps,\n CustomDrawingNodeProps,\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} from \"../dom/types\";\nimport type { ChildrenProps } from \"../dom/types/Common\";\nimport type {\n BlendProps,\n MorphologyImageFilterProps,\n} from \"../dom/types/ImageFilters\";\nimport type { PaintNode } from \"../dom/nodes/PaintNode\";\n\nimport type { Container } from \"./Container\";\nimport { exhaustiveCheck } from \"./typeddash\";\nimport type { SkiaProps } from \"./processors\";\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace JSX {\n interface IntrinsicElements {\n skGroup: SkiaProps<GroupProps>;\n skPaint: SkiaProps<PaintProps> & { ref: ForwardedRef<PaintNode> };\n\n // Drawings\n skFill: SkiaProps<DrawingNodeProps>;\n skImage: SkiaProps<ImageProps>;\n skCircle: SkiaProps<CircleProps>;\n skPath: SkiaProps<PathProps>;\n skDrawing: SkiaProps<CustomDrawingNodeProps>;\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<TurbulenceProps>;\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 }\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.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.Drawing:\n return Sk.CustomDrawing(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 default:\n return exhaustiveCheck(type);\n }\n};\n"]}
1
+ {"version":3,"names":["createNode","container","type","props","Sk","NodeType","Group","Paint","Fill","Image","Circle","Path","Drawing","CustomDrawing","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","exhaustiveCheck"],"sources":["HostComponents.ts"],"sourcesContent":["import type { ForwardedRef } from \"react\";\n\nimport { NodeType } from \"../dom/types\";\nimport type {\n CircleProps,\n DrawingNodeProps,\n ImageProps,\n PaintProps,\n PathProps,\n CustomDrawingNodeProps,\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} from \"../dom/types\";\nimport type { ChildrenProps } from \"../dom/types/Common\";\nimport type {\n BlendProps,\n MorphologyImageFilterProps,\n} from \"../dom/types/ImageFilters\";\nimport type { PaintNode } from \"../dom/nodes/PaintNode\";\n\nimport type { Container } from \"./Container\";\nimport { exhaustiveCheck } from \"./typeddash\";\nimport type { SkiaProps } from \"./processors\";\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace JSX {\n interface IntrinsicElements {\n skGroup: SkiaProps<GroupProps>;\n skPaint: SkiaProps<PaintProps> & { ref: ForwardedRef<PaintNode> };\n\n // Drawings\n skFill: SkiaProps<DrawingNodeProps>;\n skImage: SkiaProps<ImageProps>;\n skCircle: SkiaProps<CircleProps>;\n skPath: SkiaProps<PathProps>;\n skDrawing: SkiaProps<CustomDrawingNodeProps>;\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<TurbulenceProps>;\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 }\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.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.Drawing:\n return Sk.CustomDrawing(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 default:\n return exhaustiveCheck(type);\n }\n};\n"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AAgB5D,IAAhB,CAAP;EAvHJ;AAyHD,CAhIM"}
@@ -11,8 +11,6 @@ var _processors = require("./processors");
11
11
 
12
12
  var _typeddash = require("./typeddash");
13
13
 
14
- /* eslint-disable @typescript-eslint/no-explicit-any */
15
-
16
14
  /*global NodeJS*/
17
15
  const DEBUG = false;
18
16