@shopify/react-native-skia 0.1.129 → 0.1.132
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/SkiaOpenGLRenderer.h +1 -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/JsiSkMatrix.h +40 -27
- package/cpp/api/JsiSkPaint.h +3 -1
- package/cpp/api/JsiSkPath.h +67 -61
- package/cpp/api/JsiSkPathFactory.h +14 -1
- package/cpp/api/JsiSkRuntimeEffect.h +7 -9
- package/cpp/api/JsiSkRuntimeShaderBuilder.h +18 -0
- package/cpp/api/JsiSkTypeface.h +11 -2
- package/cpp/api/JsiSkTypefaceFactory.h +5 -1
- package/cpp/api/JsiSkVertices.h +0 -2
- package/cpp/rnskia/RNSkInfoParameter.h +2 -0
- package/cpp/rnskia/values/RNSkValue.h +1 -1
- package/cpp/skia/include/codec/SkCodec.h +7 -1
- package/cpp/skia/include/core/SkAlphaType.h +45 -0
- package/cpp/skia/include/core/SkBitmap.h +4 -2
- package/cpp/skia/include/core/SkCanvas.h +31 -20
- package/cpp/skia/include/core/SkColor.h +1 -1
- package/cpp/skia/include/core/SkColorFilter.h +1 -0
- package/cpp/skia/include/core/SkColorType.h +66 -0
- package/cpp/skia/include/core/SkDeferredDisplayListRecorder.h +1 -1
- package/cpp/skia/include/core/SkDrawable.h +7 -0
- package/cpp/skia/include/core/SkEncodedImageFormat.h +1 -0
- package/cpp/skia/include/core/SkFont.h +4 -3
- package/cpp/skia/include/core/SkFontArguments.h +33 -1
- package/cpp/skia/include/core/SkGraphics.h +13 -0
- package/cpp/skia/include/core/SkImage.h +67 -22
- package/cpp/skia/include/core/SkImageEncoder.h +0 -3
- package/cpp/skia/include/core/SkImageGenerator.h +4 -3
- package/cpp/skia/include/core/SkImageInfo.h +35 -142
- package/cpp/skia/include/core/SkMesh.h +303 -0
- package/cpp/skia/include/core/SkMilestone.h +1 -1
- package/cpp/skia/include/core/SkOpenTypeSVGDecoder.h +30 -0
- package/cpp/skia/include/core/SkPaint.h +4 -19
- package/cpp/skia/include/core/SkPath.h +20 -33
- package/cpp/skia/include/core/SkPathBuilder.h +1 -6
- package/cpp/skia/include/core/SkPixelRef.h +1 -1
- package/cpp/skia/include/core/SkPixmap.h +3 -2
- package/cpp/skia/include/core/SkRSXform.h +1 -1
- package/cpp/skia/include/core/SkSamplingOptions.h +16 -5
- package/cpp/skia/include/core/SkSpan.h +5 -5
- package/cpp/skia/include/core/SkString.h +5 -8
- package/cpp/skia/include/core/SkSurface.h +21 -0
- package/cpp/skia/include/core/SkTypeface.h +20 -4
- package/cpp/skia/include/core/SkTypes.h +9 -5
- package/cpp/skia/include/effects/SkGradientShader.h +9 -18
- package/cpp/skia/include/effects/SkRuntimeEffect.h +16 -12
- package/cpp/skia/include/gpu/GpuTypes.h +32 -0
- package/cpp/skia/include/gpu/GrBackendSemaphore.h +1 -1
- package/cpp/skia/include/gpu/GrBackendSurface.h +6 -5
- package/cpp/skia/include/gpu/GrBackendSurfaceMutableState.h +1 -1
- package/cpp/skia/include/gpu/GrContextOptions.h +11 -20
- package/cpp/skia/include/gpu/GrContextThreadSafeProxy.h +7 -0
- package/cpp/skia/include/gpu/GrDirectContext.h +16 -11
- package/cpp/skia/include/gpu/GrDriverBugWorkaroundsAutogen.h +0 -2
- package/cpp/skia/include/gpu/GrRecordingContext.h +14 -7
- package/cpp/skia/include/gpu/GrSurfaceInfo.h +6 -6
- package/cpp/skia/include/gpu/dawn/GrDawnTypes.h +1 -1
- package/cpp/skia/include/gpu/gl/GrGLFunctions.h +3 -1
- package/cpp/skia/include/gpu/gl/GrGLInterface.h +2 -2
- package/cpp/skia/include/gpu/graphite/BackendTexture.h +64 -0
- package/cpp/skia/include/gpu/graphite/Context.h +124 -0
- package/cpp/skia/include/gpu/graphite/GraphiteTypes.h +71 -0
- package/cpp/skia/include/gpu/graphite/Recorder.h +104 -0
- package/cpp/skia/include/gpu/graphite/Recording.h +39 -0
- package/cpp/skia/include/gpu/graphite/SkStuff.h +47 -0
- package/cpp/skia/include/gpu/graphite/TextureInfo.h +91 -0
- package/cpp/skia/include/gpu/graphite/mtl/MtlBackendContext.h +24 -0
- package/cpp/skia/include/gpu/graphite/mtl/MtlTypes.h +68 -0
- package/cpp/skia/include/gpu/mock/GrMockTypes.h +1 -2
- package/cpp/skia/include/ports/SkCFObject.h +0 -4
- package/cpp/skia/include/ports/SkTypeface_win.h +2 -2
- package/cpp/skia/include/private/{GrSingleOwner.h → SingleOwner.h} +17 -10
- package/cpp/skia/include/private/SkChecksum.h +11 -0
- package/cpp/skia/include/private/SkEncodedInfo.h +22 -5
- package/cpp/skia/include/private/SkFloatingPoint.h +0 -53
- package/cpp/skia/include/private/SkImageInfoPriv.h +8 -2
- package/cpp/skia/include/private/SkMacros.h +13 -18
- package/cpp/skia/include/private/SkMutex.h +8 -0
- package/cpp/skia/include/private/SkPathRef.h +2 -16
- package/cpp/skia/include/private/SkSLDefines.h +9 -1
- package/cpp/skia/include/private/SkSLIRNode.h +6 -5
- package/cpp/skia/include/private/SkSLLayout.h +11 -10
- package/cpp/skia/include/private/SkSLModifiers.h +4 -3
- package/cpp/skia/include/private/SkSLProgramElement.h +2 -2
- package/cpp/skia/include/private/SkSLProgramKind.h +8 -5
- package/cpp/skia/include/private/SkSLStatement.h +2 -3
- package/cpp/skia/include/private/SkSLString.h +17 -56
- package/cpp/skia/include/private/SkSLSymbol.h +4 -4
- package/cpp/skia/include/private/SkShadowFlags.h +3 -1
- package/cpp/skia/include/private/SkStringView.h +47 -0
- package/cpp/skia/include/private/SkTArray.h +4 -3
- package/cpp/skia/include/private/SkTHash.h +66 -24
- package/cpp/skia/include/private/SkTLogic.h +2 -32
- package/cpp/skia/include/private/SkTemplates.h +2 -2
- package/cpp/skia/include/private/SkThreadAnnotations.h +4 -4
- package/cpp/skia/include/private/SkVx.h +28 -28
- package/cpp/skia/include/private/chromium/GrSlug.h +40 -3
- package/cpp/skia/include/private/chromium/SkChromeRemoteGlyphCache.h +12 -6
- package/cpp/skia/include/private/{GrContext_Base.h → gpu/ganesh/GrContext_Base.h} +7 -0
- package/cpp/skia/include/private/{GrD3DTypesMinimal.h → gpu/ganesh/GrD3DTypesMinimal.h} +0 -0
- package/cpp/skia/include/private/{GrDawnTypesPriv.h → gpu/ganesh/GrDawnTypesPriv.h} +0 -0
- package/cpp/skia/include/private/{GrGLTypesPriv.h → gpu/ganesh/GrGLTypesPriv.h} +1 -0
- package/cpp/skia/include/private/{GrImageContext.h → gpu/ganesh/GrImageContext.h} +4 -4
- package/cpp/skia/include/private/{GrMockTypesPriv.h → gpu/ganesh/GrMockTypesPriv.h} +0 -0
- package/cpp/skia/include/private/{GrMtlTypesPriv.h → gpu/ganesh/GrMtlTypesPriv.h} +0 -0
- package/cpp/skia/include/private/{GrTypesPriv.h → gpu/ganesh/GrTypesPriv.h} +25 -367
- package/cpp/skia/include/private/{GrVkTypesPriv.h → gpu/ganesh/GrVkTypesPriv.h} +0 -0
- package/cpp/skia/include/private/gpu/graphite/MtlTypesPriv.h +74 -0
- package/cpp/skia/include/sksl/DSL.h +4 -0
- package/cpp/skia/include/sksl/DSLBlock.h +8 -3
- package/cpp/skia/include/sksl/DSLCase.h +6 -6
- package/cpp/skia/include/sksl/DSLCore.h +89 -78
- package/cpp/skia/include/sksl/DSLExpression.h +78 -45
- package/cpp/skia/include/sksl/DSLFunction.h +23 -18
- package/cpp/skia/include/sksl/DSLLayout.h +14 -16
- package/cpp/skia/include/sksl/DSLModifiers.h +7 -5
- package/cpp/skia/include/sksl/DSLRuntimeEffects.h +1 -1
- package/cpp/skia/include/sksl/DSLStatement.h +16 -10
- package/cpp/skia/include/sksl/DSLSymbols.h +7 -7
- package/cpp/skia/include/sksl/DSLType.h +27 -23
- package/cpp/skia/include/sksl/DSLVar.h +72 -61
- package/cpp/skia/include/sksl/SkSLErrorReporter.h +12 -49
- package/cpp/skia/include/sksl/SkSLOperator.h +151 -0
- package/cpp/skia/include/sksl/SkSLPosition.h +102 -0
- package/cpp/skia/include/svg/SkSVGCanvas.h +5 -1
- package/cpp/skia/include/utils/SkAnimCodecPlayer.h +7 -0
- package/cpp/skia/include/utils/SkCamera.h +2 -0
- package/cpp/skia/include/utils/SkCanvasStateUtils.h +4 -1
- package/cpp/skia/include/utils/SkCustomTypeface.h +6 -4
- package/cpp/skia/include/utils/SkNWayCanvas.h +34 -0
- package/cpp/skia/include/utils/SkNullCanvas.h +5 -1
- package/cpp/skia/include/utils/SkOrderedFontMgr.h +12 -0
- package/cpp/skia/include/utils/SkPaintFilterCanvas.h +30 -1
- package/cpp/skia/include/utils/SkParse.h +2 -0
- package/cpp/skia/include/utils/SkShadowUtils.h +3 -2
- package/cpp/skia/include/utils/SkTextUtils.h +8 -4
- package/cpp/skia/modules/svg/include/SkSVGAttributeParser.h +27 -1
- package/cpp/skia/modules/svg/include/SkSVGDOM.h +4 -0
- package/cpp/skia/modules/svg/include/SkSVGOpenTypeSVGDecoder.h +32 -0
- package/cpp/skia/modules/svg/include/SkSVGRenderContext.h +3 -3
- package/cpp/skia/modules/svg/include/SkSVGSVG.h +2 -0
- package/cpp/skia/modules/svg/include/SkSVGTypes.h +48 -9
- package/cpp/utils/RNSkLog.h +27 -0
- package/ios/RNSkia-iOS/PlatformContext.h +1 -1
- package/ios/RNSkia-iOS/RNSkDrawViewImpl.mm +1 -0
- package/ios/RNSkia-iOS/SkiaDrawView.mm +3 -2
- 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 -44
- 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/ImageFactory.js.map +1 -1
- package/lib/commonjs/skia/types/Matrix.js +58 -1
- package/lib/commonjs/skia/types/Matrix.js.map +1 -1
- package/lib/commonjs/skia/types/Path/Path.js +1 -0
- package/lib/commonjs/skia/types/Path/Path.js.map +1 -1
- package/lib/commonjs/skia/types/Point.js.map +1 -1
- package/lib/commonjs/skia/types/RRect.js +7 -0
- package/lib/commonjs/skia/types/RRect.js.map +1 -1
- package/lib/commonjs/skia/types/Shader/Shader.js +51 -1
- package/lib/commonjs/skia/types/Shader/Shader.js.map +1 -1
- package/lib/commonjs/skia/web/{api/Host.js → Host.js} +10 -1
- package/lib/commonjs/skia/web/Host.js.map +1 -0
- package/lib/commonjs/skia/web/JsiImageFilterFactory.js +68 -0
- package/lib/commonjs/skia/web/JsiImageFilterFactory.js.map +1 -0
- package/lib/commonjs/skia/web/{api/JsiSkCanvas.js → JsiSkCanvas.js} +20 -6
- package/lib/commonjs/skia/web/JsiSkCanvas.js.map +1 -0
- package/lib/commonjs/skia/web/{api/JsiSkColor.js → JsiSkColor.js} +163 -4
- package/lib/commonjs/skia/web/JsiSkColor.js.map +1 -0
- package/lib/commonjs/skia/web/{api/JsiSkColorFilter.js → JsiSkColorFilter.js} +0 -0
- package/lib/commonjs/skia/web/{api/JsiSkColorFilter.js.map → JsiSkColorFilter.js.map} +1 -1
- package/lib/commonjs/skia/web/JsiSkColorFilterFactory.js +48 -0
- package/lib/commonjs/skia/web/JsiSkColorFilterFactory.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkContourMeasure.js +42 -0
- package/lib/commonjs/skia/web/JsiSkContourMeasure.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkContourMeasureIter.js +30 -0
- package/lib/commonjs/skia/web/JsiSkContourMeasureIter.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkData.js +18 -0
- package/lib/commonjs/skia/web/JsiSkData.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkDataFactory.js +44 -0
- package/lib/commonjs/skia/web/JsiSkDataFactory.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkFont.js +113 -0
- package/lib/commonjs/skia/web/JsiSkFont.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkFontMgr.js +35 -0
- package/lib/commonjs/skia/web/JsiSkFontMgr.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkFontMgrFactory.js +25 -0
- package/lib/commonjs/skia/web/JsiSkFontMgrFactory.js.map +1 -0
- package/lib/commonjs/skia/web/{api/JsiSkImage.js → JsiSkImage.js} +0 -0
- package/lib/commonjs/skia/web/{api/JsiSkImage.js.map → JsiSkImage.js.map} +1 -1
- package/lib/commonjs/skia/web/JsiSkImageFactory.js +47 -0
- package/lib/commonjs/skia/web/JsiSkImageFactory.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkImageFilter.js +18 -0
- package/lib/commonjs/skia/web/JsiSkImageFilter.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkMaskFilter.js +18 -0
- package/lib/commonjs/skia/web/JsiSkMaskFilter.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkMaskFilterFactory.js +24 -0
- package/lib/commonjs/skia/web/JsiSkMaskFilterFactory.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkMatrix.js +38 -0
- package/lib/commonjs/skia/web/JsiSkMatrix.js.map +1 -0
- package/lib/commonjs/skia/web/{api/JsiSkPaint.js → JsiSkPaint.js} +4 -9
- package/lib/commonjs/skia/web/JsiSkPaint.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkPath.js +324 -0
- package/lib/commonjs/skia/web/JsiSkPath.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkPathEffect.js +18 -0
- package/lib/commonjs/skia/web/JsiSkPathEffect.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkPathEffectFactory.js +78 -0
- package/lib/commonjs/skia/web/JsiSkPathEffectFactory.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkPathFactory.js +58 -0
- package/lib/commonjs/skia/web/JsiSkPathFactory.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkPicture.js +29 -0
- package/lib/commonjs/skia/web/JsiSkPicture.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkPictureFactory.js +30 -0
- package/lib/commonjs/skia/web/JsiSkPictureFactory.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkPictureRecorder.js +30 -0
- package/lib/commonjs/skia/web/JsiSkPictureRecorder.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkPoint.js +26 -0
- package/lib/commonjs/skia/web/JsiSkPoint.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkRRect.js +32 -0
- package/lib/commonjs/skia/web/JsiSkRRect.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkRSXform.js +18 -0
- package/lib/commonjs/skia/web/JsiSkRSXform.js.map +1 -0
- package/lib/commonjs/skia/web/{api/JsiSkRect.js → JsiSkRect.js} +8 -0
- package/lib/commonjs/skia/web/JsiSkRect.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkRuntimeEffect.js +44 -0
- package/lib/commonjs/skia/web/JsiSkRuntimeEffect.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkRuntimeEffectFactory.js +30 -0
- package/lib/commonjs/skia/web/JsiSkRuntimeEffectFactory.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkSVGFactory.js +26 -0
- package/lib/commonjs/skia/web/JsiSkSVGFactory.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkShader.js +18 -0
- package/lib/commonjs/skia/web/JsiSkShader.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkShaderFactory.js +52 -0
- package/lib/commonjs/skia/web/JsiSkShaderFactory.js.map +1 -0
- package/lib/commonjs/skia/web/{api/JsiSkSurface.js → JsiSkSurface.js} +0 -0
- package/lib/commonjs/skia/web/{api/JsiSkSurface.js.map → JsiSkSurface.js.map} +1 -1
- package/lib/commonjs/skia/web/{api/JsiSkSurfaceFactory.js → JsiSkSurfaceFactory.js} +0 -0
- package/lib/commonjs/skia/web/{api/JsiSkSurfaceFactory.js.map → JsiSkSurfaceFactory.js.map} +1 -1
- package/lib/commonjs/skia/web/JsiSkTextBlob.js +18 -0
- package/lib/commonjs/skia/web/JsiSkTextBlob.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkTextBlobFactory.js +36 -0
- package/lib/commonjs/skia/web/JsiSkTextBlobFactory.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkTypeface.js +28 -0
- package/lib/commonjs/skia/web/JsiSkTypeface.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkTypefaceFactory.js +30 -0
- package/lib/commonjs/skia/web/JsiSkTypefaceFactory.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkVertices.js +28 -0
- package/lib/commonjs/skia/web/JsiSkVertices.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkVerticesFactory.js +27 -0
- package/lib/commonjs/skia/web/JsiSkVerticesFactory.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkia.js +97 -0
- package/lib/commonjs/skia/web/JsiSkia.js.map +1 -0
- package/lib/commonjs/skia/web/index.js +4 -4
- package/lib/commonjs/skia/web/index.js.map +1 -1
- package/lib/commonjs/values/web/api.js +2 -2
- package/lib/commonjs/values/web/api.js.map +1 -1
- package/lib/commonjs/views/SkiaView.web.js +216 -0
- package/lib/commonjs/views/SkiaView.web.js.map +1 -0
- package/lib/commonjs/views/types.js.map +1 -1
- package/lib/commonjs/views/useTouchHandler.js +70 -46
- package/lib/commonjs/views/useTouchHandler.js.map +1 -1
- package/lib/commonjs/web/index.js +20 -0
- package/lib/commonjs/web/index.js.map +1 -0
- package/lib/module/animation/functions/index.js +4 -2
- package/lib/module/animation/functions/index.js.map +1 -1
- package/lib/module/animation/functions/interpolatePaths.js +36 -0
- package/lib/module/animation/functions/interpolatePaths.js.map +1 -0
- package/lib/module/animation/functions/interpolateVector.js +7 -0
- package/lib/module/animation/functions/interpolateVector.js.map +1 -0
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/renderer/Canvas.js +15 -26
- package/lib/module/renderer/Canvas.js.map +1 -1
- package/lib/module/renderer/HostConfig.js +2 -2
- package/lib/module/renderer/HostConfig.js.map +1 -1
- package/lib/module/renderer/components/Blend.js +5 -2
- package/lib/module/renderer/components/Blend.js.map +1 -1
- package/lib/module/renderer/components/Compose.js +5 -2
- package/lib/module/renderer/components/Compose.js.map +1 -1
- package/lib/module/renderer/components/Group.js +7 -6
- package/lib/module/renderer/components/Group.js.map +1 -1
- package/lib/module/renderer/components/Mask.js +7 -3
- package/lib/module/renderer/components/Mask.js.map +1 -1
- package/lib/module/renderer/components/Paint.js +6 -3
- package/lib/module/renderer/components/Paint.js.map +1 -1
- package/lib/module/renderer/components/Picture.js.map +1 -1
- package/lib/module/renderer/components/backdrop/BackdropFilter.js +1 -1
- package/lib/module/renderer/components/backdrop/BackdropFilter.js.map +1 -1
- package/lib/module/renderer/components/colorFilters/BlendColor.js +6 -3
- package/lib/module/renderer/components/colorFilters/BlendColor.js.map +1 -1
- package/lib/module/renderer/components/colorFilters/Compose.js +2 -2
- package/lib/module/renderer/components/colorFilters/Compose.js.map +1 -1
- package/lib/module/renderer/components/colorFilters/Lerp.js +6 -3
- package/lib/module/renderer/components/colorFilters/Lerp.js.map +1 -1
- package/lib/module/renderer/components/colorFilters/LinearToSRGBGamma.js +5 -3
- package/lib/module/renderer/components/colorFilters/LinearToSRGBGamma.js.map +1 -1
- package/lib/module/renderer/components/colorFilters/LumaColorFilter.js +5 -3
- package/lib/module/renderer/components/colorFilters/LumaColorFilter.js.map +1 -1
- package/lib/module/renderer/components/colorFilters/Matrix.js +5 -3
- package/lib/module/renderer/components/colorFilters/Matrix.js.map +1 -1
- package/lib/module/renderer/components/colorFilters/SRGBToLinearGamma.js +5 -3
- package/lib/module/renderer/components/colorFilters/SRGBToLinearGamma.js.map +1 -1
- package/lib/module/renderer/components/image/BoxFit.js +7 -8
- package/lib/module/renderer/components/image/BoxFit.js.map +1 -1
- package/lib/module/renderer/components/image/Image.js +3 -2
- package/lib/module/renderer/components/image/Image.js.map +1 -1
- package/lib/module/renderer/components/image/ImageSVG.js +3 -2
- package/lib/module/renderer/components/image/ImageSVG.js.map +1 -1
- package/lib/module/renderer/components/image/ImageShader.js +10 -7
- package/lib/module/renderer/components/image/ImageShader.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/Blur.js +7 -4
- package/lib/module/renderer/components/imageFilters/Blur.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/DisplacementMap.js +7 -4
- package/lib/module/renderer/components/imageFilters/DisplacementMap.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/InnerShadow.js +3 -3
- package/lib/module/renderer/components/imageFilters/InnerShadow.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/Morphology.js +6 -4
- package/lib/module/renderer/components/imageFilters/Morphology.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/Offset.js +5 -3
- package/lib/module/renderer/components/imageFilters/Offset.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/RuntimeShader.js +13 -4
- package/lib/module/renderer/components/imageFilters/RuntimeShader.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/Shadow.js +6 -5
- package/lib/module/renderer/components/imageFilters/Shadow.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/getInput.js +2 -2
- package/lib/module/renderer/components/imageFilters/getInput.js.map +1 -1
- package/lib/module/renderer/components/maskFilters/Blur.js +5 -2
- package/lib/module/renderer/components/maskFilters/Blur.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/Corner.js +5 -2
- package/lib/module/renderer/components/pathEffects/Corner.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/Dash.js +5 -2
- package/lib/module/renderer/components/pathEffects/Dash.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/Discrete.js +5 -2
- package/lib/module/renderer/components/pathEffects/Discrete.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/Line2D.js +5 -2
- package/lib/module/renderer/components/pathEffects/Line2D.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/Path1D.js +6 -3
- package/lib/module/renderer/components/pathEffects/Path1D.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/Path2D.js +6 -3
- package/lib/module/renderer/components/pathEffects/Path2D.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/Sum.js +5 -2
- package/lib/module/renderer/components/pathEffects/Sum.js.map +1 -1
- package/lib/module/renderer/components/shaders/Color.js +6 -3
- package/lib/module/renderer/components/shaders/Color.js.map +1 -1
- package/lib/module/renderer/components/shaders/FractalNoise.js +4 -2
- package/lib/module/renderer/components/shaders/FractalNoise.js.map +1 -1
- package/lib/module/renderer/components/shaders/Gradient.js +3 -3
- package/lib/module/renderer/components/shaders/Gradient.js.map +1 -1
- package/lib/module/renderer/components/shaders/LinearGradient.js +5 -3
- package/lib/module/renderer/components/shaders/LinearGradient.js.map +1 -1
- package/lib/module/renderer/components/shaders/RadialGradient.js +5 -3
- package/lib/module/renderer/components/shaders/RadialGradient.js.map +1 -1
- package/lib/module/renderer/components/shaders/Shader.js +6 -45
- 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/ImageFactory.js.map +1 -1
- package/lib/module/skia/types/Matrix.js +55 -0
- package/lib/module/skia/types/Matrix.js.map +1 -1
- package/lib/module/skia/types/Path/Path.js +1 -0
- package/lib/module/skia/types/Path/Path.js.map +1 -1
- package/lib/module/skia/types/Point.js.map +1 -1
- package/lib/module/skia/types/RRect.js +3 -1
- package/lib/module/skia/types/RRect.js.map +1 -1
- package/lib/module/skia/types/Shader/Shader.js +48 -0
- package/lib/module/skia/types/Shader/Shader.js.map +1 -1
- package/lib/module/skia/web/{api/Host.js → Host.js} +6 -0
- package/lib/module/skia/web/Host.js.map +1 -0
- package/lib/module/skia/web/JsiImageFilterFactory.js +57 -0
- package/lib/module/skia/web/JsiImageFilterFactory.js.map +1 -0
- package/lib/module/skia/web/{api/JsiSkCanvas.js → JsiSkCanvas.js} +19 -6
- package/lib/module/skia/web/JsiSkCanvas.js.map +1 -0
- package/lib/module/skia/web/{api/JsiSkColor.js → JsiSkColor.js} +164 -4
- package/lib/module/skia/web/JsiSkColor.js.map +1 -0
- package/lib/module/skia/web/{api/JsiSkColorFilter.js → JsiSkColorFilter.js} +0 -0
- package/lib/module/skia/web/{api/JsiSkColorFilter.js.map → JsiSkColorFilter.js.map} +1 -1
- package/lib/module/skia/web/JsiSkColorFilterFactory.js +37 -0
- package/lib/module/skia/web/JsiSkColorFilterFactory.js.map +1 -0
- package/lib/module/skia/web/JsiSkContourMeasure.js +31 -0
- package/lib/module/skia/web/JsiSkContourMeasure.js.map +1 -0
- package/lib/module/skia/web/JsiSkContourMeasureIter.js +19 -0
- package/lib/module/skia/web/JsiSkContourMeasureIter.js.map +1 -0
- package/lib/module/skia/web/JsiSkData.js +8 -0
- package/lib/module/skia/web/JsiSkData.js.map +1 -0
- package/lib/module/skia/web/JsiSkDataFactory.js +33 -0
- package/lib/module/skia/web/JsiSkDataFactory.js.map +1 -0
- package/lib/module/skia/web/JsiSkFont.js +101 -0
- package/lib/module/skia/web/JsiSkFont.js.map +1 -0
- package/lib/module/skia/web/JsiSkFontMgr.js +25 -0
- package/lib/module/skia/web/JsiSkFontMgr.js.map +1 -0
- package/lib/module/skia/web/JsiSkFontMgrFactory.js +14 -0
- package/lib/module/skia/web/JsiSkFontMgrFactory.js.map +1 -0
- package/lib/module/skia/web/{api/JsiSkImage.js → JsiSkImage.js} +0 -0
- package/lib/module/skia/web/{api/JsiSkImage.js.map → JsiSkImage.js.map} +1 -1
- package/lib/module/skia/web/JsiSkImageFactory.js +36 -0
- package/lib/module/skia/web/JsiSkImageFactory.js.map +1 -0
- package/lib/module/skia/web/JsiSkImageFilter.js +8 -0
- package/lib/module/skia/web/JsiSkImageFilter.js.map +1 -0
- package/lib/module/skia/web/JsiSkMaskFilter.js +8 -0
- package/lib/module/skia/web/JsiSkMaskFilter.js.map +1 -0
- package/lib/module/skia/web/JsiSkMaskFilterFactory.js +13 -0
- package/lib/module/skia/web/JsiSkMaskFilterFactory.js.map +1 -0
- package/lib/module/skia/web/JsiSkMatrix.js +28 -0
- package/lib/module/skia/web/JsiSkMatrix.js.map +1 -0
- package/lib/module/skia/web/{api/JsiSkPaint.js → JsiSkPaint.js} +5 -10
- package/lib/module/skia/web/JsiSkPaint.js.map +1 -0
- package/lib/module/skia/web/JsiSkPath.js +311 -0
- package/lib/module/skia/web/JsiSkPath.js.map +1 -0
- package/lib/module/skia/web/JsiSkPathEffect.js +8 -0
- package/lib/module/skia/web/JsiSkPathEffect.js.map +1 -0
- package/lib/module/skia/web/JsiSkPathEffectFactory.js +67 -0
- package/lib/module/skia/web/JsiSkPathEffectFactory.js.map +1 -0
- package/lib/module/skia/web/JsiSkPathFactory.js +47 -0
- package/lib/module/skia/web/JsiSkPathFactory.js.map +1 -0
- package/lib/module/skia/web/JsiSkPicture.js +18 -0
- package/lib/module/skia/web/JsiSkPicture.js.map +1 -0
- package/lib/module/skia/web/JsiSkPictureFactory.js +19 -0
- package/lib/module/skia/web/JsiSkPictureFactory.js.map +1 -0
- package/lib/module/skia/web/JsiSkPictureRecorder.js +18 -0
- package/lib/module/skia/web/JsiSkPictureRecorder.js.map +1 -0
- package/lib/module/skia/web/JsiSkPoint.js +16 -0
- package/lib/module/skia/web/JsiSkPoint.js.map +1 -0
- package/lib/module/skia/web/JsiSkRRect.js +21 -0
- package/lib/module/skia/web/JsiSkRRect.js.map +1 -0
- package/lib/module/skia/web/JsiSkRSXform.js +8 -0
- package/lib/module/skia/web/JsiSkRSXform.js.map +1 -0
- package/lib/module/skia/web/{api/JsiSkRect.js → JsiSkRect.js} +8 -0
- package/lib/module/skia/web/JsiSkRect.js.map +1 -0
- package/lib/module/skia/web/JsiSkRuntimeEffect.js +33 -0
- package/lib/module/skia/web/JsiSkRuntimeEffect.js.map +1 -0
- package/lib/module/skia/web/JsiSkRuntimeEffectFactory.js +19 -0
- package/lib/module/skia/web/JsiSkRuntimeEffectFactory.js.map +1 -0
- package/lib/module/skia/web/JsiSkSVGFactory.js +16 -0
- package/lib/module/skia/web/JsiSkSVGFactory.js.map +1 -0
- package/lib/module/skia/web/JsiSkShader.js +8 -0
- package/lib/module/skia/web/JsiSkShader.js.map +1 -0
- package/lib/module/skia/web/JsiSkShaderFactory.js +41 -0
- package/lib/module/skia/web/JsiSkShaderFactory.js.map +1 -0
- package/lib/module/skia/web/{api/JsiSkSurface.js → JsiSkSurface.js} +0 -0
- package/lib/module/skia/web/{api/JsiSkSurface.js.map → JsiSkSurface.js.map} +1 -1
- package/lib/module/skia/web/{api/JsiSkSurfaceFactory.js → JsiSkSurfaceFactory.js} +0 -0
- package/lib/module/skia/web/{api/JsiSkSurfaceFactory.js.map → JsiSkSurfaceFactory.js.map} +1 -1
- package/lib/module/skia/web/JsiSkTextBlob.js +8 -0
- package/lib/module/skia/web/JsiSkTextBlob.js.map +1 -0
- package/lib/module/skia/web/JsiSkTextBlobFactory.js +25 -0
- package/lib/module/skia/web/JsiSkTextBlobFactory.js.map +1 -0
- package/lib/module/skia/web/JsiSkTypeface.js +18 -0
- package/lib/module/skia/web/JsiSkTypeface.js.map +1 -0
- package/lib/module/skia/web/JsiSkTypefaceFactory.js +19 -0
- package/lib/module/skia/web/JsiSkTypefaceFactory.js.map +1 -0
- package/lib/module/skia/web/JsiSkVertices.js +17 -0
- package/lib/module/skia/web/JsiSkVertices.js.map +1 -0
- package/lib/module/skia/web/JsiSkVerticesFactory.js +16 -0
- package/lib/module/skia/web/JsiSkVerticesFactory.js.map +1 -0
- package/lib/module/skia/web/JsiSkia.js +61 -0
- package/lib/module/skia/web/JsiSkia.js.map +1 -0
- package/lib/module/skia/web/index.js +1 -1
- package/lib/module/skia/web/index.js.map +1 -1
- package/lib/module/values/web/api.js +2 -2
- package/lib/module/values/web/api.js.map +1 -1
- package/lib/module/views/SkiaView.web.js +202 -0
- package/lib/module/views/SkiaView.web.js.map +1 -0
- package/lib/module/views/types.js.map +1 -1
- package/lib/module/views/useTouchHandler.js +64 -43
- package/lib/module/views/useTouchHandler.js.map +1 -1
- package/lib/module/web/index.js +8 -0
- package/lib/module/web/index.js.map +1 -0
- package/lib/typescript/src/animation/functions/index.d.ts +4 -2
- package/lib/typescript/src/animation/functions/interpolatePaths.d.ts +17 -0
- package/lib/typescript/src/animation/functions/interpolateVector.d.ts +10 -0
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/renderer/Canvas.d.ts +3 -14
- package/lib/typescript/src/renderer/DrawingContext.d.ts +3 -3
- package/lib/typescript/src/renderer/components/Blend.d.ts +1 -1
- package/lib/typescript/src/renderer/components/Group.d.ts +1 -1
- package/lib/typescript/src/renderer/components/Paint.d.ts +1 -1
- package/lib/typescript/src/renderer/components/Picture.d.ts +1 -1
- package/lib/typescript/src/renderer/components/colorFilters/BlendColor.d.ts +2 -2
- package/lib/typescript/src/renderer/components/colorFilters/Compose.d.ts +2 -2
- package/lib/typescript/src/renderer/components/image/BoxFit.d.ts +13 -3
- package/lib/typescript/src/renderer/components/image/Image.d.ts +1 -1
- package/lib/typescript/src/renderer/components/image/ImageSVG.d.ts +1 -1
- package/lib/typescript/src/renderer/components/image/ImageShader.d.ts +2 -2
- package/lib/typescript/src/renderer/components/imageFilters/Blur.d.ts +1 -1
- package/lib/typescript/src/renderer/components/imageFilters/DisplacementMap.d.ts +1 -1
- package/lib/typescript/src/renderer/components/imageFilters/InnerShadow.d.ts +2 -2
- package/lib/typescript/src/renderer/components/imageFilters/RuntimeShader.d.ts +2 -1
- package/lib/typescript/src/renderer/components/imageFilters/Shadow.d.ts +1 -1
- package/lib/typescript/src/renderer/components/imageFilters/getInput.d.ts +2 -1
- package/lib/typescript/src/renderer/components/maskFilters/Blur.d.ts +1 -1
- package/lib/typescript/src/renderer/components/pathEffects/Line2D.d.ts +1 -1
- package/lib/typescript/src/renderer/components/pathEffects/Path1D.d.ts +1 -1
- package/lib/typescript/src/renderer/components/pathEffects/Path2D.d.ts +1 -1
- package/lib/typescript/src/renderer/components/shaders/Color.d.ts +1 -1
- package/lib/typescript/src/renderer/components/shaders/Gradient.d.ts +4 -4
- package/lib/typescript/src/renderer/components/shaders/LinearGradient.d.ts +2 -1
- package/lib/typescript/src/renderer/components/shaders/RadialGradient.d.ts +2 -1
- package/lib/typescript/src/renderer/components/shaders/Shader.d.ts +2 -9
- 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/ImageFactory.d.ts +3 -3
- package/lib/typescript/src/skia/types/Matrix.d.ts +15 -14
- package/lib/typescript/src/skia/types/Path/Path.d.ts +29 -23
- package/lib/typescript/src/skia/types/Path/PathFactory.d.ts +5 -0
- package/lib/typescript/src/skia/types/Picture/Picture.d.ts +2 -2
- package/lib/typescript/src/skia/types/Point.d.ts +1 -0
- package/lib/typescript/src/skia/types/RRect.d.ts +1 -0
- package/lib/typescript/src/skia/types/RuntimeEffect/RuntimeEffect.d.ts +5 -6
- package/lib/typescript/src/skia/types/SVG/SVGFactory.d.ts +2 -2
- package/lib/typescript/src/skia/types/Shader/Shader.d.ts +8 -0
- package/lib/typescript/src/skia/types/Skia.d.ts +1 -1
- package/lib/typescript/src/skia/types/Typeface/TypefaceFactory.d.ts +2 -2
- package/lib/typescript/src/skia/web/{api/Host.d.ts → Host.d.ts} +4 -1
- package/lib/typescript/src/skia/web/JsiImageFilterFactory.d.ts +19 -0
- package/lib/typescript/src/skia/web/{api/JsiSkCanvas.d.ts → JsiSkCanvas.d.ts} +1 -1
- package/lib/typescript/src/skia/web/JsiSkColor.d.ts +2 -0
- package/lib/typescript/src/skia/web/{api/JsiSkColorFilter.d.ts → JsiSkColorFilter.d.ts} +1 -1
- package/lib/typescript/src/skia/web/JsiSkColorFilterFactory.d.ts +14 -0
- package/lib/typescript/src/skia/web/JsiSkContourMeasure.d.ts +16 -0
- package/lib/typescript/src/skia/web/JsiSkContourMeasureIter.d.ts +8 -0
- package/lib/typescript/src/skia/web/JsiSkData.d.ts +8 -0
- package/lib/typescript/src/skia/web/JsiSkDataFactory.d.ts +19 -0
- package/lib/typescript/src/skia/web/JsiSkFont.d.ts +33 -0
- package/lib/typescript/src/skia/web/JsiSkFontMgr.d.ts +9 -0
- package/lib/typescript/src/skia/web/JsiSkFontMgrFactory.d.ts +8 -0
- package/lib/typescript/src/skia/web/{api/JsiSkImage.d.ts → JsiSkImage.d.ts} +1 -1
- package/lib/typescript/src/skia/web/JsiSkImageFactory.d.ts +10 -0
- package/lib/typescript/src/skia/web/JsiSkImageFilter.d.ts +6 -0
- package/lib/typescript/src/skia/web/JsiSkMaskFilter.d.ts +6 -0
- package/lib/typescript/src/skia/web/JsiSkMaskFilterFactory.d.ts +9 -0
- package/lib/typescript/src/skia/web/JsiSkMatrix.d.ts +11 -0
- package/lib/typescript/src/skia/web/{api/JsiSkPaint.d.ts → JsiSkPaint.d.ts} +1 -1
- package/lib/typescript/src/skia/web/JsiSkPath.d.ts +56 -0
- package/lib/typescript/src/skia/web/JsiSkPathEffect.d.ts +6 -0
- package/lib/typescript/src/skia/web/JsiSkPathEffectFactory.d.ts +15 -0
- package/lib/typescript/src/skia/web/JsiSkPathFactory.d.ts +13 -0
- package/lib/typescript/src/skia/web/JsiSkPicture.d.ts +9 -0
- package/lib/typescript/src/skia/web/JsiSkPictureFactory.d.ts +8 -0
- package/lib/typescript/src/skia/web/JsiSkPictureRecorder.d.ts +11 -0
- package/lib/typescript/src/skia/web/JsiSkPoint.d.ts +8 -0
- package/lib/typescript/src/skia/web/JsiSkRRect.d.ts +10 -0
- package/lib/typescript/src/skia/web/JsiSkRSXform.d.ts +8 -0
- package/lib/typescript/src/skia/web/{api/JsiSkRect.d.ts → JsiSkRect.d.ts} +2 -1
- package/lib/typescript/src/skia/web/JsiSkRuntimeEffect.d.ts +14 -0
- package/lib/typescript/src/skia/web/JsiSkRuntimeEffectFactory.d.ts +8 -0
- package/lib/typescript/src/skia/web/JsiSkSVGFactory.d.ts +9 -0
- package/lib/typescript/src/skia/web/JsiSkShader.d.ts +6 -0
- package/lib/typescript/src/skia/web/JsiSkShaderFactory.d.ts +16 -0
- package/lib/typescript/src/skia/web/{api/JsiSkSurface.d.ts → JsiSkSurface.d.ts} +1 -1
- package/lib/typescript/src/skia/web/{api/JsiSkSurfaceFactory.d.ts → JsiSkSurfaceFactory.d.ts} +1 -1
- package/lib/typescript/src/skia/web/JsiSkTextBlob.d.ts +6 -0
- package/lib/typescript/src/skia/web/JsiSkTextBlobFactory.d.ts +12 -0
- package/lib/typescript/src/skia/web/JsiSkTypeface.d.ts +8 -0
- package/lib/typescript/src/skia/web/JsiSkTypefaceFactory.d.ts +8 -0
- package/lib/typescript/src/skia/web/JsiSkVertices.d.ts +9 -0
- package/lib/typescript/src/skia/web/JsiSkVerticesFactory.d.ts +4 -0
- package/lib/typescript/src/skia/web/JsiSkia.d.ts +3 -0
- package/lib/typescript/src/skia/web/index.d.ts +1 -1
- package/lib/typescript/src/views/SkiaView.web.d.ts +56 -0
- package/lib/typescript/src/views/types.d.ts +1 -0
- package/lib/typescript/src/views/useTouchHandler.d.ts +11 -1
- package/lib/typescript/src/web/index.d.ts +5 -0
- package/libs/android/arm64-v8a/libskia.a +0 -0
- package/libs/android/arm64-v8a/libsvg.a +0 -0
- package/libs/android/armeabi-v7a/libskia.a +0 -0
- package/libs/android/armeabi-v7a/libsvg.a +0 -0
- package/libs/android/x86/libskia.a +0 -0
- package/libs/android/x86/libsvg.a +0 -0
- package/libs/android/x86_64/libskia.a +0 -0
- package/libs/android/x86_64/libsvg.a +0 -0
- package/libs/ios/libskia.xcframework/Info.plist +5 -5
- package/libs/ios/libskia.xcframework/ios-arm64_arm64e/libskia.a +0 -0
- package/libs/ios/libskia.xcframework/ios-arm64_arm64e_x86_64-simulator/libskia.a +0 -0
- package/libs/ios/libskshaper.xcframework/Info.plist +5 -5
- package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e/libskshaper.a +0 -0
- package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e_x86_64-simulator/libskshaper.a +0 -0
- package/libs/ios/libsvg.xcframework/ios-arm64_arm64e/libsvg.a +0 -0
- package/libs/ios/libsvg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsvg.a +0 -0
- package/package.json +5 -6
- 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 -58
- 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/ImageFactory.ts +3 -3
- package/src/skia/types/Matrix.ts +79 -14
- package/src/skia/types/Path/Path.ts +34 -23
- package/src/skia/types/Path/PathFactory.ts +7 -0
- package/src/skia/types/Picture/Picture.ts +2 -2
- package/src/skia/types/Point.ts +2 -0
- package/src/skia/types/RRect.ts +5 -0
- package/src/skia/types/RuntimeEffect/RuntimeEffect.ts +5 -10
- package/src/skia/types/SVG/SVGFactory.ts +2 -2
- package/src/skia/types/Shader/Shader.ts +61 -0
- package/src/skia/types/Skia.ts +1 -1
- package/src/skia/types/Typeface/TypefaceFactory.ts +2 -2
- package/src/skia/web/{api/Host.ts → Host.ts} +7 -1
- package/src/skia/web/JsiImageFilterFactory.ts +144 -0
- package/src/skia/web/{api/JsiSkCanvas.ts → JsiSkCanvas.ts} +19 -11
- package/src/skia/web/{api/JsiSkColor.ts → JsiSkColor.ts} +152 -6
- package/src/skia/web/{api/JsiSkColorFilter.ts → JsiSkColorFilter.ts} +1 -1
- package/src/skia/web/JsiSkColorFilterFactory.ts +67 -0
- package/src/skia/web/JsiSkContourMeasure.ts +35 -0
- package/src/skia/web/JsiSkContourMeasureIter.ts +23 -0
- package/src/skia/web/JsiSkData.ts +13 -0
- package/src/skia/web/JsiSkDataFactory.ts +35 -0
- package/src/skia/web/JsiSkFont.ts +128 -0
- package/src/skia/web/JsiSkFontMgr.ts +42 -0
- package/src/skia/web/JsiSkFontMgrFactory.ts +18 -0
- package/src/skia/web/{api/JsiSkImage.ts → JsiSkImage.ts} +1 -1
- package/src/skia/web/JsiSkImageFactory.ts +40 -0
- package/src/skia/web/JsiSkImageFilter.ts +14 -0
- package/src/skia/web/JsiSkMaskFilter.ts +14 -0
- package/src/skia/web/JsiSkMaskFilterFactory.ts +20 -0
- package/src/skia/web/JsiSkMatrix.ts +54 -0
- package/src/skia/web/{api/JsiSkPaint.ts → JsiSkPaint.ts} +6 -5
- package/src/skia/web/JsiSkPath.ts +369 -0
- package/src/skia/web/JsiSkPathEffect.ts +14 -0
- package/src/skia/web/JsiSkPathEffectFactory.ts +85 -0
- package/src/skia/web/JsiSkPathFactory.ts +54 -0
- package/src/skia/web/JsiSkPicture.ts +45 -0
- package/src/skia/web/JsiSkPictureFactory.ts +20 -0
- package/src/skia/web/JsiSkPictureRecorder.ts +31 -0
- package/src/skia/web/JsiSkPoint.ts +19 -0
- package/src/skia/web/JsiSkRRect.ts +27 -0
- package/src/skia/web/JsiSkRSXform.ts +16 -0
- package/src/skia/web/{api/JsiSkRect.ts → JsiSkRect.ts} +11 -1
- package/src/skia/web/JsiSkRuntimeEffect.ts +57 -0
- package/src/skia/web/JsiSkRuntimeEffectFactory.ts +23 -0
- package/src/skia/web/JsiSkSVGFactory.ts +20 -0
- package/src/skia/web/JsiSkShader.ts +14 -0
- package/src/skia/web/JsiSkShaderFactory.ts +178 -0
- package/src/skia/web/{api/JsiSkSurface.ts → JsiSkSurface.ts} +1 -1
- package/src/skia/web/{api/JsiSkSurfaceFactory.ts → JsiSkSurfaceFactory.ts} +1 -1
- package/src/skia/web/JsiSkTextBlob.ts +14 -0
- package/src/skia/web/JsiSkTextBlobFactory.ts +49 -0
- package/src/skia/web/JsiSkTypeface.ts +28 -0
- package/src/skia/web/JsiSkTypefaceFactory.tsx +20 -0
- package/src/skia/web/JsiSkVertices.ts +23 -0
- package/src/skia/web/JsiSkVerticesFactory.ts +27 -0
- package/src/skia/web/JsiSkia.ts +98 -0
- package/src/skia/web/index.ts +1 -1
- package/src/values/web/api.ts +2 -2
- package/src/views/SkiaView.web.tsx +192 -0
- package/src/views/types.ts +1 -0
- package/src/views/useTouchHandler.ts +82 -51
- package/src/web/index.ts +13 -0
- package/cpp/skia/include/core/SkCustomMesh.h +0 -202
- package/cpp/skia/include/core/SkStringView.h +0 -185
- package/cpp/skia/include/private/SkPaintParamsKey.h +0 -110
- package/cpp/skia/include/private/SkShaderCodeDictionary.h +0 -63
- package/cpp/skia/include/private/SkTOptional.h +0 -362
- package/lib/commonjs/renderer/processors/math/Matrix3.js +0 -66
- package/lib/commonjs/renderer/processors/math/Matrix3.js.map +0 -1
- package/lib/commonjs/renderer/processors/math/Vector.js +0 -60
- package/lib/commonjs/renderer/processors/math/Vector.js.map +0 -1
- package/lib/commonjs/skia/core/Color.js.map +0 -1
- package/lib/commonjs/skia/core/Shader.js +0 -18
- package/lib/commonjs/skia/core/Shader.js.map +0 -1
- package/lib/commonjs/skia/web/api/Host.js.map +0 -1
- package/lib/commonjs/skia/web/api/JsiSkCanvas.js.map +0 -1
- package/lib/commonjs/skia/web/api/JsiSkColor.js.map +0 -1
- package/lib/commonjs/skia/web/api/JsiSkPaint.js.map +0 -1
- package/lib/commonjs/skia/web/api/JsiSkRect.js.map +0 -1
- package/lib/commonjs/skia/web/api/index.js +0 -26
- package/lib/commonjs/skia/web/api/index.js.map +0 -1
- package/lib/module/renderer/processors/math/Matrix3.js +0 -55
- package/lib/module/renderer/processors/math/Matrix3.js.map +0 -1
- package/lib/module/renderer/processors/math/Vector.js.map +0 -1
- package/lib/module/skia/core/Color.js.map +0 -1
- package/lib/module/skia/core/Shader.js +0 -7
- package/lib/module/skia/core/Shader.js.map +0 -1
- package/lib/module/skia/web/api/Host.js.map +0 -1
- package/lib/module/skia/web/api/JsiSkCanvas.js.map +0 -1
- package/lib/module/skia/web/api/JsiSkColor.js.map +0 -1
- package/lib/module/skia/web/api/JsiSkPaint.js.map +0 -1
- package/lib/module/skia/web/api/JsiSkRect.js.map +0 -1
- package/lib/module/skia/web/api/index.js +0 -13
- package/lib/module/skia/web/api/index.js.map +0 -1
- package/lib/typescript/src/renderer/processors/math/Matrix3.d.ts +0 -10
- package/lib/typescript/src/renderer/processors/math/Vector.d.ts +0 -23
- package/lib/typescript/src/skia/core/Shader.d.ts +0 -1
- package/lib/typescript/src/skia/web/api/JsiSkColor.d.ts +0 -3
- package/lib/typescript/src/skia/web/api/index.d.ts +0 -10
- package/src/animation/timing/functions/__tests__/timing.spec.ts +0 -29
- package/src/renderer/processors/math/Matrix3.ts +0 -73
- package/src/renderer/processors/math/Vector.ts +0 -38
- package/src/skia/__tests__/Rects.spec.ts +0 -40
- package/src/skia/__tests__/snapshots/lightblue-rect.png +0 -0
- package/src/skia/core/Shader.ts +0 -9
- package/src/skia/web/api/index.ts +0 -15
- package/src/values/web/__tests__/RNSkAnimation.spec.ts +0 -21
- package/src/values/web/__tests__/RNSkDerivedValue.spec.ts +0 -15
- package/src/values/web/__tests__/RNSkReadonlyValue.spec.ts +0 -8
- package/src/values/web/__tests__/RNSkValue.spec.ts +0 -11
@@ -0,0 +1,61 @@
|
|
1
|
+
import { JsiSkPoint } from "./JsiSkPoint";
|
2
|
+
import { JsiSkPaint } from "./JsiSkPaint";
|
3
|
+
import { JsiSkRect } from "./JsiSkRect";
|
4
|
+
import { Color } from "./JsiSkColor";
|
5
|
+
import { JsiSkSurfaceFactory } from "./JsiSkSurfaceFactory";
|
6
|
+
import { JsiSkRRect } from "./JsiSkRRect";
|
7
|
+
import { JsiSkRSXform } from "./JsiSkRSXform";
|
8
|
+
import { toValue } from "./Host";
|
9
|
+
import { JsiSkContourMeasureIter } from "./JsiSkContourMeasureIter";
|
10
|
+
import { JsiSkPictureRecorder } from "./JsiSkPictureRecorder";
|
11
|
+
import { JsiSkPictureFactory } from "./JsiSkPictureFactory";
|
12
|
+
import { JsiSkPathFactory } from "./JsiSkPathFactory";
|
13
|
+
import { JsiSkMatrix } from "./JsiSkMatrix";
|
14
|
+
import { JsiSkColorFilterFactory } from "./JsiSkColorFilterFactory";
|
15
|
+
import { JsiSkTypefaceFactory } from "./JsiSkTypefaceFactory";
|
16
|
+
import { JsiSkMaskFilterFactory } from "./JsiSkMaskFilterFactory";
|
17
|
+
import { JsiSkRuntimeEffectFactory } from "./JsiSkRuntimeEffectFactory";
|
18
|
+
import { JsiSkImageFilterFactory } from "./JsiImageFilterFactory";
|
19
|
+
import { JsiSkShaderFactory } from "./JsiSkShaderFactory";
|
20
|
+
import { JsiSkPathEffectFactory } from "./JsiSkPathEffectFactory";
|
21
|
+
import { JsiSkDataFactory } from "./JsiSkDataFactory";
|
22
|
+
import { JsiSkImageFactory } from "./JsiSkImageFactory";
|
23
|
+
import { JsiSkSVGFactory } from "./JsiSkSVGFactory";
|
24
|
+
import { JsiSkTextBlobFactory } from "./JsiSkTextBlobFactory";
|
25
|
+
import { JsiSkFontMgrFactory } from "./JsiSkFontMgrFactory";
|
26
|
+
import { JsiSkFont } from "./JsiSkFont";
|
27
|
+
import { MakeVertices } from "./JsiSkVerticesFactory";
|
28
|
+
export const JsiSkApi = CanvasKit => ({
|
29
|
+
Point: (x, y) => new JsiSkPoint(CanvasKit, Float32Array.of(x, y)),
|
30
|
+
RuntimeShaderBuilder: _ => {
|
31
|
+
throw new Error("Not implemented on React Native Web");
|
32
|
+
},
|
33
|
+
RRectXY: (rect, rx, ry) => new JsiSkRRect(CanvasKit, CanvasKit.RRectXY(toValue(rect), rx, ry)),
|
34
|
+
RSXform: (scos, ssin, tx, ty) => new JsiSkRSXform(CanvasKit, Float32Array.of(scos, ssin, tx, ty)),
|
35
|
+
Color,
|
36
|
+
ContourMeasureIter: (path, forceClosed, resScale) => new JsiSkContourMeasureIter(CanvasKit, new CanvasKit.ContourMeasureIter(toValue(path), forceClosed, resScale)),
|
37
|
+
Paint: () => new JsiSkPaint(CanvasKit, new CanvasKit.Paint()),
|
38
|
+
PictureRecorder: () => new JsiSkPictureRecorder(CanvasKit, new CanvasKit.PictureRecorder()),
|
39
|
+
Picture: new JsiSkPictureFactory(CanvasKit),
|
40
|
+
Path: new JsiSkPathFactory(CanvasKit),
|
41
|
+
Matrix: matrix => new JsiSkMatrix(CanvasKit, matrix ? Float32Array.of(...matrix) : Float32Array.of(...CanvasKit.Matrix.identity())),
|
42
|
+
ColorFilter: new JsiSkColorFilterFactory(CanvasKit),
|
43
|
+
Font: (typeface, size) => new JsiSkFont(CanvasKit, new CanvasKit.Font(typeface === undefined ? null : toValue(typeface), size)),
|
44
|
+
Typeface: new JsiSkTypefaceFactory(CanvasKit),
|
45
|
+
MaskFilter: new JsiSkMaskFilterFactory(CanvasKit),
|
46
|
+
RuntimeEffect: new JsiSkRuntimeEffectFactory(CanvasKit),
|
47
|
+
ImageFilter: new JsiSkImageFilterFactory(CanvasKit),
|
48
|
+
Shader: new JsiSkShaderFactory(CanvasKit),
|
49
|
+
PathEffect: new JsiSkPathEffectFactory(CanvasKit),
|
50
|
+
MakeVertices: MakeVertices.bind(null, CanvasKit),
|
51
|
+
Data: new JsiSkDataFactory(CanvasKit),
|
52
|
+
Image: new JsiSkImageFactory(CanvasKit),
|
53
|
+
SVG: new JsiSkSVGFactory(CanvasKit),
|
54
|
+
TextBlob: new JsiSkTextBlobFactory(CanvasKit),
|
55
|
+
FontMgr: new JsiSkFontMgrFactory(CanvasKit),
|
56
|
+
XYWHRect: (x, y, width, height) => {
|
57
|
+
return new JsiSkRect(CanvasKit, CanvasKit.XYWHRect(x, y, width, height));
|
58
|
+
},
|
59
|
+
Surface: new JsiSkSurfaceFactory(CanvasKit)
|
60
|
+
});
|
61
|
+
//# sourceMappingURL=JsiSkia.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["JsiSkia.ts"],"names":["JsiSkPoint","JsiSkPaint","JsiSkRect","Color","JsiSkSurfaceFactory","JsiSkRRect","JsiSkRSXform","toValue","JsiSkContourMeasureIter","JsiSkPictureRecorder","JsiSkPictureFactory","JsiSkPathFactory","JsiSkMatrix","JsiSkColorFilterFactory","JsiSkTypefaceFactory","JsiSkMaskFilterFactory","JsiSkRuntimeEffectFactory","JsiSkImageFilterFactory","JsiSkShaderFactory","JsiSkPathEffectFactory","JsiSkDataFactory","JsiSkImageFactory","JsiSkSVGFactory","JsiSkTextBlobFactory","JsiSkFontMgrFactory","JsiSkFont","MakeVertices","JsiSkApi","CanvasKit","Point","x","y","Float32Array","of","RuntimeShaderBuilder","_","Error","RRectXY","rect","rx","ry","RSXform","scos","ssin","tx","ty","ContourMeasureIter","path","forceClosed","resScale","Paint","PictureRecorder","Picture","Path","Matrix","matrix","identity","ColorFilter","Font","typeface","size","undefined","Typeface","MaskFilter","RuntimeEffect","ImageFilter","Shader","PathEffect","bind","Data","Image","SVG","TextBlob","FontMgr","XYWHRect","width","height","Surface"],"mappings":"AAYA,SAASA,UAAT,QAA2B,cAA3B;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SAASC,KAAT,QAAsB,cAAtB;AACA,SAASC,mBAAT,QAAoC,uBAApC;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,YAAT,QAA6B,gBAA7B;AACA,SAASC,OAAT,QAAwB,QAAxB;AACA,SAASC,uBAAT,QAAwC,2BAAxC;AACA,SAASC,oBAAT,QAAqC,wBAArC;AACA,SAASC,mBAAT,QAAoC,uBAApC;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AACA,SAASC,WAAT,QAA4B,eAA5B;AACA,SAASC,uBAAT,QAAwC,2BAAxC;AACA,SAASC,oBAAT,QAAqC,wBAArC;AACA,SAASC,sBAAT,QAAuC,0BAAvC;AACA,SAASC,yBAAT,QAA0C,6BAA1C;AACA,SAASC,uBAAT,QAAwC,yBAAxC;AACA,SAASC,kB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A6CvDsC,EAAAA,MAAM,EAAE,IAAIhD,kBAAJ,CAAuBU,SAAvB,CA7C+C;AA8CvDuC,EAAAA,UAAU,EAAE,IAAIhD,sBAAJ,CAA2BS,SAA3B,CA9C2C;AA+CvDF,EAAAA,YAAY,EAAEA,YAAY,CAAC0C,IAAb,CAAkB,IAAlB,EAAwBxC,SAAxB,CA/CyC;AAgDvDyC,EAAAA,IAAI,EAAE,IAAIjD,gBAAJ,CAAqBQ,SAArB,CAhDiD;AAiDvD0C,EAAAA,KAAK,EAAE,IAAIjD,iBAAJ,CAAsBO,SAAtB,CAjDgD;AAkDvD2C,EAAAA,GAAG,EAAE,IAAIjD,eAAJ,CAAoBM,SAApB,CAlDkD;AAmDvD4C,EAAAA,QAAQ,EAAE,IAAIjD,oBAAJ,CAAyBK,SAAzB,CAnD6C;AAoDvD6C,EAAAA,OAAO,EAAE,IAAIjD,mBAAJ,CAAwBI,SAAxB,CApD8C;AAqDvD8C,EAAAA,QAAQ,EAAE,CAAC5C,CAAD,EAAYC,CAAZ,EAAuB4C,KAAvB,EAAsCC,MAAtC,KAAyD;AACjE,WAAO,IAAI1E,SAAJ,CAAc0B,SAAd,EAAyBA,SAAS,CAAC8C,QAAV,CAAmB5C,CAAnB,EAAsBC,CAAtB,EAAyB4C,KAAzB,EAAgCC,MAAhC,CAAzB,CAAP;AACD,GAvDsD;AAwDvDC,EAAAA,OAAO,EAAE,IAAIzE,mBAAJ,CAAwBwB,SAAxB;AAxD8C,CAAjC,CAAjB","sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type {\n SkContourMeasureIter,\n Skia,\n SkPath,\n SkRect,\n SkRuntimeEffect,\n SkRuntimeShaderBuilder,\n SkTypeface,\n} from \"../types\";\n\nimport { JsiSkPoint } from \"./JsiSkPoint\";\nimport { JsiSkPaint } from \"./JsiSkPaint\";\nimport { JsiSkRect } from \"./JsiSkRect\";\nimport { Color } from \"./JsiSkColor\";\nimport { JsiSkSurfaceFactory } from \"./JsiSkSurfaceFactory\";\nimport { JsiSkRRect } from \"./JsiSkRRect\";\nimport { JsiSkRSXform } from \"./JsiSkRSXform\";\nimport { toValue } from \"./Host\";\nimport { JsiSkContourMeasureIter } from \"./JsiSkContourMeasureIter\";\nimport { JsiSkPictureRecorder } from \"./JsiSkPictureRecorder\";\nimport { JsiSkPictureFactory } from \"./JsiSkPictureFactory\";\nimport { JsiSkPathFactory } from \"./JsiSkPathFactory\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkColorFilterFactory } from \"./JsiSkColorFilterFactory\";\nimport { JsiSkTypefaceFactory } from \"./JsiSkTypefaceFactory\";\nimport { JsiSkMaskFilterFactory } from \"./JsiSkMaskFilterFactory\";\nimport { JsiSkRuntimeEffectFactory } from \"./JsiSkRuntimeEffectFactory\";\nimport { JsiSkImageFilterFactory } from \"./JsiImageFilterFactory\";\nimport { JsiSkShaderFactory } from \"./JsiSkShaderFactory\";\nimport { JsiSkPathEffectFactory } from \"./JsiSkPathEffectFactory\";\nimport { JsiSkDataFactory } from \"./JsiSkDataFactory\";\nimport { JsiSkImageFactory } from \"./JsiSkImageFactory\";\nimport { JsiSkSVGFactory } from \"./JsiSkSVGFactory\";\nimport { JsiSkTextBlobFactory } from \"./JsiSkTextBlobFactory\";\nimport { JsiSkFontMgrFactory } from \"./JsiSkFontMgrFactory\";\nimport { JsiSkFont } from \"./JsiSkFont\";\nimport { MakeVertices } from \"./JsiSkVerticesFactory\";\n\nexport const JsiSkApi = (CanvasKit: CanvasKit): Skia => ({\n Point: (x: number, y: number) =>\n new JsiSkPoint(CanvasKit, Float32Array.of(x, y)),\n RuntimeShaderBuilder: (_: SkRuntimeEffect): SkRuntimeShaderBuilder => {\n throw new Error(\"Not implemented on React Native Web\");\n },\n RRectXY: (rect: SkRect, rx: number, ry: number) =>\n new JsiSkRRect(CanvasKit, CanvasKit.RRectXY(toValue(rect), rx, ry)),\n RSXform: (scos: number, ssin: number, tx: number, ty: number) =>\n new JsiSkRSXform(CanvasKit, Float32Array.of(scos, ssin, tx, ty)),\n Color,\n ContourMeasureIter: (\n path: SkPath,\n forceClosed: boolean,\n resScale: number\n ): SkContourMeasureIter =>\n new JsiSkContourMeasureIter(\n CanvasKit,\n new CanvasKit.ContourMeasureIter(toValue(path), forceClosed, resScale)\n ),\n Paint: () => new JsiSkPaint(CanvasKit, new CanvasKit.Paint()),\n PictureRecorder: () =>\n new JsiSkPictureRecorder(CanvasKit, new CanvasKit.PictureRecorder()),\n Picture: new JsiSkPictureFactory(CanvasKit),\n Path: new JsiSkPathFactory(CanvasKit),\n Matrix: (matrix?: number[]) =>\n new JsiSkMatrix(\n CanvasKit,\n matrix\n ? Float32Array.of(...matrix)\n : Float32Array.of(...CanvasKit.Matrix.identity())\n ),\n ColorFilter: new JsiSkColorFilterFactory(CanvasKit),\n Font: (typeface?: SkTypeface, size?: number) =>\n new JsiSkFont(\n CanvasKit,\n new CanvasKit.Font(\n typeface === undefined ? null : toValue(typeface),\n size\n )\n ),\n Typeface: new JsiSkTypefaceFactory(CanvasKit),\n MaskFilter: new JsiSkMaskFilterFactory(CanvasKit),\n RuntimeEffect: new JsiSkRuntimeEffectFactory(CanvasKit),\n ImageFilter: new JsiSkImageFilterFactory(CanvasKit),\n Shader: new JsiSkShaderFactory(CanvasKit),\n PathEffect: new JsiSkPathEffectFactory(CanvasKit),\n MakeVertices: MakeVertices.bind(null, CanvasKit),\n Data: new JsiSkDataFactory(CanvasKit),\n Image: new JsiSkImageFactory(CanvasKit),\n SVG: new JsiSkSVGFactory(CanvasKit),\n TextBlob: new JsiSkTextBlobFactory(CanvasKit),\n FontMgr: new JsiSkFontMgrFactory(CanvasKit),\n XYWHRect: (x: number, y: number, width: number, height: number) => {\n return new JsiSkRect(CanvasKit, CanvasKit.XYWHRect(x, y, width, height));\n },\n Surface: new JsiSkSurfaceFactory(CanvasKit),\n});\n"]}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
export * from "./
|
1
|
+
export * from "./JsiSkia";
|
2
2
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
1
|
+
{"version":3,"sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAd","sourcesContent":["export * from \"./JsiSkia\";\n"]}
|
@@ -10,10 +10,10 @@ export const ValueApi = {
|
|
10
10
|
return new RNSkDerivedValue(cb, values);
|
11
11
|
},
|
12
12
|
createClockValue: function () {
|
13
|
-
return new RNSkClockValue(requestAnimationFrame);
|
13
|
+
return new RNSkClockValue(requestAnimationFrame.bind(window));
|
14
14
|
},
|
15
15
|
createAnimation: function (cb) {
|
16
|
-
return new RNSkAnimation(cb, requestAnimationFrame);
|
16
|
+
return new RNSkAnimation(cb, requestAnimationFrame.bind(window));
|
17
17
|
}
|
18
18
|
};
|
19
19
|
//# sourceMappingURL=api.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["api.ts"],"names":["RNSkAnimation","RNSkClockValue","RNSkDerivedValue","RNSkValue","ValueApi","createValue","initialValue","createDerivedValue","cb","values","createClockValue","requestAnimationFrame","createAnimation"],"mappings":"AASA,SAASA,aAAT,QAA8B,iBAA9B;AACA,SAASC,cAAT,QAA+B,kBAA/B;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AACA,SAASC,SAAT,QAA0B,aAA1B;AAEA,OAAO,MAAMC,QAAuB,GAAG;AACrCC,EAAAA,WAAW,EAAE,UAAaC,YAAb,EAAmD;AAC9D,WAAO,IAAIH,SAAJ,CAAcG,YAAd,CAAP;AACD,GAHoC;AAIrCC,EAAAA,kBAAkB,EAAE,UAClBC,EADkB,EAElBC,MAFkB,EAGJ;AACd,WAAO,IAAIP,gBAAJ,CAAqBM,EAArB,EAAyBC,MAAzB,CAAP;AACD,GAToC;AAUrCC,EAAAA,gBAAgB,EAAE,YAA4B;AAC5C,WAAO,IAAIT,cAAJ,CAAmBU,
|
1
|
+
{"version":3,"sources":["api.ts"],"names":["RNSkAnimation","RNSkClockValue","RNSkDerivedValue","RNSkValue","ValueApi","createValue","initialValue","createDerivedValue","cb","values","createClockValue","requestAnimationFrame","bind","window","createAnimation"],"mappings":"AASA,SAASA,aAAT,QAA8B,iBAA9B;AACA,SAASC,cAAT,QAA+B,kBAA/B;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AACA,SAASC,SAAT,QAA0B,aAA1B;AAEA,OAAO,MAAMC,QAAuB,GAAG;AACrCC,EAAAA,WAAW,EAAE,UAAaC,YAAb,EAAmD;AAC9D,WAAO,IAAIH,SAAJ,CAAcG,YAAd,CAAP;AACD,GAHoC;AAIrCC,EAAAA,kBAAkB,EAAE,UAClBC,EADkB,EAElBC,MAFkB,EAGJ;AACd,WAAO,IAAIP,gBAAJ,CAAqBM,EAArB,EAAyBC,MAAzB,CAAP;AACD,GAToC;AAUrCC,EAAAA,gBAAgB,EAAE,YAA4B;AAC5C,WAAO,IAAIT,cAAJ,CAAmBU,qBAAqB,CAACC,IAAtB,CAA2BC,MAA3B,CAAnB,CAAP;AACD,GAZoC;AAarCC,EAAAA,eAAe,EAAE,UACfN,EADe,EAEA;AACf,WAAO,IAAIR,aAAJ,CAAkBQ,EAAlB,EAAsBG,qBAAqB,CAACC,IAAtB,CAA2BC,MAA3B,CAAtB,CAAP;AACD;AAjBoC,CAAhC","sourcesContent":["import type {\n ISkiaValueApi,\n SkiaMutableValue,\n SkiaValue,\n SkiaClockValue,\n AnimationState,\n SkiaAnimation,\n} from \"../types\";\n\nimport { RNSkAnimation } from \"./RNSkAnimation\";\nimport { RNSkClockValue } from \"./RNSkClockValue\";\nimport { RNSkDerivedValue } from \"./RNSkDerivedValue\";\nimport { RNSkValue } from \"./RNSkValue\";\n\nexport const ValueApi: ISkiaValueApi = {\n createValue: function <T>(initialValue: T): SkiaMutableValue<T> {\n return new RNSkValue(initialValue);\n },\n createDerivedValue: function <R>(\n cb: () => R,\n values: SkiaValue<unknown>[]\n ): SkiaValue<R> {\n return new RNSkDerivedValue(cb, values);\n },\n createClockValue: function (): SkiaClockValue {\n return new RNSkClockValue(requestAnimationFrame.bind(window));\n },\n createAnimation: function <S extends AnimationState = AnimationState>(\n cb: (t: number, state: S | undefined) => S\n ): SkiaAnimation {\n return new RNSkAnimation(cb, requestAnimationFrame.bind(window));\n },\n};\n"]}
|
@@ -0,0 +1,202 @@
|
|
1
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
2
|
+
|
3
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
4
|
+
|
5
|
+
/* global HTMLCanvasElement */
|
6
|
+
import React from "react";
|
7
|
+
import { View } from "react-native";
|
8
|
+
import { JsiSkSurface } from "../skia/web/JsiSkSurface";
|
9
|
+
import { TouchType } from "./types";
|
10
|
+
export class SkiaView extends React.Component {
|
11
|
+
constructor(props) {
|
12
|
+
var _props$mode;
|
13
|
+
|
14
|
+
super(props);
|
15
|
+
|
16
|
+
_defineProperty(this, "_surface", null);
|
17
|
+
|
18
|
+
_defineProperty(this, "_unsubscriptions", []);
|
19
|
+
|
20
|
+
_defineProperty(this, "_touches", []);
|
21
|
+
|
22
|
+
_defineProperty(this, "_canvas", null);
|
23
|
+
|
24
|
+
_defineProperty(this, "_canvasRef", /*#__PURE__*/React.createRef());
|
25
|
+
|
26
|
+
_defineProperty(this, "_mode", void 0);
|
27
|
+
|
28
|
+
_defineProperty(this, "_redrawRequests", 0);
|
29
|
+
|
30
|
+
_defineProperty(this, "_unmounted", false);
|
31
|
+
|
32
|
+
this.state = {
|
33
|
+
width: -1,
|
34
|
+
height: -1
|
35
|
+
};
|
36
|
+
this._mode = (_props$mode = props.mode) !== null && _props$mode !== void 0 ? _props$mode : "default";
|
37
|
+
}
|
38
|
+
|
39
|
+
unsubscribeAll() {
|
40
|
+
this._unsubscriptions.forEach(u => u());
|
41
|
+
|
42
|
+
this._unsubscriptions = [];
|
43
|
+
}
|
44
|
+
|
45
|
+
onLayout(evt) {
|
46
|
+
this.setState({
|
47
|
+
width: evt.nativeEvent.layout.width,
|
48
|
+
height: evt.nativeEvent.layout.height
|
49
|
+
}); // Reset canvas / surface on layout change
|
50
|
+
|
51
|
+
if (this._canvasRef.current) {
|
52
|
+
// Create surface
|
53
|
+
this._surface = new JsiSkSurface(global.CanvasKit, global.CanvasKit.MakeCanvasSurface(this._canvasRef.current)); // Get canvas and repaint
|
54
|
+
|
55
|
+
if (this._surface) {
|
56
|
+
this._canvas = this._surface.getCanvas();
|
57
|
+
this.requestRedraw();
|
58
|
+
this.redraw();
|
59
|
+
}
|
60
|
+
}
|
61
|
+
}
|
62
|
+
|
63
|
+
componentDidMount() {
|
64
|
+
// Start render loop
|
65
|
+
this.redraw();
|
66
|
+
}
|
67
|
+
|
68
|
+
componentWillUnmount() {
|
69
|
+
this.unsubscribeAll();
|
70
|
+
this._surface = null;
|
71
|
+
this._canvas = null;
|
72
|
+
this._unmounted = true;
|
73
|
+
}
|
74
|
+
/**
|
75
|
+
* Creates a snapshot from the canvas in the surface
|
76
|
+
* @param rect Rect to use as bounds. Optional.
|
77
|
+
* @returns An Image object.
|
78
|
+
*/
|
79
|
+
|
80
|
+
|
81
|
+
makeImageSnapshot(rect) {
|
82
|
+
var _this$_surface;
|
83
|
+
|
84
|
+
return (_this$_surface = this._surface) === null || _this$_surface === void 0 ? void 0 : _this$_surface.makeImageSnapshot(rect);
|
85
|
+
}
|
86
|
+
/**
|
87
|
+
* Sends a redraw request to the native SkiaView.
|
88
|
+
*/
|
89
|
+
|
90
|
+
|
91
|
+
redraw() {
|
92
|
+
if (this._mode === "continuous" || this._redrawRequests > 0) {
|
93
|
+
this._redrawRequests = 0;
|
94
|
+
|
95
|
+
if (this._canvas && this.props.onDraw && this.state.height !== -1 && this.state.width !== -1) {
|
96
|
+
var _this$_surface2;
|
97
|
+
|
98
|
+
const touches = [...this._touches];
|
99
|
+
this._touches = [];
|
100
|
+
const info = {
|
101
|
+
height: this.state.height,
|
102
|
+
width: this.state.width,
|
103
|
+
timestamp: Date.now(),
|
104
|
+
touches: [touches]
|
105
|
+
};
|
106
|
+
this.props.onDraw && this.props.onDraw(this._canvas, info);
|
107
|
+
(_this$_surface2 = this._surface) === null || _this$_surface2 === void 0 ? void 0 : _this$_surface2.ref.flush();
|
108
|
+
}
|
109
|
+
} // Always request a new redraw as long as we're not unmounted
|
110
|
+
|
111
|
+
|
112
|
+
if (!this._unmounted) {
|
113
|
+
requestAnimationFrame(this.redraw.bind(this));
|
114
|
+
}
|
115
|
+
}
|
116
|
+
|
117
|
+
requestRedraw() {
|
118
|
+
this._redrawRequests++;
|
119
|
+
}
|
120
|
+
/**
|
121
|
+
* Updates the drawing mode for the skia view. This is the same
|
122
|
+
* as declaratively setting the mode property on the SkiaView.
|
123
|
+
* There are two drawing modes, "continuous" and "default",
|
124
|
+
* where the continuous mode will continuously redraw the view and
|
125
|
+
* the default mode will only redraw when any of the regular react
|
126
|
+
* properties are changed like size and margins.
|
127
|
+
* @param mode Drawing mode to use.
|
128
|
+
*/
|
129
|
+
|
130
|
+
|
131
|
+
setDrawMode(mode) {
|
132
|
+
this._mode = mode;
|
133
|
+
this.redraw();
|
134
|
+
}
|
135
|
+
/**
|
136
|
+
* Registers one or move values as a dependant value of the Skia View. The view will
|
137
|
+
* The view will redraw itself when any of the values change.
|
138
|
+
* @param values Values to register
|
139
|
+
*/
|
140
|
+
|
141
|
+
|
142
|
+
registerValues(_values) {
|
143
|
+
// Unsubscribe from dependency values
|
144
|
+
this.unsubscribeAll(); // Register redraw dependencies on values
|
145
|
+
|
146
|
+
_values.forEach(v => {
|
147
|
+
this._unsubscriptions.push(v.addListener(() => {
|
148
|
+
this.requestRedraw();
|
149
|
+
}));
|
150
|
+
});
|
151
|
+
}
|
152
|
+
|
153
|
+
handleTouchEvent(evt, touchType) {
|
154
|
+
this._touches.push({
|
155
|
+
id: evt.pointerId,
|
156
|
+
x: evt.clientX - evt.currentTarget.getClientRects()[0].left,
|
157
|
+
y: evt.clientY - evt.currentTarget.getClientRects()[0].top,
|
158
|
+
force: evt.pressure,
|
159
|
+
type: touchType,
|
160
|
+
timestamp: Date.now()
|
161
|
+
});
|
162
|
+
|
163
|
+
this.requestRedraw();
|
164
|
+
}
|
165
|
+
|
166
|
+
handleTouchStart(evt) {
|
167
|
+
this.handleTouchEvent(evt, TouchType.Start);
|
168
|
+
}
|
169
|
+
|
170
|
+
handleTouchMove(evt) {
|
171
|
+
this.handleTouchEvent(evt, TouchType.Active);
|
172
|
+
}
|
173
|
+
|
174
|
+
handleTouchEnd(evt) {
|
175
|
+
this.handleTouchEvent(evt, TouchType.Cancelled);
|
176
|
+
}
|
177
|
+
|
178
|
+
handleTouchCancel(evt) {
|
179
|
+
this.handleTouchEvent(evt, TouchType.End);
|
180
|
+
}
|
181
|
+
|
182
|
+
render() {
|
183
|
+
const {
|
184
|
+
mode,
|
185
|
+
debug = false,
|
186
|
+
...viewProps
|
187
|
+
} = this.props;
|
188
|
+
return /*#__PURE__*/React.createElement(View, _extends({}, viewProps, {
|
189
|
+
onLayout: this.onLayout.bind(this)
|
190
|
+
}), this.state.width > -1 ? /*#__PURE__*/React.createElement("canvas", {
|
191
|
+
ref: this._canvasRef,
|
192
|
+
width: `${this.state.width}px`,
|
193
|
+
height: `${this.state.height}px`,
|
194
|
+
onPointerDown: this.handleTouchStart.bind(this),
|
195
|
+
onPointerMove: this.handleTouchMove.bind(this),
|
196
|
+
onPointerUp: this.handleTouchEnd.bind(this),
|
197
|
+
onPointerCancel: this.handleTouchCancel.bind(this)
|
198
|
+
}) : null);
|
199
|
+
}
|
200
|
+
|
201
|
+
}
|
202
|
+
//# sourceMappingURL=SkiaView.web.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["SkiaView.web.tsx"],"names":["React","View","JsiSkSurface","TouchType","SkiaView","Component","constructor","props","createRef","state","width","height","_mode","mode","unsubscribeAll","_unsubscriptions","forEach","u","onLayout","evt","setState","nativeEvent","layout","_canvasRef","current","_surface","global","CanvasKit","MakeCanvasSurface","_canvas","getCanvas","requestRedraw","redraw","componentDidMount","componentWillUnmount","_unmounted","makeImageSnapshot","rect","_redrawRequests","onDraw","touches","_touches","info","timestamp","Date","now","ref","flush","requestAnimationFrame","bind","setDrawMode","registerValues","_values","v","push","addListener","handleTouchEvent","touchType","id","pointerId","x","clientX","currentTarget","getClientRects","left","y","clientY","top","force","pressure","type","handleTouchStart","Start","handleTouchMove","Active","handleTouchEnd","Cancelled","handleTouchCancel","End","render","debug","viewProps"],"mappings":";;;;AAAA;AACA,OAAOA,KAAP,MAAkB,OAAlB;AAGA,SAASC,IAAT,QAAqB,cAArB;AAIA,SAASC,YAAT,QAA6B,0BAA7B;AAGA,SAASC,SAAT,QAA0B,SAA1B;AAEA,OAAO,MAAMC,QAAN,SAAuBJ,KAAK,CAACK,SAA7B,CAGL;AACAC,EAAAA,WAAW,CAACC,KAAD,EAAuB;AAAA;;AAChC,UAAMA,KAAN;;AADgC,sCAMM,IANN;;AAAA,8CAOY,EAPZ;;AAAA,sCAQG,EARH;;AAAA,qCASC,IATD;;AAAA,qDAUuBP,KAAK,CAACQ,SAAN,EAVvB;;AAAA;;AAAA,6CAYR,CAZQ;;AAAA,wCAab,KAba;;AAEhC,SAAKC,KAAL,GAAa;AAAEC,MAAAA,KAAK,EAAE,CAAC,CAAV;AAAaC,MAAAA,MAAM,EAAE,CAAC;AAAtB,KAAb;AACA,SAAKC,KAAL,kBAAaL,KAAK,CAACM,IAAnB,qDAA2B,SAA3B;AACD;;AAWOC,EAAAA,cAAc,GAAG;AACvB,SAAKC,gBAAL,CAAsBC,OAAtB,CAA+BC,CAAD,IAAOA,CAAC,EAAtC;;AACA,SAAKF,gBAAL,GAAwB,EAAxB;A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L,CAAc+B,IAAd,CAAmB,IAAnB;AAA/B,QACG,KAAKxC,KAAL,CAAWC,KAAX,GAAmB,CAAC,CAApB,gBACC;AACE,MAAA,GAAG,EAAE,KAAKa,UADZ;AAEE,MAAA,KAAK,EAAG,GAAE,KAAKd,KAAL,CAAWC,KAAM,IAF7B;AAGE,MAAA,MAAM,EAAG,GAAE,KAAKD,KAAL,CAAWE,MAAO,IAH/B;AAIE,MAAA,aAAa,EAAE,KAAK4D,gBAAL,CAAsBtB,IAAtB,CAA2B,IAA3B,CAJjB;AAKE,MAAA,aAAa,EAAE,KAAKwB,eAAL,CAAqBxB,IAArB,CAA0B,IAA1B,CALjB;AAME,MAAA,WAAW,EAAE,KAAK0B,cAAL,CAAoB1B,IAApB,CAAyB,IAAzB,CANf;AAOE,MAAA,eAAe,EAAE,KAAK4B,iBAAL,CAAuB5B,IAAvB,CAA4B,IAA5B;AAPnB,MADD,GAUG,IAXN,CADF;AAeD;;AA9KD","sourcesContent":["/* global HTMLCanvasElement */\nimport React from \"react\";\nimport type { PointerEvent } from \"react\";\nimport type { LayoutChangeEvent } from \"react-native\";\nimport { View } from \"react-native\";\n\nimport type { SkRect, SkCanvas } from \"../skia/types\";\nimport type { SkiaValue } from \"../values\";\nimport { JsiSkSurface } from \"../skia/web/JsiSkSurface\";\n\nimport type { DrawingInfo, DrawMode, SkiaViewProps, TouchInfo } from \"./types\";\nimport { TouchType } from \"./types\";\n\nexport class SkiaView extends React.Component<\n SkiaViewProps,\n { width: number; height: number }\n> {\n constructor(props: SkiaViewProps) {\n super(props);\n this.state = { width: -1, height: -1 };\n this._mode = props.mode ?? \"default\";\n }\n\n private _surface: JsiSkSurface | null = null;\n private _unsubscriptions: Array<() => void> = [];\n private _touches: Array<TouchInfo> = [];\n private _canvas: SkCanvas | null = null;\n private _canvasRef: React.RefObject<HTMLCanvasElement> = React.createRef();\n private _mode: DrawMode;\n private _redrawRequests = 0;\n private _unmounted = false;\n\n private unsubscribeAll() {\n this._unsubscriptions.forEach((u) => u());\n this._unsubscriptions = [];\n }\n\n private onLayout(evt: LayoutChangeEvent) {\n this.setState({\n width: evt.nativeEvent.layout.width,\n height: evt.nativeEvent.layout.height,\n });\n // Reset canvas / surface on layout change\n if (this._canvasRef.current) {\n // Create surface\n this._surface = new JsiSkSurface(\n global.CanvasKit,\n global.CanvasKit.MakeCanvasSurface(this._canvasRef.current)!\n );\n // Get canvas and repaint\n if (this._surface) {\n this._canvas = this._surface.getCanvas();\n this.requestRedraw();\n this.redraw();\n }\n }\n }\n\n componentDidMount() {\n // Start render loop\n this.redraw();\n }\n\n componentWillUnmount() {\n this.unsubscribeAll();\n this._surface = null;\n this._canvas = null;\n this._unmounted = true;\n }\n\n /**\n * Creates a snapshot from the canvas in the surface\n * @param rect Rect to use as bounds. Optional.\n * @returns An Image object.\n */\n public makeImageSnapshot(rect?: SkRect) {\n return this._surface?.makeImageSnapshot(rect);\n }\n\n /**\n * Sends a redraw request to the native SkiaView.\n */\n private redraw() {\n if (this._mode === \"continuous\" || this._redrawRequests > 0) {\n this._redrawRequests = 0;\n if (\n this._canvas &&\n this.props.onDraw &&\n this.state.height !== -1 &&\n this.state.width !== -1\n ) {\n const touches = [...this._touches];\n this._touches = [];\n const info: DrawingInfo = {\n height: this.state.height,\n width: this.state.width,\n timestamp: Date.now(),\n touches: [touches],\n };\n this.props.onDraw && this.props.onDraw(this._canvas!, info);\n this._surface?.ref.flush();\n }\n }\n // Always request a new redraw as long as we're not unmounted\n if (!this._unmounted) {\n requestAnimationFrame(this.redraw.bind(this));\n }\n }\n\n public requestRedraw() {\n this._redrawRequests++;\n }\n\n /**\n * Updates the drawing mode for the skia view. This is the same\n * as declaratively setting the mode property on the SkiaView.\n * There are two drawing modes, \"continuous\" and \"default\",\n * where the continuous mode will continuously redraw the view and\n * the default mode will only redraw when any of the regular react\n * properties are changed like size and margins.\n * @param mode Drawing mode to use.\n */\n public setDrawMode(mode: DrawMode) {\n this._mode = mode;\n this.redraw();\n }\n\n /**\n * Registers one or move values as a dependant value of the Skia View. The view will\n * The view will redraw itself when any of the values change.\n * @param values Values to register\n */\n public registerValues(_values: SkiaValue<unknown>[]) {\n // Unsubscribe from dependency values\n this.unsubscribeAll();\n // Register redraw dependencies on values\n _values.forEach((v) => {\n this._unsubscriptions.push(\n v.addListener(() => {\n this.requestRedraw();\n })\n );\n });\n }\n\n private handleTouchEvent(evt: PointerEvent, touchType: TouchType) {\n this._touches.push({\n id: evt.pointerId,\n x: evt.clientX - evt.currentTarget.getClientRects()[0].left,\n y: evt.clientY - evt.currentTarget.getClientRects()[0].top,\n force: evt.pressure,\n type: touchType,\n timestamp: Date.now(),\n });\n this.requestRedraw();\n }\n\n handleTouchStart(evt: PointerEvent) {\n this.handleTouchEvent(evt, TouchType.Start);\n }\n\n handleTouchMove(evt: PointerEvent) {\n this.handleTouchEvent(evt, TouchType.Active);\n }\n\n handleTouchEnd(evt: PointerEvent) {\n this.handleTouchEvent(evt, TouchType.Cancelled);\n }\n\n handleTouchCancel(evt: PointerEvent) {\n this.handleTouchEvent(evt, TouchType.End);\n }\n\n render() {\n const { mode, debug = false, ...viewProps } = this.props;\n return (\n <View {...viewProps} onLayout={this.onLayout.bind(this)}>\n {this.state.width > -1 ? (\n <canvas\n ref={this._canvasRef}\n width={`${this.state.width}px`}\n height={`${this.state.height}px`}\n onPointerDown={this.handleTouchStart.bind(this)}\n onPointerMove={this.handleTouchMove.bind(this)}\n onPointerUp={this.handleTouchEnd.bind(this)}\n onPointerCancel={this.handleTouchCancel.bind(this)}\n />\n ) : null}\n </View>\n );\n }\n}\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["types.ts"],"names":["TouchType"],"mappings":"AAYA,WAAYA,SAAZ;;WAAYA,S;AAAAA,EAAAA,S,CAAAA,S;AAAAA,EAAAA,S,CAAAA,S;AAAAA,EAAAA,S,CAAAA,S;AAAAA,EAAAA,S,CAAAA,S;GAAAA,S,KAAAA,S","sourcesContent":["import type { ViewProps } from \"react-native\";\n\nimport type { SkImage, SkRect, SkCanvas } from \"../skia/types\";\nimport type { SkiaValue } from \"../values\";\n\nexport type DrawMode = \"continuous\" | \"default\";\n\nexport type NativeSkiaViewProps = ViewProps & {\n mode?: DrawMode;\n debug?: boolean;\n};\n\nexport enum TouchType {\n Start,\n Active,\n End,\n Cancelled,\n}\n\nexport interface TouchInfo {\n x: number;\n y: number;\n force: number;\n type: TouchType;\n timestamp: number;\n}\n\nexport interface DrawingInfo {\n width: number;\n height: number;\n timestamp: number;\n touches: Array<Array<TouchInfo>>;\n}\n\nexport type ExtendedTouchInfo = TouchInfo & {\n // points per second\n velocityX: number;\n velocityY: number;\n};\n\nexport type TouchHandlers = {\n onStart?: (touchInfo: TouchInfo) => void;\n onActive?: (touchInfo: ExtendedTouchInfo) => void;\n onEnd?: (touchInfo: ExtendedTouchInfo) => void;\n};\n\nexport type TouchHandler = (touchInfo: Array<Array<TouchInfo>>) => void;\n\nexport type RNSkiaDrawCallback = (canvas: SkCanvas, info: DrawingInfo) => void;\n\n/**\n * Listener interface for value changes\n */\nexport interface ValueListener {\n addListener: (callback: () => void) => number;\n removeListener: (id: number) => void;\n}\n\nexport interface ISkiaViewApi {\n invalidateSkiaView: (nativeId: number) => void;\n makeImageSnapshot: (nativeId: number, rect?: SkRect) => SkImage;\n setDrawCallback: (\n nativeId: number,\n callback: RNSkiaDrawCallback | undefined\n ) => void;\n setDrawMode: (nativeId: number, mode: DrawMode) => void;\n registerValuesInView: (\n nativeId: number,\n values: SkiaValue<unknown>[]\n ) => () => void;\n}\n\nexport interface SkiaViewProps extends ViewProps {\n /**\n * Sets the drawing mode for the skia view. There are two drawing\n * modes, \"continuous\" and \"default\", where the continuous mode will\n * continuously redraw the view, and the default mode will only\n * redraw when any of the regular react properties are changed like\n * sizes and margins.\n */\n mode?: DrawMode;\n /**\n * When set to true the view will display information about the\n * average time it takes to render.\n */\n debug?: boolean;\n /**\n * Draw callback. Will be called whenever the view is invalidated and\n * needs to redraw. This is either caused by a change in a react\n * property, a touch event, or a call to redraw. If the view is in\n * continuous mode the callback will be called 60 frames per second\n * by the native view.\n */\n onDraw?: RNSkiaDrawCallback;\n}\n"]}
|
1
|
+
{"version":3,"sources":["types.ts"],"names":["TouchType"],"mappings":"AAYA,WAAYA,SAAZ;;WAAYA,S;AAAAA,EAAAA,S,CAAAA,S;AAAAA,EAAAA,S,CAAAA,S;AAAAA,EAAAA,S,CAAAA,S;AAAAA,EAAAA,S,CAAAA,S;GAAAA,S,KAAAA,S","sourcesContent":["import type { ViewProps } from \"react-native\";\n\nimport type { SkImage, SkRect, SkCanvas } from \"../skia/types\";\nimport type { SkiaValue } from \"../values\";\n\nexport type DrawMode = \"continuous\" | \"default\";\n\nexport type NativeSkiaViewProps = ViewProps & {\n mode?: DrawMode;\n debug?: boolean;\n};\n\nexport enum TouchType {\n Start,\n Active,\n End,\n Cancelled,\n}\n\nexport interface TouchInfo {\n x: number;\n y: number;\n force: number;\n type: TouchType;\n id: number;\n timestamp: number;\n}\n\nexport interface DrawingInfo {\n width: number;\n height: number;\n timestamp: number;\n touches: Array<Array<TouchInfo>>;\n}\n\nexport type ExtendedTouchInfo = TouchInfo & {\n // points per second\n velocityX: number;\n velocityY: number;\n};\n\nexport type TouchHandlers = {\n onStart?: (touchInfo: TouchInfo) => void;\n onActive?: (touchInfo: ExtendedTouchInfo) => void;\n onEnd?: (touchInfo: ExtendedTouchInfo) => void;\n};\n\nexport type TouchHandler = (touchInfo: Array<Array<TouchInfo>>) => void;\n\nexport type RNSkiaDrawCallback = (canvas: SkCanvas, info: DrawingInfo) => void;\n\n/**\n * Listener interface for value changes\n */\nexport interface ValueListener {\n addListener: (callback: () => void) => number;\n removeListener: (id: number) => void;\n}\n\nexport interface ISkiaViewApi {\n invalidateSkiaView: (nativeId: number) => void;\n makeImageSnapshot: (nativeId: number, rect?: SkRect) => SkImage;\n setDrawCallback: (\n nativeId: number,\n callback: RNSkiaDrawCallback | undefined\n ) => void;\n setDrawMode: (nativeId: number, mode: DrawMode) => void;\n registerValuesInView: (\n nativeId: number,\n values: SkiaValue<unknown>[]\n ) => () => void;\n}\n\nexport interface SkiaViewProps extends ViewProps {\n /**\n * Sets the drawing mode for the skia view. There are two drawing\n * modes, \"continuous\" and \"default\", where the continuous mode will\n * continuously redraw the view, and the default mode will only\n * redraw when any of the regular react properties are changed like\n * sizes and margins.\n */\n mode?: DrawMode;\n /**\n * When set to true the view will display information about the\n * average time it takes to render.\n */\n debug?: boolean;\n /**\n * Draw callback. Will be called whenever the view is invalidated and\n * needs to redraw. This is either caused by a change in a react\n * property, a touch event, or a call to redraw. If the view is in\n * continuous mode the callback will be called 60 frames per second\n * by the native view.\n */\n onDraw?: RNSkiaDrawCallback;\n}\n"]}
|
@@ -1,64 +1,85 @@
|
|
1
1
|
import { useCallback, useRef } from "react";
|
2
2
|
import { PixelRatio } from "react-native";
|
3
3
|
import { TouchType } from "./types";
|
4
|
-
/**
|
5
|
-
* Provides a callback for handling touch events in the Skia View.
|
6
|
-
* This touch handler only handles single taps.
|
7
|
-
* @param handlers Callbacks for the different touch states
|
8
|
-
* @param deps optional Dependency array to update the handlers
|
9
|
-
* @returns A function that can be used from within the onDraw callback to
|
10
|
-
* update and handle touch events. Call it with the touches property from
|
11
|
-
* the info object.
|
12
|
-
*/
|
13
4
|
|
14
|
-
|
5
|
+
const useInternalTouchHandler = function (handlers) {
|
15
6
|
let deps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
16
|
-
|
17
|
-
const
|
18
|
-
|
19
|
-
y: 0
|
20
|
-
});
|
7
|
+
let multiTouch = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
8
|
+
const prevTouchInfoRef = useRef({});
|
9
|
+
const prevVelocityRef = useRef({});
|
21
10
|
return useCallback(history => {
|
22
11
|
// Process all items in the current touch history
|
23
12
|
history.forEach(touches => {
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
return;
|
28
|
-
} // Get the next touch
|
13
|
+
// Enumerate touches
|
14
|
+
for (let i = 0; i < touches.length; i++) {
|
15
|
+
var _prevTouchInfoRef$cur, _prevTouchInfoRef$cur2, _prevTouchInfoRef$cur3, _prevTouchInfoRef$cur4, _prevTouchInfoRef$cur5, _prevTouchInfoRef$cur6, _prevVelocityRef$curr, _prevVelocityRef$curr2;
|
29
16
|
|
17
|
+
if (!multiTouch && i > 0) {
|
18
|
+
break;
|
19
|
+
}
|
30
20
|
|
31
|
-
|
21
|
+
const touch = touches[i]; // Calculate the velocity from the previous touch.
|
32
22
|
|
33
|
-
|
34
|
-
|
35
|
-
|
23
|
+
const timeDiffseconds = touch.timestamp - ((_prevTouchInfoRef$cur = (_prevTouchInfoRef$cur2 = prevTouchInfoRef.current[touch.id]) === null || _prevTouchInfoRef$cur2 === void 0 ? void 0 : _prevTouchInfoRef$cur2.timestamp) !== null && _prevTouchInfoRef$cur !== void 0 ? _prevTouchInfoRef$cur : touch.timestamp);
|
24
|
+
const distX = touch.x - ((_prevTouchInfoRef$cur3 = (_prevTouchInfoRef$cur4 = prevTouchInfoRef.current[touch.id]) === null || _prevTouchInfoRef$cur4 === void 0 ? void 0 : _prevTouchInfoRef$cur4.x) !== null && _prevTouchInfoRef$cur3 !== void 0 ? _prevTouchInfoRef$cur3 : touch.x);
|
25
|
+
const distY = touch.y - ((_prevTouchInfoRef$cur5 = (_prevTouchInfoRef$cur6 = prevTouchInfoRef.current[touch.id]) === null || _prevTouchInfoRef$cur6 === void 0 ? void 0 : _prevTouchInfoRef$cur6.y) !== null && _prevTouchInfoRef$cur5 !== void 0 ? _prevTouchInfoRef$cur5 : touch.y);
|
36
26
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
27
|
+
if (touch.type !== TouchType.Start && touch.type !== TouchType.End && touch.type !== TouchType.Cancelled) {
|
28
|
+
if (timeDiffseconds > 0) {
|
29
|
+
prevVelocityRef.current[touch.id] = {
|
30
|
+
x: distX / timeDiffseconds / PixelRatio.get(),
|
31
|
+
y: distY / timeDiffseconds / PixelRatio.get()
|
32
|
+
};
|
33
|
+
}
|
41
34
|
}
|
42
|
-
}
|
43
35
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
36
|
+
const extendedTouchInfo = { ...touch,
|
37
|
+
velocityX: (_prevVelocityRef$curr = prevVelocityRef.current[touch.id]) === null || _prevVelocityRef$curr === void 0 ? void 0 : _prevVelocityRef$curr.x,
|
38
|
+
velocityY: (_prevVelocityRef$curr2 = prevVelocityRef.current[touch.id]) === null || _prevVelocityRef$curr2 === void 0 ? void 0 : _prevVelocityRef$curr2.y
|
39
|
+
}; // Save previous touch
|
48
40
|
|
49
|
-
|
41
|
+
prevTouchInfoRef.current[touch.id] = touch;
|
50
42
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
43
|
+
if (touch.type === TouchType.Start) {
|
44
|
+
delete prevVelocityRef.current[touch.id];
|
45
|
+
handlers.onStart && handlers.onStart(touch);
|
46
|
+
} else if (touch.type === TouchType.Active) {
|
47
|
+
handlers.onActive && handlers.onActive(extendedTouchInfo);
|
48
|
+
} else {
|
49
|
+
handlers.onActive && handlers.onActive(extendedTouchInfo);
|
50
|
+
handlers.onEnd && handlers.onEnd(extendedTouchInfo);
|
51
|
+
}
|
60
52
|
}
|
61
53
|
}); // eslint-disable-next-line react-hooks/exhaustive-deps
|
62
54
|
}, deps);
|
63
55
|
};
|
56
|
+
/**
|
57
|
+
* Provides a callback for handling touch events in the Skia View.
|
58
|
+
* This touch handler only handles single touches.
|
59
|
+
* @param handlers Callbacks for the different touch states
|
60
|
+
* @param deps optional Dependency array to update the handlers
|
61
|
+
* @returns A function that can be used from within the onDraw callback to
|
62
|
+
* update and handle touch events. Call it with the touches property from
|
63
|
+
* the info object.
|
64
|
+
*/
|
65
|
+
|
66
|
+
|
67
|
+
export const useTouchHandler = function (handlers) {
|
68
|
+
let deps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
69
|
+
return useInternalTouchHandler(handlers, deps, false);
|
70
|
+
};
|
71
|
+
/**
|
72
|
+
* Provides a callback for handling touch events in the Skia View.
|
73
|
+
* This touch handler handles multiple touches.
|
74
|
+
* @param handlers Callbacks for the different touch states
|
75
|
+
* @param deps optional Dependency array to update the handlers
|
76
|
+
* @returns A function that can be used from within the onDraw callback to
|
77
|
+
* update and handle touch events. Call it with the touches property from
|
78
|
+
* the info object.
|
79
|
+
*/
|
80
|
+
|
81
|
+
export const useMultiTouchHandler = function (handlers) {
|
82
|
+
let deps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
83
|
+
return useInternalTouchHandler(handlers, deps, true);
|
84
|
+
};
|
64
85
|
//# sourceMappingURL=useTouchHandler.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["useTouchHandler.ts"],"names":["useCallback","useRef","PixelRatio","TouchType","
|
1
|
+
{"version":3,"sources":["useTouchHandler.ts"],"names":["useCallback","useRef","PixelRatio","TouchType","useInternalTouchHandler","handlers","deps","multiTouch","prevTouchInfoRef","prevVelocityRef","history","forEach","touches","i","length","touch","timeDiffseconds","timestamp","current","id","distX","x","distY","y","type","Start","End","Cancelled","get","extendedTouchInfo","velocityX","velocityY","onStart","Active","onActive","onEnd","useTouchHandler","useMultiTouchHandler"],"mappings":"AACA,SAASA,WAAT,EAAsBC,MAAtB,QAAoC,OAApC;AACA,SAASC,UAAT,QAA2B,cAA3B;AAQA,SAASC,SAAT,QAA0B,SAA1B;;AAEA,MAAMC,uBAAuB,GAAG,UAC9BC,QAD8B,EAIb;AAAA,MAFjBC,IAEiB,uEAFM,EAEN;AAAA,MADjBC,UACiB,uEADJ,KACI;AACjB,QAAMC,gBAAgB,GAAGP,MAAM,CAA+B,EAA/B,CAA/B;AACA,QAAMQ,eAAe,GAAGR,MAAM,CAC5B,EAD4B,CAA9B;AAIA,SAAOD,WAAW,CAAEU,OAAD,IAAsC;AACvD;AACAA,IAAA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AiB,KAAjB,CAA9B;AACD,CALM;AAOP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAM+B,oBAAoB,GAAG,UAClChC,QADkC,EAGjB;AAAA,MADjBC,IACiB,uEADM,EACN;AACjB,SAAOF,uBAAuB,CAACC,QAAD,EAAWC,IAAX,EAAiB,IAAjB,CAA9B;AACD,CALM","sourcesContent":["import type { DependencyList } from \"react\";\nimport { useCallback, useRef } from \"react\";\nimport { PixelRatio } from \"react-native\";\n\nimport type {\n ExtendedTouchInfo,\n TouchHandlers,\n TouchHandler,\n TouchInfo,\n} from \"./types\";\nimport { TouchType } from \"./types\";\n\nconst useInternalTouchHandler = (\n handlers: TouchHandlers,\n deps: DependencyList = [],\n multiTouch = false\n): TouchHandler => {\n const prevTouchInfoRef = useRef<{ [key: number]: TouchInfo }>({});\n const prevVelocityRef = useRef<{ [key: number]: { x: number; y: number } }>(\n {}\n );\n\n return useCallback((history: Array<Array<TouchInfo>>) => {\n // Process all items in the current touch history\n history.forEach((touches) => {\n // Enumerate touches\n for (let i = 0; i < touches.length; i++) {\n if (!multiTouch && i > 0) {\n break;\n }\n\n const touch = touches[i];\n\n // Calculate the velocity from the previous touch.\n const timeDiffseconds =\n touch.timestamp -\n (prevTouchInfoRef.current[touch.id]?.timestamp ?? touch.timestamp);\n\n const distX =\n touch.x - (prevTouchInfoRef.current[touch.id]?.x ?? touch.x);\n const distY =\n touch.y - (prevTouchInfoRef.current[touch.id]?.y ?? touch.y);\n\n if (\n touch.type !== TouchType.Start &&\n touch.type !== TouchType.End &&\n touch.type !== TouchType.Cancelled\n ) {\n if (timeDiffseconds > 0) {\n prevVelocityRef.current[touch.id] = {\n x: distX / timeDiffseconds / PixelRatio.get(),\n y: distY / timeDiffseconds / PixelRatio.get(),\n };\n }\n }\n\n const extendedTouchInfo: ExtendedTouchInfo = {\n ...touch,\n velocityX: prevVelocityRef.current[touch.id]?.x,\n velocityY: prevVelocityRef.current[touch.id]?.y,\n };\n\n // Save previous touch\n prevTouchInfoRef.current[touch.id] = touch;\n\n if (touch.type === TouchType.Start) {\n delete prevVelocityRef.current[touch.id];\n handlers.onStart && handlers.onStart(touch);\n } else if (touch.type === TouchType.Active) {\n handlers.onActive && handlers.onActive(extendedTouchInfo);\n } else {\n handlers.onActive && handlers.onActive(extendedTouchInfo);\n handlers.onEnd && handlers.onEnd(extendedTouchInfo);\n }\n }\n });\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, deps);\n};\n\n/**\n * Provides a callback for handling touch events in the Skia View.\n * This touch handler only handles single touches.\n * @param handlers Callbacks for the different touch states\n * @param deps optional Dependency array to update the handlers\n * @returns A function that can be used from within the onDraw callback to\n * update and handle touch events. Call it with the touches property from\n * the info object.\n */\nexport const useTouchHandler = (\n handlers: TouchHandlers,\n deps: DependencyList = []\n): TouchHandler => {\n return useInternalTouchHandler(handlers, deps, false);\n};\n\n/**\n * Provides a callback for handling touch events in the Skia View.\n * This touch handler handles multiple touches.\n * @param handlers Callbacks for the different touch states\n * @param deps optional Dependency array to update the handlers\n * @returns A function that can be used from within the onDraw callback to\n * update and handle touch events. Call it with the touches property from\n * the info object.\n */\nexport const useMultiTouchHandler = (\n handlers: TouchHandlers,\n deps: DependencyList = []\n): TouchHandler => {\n return useInternalTouchHandler(handlers, deps, true);\n};\n"]}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import CanvasKitInit from "canvaskit-wasm";
|
2
|
+
export const LoadSkia = async () => {
|
3
|
+
const CanvasKit = await CanvasKitInit(); // The CanvasKit API is stored on the global object and used
|
4
|
+
// to create the JsiSKApi in the Skia.web.ts file.
|
5
|
+
|
6
|
+
global.CanvasKit = CanvasKit;
|
7
|
+
};
|
8
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["index.ts"],"names":["CanvasKitInit","LoadSkia","CanvasKit","global"],"mappings":"AAAA,OAAOA,aAAP,MAA0B,gBAA1B;AAOA,OAAO,MAAMC,QAAQ,GAAG,YAAY;AAClC,QAAMC,SAAS,GAAG,MAAMF,aAAa,EAArC,CADkC,CAElC;AACA;;AACAG,EAAAA,MAAM,CAACD,SAAP,GAAmBA,SAAnB;AACD,CALM","sourcesContent":["import CanvasKitInit from \"canvaskit-wasm\";\nimport type { CanvasKit as CanvasKitType } from \"canvaskit-wasm\";\n\ndeclare global {\n var CanvasKit: CanvasKitType;\n}\n\nexport const LoadSkia = async () => {\n const CanvasKit = await CanvasKitInit();\n // The CanvasKit API is stored on the global object and used\n // to create the JsiSKApi in the Skia.web.ts file.\n global.CanvasKit = CanvasKit;\n};\n"]}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import type { SkPath } from "../../skia/types";
|
2
|
+
/**
|
3
|
+
* Maps an input value within a range to an output path within a path range.
|
4
|
+
* @param value - The input value.
|
5
|
+
* @param inputRange - The range of the input value.
|
6
|
+
* @param outputRange - The range of the output path.
|
7
|
+
* @returns The output path.
|
8
|
+
* @example <caption>Map a value between 0 and 1 to a path between two paths.</caption>
|
9
|
+
* const path1 = new Path();
|
10
|
+
* path1.moveTo(0, 0);
|
11
|
+
* path1.lineTo(100, 0);
|
12
|
+
* const path2 = new Path();
|
13
|
+
* path2.moveTo(0, 0);
|
14
|
+
* path2.lineTo(0, 100);
|
15
|
+
* const path = interpolatePath(0.5, [0, 1], [path1, path2]);
|
16
|
+
*/
|
17
|
+
export declare const interpolatePaths: (value: number, input: number[], outputRange: SkPath[]) => SkPath;
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import type { Vector } from "../../skia/types";
|
2
|
+
import { interpolate } from "./interpolate";
|
3
|
+
export declare const interpolateVector: (value: number, inputRange: readonly number[], outputRange: readonly Vector[], options?: Parameters<typeof interpolate>[3]) => {
|
4
|
+
x: number;
|
5
|
+
y: number;
|
6
|
+
};
|
7
|
+
export declare const mixVector: (value: number, from: Vector, to: Vector) => {
|
8
|
+
x: number;
|
9
|
+
y: number;
|
10
|
+
};
|