@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
package/cpp/api/JsiSkPath.h
CHANGED
@@ -31,18 +31,19 @@ using namespace facebook;
|
|
31
31
|
|
32
32
|
|
33
33
|
class JsiSkPath : public JsiSkWrappingSharedPtrHostObject<SkPath> {
|
34
|
+
|
34
35
|
public:
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
36
|
+
// TODO: declare in JsiSkWrappingSkPtrHostObject via extra template parameter?
|
37
|
+
JSI_PROPERTY_GET(__typename__) {
|
38
|
+
return jsi::String::createFromUtf8(runtime, "Path");
|
39
|
+
}
|
39
40
|
|
40
|
-
|
41
|
+
JSI_HOST_FUNCTION(addArc) {
|
41
42
|
auto rect = JsiSkRect::fromValue(runtime, arguments[0]).get();
|
42
43
|
auto start = arguments[1].asNumber();
|
43
44
|
auto sweep = arguments[2].asNumber();
|
44
45
|
getObject()->addArc(*rect, start, sweep);
|
45
|
-
return
|
46
|
+
return thisValue.getObject(runtime);
|
46
47
|
}
|
47
48
|
|
48
49
|
JSI_HOST_FUNCTION(addOval) {
|
@@ -52,8 +53,8 @@ public:
|
|
52
53
|
direction = SkPathDirection::kCCW;
|
53
54
|
}
|
54
55
|
unsigned startIndex = count < 3 ? 0 : arguments[2].asNumber();
|
55
|
-
getObject()->addOval(*rect, direction, startIndex);
|
56
|
-
return
|
56
|
+
auto result = getObject()->addOval(*rect, direction, startIndex);
|
57
|
+
return thisValue.getObject(runtime);
|
57
58
|
}
|
58
59
|
|
59
60
|
JSI_HOST_FUNCTION(addPoly) {
|
@@ -68,7 +69,7 @@ public:
|
|
68
69
|
points.push_back(*point.get());
|
69
70
|
}
|
70
71
|
getObject()->addPoly(points.data(), (int)points.size(), close);
|
71
|
-
return
|
72
|
+
return thisValue.getObject(runtime);
|
72
73
|
}
|
73
74
|
|
74
75
|
JSI_HOST_FUNCTION(addRect) {
|
@@ -88,7 +89,7 @@ public:
|
|
88
89
|
direction = SkPathDirection::kCCW;
|
89
90
|
}
|
90
91
|
getObject()->addRRect(*rrect, direction);
|
91
|
-
return
|
92
|
+
return thisValue.getObject(runtime);
|
92
93
|
}
|
93
94
|
|
94
95
|
JSI_HOST_FUNCTION(arcToOval) {
|
@@ -97,7 +98,7 @@ public:
|
|
97
98
|
auto sweep = arguments[2].asNumber();
|
98
99
|
auto forceMoveTo = arguments[3].getBool();
|
99
100
|
getObject()->arcTo(*rect, start, sweep, forceMoveTo);
|
100
|
-
return
|
101
|
+
return thisValue.getObject(runtime);
|
101
102
|
}
|
102
103
|
|
103
104
|
JSI_HOST_FUNCTION(arcToRotated) {
|
@@ -112,7 +113,7 @@ public:
|
|
112
113
|
auto x = arguments[5].asNumber();
|
113
114
|
auto y = arguments[6].asNumber();
|
114
115
|
getObject()->arcTo(rx, ry, xAxisRotate, arcSize, sweep, x, y);
|
115
|
-
return
|
116
|
+
return thisValue.getObject(runtime);
|
116
117
|
}
|
117
118
|
|
118
119
|
JSI_HOST_FUNCTION(rArcTo) {
|
@@ -127,7 +128,7 @@ public:
|
|
127
128
|
auto x = arguments[5].asNumber();
|
128
129
|
auto y = arguments[6].asNumber();
|
129
130
|
getObject()->rArcTo(rx, ry, xAxisRotate, arcSize, sweep, x, y);
|
130
|
-
return
|
131
|
+
return thisValue.getObject(runtime);
|
131
132
|
}
|
132
133
|
|
133
134
|
JSI_HOST_FUNCTION(arcToTangent) {
|
@@ -137,7 +138,7 @@ public:
|
|
137
138
|
auto y2 = arguments[3].asNumber();
|
138
139
|
auto r = arguments[4].asNumber();
|
139
140
|
getObject()->arcTo(x1, y1, x2, y2, r);
|
140
|
-
return
|
141
|
+
return thisValue.getObject(runtime);
|
141
142
|
}
|
142
143
|
|
143
144
|
JSI_HOST_FUNCTION(computeTightBounds) {
|
@@ -160,7 +161,7 @@ public:
|
|
160
161
|
auto y2 = arguments[3].asNumber();
|
161
162
|
auto w = arguments[4].asNumber();
|
162
163
|
getObject()->conicTo(x1, y1, x2, y2, w);
|
163
|
-
return
|
164
|
+
return thisValue.getObject(runtime);
|
164
165
|
}
|
165
166
|
|
166
167
|
JSI_HOST_FUNCTION(rConicTo) {
|
@@ -170,7 +171,7 @@ public:
|
|
170
171
|
auto y2 = arguments[3].asNumber();
|
171
172
|
auto w = arguments[4].asNumber();
|
172
173
|
getObject()->rConicTo(x1, y1, x2, y2, w);
|
173
|
-
return
|
174
|
+
return thisValue.getObject(runtime);
|
174
175
|
}
|
175
176
|
|
176
177
|
JSI_HOST_FUNCTION(contains) {
|
@@ -270,7 +271,7 @@ public:
|
|
270
271
|
auto precision = jsiPrecision.isUndefined() ? 1 : jsiPrecision.asNumber();
|
271
272
|
auto result = p.getFillPath(path, &path, nullptr, precision);
|
272
273
|
getObject()->swap(path);
|
273
|
-
return jsi::Value(
|
274
|
+
return result ? thisValue.getObject(runtime) : jsi::Value::null();
|
274
275
|
}
|
275
276
|
|
276
277
|
JSI_HOST_FUNCTION(trim) {
|
@@ -284,15 +285,15 @@ public:
|
|
284
285
|
if (!pe) {
|
285
286
|
// SkDebugf("Invalid args to trim(): startT and stopT must be in
|
286
287
|
// [0,1]\n");
|
287
|
-
return jsi::Value(
|
288
|
+
return jsi::Value::null();
|
288
289
|
}
|
289
290
|
SkStrokeRec rec(SkStrokeRec::InitStyle::kHairline_InitStyle);
|
290
291
|
if (pe->filterPath(&path, path, &rec, nullptr)) {
|
291
292
|
getObject()->swap(path);
|
292
|
-
return
|
293
|
+
return thisValue.getObject(runtime);
|
293
294
|
}
|
294
295
|
SkDebugf("Could not trim path\n");
|
295
|
-
return jsi::Value(
|
296
|
+
return jsi::Value::null();
|
296
297
|
}
|
297
298
|
|
298
299
|
JSI_HOST_FUNCTION(getPoint) {
|
@@ -312,8 +313,8 @@ public:
|
|
312
313
|
JSI_HOST_FUNCTION(makeAsWinding) {
|
313
314
|
SkPath out;
|
314
315
|
if (AsWinding(*getObject(), &out)) {
|
315
|
-
|
316
|
-
|
316
|
+
getObject()->swap(out);
|
317
|
+
return thisValue.getObject(runtime);
|
317
318
|
}
|
318
319
|
return jsi::Value::null();
|
319
320
|
}
|
@@ -324,34 +325,34 @@ public:
|
|
324
325
|
SkScalar dx = arguments[0].asNumber();
|
325
326
|
SkScalar dy = arguments[1].asNumber();
|
326
327
|
getObject()->offset(dx, dy);
|
327
|
-
return
|
328
|
+
return thisValue.getObject(runtime);
|
328
329
|
}
|
329
330
|
|
330
331
|
JSI_HOST_FUNCTION(moveTo) {
|
331
332
|
SkScalar x = arguments[0].asNumber();
|
332
333
|
SkScalar y = arguments[1].asNumber();
|
333
334
|
getObject()->moveTo(x, y);
|
334
|
-
return
|
335
|
+
return thisValue.getObject(runtime);
|
335
336
|
}
|
336
337
|
|
337
338
|
JSI_HOST_FUNCTION(rMoveTo) {
|
338
339
|
SkScalar x = arguments[0].asNumber();
|
339
340
|
SkScalar y = arguments[1].asNumber();
|
340
341
|
getObject()->rMoveTo(x, y);
|
341
|
-
return
|
342
|
+
return thisValue.getObject(runtime);
|
342
343
|
}
|
343
344
|
JSI_HOST_FUNCTION(lineTo) {
|
344
345
|
SkScalar x = arguments[0].asNumber();
|
345
346
|
SkScalar y = arguments[1].asNumber();
|
346
347
|
getObject()->lineTo(x, y);
|
347
|
-
return
|
348
|
+
return thisValue.getObject(runtime);
|
348
349
|
}
|
349
350
|
|
350
351
|
JSI_HOST_FUNCTION(rlineTo) {
|
351
352
|
SkScalar x = arguments[0].asNumber();
|
352
353
|
SkScalar y = arguments[1].asNumber();
|
353
354
|
getObject()->rLineTo(x, y);
|
354
|
-
return
|
355
|
+
return thisValue.getObject(runtime);
|
355
356
|
}
|
356
357
|
|
357
358
|
JSI_HOST_FUNCTION(cubicTo) {
|
@@ -362,7 +363,7 @@ public:
|
|
362
363
|
auto x3 = arguments[4].asNumber();
|
363
364
|
auto y3 = arguments[5].asNumber();
|
364
365
|
getObject()->cubicTo(x1, y1, x2, y2, x3, y3);
|
365
|
-
return
|
366
|
+
return thisValue.getObject(runtime);
|
366
367
|
}
|
367
368
|
|
368
369
|
JSI_HOST_FUNCTION(rCubicTo) {
|
@@ -373,7 +374,7 @@ public:
|
|
373
374
|
auto x3 = arguments[4].asNumber();
|
374
375
|
auto y3 = arguments[5].asNumber();
|
375
376
|
getObject()->rCubicTo(x1, y1, x2, y2, x3, y3);
|
376
|
-
return
|
377
|
+
return thisValue.getObject(runtime);
|
377
378
|
}
|
378
379
|
|
379
380
|
JSI_HOST_FUNCTION(reset) {
|
@@ -401,7 +402,7 @@ public:
|
|
401
402
|
auto x2 = arguments[2].asNumber();
|
402
403
|
auto y2 = arguments[3].asNumber();
|
403
404
|
getObject()->rQuadTo(x1, y1, x2, y2);
|
404
|
-
return
|
405
|
+
return thisValue.getObject(runtime);
|
405
406
|
}
|
406
407
|
|
407
408
|
JSI_HOST_FUNCTION(addCircle) {
|
@@ -409,7 +410,7 @@ public:
|
|
409
410
|
auto y = arguments[1].asNumber();
|
410
411
|
auto r = arguments[2].asNumber();
|
411
412
|
getObject()->addCircle(x, y, r);
|
412
|
-
return
|
413
|
+
return thisValue.getObject(runtime);
|
413
414
|
}
|
414
415
|
|
415
416
|
JSI_HOST_FUNCTION(getLastPt) {
|
@@ -446,19 +447,6 @@ public:
|
|
446
447
|
runtime, std::make_shared<JsiSkPath>(getContext(), SkPath(*path)));
|
447
448
|
}
|
448
449
|
|
449
|
-
JSI_HOST_FUNCTION(fromText) {
|
450
|
-
auto text = arguments[0].asString(runtime).utf8(runtime);
|
451
|
-
auto x = arguments[1].asNumber();
|
452
|
-
auto y = arguments[2].asNumber();
|
453
|
-
auto font = JsiSkFont::fromValue(runtime, arguments[3]);
|
454
|
-
SkPath result;
|
455
|
-
SkTextUtils::GetPath(text.c_str(), strlen(text.c_str()),
|
456
|
-
SkTextEncoding::kUTF8, x, y, *font, &result);
|
457
|
-
|
458
|
-
getObject()->swap(result);
|
459
|
-
return jsi::Value::undefined();
|
460
|
-
}
|
461
|
-
|
462
450
|
JSI_HOST_FUNCTION(op) {
|
463
451
|
auto path2 = JsiSkPath::fromValue(runtime, arguments[0]);
|
464
452
|
int pathOp = arguments[1].asNumber();
|
@@ -479,7 +467,10 @@ public:
|
|
479
467
|
auto path2 = JsiSkPath::fromValue(runtime, arguments[0]);
|
480
468
|
auto weight = arguments[1].asNumber();
|
481
469
|
SkPath result;
|
482
|
-
getObject()->interpolate(*path2, weight, &result);
|
470
|
+
auto succeed = getObject()->interpolate(*path2, weight, &result);
|
471
|
+
if (!succeed) {
|
472
|
+
return nullptr;
|
473
|
+
}
|
483
474
|
return jsi::Object::createFromHostObject(
|
484
475
|
runtime, std::make_shared<JsiSkPath>(getContext(), std::move(result)));
|
485
476
|
}
|
@@ -489,8 +480,8 @@ public:
|
|
489
480
|
auto cmds = jsi::Array(runtime, path.countVerbs());
|
490
481
|
auto it = SkPath::Iter(path, false);
|
491
482
|
// { "Move", "Line", "Quad", "Conic", "Cubic", "Close", "Done" };
|
492
|
-
const int pointCount[] = { 1 ,
|
493
|
-
const int cmdCount[] = { 3 ,
|
483
|
+
const int pointCount[] = { 1 , 1 , 2 , 2 , 3 , 0 , 0 };
|
484
|
+
const int cmdCount[] = { 3 , 3 , 5 , 6 , 7 , 1 , 0 };
|
494
485
|
SkPoint points[4];
|
495
486
|
SkPath::Verb verb;
|
496
487
|
auto k = 0;
|
@@ -500,8 +491,8 @@ public:
|
|
500
491
|
auto j = 0;
|
501
492
|
cmd.setValueAtIndex(runtime, j++, jsi::Value(verbVal));
|
502
493
|
for (int i = 0; i < pointCount[verbVal]; ++i) {
|
503
|
-
cmd.setValueAtIndex(runtime, j++, jsi::Value(static_cast<double>(points[i].fX)));
|
504
|
-
cmd.setValueAtIndex(runtime, j++, jsi::Value(static_cast<double>(points[i].fY)));
|
494
|
+
cmd.setValueAtIndex(runtime, j++, jsi::Value(static_cast<double>(points[1 + i].fX)));
|
495
|
+
cmd.setValueAtIndex(runtime, j++, jsi::Value(static_cast<double>(points[1 + i].fY)));
|
505
496
|
}
|
506
497
|
if (SkPath::kConic_Verb == verb) {
|
507
498
|
cmd.setValueAtIndex(runtime, j, jsi::Value(static_cast<double>(it.conicWeight())));
|
@@ -514,8 +505,10 @@ public:
|
|
514
505
|
JSI_EXPORT_PROPERTY_GETTERS(JSI_EXPORT_PROP_GET(JsiSkPath, __typename__))
|
515
506
|
|
516
507
|
JSI_EXPORT_FUNCTIONS(
|
517
|
-
JSI_EXPORT_FUNC(JsiSkPath, addArc),
|
518
|
-
JSI_EXPORT_FUNC(JsiSkPath,
|
508
|
+
JSI_EXPORT_FUNC(JsiSkPath, addArc),
|
509
|
+
JSI_EXPORT_FUNC(JsiSkPath, addOval),
|
510
|
+
JSI_EXPORT_FUNC(JsiSkPath, addPoly),
|
511
|
+
JSI_EXPORT_FUNC(JsiSkPath, addRect),
|
519
512
|
JSI_EXPORT_FUNC(JsiSkPath, addRRect),
|
520
513
|
JSI_EXPORT_FUNC(JsiSkPath, arcToOval),
|
521
514
|
JSI_EXPORT_FUNC(JsiSkPath, arcToRotated),
|
@@ -523,28 +516,40 @@ public:
|
|
523
516
|
JSI_EXPORT_FUNC(JsiSkPath, arcToTangent),
|
524
517
|
JSI_EXPORT_FUNC(JsiSkPath, computeTightBounds),
|
525
518
|
JSI_EXPORT_FUNC(JsiSkPath, getBounds),
|
526
|
-
JSI_EXPORT_FUNC(JsiSkPath, conicTo),
|
527
|
-
JSI_EXPORT_FUNC(JsiSkPath,
|
519
|
+
JSI_EXPORT_FUNC(JsiSkPath, conicTo),
|
520
|
+
JSI_EXPORT_FUNC(JsiSkPath, rConicTo),
|
521
|
+
JSI_EXPORT_FUNC(JsiSkPath, contains),
|
522
|
+
JSI_EXPORT_FUNC(JsiSkPath, dash),
|
528
523
|
JSI_EXPORT_FUNC(JsiSkPath, equals),
|
529
524
|
JSI_EXPORT_FUNC(JsiSkPath, getFillType),
|
530
525
|
JSI_EXPORT_FUNC(JsiSkPath, setFillType),
|
531
526
|
JSI_EXPORT_FUNC(JsiSkPath, setIsVolatile),
|
532
527
|
JSI_EXPORT_FUNC(JsiSkPath, isVolatile),
|
533
|
-
JSI_EXPORT_FUNC(JsiSkPath, transform),
|
534
|
-
JSI_EXPORT_FUNC(JsiSkPath,
|
528
|
+
JSI_EXPORT_FUNC(JsiSkPath, transform),
|
529
|
+
JSI_EXPORT_FUNC(JsiSkPath, stroke),
|
530
|
+
JSI_EXPORT_FUNC(JsiSkPath, trim),
|
531
|
+
JSI_EXPORT_FUNC(JsiSkPath, getPoint),
|
535
532
|
JSI_EXPORT_FUNC(JsiSkPath, toSVGString),
|
536
533
|
JSI_EXPORT_FUNC(JsiSkPath, makeAsWinding),
|
537
|
-
JSI_EXPORT_FUNC(JsiSkPath, isEmpty),
|
538
|
-
JSI_EXPORT_FUNC(JsiSkPath,
|
539
|
-
JSI_EXPORT_FUNC(JsiSkPath,
|
540
|
-
JSI_EXPORT_FUNC(JsiSkPath,
|
541
|
-
JSI_EXPORT_FUNC(JsiSkPath,
|
542
|
-
JSI_EXPORT_FUNC(JsiSkPath,
|
534
|
+
JSI_EXPORT_FUNC(JsiSkPath, isEmpty),
|
535
|
+
JSI_EXPORT_FUNC(JsiSkPath, offset),
|
536
|
+
JSI_EXPORT_FUNC(JsiSkPath, moveTo),
|
537
|
+
JSI_EXPORT_FUNC(JsiSkPath, rMoveTo),
|
538
|
+
JSI_EXPORT_FUNC(JsiSkPath, lineTo),
|
539
|
+
JSI_EXPORT_FUNC(JsiSkPath, rlineTo),
|
540
|
+
JSI_EXPORT_FUNC(JsiSkPath, cubicTo),
|
541
|
+
JSI_EXPORT_FUNC(JsiSkPath, rCubicTo),
|
542
|
+
JSI_EXPORT_FUNC(JsiSkPath, reset),
|
543
|
+
JSI_EXPORT_FUNC(JsiSkPath, rewind),
|
544
|
+
JSI_EXPORT_FUNC(JsiSkPath, quadTo),
|
545
|
+
JSI_EXPORT_FUNC(JsiSkPath, rQuadTo),
|
543
546
|
JSI_EXPORT_FUNC(JsiSkPath, addCircle),
|
544
|
-
JSI_EXPORT_FUNC(JsiSkPath, getLastPt),
|
547
|
+
JSI_EXPORT_FUNC(JsiSkPath, getLastPt),
|
548
|
+
JSI_EXPORT_FUNC(JsiSkPath, close),
|
545
549
|
JSI_EXPORT_FUNC(JsiSkPath, simplify),
|
546
|
-
JSI_EXPORT_FUNC(JsiSkPath, countPoints),
|
547
|
-
JSI_EXPORT_FUNC(JsiSkPath,
|
550
|
+
JSI_EXPORT_FUNC(JsiSkPath, countPoints),
|
551
|
+
JSI_EXPORT_FUNC(JsiSkPath, copy),
|
552
|
+
JSI_EXPORT_FUNC(JsiSkPath, op),
|
548
553
|
JSI_EXPORT_FUNC(JsiSkPath, isInterpolatable),
|
549
554
|
JSI_EXPORT_FUNC(JsiSkPath, interpolate),
|
550
555
|
JSI_EXPORT_FUNC(JsiSkPath, toCmds),
|
@@ -552,7 +557,8 @@ public:
|
|
552
557
|
|
553
558
|
JsiSkPath(std::shared_ptr<RNSkPlatformContext> context, SkPath path)
|
554
559
|
: JsiSkWrappingSharedPtrHostObject<SkPath>(
|
555
|
-
std::move(context), std::make_shared<SkPath>(std::move(path))){
|
560
|
+
std::move(context), std::make_shared<SkPath>(std::move(path))) {
|
561
|
+
}
|
556
562
|
|
557
563
|
/**
|
558
564
|
Returns the underlying object from a host object of this type
|
@@ -147,10 +147,23 @@ public:
|
|
147
147
|
runtime, std::make_shared<JsiSkPath>(getContext(), std::move(path)));
|
148
148
|
}
|
149
149
|
|
150
|
+
JSI_HOST_FUNCTION(MakeFromText) {
|
151
|
+
auto text = arguments[0].asString(runtime).utf8(runtime);
|
152
|
+
auto x = arguments[1].asNumber();
|
153
|
+
auto y = arguments[2].asNumber();
|
154
|
+
auto font = JsiSkFont::fromValue(runtime, arguments[3]);
|
155
|
+
SkPath path;
|
156
|
+
SkTextUtils::GetPath(text.c_str(), strlen(text.c_str()),
|
157
|
+
SkTextEncoding::kUTF8, x, y, *font, &path);
|
158
|
+
return jsi::Object::createFromHostObject(
|
159
|
+
runtime, std::make_shared<JsiSkPath>(getContext(), std::move(path)));;
|
160
|
+
}
|
161
|
+
|
150
162
|
JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkPathFactory, Make),
|
151
163
|
JSI_EXPORT_FUNC(JsiSkPathFactory, MakeFromSVGString),
|
152
164
|
JSI_EXPORT_FUNC(JsiSkPathFactory, MakeFromOp),
|
153
|
-
JSI_EXPORT_FUNC(JsiSkPathFactory, MakeFromCmds)
|
165
|
+
JSI_EXPORT_FUNC(JsiSkPathFactory, MakeFromCmds),
|
166
|
+
JSI_EXPORT_FUNC(JsiSkPathFactory, MakeFromText))
|
154
167
|
|
155
168
|
JsiSkPathFactory(std::shared_ptr<RNSkPlatformContext> context)
|
156
169
|
: JsiSkHostObject(std::move(context)) {}
|
@@ -29,6 +29,24 @@ namespace RNSkia {
|
|
29
29
|
: JsiSkWrappingSharedPtrHostObject<SkRuntimeShaderBuilder>(
|
30
30
|
std::move(context), std::make_shared<SkRuntimeShaderBuilder>(rt)){}
|
31
31
|
|
32
|
+
JSI_HOST_FUNCTION(setUniform) {
|
33
|
+
auto name = arguments[0].asString(runtime).utf8(runtime);
|
34
|
+
auto jsiValue = arguments[1].asObject(runtime).asArray(runtime);
|
35
|
+
auto size = jsiValue.size(runtime);
|
36
|
+
std::vector<SkScalar> value;
|
37
|
+
value.reserve(size);
|
38
|
+
for (int i = 0; i < size; i++) {
|
39
|
+
auto e = jsiValue.getValueAtIndex(runtime, i).asNumber();
|
40
|
+
value.push_back(e);
|
41
|
+
}
|
42
|
+
getObject()->uniform(name.c_str()).set(value.data(), static_cast<int>(size));
|
43
|
+
return jsi::Value::undefined();
|
44
|
+
}
|
45
|
+
|
46
|
+
JSI_EXPORT_FUNCTIONS(
|
47
|
+
JSI_EXPORT_FUNC(JsiSkRuntimeShaderBuilder, setUniform)
|
48
|
+
)
|
49
|
+
|
32
50
|
/**
|
33
51
|
Returns the underlying object from a host object of this type
|
34
52
|
*/
|
package/cpp/api/JsiSkTypeface.h
CHANGED
@@ -6,6 +6,7 @@
|
|
6
6
|
#include <jsi/jsi.h>
|
7
7
|
|
8
8
|
#include "JsiSkHostObjects.h"
|
9
|
+
#include <RNSkLog.h>
|
9
10
|
|
10
11
|
#pragma clang diagnostic push
|
11
12
|
#pragma clang diagnostic ignored "-Wdocumentation"
|
@@ -21,8 +22,16 @@ using namespace facebook;
|
|
21
22
|
|
22
23
|
class JsiSkTypeface : public JsiSkWrappingSkPtrHostObject<SkTypeface> {
|
23
24
|
public:
|
24
|
-
JSI_PROPERTY_GET(bold) {
|
25
|
-
|
25
|
+
JSI_PROPERTY_GET(bold) {
|
26
|
+
RNSkLogger::warnToJavascriptConsole(runtime, "Typeface.bold is deprecated and will be removed in a future release.");
|
27
|
+
return jsi::Value(getObject()->isBold());
|
28
|
+
}
|
29
|
+
|
30
|
+
JSI_PROPERTY_GET(italic) {
|
31
|
+
RNSkLogger::warnToJavascriptConsole(runtime, "Typeface.italic is deprecated and will be removed in a future release.");
|
32
|
+
return jsi::Value(getObject()->isItalic());
|
33
|
+
}
|
34
|
+
|
26
35
|
// TODO: declare in JsiSkWrappingSkPtrHostObject via extra template parameter?
|
27
36
|
JSI_PROPERTY_GET(__typename__) {
|
28
37
|
return jsi::String::createFromUtf8(runtime, "Typeface");
|
@@ -17,8 +17,12 @@ namespace RNSkia {
|
|
17
17
|
public:
|
18
18
|
JSI_HOST_FUNCTION(MakeFreeTypeFaceFromData) {
|
19
19
|
auto data = JsiSkData::fromValue(runtime, arguments[0]);
|
20
|
+
auto typeface = SkFontMgr::RefDefault()->makeFromData(std::move(data));
|
21
|
+
if(typeface == nullptr) {
|
22
|
+
return jsi::Value::null();
|
23
|
+
}
|
20
24
|
return jsi::Object::createFromHostObject(
|
21
|
-
runtime, std::make_shared<JsiSkTypeface>(getContext(),
|
25
|
+
runtime, std::make_shared<JsiSkTypeface>(getContext(), typeface));
|
22
26
|
}
|
23
27
|
|
24
28
|
JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkTypefaceFactory, MakeFreeTypeFaceFromData))
|
@@ -23,6 +23,7 @@ using RNSkTouchPoint = struct {
|
|
23
23
|
double y;
|
24
24
|
double force;
|
25
25
|
RNSkTouchType type;
|
26
|
+
size_t id;
|
26
27
|
long timestamp;
|
27
28
|
};
|
28
29
|
|
@@ -45,6 +46,7 @@ public:
|
|
45
46
|
touchObj.setProperty(runtime, "force", t.force);
|
46
47
|
touchObj.setProperty(runtime, "type", (double)t.type);
|
47
48
|
touchObj.setProperty(runtime, "timestamp", (double)t.timestamp / 1000.0);
|
49
|
+
touchObj.setProperty(runtime, "id", (double)t.id);
|
48
50
|
touches.setValueAtIndex(runtime, n, touchObj);
|
49
51
|
}
|
50
52
|
ops.setValueAtIndex(runtime, i, touches);
|
package/cpp/utils/RNSkLog.h
CHANGED
@@ -5,6 +5,8 @@
|
|
5
5
|
#pragma once
|
6
6
|
|
7
7
|
#include <string>
|
8
|
+
#include <jsi/jsi.h>
|
9
|
+
|
8
10
|
#ifdef ANDROID
|
9
11
|
#include <android/log.h>
|
10
12
|
#endif
|
@@ -14,6 +16,9 @@
|
|
14
16
|
#endif
|
15
17
|
|
16
18
|
namespace RNSkia {
|
19
|
+
|
20
|
+
using namespace facebook;
|
21
|
+
|
17
22
|
class RNSkLogger {
|
18
23
|
public:
|
19
24
|
/**
|
@@ -49,5 +54,27 @@ public:
|
|
49
54
|
#endif
|
50
55
|
va_end(args);
|
51
56
|
}
|
57
|
+
|
58
|
+
static void logToJavascriptConsole(jsi::Runtime& runtime, const std::string& message) {
|
59
|
+
auto console = RNSkLogger::getJavascriptConsole(runtime).asObject(runtime);
|
60
|
+
auto log = console.getPropertyAsFunction(runtime, "log");
|
61
|
+
log.call(runtime, jsi::String::createFromUtf8(runtime, message));
|
62
|
+
}
|
63
|
+
|
64
|
+
static void warnToJavascriptConsole(jsi::Runtime& runtime, const std::string& message) {
|
65
|
+
auto console = RNSkLogger::getJavascriptConsole(runtime).asObject(runtime);
|
66
|
+
auto warn = console.getPropertyAsFunction(runtime, "warn");
|
67
|
+
warn.call(runtime, jsi::String::createFromUtf8(runtime, message));
|
68
|
+
}
|
69
|
+
|
70
|
+
private:
|
71
|
+
static jsi::Value getJavascriptConsole(jsi::Runtime& runtime) {
|
72
|
+
auto console = runtime.global().getProperty(runtime, "console");
|
73
|
+
if(console.isUndefined() || console.isNull()) {
|
74
|
+
jsi::detail::throwJSError(runtime, "Could not find console object.");
|
75
|
+
return jsi::Value::undefined();
|
76
|
+
}
|
77
|
+
return console;
|
78
|
+
}
|
52
79
|
};
|
53
80
|
} // namespace RNSkia
|
@@ -137,7 +137,8 @@
|
|
137
137
|
RNSkia::RNSkTouchPoint nextTouch;
|
138
138
|
nextTouch.x = position.x;
|
139
139
|
nextTouch.y = position.y;
|
140
|
-
nextTouch.force = [touch force];
|
140
|
+
nextTouch.force = [touch force];
|
141
|
+
nextTouch.id = [touch hash];
|
141
142
|
auto phase = [touch phase];
|
142
143
|
switch(phase) {
|
143
144
|
case UITouchPhaseBegan:
|
@@ -3,26 +3,56 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
6
|
+
|
7
|
+
var _interpolate = require("./interpolate");
|
8
|
+
|
9
|
+
Object.keys(_interpolate).forEach(function (key) {
|
10
|
+
if (key === "default" || key === "__esModule") return;
|
11
|
+
if (key in exports && exports[key] === _interpolate[key]) return;
|
12
|
+
Object.defineProperty(exports, key, {
|
13
|
+
enumerable: true,
|
14
|
+
get: function () {
|
15
|
+
return _interpolate[key];
|
16
|
+
}
|
17
|
+
});
|
11
18
|
});
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
19
|
+
|
20
|
+
var _interpolateColors = require("./interpolateColors");
|
21
|
+
|
22
|
+
Object.keys(_interpolateColors).forEach(function (key) {
|
23
|
+
if (key === "default" || key === "__esModule") return;
|
24
|
+
if (key in exports && exports[key] === _interpolateColors[key]) return;
|
25
|
+
Object.defineProperty(exports, key, {
|
26
|
+
enumerable: true,
|
27
|
+
get: function () {
|
28
|
+
return _interpolateColors[key];
|
29
|
+
}
|
30
|
+
});
|
17
31
|
});
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
32
|
+
|
33
|
+
var _interpolateVector = require("./interpolateVector");
|
34
|
+
|
35
|
+
Object.keys(_interpolateVector).forEach(function (key) {
|
36
|
+
if (key === "default" || key === "__esModule") return;
|
37
|
+
if (key in exports && exports[key] === _interpolateVector[key]) return;
|
38
|
+
Object.defineProperty(exports, key, {
|
39
|
+
enumerable: true,
|
40
|
+
get: function () {
|
41
|
+
return _interpolateVector[key];
|
42
|
+
}
|
43
|
+
});
|
23
44
|
});
|
24
45
|
|
25
|
-
var
|
46
|
+
var _interpolatePaths = require("./interpolatePaths");
|
26
47
|
|
27
|
-
|
48
|
+
Object.keys(_interpolatePaths).forEach(function (key) {
|
49
|
+
if (key === "default" || key === "__esModule") return;
|
50
|
+
if (key in exports && exports[key] === _interpolatePaths[key]) return;
|
51
|
+
Object.defineProperty(exports, key, {
|
52
|
+
enumerable: true,
|
53
|
+
get: function () {
|
54
|
+
return _interpolatePaths[key];
|
55
|
+
}
|
56
|
+
});
|
57
|
+
});
|
28
58
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["index.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export * from \"./interpolate\";\nexport * from \"./interpolateColors\";\nexport * from \"./interpolateVector\";\nexport * from \"./interpolatePaths\";\n"]}
|
@@ -0,0 +1,45 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.interpolatePaths = void 0;
|
7
|
+
|
8
|
+
/**
|
9
|
+
* Maps an input value within a range to an output path within a path range.
|
10
|
+
* @param value - The input value.
|
11
|
+
* @param inputRange - The range of the input value.
|
12
|
+
* @param outputRange - The range of the output path.
|
13
|
+
* @returns The output path.
|
14
|
+
* @example <caption>Map a value between 0 and 1 to a path between two paths.</caption>
|
15
|
+
* const path1 = new Path();
|
16
|
+
* path1.moveTo(0, 0);
|
17
|
+
* path1.lineTo(100, 0);
|
18
|
+
* const path2 = new Path();
|
19
|
+
* path2.moveTo(0, 0);
|
20
|
+
* path2.lineTo(0, 100);
|
21
|
+
* const path = interpolatePath(0.5, [0, 1], [path1, path2]);
|
22
|
+
*/
|
23
|
+
const interpolatePaths = (value, input, outputRange) => {
|
24
|
+
let i = 0;
|
25
|
+
|
26
|
+
for (; i <= input.length - 1; i++) {
|
27
|
+
if (value >= input[i] && value <= input[i + 1]) {
|
28
|
+
break;
|
29
|
+
}
|
30
|
+
|
31
|
+
if (i === input.length - 1) {
|
32
|
+
if (value < input[0]) {
|
33
|
+
return outputRange[0];
|
34
|
+
} else {
|
35
|
+
return outputRange[i];
|
36
|
+
}
|
37
|
+
}
|
38
|
+
}
|
39
|
+
|
40
|
+
const t = (value - input[i]) / (input[i + 1] - input[i]);
|
41
|
+
return outputRange[i + 1].interpolate(outputRange[i], t);
|
42
|
+
};
|
43
|
+
|
44
|
+
exports.interpolatePaths = interpolatePaths;
|
45
|
+
//# sourceMappingURL=interpolatePaths.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["interpolatePaths.ts"],"names":["interpolatePaths","value","input","outputRange","i","length","t","interpolate"],"mappings":";;;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,gBAAgB,GAAG,CAC9BC,KAD8B,EAE9BC,KAF8B,EAG9BC,WAH8B,KAI3B;AACH,MAAIC,CAAC,GAAG,CAAR;;AACA,SAAOA,CAAC,IAAIF,KAAK,CAACG,MAAN,GAAe,CAA3B,EAA8BD,CAAC,EAA/B,EAAmC;AACjC,QAAIH,KAAK,IAAIC,KAAK,CAACE,CAAD,CAAd,IAAqBH,KAAK,IAAIC,KAAK,CAACE,CAAC,GAAG,CAAL,CAAvC,EAAgD;AAC9C;AACD;;AACD,QAAIA,CAAC,KAAKF,KAAK,CAACG,MAAN,GAAe,CAAzB,EAA4B;AAC1B,UAAIJ,KAAK,GAAGC,KAAK,CAAC,CAAD,CAAjB,EAAsB;AACpB,eAAOC,WAAW,CAAC,CAAD,CAAlB;AACD,OAFD,MAEO;AACL,eAAOA,WAAW,CAACC,CAAD,CAAlB;AACD;AACF;AACF;;AACD,QAAME,CAAC,GAAG,CAACL,KAAK,GAAGC,KAAK,CAACE,CAAD,CAAd,KAAsBF,KAAK,CAACE,CAAC,GAAG,CAAL,CAAL,GAAeF,KAAK,CAACE,CAAD,CAA1C,CAAV;AACA,SAAOD,WAAW,CAACC,CAAC,GAAG,CAAL,CAAX,CAAmBG,WAAnB,CAA+BJ,WAAW,CAACC,CAAD,CAA1C,EAA+CE,CAA/C,CAAP;AACD,CApBM","sourcesContent":["import type { SkPath } from \"../../skia/types\";\n\n/**\n * Maps an input value within a range to an output path within a path range.\n * @param value - The input value.\n * @param inputRange - The range of the input value.\n * @param outputRange - The range of the output path.\n * @returns The output path.\n * @example <caption>Map a value between 0 and 1 to a path between two paths.</caption>\n * const path1 = new Path();\n * path1.moveTo(0, 0);\n * path1.lineTo(100, 0);\n * const path2 = new Path();\n * path2.moveTo(0, 0);\n * path2.lineTo(0, 100);\n * const path = interpolatePath(0.5, [0, 1], [path1, path2]);\n */\nexport const interpolatePaths = (\n value: number,\n input: number[],\n outputRange: SkPath[]\n) => {\n let i = 0;\n for (; i <= input.length - 1; i++) {\n if (value >= input[i] && value <= input[i + 1]) {\n break;\n }\n if (i === input.length - 1) {\n if (value < input[0]) {\n return outputRange[0];\n } else {\n return outputRange[i];\n }\n }\n }\n const t = (value - input[i]) / (input[i + 1] - input[i]);\n return outputRange[i + 1].interpolate(outputRange[i], t)!;\n};\n"]}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.mixVector = exports.interpolateVector = void 0;
|
7
|
+
|
8
|
+
var _interpolate = require("./interpolate");
|
9
|
+
|
10
|
+
const interpolateVector = (value, inputRange, outputRange, options) => ({
|
11
|
+
x: (0, _interpolate.interpolate)(value, inputRange, outputRange.map(v => v.x), options),
|
12
|
+
y: (0, _interpolate.interpolate)(value, inputRange, outputRange.map(v => v.y), options)
|
13
|
+
});
|
14
|
+
|
15
|
+
exports.interpolateVector = interpolateVector;
|
16
|
+
|
17
|
+
const mixVector = (value, from, to) => interpolateVector(value, [0, 1], [from, to]);
|
18
|
+
|
19
|
+
exports.mixVector = mixVector;
|
20
|
+
//# sourceMappingURL=interpolateVector.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["interpolateVector.ts"],"names":["interpolateVector","value","inputRange","outputRange","options","x","map","v","y","mixVector","from","to"],"mappings":";;;;;;;AAEA;;AAEO,MAAMA,iBAAiB,GAAG,CAC/BC,KAD+B,EAE/BC,UAF+B,EAG/BC,WAH+B,EAI/BC,OAJ+B,MAK3B;AACJC,EAAAA,CAAC,EAAE,8BACDJ,KADC,EAEDC,UAFC,EAGDC,WAAW,CAACG,GAAZ,CAAiBC,CAAD,IAAOA,CAAC,CAACF,CAAzB,CAHC,EAIDD,OAJC,CADC;AAOJI,EAAAA,CAAC,EAAE,8BACDP,KADC,EAEDC,UAFC,EAGDC,WAAW,CAACG,GAAZ,CAAiBC,CAAD,IAAOA,CAAC,CAACC,CAAzB,CAHC,EAIDJ,OAJC;AAPC,CAL2B,CAA1B;;;;AAoBA,MAAMK,SAAS,GAAG,CAACR,KAAD,EAAgBS,IAAhB,EAA8BC,EAA9B,KACvBX,iBAAiB,CAACC,KAAD,EAAQ,CAAC,CAAD,EAAI,CAAJ,CAAR,EAAgB,CAACS,IAAD,EAAOC,EAAP,CAAhB,CADZ","sourcesContent":["import type { Vector } from \"../../skia/types\";\n\nimport { interpolate } from \"./interpolate\";\n\nexport const interpolateVector = (\n value: number,\n inputRange: readonly number[],\n outputRange: readonly Vector[],\n options?: Parameters<typeof interpolate>[3]\n) => ({\n x: interpolate(\n value,\n inputRange,\n outputRange.map((v) => v.x),\n options\n ),\n y: interpolate(\n value,\n inputRange,\n outputRange.map((v) => v.y),\n options\n ),\n});\n\nexport const mixVector = (value: number, from: Vector, to: Vector) =>\n interpolateVector(value, [0, 1], [from, to]);\n"]}
|