@shopify/react-native-skia 0.1.150 → 0.1.152
Sign up to get free protection for your applications and to get access to all the features.
- package/android/CMakeLists.txt +4 -5
- package/android/cpp/jni/JniLoad.cpp +7 -5
- package/android/cpp/jni/JniSkiaManager.cpp +2 -15
- package/android/cpp/jni/include/JniSkiaBaseView.h +68 -0
- package/android/cpp/jni/include/JniSkiaDrawView.h +64 -47
- package/android/cpp/jni/include/JniSkiaManager.h +8 -10
- package/android/cpp/jni/include/JniSkiaPictureView.h +96 -0
- package/android/cpp/rnskia-android/{RNSkPlatformContextImpl.h → RNSkAndroidPlatformContext.h} +4 -4
- package/android/cpp/rnskia-android/RNSkAndroidView.h +100 -0
- package/android/cpp/rnskia-android/RNSkOpenGLCanvasProvider.cpp +91 -0
- package/android/cpp/rnskia-android/RNSkOpenGLCanvasProvider.h +39 -0
- package/android/cpp/rnskia-android/SkiaOpenGLRenderer.cpp +15 -6
- package/android/cpp/rnskia-android/SkiaOpenGLRenderer.h +5 -4
- package/android/src/main/java/com/shopify/reactnative/skia/PlatformContext.java +5 -11
- package/android/src/main/java/com/shopify/reactnative/skia/RNSkiaPackage.java +1 -2
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaBaseView.java +143 -0
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaDrawView.java +17 -145
- package/android/src/main/java/com/shopify/reactnative/skia/{RNSkiaViewManager.java → SkiaDrawViewManager.java} +4 -15
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaManager.java +1 -10
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaPictureView.java +45 -0
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaPictureViewManager.java +64 -0
- package/cpp/jsi/JsiValueWrapper.h +11 -0
- package/cpp/rnskia/RNSkInfoParameter.h +4 -14
- package/cpp/rnskia/RNSkJsView.cpp +211 -0
- package/cpp/rnskia/RNSkJsView.h +115 -0
- package/cpp/rnskia/RNSkJsiViewApi.h +6 -6
- package/cpp/rnskia/RNSkManager.cpp +7 -7
- package/cpp/rnskia/RNSkManager.h +7 -7
- package/cpp/rnskia/RNSkPictureView.h +124 -0
- package/cpp/rnskia/RNSkView.h +287 -0
- package/ios/RNSkia-iOS/RNSkMetalCanvasProvider.h +38 -0
- package/ios/RNSkia-iOS/{RNSkDrawViewImpl.mm → RNSkMetalCanvasProvider.mm} +40 -23
- package/ios/RNSkia-iOS/{PlatformContext.h → RNSkiOSPlatformContext.h} +4 -4
- package/ios/RNSkia-iOS/{PlatformContext.mm → RNSkiOSPlatformContext.mm} +5 -5
- package/ios/RNSkia-iOS/RNSkiOSView.h +34 -0
- package/ios/RNSkia-iOS/SkiaDrawViewManager.mm +19 -11
- package/ios/RNSkia-iOS/SkiaManager.mm +3 -3
- package/ios/RNSkia-iOS/SkiaPictureViewManager.h +8 -0
- package/ios/RNSkia-iOS/SkiaPictureViewManager.mm +51 -0
- package/ios/RNSkia-iOS/SkiaUIView.h +26 -0
- package/ios/RNSkia-iOS/{SkiaDrawView.mm → SkiaUIView.mm} +29 -23
- package/lib/commonjs/animation/decay/decay.js.map +1 -1
- package/lib/commonjs/animation/decay/index.js.map +1 -1
- package/lib/commonjs/animation/decay/runDecay.js.map +1 -1
- package/lib/commonjs/animation/decay/types.js.map +1 -1
- package/lib/commonjs/animation/functions/index.js.map +1 -1
- package/lib/commonjs/animation/functions/interpolate.js.map +1 -1
- package/lib/commonjs/animation/functions/interpolateColors.js.map +1 -1
- package/lib/commonjs/animation/functions/interpolatePaths.js.map +1 -1
- package/lib/commonjs/animation/functions/interpolateVector.js.map +1 -1
- package/lib/commonjs/animation/index.js.map +1 -1
- package/lib/commonjs/animation/spring/Spring.js.map +1 -1
- package/lib/commonjs/animation/spring/functions/index.js.map +1 -1
- package/lib/commonjs/animation/spring/functions/spring.js.map +1 -1
- package/lib/commonjs/animation/spring/index.js.map +1 -1
- package/lib/commonjs/animation/spring/runSpring.js +1 -1
- package/lib/commonjs/animation/spring/runSpring.js.map +1 -1
- package/lib/commonjs/animation/spring/types.js.map +1 -1
- package/lib/commonjs/animation/spring/useSpring.js +1 -1
- package/lib/commonjs/animation/spring/useSpring.js.map +1 -1
- package/lib/commonjs/animation/timing/Easing.js.map +1 -1
- package/lib/commonjs/animation/timing/createTiming.js +2 -6
- package/lib/commonjs/animation/timing/createTiming.js.map +1 -1
- package/lib/commonjs/animation/timing/functions/bezier.js.map +1 -1
- package/lib/commonjs/animation/timing/functions/getResolvedParams.js +6 -10
- package/lib/commonjs/animation/timing/functions/getResolvedParams.js.map +1 -1
- package/lib/commonjs/animation/timing/functions/index.js.map +1 -1
- package/lib/commonjs/animation/timing/functions/timing.js.map +1 -1
- package/lib/commonjs/animation/timing/functions/types.js.map +1 -1
- package/lib/commonjs/animation/timing/index.js.map +1 -1
- package/lib/commonjs/animation/timing/runTiming.js.map +1 -1
- package/lib/commonjs/animation/timing/useLoop.js.map +1 -1
- package/lib/commonjs/animation/timing/useTiming.js +1 -3
- package/lib/commonjs/animation/timing/useTiming.js.map +1 -1
- package/lib/commonjs/animation/types.js.map +1 -1
- package/lib/commonjs/dom/nodes/DrawingNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/GroupNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/JsiSkDOM.js +1 -1
- package/lib/commonjs/dom/nodes/JsiSkDOM.js.map +1 -1
- package/lib/commonjs/dom/nodes/Node.js.map +1 -1
- package/lib/commonjs/dom/nodes/PaintContext.js.map +1 -1
- package/lib/commonjs/dom/nodes/PaintNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/RenderNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Circle.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Color.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Enum.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Fitting.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Gradient.js +2 -2
- package/lib/commonjs/dom/nodes/datatypes/Gradient.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Path.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Radius.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Rect.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Transform.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/index.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/BackdropFilterNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/Box.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/CircleNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/CustomDrawingNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/DiffRectNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/FillNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/ImageNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/ImageSVG.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/LineNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/OvalNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/PatchNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/PathNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/PictureNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/PointsNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/RRectNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/RectNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/Text.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/VerticesNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/index.js.map +1 -1
- package/lib/commonjs/dom/nodes/index.js.map +1 -1
- package/lib/commonjs/dom/nodes/paint/BlendNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/paint/ColorFilters.js.map +1 -1
- package/lib/commonjs/dom/nodes/paint/ImageFilters.js.map +1 -1
- package/lib/commonjs/dom/nodes/paint/MaskFilters.js.map +1 -1
- package/lib/commonjs/dom/nodes/paint/PathEffects.js.map +1 -1
- package/lib/commonjs/dom/nodes/paint/Shaders.js +2 -4
- package/lib/commonjs/dom/nodes/paint/Shaders.js.map +1 -1
- package/lib/commonjs/dom/nodes/paint/index.js.map +1 -1
- package/lib/commonjs/dom/types/ColorFilters.js.map +1 -1
- package/lib/commonjs/dom/types/Common.js.map +1 -1
- package/lib/commonjs/dom/types/DrawingContext.js.map +1 -1
- package/lib/commonjs/dom/types/Drawings.js.map +1 -1
- package/lib/commonjs/dom/types/ImageFilters.js.map +1 -1
- package/lib/commonjs/dom/types/MaskFilters.js.map +1 -1
- package/lib/commonjs/dom/types/Node.js.map +1 -1
- package/lib/commonjs/dom/types/NodeType.js.map +1 -1
- package/lib/commonjs/dom/types/PathEffects.js.map +1 -1
- package/lib/commonjs/dom/types/Shaders.js.map +1 -1
- package/lib/commonjs/dom/types/SkDOM.js.map +1 -1
- package/lib/commonjs/dom/types/index.js.map +1 -1
- package/lib/commonjs/external/index.js.map +1 -1
- package/lib/commonjs/external/reanimated/index.js.map +1 -1
- package/lib/commonjs/external/reanimated/useSharedValueEffect.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/mock/index.js +6 -10
- package/lib/commonjs/mock/index.js.map +1 -1
- package/lib/commonjs/renderer/Canvas.js.map +1 -1
- package/lib/commonjs/renderer/Container.js.map +1 -1
- package/lib/commonjs/renderer/DependencyManager.js.map +1 -1
- package/lib/commonjs/renderer/DrawingContext.js.map +1 -1
- package/lib/commonjs/renderer/HostComponents.js.map +1 -1
- package/lib/commonjs/renderer/HostConfig.js +0 -2
- package/lib/commonjs/renderer/HostConfig.js.map +1 -1
- package/lib/commonjs/renderer/components/Blend.js.map +1 -1
- package/lib/commonjs/renderer/components/Drawing.js.map +1 -1
- package/lib/commonjs/renderer/components/Group.js.map +1 -1
- package/lib/commonjs/renderer/components/Mask.js.map +1 -1
- package/lib/commonjs/renderer/components/Paint.js +1 -1
- package/lib/commonjs/renderer/components/Paint.js.map +1 -1
- package/lib/commonjs/renderer/components/Picture.js.map +1 -1
- package/lib/commonjs/renderer/components/backdrop/BackdropBlur.js +1 -1
- package/lib/commonjs/renderer/components/backdrop/BackdropBlur.js.map +1 -1
- package/lib/commonjs/renderer/components/backdrop/BackdropFilter.js.map +1 -1
- package/lib/commonjs/renderer/components/backdrop/index.js.map +1 -1
- package/lib/commonjs/renderer/components/colorFilters/BlendColor.js.map +1 -1
- package/lib/commonjs/renderer/components/colorFilters/Lerp.js.map +1 -1
- package/lib/commonjs/renderer/components/colorFilters/LinearToSRGBGamma.js.map +1 -1
- package/lib/commonjs/renderer/components/colorFilters/LumaColorFilter.js.map +1 -1
- package/lib/commonjs/renderer/components/colorFilters/Matrix.js.map +1 -1
- package/lib/commonjs/renderer/components/colorFilters/SRGBToLinearGamma.js.map +1 -1
- package/lib/commonjs/renderer/components/colorFilters/index.js.map +1 -1
- package/lib/commonjs/renderer/components/image/Image.js.map +1 -1
- package/lib/commonjs/renderer/components/image/ImageSVG.js.map +1 -1
- package/lib/commonjs/renderer/components/image/ImageShader.js.map +1 -1
- package/lib/commonjs/renderer/components/image/index.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/Blur.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/DisplacementMap.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/Morphology.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/Offset.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/RuntimeShader.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/Shadow.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/index.js.map +1 -1
- package/lib/commonjs/renderer/components/index.js.map +1 -1
- package/lib/commonjs/renderer/components/maskFilters/Blur.js.map +1 -1
- package/lib/commonjs/renderer/components/maskFilters/index.js.map +1 -1
- package/lib/commonjs/renderer/components/pathEffects/Corner.js.map +1 -1
- package/lib/commonjs/renderer/components/pathEffects/Dash.js.map +1 -1
- package/lib/commonjs/renderer/components/pathEffects/Discrete.js.map +1 -1
- package/lib/commonjs/renderer/components/pathEffects/Line2D.js.map +1 -1
- package/lib/commonjs/renderer/components/pathEffects/Path1D.js.map +1 -1
- package/lib/commonjs/renderer/components/pathEffects/Path2D.js.map +1 -1
- package/lib/commonjs/renderer/components/pathEffects/Sum.js.map +1 -1
- package/lib/commonjs/renderer/components/pathEffects/index.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/Color.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/FractalNoise.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/LinearGradient.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/RadialGradient.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/Shader.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/ShaderLib.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/SweepGradient.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/Turbulence.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/TwoPointConicalGradient.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/index.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Box.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Circle.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/DiffRect.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Fill.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/FitBox.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Line.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Oval.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Patch.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Path.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Points.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Rect.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/RoundedRect.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Vertices.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/index.js.map +1 -1
- package/lib/commonjs/renderer/components/text/Glyphs.js.map +1 -1
- package/lib/commonjs/renderer/components/text/Text.js.map +1 -1
- package/lib/commonjs/renderer/components/text/TextBlob.js.map +1 -1
- package/lib/commonjs/renderer/components/text/TextPath.js.map +1 -1
- package/lib/commonjs/renderer/components/text/index.js.map +1 -1
- package/lib/commonjs/renderer/index.js.map +1 -1
- package/lib/commonjs/renderer/processors/Animations/Animations.js.map +1 -1
- package/lib/commonjs/renderer/processors/Animations/index.js.map +1 -1
- package/lib/commonjs/renderer/processors/index.js.map +1 -1
- package/lib/commonjs/renderer/processors/math/Coordinates.js.map +1 -1
- package/lib/commonjs/renderer/processors/math/Math.js.map +1 -1
- package/lib/commonjs/renderer/processors/math/Transforms.js.map +1 -1
- package/lib/commonjs/renderer/processors/math/index.js.map +1 -1
- package/lib/commonjs/renderer/typeddash.js.map +1 -1
- package/lib/commonjs/renderer/useCanvas.js.map +1 -1
- package/lib/commonjs/renderer/useContextBridge.js.map +1 -1
- package/lib/commonjs/skia/NativeSetup.js.map +1 -1
- package/lib/commonjs/skia/Skia.js.map +1 -1
- package/lib/commonjs/skia/Skia.web.js.map +1 -1
- package/lib/commonjs/skia/core/Data.js.map +1 -1
- package/lib/commonjs/skia/core/Font.js.map +1 -1
- package/lib/commonjs/skia/core/Image.js.map +1 -1
- package/lib/commonjs/skia/core/Matrix.js.map +1 -1
- package/lib/commonjs/skia/core/Picture.js.map +1 -1
- package/lib/commonjs/skia/core/RRect.js.map +1 -1
- package/lib/commonjs/skia/core/Rect.js.map +1 -1
- package/lib/commonjs/skia/core/SVG.js.map +1 -1
- package/lib/commonjs/skia/core/Typeface.js.map +1 -1
- package/lib/commonjs/skia/core/Vector.js +1 -1
- package/lib/commonjs/skia/core/Vector.js.map +1 -1
- package/lib/commonjs/skia/core/index.js.map +1 -1
- package/lib/commonjs/skia/index.js.map +1 -1
- package/lib/commonjs/skia/types/Canvas.js.map +1 -1
- package/lib/commonjs/skia/types/Color.js.map +1 -1
- package/lib/commonjs/skia/types/ColorFilter/ColorFilter.js.map +1 -1
- package/lib/commonjs/skia/types/ColorFilter/ColorFilterFactory.js.map +1 -1
- package/lib/commonjs/skia/types/ColorFilter/index.js.map +1 -1
- package/lib/commonjs/skia/types/ContourMeasure.js.map +1 -1
- package/lib/commonjs/skia/types/Data/Data.js.map +1 -1
- package/lib/commonjs/skia/types/Data/DataFactory.js.map +1 -1
- package/lib/commonjs/skia/types/Data/index.js.map +1 -1
- package/lib/commonjs/skia/types/Font/Font.js.map +1 -1
- package/lib/commonjs/skia/types/Font/index.js.map +1 -1
- package/lib/commonjs/skia/types/Image/Image.js.map +1 -1
- package/lib/commonjs/skia/types/Image/ImageFactory.js.map +1 -1
- package/lib/commonjs/skia/types/Image/index.js.map +1 -1
- package/lib/commonjs/skia/types/ImageFilter/ImageFilter.js.map +1 -1
- package/lib/commonjs/skia/types/ImageFilter/ImageFilterFactory.js.map +1 -1
- package/lib/commonjs/skia/types/ImageFilter/index.js.map +1 -1
- package/lib/commonjs/skia/types/JsiInstance.js.map +1 -1
- package/lib/commonjs/skia/types/MaskFilter.js.map +1 -1
- package/lib/commonjs/skia/types/Matrix.js.map +1 -1
- package/lib/commonjs/skia/types/Paint/BlendMode.js.map +1 -1
- package/lib/commonjs/skia/types/Paint/Paint.js.map +1 -1
- package/lib/commonjs/skia/types/Paint/index.js.map +1 -1
- package/lib/commonjs/skia/types/Path/Path.js.map +1 -1
- package/lib/commonjs/skia/types/Path/PathFactory.js.map +1 -1
- package/lib/commonjs/skia/types/Path/index.js.map +1 -1
- package/lib/commonjs/skia/types/PathEffect.js.map +1 -1
- package/lib/commonjs/skia/types/Picture/Picture.js.map +1 -1
- package/lib/commonjs/skia/types/Picture/PictureFactory.js.map +1 -1
- package/lib/commonjs/skia/types/Picture/PictureRecorder.js.map +1 -1
- package/lib/commonjs/skia/types/Picture/index.js.map +1 -1
- package/lib/commonjs/skia/types/Point.js.map +1 -1
- package/lib/commonjs/skia/types/RRect.js.map +1 -1
- package/lib/commonjs/skia/types/RSXform.js.map +1 -1
- package/lib/commonjs/skia/types/Rect.js.map +1 -1
- package/lib/commonjs/skia/types/RuntimeEffect/RuntimeEffect.js.map +1 -1
- package/lib/commonjs/skia/types/RuntimeEffect/RuntimeEffectFactory.js.map +1 -1
- package/lib/commonjs/skia/types/RuntimeEffect/index.js.map +1 -1
- package/lib/commonjs/skia/types/SVG/SVG.js.map +1 -1
- package/lib/commonjs/skia/types/SVG/SVGFactory.js.map +1 -1
- package/lib/commonjs/skia/types/SVG/index.js.map +1 -1
- package/lib/commonjs/skia/types/Shader/Shader.js.map +1 -1
- package/lib/commonjs/skia/types/Shader/ShaderFactory.js.map +1 -1
- package/lib/commonjs/skia/types/Shader/index.js.map +1 -1
- package/lib/commonjs/skia/types/Skia.js.map +1 -1
- package/lib/commonjs/skia/types/Surface/Surface.js.map +1 -1
- package/lib/commonjs/skia/types/Surface/SurfaceFactory.js.map +1 -1
- package/lib/commonjs/skia/types/Surface/index.js.map +1 -1
- package/lib/commonjs/skia/types/TextBlob.js.map +1 -1
- package/lib/commonjs/skia/types/Typeface/Typeface.js.map +1 -1
- package/lib/commonjs/skia/types/Typeface/TypefaceFactory.js.map +1 -1
- package/lib/commonjs/skia/types/Typeface/index.js.map +1 -1
- package/lib/commonjs/skia/types/Vertices/Vertices.js.map +1 -1
- package/lib/commonjs/skia/types/Vertices/index.js.map +1 -1
- package/lib/commonjs/skia/types/index.js.map +1 -1
- package/lib/commonjs/skia/web/Host.js +1 -1
- package/lib/commonjs/skia/web/Host.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkCanvas.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkColor.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkColorFilter.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkColorFilterFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkContourMeasure.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkContourMeasureIter.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkData.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkDataFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkFont.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkImage.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkImageFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkImageFilter.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkImageFilterFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkMaskFilter.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkMaskFilterFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkMatrix.js +1 -1
- package/lib/commonjs/skia/web/JsiSkMatrix.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPaint.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPath.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPathEffect.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPathEffectFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPathFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPicture.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPictureFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPictureRecorder.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPoint.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkRRect.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkRSXform.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkRect.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkRuntimeEffect.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkRuntimeEffectFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkSVGFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkShader.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkShaderFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkSurface.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkSurfaceFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkTextBlob.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkTextBlobFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkTypeface.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkTypefaceFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkVertices.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkVerticesFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkia.js.map +1 -1
- package/lib/commonjs/skia/web/index.js.map +1 -1
- package/lib/commonjs/values/api.js.map +1 -1
- package/lib/commonjs/values/api.web.js.map +1 -1
- package/lib/commonjs/values/hooks/index.js.map +1 -1
- package/lib/commonjs/values/hooks/useClockValue.js.map +1 -1
- package/lib/commonjs/values/hooks/useComputedValue.js.map +1 -1
- package/lib/commonjs/values/hooks/useValue.js.map +1 -1
- package/lib/commonjs/values/hooks/useValueEffect.js.map +1 -1
- package/lib/commonjs/values/index.js.map +1 -1
- package/lib/commonjs/values/selector.js.map +1 -1
- package/lib/commonjs/values/types.js.map +1 -1
- package/lib/commonjs/values/web/RNSkAnimation.js +2 -2
- package/lib/commonjs/values/web/RNSkAnimation.js.map +1 -1
- package/lib/commonjs/values/web/RNSkClockValue.js.map +1 -1
- package/lib/commonjs/values/web/RNSkComputedValue.js +1 -1
- package/lib/commonjs/values/web/RNSkComputedValue.js.map +1 -1
- package/lib/commonjs/values/web/RNSkReadonlyValue.js.map +1 -1
- package/lib/commonjs/values/web/RNSkValue.js.map +1 -1
- package/lib/commonjs/values/web/api.js.map +1 -1
- package/lib/commonjs/values/web/index.js.map +1 -1
- package/lib/commonjs/views/SkiaBaseWebView.js +213 -0
- package/lib/commonjs/views/SkiaBaseWebView.js.map +1 -0
- package/lib/commonjs/views/SkiaPictureView.js +112 -0
- package/lib/commonjs/views/SkiaPictureView.js.map +1 -0
- package/lib/commonjs/views/SkiaPictureView.web.js +31 -0
- package/lib/commonjs/views/SkiaPictureView.web.js.map +1 -0
- package/lib/commonjs/views/SkiaView.js +2 -2
- package/lib/commonjs/views/SkiaView.js.map +1 -1
- package/lib/commonjs/views/SkiaView.web.js +14 -203
- package/lib/commonjs/views/SkiaView.web.js.map +1 -1
- package/lib/commonjs/views/api.js.map +1 -1
- package/lib/commonjs/views/index.js +13 -0
- package/lib/commonjs/views/index.js.map +1 -1
- package/lib/commonjs/views/types.js.map +1 -1
- package/lib/commonjs/views/useDrawCallback.js.map +1 -1
- package/lib/commonjs/views/useTouchHandler.js +6 -6
- package/lib/commonjs/views/useTouchHandler.js.map +1 -1
- package/lib/commonjs/web/LoadSkiaWeb.js.map +1 -1
- package/lib/commonjs/web/WithSkiaWeb.js +1 -1
- package/lib/commonjs/web/WithSkiaWeb.js.map +1 -1
- package/lib/commonjs/web/index.js.map +1 -1
- package/lib/module/animation/decay/decay.js.map +1 -1
- package/lib/module/animation/decay/index.js.map +1 -1
- package/lib/module/animation/decay/runDecay.js.map +1 -1
- package/lib/module/animation/decay/types.js.map +1 -1
- package/lib/module/animation/functions/index.js.map +1 -1
- package/lib/module/animation/functions/interpolate.js.map +1 -1
- package/lib/module/animation/functions/interpolateColors.js.map +1 -1
- package/lib/module/animation/functions/interpolatePaths.js.map +1 -1
- package/lib/module/animation/functions/interpolateVector.js.map +1 -1
- package/lib/module/animation/index.js.map +1 -1
- package/lib/module/animation/spring/Spring.js.map +1 -1
- package/lib/module/animation/spring/functions/index.js.map +1 -1
- package/lib/module/animation/spring/functions/spring.js.map +1 -1
- package/lib/module/animation/spring/index.js.map +1 -1
- package/lib/module/animation/spring/runSpring.js +1 -1
- package/lib/module/animation/spring/runSpring.js.map +1 -1
- package/lib/module/animation/spring/types.js.map +1 -1
- package/lib/module/animation/spring/useSpring.js +1 -1
- package/lib/module/animation/spring/useSpring.js.map +1 -1
- package/lib/module/animation/timing/Easing.js.map +1 -1
- package/lib/module/animation/timing/createTiming.js +2 -6
- package/lib/module/animation/timing/createTiming.js.map +1 -1
- package/lib/module/animation/timing/functions/bezier.js.map +1 -1
- package/lib/module/animation/timing/functions/getResolvedParams.js +6 -10
- package/lib/module/animation/timing/functions/getResolvedParams.js.map +1 -1
- package/lib/module/animation/timing/functions/index.js.map +1 -1
- package/lib/module/animation/timing/functions/timing.js.map +1 -1
- package/lib/module/animation/timing/functions/types.js.map +1 -1
- package/lib/module/animation/timing/index.js.map +1 -1
- package/lib/module/animation/timing/runTiming.js.map +1 -1
- package/lib/module/animation/timing/useLoop.js.map +1 -1
- package/lib/module/animation/timing/useTiming.js +1 -3
- package/lib/module/animation/timing/useTiming.js.map +1 -1
- package/lib/module/animation/types.js.map +1 -1
- package/lib/module/dom/nodes/DrawingNode.js.map +1 -1
- package/lib/module/dom/nodes/GroupNode.js.map +1 -1
- package/lib/module/dom/nodes/JsiSkDOM.js +1 -1
- package/lib/module/dom/nodes/JsiSkDOM.js.map +1 -1
- package/lib/module/dom/nodes/Node.js.map +1 -1
- package/lib/module/dom/nodes/PaintContext.js.map +1 -1
- package/lib/module/dom/nodes/PaintNode.js.map +1 -1
- package/lib/module/dom/nodes/RenderNode.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Circle.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Color.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Enum.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Fitting.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Gradient.js +2 -2
- package/lib/module/dom/nodes/datatypes/Gradient.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Path.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Radius.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Rect.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Transform.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/index.js.map +1 -1
- package/lib/module/dom/nodes/drawings/BackdropFilterNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/Box.js.map +1 -1
- package/lib/module/dom/nodes/drawings/CircleNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/CustomDrawingNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/DiffRectNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/FillNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/ImageNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/ImageSVG.js.map +1 -1
- package/lib/module/dom/nodes/drawings/LineNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/OvalNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/PatchNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/PathNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/PictureNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/PointsNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/RRectNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/RectNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/Text.js.map +1 -1
- package/lib/module/dom/nodes/drawings/VerticesNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/index.js.map +1 -1
- package/lib/module/dom/nodes/index.js.map +1 -1
- package/lib/module/dom/nodes/paint/BlendNode.js.map +1 -1
- package/lib/module/dom/nodes/paint/ColorFilters.js.map +1 -1
- package/lib/module/dom/nodes/paint/ImageFilters.js.map +1 -1
- package/lib/module/dom/nodes/paint/MaskFilters.js.map +1 -1
- package/lib/module/dom/nodes/paint/PathEffects.js.map +1 -1
- package/lib/module/dom/nodes/paint/Shaders.js +2 -4
- package/lib/module/dom/nodes/paint/Shaders.js.map +1 -1
- package/lib/module/dom/nodes/paint/index.js.map +1 -1
- package/lib/module/dom/types/ColorFilters.js.map +1 -1
- package/lib/module/dom/types/Common.js.map +1 -1
- package/lib/module/dom/types/DrawingContext.js.map +1 -1
- package/lib/module/dom/types/Drawings.js.map +1 -1
- package/lib/module/dom/types/ImageFilters.js.map +1 -1
- package/lib/module/dom/types/MaskFilters.js.map +1 -1
- package/lib/module/dom/types/Node.js.map +1 -1
- package/lib/module/dom/types/NodeType.js.map +1 -1
- package/lib/module/dom/types/PathEffects.js.map +1 -1
- package/lib/module/dom/types/Shaders.js.map +1 -1
- package/lib/module/dom/types/SkDOM.js.map +1 -1
- package/lib/module/dom/types/index.js.map +1 -1
- package/lib/module/external/index.js.map +1 -1
- package/lib/module/external/reanimated/index.js.map +1 -1
- package/lib/module/external/reanimated/useSharedValueEffect.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/mock/index.js +6 -10
- package/lib/module/mock/index.js.map +1 -1
- package/lib/module/renderer/Canvas.js.map +1 -1
- package/lib/module/renderer/Container.js.map +1 -1
- package/lib/module/renderer/DependencyManager.js.map +1 -1
- package/lib/module/renderer/DrawingContext.js.map +1 -1
- package/lib/module/renderer/HostComponents.js.map +1 -1
- package/lib/module/renderer/HostConfig.js +0 -2
- package/lib/module/renderer/HostConfig.js.map +1 -1
- package/lib/module/renderer/components/Blend.js.map +1 -1
- package/lib/module/renderer/components/Drawing.js.map +1 -1
- package/lib/module/renderer/components/Group.js.map +1 -1
- package/lib/module/renderer/components/Mask.js.map +1 -1
- package/lib/module/renderer/components/Paint.js +1 -1
- package/lib/module/renderer/components/Paint.js.map +1 -1
- package/lib/module/renderer/components/Picture.js.map +1 -1
- package/lib/module/renderer/components/backdrop/BackdropBlur.js +1 -1
- package/lib/module/renderer/components/backdrop/BackdropBlur.js.map +1 -1
- package/lib/module/renderer/components/backdrop/BackdropFilter.js.map +1 -1
- package/lib/module/renderer/components/backdrop/index.js.map +1 -1
- package/lib/module/renderer/components/colorFilters/BlendColor.js.map +1 -1
- package/lib/module/renderer/components/colorFilters/Lerp.js.map +1 -1
- package/lib/module/renderer/components/colorFilters/LinearToSRGBGamma.js.map +1 -1
- package/lib/module/renderer/components/colorFilters/LumaColorFilter.js.map +1 -1
- package/lib/module/renderer/components/colorFilters/Matrix.js.map +1 -1
- package/lib/module/renderer/components/colorFilters/SRGBToLinearGamma.js.map +1 -1
- package/lib/module/renderer/components/colorFilters/index.js.map +1 -1
- package/lib/module/renderer/components/image/Image.js.map +1 -1
- package/lib/module/renderer/components/image/ImageSVG.js.map +1 -1
- package/lib/module/renderer/components/image/ImageShader.js.map +1 -1
- package/lib/module/renderer/components/image/index.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/Blur.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/DisplacementMap.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/Morphology.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/Offset.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/RuntimeShader.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/Shadow.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/index.js.map +1 -1
- package/lib/module/renderer/components/index.js.map +1 -1
- package/lib/module/renderer/components/maskFilters/Blur.js.map +1 -1
- package/lib/module/renderer/components/maskFilters/index.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/Corner.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/Dash.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/Discrete.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/Line2D.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/Path1D.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/Path2D.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/Sum.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/index.js.map +1 -1
- package/lib/module/renderer/components/shaders/Color.js.map +1 -1
- package/lib/module/renderer/components/shaders/FractalNoise.js.map +1 -1
- package/lib/module/renderer/components/shaders/LinearGradient.js.map +1 -1
- package/lib/module/renderer/components/shaders/RadialGradient.js.map +1 -1
- package/lib/module/renderer/components/shaders/Shader.js.map +1 -1
- package/lib/module/renderer/components/shaders/ShaderLib.js.map +1 -1
- package/lib/module/renderer/components/shaders/SweepGradient.js.map +1 -1
- package/lib/module/renderer/components/shaders/Turbulence.js.map +1 -1
- package/lib/module/renderer/components/shaders/TwoPointConicalGradient.js.map +1 -1
- package/lib/module/renderer/components/shaders/index.js.map +1 -1
- package/lib/module/renderer/components/shapes/Box.js.map +1 -1
- package/lib/module/renderer/components/shapes/Circle.js.map +1 -1
- package/lib/module/renderer/components/shapes/DiffRect.js.map +1 -1
- package/lib/module/renderer/components/shapes/Fill.js.map +1 -1
- package/lib/module/renderer/components/shapes/FitBox.js.map +1 -1
- package/lib/module/renderer/components/shapes/Line.js.map +1 -1
- package/lib/module/renderer/components/shapes/Oval.js.map +1 -1
- package/lib/module/renderer/components/shapes/Patch.js.map +1 -1
- package/lib/module/renderer/components/shapes/Path.js.map +1 -1
- package/lib/module/renderer/components/shapes/Points.js.map +1 -1
- package/lib/module/renderer/components/shapes/Rect.js.map +1 -1
- package/lib/module/renderer/components/shapes/RoundedRect.js.map +1 -1
- package/lib/module/renderer/components/shapes/Vertices.js.map +1 -1
- package/lib/module/renderer/components/shapes/index.js.map +1 -1
- package/lib/module/renderer/components/text/Glyphs.js.map +1 -1
- package/lib/module/renderer/components/text/Text.js.map +1 -1
- package/lib/module/renderer/components/text/TextBlob.js.map +1 -1
- package/lib/module/renderer/components/text/TextPath.js.map +1 -1
- package/lib/module/renderer/components/text/index.js.map +1 -1
- package/lib/module/renderer/index.js.map +1 -1
- package/lib/module/renderer/processors/Animations/Animations.js.map +1 -1
- package/lib/module/renderer/processors/Animations/index.js.map +1 -1
- package/lib/module/renderer/processors/index.js.map +1 -1
- package/lib/module/renderer/processors/math/Coordinates.js.map +1 -1
- package/lib/module/renderer/processors/math/Math.js.map +1 -1
- package/lib/module/renderer/processors/math/Transforms.js.map +1 -1
- package/lib/module/renderer/processors/math/index.js.map +1 -1
- package/lib/module/renderer/typeddash.js.map +1 -1
- package/lib/module/renderer/useCanvas.js.map +1 -1
- package/lib/module/renderer/useContextBridge.js.map +1 -1
- package/lib/module/skia/NativeSetup.js.map +1 -1
- package/lib/module/skia/Skia.js.map +1 -1
- package/lib/module/skia/Skia.web.js.map +1 -1
- package/lib/module/skia/core/Data.js.map +1 -1
- package/lib/module/skia/core/Font.js.map +1 -1
- package/lib/module/skia/core/Image.js.map +1 -1
- package/lib/module/skia/core/Matrix.js.map +1 -1
- package/lib/module/skia/core/Picture.js.map +1 -1
- package/lib/module/skia/core/RRect.js.map +1 -1
- package/lib/module/skia/core/Rect.js.map +1 -1
- package/lib/module/skia/core/SVG.js.map +1 -1
- package/lib/module/skia/core/Typeface.js.map +1 -1
- package/lib/module/skia/core/Vector.js +1 -1
- package/lib/module/skia/core/Vector.js.map +1 -1
- package/lib/module/skia/core/index.js.map +1 -1
- package/lib/module/skia/index.js.map +1 -1
- package/lib/module/skia/types/Canvas.js.map +1 -1
- package/lib/module/skia/types/Color.js.map +1 -1
- package/lib/module/skia/types/ColorFilter/ColorFilter.js.map +1 -1
- package/lib/module/skia/types/ColorFilter/ColorFilterFactory.js.map +1 -1
- package/lib/module/skia/types/ColorFilter/index.js.map +1 -1
- package/lib/module/skia/types/ContourMeasure.js.map +1 -1
- package/lib/module/skia/types/Data/Data.js.map +1 -1
- package/lib/module/skia/types/Data/DataFactory.js.map +1 -1
- package/lib/module/skia/types/Data/index.js.map +1 -1
- package/lib/module/skia/types/Font/Font.js.map +1 -1
- package/lib/module/skia/types/Font/index.js.map +1 -1
- package/lib/module/skia/types/Image/Image.js.map +1 -1
- package/lib/module/skia/types/Image/ImageFactory.js.map +1 -1
- package/lib/module/skia/types/Image/index.js.map +1 -1
- package/lib/module/skia/types/ImageFilter/ImageFilter.js.map +1 -1
- package/lib/module/skia/types/ImageFilter/ImageFilterFactory.js.map +1 -1
- package/lib/module/skia/types/ImageFilter/index.js.map +1 -1
- package/lib/module/skia/types/JsiInstance.js.map +1 -1
- package/lib/module/skia/types/MaskFilter.js.map +1 -1
- package/lib/module/skia/types/Matrix.js.map +1 -1
- package/lib/module/skia/types/Paint/BlendMode.js.map +1 -1
- package/lib/module/skia/types/Paint/Paint.js.map +1 -1
- package/lib/module/skia/types/Paint/index.js.map +1 -1
- package/lib/module/skia/types/Path/Path.js.map +1 -1
- package/lib/module/skia/types/Path/PathFactory.js.map +1 -1
- package/lib/module/skia/types/Path/index.js.map +1 -1
- package/lib/module/skia/types/PathEffect.js.map +1 -1
- package/lib/module/skia/types/Picture/Picture.js.map +1 -1
- package/lib/module/skia/types/Picture/PictureFactory.js.map +1 -1
- package/lib/module/skia/types/Picture/PictureRecorder.js.map +1 -1
- package/lib/module/skia/types/Picture/index.js.map +1 -1
- package/lib/module/skia/types/Point.js.map +1 -1
- package/lib/module/skia/types/RRect.js.map +1 -1
- package/lib/module/skia/types/RSXform.js.map +1 -1
- package/lib/module/skia/types/Rect.js.map +1 -1
- package/lib/module/skia/types/RuntimeEffect/RuntimeEffect.js.map +1 -1
- package/lib/module/skia/types/RuntimeEffect/RuntimeEffectFactory.js.map +1 -1
- package/lib/module/skia/types/RuntimeEffect/index.js.map +1 -1
- package/lib/module/skia/types/SVG/SVG.js.map +1 -1
- package/lib/module/skia/types/SVG/SVGFactory.js.map +1 -1
- package/lib/module/skia/types/SVG/index.js.map +1 -1
- package/lib/module/skia/types/Shader/Shader.js.map +1 -1
- package/lib/module/skia/types/Shader/ShaderFactory.js.map +1 -1
- package/lib/module/skia/types/Shader/index.js.map +1 -1
- package/lib/module/skia/types/Skia.js.map +1 -1
- package/lib/module/skia/types/Surface/Surface.js.map +1 -1
- package/lib/module/skia/types/Surface/SurfaceFactory.js.map +1 -1
- package/lib/module/skia/types/Surface/index.js.map +1 -1
- package/lib/module/skia/types/TextBlob.js.map +1 -1
- package/lib/module/skia/types/Typeface/Typeface.js.map +1 -1
- package/lib/module/skia/types/Typeface/TypefaceFactory.js.map +1 -1
- package/lib/module/skia/types/Typeface/index.js.map +1 -1
- package/lib/module/skia/types/Vertices/Vertices.js.map +1 -1
- package/lib/module/skia/types/Vertices/index.js.map +1 -1
- package/lib/module/skia/types/index.js.map +1 -1
- package/lib/module/skia/web/Host.js +1 -1
- package/lib/module/skia/web/Host.js.map +1 -1
- package/lib/module/skia/web/JsiSkCanvas.js.map +1 -1
- package/lib/module/skia/web/JsiSkColor.js.map +1 -1
- package/lib/module/skia/web/JsiSkColorFilter.js.map +1 -1
- package/lib/module/skia/web/JsiSkColorFilterFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkContourMeasure.js.map +1 -1
- package/lib/module/skia/web/JsiSkContourMeasureIter.js.map +1 -1
- package/lib/module/skia/web/JsiSkData.js.map +1 -1
- package/lib/module/skia/web/JsiSkDataFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkFont.js.map +1 -1
- package/lib/module/skia/web/JsiSkImage.js.map +1 -1
- package/lib/module/skia/web/JsiSkImageFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkImageFilter.js.map +1 -1
- package/lib/module/skia/web/JsiSkImageFilterFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkMaskFilter.js.map +1 -1
- package/lib/module/skia/web/JsiSkMaskFilterFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkMatrix.js +1 -1
- package/lib/module/skia/web/JsiSkMatrix.js.map +1 -1
- package/lib/module/skia/web/JsiSkPaint.js.map +1 -1
- package/lib/module/skia/web/JsiSkPath.js.map +1 -1
- package/lib/module/skia/web/JsiSkPathEffect.js.map +1 -1
- package/lib/module/skia/web/JsiSkPathEffectFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkPathFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkPicture.js.map +1 -1
- package/lib/module/skia/web/JsiSkPictureFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkPictureRecorder.js.map +1 -1
- package/lib/module/skia/web/JsiSkPoint.js.map +1 -1
- package/lib/module/skia/web/JsiSkRRect.js.map +1 -1
- package/lib/module/skia/web/JsiSkRSXform.js.map +1 -1
- package/lib/module/skia/web/JsiSkRect.js.map +1 -1
- package/lib/module/skia/web/JsiSkRuntimeEffect.js.map +1 -1
- package/lib/module/skia/web/JsiSkRuntimeEffectFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkSVGFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkShader.js.map +1 -1
- package/lib/module/skia/web/JsiSkShaderFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkSurface.js.map +1 -1
- package/lib/module/skia/web/JsiSkSurfaceFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkTextBlob.js.map +1 -1
- package/lib/module/skia/web/JsiSkTextBlobFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkTypeface.js.map +1 -1
- package/lib/module/skia/web/JsiSkTypefaceFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkVertices.js.map +1 -1
- package/lib/module/skia/web/JsiSkVerticesFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkia.js.map +1 -1
- package/lib/module/skia/web/index.js.map +1 -1
- package/lib/module/values/api.js.map +1 -1
- package/lib/module/values/api.web.js.map +1 -1
- package/lib/module/values/hooks/index.js.map +1 -1
- package/lib/module/values/hooks/useClockValue.js.map +1 -1
- package/lib/module/values/hooks/useComputedValue.js.map +1 -1
- package/lib/module/values/hooks/useValue.js.map +1 -1
- package/lib/module/values/hooks/useValueEffect.js.map +1 -1
- package/lib/module/values/index.js.map +1 -1
- package/lib/module/values/selector.js.map +1 -1
- package/lib/module/values/types.js.map +1 -1
- package/lib/module/values/web/RNSkAnimation.js +2 -2
- package/lib/module/values/web/RNSkAnimation.js.map +1 -1
- package/lib/module/values/web/RNSkClockValue.js.map +1 -1
- package/lib/module/values/web/RNSkComputedValue.js +1 -1
- package/lib/module/values/web/RNSkComputedValue.js.map +1 -1
- package/lib/module/values/web/RNSkReadonlyValue.js.map +1 -1
- package/lib/module/values/web/RNSkValue.js.map +1 -1
- package/lib/module/values/web/api.js.map +1 -1
- package/lib/module/values/web/index.js.map +1 -1
- package/lib/module/views/SkiaBaseWebView.js +198 -0
- package/lib/module/views/SkiaBaseWebView.js.map +1 -0
- package/lib/module/views/SkiaPictureView.js +94 -0
- package/lib/module/views/SkiaPictureView.js.map +1 -0
- package/lib/module/views/SkiaPictureView.web.js +19 -0
- package/lib/module/views/SkiaPictureView.web.js.map +1 -0
- package/lib/module/views/SkiaView.js +2 -2
- package/lib/module/views/SkiaView.js.map +1 -1
- package/lib/module/views/SkiaView.web.js +15 -201
- package/lib/module/views/SkiaView.web.js.map +1 -1
- package/lib/module/views/api.js.map +1 -1
- package/lib/module/views/index.js +1 -0
- package/lib/module/views/index.js.map +1 -1
- package/lib/module/views/types.js.map +1 -1
- package/lib/module/views/useDrawCallback.js.map +1 -1
- package/lib/module/views/useTouchHandler.js +6 -6
- package/lib/module/views/useTouchHandler.js.map +1 -1
- package/lib/module/web/LoadSkiaWeb.js.map +1 -1
- package/lib/module/web/WithSkiaWeb.js +1 -1
- package/lib/module/web/WithSkiaWeb.js.map +1 -1
- package/lib/module/web/index.js.map +1 -1
- package/lib/typescript/src/animation/decay/runDecay.d.ts +1 -1
- package/lib/typescript/src/animation/spring/runSpring.d.ts +1 -1
- package/lib/typescript/src/animation/spring/useSpring.d.ts +1 -1
- package/lib/typescript/src/animation/timing/createTiming.d.ts +1 -1
- package/lib/typescript/src/animation/timing/functions/getResolvedParams.d.ts +1 -1
- package/lib/typescript/src/animation/timing/runTiming.d.ts +1 -1
- package/lib/typescript/src/animation/timing/useLoop.d.ts +1 -1
- package/lib/typescript/src/animation/timing/useTiming.d.ts +1 -1
- package/lib/typescript/src/mock/index.d.ts +1 -1
- package/lib/typescript/src/renderer/Canvas.d.ts +1 -1
- package/lib/typescript/src/renderer/HostConfig.d.ts +1 -1
- package/lib/typescript/src/renderer/components/Paint.d.ts +1 -1
- package/lib/typescript/src/renderer/components/backdrop/BackdropFilter.d.ts +1 -1
- package/lib/typescript/src/renderer/processors/Animations/Animations.d.ts +4 -4
- package/lib/typescript/src/renderer/typeddash.d.ts +2 -2
- package/lib/typescript/src/skia/core/Font.d.ts +1 -1
- package/lib/typescript/src/skia/core/Vector.d.ts +2 -2
- package/lib/typescript/src/skia/types/Shader/Shader.d.ts +1 -1
- package/lib/typescript/src/skia/web/JsiSkVerticesFactory.d.ts +2 -2
- package/lib/typescript/src/views/SkiaBaseWebView.d.ts +58 -0
- package/lib/typescript/src/views/SkiaPictureView.d.ts +27 -0
- package/lib/typescript/src/views/SkiaPictureView.web.d.ts +7 -0
- package/lib/typescript/src/views/SkiaView.d.ts +4 -4
- package/lib/typescript/src/views/SkiaView.web.d.ts +6 -53
- package/lib/typescript/src/views/index.d.ts +1 -0
- package/lib/typescript/src/views/types.d.ts +7 -2
- package/lib/typescript/src/web/LoadSkiaWeb.d.ts +2 -2
- package/package.json +6 -6
- package/src/renderer/HostConfig.ts +3 -4
- package/src/renderer/components/backdrop/BackdropFilter.tsx +1 -1
- package/src/renderer/processors/Animations/Animations.ts +11 -4
- package/src/renderer/typeddash.ts +3 -2
- package/src/values/web/RNSkComputedValue.ts +6 -1
- package/src/views/SkiaBaseWebView.tsx +177 -0
- package/src/views/SkiaPictureView.tsx +93 -0
- package/src/views/SkiaPictureView.web.tsx +23 -0
- package/src/views/SkiaView.tsx +6 -7
- package/src/views/SkiaView.web.tsx +18 -167
- package/src/views/index.ts +1 -0
- package/src/views/types.ts +9 -2
- package/android/cpp/jni/JniSkiaDrawView.cpp +0 -113
- package/android/cpp/rnskia-android/RNSkDrawViewImpl.cpp +0 -73
- package/android/cpp/rnskia-android/RNSkDrawViewImpl.h +0 -48
- package/cpp/rnskia/RNSkDrawView.cpp +0 -315
- package/cpp/rnskia/RNSkDrawView.h +0 -226
- package/ios/RNSkia-iOS/RNSkDrawViewImpl.h +0 -52
- package/ios/RNSkia-iOS/SkiaDrawView.h +0 -23
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"names":["NodeType","processPath","JsiDrawingNode","TextNode","constructor","ctx","props","Text","deriveProps","draw","canvas","paint","text","x","y","font","drawText","TextPathNode","TextPath","path","Skia","initialOffset","ids","getGlyphIDs","widths","getGlyphWidths","rsx","meas","ContourMeasureIter","cont","next","dist","i","length","width","substring","px","py","tx","ty","getPosTan","adjustedX","adjustedY","push","RSXform","TextBlob","MakeFromRSXform","derived","Error","drawTextBlob","TextBlobNode","blob","GlyphsNode","Glyphs","glyphs","reduce","acc","glyph","id","pos","positions","drawGlyphs"],"sources":["Text.ts"],"sourcesContent":["import type { SkRSXform, SkTextBlob, SkPoint } from \"../../../skia/types\";\nimport type {\n DrawingContext,\n TextBlobProps,\n TextPathProps,\n TextProps,\n} from \"../../types\";\nimport { NodeType } from \"../../types\";\nimport { processPath } from \"../datatypes\";\nimport type { GlyphsProps } from \"../../types/Drawings\";\nimport { JsiDrawingNode } from \"../DrawingNode\";\nimport type { NodeContext } from \"../Node\";\n\nexport class TextNode extends JsiDrawingNode<TextProps, null> {\n constructor(ctx: NodeContext, props: TextProps) {\n super(ctx, NodeType.Text, props);\n }\n\n protected deriveProps() {\n return null;\n }\n\n draw({ canvas, paint }: DrawingContext) {\n const { text, x, y, font } = this.props;\n canvas.drawText(text, x, y, paint, font);\n }\n}\n\nexport class TextPathNode extends JsiDrawingNode<TextPathProps, SkTextBlob> {\n constructor(ctx: NodeContext, props: TextPathProps) {\n super(ctx, NodeType.TextPath, props);\n }\n\n deriveProps() {\n const path = processPath(this.Skia, this.props.path);\n const { font, initialOffset } = this.props;\n let { text } = this.props;\n const ids = font.getGlyphIDs(text);\n const widths = font.getGlyphWidths(ids);\n const rsx: SkRSXform[] = [];\n const meas = this.Skia.ContourMeasureIter(path, false, 1);\n let cont = meas.next();\n let dist = initialOffset;\n for (let i = 0; i < text.length && cont; i++) {\n const width = widths[i];\n dist += width / 2;\n if (dist > cont.length()) {\n // jump to next contour\n cont = meas.next();\n if (!cont) {\n // We have come to the end of the path - terminate the string\n // right here.\n text = text.substring(0, i);\n break;\n }\n dist = width / 2;\n }\n // Gives us the (x, y) coordinates as well as the cos/sin of the tangent\n // line at that position.\n const { px, py, tx, ty } = cont.getPosTan(dist);\n const adjustedX = px - (width / 2) * tx;\n const adjustedY = py - (width / 2) * ty;\n rsx.push(this.Skia.RSXform(tx, ty, adjustedX, adjustedY));\n dist += width / 2;\n }\n return this.Skia.TextBlob.MakeFromRSXform(text, rsx, font);\n }\n\n draw({ canvas, paint }: DrawingContext) {\n if (!this.derived) {\n throw new Error(\"TextPathNode: blob is null\");\n }\n canvas.drawTextBlob(this.derived, 0, 0, paint);\n }\n}\n\nexport class TextBlobNode extends JsiDrawingNode<TextBlobProps, null> {\n constructor(ctx: NodeContext, props: TextBlobProps) {\n super(ctx, NodeType.TextBlob, props);\n }\n\n protected deriveProps() {\n return null;\n }\n\n draw({ canvas, paint }: DrawingContext) {\n const { blob, x, y } = this.props;\n canvas.drawTextBlob(blob, x, y, paint);\n }\n}\n\ninterface ProcessedGlyphs {\n glyphs: number[];\n positions: SkPoint[];\n}\n\nexport class GlyphsNode extends JsiDrawingNode<GlyphsProps, ProcessedGlyphs> {\n constructor(ctx: NodeContext, props: GlyphsProps) {\n super(ctx, NodeType.Glyphs, props);\n }\n\n deriveProps() {\n return this.props.glyphs.reduce<ProcessedGlyphs>(\n (acc, glyph) => {\n const { id, pos } = glyph;\n acc.glyphs.push(id);\n acc.positions.push(pos);\n return acc;\n },\n { glyphs: [], positions: [] }\n );\n }\n\n draw({ canvas, paint }: DrawingContext) {\n if (!this.derived) {\n throw new Error(\"GlyphsNode: processedGlyphs is null\");\n }\n const { glyphs, positions } = this.derived;\n const { x, y, font } = this.props;\n canvas.drawGlyphs(glyphs, positions, x, y, font, paint);\n }\n}\n"],"mappings":"AAOA,SAASA,QAAT,QAAyB,aAAzB;AACA,SAASC,WAAT,QAA4B,cAA5B;AAEA,SAASC,cAAT,QAA+B,gBAA/B;AAGA,OAAO,MAAMC,QAAN,SAAuBD,cAAvB,CAAuD;EAC5DE,WAAW,CAACC,GAAD,EAAmBC,KAAnB,EAAqC;IAC9C,MAAMD,GAAN,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KAAKT,KAA5B;IACAI,MAAM,CAACmD,UAAP,CAAkBP,MAAlB,EAA0BM,SAA1B,EAAqC/C,CAArC,EAAwCC,CAAxC,EAA2CC,IAA3C,EAAiDJ,KAAjD;EACD;;AAxB0E"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"names":["VertexMode","BlendMode","NodeType","enumKey","processColor","JsiDrawingNode","VerticesNode","constructor","ctx","props","Vertices","deriveProps","mode","vertices","textures","colors","indices","vertexMode","Triangles","Skia","MakeVertices","map","c","undefined","draw","canvas","paint","blendMode","defaultBlendMode","DstOver","SrcOver","blend","derived","Error","drawVertices"],"sources":["VerticesNode.ts"],"sourcesContent":["import type { SkVertices } from \"../../../skia/types\";\nimport { VertexMode, BlendMode } from \"../../../skia/types\";\nimport type { DrawingContext, VerticesProps } from \"../../types\";\nimport { NodeType } from \"../../types\";\nimport { enumKey, processColor } from \"../datatypes\";\nimport { JsiDrawingNode } from \"../DrawingNode\";\nimport type { NodeContext } from \"../Node\";\n\nexport class VerticesNode extends JsiDrawingNode<VerticesProps, SkVertices> {\n constructor(ctx: NodeContext, props: VerticesProps) {\n super(ctx, NodeType.Vertices, props);\n }\n\n protected deriveProps() {\n const { mode, vertices, textures, colors, indices } = this.props;\n const vertexMode = mode ? VertexMode[enumKey(mode)] : VertexMode.Triangles;\n return this.Skia.MakeVertices(\n vertexMode,\n vertices,\n textures,\n colors ? colors.map((c) => processColor(this.Skia, c, 1)) : undefined,\n indices\n );\n }\n\n draw({ canvas, paint }: DrawingContext) {\n const { colors, blendMode } = this.props;\n const defaultBlendMode = colors ? BlendMode.DstOver : BlendMode.SrcOver;\n const blend = blendMode ? BlendMode[enumKey(blendMode)] : defaultBlendMode;\n if (this.derived === undefined) {\n throw new Error(\"VerticesNode: vertices is undefined\");\n }\n canvas.drawVertices(this.derived, blend, paint);\n }\n}\n"],"mappings":"AACA,SAASA,UAAT,EAAqBC,SAArB,QAAsC,qBAAtC;AAEA,SAASC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AAyCL,KAAzC;EACD;;AAzByE"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./CircleNode\";\nexport * from \"./FillNode\";\nexport * from \"./ImageNode\";\nexport * from \"./PointsNode\";\nexport * from \"./PathNode\";\nexport * from \"./RectNode\";\nexport * from \"./RRectNode\";\nexport * from \"./OvalNode\";\nexport * from \"./LineNode\";\nexport * from \"./PatchNode\";\nexport * from \"./VerticesNode\";\nexport * from \"./CustomDrawingNode\";\nexport * from \"./Text\";\nexport * from \"./PictureNode\";\nexport * from \"./DiffRectNode\";\nexport * from \"./ImageSVG\";\nexport * from \"./BackdropFilterNode\";\nexport * from \"./Box\";\n"],"mappings":"AAAA,cAAc,cAAd;AACA,cAAc,YAAd;AACA,cAAc,aAAd;AACA,cAAc,cAAd;AACA,cAAc,YAAd;AACA,cAAc,YAAd;AACA,cAAc,aAAd;AACA,cAAc,YAAd;AACA,cAAc,YAAd;AACA,cAAc,aAAd;AACA,cAAc,gBAAd;AACA,cAAc,qBAAd;AACA,cAAc,QAAd;AACA,cAAc,eAAd;AACA,cAAc,gBAAd;AACA,cAAc,YAAd;AACA,cAAc,sBAAd;AACA,cAAc,OAAd"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"../types\";\nexport * from \"./JsiSkDOM\";\nexport * from \"./datatypes\";\n"],"mappings":"AAAA,cAAc,UAAd;AACA,cAAc,YAAd;AACA,cAAc,aAAd"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"names":["BlendMode","DeclarationType","NodeType","JsiDeclarationNode","enumKey","ImageFilterDeclaration","ShaderDeclaration","BlendNode","constructor","ctx","props","ImageFilter","Blend","checkChild","child","_children","length","declarationType","Shader","addChild","Error","type","insertChildBefore","before","materialize","Skia","blend","mode","reverse","reduce","inner","outer","MakeBlend"],"sources":["BlendNode.ts"],"sourcesContent":["import type { BlendProps } from \"../../types/ImageFilters\";\nimport type { SkShader, SkImageFilter } from \"../../../skia/types\";\nimport { BlendMode } from \"../../../skia/types\";\nimport { DeclarationType, NodeType } from \"../../types/NodeType\";\nimport type { NodeContext } from \"../Node\";\nimport { JsiDeclarationNode } from \"../Node\";\nimport type { Node } from \"../../types\";\nimport { enumKey } from \"../datatypes\";\n\nimport { ImageFilterDeclaration } from \"./ImageFilters\";\nimport { ShaderDeclaration } from \"./Shaders\";\n\nexport class BlendNode extends JsiDeclarationNode<\n BlendProps,\n SkShader | SkImageFilter\n> {\n constructor(ctx: NodeContext, props: BlendProps) {\n super(ctx, DeclarationType.ImageFilter, NodeType.Blend, props);\n }\n\n private checkChild(\n child: ImageFilterDeclaration<unknown> | ShaderDeclaration<unknown>\n ) {\n if (this._children.length > 0) {\n if (child.declarationType === DeclarationType.ImageFilter) {\n this.declarationType = DeclarationType.ImageFilter;\n } else {\n this.declarationType = DeclarationType.Shader;\n }\n }\n }\n\n addChild(child: Node<unknown>) {\n if (\n !(child instanceof JsiDeclarationNode) ||\n (child.declarationType !== DeclarationType.Shader &&\n child.declarationType !== DeclarationType.ImageFilter)\n ) {\n throw new Error(`Cannot add child of type ${child.type} to ${this.type}`);\n }\n this.checkChild(child);\n super.addChild(child);\n }\n\n insertChildBefore(child: Node<unknown>, before: Node<unknown>): void {\n if (\n !(child instanceof ImageFilterDeclaration) ||\n !(child instanceof ShaderDeclaration)\n ) {\n throw new Error(`Cannot add child of type ${child.type} to ${this.type}`);\n }\n this.checkChild(child);\n super.insertChildBefore(child, before);\n }\n\n materialize() {\n const { Skia } = this;\n const blend = BlendMode[enumKey(this.props.mode)];\n if (this.declarationType === DeclarationType.ImageFilter) {\n return (this._children as ImageFilterDeclaration<unknown>[])\n .reverse()\n .reduce<SkImageFilter | null>((inner, outer) => {\n if (inner === null) {\n return outer.materialize();\n }\n return Skia.ImageFilter.MakeBlend(blend, outer.materialize(), inner);\n }, null) as SkImageFilter;\n } else {\n return (this._children as ShaderDeclaration<unknown>[])\n .reverse()\n .reduce<SkShader | null>((inner, outer) => {\n if (inner === null) {\n return outer.materialize();\n }\n return Skia.Shader.MakeBlend(blend, outer.materialize(), inner);\n }, null) as SkShader;\n }\n }\n}\n"],"mappings":"AAEA,SAASA,SAAT,QAA0B,qBAA1B;AACA,SAASC,eAAT,EAA0BC,QAA1B,QAA0C,sBAA1C;AAEA,SAASC,kBAAT,QAAmC,SAAnC;AAEA,SAASC,OAAT,QAAwB,cAAxB;AAEA,SAASC,sBAAT,QAAuC,gBAAvC;AACA,SAASC,iBAAT,QAAkC,WAAlC;AAEA,OAAO,MAAMC,SAAN,SAAwBJ,kBAAxB,CAGL;EACAK,WAAW,CAACC,GAAD,EAAmBC,KAAnB,EAAsC;IAC/C,MAAMD,GAAN,EAAWR,eAAe,CAACU,WAA3B,EAAwCT,QAAQ,CAACU,KAAjD,EAAwDF,KAAxD;EACD;;EAEOG,UAAU,CAChBC,KADgB,EAEhB;IACA,IAAI,KAAKC,SAAL,CAAeC,MAAf,GAAwB,CAA5B,EAA+B;MAC7B,IAAIF,KAAK,CAACG,eAAN,KAA0BhB,eAAe,CAACU,WAA9C,EAA2D;QACzD,KAAKM,eAAL,GAAuBhB,eAAe,CAACU,WAAvC;MACD,CAFD,MAEO;QACL,KAAKM,eAAL,GAAuBhB,eAAe,CAACiB,MAAvC;MACD;IACF;EACF;;EAEDC,QAAQ,CAACL,KAAD,EAAuB;IAC7B,IACE,EAAEA,KAAK,YAAYX,kBAAnB,KACCW,KAAK,CAACG,eAAN,KAA0BhB,eAAe,CAACiB,MAA1C,IACCJ,KAAK,CAACG,eAAN,KAA0BhB,eAAe,CAACU,WAH9C,EAIE;MACA,MAAM,IAAIS,KAAJ,CAAW,4BAA2BN,KAAK,CAACO,IAAK,OAAM,KAAKA,IAAK,EAAjE,CAAN;IACD;;IACD,KAAKR,UAAL,CAAgBC,KAAhB;IACA,MAAMK,QAA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 -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"names":["BlendMode","JsiDeclarationNode","DeclarationType","NodeType","processColor","enumKey","ColorFilterDeclaration","constructor","ctx","type","props","ColorFilter","addChild","child","Error","insertChildBefore","before","compose","filter","children","_children","length","Skia","MakeCompose","reduce","acc","materialize","MatrixColorFilterNode","MatrixColorFilter","matrix","cf","MakeMatrix","BlendColorFilterNode","BlendColorFilter","mode","color","MakeBlend","LinearToSRGBGammaColorFilterNode","LinearToSRGBGammaColorFilter","MakeLinearToSRGBGamma","SRGBToLinearGammaColorFilterNode","SRGBToLinearGammaColorFilter","MakeSRGBToLinearGamma","LumaColorFilterNode","LumaColorFilter","MakeLumaColorFilter","LerpColorFilterNode","LerpColorFilter","t","first","second","MakeLerp"],"sources":["ColorFilters.ts"],"sourcesContent":["import { BlendMode } from \"../../../skia/types\";\nimport type { SkColorFilter } from \"../../../skia/types\";\nimport type { NodeContext } from \"../Node\";\nimport { JsiDeclarationNode } from \"../Node\";\nimport type {\n BlendColorFilterProps,\n MatrixColorFilterProps,\n Node,\n} from \"../../types\";\nimport { DeclarationType, NodeType } from \"../../types\";\nimport { processColor } from \"../datatypes\";\nimport { enumKey } from \"../datatypes/Enum\";\nimport type { LerpColorFilterProps } from \"../../types/ColorFilters\";\n\nexport abstract class ColorFilterDeclaration<\n P,\n Nullable extends null | never = never\n> extends JsiDeclarationNode<P, SkColorFilter, Nullable> {\n constructor(ctx: NodeContext, type: NodeType, props: P) {\n super(ctx, DeclarationType.ColorFilter, type, props);\n }\n\n addChild(child: Node<unknown>) {\n if (!(child instanceof ColorFilterDeclaration)) {\n throw new Error(`Cannot add child of type ${child.type} to ${this.type}`);\n }\n super.addChild(child);\n }\n\n insertChildBefore(child: Node<unknown>, before: Node<unknown>): void {\n if (!(child instanceof ColorFilterDeclaration)) {\n throw new Error(`Cannot add child of type ${child.type} to ${this.type}`);\n }\n super.insertChildBefore(child, before);\n }\n\n compose(filter: SkColorFilter) {\n const children = this._children as ColorFilterDeclaration<unknown>[];\n if (this._children.length === 0) {\n return filter;\n } else {\n return this.Skia.ColorFilter.MakeCompose(\n filter,\n children.reduce<SkColorFilter | null>((acc, child) => {\n if (acc === null) {\n return child.materialize();\n }\n return this.Skia.ColorFilter.MakeCompose(acc, child.materialize());\n }, null) as SkColorFilter\n );\n }\n }\n}\n\nexport class MatrixColorFilterNode extends ColorFilterDeclaration<MatrixColorFilterProps> {\n constructor(ctx: NodeContext, props: MatrixColorFilterProps) {\n super(ctx, NodeType.MatrixColorFilter, props);\n }\n\n materialize() {\n const { matrix } = this.props;\n const cf = this.Skia.ColorFilter.MakeMatrix(matrix);\n return this.compose(cf);\n }\n}\n\nexport class BlendColorFilterNode extends ColorFilterDeclaration<BlendColorFilterProps> {\n constructor(ctx: NodeContext, props: BlendColorFilterProps) {\n super(ctx, NodeType.BlendColorFilter, props);\n }\n\n materialize() {\n const { mode } = this.props;\n const color = processColor(this.Skia, this.props.color, 1);\n const cf = this.Skia.ColorFilter.MakeBlend(color, BlendMode[enumKey(mode)]);\n return this.compose(cf);\n }\n}\n\nexport class LinearToSRGBGammaColorFilterNode extends ColorFilterDeclaration<null> {\n constructor(ctx: NodeContext) {\n super(ctx, NodeType.LinearToSRGBGammaColorFilter, null);\n }\n\n materialize() {\n const cf = this.Skia.ColorFilter.MakeLinearToSRGBGamma();\n return this.compose(cf);\n }\n}\n\nexport class SRGBToLinearGammaColorFilterNode extends ColorFilterDeclaration<null> {\n constructor(ctx: NodeContext) {\n super(ctx, NodeType.SRGBToLinearGammaColorFilter, null);\n }\n\n materialize() {\n const cf = this.Skia.ColorFilter.MakeSRGBToLinearGamma();\n return this.compose(cf);\n }\n}\n\nexport class LumaColorFilterNode extends ColorFilterDeclaration<null> {\n constructor(ctx: NodeContext) {\n super(ctx, NodeType.LumaColorFilter, null);\n }\n\n materialize() {\n const cf = this.Skia.ColorFilter.MakeLumaColorFilter();\n return this.compose(cf);\n }\n}\n\nexport class LerpColorFilterNode extends ColorFilterDeclaration<LerpColorFilterProps> {\n constructor(ctx: NodeContext, props: LerpColorFilterProps) {\n super(ctx, NodeType.LerpColorFilter, props);\n }\n\n materialize() {\n const { t } = this.props;\n const [first, second] = this.children() as JsiDeclarationNode<\n unknown,\n SkColorFilter\n >[];\n return this.Skia.ColorFilter.MakeLerp(\n t,\n first.materialize(),\n second.materialize()\n );\n }\n}\n"],"mappings":"AAAA,SAASA,SAAT,QAA0B,qBAA1B;AAGA,SAASC,kBAAT,QAAmC,SAAnC;AAMA,SAASC,eAAT,EAA0BC,QAA1B,QAA0C,aAA1C;AACA,SAASC,YAAT,QAA6B,cAA7B;AACA,SAASC,OAAT,QAAwB,mBAAxB;AAGA,OAAO,MAAeC,sBAAf,SAGGL,kBAHH,CAGkD;EACvDM,WAAW,CAACC,GAAD,EAAmBC,IAAnB,EAAmCC,KAAnC,EAA6C;IACtD,MAAMF,GAAN,EAAWN,eAAe,CAACS,WAA3B,EAAwCF,IAAxC,EAA8CC,KAA9C;EACD;;EAEDE,QAAQ,CAACC,KAAD,EAAuB;IAC7B,IAAI,EAAEA,KAAK,YAAYP,sBAAnB,CAAJ,EAAgD;MAC9C,MAAM,IAAIQ,KAAJ,CAAW,4BAA2BD,KAAK,CAACJ,IAAK,OAAM,KAAKA,IAAK,EAAjE,CAAN;IACD;;IACD,MAAMG,QAAN,CAAeC,KAAf;EACD;;EAEDE,iBAAiB,CAACF,KAAD,EAAuBG,MAAvB,EAAoD;IACnE,IAAI,EAAEH,KAAK,YAAYP,sBAAnB,CAAJ,EAAgD;MAC9C,MAAM,IAAIQ,KAAJ,CAAW,4BAA2BD,KAAK,CAACJ,IAAK,OAAM,KAAKA,IAAK,EAAjE,CAAN;IACD;;IACD,MAAMM,iBAAN,CAAwBF,KAAxB,EAA+BG,MAA/B;EACD;;EAEDC,OAAO,CAACC,MAAD,EAAwB;IAC7B,MAAMC,QAAQ,GAAG,KAAKC,SAAtB;;IACA,IAAI,KAAKA,SAAL,CAAeC,MA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;EACD;;EAEDgB,WAAW,GAAG;IACZ,MAAM;MAAEsB;IAAF,IAAQ,KAAKtC,KAAnB;IACA,MAAM,CAACuC,KAAD,EAAQC,MAAR,IAAkB,KAAK/B,QAAL,EAAxB;IAIA,OAAO,KAAKG,IAAL,CAAUX,WAAV,CAAsBwC,QAAtB,CACLH,CADK,EAELC,KAAK,CAACvB,WAAN,EAFK,EAGLwB,MAAM,CAACxB,WAAP,EAHK,CAAP;EAKD;;AAhBmF"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["ImageFilters.ts"],"names":["BlendMode","ColorChannel","processUniforms","TileMode","DeclarationType","NodeType","processRadius","enumKey","processColor","JsiDeclarationNode","Black","Float32Array","of","MakeInnerShadow","Skia","shadowOnly","dx","dy","sigmaX","sigmaY","color","input","sourceGraphic","ImageFilter","MakeColorFilter","ColorFilter","MakeBlend","Dst","sourceAlpha","SrcIn","f1","SrcOut","f2","MakeOffset","f3","MakeBlur","Decal","f4","MakeCompose","SrcOver","ImageFilterDeclaration","constructor","ctx","type","props","getOptionalChildInstance","index","child","_children","getMandatoryChildInstance","isImageFilter","materialize","isShader","MakeShader","declarationType","Error","OffsetImageFilterNode","OffsetImageFilter","x","y","DisplacementMapImageFilterNode","DisplacementMapImageFilter","channelX","channelY","scale","MakeDisplacementMap","BlurImageFilterNode","BlurImageFilter","mode","blur","sigma","DropShadowImageFilterNode","cl","inner","factory","bind","MakeDropShadowOnly","MakeDropShadow","MorphologyOperator","MorphologyImageFilterNode","MorphologyImageFilter","operator","r","radius","Erode","MakeErode","MakeDilate","BlendImageFilterNode","BlendImageFilter","a","b","RuntimeShaderImageFilterNode","RuntimeShaderImageFilter","source","uniforms","rtb","RuntimeShaderBuilder","MakeRuntimeShader"],"mappings":"AACA,SACEA,SADF,EAEEC,YAFF,EAGEC,eAHF,EAIEC,QAJF,QAKO,qBALP;AAeA,SAASC,eAAT,EAA0BC,QAA1B,QAA0C,aAA1C;AACA,SAASC,aAAT,EAAwBC,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CAAUS,WAAV,CAAsB0E,iBAAtB,CAAwCF,GAAxC,EAA6C,IAA7C,EAAmD1E,KAAnD,CAAP;AACD;;AAbqG","sourcesContent":["import type { SkImageFilter, SkColor, Skia } from \"../../../skia/types\";\nimport {\n BlendMode,\n ColorChannel,\n processUniforms,\n TileMode,\n} from \"../../../skia/types\";\nimport type {\n BlendImageFilterProps,\n BlurImageFilterProps,\n DisplacementMapImageFilterProps,\n DropShadowImageFilterProps,\n MorphologyImageFilterProps,\n OffsetImageFilterProps,\n RuntimeShaderImageFilterProps,\n} from \"../../types\";\nimport { DeclarationType, NodeType } from \"../../types\";\nimport { processRadius, enumKey, processColor } from \"../datatypes\";\nimport type { NodeContext } from \"../Node\";\nimport { JsiDeclarationNode } from \"../Node\";\n\nconst Black = Float32Array.of(0, 0, 0, 1);\n\nconst MakeInnerShadow = (\n Skia: Skia,\n shadowOnly: boolean | undefined,\n dx: number,\n dy: number,\n sigmaX: number,\n sigmaY: number,\n color: SkColor,\n input: SkImageFilter | null\n) => {\n const sourceGraphic = Skia.ImageFilter.MakeColorFilter(\n Skia.ColorFilter.MakeBlend(Black, BlendMode.Dst),\n null\n );\n const sourceAlpha = Skia.ImageFilter.MakeColorFilter(\n Skia.ColorFilter.MakeBlend(Black, BlendMode.SrcIn),\n null\n );\n const f1 = Skia.ImageFilter.MakeColorFilter(\n Skia.ColorFilter.MakeBlend(color, BlendMode.SrcOut),\n null\n );\n const f2 = Skia.ImageFilter.MakeOffset(dx, dy, f1);\n const f3 = Skia.ImageFilter.MakeBlur(sigmaX, sigmaY, TileMode.Decal, f2);\n const f4 = Skia.ImageFilter.MakeBlend(BlendMode.SrcIn, sourceAlpha, f3);\n if (shadowOnly) {\n return f4;\n }\n return Skia.ImageFilter.MakeCompose(\n input,\n Skia.ImageFilter.MakeBlend(BlendMode.SrcOver, sourceGraphic, f4)\n );\n};\n\nexport abstract class ImageFilterDeclaration<\n P,\n Nullable extends null | never = never\n> extends JsiDeclarationNode<P, SkImageFilter, Nullable> {\n constructor(ctx: NodeContext, type: NodeType, props: P) {\n super(ctx, DeclarationType.ImageFilter, type, props);\n }\n\n getOptionalChildInstance(index: number) {\n const child = this._children[index];\n if (!child) {\n return null;\n }\n return this.getMandatoryChildInstance(index);\n }\n\n getMandatoryChildInstance(index: number) {\n const child = this._children[index];\n if (child instanceof JsiDeclarationNode) {\n if (child.isImageFilter()) {\n return child.materialize();\n } else if (child.isShader()) {\n return this.Skia.ImageFilter.MakeShader(child.materialize(), null);\n } else if (child.declarationType === DeclarationType.ColorFilter) {\n return this.Skia.ImageFilter.MakeColorFilter(child.materialize(), null);\n } else {\n throw new Error(`Found invalid child ${child.type} in ${this.type}`);\n }\n } else {\n throw new Error(`Found invalid child ${child.type} in ${this.type}`);\n }\n }\n}\n\nexport class OffsetImageFilterNode extends ImageFilterDeclaration<OffsetImageFilterProps> {\n constructor(ctx: NodeContext, props: OffsetImageFilterProps) {\n super(ctx, NodeType.OffsetImageFilter, props);\n }\n\n materialize() {\n const { x, y } = this.props;\n return this.Skia.ImageFilter.MakeOffset(\n x,\n y,\n this.getOptionalChildInstance(0)\n );\n }\n}\n\nexport class DisplacementMapImageFilterNode extends ImageFilterDeclaration<DisplacementMapImageFilterProps> {\n constructor(ctx: NodeContext, props: DisplacementMapImageFilterProps) {\n super(ctx, NodeType.DisplacementMapImageFilter, props);\n }\n\n materialize() {\n const { channelX, channelY, scale } = this.props;\n return this.Skia.ImageFilter.MakeDisplacementMap(\n ColorChannel[enumKey(channelX)],\n ColorChannel[enumKey(channelY)],\n scale,\n this.getMandatoryChildInstance(0),\n this.getOptionalChildInstance(1)\n );\n }\n}\n\nexport class BlurImageFilterNode extends ImageFilterDeclaration<BlurImageFilterProps> {\n constructor(ctx: NodeContext, props: BlurImageFilterProps) {\n super(ctx, NodeType.BlurImageFilter, props);\n }\n\n materialize() {\n const { mode, blur } = this.props;\n const sigma = processRadius(this.Skia, blur);\n return this.Skia.ImageFilter.MakeBlur(\n sigma.x,\n sigma.y,\n TileMode[enumKey(mode)],\n this.getOptionalChildInstance(0)\n );\n }\n}\n\nexport class DropShadowImageFilterNode extends ImageFilterDeclaration<DropShadowImageFilterProps> {\n constructor(ctx: NodeContext, props: DropShadowImageFilterProps) {\n super(ctx, NodeType.BlurImageFilter, props);\n }\n\n materialize() {\n const { dx, dy, blur, shadowOnly, color: cl, inner } = this.props;\n const color = processColor(this.Skia, cl, 1);\n const input = this.getOptionalChildInstance(0);\n let factory;\n if (inner) {\n factory = MakeInnerShadow.bind(null, this.Skia, shadowOnly);\n } else {\n factory = shadowOnly\n ? this.Skia.ImageFilter.MakeDropShadowOnly.bind(this.Skia.ImageFilter)\n : this.Skia.ImageFilter.MakeDropShadow.bind(this.Skia.ImageFilter);\n }\n return factory(dx, dy, blur, blur, color, input);\n }\n}\n\nexport enum MorphologyOperator {\n Erode,\n Dilate,\n}\n\nexport class MorphologyImageFilterNode extends ImageFilterDeclaration<MorphologyImageFilterProps> {\n constructor(ctx: NodeContext, props: MorphologyImageFilterProps) {\n super(ctx, NodeType.MorphologyImageFilter, props);\n }\n\n materialize() {\n const { operator } = this.props;\n const r = processRadius(this.Skia, this.props.radius);\n const input = this.getOptionalChildInstance(0);\n if (MorphologyOperator[enumKey(operator)] === MorphologyOperator.Erode) {\n return this.Skia.ImageFilter.MakeErode(r.x, r.y, input);\n }\n return this.Skia.ImageFilter.MakeDilate(r.x, r.y, input);\n }\n}\n\nexport class BlendImageFilterNode extends ImageFilterDeclaration<BlendImageFilterProps> {\n constructor(ctx: NodeContext, props: BlendImageFilterProps) {\n super(ctx, NodeType.BlendImageFilter, props);\n }\n\n materialize() {\n const { mode } = this.props;\n const a = this.getMandatoryChildInstance(0);\n const b = this.getMandatoryChildInstance(1);\n return this.Skia.ImageFilter.MakeBlend(mode, a, b);\n }\n}\n\nexport class RuntimeShaderImageFilterNode extends ImageFilterDeclaration<RuntimeShaderImageFilterProps> {\n constructor(ctx: NodeContext, props: RuntimeShaderImageFilterProps) {\n super(ctx, NodeType.RuntimeShaderImageFilter, props);\n }\n\n materialize() {\n const { source, uniforms } = this.props;\n const rtb = this.Skia.RuntimeShaderBuilder(source);\n if (uniforms) {\n processUniforms(source, uniforms, rtb);\n }\n const input = this.getOptionalChildInstance(0);\n return this.Skia.ImageFilter.MakeRuntimeShader(rtb, null, input);\n }\n}\n"]}
|
1
|
+
{"version":3,"names":["BlendMode","ColorChannel","processUniforms","TileMode","DeclarationType","NodeType","processRadius","enumKey","processColor","JsiDeclarationNode","Black","Float32Array","of","MakeInnerShadow","Skia","shadowOnly","dx","dy","sigmaX","sigmaY","color","input","sourceGraphic","ImageFilter","MakeColorFilter","ColorFilter","MakeBlend","Dst","sourceAlpha","SrcIn","f1","SrcOut","f2","MakeOffset","f3","MakeBlur","Decal","f4","MakeCompose","SrcOver","ImageFilterDeclaration","constructor","ctx","type","props","getOptionalChildInstance","index","child","_children","getMandatoryChildInstance","isImageFilter","materialize","isShader","MakeShader","declarationType","Error","OffsetImageFilterNode","OffsetImageFilter","x","y","DisplacementMapImageFilterNode","DisplacementMapImageFilter","channelX","channelY","scale","MakeDisplacementMap","BlurImageFilterNode","BlurImageFilter","mode","blur","sigma","DropShadowImageFilterNode","cl","inner","factory","bind","MakeDropShadowOnly","MakeDropShadow","MorphologyOperator","MorphologyImageFilterNode","MorphologyImageFilter","operator","r","radius","Erode","MakeErode","MakeDilate","BlendImageFilterNode","BlendImageFilter","a","b","RuntimeShaderImageFilterNode","RuntimeShaderImageFilter","source","uniforms","rtb","RuntimeShaderBuilder","MakeRuntimeShader"],"sources":["ImageFilters.ts"],"sourcesContent":["import type { SkImageFilter, SkColor, Skia } from \"../../../skia/types\";\nimport {\n BlendMode,\n ColorChannel,\n processUniforms,\n TileMode,\n} from \"../../../skia/types\";\nimport type {\n BlendImageFilterProps,\n BlurImageFilterProps,\n DisplacementMapImageFilterProps,\n DropShadowImageFilterProps,\n MorphologyImageFilterProps,\n OffsetImageFilterProps,\n RuntimeShaderImageFilterProps,\n} from \"../../types\";\nimport { DeclarationType, NodeType } from \"../../types\";\nimport { processRadius, enumKey, processColor } from \"../datatypes\";\nimport type { NodeContext } from \"../Node\";\nimport { JsiDeclarationNode } from \"../Node\";\n\nconst Black = Float32Array.of(0, 0, 0, 1);\n\nconst MakeInnerShadow = (\n Skia: Skia,\n shadowOnly: boolean | undefined,\n dx: number,\n dy: number,\n sigmaX: number,\n sigmaY: number,\n color: SkColor,\n input: SkImageFilter | null\n) => {\n const sourceGraphic = Skia.ImageFilter.MakeColorFilter(\n Skia.ColorFilter.MakeBlend(Black, BlendMode.Dst),\n null\n );\n const sourceAlpha = Skia.ImageFilter.MakeColorFilter(\n Skia.ColorFilter.MakeBlend(Black, BlendMode.SrcIn),\n null\n );\n const f1 = Skia.ImageFilter.MakeColorFilter(\n Skia.ColorFilter.MakeBlend(color, BlendMode.SrcOut),\n null\n );\n const f2 = Skia.ImageFilter.MakeOffset(dx, dy, f1);\n const f3 = Skia.ImageFilter.MakeBlur(sigmaX, sigmaY, TileMode.Decal, f2);\n const f4 = Skia.ImageFilter.MakeBlend(BlendMode.SrcIn, sourceAlpha, f3);\n if (shadowOnly) {\n return f4;\n }\n return Skia.ImageFilter.MakeCompose(\n input,\n Skia.ImageFilter.MakeBlend(BlendMode.SrcOver, sourceGraphic, f4)\n );\n};\n\nexport abstract class ImageFilterDeclaration<\n P,\n Nullable extends null | never = never\n> extends JsiDeclarationNode<P, SkImageFilter, Nullable> {\n constructor(ctx: NodeContext, type: NodeType, props: P) {\n super(ctx, DeclarationType.ImageFilter, type, props);\n }\n\n getOptionalChildInstance(index: number) {\n const child = this._children[index];\n if (!child) {\n return null;\n }\n return this.getMandatoryChildInstance(index);\n }\n\n getMandatoryChildInstance(index: number) {\n const child = this._children[index];\n if (child instanceof JsiDeclarationNode) {\n if (child.isImageFilter()) {\n return child.materialize();\n } else if (child.isShader()) {\n return this.Skia.ImageFilter.MakeShader(child.materialize(), null);\n } else if (child.declarationType === DeclarationType.ColorFilter) {\n return this.Skia.ImageFilter.MakeColorFilter(child.materialize(), null);\n } else {\n throw new Error(`Found invalid child ${child.type} in ${this.type}`);\n }\n } else {\n throw new Error(`Found invalid child ${child.type} in ${this.type}`);\n }\n }\n}\n\nexport class OffsetImageFilterNode extends ImageFilterDeclaration<OffsetImageFilterProps> {\n constructor(ctx: NodeContext, props: OffsetImageFilterProps) {\n super(ctx, NodeType.OffsetImageFilter, props);\n }\n\n materialize() {\n const { x, y } = this.props;\n return this.Skia.ImageFilter.MakeOffset(\n x,\n y,\n this.getOptionalChildInstance(0)\n );\n }\n}\n\nexport class DisplacementMapImageFilterNode extends ImageFilterDeclaration<DisplacementMapImageFilterProps> {\n constructor(ctx: NodeContext, props: DisplacementMapImageFilterProps) {\n super(ctx, NodeType.DisplacementMapImageFilter, props);\n }\n\n materialize() {\n const { channelX, channelY, scale } = this.props;\n return this.Skia.ImageFilter.MakeDisplacementMap(\n ColorChannel[enumKey(channelX)],\n ColorChannel[enumKey(channelY)],\n scale,\n this.getMandatoryChildInstance(0),\n this.getOptionalChildInstance(1)\n );\n }\n}\n\nexport class BlurImageFilterNode extends ImageFilterDeclaration<BlurImageFilterProps> {\n constructor(ctx: NodeContext, props: BlurImageFilterProps) {\n super(ctx, NodeType.BlurImageFilter, props);\n }\n\n materialize() {\n const { mode, blur } = this.props;\n const sigma = processRadius(this.Skia, blur);\n return this.Skia.ImageFilter.MakeBlur(\n sigma.x,\n sigma.y,\n TileMode[enumKey(mode)],\n this.getOptionalChildInstance(0)\n );\n }\n}\n\nexport class DropShadowImageFilterNode extends ImageFilterDeclaration<DropShadowImageFilterProps> {\n constructor(ctx: NodeContext, props: DropShadowImageFilterProps) {\n super(ctx, NodeType.BlurImageFilter, props);\n }\n\n materialize() {\n const { dx, dy, blur, shadowOnly, color: cl, inner } = this.props;\n const color = processColor(this.Skia, cl, 1);\n const input = this.getOptionalChildInstance(0);\n let factory;\n if (inner) {\n factory = MakeInnerShadow.bind(null, this.Skia, shadowOnly);\n } else {\n factory = shadowOnly\n ? this.Skia.ImageFilter.MakeDropShadowOnly.bind(this.Skia.ImageFilter)\n : this.Skia.ImageFilter.MakeDropShadow.bind(this.Skia.ImageFilter);\n }\n return factory(dx, dy, blur, blur, color, input);\n }\n}\n\nexport enum MorphologyOperator {\n Erode,\n Dilate,\n}\n\nexport class MorphologyImageFilterNode extends ImageFilterDeclaration<MorphologyImageFilterProps> {\n constructor(ctx: NodeContext, props: MorphologyImageFilterProps) {\n super(ctx, NodeType.MorphologyImageFilter, props);\n }\n\n materialize() {\n const { operator } = this.props;\n const r = processRadius(this.Skia, this.props.radius);\n const input = this.getOptionalChildInstance(0);\n if (MorphologyOperator[enumKey(operator)] === MorphologyOperator.Erode) {\n return this.Skia.ImageFilter.MakeErode(r.x, r.y, input);\n }\n return this.Skia.ImageFilter.MakeDilate(r.x, r.y, input);\n }\n}\n\nexport class BlendImageFilterNode extends ImageFilterDeclaration<BlendImageFilterProps> {\n constructor(ctx: NodeContext, props: BlendImageFilterProps) {\n super(ctx, NodeType.BlendImageFilter, props);\n }\n\n materialize() {\n const { mode } = this.props;\n const a = this.getMandatoryChildInstance(0);\n const b = this.getMandatoryChildInstance(1);\n return this.Skia.ImageFilter.MakeBlend(mode, a, b);\n }\n}\n\nexport class RuntimeShaderImageFilterNode extends ImageFilterDeclaration<RuntimeShaderImageFilterProps> {\n constructor(ctx: NodeContext, props: RuntimeShaderImageFilterProps) {\n super(ctx, NodeType.RuntimeShaderImageFilter, props);\n }\n\n materialize() {\n const { source, uniforms } = this.props;\n const rtb = this.Skia.RuntimeShaderBuilder(source);\n if (uniforms) {\n processUniforms(source, uniforms, rtb);\n }\n const input = this.getOptionalChildInstance(0);\n return this.Skia.ImageFilter.MakeRuntimeShader(rtb, null, input);\n }\n}\n"],"mappings":"AACA,SACEA,SADF,EAEEC,YAFF,EAGEC,eAHF,EAIEC,QAJF,QAKO,qBALP;AAeA,SAASC,eAAT,EAA0BC,QAA1B,QAA0C,aAA1C;AACA,SAASC,aAAT,E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,CAAiF;EACtFC,WAAW,CAACC,GAAD,EAAmBE,KAAnB,EAAiD;IAC1D,MAAMF,GAAN,EAAWrC,QAAQ,CAACmF,gBAApB,EAAsC5C,KAAtC;EACD;;EAEDO,WAAW,GAAG;IACZ,MAAM;MAAEiB;IAAF,IAAW,KAAKxB,KAAtB;IACA,MAAM6C,CAAC,GAAG,KAAKxC,yBAAL,CAA+B,CAA/B,CAAV;IACA,MAAMyC,CAAC,GAAG,KAAKzC,yBAAL,CAA+B,CAA/B,CAAV;IACA,OAAO,KAAKnC,IAAL,CAAUS,WAAV,CAAsBG,SAAtB,CAAgC0C,IAAhC,EAAsCqB,CAAtC,EAAyCC,CAAzC,CAAP;EACD;;AAVqF;AAaxF,OAAO,MAAMC,4BAAN,SAA2CnD,sBAA3C,CAAiG;EACtGC,WAAW,CAACC,GAAD,EAAmBE,KAAnB,EAAyD;IAClE,MAAMF,GAAN,EAAWrC,QAAQ,CAACuF,wBAApB,EAA8ChD,KAA9C;EACD;;EAEDO,WAAW,GAAG;IACZ,MAAM;MAAE0C,MAAF;MAAUC;IAAV,IAAuB,KAAKlD,KAAlC;IACA,MAAMmD,GAAG,GAAG,KAAKjF,IAAL,CAAUkF,oBAAV,CAA+BH,MAA/B,CAAZ;;IACA,IAAIC,QAAJ,EAAc;MACZ5F,eAAe,CAAC2F,MAAD,EAASC,QAAT,EAAmBC,GAAnB,CAAf;IACD;;IACD,MAAM1E,KAAK,GAAG,KAAKwB,wBAAL,CAA8B,CAA9B,CAAd;IACA,OAAO,KAAK/B,IAAL,CAAUS,WAAV,CAAsB0E,iBAAtB,CAAwCF,GAAxC,EAA6C,IAA7C,EAAmD1E,KAAnD,CAAP;EACD;;AAbqG"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"names":["BlurStyle","JsiDeclarationNode","DeclarationType","NodeType","enumKey","BlurMaskFilterNode","constructor","ctx","props","MaskFilter","BlurMaskFilter","materialize","style","blur","respectCTM","Skia","MakeBlur"],"sources":["MaskFilters.ts"],"sourcesContent":["import type { SkMaskFilter } from \"../../../skia/types\";\nimport { BlurStyle } from \"../../../skia/types\";\nimport type { NodeContext } from \"../Node\";\nimport { JsiDeclarationNode } from \"../Node\";\nimport type { BlurMaskFilterProps } from \"../../types\";\nimport { DeclarationType, NodeType } from \"../../types\";\nimport { enumKey } from \"../datatypes\";\n\nexport class BlurMaskFilterNode extends JsiDeclarationNode<\n BlurMaskFilterProps,\n SkMaskFilter\n> {\n constructor(ctx: NodeContext, props: BlurMaskFilterProps) {\n super(ctx, DeclarationType.MaskFilter, NodeType.BlurMaskFilter, props);\n }\n\n materialize() {\n const { style, blur, respectCTM } = this.props;\n return this.Skia.MaskFilter.MakeBlur(\n BlurStyle[enumKey(style)],\n blur,\n respectCTM\n );\n }\n}\n"],"mappings":"AACA,SAASA,SAAT,QAA0B,qBAA1B;AAEA,SAASC,kBAAT,QAAmC,SAAnC;AAEA,SAASC,eAAT,EAA0BC,QAA1B,QAA0C,aAA1C;AACA,SAASC,OAAT,QAAwB,cAAxB;AAEA,OAAO,MAAMC,kBAAN,SAAiCJ,kBAAjC,CAGL;EACAK,WAAW,CAACC,GAAD,EAAmBC,KAAnB,EAA+C;IACxD,MAAMD,GAAN,EAAWL,eAAe,CAACO,UAA3B,EAAuCN,QAAQ,CAACO,cAAhD,EAAgEF,KAAhE;EACD;;EAEDG,WAAW,GAAG;IACZ,MAAM;MAAEC,KAAF;MAASC,IAAT;MAAeC;IAAf,IAA8B,KAAKN,KAAzC;IACA,OAAO,KAAKO,IAAL,CAAUN,UAAV,CAAqBO,QAArB,CACLhB,SAAS,CAACI,OAAO,CAACQ,KAAD,CAAR,CADJ,EAELC,IAFK,EAGLC,UAHK,CAAP;EAKD;;AAZD"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["PathEffects.ts"],"names":["Path1DEffectStyle","JsiDeclarationNode","DeclarationType","NodeType","enumKey","processPath","PathEffectDeclaration","constructor","ctx","type","props","PathEffect","addChild","child","Error","insertChildBefore","before","compose","pe","children","_children","length","Skia","MakeCompose","reduce","acc","materialize","getOptionalChildInstance","index","getMandatoryChildInstance","isPathEffect","DiscretePathEffectNode","DiscretePathEffect","deviation","seed","MakeDiscrete","Path2DPathEffectNode","Path2DPathEffect","matrix","path","MakePath2D","DashPathEffectNode","DashPathEffect","intervals","phase","MakeDash","CornerPathEffectNode","CornerPathEffect","r","MakeCorner","SumPathEffectNode","SumPathEffect","MakeSum","Line2DPathEffectNode","Line2DPathEffect","width","MakeLine2D","Path1DPathEffectNode","Path1DPathEffect","advance","style","MakePath1D"],"mappings":"AAAA,SAASA,iBAAT,QAAkC,qBAAlC;AAGA,SAASC,kBAAT,QAAmC,SAAnC;AAUA,SAASC,eAAT,EAA0BC,QAA1B,QAA0C,aAA1C;AACA,SAASC,OAAT,QAAwB,mBAAxB;AACA,SAASC,WAAT,QAA4B,cAA5B;;AAEA,MAAeC,qBAAf,SAGUL,kBAHV,CAGwD;AACtDM,EAAAA,WAAW,CAACC,GAAD,EAAmBC,IAAnB,EAAmCC,KAAnC,EAA6C;AACtD,UAAMF,GAAN,EAAWN,eAAe,CAACS,UAA3B,EAAuCF,IAAvC,EAA6CC,KAA7C;AACD;;AAEDE,EAAAA,QAAQ,CAACC,KAAD,EAAuB;AAC7B,QAAI,EAAEA,KAAK,YAAYP,qBAAnB,CAAJ,EAA+C;AAC7C,YAAM,IAAIQ,KAAJ,CAAW,4BAA2BD,KAAK,CAACJ,IAAK,OAAM,KAAKA,IAAK,EAAjE,CAAN;AACD;;AACD,UAAMG,QAAN,CAAeC,KAAf;AACD;;AAEDE,EAAAA,iBAAiB,CAACF,KAAD,EAAuBG,MAAvB,EAAoD;AACnE,QAAI,EAAEH,KAAK,YAAYP,qBAAnB,CAAJ,EAA+C;AAC7C,YAAM,IAAIQ,KAAJ,CAAW,4BAA2BD,KAAK,CAACJ,IAAK,OAAM,KAAKA,IAAK,EAAjE,CAAN;AACD;;AACD,UAAMM,iBA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C1D,UAAMF,GAAN,EAAWL,QAAQ,CAACmD,gBAApB,EAAsC5C,KAAtC;AACD;;AAEDgB,EAAAA,WAAW,GAAG;AACZ,UAAM;AAAE6B,MAAAA,KAAF;AAASjB,MAAAA;AAAT,QAAoB,KAAK5B,KAA/B;AACA,UAAMQ,EAAE,GAAG,KAAKI,IAAL,CAAUX,UAAV,CAAqB6C,UAArB,CAAgCD,KAAhC,EAAuCjB,MAAvC,CAAX;;AACA,QAAIpB,EAAE,KAAK,IAAX,EAAiB;AACf,aAAO,IAAP;AACD;;AACD,WAAO,KAAKD,OAAL,CAAaC,EAAb,CAAP;AACD;;AAZD;AAeF,OAAO,MAAMuC,oBAAN,SAAmCnD,qBAAnC,CAGL;AACAC,EAAAA,WAAW,CAACC,GAAD,EAAmBE,KAAnB,EAAiD;AAC1D,UAAMF,GAAN,EAAWL,QAAQ,CAACuD,gBAApB,EAAsChD,KAAtC;AACD;;AAEDgB,EAAAA,WAAW,GAAG;AACZ,UAAM;AAAEiC,MAAAA,OAAF;AAAWf,MAAAA,KAAX;AAAkBgB,MAAAA;AAAlB,QAA4B,KAAKlD,KAAvC;AACA,UAAM6B,IAAI,GAAGlC,WAAW,CAAC,KAAKiB,IAAN,EAAY,KAAKZ,KAAL,CAAW6B,IAAvB,CAAxB;AACA,UAAMrB,EAAE,GAAG,KAAKI,IAAL,CAAUX,UAAV,CAAqBkD,UAArB,CACTtB,IADS,EAEToB,OAFS,EAGTf,KAHS,EAIT5C,iBAAiB,CAACI,OAAO,CAACwD,KAAD,CAAR,CAJR,CAAX;;AAMA,QAAI1C,EAAE,KAAK,IAAX,EAAiB;AACf,aAAO,IAAP;AACD;;AACD,WAAO,KAAKD,OAAL,CAAaC,EAAb,CAAP;AACD;;AAlBD","sourcesContent":["import { Path1DEffectStyle } from \"../../../skia/types\";\nimport type { SkPathEffect } from \"../../../skia/types\";\nimport type { NodeContext } from \"../Node\";\nimport { JsiDeclarationNode } from \"../Node\";\nimport type {\n CornerPathEffectProps,\n DashPathEffectProps,\n DiscretePathEffectProps,\n Line2DPathEffectProps,\n Node,\n Path1DPathEffectProps,\n Path2DPathEffectProps,\n} from \"../../types\";\nimport { DeclarationType, NodeType } from \"../../types\";\nimport { enumKey } from \"../datatypes/Enum\";\nimport { processPath } from \"../datatypes\";\n\nabstract class PathEffectDeclaration<\n P,\n Nullable extends null | never = never\n> extends JsiDeclarationNode<P, SkPathEffect, Nullable> {\n constructor(ctx: NodeContext, type: NodeType, props: P) {\n super(ctx, DeclarationType.PathEffect, type, props);\n }\n\n addChild(child: Node<unknown>) {\n if (!(child instanceof PathEffectDeclaration)) {\n throw new Error(`Cannot add child of type ${child.type} to ${this.type}`);\n }\n super.addChild(child);\n }\n\n insertChildBefore(child: Node<unknown>, before: Node<unknown>): void {\n if (!(child instanceof PathEffectDeclaration)) {\n throw new Error(`Cannot add child of type ${child.type} to ${this.type}`);\n }\n super.insertChildBefore(child, before);\n }\n\n compose(pe: SkPathEffect) {\n const children = this._children as PathEffectDeclaration<unknown>[];\n if (this._children.length === 0) {\n return pe;\n } else {\n return this.Skia.PathEffect.MakeCompose(\n pe,\n children.reduce<SkPathEffect | null>((acc, child) => {\n if (acc === null) {\n return child.materialize();\n }\n return this.Skia.PathEffect.MakeCompose(acc, child.materialize());\n }, null) as SkPathEffect\n );\n }\n }\n getOptionalChildInstance(index: number) {\n const child = this._children[index];\n if (!child) {\n return null;\n }\n return this.getMandatoryChildInstance(index);\n }\n\n getMandatoryChildInstance(index: number) {\n const child = this._children[index];\n if (child instanceof JsiDeclarationNode) {\n if (child.isPathEffect()) {\n return child.materialize();\n } else {\n throw new Error(`Found invalid child ${child.type} in ${this.type}`);\n }\n } else {\n throw new Error(`Found invalid child ${child.type} in ${this.type}`);\n }\n }\n}\n\nexport class DiscretePathEffectNode extends PathEffectDeclaration<DiscretePathEffectProps> {\n constructor(ctx: NodeContext, props: DiscretePathEffectProps) {\n super(ctx, NodeType.DiscretePathEffect, props);\n }\n\n materialize() {\n const { length, deviation, seed } = this.props;\n const pe = this.Skia.PathEffect.MakeDiscrete(length, deviation, seed);\n return this.compose(pe);\n }\n}\n\nexport class Path2DPathEffectNode extends PathEffectDeclaration<\n Path2DPathEffectProps,\n null\n> {\n constructor(ctx: NodeContext, props: Path2DPathEffectProps) {\n super(ctx, NodeType.Path2DPathEffect, props);\n }\n\n materialize() {\n const { matrix } = this.props;\n const path = processPath(this.Skia, this.props.path);\n const pe = this.Skia.PathEffect.MakePath2D(matrix, path);\n if (pe === null) {\n return null;\n }\n return this.compose(pe);\n }\n}\n\nexport class DashPathEffectNode extends PathEffectDeclaration<DashPathEffectProps> {\n constructor(ctx: NodeContext, props: DashPathEffectProps) {\n super(ctx, NodeType.DashPathEffect, props);\n }\n\n materialize() {\n const { intervals, phase } = this.props;\n const pe = this.Skia.PathEffect.MakeDash(intervals, phase);\n return this.compose(pe);\n }\n}\n\nexport class CornerPathEffectNode extends PathEffectDeclaration<\n CornerPathEffectProps,\n null\n> {\n constructor(ctx: NodeContext, props: CornerPathEffectProps) {\n super(ctx, NodeType.CornerPathEffect, props);\n }\n\n materialize() {\n const { r } = this.props;\n const pe = this.Skia.PathEffect.MakeCorner(r);\n if (pe === null) {\n return null;\n }\n return this.compose(pe);\n }\n}\n\nexport class SumPathEffectNode extends PathEffectDeclaration<null> {\n constructor(ctx: NodeContext) {\n super(ctx, NodeType.SumPathEffect, null);\n }\n\n materialize() {\n return this.Skia.PathEffect.MakeSum(\n this.getMandatoryChildInstance(0),\n this.getMandatoryChildInstance(1)\n );\n }\n}\n\nexport class Line2DPathEffectNode extends PathEffectDeclaration<\n Line2DPathEffectProps,\n null\n> {\n constructor(ctx: NodeContext, props: Line2DPathEffectProps) {\n super(ctx, NodeType.Line2DPathEffect, props);\n }\n\n materialize() {\n const { width, matrix } = this.props;\n const pe = this.Skia.PathEffect.MakeLine2D(width, matrix);\n if (pe === null) {\n return null;\n }\n return this.compose(pe);\n }\n}\n\nexport class Path1DPathEffectNode extends PathEffectDeclaration<\n Path1DPathEffectProps,\n null\n> {\n constructor(ctx: NodeContext, props: Path1DPathEffectProps) {\n super(ctx, NodeType.Path1DPathEffect, props);\n }\n\n materialize() {\n const { advance, phase, style } = this.props;\n const path = processPath(this.Skia, this.props.path);\n const pe = this.Skia.PathEffect.MakePath1D(\n path,\n advance,\n phase,\n Path1DEffectStyle[enumKey(style)]\n );\n if (pe === null) {\n return null;\n }\n return this.compose(pe);\n }\n}\n"]}
|
1
|
+
{"version":3,"names":["Path1DEffectStyle","JsiDeclarationNode","DeclarationType","NodeType","enumKey","processPath","PathEffectDeclaration","constructor","ctx","type","props","PathEffect","addChild","child","Error","insertChildBefore","before","compose","pe","children","_children","length","Skia","MakeCompose","reduce","acc","materialize","getOptionalChildInstance","index","getMandatoryChildInstance","isPathEffect","DiscretePathEffectNode","DiscretePathEffect","deviation","seed","MakeDiscrete","Path2DPathEffectNode","Path2DPathEffect","matrix","path","MakePath2D","DashPathEffectNode","DashPathEffect","intervals","phase","MakeDash","CornerPathEffectNode","CornerPathEffect","r","MakeCorner","SumPathEffectNode","SumPathEffect","MakeSum","Line2DPathEffectNode","Line2DPathEffect","width","MakeLine2D","Path1DPathEffectNode","Path1DPathEffect","advance","style","MakePath1D"],"sources":["PathEffects.ts"],"sourcesContent":["import { Path1DEffectStyle } from \"../../../skia/types\";\nimport type { SkPathEffect } from \"../../../skia/types\";\nimport type { NodeContext } from \"../Node\";\nimport { JsiDeclarationNode } from \"../Node\";\nimport type {\n CornerPathEffectProps,\n DashPathEffectProps,\n DiscretePathEffectProps,\n Line2DPathEffectProps,\n Node,\n Path1DPathEffectProps,\n Path2DPathEffectProps,\n} from \"../../types\";\nimport { DeclarationType, NodeType } from \"../../types\";\nimport { enumKey } from \"../datatypes/Enum\";\nimport { processPath } from \"../datatypes\";\n\nabstract class PathEffectDeclaration<\n P,\n Nullable extends null | never = never\n> extends JsiDeclarationNode<P, SkPathEffect, Nullable> {\n constructor(ctx: NodeContext, type: NodeType, props: P) {\n super(ctx, DeclarationType.PathEffect, type, props);\n }\n\n addChild(child: Node<unknown>) {\n if (!(child instanceof PathEffectDeclaration)) {\n throw new Error(`Cannot add child of type ${child.type} to ${this.type}`);\n }\n super.addChild(child);\n }\n\n insertChildBefore(child: Node<unknown>, before: Node<unknown>): void {\n if (!(child instanceof PathEffectDeclaration)) {\n throw new Error(`Cannot add child of type ${child.type} to ${this.type}`);\n }\n super.insertChildBefore(child, before);\n }\n\n compose(pe: SkPathEffect) {\n const children = this._children as PathEffectDeclaration<unknown>[];\n if (this._children.length === 0) {\n return pe;\n } else {\n return this.Skia.PathEffect.MakeCompose(\n pe,\n children.reduce<SkPathEffect | null>((acc, child) => {\n if (acc === null) {\n return child.materialize();\n }\n return this.Skia.PathEffect.MakeCompose(acc, child.materialize());\n }, null) as SkPathEffect\n );\n }\n }\n getOptionalChildInstance(index: number) {\n const child = this._children[index];\n if (!child) {\n return null;\n }\n return this.getMandatoryChildInstance(index);\n }\n\n getMandatoryChildInstance(index: number) {\n const child = this._children[index];\n if (child instanceof JsiDeclarationNode) {\n if (child.isPathEffect()) {\n return child.materialize();\n } else {\n throw new Error(`Found invalid child ${child.type} in ${this.type}`);\n }\n } else {\n throw new Error(`Found invalid child ${child.type} in ${this.type}`);\n }\n }\n}\n\nexport class DiscretePathEffectNode extends PathEffectDeclaration<DiscretePathEffectProps> {\n constructor(ctx: NodeContext, props: DiscretePathEffectProps) {\n super(ctx, NodeType.DiscretePathEffect, props);\n }\n\n materialize() {\n const { length, deviation, seed } = this.props;\n const pe = this.Skia.PathEffect.MakeDiscrete(length, deviation, seed);\n return this.compose(pe);\n }\n}\n\nexport class Path2DPathEffectNode extends PathEffectDeclaration<\n Path2DPathEffectProps,\n null\n> {\n constructor(ctx: NodeContext, props: Path2DPathEffectProps) {\n super(ctx, NodeType.Path2DPathEffect, props);\n }\n\n materialize() {\n const { matrix } = this.props;\n const path = processPath(this.Skia, this.props.path);\n const pe = this.Skia.PathEffect.MakePath2D(matrix, path);\n if (pe === null) {\n return null;\n }\n return this.compose(pe);\n }\n}\n\nexport class DashPathEffectNode extends PathEffectDeclaration<DashPathEffectProps> {\n constructor(ctx: NodeContext, props: DashPathEffectProps) {\n super(ctx, NodeType.DashPathEffect, props);\n }\n\n materialize() {\n const { intervals, phase } = this.props;\n const pe = this.Skia.PathEffect.MakeDash(intervals, phase);\n return this.compose(pe);\n }\n}\n\nexport class CornerPathEffectNode extends PathEffectDeclaration<\n CornerPathEffectProps,\n null\n> {\n constructor(ctx: NodeContext, props: CornerPathEffectProps) {\n super(ctx, NodeType.CornerPathEffect, props);\n }\n\n materialize() {\n const { r } = this.props;\n const pe = this.Skia.PathEffect.MakeCorner(r);\n if (pe === null) {\n return null;\n }\n return this.compose(pe);\n }\n}\n\nexport class SumPathEffectNode extends PathEffectDeclaration<null> {\n constructor(ctx: NodeContext) {\n super(ctx, NodeType.SumPathEffect, null);\n }\n\n materialize() {\n return this.Skia.PathEffect.MakeSum(\n this.getMandatoryChildInstance(0),\n this.getMandatoryChildInstance(1)\n );\n }\n}\n\nexport class Line2DPathEffectNode extends PathEffectDeclaration<\n Line2DPathEffectProps,\n null\n> {\n constructor(ctx: NodeContext, props: Line2DPathEffectProps) {\n super(ctx, NodeType.Line2DPathEffect, props);\n }\n\n materialize() {\n const { width, matrix } = this.props;\n const pe = this.Skia.PathEffect.MakeLine2D(width, matrix);\n if (pe === null) {\n return null;\n }\n return this.compose(pe);\n }\n}\n\nexport class Path1DPathEffectNode extends PathEffectDeclaration<\n Path1DPathEffectProps,\n null\n> {\n constructor(ctx: NodeContext, props: Path1DPathEffectProps) {\n super(ctx, NodeType.Path1DPathEffect, props);\n }\n\n materialize() {\n const { advance, phase, style } = this.props;\n const path = processPath(this.Skia, this.props.path);\n const pe = this.Skia.PathEffect.MakePath1D(\n path,\n advance,\n phase,\n Path1DEffectStyle[enumKey(style)]\n );\n if (pe === null) {\n return null;\n }\n return this.compose(pe);\n }\n}\n"],"mappings":"AAAA,SAASA,iBAAT,QAAk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C,OAAF;MAAWf,KAAX;MAAkBgB;IAAlB,IAA4B,KAAKlD,KAAvC;IACA,MAAM6B,IAAI,GAAGlC,WAAW,CAAC,KAAKiB,IAAN,EAAY,KAAKZ,KAAL,CAAW6B,IAAvB,CAAxB;IACA,MAAMrB,EAAE,GAAG,KAAKI,IAAL,CAAUX,UAAV,CAAqBkD,UAArB,CACTtB,IADS,EAEToB,OAFS,EAGTf,KAHS,EAIT5C,iBAAiB,CAACI,OAAO,CAACwD,KAAD,CAAR,CAJR,CAAX;;IAMA,IAAI1C,EAAE,KAAK,IAAX,EAAiB;MACf,OAAO,IAAP;IACD;;IACD,OAAO,KAAKD,OAAL,CAAaC,EAAb,CAAP;EACD;;AAlBD"}
|
@@ -44,8 +44,6 @@ export class ImageShaderNode extends ShaderDeclaration {
|
|
44
44
|
const rct = getRect(this.Skia, imageShaderProps);
|
45
45
|
|
46
46
|
if (rct) {
|
47
|
-
var _imageShaderProps$tra;
|
48
|
-
|
49
47
|
const rects = fitRects(fit, {
|
50
48
|
x: 0,
|
51
49
|
y: 0,
|
@@ -53,7 +51,7 @@ export class ImageShaderNode extends ShaderDeclaration {
|
|
53
51
|
height: image.height()
|
54
52
|
}, rct);
|
55
53
|
const m3 = rect2rect(rects.src, rects.dst);
|
56
|
-
imageShaderProps.transform = [...(
|
54
|
+
imageShaderProps.transform = [...(imageShaderProps.transform ?? []), ...m3];
|
57
55
|
}
|
58
56
|
|
59
57
|
const lm = this.Skia.Matrix();
|
@@ -128,7 +126,7 @@ export class LinearGradientNode extends ShaderDeclaration {
|
|
128
126
|
localMatrix,
|
129
127
|
flags
|
130
128
|
} = processGradientProps(this.Skia, this.props);
|
131
|
-
return this.Skia.Shader.MakeLinearGradient(start, end, colors, positions
|
129
|
+
return this.Skia.Shader.MakeLinearGradient(start, end, colors, positions ?? null, mode, localMatrix, flags);
|
132
130
|
}
|
133
131
|
|
134
132
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["Shaders.ts"],"names":["processUniforms","FilterMode","MipmapMode","TileMode","JsiDeclarationNode","DeclarationType","NodeType","processColor","enumKey","fitRects","getRect","processGradientProps","processTransformProps","rect2rect","ShaderDeclaration","constructor","ctx","type","props","Shader","ShaderNode","materialize","source","uniforms","transform","m3","Skia","Matrix","makeShaderWithChildren","children","filter","child","isShader","map","ImageShaderNode","ImageShader","fit","image","tx","ty","fm","mm","imageShaderProps","rct","rects","x","y","width","height","src","dst","lm","makeShaderOptions","ColorNode","ColorShader","color","MakeColor","TurbulenceNode","Turbulence","freqX","freqY","octaves","seed","tileWidth","tileHeight","MakeTurbulence","FractalNoiseNode","FractalNoise","MakeFractalNoise","LinearGradientNode","LinearGradient","start","end","colors","positions","mode","localMatrix","flags","MakeLinearGradient","RadialGradientNode","RadialGradient","c","r","MakeRadialGradient","SweepGradientNode","SweepGradient","MakeSweepGradient","TwoPointConicalGradientNode","TwoPointConicalGradient","startR","endR","MakeTwoPointConicalGradient"],"mappings":"AAAA,SACEA,eADF,EAEEC,UAFF,EAGEC,UAHF,EAIEC,QAJF,QAKO,qBALP;AAQA,SAASC,kBAAT,QAAmC,SAAnC;AAYA,SAASC,eAAT,EAA0BC,QAA1B,QAA0C,aAA1C;AACA,SAASC,YAAT,QAA6B,oBAA7B;AACA,SACEC,OADF,EAEEC,QAFF,EAGEC,OAHF,EAIEC,oBAJF,EAKEC,qBALF,EAMEC,SANF,QAOO,cAPP;AASA,OAAO,MAAeC,iBAAf,SAA4CV,kBAA5C,CAGL;AACAW,EAAAA,WAAW,CAACC,GAAD,EAAmBC,IAAnB,EAAmCC,KAAnC,EAA6C;AACtD,UAAMF,GAAN,EAAWX,eAAe,CAACc,MAA3B,EAAmCF,IAAnC,EAAyCC,KAAzC;AACD;;AAHD;AAMF,OAAO,MAAME,UAAN,SAAyBN,iBAAzB,CAAwD;AAC7DC,EAAAA,WAAW,CAACC,GAAD,EAAmBE,KAAnB,EAAuC;AAChD,UAAMF,GAAN,EAAWV,QAAQ,CAACa,MAAp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AAZ,QAAoB,KAAKtD,KAA/B;AACA,UAAM;AAAEuD,MAAAA,MAAF;AAAUC,MAAAA,SAAV;AAAqBC,MAAAA,IAArB;AAA2BC,MAAAA,WAA3B;AAAwCC,MAAAA;AAAxC,QACJlE,oBAAoB,CAAC,KAAKe,IAAN,EAAY,KAAKR,KAAjB,CADtB;AAEA,WAAO,KAAKQ,IAAL,CAAUP,MAAV,CAAiBmE,iBAAjB,CACLL,CAAC,CAACpC,CADG,EAELoC,CAAC,CAACnC,CAFG,EAGL2B,MAHK,EAILC,SAJK,EAKLC,IALK,EAMLC,WANK,EAOLC,KAPK,EAQLN,KARK,EASLC,GATK,CAAP;AAWD;;AApB0E;AAuB7E,OAAO,MAAMe,2BAAN,SAA0CzE,iBAA1C,CAA0F;AAC/FC,EAAAA,WAAW,CAACC,GAAD,EAAmBE,KAAnB,EAAwD;AACjE,UAAMF,GAAN,EAAWV,QAAQ,CAACkF,uBAApB,EAA6CtE,KAA7C;AACD;;AAEDG,EAAAA,WAAW,GAAG;AACZ,UAAM;AAAEoE,MAAAA,MAAF;AAAUC,MAAAA,IAAV;AAAgBnB,MAAAA,KAAhB;AAAuBC,MAAAA;AAAvB,QAA+B,KAAKtD,KAA1C;AACA,UAAM;AAAEuD,MAAAA,MAAF;AAAUC,MAAAA,SAAV;AAAqBC,MAAAA,IAArB;AAA2BC,MAAAA,WAA3B;AAAwCC,MAAAA;AAAxC,QACJlE,oBAAoB,CAAC,KAAKe,IAAN,EAAY,KAAKR,KAAjB,CADtB;AAEA,WAAO,KAAKQ,IAAL,CAAUP,MAAV,CAAiBwE,2BAAjB,CACLpB,KADK,EAELkB,MAFK,EAGLjB,GAHK,EAILkB,IAJK,EAKLjB,MALK,EAMLC,SANK,EAOLC,IAPK,EAQLC,WARK,EASLC,KATK,CAAP;AAWD;;AApB8F","sourcesContent":["import {\n processUniforms,\n FilterMode,\n MipmapMode,\n TileMode,\n} from \"../../../skia/types\";\nimport type { SkShader } from \"../../../skia/types\";\nimport type { NodeContext } from \"../Node\";\nimport { JsiDeclarationNode } from \"../Node\";\nimport type {\n ColorProps,\n FractalNoiseProps,\n ImageShaderProps,\n LinearGradientProps,\n RadialGradientProps,\n ShaderProps,\n SweepGradientProps,\n TurbulenceProps,\n TwoPointConicalGradientProps,\n} from \"../../types\";\nimport { DeclarationType, NodeType } from \"../../types\";\nimport { processColor } from \"../datatypes/Color\";\nimport {\n enumKey,\n fitRects,\n getRect,\n processGradientProps,\n processTransformProps,\n rect2rect,\n} from \"../datatypes\";\n\nexport abstract class ShaderDeclaration<P> extends JsiDeclarationNode<\n P,\n SkShader\n> {\n constructor(ctx: NodeContext, type: NodeType, props: P) {\n super(ctx, DeclarationType.Shader, type, props);\n }\n}\n\nexport class ShaderNode extends ShaderDeclaration<ShaderProps> {\n constructor(ctx: NodeContext, props: ShaderProps) {\n super(ctx, NodeType.Shader, props);\n }\n\n materialize() {\n const { source, uniforms, ...transform } = this.props;\n const m3 = this.Skia.Matrix();\n processTransformProps(m3, transform);\n return source.makeShaderWithChildren(\n processUniforms(source, uniforms),\n this.children()\n .filter(\n (child): child is JsiDeclarationNode<unknown, SkShader> =>\n child instanceof JsiDeclarationNode && child.isShader()\n )\n .map((child) => child.materialize()),\n m3\n );\n }\n}\n\nexport class ImageShaderNode extends ShaderDeclaration<ImageShaderProps> {\n constructor(ctx: NodeContext, props: ImageShaderProps) {\n super(ctx, NodeType.ImageShader, props);\n }\n\n materialize() {\n const { fit, image, tx, ty, fm, mm, ...imageShaderProps } = this.props;\n const rct = getRect(this.Skia, imageShaderProps);\n if (rct) {\n const rects = fitRects(\n fit,\n { x: 0, y: 0, width: image.width(), height: image.height() },\n rct\n );\n const m3 = rect2rect(rects.src, rects.dst);\n imageShaderProps.transform = [\n ...(imageShaderProps.transform ?? []),\n ...m3,\n ];\n }\n const lm = this.Skia.Matrix();\n processTransformProps(lm, imageShaderProps);\n return image.makeShaderOptions(\n TileMode[enumKey(tx)],\n TileMode[enumKey(ty)],\n FilterMode[enumKey(fm)],\n MipmapMode[enumKey(mm)],\n lm\n );\n }\n}\n\nexport class ColorNode extends ShaderDeclaration<ColorProps> {\n constructor(ctx: NodeContext, props: ColorProps) {\n super(ctx, NodeType.ColorShader, props);\n }\n\n materialize() {\n const { color } = this.props;\n return this.Skia.Shader.MakeColor(processColor(this.Skia, color, 1));\n }\n}\n\nexport class TurbulenceNode extends ShaderDeclaration<TurbulenceProps> {\n constructor(ctx: NodeContext, props: TurbulenceProps) {\n super(ctx, NodeType.Turbulence, props);\n }\n\n materialize() {\n const { freqX, freqY, octaves, seed, tileWidth, tileHeight } = this.props;\n return this.Skia.Shader.MakeTurbulence(\n freqX,\n freqY,\n octaves,\n seed,\n tileWidth,\n tileHeight\n );\n }\n}\n\nexport class FractalNoiseNode extends ShaderDeclaration<FractalNoiseProps> {\n constructor(ctx: NodeContext, props: FractalNoiseProps) {\n super(ctx, NodeType.FractalNoise, props);\n }\n\n materialize() {\n const { freqX, freqY, octaves, seed, tileWidth, tileHeight } = this.props;\n return this.Skia.Shader.MakeFractalNoise(\n freqX,\n freqY,\n octaves,\n seed,\n tileWidth,\n tileHeight\n );\n }\n}\n\nexport class LinearGradientNode extends ShaderDeclaration<LinearGradientProps> {\n constructor(ctx: NodeContext, props: LinearGradientProps) {\n super(ctx, NodeType.LinearGradient, props);\n }\n\n materialize() {\n const { start, end } = this.props;\n const { colors, positions, mode, localMatrix, flags } =\n processGradientProps(this.Skia, this.props);\n return this.Skia.Shader.MakeLinearGradient(\n start,\n end,\n colors,\n positions ?? null,\n mode,\n localMatrix,\n flags\n );\n }\n}\n\nexport class RadialGradientNode extends ShaderDeclaration<RadialGradientProps> {\n constructor(ctx: NodeContext, props: RadialGradientProps) {\n super(ctx, NodeType.RadialGradient, props);\n }\n\n materialize() {\n const { c, r } = this.props;\n const { colors, positions, mode, localMatrix, flags } =\n processGradientProps(this.Skia, this.props);\n return this.Skia.Shader.MakeRadialGradient(\n c,\n r,\n colors,\n positions,\n mode,\n localMatrix,\n flags\n );\n }\n}\n\nexport class SweepGradientNode extends ShaderDeclaration<SweepGradientProps> {\n constructor(ctx: NodeContext, props: SweepGradientProps) {\n super(ctx, NodeType.SweepGradient, props);\n }\n\n materialize() {\n const { c, start, end } = this.props;\n const { colors, positions, mode, localMatrix, flags } =\n processGradientProps(this.Skia, this.props);\n return this.Skia.Shader.MakeSweepGradient(\n c.x,\n c.y,\n colors,\n positions,\n mode,\n localMatrix,\n flags,\n start,\n end\n );\n }\n}\n\nexport class TwoPointConicalGradientNode extends ShaderDeclaration<TwoPointConicalGradientProps> {\n constructor(ctx: NodeContext, props: TwoPointConicalGradientProps) {\n super(ctx, NodeType.TwoPointConicalGradient, props);\n }\n\n materialize() {\n const { startR, endR, start, end } = this.props;\n const { colors, positions, mode, localMatrix, flags } =\n processGradientProps(this.Skia, this.props);\n return this.Skia.Shader.MakeTwoPointConicalGradient(\n start,\n startR,\n end,\n endR,\n colors,\n positions,\n mode,\n localMatrix,\n flags\n );\n }\n}\n"]}
|
1
|
+
{"version":3,"names":["processUniforms","FilterMode","MipmapMode","TileMode","JsiDeclarationNode","DeclarationType","NodeType","processColor","enumKey","fitRects","getRect","processGradientProps","processTransformProps","rect2rect","ShaderDeclaration","constructor","ctx","type","props","Shader","ShaderNode","materialize","source","uniforms","transform","m3","Skia","Matrix","makeShaderWithChildren","children","filter","child","isShader","map","ImageShaderNode","ImageShader","fit","image","tx","ty","fm","mm","imageShaderProps","rct","rects","x","y","width","height","src","dst","lm","makeShaderOptions","ColorNode","ColorShader","color","MakeColor","TurbulenceNode","Turbulence","freqX","freqY","octaves","seed","tileWidth","tileHeight","MakeTurbulence","FractalNoiseNode","FractalNoise","MakeFractalNoise","LinearGradientNode","LinearGradient","start","end","colors","positions","mode","localMatrix","flags","MakeLinearGradient","RadialGradientNode","RadialGradient","c","r","MakeRadialGradient","SweepGradientNode","SweepGradient","MakeSweepGradient","TwoPointConicalGradientNode","TwoPointConicalGradient","startR","endR","MakeTwoPointConicalGradient"],"sources":["Shaders.ts"],"sourcesContent":["import {\n processUniforms,\n FilterMode,\n MipmapMode,\n TileMode,\n} from \"../../../skia/types\";\nimport type { SkShader } from \"../../../skia/types\";\nimport type { NodeContext } from \"../Node\";\nimport { JsiDeclarationNode } from \"../Node\";\nimport type {\n ColorProps,\n FractalNoiseProps,\n ImageShaderProps,\n LinearGradientProps,\n RadialGradientProps,\n ShaderProps,\n SweepGradientProps,\n TurbulenceProps,\n TwoPointConicalGradientProps,\n} from \"../../types\";\nimport { DeclarationType, NodeType } from \"../../types\";\nimport { processColor } from \"../datatypes/Color\";\nimport {\n enumKey,\n fitRects,\n getRect,\n processGradientProps,\n processTransformProps,\n rect2rect,\n} from \"../datatypes\";\n\nexport abstract class ShaderDeclaration<P> extends JsiDeclarationNode<\n P,\n SkShader\n> {\n constructor(ctx: NodeContext, type: NodeType, props: P) {\n super(ctx, DeclarationType.Shader, type, props);\n }\n}\n\nexport class ShaderNode extends ShaderDeclaration<ShaderProps> {\n constructor(ctx: NodeContext, props: ShaderProps) {\n super(ctx, NodeType.Shader, props);\n }\n\n materialize() {\n const { source, uniforms, ...transform } = this.props;\n const m3 = this.Skia.Matrix();\n processTransformProps(m3, transform);\n return source.makeShaderWithChildren(\n processUniforms(source, uniforms),\n this.children()\n .filter(\n (child): child is JsiDeclarationNode<unknown, SkShader> =>\n child instanceof JsiDeclarationNode && child.isShader()\n )\n .map((child) => child.materialize()),\n m3\n );\n }\n}\n\nexport class ImageShaderNode extends ShaderDeclaration<ImageShaderProps> {\n constructor(ctx: NodeContext, props: ImageShaderProps) {\n super(ctx, NodeType.ImageShader, props);\n }\n\n materialize() {\n const { fit, image, tx, ty, fm, mm, ...imageShaderProps } = this.props;\n const rct = getRect(this.Skia, imageShaderProps);\n if (rct) {\n const rects = fitRects(\n fit,\n { x: 0, y: 0, width: image.width(), height: image.height() },\n rct\n );\n const m3 = rect2rect(rects.src, rects.dst);\n imageShaderProps.transform = [\n ...(imageShaderProps.transform ?? []),\n ...m3,\n ];\n }\n const lm = this.Skia.Matrix();\n processTransformProps(lm, imageShaderProps);\n return image.makeShaderOptions(\n TileMode[enumKey(tx)],\n TileMode[enumKey(ty)],\n FilterMode[enumKey(fm)],\n MipmapMode[enumKey(mm)],\n lm\n );\n }\n}\n\nexport class ColorNode extends ShaderDeclaration<ColorProps> {\n constructor(ctx: NodeContext, props: ColorProps) {\n super(ctx, NodeType.ColorShader, props);\n }\n\n materialize() {\n const { color } = this.props;\n return this.Skia.Shader.MakeColor(processColor(this.Skia, color, 1));\n }\n}\n\nexport class TurbulenceNode extends ShaderDeclaration<TurbulenceProps> {\n constructor(ctx: NodeContext, props: TurbulenceProps) {\n super(ctx, NodeType.Turbulence, props);\n }\n\n materialize() {\n const { freqX, freqY, octaves, seed, tileWidth, tileHeight } = this.props;\n return this.Skia.Shader.MakeTurbulence(\n freqX,\n freqY,\n octaves,\n seed,\n tileWidth,\n tileHeight\n );\n }\n}\n\nexport class FractalNoiseNode extends ShaderDeclaration<FractalNoiseProps> {\n constructor(ctx: NodeContext, props: FractalNoiseProps) {\n super(ctx, NodeType.FractalNoise, props);\n }\n\n materialize() {\n const { freqX, freqY, octaves, seed, tileWidth, tileHeight } = this.props;\n return this.Skia.Shader.MakeFractalNoise(\n freqX,\n freqY,\n octaves,\n seed,\n tileWidth,\n tileHeight\n );\n }\n}\n\nexport class LinearGradientNode extends ShaderDeclaration<LinearGradientProps> {\n constructor(ctx: NodeContext, props: LinearGradientProps) {\n super(ctx, NodeType.LinearGradient, props);\n }\n\n materialize() {\n const { start, end } = this.props;\n const { colors, positions, mode, localMatrix, flags } =\n processGradientProps(this.Skia, this.props);\n return this.Skia.Shader.MakeLinearGradient(\n start,\n end,\n colors,\n positions ?? null,\n mode,\n localMatrix,\n flags\n );\n }\n}\n\nexport class RadialGradientNode extends ShaderDeclaration<RadialGradientProps> {\n constructor(ctx: NodeContext, props: RadialGradientProps) {\n super(ctx, NodeType.RadialGradient, props);\n }\n\n materialize() {\n const { c, r } = this.props;\n const { colors, positions, mode, localMatrix, flags } =\n processGradientProps(this.Skia, this.props);\n return this.Skia.Shader.MakeRadialGradient(\n c,\n r,\n colors,\n positions,\n mode,\n localMatrix,\n flags\n );\n }\n}\n\nexport class SweepGradientNode extends ShaderDeclaration<SweepGradientProps> {\n constructor(ctx: NodeContext, props: SweepGradientProps) {\n super(ctx, NodeType.SweepGradient, props);\n }\n\n materialize() {\n const { c, start, end } = this.props;\n const { colors, positions, mode, localMatrix, flags } =\n processGradientProps(this.Skia, this.props);\n return this.Skia.Shader.MakeSweepGradient(\n c.x,\n c.y,\n colors,\n positions,\n mode,\n localMatrix,\n flags,\n start,\n end\n );\n }\n}\n\nexport class TwoPointConicalGradientNode extends ShaderDeclaration<TwoPointConicalGradientProps> {\n constructor(ctx: NodeContext, props: TwoPointConicalGradientProps) {\n super(ctx, NodeType.TwoPointConicalGradient, props);\n }\n\n materialize() {\n const { startR, endR, start, end } = this.props;\n const { colors, positions, mode, localMatrix, flags } =\n processGradientProps(this.Skia, this.props);\n return this.Skia.Shader.MakeTwoPointConicalGradient(\n start,\n startR,\n end,\n endR,\n colors,\n positions,\n mode,\n localMatrix,\n flags\n );\n }\n}\n"],"mappings":"AAAA,SACEA,eADF,EAEEC,UAFF,EAGEC,UAHF,EAIEC,QAJF,QAKO,qBALP;AAQA,SAASC,kBAAT,QAAmC,SAAnC;AAYA,SAASC,eAAT,EAA0BC,QAA1B,QAA0C,aAA1C;AACA,SAASC,YAAT,QAA6B,oBAA7B;AACA,SACEC,OADF,EAEEC,QAFF,EAGEC,OAHF,EAIEC,oBAJF,EAKEC,qBALF,EAMEC,SANF,QAOO,cAPP;AASA,OAAO,MAAeC,iBAAf,SAA4CV,kBAA5C,CAGL;EACAW,WAAW,CAACC,GAAD,EAAmBC,IAAnB,EAAmCC,KAAnC,EAA6C;IACtD,MAAMF,GAAN,EAAWX,eAAe,CAACc,MAA3B,EAAmCF,IAAnC,EAAyCC,KAAzC;EACD;;AAHD;AAMF,OAAO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LC,KAPK,EAQLN,KARK,EASLC,GATK,CAAP;EAWD;;AApB0E;AAuB7E,OAAO,MAAMe,2BAAN,SAA0CzE,iBAA1C,CAA0F;EAC/FC,WAAW,CAACC,GAAD,EAAmBE,KAAnB,EAAwD;IACjE,MAAMF,GAAN,EAAWV,QAAQ,CAACkF,uBAApB,EAA6CtE,KAA7C;EACD;;EAEDG,WAAW,GAAG;IACZ,MAAM;MAAEoE,MAAF;MAAUC,IAAV;MAAgBnB,KAAhB;MAAuBC;IAAvB,IAA+B,KAAKtD,KAA1C;IACA,MAAM;MAAEuD,MAAF;MAAUC,SAAV;MAAqBC,IAArB;MAA2BC,WAA3B;MAAwCC;IAAxC,IACJlE,oBAAoB,CAAC,KAAKe,IAAN,EAAY,KAAKR,KAAjB,CADtB;IAEA,OAAO,KAAKQ,IAAL,CAAUP,MAAV,CAAiBwE,2BAAjB,CACLpB,KADK,EAELkB,MAFK,EAGLjB,GAHK,EAILkB,IAJK,EAKLjB,MALK,EAMLC,SANK,EAOLC,IAPK,EAQLC,WARK,EASLC,KATK,CAAP;EAWD;;AApB8F"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./Shaders\";\nexport * from \"./MaskFilters\";\nexport * from \"./ColorFilters\";\nexport * from \"./ImageFilters\";\nexport * from \"./PathEffects\";\nexport * from \"./BlendNode\";\n"],"mappings":"AAAA,cAAc,WAAd;AACA,cAAc,eAAd;AACA,cAAc,gBAAd;AACA,cAAc,gBAAd;AACA,cAAc,eAAd;AACA,cAAc,aAAd"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"names":[],"sources":["ColorFilters.ts"],"sourcesContent":["import type { BlendMode, Color } from \"../../skia/types\";\n\nimport type { ChildrenProps, SkEnum } from \"./Common\";\n\nexport interface MatrixColorFilterProps extends ChildrenProps {\n matrix: number[];\n}\n\nexport interface BlendColorFilterProps extends ChildrenProps {\n mode: SkEnum<typeof BlendMode>;\n color: Color;\n}\n\nexport interface LerpColorFilterProps extends ChildrenProps {\n t: number;\n}\n"],"mappings":""}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"names":[],"sources":["Common.ts"],"sourcesContent":["import type { ReactNode, RefObject } from \"react\";\n\nimport type {\n BlendMode,\n Color,\n PaintStyle,\n SkMatrix,\n SkPaint,\n SkPath,\n SkRect,\n SkRRect,\n StrokeCap,\n StrokeJoin,\n Transforms2d,\n Vector,\n} from \"../../skia/types\";\n\nimport type { DeclarationNode } from \"./Node\";\n\nexport type SkEnum<T> = Uncapitalize<keyof T extends string ? keyof T : never>;\n\nexport type PathDef = string | SkPath;\n\nexport type ClipDef = SkRRect | SkRect | PathDef;\n\nexport type Fit =\n | \"cover\"\n | \"contain\"\n | \"fill\"\n | \"fitHeight\"\n | \"fitWidth\"\n | \"none\"\n | \"scaleDown\";\n\nexport type Radius = number | Vector;\n\nexport interface ChildrenProps {\n children?: ReactNode | ReactNode[];\n}\n\nexport interface RectCtor {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\nexport interface RRectCtor extends RectCtor {\n r: Radius;\n}\n\nexport type RectDef = RectCtor | { rect: SkRect };\nexport type RRectDef = RRectCtor | { rect: SkRRect };\n\nexport interface PointCircleDef {\n c: Vector;\n r: number;\n}\n\nexport interface ScalarCircleDef {\n cx: number;\n cy: number;\n r: number;\n}\n\nexport type CircleDef = PointCircleDef | ScalarCircleDef;\n\nexport interface TransformProps {\n transform?: Transforms2d;\n origin?: Vector;\n matrix?: SkMatrix;\n}\n\nexport interface PaintProps extends ChildrenProps {\n color?: Color;\n strokeWidth?: number;\n blendMode?: SkEnum<typeof BlendMode>;\n style?: SkEnum<typeof PaintStyle>;\n strokeJoin?: SkEnum<typeof StrokeJoin>;\n strokeCap?: SkEnum<typeof StrokeCap>;\n strokeMiter?: number;\n opacity?: number;\n antiAlias?: boolean;\n}\n\nexport interface GroupProps extends PaintProps, TransformProps {\n clip?: ClipDef;\n invertClip?: boolean;\n layer?: RefObject<DeclarationNode<unknown, SkPaint>> | SkPaint | boolean;\n}\n"],"mappings":""}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"names":[],"sources":["DrawingContext.ts"],"sourcesContent":["import type { SkCanvas, SkPaint } from \"../../skia/types\";\n\nexport interface DrawingContext {\n canvas: SkCanvas;\n paint: SkPaint;\n opacity: number;\n}\n"],"mappings":""}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"names":[],"sources":["Drawings.ts"],"sourcesContent":["import type { RefObject } from \"react\";\n\nimport type {\n FillType,\n SkImage,\n StrokeOpts,\n Vector,\n Color,\n SkPoint,\n BlendMode,\n PointMode,\n VertexMode,\n SkFont,\n SkRRect,\n SkTextBlob,\n SkPicture,\n SkSVG,\n SkPaint,\n SkRect,\n} from \"../../skia/types\";\n\nimport type {\n CircleDef,\n Fit,\n GroupProps,\n PathDef,\n RectDef,\n RRectDef,\n SkEnum,\n} from \"./Common\";\nimport type { DrawingContext } from \"./DrawingContext\";\nimport type { DeclarationNode } from \"./Node\";\n\nexport interface DrawingNodeProps extends GroupProps {\n paint?: SkPaint | RefObject<DeclarationNode<unknown, SkPaint>>;\n}\n\nexport type ImageProps = DrawingNodeProps &\n RectDef & {\n fit: Fit;\n image: SkImage;\n };\n\nexport type CircleProps = CircleDef & DrawingNodeProps;\n\nexport interface PathProps extends DrawingNodeProps {\n path: PathDef;\n start: number;\n end: number;\n stroke?: StrokeOpts;\n fillType?: SkEnum<typeof FillType>;\n}\n\nexport interface CustomDrawingNodeProps extends DrawingNodeProps {\n drawing: (ctx: DrawingContext) => void;\n}\n\nexport interface LineProps extends DrawingNodeProps {\n p1: Vector;\n p2: Vector;\n}\n\nexport type OvalProps = RectDef & DrawingNodeProps;\n\nexport type RectProps = RectDef & DrawingNodeProps;\n\nexport type RoundedRectProps = RRectDef & DrawingNodeProps;\n\nexport interface CubicBezierHandle {\n pos: Vector;\n c1: Vector;\n c2: Vector;\n}\n\nexport interface PatchProps extends DrawingNodeProps {\n colors?: Color[];\n patch: [\n CubicBezierHandle,\n CubicBezierHandle,\n CubicBezierHandle,\n CubicBezierHandle\n ];\n texture?: readonly [SkPoint, SkPoint, SkPoint, SkPoint];\n blendMode?: SkEnum<typeof BlendMode>;\n}\n\nexport interface VerticesProps extends DrawingNodeProps {\n colors?: string[];\n vertices: SkPoint[];\n textures?: SkPoint[];\n mode: SkEnum<typeof VertexMode>;\n blendMode?: SkEnum<typeof BlendMode>;\n indices?: number[];\n}\n\nexport type ImageSVGProps = RectDef & {\n svg: SkSVG;\n} & DrawingNodeProps;\n\nexport interface PictureProps extends DrawingNodeProps {\n picture: SkPicture;\n}\n\nexport interface PointsProps extends DrawingNodeProps {\n points: SkPoint[];\n mode: SkEnum<typeof PointMode>;\n}\n\nexport interface DiffRectProps extends DrawingNodeProps {\n inner: SkRRect;\n outer: SkRRect;\n}\n\nexport interface TextProps extends DrawingNodeProps {\n font: SkFont;\n text: string;\n x: number;\n y: number;\n}\n\nexport interface TextPathProps extends DrawingNodeProps {\n font: SkFont;\n text: string;\n path: PathDef;\n initialOffset: number;\n}\n\nexport interface TextBlobProps extends DrawingNodeProps {\n blob: SkTextBlob;\n x: number;\n y: number;\n}\n\nexport interface Glyph {\n id: number;\n pos: SkPoint;\n}\n\nexport interface GlyphsProps extends DrawingNodeProps {\n font: SkFont;\n x: number;\n y: number;\n glyphs: Glyph[];\n}\n\nexport interface BoxProps extends DrawingNodeProps {\n box: SkRRect | SkRect;\n}\n\nexport interface BoxShadowProps {\n dx?: number;\n dy?: number;\n spread?: number;\n blur: number;\n color?: Color;\n inner?: boolean;\n}\n"],"mappings":""}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"names":[],"sources":["ImageFilters.ts"],"sourcesContent":["import type {\n BlendMode,\n Color,\n ColorChannel,\n SkRuntimeEffect,\n TileMode,\n Uniforms,\n} from \"../../skia/types\";\n\nimport type { Radius, SkEnum, ChildrenProps } from \"./Common\";\n\nexport interface BlurImageFilterProps extends ChildrenProps {\n blur: Radius;\n mode: SkEnum<typeof TileMode>;\n}\n\nexport interface OffsetImageFilterProps extends ChildrenProps {\n x: number;\n y: number;\n}\n\nexport interface RuntimeShaderImageFilterProps extends ChildrenProps {\n source: SkRuntimeEffect;\n uniforms?: Uniforms;\n}\n\nexport interface BlendImageFilterProps extends ChildrenProps {\n mode: BlendMode;\n}\n\nexport interface MorphologyImageFilterProps extends ChildrenProps {\n operator: \"erode\" | \"dilate\";\n radius: Radius;\n}\n\nexport interface DropShadowImageFilterProps extends ChildrenProps {\n dx: number;\n dy: number;\n blur: number;\n color: Color;\n inner?: boolean;\n shadowOnly?: boolean;\n}\n\nexport interface DisplacementMapImageFilterProps extends ChildrenProps {\n channelX: SkEnum<typeof ColorChannel>;\n channelY: SkEnum<typeof ColorChannel>;\n scale: number;\n}\n\nexport interface BlendProps extends ChildrenProps {\n mode: SkEnum<typeof BlendMode>;\n}\n"],"mappings":""}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"names":[],"sources":["MaskFilters.ts"],"sourcesContent":["import type { BlurStyle } from \"../../skia/types\";\n\nimport type { SkEnum } from \"./Common\";\n\nexport interface BlurMaskFilterProps {\n style: SkEnum<typeof BlurStyle>;\n blur: number;\n respectCTM: boolean;\n}\n"],"mappings":""}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"names":[],"sources":["Node.ts"],"sourcesContent":["import type {\n SkColorFilter,\n SkImageFilter,\n SkMaskFilter,\n SkPaint,\n SkPathEffect,\n SkShader,\n} from \"../../skia/types\";\n\nimport type { GroupProps } from \"./Common\";\nimport type { DrawingContext } from \"./DrawingContext\";\nimport type { DeclarationType, NodeType } from \"./NodeType\";\n\nexport interface Node<P> {\n type: NodeType;\n\n setProps(props: P): void;\n setProp<K extends keyof P>(name: K, v: P[K]): boolean;\n getProps(): P;\n\n children(): Node<unknown>[];\n addChild(child: Node<unknown>): void;\n removeChild(child: Node<unknown>): void;\n insertChildBefore(child: Node<unknown>, before: Node<unknown>): void;\n}\n\nexport type Invalidate = () => void;\n\nexport interface DeclarationNode<P, T, Nullable extends null | never = never>\n extends Node<P> {\n declarationType: DeclarationType;\n materialize(): T | Nullable;\n\n setInvalidate(invalidate: Invalidate): void;\n\n isPaint(): this is DeclarationNode<unknown, SkPaint>;\n isImageFilter(): this is DeclarationNode<unknown, SkImageFilter>;\n isColorFilter(): this is DeclarationNode<unknown, SkColorFilter>;\n isShader(): this is DeclarationNode<unknown, SkShader>;\n isMaskFilter(): this is DeclarationNode<unknown, SkMaskFilter>;\n isPathEffect(): this is DeclarationNode<unknown, SkPathEffect>;\n}\n\nexport interface RenderNode<P extends GroupProps> extends Node<P> {\n render(ctx: DrawingContext): void;\n}\n"],"mappings":""}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"names":["NodeType","DeclarationType"],"sources":["NodeType.ts"],"sourcesContent":["export const enum NodeType {\n // Shaders\n Shader = \"skShader\",\n ImageShader = \"skImageShader\",\n ColorShader = \"skColorShader\",\n Turbulence = \"skTurbulence\",\n FractalNoise = \"skFractalNoise\",\n LinearGradient = \"skLinearGradient\",\n RadialGradient = \"skRadialGradient\",\n SweepGradient = \"skSweepGradient\",\n TwoPointConicalGradient = \"skTwoPointConicalGradient\",\n\n // Mask Filters\n BlurMaskFilter = \"skBlurMaskFilter\",\n\n // Path Effects\n DiscretePathEffect = \"skDiscretePathEffect\",\n DashPathEffect = \"skDashPathEffect\",\n Path1DPathEffect = \"skPath1DPathEffect\",\n Path2DPathEffect = \"skPath2DPathEffect\",\n CornerPathEffect = \"skCornerPathEffect\",\n SumPathEffect = \"skSumPathEffect\",\n Line2DPathEffect = \"skLine2DPathEffect\",\n\n // Color Filters\n MatrixColorFilter = \"skMatrixColorFilter\",\n BlendColorFilter = \"skBlendColorFilter\",\n LinearToSRGBGammaColorFilter = \"skLinearToSRGBGammaColorFilter\",\n SRGBToLinearGammaColorFilter = \"skSRGBToLinearGammaColorFilter\",\n LumaColorFilter = \"skLumaColorFilter\",\n LerpColorFilter = \"skLerpColorFilter\",\n\n // Image Filters\n OffsetImageFilter = \"skOffsetImageFilter\",\n DisplacementMapImageFilter = \"skDisplacementMapImageFilter\",\n BlurImageFilter = \"skBlurImageFilter\",\n DropShadowImageFilter = \"skDropShadowImageFilter\",\n MorphologyImageFilter = \"skMorphologyImageFilter\",\n BlendImageFilter = \"skBlendImageFilter\",\n RuntimeShaderImageFilter = \"skRuntimeShaderImageFilter\",\n\n // Mixed\n Blend = \"skBlend\",\n BackdropFilter = \"skBackdropFilter\",\n Box = \"skBox\",\n BoxShadow = \"skBoxShadow\",\n\n // Drawings\n Group = \"skGroup\",\n Drawing = \"skDrawing\",\n Paint = \"skPaint\",\n Circle = \"skCircle\",\n Fill = \"skFill\",\n Image = \"skImage\",\n Points = \"skPoints\",\n Path = \"skPath\",\n Rect = \"skRect\",\n RRect = \"skRRect\",\n Oval = \"skOval\",\n Line = \"skLine\",\n Patch = \"skPatch\",\n Vertices = \"skVertices\",\n DiffRect = \"skDiffRect\",\n Text = \"skText\",\n TextPath = \"skTextPath\",\n TextBlob = \"skTextBlob\",\n Glyphs = \"skGlyphs\",\n Picture = \"skPicture\",\n ImageSVG = \"skImageSVG\",\n}\n\nexport const enum DeclarationType {\n Paint,\n Shader,\n ImageFilter,\n ColorFilter,\n PathEffect,\n MaskFilter,\n Unknown,\n}\n"],"mappings":"AAAA,WAAkBA,QAAlB;;WAAkBA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;GAAAA,Q,KAAAA,Q;;AAuElB,WAAkBC,eAAlB;;WAAkBA,e;EAAAA,e,CAAAA,e;EAAAA,e,CAAAA,e;EAAAA,e,CAAAA,e;EAAAA,e,CAAAA,e;EAAAA,e,CAAAA,e;EAAAA,e,CAAAA,e;EAAAA,e,CAAAA,e;GAAAA,e,KAAAA,e"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"names":[],"sources":["PathEffects.ts"],"sourcesContent":["import type { Path1DEffectStyle, SkMatrix } from \"../../skia/types\";\n\nimport type { ChildrenProps, PathDef, SkEnum } from \"./Common\";\n\nexport interface CornerPathEffectProps extends ChildrenProps {\n r: number;\n}\n\nexport interface DiscretePathEffectProps extends ChildrenProps {\n length: number;\n deviation: number;\n seed: number;\n}\n\nexport interface DashPathEffectProps extends ChildrenProps {\n intervals: number[];\n phase?: number;\n}\n\nexport interface Path1DPathEffectProps extends ChildrenProps {\n path: PathDef;\n advance: number;\n phase: number;\n style: SkEnum<typeof Path1DEffectStyle>;\n}\n\nexport interface Path2DPathEffectProps extends ChildrenProps {\n matrix: SkMatrix;\n path: PathDef;\n}\n\nexport interface Line2DPathEffectProps extends ChildrenProps {\n width: number;\n matrix: SkMatrix;\n}\n"],"mappings":""}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"names":[],"sources":["Shaders.ts"],"sourcesContent":["import type {\n Color,\n FilterMode,\n MipmapMode,\n SkImage,\n SkRect,\n SkRuntimeEffect,\n TileMode,\n Uniforms,\n Vector,\n} from \"../../skia/types\";\n\nimport type {\n SkEnum,\n TransformProps,\n ChildrenProps,\n RectCtor,\n Fit,\n} from \"./Common\";\n\nexport interface ShaderProps extends TransformProps, ChildrenProps {\n source: SkRuntimeEffect;\n uniforms: Uniforms;\n}\n\nexport interface ImageShaderProps extends TransformProps, Partial<RectCtor> {\n tx: SkEnum<typeof TileMode>;\n ty: SkEnum<typeof TileMode>;\n fm: SkEnum<typeof FilterMode>;\n mm: SkEnum<typeof MipmapMode>;\n fit: Fit;\n rect?: SkRect;\n image: SkImage;\n}\n\nexport interface ColorProps {\n color: Color;\n}\n\nexport interface TurbulenceProps {\n freqX: number;\n freqY: number;\n octaves: number;\n seed: number;\n tileWidth: number;\n tileHeight: number;\n}\n\nexport interface FractalNoiseProps {\n freqX: number;\n freqY: number;\n octaves: number;\n seed: number;\n tileWidth: number;\n tileHeight: number;\n}\n\nexport interface GradientProps extends TransformProps {\n colors: Color[];\n positions?: number[];\n mode?: SkEnum<typeof TileMode>;\n flags?: number;\n}\n\nexport interface LinearGradientProps extends GradientProps {\n start: Vector;\n end: Vector;\n}\n\nexport interface RadialGradientProps extends GradientProps {\n c: Vector;\n r: number;\n}\n\nexport interface SweepGradientProps extends GradientProps {\n c: Vector;\n start?: number;\n end?: number;\n}\n\nexport interface TwoPointConicalGradientProps extends GradientProps {\n start: Vector;\n startR: number;\n end: Vector;\n endR: number;\n}\n"],"mappings":""}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"names":[],"sources":["SkDOM.ts"],"sourcesContent":["import type {\n SkImageFilter,\n SkMaskFilter,\n SkShader,\n SkColorFilter,\n SkPathEffect,\n SkPaint,\n} from \"../../skia/types\";\n\nimport type { ChildrenProps, GroupProps, PaintProps } from \"./Common\";\nimport type {\n BlendImageFilterProps,\n BlurImageFilterProps,\n DropShadowImageFilterProps,\n OffsetImageFilterProps,\n RuntimeShaderImageFilterProps,\n DisplacementMapImageFilterProps,\n MorphologyImageFilterProps,\n BlendProps,\n} from \"./ImageFilters\";\nimport type { DeclarationNode, RenderNode } from \"./Node\";\nimport type {\n BlendColorFilterProps,\n MatrixColorFilterProps,\n LerpColorFilterProps,\n} from \"./ColorFilters\";\nimport type {\n ImageProps,\n CircleProps,\n PathProps,\n CustomDrawingNodeProps,\n LineProps,\n OvalProps,\n PatchProps,\n PointsProps,\n RectProps,\n RoundedRectProps,\n VerticesProps,\n TextProps,\n DiffRectProps,\n TextPathProps,\n TextBlobProps,\n GlyphsProps,\n PictureProps,\n ImageSVGProps,\n DrawingNodeProps,\n BoxProps,\n BoxShadowProps,\n} from \"./Drawings\";\nimport type { BlurMaskFilterProps } from \"./MaskFilters\";\nimport type {\n FractalNoiseProps,\n SweepGradientProps,\n ImageShaderProps,\n LinearGradientProps,\n ShaderProps,\n TurbulenceProps,\n TwoPointConicalGradientProps,\n RadialGradientProps,\n ColorProps,\n} from \"./Shaders\";\nimport type {\n CornerPathEffectProps,\n DashPathEffectProps,\n DiscretePathEffectProps,\n Line2DPathEffectProps,\n Path1DPathEffectProps,\n Path2DPathEffectProps,\n} from \"./PathEffects\";\n\ntype ImageFilterNode<P> = DeclarationNode<P, SkImageFilter>;\n\ntype PathEffectNode<P> = DeclarationNode<P, SkPathEffect>;\ntype NullablePathEffectNode<P> = DeclarationNode<P, SkPathEffect, null>;\n\ntype DrawingNode<P extends GroupProps> = RenderNode<P>;\n\nexport interface SkDOM {\n Group(props?: GroupProps): RenderNode<GroupProps>;\n Paint(props: PaintProps): DeclarationNode<PaintProps, SkPaint>;\n\n // Drawings\n Fill(props?: DrawingNodeProps): DrawingNode<DrawingNodeProps>;\n Image(props: ImageProps): DrawingNode<ImageProps>;\n Circle(props: CircleProps): DrawingNode<CircleProps>;\n Path(props: PathProps): DrawingNode<PathProps>;\n CustomDrawing(\n props: CustomDrawingNodeProps\n ): DrawingNode<CustomDrawingNodeProps>;\n Line(props: LineProps): DrawingNode<LineProps>;\n Oval(props: OvalProps): DrawingNode<OvalProps>;\n Patch(props: PatchProps): DrawingNode<PatchProps>;\n Points(props: PointsProps): DrawingNode<PointsProps>;\n Rect(props: RectProps): DrawingNode<RectProps>;\n RRect(props: RoundedRectProps): DrawingNode<RoundedRectProps>;\n Vertices(props: VerticesProps): DrawingNode<VerticesProps>;\n Text(props: TextProps): DrawingNode<TextProps>;\n TextPath(props: TextPathProps): DrawingNode<TextPathProps>;\n TextBlob(props: TextBlobProps): DrawingNode<TextBlobProps>;\n Glyphs(props: GlyphsProps): DrawingNode<GlyphsProps>;\n DiffRect(props: DiffRectProps): DrawingNode<DiffRectProps>;\n Picture(props: PictureProps): DrawingNode<PictureProps>;\n ImageSVG(props: ImageSVGProps): DrawingNode<ImageSVGProps>;\n\n // BlurMaskFilters\n BlurMaskFilter(\n props: BlurMaskFilterProps\n ): DeclarationNode<BlurMaskFilterProps, SkMaskFilter>;\n\n // ImageFilters\n BlendImageFilter(\n props: BlendImageFilterProps\n ): ImageFilterNode<BlendImageFilterProps>;\n BlurImageFilter(\n props: BlurImageFilterProps\n ): ImageFilterNode<BlurImageFilterProps>;\n OffsetImageFilter(\n props: OffsetImageFilterProps\n ): ImageFilterNode<OffsetImageFilterProps>;\n DropShadowImageFilter(\n props: DropShadowImageFilterProps\n ): ImageFilterNode<DropShadowImageFilterProps>;\n MorphologyImageFilter(\n props: MorphologyImageFilterProps\n ): ImageFilterNode<MorphologyImageFilterProps>;\n DisplacementMapImageFilter(\n props: DisplacementMapImageFilterProps\n ): ImageFilterNode<DisplacementMapImageFilterProps>;\n RuntimeShaderImageFilter(\n props: RuntimeShaderImageFilterProps\n ): ImageFilterNode<RuntimeShaderImageFilterProps>;\n\n // ColorFilters\n MatrixColorFilter(\n props: MatrixColorFilterProps\n ): DeclarationNode<MatrixColorFilterProps, SkColorFilter>;\n BlendColorFilter(\n props: BlendColorFilterProps\n ): DeclarationNode<BlendColorFilterProps, SkColorFilter>;\n LumaColorFilter(): DeclarationNode<null, SkColorFilter>;\n LinearToSRGBGammaColorFilter(): DeclarationNode<null, SkColorFilter>;\n SRGBToLinearGammaColorFilter(): DeclarationNode<null, SkColorFilter>;\n LerpColorFilter(\n props: LerpColorFilterProps\n ): DeclarationNode<LerpColorFilterProps, SkColorFilter>;\n\n // Shaders\n Shader(props: ShaderProps): DeclarationNode<ShaderProps, SkShader>;\n ImageShader(\n props: ImageShaderProps\n ): DeclarationNode<ImageShaderProps, SkShader>;\n ColorShader(props: ColorProps): DeclarationNode<ColorProps, SkShader>;\n Turbulence(\n props: TurbulenceProps\n ): DeclarationNode<TurbulenceProps, SkShader>;\n FractalNoise(\n props: FractalNoiseProps\n ): DeclarationNode<FractalNoiseProps, SkShader>;\n LinearGradient(\n props: LinearGradientProps\n ): DeclarationNode<LinearGradientProps, SkShader>;\n RadialGradient(\n props: RadialGradientProps\n ): DeclarationNode<RadialGradientProps, SkShader>;\n SweepGradient(\n props: SweepGradientProps\n ): DeclarationNode<SweepGradientProps, SkShader>;\n TwoPointConicalGradient(\n props: TwoPointConicalGradientProps\n ): DeclarationNode<TwoPointConicalGradientProps, SkShader>;\n\n // Path Effects\n CornerPathEffect(\n props: CornerPathEffectProps\n ): NullablePathEffectNode<CornerPathEffectProps>;\n DiscretePathEffect(\n props: DiscretePathEffectProps\n ): PathEffectNode<DiscretePathEffectProps>;\n DashPathEffect(\n props: DashPathEffectProps\n ): PathEffectNode<DashPathEffectProps>;\n Path1DPathEffect(\n props: Path1DPathEffectProps\n ): NullablePathEffectNode<Path1DPathEffectProps>;\n Path2DPathEffect(\n props: Path2DPathEffectProps\n ): NullablePathEffectNode<Path2DPathEffectProps>;\n SumPathEffect(): NullablePathEffectNode<null>;\n Line2DPathEffect(\n props: Line2DPathEffectProps\n ): NullablePathEffectNode<Line2DPathEffectProps>;\n\n // Mixed\n Blend(\n props: BlendProps\n ): DeclarationNode<BlendProps, SkShader | SkImageFilter>;\n BackdropFilter(props: ChildrenProps): RenderNode<ChildrenProps>;\n Box(props: BoxProps): RenderNode<BoxProps>;\n BoxShadow(\n props: BoxShadowProps\n ): DeclarationNode<BoxShadowProps, BoxShadowProps>;\n}\n"],"mappings":""}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./DrawingContext\";\nexport * from \"./Node\";\nexport * from \"./NodeType\";\nexport * from \"./SkDOM\";\nexport * from \"./Common\";\nexport * from \"./Drawings\";\nexport * from \"./ImageFilters\";\nexport * from \"./ColorFilters\";\nexport * from \"./MaskFilters\";\nexport * from \"./PathEffects\";\nexport * from \"./Shaders\";\n"],"mappings":"AAAA,cAAc,kBAAd;AACA,cAAc,QAAd;AACA,cAAc,YAAd;AACA,cAAc,SAAd;AACA,cAAc,UAAd;AACA,cAAc,YAAd;AACA,cAAc,gBAAd;AACA,cAAc,gBAAd;AACA,cAAc,eAAd;AACA,cAAc,eAAd;AACA,cAAc,WAAd"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./reanimated\";\n"],"mappings":"AAAA,cAAc,cAAd"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./useSharedValueEffect\";\n"],"mappings":"AAAA,cAAc,wBAAd"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"names":["useEffect","useMemo","Reanimated","Core","require","e","useSharedValueWrapper","useSharedValue","undefined","value","useSharedValueEffect","cb","values","input","runOnJS","startMapper","stopMapper","console","warn","mapperId"],"sources":["useSharedValueEffect.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-shadow */\n/* eslint-disable @typescript-eslint/consistent-type-imports */\n/* eslint-disable @typescript-eslint/ban-ts-comment */\nimport { useEffect, useMemo } from \"react\";\n\n// @ts-ignore\nlet Reanimated: typeof import(\"react-native-reanimated\") | undefined;\nlet Core: // @ts-ignore\ntypeof import(\"react-native-reanimated/lib/reanimated2/core\") | undefined;\n\ntry {\n Reanimated = require(\"react-native-reanimated\");\n Core = require(\"react-native-reanimated/lib/reanimated2/core\");\n} catch (e) {\n // Ignore\n}\n\ntype SharedValueTypeWrapper<T = number> = {\n value: T;\n};\n\nconst useSharedValueWrapper =\n Reanimated?.useSharedValue === undefined\n ? (value: number) => useMemo(() => ({ value }), [value])\n : Reanimated.useSharedValue;\n\n/**\n * Connects a shared value from reanimated to a SkiaView or Canvas\n * so whenever the shared value changes the SkiaView will redraw.\n * @param cb Callback that will be called whenever the shared value changes.\n * @param values One or more shared values to listen for.\n */\nexport const useSharedValueEffect = <T = number>(\n cb: () => void,\n value: SharedValueTypeWrapper<T>,\n ...values: SharedValueTypeWrapper<T>[]\n) => {\n const input = useSharedValueWrapper(0);\n const { runOnJS, startMapper, stopMapper } = useMemo(() => {\n if (Reanimated && Core) {\n const { runOnJS } = Reanimated;\n const { startMapper, stopMapper } = Core;\n return { runOnJS, startMapper, stopMapper };\n } else {\n console.warn(\n \"Reanimated was not found and the useSharedValueEffect hook will have no effect.\"\n );\n return {\n runOnJS: undefined,\n startMapper: undefined,\n stopMapper: undefined,\n };\n }\n }, []);\n\n useEffect(() => {\n if (\n startMapper !== undefined &&\n runOnJS !== undefined &&\n stopMapper !== undefined\n ) {\n // Start a mapper in Reanimated\n const mapperId = startMapper(\n () => {\n \"worklet\";\n runOnJS(cb)();\n },\n [value, ...values],\n [input]\n );\n // Return unregistering the mapper\n return () => {\n if (stopMapper && mapperId !== undefined) {\n stopMapper(mapperId);\n }\n };\n }\n return () => {};\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [input, runOnJS, startMapper, stopMapper, value, ...values]);\n};\n"],"mappings":";;AAAA;;AACA;;AACA;AACA,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AAGJ,WAAW,CAC1B,MAAM;QACJ;;QACAD,OAAO,CAACH,EAAD,CAAP;MACD,CAJyB,EAK1B,CAACF,KAAD,EAAQ,GAAGG,MAAX,CAL0B,EAM1B,CAACC,KAAD,CAN0B,CAA5B,CAFA,CAUA;;MACA,OAAO,MAAM;QACX,IAAIG,UAAU,IAAIG,QAAQ,KAAKX,SAA/B,EAA0C;UACxCQ,UAAU,CAACG,QAAD,CAAV;QACD;MACF,CAJD;IAKD;;IACD,OAAO,MAAM,CAAE,CAAf,CAtBc,CAuBd;EACD,CAxBQ,EAwBN,CAACN,KAAD,EAAQC,OAAR,EAAiBC,WAAjB,EAA8BC,UAA9B,EAA0CP,KAA1C,EAAiD,GAAGG,MAApD,CAxBM,CAAT;AAyBD,CAhDM"}
|
package/lib/module/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["import \"./skia/NativeSetup\";\nexport * from \"./renderer\";\nexport * from \"./renderer/Canvas\";\nexport * from \"./views\";\nexport * from \"./skia\";\nexport * from \"./external\";\nexport * from \"./values\";\nexport * from \"./animation\";\nexport * from \"./dom/types\";\nexport * from \"./dom/nodes\";\n"],"mappings":"AAAA,OAAO,oBAAP;AACA,cAAc,YAAd;AACA,cAAc,mBAAd;AACA,cAAc,SAAd;AACA,cAAc,QAAd;AACA,cAAc,YAAd;AACA,cAAc,UAAd;AACA,cAAc,aAAd;AACA,cAAc,aAAd;AACA,cAAc,aAAd"}
|