@shopify/react-native-skia 0.1.147 → 0.1.148
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/commonjs/dom/nodes/DrawingNode.js +84 -0
- package/lib/commonjs/dom/nodes/DrawingNode.js.map +1 -0
- package/lib/commonjs/dom/nodes/GroupNode.js +28 -0
- package/lib/commonjs/dom/nodes/GroupNode.js.map +1 -0
- package/lib/commonjs/dom/nodes/JsiSkDOM.js +256 -0
- package/lib/commonjs/dom/nodes/JsiSkDOM.js.map +1 -0
- package/lib/commonjs/dom/nodes/Node.js +158 -0
- package/lib/commonjs/dom/nodes/Node.js.map +1 -0
- package/lib/commonjs/dom/nodes/PaintContext.js +6 -0
- package/lib/commonjs/dom/nodes/PaintContext.js.map +1 -0
- package/lib/commonjs/dom/nodes/PaintNode.js +96 -0
- package/lib/commonjs/dom/nodes/PaintNode.js.map +1 -0
- package/lib/commonjs/dom/nodes/RenderNode.js +346 -0
- package/lib/commonjs/dom/nodes/RenderNode.js.map +1 -0
- package/lib/commonjs/{renderer/processors/Circles.js → dom/nodes/datatypes/Circle.js} +4 -2
- package/lib/commonjs/dom/nodes/datatypes/Circle.js.map +1 -0
- package/lib/commonjs/{renderer/processors → dom/nodes/datatypes}/Color.js +0 -0
- package/lib/commonjs/{renderer/processors → dom/nodes/datatypes}/Color.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Enum.js +11 -0
- package/lib/commonjs/dom/nodes/datatypes/Enum.js.map +1 -0
- package/lib/commonjs/{renderer/components/image/BoxFit.js → dom/nodes/datatypes/Fitting.js} +2 -2
- package/lib/commonjs/{renderer/components/image/BoxFit.js.map → dom/nodes/datatypes/Fitting.js.map} +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Gradient.js +65 -0
- package/lib/commonjs/dom/nodes/datatypes/Gradient.js.map +1 -0
- package/lib/commonjs/{renderer/processors/Paths.js → dom/nodes/datatypes/Path.js} +2 -2
- package/lib/commonjs/dom/nodes/datatypes/Path.js.map +1 -0
- package/lib/commonjs/{renderer/processors → dom/nodes/datatypes}/Radius.js +0 -0
- package/lib/commonjs/dom/nodes/datatypes/Radius.js.map +1 -0
- package/lib/commonjs/{renderer/processors/Rects.js → dom/nodes/datatypes/Rect.js} +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Rect.js.map +1 -0
- package/lib/commonjs/dom/nodes/datatypes/Transform.js +42 -0
- package/lib/commonjs/dom/nodes/datatypes/Transform.js.map +1 -0
- package/lib/commonjs/dom/nodes/datatypes/index.js +123 -0
- package/lib/commonjs/dom/nodes/datatypes/index.js.map +1 -0
- package/lib/commonjs/dom/nodes/drawings/BackdropFilterNode.js +38 -0
- package/lib/commonjs/dom/nodes/drawings/BackdropFilterNode.js.map +1 -0
- package/lib/commonjs/dom/nodes/drawings/Box.js +105 -0
- package/lib/commonjs/dom/nodes/drawings/Box.js.map +1 -0
- package/lib/commonjs/dom/nodes/drawings/CircleNode.js +43 -0
- package/lib/commonjs/dom/nodes/drawings/CircleNode.js.map +1 -0
- package/lib/commonjs/dom/nodes/drawings/CustomDrawingNode.js +28 -0
- package/lib/commonjs/dom/nodes/drawings/CustomDrawingNode.js.map +1 -0
- package/lib/commonjs/dom/nodes/drawings/DiffRectNode.js +36 -0
- package/lib/commonjs/dom/nodes/drawings/DiffRectNode.js.map +1 -0
- package/lib/commonjs/dom/nodes/drawings/FillNode.js +33 -0
- package/lib/commonjs/dom/nodes/drawings/FillNode.js.map +1 -0
- package/lib/commonjs/dom/nodes/drawings/ImageNode.js +63 -0
- package/lib/commonjs/dom/nodes/drawings/ImageNode.js.map +1 -0
- package/lib/commonjs/dom/nodes/drawings/ImageSVG.js +45 -0
- package/lib/commonjs/dom/nodes/drawings/ImageSVG.js.map +1 -0
- package/lib/commonjs/dom/nodes/drawings/LineNode.js +36 -0
- package/lib/commonjs/dom/nodes/drawings/LineNode.js.map +1 -0
- package/lib/commonjs/dom/nodes/drawings/OvalNode.js +39 -0
- package/lib/commonjs/dom/nodes/drawings/OvalNode.js.map +1 -0
- package/lib/commonjs/dom/nodes/drawings/PatchNode.js +69 -0
- package/lib/commonjs/dom/nodes/drawings/PatchNode.js.map +1 -0
- package/lib/commonjs/dom/nodes/drawings/PathNode.js +68 -0
- package/lib/commonjs/dom/nodes/drawings/PathNode.js.map +1 -0
- package/lib/commonjs/dom/nodes/drawings/PictureNode.js +34 -0
- package/lib/commonjs/dom/nodes/drawings/PictureNode.js.map +1 -0
- package/lib/commonjs/dom/nodes/drawings/PointsNode.js +40 -0
- package/lib/commonjs/dom/nodes/drawings/PointsNode.js.map +1 -0
- package/lib/commonjs/dom/nodes/drawings/RRectNode.js +43 -0
- package/lib/commonjs/dom/nodes/drawings/RRectNode.js.map +1 -0
- package/lib/commonjs/dom/nodes/drawings/RectNode.js +39 -0
- package/lib/commonjs/dom/nodes/drawings/RectNode.js.map +1 -0
- package/lib/commonjs/dom/nodes/drawings/Text.js +185 -0
- package/lib/commonjs/dom/nodes/drawings/Text.js.map +1 -0
- package/lib/commonjs/dom/nodes/drawings/VerticesNode.js +55 -0
- package/lib/commonjs/dom/nodes/drawings/VerticesNode.js.map +1 -0
- package/lib/commonjs/dom/nodes/drawings/index.js +240 -0
- package/lib/commonjs/dom/nodes/drawings/index.js.map +1 -0
- package/lib/commonjs/dom/nodes/index.js +45 -0
- package/lib/commonjs/dom/nodes/index.js.map +1 -0
- package/lib/commonjs/dom/nodes/paint/BlendNode.js +82 -0
- package/lib/commonjs/dom/nodes/paint/BlendNode.js.map +1 -0
- package/lib/commonjs/dom/nodes/paint/ColorFilters.js +152 -0
- package/lib/commonjs/dom/nodes/paint/ColorFilters.js.map +1 -0
- package/lib/commonjs/dom/nodes/paint/ImageFilters.js +225 -0
- package/lib/commonjs/dom/nodes/paint/ImageFilters.js.map +1 -0
- package/lib/commonjs/dom/nodes/paint/MaskFilters.js +33 -0
- package/lib/commonjs/dom/nodes/paint/MaskFilters.js.map +1 -0
- package/lib/commonjs/dom/nodes/paint/PathEffects.js +223 -0
- package/lib/commonjs/dom/nodes/paint/PathEffects.js.map +1 -0
- package/lib/commonjs/dom/nodes/paint/Shaders.js +242 -0
- package/lib/commonjs/dom/nodes/paint/Shaders.js.map +1 -0
- package/lib/commonjs/dom/nodes/paint/index.js +84 -0
- package/lib/commonjs/dom/nodes/paint/index.js.map +1 -0
- package/lib/commonjs/dom/types/ColorFilters.js +6 -0
- package/lib/commonjs/dom/types/ColorFilters.js.map +1 -0
- package/lib/commonjs/dom/types/Common.js +6 -0
- package/lib/commonjs/dom/types/Common.js.map +1 -0
- package/lib/commonjs/dom/types/DrawingContext.js +6 -0
- package/lib/commonjs/dom/types/DrawingContext.js.map +1 -0
- package/lib/commonjs/dom/types/Drawings.js +6 -0
- package/lib/commonjs/dom/types/Drawings.js.map +1 -0
- package/lib/commonjs/dom/types/ImageFilters.js +6 -0
- package/lib/commonjs/dom/types/ImageFilters.js.map +1 -0
- package/lib/commonjs/dom/types/MaskFilters.js +6 -0
- package/lib/commonjs/dom/types/MaskFilters.js.map +1 -0
- package/lib/commonjs/dom/types/Node.js +6 -0
- package/lib/commonjs/dom/types/Node.js.map +1 -0
- package/lib/commonjs/dom/types/NodeType.js +80 -0
- package/lib/commonjs/dom/types/NodeType.js.map +1 -0
- package/lib/commonjs/dom/types/PathEffects.js +6 -0
- package/lib/commonjs/dom/types/PathEffects.js.map +1 -0
- package/lib/commonjs/dom/types/Shaders.js +6 -0
- package/lib/commonjs/dom/types/Shaders.js.map +1 -0
- package/lib/commonjs/dom/types/SkDOM.js +6 -0
- package/lib/commonjs/dom/types/SkDOM.js.map +1 -0
- package/lib/commonjs/dom/types/index.js +149 -0
- package/lib/commonjs/dom/types/index.js.map +1 -0
- package/lib/commonjs/index.js +26 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/renderer/Canvas.js +7 -3
- package/lib/commonjs/renderer/Canvas.js.map +1 -1
- package/lib/commonjs/renderer/Container.js +39 -0
- package/lib/commonjs/renderer/Container.js.map +1 -0
- package/lib/commonjs/renderer/DependencyManager.js +17 -5
- package/lib/commonjs/renderer/DependencyManager.js.map +1 -1
- package/lib/commonjs/renderer/HostComponents.js +196 -0
- package/lib/commonjs/renderer/HostComponents.js.map +1 -0
- package/lib/commonjs/renderer/HostConfig.js +47 -125
- package/lib/commonjs/renderer/HostConfig.js.map +1 -1
- package/lib/commonjs/renderer/components/Blend.js +1 -46
- package/lib/commonjs/renderer/components/Blend.js.map +1 -1
- package/lib/commonjs/renderer/components/Drawing.js +1 -15
- package/lib/commonjs/renderer/components/Drawing.js.map +1 -1
- package/lib/commonjs/renderer/components/Group.js +1 -69
- package/lib/commonjs/renderer/components/Group.js.map +1 -1
- package/lib/commonjs/renderer/components/Paint.js +2 -14
- package/lib/commonjs/renderer/components/Paint.js.map +1 -1
- package/lib/commonjs/renderer/components/Picture.js +1 -19
- package/lib/commonjs/renderer/components/Picture.js.map +1 -1
- package/lib/commonjs/renderer/components/backdrop/BackdropBlur.js.map +1 -1
- package/lib/commonjs/renderer/components/backdrop/BackdropFilter.js +2 -32
- package/lib/commonjs/renderer/components/backdrop/BackdropFilter.js.map +1 -1
- package/lib/commonjs/renderer/components/colorFilters/BlendColor.js +1 -25
- package/lib/commonjs/renderer/components/colorFilters/BlendColor.js.map +1 -1
- package/lib/commonjs/renderer/components/colorFilters/Lerp.js +1 -23
- package/lib/commonjs/renderer/components/colorFilters/Lerp.js.map +1 -1
- package/lib/commonjs/renderer/components/colorFilters/LinearToSRGBGamma.js +1 -17
- package/lib/commonjs/renderer/components/colorFilters/LinearToSRGBGamma.js.map +1 -1
- package/lib/commonjs/renderer/components/colorFilters/LumaColorFilter.js +1 -17
- package/lib/commonjs/renderer/components/colorFilters/LumaColorFilter.js.map +1 -1
- package/lib/commonjs/renderer/components/colorFilters/Matrix.js +1 -20
- package/lib/commonjs/renderer/components/colorFilters/Matrix.js.map +1 -1
- package/lib/commonjs/renderer/components/colorFilters/SRGBToLinearGamma.js +1 -17
- package/lib/commonjs/renderer/components/colorFilters/SRGBToLinearGamma.js.map +1 -1
- package/lib/commonjs/renderer/components/image/Image.js +1 -35
- package/lib/commonjs/renderer/components/image/Image.js.map +1 -1
- package/lib/commonjs/renderer/components/image/ImageSVG.js +1 -30
- package/lib/commonjs/renderer/components/image/ImageSVG.js.map +1 -1
- package/lib/commonjs/renderer/components/image/ImageShader.js +1 -61
- package/lib/commonjs/renderer/components/image/ImageShader.js.map +1 -1
- package/lib/commonjs/renderer/components/image/index.js +0 -13
- package/lib/commonjs/renderer/components/image/index.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/Blur.js +1 -27
- package/lib/commonjs/renderer/components/imageFilters/Blur.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/DisplacementMap.js +1 -38
- package/lib/commonjs/renderer/components/imageFilters/DisplacementMap.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/Morphology.js +1 -25
- package/lib/commonjs/renderer/components/imageFilters/Morphology.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/Offset.js +1 -20
- package/lib/commonjs/renderer/components/imageFilters/Offset.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/RuntimeShader.js +1 -28
- package/lib/commonjs/renderer/components/imageFilters/RuntimeShader.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/Shadow.js +1 -39
- package/lib/commonjs/renderer/components/imageFilters/Shadow.js.map +1 -1
- package/lib/commonjs/renderer/components/index.js +0 -13
- package/lib/commonjs/renderer/components/index.js.map +1 -1
- package/lib/commonjs/renderer/components/maskFilters/Blur.js +1 -23
- package/lib/commonjs/renderer/components/maskFilters/Blur.js.map +1 -1
- package/lib/commonjs/renderer/components/pathEffects/Corner.js +1 -30
- package/lib/commonjs/renderer/components/pathEffects/Corner.js.map +1 -1
- package/lib/commonjs/renderer/components/pathEffects/Dash.js +1 -27
- package/lib/commonjs/renderer/components/pathEffects/Dash.js.map +1 -1
- package/lib/commonjs/renderer/components/pathEffects/Discrete.js +1 -28
- package/lib/commonjs/renderer/components/pathEffects/Discrete.js.map +1 -1
- package/lib/commonjs/renderer/components/pathEffects/Line2D.js +1 -31
- package/lib/commonjs/renderer/components/pathEffects/Line2D.js.map +1 -1
- package/lib/commonjs/renderer/components/pathEffects/Path1D.js +1 -37
- package/lib/commonjs/renderer/components/pathEffects/Path1D.js.map +1 -1
- package/lib/commonjs/renderer/components/pathEffects/Path2D.js +1 -33
- package/lib/commonjs/renderer/components/pathEffects/Path2D.js.map +1 -1
- package/lib/commonjs/renderer/components/pathEffects/Sum.js +1 -17
- package/lib/commonjs/renderer/components/pathEffects/Sum.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/Color.js +1 -19
- package/lib/commonjs/renderer/components/shaders/Color.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/FractalNoise.js +1 -22
- package/lib/commonjs/renderer/components/shaders/FractalNoise.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/LinearGradient.js +1 -28
- package/lib/commonjs/renderer/components/shaders/LinearGradient.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/RadialGradient.js +1 -28
- package/lib/commonjs/renderer/components/shaders/RadialGradient.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/Shader.js +1 -23
- package/lib/commonjs/renderer/components/shaders/Shader.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/SweepGradient.js +1 -29
- package/lib/commonjs/renderer/components/shaders/SweepGradient.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/Turbulence.js +1 -22
- package/lib/commonjs/renderer/components/shaders/Turbulence.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/TwoPointConicalGradient.js +1 -30
- package/lib/commonjs/renderer/components/shaders/TwoPointConicalGradient.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Box.js +2 -102
- package/lib/commonjs/renderer/components/shapes/Box.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Circle.js +1 -22
- package/lib/commonjs/renderer/components/shapes/Circle.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/DiffRect.js +1 -19
- package/lib/commonjs/renderer/components/shapes/DiffRect.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Fill.js +1 -15
- package/lib/commonjs/renderer/components/shapes/Fill.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/FitBox.js +3 -3
- package/lib/commonjs/renderer/components/shapes/FitBox.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Line.js +1 -19
- package/lib/commonjs/renderer/components/shapes/Line.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Oval.js +1 -19
- package/lib/commonjs/renderer/components/shapes/Oval.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Patch.js +1 -37
- package/lib/commonjs/renderer/components/shapes/Patch.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Path.js +1 -47
- package/lib/commonjs/renderer/components/shapes/Path.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Points.js +1 -26
- package/lib/commonjs/renderer/components/shapes/Points.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Rect.js +1 -19
- package/lib/commonjs/renderer/components/shapes/Rect.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/RoundedRect.js +1 -19
- package/lib/commonjs/renderer/components/shapes/RoundedRect.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Vertices.js +1 -36
- package/lib/commonjs/renderer/components/shapes/Vertices.js.map +1 -1
- package/lib/commonjs/renderer/components/text/Glyphs.js +1 -39
- package/lib/commonjs/renderer/components/text/Glyphs.js.map +1 -1
- package/lib/commonjs/renderer/components/text/Text.js +1 -24
- package/lib/commonjs/renderer/components/text/Text.js.map +1 -1
- package/lib/commonjs/renderer/components/text/TextBlob.js +1 -20
- package/lib/commonjs/renderer/components/text/TextBlob.js.map +1 -1
- package/lib/commonjs/renderer/components/text/TextPath.js +1 -71
- package/lib/commonjs/renderer/components/text/TextPath.js.map +1 -1
- package/lib/commonjs/renderer/index.js +0 -13
- 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/index.js +0 -117
- package/lib/commonjs/renderer/processors/index.js.map +1 -1
- package/lib/commonjs/web/WithSkiaWeb.js +3 -1
- package/lib/commonjs/web/WithSkiaWeb.js.map +1 -1
- package/lib/module/dom/nodes/DrawingNode.js +72 -0
- package/lib/module/dom/nodes/DrawingNode.js.map +1 -0
- package/lib/module/dom/nodes/GroupNode.js +17 -0
- package/lib/module/dom/nodes/GroupNode.js.map +1 -0
- package/lib/module/dom/nodes/JsiSkDOM.js +240 -0
- package/lib/module/dom/nodes/JsiSkDOM.js.map +1 -0
- package/lib/module/dom/nodes/Node.js +145 -0
- package/lib/module/dom/nodes/Node.js.map +1 -0
- package/lib/module/dom/nodes/PaintContext.js +2 -0
- package/lib/module/dom/nodes/PaintContext.js.map +1 -0
- package/lib/module/dom/nodes/PaintNode.js +83 -0
- package/lib/module/dom/nodes/PaintNode.js.map +1 -0
- package/lib/module/dom/nodes/RenderNode.js +329 -0
- package/lib/module/dom/nodes/RenderNode.js.map +1 -0
- package/lib/module/{renderer/processors/Circles.js → dom/nodes/datatypes/Circle.js} +2 -3
- package/lib/module/dom/nodes/datatypes/Circle.js.map +1 -0
- package/lib/module/{renderer/processors → dom/nodes/datatypes}/Color.js +0 -0
- package/lib/module/{renderer/processors → dom/nodes/datatypes}/Color.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Enum.js +2 -0
- package/lib/module/dom/nodes/datatypes/Enum.js.map +1 -0
- package/lib/module/{renderer/components/image/BoxFit.js → dom/nodes/datatypes/Fitting.js} +2 -2
- package/lib/module/{renderer/components/image/BoxFit.js.map → dom/nodes/datatypes/Fitting.js.map} +1 -1
- package/lib/module/dom/nodes/datatypes/Gradient.js +47 -0
- package/lib/module/dom/nodes/datatypes/Gradient.js.map +1 -0
- package/lib/module/{renderer/processors/Paths.js → dom/nodes/datatypes/Path.js} +2 -2
- package/lib/module/dom/nodes/datatypes/Path.js.map +1 -0
- package/lib/module/{renderer/processors → dom/nodes/datatypes}/Radius.js +0 -0
- package/lib/module/dom/nodes/datatypes/Radius.js.map +1 -0
- package/lib/module/{renderer/processors/Rects.js → dom/nodes/datatypes/Rect.js} +1 -1
- package/lib/module/dom/nodes/datatypes/Rect.js.map +1 -0
- package/lib/module/dom/nodes/datatypes/Transform.js +32 -0
- package/lib/module/dom/nodes/datatypes/Transform.js.map +1 -0
- package/lib/module/dom/nodes/datatypes/index.js +10 -0
- package/lib/module/dom/nodes/datatypes/index.js.map +1 -0
- package/lib/module/dom/nodes/drawings/BackdropFilterNode.js +25 -0
- package/lib/module/dom/nodes/drawings/BackdropFilterNode.js.map +1 -0
- package/lib/module/dom/nodes/drawings/Box.js +89 -0
- package/lib/module/dom/nodes/drawings/Box.js.map +1 -0
- package/lib/module/dom/nodes/drawings/CircleNode.js +31 -0
- package/lib/module/dom/nodes/drawings/CircleNode.js.map +1 -0
- package/lib/module/dom/nodes/drawings/CustomDrawingNode.js +17 -0
- package/lib/module/dom/nodes/drawings/CustomDrawingNode.js.map +1 -0
- package/lib/module/dom/nodes/drawings/DiffRectNode.js +25 -0
- package/lib/module/dom/nodes/drawings/DiffRectNode.js.map +1 -0
- package/lib/module/dom/nodes/drawings/FillNode.js +22 -0
- package/lib/module/dom/nodes/drawings/FillNode.js.map +1 -0
- package/lib/module/dom/nodes/drawings/ImageNode.js +51 -0
- package/lib/module/dom/nodes/drawings/ImageNode.js.map +1 -0
- package/lib/module/dom/nodes/drawings/ImageSVG.js +33 -0
- package/lib/module/dom/nodes/drawings/ImageSVG.js.map +1 -0
- package/lib/module/dom/nodes/drawings/LineNode.js +25 -0
- package/lib/module/dom/nodes/drawings/LineNode.js.map +1 -0
- package/lib/module/dom/nodes/drawings/OvalNode.js +27 -0
- package/lib/module/dom/nodes/drawings/OvalNode.js.map +1 -0
- package/lib/module/dom/nodes/drawings/PatchNode.js +56 -0
- package/lib/module/dom/nodes/drawings/PatchNode.js.map +1 -0
- package/lib/module/dom/nodes/drawings/PathNode.js +55 -0
- package/lib/module/dom/nodes/drawings/PathNode.js.map +1 -0
- package/lib/module/dom/nodes/drawings/PictureNode.js +23 -0
- package/lib/module/dom/nodes/drawings/PictureNode.js.map +1 -0
- package/lib/module/dom/nodes/drawings/PointsNode.js +27 -0
- package/lib/module/dom/nodes/drawings/PointsNode.js.map +1 -0
- package/lib/module/dom/nodes/drawings/RRectNode.js +31 -0
- package/lib/module/dom/nodes/drawings/RRectNode.js.map +1 -0
- package/lib/module/dom/nodes/drawings/RectNode.js +27 -0
- package/lib/module/dom/nodes/drawings/RectNode.js.map +1 -0
- package/lib/module/dom/nodes/drawings/Text.js +164 -0
- package/lib/module/dom/nodes/drawings/Text.js.map +1 -0
- package/lib/module/dom/nodes/drawings/VerticesNode.js +42 -0
- package/lib/module/dom/nodes/drawings/VerticesNode.js.map +1 -0
- package/lib/module/dom/nodes/drawings/index.js +19 -0
- package/lib/module/dom/nodes/drawings/index.js.map +1 -0
- package/lib/module/dom/nodes/index.js +4 -0
- package/lib/module/dom/nodes/index.js.map +1 -0
- package/lib/module/dom/nodes/paint/BlendNode.js +66 -0
- package/lib/module/dom/nodes/paint/BlendNode.js.map +1 -0
- package/lib/module/dom/nodes/paint/ColorFilters.js +120 -0
- package/lib/module/dom/nodes/paint/ColorFilters.js.map +1 -0
- package/lib/module/dom/nodes/paint/ImageFilters.js +191 -0
- package/lib/module/dom/nodes/paint/ImageFilters.js.map +1 -0
- package/lib/module/dom/nodes/paint/MaskFilters.js +20 -0
- package/lib/module/dom/nodes/paint/MaskFilters.js.map +1 -0
- package/lib/module/dom/nodes/paint/PathEffects.js +192 -0
- package/lib/module/dom/nodes/paint/PathEffects.js.map +1 -0
- package/lib/module/dom/nodes/paint/Shaders.js +201 -0
- package/lib/module/dom/nodes/paint/Shaders.js.map +1 -0
- package/lib/module/dom/nodes/paint/index.js +7 -0
- package/lib/module/dom/nodes/paint/index.js.map +1 -0
- package/lib/module/dom/types/ColorFilters.js +2 -0
- package/lib/module/dom/types/ColorFilters.js.map +1 -0
- package/lib/module/dom/types/Common.js +2 -0
- package/lib/module/dom/types/Common.js.map +1 -0
- package/lib/module/dom/types/DrawingContext.js +2 -0
- package/lib/module/dom/types/DrawingContext.js.map +1 -0
- package/lib/module/dom/types/Drawings.js +2 -0
- package/lib/module/dom/types/Drawings.js.map +1 -0
- package/lib/module/dom/types/ImageFilters.js +2 -0
- package/lib/module/dom/types/ImageFilters.js.map +1 -0
- package/lib/module/dom/types/MaskFilters.js +2 -0
- package/lib/module/dom/types/MaskFilters.js.map +1 -0
- package/lib/module/dom/types/Node.js +2 -0
- package/lib/module/dom/types/Node.js.map +1 -0
- package/lib/module/dom/types/NodeType.js +72 -0
- package/lib/module/dom/types/NodeType.js.map +1 -0
- package/lib/module/dom/types/PathEffects.js +2 -0
- package/lib/module/dom/types/PathEffects.js.map +1 -0
- package/lib/module/dom/types/Shaders.js +2 -0
- package/lib/module/dom/types/Shaders.js.map +1 -0
- package/lib/module/dom/types/SkDOM.js +2 -0
- package/lib/module/dom/types/SkDOM.js.map +1 -0
- package/lib/module/dom/types/index.js +12 -0
- package/lib/module/dom/types/index.js.map +1 -0
- package/lib/module/index.js +2 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/renderer/Canvas.js +7 -3
- package/lib/module/renderer/Canvas.js.map +1 -1
- package/lib/module/renderer/Container.js +29 -0
- package/lib/module/renderer/Container.js.map +1 -0
- package/lib/module/renderer/DependencyManager.js +17 -5
- package/lib/module/renderer/DependencyManager.js.map +1 -1
- package/lib/module/renderer/HostComponents.js +185 -0
- package/lib/module/renderer/HostComponents.js.map +1 -0
- package/lib/module/renderer/HostConfig.js +47 -126
- package/lib/module/renderer/HostConfig.js.map +1 -1
- package/lib/module/renderer/components/Blend.js +1 -42
- package/lib/module/renderer/components/Blend.js.map +1 -1
- package/lib/module/renderer/components/Drawing.js +1 -13
- package/lib/module/renderer/components/Drawing.js.map +1 -1
- package/lib/module/renderer/components/Group.js +1 -65
- package/lib/module/renderer/components/Group.js.map +1 -1
- package/lib/module/renderer/components/Paint.js +3 -12
- package/lib/module/renderer/components/Paint.js.map +1 -1
- package/lib/module/renderer/components/Picture.js +1 -17
- package/lib/module/renderer/components/Picture.js.map +1 -1
- package/lib/module/renderer/components/backdrop/BackdropBlur.js.map +1 -1
- package/lib/module/renderer/components/backdrop/BackdropFilter.js +2 -30
- package/lib/module/renderer/components/backdrop/BackdropFilter.js.map +1 -1
- package/lib/module/renderer/components/colorFilters/BlendColor.js +1 -20
- package/lib/module/renderer/components/colorFilters/BlendColor.js.map +1 -1
- package/lib/module/renderer/components/colorFilters/Lerp.js +1 -19
- package/lib/module/renderer/components/colorFilters/Lerp.js.map +1 -1
- package/lib/module/renderer/components/colorFilters/LinearToSRGBGamma.js +1 -15
- package/lib/module/renderer/components/colorFilters/LinearToSRGBGamma.js.map +1 -1
- package/lib/module/renderer/components/colorFilters/LumaColorFilter.js +1 -15
- package/lib/module/renderer/components/colorFilters/LumaColorFilter.js.map +1 -1
- package/lib/module/renderer/components/colorFilters/Matrix.js +1 -17
- package/lib/module/renderer/components/colorFilters/Matrix.js.map +1 -1
- package/lib/module/renderer/components/colorFilters/SRGBToLinearGamma.js +1 -15
- package/lib/module/renderer/components/colorFilters/SRGBToLinearGamma.js.map +1 -1
- package/lib/module/renderer/components/image/Image.js +1 -31
- package/lib/module/renderer/components/image/Image.js.map +1 -1
- package/lib/module/renderer/components/image/ImageSVG.js +1 -27
- package/lib/module/renderer/components/image/ImageSVG.js.map +1 -1
- package/lib/module/renderer/components/image/ImageShader.js +1 -57
- package/lib/module/renderer/components/image/ImageShader.js.map +1 -1
- package/lib/module/renderer/components/image/index.js +0 -1
- package/lib/module/renderer/components/image/index.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/Blur.js +1 -21
- package/lib/module/renderer/components/imageFilters/Blur.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/DisplacementMap.js +1 -30
- package/lib/module/renderer/components/imageFilters/DisplacementMap.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/Morphology.js +1 -21
- package/lib/module/renderer/components/imageFilters/Morphology.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/Offset.js +1 -17
- package/lib/module/renderer/components/imageFilters/Offset.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/RuntimeShader.js +1 -24
- package/lib/module/renderer/components/imageFilters/RuntimeShader.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/Shadow.js +1 -34
- package/lib/module/renderer/components/imageFilters/Shadow.js.map +1 -1
- package/lib/module/renderer/components/index.js +0 -1
- package/lib/module/renderer/components/index.js.map +1 -1
- package/lib/module/renderer/components/maskFilters/Blur.js +1 -19
- package/lib/module/renderer/components/maskFilters/Blur.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/Corner.js +1 -27
- package/lib/module/renderer/components/pathEffects/Corner.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/Dash.js +1 -24
- package/lib/module/renderer/components/pathEffects/Dash.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/Discrete.js +1 -25
- package/lib/module/renderer/components/pathEffects/Discrete.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/Line2D.js +1 -28
- package/lib/module/renderer/components/pathEffects/Line2D.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/Path1D.js +1 -32
- package/lib/module/renderer/components/pathEffects/Path1D.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/Path2D.js +1 -29
- package/lib/module/renderer/components/pathEffects/Path2D.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/Sum.js +1 -14
- package/lib/module/renderer/components/pathEffects/Sum.js.map +1 -1
- package/lib/module/renderer/components/shaders/Color.js +1 -16
- package/lib/module/renderer/components/shaders/Color.js.map +1 -1
- package/lib/module/renderer/components/shaders/FractalNoise.js +1 -20
- package/lib/module/renderer/components/shaders/FractalNoise.js.map +1 -1
- package/lib/module/renderer/components/shaders/LinearGradient.js +1 -25
- package/lib/module/renderer/components/shaders/LinearGradient.js.map +1 -1
- package/lib/module/renderer/components/shaders/RadialGradient.js +1 -25
- package/lib/module/renderer/components/shaders/RadialGradient.js.map +1 -1
- package/lib/module/renderer/components/shaders/Shader.js +1 -19
- package/lib/module/renderer/components/shaders/Shader.js.map +1 -1
- package/lib/module/renderer/components/shaders/SweepGradient.js +1 -26
- package/lib/module/renderer/components/shaders/SweepGradient.js.map +1 -1
- package/lib/module/renderer/components/shaders/Turbulence.js +1 -20
- package/lib/module/renderer/components/shaders/Turbulence.js.map +1 -1
- package/lib/module/renderer/components/shaders/TwoPointConicalGradient.js +1 -27
- package/lib/module/renderer/components/shaders/TwoPointConicalGradient.js.map +1 -1
- package/lib/module/renderer/components/shapes/Box.js +2 -97
- package/lib/module/renderer/components/shapes/Box.js.map +1 -1
- package/lib/module/renderer/components/shapes/Circle.js +1 -19
- package/lib/module/renderer/components/shapes/Circle.js.map +1 -1
- package/lib/module/renderer/components/shapes/DiffRect.js +1 -17
- package/lib/module/renderer/components/shapes/DiffRect.js.map +1 -1
- package/lib/module/renderer/components/shapes/Fill.js +1 -13
- package/lib/module/renderer/components/shapes/Fill.js.map +1 -1
- package/lib/module/renderer/components/shapes/FitBox.js +1 -1
- package/lib/module/renderer/components/shapes/FitBox.js.map +1 -1
- package/lib/module/renderer/components/shapes/Line.js +1 -17
- package/lib/module/renderer/components/shapes/Line.js.map +1 -1
- package/lib/module/renderer/components/shapes/Oval.js +1 -16
- package/lib/module/renderer/components/shapes/Oval.js.map +1 -1
- package/lib/module/renderer/components/shapes/Patch.js +1 -32
- package/lib/module/renderer/components/shapes/Patch.js.map +1 -1
- package/lib/module/renderer/components/shapes/Path.js +1 -43
- package/lib/module/renderer/components/shapes/Path.js.map +1 -1
- package/lib/module/renderer/components/shapes/Points.js +1 -20
- package/lib/module/renderer/components/shapes/Points.js.map +1 -1
- package/lib/module/renderer/components/shapes/Rect.js +1 -16
- package/lib/module/renderer/components/shapes/Rect.js.map +1 -1
- package/lib/module/renderer/components/shapes/RoundedRect.js +1 -16
- package/lib/module/renderer/components/shapes/RoundedRect.js.map +1 -1
- package/lib/module/renderer/components/shapes/Vertices.js +1 -31
- package/lib/module/renderer/components/shapes/Vertices.js.map +1 -1
- package/lib/module/renderer/components/text/Glyphs.js +1 -37
- package/lib/module/renderer/components/text/Glyphs.js.map +1 -1
- package/lib/module/renderer/components/text/Text.js +1 -22
- package/lib/module/renderer/components/text/Text.js.map +1 -1
- package/lib/module/renderer/components/text/TextBlob.js +1 -18
- package/lib/module/renderer/components/text/TextBlob.js.map +1 -1
- package/lib/module/renderer/components/text/TextPath.js +1 -69
- package/lib/module/renderer/components/text/TextPath.js.map +1 -1
- package/lib/module/renderer/index.js +0 -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/index.js +0 -9
- package/lib/module/renderer/processors/index.js.map +1 -1
- package/lib/module/web/WithSkiaWeb.js +3 -1
- package/lib/module/web/WithSkiaWeb.js.map +1 -1
- package/lib/typescript/src/dom/nodes/DrawingNode.d.ts +14 -0
- package/lib/typescript/src/dom/nodes/GroupNode.d.ts +8 -0
- package/lib/typescript/src/dom/nodes/JsiSkDOM.d.ts +70 -0
- package/lib/typescript/src/dom/nodes/Node.d.ts +43 -0
- package/lib/typescript/src/dom/nodes/PaintContext.d.ts +18 -0
- package/lib/typescript/src/dom/nodes/PaintNode.d.ts +8 -0
- package/lib/typescript/src/dom/nodes/RenderNode.d.ts +29 -0
- package/lib/typescript/src/dom/nodes/datatypes/Circle.d.ts +4 -0
- package/lib/typescript/src/{renderer/processors → dom/nodes/datatypes}/Color.d.ts +1 -1
- package/lib/typescript/src/dom/nodes/datatypes/Enum.d.ts +1 -0
- package/lib/typescript/src/{renderer/components/image/BoxFit.d.ts → dom/nodes/datatypes/Fitting.d.ts} +1 -1
- package/lib/typescript/src/{renderer/processors/Transform.d.ts → dom/nodes/datatypes/Gradient.d.ts} +11 -9
- package/lib/typescript/src/dom/nodes/datatypes/Path.d.ts +4 -0
- package/lib/typescript/src/dom/nodes/datatypes/Radius.d.ts +3 -0
- package/lib/typescript/src/dom/nodes/datatypes/Rect.d.ts +5 -0
- package/lib/typescript/src/dom/nodes/datatypes/Transform.d.ts +3 -0
- package/lib/typescript/src/dom/nodes/datatypes/index.d.ts +9 -0
- package/lib/typescript/src/dom/nodes/drawings/BackdropFilterNode.d.ts +8 -0
- package/lib/typescript/src/dom/nodes/drawings/Box.d.ts +13 -0
- package/lib/typescript/src/dom/nodes/drawings/CircleNode.d.ts +9 -0
- package/lib/typescript/src/dom/nodes/drawings/CustomDrawingNode.d.ts +8 -0
- package/lib/typescript/src/dom/nodes/drawings/DiffRectNode.d.ts +8 -0
- package/lib/typescript/src/dom/nodes/drawings/FillNode.d.ts +8 -0
- package/lib/typescript/src/dom/nodes/drawings/ImageNode.d.ts +25 -0
- package/lib/typescript/src/dom/nodes/drawings/ImageSVG.d.ts +8 -0
- package/lib/typescript/src/dom/nodes/drawings/LineNode.d.ts +8 -0
- package/lib/typescript/src/dom/nodes/drawings/OvalNode.d.ts +9 -0
- package/lib/typescript/src/dom/nodes/drawings/PatchNode.d.ts +18 -0
- package/lib/typescript/src/dom/nodes/drawings/PathNode.d.ts +9 -0
- package/lib/typescript/src/dom/nodes/drawings/PictureNode.d.ts +8 -0
- package/lib/typescript/src/dom/nodes/drawings/PointsNode.d.ts +8 -0
- package/lib/typescript/src/dom/nodes/drawings/RRectNode.d.ts +10 -0
- package/lib/typescript/src/dom/nodes/drawings/RectNode.d.ts +9 -0
- package/lib/typescript/src/dom/nodes/drawings/Text.d.ts +30 -0
- package/lib/typescript/src/dom/nodes/drawings/VerticesNode.d.ts +9 -0
- package/lib/typescript/src/dom/nodes/drawings/index.d.ts +18 -0
- package/lib/typescript/src/dom/nodes/index.d.ts +3 -0
- package/lib/typescript/src/dom/nodes/paint/BlendNode.d.ts +12 -0
- package/lib/typescript/src/dom/nodes/paint/ColorFilters.d.ts +36 -0
- package/lib/typescript/src/dom/nodes/paint/ImageFilters.d.ts +42 -0
- package/lib/typescript/src/dom/nodes/paint/MaskFilters.d.ts +8 -0
- package/lib/typescript/src/dom/nodes/paint/PathEffects.d.ts +42 -0
- package/lib/typescript/src/dom/nodes/paint/Shaders.d.ts +44 -0
- package/lib/typescript/src/dom/nodes/paint/index.d.ts +6 -0
- package/lib/typescript/src/dom/types/ColorFilters.d.ts +12 -0
- package/lib/typescript/src/dom/types/Common.d.ts +57 -0
- package/lib/typescript/src/dom/types/DrawingContext.d.ts +6 -0
- package/lib/typescript/src/dom/types/Drawings.d.ts +106 -0
- package/lib/typescript/src/dom/types/ImageFilters.d.ts +37 -0
- package/lib/typescript/src/dom/types/MaskFilters.d.ts +7 -0
- package/lib/typescript/src/dom/types/Node.d.ts +29 -0
- package/lib/typescript/src/dom/types/NodeType.d.ts +66 -0
- package/lib/typescript/src/dom/types/PathEffects.d.ts +28 -0
- package/lib/typescript/src/dom/types/Shaders.d.ts +59 -0
- package/lib/typescript/src/dom/types/SkDOM.d.ts +71 -0
- package/lib/typescript/src/dom/types/index.d.ts +11 -0
- package/lib/typescript/src/index.d.ts +2 -0
- package/lib/typescript/src/renderer/Canvas.d.ts +3 -3
- package/lib/typescript/src/renderer/Container.d.ts +12 -0
- package/lib/typescript/src/renderer/DependencyManager.d.ts +5 -4
- package/lib/typescript/src/renderer/HostComponents.d.ts +72 -0
- package/lib/typescript/src/renderer/HostConfig.d.ts +5 -13
- package/lib/typescript/src/renderer/components/Blend.d.ts +4 -9
- package/lib/typescript/src/renderer/components/Drawing.d.ts +2 -6
- package/lib/typescript/src/renderer/components/Group.d.ts +4 -9
- package/lib/typescript/src/renderer/components/Paint.d.ts +4 -8
- package/lib/typescript/src/renderer/components/Picture.d.ts +3 -5
- package/lib/typescript/src/renderer/components/backdrop/BackdropBlur.d.ts +2 -1
- package/lib/typescript/src/renderer/components/backdrop/BackdropFilter.d.ts +3 -3
- package/lib/typescript/src/renderer/components/colorFilters/BlendColor.d.ts +4 -10
- package/lib/typescript/src/renderer/components/colorFilters/Lerp.d.ts +4 -7
- package/lib/typescript/src/renderer/components/colorFilters/LinearToSRGBGamma.d.ts +3 -4
- package/lib/typescript/src/renderer/components/colorFilters/LumaColorFilter.d.ts +3 -4
- package/lib/typescript/src/renderer/components/colorFilters/Matrix.d.ts +4 -8
- package/lib/typescript/src/renderer/components/colorFilters/SRGBToLinearGamma.d.ts +3 -4
- package/lib/typescript/src/renderer/components/image/Image.d.ts +3 -11
- package/lib/typescript/src/renderer/components/image/ImageSVG.d.ts +2 -5
- package/lib/typescript/src/renderer/components/image/ImageShader.d.ts +3 -15
- package/lib/typescript/src/renderer/components/image/index.d.ts +0 -1
- package/lib/typescript/src/renderer/components/imageFilters/Blur.d.ts +4 -10
- package/lib/typescript/src/renderer/components/imageFilters/DisplacementMap.d.ts +4 -10
- package/lib/typescript/src/renderer/components/imageFilters/Morphology.d.ts +4 -8
- package/lib/typescript/src/renderer/components/imageFilters/Offset.d.ts +4 -8
- package/lib/typescript/src/renderer/components/imageFilters/RuntimeShader.d.ts +3 -7
- package/lib/typescript/src/renderer/components/imageFilters/Shadow.d.ts +3 -11
- package/lib/typescript/src/renderer/components/index.d.ts +0 -1
- package/lib/typescript/src/renderer/components/maskFilters/Blur.d.ts +3 -9
- package/lib/typescript/src/renderer/components/pathEffects/Corner.d.ts +4 -7
- package/lib/typescript/src/renderer/components/pathEffects/Dash.d.ts +4 -8
- package/lib/typescript/src/renderer/components/pathEffects/Discrete.d.ts +4 -9
- package/lib/typescript/src/renderer/components/pathEffects/Line2D.d.ts +4 -9
- package/lib/typescript/src/renderer/components/pathEffects/Path1D.d.ts +4 -13
- package/lib/typescript/src/renderer/components/pathEffects/Path2D.d.ts +4 -10
- package/lib/typescript/src/renderer/components/pathEffects/Sum.d.ts +3 -6
- package/lib/typescript/src/renderer/components/shaders/Color.d.ts +3 -6
- package/lib/typescript/src/renderer/components/shaders/FractalNoise.d.ts +3 -10
- package/lib/typescript/src/renderer/components/shaders/LinearGradient.d.ts +3 -8
- package/lib/typescript/src/renderer/components/shaders/RadialGradient.d.ts +3 -8
- package/lib/typescript/src/renderer/components/shaders/Shader.d.ts +4 -9
- package/lib/typescript/src/renderer/components/shaders/SweepGradient.d.ts +3 -9
- package/lib/typescript/src/renderer/components/shaders/Turbulence.d.ts +3 -10
- package/lib/typescript/src/renderer/components/shaders/TwoPointConicalGradient.d.ts +3 -10
- package/lib/typescript/src/renderer/components/shapes/Box.d.ts +4 -21
- package/lib/typescript/src/renderer/components/shapes/Circle.d.ts +3 -3
- package/lib/typescript/src/renderer/components/shapes/DiffRect.d.ts +3 -8
- package/lib/typescript/src/renderer/components/shapes/Fill.d.ts +3 -4
- package/lib/typescript/src/renderer/components/shapes/FitBox.d.ts +1 -1
- package/lib/typescript/src/renderer/components/shapes/Line.d.ts +3 -7
- package/lib/typescript/src/renderer/components/shapes/Oval.d.ts +3 -3
- package/lib/typescript/src/renderer/components/shapes/Patch.d.ts +3 -20
- package/lib/typescript/src/renderer/components/shapes/Path.d.ts +3 -16
- package/lib/typescript/src/renderer/components/shapes/Points.d.ts +3 -9
- package/lib/typescript/src/renderer/components/shapes/Rect.d.ts +3 -3
- package/lib/typescript/src/renderer/components/shapes/RoundedRect.d.ts +3 -3
- package/lib/typescript/src/renderer/components/shapes/Vertices.d.ts +3 -12
- package/lib/typescript/src/renderer/components/text/Glyphs.d.ts +3 -13
- package/lib/typescript/src/renderer/components/text/Text.d.ts +3 -8
- package/lib/typescript/src/renderer/components/text/TextBlob.d.ts +3 -8
- package/lib/typescript/src/renderer/components/text/TextPath.d.ts +3 -9
- package/lib/typescript/src/renderer/index.d.ts +0 -1
- package/lib/typescript/src/renderer/processors/Animations/Animations.d.ts +1 -0
- package/lib/typescript/src/renderer/processors/index.d.ts +0 -9
- package/package.json +1 -1
- package/src/dom/nodes/DrawingNode.ts +72 -0
- package/src/dom/nodes/GroupNode.ts +23 -0
- package/src/dom/nodes/JsiSkDOM.ts +353 -0
- package/src/dom/nodes/Node.ts +158 -0
- package/src/dom/nodes/PaintContext.ts +30 -0
- package/src/dom/nodes/PaintNode.ts +77 -0
- package/src/dom/nodes/RenderNode.ts +349 -0
- package/src/{renderer/processors/Circles.ts → dom/nodes/datatypes/Circle.ts} +3 -15
- package/src/{renderer/processors → dom/nodes/datatypes}/Color.ts +1 -1
- package/src/dom/nodes/datatypes/Enum.ts +2 -0
- package/src/{renderer/components/image/BoxFit.ts → dom/nodes/datatypes/Fitting.ts} +2 -11
- package/src/dom/nodes/datatypes/Gradient.ts +48 -0
- package/src/{renderer/processors/Paths.ts → dom/nodes/datatypes/Path.ts} +3 -4
- package/src/{renderer/processors → dom/nodes/datatypes}/Radius.ts +2 -3
- package/src/{renderer/processors/Rects.ts → dom/nodes/datatypes/Rect.ts} +2 -16
- package/src/dom/nodes/datatypes/Transform.ts +26 -0
- package/src/dom/nodes/datatypes/index.ts +9 -0
- package/src/dom/nodes/drawings/BackdropFilterNode.ts +30 -0
- package/src/dom/nodes/drawings/Box.ts +105 -0
- package/src/dom/nodes/drawings/CircleNode.ts +24 -0
- package/src/dom/nodes/drawings/CustomDrawingNode.ts +21 -0
- package/src/dom/nodes/drawings/DiffRectNode.ts +19 -0
- package/src/dom/nodes/drawings/FillNode.ts +18 -0
- package/src/dom/nodes/drawings/ImageNode.ts +40 -0
- package/src/dom/nodes/drawings/ImageSVG.ts +24 -0
- package/src/dom/nodes/drawings/LineNode.ts +19 -0
- package/src/dom/nodes/drawings/OvalNode.ts +23 -0
- package/src/dom/nodes/drawings/PatchNode.ts +68 -0
- package/src/dom/nodes/drawings/PathNode.ts +42 -0
- package/src/dom/nodes/drawings/PictureNode.ts +19 -0
- package/src/dom/nodes/drawings/PointsNode.ts +21 -0
- package/src/dom/nodes/drawings/RRectNode.ts +25 -0
- package/src/dom/nodes/drawings/RectNode.ts +23 -0
- package/src/dom/nodes/drawings/Text.ts +122 -0
- package/src/dom/nodes/drawings/VerticesNode.ts +35 -0
- package/src/dom/nodes/drawings/index.ts +18 -0
- package/src/dom/nodes/index.ts +3 -0
- package/src/dom/nodes/paint/BlendNode.ts +79 -0
- package/src/dom/nodes/paint/ColorFilters.ts +130 -0
- package/src/dom/nodes/paint/ImageFilters.ts +210 -0
- package/src/dom/nodes/paint/MaskFilters.ts +25 -0
- package/src/dom/nodes/paint/PathEffects.ts +192 -0
- package/src/dom/nodes/paint/Shaders.ts +228 -0
- package/src/dom/nodes/paint/index.ts +6 -0
- package/src/dom/types/ColorFilters.ts +16 -0
- package/src/dom/types/Common.ts +90 -0
- package/src/dom/types/DrawingContext.ts +7 -0
- package/src/dom/types/Drawings.ts +157 -0
- package/src/dom/types/ImageFilters.ts +53 -0
- package/src/dom/types/MaskFilters.ts +9 -0
- package/src/dom/types/Node.ts +46 -0
- package/src/dom/types/NodeType.ts +80 -0
- package/src/dom/types/PathEffects.ts +35 -0
- package/src/dom/types/Shaders.ts +86 -0
- package/src/dom/types/SkDOM.ts +202 -0
- package/src/dom/types/index.ts +11 -0
- package/src/index.ts +2 -0
- package/src/renderer/Canvas.tsx +7 -6
- package/src/renderer/Container.tsx +31 -0
- package/src/renderer/DependencyManager.tsx +23 -15
- package/src/renderer/HostComponents.ts +269 -0
- package/src/renderer/HostConfig.ts +60 -123
- package/src/renderer/components/Blend.tsx +4 -45
- package/src/renderer/components/Drawing.tsx +3 -12
- package/src/renderer/components/Group.tsx +4 -79
- package/src/renderer/components/Paint.tsx +7 -24
- package/src/renderer/components/Picture.tsx +4 -13
- package/src/renderer/components/backdrop/BackdropBlur.tsx +2 -1
- package/src/renderer/components/backdrop/BackdropFilter.tsx +5 -29
- package/src/renderer/components/colorFilters/BlendColor.tsx +4 -26
- package/src/renderer/components/colorFilters/Lerp.tsx +4 -23
- package/src/renderer/components/colorFilters/LinearToSRGBGamma.tsx +4 -16
- package/src/renderer/components/colorFilters/LumaColorFilter.tsx +4 -14
- package/src/renderer/components/colorFilters/Matrix.tsx +4 -19
- package/src/renderer/components/colorFilters/SRGBToLinearGamma.tsx +4 -16
- package/src/renderer/components/image/Image.tsx +4 -40
- package/src/renderer/components/image/ImageSVG.tsx +3 -19
- package/src/renderer/components/image/ImageShader.tsx +4 -69
- package/src/renderer/components/image/index.ts +0 -1
- package/src/renderer/components/imageFilters/Blur.tsx +4 -29
- package/src/renderer/components/imageFilters/DisplacementMap.tsx +6 -30
- package/src/renderer/components/imageFilters/Morphology.tsx +4 -25
- package/src/renderer/components/imageFilters/Offset.tsx +4 -19
- package/src/renderer/components/imageFilters/RuntimeShader.tsx +6 -27
- package/src/renderer/components/imageFilters/Shadow.tsx +4 -38
- package/src/renderer/components/index.ts +0 -1
- package/src/renderer/components/maskFilters/Blur.tsx +4 -23
- package/src/renderer/components/pathEffects/Corner.tsx +4 -27
- package/src/renderer/components/pathEffects/Dash.tsx +4 -23
- package/src/renderer/components/pathEffects/Discrete.tsx +4 -24
- package/src/renderer/components/pathEffects/Line2D.tsx +4 -29
- package/src/renderer/components/pathEffects/Path1D.tsx +4 -39
- package/src/renderer/components/pathEffects/Path2D.tsx +4 -31
- package/src/renderer/components/pathEffects/Sum.tsx +3 -17
- package/src/renderer/components/shaders/Color.tsx +4 -16
- package/src/renderer/components/shaders/FractalNoise.tsx +4 -26
- package/src/renderer/components/shaders/LinearGradient.tsx +4 -29
- package/src/renderer/components/shaders/RadialGradient.tsx +4 -29
- package/src/renderer/components/shaders/Shader.tsx +4 -24
- package/src/renderer/components/shaders/SweepGradient.tsx +4 -32
- package/src/renderer/components/shaders/Turbulence.tsx +4 -26
- package/src/renderer/components/shaders/TwoPointConicalGradient.tsx +4 -33
- package/src/renderer/components/shapes/Box.tsx +6 -109
- package/src/renderer/components/shapes/Circle.tsx +4 -16
- package/src/renderer/components/shapes/DiffRect.tsx +4 -17
- package/src/renderer/components/shapes/Fill.tsx +4 -11
- package/src/renderer/components/shapes/FitBox.tsx +2 -2
- package/src/renderer/components/shapes/Line.tsx +4 -13
- package/src/renderer/components/shapes/Oval.tsx +4 -18
- package/src/renderer/components/shapes/Patch.tsx +4 -59
- package/src/renderer/components/shapes/Path.tsx +4 -48
- package/src/renderer/components/shapes/Points.tsx +4 -20
- package/src/renderer/components/shapes/Rect.tsx +4 -18
- package/src/renderer/components/shapes/RoundedRect.tsx +4 -17
- package/src/renderer/components/shapes/Vertices.tsx +4 -37
- package/src/renderer/components/text/Glyphs.tsx +4 -39
- package/src/renderer/components/text/Text.tsx +4 -22
- package/src/renderer/components/text/TextBlob.tsx +4 -17
- package/src/renderer/components/text/TextPath.tsx +4 -59
- package/src/renderer/index.ts +0 -1
- package/src/renderer/processors/Animations/Animations.ts +5 -0
- package/src/renderer/processors/index.ts +0 -9
- package/src/web/WithSkiaWeb.tsx +3 -1
- package/lib/commonjs/renderer/components/Compose.js +0 -40
- package/lib/commonjs/renderer/components/Compose.js.map +0 -1
- package/lib/commonjs/renderer/components/colorFilters/Compose.js +0 -24
- package/lib/commonjs/renderer/components/colorFilters/Compose.js.map +0 -1
- package/lib/commonjs/renderer/components/imageFilters/InnerShadow.js +0 -28
- package/lib/commonjs/renderer/components/imageFilters/InnerShadow.js.map +0 -1
- package/lib/commonjs/renderer/components/imageFilters/getInput.js +0 -33
- package/lib/commonjs/renderer/components/imageFilters/getInput.js.map +0 -1
- package/lib/commonjs/renderer/components/shaders/Gradient.js +0 -32
- package/lib/commonjs/renderer/components/shaders/Gradient.js.map +0 -1
- package/lib/commonjs/renderer/nodes/Container.js +0 -28
- package/lib/commonjs/renderer/nodes/Container.js.map +0 -1
- package/lib/commonjs/renderer/nodes/Declaration.js +0 -57
- package/lib/commonjs/renderer/nodes/Declaration.js.map +0 -1
- package/lib/commonjs/renderer/nodes/Drawing.js +0 -56
- package/lib/commonjs/renderer/nodes/Drawing.js.map +0 -1
- package/lib/commonjs/renderer/nodes/Node.js +0 -73
- package/lib/commonjs/renderer/nodes/Node.js.map +0 -1
- package/lib/commonjs/renderer/nodes/index.js +0 -58
- package/lib/commonjs/renderer/nodes/index.js.map +0 -1
- package/lib/commonjs/renderer/processors/Circles.js.map +0 -1
- package/lib/commonjs/renderer/processors/Clips.js +0 -24
- package/lib/commonjs/renderer/processors/Clips.js.map +0 -1
- package/lib/commonjs/renderer/processors/Font.js +0 -13
- package/lib/commonjs/renderer/processors/Font.js.map +0 -1
- package/lib/commonjs/renderer/processors/Paint.js +0 -98
- package/lib/commonjs/renderer/processors/Paint.js.map +0 -1
- package/lib/commonjs/renderer/processors/Paths.js.map +0 -1
- package/lib/commonjs/renderer/processors/Radius.js.map +0 -1
- package/lib/commonjs/renderer/processors/Rects.js.map +0 -1
- package/lib/commonjs/renderer/processors/Transform.js +0 -58
- package/lib/commonjs/renderer/processors/Transform.js.map +0 -1
- package/lib/module/renderer/components/Compose.js +0 -25
- package/lib/module/renderer/components/Compose.js.map +0 -1
- package/lib/module/renderer/components/colorFilters/Compose.js +0 -14
- package/lib/module/renderer/components/colorFilters/Compose.js.map +0 -1
- package/lib/module/renderer/components/imageFilters/InnerShadow.js +0 -17
- package/lib/module/renderer/components/imageFilters/InnerShadow.js.map +0 -1
- package/lib/module/renderer/components/imageFilters/getInput.js +0 -23
- package/lib/module/renderer/components/imageFilters/getInput.js.map +0 -1
- package/lib/module/renderer/components/shaders/Gradient.js +0 -20
- package/lib/module/renderer/components/shaders/Gradient.js.map +0 -1
- package/lib/module/renderer/nodes/Container.js +0 -18
- package/lib/module/renderer/nodes/Container.js.map +0 -1
- package/lib/module/renderer/nodes/Declaration.js +0 -36
- package/lib/module/renderer/nodes/Declaration.js.map +0 -1
- package/lib/module/renderer/nodes/Drawing.js +0 -37
- package/lib/module/renderer/nodes/Drawing.js.map +0 -1
- package/lib/module/renderer/nodes/Node.js +0 -63
- package/lib/module/renderer/nodes/Node.js.map +0 -1
- package/lib/module/renderer/nodes/index.js +0 -5
- package/lib/module/renderer/nodes/index.js.map +0 -1
- package/lib/module/renderer/processors/Circles.js.map +0 -1
- package/lib/module/renderer/processors/Clips.js +0 -13
- package/lib/module/renderer/processors/Clips.js.map +0 -1
- package/lib/module/renderer/processors/Font.js +0 -4
- package/lib/module/renderer/processors/Font.js.map +0 -1
- package/lib/module/renderer/processors/Paint.js +0 -84
- package/lib/module/renderer/processors/Paint.js.map +0 -1
- package/lib/module/renderer/processors/Paths.js.map +0 -1
- package/lib/module/renderer/processors/Radius.js.map +0 -1
- package/lib/module/renderer/processors/Rects.js.map +0 -1
- package/lib/module/renderer/processors/Transform.js +0 -42
- package/lib/module/renderer/processors/Transform.js.map +0 -1
- package/lib/typescript/src/renderer/components/Compose.d.ts +0 -6
- package/lib/typescript/src/renderer/components/colorFilters/Compose.d.ts +0 -3
- package/lib/typescript/src/renderer/components/imageFilters/InnerShadow.d.ts +0 -2
- package/lib/typescript/src/renderer/components/imageFilters/getInput.d.ts +0 -3
- package/lib/typescript/src/renderer/components/shaders/Gradient.d.ts +0 -17
- package/lib/typescript/src/renderer/nodes/Container.d.ts +0 -8
- package/lib/typescript/src/renderer/nodes/Declaration.d.ts +0 -22
- package/lib/typescript/src/renderer/nodes/Drawing.d.ts +0 -21
- package/lib/typescript/src/renderer/nodes/Node.d.ts +0 -24
- package/lib/typescript/src/renderer/nodes/index.d.ts +0 -4
- package/lib/typescript/src/renderer/processors/Circles.d.ts +0 -13
- package/lib/typescript/src/renderer/processors/Clips.d.ts +0 -4
- package/lib/typescript/src/renderer/processors/Font.d.ts +0 -7
- package/lib/typescript/src/renderer/processors/Paint.d.ts +0 -22
- package/lib/typescript/src/renderer/processors/Paths.d.ts +0 -4
- package/lib/typescript/src/renderer/processors/Radius.d.ts +0 -3
- package/lib/typescript/src/renderer/processors/Rects.d.ts +0 -20
- package/src/renderer/components/Compose.tsx +0 -26
- package/src/renderer/components/colorFilters/Compose.ts +0 -18
- package/src/renderer/components/imageFilters/InnerShadow.tsx +0 -38
- package/src/renderer/components/imageFilters/getInput.ts +0 -20
- package/src/renderer/components/shaders/Gradient.ts +0 -24
- package/src/renderer/nodes/Container.tsx +0 -17
- package/src/renderer/nodes/Declaration.tsx +0 -65
- package/src/renderer/nodes/Drawing.tsx +0 -65
- package/src/renderer/nodes/Node.ts +0 -59
- package/src/renderer/nodes/index.ts +0 -4
- package/src/renderer/processors/Clips.ts +0 -23
- package/src/renderer/processors/Font.ts +0 -8
- package/src/renderer/processors/Paint.ts +0 -118
- package/src/renderer/processors/Transform.ts +0 -50
@@ -0,0 +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,IA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B,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"]}
|
@@ -0,0 +1,201 @@
|
|
1
|
+
import { processUniforms, FilterMode, MipmapMode, TileMode } from "../../../skia/types";
|
2
|
+
import { JsiDeclarationNode } from "../Node";
|
3
|
+
import { DeclarationType, NodeType } from "../../types";
|
4
|
+
import { processColor } from "../datatypes/Color";
|
5
|
+
import { enumKey, fitRects, getRect, processGradientProps, processTransformProps, rect2rect } from "../datatypes";
|
6
|
+
export class ShaderDeclaration extends JsiDeclarationNode {
|
7
|
+
constructor(ctx, type, props) {
|
8
|
+
super(ctx, DeclarationType.Shader, type, props);
|
9
|
+
}
|
10
|
+
|
11
|
+
}
|
12
|
+
export class ShaderNode extends ShaderDeclaration {
|
13
|
+
constructor(ctx, props) {
|
14
|
+
super(ctx, NodeType.Shader, props);
|
15
|
+
}
|
16
|
+
|
17
|
+
materialize() {
|
18
|
+
const {
|
19
|
+
source,
|
20
|
+
uniforms,
|
21
|
+
...transform
|
22
|
+
} = this.props;
|
23
|
+
const m3 = this.Skia.Matrix();
|
24
|
+
processTransformProps(m3, transform);
|
25
|
+
return source.makeShaderWithChildren(processUniforms(source, uniforms), this.children().filter(child => child instanceof JsiDeclarationNode && child.isShader()).map(child => child.materialize()), m3);
|
26
|
+
}
|
27
|
+
|
28
|
+
}
|
29
|
+
export class ImageShaderNode extends ShaderDeclaration {
|
30
|
+
constructor(ctx, props) {
|
31
|
+
super(ctx, NodeType.ImageShader, props);
|
32
|
+
}
|
33
|
+
|
34
|
+
materialize() {
|
35
|
+
const {
|
36
|
+
fit,
|
37
|
+
image,
|
38
|
+
tx,
|
39
|
+
ty,
|
40
|
+
fm,
|
41
|
+
mm,
|
42
|
+
...imageShaderProps
|
43
|
+
} = this.props;
|
44
|
+
const rct = getRect(this.Skia, imageShaderProps);
|
45
|
+
|
46
|
+
if (rct) {
|
47
|
+
var _imageShaderProps$tra;
|
48
|
+
|
49
|
+
const rects = fitRects(fit, {
|
50
|
+
x: 0,
|
51
|
+
y: 0,
|
52
|
+
width: image.width(),
|
53
|
+
height: image.height()
|
54
|
+
}, rct);
|
55
|
+
const m3 = rect2rect(rects.src, rects.dst);
|
56
|
+
imageShaderProps.transform = [...((_imageShaderProps$tra = imageShaderProps.transform) !== null && _imageShaderProps$tra !== void 0 ? _imageShaderProps$tra : []), ...m3];
|
57
|
+
}
|
58
|
+
|
59
|
+
const lm = this.Skia.Matrix();
|
60
|
+
processTransformProps(lm, imageShaderProps);
|
61
|
+
return image.makeShaderOptions(TileMode[enumKey(tx)], TileMode[enumKey(ty)], FilterMode[enumKey(fm)], MipmapMode[enumKey(mm)], lm);
|
62
|
+
}
|
63
|
+
|
64
|
+
}
|
65
|
+
export class ColorNode extends ShaderDeclaration {
|
66
|
+
constructor(ctx, props) {
|
67
|
+
super(ctx, NodeType.ColorShader, props);
|
68
|
+
}
|
69
|
+
|
70
|
+
materialize() {
|
71
|
+
const {
|
72
|
+
color
|
73
|
+
} = this.props;
|
74
|
+
return this.Skia.Shader.MakeColor(processColor(this.Skia, color, 1));
|
75
|
+
}
|
76
|
+
|
77
|
+
}
|
78
|
+
export class TurbulenceNode extends ShaderDeclaration {
|
79
|
+
constructor(ctx, props) {
|
80
|
+
super(ctx, NodeType.Turbulence, props);
|
81
|
+
}
|
82
|
+
|
83
|
+
materialize() {
|
84
|
+
const {
|
85
|
+
freqX,
|
86
|
+
freqY,
|
87
|
+
octaves,
|
88
|
+
seed,
|
89
|
+
tileWidth,
|
90
|
+
tileHeight
|
91
|
+
} = this.props;
|
92
|
+
return this.Skia.Shader.MakeTurbulence(freqX, freqY, octaves, seed, tileWidth, tileHeight);
|
93
|
+
}
|
94
|
+
|
95
|
+
}
|
96
|
+
export class FractalNoiseNode extends ShaderDeclaration {
|
97
|
+
constructor(ctx, props) {
|
98
|
+
super(ctx, NodeType.FractalNoise, props);
|
99
|
+
}
|
100
|
+
|
101
|
+
materialize() {
|
102
|
+
const {
|
103
|
+
freqX,
|
104
|
+
freqY,
|
105
|
+
octaves,
|
106
|
+
seed,
|
107
|
+
tileWidth,
|
108
|
+
tileHeight
|
109
|
+
} = this.props;
|
110
|
+
return this.Skia.Shader.MakeFractalNoise(freqX, freqY, octaves, seed, tileWidth, tileHeight);
|
111
|
+
}
|
112
|
+
|
113
|
+
}
|
114
|
+
export class LinearGradientNode extends ShaderDeclaration {
|
115
|
+
constructor(ctx, props) {
|
116
|
+
super(ctx, NodeType.LinearGradient, props);
|
117
|
+
}
|
118
|
+
|
119
|
+
materialize() {
|
120
|
+
const {
|
121
|
+
start,
|
122
|
+
end
|
123
|
+
} = this.props;
|
124
|
+
const {
|
125
|
+
colors,
|
126
|
+
positions,
|
127
|
+
mode,
|
128
|
+
localMatrix,
|
129
|
+
flags
|
130
|
+
} = processGradientProps(this.Skia, this.props);
|
131
|
+
return this.Skia.Shader.MakeLinearGradient(start, end, colors, positions !== null && positions !== void 0 ? positions : null, mode, localMatrix, flags);
|
132
|
+
}
|
133
|
+
|
134
|
+
}
|
135
|
+
export class RadialGradientNode extends ShaderDeclaration {
|
136
|
+
constructor(ctx, props) {
|
137
|
+
super(ctx, NodeType.RadialGradient, props);
|
138
|
+
}
|
139
|
+
|
140
|
+
materialize() {
|
141
|
+
const {
|
142
|
+
c,
|
143
|
+
r
|
144
|
+
} = this.props;
|
145
|
+
const {
|
146
|
+
colors,
|
147
|
+
positions,
|
148
|
+
mode,
|
149
|
+
localMatrix,
|
150
|
+
flags
|
151
|
+
} = processGradientProps(this.Skia, this.props);
|
152
|
+
return this.Skia.Shader.MakeRadialGradient(c, r, colors, positions, mode, localMatrix, flags);
|
153
|
+
}
|
154
|
+
|
155
|
+
}
|
156
|
+
export class SweepGradientNode extends ShaderDeclaration {
|
157
|
+
constructor(ctx, props) {
|
158
|
+
super(ctx, NodeType.SweepGradient, props);
|
159
|
+
}
|
160
|
+
|
161
|
+
materialize() {
|
162
|
+
const {
|
163
|
+
c,
|
164
|
+
start,
|
165
|
+
end
|
166
|
+
} = this.props;
|
167
|
+
const {
|
168
|
+
colors,
|
169
|
+
positions,
|
170
|
+
mode,
|
171
|
+
localMatrix,
|
172
|
+
flags
|
173
|
+
} = processGradientProps(this.Skia, this.props);
|
174
|
+
return this.Skia.Shader.MakeSweepGradient(c.x, c.y, colors, positions, mode, localMatrix, flags, start, end);
|
175
|
+
}
|
176
|
+
|
177
|
+
}
|
178
|
+
export class TwoPointConicalGradientNode extends ShaderDeclaration {
|
179
|
+
constructor(ctx, props) {
|
180
|
+
super(ctx, NodeType.TwoPointConicalGradient, props);
|
181
|
+
}
|
182
|
+
|
183
|
+
materialize() {
|
184
|
+
const {
|
185
|
+
startR,
|
186
|
+
endR,
|
187
|
+
start,
|
188
|
+
end
|
189
|
+
} = this.props;
|
190
|
+
const {
|
191
|
+
colors,
|
192
|
+
positions,
|
193
|
+
mode,
|
194
|
+
localMatrix,
|
195
|
+
flags
|
196
|
+
} = processGradientProps(this.Skia, this.props);
|
197
|
+
return this.Skia.Shader.MakeTwoPointConicalGradient(start, startR, end, endR, colors, positions, mode, localMatrix, flags);
|
198
|
+
}
|
199
|
+
|
200
|
+
}
|
201
|
+
//# sourceMappingURL=Shaders.js.map
|
@@ -0,0 +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,EAAA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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"]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAd;AACA,cAAc,eAAd;AACA,cAAc,gBAAd;AACA,cAAc,gBAAd;AACA,cAAc,eAAd;AACA,cAAc,aAAd","sourcesContent":["export * from \"./Shaders\";\nexport * from \"./MaskFilters\";\nexport * from \"./ColorFilters\";\nexport * from \"./ImageFilters\";\nexport * from \"./PathEffects\";\nexport * from \"./BlendNode\";\n"]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
|
@@ -0,0 +1,72 @@
|
|
1
|
+
export let NodeType;
|
2
|
+
|
3
|
+
(function (NodeType) {
|
4
|
+
NodeType["Shader"] = "skShader";
|
5
|
+
NodeType["ImageShader"] = "skImageShader";
|
6
|
+
NodeType["ColorShader"] = "skColorShader";
|
7
|
+
NodeType["Turbulence"] = "skTurbulence";
|
8
|
+
NodeType["FractalNoise"] = "skFractalNoise";
|
9
|
+
NodeType["LinearGradient"] = "skLinearGradient";
|
10
|
+
NodeType["RadialGradient"] = "skRadialGradient";
|
11
|
+
NodeType["SweepGradient"] = "skSweepGradient";
|
12
|
+
NodeType["TwoPointConicalGradient"] = "skTwoPointConicalGradient";
|
13
|
+
NodeType["BlurMaskFilter"] = "skBlurMaskFilter";
|
14
|
+
NodeType["DiscretePathEffect"] = "skDiscretePathEffect";
|
15
|
+
NodeType["DashPathEffect"] = "skDashPathEffect";
|
16
|
+
NodeType["Path1DPathEffect"] = "skPath1DPathEffect";
|
17
|
+
NodeType["Path2DPathEffect"] = "skPath2DPathEffect";
|
18
|
+
NodeType["CornerPathEffect"] = "skCornerPathEffect";
|
19
|
+
NodeType["SumPathEffect"] = "skSumPathEffect";
|
20
|
+
NodeType["Line2DPathEffect"] = "skLine2DPathEffect";
|
21
|
+
NodeType["MatrixColorFilter"] = "skMatrixColorFilter";
|
22
|
+
NodeType["BlendColorFilter"] = "skBlendColorFilter";
|
23
|
+
NodeType["LinearToSRGBGammaColorFilter"] = "skLinearToSRGBGammaColorFilter";
|
24
|
+
NodeType["SRGBToLinearGammaColorFilter"] = "skSRGBToLinearGammaColorFilter";
|
25
|
+
NodeType["LumaColorFilter"] = "skLumaColorFilter";
|
26
|
+
NodeType["LerpColorFilter"] = "skLerpColorFilter";
|
27
|
+
NodeType["OffsetImageFilter"] = "skOffsetImageFilter";
|
28
|
+
NodeType["DisplacementMapImageFilter"] = "skDisplacementMapImageFilter";
|
29
|
+
NodeType["BlurImageFilter"] = "skBlurImageFilter";
|
30
|
+
NodeType["DropShadowImageFilter"] = "skDropShadowImageFilter";
|
31
|
+
NodeType["MorphologyImageFilter"] = "skMorphologyImageFilter";
|
32
|
+
NodeType["BlendImageFilter"] = "skBlendImageFilter";
|
33
|
+
NodeType["RuntimeShaderImageFilter"] = "skRuntimeShaderImageFilter";
|
34
|
+
NodeType["Blend"] = "skBlend";
|
35
|
+
NodeType["BackdropFilter"] = "skBackdropFilter";
|
36
|
+
NodeType["Box"] = "skBox";
|
37
|
+
NodeType["BoxShadow"] = "skBoxShadow";
|
38
|
+
NodeType["Group"] = "skGroup";
|
39
|
+
NodeType["Drawing"] = "skDrawing";
|
40
|
+
NodeType["Paint"] = "skPaint";
|
41
|
+
NodeType["Circle"] = "skCircle";
|
42
|
+
NodeType["Fill"] = "skFill";
|
43
|
+
NodeType["Image"] = "skImage";
|
44
|
+
NodeType["Points"] = "skPoints";
|
45
|
+
NodeType["Path"] = "skPath";
|
46
|
+
NodeType["Rect"] = "skRect";
|
47
|
+
NodeType["RRect"] = "skRRect";
|
48
|
+
NodeType["Oval"] = "skOval";
|
49
|
+
NodeType["Line"] = "skLine";
|
50
|
+
NodeType["Patch"] = "skPatch";
|
51
|
+
NodeType["Vertices"] = "skVertices";
|
52
|
+
NodeType["DiffRect"] = "skDiffRect";
|
53
|
+
NodeType["Text"] = "skText";
|
54
|
+
NodeType["TextPath"] = "skTextPath";
|
55
|
+
NodeType["TextBlob"] = "skTextBlob";
|
56
|
+
NodeType["Glyphs"] = "skGlyphs";
|
57
|
+
NodeType["Picture"] = "skPicture";
|
58
|
+
NodeType["ImageSVG"] = "skImageSVG";
|
59
|
+
})(NodeType || (NodeType = {}));
|
60
|
+
|
61
|
+
export let DeclarationType;
|
62
|
+
|
63
|
+
(function (DeclarationType) {
|
64
|
+
DeclarationType[DeclarationType["Paint"] = 0] = "Paint";
|
65
|
+
DeclarationType[DeclarationType["Shader"] = 1] = "Shader";
|
66
|
+
DeclarationType[DeclarationType["ImageFilter"] = 2] = "ImageFilter";
|
67
|
+
DeclarationType[DeclarationType["ColorFilter"] = 3] = "ColorFilter";
|
68
|
+
DeclarationType[DeclarationType["PathEffect"] = 4] = "PathEffect";
|
69
|
+
DeclarationType[DeclarationType["MaskFilter"] = 5] = "MaskFilter";
|
70
|
+
DeclarationType[DeclarationType["Unknown"] = 6] = "Unknown";
|
71
|
+
})(DeclarationType || (DeclarationType = {}));
|
72
|
+
//# sourceMappingURL=NodeType.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["NodeType.ts"],"names":["NodeType","DeclarationType"],"mappings":"AAAA,WAAkBA,QAAlB;;WAAkBA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;AAAAA,EAAAA,Q;GAAAA,Q,KAAAA,Q;;AAuElB,WAAkBC,eAAlB;;WAAkBA,e;AAAAA,EAAAA,e,CAAAA,e;AAAAA,EAAAA,e,CAAAA,e;AAAAA,EAAAA,e,CAAAA,e;AAAAA,EAAAA,e,CAAAA,e;AAAAA,EAAAA,e,CAAAA,e;AAAAA,EAAAA,e,CAAAA,e;AAAAA,EAAAA,e,CAAAA,e;GAAAA,e,KAAAA,e","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"]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
export * from "./DrawingContext";
|
2
|
+
export * from "./Node";
|
3
|
+
export * from "./NodeType";
|
4
|
+
export * from "./SkDOM";
|
5
|
+
export * from "./Common";
|
6
|
+
export * from "./Drawings";
|
7
|
+
export * from "./ImageFilters";
|
8
|
+
export * from "./ColorFilters";
|
9
|
+
export * from "./MaskFilters";
|
10
|
+
export * from "./PathEffects";
|
11
|
+
export * from "./Shaders";
|
12
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["index.ts"],"names":[],"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","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"]}
|
package/lib/module/index.js
CHANGED
package/lib/module/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["index.ts"],"names":[],"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","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\";\n"]}
|
1
|
+
{"version":3,"sources":["index.ts"],"names":[],"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","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"]}
|
@@ -5,7 +5,7 @@ import { useValue } from "../values/hooks/useValue";
|
|
5
5
|
import { Skia } from "../skia/Skia";
|
6
6
|
import { debug as hostDebug, skHostConfig } from "./HostConfig"; // import { debugTree } from "./nodes";
|
7
7
|
|
8
|
-
import { Container } from "./
|
8
|
+
import { Container } from "./Container";
|
9
9
|
import { DependencyManager } from "./DependencyManager";
|
10
10
|
import { CanvasProvider } from "./useCanvas";
|
11
11
|
export const skiaReconciler = ReactReconciler(skHostConfig);
|
@@ -42,7 +42,9 @@ export const Canvas = /*#__PURE__*/forwardRef((_ref, forwardedRef) => {
|
|
42
42
|
const innerRef = useCanvasRef();
|
43
43
|
const ref = useCombinedRefs(forwardedRef, innerRef);
|
44
44
|
const [tick, setTick] = useState(0);
|
45
|
-
const redraw = useCallback(() =>
|
45
|
+
const redraw = useCallback(() => {
|
46
|
+
setTick(t => t + 1);
|
47
|
+
}, []);
|
46
48
|
const registerValues = useCallback(values => {
|
47
49
|
if (ref.current === null) {
|
48
50
|
throw new Error("Canvas ref is not set");
|
@@ -50,7 +52,9 @@ export const Canvas = /*#__PURE__*/forwardRef((_ref, forwardedRef) => {
|
|
50
52
|
|
51
53
|
return ref.current.registerValues(values);
|
52
54
|
}, [ref]);
|
53
|
-
const container = useMemo(() =>
|
55
|
+
const container = useMemo(() => {
|
56
|
+
return new Container(Skia, new DependencyManager(registerValues), redraw);
|
57
|
+
}, [redraw, registerValues]);
|
54
58
|
const root = useMemo(() => skiaReconciler.createContainer(container, 0, false, null), [container]); // Render effect
|
55
59
|
|
56
60
|
useEffect(() => {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["Canvas.tsx"],"names":["React","useEffect","useState","useCallback","useMemo","forwardRef","useRef","ReactReconciler","SkiaView","useDrawCallback","useValue","Skia","debug","hostDebug","skHostConfig","Container","DependencyManager","CanvasProvider","skiaReconciler","injectIntoDevTools","bundleType","version","rendererPackageName","render","element","root","container","updateContainer","depMgr","update","useCanvasRef","Canvas","forwardedRef","children","style","mode","onTouch","size","width","height","canvasCtx","innerRef","ref","useCombinedRefs","tick","setTick","redraw","t","registerValues","values","current","Error","createContainer","paint","Paint","onDraw","canvas","info","timestamp","touches","reset","ctx","opacity","center","x","y","draw","remove","refs","targetRef","forEach"],"mappings":"AAAA,OAAOA,KAAP,IACEC,SADF,EAEEC,QAFF,EAGEC,WAHF,EAIEC,OAJF,EAKEC,UALF,EAMEC,MANF,QAOO,OAPP;AAgBA,OAAOC,eAAP,MAA4B,kBAA5B;AAEA,SAASC,QAAT,EAAmBC,eAAnB,QAA0C,UAA1C;AAEA,SAASC,QAAT,QAAyB,0BAAzB;AACA,SAASC,IAAT,QAAqB,cAArB;AAGA,SAASC,KAAK,IAAIC,SAAlB,EAA6BC,YAA7B,QAAiD,cAAjD,C,CACA;;AACA,SAASC,SAAT,QAA0B,
|
1
|
+
{"version":3,"sources":["Canvas.tsx"],"names":["React","useEffect","useState","useCallback","useMemo","forwardRef","useRef","ReactReconciler","SkiaView","useDrawCallback","useValue","Skia","debug","hostDebug","skHostConfig","Container","DependencyManager","CanvasProvider","skiaReconciler","injectIntoDevTools","bundleType","version","rendererPackageName","render","element","root","container","updateContainer","depMgr","update","useCanvasRef","Canvas","forwardedRef","children","style","mode","onTouch","size","width","height","canvasCtx","innerRef","ref","useCombinedRefs","tick","setTick","redraw","t","registerValues","values","current","Error","createContainer","paint","Paint","onDraw","canvas","info","timestamp","touches","reset","ctx","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AAZ;AAWAe,IAAAA,SAAS,CAACwC,IAAV,CAAeL,GAAf;AACD,GA1B2B,EA2B5B,CAACjB,IAAD,EAAOR,OAAP,CA3B4B,CAA9B;AA8BAnC,EAAAA,SAAS,CAAC,MAAM;AACd,WAAO,MAAM;AACXiB,MAAAA,cAAc,CAACS,eAAf,CAA+B,IAA/B,EAAqCF,IAArC,EAA2C,IAA3C,EAAiD,MAAM;AACrDC,QAAAA,SAAS,CAACE,MAAV,CAAiBuC,MAAjB;AACD,OAFD;AAGD,KAJD;AAKD,GANQ,EAMN,CAACzC,SAAD,EAAYD,IAAZ,CANM,CAAT;AAQA,sBACE,oBAAC,QAAD;AACE,IAAA,GAAG,EAAEiB,GADP;AAEE,IAAA,KAAK,EAAER,KAFT;AAGE,IAAA,MAAM,EAAEqB,MAHV;AAIE,IAAA,IAAI,EAAEpB,IAJR;AAKE,IAAA,KAAK,EAAEvB;AALT,IADF;AASD,CAxF6B,CAAzB;AA2FP;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,MAAM+B,eAAe,GAAG,YAEnB;AAAA,oCADAyB,IACA;AADAA,IAAAA,IACA;AAAA;;AACH,QAAMC,SAAS,GAAGrE,KAAK,CAACM,MAAN,CAAgB,IAAhB,CAAlB;AACAN,EAAAA,KAAK,CAACC,SAAN,CAAgB,MAAM;AACpBmE,IAAAA,IAAI,CAACE,OAAL,CAAc5B,GAAD,IAAS;AACpB,UAAIA,GAAJ,EAAS;AACP,YAAI,OAAOA,GAAP,KAAe,UAAnB,EAA+B;AAC7BA,UAAAA,GAAG,CAAC2B,SAAS,CAACnB,OAAX,CAAH;AACD,SAFD,MAEO;AACLR,UAAAA,GAAG,CAACQ,OAAJ,GAAcmB,SAAS,CAACnB,OAAxB;AACD;AACF;AACF,KARD;AASD,GAVD,EAUG,CAACkB,IAAD,CAVH;AAWA,SAAOC,SAAP;AACD,CAhBD","sourcesContent":["import React, {\n useEffect,\n useState,\n useCallback,\n useMemo,\n forwardRef,\n useRef,\n} from \"react\";\nimport type {\n RefObject,\n ReactNode,\n ComponentProps,\n MutableRefObject,\n ForwardedRef,\n} from \"react\";\nimport type { OpaqueRoot } from \"react-reconciler\";\nimport ReactReconciler from \"react-reconciler\";\n\nimport { SkiaView, useDrawCallback } from \"../views\";\nimport type { TouchHandler } from \"../views\";\nimport { useValue } from \"../values/hooks/useValue\";\nimport { Skia } from \"../skia/Skia\";\nimport type { SkiaValue } from \"../values\";\n\nimport { debug as hostDebug, skHostConfig } from \"./HostConfig\";\n// import { debugTree } from \"./nodes\";\nimport { Container } from \"./Container\";\nimport { DependencyManager } from \"./DependencyManager\";\nimport { CanvasProvider } from \"./useCanvas\";\n\nexport const skiaReconciler = ReactReconciler(skHostConfig);\n\nskiaReconciler.injectIntoDevTools({\n bundleType: 1,\n version: \"0.0.1\",\n rendererPackageName: \"react-native-skia\",\n});\n\nconst render = (element: ReactNode, root: OpaqueRoot, container: Container) => {\n skiaReconciler.updateContainer(element, root, null, () => {\n hostDebug(\"updateContainer\");\n container.depMgr.update();\n });\n};\n\nexport const useCanvasRef = () => useRef<SkiaView>(null);\n\nexport interface CanvasProps extends ComponentProps<typeof SkiaView> {\n ref?: RefObject<SkiaView>;\n children: ReactNode;\n onTouch?: TouchHandler;\n}\n\nexport const Canvas = forwardRef<SkiaView, CanvasProps>(\n ({ children, style, debug, mode, onTouch }, forwardedRef) => {\n const size = useValue({ width: 0, height: 0 });\n const canvasCtx = useMemo(() => ({ Skia, size }), [size]);\n const innerRef = useCanvasRef();\n const ref = useCombinedRefs(forwardedRef, innerRef);\n const [tick, setTick] = useState(0);\n const redraw = useCallback(() => {\n setTick((t) => t + 1);\n }, []);\n\n const registerValues = useCallback(\n (values: Array<SkiaValue<unknown>>) => {\n if (ref.current === null) {\n throw new Error(\"Canvas ref is not set\");\n }\n return ref.current.registerValues(values);\n },\n [ref]\n );\n\n const container = useMemo(() => {\n return new Container(Skia, new DependencyManager(registerValues), redraw);\n }, [redraw, registerValues]);\n\n const root = useMemo(\n () => skiaReconciler.createContainer(container, 0, false, null),\n [container]\n );\n // Render effect\n useEffect(() => {\n render(\n <CanvasProvider value={canvasCtx}>{children}</CanvasProvider>,\n root,\n container\n );\n }, [children, root, redraw, container, canvasCtx]);\n\n const paint = useMemo(() => Skia.Paint(), []);\n\n // Draw callback\n const onDraw = useDrawCallback(\n (canvas, info) => {\n // TODO: if tree is empty (count === 1) maybe we should not render?\n const { width, height, timestamp } = info;\n if (onTouch) {\n onTouch(info.touches);\n }\n if (\n width !== canvasCtx.size.current.width ||\n height !== canvasCtx.size.current.height\n ) {\n canvasCtx.size.current = { width, height };\n }\n paint.reset();\n const ctx = {\n width,\n height,\n timestamp,\n canvas,\n paint,\n opacity: 1,\n ref,\n center: { x: width / 2, y: height / 2 },\n Skia,\n };\n container.draw(ctx);\n },\n [tick, onTouch]\n );\n\n useEffect(() => {\n return () => {\n skiaReconciler.updateContainer(null, root, null, () => {\n container.depMgr.remove();\n });\n };\n }, [container, root]);\n\n return (\n <SkiaView\n ref={ref}\n style={style}\n onDraw={onDraw}\n mode={mode}\n debug={debug}\n />\n );\n }\n);\n\n/**\n * Combines a list of refs into a single ref. This can be used to provide\n * both a forwarded ref and an internal ref keeping the same functionality\n * on both of the refs.\n * @param refs Array of refs to combine\n * @returns A single ref that can be used in a ref prop.\n */\nconst useCombinedRefs = <T,>(\n ...refs: Array<MutableRefObject<T> | ForwardedRef<T>>\n) => {\n const targetRef = React.useRef<T>(null);\n React.useEffect(() => {\n refs.forEach((ref) => {\n if (ref) {\n if (typeof ref === \"function\") {\n ref(targetRef.current);\n } else {\n ref.current = targetRef.current;\n }\n }\n });\n }, [refs]);\n return targetRef;\n};\n"]}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
2
|
+
|
3
|
+
import { JsiSkDOM } from "../dom/nodes";
|
4
|
+
export class Container {
|
5
|
+
constructor(Skia, depMgr, redraw) {
|
6
|
+
this.depMgr = depMgr;
|
7
|
+
this.redraw = redraw;
|
8
|
+
|
9
|
+
_defineProperty(this, "_root", void 0);
|
10
|
+
|
11
|
+
_defineProperty(this, "Sk", void 0);
|
12
|
+
|
13
|
+
this.Sk = new JsiSkDOM({
|
14
|
+
Skia,
|
15
|
+
depMgr
|
16
|
+
});
|
17
|
+
this._root = this.Sk.Group();
|
18
|
+
}
|
19
|
+
|
20
|
+
draw(ctx) {
|
21
|
+
this._root.render(ctx);
|
22
|
+
}
|
23
|
+
|
24
|
+
get root() {
|
25
|
+
return this._root;
|
26
|
+
}
|
27
|
+
|
28
|
+
}
|
29
|
+
//# sourceMappingURL=Container.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["Container.tsx"],"names":["JsiSkDOM","Container","constructor","Skia","depMgr","redraw","Sk","_root","Group","draw","ctx","render","root"],"mappings":";;AAAA,SAASA,QAAT,QAAyB,cAAzB;AAWA,OAAO,MAAMC,SAAN,CAAgB;AAGrBC,EAAAA,WAAW,CACTC,IADS,EAEFC,MAFE,EAGFC,MAHE,EAIT;AAAA,SAFOD,MAEP,GAFOA,MAEP;AAAA,SADOC,MACP,GADOA,MACP;;AAAA;;AAAA;;AACA,SAAKC,EAAL,GAAU,IAAIN,QAAJ,CAAa;AAAEG,MAAAA,IAAF;AAAQC,MAAAA;AAAR,KAAb,CAAV;AACA,SAAKG,KAAL,GAAa,KAAKD,EAAL,CAAQE,KAAR,EAAb;AACD;;AAEDC,EAAAA,IAAI,CAACC,GAAD,EAAsB;AACxB,SAAKH,KAAL,CAAWI,MAAX,CAAkBD,GAAlB;AACD;;AAEO,MAAJE,IAAI,GAAG;AACT,WAAO,KAAKL,KAAZ;AACD;;AAlBoB","sourcesContent":["import { JsiSkDOM } from \"../dom/nodes\";\nimport type {\n GroupProps,\n DrawingContext,\n RenderNode,\n SkDOM,\n} from \"../dom/types\";\nimport type { Skia } from \"../skia/types\";\n\nimport type { DependencyManager } from \"./DependencyManager\";\n\nexport class Container {\n private _root: RenderNode<GroupProps>;\n public Sk: SkDOM;\n constructor(\n Skia: Skia,\n public depMgr: DependencyManager,\n public redraw: () => void\n ) {\n this.Sk = new JsiSkDOM({ Skia, depMgr });\n this._root = this.Sk.Group();\n }\n\n draw(ctx: DrawingContext) {\n this._root.render(ctx);\n }\n\n get root() {\n return this._root;\n }\n}\n"]}
|