@shopify/react-native-skia 0.1.149 → 0.1.151

Sign up to get free protection for your applications and to get access to all the features.
Files changed (703) hide show
  1. package/lib/commonjs/animation/decay/decay.js.map +1 -1
  2. package/lib/commonjs/animation/decay/index.js.map +1 -1
  3. package/lib/commonjs/animation/decay/runDecay.js.map +1 -1
  4. package/lib/commonjs/animation/decay/types.js.map +1 -1
  5. package/lib/commonjs/animation/functions/index.js.map +1 -1
  6. package/lib/commonjs/animation/functions/interpolate.js.map +1 -1
  7. package/lib/commonjs/animation/functions/interpolateColors.js.map +1 -1
  8. package/lib/commonjs/animation/functions/interpolatePaths.js.map +1 -1
  9. package/lib/commonjs/animation/functions/interpolateVector.js.map +1 -1
  10. package/lib/commonjs/animation/index.js.map +1 -1
  11. package/lib/commonjs/animation/spring/Spring.js.map +1 -1
  12. package/lib/commonjs/animation/spring/functions/index.js.map +1 -1
  13. package/lib/commonjs/animation/spring/functions/spring.js.map +1 -1
  14. package/lib/commonjs/animation/spring/index.js.map +1 -1
  15. package/lib/commonjs/animation/spring/runSpring.js +1 -1
  16. package/lib/commonjs/animation/spring/runSpring.js.map +1 -1
  17. package/lib/commonjs/animation/spring/types.js.map +1 -1
  18. package/lib/commonjs/animation/spring/useSpring.js +1 -1
  19. package/lib/commonjs/animation/spring/useSpring.js.map +1 -1
  20. package/lib/commonjs/animation/timing/Easing.js.map +1 -1
  21. package/lib/commonjs/animation/timing/createTiming.js +2 -6
  22. package/lib/commonjs/animation/timing/createTiming.js.map +1 -1
  23. package/lib/commonjs/animation/timing/functions/bezier.js.map +1 -1
  24. package/lib/commonjs/animation/timing/functions/getResolvedParams.js +6 -10
  25. package/lib/commonjs/animation/timing/functions/getResolvedParams.js.map +1 -1
  26. package/lib/commonjs/animation/timing/functions/index.js.map +1 -1
  27. package/lib/commonjs/animation/timing/functions/timing.js.map +1 -1
  28. package/lib/commonjs/animation/timing/functions/types.js.map +1 -1
  29. package/lib/commonjs/animation/timing/index.js.map +1 -1
  30. package/lib/commonjs/animation/timing/runTiming.js.map +1 -1
  31. package/lib/commonjs/animation/timing/useLoop.js.map +1 -1
  32. package/lib/commonjs/animation/timing/useTiming.js +1 -3
  33. package/lib/commonjs/animation/timing/useTiming.js.map +1 -1
  34. package/lib/commonjs/animation/types.js.map +1 -1
  35. package/lib/commonjs/dom/nodes/DrawingNode.js.map +1 -1
  36. package/lib/commonjs/dom/nodes/GroupNode.js.map +1 -1
  37. package/lib/commonjs/dom/nodes/JsiSkDOM.js +1 -1
  38. package/lib/commonjs/dom/nodes/JsiSkDOM.js.map +1 -1
  39. package/lib/commonjs/dom/nodes/Node.js.map +1 -1
  40. package/lib/commonjs/dom/nodes/PaintContext.js.map +1 -1
  41. package/lib/commonjs/dom/nodes/PaintNode.js.map +1 -1
  42. package/lib/commonjs/dom/nodes/RenderNode.js.map +1 -1
  43. package/lib/commonjs/dom/nodes/datatypes/Circle.js.map +1 -1
  44. package/lib/commonjs/dom/nodes/datatypes/Color.js.map +1 -1
  45. package/lib/commonjs/dom/nodes/datatypes/Enum.js.map +1 -1
  46. package/lib/commonjs/dom/nodes/datatypes/Fitting.js.map +1 -1
  47. package/lib/commonjs/dom/nodes/datatypes/Gradient.js +2 -2
  48. package/lib/commonjs/dom/nodes/datatypes/Gradient.js.map +1 -1
  49. package/lib/commonjs/dom/nodes/datatypes/Path.js.map +1 -1
  50. package/lib/commonjs/dom/nodes/datatypes/Radius.js.map +1 -1
  51. package/lib/commonjs/dom/nodes/datatypes/Rect.js.map +1 -1
  52. package/lib/commonjs/dom/nodes/datatypes/Transform.js.map +1 -1
  53. package/lib/commonjs/dom/nodes/datatypes/index.js.map +1 -1
  54. package/lib/commonjs/dom/nodes/drawings/BackdropFilterNode.js.map +1 -1
  55. package/lib/commonjs/dom/nodes/drawings/Box.js.map +1 -1
  56. package/lib/commonjs/dom/nodes/drawings/CircleNode.js.map +1 -1
  57. package/lib/commonjs/dom/nodes/drawings/CustomDrawingNode.js.map +1 -1
  58. package/lib/commonjs/dom/nodes/drawings/DiffRectNode.js.map +1 -1
  59. package/lib/commonjs/dom/nodes/drawings/FillNode.js.map +1 -1
  60. package/lib/commonjs/dom/nodes/drawings/ImageNode.js.map +1 -1
  61. package/lib/commonjs/dom/nodes/drawings/ImageSVG.js.map +1 -1
  62. package/lib/commonjs/dom/nodes/drawings/LineNode.js.map +1 -1
  63. package/lib/commonjs/dom/nodes/drawings/OvalNode.js.map +1 -1
  64. package/lib/commonjs/dom/nodes/drawings/PatchNode.js.map +1 -1
  65. package/lib/commonjs/dom/nodes/drawings/PathNode.js.map +1 -1
  66. package/lib/commonjs/dom/nodes/drawings/PictureNode.js.map +1 -1
  67. package/lib/commonjs/dom/nodes/drawings/PointsNode.js.map +1 -1
  68. package/lib/commonjs/dom/nodes/drawings/RRectNode.js.map +1 -1
  69. package/lib/commonjs/dom/nodes/drawings/RectNode.js.map +1 -1
  70. package/lib/commonjs/dom/nodes/drawings/Text.js.map +1 -1
  71. package/lib/commonjs/dom/nodes/drawings/VerticesNode.js.map +1 -1
  72. package/lib/commonjs/dom/nodes/drawings/index.js.map +1 -1
  73. package/lib/commonjs/dom/nodes/index.js.map +1 -1
  74. package/lib/commonjs/dom/nodes/paint/BlendNode.js.map +1 -1
  75. package/lib/commonjs/dom/nodes/paint/ColorFilters.js.map +1 -1
  76. package/lib/commonjs/dom/nodes/paint/ImageFilters.js.map +1 -1
  77. package/lib/commonjs/dom/nodes/paint/MaskFilters.js.map +1 -1
  78. package/lib/commonjs/dom/nodes/paint/PathEffects.js.map +1 -1
  79. package/lib/commonjs/dom/nodes/paint/Shaders.js +2 -4
  80. package/lib/commonjs/dom/nodes/paint/Shaders.js.map +1 -1
  81. package/lib/commonjs/dom/nodes/paint/index.js.map +1 -1
  82. package/lib/commonjs/dom/types/ColorFilters.js.map +1 -1
  83. package/lib/commonjs/dom/types/Common.js.map +1 -1
  84. package/lib/commonjs/dom/types/DrawingContext.js.map +1 -1
  85. package/lib/commonjs/dom/types/Drawings.js.map +1 -1
  86. package/lib/commonjs/dom/types/ImageFilters.js.map +1 -1
  87. package/lib/commonjs/dom/types/MaskFilters.js.map +1 -1
  88. package/lib/commonjs/dom/types/Node.js.map +1 -1
  89. package/lib/commonjs/dom/types/NodeType.js.map +1 -1
  90. package/lib/commonjs/dom/types/PathEffects.js.map +1 -1
  91. package/lib/commonjs/dom/types/Shaders.js.map +1 -1
  92. package/lib/commonjs/dom/types/SkDOM.js.map +1 -1
  93. package/lib/commonjs/dom/types/index.js.map +1 -1
  94. package/lib/commonjs/external/index.js.map +1 -1
  95. package/lib/commonjs/external/reanimated/index.js.map +1 -1
  96. package/lib/commonjs/external/reanimated/useSharedValueEffect.js.map +1 -1
  97. package/lib/commonjs/index.js.map +1 -1
  98. package/lib/commonjs/mock/index.js +7 -10
  99. package/lib/commonjs/mock/index.js.map +1 -1
  100. package/lib/commonjs/renderer/Canvas.js.map +1 -1
  101. package/lib/commonjs/renderer/Container.js.map +1 -1
  102. package/lib/commonjs/renderer/DependencyManager.js.map +1 -1
  103. package/lib/commonjs/renderer/DrawingContext.js.map +1 -1
  104. package/lib/commonjs/renderer/HostComponents.js.map +1 -1
  105. package/lib/commonjs/renderer/HostConfig.js +0 -2
  106. package/lib/commonjs/renderer/HostConfig.js.map +1 -1
  107. package/lib/commonjs/renderer/components/Blend.js.map +1 -1
  108. package/lib/commonjs/renderer/components/Drawing.js.map +1 -1
  109. package/lib/commonjs/renderer/components/Group.js.map +1 -1
  110. package/lib/commonjs/renderer/components/Mask.js.map +1 -1
  111. package/lib/commonjs/renderer/components/Paint.js +1 -1
  112. package/lib/commonjs/renderer/components/Paint.js.map +1 -1
  113. package/lib/commonjs/renderer/components/Picture.js.map +1 -1
  114. package/lib/commonjs/renderer/components/backdrop/BackdropBlur.js +1 -1
  115. package/lib/commonjs/renderer/components/backdrop/BackdropBlur.js.map +1 -1
  116. package/lib/commonjs/renderer/components/backdrop/BackdropFilter.js.map +1 -1
  117. package/lib/commonjs/renderer/components/backdrop/index.js.map +1 -1
  118. package/lib/commonjs/renderer/components/colorFilters/BlendColor.js.map +1 -1
  119. package/lib/commonjs/renderer/components/colorFilters/Lerp.js.map +1 -1
  120. package/lib/commonjs/renderer/components/colorFilters/LinearToSRGBGamma.js.map +1 -1
  121. package/lib/commonjs/renderer/components/colorFilters/LumaColorFilter.js.map +1 -1
  122. package/lib/commonjs/renderer/components/colorFilters/Matrix.js.map +1 -1
  123. package/lib/commonjs/renderer/components/colorFilters/SRGBToLinearGamma.js.map +1 -1
  124. package/lib/commonjs/renderer/components/colorFilters/index.js.map +1 -1
  125. package/lib/commonjs/renderer/components/image/Image.js.map +1 -1
  126. package/lib/commonjs/renderer/components/image/ImageSVG.js.map +1 -1
  127. package/lib/commonjs/renderer/components/image/ImageShader.js.map +1 -1
  128. package/lib/commonjs/renderer/components/image/index.js.map +1 -1
  129. package/lib/commonjs/renderer/components/imageFilters/Blur.js.map +1 -1
  130. package/lib/commonjs/renderer/components/imageFilters/DisplacementMap.js.map +1 -1
  131. package/lib/commonjs/renderer/components/imageFilters/Morphology.js.map +1 -1
  132. package/lib/commonjs/renderer/components/imageFilters/Offset.js.map +1 -1
  133. package/lib/commonjs/renderer/components/imageFilters/RuntimeShader.js.map +1 -1
  134. package/lib/commonjs/renderer/components/imageFilters/Shadow.js.map +1 -1
  135. package/lib/commonjs/renderer/components/imageFilters/index.js.map +1 -1
  136. package/lib/commonjs/renderer/components/index.js.map +1 -1
  137. package/lib/commonjs/renderer/components/maskFilters/Blur.js.map +1 -1
  138. package/lib/commonjs/renderer/components/maskFilters/index.js.map +1 -1
  139. package/lib/commonjs/renderer/components/pathEffects/Corner.js.map +1 -1
  140. package/lib/commonjs/renderer/components/pathEffects/Dash.js.map +1 -1
  141. package/lib/commonjs/renderer/components/pathEffects/Discrete.js.map +1 -1
  142. package/lib/commonjs/renderer/components/pathEffects/Line2D.js.map +1 -1
  143. package/lib/commonjs/renderer/components/pathEffects/Path1D.js.map +1 -1
  144. package/lib/commonjs/renderer/components/pathEffects/Path2D.js.map +1 -1
  145. package/lib/commonjs/renderer/components/pathEffects/Sum.js.map +1 -1
  146. package/lib/commonjs/renderer/components/pathEffects/index.js.map +1 -1
  147. package/lib/commonjs/renderer/components/shaders/Color.js.map +1 -1
  148. package/lib/commonjs/renderer/components/shaders/FractalNoise.js.map +1 -1
  149. package/lib/commonjs/renderer/components/shaders/LinearGradient.js.map +1 -1
  150. package/lib/commonjs/renderer/components/shaders/RadialGradient.js.map +1 -1
  151. package/lib/commonjs/renderer/components/shaders/Shader.js.map +1 -1
  152. package/lib/commonjs/renderer/components/shaders/ShaderLib.js.map +1 -1
  153. package/lib/commonjs/renderer/components/shaders/SweepGradient.js.map +1 -1
  154. package/lib/commonjs/renderer/components/shaders/Turbulence.js.map +1 -1
  155. package/lib/commonjs/renderer/components/shaders/TwoPointConicalGradient.js.map +1 -1
  156. package/lib/commonjs/renderer/components/shaders/index.js.map +1 -1
  157. package/lib/commonjs/renderer/components/shapes/Box.js.map +1 -1
  158. package/lib/commonjs/renderer/components/shapes/Circle.js.map +1 -1
  159. package/lib/commonjs/renderer/components/shapes/DiffRect.js.map +1 -1
  160. package/lib/commonjs/renderer/components/shapes/Fill.js.map +1 -1
  161. package/lib/commonjs/renderer/components/shapes/FitBox.js.map +1 -1
  162. package/lib/commonjs/renderer/components/shapes/Line.js.map +1 -1
  163. package/lib/commonjs/renderer/components/shapes/Oval.js.map +1 -1
  164. package/lib/commonjs/renderer/components/shapes/Patch.js.map +1 -1
  165. package/lib/commonjs/renderer/components/shapes/Path.js.map +1 -1
  166. package/lib/commonjs/renderer/components/shapes/Points.js.map +1 -1
  167. package/lib/commonjs/renderer/components/shapes/Rect.js.map +1 -1
  168. package/lib/commonjs/renderer/components/shapes/RoundedRect.js.map +1 -1
  169. package/lib/commonjs/renderer/components/shapes/Vertices.js.map +1 -1
  170. package/lib/commonjs/renderer/components/shapes/index.js.map +1 -1
  171. package/lib/commonjs/renderer/components/text/Glyphs.js.map +1 -1
  172. package/lib/commonjs/renderer/components/text/Text.js.map +1 -1
  173. package/lib/commonjs/renderer/components/text/TextBlob.js.map +1 -1
  174. package/lib/commonjs/renderer/components/text/TextPath.js.map +1 -1
  175. package/lib/commonjs/renderer/components/text/index.js.map +1 -1
  176. package/lib/commonjs/renderer/index.js.map +1 -1
  177. package/lib/commonjs/renderer/processors/Animations/Animations.js.map +1 -1
  178. package/lib/commonjs/renderer/processors/Animations/index.js.map +1 -1
  179. package/lib/commonjs/renderer/processors/index.js.map +1 -1
  180. package/lib/commonjs/renderer/processors/math/Coordinates.js.map +1 -1
  181. package/lib/commonjs/renderer/processors/math/Math.js.map +1 -1
  182. package/lib/commonjs/renderer/processors/math/Transforms.js.map +1 -1
  183. package/lib/commonjs/renderer/processors/math/index.js.map +1 -1
  184. package/lib/commonjs/renderer/typeddash.js.map +1 -1
  185. package/lib/commonjs/renderer/useCanvas.js.map +1 -1
  186. package/lib/commonjs/renderer/useContextBridge.js.map +1 -1
  187. package/lib/commonjs/skia/NativeSetup.js.map +1 -1
  188. package/lib/commonjs/skia/Skia.js.map +1 -1
  189. package/lib/commonjs/skia/Skia.web.js.map +1 -1
  190. package/lib/commonjs/skia/core/Data.js.map +1 -1
  191. package/lib/commonjs/skia/core/Font.js.map +1 -1
  192. package/lib/commonjs/skia/core/Image.js.map +1 -1
  193. package/lib/commonjs/skia/core/Matrix.js.map +1 -1
  194. package/lib/commonjs/skia/core/Picture.js +20 -2
  195. package/lib/commonjs/skia/core/Picture.js.map +1 -1
  196. package/lib/commonjs/skia/core/RRect.js.map +1 -1
  197. package/lib/commonjs/skia/core/Rect.js.map +1 -1
  198. package/lib/commonjs/skia/core/SVG.js.map +1 -1
  199. package/lib/commonjs/skia/core/Typeface.js.map +1 -1
  200. package/lib/commonjs/skia/core/Vector.js +1 -1
  201. package/lib/commonjs/skia/core/Vector.js.map +1 -1
  202. package/lib/commonjs/skia/core/index.js.map +1 -1
  203. package/lib/commonjs/skia/index.js.map +1 -1
  204. package/lib/commonjs/skia/types/Canvas.js.map +1 -1
  205. package/lib/commonjs/skia/types/Color.js.map +1 -1
  206. package/lib/commonjs/skia/types/ColorFilter/ColorFilter.js.map +1 -1
  207. package/lib/commonjs/skia/types/ColorFilter/ColorFilterFactory.js.map +1 -1
  208. package/lib/commonjs/skia/types/ColorFilter/index.js.map +1 -1
  209. package/lib/commonjs/skia/types/ContourMeasure.js.map +1 -1
  210. package/lib/commonjs/skia/types/Data/Data.js.map +1 -1
  211. package/lib/commonjs/skia/types/Data/DataFactory.js.map +1 -1
  212. package/lib/commonjs/skia/types/Data/index.js.map +1 -1
  213. package/lib/commonjs/skia/types/Font/Font.js.map +1 -1
  214. package/lib/commonjs/skia/types/Font/index.js.map +1 -1
  215. package/lib/commonjs/skia/types/Image/Image.js.map +1 -1
  216. package/lib/commonjs/skia/types/Image/ImageFactory.js.map +1 -1
  217. package/lib/commonjs/skia/types/Image/index.js.map +1 -1
  218. package/lib/commonjs/skia/types/ImageFilter/ImageFilter.js.map +1 -1
  219. package/lib/commonjs/skia/types/ImageFilter/ImageFilterFactory.js.map +1 -1
  220. package/lib/commonjs/skia/types/ImageFilter/index.js.map +1 -1
  221. package/lib/commonjs/skia/types/JsiInstance.js.map +1 -1
  222. package/lib/commonjs/skia/types/MaskFilter.js.map +1 -1
  223. package/lib/commonjs/skia/types/Matrix.js.map +1 -1
  224. package/lib/commonjs/skia/types/Paint/BlendMode.js.map +1 -1
  225. package/lib/commonjs/skia/types/Paint/Paint.js.map +1 -1
  226. package/lib/commonjs/skia/types/Paint/index.js.map +1 -1
  227. package/lib/commonjs/skia/types/Path/Path.js.map +1 -1
  228. package/lib/commonjs/skia/types/Path/PathFactory.js.map +1 -1
  229. package/lib/commonjs/skia/types/Path/index.js.map +1 -1
  230. package/lib/commonjs/skia/types/PathEffect.js.map +1 -1
  231. package/lib/commonjs/skia/types/Picture/Picture.js.map +1 -1
  232. package/lib/commonjs/skia/types/Picture/PictureFactory.js.map +1 -1
  233. package/lib/commonjs/skia/types/Picture/PictureRecorder.js.map +1 -1
  234. package/lib/commonjs/skia/types/Picture/index.js.map +1 -1
  235. package/lib/commonjs/skia/types/Point.js.map +1 -1
  236. package/lib/commonjs/skia/types/RRect.js.map +1 -1
  237. package/lib/commonjs/skia/types/RSXform.js.map +1 -1
  238. package/lib/commonjs/skia/types/Rect.js.map +1 -1
  239. package/lib/commonjs/skia/types/RuntimeEffect/RuntimeEffect.js.map +1 -1
  240. package/lib/commonjs/skia/types/RuntimeEffect/RuntimeEffectFactory.js.map +1 -1
  241. package/lib/commonjs/skia/types/RuntimeEffect/index.js.map +1 -1
  242. package/lib/commonjs/skia/types/SVG/SVG.js.map +1 -1
  243. package/lib/commonjs/skia/types/SVG/SVGFactory.js.map +1 -1
  244. package/lib/commonjs/skia/types/SVG/index.js.map +1 -1
  245. package/lib/commonjs/skia/types/Shader/Shader.js.map +1 -1
  246. package/lib/commonjs/skia/types/Shader/ShaderFactory.js.map +1 -1
  247. package/lib/commonjs/skia/types/Shader/index.js.map +1 -1
  248. package/lib/commonjs/skia/types/Skia.js.map +1 -1
  249. package/lib/commonjs/skia/types/Surface/Surface.js.map +1 -1
  250. package/lib/commonjs/skia/types/Surface/SurfaceFactory.js.map +1 -1
  251. package/lib/commonjs/skia/types/Surface/index.js.map +1 -1
  252. package/lib/commonjs/skia/types/TextBlob.js.map +1 -1
  253. package/lib/commonjs/skia/types/Typeface/Typeface.js.map +1 -1
  254. package/lib/commonjs/skia/types/Typeface/TypefaceFactory.js.map +1 -1
  255. package/lib/commonjs/skia/types/Typeface/index.js.map +1 -1
  256. package/lib/commonjs/skia/types/Vertices/Vertices.js.map +1 -1
  257. package/lib/commonjs/skia/types/Vertices/index.js.map +1 -1
  258. package/lib/commonjs/skia/types/index.js.map +1 -1
  259. package/lib/commonjs/skia/web/Host.js +1 -1
  260. package/lib/commonjs/skia/web/Host.js.map +1 -1
  261. package/lib/commonjs/skia/web/JsiSkCanvas.js.map +1 -1
  262. package/lib/commonjs/skia/web/JsiSkColor.js.map +1 -1
  263. package/lib/commonjs/skia/web/JsiSkColorFilter.js.map +1 -1
  264. package/lib/commonjs/skia/web/JsiSkColorFilterFactory.js.map +1 -1
  265. package/lib/commonjs/skia/web/JsiSkContourMeasure.js.map +1 -1
  266. package/lib/commonjs/skia/web/JsiSkContourMeasureIter.js.map +1 -1
  267. package/lib/commonjs/skia/web/JsiSkData.js.map +1 -1
  268. package/lib/commonjs/skia/web/JsiSkDataFactory.js.map +1 -1
  269. package/lib/commonjs/skia/web/JsiSkFont.js.map +1 -1
  270. package/lib/commonjs/skia/web/JsiSkImage.js.map +1 -1
  271. package/lib/commonjs/skia/web/JsiSkImageFactory.js.map +1 -1
  272. package/lib/commonjs/skia/web/JsiSkImageFilter.js.map +1 -1
  273. package/lib/commonjs/skia/web/JsiSkImageFilterFactory.js.map +1 -1
  274. package/lib/commonjs/skia/web/JsiSkMaskFilter.js.map +1 -1
  275. package/lib/commonjs/skia/web/JsiSkMaskFilterFactory.js.map +1 -1
  276. package/lib/commonjs/skia/web/JsiSkMatrix.js +1 -1
  277. package/lib/commonjs/skia/web/JsiSkMatrix.js.map +1 -1
  278. package/lib/commonjs/skia/web/JsiSkPaint.js.map +1 -1
  279. package/lib/commonjs/skia/web/JsiSkPath.js.map +1 -1
  280. package/lib/commonjs/skia/web/JsiSkPathEffect.js.map +1 -1
  281. package/lib/commonjs/skia/web/JsiSkPathEffectFactory.js.map +1 -1
  282. package/lib/commonjs/skia/web/JsiSkPathFactory.js.map +1 -1
  283. package/lib/commonjs/skia/web/JsiSkPicture.js.map +1 -1
  284. package/lib/commonjs/skia/web/JsiSkPictureFactory.js.map +1 -1
  285. package/lib/commonjs/skia/web/JsiSkPictureRecorder.js.map +1 -1
  286. package/lib/commonjs/skia/web/JsiSkPoint.js.map +1 -1
  287. package/lib/commonjs/skia/web/JsiSkRRect.js.map +1 -1
  288. package/lib/commonjs/skia/web/JsiSkRSXform.js.map +1 -1
  289. package/lib/commonjs/skia/web/JsiSkRect.js.map +1 -1
  290. package/lib/commonjs/skia/web/JsiSkRuntimeEffect.js.map +1 -1
  291. package/lib/commonjs/skia/web/JsiSkRuntimeEffectFactory.js.map +1 -1
  292. package/lib/commonjs/skia/web/JsiSkSVGFactory.js.map +1 -1
  293. package/lib/commonjs/skia/web/JsiSkShader.js.map +1 -1
  294. package/lib/commonjs/skia/web/JsiSkShaderFactory.js.map +1 -1
  295. package/lib/commonjs/skia/web/JsiSkSurface.js.map +1 -1
  296. package/lib/commonjs/skia/web/JsiSkSurfaceFactory.js.map +1 -1
  297. package/lib/commonjs/skia/web/JsiSkTextBlob.js.map +1 -1
  298. package/lib/commonjs/skia/web/JsiSkTextBlobFactory.js.map +1 -1
  299. package/lib/commonjs/skia/web/JsiSkTypeface.js.map +1 -1
  300. package/lib/commonjs/skia/web/JsiSkTypefaceFactory.js.map +1 -1
  301. package/lib/commonjs/skia/web/JsiSkVertices.js.map +1 -1
  302. package/lib/commonjs/skia/web/JsiSkVerticesFactory.js.map +1 -1
  303. package/lib/commonjs/skia/web/JsiSkia.js.map +1 -1
  304. package/lib/commonjs/skia/web/index.js.map +1 -1
  305. package/lib/commonjs/values/api.js.map +1 -1
  306. package/lib/commonjs/values/api.web.js.map +1 -1
  307. package/lib/commonjs/values/hooks/index.js.map +1 -1
  308. package/lib/commonjs/values/hooks/useClockValue.js.map +1 -1
  309. package/lib/commonjs/values/hooks/useComputedValue.js.map +1 -1
  310. package/lib/commonjs/values/hooks/useValue.js.map +1 -1
  311. package/lib/commonjs/values/hooks/useValueEffect.js.map +1 -1
  312. package/lib/commonjs/values/index.js.map +1 -1
  313. package/lib/commonjs/values/selector.js.map +1 -1
  314. package/lib/commonjs/values/types.js.map +1 -1
  315. package/lib/commonjs/values/web/RNSkAnimation.js +2 -2
  316. package/lib/commonjs/values/web/RNSkAnimation.js.map +1 -1
  317. package/lib/commonjs/values/web/RNSkClockValue.js.map +1 -1
  318. package/lib/commonjs/values/web/RNSkComputedValue.js +1 -1
  319. package/lib/commonjs/values/web/RNSkComputedValue.js.map +1 -1
  320. package/lib/commonjs/values/web/RNSkReadonlyValue.js.map +1 -1
  321. package/lib/commonjs/values/web/RNSkValue.js.map +1 -1
  322. package/lib/commonjs/values/web/api.js.map +1 -1
  323. package/lib/commonjs/values/web/index.js.map +1 -1
  324. package/lib/commonjs/views/SkiaView.js +1 -1
  325. package/lib/commonjs/views/SkiaView.js.map +1 -1
  326. package/lib/commonjs/views/SkiaView.web.js +2 -4
  327. package/lib/commonjs/views/SkiaView.web.js.map +1 -1
  328. package/lib/commonjs/views/api.js.map +1 -1
  329. package/lib/commonjs/views/index.js.map +1 -1
  330. package/lib/commonjs/views/types.js.map +1 -1
  331. package/lib/commonjs/views/useDrawCallback.js.map +1 -1
  332. package/lib/commonjs/views/useTouchHandler.js +6 -6
  333. package/lib/commonjs/views/useTouchHandler.js.map +1 -1
  334. package/lib/commonjs/web/LoadSkiaWeb.js.map +1 -1
  335. package/lib/commonjs/web/WithSkiaWeb.js +1 -1
  336. package/lib/commonjs/web/WithSkiaWeb.js.map +1 -1
  337. package/lib/commonjs/web/index.js.map +1 -1
  338. package/lib/module/animation/decay/decay.js.map +1 -1
  339. package/lib/module/animation/decay/index.js.map +1 -1
  340. package/lib/module/animation/decay/runDecay.js.map +1 -1
  341. package/lib/module/animation/decay/types.js.map +1 -1
  342. package/lib/module/animation/functions/index.js.map +1 -1
  343. package/lib/module/animation/functions/interpolate.js.map +1 -1
  344. package/lib/module/animation/functions/interpolateColors.js.map +1 -1
  345. package/lib/module/animation/functions/interpolatePaths.js.map +1 -1
  346. package/lib/module/animation/functions/interpolateVector.js.map +1 -1
  347. package/lib/module/animation/index.js.map +1 -1
  348. package/lib/module/animation/spring/Spring.js.map +1 -1
  349. package/lib/module/animation/spring/functions/index.js.map +1 -1
  350. package/lib/module/animation/spring/functions/spring.js.map +1 -1
  351. package/lib/module/animation/spring/index.js.map +1 -1
  352. package/lib/module/animation/spring/runSpring.js +1 -1
  353. package/lib/module/animation/spring/runSpring.js.map +1 -1
  354. package/lib/module/animation/spring/types.js.map +1 -1
  355. package/lib/module/animation/spring/useSpring.js +1 -1
  356. package/lib/module/animation/spring/useSpring.js.map +1 -1
  357. package/lib/module/animation/timing/Easing.js.map +1 -1
  358. package/lib/module/animation/timing/createTiming.js +2 -6
  359. package/lib/module/animation/timing/createTiming.js.map +1 -1
  360. package/lib/module/animation/timing/functions/bezier.js.map +1 -1
  361. package/lib/module/animation/timing/functions/getResolvedParams.js +6 -10
  362. package/lib/module/animation/timing/functions/getResolvedParams.js.map +1 -1
  363. package/lib/module/animation/timing/functions/index.js.map +1 -1
  364. package/lib/module/animation/timing/functions/timing.js.map +1 -1
  365. package/lib/module/animation/timing/functions/types.js.map +1 -1
  366. package/lib/module/animation/timing/index.js.map +1 -1
  367. package/lib/module/animation/timing/runTiming.js.map +1 -1
  368. package/lib/module/animation/timing/useLoop.js.map +1 -1
  369. package/lib/module/animation/timing/useTiming.js +1 -3
  370. package/lib/module/animation/timing/useTiming.js.map +1 -1
  371. package/lib/module/animation/types.js.map +1 -1
  372. package/lib/module/dom/nodes/DrawingNode.js.map +1 -1
  373. package/lib/module/dom/nodes/GroupNode.js.map +1 -1
  374. package/lib/module/dom/nodes/JsiSkDOM.js +1 -1
  375. package/lib/module/dom/nodes/JsiSkDOM.js.map +1 -1
  376. package/lib/module/dom/nodes/Node.js.map +1 -1
  377. package/lib/module/dom/nodes/PaintContext.js.map +1 -1
  378. package/lib/module/dom/nodes/PaintNode.js.map +1 -1
  379. package/lib/module/dom/nodes/RenderNode.js.map +1 -1
  380. package/lib/module/dom/nodes/datatypes/Circle.js.map +1 -1
  381. package/lib/module/dom/nodes/datatypes/Color.js.map +1 -1
  382. package/lib/module/dom/nodes/datatypes/Enum.js.map +1 -1
  383. package/lib/module/dom/nodes/datatypes/Fitting.js.map +1 -1
  384. package/lib/module/dom/nodes/datatypes/Gradient.js +2 -2
  385. package/lib/module/dom/nodes/datatypes/Gradient.js.map +1 -1
  386. package/lib/module/dom/nodes/datatypes/Path.js.map +1 -1
  387. package/lib/module/dom/nodes/datatypes/Radius.js.map +1 -1
  388. package/lib/module/dom/nodes/datatypes/Rect.js.map +1 -1
  389. package/lib/module/dom/nodes/datatypes/Transform.js.map +1 -1
  390. package/lib/module/dom/nodes/datatypes/index.js.map +1 -1
  391. package/lib/module/dom/nodes/drawings/BackdropFilterNode.js.map +1 -1
  392. package/lib/module/dom/nodes/drawings/Box.js.map +1 -1
  393. package/lib/module/dom/nodes/drawings/CircleNode.js.map +1 -1
  394. package/lib/module/dom/nodes/drawings/CustomDrawingNode.js.map +1 -1
  395. package/lib/module/dom/nodes/drawings/DiffRectNode.js.map +1 -1
  396. package/lib/module/dom/nodes/drawings/FillNode.js.map +1 -1
  397. package/lib/module/dom/nodes/drawings/ImageNode.js.map +1 -1
  398. package/lib/module/dom/nodes/drawings/ImageSVG.js.map +1 -1
  399. package/lib/module/dom/nodes/drawings/LineNode.js.map +1 -1
  400. package/lib/module/dom/nodes/drawings/OvalNode.js.map +1 -1
  401. package/lib/module/dom/nodes/drawings/PatchNode.js.map +1 -1
  402. package/lib/module/dom/nodes/drawings/PathNode.js.map +1 -1
  403. package/lib/module/dom/nodes/drawings/PictureNode.js.map +1 -1
  404. package/lib/module/dom/nodes/drawings/PointsNode.js.map +1 -1
  405. package/lib/module/dom/nodes/drawings/RRectNode.js.map +1 -1
  406. package/lib/module/dom/nodes/drawings/RectNode.js.map +1 -1
  407. package/lib/module/dom/nodes/drawings/Text.js.map +1 -1
  408. package/lib/module/dom/nodes/drawings/VerticesNode.js.map +1 -1
  409. package/lib/module/dom/nodes/drawings/index.js.map +1 -1
  410. package/lib/module/dom/nodes/index.js.map +1 -1
  411. package/lib/module/dom/nodes/paint/BlendNode.js.map +1 -1
  412. package/lib/module/dom/nodes/paint/ColorFilters.js.map +1 -1
  413. package/lib/module/dom/nodes/paint/ImageFilters.js.map +1 -1
  414. package/lib/module/dom/nodes/paint/MaskFilters.js.map +1 -1
  415. package/lib/module/dom/nodes/paint/PathEffects.js.map +1 -1
  416. package/lib/module/dom/nodes/paint/Shaders.js +2 -4
  417. package/lib/module/dom/nodes/paint/Shaders.js.map +1 -1
  418. package/lib/module/dom/nodes/paint/index.js.map +1 -1
  419. package/lib/module/dom/types/ColorFilters.js.map +1 -1
  420. package/lib/module/dom/types/Common.js.map +1 -1
  421. package/lib/module/dom/types/DrawingContext.js.map +1 -1
  422. package/lib/module/dom/types/Drawings.js.map +1 -1
  423. package/lib/module/dom/types/ImageFilters.js.map +1 -1
  424. package/lib/module/dom/types/MaskFilters.js.map +1 -1
  425. package/lib/module/dom/types/Node.js.map +1 -1
  426. package/lib/module/dom/types/NodeType.js.map +1 -1
  427. package/lib/module/dom/types/PathEffects.js.map +1 -1
  428. package/lib/module/dom/types/Shaders.js.map +1 -1
  429. package/lib/module/dom/types/SkDOM.js.map +1 -1
  430. package/lib/module/dom/types/index.js.map +1 -1
  431. package/lib/module/external/index.js.map +1 -1
  432. package/lib/module/external/reanimated/index.js.map +1 -1
  433. package/lib/module/external/reanimated/useSharedValueEffect.js.map +1 -1
  434. package/lib/module/index.js.map +1 -1
  435. package/lib/module/mock/index.js +7 -10
  436. package/lib/module/mock/index.js.map +1 -1
  437. package/lib/module/renderer/Canvas.js.map +1 -1
  438. package/lib/module/renderer/Container.js.map +1 -1
  439. package/lib/module/renderer/DependencyManager.js.map +1 -1
  440. package/lib/module/renderer/DrawingContext.js.map +1 -1
  441. package/lib/module/renderer/HostComponents.js.map +1 -1
  442. package/lib/module/renderer/HostConfig.js +0 -2
  443. package/lib/module/renderer/HostConfig.js.map +1 -1
  444. package/lib/module/renderer/components/Blend.js.map +1 -1
  445. package/lib/module/renderer/components/Drawing.js.map +1 -1
  446. package/lib/module/renderer/components/Group.js.map +1 -1
  447. package/lib/module/renderer/components/Mask.js.map +1 -1
  448. package/lib/module/renderer/components/Paint.js +1 -1
  449. package/lib/module/renderer/components/Paint.js.map +1 -1
  450. package/lib/module/renderer/components/Picture.js.map +1 -1
  451. package/lib/module/renderer/components/backdrop/BackdropBlur.js +1 -1
  452. package/lib/module/renderer/components/backdrop/BackdropBlur.js.map +1 -1
  453. package/lib/module/renderer/components/backdrop/BackdropFilter.js.map +1 -1
  454. package/lib/module/renderer/components/backdrop/index.js.map +1 -1
  455. package/lib/module/renderer/components/colorFilters/BlendColor.js.map +1 -1
  456. package/lib/module/renderer/components/colorFilters/Lerp.js.map +1 -1
  457. package/lib/module/renderer/components/colorFilters/LinearToSRGBGamma.js.map +1 -1
  458. package/lib/module/renderer/components/colorFilters/LumaColorFilter.js.map +1 -1
  459. package/lib/module/renderer/components/colorFilters/Matrix.js.map +1 -1
  460. package/lib/module/renderer/components/colorFilters/SRGBToLinearGamma.js.map +1 -1
  461. package/lib/module/renderer/components/colorFilters/index.js.map +1 -1
  462. package/lib/module/renderer/components/image/Image.js.map +1 -1
  463. package/lib/module/renderer/components/image/ImageSVG.js.map +1 -1
  464. package/lib/module/renderer/components/image/ImageShader.js.map +1 -1
  465. package/lib/module/renderer/components/image/index.js.map +1 -1
  466. package/lib/module/renderer/components/imageFilters/Blur.js.map +1 -1
  467. package/lib/module/renderer/components/imageFilters/DisplacementMap.js.map +1 -1
  468. package/lib/module/renderer/components/imageFilters/Morphology.js.map +1 -1
  469. package/lib/module/renderer/components/imageFilters/Offset.js.map +1 -1
  470. package/lib/module/renderer/components/imageFilters/RuntimeShader.js.map +1 -1
  471. package/lib/module/renderer/components/imageFilters/Shadow.js.map +1 -1
  472. package/lib/module/renderer/components/imageFilters/index.js.map +1 -1
  473. package/lib/module/renderer/components/index.js.map +1 -1
  474. package/lib/module/renderer/components/maskFilters/Blur.js.map +1 -1
  475. package/lib/module/renderer/components/maskFilters/index.js.map +1 -1
  476. package/lib/module/renderer/components/pathEffects/Corner.js.map +1 -1
  477. package/lib/module/renderer/components/pathEffects/Dash.js.map +1 -1
  478. package/lib/module/renderer/components/pathEffects/Discrete.js.map +1 -1
  479. package/lib/module/renderer/components/pathEffects/Line2D.js.map +1 -1
  480. package/lib/module/renderer/components/pathEffects/Path1D.js.map +1 -1
  481. package/lib/module/renderer/components/pathEffects/Path2D.js.map +1 -1
  482. package/lib/module/renderer/components/pathEffects/Sum.js.map +1 -1
  483. package/lib/module/renderer/components/pathEffects/index.js.map +1 -1
  484. package/lib/module/renderer/components/shaders/Color.js.map +1 -1
  485. package/lib/module/renderer/components/shaders/FractalNoise.js.map +1 -1
  486. package/lib/module/renderer/components/shaders/LinearGradient.js.map +1 -1
  487. package/lib/module/renderer/components/shaders/RadialGradient.js.map +1 -1
  488. package/lib/module/renderer/components/shaders/Shader.js.map +1 -1
  489. package/lib/module/renderer/components/shaders/ShaderLib.js.map +1 -1
  490. package/lib/module/renderer/components/shaders/SweepGradient.js.map +1 -1
  491. package/lib/module/renderer/components/shaders/Turbulence.js.map +1 -1
  492. package/lib/module/renderer/components/shaders/TwoPointConicalGradient.js.map +1 -1
  493. package/lib/module/renderer/components/shaders/index.js.map +1 -1
  494. package/lib/module/renderer/components/shapes/Box.js.map +1 -1
  495. package/lib/module/renderer/components/shapes/Circle.js.map +1 -1
  496. package/lib/module/renderer/components/shapes/DiffRect.js.map +1 -1
  497. package/lib/module/renderer/components/shapes/Fill.js.map +1 -1
  498. package/lib/module/renderer/components/shapes/FitBox.js.map +1 -1
  499. package/lib/module/renderer/components/shapes/Line.js.map +1 -1
  500. package/lib/module/renderer/components/shapes/Oval.js.map +1 -1
  501. package/lib/module/renderer/components/shapes/Patch.js.map +1 -1
  502. package/lib/module/renderer/components/shapes/Path.js.map +1 -1
  503. package/lib/module/renderer/components/shapes/Points.js.map +1 -1
  504. package/lib/module/renderer/components/shapes/Rect.js.map +1 -1
  505. package/lib/module/renderer/components/shapes/RoundedRect.js.map +1 -1
  506. package/lib/module/renderer/components/shapes/Vertices.js.map +1 -1
  507. package/lib/module/renderer/components/shapes/index.js.map +1 -1
  508. package/lib/module/renderer/components/text/Glyphs.js.map +1 -1
  509. package/lib/module/renderer/components/text/Text.js.map +1 -1
  510. package/lib/module/renderer/components/text/TextBlob.js.map +1 -1
  511. package/lib/module/renderer/components/text/TextPath.js.map +1 -1
  512. package/lib/module/renderer/components/text/index.js.map +1 -1
  513. package/lib/module/renderer/index.js.map +1 -1
  514. package/lib/module/renderer/processors/Animations/Animations.js.map +1 -1
  515. package/lib/module/renderer/processors/Animations/index.js.map +1 -1
  516. package/lib/module/renderer/processors/index.js.map +1 -1
  517. package/lib/module/renderer/processors/math/Coordinates.js.map +1 -1
  518. package/lib/module/renderer/processors/math/Math.js.map +1 -1
  519. package/lib/module/renderer/processors/math/Transforms.js.map +1 -1
  520. package/lib/module/renderer/processors/math/index.js.map +1 -1
  521. package/lib/module/renderer/typeddash.js.map +1 -1
  522. package/lib/module/renderer/useCanvas.js.map +1 -1
  523. package/lib/module/renderer/useContextBridge.js.map +1 -1
  524. package/lib/module/skia/NativeSetup.js.map +1 -1
  525. package/lib/module/skia/Skia.js.map +1 -1
  526. package/lib/module/skia/Skia.web.js.map +1 -1
  527. package/lib/module/skia/core/Data.js.map +1 -1
  528. package/lib/module/skia/core/Font.js.map +1 -1
  529. package/lib/module/skia/core/Image.js.map +1 -1
  530. package/lib/module/skia/core/Matrix.js.map +1 -1
  531. package/lib/module/skia/core/Picture.js +15 -1
  532. package/lib/module/skia/core/Picture.js.map +1 -1
  533. package/lib/module/skia/core/RRect.js.map +1 -1
  534. package/lib/module/skia/core/Rect.js.map +1 -1
  535. package/lib/module/skia/core/SVG.js.map +1 -1
  536. package/lib/module/skia/core/Typeface.js.map +1 -1
  537. package/lib/module/skia/core/Vector.js +1 -1
  538. package/lib/module/skia/core/Vector.js.map +1 -1
  539. package/lib/module/skia/core/index.js.map +1 -1
  540. package/lib/module/skia/index.js.map +1 -1
  541. package/lib/module/skia/types/Canvas.js.map +1 -1
  542. package/lib/module/skia/types/Color.js.map +1 -1
  543. package/lib/module/skia/types/ColorFilter/ColorFilter.js.map +1 -1
  544. package/lib/module/skia/types/ColorFilter/ColorFilterFactory.js.map +1 -1
  545. package/lib/module/skia/types/ColorFilter/index.js.map +1 -1
  546. package/lib/module/skia/types/ContourMeasure.js.map +1 -1
  547. package/lib/module/skia/types/Data/Data.js.map +1 -1
  548. package/lib/module/skia/types/Data/DataFactory.js.map +1 -1
  549. package/lib/module/skia/types/Data/index.js.map +1 -1
  550. package/lib/module/skia/types/Font/Font.js.map +1 -1
  551. package/lib/module/skia/types/Font/index.js.map +1 -1
  552. package/lib/module/skia/types/Image/Image.js.map +1 -1
  553. package/lib/module/skia/types/Image/ImageFactory.js.map +1 -1
  554. package/lib/module/skia/types/Image/index.js.map +1 -1
  555. package/lib/module/skia/types/ImageFilter/ImageFilter.js.map +1 -1
  556. package/lib/module/skia/types/ImageFilter/ImageFilterFactory.js.map +1 -1
  557. package/lib/module/skia/types/ImageFilter/index.js.map +1 -1
  558. package/lib/module/skia/types/JsiInstance.js.map +1 -1
  559. package/lib/module/skia/types/MaskFilter.js.map +1 -1
  560. package/lib/module/skia/types/Matrix.js.map +1 -1
  561. package/lib/module/skia/types/Paint/BlendMode.js.map +1 -1
  562. package/lib/module/skia/types/Paint/Paint.js.map +1 -1
  563. package/lib/module/skia/types/Paint/index.js.map +1 -1
  564. package/lib/module/skia/types/Path/Path.js.map +1 -1
  565. package/lib/module/skia/types/Path/PathFactory.js.map +1 -1
  566. package/lib/module/skia/types/Path/index.js.map +1 -1
  567. package/lib/module/skia/types/PathEffect.js.map +1 -1
  568. package/lib/module/skia/types/Picture/Picture.js.map +1 -1
  569. package/lib/module/skia/types/Picture/PictureFactory.js.map +1 -1
  570. package/lib/module/skia/types/Picture/PictureRecorder.js.map +1 -1
  571. package/lib/module/skia/types/Picture/index.js.map +1 -1
  572. package/lib/module/skia/types/Point.js.map +1 -1
  573. package/lib/module/skia/types/RRect.js.map +1 -1
  574. package/lib/module/skia/types/RSXform.js.map +1 -1
  575. package/lib/module/skia/types/Rect.js.map +1 -1
  576. package/lib/module/skia/types/RuntimeEffect/RuntimeEffect.js.map +1 -1
  577. package/lib/module/skia/types/RuntimeEffect/RuntimeEffectFactory.js.map +1 -1
  578. package/lib/module/skia/types/RuntimeEffect/index.js.map +1 -1
  579. package/lib/module/skia/types/SVG/SVG.js.map +1 -1
  580. package/lib/module/skia/types/SVG/SVGFactory.js.map +1 -1
  581. package/lib/module/skia/types/SVG/index.js.map +1 -1
  582. package/lib/module/skia/types/Shader/Shader.js.map +1 -1
  583. package/lib/module/skia/types/Shader/ShaderFactory.js.map +1 -1
  584. package/lib/module/skia/types/Shader/index.js.map +1 -1
  585. package/lib/module/skia/types/Skia.js.map +1 -1
  586. package/lib/module/skia/types/Surface/Surface.js.map +1 -1
  587. package/lib/module/skia/types/Surface/SurfaceFactory.js.map +1 -1
  588. package/lib/module/skia/types/Surface/index.js.map +1 -1
  589. package/lib/module/skia/types/TextBlob.js.map +1 -1
  590. package/lib/module/skia/types/Typeface/Typeface.js.map +1 -1
  591. package/lib/module/skia/types/Typeface/TypefaceFactory.js.map +1 -1
  592. package/lib/module/skia/types/Typeface/index.js.map +1 -1
  593. package/lib/module/skia/types/Vertices/Vertices.js.map +1 -1
  594. package/lib/module/skia/types/Vertices/index.js.map +1 -1
  595. package/lib/module/skia/types/index.js.map +1 -1
  596. package/lib/module/skia/web/Host.js +1 -1
  597. package/lib/module/skia/web/Host.js.map +1 -1
  598. package/lib/module/skia/web/JsiSkCanvas.js.map +1 -1
  599. package/lib/module/skia/web/JsiSkColor.js.map +1 -1
  600. package/lib/module/skia/web/JsiSkColorFilter.js.map +1 -1
  601. package/lib/module/skia/web/JsiSkColorFilterFactory.js.map +1 -1
  602. package/lib/module/skia/web/JsiSkContourMeasure.js.map +1 -1
  603. package/lib/module/skia/web/JsiSkContourMeasureIter.js.map +1 -1
  604. package/lib/module/skia/web/JsiSkData.js.map +1 -1
  605. package/lib/module/skia/web/JsiSkDataFactory.js.map +1 -1
  606. package/lib/module/skia/web/JsiSkFont.js.map +1 -1
  607. package/lib/module/skia/web/JsiSkImage.js.map +1 -1
  608. package/lib/module/skia/web/JsiSkImageFactory.js.map +1 -1
  609. package/lib/module/skia/web/JsiSkImageFilter.js.map +1 -1
  610. package/lib/module/skia/web/JsiSkImageFilterFactory.js.map +1 -1
  611. package/lib/module/skia/web/JsiSkMaskFilter.js.map +1 -1
  612. package/lib/module/skia/web/JsiSkMaskFilterFactory.js.map +1 -1
  613. package/lib/module/skia/web/JsiSkMatrix.js +1 -1
  614. package/lib/module/skia/web/JsiSkMatrix.js.map +1 -1
  615. package/lib/module/skia/web/JsiSkPaint.js.map +1 -1
  616. package/lib/module/skia/web/JsiSkPath.js.map +1 -1
  617. package/lib/module/skia/web/JsiSkPathEffect.js.map +1 -1
  618. package/lib/module/skia/web/JsiSkPathEffectFactory.js.map +1 -1
  619. package/lib/module/skia/web/JsiSkPathFactory.js.map +1 -1
  620. package/lib/module/skia/web/JsiSkPicture.js.map +1 -1
  621. package/lib/module/skia/web/JsiSkPictureFactory.js.map +1 -1
  622. package/lib/module/skia/web/JsiSkPictureRecorder.js.map +1 -1
  623. package/lib/module/skia/web/JsiSkPoint.js.map +1 -1
  624. package/lib/module/skia/web/JsiSkRRect.js.map +1 -1
  625. package/lib/module/skia/web/JsiSkRSXform.js.map +1 -1
  626. package/lib/module/skia/web/JsiSkRect.js.map +1 -1
  627. package/lib/module/skia/web/JsiSkRuntimeEffect.js.map +1 -1
  628. package/lib/module/skia/web/JsiSkRuntimeEffectFactory.js.map +1 -1
  629. package/lib/module/skia/web/JsiSkSVGFactory.js.map +1 -1
  630. package/lib/module/skia/web/JsiSkShader.js.map +1 -1
  631. package/lib/module/skia/web/JsiSkShaderFactory.js.map +1 -1
  632. package/lib/module/skia/web/JsiSkSurface.js.map +1 -1
  633. package/lib/module/skia/web/JsiSkSurfaceFactory.js.map +1 -1
  634. package/lib/module/skia/web/JsiSkTextBlob.js.map +1 -1
  635. package/lib/module/skia/web/JsiSkTextBlobFactory.js.map +1 -1
  636. package/lib/module/skia/web/JsiSkTypeface.js.map +1 -1
  637. package/lib/module/skia/web/JsiSkTypefaceFactory.js.map +1 -1
  638. package/lib/module/skia/web/JsiSkVertices.js.map +1 -1
  639. package/lib/module/skia/web/JsiSkVerticesFactory.js.map +1 -1
  640. package/lib/module/skia/web/JsiSkia.js.map +1 -1
  641. package/lib/module/skia/web/index.js.map +1 -1
  642. package/lib/module/values/api.js.map +1 -1
  643. package/lib/module/values/api.web.js.map +1 -1
  644. package/lib/module/values/hooks/index.js.map +1 -1
  645. package/lib/module/values/hooks/useClockValue.js.map +1 -1
  646. package/lib/module/values/hooks/useComputedValue.js.map +1 -1
  647. package/lib/module/values/hooks/useValue.js.map +1 -1
  648. package/lib/module/values/hooks/useValueEffect.js.map +1 -1
  649. package/lib/module/values/index.js.map +1 -1
  650. package/lib/module/values/selector.js.map +1 -1
  651. package/lib/module/values/types.js.map +1 -1
  652. package/lib/module/values/web/RNSkAnimation.js +2 -2
  653. package/lib/module/values/web/RNSkAnimation.js.map +1 -1
  654. package/lib/module/values/web/RNSkClockValue.js.map +1 -1
  655. package/lib/module/values/web/RNSkComputedValue.js +1 -1
  656. package/lib/module/values/web/RNSkComputedValue.js.map +1 -1
  657. package/lib/module/values/web/RNSkReadonlyValue.js.map +1 -1
  658. package/lib/module/values/web/RNSkValue.js.map +1 -1
  659. package/lib/module/values/web/api.js.map +1 -1
  660. package/lib/module/values/web/index.js.map +1 -1
  661. package/lib/module/views/SkiaView.js +1 -1
  662. package/lib/module/views/SkiaView.js.map +1 -1
  663. package/lib/module/views/SkiaView.web.js +2 -4
  664. package/lib/module/views/SkiaView.web.js.map +1 -1
  665. package/lib/module/views/api.js.map +1 -1
  666. package/lib/module/views/index.js.map +1 -1
  667. package/lib/module/views/types.js.map +1 -1
  668. package/lib/module/views/useDrawCallback.js.map +1 -1
  669. package/lib/module/views/useTouchHandler.js +6 -6
  670. package/lib/module/views/useTouchHandler.js.map +1 -1
  671. package/lib/module/web/LoadSkiaWeb.js.map +1 -1
  672. package/lib/module/web/WithSkiaWeb.js +1 -1
  673. package/lib/module/web/WithSkiaWeb.js.map +1 -1
  674. package/lib/module/web/index.js.map +1 -1
  675. package/lib/typescript/src/animation/decay/runDecay.d.ts +1 -1
  676. package/lib/typescript/src/animation/spring/runSpring.d.ts +1 -1
  677. package/lib/typescript/src/animation/spring/useSpring.d.ts +1 -1
  678. package/lib/typescript/src/animation/timing/createTiming.d.ts +1 -1
  679. package/lib/typescript/src/animation/timing/functions/getResolvedParams.d.ts +1 -1
  680. package/lib/typescript/src/animation/timing/runTiming.d.ts +1 -1
  681. package/lib/typescript/src/animation/timing/useLoop.d.ts +1 -1
  682. package/lib/typescript/src/animation/timing/useTiming.d.ts +1 -1
  683. package/lib/typescript/src/mock/index.d.ts +1 -1
  684. package/lib/typescript/src/renderer/Canvas.d.ts +1 -1
  685. package/lib/typescript/src/renderer/HostConfig.d.ts +1 -1
  686. package/lib/typescript/src/renderer/components/Paint.d.ts +1 -1
  687. package/lib/typescript/src/renderer/components/backdrop/BackdropFilter.d.ts +1 -1
  688. package/lib/typescript/src/renderer/processors/Animations/Animations.d.ts +4 -4
  689. package/lib/typescript/src/renderer/typeddash.d.ts +2 -2
  690. package/lib/typescript/src/skia/core/Font.d.ts +1 -1
  691. package/lib/typescript/src/skia/core/Picture.d.ts +9 -2
  692. package/lib/typescript/src/skia/core/Vector.d.ts +2 -2
  693. package/lib/typescript/src/skia/types/Shader/Shader.d.ts +1 -1
  694. package/lib/typescript/src/skia/web/JsiSkVerticesFactory.d.ts +2 -2
  695. package/lib/typescript/src/web/LoadSkiaWeb.d.ts +2 -2
  696. package/package.json +6 -6
  697. package/src/mock/index.ts +1 -0
  698. package/src/renderer/HostConfig.ts +3 -4
  699. package/src/renderer/components/backdrop/BackdropFilter.tsx +1 -1
  700. package/src/renderer/processors/Animations/Animations.ts +11 -4
  701. package/src/renderer/typeddash.ts +3 -2
  702. package/src/skia/core/Picture.ts +17 -3
  703. package/src/values/web/RNSkComputedValue.ts +6 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["api.ts"],"names":["ValueApi","createValue","initialValue","RNSkValue","createComputedValue","cb","values","RNSkComputedValue","createClockValue","RNSkClockValue","requestAnimationFrame","bind","window","createAnimation","RNSkAnimation"],"mappings":";;;;;;;AASA;;AACA;;AACA;;AACA;;AAEO,MAAMA,QAAuB,GAAG;AACrCC,EAAAA,WAAW,EAAE,UAAaC,YAAb,EAAmD;AAC9D,WAAO,IAAIC,oBAAJ,CAAcD,YAAd,CAAP;AACD,GAHoC;AAIrCE,EAAAA,mBAAmB,EAAE,UACnBC,EADmB,EAEnBC,MAFmB,EAGL;AACd,WAAO,IAAIC,oCAAJ,CAAsBF,EAAtB,EAA0BC,MAA1B,CAAP;AACD,GAToC;AAUrCE,EAAAA,gBAAgB,EAAE,YAA4B;AAC5C,WAAO,IAAIC,8BAAJ,CAAmBC,qBAAqB,CAACC,IAAtB,CAA2BC,MAA3B,CAAnB,CAAP;AACD,GAZoC;AAarCC,EAAAA,eAAe,EAAE,UACfR,EADe,EAEA;AACf,WAAO,IAAIS,4BAAJ,CAAkBT,EAAlB,EAAsBK,qBAAqB,CAACC,IAAtB,CAA2BC,MAA3B,CAAtB,CAAP;AACD;AAjBoC,CAAhC","sourcesContent":["import type {\n ISkiaValueApi,\n SkiaMutableValue,\n SkiaValue,\n SkiaClockValue,\n AnimationState,\n SkiaAnimation,\n} from \"../types\";\n\nimport { RNSkAnimation } from \"./RNSkAnimation\";\nimport { RNSkClockValue } from \"./RNSkClockValue\";\nimport { RNSkComputedValue } from \"./RNSkComputedValue\";\nimport { RNSkValue } from \"./RNSkValue\";\n\nexport const ValueApi: ISkiaValueApi = {\n createValue: function <T>(initialValue: T): SkiaMutableValue<T> {\n return new RNSkValue(initialValue);\n },\n createComputedValue: function <R>(\n cb: () => R,\n values: SkiaValue<unknown>[]\n ): SkiaValue<R> {\n return new RNSkComputedValue(cb, values);\n },\n createClockValue: function (): SkiaClockValue {\n return new RNSkClockValue(requestAnimationFrame.bind(window));\n },\n createAnimation: function <S extends AnimationState = AnimationState>(\n cb: (t: number, state: S | undefined) => S\n ): SkiaAnimation {\n return new RNSkAnimation(cb, requestAnimationFrame.bind(window));\n },\n};\n"]}
1
+ {"version":3,"names":["ValueApi","createValue","initialValue","RNSkValue","createComputedValue","cb","values","RNSkComputedValue","createClockValue","RNSkClockValue","requestAnimationFrame","bind","window","createAnimation","RNSkAnimation"],"sources":["api.ts"],"sourcesContent":["import type {\n ISkiaValueApi,\n SkiaMutableValue,\n SkiaValue,\n SkiaClockValue,\n AnimationState,\n SkiaAnimation,\n} from \"../types\";\n\nimport { RNSkAnimation } from \"./RNSkAnimation\";\nimport { RNSkClockValue } from \"./RNSkClockValue\";\nimport { RNSkComputedValue } from \"./RNSkComputedValue\";\nimport { RNSkValue } from \"./RNSkValue\";\n\nexport const ValueApi: ISkiaValueApi = {\n createValue: function <T>(initialValue: T): SkiaMutableValue<T> {\n return new RNSkValue(initialValue);\n },\n createComputedValue: function <R>(\n cb: () => R,\n values: SkiaValue<unknown>[]\n ): SkiaValue<R> {\n return new RNSkComputedValue(cb, values);\n },\n createClockValue: function (): SkiaClockValue {\n return new RNSkClockValue(requestAnimationFrame.bind(window));\n },\n createAnimation: function <S extends AnimationState = AnimationState>(\n cb: (t: number, state: S | undefined) => S\n ): SkiaAnimation {\n return new RNSkAnimation(cb, requestAnimationFrame.bind(window));\n },\n};\n"],"mappings":";;;;;;;AASA;;AACA;;AACA;;AACA;;AAEO,MAAMA,QAAuB,GAAG;EACrCC,WAAW,EAAE,UAAaC,YAAb,EAAmD;IAC9D,OAAO,IAAIC,oBAAJ,CAAcD,YAAd,CAAP;EACD,CAHoC;EAIrCE,mBAAmB,EAAE,UACnBC,EADmB,EAEnBC,MAFmB,EAGL;IACd,OAAO,IAAIC,oCAAJ,CAAsBF,EAAtB,EAA0BC,MAA1B,CAAP;EACD,CAToC;EAUrCE,gBAAgB,EAAE,YAA4B;IAC5C,OAAO,IAAIC,8BAAJ,CAAmBC,qBAAqB,CAACC,IAAtB,CAA2BC,MAA3B,CAAnB,CAAP;EACD,CAZoC;EAarCC,eAAe,EAAE,UACfR,EADe,EAEA;IACf,OAAO,IAAIS,4BAAJ,CAAkBT,EAAlB,EAAsBK,qBAAqB,CAACC,IAAtB,CAA2BC,MAA3B,CAAtB,CAAP;EACD;AAjBoC,CAAhC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export * from \"./api\";\n"]}
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./api\";\n"],"mappings":";;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
@@ -13,7 +13,7 @@ var _api = require("./api");
13
13
 
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
15
 
16
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
16
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
17
17
 
18
18
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
19
19
 
@@ -1 +1 @@
1
- {"version":3,"sources":["SkiaView.tsx"],"names":["SkiaViewNativeId","NativeSkiaView","SkiaView","React","Component","constructor","props","_nativeId","onDraw","assertSkiaViewApi","SkiaViewApi","setJsiProperty","nativeId","componentDidUpdate","prevProps","makeImageSnapshot","rect","redraw","requestRedraw","registerValues","values","registerValuesInView","render","mode","debug","viewProps","callJsiMethod","Error"],"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P;AACD;;AAEDE,EAAAA,MAAM,GAAG;AACP,UAAM;AAAEC,MAAAA,IAAF;AAAQC,MAAAA,KAAK,GAAG,KAAhB;AAAuB,SAAGC;AAA1B,QAAwC,KAAKnB,KAAnD;AACA,wBACE,6BAAC,cAAD;AACE,MAAA,WAAW,EAAE,KADf;AAEE,MAAA,QAAQ,EAAG,GAAE,KAAKC,SAAU,EAF9B;AAGE,MAAA,IAAI,EAAEgB,IAHR;AAIE,MAAA,KAAK,EAAEC;AAJT,OAKMC,SALN,EADF;AASD;;AAhE0D;;;;AAmE7D,MAAMhB,iBAAiB,GAAG,MAAM;AAC9B,MACEC,qBAAgB,IAAhB,IACAA,iBAAYC,cAAZ,KAA+B,IAD/B,IAEAD,iBAAYgB,aAAZ,KAA8B,IAF9B,IAGAhB,iBAAYW,oBAAZ,KAAqC,IAHrC,IAIAX,iBAAYQ,aAAZ,KAA8B,IAJ9B,IAKAR,iBAAYK,iBAAZ,KAAkC,IANpC,EAOE;AACA,UAAMY,KAAK,CAAC,8BAAD,CAAX;AACD;AACF,CAXD","sourcesContent":["import React from \"react\";\nimport { requireNativeComponent } from \"react-native\";\n\nimport type { SkRect } from \"../skia/types\";\nimport type { SkiaValue } from \"../values\";\n\nimport { SkiaViewApi } from \"./api\";\nimport type { NativeSkiaViewProps, SkiaViewProps } from \"./types\";\n\nlet SkiaViewNativeId = 1000;\n\nconst NativeSkiaView = requireNativeComponent<NativeSkiaViewProps>(\n \"ReactNativeSkiaView\"\n);\n\nexport class SkiaView extends React.Component<SkiaViewProps> {\n constructor(props: SkiaViewProps) {\n super(props);\n this._nativeId = SkiaViewNativeId++;\n const { onDraw } = props;\n if (onDraw) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"drawCallback\", onDraw);\n }\n }\n\n private _nativeId: number;\n\n public get nativeId() {\n return this._nativeId;\n }\n\n componentDidUpdate(prevProps: SkiaViewProps) {\n const { onDraw } = this.props;\n if (onDraw !== prevProps.onDraw) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"drawCallback\", onDraw);\n }\n }\n\n /**\n * Creates a snapshot from the canvas in the surface\n * @param rect Rect to use as bounds. Optional.\n * @returns An Image object.\n */\n public makeImageSnapshot(rect?: SkRect) {\n assertSkiaViewApi();\n return SkiaViewApi.makeImageSnapshot(this._nativeId, rect);\n }\n\n /**\n * Sends a redraw request to the native SkiaView.\n */\n public redraw() {\n assertSkiaViewApi();\n SkiaViewApi.requestRedraw(this._nativeId);\n }\n\n /**\n * Registers one or move values as a dependant value of the Skia View. The view will\n * The view will redraw itself when any of the values change.\n * @param values Values to register\n */\n public registerValues(values: SkiaValue<unknown>[]): () => void {\n assertSkiaViewApi();\n return SkiaViewApi.registerValuesInView(this._nativeId, values);\n }\n\n render() {\n const { mode, debug = false, ...viewProps } = this.props;\n return (\n <NativeSkiaView\n collapsable={false}\n nativeID={`${this._nativeId}`}\n mode={mode}\n debug={debug}\n {...viewProps}\n />\n );\n }\n}\n\nconst assertSkiaViewApi = () => {\n if (\n SkiaViewApi === null ||\n SkiaViewApi.setJsiProperty === null ||\n SkiaViewApi.callJsiMethod === null ||\n SkiaViewApi.registerValuesInView === null ||\n SkiaViewApi.requestRedraw === null ||\n SkiaViewApi.makeImageSnapshot === null\n ) {\n throw Error(\"Skia View Api was not found.\");\n }\n};\n"]}
1
+ {"version":3,"names":["SkiaViewNativeId","NativeSkiaView","requireNativeComponent","SkiaView","React","Component","constructor","props","_nativeId","onDraw","assertSkiaViewApi","SkiaViewApi","setJsiProperty","nativeId","componentDidUpdate","prevProps","makeImageSnapshot","rect","redraw","requestRedraw","registerValues","values","registerValuesInView","render","mode","debug","viewProps","callJsiMethod","Error"],"sources":["SkiaView.tsx"],"sourcesContent":["import React from \"react\";\nimport { requireNativeComponent } from \"react-native\";\n\nimport type { SkRect } from \"../skia/types\";\nimport type { SkiaValue } from \"../values\";\n\nimport { SkiaViewApi } from \"./api\";\nimport type { NativeSkiaViewProps, SkiaViewProps } from \"./types\";\n\nlet SkiaViewNativeId = 1000;\n\nconst NativeSkiaView = requireNativeComponent<NativeSkiaViewProps>(\n \"ReactNativeSkiaView\"\n);\n\nexport class SkiaView extends React.Component<SkiaViewProps> {\n constructor(props: SkiaViewProps) {\n super(props);\n this._nativeId = SkiaViewNativeId++;\n const { onDraw } = props;\n if (onDraw) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"drawCallback\", onDraw);\n }\n }\n\n private _nativeId: number;\n\n public get nativeId() {\n return this._nativeId;\n }\n\n componentDidUpdate(prevProps: SkiaViewProps) {\n const { onDraw } = this.props;\n if (onDraw !== prevProps.onDraw) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"drawCallback\", onDraw);\n }\n }\n\n /**\n * Creates a snapshot from the canvas in the surface\n * @param rect Rect to use as bounds. Optional.\n * @returns An Image object.\n */\n public makeImageSnapshot(rect?: SkRect) {\n assertSkiaViewApi();\n return SkiaViewApi.makeImageSnapshot(this._nativeId, rect);\n }\n\n /**\n * Sends a redraw request to the native SkiaView.\n */\n public redraw() {\n assertSkiaViewApi();\n SkiaViewApi.requestRedraw(this._nativeId);\n }\n\n /**\n * Registers one or move values as a dependant value of the Skia View. The view will\n * The view will redraw itself when any of the values change.\n * @param values Values to register\n */\n public registerValues(values: SkiaValue<unknown>[]): () => void {\n assertSkiaViewApi();\n return SkiaViewApi.registerValuesInView(this._nativeId, values);\n }\n\n render() {\n const { mode, debug = false, ...viewProps } = this.props;\n return (\n <NativeSkiaView\n collapsable={false}\n nativeID={`${this._nativeId}`}\n mode={mode}\n debug={debug}\n {...viewProps}\n />\n );\n }\n}\n\nconst assertSkiaViewApi = () => {\n if (\n SkiaViewApi === null ||\n SkiaViewApi.setJsiProperty === null ||\n SkiaViewApi.callJsiMethod === null ||\n SkiaViewApi.registerValuesInView === null ||\n SkiaViewApi.requestRedraw === null ||\n SkiaViewApi.makeImageSnapshot === null\n ) {\n throw Error(\"Sk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,MAAM,GAAG;IACP,MAAM;MAAEC,IAAF;MAAQC,KAAK,GAAG,KAAhB;MAAuB,GAAGC;IAA1B,IAAwC,KAAKnB,KAAnD;IACA,oBACE,6BAAC,cAAD;MACE,WAAW,EAAE,KADf;MAEE,QAAQ,EAAG,GAAE,KAAKC,SAAU,EAF9B;MAGE,IAAI,EAAEgB,IAHR;MAIE,KAAK,EAAEC;IAJT,GAKMC,SALN,EADF;EASD;;AAhE0D;;;;AAmE7D,MAAMhB,iBAAiB,GAAG,MAAM;EAC9B,IACEC,gBAAA,KAAgB,IAAhB,IACAA,gBAAA,CAAYC,cAAZ,KAA+B,IAD/B,IAEAD,gBAAA,CAAYgB,aAAZ,KAA8B,IAF9B,IAGAhB,gBAAA,CAAYW,oBAAZ,KAAqC,IAHrC,IAIAX,gBAAA,CAAYQ,aAAZ,KAA8B,IAJ9B,IAKAR,gBAAA,CAAYK,iBAAZ,KAAkC,IANpC,EAOE;IACA,MAAMY,KAAK,CAAC,8BAAD,CAAX;EACD;AACF,CAXD"}
@@ -15,7 +15,7 @@ var _types = require("./types");
15
15
 
16
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
17
 
18
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
18
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
19
19
 
20
20
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
21
21
 
@@ -23,8 +23,6 @@ const pd = _reactNative.PixelRatio.get();
23
23
 
24
24
  class SkiaView extends _react.default.Component {
25
25
  constructor(props) {
26
- var _props$mode;
27
-
28
26
  super(props);
29
27
 
30
28
  _defineProperty(this, "_surface", null);
@@ -47,7 +45,7 @@ class SkiaView extends _react.default.Component {
47
45
 
48
46
  _defineProperty(this, "requestId", 0);
49
47
 
50
- this._mode = (_props$mode = props.mode) !== null && _props$mode !== void 0 ? _props$mode : "default";
48
+ this._mode = props.mode ?? "default";
51
49
  }
52
50
 
53
51
  unsubscribeAll() {
@@ -1 +1 @@
1
- {"version":3,"sources":["SkiaView.web.tsx"],"names":["pd","PixelRatio","get","SkiaView","React","Component","constructor","props","createRef","_mode","mode","unsubscribeAll","_unsubscriptions","forEach","u","onLayout","evt","CanvasKit","global","width","height","nativeEvent","layout","_canvasRef","current","canvas","clientWidth","clientHeight","surface","MakeWebGLCanvasSurface","Error","_surface","JsiSkSurface","_canvas","getCanvas","redraw","componentDidMount","tick","componentDidUpdate","componentWillUnmount","cancelAnimationFrame","requestId","makeImageSnapshot","rect","_redrawRequests","onDraw","touches","_touches","info","timestamp","Date","now","map","t","save","scale","restore","ref","flush","requestAnimationFrame","bind","setDrawMode","registerValues","_values","v","push","addListener","handleTouchEvent","touchType","id","pointerId","x","clientX","currentTarget","getClientRects","left","y","clientY","top","force","pressure","type","createTouchHandler","render","debug","viewProps","display","flex","TouchType","Start","Active","End","Cancelled"],"mappings":";;;;;;;AACA;;AAGA;;AAIA;;AAGA;;;;;;;;AAEA,MAAMA,EAAE,GAAGC,wBAAWC,GAAX,EAAX;;AAEO,MAAMC,QAAN,SAAuBC,eAAMC,SAA7B,CAAsD;AAC3DC,EAAAA,WAAW,CAACC,KAAD,EAAuB;AAAA;;AAChC,UAAMA,KAAN;;AADgC,sCAKM,IALN;;AAAA,8CAMY,EANZ;;AAAA,sCAOG,EAPH;;AAAA,qCAQC,IARD;;AAAA,qDASbH,eAAMI,SAAN,EATa;;AAAA;;AAAA,6CAWR,CAXQ;;AAAA,mCAYlB,CAZkB;;AAAA,oCAajB,CAbiB;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AG;AACP,UAAM;AAAEzE,MAAAA,IAAF;AAAQ0E,MAAAA,KAAK,GAAG,KAAhB;AAAuB,SAAGC;AAA1B,QAAwC,KAAK9E,KAAnD;AACA,wBACE,6BAAC,iBAAD,eAAU8E,SAAV;AAAqB,MAAA,QAAQ,EAAE,KAAKtE,QAAL,CAAc6C,IAAd,CAAmB,IAAnB;AAA/B,qBACE;AACE,MAAA,GAAG,EAAE,KAAKrC,UADZ;AAEE,MAAA,KAAK,EAAE;AAAE+D,QAAAA,OAAO,EAAE,MAAX;AAAmBC,QAAAA,IAAI,EAAE;AAAzB,OAFT;AAGE,MAAA,aAAa,EAAE,KAAKL,kBAAL,CAAwBM,iBAAUC,KAAlC,CAHjB;AAIE,MAAA,aAAa,EAAE,KAAKP,kBAAL,CAAwBM,iBAAUE,MAAlC,CAJjB;AAKE,MAAA,WAAW,EAAE,KAAKR,kBAAL,CAAwBM,iBAAUG,GAAlC,CALf;AAME,MAAA,eAAe,EAAE,KAAKT,kBAAL,CAAwBM,iBAAUI,SAAlC,CANnB;AAOE,MAAA,cAAc,EAAE,KAAKV,kBAAL,CAAwBM,iBAAUG,GAAlC,CAPlB;AAQE,MAAA,YAAY,EAAE,KAAKT,kBAAL,CAAwBM,iBAAUG,GAAlC;AARhB,MADF,CADF;AAcD;;AAjK0D","sourcesContent":["/* global HTMLCanvasElement */\nimport React from \"react\";\nimport type { PointerEvent } from \"react\";\nimport type { LayoutChangeEvent } from \"react-native\";\nimport { PixelRatio, View } from \"react-native\";\n\nimport type { SkRect, SkCanvas } from \"../skia/types\";\nimport type { SkiaValue } from \"../values\";\nimport { JsiSkSurface } from \"../skia/web/JsiSkSurface\";\n\nimport type { DrawingInfo, DrawMode, SkiaViewProps, TouchInfo } from \"./types\";\nimport { TouchType } from \"./types\";\n\nconst pd = PixelRatio.get();\n\nexport class SkiaView extends React.Component<SkiaViewProps> {\n constructor(props: SkiaViewProps) {\n super(props);\n this._mode = props.mode ?? \"default\";\n }\n\n private _surface: JsiSkSurface | null = null;\n private _unsubscriptions: Array<() => void> = [];\n private _touches: Array<TouchInfo> = [];\n private _canvas: SkCanvas | null = null;\n private _canvasRef = React.createRef<HTMLCanvasElement>();\n private _mode: DrawMode;\n private _redrawRequests = 0;\n private width = 0;\n private height = 0;\n private requestId = 0;\n\n private unsubscribeAll() {\n this._unsubscriptions.forEach((u) => u());\n this._unsubscriptions = [];\n }\n\n private onLayout(evt: LayoutChangeEvent) {\n const { CanvasKit } = global;\n const { width, height } = evt.nativeEvent.layout;\n this.width = width;\n this.height = height;\n // Reset canvas / surface on layout change\n if (this._canvasRef.current) {\n const canvas = this._canvasRef.current;\n canvas.width = canvas.clientWidth * pd;\n canvas.height = canvas.clientHeight * pd;\n const surface = CanvasKit.MakeWebGLCanvasSurface(this._canvasRef.current);\n if (!surface) {\n throw new Error(\"Could not create surface\");\n }\n this._surface = new JsiSkSurface(CanvasKit, surface);\n this._canvas = this._surface.getCanvas();\n this.redraw();\n }\n }\n\n componentDidMount() {\n // Start render loop\n this.tick();\n }\n\n componentDidUpdate() {\n this.redraw();\n }\n\n componentWillUnmount() {\n this.unsubscribeAll();\n cancelAnimationFrame(this.requestId);\n }\n\n /**\n * Creates a snapshot from the canvas in the surface\n * @param rect Rect to use as bounds. Optional.\n * @returns An Image object.\n */\n public makeImageSnapshot(rect?: SkRect) {\n return this._surface?.makeImageSnapshot(rect);\n }\n\n /**\n * Sends a redraw request to the native SkiaView.\n */\n private tick() {\n if (this._mode === \"continuous\" || this._redrawRequests > 0) {\n this._redrawRequests = 0;\n if (this._canvas && this.props.onDraw) {\n const touches = [...this._touches];\n this._touches = [];\n const info: DrawingInfo = {\n height: this.height,\n width: this.width,\n timestamp: Date.now(),\n touches: touches.map((t) => [t]),\n };\n if (this.props.onDraw) {\n const canvas = this._canvas!;\n canvas.save();\n canvas.scale(pd, pd);\n this.props.onDraw(canvas, info);\n canvas.restore();\n }\n this._surface?.ref.flush();\n }\n }\n this.requestId = requestAnimationFrame(this.tick.bind(this));\n }\n\n public redraw() {\n this._redrawRequests++;\n }\n\n /**\n * Updates the drawing mode for the skia view. This is the same\n * as declaratively setting the mode property on the SkiaView.\n * There are two drawing modes, \"continuous\" and \"default\",\n * where the continuous mode will continuously redraw the view and\n * the default mode will only redraw when any of the regular react\n * properties are changed like size and margins.\n * @param mode Drawing mode to use.\n */\n public setDrawMode(mode: DrawMode) {\n this._mode = mode;\n this.tick();\n }\n\n /**\n * Registers one or move values as a dependant value of the Skia View. The view will\n * The view will redraw itself when any of the values change.\n * @param values Values to register\n */\n public registerValues(_values: SkiaValue<unknown>[]) {\n // Unsubscribe from dependency values\n this.unsubscribeAll();\n // Register redraw dependencies on values\n _values.forEach((v) => {\n this._unsubscriptions.push(\n v.addListener(() => {\n this.redraw();\n })\n );\n });\n }\n\n private handleTouchEvent(evt: PointerEvent, touchType: TouchType) {\n this._touches.push({\n id: evt.pointerId,\n x: evt.clientX - evt.currentTarget.getClientRects()[0].left,\n y: evt.clientY - evt.currentTarget.getClientRects()[0].top,\n force: evt.pressure,\n type: touchType,\n timestamp: Date.now(),\n });\n this.redraw();\n }\n\n createTouchHandler(touchType: TouchType) {\n return (evt: PointerEvent) => this.handleTouchEvent(evt, touchType);\n }\n\n render() {\n const { mode, debug = false, ...viewProps } = this.props;\n return (\n <View {...viewProps} onLayout={this.onLayout.bind(this)}>\n <canvas\n ref={this._canvasRef}\n style={{ display: \"flex\", flex: 1 }}\n onPointerDown={this.createTouchHandler(TouchType.Start)}\n onPointerMove={this.createTouchHandler(TouchType.Active)}\n onPointerUp={this.createTouchHandler(TouchType.End)}\n onPointerCancel={this.createTouchHandler(TouchType.Cancelled)}\n onPointerLeave={this.createTouchHandler(TouchType.End)}\n onPointerOut={this.createTouchHandler(TouchType.End)}\n />\n </View>\n );\n }\n}\n"]}
1
+ {"version":3,"names":["pd","PixelRatio","get","SkiaView","React","Component","constructor","props","createRef","_mode","mode","unsubscribeAll","_unsubscriptions","forEach","u","onLayout","evt","CanvasKit","global","width","height","nativeEvent","layout","_canvasRef","current","canvas","clientWidth","clientHeight","surface","MakeWebGLCanvasSurface","Error","_surface","JsiSkSurface","_canvas","getCanvas","redraw","componentDidMount","tick","componentDidUpdate","componentWillUnmount","cancelAnimationFrame","requestId","makeImageSnapshot","rect","_redrawRequests","onDraw","touches","_touches","info","timestamp","Date","now","map","t","save","scale","restore","ref","flush","requestAnimationFrame","bind","setDrawMode","registerValues","_values","v","push","addListener","handleTouchEvent","touchType","id","pointerId","x","clientX","currentTarget","getClientRects","left","y","clientY","top","force","pressure","type","createTouchHandler","render","debug","viewProps","display","flex","TouchType","Start","Active","End","Cancelled"],"sources":["SkiaView.web.tsx"],"sourcesContent":["/* global HTMLCanvasElement */\nimport React from \"react\";\nimport type { PointerEvent } from \"react\";\nimport type { LayoutChangeEvent } from \"react-native\";\nimport { PixelRatio, View } from \"react-native\";\n\nimport type { SkRect, SkCanvas } from \"../skia/types\";\nimport type { SkiaValue } from \"../values\";\nimport { JsiSkSurface } from \"../skia/web/JsiSkSurface\";\n\nimport type { DrawingInfo, DrawMode, SkiaViewProps, TouchInfo } from \"./types\";\nimport { TouchType } from \"./types\";\n\nconst pd = PixelRatio.get();\n\nexport class SkiaView extends React.Component<SkiaViewProps> {\n constructor(props: SkiaViewProps) {\n super(props);\n this._mode = props.mode ?? \"default\";\n }\n\n private _surface: JsiSkSurface | null = null;\n private _unsubscriptions: Array<() => void> = [];\n private _touches: Array<TouchInfo> = [];\n private _canvas: SkCanvas | null = null;\n private _canvasRef = React.createRef<HTMLCanvasElement>();\n private _mode: DrawMode;\n private _redrawRequests = 0;\n private width = 0;\n private height = 0;\n private requestId = 0;\n\n private unsubscribeAll() {\n this._unsubscriptions.forEach((u) => u());\n this._unsubscriptions = [];\n }\n\n private onLayout(evt: LayoutChangeEvent) {\n const { CanvasKit } = global;\n const { width, height } = evt.nativeEvent.layout;\n this.width = width;\n this.height = height;\n // Reset canvas / surface on layout change\n if (this._canvasRef.current) {\n const canvas = this._canvasRef.current;\n canvas.width = canvas.clientWidth * pd;\n canvas.height = canvas.clientHeight * pd;\n const surface = CanvasKit.MakeWebGLCanvasSurface(this._canvasRef.current);\n if (!surface) {\n throw new Error(\"Could not create surface\");\n }\n this._surface = new JsiSkSurface(CanvasKit, surface);\n this._canvas = this._surface.getCanvas();\n this.redraw();\n }\n }\n\n componentDidMount() {\n // Start render loop\n this.tick();\n }\n\n componentDidUpdate() {\n this.redraw();\n }\n\n componentWillUnmount() {\n this.unsubscribeAll();\n cancelAnimationFrame(this.requestId);\n }\n\n /**\n * Creates a snapshot from the canvas in the surface\n * @param rect Rect to use as bounds. Optional.\n * @returns An Image object.\n */\n public makeImageSnapshot(rect?: SkRect) {\n return this._surface?.makeImageSnapshot(rect);\n }\n\n /**\n * Sends a redraw request to the native SkiaView.\n */\n private tick() {\n if (this._mode === \"continuous\" || this._redrawRequests > 0) {\n this._redrawRequests = 0;\n if (this._canvas && this.props.onDraw) {\n const touches = [...this._touches];\n this._touches = [];\n const info: DrawingInfo = {\n height: this.height,\n width: this.width,\n timestamp: Date.now(),\n touches: touches.map((t) => [t]),\n };\n if (this.props.onDraw) {\n const canvas = this._canvas!;\n canvas.save();\n canvas.scale(pd, pd);\n this.props.onDraw(canvas, info);\n canvas.restore();\n }\n this._surface?.ref.flush();\n }\n }\n this.requestId = requestAnimationFrame(this.tick.bind(this));\n }\n\n public redraw() {\n this._redrawRequests++;\n }\n\n /**\n * Updates the drawing mode for the skia view. This is the same\n * as declaratively setting the mode property on the SkiaView.\n * There are two drawing modes, \"continuous\" and \"default\",\n * where the continuous mode will continuously redraw the view and\n * the default mode will only redraw when any of the regular react\n * properties are changed like size and margins.\n * @param mode Drawing mode to use.\n */\n public setDrawMode(mode: DrawMode) {\n this._mode = mode;\n this.tick();\n }\n\n /**\n * Registers one or move values as a dependant value of the Skia View. The view will\n * The view will redraw itself when any of the values change.\n * @param values Values to register\n */\n public registerValues(_values: SkiaValue<unknown>[]) {\n // Unsubscribe from dependency values\n this.unsubscribeAll();\n // Register redraw dependencies on values\n _values.forEach((v) => {\n this._unsubscriptions.push(\n v.addListener(() => {\n this.redraw();\n })\n );\n });\n }\n\n private handleTouchEvent(evt: PointerEvent, touchType: TouchType) {\n this._touches.push({\n id: evt.pointerId,\n x: evt.clientX - evt.currentTarget.getClientRects()[0].left,\n y: evt.clientY - evt.currentTarget.getClientRects()[0].top,\n force: evt.pressure,\n type: touchType,\n timestamp: Date.now(),\n });\n this.redraw();\n }\n\n createTouchHandler(touchType: TouchType) {\n return (evt: PointerEvent) => this.handleTouchEvent(evt, touchType);\n }\n\n render() {\n const { mode, debug = false, ...viewProps } = this.props;\n return (\n <View {...viewProps} onLayout={this.onLayout.bind(this)}>\n <canvas\n ref={this._canvasRef}\n style={{ display: \"flex\", flex: 1 }}\n onPointerDown={this.createTouchHandler(TouchType.Start)}\n onPointerMove={this.createTouchHandler(TouchType.Active)}\n onPointerUp={this.createTouchHandler(TouchType.End)}\n onPointerCancel={this.createTouchHandler(TouchType.Cancelled)}\n onPointerLeave={this.createTouchHandler(TouchType.End)}\n onPointerOut={this.createTouchHandler(TouchType.End)}\n />\n </View>\n );\n }\n}\n"],"mappings":";;;;;;;AACA;;AAGA;;AAIA;;AAGA;;;;;;;;AAEA,MAAMA,EAAE,GAAGC,uBAAA,CAAWC,GAAX,EAAX;;AAEO,MAAMC,QAAN,SAAuBC,cAAA,CAAMC,SAA7B,CAAsD;EAC3DC,WAAW,CAACC,KAAD,EAAuB;IAChC,MAAMA,KAAN;;IADgC,kCAKM,IALN;;IAAA,0CAMY,EANZ;;IAAA,kCAOG,EAPH;;IAAA,iCAQC,IARD;;IAAA,iDASbH,cAAA,CAAMI,SAAN,EATa;;IAAA;;IAAA,yCAWR,CAXQ;;IAAA,+BAYlB,CAZkB;;IAAA,gCAajB,CAbiB;;IAAA,mCAcd,CAdc;;IAEhC,KAAKC,KAAL,GAAaF,KAAK,CAACG,IAAN,IAAc,SAA3B;EACD;;EAaOC,cAAc,GAAG;IACvB,K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AL,CAAwBM,gBAAA,CAAUC,KAAlC,CAHjB;MAIE,aAAa,EAAE,KAAKP,kBAAL,CAAwBM,gBAAA,CAAUE,MAAlC,CAJjB;MAKE,WAAW,EAAE,KAAKR,kBAAL,CAAwBM,gBAAA,CAAUG,GAAlC,CALf;MAME,eAAe,EAAE,KAAKT,kBAAL,CAAwBM,gBAAA,CAAUI,SAAlC,CANnB;MAOE,cAAc,EAAE,KAAKV,kBAAL,CAAwBM,gBAAA,CAAUG,GAAlC,CAPlB;MAQE,YAAY,EAAE,KAAKT,kBAAL,CAAwBM,gBAAA,CAAUG,GAAlC;IARhB,EADF,CADF;EAcD;;AAjK0D"}
@@ -1 +1 @@
1
- {"version":3,"sources":["api.ts"],"names":["SkiaViewApi","global"],"mappings":";;;;;;AAMO,MAAM;AAAEA,EAAAA;AAAF,IAAkBC,MAAxB","sourcesContent":["import type { ISkiaViewApi } from \"./types\";\n\ndeclare global {\n var SkiaViewApi: ISkiaViewApi;\n}\n\nexport const { SkiaViewApi } = global;\n"]}
1
+ {"version":3,"names":["SkiaViewApi","global"],"sources":["api.ts"],"sourcesContent":["import type { ISkiaViewApi } from \"./types\";\n\ndeclare global {\n var SkiaViewApi: ISkiaViewApi;\n}\n\nexport const { SkiaViewApi } = global;\n"],"mappings":";;;;;;AAMO,MAAM;EAAEA;AAAF,IAAkBC,MAAxB"}
@@ -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","sourcesContent":["export * from \"./SkiaView\";\nexport * from \"./types\";\nexport * from \"./useDrawCallback\";\nexport * from \"./useTouchHandler\";\n"]}
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./SkiaView\";\nexport * from \"./types\";\nexport * from \"./useDrawCallback\";\nexport * from \"./useTouchHandler\";\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"}
@@ -1 +1 @@
1
- {"version":3,"sources":["types.ts"],"names":["TouchType"],"mappings":";;;;;;IAYYA,S;;;WAAAA,S;AAAAA,EAAAA,S,CAAAA,S;AAAAA,EAAAA,S,CAAAA,S;AAAAA,EAAAA,S,CAAAA,S;AAAAA,EAAAA,S,CAAAA,S;GAAAA,S,yBAAAA,S","sourcesContent":["import type { ViewProps } from \"react-native\";\n\nimport type { SkCanvas, SkImage, SkRect } from \"../skia/types\";\nimport type { SkiaValue } from \"../values\";\n\nexport type DrawMode = \"continuous\" | \"default\";\n\nexport type NativeSkiaViewProps = ViewProps & {\n mode?: DrawMode;\n debug?: boolean;\n};\n\nexport enum TouchType {\n Start,\n Active,\n End,\n Cancelled,\n}\n\nexport interface TouchInfo {\n x: number;\n y: number;\n force: number;\n type: TouchType;\n id: number;\n timestamp: number;\n}\n\nexport interface DrawingInfo {\n width: number;\n height: number;\n timestamp: number;\n touches: Array<Array<TouchInfo>>;\n}\n\nexport type ExtendedTouchInfo = TouchInfo & {\n // points per second\n velocityX: number;\n velocityY: number;\n};\n\nexport type TouchHandlers = {\n onStart?: (touchInfo: TouchInfo) => void;\n onActive?: (touchInfo: ExtendedTouchInfo) => void;\n onEnd?: (touchInfo: ExtendedTouchInfo) => void;\n};\n\nexport type TouchHandler = (touchInfo: Array<Array<TouchInfo>>) => void;\n\nexport type RNSkiaDrawCallback = (canvas: SkCanvas, info: DrawingInfo) => void;\n\n/**\n * Listener interface for value changes\n */\nexport interface ValueListener {\n addListener: (callback: () => void) => number;\n removeListener: (id: number) => void;\n}\n\nexport interface ISkiaViewApi {\n setJsiProperty: <T>(nativeId: number, name: string, value: T) => void;\n callJsiMethod: <T extends Array<unknown>>(\n nativeId: number,\n name: string,\n ...args: T\n ) => void;\n registerValuesInView: (\n nativeId: number,\n values: SkiaValue<unknown>[]\n ) => () => void;\n requestRedraw: (nativeId: number) => void;\n makeImageSnapshot: (nativeId: number, rect?: SkRect) => SkImage;\n}\n\nexport interface SkiaViewProps extends ViewProps {\n /**\n * Sets the drawing mode for the skia view. There are two drawing\n * modes, \"continuous\" and \"default\", where the continuous mode will\n * continuously redraw the view, and the default mode will only\n * redraw when any of the regular react properties are changed like\n * sizes and margins.\n */\n mode?: DrawMode;\n /**\n * When set to true the view will display information about the\n * average time it takes to render.\n */\n debug?: boolean;\n /**\n * Draw callback. Will be called whenever the view is invalidated and\n * needs to redraw. This is either caused by a change in a react\n * property, a touch event, or a call to redraw. If the view is in\n * continuous mode the callback will be called 60 frames per second\n * by the native view.\n */\n onDraw?: RNSkiaDrawCallback;\n}\n"]}
1
+ {"version":3,"names":["TouchType"],"sources":["types.ts"],"sourcesContent":["import type { ViewProps } from \"react-native\";\n\nimport type { SkCanvas, SkImage, SkRect } from \"../skia/types\";\nimport type { SkiaValue } from \"../values\";\n\nexport type DrawMode = \"continuous\" | \"default\";\n\nexport type NativeSkiaViewProps = ViewProps & {\n mode?: DrawMode;\n debug?: boolean;\n};\n\nexport enum TouchType {\n Start,\n Active,\n End,\n Cancelled,\n}\n\nexport interface TouchInfo {\n x: number;\n y: number;\n force: number;\n type: TouchType;\n id: number;\n timestamp: number;\n}\n\nexport interface DrawingInfo {\n width: number;\n height: number;\n timestamp: number;\n touches: Array<Array<TouchInfo>>;\n}\n\nexport type ExtendedTouchInfo = TouchInfo & {\n // points per second\n velocityX: number;\n velocityY: number;\n};\n\nexport type TouchHandlers = {\n onStart?: (touchInfo: TouchInfo) => void;\n onActive?: (touchInfo: ExtendedTouchInfo) => void;\n onEnd?: (touchInfo: ExtendedTouchInfo) => void;\n};\n\nexport type TouchHandler = (touchInfo: Array<Array<TouchInfo>>) => void;\n\nexport type RNSkiaDrawCallback = (canvas: SkCanvas, info: DrawingInfo) => void;\n\n/**\n * Listener interface for value changes\n */\nexport interface ValueListener {\n addListener: (callback: () => void) => number;\n removeListener: (id: number) => void;\n}\n\nexport interface ISkiaViewApi {\n setJsiProperty: <T>(nativeId: number, name: string, value: T) => void;\n callJsiMethod: <T extends Array<unknown>>(\n nativeId: number,\n name: string,\n ...args: T\n ) => void;\n registerValuesInView: (\n nativeId: number,\n values: SkiaValue<unknown>[]\n ) => () => void;\n requestRedraw: (nativeId: number) => void;\n makeImageSnapshot: (nativeId: number, rect?: SkRect) => SkImage;\n}\n\nexport interface SkiaViewProps extends ViewProps {\n /**\n * Sets the drawing mode for the skia view. There are two drawing\n * modes, \"continuous\" and \"default\", where the continuous mode will\n * continuously redraw the view, and the default mode will only\n * redraw when any of the regular react properties are changed like\n * sizes and margins.\n */\n mode?: DrawMode;\n /**\n * When set to true the view will display information about the\n * average time it takes to render.\n */\n debug?: boolean;\n /**\n * Draw callback. Will be called whenever the view is invalidated and\n * needs to redraw. This is either caused by a change in a react\n * property, a touch event, or a call to redraw. If the view is in\n * continuous mode the callback will be called 60 frames per second\n * by the native view.\n */\n onDraw?: RNSkiaDrawCallback;\n}\n"],"mappings":";;;;;;IAYYA,S;;;WAAAA,S;EAAAA,S,CAAAA,S;EAAAA,S,CAAAA,S;EAAAA,S,CAAAA,S;EAAAA,S,CAAAA,S;GAAAA,S,yBAAAA,S"}
@@ -1 +1 @@
1
- {"version":3,"sources":["useDrawCallback.ts"],"names":["useDrawCallback","callback","deps"],"mappings":";;;;;;;AACA;;AAIA;AACA;AACA;AACA;AACA;AACO,MAAMA,eAAe,GAAG,UAC7BC,QAD6B,EAG1B;AAAA,MADHC,IACG,uEADoB,EACpB;AACH,SAAO,oBAAQ,MAAM;AACnB,WAAOD,QAAP,CADmB,CAEnB;AACD,GAHM,EAGJC,IAHI,CAAP;AAID,CARM","sourcesContent":["import type { DependencyList } from \"react\";\nimport { useMemo } from \"react\";\n\nimport type { RNSkiaDrawCallback } from \"./types\";\n\n/**\n * Creates a memoized callback for the onDraw handler of a Skia component.\n * @param callback The callback to memoize.\n * @param deps Dependencies for the callback.\n * */\nexport const useDrawCallback = (\n callback: RNSkiaDrawCallback,\n deps: DependencyList = []\n) => {\n return useMemo(() => {\n return callback;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, deps);\n};\n"]}
1
+ {"version":3,"names":["useDrawCallback","callback","deps","useMemo"],"sources":["useDrawCallback.ts"],"sourcesContent":["import type { DependencyList } from \"react\";\nimport { useMemo } from \"react\";\n\nimport type { RNSkiaDrawCallback } from \"./types\";\n\n/**\n * Creates a memoized callback for the onDraw handler of a Skia component.\n * @param callback The callback to memoize.\n * @param deps Dependencies for the callback.\n * */\nexport const useDrawCallback = (\n callback: RNSkiaDrawCallback,\n deps: DependencyList = []\n) => {\n return useMemo(() => {\n return callback;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, deps);\n};\n"],"mappings":";;;;;;;AACA;;AAIA;AACA;AACA;AACA;AACA;AACO,MAAMA,eAAe,GAAG,UAC7BC,QAD6B,EAG1B;EAAA,IADHC,IACG,uEADoB,EACpB;EACH,OAAO,IAAAC,cAAA,EAAQ,MAAM;IACnB,OAAOF,QAAP,CADmB,CAEnB;EACD,CAHM,EAGJC,IAHI,CAAP;AAID,CARM"}
@@ -21,7 +21,7 @@ const useInternalTouchHandler = function (handlers) {
21
21
  history.forEach(touches => {
22
22
  // Enumerate touches
23
23
  for (let i = 0; i < touches.length; i++) {
24
- var _prevTouchInfoRef$cur, _prevTouchInfoRef$cur2, _prevTouch$x, _prevTouch$y, _prevVelocityRef$curr, _prevVelocityRef$curr2, _prevVelocityRef$curr3, _prevVelocityRef$curr4;
24
+ var _prevTouchInfoRef$cur, _prevVelocityRef$curr, _prevVelocityRef$curr2;
25
25
 
26
26
  if (!multiTouch && i > 0) {
27
27
  break;
@@ -30,9 +30,9 @@ const useInternalTouchHandler = function (handlers) {
30
30
  const touch = touches[i];
31
31
  const prevTouch = prevTouchInfoRef.current[touch.id]; // Calculate the velocity from the previous touch.
32
32
 
33
- const timeDiffseconds = touch.timestamp - ((_prevTouchInfoRef$cur = (_prevTouchInfoRef$cur2 = prevTouchInfoRef.current[touch.id]) === null || _prevTouchInfoRef$cur2 === void 0 ? void 0 : _prevTouchInfoRef$cur2.timestamp) !== null && _prevTouchInfoRef$cur !== void 0 ? _prevTouchInfoRef$cur : touch.timestamp);
34
- const distX = touch.x - ((_prevTouch$x = prevTouch === null || prevTouch === void 0 ? void 0 : prevTouch.x) !== null && _prevTouch$x !== void 0 ? _prevTouch$x : touch.x);
35
- const distY = touch.y - ((_prevTouch$y = prevTouch === null || prevTouch === void 0 ? void 0 : prevTouch.y) !== null && _prevTouch$y !== void 0 ? _prevTouch$y : touch.y);
33
+ const timeDiffseconds = touch.timestamp - (((_prevTouchInfoRef$cur = prevTouchInfoRef.current[touch.id]) === null || _prevTouchInfoRef$cur === void 0 ? void 0 : _prevTouchInfoRef$cur.timestamp) ?? touch.timestamp);
34
+ const distX = touch.x - ((prevTouch === null || prevTouch === void 0 ? void 0 : prevTouch.x) ?? touch.x);
35
+ const distY = touch.y - ((prevTouch === null || prevTouch === void 0 ? void 0 : prevTouch.y) ?? touch.y);
36
36
 
37
37
  if (touch.type !== _types.TouchType.Start && touch.type !== _types.TouchType.End && touch.type !== _types.TouchType.Cancelled && timeDiffseconds > 0) {
38
38
  prevVelocityRef.current[touch.id] = {
@@ -42,8 +42,8 @@ const useInternalTouchHandler = function (handlers) {
42
42
  }
43
43
 
44
44
  const extendedTouchInfo = { ...touch,
45
- velocityX: (_prevVelocityRef$curr = (_prevVelocityRef$curr2 = prevVelocityRef.current[touch.id]) === null || _prevVelocityRef$curr2 === void 0 ? void 0 : _prevVelocityRef$curr2.x) !== null && _prevVelocityRef$curr !== void 0 ? _prevVelocityRef$curr : 0,
46
- velocityY: (_prevVelocityRef$curr3 = (_prevVelocityRef$curr4 = prevVelocityRef.current[touch.id]) === null || _prevVelocityRef$curr4 === void 0 ? void 0 : _prevVelocityRef$curr4.y) !== null && _prevVelocityRef$curr3 !== void 0 ? _prevVelocityRef$curr3 : 0
45
+ velocityX: ((_prevVelocityRef$curr = prevVelocityRef.current[touch.id]) === null || _prevVelocityRef$curr === void 0 ? void 0 : _prevVelocityRef$curr.x) ?? 0,
46
+ velocityY: ((_prevVelocityRef$curr2 = prevVelocityRef.current[touch.id]) === null || _prevVelocityRef$curr2 === void 0 ? void 0 : _prevVelocityRef$curr2.y) ?? 0
47
47
  }; // Save previous touch
48
48
 
49
49
  prevTouchInfoRef.current[touch.id] = touch;
@@ -1 +1 @@
1
- {"version":3,"sources":["useTouchHandler.ts"],"names":["useInternalTouchHandler","handlers","deps","multiTouch","prevTouchInfoRef","prevVelocityRef","history","forEach","touches","i","length","touch","prevTouch","current","id","timeDiffseconds","timestamp","distX","x","distY","y","type","TouchType","Start","End","Cancelled","PixelRatio","get","extendedTouchInfo","velocityX","velocityY","onStart","Active","onActive","onEnd","useTouchHandler","useMultiTouchHandler"],"mappings":";;;;;;;AACA;;AACA;;AAUA;;AAEA,MAAMA,uBAAuB,GAAG,UAC9BC,QAD8B,EAIb;AAAA,MAFjBC,IAEiB,uEAFM,EAEN;AAAA,MADjBC,UACiB,uEADJ,KACI;AACjB,QAAMC,gBAAgB,GAAG,mBAAiD,EAAjD,CAAzB;AACA,QAAMC,eAAe,GAAG,mBAA8C,EAA9C,CAAxB;AAEA,SAAO,wBAAaC,OAAD,IAAsC;AACvD;AACAA,IAAAA,OAAO,CAACC,OAAR,CAAiBC,OAAD,IAAa;AAC3B;AACA,WAAK,IAAI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,SAAOF,uBAAuB,CAACC,QAAD,EAAWC,IAAX,EAAiB,IAAjB,CAA9B;AACD,CALM","sourcesContent":["import type { DependencyList } from \"react\";\nimport { useCallback, useRef } from \"react\";\nimport { PixelRatio } from \"react-native\";\n\nimport type { Vector } from \"../skia/types\";\n\nimport type {\n ExtendedTouchInfo,\n TouchHandlers,\n TouchHandler,\n TouchInfo,\n} from \"./types\";\nimport { TouchType } from \"./types\";\n\nconst useInternalTouchHandler = (\n handlers: TouchHandlers,\n deps: DependencyList = [],\n multiTouch = false\n): TouchHandler => {\n const prevTouchInfoRef = useRef<{ [key: number]: TouchInfo | undefined }>({});\n const prevVelocityRef = useRef<{ [key: number]: Vector | undefined }>({});\n\n return useCallback((history: Array<Array<TouchInfo>>) => {\n // Process all items in the current touch history\n history.forEach((touches) => {\n // Enumerate touches\n for (let i = 0; i < touches.length; i++) {\n if (!multiTouch && i > 0) {\n break;\n }\n\n const touch = touches[i];\n const prevTouch = prevTouchInfoRef.current[touch.id];\n // Calculate the velocity from the previous touch.\n const timeDiffseconds =\n touch.timestamp -\n (prevTouchInfoRef.current[touch.id]?.timestamp ?? touch.timestamp);\n\n const distX = touch.x - (prevTouch?.x ?? touch.x);\n const distY = touch.y - (prevTouch?.y ?? touch.y);\n\n if (\n touch.type !== TouchType.Start &&\n touch.type !== TouchType.End &&\n touch.type !== TouchType.Cancelled &&\n timeDiffseconds > 0\n ) {\n prevVelocityRef.current[touch.id] = {\n x: distX / timeDiffseconds / PixelRatio.get(),\n y: distY / timeDiffseconds / PixelRatio.get(),\n };\n }\n\n const extendedTouchInfo: ExtendedTouchInfo = {\n ...touch,\n velocityX: prevVelocityRef.current[touch.id]?.x ?? 0,\n velocityY: prevVelocityRef.current[touch.id]?.y ?? 0,\n };\n\n // Save previous touch\n prevTouchInfoRef.current[touch.id] = touch;\n\n if (touch.type === TouchType.Start) {\n delete prevVelocityRef.current[touch.id];\n handlers.onStart && handlers.onStart(touch);\n } else if (touch.type === TouchType.Active) {\n handlers.onActive && handlers.onActive(extendedTouchInfo);\n } else {\n handlers.onEnd && handlers.onEnd(extendedTouchInfo);\n }\n }\n });\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, deps);\n};\n\n/**\n * Provides a callback for handling touch events in the Skia View.\n * This touch handler only handles single touches.\n * @param handlers Callbacks for the different touch states\n * @param deps optional Dependency array to update the handlers\n * @returns A function that can be used from within the onDraw callback to\n * update and handle touch events. Call it with the touches property from\n * the info object.\n */\nexport const useTouchHandler = (\n handlers: TouchHandlers,\n deps: DependencyList = []\n): TouchHandler => {\n return useInternalTouchHandler(handlers, deps, false);\n};\n\n/**\n * Provides a callback for handling touch events in the Skia View.\n * This touch handler handles multiple touches.\n * @param handlers Callbacks for the different touch states\n * @param deps optional Dependency array to update the handlers\n * @returns A function that can be used from within the onDraw callback to\n * update and handle touch events. Call it with the touches property from\n * the info object.\n */\nexport const useMultiTouchHandler = (\n handlers: TouchHandlers,\n deps: DependencyList = []\n): TouchHandler => {\n return useInternalTouchHandler(handlers, deps, true);\n};\n"]}
1
+ {"version":3,"names":["useInternalTouchHandler","handlers","deps","multiTouch","prevTouchInfoRef","useRef","prevVelocityRef","useCallback","history","forEach","touches","i","length","touch","prevTouch","current","id","timeDiffseconds","timestamp","distX","x","distY","y","type","TouchType","Start","End","Cancelled","PixelRatio","get","extendedTouchInfo","velocityX","velocityY","onStart","Active","onActive","onEnd","useTouchHandler","useMultiTouchHandler"],"sources":["useTouchHandler.ts"],"sourcesContent":["import type { DependencyList } from \"react\";\nimport { useCallback, useRef } from \"react\";\nimport { PixelRatio } from \"react-native\";\n\nimport type { Vector } from \"../skia/types\";\n\nimport type {\n ExtendedTouchInfo,\n TouchHandlers,\n TouchHandler,\n TouchInfo,\n} from \"./types\";\nimport { TouchType } from \"./types\";\n\nconst useInternalTouchHandler = (\n handlers: TouchHandlers,\n deps: DependencyList = [],\n multiTouch = false\n): TouchHandler => {\n const prevTouchInfoRef = useRef<{ [key: number]: TouchInfo | undefined }>({});\n const prevVelocityRef = useRef<{ [key: number]: Vector | undefined }>({});\n\n return useCallback((history: Array<Array<TouchInfo>>) => {\n // Process all items in the current touch history\n history.forEach((touches) => {\n // Enumerate touches\n for (let i = 0; i < touches.length; i++) {\n if (!multiTouch && i > 0) {\n break;\n }\n\n const touch = touches[i];\n const prevTouch = prevTouchInfoRef.current[touch.id];\n // Calculate the velocity from the previous touch.\n const timeDiffseconds =\n touch.timestamp -\n (prevTouchInfoRef.current[touch.id]?.timestamp ?? touch.timestamp);\n\n const distX = touch.x - (prevTouch?.x ?? touch.x);\n const distY = touch.y - (prevTouch?.y ?? touch.y);\n\n if (\n touch.type !== TouchType.Start &&\n touch.type !== TouchType.End &&\n touch.type !== TouchType.Cancelled &&\n timeDiffseconds > 0\n ) {\n prevVelocityRef.current[touch.id] = {\n x: distX / timeDiffseconds / PixelRatio.get(),\n y: distY / timeDiffseconds / PixelRatio.get(),\n };\n }\n\n const extendedTouchInfo: ExtendedTouchInfo = {\n ...touch,\n velocityX: prevVelocityRef.current[touch.id]?.x ?? 0,\n velocityY: prevVelocityRef.current[touch.id]?.y ?? 0,\n };\n\n // Save previous touch\n prevTouchInfoRef.current[touch.id] = touch;\n\n if (touch.type === TouchType.Start) {\n delete prevVelocityRef.current[touch.id];\n handlers.onStart && handlers.onStart(touch);\n } else if (touch.type === TouchType.Active) {\n handlers.onActive && handlers.onActive(extendedTouchInfo);\n } else {\n handlers.onEnd && handlers.onEnd(extendedTouchInfo);\n }\n }\n });\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, deps);\n};\n\n/**\n * Provides a callback for handling touch events in the Skia View.\n * This touch handler only handles single touches.\n * @param handlers Callbacks for the different touch states\n * @param deps optional Dependency array to update the handlers\n * @returns A function that can be used from within the onDraw callback to\n * update and handle touch events. Call it with the touches property from\n * the info object.\n */\nexport const useTouchHandler = (\n handlers: TouchHandlers,\n deps: DependencyList = []\n): TouchHandler => {\n return useInternalTouchHandler(handlers, deps, false);\n};\n\n/**\n * Provides a callback for handling touch events in the Skia View.\n * This touch handler handles multiple touches.\n * @param handlers Callbacks for the different touch states\n * @param deps optional Dependency array to update the handlers\n * @returns A function that can be used from within the onDraw callback to\n * update and handle touch events. Call it with the touches property from\n * the info object.\n */\nexport const useMultiTouchHandler = (\n handlers: TouchHandlers,\n deps: DependencyList = []\n): TouchHandler => {\n return useInternalTouchHandler(handlers, deps, true);\n};\n"],"mappings":";;;;;;;AACA;;AACA;;AAUA;;AAEA,MAAMA,uBAAuB,GAAG,UAC9BC,QAD8B,EAIb;EAAA,IAFjBC,IAEiB,uEAFM,EAEN;EAAA,IADjBC,UACiB,uEADJ,KACI;EACjB,MAAMC,gBAAgB,GAAG,IAAAC,aAAA,EAAiD,EAAjD,CAAzB;EACA,MAAMC,eAAe,GAAG,IAAAD,aAAA,EAA8C,EAA9C,CAAxB;EAEA,OAAO,IAAAE,kBAAA,EAAaC,OAAD,IAAsC;IACvD;IACAA,OAAO,CAACC,OAAR,CAAiBC,OAAD,IAAa;MAC3B;MACA,KAAK,IAAIC,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGD,OAAO,CAACE,MAA5B,EAAoCD,CAAC,EAArC,EAAyC;QAAA;;QACvC,IAAI,CAACR,UAAD,IAAeQ,CAAC,GAAG,CAAvB,EAA0B;UACxB;QACD;;QAED,MAAME,KAAK,GAAGH,OAAO,CAACC,CAAD,CAArB;QACA,MAAMG,SAAS,GAAGV,gBAAgB,CAACW,OAAjB,CAAyBF,KAAK,CAACG,EAA/B,CAAlB,CANuC,CAOvC;;QACA,MAAMC,eAAe,GACnBJ,KAAK,CAACK,SAAN,IACC,0BAAAd,gBAAgB,CAACW,OAAjB,CAAyBF,KAAK,CAACG,EAA/B,iFAAoCE,SAApC,KAAiDL,KAAK,CAACK,SADxD,CADF;QAIA,MAAMC,KAAK,GAAGN,KAAK,CAACO,CAAN,IAAW,CAAAN,SAAS,SAAT,IAAAA,SAAS,WAAT,YAAAA,SAAS,CAAEM,CAAX,KAAgBP,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AA7B,EAAqC;UAC1CjC,QAAQ,CAACkC,QAAT,IAAqBlC,QAAQ,CAACkC,QAAT,CAAkBL,iBAAlB,CAArB;QACD,CAFM,MAEA;UACL7B,QAAQ,CAACmC,KAAT,IAAkBnC,QAAQ,CAACmC,KAAT,CAAeN,iBAAf,CAAlB;QACD;MACF;IACF,CA/CD,EAFuD,CAkDvD;EACD,CAnDM,EAmDJ5B,IAnDI,CAAP;AAoDD,CA5DD;AA8DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAMmC,eAAe,GAAG,UAC7BpC,QAD6B,EAGZ;EAAA,IADjBC,IACiB,uEADM,EACN;EACjB,OAAOF,uBAAuB,CAACC,QAAD,EAAWC,IAAX,EAAiB,KAAjB,CAA9B;AACD,CALM;AAOP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AACO,MAAMoC,oBAAoB,GAAG,UAClCrC,QADkC,EAGjB;EAAA,IADjBC,IACiB,uEADM,EACN;EACjB,OAAOF,uBAAuB,CAACC,QAAD,EAAWC,IAAX,EAAiB,IAAjB,CAA9B;AACD,CALM"}
@@ -1 +1 @@
1
- {"version":3,"sources":["LoadSkiaWeb.tsx"],"names":["LoadSkiaWeb","opts","global","CanvasKit","undefined","LoadSkia"],"mappings":";;;;;;;AAEA;;;;AAFA;AACA;AAWO,MAAMA,WAAW,GAAG,MAAOC,IAAP,IAAuC;AAChE,MAAIC,MAAM,CAACC,SAAP,KAAqBC,SAAzB,EAAoC;AAClC;AACD;;AACD,QAAMD,SAAS,GAAG,MAAM,wBAAcF,IAAd,CAAxB,CAJgE,CAKhE;AACA;;AACAC,EAAAA,MAAM,CAACC,SAAP,GAAmBA,SAAnB;AACD,CARM,C,CAUP;;;;AACO,MAAME,QAAQ,GAAGL,WAAjB","sourcesContent":["// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-expect-error\nimport CanvasKitInit from \"canvaskit-wasm/bin/full/canvaskit\";\nimport type {\n CanvasKit as CanvasKitType,\n CanvasKitInitOptions,\n} from \"canvaskit-wasm\";\n\ndeclare global {\n var CanvasKit: CanvasKitType;\n}\n\nexport const LoadSkiaWeb = async (opts?: CanvasKitInitOptions) => {\n if (global.CanvasKit !== undefined) {\n return;\n }\n const CanvasKit = await CanvasKitInit(opts);\n // The CanvasKit API is stored on the global object and used\n // to create the JsiSKApi in the Skia.web.ts file.\n global.CanvasKit = CanvasKit;\n};\n\n// We keep this function for backward compatibility\nexport const LoadSkia = LoadSkiaWeb;\n"]}
1
+ {"version":3,"names":["LoadSkiaWeb","opts","global","CanvasKit","undefined","CanvasKitInit","LoadSkia"],"sources":["LoadSkiaWeb.tsx"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-expect-error\nimport CanvasKitInit from \"canvaskit-wasm/bin/full/canvaskit\";\nimport type {\n CanvasKit as CanvasKitType,\n CanvasKitInitOptions,\n} from \"canvaskit-wasm\";\n\ndeclare global {\n var CanvasKit: CanvasKitType;\n}\n\nexport const LoadSkiaWeb = async (opts?: CanvasKitInitOptions) => {\n if (global.CanvasKit !== undefined) {\n return;\n }\n const CanvasKit = await CanvasKitInit(opts);\n // The CanvasKit API is stored on the global object and used\n // to create the JsiSKApi in the Skia.web.ts file.\n global.CanvasKit = CanvasKit;\n};\n\n// We keep this function for backward compatibility\nexport const LoadSkia = LoadSkiaWeb;\n"],"mappings":";;;;;;;AAEA;;;;AAFA;AACA;AAWO,MAAMA,WAAW,GAAG,MAAOC,IAAP,IAAuC;EAChE,IAAIC,MAAM,CAACC,SAAP,KAAqBC,SAAzB,EAAoC;IAClC;EACD;;EACD,MAAMD,SAAS,GAAG,MAAM,IAAAE,kBAAA,EAAcJ,IAAd,CAAxB,CAJgE,CAKhE;EACA;;EACAC,MAAM,CAACC,SAAP,GAAmBA,SAAnB;AACD,CARM,C,CAUP;;;;AACO,MAAMG,QAAQ,GAAGN,WAAjB"}
@@ -33,7 +33,7 @@ const WithSkiaWeb = _ref => {
33
33
  return getComponent();
34
34
  }), [getComponent, opts]);
35
35
  return /*#__PURE__*/_react.default.createElement(_react.Suspense, {
36
- fallback: fallback !== null && fallback !== void 0 ? fallback : null
36
+ fallback: fallback ?? null
37
37
  }, /*#__PURE__*/_react.default.createElement(Inner, null));
38
38
  };
39
39
 
@@ -1 +1 @@
1
- {"version":3,"sources":["WithSkiaWeb.tsx"],"names":["WithSkiaWeb","getComponent","fallback","opts","Inner","Platform","OS","console","warn"],"mappings":";;;;;;;AACA;;AACA;;AAEA;;;;;;AAQO,MAAMA,WAAW,GAAG,QAIN;AAAA,MAJO;AAC1BC,IAAAA,YAD0B;AAE1BC,IAAAA,QAF0B;AAG1BC,IAAAA;AAH0B,GAIP;AACnB,QAAMC,KAAK,GAAG,qBACZ;AACA;AACA,qBACE,iBAAK,YAAY;AACf,QAAIC,sBAASC,EAAT,KAAgB,KAApB,EAA2B;AACzB,YAAM,8BAAYH,IAAZ,CAAN;AACD,KAFD,MAEO;AACLI,MAAAA,OAAO,CAACC,IAAR,CACE,yEADF;AAGD;;AACD,WAAOP,YAAY,EAAnB;AACD,GATD,CAJU,EAcZ,CAACA,YAAD,EAAeE,IAAf,CAdY,CAAd;AAgBA,sBACE,6BAAC,eAAD;AAAU,IAAA,QAAQ,EAAED,QAAF,aAAEA,QAAF,cAAEA,QAAF,GAAc;AAAhC,kBACE,6BAAC,KAAD,OADF,CADF;AAKD,CA1BM","sourcesContent":["import type { ComponentProps, ComponentType } from \"react\";\nimport React, { useMemo, lazy, Suspense } from \"react\";\nimport { Platform } from \"react-native\";\n\nimport { LoadSkiaWeb } from \"./LoadSkiaWeb\";\n\ninterface WithSkiaProps {\n fallback?: ComponentProps<typeof Suspense>[\"fallback\"];\n getComponent: () => Promise<{ default: ComponentType }>;\n opts?: Parameters<typeof LoadSkiaWeb>[0];\n}\n\nexport const WithSkiaWeb = ({\n getComponent,\n fallback,\n opts,\n}: WithSkiaProps) => {\n const Inner = useMemo(\n // TODO: investigate\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (): any =>\n lazy(async () => {\n if (Platform.OS === \"web\") {\n await LoadSkiaWeb(opts);\n } else {\n console.warn(\n \"<WithSkiaWeb /> is only necessary on web. Consider not using on native.\"\n );\n }\n return getComponent();\n }),\n [getComponent, opts]\n );\n return (\n <Suspense fallback={fallback ?? null}>\n <Inner />\n </Suspense>\n );\n};\n"]}
1
+ {"version":3,"names":["WithSkiaWeb","getComponent","fallback","opts","Inner","useMemo","lazy","Platform","OS","LoadSkiaWeb","console","warn"],"sources":["WithSkiaWeb.tsx"],"sourcesContent":["import type { ComponentProps, ComponentType } from \"react\";\nimport React, { useMemo, lazy, Suspense } from \"react\";\nimport { Platform } from \"react-native\";\n\nimport { LoadSkiaWeb } from \"./LoadSkiaWeb\";\n\ninterface WithSkiaProps {\n fallback?: ComponentProps<typeof Suspense>[\"fallback\"];\n getComponent: () => Promise<{ default: ComponentType }>;\n opts?: Parameters<typeof LoadSkiaWeb>[0];\n}\n\nexport const WithSkiaWeb = ({\n getComponent,\n fallback,\n opts,\n}: WithSkiaProps) => {\n const Inner = useMemo(\n // TODO: investigate\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (): any =>\n lazy(async () => {\n if (Platform.OS === \"web\") {\n await LoadSkiaWeb(opts);\n } else {\n console.warn(\n \"<WithSkiaWeb /> is only necessary on web. Consider not using on native.\"\n );\n }\n return getComponent();\n }),\n [getComponent, opts]\n );\n return (\n <Suspense fallback={fallback ?? null}>\n <Inner />\n </Suspense>\n );\n};\n"],"mappings":";;;;;;;AACA;;AACA;;AAEA;;;;;;AAQO,MAAMA,WAAW,GAAG,QAIN;EAAA,IAJO;IAC1BC,YAD0B;IAE1BC,QAF0B;IAG1BC;EAH0B,CAIP;EACnB,MAAMC,KAAK,GAAG,IAAAC,cAAA,GACZ;EACA;EACA,mBACE,IAAAC,WAAA,EAAK,YAAY;IACf,IAAIC,qBAAA,CAASC,EAAT,KAAgB,KAApB,EAA2B;MACzB,MAAM,IAAAC,wBAAA,EAAYN,IAAZ,CAAN;IACD,CAFD,MAEO;MACLO,OAAO,CAACC,IAAR,CACE,yEADF;IAGD;;IACD,OAAOV,YAAY,EAAnB;EACD,CATD,CAJU,EAcZ,CAACA,YAAD,EAAeE,IAAf,CAdY,CAAd;EAgBA,oBACE,6BAAC,eAAD;IAAU,QAAQ,EAAED,QAAQ,IAAI;EAAhC,gBACE,6BAAC,KAAD,OADF,CADF;AAKD,CA1BM"}
@@ -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","sourcesContent":["export * from \"./LoadSkiaWeb\";\nexport * from \"./WithSkiaWeb\";\n"]}
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./LoadSkiaWeb\";\nexport * from \"./WithSkiaWeb\";\n"],"mappings":";;;;;;AAAA;;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":["decay.ts"],"names":["VELOCITY_EPS","SLOPE_FACTOR","decay","now","state","config","lastTimestamp","startTimestamp","initialVelocity","current","velocity","nextState","deltaTime","Math","min","v","exp","deceleration","velocityFactor","clamp","finished","abs"],"mappings":"AAEA,MAAMA,YAAY,GAAG,CAArB;AACA,MAAMC,YAAY,GAAG,GAArB;AAEA,OAAO,MAAMC,KAAK,GAAG,CACnBC,GADmB,EAEnBC,KAFmB,EAGnBC,MAHmB,KAIJ;AACf,QAAM;AAAEC,IAAAA,aAAF;AAAiBC,IAAAA,cAAjB;AAAiCC,IAAAA,eAAjC;AAAkDC,IAAAA,OAAlD;AAA2DC,IAAAA;AAA3D,MACJ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\nconst SLOPE_FACTOR = 0.1;\n\nexport const decay = (\n now: number,\n state: DecayState,\n config: DefaultDecayConfig\n): DecayState => {\n const { lastTimestamp, startTimestamp, initialVelocity, current, velocity } =\n state;\n const nextState = { ...state };\n const deltaTime = Math.min(now - lastTimestamp, 64);\n const v =\n velocity *\n Math.exp(\n -(1 - config.deceleration) * (now - startTimestamp) * SLOPE_FACTOR\n );\n nextState.current = current + (v * config.velocityFactor * deltaTime) / 1000; // /1000 because time is in ms not in s\n nextState.velocity = v;\n nextState.lastTimestamp = now;\n\n if (config.clamp) {\n if (initialVelocity < 0 && nextState.current <= config.clamp[0]) {\n nextState.current = config.clamp[0];\n nextState.finished = true;\n } else if (initialVelocity > 0 && nextState.current >= config.clamp[1]) {\n nextState.current = config.clamp[1];\n nextState.finished = true;\n }\n }\n nextState.finished = Math.abs(v) < VELOCITY_EPS;\n return nextState;\n};\n"]}
1
+ {"version":3,"names":["VELOCITY_EPS","SLOPE_FACTOR","decay","now","state","config","lastTimestamp","startTimestamp","initialVelocity","current","velocity","nextState","deltaTime","Math","min","v","exp","deceleration","velocityFactor","clamp","finished","abs"],"sources":["decay.ts"],"sourcesContent":["import type { DecayState, DefaultDecayConfig } from \"./types\";\n\nconst VELOCITY_EPS = 1;\nconst SLOPE_FACTOR = 0.1;\n\nexport const decay = (\n now: number,\n state: DecayState,\n config: DefaultDecayConfig\n): DecayState => {\n const { lastTimestamp, startTimestamp, initialVelocity, current, velocity } =\n state;\n const nextState = { ...state };\n const deltaTime = Math.min(now - lastTimestamp, 64);\n const v =\n velocity *\n Math.exp(\n -(1 - config.deceleration) * (now - startTimestamp) * SLOPE_FACTOR\n );\n nextState.current = current + (v * config.velocityFactor * deltaTime) / 1000; // /1000 because time is in ms not in s\n nextState.velocity = v;\n nextState.lastTimestamp = now;\n\n if (config.clamp) {\n if (initialVelocity < 0 && nextState.current <= config.clamp[0]) {\n nextState.current = config.clamp[0];\n nextState.finished = true;\n } else if (initialVelocity > 0 && nextState.current >= config.clamp[1]) {\n nextState.current = config.clamp[1];\n nextState.finished = true;\n }\n }\n nextState.finished = Math.abs(v) < VELOCITY_EPS;\n return nextState;\n};\n"],"mappings":"AAEA,MAAMA,YAAY,GAAG,CAArB;AACA,MAAMC,YAAY,GAAG,GAArB;AAEA,OAAO,MAAMC,KAAK,GAAG,CACnBC,GADmB,EAEnBC,KAFmB,EAGnBC,MAHmB,KAIJ;EACf,MAAM;IAAEC,aAAF;IAAiBC,cAAjB;IAAiCC,eAAjC;IAAkDC,OAAlD;IAA2DC;EAA3D,IACJN,KADF;EAEA,MAAMO,SAAS,GAAG,EAAE,GAAGP;EAAL,CAAlB;EACA,MAAMQ,SAAS,GAAGC,IAAI,CAACC,GAAL,CAASX,GAAG,GAAGG,aAAf,EAA8B,EAA9B,CAAlB;EACA,MAAMS,CAAC,GACLL,QAAQ,GACRG,IAAI,CAACG,GAAL,CACE,EAAE,IAAIX,MAAM,CAACY,YAAb,KAA8Bd,GAAG,GAAGI,cAApC,IAAsDN,YADxD,CAFF;EAKAU,SAAS,CAACF,OAAV,GAAoBA,OAAO,GAAIM,CAAC,GAAGV,MAAM,CAACa,cAAX,GAA4BN,SAA7B,GAA0C,IAAxE,CAVe,CAU+D;;EAC9ED,SAAS,CAACD,QAAV,GAAqBK,CAArB;EACAJ,SAAS,CAACL,aAAV,GAA0BH,GAA1B;;EAEA,IAAIE,MAAM,CAACc,KAAX,EAAkB;IAChB,IAAIX,eAAe,GAAG,CAAlB,IAAuBG,SAAS,CAACF,OAAV,IAAqBJ,MAAM,CAACc,KAAP,CAAa,CAAb,CAAhD,EAAiE;MAC/DR,SAAS,CAACF,OAAV,GAAoBJ,MAAM,CAACc,KAAP,CAAa,CAAb,CAApB;MACAR,SAAS,CAACS,QAAV,GAAqB,IAArB;IACD,CAHD,MAGO,IAAIZ,eAAe,GAAG,CAAlB,IAAuBG,SAAS,CAACF,OAAV,IAAqBJ,MAAM,CAACc,KAAP,CAAa,CAAb,CAAhD,EAAiE;MACtER,SAAS,CAACF,OAAV,GAAoBJ,MAAM,CAACc,KAAP,CAAa,CAAb,CAApB;MACAR,SAAS,CAACS,QAAV,GAAqB,IAArB;IACD;EACF;;EACDT,SAAS,CAACS,QAAV,GAAqBP,IAAI,CAACQ,GAAL,CAASN,CAAT,IAAcf,YAAnC;EACA,OAAOW,SAAP;AACD,CA7BM"}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":["runDecay"],"mappings":"AAAA,SAASA,QAAT,QAAyB,YAAzB","sourcesContent":["export { runDecay } from \"./runDecay\";\n"]}
1
+ {"version":3,"names":["runDecay"],"sources":["index.ts"],"sourcesContent":["export { runDecay } from \"./runDecay\";\n"],"mappings":"AAAA,SAASA,QAAT,QAAyB,YAAzB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["runDecay.ts"],"names":["ValueApi","decay","runDecay","value","config","resolvedConfig","deceleration","velocityFactor","velocity","from","current","updateFunction","t","state","finished","lastTimestamp","startTimestamp","initialVelocity","animation","createAnimation"],"mappings":"AAAA,SAASA,QAAT,QAAyB,kBAAzB;AAGA,SAASC,KAAT,QAAsB,SAAtB;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,QAAQ,GAAG,CACtBC,KADsB,EAEtBC,MAFsB,KAGnB;AACH,QAAMC,cAAkC,GAAG;AACzCC,IAAAA,YAAY,EAAE,KAD2B;AAEzCC,IAAAA,cAAc,EAAE,CAFyB;AAGzCC,IAAAA,QAAQ,EAAE,CAH+B;AAIzCC,IAAAA,IAAI,EAAEN,KAAK,CAACO,OAJ6B;AAKzC,OAAGN;AALsC,GAA3C;;AAOA,QAAMO,cAAc,GAAG,CAACC,CAAD,EAAYC,KAAZ,KAA8C;AACnE,QAAI,CAACA,KAAL,EAAY;AACV,aAAO;AACLH,QAAAA,OAAO,EAAEL,cAAc,CAACI,IADnB;AAELK,QAAAA,QAAQ,EAAE,KAFL;AAGLC,QAAAA,aAAa,EAAEH,CAHV;AAILI,QAAAA,cAAc,EAAEJ,CAJX;AAKLK,QAAAA,eAAe,EAAEZ,cAAc,CAACG,QAL3B;AAMLA,QAAAA,QAAQ,EAAEH,cAAc,CAACG;AANpB,OAAP;AAQD;;AACD,WAAOP,KAAK,CAACW,CAAD,EAAIC,KAAJ,EAAWR,cAAX,CAAZ;AACD,GAZD;;AAaAF,EAAAA,KAAK,CAACe,SAAN,GAAkBlB,QAAQ,CAACmB,eAAT,CAAyBR,cAAzB,CAAlB;AACA,SAAOR,KAAK,CAACe,SAAb;AACD,CA1BM","sourcesContent":["import { ValueApi } from \"../../values/api\";\nimport type { SkiaMutableValue } from \"../../values/types\";\n\nimport { decay } from \"./decay\";\nimport type { DecayConfig, DefaultDecayConfig, DecayState } from \"./types\";\n\n/**\n * Runs a decay animation from the current value to zero with the given decay\n * configuration.\n * @param value value to animate\n * @param config Configuration or default configuration\n * @returns Animation\n */\nexport const runDecay = (\n value: SkiaMutableValue<number>,\n config?: DecayConfig\n) => {\n const resolvedConfig: DefaultDecayConfig = {\n deceleration: 0.998,\n velocityFactor: 1,\n velocity: 0,\n from: value.current,\n ...config,\n };\n const updateFunction = (t: number, state: DecayState | undefined) => {\n if (!state) {\n return {\n current: resolvedConfig.from,\n finished: false,\n lastTimestamp: t,\n startTimestamp: t,\n initialVelocity: resolvedConfig.velocity,\n velocity: resolvedConfig.velocity,\n };\n }\n return decay(t, state, resolvedConfig);\n };\n value.animation = ValueApi.createAnimation(updateFunction);\n return value.animation;\n};\n"]}
1
+ {"version":3,"names":["ValueApi","decay","runDecay","value","config","resolvedConfig","deceleration","velocityFactor","velocity","from","current","updateFunction","t","state","finished","lastTimestamp","startTimestamp","initialVelocity","animation","createAnimation"],"sources":["runDecay.ts"],"sourcesContent":["import { ValueApi } from \"../../values/api\";\nimport type { SkiaMutableValue } from \"../../values/types\";\n\nimport { decay } from \"./decay\";\nimport type { DecayConfig, DefaultDecayConfig, DecayState } from \"./types\";\n\n/**\n * Runs a decay animation from the current value to zero with the given decay\n * configuration.\n * @param value value to animate\n * @param config Configuration or default configuration\n * @returns Animation\n */\nexport const runDecay = (\n value: SkiaMutableValue<number>,\n config?: DecayConfig\n) => {\n const resolvedConfig: DefaultDecayConfig = {\n deceleration: 0.998,\n velocityFactor: 1,\n velocity: 0,\n from: value.current,\n ...config,\n };\n const updateFunction = (t: number, state: DecayState | undefined) => {\n if (!state) {\n return {\n current: resolvedConfig.from,\n finished: false,\n lastTimestamp: t,\n startTimestamp: t,\n initialVelocity: resolvedConfig.velocity,\n velocity: resolvedConfig.velocity,\n };\n }\n return decay(t, state, resolvedConfig);\n };\n value.animation = ValueApi.createAnimation(updateFunction);\n return value.animation;\n};\n"],"mappings":"AAAA,SAASA,QAAT,QAAyB,kBAAzB;AAGA,SAASC,KAAT,QAAsB,SAAtB;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,QAAQ,GAAG,CACtBC,KADsB,EAEtBC,MAFsB,KAGnB;EACH,MAAMC,cAAkC,GAAG;IACzCC,YAAY,EAAE,KAD2B;IAEzCC,cAAc,EAAE,CAFyB;IAGzCC,QAAQ,EAAE,CAH+B;IAIzCC,IAAI,EAAEN,KAAK,CAACO,OAJ6B;IAKzC,GAAGN;EALsC,CAA3C;;EAOA,MAAMO,cAAc,GAAG,CAACC,CAAD,EAAYC,KAAZ,KAA8C;IACnE,IAAI,CAACA,KAAL,EAAY;MACV,OAAO;QACLH,OAAO,EAAEL,cAAc,CAACI,IADnB;QAELK,QAAQ,EAAE,KAFL;QAGLC,aAAa,EAAEH,CAHV;QAILI,cAAc,EAAEJ,CAJX;QAKLK,eAAe,EAAEZ,cAAc,CAACG,QAL3B;QAMLA,QAAQ,EAAEH,cAAc,CAACG;MANpB,CAAP;IAQD;;IACD,OAAOP,KAAK,CAACW,CAAD,EAAIC,KAAJ,EAAWR,cAAX,CAAZ;EACD,CAZD;;EAaAF,KAAK,CAACe,SAAN,GAAkBlB,QAAQ,CAACmB,eAAT,CAAyBR,cAAzB,CAAlB;EACA,OAAOR,KAAK,CAACe,SAAb;AACD,CA1BM"}
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
1
+ {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { AnimationState } from \"../../values/types\";\n\nexport interface DecayConfig {\n from?: number;\n deceleration?: number;\n velocityFactor?: number;\n clamp?: number[];\n velocity?: number;\n}\n\nexport interface DefaultDecayConfig {\n from: number;\n deceleration: number;\n velocityFactor: number;\n clamp?: number[];\n velocity: number;\n}\n\nexport interface DecayState extends AnimationState {\n lastTimestamp: number;\n startTimestamp: number;\n initialVelocity: number;\n velocity: number;\n}\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAd;AACA,cAAc,qBAAd;AACA,cAAc,qBAAd;AACA,cAAc,oBAAd","sourcesContent":["export * from \"./interpolate\";\nexport * from \"./interpolateColors\";\nexport * from \"./interpolateVector\";\nexport * from \"./interpolatePaths\";\n"]}
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./interpolate\";\nexport * from \"./interpolateColors\";\nexport * from \"./interpolateVector\";\nexport * from \"./interpolatePaths\";\n"],"mappings":"AAAA,cAAc,eAAd;AACA,cAAc,qBAAd;AACA,cAAc,qBAAd;AACA,cAAc,oBAAd"}
@@ -1 +1 @@
1
- {"version":3,"sources":["interpolate.ts"],"names":["Extrapolate","getVal","type","coef","val","leftEdgeOutput","rightEdgeOutput","x","IDENTITY","CLAMP","EXTEND","isExtrapolate","value","validateInterpolationOptions","extrapolationConfig","extrapolateLeft","extrapolateRight","Error","Object","assign","internalInterpolate","narrowedInput","leftEdgeInput","rightEdgeInput","progress","interpolate","input","output","length","i"],"mappings":"AAAA;AACA,WAAYA,WAAZ;;WAAYA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;GAAAA,W,KAAAA,W;;AA6BZ,SAASC,MAAT,CAC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AL,CAArC;AACAR,UAAAA,aAAa,CAACf,eAAd,GAAgCqB,MAAM,CAACE,CAAD,CAAtC;AACA;AACD;AACF;AACF;AACF;;AAED,SAAOT,mBAAmB,CAACb,CAAD,EAAIc,aAAJ,EAAmBP,mBAAnB,CAA1B;AACD","sourcesContent":["/* eslint-disable max-len */\nexport enum Extrapolate {\n IDENTITY = \"identity\",\n CLAMP = \"clamp\",\n EXTEND = \"extend\",\n}\n\ninterface InterpolationNarrowedInput {\n leftEdgeInput: number;\n rightEdgeInput: number;\n leftEdgeOutput: number;\n rightEdgeOutput: number;\n}\n\nexport interface ExtrapolationConfig {\n extrapolateLeft?: Extrapolate | string;\n extrapolateRight?: Extrapolate | string;\n}\n\ninterface RequiredExtrapolationConfig {\n extrapolateLeft: Extrapolate;\n extrapolateRight: Extrapolate;\n}\n\nexport type ExtrapolationType =\n | ExtrapolationConfig\n | Extrapolate\n | string\n | undefined;\n\nfunction getVal(\n type: Extrapolate,\n coef: number,\n val: number,\n leftEdgeOutput: number,\n rightEdgeOutput: number,\n x: number\n): number {\n switch (type) {\n case Extrapolate.IDENTITY:\n return x;\n case Extrapolate.CLAMP:\n if (coef * val < coef * leftEdgeOutput) {\n return leftEdgeOutput;\n }\n return rightEdgeOutput;\n case Extrapolate.EXTEND:\n default:\n return val;\n }\n}\n\nfunction isExtrapolate(value: string): value is Extrapolate {\n return (\n value === Extrapolate.EXTEND ||\n value === Extrapolate.CLAMP ||\n value === Extrapolate.IDENTITY\n );\n}\n\n// validates extrapolations type\n// if type is correct, converts it to ExtrapolationConfig\nexport function validateInterpolationOptions(\n type: ExtrapolationType\n): RequiredExtrapolationConfig {\n // initialize extrapolationConfig with default extrapolation\n const extrapolationConfig: RequiredExtrapolationConfig = {\n extrapolateLeft: Extrapolate.EXTEND,\n extrapolateRight: Extrapolate.EXTEND,\n };\n\n if (!type) {\n return extrapolationConfig;\n }\n\n if (typeof type === \"string\") {\n if (!isExtrapolate(type)) {\n throw new Error(\n `No supported value for \"interpolate\" \\nSupported values: [\"extend\", \"clamp\", \"identity\", Extrapolatation.CLAMP, Extrapolatation.EXTEND, Extrapolatation.IDENTITY]\\n Valid example:\n interpolate(value, [inputRange], [outputRange], \"clamp\")`\n );\n }\n extrapolationConfig.extrapolateLeft = type;\n extrapolationConfig.extrapolateRight = type;\n return extrapolationConfig;\n }\n\n // otherwise type is extrapolation config object\n if (\n (type.extrapolateLeft && !isExtrapolate(type.extrapolateLeft)) ||\n (type.extrapolateRight && !isExtrapolate(type.extrapolateRight))\n ) {\n throw new Error(\n `No supported value for \"interpolate\" \\nSupported values: [\"extend\", \"clamp\", \"identity\", Extrapolatation.CLAMP, Extrapolatation.EXTEND, Extrapolatation.IDENTITY]\\n Valid example:\n interpolate(value, [inputRange], [outputRange], {\n extrapolateLeft: Extrapolation.CLAMP,\n extrapolateRight: Extrapolation.IDENTITY\n }})`\n );\n }\n\n Object.assign(extrapolationConfig, type);\n return extrapolationConfig;\n}\n\nfunction internalInterpolate(\n x: number,\n narrowedInput: InterpolationNarrowedInput,\n extrapolationConfig: RequiredExtrapolationConfig\n) {\n const { leftEdgeInput, rightEdgeInput, leftEdgeOutput, rightEdgeOutput } =\n narrowedInput;\n if (rightEdgeInput - leftEdgeInput === 0) {\n return leftEdgeOutput;\n }\n const progress = (x - leftEdgeInput) / (rightEdgeInput - leftEdgeInput);\n const val = leftEdgeOutput + progress * (rightEdgeOutput - leftEdgeOutput);\n const coef = rightEdgeOutput >= leftEdgeOutput ? 1 : -1;\n\n if (coef * val < coef * leftEdgeOutput) {\n return getVal(\n extrapolationConfig.extrapolateLeft,\n coef,\n val,\n leftEdgeOutput,\n rightEdgeOutput,\n x\n );\n } else if (coef * val > coef * rightEdgeOutput) {\n return getVal(\n extrapolationConfig.extrapolateRight,\n coef,\n val,\n leftEdgeOutput,\n rightEdgeOutput,\n x\n );\n }\n\n return val;\n}\n\n// e.g. function interpolate(x, input, output, type = Extrapolatation.CLAMP)\nexport function interpolate(\n x: number,\n input: readonly number[],\n output: readonly number[],\n type?: ExtrapolationType\n): number {\n if (input.length < 2 || output.length < 2) {\n throw Error(\n \"Interpolation input and output should contain at least two values.\"\n );\n }\n\n const extrapolationConfig = validateInterpolationOptions(type);\n const { length } = input;\n const narrowedInput: InterpolationNarrowedInput = {\n leftEdgeInput: input[0],\n rightEdgeInput: input[1],\n leftEdgeOutput: output[0],\n rightEdgeOutput: output[1],\n };\n if (length > 2) {\n if (x > input[length - 1]) {\n narrowedInput.leftEdgeInput = input[length - 2];\n narrowedInput.rightEdgeInput = input[length - 1];\n narrowedInput.leftEdgeOutput = output[length - 2];\n narrowedInput.rightEdgeOutput = output[length - 1];\n } else {\n for (let i = 1; i < length; ++i) {\n if (x <= input[i]) {\n narrowedInput.leftEdgeInput = input[i - 1];\n narrowedInput.rightEdgeInput = input[i];\n narrowedInput.leftEdgeOutput = output[i - 1];\n narrowedInput.rightEdgeOutput = output[i];\n break;\n }\n }\n }\n }\n\n return internalInterpolate(x, narrowedInput, extrapolationConfig);\n}\n"]}
1
+ {"version":3,"names":["Extrapolate","getVal","type","coef","val","leftEdgeOutput","rightEdgeOutput","x","IDENTITY","CLAMP","EXTEND","isExtrapolate","value","validateInterpolationOptions","extrapolationConfig","extrapolateLeft","extrapolateRight","Error","Object","assign","internalInterpolate","narrowedInput","leftEdgeInput","rightEdgeInput","progress","interpolate","input","output","length","i"],"sources":["interpolate.ts"],"sourcesContent":["/* eslint-disable max-len */\nexport enum Extrapolate {\n IDENTITY = \"identity\",\n CLAMP = \"clamp\",\n EXTEND = \"extend\",\n}\n\ninterface InterpolationNarrowedInput {\n leftEdgeInput: number;\n rightEdgeInput: number;\n leftEdgeOutput: number;\n rightEdgeOutput: number;\n}\n\nexport interface ExtrapolationConfig {\n extrapolateLeft?: Extrapolate | string;\n extrapolateRight?: Extrapolate | string;\n}\n\ninterface RequiredExtrapolationConfig {\n extrapolateLeft: Extrapolate;\n extrapolateRight: Extrapolate;\n}\n\nexport type ExtrapolationType =\n | ExtrapolationConfig\n | Extrapolate\n | string\n | undefined;\n\nfunction getVal(\n type: Extrapolate,\n coef: number,\n val: number,\n leftEdgeOutput: number,\n rightEdgeOutput: number,\n x: number\n): number {\n switch (type) {\n case Extrapolate.IDENTITY:\n return x;\n case Extrapolate.CLAMP:\n if (coef * val < coef * leftEdgeOutput) {\n return leftEdgeOutput;\n }\n return rightEdgeOutput;\n case Extrapolate.EXTEND:\n default:\n return val;\n }\n}\n\nfunction isExtrapolate(value: string): value is Extrapolate {\n return (\n value === Extrapolate.EXTEND ||\n value === Extrapolate.CLAMP ||\n value === Extrapolate.IDENTITY\n );\n}\n\n// validates extrapolations type\n// if type is correct, converts it to ExtrapolationConfig\nexport function validateInterpolationOptions(\n type: ExtrapolationType\n): RequiredExtrapolationConfig {\n // initialize extrapolationConfig with default extrapolation\n const extrapolationConfig: RequiredExtrapolationConfig = {\n extrapolateLeft: Extrapolate.EXTEND,\n extrapolateRight: Extrapolate.EXTEND,\n };\n\n if (!type) {\n return extrapolationConfig;\n }\n\n if (typeof type === \"string\") {\n if (!isExtrapolate(type)) {\n throw new Error(\n `No supported value for \"interpolate\" \\nSupported values: [\"extend\", \"clamp\", \"identity\", Extrapolatation.CLAMP, Extrapolatation.EXTEND, Extrapolatation.IDENTITY]\\n Valid example:\n interpolate(value, [inputRange], [outputRange], \"clamp\")`\n );\n }\n extrapolationConfig.extrapolateLeft = type;\n extrapolationConfig.extrapolateRight = type;\n return extrapolationConfig;\n }\n\n // otherwise type is extrapolation config object\n if (\n (type.extrapolateLeft && !isExtrapolate(type.extrapolateLeft)) ||\n (type.extrapolateRight && !isExtrapolate(type.extrapolateRight))\n ) {\n throw new Error(\n `No supported value for \"interpolate\" \\nSupported values: [\"extend\", \"clamp\", \"identity\", Extrapolatation.CLAMP, Extrapolatation.EXTEND, Extrapolatation.IDENTITY]\\n Valid example:\n interpolate(value, [inputRange], [outputRange], {\n extrapolateLeft: Extrapolation.CLAMP,\n extrapolateRight: Extrapolation.IDENTITY\n }})`\n );\n }\n\n Object.assign(extrapolationConfig, type);\n return extrapolationConfig;\n}\n\nfunction internalInterpolate(\n x: number,\n narrowedInput: InterpolationNarrowedInput,\n extrapolationConfig: RequiredExtrapolationConfig\n) {\n const { leftEdgeInput, rightEdgeInput, leftEdgeOutput, rightEdgeOutput } =\n narrowedInput;\n if (rightEdgeInput - leftEdgeInput === 0) {\n return leftEdgeOutput;\n }\n const progress = (x - leftEdgeInput) / (rightEdgeInput - leftEdgeInput);\n const val = leftEdgeOutput + progress * (rightEdgeOutput - leftEdgeOutput);\n const coef = rightEdgeOutput >= leftEdgeOutput ? 1 : -1;\n\n if (coef * val < coef * leftEdgeOutput) {\n return getVal(\n extrapolationConfig.extrapolateLeft,\n coef,\n val,\n leftEdgeOutput,\n rightEdgeOutput,\n x\n );\n } else if (coef * val > coef * rightEdgeOutput) {\n return getVal(\n extrapolationConfig.extrapolateRight,\n coef,\n val,\n leftEdgeOutput,\n rightEdgeOutput,\n x\n );\n }\n\n return val;\n}\n\n// e.g. function interpolate(x, input, output, type = Extrapolatation.CLAMP)\nexport function interpolate(\n x: number,\n input: readonly number[],\n output: readonly number[],\n type?: ExtrapolationType\n): number {\n if (input.length < 2 || output.length < 2) {\n throw Error(\n \"Interpolation input and output should contain at least two values.\"\n );\n }\n\n const extrapolationConfig = validateInterpolationOptions(type);\n const { length } = input;\n const narrowedInput: InterpolationNarrowedInput = {\n leftEdgeInput: input[0],\n rightEdgeInput: input[1],\n leftEdgeOutput: output[0],\n rightEdgeOutput: output[1],\n };\n if (length > 2) {\n if (x > input[length - 1]) {\n narrowedInput.leftEdgeInput = input[length - 2];\n narrowedInput.rightEdgeInput = input[length - 1];\n narrowedInput.leftEdgeOutput = output[length - 2];\n narrowedInput.rightEdgeOutput = output[length - 1];\n } else {\n for (let i = 1; i < length; ++i) {\n if (x <= input[i]) {\n narrowedInput.leftEdgeInput = input[i - 1];\n narrowedInput.rightEdgeInput = input[i];\n narrowedInput.leftEdgeOutput = output[i - 1];\n narrowedInput.rightEdgeOutput = output[i];\n break;\n }\n }\n }\n }\n\n return internalInterpolate(x, narrowedInput, extrapolationConfig);\n}\n"],"mappings":"AAAA;AACA,WAAYA,WAAZ;;WAAYA,W;EAAAA,W;EAAAA,W;EAAAA,W;GAAAA,W,KAAAA,W;;AA6BZ,SAASC,MAAT,CACEC,IADF,EAEEC,IAFF,EAGEC,GAHF,EAIEC,cAJF,EAKEC,eALF,EAMEC,CANF,EAOU;EACR,QAAQL,IAAR;IACE,KAAKF,WAAW,CAACQ,QAAjB;MACE,OAAOD,CAAP;;IACF,KAAKP,WAAW,CAACS,KAAjB;MACE,IAAIN,IAAI,GAAGC,GAAP,GAAaD,IAAI,GAAGE,cAAxB,EAAwC;QACtC,OAAOA,cAAP;MACD;;MACD,OAAOC,eAAP;;IACF,KAAKN,WAAW,CAACU,MAAjB;IACA;MACE,OAAON,GAAP;EAVJ;AAYD;;AAED,SAASO,aAAT,CAAuBC,KAAvB,EAA4D;EAC1D,OACEA,KAAK,KAAKZ,WAAW,CAACU,MAAtB,IACAE,KAAK,KAAKZ,WAAW,CAACS,KADtB,IAEAG,KAAK,KAAKZ,WAAW,CAACQ,QAHxB;AAKD,C,CAED;AACA;;;AACA,OAAO,SAASK,4BAAT,CACLX,IADK,EAEwB;EAC7B;EACA,MAAMY,mBAAgD,GAAG;IACvDC,eAAe,EAAEf,WAAW,CAACU,MAD0B;IAEvDM,gBAAgB,EAAEhB,WAAW,CAACU;EAFyB,CAAzD;;EAKA,IAAI,CAACR,IAAL,EAAW;IACT,OAAOY,mBAAP;EACD;;EAED,IAAI,OAAOZ,IAAP,KAAgB,QAApB,EAA8B;IAC5B,IAAI,CAACS,aAAa,CAACT,IAAD,CAAlB,EAA0B;MACxB,MAAM,IAAIe,KAAJ,CACH;AACT,iEAFY,CAAN;IAID;;IACDH,mBAAmB,CAACC,eAApB,GAAsCb,IAAtC;IACAY,mBAAmB,CAACE,gBAApB,GAAuCd,IAAvC;IACA,OAAOY,mBAAP;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AAa,CAAChB,cAAd,GAA+BsB,MAAM,CAACE,CAAC,GAAG,CAAL,CAArC;UACAR,aAAa,CAACf,eAAd,GAAgCqB,MAAM,CAACE,CAAD,CAAtC;UACA;QACD;MACF;IACF;EACF;;EAED,OAAOT,mBAAmB,CAACb,CAAD,EAAIc,aAAJ,EAAmBP,mBAAnB,CAA1B;AACD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["interpolateColors.ts"],"names":["mix","Skia","interpolate","interpolateColorsRGB","value","inputRange","outputRange","r","map","c","g","b","a","Float32Array","interpolateColors","_outputRange","cl","Color","mixColors","x","y","c1","c2"],"mappings":"AAAA,SAASA,GAAT,QAAoB,gCAApB;AAEA,SAASC,IAAT,QAAqB,YAArB;AAEA,SAASC,WAAT,QAA4B,eAA5B;;AAEA,MAAMC,oBAAoB,GAAG,CAC3BC,KAD2B,EAE3BC,UAF2B,EAG3BC,WAH2B,KAIxB;AACH,QAAMC,CAAC,GAAGL,WAAW,CACnBE,KADmB,EAEnBC,UAFmB,EAGnBC,WAAW,CAACE,GAAZ,CAAiBC,CAAD,IAAOA,CAAC,CAAC,CAAD,CAAxB,CAHmB,EAInB,OAJmB,CAArB;AAMA,QAAMC,CAAC,GAAGR,WAAW,CACnBE,KADmB,EAEnBC,UAFmB,EAGnBC,WAAW,CAACE,GAAZ,CAAiBC,CAAD,IAAOA,CAAC,CAAC,CAAD,CAAxB,CAHmB,EAInB,OAJmB,CAArB;AAMA,QAAME,CAAC,GAAGT,WAAW,CACnBE,KADmB,EAEnBC,UAFmB,EAGnBC,WAAW,CAACE,GAAZ,CAAiBC,CAAD,IAAOA,CAAC,CAAC,CAAD,CAAxB,CAHmB,EAInB,OAJmB,CAArB;AAMA,QAAMG,CAAC,GAAGV,WAAW,CACnBE,KADmB,EAEnBC,UAFmB,EAGnBC,WAAW,CAACE,GAAZ,CAAiBC,CAAD,IAAOA,CAAC,CAAC,CAAD,CAAxB,CAHmB,EAInB,OAJmB,CAArB;AAMA,SAAO,IAAII,YAAJ,CAAiB,CAACN,CAAD,EAAIG,CAAJ,EAAOC,CAAP,EAAUC,CAAV,CAAjB,CAAP;AACD,CA9BD;;AAgCA,OAAO,MAAME,iBAAiB,GAAG,CAC/BV,KAD+B,EAE/BC,UAF+B,EAG/BU,YAH+B,KAI5B;AACH,QAAMT,WAAW,GAAGS,YAAY,CAACP,GAAb,CAAkBQ,EAAD,IAAQf,IAAI,CAACgB,KAAL,CAAWD,EAAX,CAAzB,CAApB;;AACA,SAAOb,oBAAoB,CAACC,KAAD,EAAQC,UAAR,EAAoBC,WAApB,CAA3B;AACD,CAPM;AASP,OAAO,MAAMY,SAAS,GAAG,CAACd,KAAD,EAAgBe,CAAhB,EAA0BC,CAA1B,KAAuC;AAC9D,QAAMC,EAAE,GAAGpB,IAAI,CAACgB,KAAL,CAAWE,CAAX,CAAX;AACA,QAAMG,EAAE,GAAGrB,IAAI,CAACgB,KAAL,CAAWG,CAAX,CAAX;AACA,SAAO,IAAIP,YAAJ,CAAiB,CACtBb,GAAG,CAACI,KAAD,EAAQiB,EAAE,CAAC,CAAD,CAAV,EAAeC,EAAE,CAAC,CAAD,CAAjB,CADmB,EAEtBtB,GAAG,CAACI,KAAD,EAAQiB,EAAE,CAAC,CAAD,CAAV,EAAeC,EAAE,CAAC,CAAD,CAAjB,CAFmB,EAGtBtB,GAAG,CAACI,KAAD,EAAQiB,EAAE,CAAC,CAAD,CAAV,EAAeC,EAAE,CAAC,CAAD,CAAjB,CAHmB,EAItBtB,GAAG,CAACI,KAAD,EAAQiB,EAAE,CAAC,CAAD,CAAV,EAAeC,EAAE,CAAC,CAAD,CAAjB,CAJmB,CAAjB,CAAP;AAMD,CATM","sourcesContent":["import { mix } from \"../../renderer/processors/math\";\nimport type { Color, SkColor } from \"../../skia\";\nimport { Skia } from \"../../skia\";\n\nimport { interpolate } from \"./interpolate\";\n\nconst interpolateColorsRGB = (\n value: number,\n inputRange: number[],\n outputRange: SkColor[]\n) => {\n const r = interpolate(\n value,\n inputRange,\n outputRange.map((c) => c[0]),\n \"clamp\"\n );\n const g = interpolate(\n value,\n inputRange,\n outputRange.map((c) => c[1]),\n \"clamp\"\n );\n const b = interpolate(\n value,\n inputRange,\n outputRange.map((c) => c[2]),\n \"clamp\"\n );\n const a = interpolate(\n value,\n inputRange,\n outputRange.map((c) => c[3]),\n \"clamp\"\n );\n return new Float32Array([r, g, b, a]);\n};\n\nexport const interpolateColors = (\n value: number,\n inputRange: number[],\n _outputRange: Color[]\n) => {\n const outputRange = _outputRange.map((cl) => Skia.Color(cl));\n return interpolateColorsRGB(value, inputRange, outputRange);\n};\n\nexport const mixColors = (value: number, x: Color, y: Color) => {\n const c1 = Skia.Color(x);\n const c2 = Skia.Color(y);\n return new Float32Array([\n mix(value, c1[0], c2[0]),\n mix(value, c1[1], c2[1]),\n mix(value, c1[2], c2[2]),\n mix(value, c1[3], c2[3]),\n ]);\n};\n"]}
1
+ {"version":3,"names":["mix","Skia","interpolate","interpolateColorsRGB","value","inputRange","outputRange","r","map","c","g","b","a","Float32Array","interpolateColors","_outputRange","cl","Color","mixColors","x","y","c1","c2"],"sources":["interpolateColors.ts"],"sourcesContent":["import { mix } from \"../../renderer/processors/math\";\nimport type { Color, SkColor } from \"../../skia\";\nimport { Skia } from \"../../skia\";\n\nimport { interpolate } from \"./interpolate\";\n\nconst interpolateColorsRGB = (\n value: number,\n inputRange: number[],\n outputRange: SkColor[]\n) => {\n const r = interpolate(\n value,\n inputRange,\n outputRange.map((c) => c[0]),\n \"clamp\"\n );\n const g = interpolate(\n value,\n inputRange,\n outputRange.map((c) => c[1]),\n \"clamp\"\n );\n const b = interpolate(\n value,\n inputRange,\n outputRange.map((c) => c[2]),\n \"clamp\"\n );\n const a = interpolate(\n value,\n inputRange,\n outputRange.map((c) => c[3]),\n \"clamp\"\n );\n return new Float32Array([r, g, b, a]);\n};\n\nexport const interpolateColors = (\n value: number,\n inputRange: number[],\n _outputRange: Color[]\n) => {\n const outputRange = _outputRange.map((cl) => Skia.Color(cl));\n return interpolateColorsRGB(value, inputRange, outputRange);\n};\n\nexport const mixColors = (value: number, x: Color, y: Color) => {\n const c1 = Skia.Color(x);\n const c2 = Skia.Color(y);\n return new Float32Array([\n mix(value, c1[0], c2[0]),\n mix(value, c1[1], c2[1]),\n mix(value, c1[2], c2[2]),\n mix(value, c1[3], c2[3]),\n ]);\n};\n"],"mappings":"AAAA,SAASA,GAAT,QAAoB,gCAApB;AAEA,SAASC,IAAT,QAAqB,YAArB;AAEA,SAASC,WAAT,QAA4B,eAA5B;;AAEA,MAAMC,oBAAoB,GAAG,CAC3BC,KAD2B,EAE3BC,UAF2B,EAG3BC,WAH2B,KAIxB;EACH,MAAMC,CAAC,GAAGL,WAAW,CACnBE,KADmB,EAEnBC,UAFmB,EAGnBC,WAAW,CAACE,GAAZ,CAAiBC,CAAD,IAAOA,CAAC,CAAC,CAAD,CAAxB,CAHmB,EAInB,OAJmB,CAArB;EAMA,MAAMC,CAAC,GAAGR,WAAW,CACnBE,KADmB,EAEnBC,UAFmB,EAGnBC,WAAW,CAACE,GAAZ,CAAiBC,CAAD,IAAOA,CAAC,CAAC,CAAD,CAAxB,CAHmB,EAInB,OAJmB,CAArB;EAMA,MAAME,CAAC,GAAGT,WAAW,CACnBE,KADmB,EAEnBC,UAFmB,EAGnBC,WAAW,CAACE,GAAZ,CAAiBC,CAAD,IAAOA,CAAC,CAAC,CAAD,CAAxB,CAHmB,EAInB,OAJmB,CAArB;EAMA,MAAMG,CAAC,GAAGV,WAAW,CACnBE,KADmB,EAEnBC,UAFmB,EAGnBC,WAAW,CAACE,GAAZ,CAAiBC,CAAD,IAAOA,CAAC,CAAC,CAAD,CAAxB,CAHmB,EAInB,OAJmB,CAArB;EAMA,OAAO,IAAII,YAAJ,CAAiB,CAACN,CAAD,EAAIG,CAAJ,EAAOC,CAAP,EAAUC,CAAV,CAAjB,CAAP;AACD,CA9BD;;AAgCA,OAAO,MAAME,iBAAiB,GAAG,CAC/BV,KAD+B,EAE/BC,UAF+B,EAG/BU,YAH+B,KAI5B;EACH,MAAMT,WAAW,GAAGS,YAAY,CAACP,GAAb,CAAkBQ,EAAD,IAAQf,IAAI,CAACgB,KAAL,CAAWD,EAAX,CAAzB,CAApB;;EACA,OAAOb,oBAAoB,CAACC,KAAD,EAAQC,UAAR,EAAoBC,WAApB,CAA3B;AACD,CAPM;AASP,OAAO,MAAMY,SAAS,GAAG,CAACd,KAAD,EAAgBe,CAAhB,EAA0BC,CAA1B,KAAuC;EAC9D,MAAMC,EAAE,GAAGpB,IAAI,CAACgB,KAAL,CAAWE,CAAX,CAAX;EACA,MAAMG,EAAE,GAAGrB,IAAI,CAACgB,KAAL,CAAWG,CAAX,CAAX;EACA,OAAO,IAAIP,YAAJ,CAAiB,CACtBb,GAAG,CAACI,KAAD,EAAQiB,EAAE,CAAC,CAAD,CAAV,EAAeC,EAAE,CAAC,CAAD,CAAjB,CADmB,EAEtBtB,GAAG,CAACI,KAAD,EAAQiB,EAAE,CAAC,CAAD,CAAV,EAAeC,EAAE,CAAC,CAAD,CAAjB,CAFmB,EAGtBtB,GAAG,CAACI,KAAD,EAAQiB,EAAE,CAAC,CAAD,CAAV,EAAeC,EAAE,CAAC,CAAD,CAAjB,CAHmB,EAItBtB,GAAG,CAACI,KAAD,EAAQiB,EAAE,CAAC,CAAD,CAAV,EAAeC,EAAE,CAAC,CAAD,CAAjB,CAJmB,CAAjB,CAAP;AAMD,CATM"}
@@ -1 +1 @@
1
- {"version":3,"sources":["interpolatePaths.ts"],"names":["exhaustiveCheck","validateInterpolationOptions","Extrapolate","lerp","value","from","to","p1","p2","t","interpolate","interpolatePaths","input","outputRange","options","extrapolation","extrapolateLeft","CLAMP","EXTEND","IDENTITY","Error","length","extrapolateRight","i"],"mappings":"AACA,SAASA,eAAT,QAAgC,0BAAhC;AAGA,SAASC,4BAAT,EAAuCC,WAAvC,QAA0D,eAA1D;;AAEA,MAAMC,IAAI,GAAG,CACXC,KADW,EAEXC,IAFW,EAGXC,EAHW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,EAETQ,KAAK,CAACA,KAAK,CAACS,MAAN,GAAe,CAAhB,CAFI,EAGTT,KAAK,CAACA,KAAK,CAACS,MAAN,GAAe,CAAhB,CAHI,EAITR,WAAW,CAACD,KAAK,CAACS,MAAN,GAAe,CAAhB,CAJF,EAKTR,WAAW,CAACD,KAAK,CAACS,MAAN,GAAe,CAAhB,CALF,CAAX;;AAOF,WAAKnB,WAAW,CAACiB,QAAjB;AACE,cAAM,IAAIC,KAAJ,CACJ,uEADI,CAAN;;AAGF;AACEpB,QAAAA,eAAe,CAACe,aAAa,CAACO,gBAAf,CAAf;AAhBJ;AAkBD;;AACD,MAAIC,CAAC,GAAG,CAAR;;AACA,SAAOA,CAAC,IAAIX,KAAK,CAACS,MAAN,GAAe,CAA3B,EAA8BE,CAAC,EAA/B,EAAmC;AACjC,QAAInB,KAAK,IAAIQ,KAAK,CAACW,CAAD,CAAd,IAAqBnB,KAAK,IAAIQ,KAAK,CAACW,CAAC,GAAG,CAAL,CAAvC,EAAgD;AAC9C;AACD;AACF;;AACD,SAAOpB,IAAI,CACTC,KADS,EAETQ,KAAK,CAACW,CAAD,CAFI,EAGTX,KAAK,CAACW,CAAC,GAAG,CAAL,CAHI,EAITV,WAAW,CAACU,CAAD,CAJF,EAKTV,WAAW,CAACU,CAAC,GAAG,CAAL,CALF,CAAX;AAOD,CArDM","sourcesContent":["import type { SkPath } from \"../../skia/types\";\nimport { exhaustiveCheck } from \"../../renderer/typeddash\";\n\nimport type { ExtrapolationType } from \"./interpolate\";\nimport { validateInterpolationOptions, Extrapolate } from \"./interpolate\";\n\nconst lerp = (\n value: number,\n from: number,\n to: number,\n p1: SkPath,\n p2: SkPath\n) => {\n const t = (value - from) / (to - from);\n return p2.interpolate(p1, t)!;\n};\n\n/**\n * Maps an input value within a range to an output path within a path range.\n * @param value - The input value.\n * @param inputRange - The range of the input value.\n * @param outputRange - The range of the output path.\n * @param options - Extrapolation options\n * @returns The output path.\n * @example <caption>Map a value between 0 and 1 to a path between two paths.</caption>\n * const path1 = new Path();\n * path1.moveTo(0, 0);\n * path1.lineTo(100, 0);\n * const path2 = new Path();\n * path2.moveTo(0, 0);\n * path2.lineTo(0, 100);\n * const path = interpolatePath(0.5, [0, 1], [path1, path2]);\n */\nexport const interpolatePaths = (\n value: number,\n input: number[],\n outputRange: SkPath[],\n options?: ExtrapolationType\n) => {\n const extrapolation = validateInterpolationOptions(options);\n if (value < input[0]) {\n switch (extrapolation.extrapolateLeft) {\n case Extrapolate.CLAMP:\n return outputRange[0];\n case Extrapolate.EXTEND:\n return lerp(value, input[0], input[1], outputRange[0], outputRange[1]);\n case Extrapolate.IDENTITY:\n throw new Error(\n \"Identity is not a supported extrapolation type for interpolatePaths()\"\n );\n default:\n exhaustiveCheck(extrapolation.extrapolateLeft);\n }\n } else if (value > input[input.length - 1]) {\n switch (extrapolation.extrapolateRight) {\n case Extrapolate.CLAMP:\n return outputRange[outputRange.length - 1];\n case Extrapolate.EXTEND:\n return lerp(\n value,\n input[input.length - 2],\n input[input.length - 1],\n outputRange[input.length - 2],\n outputRange[input.length - 1]\n );\n case Extrapolate.IDENTITY:\n throw new Error(\n \"Identity is not a supported extrapolation type for interpolatePaths()\"\n );\n default:\n exhaustiveCheck(extrapolation.extrapolateRight);\n }\n }\n let i = 0;\n for (; i <= input.length - 1; i++) {\n if (value >= input[i] && value <= input[i + 1]) {\n break;\n }\n }\n return lerp(\n value,\n input[i],\n input[i + 1],\n outputRange[i],\n outputRange[i + 1]\n );\n};\n"]}
1
+ {"version":3,"names":["exhaustiveCheck","validateInterpolationOptions","Extrapolate","lerp","value","from","to","p1","p2","t","interpolate","interpolatePaths","input","outputRange","options","extrapolation","extrapolateLeft","CLAMP","EXTEND","IDENTITY","Error","length","extrapolateRight","i"],"sources":["interpolatePaths.ts"],"sourcesContent":["import type { SkPath } from \"../../skia/types\";\nimport { exhaustiveCheck } from \"../../renderer/typeddash\";\n\nimport type { ExtrapolationType } from \"./interpolate\";\nimport { validateInterpolationOptions, Extrapolate } from \"./interpolate\";\n\nconst lerp = (\n value: number,\n from: number,\n to: number,\n p1: SkPath,\n p2: SkPath\n) => {\n const t = (value - from) / (to - from);\n return p2.interpolate(p1, t)!;\n};\n\n/**\n * Maps an input value within a range to an output path within a path range.\n * @param value - The input value.\n * @param inputRange - The range of the input value.\n * @param outputRange - The range of the output path.\n * @param options - Extrapolation options\n * @returns The output path.\n * @example <caption>Map a value between 0 and 1 to a path between two paths.</caption>\n * const path1 = new Path();\n * path1.moveTo(0, 0);\n * path1.lineTo(100, 0);\n * const path2 = new Path();\n * path2.moveTo(0, 0);\n * path2.lineTo(0, 100);\n * const path = interpolatePath(0.5, [0, 1], [path1, path2]);\n */\nexport const interpolatePaths = (\n value: number,\n input: number[],\n outputRange: SkPath[],\n options?: ExtrapolationType\n) => {\n const extrapolation = validateInterpolationOptions(options);\n if (value < input[0]) {\n switch (extrapolation.extrapolateLeft) {\n case Extrapolate.CLAMP:\n return outputRange[0];\n case Extrapolate.EXTEND:\n return lerp(value, input[0], input[1], outputRange[0], outputRange[1]);\n case Extrapolate.IDENTITY:\n throw new Error(\n \"Identity is not a supported extrapolation type for interpolatePaths()\"\n );\n default:\n exhaustiveCheck(extrapolation.extrapolateLeft);\n }\n } else if (value > input[input.length - 1]) {\n switch (extrapolation.extrapolateRight) {\n case Extrapolate.CLAMP:\n return outputRange[outputRange.length - 1];\n case Extrapolate.EXTEND:\n return lerp(\n value,\n input[input.length - 2],\n input[input.length - 1],\n outputRange[input.length - 2],\n outputRange[input.length - 1]\n );\n case Extrapolate.IDENTITY:\n throw new Error(\n \"Identity is not a supported extrapolation type for interpolatePaths()\"\n );\n default:\n exhaustiveCheck(extrapolation.extrapolateRight);\n }\n }\n let i = 0;\n for (; i <= input.length - 1; i++) {\n if (value >= input[i] && value <= input[i + 1]) {\n break;\n }\n }\n return lerp(\n value,\n input[i],\n input[i + 1],\n outputRange[i],\n outputRange[i + 1]\n );\n};\n"],"mappings":"AACA,SAASA,eAAT,QAAgC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AW,CAACA,WAAW,CAACQ,MAAZ,GAAqB,CAAtB,CAAlB;;MACF,KAAKnB,WAAW,CAACgB,MAAjB;QACE,OAAOf,IAAI,CACTC,KADS,EAETQ,KAAK,CAACA,KAAK,CAACS,MAAN,GAAe,CAAhB,CAFI,EAGTT,KAAK,CAACA,KAAK,CAACS,MAAN,GAAe,CAAhB,CAHI,EAITR,WAAW,CAACD,KAAK,CAACS,MAAN,GAAe,CAAhB,CAJF,EAKTR,WAAW,CAACD,KAAK,CAACS,MAAN,GAAe,CAAhB,CALF,CAAX;;MAOF,KAAKnB,WAAW,CAACiB,QAAjB;QACE,MAAM,IAAIC,KAAJ,CACJ,uEADI,CAAN;;MAGF;QACEpB,eAAe,CAACe,aAAa,CAACO,gBAAf,CAAf;IAhBJ;EAkBD;;EACD,IAAIC,CAAC,GAAG,CAAR;;EACA,OAAOA,CAAC,IAAIX,KAAK,CAACS,MAAN,GAAe,CAA3B,EAA8BE,CAAC,EAA/B,EAAmC;IACjC,IAAInB,KAAK,IAAIQ,KAAK,CAACW,CAAD,CAAd,IAAqBnB,KAAK,IAAIQ,KAAK,CAACW,CAAC,GAAG,CAAL,CAAvC,EAAgD;MAC9C;IACD;EACF;;EACD,OAAOpB,IAAI,CACTC,KADS,EAETQ,KAAK,CAACW,CAAD,CAFI,EAGTX,KAAK,CAACW,CAAC,GAAG,CAAL,CAHI,EAITV,WAAW,CAACU,CAAD,CAJF,EAKTV,WAAW,CAACU,CAAC,GAAG,CAAL,CALF,CAAX;AAOD,CArDM"}
@@ -1 +1 @@
1
- {"version":3,"sources":["interpolateVector.ts"],"names":["interpolate","interpolateVector","value","inputRange","outputRange","options","x","map","v","y","mixVector","from","to"],"mappings":"AAEA,SAASA,WAAT,QAA4B,eAA5B;AAEA,OAAO,MAAMC,iBAAiB,GAAG,CAC/BC,KAD+B,EAE/BC,UAF+B,EAG/BC,WAH+B,EAI/BC,OAJ+B,MAK3B;AACJC,EAAAA,CAAC,EAAEN,WAAW,CACZE,KADY,EAEZC,UAFY,EAGZC,WAAW,CAACG,GAAZ,CAAiBC,CAAD,IAAOA,CAAC,CAACF,CAAzB,CAHY,EAIZD,OAJY,CADV;AAOJI,EAAAA,CAAC,EAAET,WAAW,CACZE,KADY,EAEZC,UAFY,EAGZC,WAAW,CAACG,GAAZ,CAAiBC,CAAD,IAAOA,CAAC,CAACC,CAAzB,CAHY,EAIZJ,OAJY;AAPV,CAL2B,CAA1B;AAoBP,OAAO,MAAMK,SAAS,GAAG,CAACR,KAAD,EAAgBS,IAAhB,EAA8BC,EAA9B,KACvBX,iBAAiB,CAACC,KAAD,EAAQ,CAAC,CAAD,EAAI,CAAJ,CAAR,EAAgB,CAACS,IAAD,EAAOC,EAAP,CAAhB,CADZ","sourcesContent":["import type { Vector } from \"../../skia/types\";\n\nimport { interpolate } from \"./interpolate\";\n\nexport const interpolateVector = (\n value: number,\n inputRange: readonly number[],\n outputRange: readonly Vector[],\n options?: Parameters<typeof interpolate>[3]\n) => ({\n x: interpolate(\n value,\n inputRange,\n outputRange.map((v) => v.x),\n options\n ),\n y: interpolate(\n value,\n inputRange,\n outputRange.map((v) => v.y),\n options\n ),\n});\n\nexport const mixVector = (value: number, from: Vector, to: Vector) =>\n interpolateVector(value, [0, 1], [from, to]);\n"]}
1
+ {"version":3,"names":["interpolate","interpolateVector","value","inputRange","outputRange","options","x","map","v","y","mixVector","from","to"],"sources":["interpolateVector.ts"],"sourcesContent":["import type { Vector } from \"../../skia/types\";\n\nimport { interpolate } from \"./interpolate\";\n\nexport const interpolateVector = (\n value: number,\n inputRange: readonly number[],\n outputRange: readonly Vector[],\n options?: Parameters<typeof interpolate>[3]\n) => ({\n x: interpolate(\n value,\n inputRange,\n outputRange.map((v) => v.x),\n options\n ),\n y: interpolate(\n value,\n inputRange,\n outputRange.map((v) => v.y),\n options\n ),\n});\n\nexport const mixVector = (value: number, from: Vector, to: Vector) =>\n interpolateVector(value, [0, 1], [from, to]);\n"],"mappings":"AAEA,SAASA,WAAT,QAA4B,eAA5B;AAEA,OAAO,MAAMC,iBAAiB,GAAG,CAC/BC,KAD+B,EAE/BC,UAF+B,EAG/BC,WAH+B,EAI/BC,OAJ+B,MAK3B;EACJC,CAAC,EAAEN,WAAW,CACZE,KADY,EAEZC,UAFY,EAGZC,WAAW,CAACG,GAAZ,CAAiBC,CAAD,IAAOA,CAAC,CAACF,CAAzB,CAHY,EAIZD,OAJY,CADV;EAOJI,CAAC,EAAET,WAAW,CACZE,KADY,EAEZC,UAFY,EAGZC,WAAW,CAACG,GAAZ,CAAiBC,CAAD,IAAOA,CAAC,CAACC,CAAzB,CAHY,EAIZJ,OAJY;AAPV,CAL2B,CAA1B;AAoBP,OAAO,MAAMK,SAAS,GAAG,CAACR,KAAD,EAAgBS,IAAhB,EAA8BC,EAA9B,KACvBX,iBAAiB,CAACC,KAAD,EAAQ,CAAC,CAAD,EAAI,CAAJ,CAAR,EAAgB,CAACS,IAAD,EAAOC,EAAP,CAAhB,CADZ"}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAd;AACA,cAAc,UAAd;AACA,cAAc,SAAd;AACA,cAAc,aAAd","sourcesContent":["export * from \"./timing\";\nexport * from \"./spring\";\nexport * from \"./decay\";\nexport * from \"./functions\";\n"]}
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./timing\";\nexport * from \"./spring\";\nexport * from \"./decay\";\nexport * from \"./functions\";\n"],"mappings":"AAAA,cAAc,UAAd;AACA,cAAc,UAAd;AACA,cAAc,SAAd;AACA,cAAc,aAAd"}
@@ -1 +1 @@
1
- {"version":3,"sources":["Spring.ts"],"names":["Config","Gentle","mass","stiffness","damping","velocity","Wobbly","WobblySlow","Stiff","Default","Spring","config"],"mappings":"AAEA;AACA;AACA;AACA,MAAMA,MAAM,GAAG;AACbC,EAAAA,MAAM,EAAE;AACNC,IAAAA,IAAI,EAAE,CADA;AAENC,IAAAA,SAAS,EAAE,GAFL;AAGN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,KAAK,EAAE;AAAA,QAACG,MAAD,uEAAwB,EAAxB;AAAA,WAAgC,EACrC,GAAGX,MAAM,CAACQ,KAD2B;AAErC,SAAGG;AAFkC,KAAhC;AAAA,GAda;AAkBpBF,EAAAA,OAAO,EAAE;AAAA,QAACE,MAAD,uEAAwB,EAAxB;AAAA,WAAgC,EACvC,GAAGX,MAAM,CAACS,OAD6B;AAEvC,SAAGE;AAFoC,KAAhC;AAAA;AAlBW,CAAf","sourcesContent":["import type { SpringConfig } from \"./types\";\n\n/*\n Spring animation configurations\n*/\nconst Config = {\n Gentle: {\n mass: 1,\n stiffness: 170,\n damping: 19,\n velocity: 0,\n },\n Wobbly: {\n mass: 1,\n stiffness: 180,\n damping: 12,\n velocity: 0,\n },\n WobblySlow: {\n mass: 4,\n stiffness: 180,\n damping: 25,\n velocity: 0,\n },\n Stiff: {\n mass: 1,\n stiffness: 200,\n damping: 20,\n velocity: 0,\n },\n Default: {\n mass: 1,\n stiffness: 100,\n damping: 10,\n velocity: 0,\n },\n};\n\nexport const Spring = {\n Config,\n Gentle: (config: SpringConfig = {}) => ({\n ...Config.Gentle,\n ...config,\n }),\n Wobbly: (config: SpringConfig = {}) => ({\n ...Config.Wobbly,\n ...config,\n }),\n WobblySlow: (config: SpringConfig = {}) => ({\n ...Config.WobblySlow,\n ...config,\n }),\n Stiff: (config: SpringConfig = {}) => ({\n ...Config.Stiff,\n ...config,\n }),\n Default: (config: SpringConfig = {}) => ({\n ...Config.Default,\n ...config,\n }),\n};\n"]}
1
+ {"version":3,"names":["Config","Gentle","mass","stiffness","damping","velocity","Wobbly","WobblySlow","Stiff","Default","Spring","config"],"sources":["Spring.ts"],"sourcesContent":["import type { SpringConfig } from \"./types\";\n\n/*\n Spring animation configurations\n*/\nconst Config = {\n Gentle: {\n mass: 1,\n stiffness: 170,\n damping: 19,\n velocity: 0,\n },\n Wobbly: {\n mass: 1,\n stiffness: 180,\n damping: 12,\n velocity: 0,\n },\n WobblySlow: {\n mass: 4,\n stiffness: 180,\n damping: 25,\n velocity: 0,\n },\n Stiff: {\n mass: 1,\n stiffness: 200,\n damping: 20,\n velocity: 0,\n },\n Default: {\n mass: 1,\n stiffness: 100,\n damping: 10,\n velocity: 0,\n },\n};\n\nexport const Spring = {\n Config,\n Gentle: (config: SpringConfig = {}) => ({\n ...Config.Gentle,\n ...config,\n }),\n Wobbly: (config: SpringConfig = {}) => ({\n ...Config.Wobbly,\n ...config,\n }),\n WobblySlow: (config: SpringConfig = {}) => ({\n ...Config.WobblySlow,\n ...config,\n }),\n Stiff: (config: SpringConfig = {}) => ({\n ...Config.Stiff,\n ...config,\n }),\n Default: (config: SpringConfig = {}) => ({\n ...Config.Default,\n ...config,\n }),\n};\n"],"mappings":"AAEA;AACA;AACA;AACA,MAAMA,MAAM,GAAG;EACbC,MAAM,EAAE;IACNC,IAAI,EAAE,CADA;IAENC,SAAS,EAAE,GAFL;IAGNC,OAAO,EAAE,EAHH;IAINC,QAAQ,EAAE;EAJJ,CADK;EAObC,MAAM,EAAE;IACNJ,IAAI,EAAE,CADA;IAENC,SAAS,EAAE,GAFL;IAGNC,OAAO,EAAE,EAHH;IAINC,QAAQ,EAAE;EAJJ,CAPK;EAabE,UAAU,EAAE;IACVL,IAAI,EAAE,CADI;IAEVC,SAAS,EAAE,GAFD;IAGVC,OAAO,EAAE,EAHC;IAIVC,QAAQ,EAAE;EAJA,CAbC;EAmBbG,KAAK,EAAE;IACLN,IAAI,EAAE,CADD;IAELC,SAAS,EAAE,GAFN;IAGLC,OAAO,EAAE,EAHJ;IAILC,QAAQ,EAAE;EAJL,CAnBM;EAyBbI,OAAO,EAAE;IACPP,IAAI,EAAE,CADC;IAEPC,SAAS,EAAE,GAFJ;IAGPC,OAAO,EAAE,EAHF;IAIPC,QAAQ,EAAE;EAJH;AAzBI,CAAf;AAiCA,OAAO,MAAMK,MAAM,GAAG;EACpBV,MADoB;EAEpBC,MAAM,EAAE;IAAA,IAACU,MAAD,uEAAwB,EAAxB;IAAA,OAAgC,EACtC,GAAGX,MAAM,CAACC,MAD4B;MAEtC,GAAGU;IAFmC,CAAhC;EAAA,CAFY;EAMpBL,MAAM,EAAE;IAAA,IAACK,MAAD,uEAAwB,EAAxB;IAAA,OAAgC,EACtC,GAAGX,MAAM,CAACM,MAD4B;MAEtC,GAAGK;IAFmC,CAAhC;EAAA,CANY;EAUpBJ,UAAU,EAAE;IAAA,IAACI,MAAD,uEAAwB,EAAxB;IAAA,OAAgC,EAC1C,GAAGX,MAAM,CAACO,UADgC;MAE1C,GAAGI;IAFuC,CAAhC;EAAA,CAVQ;EAcpBH,KAAK,EAAE;IAAA,IAACG,MAAD,uEAAwB,EAAxB;IAAA,OAAgC,EACrC,GAAGX,MAAM,CAACQ,KAD2B;MAErC,GAAGG;IAFkC,CAAhC;EAAA,CAda;EAkBpBF,OAAO,EAAE;IAAA,IAACE,MAAD,uEAAwB,EAAxB;IAAA,OAAgC,EACvC,GAAGX,MAAM,CAACS,OAD6B;MAEvC,GAAGE;IAFoC,CAAhC;EAAA;AAlBW,CAAf"}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":["createSpringEasing"],"mappings":"AAAA,SAASA,kBAAT,QAAmC,UAAnC","sourcesContent":["export { createSpringEasing } from \"./spring\";\n"]}
1
+ {"version":3,"names":["createSpringEasing"],"sources":["index.ts"],"sourcesContent":["export { createSpringEasing } from \"./spring\";\n"],"mappings":"AAAA,SAASA,kBAAT,QAAmC,UAAnC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["spring.ts"],"names":["createSpringEasing","params","config","mass","stiffness","damping","velocity","getSpringEasing","initialVelocity","state","w0","Math","sqrt","zeta","wd","a","b","update","t","duration","progress","exp","cos","sin","getDurationMs","frame","elapsed","rest","durationMs","easing"],"mappings":"AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,kBAAkB,GAC7BC,MADgC,IAEf;AACjB,QAAMC,MAAM,GAAG;AACbC,IAAAA,IAAI,EAAE,CADO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,KAAV,GAAkB,IAAnC;AACA,WAAOG,UAAU,GAAG,IAApB;AACD,GAjBD;;AAmBA,QAAMA,UAAU,GAAGJ,aAAa,EAAhC;AAEA,SAAO;AACLK,IAAAA,MAAM,EAAGX,CAAD,IAAeD,MAAM,CAACC,CAAD,EAAIU,UAAJ,CADxB;AAELT,IAAAA,QAAQ,EAAES;AAFL,GAAP;AAID,CA7DD","sourcesContent":["import type { SpringConfig } from \"../types\";\nimport type { TimingConfig } from \"../../types\";\n\n/**\n * @description Returns a cached jsContext function for a spring with duration\n * @param mass The mass of the spring\n * @param stiffness The stiffness of the spring\n * @param damping Spring damping\n * @param velocity The initial velocity\n */\nexport const createSpringEasing = (\n params: Partial<SpringConfig>\n): TimingConfig => {\n const config = {\n mass: 1,\n stiffness: 100,\n damping: 10,\n velocity: 0,\n ...params,\n };\n config.velocity /= 100;\n return getSpringEasing(config);\n};\n\nconst getSpringEasing = (config: Required<SpringConfig>) => {\n const { stiffness, mass, damping, velocity: initialVelocity } = config;\n // Setup spring state\n const state = {\n w0: Math.sqrt(stiffness / mass),\n zeta: 0,\n wd: 0,\n a: 1,\n b: 0,\n };\n state.zeta = damping / (2 * Math.sqrt(stiffness * mass));\n state.wd =\n state.zeta < 1 ? state.w0 * Math.sqrt(1 - state.zeta * state.zeta) : 0;\n state.a = 1;\n state.b =\n state.zeta < 1\n ? (state.zeta * state.w0 + -initialVelocity) / state.wd\n : -initialVelocity + state.w0;\n\n const update = (t: number, duration?: number) => {\n let progress = duration ? (duration * t) / 1000 : t;\n if (state.zeta < 1) {\n progress =\n Math.exp(-progress * state.zeta * state.w0) *\n (state.a * Math.cos(state.wd * progress) +\n state.b * Math.sin(state.wd * progress));\n } else {\n progress =\n (state.a + state.b * progress) * Math.exp(-progress * state.w0);\n }\n if (t === 0 || t === 1) {\n return t;\n }\n return 1 - progress;\n };\n\n const getDurationMs = () => {\n var frame = 1 / 6;\n var elapsed = 0;\n var rest = 0;\n while (true) {\n elapsed += frame;\n if (update(elapsed) === 1) {\n rest++;\n if (rest >= 6) {\n break;\n }\n } else {\n rest = 0;\n }\n }\n var durationMs = elapsed * frame * 1000;\n return durationMs + 1000;\n };\n\n const durationMs = getDurationMs();\n\n return {\n easing: (t: number) => update(t, durationMs),\n duration: durationMs,\n };\n};\n"]}
1
+ {"version":3,"names":["createSpringEasing","params","config","mass","stiffness","damping","velocity","getSpringEasing","initialVelocity","state","w0","Math","sqrt","zeta","wd","a","b","update","t","duration","progress","exp","cos","sin","getDurationMs","frame","elapsed","rest","durationMs","easing"],"sources":["spring.ts"],"sourcesContent":["import type { SpringConfig } from \"../types\";\nimport type { TimingConfig } from \"../../types\";\n\n/**\n * @description Returns a cached jsContext function for a spring with duration\n * @param mass The mass of the spring\n * @param stiffness The stiffness of the spring\n * @param damping Spring damping\n * @param velocity The initial velocity\n */\nexport const createSpringEasing = (\n params: Partial<SpringConfig>\n): TimingConfig => {\n const config = {\n mass: 1,\n stiffness: 100,\n damping: 10,\n velocity: 0,\n ...params,\n };\n config.velocity /= 100;\n return getSpringEasing(config);\n};\n\nconst getSpringEasing = (config: Required<SpringConfig>) => {\n const { stiffness, mass, damping, velocity: initialVelocity } = config;\n // Setup spring state\n const state = {\n w0: Math.sqrt(stiffness / mass),\n zeta: 0,\n wd: 0,\n a: 1,\n b: 0,\n };\n state.zeta = damping / (2 * Math.sqrt(stiffness * mass));\n state.wd =\n state.zeta < 1 ? state.w0 * Math.sqrt(1 - state.zeta * state.zeta) : 0;\n state.a = 1;\n state.b =\n state.zeta < 1\n ? (state.zeta * state.w0 + -initialVelocity) / state.wd\n : -initialVelocity + state.w0;\n\n const update = (t: number, duration?: number) => {\n let progress = duration ? (duration * t) / 1000 : t;\n if (state.zeta < 1) {\n progress =\n Math.exp(-progress * state.zeta * state.w0) *\n (state.a * Math.cos(state.wd * progress) +\n state.b * Math.sin(state.wd * progress));\n } else {\n progress =\n (state.a + state.b * progress) * Math.exp(-progress * state.w0);\n }\n if (t === 0 || t === 1) {\n return t;\n }\n return 1 - progress;\n };\n\n const getDurationMs = () => {\n var frame = 1 / 6;\n var elapsed = 0;\n var rest = 0;\n while (true) {\n elapsed += frame;\n if (update(elapsed) === 1) {\n rest++;\n if (rest >= 6) {\n break;\n }\n } else {\n rest = 0;\n }\n }\n var durationMs = elapsed * frame * 1000;\n return durationMs + 1000;\n };\n\n const durationMs = getDurationMs();\n\n return {\n easing: (t: number) => update(t, durationMs),\n duration: durationMs,\n };\n};\n"],"mappings":"AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,kBAAkB,GAC7BC,MADgC,IAEf;EACjB,MAAMC,MAAM,GAAG;IACbC,IAAI,EAAE,CADO;IAEbC,SAAS,EAAE,GAFE;IAGbC,OAAO,EAAE,EAHI;IAIbC,QAAQ,EAAE,CAJG;IAKb,GAAGL;EALU,CAAf;EAOAC,MAAM,CAACI,QAAP,IAAmB,GAAnB;EACA,OAAOC,eAAe,CAACL,MAAD,CAAtB;AACD,CAZM;;AAcP,MAAMK,eAAe,GAAIL,MAAD,IAAoC;EAC1D,MAAM;IAAEE,SAAF;IAAaD,IAAb;IAAmBE,OAAnB;IAA4BC,QAAQ,EAAEE;EAAtC,IAA0DN,MAAhE,CAD0D,CAE1D;;EACA,MAAMO,KAAK,GAAG;IACZC,EAAE,EAAEC,IAAI,CAACC,IAAL,CAAUR,SAAS,GAAGD,IAAtB,CADQ;IAEZU,IAAI,EAAE,CAFM;IAGZC,EAAE,EAAE,CAHQ;IAIZC,CAAC,EAAE,CAJS;IAKZC,CAAC,EAAE;EALS,CAAd;EAOAP,KAAK,CAACI,IAAN,GAAaR,OAAO,IAAI,IAAIM,IAAI,CAACC,IAAL,CAAUR,SAAS,GAAGD,IAAtB,CAAR,CAApB;EACAM,KAAK,CAACK,EAAN,GACEL,KAAK,CAACI,IAAN,GAAa,CAAb,GAAiBJ,KAAK,CAACC,EAAN,GAAWC,IAAI,CAACC,IAAL,CAAU,IAAIH,KAAK,CAACI,IAAN,GAAa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,CAAX;;IACA,OAAO,IAAP,EAAa;MACXD,OAAO,IAAID,KAAX;;MACA,IAAIR,MAAM,CAACS,OAAD,CAAN,KAAoB,CAAxB,EAA2B;QACzBC,IAAI;;QACJ,IAAIA,IAAI,IAAI,CAAZ,EAAe;UACb;QACD;MACF,CALD,MAKO;QACLA,IAAI,GAAG,CAAP;MACD;IACF;;IACD,IAAIC,UAAU,GAAGF,OAAO,GAAGD,KAAV,GAAkB,IAAnC;IACA,OAAOG,UAAU,GAAG,IAApB;EACD,CAjBD;;EAmBA,MAAMA,UAAU,GAAGJ,aAAa,EAAhC;EAEA,OAAO;IACLK,MAAM,EAAGX,CAAD,IAAeD,MAAM,CAACC,CAAD,EAAIU,UAAJ,CADxB;IAELT,QAAQ,EAAES;EAFL,CAAP;AAID,CA7DD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":["Spring","runSpring","useSpring"],"mappings":"AAAA,SAASA,MAAT,QAAuB,UAAvB;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SAASC,SAAT,QAA0B,aAA1B","sourcesContent":["export { Spring } from \"./Spring\";\nexport { runSpring } from \"./runSpring\";\nexport { useSpring } from \"./useSpring\";\n"]}
1
+ {"version":3,"names":["Spring","runSpring","useSpring"],"sources":["index.ts"],"sourcesContent":["export { Spring } from \"./Spring\";\nexport { runSpring } from \"./runSpring\";\nexport { useSpring } from \"./useSpring\";\n"],"mappings":"AAAA,SAASA,MAAT,QAAuB,UAAvB;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SAASC,SAAT,QAA0B,aAA1B"}
@@ -16,6 +16,6 @@ import { createSpringEasing } from "./functions/spring";
16
16
  */
17
17
 
18
18
  export const runSpring = (value, toOrParams, config, callback) => {
19
- return runTiming(value, toOrParams, createSpringEasing(config !== null && config !== void 0 ? config : Spring.Config.Default), callback);
19
+ return runTiming(value, toOrParams, createSpringEasing(config ?? Spring.Config.Default), callback);
20
20
  };
21
21
  //# sourceMappingURL=runSpring.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["runSpring.ts"],"names":["runTiming","Spring","createSpringEasing","runSpring","value","toOrParams","config","callback","Config","Default"],"mappings":"AAMA,SAASA,SAAT,QAA0B,qBAA1B;AAEA,SAASC,MAAT,QAAuB,UAAvB;AACA,SAASC,kBAAT,QAAmC,oBAAnC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,SAAS,GAAG,CACvBC,KADuB,EAEvBC,UAFuB,EAGvBC,MAHuB,EAIvBC,QAJuB,KAKL;AAClB,SAAOP,SAAS,CACdI,KADc,EAEdC,UAFc,EAGdH,kBAAkB,CAACI,MAAD,aAACA,MAAD,cAACA,MAAD,GAAWL,MAAM,CAACO,MAAP,CAAcC,OAAzB,CAHJ,EAIdF,QAJc,CAAhB;AAMD,CAZM","sourcesContent":["import type { SkiaMutableValue, SkiaAnimation } from \"../../values/types\";\nimport type {\n AnimationParams,\n SpringConfig,\n AnimationCallback,\n} from \"../types\";\nimport { runTiming } from \"../timing/runTiming\";\n\nimport { Spring } from \"./Spring\";\nimport { createSpringEasing } from \"./functions/spring\";\n\n/**\n * Creates a new animation on an existing value that will be driven by\n * an animation value. The value will be run from / to the value in\n * params and modified by the provided easing curve for the length of\n * the duration. When the value has reached its desired \"to\" value the\n * animation will be stopped.\n *\n * @param value The value to animate\n * @param toOrParams To value or Animation parameters\n * @param config Spring configuration\n * @returns an animation value that can be used to start/stop\n * the animation.\n */\nexport const runSpring = (\n value: SkiaMutableValue<number>,\n toOrParams: number | AnimationParams,\n config?: SpringConfig,\n callback?: AnimationCallback\n): SkiaAnimation => {\n return runTiming(\n value,\n toOrParams,\n createSpringEasing(config ?? Spring.Config.Default),\n callback\n );\n};\n"]}
1
+ {"version":3,"names":["runTiming","Spring","createSpringEasing","runSpring","value","toOrParams","config","callback","Config","Default"],"sources":["runSpring.ts"],"sourcesContent":["import type { SkiaMutableValue, SkiaAnimation } from \"../../values/types\";\nimport type {\n AnimationParams,\n SpringConfig,\n AnimationCallback,\n} from \"../types\";\nimport { runTiming } from \"../timing/runTiming\";\n\nimport { Spring } from \"./Spring\";\nimport { createSpringEasing } from \"./functions/spring\";\n\n/**\n * Creates a new animation on an existing value that will be driven by\n * an animation value. The value will be run from / to the value in\n * params and modified by the provided easing curve for the length of\n * the duration. When the value has reached its desired \"to\" value the\n * animation will be stopped.\n *\n * @param value The value to animate\n * @param toOrParams To value or Animation parameters\n * @param config Spring configuration\n * @returns an animation value that can be used to start/stop\n * the animation.\n */\nexport const runSpring = (\n value: SkiaMutableValue<number>,\n toOrParams: number | AnimationParams,\n config?: SpringConfig,\n callback?: AnimationCallback\n): SkiaAnimation => {\n return runTiming(\n value,\n toOrParams,\n createSpringEasing(config ?? Spring.Config.Default),\n callback\n );\n};\n"],"mappings":"AAMA,SAASA,SAAT,QAA0B,qBAA1B;AAEA,SAASC,MAAT,QAAuB,UAAvB;AACA,SAASC,kBAAT,QAAmC,oBAAnC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,SAAS,GAAG,CACvBC,KADuB,EAEvBC,UAFuB,EAGvBC,MAHuB,EAIvBC,QAJuB,KAKL;EAClB,OAAOP,SAAS,CACdI,KADc,EAEdC,UAFc,EAGdH,kBAAkB,CAACI,MAAM,IAAIL,MAAM,CAACO,MAAP,CAAcC,OAAzB,CAHJ,EAIdF,QAJc,CAAhB;AAMD,CAZM"}
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
1
+ {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["export interface SpringConfig {\n mass?: number;\n stiffness?: number;\n velocity?: number;\n damping?: number;\n}\n"],"mappings":""}
@@ -9,5 +9,5 @@ import { createSpringEasing } from "./functions/spring";
9
9
  * @returns
10
10
  */
11
11
 
12
- export const useSpring = (toOrParams, config, callback) => useTiming(toOrParams, createSpringEasing(config !== null && config !== void 0 ? config : Spring.Config.Default), callback);
12
+ export const useSpring = (toOrParams, config, callback) => useTiming(toOrParams, createSpringEasing(config ?? Spring.Config.Default), callback);
13
13
  //# sourceMappingURL=useSpring.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["useSpring.ts"],"names":["useTiming","Spring","createSpringEasing","useSpring","toOrParams","config","callback","Config","Default"],"mappings":"AAMA,SAASA,SAAT,QAA0B,WAA1B;AAEA,SAASC,MAAT,QAAuB,UAAvB;AACA,SAASC,kBAAT,QAAmC,oBAAnC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,SAAS,GAAG,CACvBC,UADuB,EAEvBC,MAFuB,EAGvBC,QAHuB,KAKvBN,SAAS,CACPI,UADO,EAEPF,kBAAkB,CAACG,MAAD,aAACA,MAAD,cAACA,MAAD,GAAWJ,MAAM,CAACM,MAAP,CAAcC,OAAzB,CAFX,EAGPF,QAHO,CALJ","sourcesContent":["import type { SkiaValue } from \"../../values/types\";\nimport type {\n SpringConfig,\n AnimationParams,\n AnimationCallback,\n} from \"../types\";\nimport { useTiming } from \"../timing\";\n\nimport { Spring } from \"./Spring\";\nimport { createSpringEasing } from \"./functions/spring\";\n\n/**\n * Creats a spring based animation value that will run whenever\n * the animation parameters change.\n * @param toOrParams\n * @param config\n * @returns\n */\nexport const useSpring = (\n toOrParams: number | AnimationParams,\n config?: SpringConfig,\n callback?: AnimationCallback\n): SkiaValue<number> =>\n useTiming(\n toOrParams,\n createSpringEasing(config ?? Spring.Config.Default),\n callback\n );\n"]}
1
+ {"version":3,"names":["useTiming","Spring","createSpringEasing","useSpring","toOrParams","config","callback","Config","Default"],"sources":["useSpring.ts"],"sourcesContent":["import type { SkiaValue } from \"../../values/types\";\nimport type {\n SpringConfig,\n AnimationParams,\n AnimationCallback,\n} from \"../types\";\nimport { useTiming } from \"../timing\";\n\nimport { Spring } from \"./Spring\";\nimport { createSpringEasing } from \"./functions/spring\";\n\n/**\n * Creats a spring based animation value that will run whenever\n * the animation parameters change.\n * @param toOrParams\n * @param config\n * @returns\n */\nexport const useSpring = (\n toOrParams: number | AnimationParams,\n config?: SpringConfig,\n callback?: AnimationCallback\n): SkiaValue<number> =>\n useTiming(\n toOrParams,\n createSpringEasing(config ?? Spring.Config.Default),\n callback\n );\n"],"mappings":"AAMA,SAASA,SAAT,QAA0B,WAA1B;AAEA,SAASC,MAAT,QAAuB,UAAvB;AACA,SAASC,kBAAT,QAAmC,oBAAnC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,SAAS,GAAG,CACvBC,UADuB,EAEvBC,MAFuB,EAGvBC,QAHuB,KAKvBN,SAAS,CACPI,UADO,EAEPF,kBAAkB,CAACG,MAAM,IAAIJ,MAAM,CAACM,MAAP,CAAcC,OAAzB,CAFX,EAGPF,QAHO,CALJ"}