@shopify/react-native-skia 0.1.130 → 0.1.131
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +8 -0
- package/android/cpp/jni/JniSkiaDrawView.cpp +3 -2
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaDrawView.java +2 -1
- package/cpp/api/JsiSkCanvas.h +2 -2
- package/cpp/api/JsiSkMatrix.h +40 -27
- package/cpp/api/JsiSkPaint.h +3 -1
- package/cpp/api/JsiSkPath.h +67 -61
- package/cpp/api/JsiSkPathFactory.h +14 -1
- package/cpp/api/JsiSkRuntimeShaderBuilder.h +18 -0
- package/cpp/api/JsiSkTypeface.h +11 -2
- package/cpp/api/JsiSkTypefaceFactory.h +5 -1
- package/cpp/rnskia/RNSkInfoParameter.h +2 -0
- package/cpp/utils/RNSkLog.h +22 -0
- package/ios/RNSkia-iOS/SkiaDrawView.mm +2 -1
- package/lib/commonjs/animation/functions/index.js +47 -17
- package/lib/commonjs/animation/functions/index.js.map +1 -1
- package/lib/commonjs/animation/functions/interpolatePaths.js +45 -0
- package/lib/commonjs/animation/functions/interpolatePaths.js.map +1 -0
- package/lib/commonjs/animation/functions/interpolateVector.js +20 -0
- package/lib/commonjs/animation/functions/interpolateVector.js.map +1 -0
- package/lib/commonjs/index.js +13 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/renderer/Canvas.js +19 -35
- package/lib/commonjs/renderer/Canvas.js.map +1 -1
- package/lib/commonjs/renderer/HostConfig.js +2 -2
- package/lib/commonjs/renderer/HostConfig.js.map +1 -1
- package/lib/commonjs/renderer/components/Blend.js +10 -7
- package/lib/commonjs/renderer/components/Blend.js.map +1 -1
- package/lib/commonjs/renderer/components/Compose.js +9 -6
- package/lib/commonjs/renderer/components/Compose.js.map +1 -1
- package/lib/commonjs/renderer/components/Group.js +7 -6
- package/lib/commonjs/renderer/components/Group.js.map +1 -1
- package/lib/commonjs/renderer/components/Mask.js +13 -10
- package/lib/commonjs/renderer/components/Mask.js.map +1 -1
- package/lib/commonjs/renderer/components/Paint.js +7 -4
- 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/BackdropFilter.js +1 -1
- package/lib/commonjs/renderer/components/backdrop/BackdropFilter.js.map +1 -1
- package/lib/commonjs/renderer/components/colorFilters/BlendColor.js +7 -6
- package/lib/commonjs/renderer/components/colorFilters/BlendColor.js.map +1 -1
- package/lib/commonjs/renderer/components/colorFilters/Compose.js +6 -6
- package/lib/commonjs/renderer/components/colorFilters/Compose.js.map +1 -1
- package/lib/commonjs/renderer/components/colorFilters/Lerp.js +8 -7
- package/lib/commonjs/renderer/components/colorFilters/Lerp.js.map +1 -1
- package/lib/commonjs/renderer/components/colorFilters/LinearToSRGBGamma.js +6 -6
- package/lib/commonjs/renderer/components/colorFilters/LinearToSRGBGamma.js.map +1 -1
- package/lib/commonjs/renderer/components/colorFilters/LumaColorFilter.js +6 -6
- package/lib/commonjs/renderer/components/colorFilters/LumaColorFilter.js.map +1 -1
- package/lib/commonjs/renderer/components/colorFilters/Matrix.js +6 -7
- package/lib/commonjs/renderer/components/colorFilters/Matrix.js.map +1 -1
- package/lib/commonjs/renderer/components/colorFilters/SRGBToLinearGamma.js +6 -6
- package/lib/commonjs/renderer/components/colorFilters/SRGBToLinearGamma.js.map +1 -1
- package/lib/commonjs/renderer/components/image/BoxFit.js +7 -9
- package/lib/commonjs/renderer/components/image/BoxFit.js.map +1 -1
- package/lib/commonjs/renderer/components/image/Image.js +3 -2
- package/lib/commonjs/renderer/components/image/Image.js.map +1 -1
- package/lib/commonjs/renderer/components/image/ImageSVG.js +3 -2
- package/lib/commonjs/renderer/components/image/ImageSVG.js.map +1 -1
- package/lib/commonjs/renderer/components/image/ImageShader.js +9 -6
- package/lib/commonjs/renderer/components/image/ImageShader.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/Blur.js +7 -4
- package/lib/commonjs/renderer/components/imageFilters/Blur.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/DisplacementMap.js +10 -7
- package/lib/commonjs/renderer/components/imageFilters/DisplacementMap.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/InnerShadow.js +10 -15
- package/lib/commonjs/renderer/components/imageFilters/InnerShadow.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/Morphology.js +7 -6
- package/lib/commonjs/renderer/components/imageFilters/Morphology.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/Offset.js +5 -4
- package/lib/commonjs/renderer/components/imageFilters/Offset.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/RuntimeShader.js +13 -6
- package/lib/commonjs/renderer/components/imageFilters/RuntimeShader.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/Shadow.js +8 -7
- package/lib/commonjs/renderer/components/imageFilters/Shadow.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/getInput.js +7 -7
- package/lib/commonjs/renderer/components/imageFilters/getInput.js.map +1 -1
- package/lib/commonjs/renderer/components/maskFilters/Blur.js +6 -3
- package/lib/commonjs/renderer/components/maskFilters/Blur.js.map +1 -1
- package/lib/commonjs/renderer/components/pathEffects/Corner.js +8 -6
- package/lib/commonjs/renderer/components/pathEffects/Corner.js.map +1 -1
- package/lib/commonjs/renderer/components/pathEffects/Dash.js +8 -6
- package/lib/commonjs/renderer/components/pathEffects/Dash.js.map +1 -1
- package/lib/commonjs/renderer/components/pathEffects/Discrete.js +8 -6
- package/lib/commonjs/renderer/components/pathEffects/Discrete.js.map +1 -1
- package/lib/commonjs/renderer/components/pathEffects/Line2D.js +8 -6
- package/lib/commonjs/renderer/components/pathEffects/Line2D.js.map +1 -1
- package/lib/commonjs/renderer/components/pathEffects/Path1D.js +8 -6
- package/lib/commonjs/renderer/components/pathEffects/Path1D.js.map +1 -1
- package/lib/commonjs/renderer/components/pathEffects/Path2D.js +8 -6
- package/lib/commonjs/renderer/components/pathEffects/Path2D.js.map +1 -1
- package/lib/commonjs/renderer/components/pathEffects/Sum.js +7 -4
- package/lib/commonjs/renderer/components/pathEffects/Sum.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/Color.js +7 -4
- package/lib/commonjs/renderer/components/shaders/Color.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/FractalNoise.js +5 -4
- package/lib/commonjs/renderer/components/shaders/FractalNoise.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/Gradient.js +5 -5
- package/lib/commonjs/renderer/components/shaders/Gradient.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/LinearGradient.js +6 -5
- package/lib/commonjs/renderer/components/shaders/LinearGradient.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/RadialGradient.js +6 -5
- package/lib/commonjs/renderer/components/shaders/RadialGradient.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/Shader.js +6 -43
- package/lib/commonjs/renderer/components/shaders/Shader.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/SweepGradient.js +6 -5
- package/lib/commonjs/renderer/components/shaders/SweepGradient.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/Turbulence.js +5 -4
- package/lib/commonjs/renderer/components/shaders/Turbulence.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/TwoPointConicalGradient.js +6 -5
- package/lib/commonjs/renderer/components/shaders/TwoPointConicalGradient.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Box.js +26 -29
- package/lib/commonjs/renderer/components/shapes/Box.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Circle.js +7 -5
- 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/FitBox.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Line.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Oval.js +3 -2
- package/lib/commonjs/renderer/components/shapes/Oval.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Patch.js +8 -5
- package/lib/commonjs/renderer/components/shapes/Patch.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Path.js +5 -4
- package/lib/commonjs/renderer/components/shapes/Path.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Points.js +2 -2
- package/lib/commonjs/renderer/components/shapes/Points.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Rect.js +3 -2
- package/lib/commonjs/renderer/components/shapes/Rect.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/RoundedRect.js +3 -2
- package/lib/commonjs/renderer/components/shapes/RoundedRect.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Vertices.js +9 -8
- package/lib/commonjs/renderer/components/shapes/Vertices.js.map +1 -1
- package/lib/commonjs/renderer/components/text/Glyphs.js +3 -2
- package/lib/commonjs/renderer/components/text/Glyphs.js.map +1 -1
- package/lib/commonjs/renderer/components/text/Text.js +3 -2
- 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 +7 -11
- package/lib/commonjs/renderer/components/text/TextPath.js.map +1 -1
- package/lib/commonjs/renderer/index.js +13 -13
- package/lib/commonjs/renderer/index.js.map +1 -1
- package/lib/commonjs/renderer/nodes/Declaration.js.map +1 -1
- package/lib/commonjs/renderer/nodes/Drawing.js +5 -5
- package/lib/commonjs/renderer/nodes/Drawing.js.map +1 -1
- package/lib/commonjs/renderer/nodes/Node.js.map +1 -1
- package/lib/commonjs/renderer/processors/Animations/Animations.js.map +1 -1
- package/lib/commonjs/renderer/processors/Circles.js +2 -4
- package/lib/commonjs/renderer/processors/Circles.js.map +1 -1
- package/lib/commonjs/renderer/processors/Clips.js +5 -5
- package/lib/commonjs/renderer/processors/Clips.js.map +1 -1
- package/lib/commonjs/{skia/core → renderer/processors}/Color.js +2 -6
- package/lib/commonjs/renderer/processors/Color.js.map +1 -0
- package/lib/commonjs/renderer/processors/Font.js +4 -4
- package/lib/commonjs/renderer/processors/Font.js.map +1 -1
- package/lib/commonjs/renderer/processors/Paint.js +18 -14
- package/lib/commonjs/renderer/processors/Paint.js.map +1 -1
- package/lib/commonjs/renderer/processors/Paths.js +4 -4
- package/lib/commonjs/renderer/processors/Paths.js.map +1 -1
- package/lib/commonjs/renderer/processors/Radius.js +2 -4
- package/lib/commonjs/renderer/processors/Radius.js.map +1 -1
- package/lib/commonjs/renderer/processors/Rects.js +8 -59
- package/lib/commonjs/renderer/processors/Rects.js.map +1 -1
- package/lib/commonjs/renderer/processors/Transform.js +26 -17
- package/lib/commonjs/renderer/processors/Transform.js.map +1 -1
- package/lib/commonjs/renderer/processors/index.js +26 -13
- 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/Transforms.js.map +1 -1
- package/lib/commonjs/renderer/processors/math/index.js +0 -26
- package/lib/commonjs/renderer/processors/math/index.js.map +1 -1
- package/lib/commonjs/renderer/useCanvas.js +30 -0
- package/lib/commonjs/renderer/useCanvas.js.map +1 -0
- package/lib/commonjs/skia/NativeSetup.js +1 -1
- package/lib/commonjs/skia/NativeSetup.js.map +1 -1
- package/lib/commonjs/skia/Skia.web.js +12 -0
- package/lib/commonjs/skia/Skia.web.js.map +1 -0
- package/lib/commonjs/skia/core/Data.js +9 -4
- package/lib/commonjs/skia/core/Data.js.map +1 -1
- package/lib/commonjs/skia/core/Font.js +2 -4
- package/lib/commonjs/skia/core/Font.js.map +1 -1
- package/lib/commonjs/skia/core/Matrix.js +15 -0
- package/lib/commonjs/skia/core/Matrix.js.map +1 -0
- package/lib/commonjs/skia/core/Paint.js +4 -12
- package/lib/commonjs/skia/core/Paint.js.map +1 -1
- package/lib/commonjs/skia/core/Path.js +14 -2
- package/lib/commonjs/skia/core/Path.js.map +1 -1
- package/lib/commonjs/skia/core/RRect.js +13 -0
- package/lib/commonjs/skia/core/RRect.js.map +1 -0
- package/lib/commonjs/skia/core/Rect.js +47 -0
- package/lib/commonjs/skia/core/Rect.js.map +1 -0
- package/lib/commonjs/skia/core/Vector.js +49 -0
- package/lib/commonjs/skia/core/Vector.js.map +1 -0
- package/lib/commonjs/skia/core/index.js +51 -25
- package/lib/commonjs/skia/core/index.js.map +1 -1
- package/lib/commonjs/skia/types/Image/ImageFactory.js.map +1 -1
- package/lib/commonjs/skia/types/Matrix.js +58 -1
- package/lib/commonjs/skia/types/Matrix.js.map +1 -1
- package/lib/commonjs/skia/types/Path/Path.js +1 -0
- package/lib/commonjs/skia/types/Path/Path.js.map +1 -1
- package/lib/commonjs/skia/types/Point.js.map +1 -1
- package/lib/commonjs/skia/types/RRect.js +7 -0
- package/lib/commonjs/skia/types/RRect.js.map +1 -1
- package/lib/commonjs/skia/types/Shader/Shader.js +51 -1
- package/lib/commonjs/skia/types/Shader/Shader.js.map +1 -1
- package/lib/commonjs/skia/web/{api/Host.js → Host.js} +10 -1
- package/lib/commonjs/skia/web/Host.js.map +1 -0
- package/lib/commonjs/skia/web/JsiImageFilterFactory.js +68 -0
- package/lib/commonjs/skia/web/JsiImageFilterFactory.js.map +1 -0
- package/lib/commonjs/skia/web/{api/JsiSkCanvas.js → JsiSkCanvas.js} +20 -6
- package/lib/commonjs/skia/web/JsiSkCanvas.js.map +1 -0
- package/lib/commonjs/skia/web/{api/JsiSkColor.js → JsiSkColor.js} +163 -4
- package/lib/commonjs/skia/web/JsiSkColor.js.map +1 -0
- package/lib/commonjs/skia/web/{api/JsiSkColorFilter.js → JsiSkColorFilter.js} +0 -0
- package/lib/commonjs/skia/web/{api/JsiSkColorFilter.js.map → JsiSkColorFilter.js.map} +1 -1
- package/lib/commonjs/skia/web/JsiSkColorFilterFactory.js +48 -0
- package/lib/commonjs/skia/web/JsiSkColorFilterFactory.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkContourMeasure.js +42 -0
- package/lib/commonjs/skia/web/JsiSkContourMeasure.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkContourMeasureIter.js +30 -0
- package/lib/commonjs/skia/web/JsiSkContourMeasureIter.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkData.js +18 -0
- package/lib/commonjs/skia/web/JsiSkData.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkDataFactory.js +44 -0
- package/lib/commonjs/skia/web/JsiSkDataFactory.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkFont.js +111 -0
- package/lib/commonjs/skia/web/JsiSkFont.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkFontMgr.js +35 -0
- package/lib/commonjs/skia/web/JsiSkFontMgr.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkFontMgrFactory.js +25 -0
- package/lib/commonjs/skia/web/JsiSkFontMgrFactory.js.map +1 -0
- package/lib/commonjs/skia/web/{api/JsiSkImage.js → JsiSkImage.js} +0 -0
- package/lib/commonjs/skia/web/{api/JsiSkImage.js.map → JsiSkImage.js.map} +1 -1
- package/lib/commonjs/skia/web/JsiSkImageFactory.js +47 -0
- package/lib/commonjs/skia/web/JsiSkImageFactory.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkImageFilter.js +18 -0
- package/lib/commonjs/skia/web/JsiSkImageFilter.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkMaskFilter.js +18 -0
- package/lib/commonjs/skia/web/JsiSkMaskFilter.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkMaskFilterFactory.js +24 -0
- package/lib/commonjs/skia/web/JsiSkMaskFilterFactory.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkMatrix.js +38 -0
- package/lib/commonjs/skia/web/JsiSkMatrix.js.map +1 -0
- package/lib/commonjs/skia/web/{api/JsiSkPaint.js → JsiSkPaint.js} +4 -9
- package/lib/commonjs/skia/web/JsiSkPaint.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkPath.js +324 -0
- package/lib/commonjs/skia/web/JsiSkPath.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkPathEffect.js +18 -0
- package/lib/commonjs/skia/web/JsiSkPathEffect.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkPathEffectFactory.js +78 -0
- package/lib/commonjs/skia/web/JsiSkPathEffectFactory.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkPathFactory.js +58 -0
- package/lib/commonjs/skia/web/JsiSkPathFactory.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkPicture.js +29 -0
- package/lib/commonjs/skia/web/JsiSkPicture.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkPictureFactory.js +30 -0
- package/lib/commonjs/skia/web/JsiSkPictureFactory.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkPictureRecorder.js +30 -0
- package/lib/commonjs/skia/web/JsiSkPictureRecorder.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkPoint.js +26 -0
- package/lib/commonjs/skia/web/JsiSkPoint.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkRRect.js +32 -0
- package/lib/commonjs/skia/web/JsiSkRRect.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkRSXform.js +18 -0
- package/lib/commonjs/skia/web/JsiSkRSXform.js.map +1 -0
- package/lib/commonjs/skia/web/{api/JsiSkRect.js → JsiSkRect.js} +8 -0
- package/lib/commonjs/skia/web/JsiSkRect.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkRuntimeEffect.js +44 -0
- package/lib/commonjs/skia/web/JsiSkRuntimeEffect.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkRuntimeEffectFactory.js +30 -0
- package/lib/commonjs/skia/web/JsiSkRuntimeEffectFactory.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkSVGFactory.js +26 -0
- package/lib/commonjs/skia/web/JsiSkSVGFactory.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkShader.js +18 -0
- package/lib/commonjs/skia/web/JsiSkShader.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkShaderFactory.js +52 -0
- package/lib/commonjs/skia/web/JsiSkShaderFactory.js.map +1 -0
- package/lib/commonjs/skia/web/{api/JsiSkSurface.js → JsiSkSurface.js} +0 -0
- package/lib/commonjs/skia/web/{api/JsiSkSurface.js.map → JsiSkSurface.js.map} +1 -1
- package/lib/commonjs/skia/web/{api/JsiSkSurfaceFactory.js → JsiSkSurfaceFactory.js} +0 -0
- package/lib/commonjs/skia/web/{api/JsiSkSurfaceFactory.js.map → JsiSkSurfaceFactory.js.map} +1 -1
- package/lib/commonjs/skia/web/JsiSkTextBlob.js +18 -0
- package/lib/commonjs/skia/web/JsiSkTextBlob.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkTextBlobFactory.js +36 -0
- package/lib/commonjs/skia/web/JsiSkTextBlobFactory.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkTypeface.js +28 -0
- package/lib/commonjs/skia/web/JsiSkTypeface.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkTypefaceFactory.js +30 -0
- package/lib/commonjs/skia/web/JsiSkTypefaceFactory.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkVertices.js +28 -0
- package/lib/commonjs/skia/web/JsiSkVertices.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkVerticesFactory.js +27 -0
- package/lib/commonjs/skia/web/JsiSkVerticesFactory.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkia.js +97 -0
- package/lib/commonjs/skia/web/JsiSkia.js.map +1 -0
- package/lib/commonjs/skia/web/index.js +4 -4
- package/lib/commonjs/skia/web/index.js.map +1 -1
- package/lib/commonjs/values/web/api.js +2 -2
- package/lib/commonjs/values/web/api.js.map +1 -1
- package/lib/commonjs/views/SkiaView.web.js +216 -0
- package/lib/commonjs/views/SkiaView.web.js.map +1 -0
- package/lib/commonjs/views/types.js.map +1 -1
- package/lib/commonjs/views/useTouchHandler.js +70 -46
- package/lib/commonjs/views/useTouchHandler.js.map +1 -1
- package/lib/commonjs/web/index.js +20 -0
- package/lib/commonjs/web/index.js.map +1 -0
- package/lib/module/animation/functions/index.js +4 -2
- package/lib/module/animation/functions/index.js.map +1 -1
- package/lib/module/animation/functions/interpolatePaths.js +36 -0
- package/lib/module/animation/functions/interpolatePaths.js.map +1 -0
- package/lib/module/animation/functions/interpolateVector.js +7 -0
- package/lib/module/animation/functions/interpolateVector.js.map +1 -0
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/renderer/Canvas.js +15 -26
- package/lib/module/renderer/Canvas.js.map +1 -1
- package/lib/module/renderer/HostConfig.js +2 -2
- package/lib/module/renderer/HostConfig.js.map +1 -1
- package/lib/module/renderer/components/Blend.js +5 -2
- package/lib/module/renderer/components/Blend.js.map +1 -1
- package/lib/module/renderer/components/Compose.js +5 -2
- package/lib/module/renderer/components/Compose.js.map +1 -1
- package/lib/module/renderer/components/Group.js +7 -6
- package/lib/module/renderer/components/Group.js.map +1 -1
- package/lib/module/renderer/components/Mask.js +7 -3
- package/lib/module/renderer/components/Mask.js.map +1 -1
- package/lib/module/renderer/components/Paint.js +6 -3
- 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/BackdropFilter.js +1 -1
- package/lib/module/renderer/components/backdrop/BackdropFilter.js.map +1 -1
- package/lib/module/renderer/components/colorFilters/BlendColor.js +6 -3
- package/lib/module/renderer/components/colorFilters/BlendColor.js.map +1 -1
- package/lib/module/renderer/components/colorFilters/Compose.js +2 -2
- package/lib/module/renderer/components/colorFilters/Compose.js.map +1 -1
- package/lib/module/renderer/components/colorFilters/Lerp.js +6 -3
- package/lib/module/renderer/components/colorFilters/Lerp.js.map +1 -1
- package/lib/module/renderer/components/colorFilters/LinearToSRGBGamma.js +5 -3
- package/lib/module/renderer/components/colorFilters/LinearToSRGBGamma.js.map +1 -1
- package/lib/module/renderer/components/colorFilters/LumaColorFilter.js +5 -3
- package/lib/module/renderer/components/colorFilters/LumaColorFilter.js.map +1 -1
- package/lib/module/renderer/components/colorFilters/Matrix.js +5 -3
- package/lib/module/renderer/components/colorFilters/Matrix.js.map +1 -1
- package/lib/module/renderer/components/colorFilters/SRGBToLinearGamma.js +5 -3
- package/lib/module/renderer/components/colorFilters/SRGBToLinearGamma.js.map +1 -1
- package/lib/module/renderer/components/image/BoxFit.js +7 -8
- package/lib/module/renderer/components/image/BoxFit.js.map +1 -1
- package/lib/module/renderer/components/image/Image.js +3 -2
- package/lib/module/renderer/components/image/Image.js.map +1 -1
- package/lib/module/renderer/components/image/ImageSVG.js +3 -2
- package/lib/module/renderer/components/image/ImageSVG.js.map +1 -1
- package/lib/module/renderer/components/image/ImageShader.js +10 -7
- package/lib/module/renderer/components/image/ImageShader.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/Blur.js +7 -4
- package/lib/module/renderer/components/imageFilters/Blur.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/DisplacementMap.js +7 -4
- package/lib/module/renderer/components/imageFilters/DisplacementMap.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/InnerShadow.js +3 -3
- package/lib/module/renderer/components/imageFilters/InnerShadow.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/Morphology.js +6 -4
- package/lib/module/renderer/components/imageFilters/Morphology.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/Offset.js +5 -3
- package/lib/module/renderer/components/imageFilters/Offset.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/RuntimeShader.js +13 -4
- package/lib/module/renderer/components/imageFilters/RuntimeShader.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/Shadow.js +6 -5
- package/lib/module/renderer/components/imageFilters/Shadow.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/getInput.js +2 -2
- package/lib/module/renderer/components/imageFilters/getInput.js.map +1 -1
- package/lib/module/renderer/components/maskFilters/Blur.js +5 -2
- package/lib/module/renderer/components/maskFilters/Blur.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/Corner.js +5 -2
- package/lib/module/renderer/components/pathEffects/Corner.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/Dash.js +5 -2
- package/lib/module/renderer/components/pathEffects/Dash.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/Discrete.js +5 -2
- package/lib/module/renderer/components/pathEffects/Discrete.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/Line2D.js +5 -2
- package/lib/module/renderer/components/pathEffects/Line2D.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/Path1D.js +6 -3
- package/lib/module/renderer/components/pathEffects/Path1D.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/Path2D.js +6 -3
- package/lib/module/renderer/components/pathEffects/Path2D.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/Sum.js +5 -2
- package/lib/module/renderer/components/pathEffects/Sum.js.map +1 -1
- package/lib/module/renderer/components/shaders/Color.js +6 -3
- package/lib/module/renderer/components/shaders/Color.js.map +1 -1
- package/lib/module/renderer/components/shaders/FractalNoise.js +4 -2
- package/lib/module/renderer/components/shaders/FractalNoise.js.map +1 -1
- package/lib/module/renderer/components/shaders/Gradient.js +3 -3
- package/lib/module/renderer/components/shaders/Gradient.js.map +1 -1
- package/lib/module/renderer/components/shaders/LinearGradient.js +5 -3
- package/lib/module/renderer/components/shaders/LinearGradient.js.map +1 -1
- package/lib/module/renderer/components/shaders/RadialGradient.js +5 -3
- package/lib/module/renderer/components/shaders/RadialGradient.js.map +1 -1
- package/lib/module/renderer/components/shaders/Shader.js +6 -44
- package/lib/module/renderer/components/shaders/Shader.js.map +1 -1
- package/lib/module/renderer/components/shaders/SweepGradient.js +5 -3
- package/lib/module/renderer/components/shaders/SweepGradient.js.map +1 -1
- package/lib/module/renderer/components/shaders/Turbulence.js +4 -2
- package/lib/module/renderer/components/shaders/Turbulence.js.map +1 -1
- package/lib/module/renderer/components/shaders/TwoPointConicalGradient.js +5 -3
- package/lib/module/renderer/components/shaders/TwoPointConicalGradient.js.map +1 -1
- package/lib/module/renderer/components/shapes/Box.js +20 -19
- package/lib/module/renderer/components/shapes/Box.js.map +1 -1
- package/lib/module/renderer/components/shapes/Circle.js +7 -4
- 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/FitBox.js.map +1 -1
- package/lib/module/renderer/components/shapes/Line.js.map +1 -1
- package/lib/module/renderer/components/shapes/Oval.js +3 -2
- package/lib/module/renderer/components/shapes/Oval.js.map +1 -1
- package/lib/module/renderer/components/shapes/Patch.js +5 -3
- package/lib/module/renderer/components/shapes/Patch.js.map +1 -1
- package/lib/module/renderer/components/shapes/Path.js +4 -3
- package/lib/module/renderer/components/shapes/Path.js.map +1 -1
- package/lib/module/renderer/components/shapes/Points.js +1 -1
- package/lib/module/renderer/components/shapes/Points.js.map +1 -1
- package/lib/module/renderer/components/shapes/Rect.js +3 -2
- package/lib/module/renderer/components/shapes/Rect.js.map +1 -1
- package/lib/module/renderer/components/shapes/RoundedRect.js +3 -2
- package/lib/module/renderer/components/shapes/RoundedRect.js.map +1 -1
- package/lib/module/renderer/components/shapes/Vertices.js +5 -3
- package/lib/module/renderer/components/shapes/Vertices.js.map +1 -1
- package/lib/module/renderer/components/text/Glyphs.js +3 -2
- package/lib/module/renderer/components/text/Glyphs.js.map +1 -1
- package/lib/module/renderer/components/text/Text.js +3 -2
- 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 +3 -3
- package/lib/module/renderer/components/text/TextPath.js.map +1 -1
- package/lib/module/renderer/index.js +1 -1
- package/lib/module/renderer/index.js.map +1 -1
- package/lib/module/renderer/nodes/Declaration.js.map +1 -1
- package/lib/module/renderer/nodes/Drawing.js +3 -3
- package/lib/module/renderer/nodes/Drawing.js.map +1 -1
- package/lib/module/renderer/nodes/Node.js.map +1 -1
- package/lib/module/renderer/processors/Animations/Animations.js.map +1 -1
- package/lib/module/renderer/processors/Circles.js +2 -4
- package/lib/module/renderer/processors/Circles.js.map +1 -1
- package/lib/module/renderer/processors/Clips.js +3 -3
- package/lib/module/renderer/processors/Clips.js.map +1 -1
- package/lib/module/{skia/core → renderer/processors}/Color.js +1 -2
- package/lib/module/renderer/processors/Color.js.map +1 -0
- package/lib/module/renderer/processors/Font.js +3 -2
- package/lib/module/renderer/processors/Font.js.map +1 -1
- package/lib/module/renderer/processors/Paint.js +8 -5
- package/lib/module/renderer/processors/Paint.js.map +1 -1
- package/lib/module/renderer/processors/Paths.js +2 -2
- package/lib/module/renderer/processors/Paths.js.map +1 -1
- package/lib/module/renderer/processors/Radius.js +2 -3
- package/lib/module/renderer/processors/Radius.js.map +1 -1
- package/lib/module/renderer/processors/Rects.js +7 -26
- package/lib/module/renderer/processors/Rects.js.map +1 -1
- package/lib/module/renderer/processors/Transform.js +24 -16
- package/lib/module/renderer/processors/Transform.js.map +1 -1
- package/lib/module/renderer/processors/index.js +2 -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/Transforms.js.map +1 -1
- package/lib/module/renderer/processors/math/index.js +0 -2
- package/lib/module/renderer/processors/math/index.js.map +1 -1
- package/lib/module/renderer/useCanvas.js +13 -0
- package/lib/module/renderer/useCanvas.js.map +1 -0
- package/lib/module/skia/NativeSetup.js +2 -2
- package/lib/module/skia/NativeSetup.js.map +1 -1
- package/lib/module/skia/Skia.web.js +3 -0
- package/lib/module/skia/Skia.web.js.map +1 -0
- package/lib/module/skia/core/Data.js +11 -5
- package/lib/module/skia/core/Data.js.map +1 -1
- package/lib/module/skia/core/Font.js +2 -4
- package/lib/module/skia/core/Font.js.map +1 -1
- package/lib/module/skia/core/Matrix.js +4 -0
- package/lib/module/skia/core/Matrix.js.map +1 -0
- package/lib/module/skia/core/Paint.js +3 -7
- package/lib/module/skia/core/Paint.js.map +1 -1
- package/lib/module/skia/core/Path.js +11 -2
- package/lib/module/skia/core/Path.js.map +1 -1
- package/lib/module/skia/core/RRect.js +3 -0
- package/lib/module/skia/core/RRect.js.map +1 -0
- package/lib/module/skia/core/Rect.js +17 -0
- package/lib/module/skia/core/Rect.js.map +1 -0
- package/lib/module/{renderer/processors/math → skia/core}/Vector.js +2 -7
- package/lib/module/skia/core/Vector.js.map +1 -0
- package/lib/module/skia/core/index.js +5 -3
- package/lib/module/skia/core/index.js.map +1 -1
- package/lib/module/skia/types/Image/ImageFactory.js.map +1 -1
- package/lib/module/skia/types/Matrix.js +55 -0
- package/lib/module/skia/types/Matrix.js.map +1 -1
- package/lib/module/skia/types/Path/Path.js +1 -0
- package/lib/module/skia/types/Path/Path.js.map +1 -1
- package/lib/module/skia/types/Point.js.map +1 -1
- package/lib/module/skia/types/RRect.js +3 -1
- package/lib/module/skia/types/RRect.js.map +1 -1
- package/lib/module/skia/types/Shader/Shader.js +48 -0
- package/lib/module/skia/types/Shader/Shader.js.map +1 -1
- package/lib/module/skia/web/{api/Host.js → Host.js} +6 -0
- package/lib/module/skia/web/Host.js.map +1 -0
- package/lib/module/skia/web/JsiImageFilterFactory.js +57 -0
- package/lib/module/skia/web/JsiImageFilterFactory.js.map +1 -0
- package/lib/module/skia/web/{api/JsiSkCanvas.js → JsiSkCanvas.js} +19 -6
- package/lib/module/skia/web/JsiSkCanvas.js.map +1 -0
- package/lib/module/skia/web/{api/JsiSkColor.js → JsiSkColor.js} +164 -4
- package/lib/module/skia/web/JsiSkColor.js.map +1 -0
- package/lib/module/skia/web/{api/JsiSkColorFilter.js → JsiSkColorFilter.js} +0 -0
- package/lib/module/skia/web/{api/JsiSkColorFilter.js.map → JsiSkColorFilter.js.map} +1 -1
- package/lib/module/skia/web/JsiSkColorFilterFactory.js +37 -0
- package/lib/module/skia/web/JsiSkColorFilterFactory.js.map +1 -0
- package/lib/module/skia/web/JsiSkContourMeasure.js +31 -0
- package/lib/module/skia/web/JsiSkContourMeasure.js.map +1 -0
- package/lib/module/skia/web/JsiSkContourMeasureIter.js +19 -0
- package/lib/module/skia/web/JsiSkContourMeasureIter.js.map +1 -0
- package/lib/module/skia/web/JsiSkData.js +8 -0
- package/lib/module/skia/web/JsiSkData.js.map +1 -0
- package/lib/module/skia/web/JsiSkDataFactory.js +33 -0
- package/lib/module/skia/web/JsiSkDataFactory.js.map +1 -0
- package/lib/module/skia/web/JsiSkFont.js +99 -0
- package/lib/module/skia/web/JsiSkFont.js.map +1 -0
- package/lib/module/skia/web/JsiSkFontMgr.js +25 -0
- package/lib/module/skia/web/JsiSkFontMgr.js.map +1 -0
- package/lib/module/skia/web/JsiSkFontMgrFactory.js +14 -0
- package/lib/module/skia/web/JsiSkFontMgrFactory.js.map +1 -0
- package/lib/module/skia/web/{api/JsiSkImage.js → JsiSkImage.js} +0 -0
- package/lib/module/skia/web/{api/JsiSkImage.js.map → JsiSkImage.js.map} +1 -1
- package/lib/module/skia/web/JsiSkImageFactory.js +36 -0
- package/lib/module/skia/web/JsiSkImageFactory.js.map +1 -0
- package/lib/module/skia/web/JsiSkImageFilter.js +8 -0
- package/lib/module/skia/web/JsiSkImageFilter.js.map +1 -0
- package/lib/module/skia/web/JsiSkMaskFilter.js +8 -0
- package/lib/module/skia/web/JsiSkMaskFilter.js.map +1 -0
- package/lib/module/skia/web/JsiSkMaskFilterFactory.js +13 -0
- package/lib/module/skia/web/JsiSkMaskFilterFactory.js.map +1 -0
- package/lib/module/skia/web/JsiSkMatrix.js +28 -0
- package/lib/module/skia/web/JsiSkMatrix.js.map +1 -0
- package/lib/module/skia/web/{api/JsiSkPaint.js → JsiSkPaint.js} +5 -10
- package/lib/module/skia/web/JsiSkPaint.js.map +1 -0
- package/lib/module/skia/web/JsiSkPath.js +311 -0
- package/lib/module/skia/web/JsiSkPath.js.map +1 -0
- package/lib/module/skia/web/JsiSkPathEffect.js +8 -0
- package/lib/module/skia/web/JsiSkPathEffect.js.map +1 -0
- package/lib/module/skia/web/JsiSkPathEffectFactory.js +67 -0
- package/lib/module/skia/web/JsiSkPathEffectFactory.js.map +1 -0
- package/lib/module/skia/web/JsiSkPathFactory.js +47 -0
- package/lib/module/skia/web/JsiSkPathFactory.js.map +1 -0
- package/lib/module/skia/web/JsiSkPicture.js +18 -0
- package/lib/module/skia/web/JsiSkPicture.js.map +1 -0
- package/lib/module/skia/web/JsiSkPictureFactory.js +19 -0
- package/lib/module/skia/web/JsiSkPictureFactory.js.map +1 -0
- package/lib/module/skia/web/JsiSkPictureRecorder.js +18 -0
- package/lib/module/skia/web/JsiSkPictureRecorder.js.map +1 -0
- package/lib/module/skia/web/JsiSkPoint.js +16 -0
- package/lib/module/skia/web/JsiSkPoint.js.map +1 -0
- package/lib/module/skia/web/JsiSkRRect.js +21 -0
- package/lib/module/skia/web/JsiSkRRect.js.map +1 -0
- package/lib/module/skia/web/JsiSkRSXform.js +8 -0
- package/lib/module/skia/web/JsiSkRSXform.js.map +1 -0
- package/lib/module/skia/web/{api/JsiSkRect.js → JsiSkRect.js} +8 -0
- package/lib/module/skia/web/JsiSkRect.js.map +1 -0
- package/lib/module/skia/web/JsiSkRuntimeEffect.js +33 -0
- package/lib/module/skia/web/JsiSkRuntimeEffect.js.map +1 -0
- package/lib/module/skia/web/JsiSkRuntimeEffectFactory.js +19 -0
- package/lib/module/skia/web/JsiSkRuntimeEffectFactory.js.map +1 -0
- package/lib/module/skia/web/JsiSkSVGFactory.js +16 -0
- package/lib/module/skia/web/JsiSkSVGFactory.js.map +1 -0
- package/lib/module/skia/web/JsiSkShader.js +8 -0
- package/lib/module/skia/web/JsiSkShader.js.map +1 -0
- package/lib/module/skia/web/JsiSkShaderFactory.js +41 -0
- package/lib/module/skia/web/JsiSkShaderFactory.js.map +1 -0
- package/lib/module/skia/web/{api/JsiSkSurface.js → JsiSkSurface.js} +0 -0
- package/lib/module/skia/web/{api/JsiSkSurface.js.map → JsiSkSurface.js.map} +1 -1
- package/lib/module/skia/web/{api/JsiSkSurfaceFactory.js → JsiSkSurfaceFactory.js} +0 -0
- package/lib/module/skia/web/{api/JsiSkSurfaceFactory.js.map → JsiSkSurfaceFactory.js.map} +1 -1
- package/lib/module/skia/web/JsiSkTextBlob.js +8 -0
- package/lib/module/skia/web/JsiSkTextBlob.js.map +1 -0
- package/lib/module/skia/web/JsiSkTextBlobFactory.js +25 -0
- package/lib/module/skia/web/JsiSkTextBlobFactory.js.map +1 -0
- package/lib/module/skia/web/JsiSkTypeface.js +18 -0
- package/lib/module/skia/web/JsiSkTypeface.js.map +1 -0
- package/lib/module/skia/web/JsiSkTypefaceFactory.js +19 -0
- package/lib/module/skia/web/JsiSkTypefaceFactory.js.map +1 -0
- package/lib/module/skia/web/JsiSkVertices.js +17 -0
- package/lib/module/skia/web/JsiSkVertices.js.map +1 -0
- package/lib/module/skia/web/JsiSkVerticesFactory.js +16 -0
- package/lib/module/skia/web/JsiSkVerticesFactory.js.map +1 -0
- package/lib/module/skia/web/JsiSkia.js +61 -0
- package/lib/module/skia/web/JsiSkia.js.map +1 -0
- package/lib/module/skia/web/index.js +1 -1
- package/lib/module/skia/web/index.js.map +1 -1
- package/lib/module/values/web/api.js +2 -2
- package/lib/module/values/web/api.js.map +1 -1
- package/lib/module/views/SkiaView.web.js +202 -0
- package/lib/module/views/SkiaView.web.js.map +1 -0
- package/lib/module/views/types.js.map +1 -1
- package/lib/module/views/useTouchHandler.js +64 -43
- package/lib/module/views/useTouchHandler.js.map +1 -1
- package/lib/module/web/index.js +8 -0
- package/lib/module/web/index.js.map +1 -0
- package/lib/typescript/src/animation/functions/index.d.ts +4 -2
- package/lib/typescript/src/animation/functions/interpolatePaths.d.ts +17 -0
- package/lib/typescript/src/animation/functions/interpolateVector.d.ts +10 -0
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/renderer/Canvas.d.ts +3 -14
- package/lib/typescript/src/renderer/DrawingContext.d.ts +3 -3
- package/lib/typescript/src/renderer/components/Blend.d.ts +1 -1
- package/lib/typescript/src/renderer/components/Group.d.ts +1 -1
- package/lib/typescript/src/renderer/components/Paint.d.ts +1 -1
- package/lib/typescript/src/renderer/components/Picture.d.ts +1 -1
- package/lib/typescript/src/renderer/components/colorFilters/BlendColor.d.ts +2 -2
- package/lib/typescript/src/renderer/components/colorFilters/Compose.d.ts +2 -2
- package/lib/typescript/src/renderer/components/image/BoxFit.d.ts +13 -3
- package/lib/typescript/src/renderer/components/image/Image.d.ts +1 -1
- package/lib/typescript/src/renderer/components/image/ImageSVG.d.ts +1 -1
- package/lib/typescript/src/renderer/components/image/ImageShader.d.ts +2 -2
- package/lib/typescript/src/renderer/components/imageFilters/Blur.d.ts +1 -1
- package/lib/typescript/src/renderer/components/imageFilters/DisplacementMap.d.ts +1 -1
- package/lib/typescript/src/renderer/components/imageFilters/InnerShadow.d.ts +2 -2
- package/lib/typescript/src/renderer/components/imageFilters/RuntimeShader.d.ts +2 -1
- package/lib/typescript/src/renderer/components/imageFilters/Shadow.d.ts +1 -1
- package/lib/typescript/src/renderer/components/imageFilters/getInput.d.ts +2 -1
- package/lib/typescript/src/renderer/components/maskFilters/Blur.d.ts +1 -1
- package/lib/typescript/src/renderer/components/pathEffects/Line2D.d.ts +1 -1
- package/lib/typescript/src/renderer/components/pathEffects/Path1D.d.ts +1 -1
- package/lib/typescript/src/renderer/components/pathEffects/Path2D.d.ts +1 -1
- package/lib/typescript/src/renderer/components/shaders/Color.d.ts +1 -1
- package/lib/typescript/src/renderer/components/shaders/Gradient.d.ts +4 -4
- package/lib/typescript/src/renderer/components/shaders/LinearGradient.d.ts +2 -1
- package/lib/typescript/src/renderer/components/shaders/RadialGradient.d.ts +2 -1
- package/lib/typescript/src/renderer/components/shaders/Shader.d.ts +2 -8
- package/lib/typescript/src/renderer/components/shaders/SweepGradient.d.ts +2 -1
- package/lib/typescript/src/renderer/components/shaders/TwoPointConicalGradient.d.ts +2 -1
- package/lib/typescript/src/renderer/components/shapes/Box.d.ts +1 -1
- package/lib/typescript/src/renderer/components/shapes/Circle.d.ts +4 -1
- package/lib/typescript/src/renderer/components/shapes/DiffRect.d.ts +1 -1
- package/lib/typescript/src/renderer/components/shapes/FitBox.d.ts +1 -1
- package/lib/typescript/src/renderer/components/shapes/Line.d.ts +2 -1
- package/lib/typescript/src/renderer/components/shapes/Patch.d.ts +3 -3
- package/lib/typescript/src/renderer/components/shapes/Path.d.ts +1 -1
- package/lib/typescript/src/renderer/components/shapes/Points.d.ts +2 -2
- package/lib/typescript/src/renderer/components/shapes/Vertices.d.ts +2 -2
- package/lib/typescript/src/renderer/components/text/Glyphs.d.ts +1 -1
- package/lib/typescript/src/renderer/components/text/TextBlob.d.ts +1 -1
- package/lib/typescript/src/renderer/components/text/TextPath.d.ts +1 -1
- package/lib/typescript/src/renderer/index.d.ts +1 -1
- package/lib/typescript/src/renderer/nodes/Declaration.d.ts +1 -1
- package/lib/typescript/src/renderer/nodes/Node.d.ts +1 -1
- package/lib/typescript/src/renderer/processors/Animations/Animations.d.ts +0 -2
- package/lib/typescript/src/renderer/processors/Circles.d.ts +2 -2
- package/lib/typescript/src/renderer/processors/Clips.d.ts +2 -2
- package/lib/typescript/src/{skia/core → renderer/processors}/Color.d.ts +2 -2
- package/lib/typescript/src/renderer/processors/Font.d.ts +2 -2
- package/lib/typescript/src/renderer/processors/Paint.d.ts +3 -3
- package/lib/typescript/src/renderer/processors/Paths.d.ts +2 -2
- package/lib/typescript/src/renderer/processors/Radius.d.ts +2 -2
- package/lib/typescript/src/renderer/processors/Rects.d.ts +3 -14
- package/lib/typescript/src/renderer/processors/Transform.d.ts +3 -4
- package/lib/typescript/src/renderer/processors/index.d.ts +2 -1
- package/lib/typescript/src/renderer/processors/math/Coordinates.d.ts +1 -1
- package/lib/typescript/src/renderer/processors/math/Transforms.d.ts +1 -1
- package/lib/typescript/src/renderer/processors/math/index.d.ts +0 -2
- package/lib/typescript/src/renderer/useCanvas.d.ts +14 -0
- package/lib/typescript/src/skia/Skia.web.d.ts +1 -0
- package/lib/typescript/src/skia/core/Data.d.ts +4 -4
- package/lib/typescript/src/skia/core/Matrix.d.ts +2 -0
- package/lib/typescript/src/skia/core/Paint.d.ts +0 -1
- package/lib/typescript/src/skia/core/RRect.d.ts +2 -0
- package/lib/typescript/src/skia/core/Rect.d.ts +8 -0
- package/lib/typescript/src/skia/core/Vector.d.ts +12 -0
- package/lib/typescript/src/skia/core/index.d.ts +5 -3
- package/lib/typescript/src/skia/types/ContourMeasure.d.ts +2 -4
- package/lib/typescript/src/skia/types/Data/Data.d.ts +1 -1
- package/lib/typescript/src/skia/types/Data/DataFactory.d.ts +4 -4
- package/lib/typescript/src/skia/types/FontMgr/FontMgr.d.ts +1 -1
- package/lib/typescript/src/skia/types/FontMgr/FontMgrFactory.d.ts +2 -2
- package/lib/typescript/src/skia/types/Image/ImageFactory.d.ts +3 -3
- package/lib/typescript/src/skia/types/Matrix.d.ts +15 -14
- package/lib/typescript/src/skia/types/Path/Path.d.ts +29 -23
- package/lib/typescript/src/skia/types/Path/PathFactory.d.ts +5 -0
- package/lib/typescript/src/skia/types/Picture/Picture.d.ts +2 -2
- package/lib/typescript/src/skia/types/Point.d.ts +1 -0
- package/lib/typescript/src/skia/types/RRect.d.ts +1 -0
- package/lib/typescript/src/skia/types/RuntimeEffect/RuntimeEffect.d.ts +3 -2
- package/lib/typescript/src/skia/types/SVG/SVGFactory.d.ts +2 -2
- package/lib/typescript/src/skia/types/Shader/Shader.d.ts +8 -0
- package/lib/typescript/src/skia/types/Skia.d.ts +1 -1
- package/lib/typescript/src/skia/types/Typeface/TypefaceFactory.d.ts +2 -2
- package/lib/typescript/src/skia/web/{api/Host.d.ts → Host.d.ts} +4 -1
- package/lib/typescript/src/skia/web/JsiImageFilterFactory.d.ts +19 -0
- package/lib/typescript/src/skia/web/{api/JsiSkCanvas.d.ts → JsiSkCanvas.d.ts} +1 -1
- package/lib/typescript/src/skia/web/JsiSkColor.d.ts +2 -0
- package/lib/typescript/src/skia/web/{api/JsiSkColorFilter.d.ts → JsiSkColorFilter.d.ts} +1 -1
- package/lib/typescript/src/skia/web/JsiSkColorFilterFactory.d.ts +14 -0
- package/lib/typescript/src/skia/web/JsiSkContourMeasure.d.ts +16 -0
- package/lib/typescript/src/skia/web/JsiSkContourMeasureIter.d.ts +8 -0
- package/lib/typescript/src/skia/web/JsiSkData.d.ts +8 -0
- package/lib/typescript/src/skia/web/JsiSkDataFactory.d.ts +19 -0
- package/lib/typescript/src/skia/web/JsiSkFont.d.ts +33 -0
- package/lib/typescript/src/skia/web/JsiSkFontMgr.d.ts +9 -0
- package/lib/typescript/src/skia/web/JsiSkFontMgrFactory.d.ts +8 -0
- package/lib/typescript/src/skia/web/{api/JsiSkImage.d.ts → JsiSkImage.d.ts} +1 -1
- package/lib/typescript/src/skia/web/JsiSkImageFactory.d.ts +10 -0
- package/lib/typescript/src/skia/web/JsiSkImageFilter.d.ts +6 -0
- package/lib/typescript/src/skia/web/JsiSkMaskFilter.d.ts +6 -0
- package/lib/typescript/src/skia/web/JsiSkMaskFilterFactory.d.ts +9 -0
- package/lib/typescript/src/skia/web/JsiSkMatrix.d.ts +11 -0
- package/lib/typescript/src/skia/web/{api/JsiSkPaint.d.ts → JsiSkPaint.d.ts} +1 -1
- package/lib/typescript/src/skia/web/JsiSkPath.d.ts +56 -0
- package/lib/typescript/src/skia/web/JsiSkPathEffect.d.ts +6 -0
- package/lib/typescript/src/skia/web/JsiSkPathEffectFactory.d.ts +15 -0
- package/lib/typescript/src/skia/web/JsiSkPathFactory.d.ts +13 -0
- package/lib/typescript/src/skia/web/JsiSkPicture.d.ts +9 -0
- package/lib/typescript/src/skia/web/JsiSkPictureFactory.d.ts +8 -0
- package/lib/typescript/src/skia/web/JsiSkPictureRecorder.d.ts +11 -0
- package/lib/typescript/src/skia/web/JsiSkPoint.d.ts +8 -0
- package/lib/typescript/src/skia/web/JsiSkRRect.d.ts +10 -0
- package/lib/typescript/src/skia/web/JsiSkRSXform.d.ts +8 -0
- package/lib/typescript/src/skia/web/{api/JsiSkRect.d.ts → JsiSkRect.d.ts} +2 -1
- package/lib/typescript/src/skia/web/JsiSkRuntimeEffect.d.ts +14 -0
- package/lib/typescript/src/skia/web/JsiSkRuntimeEffectFactory.d.ts +8 -0
- package/lib/typescript/src/skia/web/JsiSkSVGFactory.d.ts +9 -0
- package/lib/typescript/src/skia/web/JsiSkShader.d.ts +6 -0
- package/lib/typescript/src/skia/web/JsiSkShaderFactory.d.ts +16 -0
- package/lib/typescript/src/skia/web/{api/JsiSkSurface.d.ts → JsiSkSurface.d.ts} +1 -1
- package/lib/typescript/src/skia/web/{api/JsiSkSurfaceFactory.d.ts → JsiSkSurfaceFactory.d.ts} +1 -1
- package/lib/typescript/src/skia/web/JsiSkTextBlob.d.ts +6 -0
- package/lib/typescript/src/skia/web/JsiSkTextBlobFactory.d.ts +12 -0
- package/lib/typescript/src/skia/web/JsiSkTypeface.d.ts +8 -0
- package/lib/typescript/src/skia/web/JsiSkTypefaceFactory.d.ts +8 -0
- package/lib/typescript/src/skia/web/JsiSkVertices.d.ts +9 -0
- package/lib/typescript/src/skia/web/JsiSkVerticesFactory.d.ts +4 -0
- package/lib/typescript/src/skia/web/JsiSkia.d.ts +3 -0
- package/lib/typescript/src/skia/web/index.d.ts +1 -1
- package/lib/typescript/src/views/SkiaView.web.d.ts +56 -0
- package/lib/typescript/src/views/types.d.ts +1 -0
- package/lib/typescript/src/views/useTouchHandler.d.ts +11 -1
- package/lib/typescript/src/web/index.d.ts +5 -0
- package/package.json +4 -5
- package/src/animation/functions/index.ts +4 -2
- package/src/animation/functions/interpolatePaths.ts +38 -0
- package/src/animation/functions/interpolateVector.ts +26 -0
- package/src/index.ts +1 -0
- package/src/renderer/Canvas.tsx +13 -35
- package/src/renderer/DrawingContext.ts +3 -4
- package/src/renderer/HostConfig.ts +2 -2
- package/src/renderer/components/Blend.tsx +12 -10
- package/src/renderer/components/Compose.tsx +2 -2
- package/src/renderer/components/Group.tsx +11 -6
- package/src/renderer/components/Mask.tsx +5 -3
- package/src/renderer/components/Paint.tsx +5 -4
- package/src/renderer/components/Picture.tsx +1 -1
- package/src/renderer/components/backdrop/BackdropFilter.tsx +1 -1
- package/src/renderer/components/colorFilters/BlendColor.tsx +4 -4
- package/src/renderer/components/colorFilters/Compose.ts +3 -2
- package/src/renderer/components/colorFilters/Lerp.tsx +3 -2
- package/src/renderer/components/colorFilters/LinearToSRGBGamma.tsx +2 -3
- package/src/renderer/components/colorFilters/LumaColorFilter.tsx +2 -3
- package/src/renderer/components/colorFilters/Matrix.tsx +2 -3
- package/src/renderer/components/colorFilters/SRGBToLinearGamma.tsx +2 -3
- package/src/renderer/components/image/BoxFit.ts +7 -13
- package/src/renderer/components/image/Image.tsx +3 -3
- package/src/renderer/components/image/ImageSVG.tsx +3 -3
- package/src/renderer/components/image/ImageShader.tsx +8 -7
- package/src/renderer/components/imageFilters/Blur.tsx +12 -10
- package/src/renderer/components/imageFilters/DisplacementMap.tsx +4 -4
- package/src/renderer/components/imageFilters/InnerShadow.tsx +4 -3
- package/src/renderer/components/imageFilters/Morphology.tsx +3 -4
- package/src/renderer/components/imageFilters/Offset.tsx +5 -4
- package/src/renderer/components/imageFilters/RuntimeShader.tsx +12 -4
- package/src/renderer/components/imageFilters/Shadow.tsx +10 -6
- package/src/renderer/components/imageFilters/getInput.ts +3 -2
- package/src/renderer/components/maskFilters/Blur.tsx +2 -2
- package/src/renderer/components/pathEffects/Corner.tsx +2 -2
- package/src/renderer/components/pathEffects/Dash.tsx +2 -2
- package/src/renderer/components/pathEffects/Discrete.tsx +2 -2
- package/src/renderer/components/pathEffects/Line2D.tsx +3 -3
- package/src/renderer/components/pathEffects/Path1D.tsx +3 -3
- package/src/renderer/components/pathEffects/Path2D.tsx +4 -4
- package/src/renderer/components/pathEffects/Sum.tsx +7 -5
- package/src/renderer/components/shaders/Color.tsx +7 -5
- package/src/renderer/components/shaders/FractalNoise.tsx +1 -2
- package/src/renderer/components/shaders/Gradient.ts +7 -10
- package/src/renderer/components/shaders/LinearGradient.tsx +4 -4
- package/src/renderer/components/shaders/RadialGradient.tsx +4 -4
- package/src/renderer/components/shaders/Shader.tsx +6 -56
- package/src/renderer/components/shaders/SweepGradient.tsx +4 -4
- package/src/renderer/components/shaders/Turbulence.tsx +1 -2
- package/src/renderer/components/shaders/TwoPointConicalGradient.tsx +4 -4
- package/src/renderer/components/shapes/Box.tsx +36 -17
- package/src/renderer/components/shapes/Circle.tsx +3 -4
- package/src/renderer/components/shapes/DiffRect.tsx +1 -1
- package/src/renderer/components/shapes/FitBox.tsx +1 -1
- package/src/renderer/components/shapes/Line.tsx +2 -1
- package/src/renderer/components/shapes/Oval.tsx +6 -4
- package/src/renderer/components/shapes/Patch.tsx +6 -10
- package/src/renderer/components/shapes/Path.tsx +3 -3
- package/src/renderer/components/shapes/Points.tsx +2 -2
- package/src/renderer/components/shapes/Rect.tsx +6 -4
- package/src/renderer/components/shapes/RoundedRect.tsx +2 -2
- package/src/renderer/components/shapes/Vertices.tsx +5 -4
- package/src/renderer/components/text/Glyphs.tsx +6 -3
- package/src/renderer/components/text/Text.tsx +2 -2
- package/src/renderer/components/text/TextBlob.tsx +1 -1
- package/src/renderer/components/text/TextPath.tsx +3 -4
- package/src/renderer/index.ts +1 -1
- package/src/renderer/nodes/Declaration.tsx +1 -1
- package/src/renderer/nodes/Drawing.tsx +3 -2
- package/src/renderer/nodes/Node.ts +1 -1
- package/src/renderer/processors/Animations/Animations.ts +0 -3
- package/src/renderer/processors/Circles.ts +4 -4
- package/src/renderer/processors/Clips.ts +9 -4
- package/src/{skia/core → renderer/processors}/Color.ts +2 -3
- package/src/renderer/processors/Font.ts +10 -3
- package/src/renderer/processors/Paint.ts +12 -7
- package/src/renderer/processors/Paths.ts +3 -3
- package/src/renderer/processors/Radius.ts +3 -4
- package/src/renderer/processors/Rects.ts +10 -45
- package/src/renderer/processors/Transform.ts +28 -19
- package/src/renderer/processors/index.ts +2 -1
- package/src/renderer/processors/math/Coordinates.ts +1 -1
- package/src/renderer/processors/math/Transforms.ts +2 -1
- package/src/renderer/processors/math/index.ts +0 -2
- package/src/renderer/useCanvas.ts +21 -0
- package/src/skia/NativeSetup.ts +2 -2
- package/src/skia/Skia.web.ts +3 -0
- package/src/skia/core/Data.ts +17 -14
- package/src/skia/core/Font.ts +2 -4
- package/src/skia/core/Matrix.ts +6 -0
- package/src/skia/core/Paint.ts +2 -6
- package/src/skia/core/Path.ts +14 -6
- package/src/skia/core/RRect.tsx +5 -0
- package/src/skia/core/Rect.ts +33 -0
- package/src/skia/core/Vector.ts +11 -0
- package/src/skia/core/index.ts +5 -3
- package/src/skia/types/ContourMeasure.tsx +2 -4
- package/src/skia/types/Data/Data.ts +1 -1
- package/src/skia/types/Data/DataFactory.ts +4 -4
- package/src/skia/types/FontMgr/FontMgr.ts +1 -1
- package/src/skia/types/FontMgr/FontMgrFactory.ts +2 -2
- package/src/skia/types/Image/ImageFactory.ts +3 -3
- package/src/skia/types/Matrix.ts +79 -14
- package/src/skia/types/Path/Path.ts +34 -23
- package/src/skia/types/Path/PathFactory.ts +7 -0
- package/src/skia/types/Picture/Picture.ts +2 -2
- package/src/skia/types/Point.ts +2 -0
- package/src/skia/types/RRect.ts +5 -0
- package/src/skia/types/RuntimeEffect/RuntimeEffect.ts +4 -2
- package/src/skia/types/SVG/SVGFactory.ts +2 -2
- package/src/skia/types/Shader/Shader.ts +61 -0
- package/src/skia/types/Skia.ts +1 -1
- package/src/skia/types/Typeface/TypefaceFactory.ts +2 -2
- package/src/skia/web/{api/Host.ts → Host.ts} +7 -1
- package/src/skia/web/JsiImageFilterFactory.ts +144 -0
- package/src/skia/web/{api/JsiSkCanvas.ts → JsiSkCanvas.ts} +19 -11
- package/src/skia/web/{api/JsiSkColor.ts → JsiSkColor.ts} +152 -6
- package/src/skia/web/{api/JsiSkColorFilter.ts → JsiSkColorFilter.ts} +1 -1
- package/src/skia/web/JsiSkColorFilterFactory.ts +67 -0
- package/src/skia/web/JsiSkContourMeasure.ts +35 -0
- package/src/skia/web/JsiSkContourMeasureIter.ts +23 -0
- package/src/skia/web/JsiSkData.ts +13 -0
- package/src/skia/web/JsiSkDataFactory.ts +35 -0
- package/src/skia/web/JsiSkFont.ts +124 -0
- package/src/skia/web/JsiSkFontMgr.ts +42 -0
- package/src/skia/web/JsiSkFontMgrFactory.ts +18 -0
- package/src/skia/web/{api/JsiSkImage.ts → JsiSkImage.ts} +1 -1
- package/src/skia/web/JsiSkImageFactory.ts +40 -0
- package/src/skia/web/JsiSkImageFilter.ts +14 -0
- package/src/skia/web/JsiSkMaskFilter.ts +14 -0
- package/src/skia/web/JsiSkMaskFilterFactory.ts +20 -0
- package/src/skia/web/JsiSkMatrix.ts +54 -0
- package/src/skia/web/{api/JsiSkPaint.ts → JsiSkPaint.ts} +6 -5
- package/src/skia/web/JsiSkPath.ts +369 -0
- package/src/skia/web/JsiSkPathEffect.ts +14 -0
- package/src/skia/web/JsiSkPathEffectFactory.ts +85 -0
- package/src/skia/web/JsiSkPathFactory.ts +54 -0
- package/src/skia/web/JsiSkPicture.ts +45 -0
- package/src/skia/web/JsiSkPictureFactory.ts +20 -0
- package/src/skia/web/JsiSkPictureRecorder.ts +31 -0
- package/src/skia/web/JsiSkPoint.ts +19 -0
- package/src/skia/web/JsiSkRRect.ts +27 -0
- package/src/skia/web/JsiSkRSXform.ts +16 -0
- package/src/skia/web/{api/JsiSkRect.ts → JsiSkRect.ts} +11 -1
- package/src/skia/web/JsiSkRuntimeEffect.ts +57 -0
- package/src/skia/web/JsiSkRuntimeEffectFactory.ts +23 -0
- package/src/skia/web/JsiSkSVGFactory.ts +20 -0
- package/src/skia/web/JsiSkShader.ts +14 -0
- package/src/skia/web/JsiSkShaderFactory.ts +178 -0
- package/src/skia/web/{api/JsiSkSurface.ts → JsiSkSurface.ts} +1 -1
- package/src/skia/web/{api/JsiSkSurfaceFactory.ts → JsiSkSurfaceFactory.ts} +1 -1
- package/src/skia/web/JsiSkTextBlob.ts +14 -0
- package/src/skia/web/JsiSkTextBlobFactory.ts +49 -0
- package/src/skia/web/JsiSkTypeface.ts +28 -0
- package/src/skia/web/JsiSkTypefaceFactory.tsx +20 -0
- package/src/skia/web/JsiSkVertices.ts +23 -0
- package/src/skia/web/JsiSkVerticesFactory.ts +27 -0
- package/src/skia/web/JsiSkia.ts +98 -0
- package/src/skia/web/index.ts +1 -1
- package/src/values/web/api.ts +2 -2
- package/src/views/SkiaView.web.tsx +192 -0
- package/src/views/types.ts +1 -0
- package/src/views/useTouchHandler.ts +82 -51
- package/src/web/index.ts +13 -0
- package/lib/commonjs/renderer/processors/math/Matrix3.js +0 -66
- package/lib/commonjs/renderer/processors/math/Matrix3.js.map +0 -1
- package/lib/commonjs/renderer/processors/math/Vector.js +0 -60
- package/lib/commonjs/renderer/processors/math/Vector.js.map +0 -1
- package/lib/commonjs/skia/core/Color.js.map +0 -1
- package/lib/commonjs/skia/core/Shader.js +0 -18
- package/lib/commonjs/skia/core/Shader.js.map +0 -1
- package/lib/commonjs/skia/web/api/Host.js.map +0 -1
- package/lib/commonjs/skia/web/api/JsiSkCanvas.js.map +0 -1
- package/lib/commonjs/skia/web/api/JsiSkColor.js.map +0 -1
- package/lib/commonjs/skia/web/api/JsiSkPaint.js.map +0 -1
- package/lib/commonjs/skia/web/api/JsiSkRect.js.map +0 -1
- package/lib/commonjs/skia/web/api/index.js +0 -26
- package/lib/commonjs/skia/web/api/index.js.map +0 -1
- package/lib/module/renderer/processors/math/Matrix3.js +0 -55
- package/lib/module/renderer/processors/math/Matrix3.js.map +0 -1
- package/lib/module/renderer/processors/math/Vector.js.map +0 -1
- package/lib/module/skia/core/Color.js.map +0 -1
- package/lib/module/skia/core/Shader.js +0 -7
- package/lib/module/skia/core/Shader.js.map +0 -1
- package/lib/module/skia/web/api/Host.js.map +0 -1
- package/lib/module/skia/web/api/JsiSkCanvas.js.map +0 -1
- package/lib/module/skia/web/api/JsiSkColor.js.map +0 -1
- package/lib/module/skia/web/api/JsiSkPaint.js.map +0 -1
- package/lib/module/skia/web/api/JsiSkRect.js.map +0 -1
- package/lib/module/skia/web/api/index.js +0 -13
- package/lib/module/skia/web/api/index.js.map +0 -1
- package/lib/typescript/src/renderer/processors/math/Matrix3.d.ts +0 -10
- package/lib/typescript/src/renderer/processors/math/Vector.d.ts +0 -23
- package/lib/typescript/src/skia/core/Shader.d.ts +0 -1
- package/lib/typescript/src/skia/web/api/JsiSkColor.d.ts +0 -3
- package/lib/typescript/src/skia/web/api/index.d.ts +0 -10
- package/src/animation/timing/functions/__tests__/timing.spec.ts +0 -29
- package/src/renderer/processors/math/Matrix3.ts +0 -73
- package/src/renderer/processors/math/Vector.ts +0 -38
- package/src/skia/__tests__/Rects.spec.ts +0 -40
- package/src/skia/__tests__/snapshots/lightblue-rect.png +0 -0
- package/src/skia/core/Shader.ts +0 -9
- package/src/skia/web/api/index.ts +0 -15
- package/src/values/web/__tests__/RNSkAnimation.spec.ts +0 -21
- package/src/values/web/__tests__/RNSkDerivedValue.spec.ts +0 -15
- package/src/values/web/__tests__/RNSkReadonlyValue.spec.ts +0 -8
- package/src/values/web/__tests__/RNSkValue.spec.ts +0 -11
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["Group.tsx"],"names":["isSkPaint","obj","__typename__","onDraw","ctx","node","layer","clip","invertClip","groupProps","canvas","opacity","declarations","children","filter","isDeclarationNode","map","child","draw","drawings","DrawingNode","paint","copy","hasTransform","transform","matrix","hasClip","shouldSave","saveLayer","current","undefined","save","op","ClipOp","Difference","Intersect","visit","restore","Group","props"],"mappings":";;;;;;;AAAA;;AAIA;;AACA;;
|
1
|
+
{"version":3,"sources":["Group.tsx"],"names":["isSkPaint","obj","__typename__","onDraw","ctx","node","layer","clip","invertClip","groupProps","canvas","opacity","Skia","declarations","children","filter","isDeclarationNode","map","child","draw","drawings","DrawingNode","paint","copy","hasTransform","transform","matrix","hasClip","shouldSave","saveLayer","current","undefined","save","op","ClipOp","Difference","Intersect","visit","restore","Group","props"],"mappings":";;;;;;;AAAA;;AAIA;;AACA;;AAWA;;AACA;;;;;;AAEA,MAAMA,SAAS,GAAIC,GAAD,IAChB,kBAAkBA,GAAlB,IAAyBA,GAAG,CAACC,YAAJ,KAAqB,OADhD;;AASA,MAAMC,MAAM,GAAG,0BACb,CAACC,GAAD,QAAkDC,IAAlD,KAA2D;AAAA,MAArD;AAAEC,IAAAA,KAAF;AAASC,IAAAA,IAAT;AAAeC,IAAAA,UAAf;AAA2B,OAAGC;AAA9B,GAAqD;AACzD,QAAM;AAAEC,IAAAA,MAAF;AAAUC,IAAAA,OAAV;AAAmBC,IAAAA;AAAnB,MAA4BR,GAAlC;AACA,QAAMS,YAAY,GAAGR,IAAI,CAACS,QAAL,CAClBC,MADkB,CACXC,8BADW,EAElBC,GAFkB,CAEbC,KAAD,IAAWA,KAAK,CAACC,IAAN,CAAWf,GAAX,CAFG,CAArB;AAIA,QAAMgB,QAAQ,GAAGf,IAAI,CAACS,QAAL,CAAcC,MAAd,CACdG,KAAD,IAAWA,KAAK,YAAYG,kBADb,CAAjB;AAGA,QAAMC,KAAK,GAAG,8BACZlB,GAAG,CAACQ,IADQ,EAEZR,GAAG,CAACkB,KAAJ,CAAUC,IAAV,EAFY,EAGZZ,OAHY,EAIZF,UAJY,EAKZI,YALY,CAAd;AAOA,QAAMW,YAAY,GAAG,CAAC,CAACf,UAAU,CAACgB,SAAb,IAA0B,CAAC,CAAChB,UAAU,CAACiB,MAA5D;AACA,QAAMC,OAAO,GAAG,CAAC,CAACpB,IAAlB;AACA,QAAMqB,UAAU,GAAGJ,YAAY,IAAIG,OAAhB,IAA2B,CAAC,CAACrB,KAAhD;;AACA,MAAIsB,UAAJ,EAAgB;AACd,QAAItB,KAAJ,EAAW;AACT,UAAI,OAAOA,KAAP,KAAiB,SAArB,EAAgC;AAC9BI,QAAAA,MAAM,CAACmB,SAAP;AACD,OAFD,MAEO,IAAI7B,SAAS,CAACM,KAAD,CAAb,EAAsB;AAC3BI,QAAAA,MAAM,CAACmB,SAAP,CAAiBvB,KAAjB;AACD,OAFM,MAEA;AAAA;;AACLI,QAAAA,MAAM,CAACmB,SAAP,mBAAiBvB,KAAK,CAACwB,OAAvB,2DAAkCC,SAAlC;AACD;AACF,KARD,MAQO;AACLrB,MAAAA,MAAM,CAACsB,IAAP;AACD;;AACD,4CAAuB5B,GAAvB,EAA4BK,UAA5B;;AACA,QAAIF,IAAJ,EAAU;AACR,YAAM0B,EAAE,GAAGzB,UAAU,GAAG0B,cAAOC,UAAV,GAAuBD,cAAOE,SAAnD;AACA,mCAAYxB,IAAZ,EAAkBF,MAAlB,EAA0BH,IAA1B,EAAgC0B,EAAhC;AACD;AACF;;AACD5B,EAAAA,IAAI,CAACgC,KAAL,CACE,EACE,GAAGjC,GADL;AAEEkB,IAAAA,KAFF;AAGEX,IAAAA,OAAO,EAAEF,UAAU,CAACE,OAAX,GAAqBF,UAAU,CAACE,OAAX,GAAqBA,OAA1C,GAAoDA;AAH/D,GADF,EAMES,QANF;;AAQA,MAAIQ,UAAJ,EAAgB;AACdlB,IAAAA,MAAM,CAAC4B,OAAP;AACD;AACF,CAjDY,CAAf;;AAoDO,MAAMC,KAAK,GAAIC,KAAD,IAAsC;AACzD,sBAAO;AAAW,IAAA,MAAM,EAAErC;AAAnB,KAA+BqC,KAA/B;AAAsC,IAAA,cAAc;AAApD,KAAP;AACD,CAFM","sourcesContent":["import React from \"react\";\nimport type { RefObject } from \"react\";\n\nimport type { SkPaint } from \"../../skia/types\";\nimport { ClipOp } from \"../../skia/types\";\nimport {\n processCanvasTransform,\n processPaint,\n processClip,\n} from \"../processors\";\nimport type {\n CustomPaintProps,\n TransformProps,\n AnimatedProps,\n ClipDef,\n} from \"../processors\";\nimport { createDrawing, DrawingNode } from \"../nodes\";\nimport { isDeclarationNode } from \"../nodes/Declaration\";\n\nconst isSkPaint = (obj: RefObject<SkPaint> | SkPaint): obj is SkPaint =>\n \"__typename__\" in obj && obj.__typename__ === \"Paint\";\n\nexport interface GroupProps extends CustomPaintProps, TransformProps {\n clip?: ClipDef;\n invertClip?: boolean;\n layer?: RefObject<SkPaint> | SkPaint | boolean;\n}\n\nconst onDraw = createDrawing<GroupProps>(\n (ctx, { layer, clip, invertClip, ...groupProps }, node) => {\n const { canvas, opacity, Skia } = ctx;\n const declarations = node.children\n .filter(isDeclarationNode)\n .map((child) => child.draw(ctx));\n\n const drawings = node.children.filter(\n (child) => child instanceof DrawingNode\n );\n const paint = processPaint(\n ctx.Skia,\n ctx.paint.copy(),\n opacity,\n groupProps,\n declarations\n );\n const hasTransform = !!groupProps.transform || !!groupProps.matrix;\n const hasClip = !!clip;\n const shouldSave = hasTransform || hasClip || !!layer;\n if (shouldSave) {\n if (layer) {\n if (typeof layer === \"boolean\") {\n canvas.saveLayer();\n } else if (isSkPaint(layer)) {\n canvas.saveLayer(layer);\n } else {\n canvas.saveLayer(layer.current ?? undefined);\n }\n } else {\n canvas.save();\n }\n processCanvasTransform(ctx, groupProps);\n if (clip) {\n const op = invertClip ? ClipOp.Difference : ClipOp.Intersect;\n processClip(Skia, canvas, clip, op);\n }\n }\n node.visit(\n {\n ...ctx,\n paint,\n opacity: groupProps.opacity ? groupProps.opacity * opacity : opacity,\n },\n drawings\n );\n if (shouldSave) {\n canvas.restore();\n }\n }\n);\n\nexport const Group = (props: AnimatedProps<GroupProps>) => {\n return <skDrawing onDraw={onDraw} {...props} skipProcessing />;\n};\n"]}
|
@@ -7,7 +7,9 @@ exports.Mask = void 0;
|
|
7
7
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
9
9
|
|
10
|
-
var
|
10
|
+
var _types = require("../../skia/types");
|
11
|
+
|
12
|
+
var _useCanvas = require("../useCanvas");
|
11
13
|
|
12
14
|
var _Group = require("./Group");
|
13
15
|
|
@@ -22,23 +24,24 @@ const Mask = _ref => {
|
|
22
24
|
mode,
|
23
25
|
clip
|
24
26
|
} = _ref;
|
27
|
+
const {
|
28
|
+
Skia
|
29
|
+
} = (0, _useCanvas.useCanvas)();
|
25
30
|
const maskPaint = (0, _react.useMemo)(() => {
|
26
|
-
const paint =
|
27
|
-
|
28
|
-
paint.setBlendMode(_skia.BlendMode.Src);
|
31
|
+
const paint = Skia.Paint();
|
32
|
+
paint.setBlendMode(_types.BlendMode.Src);
|
29
33
|
|
30
34
|
if (mode === "luminance") {
|
31
|
-
paint.setColorFilter(
|
35
|
+
paint.setColorFilter(Skia.ColorFilter.MakeLumaColorFilter());
|
32
36
|
}
|
33
37
|
|
34
38
|
return paint;
|
35
|
-
}, [mode]);
|
39
|
+
}, [Skia, mode]);
|
36
40
|
const clippingPaint = (0, _react.useMemo)(() => {
|
37
|
-
const paint =
|
38
|
-
|
39
|
-
paint.setBlendMode(_skia.BlendMode.DstIn);
|
41
|
+
const paint = Skia.Paint();
|
42
|
+
paint.setBlendMode(_types.BlendMode.DstIn);
|
40
43
|
return paint;
|
41
|
-
}, []);
|
44
|
+
}, [Skia]);
|
42
45
|
return /*#__PURE__*/_react.default.createElement(_Group.Group, {
|
43
46
|
layer: true
|
44
47
|
}, /*#__PURE__*/_react.default.createElement(_Group.Group, {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["Mask.tsx"],"names":["Mask","children","mask","mode","clip","
|
1
|
+
{"version":3,"sources":["Mask.tsx"],"names":["Mask","children","mask","mode","clip","Skia","maskPaint","paint","Paint","setBlendMode","BlendMode","Src","setColorFilter","ColorFilter","MakeLumaColorFilter","clippingPaint","DstIn","defaultProps"],"mappings":";;;;;;;AACA;;AAEA;;AACA;;AAEA;;;;;;AASO,MAAMA,IAAI,GAAG,QAA+C;AAAA,MAA9C;AAAEC,IAAAA,QAAF;AAAYC,IAAAA,IAAZ;AAAkBC,IAAAA,IAAlB;AAAwBC,IAAAA;AAAxB,GAA8C;AACjE,QAAM;AAAEC,IAAAA;AAAF,MAAW,2BAAjB;AACA,QAAMC,SAAS,GAAG,oBAAQ,MAAM;AAC9B,UAAMC,KAAK,GAAGF,IAAI,CAACG,KAAL,EAAd;AACAD,IAAAA,KAAK,CAACE,YAAN,CAAmBC,iBAAUC,GAA7B;;AACA,QAAIR,IAAI,KAAK,WAAb,EAA0B;AACxBI,MAAAA,KAAK,CAACK,cAAN,CAAqBP,IAAI,CAACQ,WAAL,CAAiBC,mBAAjB,EAArB;AACD;;AACD,WAAOP,KAAP;AACD,GAPiB,EAOf,CAACF,IAAD,EAAOF,IAAP,CAPe,CAAlB;AAQA,QAAMY,aAAa,GAAG,oBAAQ,MAAM;AAClC,UAAMR,KAAK,GAAGF,IAAI,CAACG,KAAL,EAAd;AACAD,IAAAA,KAAK,CAACE,YAAN,CAAmBC,iBAAUM,KAA7B;AACA,WAAOT,KAAP;AACD,GAJqB,EAInB,CAACF,IAAD,CAJmB,CAAtB;AAKA,sBACE,6BAAC,YAAD;AAAO,IAAA,KAAK;AAAZ,kBACE,6BAAC,YAAD;AAAO,IAAA,KAAK,EAAEC;AAAd,KACGJ,IADH,EAEGE,IAAI,iBAAI,6BAAC,YAAD;AAAO,IAAA,KAAK,EAAEW;AAAd,KAA8Bd,QAA9B,CAFX,CADF,eAKE,6BAAC,YAAD;AAAO,IAAA,SAAS,EAAC;AAAjB,KAA0BA,QAA1B,CALF,CADF;AASD,CAxBM;;;AA0BPD,IAAI,CAACiB,YAAL,GAAoB;AAClBd,EAAAA,IAAI,EAAE,OADY;AAElBC,EAAAA,IAAI,EAAE;AAFY,CAApB","sourcesContent":["import type { ReactNode } from \"react\";\nimport React, { useMemo } from \"react\";\n\nimport { BlendMode } from \"../../skia/types\";\nimport { useCanvas } from \"../useCanvas\";\n\nimport { Group } from \"./Group\";\n\ninterface MaskProps {\n mode: \"luminance\" | \"alpha\";\n clip: boolean;\n mask: ReactNode | ReactNode[];\n children: ReactNode | ReactNode[];\n}\n\nexport const Mask = ({ children, mask, mode, clip }: MaskProps) => {\n const { Skia } = useCanvas();\n const maskPaint = useMemo(() => {\n const paint = Skia.Paint();\n paint.setBlendMode(BlendMode.Src);\n if (mode === \"luminance\") {\n paint.setColorFilter(Skia.ColorFilter.MakeLumaColorFilter());\n }\n return paint;\n }, [Skia, mode]);\n const clippingPaint = useMemo(() => {\n const paint = Skia.Paint();\n paint.setBlendMode(BlendMode.DstIn);\n return paint;\n }, [Skia]);\n return (\n <Group layer>\n <Group layer={maskPaint}>\n {mask}\n {clip && <Group layer={clippingPaint}>{children}</Group>}\n </Group>\n <Group blendMode=\"srcIn\">{children}</Group>\n </Group>\n );\n};\n\nMask.defaultProps = {\n mode: \"alpha\",\n clip: true,\n};\n"]}
|
@@ -7,12 +7,12 @@ exports.usePaintRef = exports.Paint = void 0;
|
|
7
7
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
9
9
|
|
10
|
-
var _skia = require("../../skia");
|
11
|
-
|
12
10
|
var _processors = require("../processors");
|
13
11
|
|
14
12
|
var _nodes = require("../nodes");
|
15
13
|
|
14
|
+
var _useCanvas = require("../useCanvas");
|
15
|
+
|
16
16
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
17
17
|
|
18
18
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
@@ -23,9 +23,12 @@ const usePaintRef = () => (0, _react.useRef)(null);
|
|
23
23
|
|
24
24
|
exports.usePaintRef = usePaintRef;
|
25
25
|
const Paint = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
26
|
-
const
|
26
|
+
const {
|
27
|
+
Skia
|
28
|
+
} = (0, _useCanvas.useCanvas)();
|
29
|
+
const paint = (0, _react.useMemo)(() => Skia.Paint(), [Skia]);
|
27
30
|
(0, _react.useImperativeHandle)(ref, () => paint, [paint]);
|
28
|
-
const onDeclare = (0, _react.useMemo)(() => (0, _nodes.createDeclaration)((paintProps, children, ctx) => (0, _processors.processPaint)(paint, ctx.opacity, paintProps, children)), [paint]);
|
31
|
+
const onDeclare = (0, _react.useMemo)(() => (0, _nodes.createDeclaration)((paintProps, children, ctx) => (0, _processors.processPaint)(ctx.Skia, paint, ctx.opacity, paintProps, children)), [paint]);
|
29
32
|
return /*#__PURE__*/_react.default.createElement("skDeclaration", _extends({
|
30
33
|
onDeclare: onDeclare
|
31
34
|
}, props));
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["Paint.tsx"],"names":["usePaintRef","Paint","props","ref","paint","onDeclare","paintProps","children","ctx","opacity"],"mappings":";;;;;;;AACA;;
|
1
|
+
{"version":3,"sources":["Paint.tsx"],"names":["usePaintRef","Paint","props","ref","Skia","paint","onDeclare","paintProps","children","ctx","opacity"],"mappings":";;;;;;;AACA;;AAIA;;AACA;;AACA;;;;;;;;AAEO,MAAMA,WAAW,GAAG,MAAM,mBAAgB,IAAhB,CAA1B;;;AAMA,MAAMC,KAAK,gBAAG,uBACnB,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACd,QAAM;AAAEC,IAAAA;AAAF,MAAW,2BAAjB;AACA,QAAMC,KAAK,GAAG,oBAAQ,MAAMD,IAAI,CAACH,KAAL,EAAd,EAA4B,CAACG,IAAD,CAA5B,CAAd;AACA,kCAAoBD,GAApB,EAAyB,MAAME,KAA/B,EAAsC,CAACA,KAAD,CAAtC;AACA,QAAMC,SAAS,GAAG,oBAChB,MACE,8BAA8B,CAACC,UAAD,EAAaC,QAAb,EAAuBC,GAAvB,KAC5B,8BAAaA,GAAG,CAACL,IAAjB,EAAuBC,KAAvB,EAA8BI,GAAG,CAACC,OAAlC,EAA2CH,UAA3C,EAAuDC,QAAvD,CADF,CAFc,EAKhB,CAACH,KAAD,CALgB,CAAlB;AAOA,sBAAO;AAAe,IAAA,SAAS,EAAEC;AAA1B,KAAyCJ,KAAzC,EAAP;AACD,CAbkB,CAAd","sourcesContent":["import type { ReactNode } from \"react\";\nimport React, { useRef, useMemo, forwardRef, useImperativeHandle } from \"react\";\n\nimport type { SkPaint } from \"../../skia/types\";\nimport type { CustomPaintProps, AnimatedProps } from \"../processors\";\nimport { processPaint } from \"../processors\";\nimport { createDeclaration } from \"../nodes\";\nimport { useCanvas } from \"../useCanvas\";\n\nexport const usePaintRef = () => useRef<SkPaint>(null);\n\nexport interface PaintProps extends Omit<CustomPaintProps, \"paint\"> {\n children?: ReactNode | ReactNode[];\n}\n\nexport const Paint = forwardRef<SkPaint, AnimatedProps<PaintProps>>(\n (props, ref) => {\n const { Skia } = useCanvas();\n const paint = useMemo(() => Skia.Paint(), [Skia]);\n useImperativeHandle(ref, () => paint, [paint]);\n const onDeclare = useMemo(\n () =>\n createDeclaration<PaintProps>((paintProps, children, ctx) =>\n processPaint(ctx.Skia, paint, ctx.opacity, paintProps, children)\n ),\n [paint]\n );\n return <skDeclaration onDeclare={onDeclare} {...props} />;\n }\n);\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["Picture.tsx"],"names":["onDraw","ctx","picture","canvas","drawPicture","Picture","props"],"mappings":";;;;;;;AAAA;;AAGA;;;;;;AAMA,MAAMA,MAAM,GAAG,4BAA4B,CAACC,GAAD,WAAsB;AAAA,MAAhB;AAAEC,IAAAA;AAAF,GAAgB;AAC/D,QAAM;AAAEC,IAAAA;AAAF,MAAaF,GAAnB;AACAE,EAAAA,MAAM,CAACC,WAAP,CAAmBF,OAAnB;AACD,CAHc,CAAf;;AAKO,MAAMG,OAAO,GAAIC,KAAD,IAAyB;AAC9C,sBAAO;AAAW,IAAA,MAAM,EAAEN;AAAnB,KAA+BM,KAA/B;AAAsC,IAAA,cAAc;AAApD,KAAP;AACD,CAFM","sourcesContent":["import React from \"react\";\n\nimport type { SkPicture } from \"../../skia\";\nimport { createDrawing } from \"../nodes/Drawing\";\n\nexport interface PictureProps {\n picture: SkPicture;\n}\n\nconst onDraw = createDrawing<PictureProps>((ctx, { picture }) => {\n const { canvas } = ctx;\n canvas.drawPicture(picture);\n});\n\nexport const Picture = (props: PictureProps) => {\n return <skDrawing onDraw={onDraw} {...props} skipProcessing />;\n};\n"]}
|
1
|
+
{"version":3,"sources":["Picture.tsx"],"names":["onDraw","ctx","picture","canvas","drawPicture","Picture","props"],"mappings":";;;;;;;AAAA;;AAGA;;;;;;AAMA,MAAMA,MAAM,GAAG,4BAA4B,CAACC,GAAD,WAAsB;AAAA,MAAhB;AAAEC,IAAAA;AAAF,GAAgB;AAC/D,QAAM;AAAEC,IAAAA;AAAF,MAAaF,GAAnB;AACAE,EAAAA,MAAM,CAACC,WAAP,CAAmBF,OAAnB;AACD,CAHc,CAAf;;AAKO,MAAMG,OAAO,GAAIC,KAAD,IAAyB;AAC9C,sBAAO;AAAW,IAAA,MAAM,EAAEN;AAAnB,KAA+BM,KAA/B;AAAsC,IAAA,cAAc;AAApD,KAAP;AACD,CAFM","sourcesContent":["import React from \"react\";\n\nimport type { SkPicture } from \"../../skia/types\";\nimport { createDrawing } from \"../nodes/Drawing\";\n\nexport interface PictureProps {\n picture: SkPicture;\n}\n\nconst onDraw = createDrawing<PictureProps>((ctx, { picture }) => {\n const { canvas } = ctx;\n canvas.drawPicture(picture);\n});\n\nexport const Picture = (props: PictureProps) => {\n return <skDrawing onDraw={onDraw} {...props} skipProcessing />;\n};\n"]}
|
@@ -25,7 +25,7 @@ const disableFilterMemoization = children => {
|
|
25
25
|
const onDraw = (0, _nodes.createDrawing)((ctx, _, node) => {
|
26
26
|
disableFilterMemoization(node.children);
|
27
27
|
const toFilter = node.visit(ctx);
|
28
|
-
const filter = (0, _getInput.getInput)(toFilter);
|
28
|
+
const filter = (0, _getInput.getInput)(ctx.Skia, toFilter);
|
29
29
|
|
30
30
|
if (!filter) {
|
31
31
|
throw new Error("No image filter provided to the background");
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["BackdropFilter.tsx"],"names":["disableFilterMemoization","children","forEach","child","memoizable","onDraw","ctx","_","node","toFilter","visit","filter","Error","canvas","saveLayer","undefined","restore","BackdropFilter","filterChild","groupChildren","props"],"mappings":";;;;;;;AACA;;AAGA;;AAEA;;AAEA;;;;AAEA,MAAMA,wBAAwB,GAAIC,QAAD,IAA+B;AAC9DA,EAAAA,QAAQ,CAACC,OAAT,CAAkBC,KAAD,IAAW;AAC1BA,IAAAA,KAAK,CAACC,UAAN,GAAmB,KAAnB;AACAJ,IAAAA,wBAAwB,CAACG,KAAK,CAACF,QAAP,CAAxB;AACD,GAHD;AAID,CALD;;AAWA,MAAMI,MAAM,GAAG,0BAAmC,CAACC,GAAD,EAAMC,CAAN,EAASC,IAAT,KAAkB;AAClER,EAAAA,wBAAwB,CAACQ,IAAI,CAACP,QAAN,CAAxB;AACA,QAAMQ,QAAQ,GAAGD,IAAI,CAACE,KAAL,CAAWJ,GAAX,CAAjB;AACA,QAAMK,MAAM,GAAG,
|
1
|
+
{"version":3,"sources":["BackdropFilter.tsx"],"names":["disableFilterMemoization","children","forEach","child","memoizable","onDraw","ctx","_","node","toFilter","visit","filter","Skia","Error","canvas","saveLayer","undefined","restore","BackdropFilter","filterChild","groupChildren","props"],"mappings":";;;;;;;AACA;;AAGA;;AAEA;;AAEA;;;;AAEA,MAAMA,wBAAwB,GAAIC,QAAD,IAA+B;AAC9DA,EAAAA,QAAQ,CAACC,OAAT,CAAkBC,KAAD,IAAW;AAC1BA,IAAAA,KAAK,CAACC,UAAN,GAAmB,KAAnB;AACAJ,IAAAA,wBAAwB,CAACG,KAAK,CAACF,QAAP,CAAxB;AACD,GAHD;AAID,CALD;;AAWA,MAAMI,MAAM,GAAG,0BAAmC,CAACC,GAAD,EAAMC,CAAN,EAASC,IAAT,KAAkB;AAClER,EAAAA,wBAAwB,CAACQ,IAAI,CAACP,QAAN,CAAxB;AACA,QAAMQ,QAAQ,GAAGD,IAAI,CAACE,KAAL,CAAWJ,GAAX,CAAjB;AACA,QAAMK,MAAM,GAAG,wBAASL,GAAG,CAACM,IAAb,EAAmBH,QAAnB,CAAf;;AACA,MAAI,CAACE,MAAL,EAAa;AACX,UAAM,IAAIE,KAAJ,CAAU,4CAAV,CAAN;AACD;;AACD,QAAM;AAAEC,IAAAA;AAAF,MAAaR,GAAnB;AACAQ,EAAAA,MAAM,CAACC,SAAP,CAAiBC,SAAjB,EAA4B,IAA5B,EAAkCL,MAAlC;AACAG,EAAAA,MAAM,CAACG,OAAP;AACD,CAVc,CAAf;;AAYO,MAAMC,cAAc,GAAG,QAIY;AAAA,MAJX;AAC7BP,IAAAA,MAAM,EAAEQ,WADqB;AAE7BlB,IAAAA,QAAQ,EAAEmB,aAFmB;AAG7B,OAAGC;AAH0B,GAIW;AACxC,sBACE,6BAAC,YAAD,EAAWA,KAAX,eACE;AAAW,IAAA,MAAM,EAAEhB,MAAnB;AAA2B,IAAA,cAAc;AAAzC,KACGc,WADH,CADF,EAIGC,aAJH,CADF;AAQD,CAbM","sourcesContent":["import type { ReactNode } from \"react\";\nimport React from \"react\";\n\nimport type { AnimatedProps } from \"../../processors\";\nimport { createDrawing } from \"../../nodes\";\nimport type { Node } from \"../../nodes\";\nimport { getInput } from \"../imageFilters/getInput\";\nimport type { GroupProps } from \"../Group\";\nimport { Group } from \"../Group\";\n\nconst disableFilterMemoization = (children: Node<unknown>[]) => {\n children.forEach((child) => {\n child.memoizable = false;\n disableFilterMemoization(child.children);\n });\n};\n\nexport interface BackdropFilterProps extends GroupProps {\n filter: ReactNode | ReactNode[];\n}\n\nconst onDraw = createDrawing<BackdropFilterProps>((ctx, _, node) => {\n disableFilterMemoization(node.children);\n const toFilter = node.visit(ctx);\n const filter = getInput(ctx.Skia, toFilter);\n if (!filter) {\n throw new Error(\"No image filter provided to the background\");\n }\n const { canvas } = ctx;\n canvas.saveLayer(undefined, null, filter);\n canvas.restore();\n});\n\nexport const BackdropFilter = ({\n filter: filterChild,\n children: groupChildren,\n ...props\n}: AnimatedProps<BackdropFilterProps>) => {\n return (\n <Group {...props}>\n <skDrawing onDraw={onDraw} skipProcessing>\n {filterChild}\n </skDrawing>\n {groupChildren}\n </Group>\n );\n};\n"]}
|
@@ -7,7 +7,7 @@ exports.BlendColor = void 0;
|
|
7
7
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
9
9
|
|
10
|
-
var
|
10
|
+
var _types = require("../../../skia/types");
|
11
11
|
|
12
12
|
var _nodes = require("../../nodes");
|
13
13
|
|
@@ -19,15 +19,16 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
19
19
|
|
20
20
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
21
21
|
|
22
|
-
const onDeclare = (0, _nodes.createDeclaration)((_ref, children) => {
|
22
|
+
const onDeclare = (0, _nodes.createDeclaration)((_ref, children, _ref2) => {
|
23
23
|
let {
|
24
24
|
mode,
|
25
25
|
color
|
26
26
|
} = _ref;
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
27
|
+
let {
|
28
|
+
Skia
|
29
|
+
} = _ref2;
|
30
|
+
const cf = Skia.ColorFilter.MakeBlend(Skia.Color(color), _types.BlendMode[(0, _processors.enumKey)(mode)]);
|
31
|
+
return (0, _Compose.composeColorFilter)(Skia, cf, children);
|
31
32
|
});
|
32
33
|
|
33
34
|
const BlendColor = props => {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["BlendColor.tsx"],"names":["onDeclare","children","mode","color","
|
1
|
+
{"version":3,"sources":["BlendColor.tsx"],"names":["onDeclare","children","mode","color","Skia","cf","ColorFilter","MakeBlend","Color","BlendMode","BlendColor","props"],"mappings":";;;;;;;AAAA;;AAIA;;AACA;;AAEA;;AAEA;;;;;;AAQA,MAAMA,SAAS,GAAG,8BAChB,OAAkBC,QAAlB,YAAyC;AAAA,MAAxC;AAAEC,IAAAA,IAAF;AAAQC,IAAAA;AAAR,GAAwC;AAAA,MAAb;AAAEC,IAAAA;AAAF,GAAa;AACvC,QAAMC,EAAE,GAAGD,IAAI,CAACE,WAAL,CAAiBC,SAAjB,CACTH,IAAI,CAACI,KAAL,CAAWL,KAAX,CADS,EAETM,iBAAU,yBAAQP,IAAR,CAAV,CAFS,CAAX;AAIA,SAAO,iCAAmBE,IAAnB,EAAyBC,EAAzB,EAA6BJ,QAA7B,CAAP;AACD,CAPe,CAAlB;;AAUO,MAAMS,UAAU,GAAIC,KAAD,IAA2C;AACnE,sBAAO;AAAe,IAAA,SAAS,EAAEX;AAA1B,KAAyCW,KAAzC,EAAP;AACD,CAFM","sourcesContent":["import React from \"react\";\nimport type { ReactNode } from \"react\";\n\nimport type { Color } from \"../../../skia/types\";\nimport { BlendMode } from \"../../../skia/types\";\nimport { createDeclaration } from \"../../nodes\";\nimport type { SkEnum, AnimatedProps } from \"../../processors\";\nimport { enumKey } from \"../../processors\";\n\nimport { composeColorFilter } from \"./Compose\";\n\nexport interface BlendColorProps {\n mode: SkEnum<typeof BlendMode>;\n color: Color;\n children?: ReactNode | ReactNode[];\n}\n\nconst onDeclare = createDeclaration<BlendColorProps>(\n ({ mode, color }, children, { Skia }) => {\n const cf = Skia.ColorFilter.MakeBlend(\n Skia.Color(color),\n BlendMode[enumKey(mode)]\n );\n return composeColorFilter(Skia, cf, children);\n }\n);\n\nexport const BlendColor = (props: AnimatedProps<BlendColorProps>) => {\n return <skDeclaration onDeclare={onDeclare} {...props} />;\n};\n"]}
|
@@ -5,16 +5,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.composeColorFilter = void 0;
|
7
7
|
|
8
|
-
var
|
8
|
+
var _types = require("../../../skia/types");
|
9
9
|
|
10
|
-
const composeColorFilter = (cf, children) => {
|
11
|
-
const [col] = children.filter(
|
12
|
-
const [img] = children.filter(
|
10
|
+
const composeColorFilter = (Skia, cf, children) => {
|
11
|
+
const [col] = children.filter(_types.isColorFilter);
|
12
|
+
const [img] = children.filter(_types.isImageFilter);
|
13
13
|
|
14
14
|
if (col) {
|
15
|
-
return
|
15
|
+
return Skia.ColorFilter.MakeCompose(cf, col);
|
16
16
|
} else if (img) {
|
17
|
-
return
|
17
|
+
return Skia.ImageFilter.MakeColorFilter(cf, img);
|
18
18
|
}
|
19
19
|
|
20
20
|
return cf;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["Compose.ts"],"names":["composeColorFilter","cf","children","col","filter","isColorFilter","img","isImageFilter","
|
1
|
+
{"version":3,"sources":["Compose.ts"],"names":["composeColorFilter","Skia","cf","children","col","filter","isColorFilter","img","isImageFilter","ColorFilter","MakeCompose","ImageFilter","MakeColorFilter"],"mappings":";;;;;;;AACA;;AAGO,MAAMA,kBAAkB,GAAG,CAChCC,IADgC,EAEhCC,EAFgC,EAGhCC,QAHgC,KAI7B;AACH,QAAM,CAACC,GAAD,IAAQD,QAAQ,CAACE,MAAT,CAAgBC,oBAAhB,CAAd;AACA,QAAM,CAACC,GAAD,IAAQJ,QAAQ,CAACE,MAAT,CAAgBG,oBAAhB,CAAd;;AACA,MAAIJ,GAAJ,EAAS;AACP,WAAOH,IAAI,CAACQ,WAAL,CAAiBC,WAAjB,CAA6BR,EAA7B,EAAiCE,GAAjC,CAAP;AACD,GAFD,MAEO,IAAIG,GAAJ,EAAS;AACd,WAAON,IAAI,CAACU,WAAL,CAAiBC,eAAjB,CAAiCV,EAAjC,EAAqCK,GAArC,CAAP;AACD;;AACD,SAAOL,EAAP;AACD,CAbM","sourcesContent":["import type { SkColorFilter, Skia } from \"../../../skia/types\";\nimport { isColorFilter, isImageFilter } from \"../../../skia/types\";\nimport type { DeclarationResult } from \"../../nodes\";\n\nexport const composeColorFilter = (\n Skia: Skia,\n cf: SkColorFilter,\n children: DeclarationResult[]\n) => {\n const [col] = children.filter(isColorFilter);\n const [img] = children.filter(isImageFilter);\n if (col) {\n return Skia.ColorFilter.MakeCompose(cf, col);\n } else if (img) {\n return Skia.ImageFilter.MakeColorFilter(cf, img);\n }\n return cf;\n};\n"]}
|
@@ -7,7 +7,7 @@ exports.Lerp = void 0;
|
|
7
7
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
9
9
|
|
10
|
-
var
|
10
|
+
var _types = require("../../../skia/types");
|
11
11
|
|
12
12
|
var _Declaration = require("../../nodes/Declaration");
|
13
13
|
|
@@ -17,15 +17,16 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
17
17
|
|
18
18
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
19
19
|
|
20
|
-
const onDeclare = (0, _Declaration.createDeclaration)((_ref, children) => {
|
20
|
+
const onDeclare = (0, _Declaration.createDeclaration)((_ref, children, _ref2) => {
|
21
21
|
let {
|
22
22
|
t
|
23
23
|
} = _ref;
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
24
|
+
let {
|
25
|
+
Skia
|
26
|
+
} = _ref2;
|
27
|
+
const [src, dst] = children.filter(_types.isColorFilter);
|
28
|
+
const cf = Skia.ColorFilter.MakeLerp(t, src, dst);
|
29
|
+
return (0, _Compose.composeColorFilter)(Skia, cf, children.filter(c => c !== src && c !== dst));
|
29
30
|
});
|
30
31
|
|
31
32
|
const Lerp = props => {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["Lerp.tsx"],"names":["onDeclare","children","t","src","dst","filter","isColorFilter","cf","
|
1
|
+
{"version":3,"sources":["Lerp.tsx"],"names":["onDeclare","children","t","Skia","src","dst","filter","isColorFilter","cf","ColorFilter","MakeLerp","c","Lerp","props"],"mappings":";;;;;;;AAAA;;AAGA;;AACA;;AAGA;;;;;;AAOA,MAAMA,SAAS,GAAG,oCAA6B,OAAQC,QAAR,YAA+B;AAAA,MAA9B;AAAEC,IAAAA;AAAF,GAA8B;AAAA,MAAb;AAAEC,IAAAA;AAAF,GAAa;AAC5E,QAAM,CAACC,GAAD,EAAMC,GAAN,IAAaJ,QAAQ,CAACK,MAAT,CAAgBC,oBAAhB,CAAnB;AACA,QAAMC,EAAE,GAAGL,IAAI,CAACM,WAAL,CAAiBC,QAAjB,CAA0BR,CAA1B,EAA6BE,GAA7B,EAAkCC,GAAlC,CAAX;AACA,SAAO,iCACLF,IADK,EAELK,EAFK,EAGLP,QAAQ,CAACK,MAAT,CAAiBK,CAAD,IAAOA,CAAC,KAAKP,GAAN,IAAaO,CAAC,KAAKN,GAA1C,CAHK,CAAP;AAKD,CARiB,CAAlB;;AAUO,MAAMO,IAAI,GAAIC,KAAD,IAAqC;AACvD,sBAAO;AAAe,IAAA,SAAS,EAAEb;AAA1B,KAAyCa,KAAzC,EAAP;AACD,CAFM","sourcesContent":["import React from \"react\";\nimport type { ReactNode } from \"react\";\n\nimport { isColorFilter } from \"../../../skia/types\";\nimport { createDeclaration } from \"../../nodes/Declaration\";\nimport type { AnimatedProps } from \"../../processors/Animations/Animations\";\n\nimport { composeColorFilter } from \"./Compose\";\n\nexport interface LerpProps {\n t: number;\n children: ReactNode | ReactNode[];\n}\n\nconst onDeclare = createDeclaration<LerpProps>(({ t }, children, { Skia }) => {\n const [src, dst] = children.filter(isColorFilter);\n const cf = Skia.ColorFilter.MakeLerp(t, src, dst);\n return composeColorFilter(\n Skia,\n cf,\n children.filter((c) => c !== src && c !== dst)\n );\n});\n\nexport const Lerp = (props: AnimatedProps<LerpProps>) => {\n return <skDeclaration onDeclare={onDeclare} {...props} />;\n};\n"]}
|
@@ -7,8 +7,6 @@ exports.LinearToSRGBGamma = void 0;
|
|
7
7
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
9
9
|
|
10
|
-
var _skia = require("../../../skia");
|
11
|
-
|
12
10
|
var _Declaration = require("../../nodes/Declaration");
|
13
11
|
|
14
12
|
var _Compose = require("./Compose");
|
@@ -17,10 +15,12 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
17
15
|
|
18
16
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
19
17
|
|
20
|
-
const onDeclare = (0, _Declaration.createDeclaration)((_props, children) => {
|
21
|
-
|
22
|
-
|
23
|
-
|
18
|
+
const onDeclare = (0, _Declaration.createDeclaration)((_props, children, _ref) => {
|
19
|
+
let {
|
20
|
+
Skia
|
21
|
+
} = _ref;
|
22
|
+
const cf = Skia.ColorFilter.MakeLinearToSRGBGamma();
|
23
|
+
return (0, _Compose.composeColorFilter)(Skia, cf, children);
|
24
24
|
});
|
25
25
|
|
26
26
|
const LinearToSRGBGamma = props => {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["LinearToSRGBGamma.tsx"],"names":["onDeclare","_props","children","
|
1
|
+
{"version":3,"sources":["LinearToSRGBGamma.tsx"],"names":["onDeclare","_props","children","Skia","cf","ColorFilter","MakeLinearToSRGBGamma","LinearToSRGBGamma","props"],"mappings":";;;;;;;AAAA;;AAEA;;AAGA;;;;;;AAKA,MAAMA,SAAS,GAAG,oCAAkB,CAACC,MAAD,EAASC,QAAT,WAAgC;AAAA,MAAb;AAAEC,IAAAA;AAAF,GAAa;AAClE,QAAMC,EAAE,GAAGD,IAAI,CAACE,WAAL,CAAiBC,qBAAjB,EAAX;AACA,SAAO,iCAAmBH,IAAnB,EAAyBC,EAAzB,EAA6BF,QAA7B,CAAP;AACD,CAHiB,CAAlB;;AAKO,MAAMK,iBAAiB,GAC5BC,KAD+B,IAE5B;AACH,sBAAO;AAAe,IAAA,SAAS,EAAER;AAA1B,KAAyCQ,KAAzC,EAAP;AACD,CAJM","sourcesContent":["import React from \"react\";\n\nimport { createDeclaration } from \"../../nodes/Declaration\";\nimport type { AnimatedProps } from \"../../processors/Animations/Animations\";\n\nimport { composeColorFilter } from \"./Compose\";\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface LinearToSRGBGammaProps {}\n\nconst onDeclare = createDeclaration((_props, children, { Skia }) => {\n const cf = Skia.ColorFilter.MakeLinearToSRGBGamma();\n return composeColorFilter(Skia, cf, children);\n});\n\nexport const LinearToSRGBGamma = (\n props: AnimatedProps<LinearToSRGBGammaProps>\n) => {\n return <skDeclaration onDeclare={onDeclare} {...props} />;\n};\n"]}
|
@@ -7,8 +7,6 @@ exports.LumaColorFilter = void 0;
|
|
7
7
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
9
9
|
|
10
|
-
var _skia = require("../../../skia");
|
11
|
-
|
12
10
|
var _Declaration = require("../../nodes/Declaration");
|
13
11
|
|
14
12
|
var _Compose = require("./Compose");
|
@@ -17,10 +15,12 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
17
15
|
|
18
16
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
19
17
|
|
20
|
-
const onDeclare = (0, _Declaration.createDeclaration)((_props, children) => {
|
21
|
-
|
22
|
-
|
23
|
-
|
18
|
+
const onDeclare = (0, _Declaration.createDeclaration)((_props, children, _ref) => {
|
19
|
+
let {
|
20
|
+
Skia
|
21
|
+
} = _ref;
|
22
|
+
const cf = Skia.ColorFilter.MakeLumaColorFilter();
|
23
|
+
return (0, _Compose.composeColorFilter)(Skia, cf, children);
|
24
24
|
});
|
25
25
|
|
26
26
|
const LumaColorFilter = props => {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["LumaColorFilter.tsx"],"names":["onDeclare","_props","children","
|
1
|
+
{"version":3,"sources":["LumaColorFilter.tsx"],"names":["onDeclare","_props","children","Skia","cf","ColorFilter","MakeLumaColorFilter","LumaColorFilter","props"],"mappings":";;;;;;;AAAA;;AAEA;;AAGA;;;;;;AAKA,MAAMA,SAAS,GAAG,oCAAkB,CAACC,MAAD,EAASC,QAAT,WAAgC;AAAA,MAAb;AAAEC,IAAAA;AAAF,GAAa;AAClE,QAAMC,EAAE,GAAGD,IAAI,CAACE,WAAL,CAAiBC,mBAAjB,EAAX;AACA,SAAO,iCAAmBH,IAAnB,EAAyBC,EAAzB,EAA6BF,QAA7B,CAAP;AACD,CAHiB,CAAlB;;AAKO,MAAMK,eAAe,GAAIC,KAAD,IAAgD;AAC7E,sBAAO;AAAe,IAAA,SAAS,EAAER;AAA1B,KAAyCQ,KAAzC,EAAP;AACD,CAFM","sourcesContent":["import React from \"react\";\n\nimport { createDeclaration } from \"../../nodes/Declaration\";\nimport type { AnimatedProps } from \"../../processors/Animations/Animations\";\n\nimport { composeColorFilter } from \"./Compose\";\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface LumaColorFilterProps {}\n\nconst onDeclare = createDeclaration((_props, children, { Skia }) => {\n const cf = Skia.ColorFilter.MakeLumaColorFilter();\n return composeColorFilter(Skia, cf, children);\n});\n\nexport const LumaColorFilter = (props: AnimatedProps<LumaColorFilterProps>) => {\n return <skDeclaration onDeclare={onDeclare} {...props} />;\n};\n"]}
|
@@ -7,8 +7,6 @@ exports.OpacityMatrix = exports.ColorMatrix = void 0;
|
|
7
7
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
9
9
|
|
10
|
-
var _skia = require("../../../skia");
|
11
|
-
|
12
10
|
var _nodes = require("../../nodes");
|
13
11
|
|
14
12
|
var _Compose = require("./Compose");
|
@@ -17,14 +15,15 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
17
15
|
|
18
16
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
19
17
|
|
20
|
-
const onDeclare = (0, _nodes.createDeclaration)((_ref, children) => {
|
18
|
+
const onDeclare = (0, _nodes.createDeclaration)((_ref, children, _ref2) => {
|
21
19
|
let {
|
22
20
|
matrix
|
23
21
|
} = _ref;
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
22
|
+
let {
|
23
|
+
Skia
|
24
|
+
} = _ref2;
|
25
|
+
const cf = Skia.ColorFilter.MakeMatrix(matrix);
|
26
|
+
return (0, _Compose.composeColorFilter)(Skia, cf, children);
|
28
27
|
});
|
29
28
|
|
30
29
|
const ColorMatrix = props => {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["Matrix.tsx"],"names":["onDeclare","children","matrix","
|
1
|
+
{"version":3,"sources":["Matrix.tsx"],"names":["onDeclare","children","matrix","Skia","cf","ColorFilter","MakeMatrix","ColorMatrix","props","OpacityMatrix","opacity"],"mappings":";;;;;;;AAAA;;AAGA;;AAGA;;;;;;AAOA,MAAMA,SAAS,GAAG,8BAChB,OAAaC,QAAb,YAAoC;AAAA,MAAnC;AAAEC,IAAAA;AAAF,GAAmC;AAAA,MAAb;AAAEC,IAAAA;AAAF,GAAa;AAClC,QAAMC,EAAE,GAAGD,IAAI,CAACE,WAAL,CAAiBC,UAAjB,CAA4BJ,MAA5B,CAAX;AACA,SAAO,iCAAmBC,IAAnB,EAAyBC,EAAzB,EAA6BH,QAA7B,CAAP;AACD,CAJe,CAAlB;;AAOO,MAAMM,WAAW,GAAIC,KAAD,IAA4C;AACrE,sBAAO;AAAe,IAAA,SAAS,EAAER;AAA1B,KAAyCQ,KAAzC,EAAP;AACD,CAFM;;;;AAIA,MAAMC,aAAa,GAAIC,OAAD,IAAqB,CAChD,CADgD,EAEhD,CAFgD,EAGhD,CAHgD,EAIhD,CAJgD,EAKhD,CALgD,EAMhD,CANgD,EAOhD,CAPgD,EAQhD,CARgD,EAShD,CATgD,EAUhD,CAVgD,EAWhD,CAXgD,EAYhD,CAZgD,EAahD,CAbgD,EAchD,CAdgD,EAehD,CAfgD,EAgBhD,CAhBgD,EAiBhD,CAjBgD,EAkBhD,CAlBgD,EAmBhDA,OAnBgD,EAoBhD,CApBgD,CAA3C","sourcesContent":["import React from \"react\";\nimport type { ReactNode } from \"react\";\n\nimport { createDeclaration } from \"../../nodes\";\nimport type { AnimatedProps } from \"../../processors\";\n\nimport { composeColorFilter } from \"./Compose\";\n\ninterface ColorMatrixProps {\n matrix: number[];\n children?: ReactNode | ReactNode[];\n}\n\nconst onDeclare = createDeclaration<ColorMatrixProps>(\n ({ matrix }, children, { Skia }) => {\n const cf = Skia.ColorFilter.MakeMatrix(matrix);\n return composeColorFilter(Skia, cf, children);\n }\n);\n\nexport const ColorMatrix = (props: AnimatedProps<ColorMatrixProps>) => {\n return <skDeclaration onDeclare={onDeclare} {...props} />;\n};\n\nexport const OpacityMatrix = (opacity: number) => [\n 1,\n 0,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 0,\n opacity,\n 0,\n];\n"]}
|
@@ -7,8 +7,6 @@ exports.SRGBToLinearGamma = void 0;
|
|
7
7
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
9
9
|
|
10
|
-
var _skia = require("../../../skia");
|
11
|
-
|
12
10
|
var _Declaration = require("../../nodes/Declaration");
|
13
11
|
|
14
12
|
var _Compose = require("./Compose");
|
@@ -17,10 +15,12 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
17
15
|
|
18
16
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
19
17
|
|
20
|
-
const onDeclare = (0, _Declaration.createDeclaration)((_props, children) => {
|
21
|
-
|
22
|
-
|
23
|
-
|
18
|
+
const onDeclare = (0, _Declaration.createDeclaration)((_props, children, _ref) => {
|
19
|
+
let {
|
20
|
+
Skia
|
21
|
+
} = _ref;
|
22
|
+
const cf = Skia.ColorFilter.MakeSRGBToLinearGamma();
|
23
|
+
return (0, _Compose.composeColorFilter)(Skia, cf, children);
|
24
24
|
});
|
25
25
|
|
26
26
|
const SRGBToLinearGamma = props => {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["SRGBToLinearGamma.tsx"],"names":["onDeclare","_props","children","
|
1
|
+
{"version":3,"sources":["SRGBToLinearGamma.tsx"],"names":["onDeclare","_props","children","Skia","cf","ColorFilter","MakeSRGBToLinearGamma","SRGBToLinearGamma","props"],"mappings":";;;;;;;AAAA;;AAEA;;AAGA;;;;;;AAKA,MAAMA,SAAS,GAAG,oCAAkB,CAACC,MAAD,EAASC,QAAT,WAAgC;AAAA,MAAb;AAAEC,IAAAA;AAAF,GAAa;AAClE,QAAMC,EAAE,GAAGD,IAAI,CAACE,WAAL,CAAiBC,qBAAjB,EAAX;AACA,SAAO,iCAAmBH,IAAnB,EAAyBC,EAAzB,EAA6BF,QAA7B,CAAP;AACD,CAHiB,CAAlB;;AAKO,MAAMK,iBAAiB,GAC5BC,KAD+B,IAE5B;AACH,sBAAO;AAAe,IAAA,SAAS,EAAER;AAA1B,KAAyCQ,KAAzC,EAAP;AACD,CAJM","sourcesContent":["import React from \"react\";\n\nimport { createDeclaration } from \"../../nodes/Declaration\";\nimport type { AnimatedProps } from \"../../processors/Animations/Animations\";\n\nimport { composeColorFilter } from \"./Compose\";\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface SRGBToLinearGammaProps {}\n\nconst onDeclare = createDeclaration((_props, children, { Skia }) => {\n const cf = Skia.ColorFilter.MakeSRGBToLinearGamma();\n return composeColorFilter(Skia, cf, children);\n});\n\nexport const SRGBToLinearGamma = (\n props: AnimatedProps<SRGBToLinearGammaProps>\n) => {\n return <skDeclaration onDeclare={onDeclare} {...props} />;\n};\n"]}
|
@@ -7,8 +7,6 @@ exports.size = exports.rect2rect = exports.fitRects = void 0;
|
|
7
7
|
|
8
8
|
var _typeddash = require("../../typeddash");
|
9
9
|
|
10
|
-
var _skia = require("../../../skia");
|
11
|
-
|
12
10
|
const size = function () {
|
13
11
|
let width = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
14
12
|
let height = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
@@ -52,12 +50,7 @@ const fitRects = (fit, rect, _ref) => {
|
|
52
50
|
width,
|
53
51
|
height
|
54
52
|
});
|
55
|
-
const src = inscribe(sizes.src,
|
56
|
-
x: 0,
|
57
|
-
y: 0,
|
58
|
-
width: rect.width,
|
59
|
-
height: rect.height
|
60
|
-
});
|
53
|
+
const src = inscribe(sizes.src, rect);
|
61
54
|
const dst = inscribe(sizes.dst, {
|
62
55
|
x,
|
63
56
|
y,
|
@@ -79,7 +72,12 @@ const inscribe = (_ref2, rect) => {
|
|
79
72
|
} = _ref2;
|
80
73
|
const halfWidthDelta = (rect.width - width) / 2.0;
|
81
74
|
const halfHeightDelta = (rect.height - height) / 2.0;
|
82
|
-
return
|
75
|
+
return {
|
76
|
+
x: rect.x + halfWidthDelta,
|
77
|
+
y: rect.y + halfHeightDelta,
|
78
|
+
width,
|
79
|
+
height
|
80
|
+
};
|
83
81
|
};
|
84
82
|
|
85
83
|
const applyBoxFit = (fit, input, output) => {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["BoxFit.ts"],"names":["size","width","height","rect2rect","src","dst","scaleX","scaleY","translateX","x","translateY","y","fitRects","fit","rect","sizes","applyBoxFit","inscribe","halfWidthDelta","halfHeightDelta","
|
1
|
+
{"version":3,"sources":["BoxFit.ts"],"names":["size","width","height","rect2rect","src","dst","scaleX","scaleY","translateX","x","translateY","y","fitRects","fit","rect","sizes","applyBoxFit","inscribe","halfWidthDelta","halfHeightDelta","input","output","Math","min","aspectRatio"],"mappings":";;;;;;;AAAA;;AAkBO,MAAMA,IAAI,GAAG;AAAA,MAACC,KAAD,uEAAS,CAAT;AAAA,MAAYC,MAAZ,uEAAqB,CAArB;AAAA,SAA4B;AAAED,IAAAA,KAAF;AAASC,IAAAA;AAAT,GAA5B;AAAA,CAAb;;;;AAEA,MAAMC,SAAS,GAAG,CAACC,GAAD,EAAcC,GAAd,KAA8B;AACrD,QAAMC,MAAM,GAAGD,GAAG,CAACJ,KAAJ,GAAYG,GAAG,CAACH,KAA/B;AACA,QAAMM,MAAM,GAAGF,GAAG,CAACH,MAAJ,GAAaE,GAAG,CAACF,MAAhC;AACA,QAAMM,UAAU,GAAGH,GAAG,CAACI,CAAJ,GAAQL,GAAG,CAACK,CAAJ,GAAQH,MAAnC;AACA,QAAMI,UAAU,GAAGL,GAAG,CAACM,CAAJ,GAAQP,GAAG,CAACO,CAAJ,GAAQJ,MAAnC;AACA,SAAO,CAAC;AAAEC,IAAAA;AAAF,GAAD,EAAiB;AAAEE,IAAAA;AAAF,GAAjB,EAAiC;AAAEJ,IAAAA;AAAF,GAAjC,EAA6C;AAAEC,IAAAA;AAAF,GAA7C,CAAP;AACD,CANM;;;;AAQA,MAAMK,QAAQ,GAAG,CACtBC,GADsB,EAEtBC,IAFsB,WAInB;AAAA,MADH;AAAEL,IAAAA,CAAF;AAAKE,IAAAA,CAAL;AAAQV,IAAAA,KAAR;AAAeC,IAAAA;AAAf,GACG;AACH,QAAMa,KAAK,GAAGC,WAAW,CACvBH,GADuB,EAEvB;AAAEZ,IAAAA,KAAK,EAAEa,IAAI,CAACb,KAAd;AAAqBC,IAAAA,MAAM,EAAEY,IAAI,CAACZ;AAAlC,GAFuB,EAGvB;AAAED,IAAAA,KAAF;AAASC,IAAAA;AAAT,GAHuB,CAAzB;AAKA,QAAME,GAAG,GAAGa,QAAQ,CAACF,KAAK,CAACX,GAAP,EAAYU,IAAZ,CAApB;AACA,QAAMT,GAAG,GAAGY,QAAQ,CAACF,KAAK,CAACV,GAAP,EAAY;AAC9BI,IAAAA,CAD8B;AAE9BE,IAAAA,CAF8B;AAG9BV,IAAAA,KAH8B;AAI9BC,IAAAA;AAJ8B,GAAZ,CAApB;AAMA,SAAO;AAAEE,IAAAA,GAAF;AAAOC,IAAAA;AAAP,GAAP;AACD,CAlBM;;;;AAoBP,MAAMY,QAAQ,GAAG,QAEfH,IAFe,KAGZ;AAAA,MAFH;AAAEb,IAAAA,KAAF;AAASC,IAAAA;AAAT,GAEG;AACH,QAAMgB,cAAc,GAAG,CAACJ,IAAI,CAACb,KAAL,GAAaA,KAAd,IAAuB,GAA9C;AACA,QAAMkB,eAAe,GAAG,CAACL,IAAI,CAACZ,MAAL,GAAcA,MAAf,IAAyB,GAAjD;AACA,SAAO;AACLO,IAAAA,CAAC,EAAEK,IAAI,CAACL,CAAL,GAASS,cADP;AAELP,IAAAA,CAAC,EAAEG,IAAI,CAACH,CAAL,GAASQ,eAFP;AAGLlB,IAAAA,KAHK;AAILC,IAAAA;AAJK,GAAP;AAMD,CAZD;;AAcA,MAAMc,WAAW,GAAG,CAACH,GAAD,EAAWO,KAAX,EAAwBC,MAAxB,KAAyC;AAC3D,MAAIjB,GAAG,GAAGJ,IAAI,EAAd;AAAA,MACEK,GAAG,GAAGL,IAAI,EADZ;;AAEA,MACEoB,KAAK,CAAClB,MAAN,IAAgB,GAAhB,IACAkB,KAAK,CAACnB,KAAN,IAAe,GADf,IAEAoB,MAAM,CAACnB,MAAP,IAAiB,GAFjB,IAGAmB,MAAM,CAACpB,KAAP,IAAgB,GAJlB,EAKE;AACA,WAAO;AAAEG,MAAAA,GAAF;AAAOC,MAAAA;AAAP,KAAP;AACD;;AACD,UAAQQ,GAAR;AACE,SAAK,MAAL;AACET,MAAAA,GAAG,GAAGgB,KAAN;AACAf,MAAAA,GAAG,GAAGgB,MAAN;AACA;;AACF,SAAK,SAAL;AACEjB,MAAAA,GAAG,GAAGgB,KAAN;;AACA,UAAIC,MAAM,CAACpB,KAAP,GAAeoB,MAAM,CAACnB,MAAtB,GAA+BE,GAAG,CAACH,KAAJ,GAAYG,GAAG,CAACF,MAAnD,EAA2D;AACzDG,QAAAA,GAAG,GAAGL,IAAI,CAAEI,GAAG,CAACH,KAAJ,GAAYoB,MAAM,CAACnB,MAApB,GAA8BE,GAAG,CAACF,MAAnC,EAA2CmB,MAAM,CAACnB,MAAlD,CAAV;AACD,OAFD,MAEO;AACLG,QAAAA,GAAG,GAAGL,IAAI,CAACqB,MAAM,CAACpB,KAAR,EAAgBG,GAAG,CAACF,MAAJ,GAAamB,MAAM,CAACpB,KAArB,GAA8BG,GAAG,CAACH,KAAjD,CAAV;AACD;;AACD;;AACF,SAAK,OAAL;AACE,UAAIoB,MAAM,CAACpB,KAAP,GAAeoB,MAAM,CAACnB,MAAtB,GAA+BkB,KAAK,CAACnB,KAAN,GAAcmB,KAAK,CAAClB,MAAvD,EAA+D;AAC7DE,QAAAA,GAAG,GAAGJ,IAAI,CAACoB,KAAK,CAACnB,KAAP,EAAemB,KAAK,CAACnB,KAAN,GAAcoB,MAAM,CAACnB,MAAtB,GAAgCmB,MAAM,CAACpB,KAArD,CAAV;AACD,OAFD,MAEO;AACLG,QAAAA,GAAG,GAAGJ,IAAI,CAAEoB,KAAK,CAAClB,MAAN,GAAemB,MAAM,CAACpB,KAAvB,GAAgCoB,MAAM,CAACnB,MAAxC,EAAgDkB,KAAK,CAAClB,MAAtD,CAAV;AACD;;AACDG,MAAAA,GAAG,GAAGgB,MAAN;AACA;;AACF,SAAK,UAAL;AACEjB,MAAAA,GAAG,GAAGJ,IAAI,CAACoB,KAAK,CAACnB,KAAP,EAAemB,KAAK,CAACnB,KAAN,GAAcoB,MAAM,CAACnB,MAAtB,GAAgCmB,MAAM,CAACpB,KAArD,CAAV;AACAI,MAAAA,GAAG,GAAGL,IAAI,CAACqB,MAAM,CAACpB,KAAR,EAAgBG,GAAG,CAACF,MAAJ,GAAamB,MAAM,CAACpB,KAArB,GAA8BG,GAAG,CAACH,KAAjD,CAAV;AACA;;AACF,SAAK,WAAL;AACEG,MAAAA,GAAG,GAAGJ,IAAI,CAAEoB,KAAK,CAAClB,MAAN,GAAemB,MAAM,CAACpB,KAAvB,GAAgCoB,MAAM,CAACnB,MAAxC,EAAgDkB,KAAK,CAAClB,MAAtD,CAAV;AACAG,MAAAA,GAAG,GAAGL,IAAI,CAAEI,GAAG,CAACH,KAAJ,GAAYoB,MAAM,CAACnB,MAApB,GAA8BE,GAAG,CAACF,MAAnC,EAA2CmB,MAAM,CAACnB,MAAlD,CAAV;AACA;;AACF,SAAK,MAAL;AACEE,MAAAA,GAAG,GAAGJ,IAAI,CACRsB,IAAI,CAACC,GAAL,CAASH,KAAK,CAACnB,KAAf,EAAsBoB,MAAM,CAACpB,KAA7B,CADQ,EAERqB,IAAI,CAACC,GAAL,CAASH,KAAK,CAAClB,MAAf,EAAuBmB,MAAM,CAACnB,MAA9B,CAFQ,CAAV;AAIAG,MAAAA,GAAG,GAAGD,GAAN;AACA;;AACF,SAAK,WAAL;AACEA,MAAAA,GAAG,GAAGgB,KAAN;AACAf,MAAAA,GAAG,GAAGe,KAAN;AACA,YAAMI,WAAW,GAAGJ,KAAK,CAACnB,KAAN,GAAcmB,KAAK,CAAClB,MAAxC;;AACA,UAAIG,GAAG,CAACH,MAAJ,GAAamB,MAAM,CAACnB,MAAxB,EAAgC;AAC9BG,QAAAA,GAAG,GAAGL,IAAI,CAACqB,MAAM,CAACnB,MAAP,GAAgBsB,WAAjB,EAA8BH,MAAM,CAACnB,MAArC,CAAV;AACD;;AACD,UAAIG,GAAG,CAACJ,KAAJ,GAAYoB,MAAM,CAACpB,KAAvB,EAA8B;AAC5BI,QAAAA,GAAG,GAAGL,IAAI,CAACqB,MAAM,CAACpB,KAAR,EAAeoB,MAAM,CAACpB,KAAP,GAAeuB,WAA9B,CAAV;AACD;;AACD;;AACF;AACE,sCAAgBX,GAAhB;AAhDJ;;AAkDA,SAAO;AAAET,IAAAA,GAAF;AAAOC,IAAAA;AAAP,GAAP;AACD,CA9DD","sourcesContent":["import { exhaustiveCheck } from \"../../typeddash\";\nimport type { SkRect } from \"../../../skia/types\";\n\n// https://api.flutter.dev/flutter/painting/BoxFit-class.html\nexport type Fit =\n | \"cover\"\n | \"contain\"\n | \"fill\"\n | \"fitHeight\"\n | \"fitWidth\"\n | \"none\"\n | \"scaleDown\";\n\nexport interface Size {\n width: number;\n height: number;\n}\n\nexport const size = (width = 0, height = 0) => ({ width, height });\n\nexport const rect2rect = (src: SkRect, dst: SkRect) => {\n const scaleX = dst.width / src.width;\n const scaleY = dst.height / src.height;\n const translateX = dst.x - src.x * scaleX;\n const translateY = dst.y - src.y * scaleY;\n return [{ translateX }, { translateY }, { scaleX }, { scaleY }] as const;\n};\n\nexport const fitRects = (\n fit: Fit,\n rect: SkRect,\n { x, y, width, height }: SkRect\n) => {\n const sizes = applyBoxFit(\n fit,\n { width: rect.width, height: rect.height },\n { width, height }\n );\n const src = inscribe(sizes.src, rect);\n const dst = inscribe(sizes.dst, {\n x,\n y,\n width,\n height,\n });\n return { src, dst };\n};\n\nconst inscribe = (\n { width, height }: Size,\n rect: { x: number; y: number; width: number; height: number }\n) => {\n const halfWidthDelta = (rect.width - width) / 2.0;\n const halfHeightDelta = (rect.height - height) / 2.0;\n return {\n x: rect.x + halfWidthDelta,\n y: rect.y + halfHeightDelta,\n width,\n height,\n };\n};\n\nconst applyBoxFit = (fit: Fit, input: Size, output: Size) => {\n let src = size(),\n dst = size();\n if (\n input.height <= 0.0 ||\n input.width <= 0.0 ||\n output.height <= 0.0 ||\n output.width <= 0.0\n ) {\n return { src, dst };\n }\n switch (fit) {\n case \"fill\":\n src = input;\n dst = output;\n break;\n case \"contain\":\n src = input;\n if (output.width / output.height > src.width / src.height) {\n dst = size((src.width * output.height) / src.height, output.height);\n } else {\n dst = size(output.width, (src.height * output.width) / src.width);\n }\n break;\n case \"cover\":\n if (output.width / output.height > input.width / input.height) {\n src = size(input.width, (input.width * output.height) / output.width);\n } else {\n src = size((input.height * output.width) / output.height, input.height);\n }\n dst = output;\n break;\n case \"fitWidth\":\n src = size(input.width, (input.width * output.height) / output.width);\n dst = size(output.width, (src.height * output.width) / src.width);\n break;\n case \"fitHeight\":\n src = size((input.height * output.width) / output.height, input.height);\n dst = size((src.width * output.height) / src.height, output.height);\n break;\n case \"none\":\n src = size(\n Math.min(input.width, output.width),\n Math.min(input.height, output.height)\n );\n dst = src;\n break;\n case \"scaleDown\":\n src = input;\n dst = input;\n const aspectRatio = input.width / input.height;\n if (dst.height > output.height) {\n dst = size(output.height * aspectRatio, output.height);\n }\n if (dst.width > output.width) {\n dst = size(output.width, output.width / aspectRatio);\n }\n break;\n default:\n exhaustiveCheck(fit);\n }\n return { src, dst };\n};\n"]}
|
@@ -20,14 +20,15 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
20
20
|
const onDraw = (0, _Drawing.createDrawing)((_ref, _ref2) => {
|
21
21
|
let {
|
22
22
|
canvas,
|
23
|
-
paint
|
23
|
+
paint,
|
24
|
+
Skia
|
24
25
|
} = _ref;
|
25
26
|
let {
|
26
27
|
fit,
|
27
28
|
image,
|
28
29
|
...rectProps
|
29
30
|
} = _ref2;
|
30
|
-
const rect = (0, _processors.processRect)(rectProps);
|
31
|
+
const rect = (0, _processors.processRect)(Skia, rectProps);
|
31
32
|
const {
|
32
33
|
src,
|
33
34
|
dst
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["Image.tsx"],"names":["onDraw","canvas","paint","fit","image","rectProps","rect","src","dst","x","y","width","height","drawImageRect","Image","props","defaultProps"],"mappings":";;;;;;;AAAA;;AAQA;;AACA;;AAGA;;;;;;AAaA,MAAMA,MAAM,GAAG,4BACb,
|
1
|
+
{"version":3,"sources":["Image.tsx"],"names":["onDraw","canvas","paint","Skia","fit","image","rectProps","rect","src","dst","x","y","width","height","drawImageRect","Image","props","defaultProps"],"mappings":";;;;;;;AAAA;;AAQA;;AACA;;AAGA;;;;;;AAaA,MAAMA,MAAM,GAAG,4BACb,iBAA2D;AAAA,MAA1D;AAAEC,IAAAA,MAAF;AAAUC,IAAAA,KAAV;AAAiBC,IAAAA;AAAjB,GAA0D;AAAA,MAAjC;AAAEC,IAAAA,GAAF;AAAOC,IAAAA,KAAP;AAAc,OAAGC;AAAjB,GAAiC;AACzD,QAAMC,IAAI,GAAG,6BAAYJ,IAAZ,EAAkBG,SAAlB,CAAb;AACA,QAAM;AAAEE,IAAAA,GAAF;AAAOC,IAAAA;AAAP,MAAe,sBACnBL,GADmB,EAEnB;AACEM,IAAAA,CAAC,EAAE,CADL;AAEEC,IAAAA,CAAC,EAAE,CAFL;AAGEC,IAAAA,KAAK,EAAEP,KAAK,CAACO,KAAN,EAHT;AAIEC,IAAAA,MAAM,EAAER,KAAK,CAACQ,MAAN;AAJV,GAFmB,EAQnBN,IARmB,CAArB;AAUAN,EAAAA,MAAM,CAACa,aAAP,CAAqBT,KAArB,EAA4BG,GAA5B,EAAiCC,GAAjC,EAAsCP,KAAtC;AACD,CAdY,CAAf;;AAgBO,MAAMa,KAAK,GAAIC,KAAD,IAAsC;AACzD,sBAAO;AAAW,IAAA,MAAM,EAAEhB;AAAnB,KAA+BgB,KAA/B,EAAP;AACD,CAFM;;;AAIPD,KAAK,CAACE,YAAN,GAAqB;AACnBP,EAAAA,CAAC,EAAE,CADgB;AAEnBC,EAAAA,CAAC,EAAE,CAFgB;AAGnBP,EAAAA,GAAG,EAAE;AAHc,CAArB","sourcesContent":["import React from \"react\";\n\nimport type { SkImage } from \"../../../skia/types\";\nimport type {\n CustomPaintProps,\n RectDef,\n AnimatedProps,\n} from \"../../processors\";\nimport { createDrawing } from \"../../nodes/Drawing\";\nimport { processRect } from \"../../processors\";\n\nimport type { Fit } from \"./BoxFit\";\nimport { fitRects } from \"./BoxFit\";\n\nexport type SourceImageProps = {\n image: SkImage;\n};\n\nexport type BaseImageProps = RectDef &\n SourceImageProps & {\n fit: Fit;\n };\n\nexport type ImageProps = CustomPaintProps & BaseImageProps;\n\nconst onDraw = createDrawing<ImageProps>(\n ({ canvas, paint, Skia }, { fit, image, ...rectProps }) => {\n const rect = processRect(Skia, rectProps);\n const { src, dst } = fitRects(\n fit,\n {\n x: 0,\n y: 0,\n width: image.width(),\n height: image.height(),\n },\n rect\n );\n canvas.drawImageRect(image, src, dst, paint);\n }\n);\nexport const Image = (props: AnimatedProps<ImageProps>) => {\n return <skDrawing onDraw={onDraw} {...props} />;\n};\n\nImage.defaultProps = {\n x: 0,\n y: 0,\n fit: \"contain\",\n};\n"]}
|
@@ -17,7 +17,8 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
17
17
|
|
18
18
|
const onDraw = (0, _nodes.createDrawing)((_ref, _ref2) => {
|
19
19
|
let {
|
20
|
-
canvas
|
20
|
+
canvas,
|
21
|
+
Skia
|
21
22
|
} = _ref;
|
22
23
|
let {
|
23
24
|
svg,
|
@@ -28,7 +29,7 @@ const onDraw = (0, _nodes.createDrawing)((_ref, _ref2) => {
|
|
28
29
|
y,
|
29
30
|
width,
|
30
31
|
height
|
31
|
-
} = (0, _processors.processRect)(rectProps);
|
32
|
+
} = (0, _processors.processRect)(Skia, rectProps);
|
32
33
|
canvas.save();
|
33
34
|
canvas.translate(x, y);
|
34
35
|
canvas.drawSvg(svg, width, height);
|