@shopify/react-native-skia 0.1.130 → 0.1.133
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/cpp/rnskia-android/RNSkDrawViewImpl.cpp +5 -0
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaDrawView.java +2 -1
- package/cpp/api/JsiSkCanvas.h +2 -2
- package/cpp/api/JsiSkFont.h +6 -2
- package/cpp/api/JsiSkImage.h +2 -19
- package/cpp/api/JsiSkMatrix.h +40 -27
- package/cpp/api/JsiSkPaint.h +8 -33
- package/cpp/api/JsiSkPath.h +71 -65
- 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 +27 -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/Font/Font.js.map +1 -1
- package/lib/commonjs/skia/types/Image/Image.js +5 -5
- package/lib/commonjs/skia/types/Image/Image.js.map +1 -1
- package/lib/commonjs/skia/types/Image/ImageFactory.js.map +1 -1
- package/lib/commonjs/skia/types/Matrix.js +58 -1
- package/lib/commonjs/skia/types/Matrix.js.map +1 -1
- package/lib/commonjs/skia/types/Paint/Paint.js +3 -3
- package/lib/commonjs/skia/types/Paint/Paint.js.map +1 -1
- 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 +45 -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/{api/JsiSkCanvas.js → JsiSkCanvas.js} +21 -7
- 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 +113 -0
- package/lib/commonjs/skia/web/JsiSkFont.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkFontMgr.js +33 -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} +10 -6
- package/lib/commonjs/skia/web/JsiSkImage.js.map +1 -0
- 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/JsiSkImageFilterFactory.js +68 -0
- package/lib/commonjs/skia/web/JsiSkImageFilterFactory.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 +337 -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 +49 -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 +22 -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/Font/Font.js.map +1 -1
- package/lib/module/skia/types/Image/Image.js +5 -5
- package/lib/module/skia/types/Image/Image.js.map +1 -1
- package/lib/module/skia/types/Image/ImageFactory.js.map +1 -1
- package/lib/module/skia/types/Matrix.js +55 -0
- package/lib/module/skia/types/Matrix.js.map +1 -1
- package/lib/module/skia/types/Paint/Paint.js +3 -3
- package/lib/module/skia/types/Paint/Paint.js.map +1 -1
- 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 +42 -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/{api/JsiSkCanvas.js → JsiSkCanvas.js} +20 -7
- 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 +101 -0
- package/lib/module/skia/web/JsiSkFont.js.map +1 -0
- package/lib/module/skia/web/JsiSkFontMgr.js +23 -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/JsiSkImage.js +49 -0
- package/lib/module/skia/web/JsiSkImage.js.map +1 -0
- 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/JsiSkImageFilterFactory.js +57 -0
- package/lib/module/skia/web/JsiSkImageFilterFactory.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 +324 -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 +39 -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 +10 -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/Font/Font.d.ts +8 -9
- 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/Image.d.ts +5 -5
- 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/Paint/Paint.d.ts +3 -3
- package/lib/typescript/src/skia/types/Path/Path.d.ts +27 -22
- 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 -1
- 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/{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} +4 -4
- 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/JsiSkImageFilterFactory.d.ts +19 -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/Font/Font.ts +9 -14
- package/src/skia/types/FontMgr/FontMgr.ts +1 -1
- package/src/skia/types/FontMgr/FontMgrFactory.ts +2 -2
- package/src/skia/types/Image/Image.ts +4 -4
- package/src/skia/types/Image/ImageFactory.ts +3 -3
- package/src/skia/types/Matrix.ts +79 -14
- package/src/skia/types/Paint/Paint.ts +1 -1
- package/src/skia/types/Path/Path.ts +33 -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 -1
- package/src/skia/types/SVG/SVGFactory.ts +2 -2
- package/src/skia/types/Shader/Shader.ts +59 -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/{api/JsiSkCanvas.ts → JsiSkCanvas.ts} +20 -12
- 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 +128 -0
- package/src/skia/web/JsiSkFontMgr.ts +38 -0
- package/src/skia/web/JsiSkFontMgrFactory.ts +18 -0
- package/src/skia/web/JsiSkImage.ts +87 -0
- package/src/skia/web/JsiSkImageFactory.ts +40 -0
- package/src/skia/web/JsiSkImageFilter.ts +14 -0
- package/src/skia/web/JsiSkImageFilterFactory.ts +144 -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} +7 -6
- package/src/skia/web/JsiSkPath.ts +386 -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 +181 -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 +41 -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 +190 -0
- package/src/views/types.ts +1 -0
- package/src/views/useTouchHandler.ts +82 -51
- package/src/web/index.ts +15 -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/JsiSkImage.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/JsiSkImage.js +0 -46
- package/lib/module/skia/web/api/JsiSkImage.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/JsiSkImage.ts +0 -66
- 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,5 +1,4 @@
|
|
1
|
-
import type { Vector } from "
|
2
|
-
import { vec } from "./math/Vector";
|
1
|
+
import type { Skia, Vector } from "../../skia/types";
|
3
2
|
|
4
3
|
interface PointCircleDef {
|
5
4
|
c: Vector;
|
@@ -18,9 +17,10 @@ const isCircleScalarDef = (def: CircleDef): def is ScalarCircleDef =>
|
|
18
17
|
// We have an issue to check property existence on JSI backed instances
|
19
18
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
20
19
|
(def as any).cx !== undefined;
|
21
|
-
|
20
|
+
|
21
|
+
export const processCircle = (Skia: Skia, def: CircleDef) => {
|
22
22
|
if (isCircleScalarDef(def)) {
|
23
|
-
return { c:
|
23
|
+
return { c: Skia.Point(def.cx, def.cy), r: def.r };
|
24
24
|
}
|
25
25
|
return def;
|
26
26
|
};
|
@@ -1,14 +1,19 @@
|
|
1
|
-
import
|
1
|
+
import { isRRect } from "../../skia/types";
|
2
|
+
import type { SkCanvas, ClipOp, SkRect, SkRRect, Skia } from "../../skia/types";
|
2
3
|
|
3
4
|
import type { PathDef } from "./Paths";
|
4
5
|
import { processPath, isPathDef } from "./Paths";
|
5
|
-
import { isRRect } from "./Rects";
|
6
6
|
|
7
7
|
export type ClipDef = SkRRect | SkRect | PathDef;
|
8
8
|
|
9
|
-
export const processClip = (
|
9
|
+
export const processClip = (
|
10
|
+
Skia: Skia,
|
11
|
+
canvas: SkCanvas,
|
12
|
+
def: ClipDef,
|
13
|
+
op: ClipOp
|
14
|
+
) => {
|
10
15
|
if (isPathDef(def)) {
|
11
|
-
const path = processPath(def);
|
16
|
+
const path = processPath(Skia, def);
|
12
17
|
canvas.clipPath(path, op, true);
|
13
18
|
} else if (isRRect(def)) {
|
14
19
|
canvas.clipRRect(def, op, true);
|
@@ -1,5 +1,4 @@
|
|
1
|
-
import { Skia } from "
|
2
|
-
import type { Color } from "../types";
|
1
|
+
import type { Color, Skia } from "../../skia/types";
|
3
2
|
|
4
3
|
export const RED = 0;
|
5
4
|
export const GREEN = 1;
|
@@ -9,7 +8,7 @@ export const ALPHA = 3;
|
|
9
8
|
export const rgbaColor = (r: number, g: number, b: number, a: number) =>
|
10
9
|
new Float32Array([r, g, b, a]);
|
11
10
|
|
12
|
-
export const processColor = (cl: Color, currentOpacity: number) => {
|
11
|
+
export const processColor = (Skia: Skia, cl: Color, currentOpacity: number) => {
|
13
12
|
const color = Skia.Color(cl);
|
14
13
|
color[ALPHA] *= currentOpacity;
|
15
14
|
return color;
|
@@ -1,5 +1,4 @@
|
|
1
|
-
import type {
|
2
|
-
import { Skia } from "../../skia/Skia";
|
1
|
+
import type { SkFontMgr, SkFont, Skia } from "../../skia/types";
|
3
2
|
|
4
3
|
export type FontDef = { font: SkFont } | { familyName: string; size: number };
|
5
4
|
|
@@ -8,11 +7,19 @@ export const isFont = (fontDef: FontDef): fontDef is { font: SkFont } =>
|
|
8
7
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
9
8
|
(fontDef as any).font !== undefined;
|
10
9
|
|
11
|
-
export const processFont = (
|
10
|
+
export const processFont = (
|
11
|
+
Skia: Skia,
|
12
|
+
fontMgr: SkFontMgr,
|
13
|
+
fontDef: FontDef
|
14
|
+
) => {
|
12
15
|
let selectedFont: SkFont;
|
13
16
|
if (isFont(fontDef)) {
|
14
17
|
selectedFont = fontDef.font;
|
15
18
|
} else {
|
19
|
+
console.warn(
|
20
|
+
// eslint-disable-next-line max-len
|
21
|
+
"Using system fonts is deprecated. Please use the font property instead: https://shopify.github.io/react-native-skia/docs/text/fonts"
|
22
|
+
);
|
16
23
|
const { familyName, size } = fontDef;
|
17
24
|
const typeface = fontMgr.matchFamilyStyle(familyName);
|
18
25
|
if (typeface === null) {
|
@@ -5,16 +5,16 @@ import {
|
|
5
5
|
PaintStyle,
|
6
6
|
StrokeJoin,
|
7
7
|
StrokeCap,
|
8
|
-
processColor,
|
9
8
|
isShader,
|
10
9
|
isMaskFilter,
|
11
10
|
isColorFilter,
|
12
11
|
isPathEffect,
|
13
12
|
isImageFilter,
|
14
|
-
|
15
|
-
} from "../../skia";
|
16
|
-
import type { SkPaint, Color, SkImageFilter } from "../../skia";
|
13
|
+
} from "../../skia/types";
|
14
|
+
import type { SkPaint, Color, SkImageFilter, Skia } from "../../skia/types";
|
17
15
|
import type { DeclarationResult } from "../nodes";
|
16
|
+
|
17
|
+
import { processColor } from "./Color";
|
18
18
|
export type SkEnum<T> = Uncapitalize<keyof T extends string ? keyof T : never>;
|
19
19
|
|
20
20
|
export interface ChildrenProps {
|
@@ -39,6 +39,7 @@ export const enumKey = <K extends string>(k: K) =>
|
|
39
39
|
(k.charAt(0).toUpperCase() + k.slice(1)) as Capitalize<K>;
|
40
40
|
|
41
41
|
export const processPaint = (
|
42
|
+
Skia: Skia,
|
42
43
|
paint: SkPaint,
|
43
44
|
currentOpacity: number,
|
44
45
|
{
|
@@ -59,11 +60,11 @@ export const processPaint = (
|
|
59
60
|
return paintRef.current;
|
60
61
|
}
|
61
62
|
if (color !== undefined) {
|
62
|
-
const c = processColor(color, currentOpacity);
|
63
|
+
const c = processColor(Skia, color, currentOpacity);
|
63
64
|
paint.setShader(null);
|
64
65
|
paint.setColor(c);
|
65
66
|
} else {
|
66
|
-
const c = processColor(paint.getColor(), currentOpacity);
|
67
|
+
const c = processColor(Skia, paint.getColor(), currentOpacity);
|
67
68
|
paint.setColor(c);
|
68
69
|
}
|
69
70
|
if (blendMode !== undefined) {
|
@@ -106,7 +107,11 @@ export const processPaint = (
|
|
106
107
|
paint.setImageFilter(
|
107
108
|
filters
|
108
109
|
.reverse()
|
109
|
-
.reduce<SkImageFilter | null>(
|
110
|
+
.reduce<SkImageFilter | null>(
|
111
|
+
(...args: Parameters<typeof Skia.ImageFilter.MakeCompose>) =>
|
112
|
+
Skia.ImageFilter.MakeCompose(...args),
|
113
|
+
null
|
114
|
+
)
|
110
115
|
);
|
111
116
|
}
|
112
117
|
return paint;
|
@@ -1,9 +1,9 @@
|
|
1
|
-
import type { SkPath } from "../../skia";
|
2
|
-
import {
|
1
|
+
import type { SkPath, Skia } from "../../skia/types";
|
2
|
+
import { isPath } from "../../skia/types";
|
3
3
|
|
4
4
|
export type PathDef = string | SkPath;
|
5
5
|
|
6
|
-
export const processPath = (rawPath: PathDef) => {
|
6
|
+
export const processPath = (Skia: Skia, rawPath: PathDef) => {
|
7
7
|
const path =
|
8
8
|
typeof rawPath === "string"
|
9
9
|
? Skia.Path.MakeFromSVGString(rawPath)
|
@@ -1,11 +1,10 @@
|
|
1
|
-
import type { Vector } from "
|
2
|
-
import { vec } from "./math";
|
1
|
+
import type { Skia, Vector } from "../../skia/types";
|
3
2
|
|
4
3
|
export type Radius = number | Vector;
|
5
4
|
|
6
|
-
export const processRadius = (radius: Radius): Vector => {
|
5
|
+
export const processRadius = (Skia: Skia, radius: Radius): Vector => {
|
7
6
|
if (typeof radius === "number") {
|
8
|
-
return
|
7
|
+
return Skia.Point(radius, radius);
|
9
8
|
}
|
10
9
|
return radius;
|
11
10
|
};
|
@@ -1,57 +1,18 @@
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
2
|
-
import type { SkRect, SkRRect } from "../../skia";
|
3
|
-
import { Skia } from "../../skia";
|
2
|
+
import type { Skia, SkRect, SkRRect, Vector } from "../../skia/types";
|
4
3
|
|
5
|
-
import type { Vector } from "./math/Vector";
|
6
|
-
import { vec } from "./math/Vector";
|
7
4
|
import type { Radius } from "./Radius";
|
8
5
|
import { processRadius } from "./Radius";
|
9
6
|
|
10
|
-
export const point = (x: number, y: number) => Skia.Point(x, y);
|
11
|
-
|
12
|
-
export const rect = (x: number, y: number, width: number, height: number) =>
|
13
|
-
Skia.XYWHRect(x, y, width, height);
|
14
|
-
|
15
|
-
export const rrect = (r: SkRect, rx: number, ry: number) =>
|
16
|
-
Skia.RRectXY(r, rx, ry);
|
17
|
-
|
18
|
-
export const bounds = (rects: SkRect[]) => {
|
19
|
-
const x = Math.min(...rects.map((r) => r.x));
|
20
|
-
const y = Math.min(...rects.map((r) => r.y));
|
21
|
-
const width = Math.max(...rects.map((r) => r.x + r.width));
|
22
|
-
const height = Math.max(...rects.map((r) => r.y + r.height));
|
23
|
-
return rect(x, y, width, height);
|
24
|
-
};
|
25
|
-
|
26
7
|
export const isEdge = (pos: Vector, b: SkRect) =>
|
27
8
|
pos.x === b.x || pos.y === b.y || pos.x === b.width || pos.y === b.height;
|
28
9
|
|
29
|
-
export const topLeft = (r: SkRect | SkRRect) =>
|
30
|
-
isRRect(r) ? vec(r.rect.x, r.rect.y) : vec(r.x, r.y);
|
31
|
-
export const topRight = (r: SkRect | SkRRect) =>
|
32
|
-
isRRect(r) ? vec(r.rect.x + r.rect.width, r.rect.y) : vec(r.x + r.width, r.y);
|
33
|
-
export const bottomLeft = (r: SkRect | SkRRect) =>
|
34
|
-
isRRect(r)
|
35
|
-
? vec(r.rect.x, r.rect.y + r.rect.height)
|
36
|
-
: vec(r.x, r.y + r.height);
|
37
|
-
export const bottomRight = (r: SkRect | SkRRect) =>
|
38
|
-
isRRect(r)
|
39
|
-
? vec(r.rect.x + r.rect.width, r.rect.y + r.rect.height)
|
40
|
-
: vec(r.x + r.width, r.y + r.height);
|
41
|
-
export const center = (r: SkRect | SkRRect) =>
|
42
|
-
isRRect(r)
|
43
|
-
? vec(r.rect.x + r.rect.width / 2, r.rect.y + r.rect.height / 2)
|
44
|
-
: vec(r.x + r.width / 2, r.y + r.height / 2);
|
45
|
-
|
46
10
|
// We have an issue to check property existence on JSI backed instances
|
47
11
|
const isRRectCtor = (def: RRectDef): def is RRectCtor =>
|
48
12
|
(def as any).rect === undefined;
|
49
13
|
// We have an issue to check property existence on JSI backed instances
|
50
14
|
const isRectCtor = (def: RectDef): def is RectCtor =>
|
51
15
|
(def as any).rect === undefined;
|
52
|
-
// We have an issue to check property existence on JSI backed instances
|
53
|
-
export const isRRect = (def: SkRect | SkRRect): def is SkRRect =>
|
54
|
-
(def as any).rect !== undefined;
|
55
16
|
|
56
17
|
export interface RectCtor {
|
57
18
|
x: number;
|
@@ -67,18 +28,22 @@ export interface RRectCtor extends RectCtor {
|
|
67
28
|
export type RectDef = RectCtor | { rect: SkRect };
|
68
29
|
export type RRectDef = RRectCtor | { rect: SkRRect };
|
69
30
|
|
70
|
-
export const processRect = (def: RectDef) => {
|
31
|
+
export const processRect = (Skia: Skia, def: RectDef) => {
|
71
32
|
if (isRectCtor(def)) {
|
72
|
-
return
|
33
|
+
return Skia.XYWHRect(def.x, def.y, def.width, def.height);
|
73
34
|
} else {
|
74
35
|
return def.rect;
|
75
36
|
}
|
76
37
|
};
|
77
38
|
|
78
|
-
export const processRRect = (def: RRectDef) => {
|
39
|
+
export const processRRect = (Skia: Skia, def: RRectDef) => {
|
79
40
|
if (isRRectCtor(def)) {
|
80
|
-
const r = processRadius(def.r);
|
81
|
-
return
|
41
|
+
const r = processRadius(Skia, def.r);
|
42
|
+
return Skia.RRectXY(
|
43
|
+
Skia.XYWHRect(def.x, def.y, def.width, def.height),
|
44
|
+
r.x,
|
45
|
+
r.y
|
46
|
+
);
|
82
47
|
} else {
|
83
48
|
return def.rect;
|
84
49
|
}
|
@@ -1,8 +1,6 @@
|
|
1
1
|
import type { DrawingContext } from "../DrawingContext";
|
2
|
-
import type { SkMatrix } from "../../skia/types";
|
3
|
-
|
4
|
-
import { neg, processTransform2d } from "./math";
|
5
|
-
import type { Transforms2d, Vector } from "./math";
|
2
|
+
import type { SkMatrix, Vector, Transforms2d } from "../../skia/types";
|
3
|
+
import { processTransform } from "../../skia/types";
|
6
4
|
|
7
5
|
export interface TransformProps {
|
8
6
|
transform?: Transforms2d;
|
@@ -10,35 +8,46 @@ export interface TransformProps {
|
|
10
8
|
matrix?: SkMatrix;
|
11
9
|
}
|
12
10
|
|
13
|
-
export const
|
14
|
-
{ canvas }: DrawingContext,
|
11
|
+
export const processCanvasTransform = (
|
12
|
+
{ canvas, Skia }: DrawingContext,
|
15
13
|
{ transform, origin, matrix }: TransformProps
|
16
14
|
) => {
|
17
|
-
if (
|
18
|
-
if (
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
);
|
15
|
+
if (matrix) {
|
16
|
+
if (origin) {
|
17
|
+
const m3 = Skia.Matrix();
|
18
|
+
m3.translate(origin.x, origin.y);
|
19
|
+
m3.concat(matrix);
|
20
|
+
m3.translate(-origin.x, -origin.y);
|
24
21
|
canvas.concat(m3);
|
22
|
+
} else {
|
23
|
+
canvas.concat(matrix);
|
25
24
|
}
|
25
|
+
} else if (transform) {
|
26
|
+
const m3 = processTransform(
|
27
|
+
Skia.Matrix(),
|
28
|
+
origin ? transformOrigin(origin, transform) : transform
|
29
|
+
);
|
30
|
+
canvas.concat(m3);
|
26
31
|
}
|
27
32
|
};
|
28
33
|
|
29
|
-
export const localMatrix = (
|
34
|
+
export const localMatrix = (
|
35
|
+
m: SkMatrix,
|
36
|
+
{ transform, origin }: TransformProps
|
37
|
+
) => {
|
30
38
|
if (transform) {
|
31
|
-
return
|
39
|
+
return processTransform(
|
40
|
+
m,
|
32
41
|
origin ? transformOrigin(origin, transform) : transform
|
33
42
|
);
|
34
43
|
}
|
35
44
|
return undefined;
|
36
45
|
};
|
37
46
|
|
38
|
-
const translate = (a: Vector) => [{ translateX: a.x }, { translateY: a.y }];
|
39
|
-
|
40
47
|
export const transformOrigin = (origin: Vector, transform: Transforms2d) => [
|
41
|
-
|
48
|
+
{ translateX: origin.x },
|
49
|
+
{ translateY: origin.y },
|
42
50
|
...transform,
|
43
|
-
|
51
|
+
{ translateX: -origin.x },
|
52
|
+
{ translateY: -origin.y },
|
44
53
|
];
|
@@ -1,4 +1,3 @@
|
|
1
|
-
export * from "./Paint";
|
2
1
|
export * from "./Transform";
|
3
2
|
export * from "./Animations";
|
4
3
|
export * from "./Circles";
|
@@ -8,3 +7,5 @@ export * from "./Font";
|
|
8
7
|
export * from "./Paths";
|
9
8
|
export * from "./Clips";
|
10
9
|
export * from "./Radius";
|
10
|
+
export * from "./Color";
|
11
|
+
export * from "./Paint";
|
@@ -1,5 +1,6 @@
|
|
1
|
+
import type { Vector } from "../../../skia/types";
|
2
|
+
|
1
3
|
import { canvas2Polar, polar2Canvas } from "./Coordinates";
|
2
|
-
import type { Vector } from "./Vector";
|
3
4
|
|
4
5
|
export const rotate = (tr: Vector, origin: Vector, rotation: number) => {
|
5
6
|
const { radius, theta } = canvas2Polar(tr, origin);
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import React, { useContext } from "react";
|
2
|
+
|
3
|
+
import type { Skia } from "../skia/types";
|
4
|
+
import type { SkiaValue } from "../values/types";
|
5
|
+
|
6
|
+
interface CanvasContext {
|
7
|
+
Skia: Skia;
|
8
|
+
size: SkiaValue<{ width: number; height: number }>;
|
9
|
+
}
|
10
|
+
|
11
|
+
const CanvasContext = React.createContext<CanvasContext | null>(null);
|
12
|
+
|
13
|
+
export const CanvasProvider = CanvasContext.Provider;
|
14
|
+
|
15
|
+
export const useCanvas = () => {
|
16
|
+
const ctx = useContext(CanvasContext);
|
17
|
+
if (!ctx) {
|
18
|
+
throw new Error("Canvas context is not available");
|
19
|
+
}
|
20
|
+
return ctx;
|
21
|
+
};
|
package/src/skia/NativeSetup.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
import { NativeModules } from "react-native";
|
1
|
+
import { NativeModules, Platform } from "react-native";
|
2
2
|
|
3
|
-
if (global.SkiaApi == null) {
|
3
|
+
if (Platform.OS !== "web" && global.SkiaApi == null) {
|
4
4
|
// Initialize RN Skia
|
5
5
|
const SkiaModule = NativeModules.RNSkia;
|
6
6
|
if (SkiaModule == null || typeof SkiaModule.install !== "function") {
|
package/src/skia/core/Data.ts
CHANGED
@@ -1,13 +1,19 @@
|
|
1
1
|
import type { DependencyList } from "react";
|
2
2
|
import { useRef, useEffect, useState } from "react";
|
3
|
-
import { Image } from "react-native";
|
3
|
+
import { Image, Platform } from "react-native";
|
4
4
|
|
5
5
|
import { Skia } from "../Skia";
|
6
|
-
import type {
|
6
|
+
import type { SkData, DataSource } from "../types";
|
7
|
+
|
8
|
+
const resolveAsset = (source: ReturnType<typeof require>) => {
|
9
|
+
return Platform.OS === "web"
|
10
|
+
? source.default
|
11
|
+
: Image.resolveAssetSource(source).uri;
|
12
|
+
};
|
7
13
|
|
8
14
|
export const useDataCollection = <T>(
|
9
15
|
sources: DataSource[],
|
10
|
-
factory: (data:
|
16
|
+
factory: (data: SkData[]) => T,
|
11
17
|
deps: DependencyList = []
|
12
18
|
) => {
|
13
19
|
const [data, setData] = useState<T | null>(null);
|
@@ -16,9 +22,7 @@ export const useDataCollection = <T>(
|
|
16
22
|
if (source instanceof Uint8Array) {
|
17
23
|
return source;
|
18
24
|
}
|
19
|
-
return typeof source === "string"
|
20
|
-
? source
|
21
|
-
: Image.resolveAssetSource(source).uri;
|
25
|
+
return typeof source === "string" ? source : resolveAsset(source);
|
22
26
|
});
|
23
27
|
Promise.all(
|
24
28
|
bytesOrURIs.map((bytesOrURI) =>
|
@@ -34,7 +38,7 @@ export const useDataCollection = <T>(
|
|
34
38
|
|
35
39
|
export const useRawData = <T>(
|
36
40
|
source: DataSource | null | undefined,
|
37
|
-
factory: (data:
|
41
|
+
factory: (data: SkData) => T,
|
38
42
|
onError?: (err: Error) => void
|
39
43
|
) => {
|
40
44
|
const [data, setData] = useState<T | null>(null);
|
@@ -44,7 +48,7 @@ export const useRawData = <T>(
|
|
44
48
|
if (prevSourceRef.current !== source) {
|
45
49
|
prevSourceRef.current = source;
|
46
50
|
if (source !== null && source !== undefined) {
|
47
|
-
const factoryWrapper = (data2:
|
51
|
+
const factoryWrapper = (data2: SkData) => {
|
48
52
|
const factoryResult = factory(data2);
|
49
53
|
if (factoryResult === null) {
|
50
54
|
onError && onError(new Error("Could not load data"));
|
@@ -57,20 +61,19 @@ export const useRawData = <T>(
|
|
57
61
|
factoryWrapper(Skia.Data.fromBytes(source));
|
58
62
|
} else {
|
59
63
|
const uri =
|
60
|
-
typeof source === "string"
|
61
|
-
? source
|
62
|
-
: Image.resolveAssetSource(source).uri;
|
64
|
+
typeof source === "string" ? source : resolveAsset(source);
|
63
65
|
Skia.Data.fromURI(uri).then((d) => factoryWrapper(d));
|
64
66
|
}
|
67
|
+
} else {
|
68
|
+
// new source is null or undefined -> remove cached data
|
69
|
+
setData(null);
|
65
70
|
}
|
66
|
-
} else {
|
67
|
-
setData(null);
|
68
71
|
}
|
69
72
|
}, [factory, onError, source]);
|
70
73
|
return data;
|
71
74
|
};
|
72
75
|
|
73
|
-
const identity = (data:
|
76
|
+
const identity = (data: SkData) => data;
|
74
77
|
|
75
78
|
export const useData = (
|
76
79
|
source: DataSource | null | undefined,
|
package/src/skia/core/Font.ts
CHANGED
@@ -16,14 +16,12 @@ export const useFont = (
|
|
16
16
|
): SkFont | null => {
|
17
17
|
const typeface = useTypeface(font, onError);
|
18
18
|
return useMemo(() => {
|
19
|
-
if (typeface
|
20
|
-
return null;
|
21
|
-
} else if (typeface && size) {
|
19
|
+
if (typeface && size) {
|
22
20
|
return Skia.Font(typeface, size);
|
23
21
|
} else if (typeface && !size) {
|
24
22
|
return Skia.Font(typeface);
|
25
23
|
} else {
|
26
|
-
return
|
24
|
+
return null;
|
27
25
|
}
|
28
26
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
29
27
|
}, [typeface]);
|
package/src/skia/core/Paint.ts
CHANGED
@@ -4,11 +4,6 @@ import { useMemo } from "react";
|
|
4
4
|
import { Skia } from "../Skia";
|
5
5
|
import type { SkPaint } from "../types";
|
6
6
|
|
7
|
-
export const SkiaPaint = () => {
|
8
|
-
const paint = Skia.Paint();
|
9
|
-
paint.setAntiAlias(true);
|
10
|
-
return paint;
|
11
|
-
};
|
12
7
|
/**
|
13
8
|
* Returns a Skia Paint object
|
14
9
|
* */
|
@@ -17,7 +12,8 @@ export const usePaint = (
|
|
17
12
|
deps?: DependencyList
|
18
13
|
) =>
|
19
14
|
useMemo(() => {
|
20
|
-
|
15
|
+
console.warn("usePaint() is deprecated. Use Skia.Paint() instead.");
|
16
|
+
const p = Skia.Paint();
|
21
17
|
if (initializer) {
|
22
18
|
initializer(p);
|
23
19
|
}
|
package/src/skia/core/Path.ts
CHANGED
@@ -15,6 +15,7 @@ export const usePath = (
|
|
15
15
|
deps?: DependencyList
|
16
16
|
) =>
|
17
17
|
useMemo(() => {
|
18
|
+
console.warn("usePath() is deprecated. Use Skia.Path.Make() instead.");
|
18
19
|
const p = Skia.Path.Make();
|
19
20
|
if (initializer) {
|
20
21
|
initializer(p);
|
@@ -31,6 +32,9 @@ export const usePath = (
|
|
31
32
|
// MakeFromSVGString
|
32
33
|
export const useSvgPath = (svgpath: string) =>
|
33
34
|
useMemo(() => {
|
35
|
+
console.warn(
|
36
|
+
"useSvgPath() is deprecated. Use Skia.Path.MakeFromSVGString() instead."
|
37
|
+
);
|
34
38
|
const p = Skia.Path.MakeFromSVGString(svgpath);
|
35
39
|
if (p === null) {
|
36
40
|
throw new Error(`Invalid SVG path: ${svgpath}`);
|
@@ -44,9 +48,13 @@ export const useSvgPath = (svgpath: string) =>
|
|
44
48
|
* @returns
|
45
49
|
*/
|
46
50
|
export const useTextPath = (text: string, x: number, y: number, font: SkFont) =>
|
47
|
-
|
48
|
-
(
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
51
|
+
useMemo(() => {
|
52
|
+
console.warn(
|
53
|
+
"useTextPath() is deprecated. Use Skia.Path.MakeFromText() instead."
|
54
|
+
);
|
55
|
+
const p = Skia.Path.MakeFromText(text, x, y, font);
|
56
|
+
if (p === null) {
|
57
|
+
throw new Error("Text path creation failed.");
|
58
|
+
}
|
59
|
+
return p;
|
60
|
+
}, [text, x, y, font]);
|
@@ -0,0 +1,33 @@
|
|
1
|
+
import { Skia } from "../Skia";
|
2
|
+
import type { SkRect, SkRRect } from "../types";
|
3
|
+
import { isRRect } from "../types";
|
4
|
+
|
5
|
+
import { vec } from "./Vector";
|
6
|
+
|
7
|
+
export const rect = (x: number, y: number, width: number, height: number) =>
|
8
|
+
Skia.XYWHRect(x, y, width, height);
|
9
|
+
|
10
|
+
export const bounds = (rects: SkRect[]) => {
|
11
|
+
const x = Math.min(...rects.map((r) => r.x));
|
12
|
+
const y = Math.min(...rects.map((r) => r.y));
|
13
|
+
const width = Math.max(...rects.map((r) => r.x + r.width));
|
14
|
+
const height = Math.max(...rects.map((r) => r.y + r.height));
|
15
|
+
return rect(x, y, width, height);
|
16
|
+
};
|
17
|
+
|
18
|
+
export const topLeft = (r: SkRect | SkRRect) =>
|
19
|
+
isRRect(r) ? vec(r.rect.x, r.rect.y) : vec(r.x, r.y);
|
20
|
+
export const topRight = (r: SkRect | SkRRect) =>
|
21
|
+
isRRect(r) ? vec(r.rect.x + r.rect.width, r.rect.y) : vec(r.x + r.width, r.y);
|
22
|
+
export const bottomLeft = (r: SkRect | SkRRect) =>
|
23
|
+
isRRect(r)
|
24
|
+
? vec(r.rect.x, r.rect.y + r.rect.height)
|
25
|
+
: vec(r.x, r.y + r.height);
|
26
|
+
export const bottomRight = (r: SkRect | SkRRect) =>
|
27
|
+
isRRect(r)
|
28
|
+
? vec(r.rect.x + r.rect.width, r.rect.y + r.rect.height)
|
29
|
+
: vec(r.x + r.width, r.y + r.height);
|
30
|
+
export const center = (r: SkRect | SkRRect) =>
|
31
|
+
isRRect(r)
|
32
|
+
? vec(r.rect.x + r.rect.width / 2, r.rect.y + r.rect.height / 2)
|
33
|
+
: vec(r.x + r.width / 2, r.y + r.height / 2);
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { Skia } from "../Skia";
|
2
|
+
import type { Vector } from "../types";
|
3
|
+
|
4
|
+
export const vec = (x = 0, y?: number) => Skia.Point(x, y ?? x);
|
5
|
+
export const point = vec;
|
6
|
+
export const neg = (a: Vector) => vec(-a.x, -a.y);
|
7
|
+
export const add = (a: Vector, b: Vector) => vec(a.x + b.x, a.y + b.y);
|
8
|
+
export const sub = (a: Vector, b: Vector) => vec(a.x - b.x, a.y - b.y);
|
9
|
+
export const dist = (a: Vector, b: Vector) => Math.hypot(a.x - b.x, a.y - b.y);
|
10
|
+
export const translate = ({ x, y }: Vector) =>
|
11
|
+
[{ translateX: x }, { translateY: y }] as const;
|
package/src/skia/core/index.ts
CHANGED
@@ -1,10 +1,12 @@
|
|
1
|
-
export * from "./Color";
|
2
1
|
export * from "./Data";
|
3
2
|
export * from "./Font";
|
4
3
|
export * from "./Typeface";
|
5
4
|
export * from "./Image";
|
6
5
|
export * from "./Picture";
|
7
6
|
export * from "./SVG";
|
8
|
-
export * from "./Shader";
|
9
|
-
export * from "./Paint";
|
10
7
|
export * from "./Path";
|
8
|
+
export * from "./Vector";
|
9
|
+
export * from "./Rect";
|
10
|
+
export * from "./RRect";
|
11
|
+
export * from "./Matrix";
|
12
|
+
export * from "./Paint";
|
@@ -8,15 +8,13 @@ export interface PosTan {
|
|
8
8
|
ty: number;
|
9
9
|
}
|
10
10
|
|
11
|
-
export interface SkContourMeasure extends SkJSIInstance<"
|
11
|
+
export interface SkContourMeasure extends SkJSIInstance<"ContourMeasure"> {
|
12
12
|
/**
|
13
13
|
* Returns the given position and tangent line for the distance on the given contour.
|
14
14
|
* The return value is 4 floats in this order: posX, posY, vecX, vecY.
|
15
15
|
* @param distance - will be pinned between 0 and length().
|
16
|
-
* @param output - if provided, the four floats of the PosTan will be copied into this array
|
17
|
-
* instead of allocating a new one.
|
18
16
|
*/
|
19
|
-
getPosTan(distance: number
|
17
|
+
getPosTan(distance: number): PosTan;
|
20
18
|
|
21
19
|
/**
|
22
20
|
* Returns an Path representing the segment of this contour.
|