@shopify/react-native-skia 0.1.150 → 0.1.152
Sign up to get free protection for your applications and to get access to all the features.
- package/android/CMakeLists.txt +4 -5
- package/android/cpp/jni/JniLoad.cpp +7 -5
- package/android/cpp/jni/JniSkiaManager.cpp +2 -15
- package/android/cpp/jni/include/JniSkiaBaseView.h +68 -0
- package/android/cpp/jni/include/JniSkiaDrawView.h +64 -47
- package/android/cpp/jni/include/JniSkiaManager.h +8 -10
- package/android/cpp/jni/include/JniSkiaPictureView.h +96 -0
- package/android/cpp/rnskia-android/{RNSkPlatformContextImpl.h → RNSkAndroidPlatformContext.h} +4 -4
- package/android/cpp/rnskia-android/RNSkAndroidView.h +100 -0
- package/android/cpp/rnskia-android/RNSkOpenGLCanvasProvider.cpp +91 -0
- package/android/cpp/rnskia-android/RNSkOpenGLCanvasProvider.h +39 -0
- package/android/cpp/rnskia-android/SkiaOpenGLRenderer.cpp +15 -6
- package/android/cpp/rnskia-android/SkiaOpenGLRenderer.h +5 -4
- package/android/src/main/java/com/shopify/reactnative/skia/PlatformContext.java +5 -11
- package/android/src/main/java/com/shopify/reactnative/skia/RNSkiaPackage.java +1 -2
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaBaseView.java +143 -0
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaDrawView.java +17 -145
- package/android/src/main/java/com/shopify/reactnative/skia/{RNSkiaViewManager.java → SkiaDrawViewManager.java} +4 -15
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaManager.java +1 -10
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaPictureView.java +45 -0
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaPictureViewManager.java +64 -0
- package/cpp/jsi/JsiValueWrapper.h +11 -0
- package/cpp/rnskia/RNSkInfoParameter.h +4 -14
- package/cpp/rnskia/RNSkJsView.cpp +211 -0
- package/cpp/rnskia/RNSkJsView.h +115 -0
- package/cpp/rnskia/RNSkJsiViewApi.h +6 -6
- package/cpp/rnskia/RNSkManager.cpp +7 -7
- package/cpp/rnskia/RNSkManager.h +7 -7
- package/cpp/rnskia/RNSkPictureView.h +124 -0
- package/cpp/rnskia/RNSkView.h +287 -0
- package/ios/RNSkia-iOS/RNSkMetalCanvasProvider.h +38 -0
- package/ios/RNSkia-iOS/{RNSkDrawViewImpl.mm → RNSkMetalCanvasProvider.mm} +40 -23
- package/ios/RNSkia-iOS/{PlatformContext.h → RNSkiOSPlatformContext.h} +4 -4
- package/ios/RNSkia-iOS/{PlatformContext.mm → RNSkiOSPlatformContext.mm} +5 -5
- package/ios/RNSkia-iOS/RNSkiOSView.h +34 -0
- package/ios/RNSkia-iOS/SkiaDrawViewManager.mm +19 -11
- package/ios/RNSkia-iOS/SkiaManager.mm +3 -3
- package/ios/RNSkia-iOS/SkiaPictureViewManager.h +8 -0
- package/ios/RNSkia-iOS/SkiaPictureViewManager.mm +51 -0
- package/ios/RNSkia-iOS/SkiaUIView.h +26 -0
- package/ios/RNSkia-iOS/{SkiaDrawView.mm → SkiaUIView.mm} +29 -23
- package/lib/commonjs/animation/decay/decay.js.map +1 -1
- package/lib/commonjs/animation/decay/index.js.map +1 -1
- package/lib/commonjs/animation/decay/runDecay.js.map +1 -1
- package/lib/commonjs/animation/decay/types.js.map +1 -1
- package/lib/commonjs/animation/functions/index.js.map +1 -1
- package/lib/commonjs/animation/functions/interpolate.js.map +1 -1
- package/lib/commonjs/animation/functions/interpolateColors.js.map +1 -1
- package/lib/commonjs/animation/functions/interpolatePaths.js.map +1 -1
- package/lib/commonjs/animation/functions/interpolateVector.js.map +1 -1
- package/lib/commonjs/animation/index.js.map +1 -1
- package/lib/commonjs/animation/spring/Spring.js.map +1 -1
- package/lib/commonjs/animation/spring/functions/index.js.map +1 -1
- package/lib/commonjs/animation/spring/functions/spring.js.map +1 -1
- package/lib/commonjs/animation/spring/index.js.map +1 -1
- package/lib/commonjs/animation/spring/runSpring.js +1 -1
- package/lib/commonjs/animation/spring/runSpring.js.map +1 -1
- package/lib/commonjs/animation/spring/types.js.map +1 -1
- package/lib/commonjs/animation/spring/useSpring.js +1 -1
- package/lib/commonjs/animation/spring/useSpring.js.map +1 -1
- package/lib/commonjs/animation/timing/Easing.js.map +1 -1
- package/lib/commonjs/animation/timing/createTiming.js +2 -6
- package/lib/commonjs/animation/timing/createTiming.js.map +1 -1
- package/lib/commonjs/animation/timing/functions/bezier.js.map +1 -1
- package/lib/commonjs/animation/timing/functions/getResolvedParams.js +6 -10
- package/lib/commonjs/animation/timing/functions/getResolvedParams.js.map +1 -1
- package/lib/commonjs/animation/timing/functions/index.js.map +1 -1
- package/lib/commonjs/animation/timing/functions/timing.js.map +1 -1
- package/lib/commonjs/animation/timing/functions/types.js.map +1 -1
- package/lib/commonjs/animation/timing/index.js.map +1 -1
- package/lib/commonjs/animation/timing/runTiming.js.map +1 -1
- package/lib/commonjs/animation/timing/useLoop.js.map +1 -1
- package/lib/commonjs/animation/timing/useTiming.js +1 -3
- package/lib/commonjs/animation/timing/useTiming.js.map +1 -1
- package/lib/commonjs/animation/types.js.map +1 -1
- package/lib/commonjs/dom/nodes/DrawingNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/GroupNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/JsiSkDOM.js +1 -1
- package/lib/commonjs/dom/nodes/JsiSkDOM.js.map +1 -1
- package/lib/commonjs/dom/nodes/Node.js.map +1 -1
- package/lib/commonjs/dom/nodes/PaintContext.js.map +1 -1
- package/lib/commonjs/dom/nodes/PaintNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/RenderNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Circle.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Color.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Enum.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Fitting.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Gradient.js +2 -2
- package/lib/commonjs/dom/nodes/datatypes/Gradient.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Path.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Radius.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Rect.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Transform.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/index.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/BackdropFilterNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/Box.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/CircleNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/CustomDrawingNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/DiffRectNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/FillNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/ImageNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/ImageSVG.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/LineNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/OvalNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/PatchNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/PathNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/PictureNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/PointsNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/RRectNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/RectNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/Text.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/VerticesNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/index.js.map +1 -1
- package/lib/commonjs/dom/nodes/index.js.map +1 -1
- package/lib/commonjs/dom/nodes/paint/BlendNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/paint/ColorFilters.js.map +1 -1
- package/lib/commonjs/dom/nodes/paint/ImageFilters.js.map +1 -1
- package/lib/commonjs/dom/nodes/paint/MaskFilters.js.map +1 -1
- package/lib/commonjs/dom/nodes/paint/PathEffects.js.map +1 -1
- package/lib/commonjs/dom/nodes/paint/Shaders.js +2 -4
- package/lib/commonjs/dom/nodes/paint/Shaders.js.map +1 -1
- package/lib/commonjs/dom/nodes/paint/index.js.map +1 -1
- package/lib/commonjs/dom/types/ColorFilters.js.map +1 -1
- package/lib/commonjs/dom/types/Common.js.map +1 -1
- package/lib/commonjs/dom/types/DrawingContext.js.map +1 -1
- package/lib/commonjs/dom/types/Drawings.js.map +1 -1
- package/lib/commonjs/dom/types/ImageFilters.js.map +1 -1
- package/lib/commonjs/dom/types/MaskFilters.js.map +1 -1
- package/lib/commonjs/dom/types/Node.js.map +1 -1
- package/lib/commonjs/dom/types/NodeType.js.map +1 -1
- package/lib/commonjs/dom/types/PathEffects.js.map +1 -1
- package/lib/commonjs/dom/types/Shaders.js.map +1 -1
- package/lib/commonjs/dom/types/SkDOM.js.map +1 -1
- package/lib/commonjs/dom/types/index.js.map +1 -1
- package/lib/commonjs/external/index.js.map +1 -1
- package/lib/commonjs/external/reanimated/index.js.map +1 -1
- package/lib/commonjs/external/reanimated/useSharedValueEffect.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/mock/index.js +6 -10
- package/lib/commonjs/mock/index.js.map +1 -1
- package/lib/commonjs/renderer/Canvas.js.map +1 -1
- package/lib/commonjs/renderer/Container.js.map +1 -1
- package/lib/commonjs/renderer/DependencyManager.js.map +1 -1
- package/lib/commonjs/renderer/DrawingContext.js.map +1 -1
- package/lib/commonjs/renderer/HostComponents.js.map +1 -1
- package/lib/commonjs/renderer/HostConfig.js +0 -2
- package/lib/commonjs/renderer/HostConfig.js.map +1 -1
- package/lib/commonjs/renderer/components/Blend.js.map +1 -1
- package/lib/commonjs/renderer/components/Drawing.js.map +1 -1
- package/lib/commonjs/renderer/components/Group.js.map +1 -1
- package/lib/commonjs/renderer/components/Mask.js.map +1 -1
- package/lib/commonjs/renderer/components/Paint.js +1 -1
- package/lib/commonjs/renderer/components/Paint.js.map +1 -1
- package/lib/commonjs/renderer/components/Picture.js.map +1 -1
- package/lib/commonjs/renderer/components/backdrop/BackdropBlur.js +1 -1
- package/lib/commonjs/renderer/components/backdrop/BackdropBlur.js.map +1 -1
- package/lib/commonjs/renderer/components/backdrop/BackdropFilter.js.map +1 -1
- package/lib/commonjs/renderer/components/backdrop/index.js.map +1 -1
- package/lib/commonjs/renderer/components/colorFilters/BlendColor.js.map +1 -1
- package/lib/commonjs/renderer/components/colorFilters/Lerp.js.map +1 -1
- package/lib/commonjs/renderer/components/colorFilters/LinearToSRGBGamma.js.map +1 -1
- package/lib/commonjs/renderer/components/colorFilters/LumaColorFilter.js.map +1 -1
- package/lib/commonjs/renderer/components/colorFilters/Matrix.js.map +1 -1
- package/lib/commonjs/renderer/components/colorFilters/SRGBToLinearGamma.js.map +1 -1
- package/lib/commonjs/renderer/components/colorFilters/index.js.map +1 -1
- package/lib/commonjs/renderer/components/image/Image.js.map +1 -1
- package/lib/commonjs/renderer/components/image/ImageSVG.js.map +1 -1
- package/lib/commonjs/renderer/components/image/ImageShader.js.map +1 -1
- package/lib/commonjs/renderer/components/image/index.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/Blur.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/DisplacementMap.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/Morphology.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/Offset.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/RuntimeShader.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/Shadow.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/index.js.map +1 -1
- package/lib/commonjs/renderer/components/index.js.map +1 -1
- package/lib/commonjs/renderer/components/maskFilters/Blur.js.map +1 -1
- package/lib/commonjs/renderer/components/maskFilters/index.js.map +1 -1
- package/lib/commonjs/renderer/components/pathEffects/Corner.js.map +1 -1
- package/lib/commonjs/renderer/components/pathEffects/Dash.js.map +1 -1
- package/lib/commonjs/renderer/components/pathEffects/Discrete.js.map +1 -1
- package/lib/commonjs/renderer/components/pathEffects/Line2D.js.map +1 -1
- package/lib/commonjs/renderer/components/pathEffects/Path1D.js.map +1 -1
- package/lib/commonjs/renderer/components/pathEffects/Path2D.js.map +1 -1
- package/lib/commonjs/renderer/components/pathEffects/Sum.js.map +1 -1
- package/lib/commonjs/renderer/components/pathEffects/index.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/Color.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/FractalNoise.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/LinearGradient.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/RadialGradient.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/Shader.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/ShaderLib.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/SweepGradient.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/Turbulence.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/TwoPointConicalGradient.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/index.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Box.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Circle.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/DiffRect.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Fill.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/FitBox.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Line.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Oval.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Patch.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Path.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Points.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Rect.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/RoundedRect.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Vertices.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/index.js.map +1 -1
- package/lib/commonjs/renderer/components/text/Glyphs.js.map +1 -1
- package/lib/commonjs/renderer/components/text/Text.js.map +1 -1
- package/lib/commonjs/renderer/components/text/TextBlob.js.map +1 -1
- package/lib/commonjs/renderer/components/text/TextPath.js.map +1 -1
- package/lib/commonjs/renderer/components/text/index.js.map +1 -1
- package/lib/commonjs/renderer/index.js.map +1 -1
- package/lib/commonjs/renderer/processors/Animations/Animations.js.map +1 -1
- package/lib/commonjs/renderer/processors/Animations/index.js.map +1 -1
- package/lib/commonjs/renderer/processors/index.js.map +1 -1
- package/lib/commonjs/renderer/processors/math/Coordinates.js.map +1 -1
- package/lib/commonjs/renderer/processors/math/Math.js.map +1 -1
- package/lib/commonjs/renderer/processors/math/Transforms.js.map +1 -1
- package/lib/commonjs/renderer/processors/math/index.js.map +1 -1
- package/lib/commonjs/renderer/typeddash.js.map +1 -1
- package/lib/commonjs/renderer/useCanvas.js.map +1 -1
- package/lib/commonjs/renderer/useContextBridge.js.map +1 -1
- package/lib/commonjs/skia/NativeSetup.js.map +1 -1
- package/lib/commonjs/skia/Skia.js.map +1 -1
- package/lib/commonjs/skia/Skia.web.js.map +1 -1
- package/lib/commonjs/skia/core/Data.js.map +1 -1
- package/lib/commonjs/skia/core/Font.js.map +1 -1
- package/lib/commonjs/skia/core/Image.js.map +1 -1
- package/lib/commonjs/skia/core/Matrix.js.map +1 -1
- package/lib/commonjs/skia/core/Picture.js.map +1 -1
- package/lib/commonjs/skia/core/RRect.js.map +1 -1
- package/lib/commonjs/skia/core/Rect.js.map +1 -1
- package/lib/commonjs/skia/core/SVG.js.map +1 -1
- package/lib/commonjs/skia/core/Typeface.js.map +1 -1
- package/lib/commonjs/skia/core/Vector.js +1 -1
- package/lib/commonjs/skia/core/Vector.js.map +1 -1
- package/lib/commonjs/skia/core/index.js.map +1 -1
- package/lib/commonjs/skia/index.js.map +1 -1
- package/lib/commonjs/skia/types/Canvas.js.map +1 -1
- package/lib/commonjs/skia/types/Color.js.map +1 -1
- package/lib/commonjs/skia/types/ColorFilter/ColorFilter.js.map +1 -1
- package/lib/commonjs/skia/types/ColorFilter/ColorFilterFactory.js.map +1 -1
- package/lib/commonjs/skia/types/ColorFilter/index.js.map +1 -1
- package/lib/commonjs/skia/types/ContourMeasure.js.map +1 -1
- package/lib/commonjs/skia/types/Data/Data.js.map +1 -1
- package/lib/commonjs/skia/types/Data/DataFactory.js.map +1 -1
- package/lib/commonjs/skia/types/Data/index.js.map +1 -1
- package/lib/commonjs/skia/types/Font/Font.js.map +1 -1
- package/lib/commonjs/skia/types/Font/index.js.map +1 -1
- package/lib/commonjs/skia/types/Image/Image.js.map +1 -1
- package/lib/commonjs/skia/types/Image/ImageFactory.js.map +1 -1
- package/lib/commonjs/skia/types/Image/index.js.map +1 -1
- package/lib/commonjs/skia/types/ImageFilter/ImageFilter.js.map +1 -1
- package/lib/commonjs/skia/types/ImageFilter/ImageFilterFactory.js.map +1 -1
- package/lib/commonjs/skia/types/ImageFilter/index.js.map +1 -1
- package/lib/commonjs/skia/types/JsiInstance.js.map +1 -1
- package/lib/commonjs/skia/types/MaskFilter.js.map +1 -1
- package/lib/commonjs/skia/types/Matrix.js.map +1 -1
- package/lib/commonjs/skia/types/Paint/BlendMode.js.map +1 -1
- package/lib/commonjs/skia/types/Paint/Paint.js.map +1 -1
- package/lib/commonjs/skia/types/Paint/index.js.map +1 -1
- package/lib/commonjs/skia/types/Path/Path.js.map +1 -1
- package/lib/commonjs/skia/types/Path/PathFactory.js.map +1 -1
- package/lib/commonjs/skia/types/Path/index.js.map +1 -1
- package/lib/commonjs/skia/types/PathEffect.js.map +1 -1
- package/lib/commonjs/skia/types/Picture/Picture.js.map +1 -1
- package/lib/commonjs/skia/types/Picture/PictureFactory.js.map +1 -1
- package/lib/commonjs/skia/types/Picture/PictureRecorder.js.map +1 -1
- package/lib/commonjs/skia/types/Picture/index.js.map +1 -1
- package/lib/commonjs/skia/types/Point.js.map +1 -1
- package/lib/commonjs/skia/types/RRect.js.map +1 -1
- package/lib/commonjs/skia/types/RSXform.js.map +1 -1
- package/lib/commonjs/skia/types/Rect.js.map +1 -1
- package/lib/commonjs/skia/types/RuntimeEffect/RuntimeEffect.js.map +1 -1
- package/lib/commonjs/skia/types/RuntimeEffect/RuntimeEffectFactory.js.map +1 -1
- package/lib/commonjs/skia/types/RuntimeEffect/index.js.map +1 -1
- package/lib/commonjs/skia/types/SVG/SVG.js.map +1 -1
- package/lib/commonjs/skia/types/SVG/SVGFactory.js.map +1 -1
- package/lib/commonjs/skia/types/SVG/index.js.map +1 -1
- package/lib/commonjs/skia/types/Shader/Shader.js.map +1 -1
- package/lib/commonjs/skia/types/Shader/ShaderFactory.js.map +1 -1
- package/lib/commonjs/skia/types/Shader/index.js.map +1 -1
- package/lib/commonjs/skia/types/Skia.js.map +1 -1
- package/lib/commonjs/skia/types/Surface/Surface.js.map +1 -1
- package/lib/commonjs/skia/types/Surface/SurfaceFactory.js.map +1 -1
- package/lib/commonjs/skia/types/Surface/index.js.map +1 -1
- package/lib/commonjs/skia/types/TextBlob.js.map +1 -1
- package/lib/commonjs/skia/types/Typeface/Typeface.js.map +1 -1
- package/lib/commonjs/skia/types/Typeface/TypefaceFactory.js.map +1 -1
- package/lib/commonjs/skia/types/Typeface/index.js.map +1 -1
- package/lib/commonjs/skia/types/Vertices/Vertices.js.map +1 -1
- package/lib/commonjs/skia/types/Vertices/index.js.map +1 -1
- package/lib/commonjs/skia/types/index.js.map +1 -1
- package/lib/commonjs/skia/web/Host.js +1 -1
- package/lib/commonjs/skia/web/Host.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkCanvas.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkColor.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkColorFilter.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkColorFilterFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkContourMeasure.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkContourMeasureIter.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkData.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkDataFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkFont.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkImage.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkImageFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkImageFilter.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkImageFilterFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkMaskFilter.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkMaskFilterFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkMatrix.js +1 -1
- package/lib/commonjs/skia/web/JsiSkMatrix.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPaint.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPath.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPathEffect.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPathEffectFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPathFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPicture.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPictureFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPictureRecorder.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPoint.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkRRect.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkRSXform.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkRect.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkRuntimeEffect.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkRuntimeEffectFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkSVGFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkShader.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkShaderFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkSurface.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkSurfaceFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkTextBlob.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkTextBlobFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkTypeface.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkTypefaceFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkVertices.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkVerticesFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkia.js.map +1 -1
- package/lib/commonjs/skia/web/index.js.map +1 -1
- package/lib/commonjs/values/api.js.map +1 -1
- package/lib/commonjs/values/api.web.js.map +1 -1
- package/lib/commonjs/values/hooks/index.js.map +1 -1
- package/lib/commonjs/values/hooks/useClockValue.js.map +1 -1
- package/lib/commonjs/values/hooks/useComputedValue.js.map +1 -1
- package/lib/commonjs/values/hooks/useValue.js.map +1 -1
- package/lib/commonjs/values/hooks/useValueEffect.js.map +1 -1
- package/lib/commonjs/values/index.js.map +1 -1
- package/lib/commonjs/values/selector.js.map +1 -1
- package/lib/commonjs/values/types.js.map +1 -1
- package/lib/commonjs/values/web/RNSkAnimation.js +2 -2
- package/lib/commonjs/values/web/RNSkAnimation.js.map +1 -1
- package/lib/commonjs/values/web/RNSkClockValue.js.map +1 -1
- package/lib/commonjs/values/web/RNSkComputedValue.js +1 -1
- package/lib/commonjs/values/web/RNSkComputedValue.js.map +1 -1
- package/lib/commonjs/values/web/RNSkReadonlyValue.js.map +1 -1
- package/lib/commonjs/values/web/RNSkValue.js.map +1 -1
- package/lib/commonjs/values/web/api.js.map +1 -1
- package/lib/commonjs/values/web/index.js.map +1 -1
- package/lib/commonjs/views/SkiaBaseWebView.js +213 -0
- package/lib/commonjs/views/SkiaBaseWebView.js.map +1 -0
- package/lib/commonjs/views/SkiaPictureView.js +112 -0
- package/lib/commonjs/views/SkiaPictureView.js.map +1 -0
- package/lib/commonjs/views/SkiaPictureView.web.js +31 -0
- package/lib/commonjs/views/SkiaPictureView.web.js.map +1 -0
- package/lib/commonjs/views/SkiaView.js +2 -2
- package/lib/commonjs/views/SkiaView.js.map +1 -1
- package/lib/commonjs/views/SkiaView.web.js +14 -203
- package/lib/commonjs/views/SkiaView.web.js.map +1 -1
- package/lib/commonjs/views/api.js.map +1 -1
- package/lib/commonjs/views/index.js +13 -0
- package/lib/commonjs/views/index.js.map +1 -1
- package/lib/commonjs/views/types.js.map +1 -1
- package/lib/commonjs/views/useDrawCallback.js.map +1 -1
- package/lib/commonjs/views/useTouchHandler.js +6 -6
- package/lib/commonjs/views/useTouchHandler.js.map +1 -1
- package/lib/commonjs/web/LoadSkiaWeb.js.map +1 -1
- package/lib/commonjs/web/WithSkiaWeb.js +1 -1
- package/lib/commonjs/web/WithSkiaWeb.js.map +1 -1
- package/lib/commonjs/web/index.js.map +1 -1
- package/lib/module/animation/decay/decay.js.map +1 -1
- package/lib/module/animation/decay/index.js.map +1 -1
- package/lib/module/animation/decay/runDecay.js.map +1 -1
- package/lib/module/animation/decay/types.js.map +1 -1
- package/lib/module/animation/functions/index.js.map +1 -1
- package/lib/module/animation/functions/interpolate.js.map +1 -1
- package/lib/module/animation/functions/interpolateColors.js.map +1 -1
- package/lib/module/animation/functions/interpolatePaths.js.map +1 -1
- package/lib/module/animation/functions/interpolateVector.js.map +1 -1
- package/lib/module/animation/index.js.map +1 -1
- package/lib/module/animation/spring/Spring.js.map +1 -1
- package/lib/module/animation/spring/functions/index.js.map +1 -1
- package/lib/module/animation/spring/functions/spring.js.map +1 -1
- package/lib/module/animation/spring/index.js.map +1 -1
- package/lib/module/animation/spring/runSpring.js +1 -1
- package/lib/module/animation/spring/runSpring.js.map +1 -1
- package/lib/module/animation/spring/types.js.map +1 -1
- package/lib/module/animation/spring/useSpring.js +1 -1
- package/lib/module/animation/spring/useSpring.js.map +1 -1
- package/lib/module/animation/timing/Easing.js.map +1 -1
- package/lib/module/animation/timing/createTiming.js +2 -6
- package/lib/module/animation/timing/createTiming.js.map +1 -1
- package/lib/module/animation/timing/functions/bezier.js.map +1 -1
- package/lib/module/animation/timing/functions/getResolvedParams.js +6 -10
- package/lib/module/animation/timing/functions/getResolvedParams.js.map +1 -1
- package/lib/module/animation/timing/functions/index.js.map +1 -1
- package/lib/module/animation/timing/functions/timing.js.map +1 -1
- package/lib/module/animation/timing/functions/types.js.map +1 -1
- package/lib/module/animation/timing/index.js.map +1 -1
- package/lib/module/animation/timing/runTiming.js.map +1 -1
- package/lib/module/animation/timing/useLoop.js.map +1 -1
- package/lib/module/animation/timing/useTiming.js +1 -3
- package/lib/module/animation/timing/useTiming.js.map +1 -1
- package/lib/module/animation/types.js.map +1 -1
- package/lib/module/dom/nodes/DrawingNode.js.map +1 -1
- package/lib/module/dom/nodes/GroupNode.js.map +1 -1
- package/lib/module/dom/nodes/JsiSkDOM.js +1 -1
- package/lib/module/dom/nodes/JsiSkDOM.js.map +1 -1
- package/lib/module/dom/nodes/Node.js.map +1 -1
- package/lib/module/dom/nodes/PaintContext.js.map +1 -1
- package/lib/module/dom/nodes/PaintNode.js.map +1 -1
- package/lib/module/dom/nodes/RenderNode.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Circle.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Color.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Enum.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Fitting.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Gradient.js +2 -2
- package/lib/module/dom/nodes/datatypes/Gradient.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Path.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Radius.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Rect.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Transform.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/index.js.map +1 -1
- package/lib/module/dom/nodes/drawings/BackdropFilterNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/Box.js.map +1 -1
- package/lib/module/dom/nodes/drawings/CircleNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/CustomDrawingNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/DiffRectNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/FillNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/ImageNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/ImageSVG.js.map +1 -1
- package/lib/module/dom/nodes/drawings/LineNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/OvalNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/PatchNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/PathNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/PictureNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/PointsNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/RRectNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/RectNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/Text.js.map +1 -1
- package/lib/module/dom/nodes/drawings/VerticesNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/index.js.map +1 -1
- package/lib/module/dom/nodes/index.js.map +1 -1
- package/lib/module/dom/nodes/paint/BlendNode.js.map +1 -1
- package/lib/module/dom/nodes/paint/ColorFilters.js.map +1 -1
- package/lib/module/dom/nodes/paint/ImageFilters.js.map +1 -1
- package/lib/module/dom/nodes/paint/MaskFilters.js.map +1 -1
- package/lib/module/dom/nodes/paint/PathEffects.js.map +1 -1
- package/lib/module/dom/nodes/paint/Shaders.js +2 -4
- package/lib/module/dom/nodes/paint/Shaders.js.map +1 -1
- package/lib/module/dom/nodes/paint/index.js.map +1 -1
- package/lib/module/dom/types/ColorFilters.js.map +1 -1
- package/lib/module/dom/types/Common.js.map +1 -1
- package/lib/module/dom/types/DrawingContext.js.map +1 -1
- package/lib/module/dom/types/Drawings.js.map +1 -1
- package/lib/module/dom/types/ImageFilters.js.map +1 -1
- package/lib/module/dom/types/MaskFilters.js.map +1 -1
- package/lib/module/dom/types/Node.js.map +1 -1
- package/lib/module/dom/types/NodeType.js.map +1 -1
- package/lib/module/dom/types/PathEffects.js.map +1 -1
- package/lib/module/dom/types/Shaders.js.map +1 -1
- package/lib/module/dom/types/SkDOM.js.map +1 -1
- package/lib/module/dom/types/index.js.map +1 -1
- package/lib/module/external/index.js.map +1 -1
- package/lib/module/external/reanimated/index.js.map +1 -1
- package/lib/module/external/reanimated/useSharedValueEffect.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/mock/index.js +6 -10
- package/lib/module/mock/index.js.map +1 -1
- package/lib/module/renderer/Canvas.js.map +1 -1
- package/lib/module/renderer/Container.js.map +1 -1
- package/lib/module/renderer/DependencyManager.js.map +1 -1
- package/lib/module/renderer/DrawingContext.js.map +1 -1
- package/lib/module/renderer/HostComponents.js.map +1 -1
- package/lib/module/renderer/HostConfig.js +0 -2
- package/lib/module/renderer/HostConfig.js.map +1 -1
- package/lib/module/renderer/components/Blend.js.map +1 -1
- package/lib/module/renderer/components/Drawing.js.map +1 -1
- package/lib/module/renderer/components/Group.js.map +1 -1
- package/lib/module/renderer/components/Mask.js.map +1 -1
- package/lib/module/renderer/components/Paint.js +1 -1
- package/lib/module/renderer/components/Paint.js.map +1 -1
- package/lib/module/renderer/components/Picture.js.map +1 -1
- package/lib/module/renderer/components/backdrop/BackdropBlur.js +1 -1
- package/lib/module/renderer/components/backdrop/BackdropBlur.js.map +1 -1
- package/lib/module/renderer/components/backdrop/BackdropFilter.js.map +1 -1
- package/lib/module/renderer/components/backdrop/index.js.map +1 -1
- package/lib/module/renderer/components/colorFilters/BlendColor.js.map +1 -1
- package/lib/module/renderer/components/colorFilters/Lerp.js.map +1 -1
- package/lib/module/renderer/components/colorFilters/LinearToSRGBGamma.js.map +1 -1
- package/lib/module/renderer/components/colorFilters/LumaColorFilter.js.map +1 -1
- package/lib/module/renderer/components/colorFilters/Matrix.js.map +1 -1
- package/lib/module/renderer/components/colorFilters/SRGBToLinearGamma.js.map +1 -1
- package/lib/module/renderer/components/colorFilters/index.js.map +1 -1
- package/lib/module/renderer/components/image/Image.js.map +1 -1
- package/lib/module/renderer/components/image/ImageSVG.js.map +1 -1
- package/lib/module/renderer/components/image/ImageShader.js.map +1 -1
- package/lib/module/renderer/components/image/index.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/Blur.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/DisplacementMap.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/Morphology.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/Offset.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/RuntimeShader.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/Shadow.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/index.js.map +1 -1
- package/lib/module/renderer/components/index.js.map +1 -1
- package/lib/module/renderer/components/maskFilters/Blur.js.map +1 -1
- package/lib/module/renderer/components/maskFilters/index.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/Corner.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/Dash.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/Discrete.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/Line2D.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/Path1D.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/Path2D.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/Sum.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/index.js.map +1 -1
- package/lib/module/renderer/components/shaders/Color.js.map +1 -1
- package/lib/module/renderer/components/shaders/FractalNoise.js.map +1 -1
- package/lib/module/renderer/components/shaders/LinearGradient.js.map +1 -1
- package/lib/module/renderer/components/shaders/RadialGradient.js.map +1 -1
- package/lib/module/renderer/components/shaders/Shader.js.map +1 -1
- package/lib/module/renderer/components/shaders/ShaderLib.js.map +1 -1
- package/lib/module/renderer/components/shaders/SweepGradient.js.map +1 -1
- package/lib/module/renderer/components/shaders/Turbulence.js.map +1 -1
- package/lib/module/renderer/components/shaders/TwoPointConicalGradient.js.map +1 -1
- package/lib/module/renderer/components/shaders/index.js.map +1 -1
- package/lib/module/renderer/components/shapes/Box.js.map +1 -1
- package/lib/module/renderer/components/shapes/Circle.js.map +1 -1
- package/lib/module/renderer/components/shapes/DiffRect.js.map +1 -1
- package/lib/module/renderer/components/shapes/Fill.js.map +1 -1
- package/lib/module/renderer/components/shapes/FitBox.js.map +1 -1
- package/lib/module/renderer/components/shapes/Line.js.map +1 -1
- package/lib/module/renderer/components/shapes/Oval.js.map +1 -1
- package/lib/module/renderer/components/shapes/Patch.js.map +1 -1
- package/lib/module/renderer/components/shapes/Path.js.map +1 -1
- package/lib/module/renderer/components/shapes/Points.js.map +1 -1
- package/lib/module/renderer/components/shapes/Rect.js.map +1 -1
- package/lib/module/renderer/components/shapes/RoundedRect.js.map +1 -1
- package/lib/module/renderer/components/shapes/Vertices.js.map +1 -1
- package/lib/module/renderer/components/shapes/index.js.map +1 -1
- package/lib/module/renderer/components/text/Glyphs.js.map +1 -1
- package/lib/module/renderer/components/text/Text.js.map +1 -1
- package/lib/module/renderer/components/text/TextBlob.js.map +1 -1
- package/lib/module/renderer/components/text/TextPath.js.map +1 -1
- package/lib/module/renderer/components/text/index.js.map +1 -1
- package/lib/module/renderer/index.js.map +1 -1
- package/lib/module/renderer/processors/Animations/Animations.js.map +1 -1
- package/lib/module/renderer/processors/Animations/index.js.map +1 -1
- package/lib/module/renderer/processors/index.js.map +1 -1
- package/lib/module/renderer/processors/math/Coordinates.js.map +1 -1
- package/lib/module/renderer/processors/math/Math.js.map +1 -1
- package/lib/module/renderer/processors/math/Transforms.js.map +1 -1
- package/lib/module/renderer/processors/math/index.js.map +1 -1
- package/lib/module/renderer/typeddash.js.map +1 -1
- package/lib/module/renderer/useCanvas.js.map +1 -1
- package/lib/module/renderer/useContextBridge.js.map +1 -1
- package/lib/module/skia/NativeSetup.js.map +1 -1
- package/lib/module/skia/Skia.js.map +1 -1
- package/lib/module/skia/Skia.web.js.map +1 -1
- package/lib/module/skia/core/Data.js.map +1 -1
- package/lib/module/skia/core/Font.js.map +1 -1
- package/lib/module/skia/core/Image.js.map +1 -1
- package/lib/module/skia/core/Matrix.js.map +1 -1
- package/lib/module/skia/core/Picture.js.map +1 -1
- package/lib/module/skia/core/RRect.js.map +1 -1
- package/lib/module/skia/core/Rect.js.map +1 -1
- package/lib/module/skia/core/SVG.js.map +1 -1
- package/lib/module/skia/core/Typeface.js.map +1 -1
- package/lib/module/skia/core/Vector.js +1 -1
- package/lib/module/skia/core/Vector.js.map +1 -1
- package/lib/module/skia/core/index.js.map +1 -1
- package/lib/module/skia/index.js.map +1 -1
- package/lib/module/skia/types/Canvas.js.map +1 -1
- package/lib/module/skia/types/Color.js.map +1 -1
- package/lib/module/skia/types/ColorFilter/ColorFilter.js.map +1 -1
- package/lib/module/skia/types/ColorFilter/ColorFilterFactory.js.map +1 -1
- package/lib/module/skia/types/ColorFilter/index.js.map +1 -1
- package/lib/module/skia/types/ContourMeasure.js.map +1 -1
- package/lib/module/skia/types/Data/Data.js.map +1 -1
- package/lib/module/skia/types/Data/DataFactory.js.map +1 -1
- package/lib/module/skia/types/Data/index.js.map +1 -1
- package/lib/module/skia/types/Font/Font.js.map +1 -1
- package/lib/module/skia/types/Font/index.js.map +1 -1
- package/lib/module/skia/types/Image/Image.js.map +1 -1
- package/lib/module/skia/types/Image/ImageFactory.js.map +1 -1
- package/lib/module/skia/types/Image/index.js.map +1 -1
- package/lib/module/skia/types/ImageFilter/ImageFilter.js.map +1 -1
- package/lib/module/skia/types/ImageFilter/ImageFilterFactory.js.map +1 -1
- package/lib/module/skia/types/ImageFilter/index.js.map +1 -1
- package/lib/module/skia/types/JsiInstance.js.map +1 -1
- package/lib/module/skia/types/MaskFilter.js.map +1 -1
- package/lib/module/skia/types/Matrix.js.map +1 -1
- package/lib/module/skia/types/Paint/BlendMode.js.map +1 -1
- package/lib/module/skia/types/Paint/Paint.js.map +1 -1
- package/lib/module/skia/types/Paint/index.js.map +1 -1
- package/lib/module/skia/types/Path/Path.js.map +1 -1
- package/lib/module/skia/types/Path/PathFactory.js.map +1 -1
- package/lib/module/skia/types/Path/index.js.map +1 -1
- package/lib/module/skia/types/PathEffect.js.map +1 -1
- package/lib/module/skia/types/Picture/Picture.js.map +1 -1
- package/lib/module/skia/types/Picture/PictureFactory.js.map +1 -1
- package/lib/module/skia/types/Picture/PictureRecorder.js.map +1 -1
- package/lib/module/skia/types/Picture/index.js.map +1 -1
- package/lib/module/skia/types/Point.js.map +1 -1
- package/lib/module/skia/types/RRect.js.map +1 -1
- package/lib/module/skia/types/RSXform.js.map +1 -1
- package/lib/module/skia/types/Rect.js.map +1 -1
- package/lib/module/skia/types/RuntimeEffect/RuntimeEffect.js.map +1 -1
- package/lib/module/skia/types/RuntimeEffect/RuntimeEffectFactory.js.map +1 -1
- package/lib/module/skia/types/RuntimeEffect/index.js.map +1 -1
- package/lib/module/skia/types/SVG/SVG.js.map +1 -1
- package/lib/module/skia/types/SVG/SVGFactory.js.map +1 -1
- package/lib/module/skia/types/SVG/index.js.map +1 -1
- package/lib/module/skia/types/Shader/Shader.js.map +1 -1
- package/lib/module/skia/types/Shader/ShaderFactory.js.map +1 -1
- package/lib/module/skia/types/Shader/index.js.map +1 -1
- package/lib/module/skia/types/Skia.js.map +1 -1
- package/lib/module/skia/types/Surface/Surface.js.map +1 -1
- package/lib/module/skia/types/Surface/SurfaceFactory.js.map +1 -1
- package/lib/module/skia/types/Surface/index.js.map +1 -1
- package/lib/module/skia/types/TextBlob.js.map +1 -1
- package/lib/module/skia/types/Typeface/Typeface.js.map +1 -1
- package/lib/module/skia/types/Typeface/TypefaceFactory.js.map +1 -1
- package/lib/module/skia/types/Typeface/index.js.map +1 -1
- package/lib/module/skia/types/Vertices/Vertices.js.map +1 -1
- package/lib/module/skia/types/Vertices/index.js.map +1 -1
- package/lib/module/skia/types/index.js.map +1 -1
- package/lib/module/skia/web/Host.js +1 -1
- package/lib/module/skia/web/Host.js.map +1 -1
- package/lib/module/skia/web/JsiSkCanvas.js.map +1 -1
- package/lib/module/skia/web/JsiSkColor.js.map +1 -1
- package/lib/module/skia/web/JsiSkColorFilter.js.map +1 -1
- package/lib/module/skia/web/JsiSkColorFilterFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkContourMeasure.js.map +1 -1
- package/lib/module/skia/web/JsiSkContourMeasureIter.js.map +1 -1
- package/lib/module/skia/web/JsiSkData.js.map +1 -1
- package/lib/module/skia/web/JsiSkDataFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkFont.js.map +1 -1
- package/lib/module/skia/web/JsiSkImage.js.map +1 -1
- package/lib/module/skia/web/JsiSkImageFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkImageFilter.js.map +1 -1
- package/lib/module/skia/web/JsiSkImageFilterFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkMaskFilter.js.map +1 -1
- package/lib/module/skia/web/JsiSkMaskFilterFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkMatrix.js +1 -1
- package/lib/module/skia/web/JsiSkMatrix.js.map +1 -1
- package/lib/module/skia/web/JsiSkPaint.js.map +1 -1
- package/lib/module/skia/web/JsiSkPath.js.map +1 -1
- package/lib/module/skia/web/JsiSkPathEffect.js.map +1 -1
- package/lib/module/skia/web/JsiSkPathEffectFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkPathFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkPicture.js.map +1 -1
- package/lib/module/skia/web/JsiSkPictureFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkPictureRecorder.js.map +1 -1
- package/lib/module/skia/web/JsiSkPoint.js.map +1 -1
- package/lib/module/skia/web/JsiSkRRect.js.map +1 -1
- package/lib/module/skia/web/JsiSkRSXform.js.map +1 -1
- package/lib/module/skia/web/JsiSkRect.js.map +1 -1
- package/lib/module/skia/web/JsiSkRuntimeEffect.js.map +1 -1
- package/lib/module/skia/web/JsiSkRuntimeEffectFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkSVGFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkShader.js.map +1 -1
- package/lib/module/skia/web/JsiSkShaderFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkSurface.js.map +1 -1
- package/lib/module/skia/web/JsiSkSurfaceFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkTextBlob.js.map +1 -1
- package/lib/module/skia/web/JsiSkTextBlobFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkTypeface.js.map +1 -1
- package/lib/module/skia/web/JsiSkTypefaceFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkVertices.js.map +1 -1
- package/lib/module/skia/web/JsiSkVerticesFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkia.js.map +1 -1
- package/lib/module/skia/web/index.js.map +1 -1
- package/lib/module/values/api.js.map +1 -1
- package/lib/module/values/api.web.js.map +1 -1
- package/lib/module/values/hooks/index.js.map +1 -1
- package/lib/module/values/hooks/useClockValue.js.map +1 -1
- package/lib/module/values/hooks/useComputedValue.js.map +1 -1
- package/lib/module/values/hooks/useValue.js.map +1 -1
- package/lib/module/values/hooks/useValueEffect.js.map +1 -1
- package/lib/module/values/index.js.map +1 -1
- package/lib/module/values/selector.js.map +1 -1
- package/lib/module/values/types.js.map +1 -1
- package/lib/module/values/web/RNSkAnimation.js +2 -2
- package/lib/module/values/web/RNSkAnimation.js.map +1 -1
- package/lib/module/values/web/RNSkClockValue.js.map +1 -1
- package/lib/module/values/web/RNSkComputedValue.js +1 -1
- package/lib/module/values/web/RNSkComputedValue.js.map +1 -1
- package/lib/module/values/web/RNSkReadonlyValue.js.map +1 -1
- package/lib/module/values/web/RNSkValue.js.map +1 -1
- package/lib/module/values/web/api.js.map +1 -1
- package/lib/module/values/web/index.js.map +1 -1
- package/lib/module/views/SkiaBaseWebView.js +198 -0
- package/lib/module/views/SkiaBaseWebView.js.map +1 -0
- package/lib/module/views/SkiaPictureView.js +94 -0
- package/lib/module/views/SkiaPictureView.js.map +1 -0
- package/lib/module/views/SkiaPictureView.web.js +19 -0
- package/lib/module/views/SkiaPictureView.web.js.map +1 -0
- package/lib/module/views/SkiaView.js +2 -2
- package/lib/module/views/SkiaView.js.map +1 -1
- package/lib/module/views/SkiaView.web.js +15 -201
- package/lib/module/views/SkiaView.web.js.map +1 -1
- package/lib/module/views/api.js.map +1 -1
- package/lib/module/views/index.js +1 -0
- package/lib/module/views/index.js.map +1 -1
- package/lib/module/views/types.js.map +1 -1
- package/lib/module/views/useDrawCallback.js.map +1 -1
- package/lib/module/views/useTouchHandler.js +6 -6
- package/lib/module/views/useTouchHandler.js.map +1 -1
- package/lib/module/web/LoadSkiaWeb.js.map +1 -1
- package/lib/module/web/WithSkiaWeb.js +1 -1
- package/lib/module/web/WithSkiaWeb.js.map +1 -1
- package/lib/module/web/index.js.map +1 -1
- package/lib/typescript/src/animation/decay/runDecay.d.ts +1 -1
- package/lib/typescript/src/animation/spring/runSpring.d.ts +1 -1
- package/lib/typescript/src/animation/spring/useSpring.d.ts +1 -1
- package/lib/typescript/src/animation/timing/createTiming.d.ts +1 -1
- package/lib/typescript/src/animation/timing/functions/getResolvedParams.d.ts +1 -1
- package/lib/typescript/src/animation/timing/runTiming.d.ts +1 -1
- package/lib/typescript/src/animation/timing/useLoop.d.ts +1 -1
- package/lib/typescript/src/animation/timing/useTiming.d.ts +1 -1
- package/lib/typescript/src/mock/index.d.ts +1 -1
- package/lib/typescript/src/renderer/Canvas.d.ts +1 -1
- package/lib/typescript/src/renderer/HostConfig.d.ts +1 -1
- package/lib/typescript/src/renderer/components/Paint.d.ts +1 -1
- package/lib/typescript/src/renderer/components/backdrop/BackdropFilter.d.ts +1 -1
- package/lib/typescript/src/renderer/processors/Animations/Animations.d.ts +4 -4
- package/lib/typescript/src/renderer/typeddash.d.ts +2 -2
- package/lib/typescript/src/skia/core/Font.d.ts +1 -1
- package/lib/typescript/src/skia/core/Vector.d.ts +2 -2
- package/lib/typescript/src/skia/types/Shader/Shader.d.ts +1 -1
- package/lib/typescript/src/skia/web/JsiSkVerticesFactory.d.ts +2 -2
- package/lib/typescript/src/views/SkiaBaseWebView.d.ts +58 -0
- package/lib/typescript/src/views/SkiaPictureView.d.ts +27 -0
- package/lib/typescript/src/views/SkiaPictureView.web.d.ts +7 -0
- package/lib/typescript/src/views/SkiaView.d.ts +4 -4
- package/lib/typescript/src/views/SkiaView.web.d.ts +6 -53
- package/lib/typescript/src/views/index.d.ts +1 -0
- package/lib/typescript/src/views/types.d.ts +7 -2
- package/lib/typescript/src/web/LoadSkiaWeb.d.ts +2 -2
- package/package.json +6 -6
- package/src/renderer/HostConfig.ts +3 -4
- package/src/renderer/components/backdrop/BackdropFilter.tsx +1 -1
- package/src/renderer/processors/Animations/Animations.ts +11 -4
- package/src/renderer/typeddash.ts +3 -2
- package/src/values/web/RNSkComputedValue.ts +6 -1
- package/src/views/SkiaBaseWebView.tsx +177 -0
- package/src/views/SkiaPictureView.tsx +93 -0
- package/src/views/SkiaPictureView.web.tsx +23 -0
- package/src/views/SkiaView.tsx +6 -7
- package/src/views/SkiaView.web.tsx +18 -167
- package/src/views/index.ts +1 -0
- package/src/views/types.ts +9 -2
- package/android/cpp/jni/JniSkiaDrawView.cpp +0 -113
- package/android/cpp/rnskia-android/RNSkDrawViewImpl.cpp +0 -73
- package/android/cpp/rnskia-android/RNSkDrawViewImpl.h +0 -48
- package/cpp/rnskia/RNSkDrawView.cpp +0 -315
- package/cpp/rnskia/RNSkDrawView.h +0 -226
- package/ios/RNSkia-iOS/RNSkDrawViewImpl.h +0 -52
- package/ios/RNSkia-iOS/SkiaDrawView.h +0 -23
@@ -0,0 +1,26 @@
|
|
1
|
+
#pragma once
|
2
|
+
|
3
|
+
#import <memory>
|
4
|
+
#import <string>
|
5
|
+
|
6
|
+
#import <CoreFoundation/CoreFoundation.h>
|
7
|
+
#import <UIKit/UIKit.h>
|
8
|
+
|
9
|
+
#import <RNSkiOSView.h>
|
10
|
+
#import <RNSkManager.h>
|
11
|
+
|
12
|
+
class RNSkiOSJsView;
|
13
|
+
|
14
|
+
@interface SkiaUIView : UIView
|
15
|
+
|
16
|
+
- (instancetype)initWithManager: (RNSkia::RNSkManager*)manager
|
17
|
+
factory: (std::function<std::shared_ptr<RNSkBaseiOSView>(
|
18
|
+
std::shared_ptr<RNSkia::RNSkPlatformContext>)>)factory;
|
19
|
+
|
20
|
+
- (std::shared_ptr<RNSkBaseiOSView>) impl;
|
21
|
+
|
22
|
+
- (void) setDrawingMode:(std::string) mode;
|
23
|
+
- (void) setDebugMode:(bool) debugMode;
|
24
|
+
- (void) setNativeId:(size_t) nativeId;
|
25
|
+
|
26
|
+
@end
|
@@ -1,24 +1,26 @@
|
|
1
1
|
#import <React/RCTBridge.h>
|
2
2
|
|
3
|
-
#import <
|
3
|
+
#import <SkiaUIView.h>
|
4
4
|
|
5
5
|
#include <utility>
|
6
6
|
#include <vector>
|
7
7
|
|
8
|
-
#import <RNSkDrawViewImpl.h>
|
9
8
|
#import <RNSkManager.h>
|
10
9
|
|
11
|
-
@implementation
|
12
|
-
std::shared_ptr<
|
10
|
+
@implementation SkiaUIView {
|
11
|
+
std::shared_ptr<RNSkBaseiOSView> _impl;
|
13
12
|
RNSkia::RNSkManager* _manager;
|
14
13
|
RNSkia::RNSkDrawingMode _drawingMode;
|
14
|
+
std::function<std::shared_ptr<RNSkBaseiOSView>(std::shared_ptr<RNSkia::RNSkPlatformContext>)> _factory;
|
15
15
|
bool _debugMode;
|
16
16
|
size_t _nativeId;
|
17
17
|
}
|
18
18
|
|
19
19
|
#pragma mark Initialization and destruction
|
20
20
|
|
21
|
-
- (instancetype) initWithManager: (RNSkia::RNSkManager*)manager
|
21
|
+
- (instancetype) initWithManager: (RNSkia::RNSkManager*)manager
|
22
|
+
factory: (std::function<std::shared_ptr<RNSkBaseiOSView>(
|
23
|
+
std::shared_ptr<RNSkia::RNSkPlatformContext>)>)factory
|
22
24
|
{
|
23
25
|
self = [super init];
|
24
26
|
if (self) {
|
@@ -26,6 +28,7 @@
|
|
26
28
|
_nativeId = 0;
|
27
29
|
_debugMode = false;
|
28
30
|
_drawingMode = RNSkia::RNSkDrawingMode::Default;
|
31
|
+
_factory = factory;
|
29
32
|
|
30
33
|
// Listen to notifications about module invalidation
|
31
34
|
[[NSNotificationCenter defaultCenter] addObserver:self
|
@@ -50,7 +53,7 @@
|
|
50
53
|
[_impl->getLayer() removeFromSuperlayer];
|
51
54
|
|
52
55
|
if(_nativeId != 0 && _manager != nullptr) {
|
53
|
-
_manager->
|
56
|
+
_manager->setSkiaView(_nativeId, nullptr);
|
54
57
|
}
|
55
58
|
|
56
59
|
_impl = nullptr;
|
@@ -58,20 +61,23 @@
|
|
58
61
|
} else {
|
59
62
|
// Create implementation view when the parent view is set
|
60
63
|
if(_impl == nullptr && _manager != nullptr) {
|
61
|
-
_impl =
|
64
|
+
_impl = _factory(_manager->getPlatformContext());
|
65
|
+
if(_impl == nullptr) {
|
66
|
+
throw std::runtime_error("Expected Skia view implementation, got nullptr.");
|
67
|
+
}
|
62
68
|
[self.layer addSublayer: _impl->getLayer()];
|
63
69
|
if(_nativeId != 0) {
|
64
|
-
_manager->
|
70
|
+
_manager->setSkiaView(_nativeId, _impl->getDrawView());
|
65
71
|
}
|
66
|
-
_impl->setDrawingMode(_drawingMode);
|
67
|
-
_impl->setShowDebugOverlays(_debugMode);
|
72
|
+
_impl->getDrawView()->setDrawingMode(_drawingMode);
|
73
|
+
_impl->getDrawView()->setShowDebugOverlays(_debugMode);
|
68
74
|
}
|
69
75
|
}
|
70
76
|
}
|
71
77
|
|
72
78
|
- (void) dealloc {
|
73
79
|
if(_manager != nullptr && _nativeId != 0) {
|
74
|
-
_manager->
|
80
|
+
_manager->unregisterSkiaView(_nativeId);
|
75
81
|
}
|
76
82
|
|
77
83
|
[[NSNotificationCenter defaultCenter] removeObserver:self name:RCTBridgeWillInvalidateModulesNotification object:nil];
|
@@ -94,14 +100,14 @@
|
|
94
100
|
_drawingMode = mode.compare("continuous") == 0 ? RNSkia::RNSkDrawingMode::Continuous : RNSkia::RNSkDrawingMode::Default;
|
95
101
|
|
96
102
|
if(_impl != nullptr) {
|
97
|
-
_impl->setDrawingMode(_drawingMode);
|
103
|
+
_impl->getDrawView()->setDrawingMode(_drawingMode);
|
98
104
|
}
|
99
105
|
}
|
100
106
|
|
101
107
|
-(void) setDebugMode:(bool) debugMode {
|
102
108
|
_debugMode = debugMode;
|
103
109
|
if(_impl != nullptr) {
|
104
|
-
_impl->setShowDebugOverlays(debugMode);
|
110
|
+
_impl->getDrawView()->setShowDebugOverlays(debugMode);
|
105
111
|
}
|
106
112
|
}
|
107
113
|
|
@@ -109,13 +115,13 @@
|
|
109
115
|
_nativeId = nativeId;
|
110
116
|
|
111
117
|
if(_impl != nullptr) {
|
112
|
-
_manager->
|
118
|
+
_manager->registerSkiaView(nativeId, _impl->getDrawView());
|
113
119
|
}
|
114
120
|
}
|
115
121
|
|
116
122
|
#pragma mark External API
|
117
123
|
|
118
|
-
- (std::shared_ptr<
|
124
|
+
- (std::shared_ptr<RNSkBaseiOSView>) impl {
|
119
125
|
return _impl;
|
120
126
|
}
|
121
127
|
|
@@ -135,10 +141,10 @@
|
|
135
141
|
|
136
142
|
- (void) handleTouches:(NSSet<UITouch*>*) touches withEvent:(UIEvent*) event {
|
137
143
|
if (event.type == UIEventTypeTouches) {
|
138
|
-
std::vector<RNSkia::
|
144
|
+
std::vector<RNSkia::RNSkTouchInfo> nextTouches;
|
139
145
|
for (UITouch *touch in touches) {
|
140
146
|
auto position = [touch preciseLocationInView:self];
|
141
|
-
RNSkia::
|
147
|
+
RNSkia::RNSkTouchInfo nextTouch;
|
142
148
|
nextTouch.x = position.x;
|
143
149
|
nextTouch.y = position.y;
|
144
150
|
nextTouch.force = [touch force];
|
@@ -146,26 +152,26 @@
|
|
146
152
|
auto phase = [touch phase];
|
147
153
|
switch(phase) {
|
148
154
|
case UITouchPhaseBegan:
|
149
|
-
nextTouch.type = RNSkia::
|
155
|
+
nextTouch.type = RNSkia::RNSkTouchInfo::TouchType::Start;
|
150
156
|
break;
|
151
157
|
case UITouchPhaseMoved:
|
152
|
-
nextTouch.type = RNSkia::
|
158
|
+
nextTouch.type = RNSkia::RNSkTouchInfo::TouchType::Active;
|
153
159
|
break;
|
154
160
|
case UITouchPhaseEnded:
|
155
|
-
nextTouch.type = RNSkia::
|
161
|
+
nextTouch.type = RNSkia::RNSkTouchInfo::TouchType::End;
|
156
162
|
break;
|
157
163
|
case UITouchPhaseCancelled:
|
158
|
-
nextTouch.type = RNSkia::
|
164
|
+
nextTouch.type = RNSkia::RNSkTouchInfo::TouchType::Cancelled;
|
159
165
|
break;
|
160
166
|
default:
|
161
|
-
nextTouch.type = RNSkia::
|
167
|
+
nextTouch.type = RNSkia::RNSkTouchInfo::TouchType::Active;
|
162
168
|
break;
|
163
169
|
}
|
164
170
|
|
165
171
|
nextTouches.push_back(nextTouch);
|
166
172
|
}
|
167
173
|
if(_impl != nullptr) {
|
168
|
-
_impl->updateTouchState(
|
174
|
+
_impl->getDrawView()->updateTouchState(nextTouches);
|
169
175
|
}
|
170
176
|
}
|
171
177
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
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;;AAEO,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,"
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { runDecay } from \"./runDecay\";\n"],"mappings":";;;;;;;;;;;;AAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"names":["runDecay","value","config","resolvedConfig","deceleration","velocityFactor","velocity","from","current","updateFunction","t","state","finished","lastTimestamp","startTimestamp","initialVelocity","decay","animation","ValueApi","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;;AAGA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,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,OAAO,IAAAU,YAAA,EAAMN,CAAN,EAASC,KAAT,EAAgBR,cAAhB,CAAP;EACD,CAZD;;EAaAF,KAAK,CAACgB,SAAN,GAAkBC,aAAA,CAASC,eAAT,CAAyBV,cAAzB,CAAlB;EACA,OAAOR,KAAK,CAACgB,SAAb;AACD,CA1BM"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
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"],"
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./interpolate\";\nexport * from \"./interpolateColors\";\nexport * from \"./interpolateVector\";\nexport * from \"./interpolatePaths\";\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,"
|
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;IACYA,W;;;WAAAA,W;EAAAA,W;EAAAA,W;EAAAA,W;GAAAA,W,2BAAAA,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;;;AACO,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;EACD,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,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,"
|
1
|
+
{"version":3,"names":["interpolateColorsRGB","value","inputRange","outputRange","r","interpolate","map","c","g","b","a","Float32Array","interpolateColors","_outputRange","cl","Skia","Color","mixColors","x","y","c1","c2","mix"],"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;;AAEA;;AAEA;;AAEA,MAAMA,oBAAoB,GAAG,CAC3BC,KAD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AX;;EACA,MAAMG,EAAE,GAAGN,UAAA,CAAKC,KAAL,CAAWG,CAAX,CAAX;;EACA,OAAO,IAAIR,YAAJ,CAAiB,CACtB,IAAAW,SAAA,EAAIrB,KAAJ,EAAWmB,EAAE,CAAC,CAAD,CAAb,EAAkBC,EAAE,CAAC,CAAD,CAApB,CADsB,EAEtB,IAAAC,SAAA,EAAIrB,KAAJ,EAAWmB,EAAE,CAAC,CAAD,CAAb,EAAkBC,EAAE,CAAC,CAAD,CAApB,CAFsB,EAGtB,IAAAC,SAAA,EAAIrB,KAAJ,EAAWmB,EAAE,CAAC,CAAD,CAAb,EAAkBC,EAAE,CAAC,CAAD,CAApB,CAHsB,EAItB,IAAAC,SAAA,EAAIrB,KAAJ,EAAWmB,EAAE,CAAC,CAAD,CAAb,EAAkBC,EAAE,CAAC,CAAD,CAApB,CAJsB,CAAjB,CAAP;AAMD,CATM"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"names":["lerp","value","from","to","p1","p2","t","interpolate","interpolatePaths","input","outputRange","options","extrapolation","validateInterpolationOptions","extrapolateLeft","Extrapolate","CLAMP","EXTEND","IDENTITY","Error","exhaustiveCheck","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;;AAGA;;AAEA,MAAMA,IAAI,GAAG,CACXC,KADW,EAEXC,IAFW,EAGXC,EAHW,EAIXC,EAJW,EAKXC,EALW,KAMR;EACH,MAAMC,CAAC,GAAG,CAACL,KAAK,GAAGC,IAAT,KAAkBC,EAAE,GAAGD,IAAvB,CAAV;EACA,OAAOG,EAAE,CAACE,WAAH,CAAeH,EAAf,EAAmBE,CAAnB,CAAP;AACD,CATD;AAWA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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ACE,MAAM,IAAIC,KAAJ,CACJ,uEADI,CAAN;;MAGF;QACE,IAAAC,0BAAA,EAAgBR,aAAa,CAACU,gBAA9B;IAhBJ;EAkBD;;EACD,IAAIC,CAAC,GAAG,CAAR;;EACA,OAAOA,CAAC,IAAId,KAAK,CAACY,MAAN,GAAe,CAA3B,EAA8BE,CAAC,EAA/B,EAAmC;IACjC,IAAItB,KAAK,IAAIQ,KAAK,CAACc,CAAD,CAAd,IAAqBtB,KAAK,IAAIQ,KAAK,CAACc,CAAC,GAAG,CAAL,CAAvC,EAAgD;MAC9C;IACD;EACF;;EACD,OAAOvB,IAAI,CACTC,KADS,EAETQ,KAAK,CAACc,CAAD,CAFI,EAGTd,KAAK,CAACc,CAAC,GAAG,CAAL,CAHI,EAITb,WAAW,CAACa,CAAD,CAJF,EAKTb,WAAW,CAACa,CAAC,GAAG,CAAL,CALF,CAAX;AAOD,CArDM"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"names":["interpolateVector","value","inputRange","outputRange","options","x","interpolate","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;;AAEO,MAAMA,iBAAiB,GAAG,CAC/BC,KAD+B,EAE/BC,UAF+B,EAG/BC,WAH+B,EAI/BC,OAJ+B,MAK3B;EACJC,CAAC,EAAE,IAAAC,wBAAA,EACDL,KADC,EAEDC,UAFC,EAGDC,WAAW,CAACI,GAAZ,CAAiBC,CAAD,IAAOA,CAAC,CAACH,CAAzB,CAHC,EAIDD,OAJC,CADC;EAOJK,CAAC,EAAE,IAAAH,wBAAA,EACDL,KADC,EAEDC,UAFC,EAGDC,WAAW,CAACI,GAAZ,CAAiBC,CAAD,IAAOA,CAAC,CAACC,CAAzB,CAHC,EAIDL,OAJC;AAPC,CAL2B,CAA1B;;;;AAoBA,MAAMM,SAAS,GAAG,CAACT,KAAD,EAAgBU,IAAhB,EAA8BC,EAA9B,KACvBZ,iBAAiB,CAACC,KAAD,EAAQ,CAAC,CAAD,EAAI,CAAJ,CAAR,EAAgB,CAACU,IAAD,EAAOC,EAAP,CAAhB,CADZ"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["index.ts"],"
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./timing\";\nexport * from \"./spring\";\nexport * from \"./decay\";\nexport * from \"./functions\";\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,"
|
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;AAiCO,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,"
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { createSpringEasing } from \"./spring\";\n"],"mappings":";;;;;;;;;;;;AAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
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;AACO,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,C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xC,KACCD,KAAK,CAACM,CAAN,GAAUJ,IAAI,CAACW,GAAL,CAASb,KAAK,CAACK,EAAN,GAAWM,QAApB,CAAV,GACCX,KAAK,CAACO,CAAN,GAAUL,IAAI,CAACY,GAAL,CAASd,KAAK,CAACK,EAAN,GAAWM,QAApB,CAFZ,CADF;IAID,CALD,MAKO;MACLA,QAAQ,GACN,CAACX,KAAK,CAACM,CAAN,GAAUN,KAAK,CAACO,CAAN,GAAUI,QAArB,IAAiCT,IAAI,CAACU,GAAL,CAAS,CAACD,QAAD,GAAYX,KAAK,CAACC,EAA3B,CADnC;IAED;;IACD,IAAIQ,CAAC,KAAK,CAAN,IAAWA,CAAC,KAAK,CAArB,EAAwB;MACtB,OAAOA,CAAP;IACD;;IACD,OAAO,IAAIE,QAAX;EACD,CAfD;;EAiBA,MAAMI,aAAa,GAAG,MAAM;IAC1B,IAAIC,KAAK,GAAG,IAAI,CAAhB;IACA,IAAIC,OAAO,GAAG,CAAd;IACA,IAAIC,IAAI,GAAG,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,"
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { Spring } from \"./Spring\";\nexport { runSpring } from \"./runSpring\";\nexport { useSpring } from \"./useSpring\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA"}
|
@@ -25,7 +25,7 @@ var _spring = require("./functions/spring");
|
|
25
25
|
* the animation.
|
26
26
|
*/
|
27
27
|
const runSpring = (value, toOrParams, config, callback) => {
|
28
|
-
return (0, _runTiming.runTiming)(value, toOrParams, (0, _spring.createSpringEasing)(config
|
28
|
+
return (0, _runTiming.runTiming)(value, toOrParams, (0, _spring.createSpringEasing)(config ?? _Spring.Spring.Config.Default), callback);
|
29
29
|
};
|
30
30
|
|
31
31
|
exports.runSpring = runSpring;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"names":["runSpring","value","toOrParams","config","callback","runTiming","createSpringEasing","Spring","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;;AAEA;;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,SAAS,GAAG,CACvBC,KADuB,EAEvBC,UAFuB,EAGvBC,MAHuB,EAIvBC,QAJuB,KAKL;EAClB,OAAO,IAAAC,oBAAA,EACLJ,KADK,EAELC,UAFK,EAGL,IAAAI,0BAAA,EAAmBH,MAAM,IAAII,cAAA,CAAOC,MAAP,CAAcC,OAA3C,CAHK,EAILL,QAJK,CAAP;AAMD,CAZM"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
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":""}
|
@@ -18,7 +18,7 @@ var _spring = require("./functions/spring");
|
|
18
18
|
* @param config
|
19
19
|
* @returns
|
20
20
|
*/
|
21
|
-
const useSpring = (toOrParams, config, callback) => (0, _timing.useTiming)(toOrParams, (0, _spring.createSpringEasing)(config
|
21
|
+
const useSpring = (toOrParams, config, callback) => (0, _timing.useTiming)(toOrParams, (0, _spring.createSpringEasing)(config ?? _Spring.Spring.Config.Default), callback);
|
22
22
|
|
23
23
|
exports.useSpring = useSpring;
|
24
24
|
//# sourceMappingURL=useSpring.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"names":["useSpring","toOrParams","config","callback","useTiming","createSpringEasing","Spring","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;;AAEA;;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,SAAS,GAAG,CACvBC,UADuB,EAEvBC,MAFuB,EAGvBC,QAHuB,KAKvB,IAAAC,iBAAA,EACEH,UADF,EAEE,IAAAI,0BAAA,EAAmBH,MAAM,IAAII,cAAA,CAAOC,MAAP,CAAcC,OAA3C,CAFF,EAGEL,QAHF,CALK"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"names":["Easing","step0","n","step1","linear","t","ease","bezier","quad","cubic","poly","sin","Math","cos","PI","circle","sqrt","exp","elastic","bounciness","p","back","s","bounce","t2_","t2","x1","y1","x2","y2","in","easing","out","inOut"],"sources":["Easing.ts"],"sourcesContent":["// eslint-disable-next-line max-len\n// Taken from https://github.com/facebook/react-native/blob/0b9ea60b4fee8cacc36e7160e31b91fc114dbc0d/Libraries/Animated/src/Easing.js\n\nimport { bezier } from \"./functions\";\n\nexport class Easing {\n static step0(n: number): number {\n return n > 0 ? 1 : 0;\n }\n\n static step1(n: number): number {\n return n >= 1 ? 1 : 0;\n }\n\n static linear(t: number): number {\n return t;\n }\n\n static ease(t: number): number {\n return Easing.bezier(0.42, 0, 1, 1)(t);\n }\n\n static quad(t: number): number {\n return t * t;\n }\n\n static cubic(t: number): number {\n return t * t * t;\n }\n\n static poly(n: number): (t: number) => number {\n return (t: number): number => t ** n;\n }\n\n static sin(t: number): number {\n return 1 - Math.cos((t * Math.PI) / 2);\n }\n\n static circle(t: number): number {\n return 1 - Math.sqrt(1 - t * t);\n }\n\n static exp(t: number): number {\n return 2 ** (10 * (t - 1));\n }\n\n static elastic(bounciness = 1): (t: number) => number {\n const p = bounciness * Math.PI;\n return (t): number =>\n 1 - Math.cos((t * Math.PI) / 2) ** 3 * Math.cos(t * p);\n }\n\n static back(s = 1.70158): (t: number) => number {\n return (t): number => t * t * ((s + 1) * t - s);\n }\n\n static bounce(t: number): number {\n if (t < 1 / 2.75) {\n return 7.5625 * t * t;\n }\n\n if (t < 2 / 2.75) {\n const t2_ = t - 1.5 / 2.75;\n return 7.5625 * t2_ * t2_ + 0.75;\n }\n\n if (t < 2.5 / 2.75) {\n const t2_ = t - 2.25 / 2.75;\n return 7.5625 * t2_ * t2_ + 0.9375;\n }\n\n const t2 = t - 2.625 / 2.75;\n return 7.5625 * t2 * t2 + 0.984375;\n }\n\n static bezier(\n x1: number,\n y1: number,\n x2: number,\n y2: number\n ): (t: number) => number {\n return bezier(x1, y1, x2, y2);\n }\n\n static in(easing: (t: number) => number): (t: number) => number {\n return easing;\n }\n\n static out(easing: (t: number) => number): (t: number) => number {\n return (t): number => 1 - easing(1 - t);\n }\n\n static inOut(easing: (t: number) => number): (t: number) => number {\n return (t): number => {\n if (t < 0.5) {\n return easing(t * 2) / 2;\n }\n\n return 1 - easing((1 - t) * 2) / 2;\n };\n }\n}\n"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AAIO,MAAMA,MAAN,CAAa;EACN,OAALC,KAAK,CAACC,CAAD,EAAoB;IAC9B,OAAOA,CAAC,GAAG,CAAJ,GAAQ,CAAR,GAAY,CAAnB;EACD;;EAEW,OAALC,KAAK,CAACD,CAAD,EAAoB;IAC9B,OAAOA,CAAC,IAAI,CAAL,GAAS,CAAT,GAAa,CAApB;EACD;;EAEY,OAANE,MAAM,CAACC,CAAD,EAAoB;IAC/B,OAAOA,CAAP;EACD;;EAEU,OAAJC,IAAI,CAACD,CAAD,EAAoB;IAC7B,OAAOL,MAAM,CAACO,MAAP,CAAc,IAAd,EAAoB,CAApB,EAAuB,CAAvB,EAA0B,CAA1B,EAA6BF,CAA7B,CAAP;EACD;;EAEU,OAAJG,IAAI,CAACH,CAAD,EAAoB;IAC7B,OAAOA,CAAC,GAAGA,CAAX;EACD;;EAEW,OAALI,KAAK,CAACJ,CAAD,EAAoB;IAC9B,OAAOA,CAAC,GAAGA,CAAJ,GAAQA,CAAf;EACD;;EAEU,OAAJK,IAAI,CAACR,CAAD,EAAmC;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B;MAClB,MAAMmB,GAAG,GAAGnB,CAAC,GAAG,OAAO,IAAvB;MACA,OAAO,SAASmB,GAAT,GAAeA,GAAf,GAAqB,MAA5B;IACD;;IAED,MAAMC,EAAE,GAAGpB,CAAC,GAAG,QAAQ,IAAvB;IACA,OAAO,SAASoB,EAAT,GAAcA,EAAd,GAAmB,QAA1B;EACD;;EAEY,OAANlB,MAAM,CACXmB,EADW,EAEXC,EAFW,EAGXC,EAHW,EAIXC,EAJW,EAKY;IACvB,OAAO,IAAAtB,iBAAA,EAAOmB,EAAP,EAAWC,EAAX,EAAeC,EAAf,EAAmBC,EAAnB,CAAP;EACD;;EAEQ,OAAFC,EAAE,CAACC,MAAD,EAAuD;IAC9D,OAAOA,MAAP;EACD;;EAES,OAAHC,GAAG,CAACD,MAAD,EAAuD;IAC/D,OAAQ1B,CAAD,IAAe,IAAI0B,MAAM,CAAC,IAAI1B,CAAL,CAAhC;EACD;;EAEW,OAAL4B,KAAK,CAACF,MAAD,EAAuD;IACjE,OAAQ1B,CAAD,IAAe;MACpB,IAAIA,CAAC,GAAG,GAAR,EAAa;QACX,OAAO0B,MAAM,CAAC1B,CAAC,GAAG,CAAL,CAAN,GAAgB,CAAvB;MACD;;MAED,OAAO,IAAI0B,MAAM,CAAC,CAAC,IAAI1B,CAAL,IAAU,CAAX,CAAN,GAAsB,CAAjC;IACD,CAND;EAOD;;AA/FiB"}
|
@@ -24,19 +24,15 @@ var _functions = require("./functions");
|
|
24
24
|
* the animation.
|
25
25
|
*/
|
26
26
|
const createTiming = (params, value, callback) => {
|
27
|
-
var _ref, _params$from;
|
28
|
-
|
29
27
|
// Update from to be either the declared from value,
|
30
28
|
// the current value of the value or zero
|
31
29
|
const resolvedParams = { ...params,
|
32
|
-
from:
|
30
|
+
from: params.from ?? (value === null || value === void 0 ? void 0 : value.current) ?? 0
|
33
31
|
}; // Update function for the animation value
|
34
32
|
|
35
33
|
const animationFunction = (t, state) => {
|
36
|
-
var _params$loop, _params$yoyo;
|
37
|
-
|
38
34
|
// Update the input value using the provided update function
|
39
|
-
const nextState = (0, _functions.timing)(t, params.duration, params.easing,
|
35
|
+
const nextState = (0, _functions.timing)(t, params.duration, params.easing, params.loop ?? false, params.yoyo ?? false, state ?? {
|
40
36
|
current: params.from,
|
41
37
|
finished: false
|
42
38
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"names":["createTiming","params","value","callback","resolvedParams","from","current","animationFunction","t","state","nextState","timing","duration","easing","loop","yoyo","finished","to","ValueApi","createAnimation"],"sources":["createTiming.ts"],"sourcesContent":["import type {\n TimingConfig,\n RequiredAnimationParams,\n AnimationCallback,\n} from \"../types\";\nimport type { AnimationState, SkiaMutableValue } from \"../../values/types\";\nimport { ValueApi } from \"../../values/api\";\n\nimport { timing } from \"./functions\";\n\n/**\n * Creates an animation that is driven by a clock value.\n * The value will be run from / to the value in params and modified\n * by the provided easing curve for the length of the duration. When\n * the value has reached its desired \"to\" value the animation\n * will be stopped. If loop is set to true, the animation will continue\n * to run until stopped.\n *\n * @param params Animation parameters\n * @param config Spring or timing configuration\n * @param value Optional value that the animation will update\n * @params an animation value that can be used to start/stop\n * the animation.\n */\nexport const createTiming = (\n params: RequiredAnimationParams & Required<TimingConfig>,\n value?: SkiaMutableValue<number>,\n callback?: AnimationCallback\n) => {\n // Update from to be either the declared from value,\n // the current value of the value or zero\n const resolvedParams = {\n ...params,\n from: params.from ?? value?.current ?? 0,\n };\n\n // Update function for the animation value\n const animationFunction = (t: number, state: AnimationState | undefined) => {\n // Update the input value using the provided update function\n const nextState = timing(\n t,\n params.duration,\n params.easing,\n params.loop ?? false,\n params.yoyo ?? false,\n state ?? { current: params.from!, finished: false }\n );\n const current =\n nextState.current * (resolvedParams.to - resolvedParams.from!) +\n resolvedParams.from!;\n if (callback && nextState.finished === true) {\n callback(current);\n }\n return {\n ...nextState,\n current,\n };\n };\n\n // Create animation value\n return ValueApi.createAnimation(animationFunction);\n};\n"],"mappings":";;;;;;;AAMA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,YAAY,GAAG,CAC1BC,MAD0B,EAE1BC,KAF0B,EAG1BC,QAH0B,KAIvB;EACH;EACA;EACA,MAAMC,cAAc,GAAG,EACrB,GAAGH,MADkB;IAErBI,IAAI,EAAEJ,MAAM,CAACI,IAAP,KAAeH,KAAf,aAAeA,KAAf,uBAAeA,KAAK,CAAEI,OAAtB,KAAiC;EAFlB,CAAvB,CAHG,CAQH;;EACA,MAAMC,iBAAiB,GAAG,CAACC,CAAD,EAAYC,KAAZ,KAAkD;IAC1E;IACA,MAAMC,SAAS,GAAG,IAAAC,iBAAA,EAChBH,CADgB,EAEhBP,MAAM,CAACW,QAFS,EAGhBX,MAAM,CAACY,MAHS,EAIhBZ,MAAM,CAACa,IAAP,IAAe,KAJC,EAKhBb,MAAM,CAACc,IAAP,IAAe,KALC,EAMhBN,KAAK,IAAI;MAAEH,OAAO,EAAEL,MAAM,CAACI,IAAlB;MAAyBW,QAAQ,EAAE;IAAnC,CANO,CAAlB;IAQA,MAAMV,OAAO,GACXI,SAAS,CAACJ,OAAV,IAAqBF,cAAc,CAACa,EAAf,GAAoBb,cAAc,CAACC,IAAxD,IACAD,cAAc,CAACC,IAFjB;;IAGA,IAAIF,QAAQ,IAAIO,SAAS,CAACM,QAAV,KAAuB,IAAvC,EAA6C;MAC3Cb,QAAQ,CAACG,OAAD,CAAR;IACD;;IACD,OAAO,EACL,GAAGI,SADE;MAELJ;IAFK,CAAP;EAID,CApBD,CATG,CA+BH;;;EACA,OAAOY,aAAA,CAASC,eAAT,CAAyBZ,iBAAzB,CAAP;AACD,CArCM"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"names":["NEWTON_ITERATIONS","NEWTON_MIN_SLOPE","SUBDIVISION_PRECISION","SUBDIVISION_MAX_ITERATIONS","kSplineTableSize","kSampleStepSize","float32ArraySupported","Float32Array","a","aA1","aA2","b","c","calcBezier","aT","getSlope","binarySubdivide","aX","_aA","_aB","mX1","mX2","currentX","currentT","i","aA","aB","Math","abs","newtonRaphsonIterate","_aGuessT","aGuessT","currentSlope","bezier","mY1","mY2","Error","sampleValues","Array","getTForX","intervalStart","currentSample","lastSample","dist","guessForT","initialSlope","x"],"sources":["bezier.ts"],"sourcesContent":["// eslint-disable-next-line max-len\n// Taken from https://github.com/facebook/react-native/blob/0b9ea60b4fee8cacc36e7160e31b91fc114dbc0d/Libraries/Animated/src/bezier.js\n\nconst NEWTON_ITERATIONS = 4;\nconst NEWTON_MIN_SLOPE = 0.001;\nconst SUBDIVISION_PRECISION = 0.0000001;\nconst SUBDIVISION_MAX_ITERATIONS = 10;\n\nconst kSplineTableSize = 11;\nconst kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);\n\nconst float32ArraySupported = typeof Float32Array === \"function\";\n\nfunction a(aA1: number, aA2: number): number {\n return 1.0 - 3.0 * aA2 + 3.0 * aA1;\n}\n\nfunction b(aA1: number, aA2: number): number {\n return 3.0 * aA2 - 6.0 * aA1;\n}\n\nfunction c(aA1: number): number {\n return 3.0 * aA1;\n}\n\n// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.\nfunction calcBezier(aT: number, aA1: number, aA2: number): number {\n return ((a(aA1, aA2) * aT + b(aA1, aA2)) * aT + c(aA1)) * aT;\n}\n\n// Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.\nfunction getSlope(aT: number, aA1: number, aA2: number): number {\n return 3.0 * a(aA1, aA2) * aT * aT + 2.0 * b(aA1, aA2) * aT + c(aA1);\n}\n\nfunction binarySubdivide({\n aX,\n _aA,\n _aB,\n mX1,\n mX2,\n}: {\n aX: number;\n _aA: number;\n _aB: number;\n mX1: number;\n mX2: number;\n}): number {\n let currentX;\n let currentT;\n let i = 0;\n let aA = _aA;\n let aB = _aB;\n do {\n currentT = aA + (aB - aA) / 2.0;\n currentX = calcBezier(currentT, mX1, mX2) - aX;\n if (currentX > 0.0) {\n aB = currentT;\n } else {\n aA = currentT;\n }\n } while (\n Math.abs(currentX) > SUBDIVISION_PRECISION &&\n ++i < SUBDIVISION_MAX_ITERATIONS\n );\n\n return currentT;\n}\n\nfunction newtonRaphsonIterate(\n aX: number,\n _aGuessT: number,\n mX1: number,\n mX2: number\n): number {\n let aGuessT = _aGuessT;\n for (let i = 0; i < NEWTON_ITERATIONS; ++i) {\n const currentSlope = getSlope(aGuessT, mX1, mX2);\n if (currentSlope === 0.0) {\n return aGuessT;\n }\n\n const currentX = calcBezier(aGuessT, mX1, mX2) - aX;\n aGuessT -= currentX / currentSlope;\n }\n\n return aGuessT;\n}\n\nexport function bezier(\n mX1: number,\n mY1: number,\n mX2: number,\n mY2: number\n): (x: number) => number {\n if (!(mX1 >= 0 && mX1 <= 1 && mX2 >= 0 && mX2 <= 1)) {\n throw new Error(\"bezier x values must be in [0, 1] range\");\n }\n\n // Precompute samples table\n const sampleValues = float32ArraySupported\n ? new Float32Array(kSplineTableSize)\n : new Array(kSplineTableSize);\n if (mX1 !== mY1 || mX2 !== mY2) {\n for (let i = 0; i < kSplineTableSize; ++i) {\n sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);\n }\n }\n\n function getTForX(aX: number): number {\n let intervalStart = 0.0;\n let currentSample = 1;\n const lastSample = kSplineTableSize - 1;\n\n for (\n ;\n currentSample !== lastSample && sampleValues[currentSample] <= aX;\n ++currentSample\n ) {\n intervalStart += kSampleStepSize;\n }\n\n --currentSample;\n\n // Interpolate to provide an initial guess for t\n const dist =\n (aX - sampleValues[currentSample]) /\n (sampleValues[currentSample + 1] - sampleValues[currentSample]);\n const guessForT = intervalStart + dist * kSampleStepSize;\n\n const initialSlope = getSlope(guessForT, mX1, mX2);\n if (initialSlope >= NEWTON_MIN_SLOPE) {\n return newtonRaphsonIterate(aX, guessForT, mX1, mX2);\n }\n\n if (initialSlope === 0.0) {\n return guessForT;\n }\n\n return binarySubdivide({\n aX,\n _aA: intervalStart,\n _aB: intervalStart + kSampleStepSize,\n mX1,\n mX2,\n });\n }\n\n return function (x: number): number {\n if (mX1 === mY1 && mX2 === mY2) {\n return x; // linear\n }\n\n // Because JavaScript number are imprecise, we should guarantee the extremes are right.\n if (x === 0) {\n return 0;\n }\n\n if (x === 1) {\n return 1;\n }\n\n return calcBezier(getTForX(x), mY1, mY2);\n };\n}\n"],"mappings":";;;;;;AAAA;AACA;AAEA,MAAMA,iBAAiB,GAAG,CAA1B;AACA,MAAMC,gBAAgB,GAAG,KAAzB;AACA,MAAMC,qBAAqB,GAAG,SAA9B;AACA,MAAMC,0BAA0B,GAAG,EAAnC;AAEA,MAAMC,gBAAgB,GAAG,EAAzB;AACA,MAAMC,eAAe,GAAG,OAAOD,gBAAgB,GAAG,GAA1B,CAAxB;AAEA,MAAME,qBAAqB,GAAG,OAAOC,YAAP,KAAwB,UAAtD;;AAEA,SAASC,CAAT,CAAWC,GAAX,EAAwBC,GAAxB,EAA6C;EAC3C,OAAO,MAAM,MAAMA,GAAZ,GAAkB,MAAMD,GAA/B;AACD;;AAED,SAASE,CAAT,CAAWF,GAAX,EAAwBC,GAAxB,EAA6C;EAC3C,OAAO,MAAMA,GAAN,GAAY,MAAMD,GAAzB;AACD;;AAED,SAASG,CAAT,CAAWH,GAAX,EAAgC;EAC9B,OAAO,MAAMA,GAAb;AACD,C,CAED;;;AACA,SAASI,UAAT,CAAoBC,EAApB,EAAgCL,GAAhC,EAA6CC,GAA7C,EAAkE;EAChE,OAAO,CAAC,CAACF,CAAC,CAACC,GAAD,EAAMC,GAAN,CAAD,GAAcI,EAAd,GAAmBH,CAAC,CAACF,GAAD,EAAMC,GAAN,CAArB,IAAmCI,EAAnC,GAAwCF,CAAC,CAACH,GAAD,CAA1C,IAAmDK,EAA1D;AACD,C,CAED;;;AACA,SAASC,QAAT,CAAkBD,EAAlB,EAA8BL,GAA9B,EAA2CC,GAA3C,EAAgE;EAC9D,OAAO,MAA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I,aAAa,GAAG,CAAjB,CAAZ,GAAkCJ,YAAY,CAACI,aAAD,CAD/C,CADF;IAGA,MAAMG,SAAS,GAAGJ,aAAa,GAAGG,IAAI,GAAGtC,eAAzC;IAEA,MAAMwC,YAAY,GAAG9B,QAAQ,CAAC6B,SAAD,EAAYxB,GAAZ,EAAiBC,GAAjB,CAA7B;;IACA,IAAIwB,YAAY,IAAI5C,gBAApB,EAAsC;MACpC,OAAO4B,oBAAoB,CAACZ,EAAD,EAAK2B,SAAL,EAAgBxB,GAAhB,EAAqBC,GAArB,CAA3B;IACD;;IAED,IAAIwB,YAAY,KAAK,GAArB,EAA0B;MACxB,OAAOD,SAAP;IACD;;IAED,OAAO5B,eAAe,CAAC;MACrBC,EADqB;MAErBC,GAAG,EAAEsB,aAFgB;MAGrBrB,GAAG,EAAEqB,aAAa,GAAGnC,eAHA;MAIrBe,GAJqB;MAKrBC;IALqB,CAAD,CAAtB;EAOD;;EAED,OAAO,UAAUyB,CAAV,EAA6B;IAClC,IAAI1B,GAAG,KAAKc,GAAR,IAAeb,GAAG,KAAKc,GAA3B,EAAgC;MAC9B,OAAOW,CAAP,CAD8B,CACpB;IACX,CAHiC,CAKlC;;;IACA,IAAIA,CAAC,KAAK,CAAV,EAAa;MACX,OAAO,CAAP;IACD;;IAED,IAAIA,CAAC,KAAK,CAAV,EAAa;MACX,OAAO,CAAP;IACD;;IAED,OAAOjC,UAAU,CAAC0B,QAAQ,CAACO,CAAD,CAAT,EAAcZ,GAAd,EAAmBC,GAAnB,CAAjB;EACD,CAfD;AAgBD"}
|
@@ -27,13 +27,11 @@ const getResolvedParams = (toOrParams, config) => {
|
|
27
27
|
if (typeof toOrParams === "number") {
|
28
28
|
resolvedParameters.to = toOrParams;
|
29
29
|
} else {
|
30
|
-
var _toOrParams$from, _toOrParams$to, _toOrParams$loop, _toOrParams$yoyo;
|
31
|
-
|
32
30
|
resolvedParameters = {
|
33
|
-
from:
|
34
|
-
to:
|
35
|
-
loop:
|
36
|
-
yoyo:
|
31
|
+
from: toOrParams.from ?? resolvedParameters.from,
|
32
|
+
to: toOrParams.to ?? resolvedParameters.to,
|
33
|
+
loop: toOrParams.loop ?? resolvedParameters.loop,
|
34
|
+
yoyo: toOrParams.yoyo ?? resolvedParameters.yoyo
|
37
35
|
};
|
38
36
|
}
|
39
37
|
|
@@ -41,10 +39,8 @@ const getResolvedParams = (toOrParams, config) => {
|
|
41
39
|
};
|
42
40
|
|
43
41
|
if (config) {
|
44
|
-
|
45
|
-
|
46
|
-
resolvedConfig.duration = (_config$duration = config.duration) !== null && _config$duration !== void 0 ? _config$duration : DefaultTimingConfig.duration;
|
47
|
-
resolvedConfig.easing = (_config$easing = config.easing) !== null && _config$easing !== void 0 ? _config$easing : DefaultTimingConfig.easing;
|
42
|
+
resolvedConfig.duration = config.duration ?? DefaultTimingConfig.duration;
|
43
|
+
resolvedConfig.easing = config.easing ?? DefaultTimingConfig.easing;
|
48
44
|
}
|
49
45
|
|
50
46
|
return { ...resolvedParameters,
|