@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":["ImageNode.ts"],"names":["NodeType","fitRects","processRect","JsiDrawingNode","ImageNode","constructor","ctx","props","Image","deriveProps","image","fit","rect","Skia","src","dst","x","y","width","height","draw","canvas","paint","derived","Error","drawImageRect"],"mappings":"AAEA,SAASA,QAAT,QAAyB,aAAzB;AACA,SAASC,QAAT,EAAmBC,WAAnB,QAAsC,cAAtC;AACA,SAASC,cAAT,QAA+B,gBAA/B;AAGA,OAAO,MAAMC,SAAN,SAAwBD,cAAxB,CAGL;AACAE,EAAAA,WAAW,CAACC,GAAD,EAAmBC,KAAnB,EAAsC;AAC/C,UAAMD,GAAN,EAAWN,QAAQ,CAACQ,KAApB,EAA2BD,KAA3B;AACD;;AAEDE,EAAAA,WAAW,GAAG;AACZ,UAAM;AAAEC,MAAAA,KAAF;AAASC,MAAAA;AAAT,QAAiB,KAAKJ,KAA5B;AACA,UAAMK,IAAI,GAAGV,WAAW,CAAC,KAAKW,IAAN,EAAY,KAAKN,KAAjB,CAAxB;AACA,UAAM;AAAEO,MAAAA,GAAF;AAAOC,MAAAA;AAAP,QAAed,QAAQ,CAC3BU,GAD2B,EAE3B;AACEK,MAAAA,CAAC,EAAE,CADL;AAEEC,MAAAA,CAAC,EAAE,CAFL;AAGEC,MAAAA,KAAK,EAAER,KAAK,CAACQ,KAAN,EAHT;AAIEC,MAAAA,MAAM,EAAET,KAAK,CAACS,MAAN;AAJV,KAF2B,EAQ3BP,IAR2B,CAA7B;AAUA,WAAO;AAAEE,MAAAA,GAAF;AAAOC,MAAAA;AAAP,KAAP;AACD;;AAEDK,EAAAA,IAAI,OAAoC;AAAA,QAAnC;AAAEC,MAAAA,MAAF;AAAUC,MAAAA;AAAV,KAAmC;AACtC,UAAM;AAAEZ,MAAAA;AAAF,QAAY,KAAKH,KAAvB;;AACA,QAAI,CAAC,KAAKgB,OAAV,EAAmB;AACjB,YAAM,IAAIC,KAAJ,CAAU,sCAAV,CAAN;AACD;;AACD,UAAM;AAAEV,MAAAA,GAAF;AAAOC,MAAAA;AAAP,QAAe,KAAKQ,OAA1B;AACAF,IAAAA,MAAM,CAACI,aAAP,CAAqBf,KAArB,EAA4BI,GAA5B,EAAiCC,GAAjC,EAAsCO,KAAtC;AACD;;AA5BD","sourcesContent":["import type { SkRect } from \"../../../skia/types\";\nimport type { DrawingContext, ImageProps } from \"../../types\";\nimport { NodeType } from \"../../types\";\nimport { fitRects, processRect } from \"../datatypes\";\nimport { JsiDrawingNode } from \"../DrawingNode\";\nimport type { NodeContext } from \"../Node\";\n\nexport class ImageNode extends JsiDrawingNode<\n ImageProps,\n { src: SkRect; dst: SkRect }\n> {\n constructor(ctx: NodeContext, props: ImageProps) {\n super(ctx, NodeType.Image, props);\n }\n\n deriveProps() {\n const { image, fit } = this.props;\n const rect = processRect(this.Skia, this.props);\n const { src, dst } = fitRects(\n fit,\n {\n x: 0,\n y: 0,\n width: image.width(),\n height: image.height(),\n },\n rect\n );\n return { src, dst };\n }\n\n draw({ canvas, paint }: DrawingContext) {\n const { image } = this.props;\n if (!this.derived) {\n throw new Error(\"ImageNode: src and dst are undefined\");\n }\n const { src, dst } = this.derived;\n canvas.drawImageRect(image, src, dst, paint);\n }\n}\n"]}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
import { NodeType } from "../../types";
|
2
|
+
import { processRect } from "../datatypes";
|
3
|
+
import { JsiDrawingNode } from "../DrawingNode";
|
4
|
+
export class ImageSVGNode extends JsiDrawingNode {
|
5
|
+
constructor(ctx, props) {
|
6
|
+
super(ctx, NodeType.ImageSVG, props);
|
7
|
+
}
|
8
|
+
|
9
|
+
deriveProps() {
|
10
|
+
return null;
|
11
|
+
}
|
12
|
+
|
13
|
+
draw(_ref) {
|
14
|
+
let {
|
15
|
+
canvas
|
16
|
+
} = _ref;
|
17
|
+
const {
|
18
|
+
svg
|
19
|
+
} = this.props;
|
20
|
+
const {
|
21
|
+
x,
|
22
|
+
y,
|
23
|
+
width,
|
24
|
+
height
|
25
|
+
} = processRect(this.Skia, this.props);
|
26
|
+
canvas.save();
|
27
|
+
canvas.translate(x, y);
|
28
|
+
canvas.drawSvg(svg, width, height);
|
29
|
+
canvas.restore();
|
30
|
+
}
|
31
|
+
|
32
|
+
}
|
33
|
+
//# sourceMappingURL=ImageSVG.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["ImageSVG.ts"],"names":["NodeType","processRect","JsiDrawingNode","ImageSVGNode","constructor","ctx","props","ImageSVG","deriveProps","draw","canvas","svg","x","y","width","height","Skia","save","translate","drawSvg","restore"],"mappings":"AACA,SAASA,QAAT,QAAyB,aAAzB;AACA,SAASC,WAAT,QAA4B,cAA5B;AACA,SAASC,cAAT,QAA+B,gBAA/B;AAGA,OAAO,MAAMC,YAAN,SAA2BD,cAA3B,CAA+D;AACpEE,EAAAA,WAAW,CAACC,GAAD,EAAmBC,KAAnB,EAAyC;AAClD,UAAMD,GAAN,EAAWL,QAAQ,CAACO,QAApB,EAA8BD,KAA9B;AACD;;AAEDE,EAAAA,WAAW,GAAG;AACZ,WAAO,IAAP;AACD;;AAEDC,EAAAA,IAAI,OAA6B;AAAA,QAA5B;AAAEC,MAAAA;AAAF,KAA4B;AAC/B,UAAM;AAAEC,MAAAA;AAAF,QAAU,KAAKL,KAArB;AACA,UAAM;AAAEM,MAAAA,CAAF;AAAKC,MAAAA,CAAL;AAAQC,MAAAA,KAAR;AAAeC,MAAAA;AAAf,QAA0Bd,WAAW,CAAC,KAAKe,IAAN,EAAY,KAAKV,KAAjB,CAA3C;AACAI,IAAAA,MAAM,CAACO,IAAP;AACAP,IAAAA,MAAM,CAACQ,SAAP,CAAiBN,CAAjB,EAAoBC,CAApB;AACAH,IAAAA,MAAM,CAACS,OAAP,CAAeR,GAAf,EAAoBG,KAApB,EAA2BC,MAA3B;AACAL,IAAAA,MAAM,CAACU,OAAP;AACD;;AAhBmE","sourcesContent":["import type { DrawingContext, ImageSVGProps } from \"../../types\";\nimport { NodeType } from \"../../types\";\nimport { processRect } from \"../datatypes\";\nimport { JsiDrawingNode } from \"../DrawingNode\";\nimport type { NodeContext } from \"../Node\";\n\nexport class ImageSVGNode extends JsiDrawingNode<ImageSVGProps, null> {\n constructor(ctx: NodeContext, props: ImageSVGProps) {\n super(ctx, NodeType.ImageSVG, props);\n }\n\n deriveProps() {\n return null;\n }\n\n draw({ canvas }: DrawingContext) {\n const { svg } = this.props;\n const { x, y, width, height } = processRect(this.Skia, this.props);\n canvas.save();\n canvas.translate(x, y);\n canvas.drawSvg(svg, width, height);\n canvas.restore();\n }\n}\n"]}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import { NodeType } from "../../types";
|
2
|
+
import { JsiDrawingNode } from "../DrawingNode";
|
3
|
+
export class LineNode extends JsiDrawingNode {
|
4
|
+
constructor(ctx, props) {
|
5
|
+
super(ctx, NodeType.Line, props);
|
6
|
+
}
|
7
|
+
|
8
|
+
deriveProps() {
|
9
|
+
return null;
|
10
|
+
}
|
11
|
+
|
12
|
+
draw(_ref) {
|
13
|
+
let {
|
14
|
+
canvas,
|
15
|
+
paint
|
16
|
+
} = _ref;
|
17
|
+
const {
|
18
|
+
p1,
|
19
|
+
p2
|
20
|
+
} = this.props;
|
21
|
+
canvas.drawLine(p1.x, p1.y, p2.x, p2.y, paint);
|
22
|
+
}
|
23
|
+
|
24
|
+
}
|
25
|
+
//# sourceMappingURL=LineNode.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["LineNode.ts"],"names":["NodeType","JsiDrawingNode","LineNode","constructor","ctx","props","Line","deriveProps","draw","canvas","paint","p1","p2","drawLine","x","y"],"mappings":"AACA,SAASA,QAAT,QAAyB,aAAzB;AACA,SAASC,cAAT,QAA+B,gBAA/B;AAGA,OAAO,MAAMC,QAAN,SAAuBD,cAAvB,CAAuD;AAC5DE,EAAAA,WAAW,CAACC,GAAD,EAAmBC,KAAnB,EAAqC;AAC9C,UAAMD,GAAN,EAAWJ,QAAQ,CAACM,IAApB,EAA0BD,KAA1B;AACD;;AAEDE,EAAAA,WAAW,GAAG;AACZ,WAAO,IAAP;AACD;;AAEDC,EAAAA,IAAI,OAAoC;AAAA,QAAnC;AAAEC,MAAAA,MAAF;AAAUC,MAAAA;AAAV,KAAmC;AACtC,UAAM;AAAEC,MAAAA,EAAF;AAAMC,MAAAA;AAAN,QAAa,KAAKP,KAAxB;AACAI,IAAAA,MAAM,CAACI,QAAP,CAAgBF,EAAE,CAACG,CAAnB,EAAsBH,EAAE,CAACI,CAAzB,EAA4BH,EAAE,CAACE,CAA/B,EAAkCF,EAAE,CAACG,CAArC,EAAwCL,KAAxC;AACD;;AAZ2D","sourcesContent":["import type { DrawingContext, LineProps } from \"../../types\";\nimport { NodeType } from \"../../types\";\nimport { JsiDrawingNode } from \"../DrawingNode\";\nimport type { NodeContext } from \"../Node\";\n\nexport class LineNode extends JsiDrawingNode<LineProps, null> {\n constructor(ctx: NodeContext, props: LineProps) {\n super(ctx, NodeType.Line, props);\n }\n\n deriveProps() {\n return null;\n }\n\n draw({ canvas, paint }: DrawingContext) {\n const { p1, p2 } = this.props;\n canvas.drawLine(p1.x, p1.y, p2.x, p2.y, paint);\n }\n}\n"]}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import { NodeType } from "../../types";
|
2
|
+
import { processRect } from "../datatypes";
|
3
|
+
import { JsiDrawingNode } from "../DrawingNode";
|
4
|
+
export class OvalNode extends JsiDrawingNode {
|
5
|
+
constructor(ctx, props) {
|
6
|
+
super(ctx, NodeType.Oval, props);
|
7
|
+
}
|
8
|
+
|
9
|
+
deriveProps() {
|
10
|
+
return processRect(this.Skia, this.props);
|
11
|
+
}
|
12
|
+
|
13
|
+
draw(_ref) {
|
14
|
+
let {
|
15
|
+
canvas,
|
16
|
+
paint
|
17
|
+
} = _ref;
|
18
|
+
|
19
|
+
if (this.derived === undefined) {
|
20
|
+
throw new Error("OvalNode: rect is undefined");
|
21
|
+
}
|
22
|
+
|
23
|
+
canvas.drawOval(this.derived, paint);
|
24
|
+
}
|
25
|
+
|
26
|
+
}
|
27
|
+
//# sourceMappingURL=OvalNode.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["OvalNode.ts"],"names":["NodeType","processRect","JsiDrawingNode","OvalNode","constructor","ctx","props","Oval","deriveProps","Skia","draw","canvas","paint","derived","undefined","Error","drawOval"],"mappings":"AAEA,SAASA,QAAT,QAAyB,aAAzB;AACA,SAASC,WAAT,QAA4B,cAA5B;AACA,SAASC,cAAT,QAA+B,gBAA/B;AAGA,OAAO,MAAMC,QAAN,SAAuBD,cAAvB,CAAyD;AAC9DE,EAAAA,WAAW,CAACC,GAAD,EAAmBC,KAAnB,EAAqC;AAC9C,UAAMD,GAAN,EAAWL,QAAQ,CAACO,IAApB,EAA0BD,KAA1B;AACD;;AAEDE,EAAAA,WAAW,GAAG;AACZ,WAAOP,WAAW,CAAC,KAAKQ,IAAN,EAAY,KAAKH,KAAjB,CAAlB;AACD;;AAEDI,EAAAA,IAAI,OAAoC;AAAA,QAAnC;AAAEC,MAAAA,MAAF;AAAUC,MAAAA;AAAV,KAAmC;;AACtC,QAAI,KAAKC,OAAL,KAAiBC,SAArB,EAAgC;AAC9B,YAAM,IAAIC,KAAJ,CAAU,6BAAV,CAAN;AACD;;AACDJ,IAAAA,MAAM,CAACK,QAAP,CAAgB,KAAKH,OAArB,EAA8BD,KAA9B;AACD;;AAd6D","sourcesContent":["import type { SkRect } from \"../../../skia/types\";\nimport type { DrawingContext, OvalProps } from \"../../types\";\nimport { NodeType } from \"../../types\";\nimport { processRect } from \"../datatypes\";\nimport { JsiDrawingNode } from \"../DrawingNode\";\nimport type { NodeContext } from \"../Node\";\n\nexport class OvalNode extends JsiDrawingNode<OvalProps, SkRect> {\n constructor(ctx: NodeContext, props: OvalProps) {\n super(ctx, NodeType.Oval, props);\n }\n\n deriveProps() {\n return processRect(this.Skia, this.props);\n }\n\n draw({ canvas, paint }: DrawingContext) {\n if (this.derived === undefined) {\n throw new Error(\"OvalNode: rect is undefined\");\n }\n canvas.drawOval(this.derived, paint);\n }\n}\n"]}
|
@@ -0,0 +1,56 @@
|
|
1
|
+
import { BlendMode } from "../../../skia/types";
|
2
|
+
import { NodeType } from "../../types";
|
3
|
+
import { ALPHA, enumKey, processColor } from "../datatypes";
|
4
|
+
import { JsiDrawingNode } from "../DrawingNode";
|
5
|
+
export class PatchNode extends JsiDrawingNode {
|
6
|
+
constructor(ctx, props) {
|
7
|
+
super(ctx, NodeType.Patch, props);
|
8
|
+
}
|
9
|
+
|
10
|
+
deriveProps() {
|
11
|
+
const {
|
12
|
+
colors,
|
13
|
+
blendMode,
|
14
|
+
patch
|
15
|
+
} = this.props;
|
16
|
+
const defaultBlendMode = colors ? BlendMode.DstOver : BlendMode.SrcOver;
|
17
|
+
const mode = blendMode ? BlendMode[enumKey(blendMode)] : defaultBlendMode; // Patch requires a path with the following constraints:
|
18
|
+
// M tl
|
19
|
+
// C c1 c2 br
|
20
|
+
// C c1 c2 bl
|
21
|
+
// C c1 c2 tl (the redundant point in the last command is removed)
|
22
|
+
|
23
|
+
return {
|
24
|
+
mode,
|
25
|
+
points: [patch[0].pos, patch[0].c2, patch[1].c1, patch[1].pos, patch[1].c2, patch[2].c1, patch[2].pos, patch[2].c2, patch[3].c1, patch[3].pos, patch[3].c2, patch[0].c1],
|
26
|
+
colors: colors ? colors.map(c => processColor(this.Skia, c, 1)) : undefined
|
27
|
+
};
|
28
|
+
}
|
29
|
+
|
30
|
+
draw(_ref) {
|
31
|
+
let {
|
32
|
+
canvas,
|
33
|
+
paint,
|
34
|
+
opacity
|
35
|
+
} = _ref;
|
36
|
+
|
37
|
+
if (!this.derived) {
|
38
|
+
throw new Error("PatchNode: derived props not set");
|
39
|
+
}
|
40
|
+
|
41
|
+
const {
|
42
|
+
texture
|
43
|
+
} = this.props;
|
44
|
+
const {
|
45
|
+
colors,
|
46
|
+
points,
|
47
|
+
mode
|
48
|
+
} = this.derived;
|
49
|
+
canvas.drawPatch(points, opacity === 1 ? colors : colors && colors.map(c => {
|
50
|
+
c[ALPHA] = c[ALPHA] * opacity;
|
51
|
+
return c;
|
52
|
+
}), texture, mode, paint);
|
53
|
+
}
|
54
|
+
|
55
|
+
}
|
56
|
+
//# sourceMappingURL=PatchNode.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["PatchNode.ts"],"names":["BlendMode","NodeType","ALPHA","enumKey","processColor","JsiDrawingNode","PatchNode","constructor","ctx","props","Patch","deriveProps","colors","blendMode","patch","defaultBlendMode","DstOver","SrcOver","mode","points","pos","c2","c1","map","c","Skia","undefined","draw","canvas","paint","opacity","derived","Error","texture","drawPatch"],"mappings":"AACA,SAASA,SAAT,QAA0B,qBAA1B;AAEA,SAASC,QAAT,QAAyB,aAAzB;AACA,SAASC,KAAT,EAAgBC,OAAhB,EAAyBC,YAAzB,QAA6C,cAA7C;AACA,SAASC,cAAT,QAA+B,gBAA/B;AAGA,OAAO,MAAMC,SAAN,SAAwBD,cAAxB,CAGL;AACAE,EAAAA,WAAW,CAACC,GAAD,EAAmBC,KAAnB,EAAsC;AAC/C,UAAMD,GAAN,EAAWP,QAAQ,CAACS,KAApB,EAA2BD,KAA3B;AACD;;AAEDE,EAAAA,WAAW,GAAG;AACZ,UAAM;AAAEC,MAAAA,MAAF;AAAUC,MAAAA,SAAV;AAAqBC,MAAAA;AAArB,QAA+B,KAAKL,KAA1C;AACA,UAAMM,gBAAgB,GAAGH,MAAM,GAAGZ,SAAS,CAACgB,OAAb,GAAuBhB,SAAS,CAACiB,OAAhE;AACA,UAAMC,IAAI,GAAGL,SAAS,GAAGb,SAAS,CAACG,OAAO,CAACU,SAAD,CAAR,CAAZ,GAAmCE,gBAAzD,CAHY,CAIZ;AACA;AACA;AACA;AACA;;AACA,WAAO;AACLG,MAAAA,IADK;AAELC,MAAAA,MAAM,EAAE,CACNL,KAAK,CAAC,CAAD,CAAL,CAASM,GADH,EAENN,KAAK,CAAC,CAAD,CAAL,CAASO,EAFH,EAGNP,KAAK,CAAC,CAAD,CAAL,CAASQ,EAHH,EAINR,KAAK,CAAC,CAAD,CAAL,CAASM,GAJH,EAKNN,KAAK,CAAC,CAAD,CAAL,CAASO,EALH,EAMNP,KAAK,CAAC,CAAD,CAAL,CAASQ,EANH,EAONR,KAAK,CAAC,CAAD,CAAL,CAASM,GAPH,EAQNN,KAAK,CAAC,CAAD,CAAL,CAASO,EARH,EASNP,KAAK,CAAC,CAAD,CAAL,CAASQ,EATH,EAUNR,KAAK,CAAC,CAAD,CAAL,CAASM,GAVH,EAWNN,KAAK,CAAC,CAAD,CAAL,CAASO,EAXH,EAYNP,KAAK,CAAC,CAAD,CAAL,CAASQ,EAZH,CAFH;AAgBLV,MAAAA,MAAM,EAAEA,MAAM,GACVA,MAAM,CAACW,GAAP,CAAYC,CAAD,IAAOpB,YAAY,CAAC,KAAKqB,IAAN,EAAYD,CAAZ,EAAe,CAAf,CAA9B,CADU,GAEVE;AAlBC,KAAP;AAoBD;;AAEDC,EAAAA,IAAI,OAA6C;AAAA,QAA5C;AAAEC,MAAAA,MAAF;AAAUC,MAAAA,KAAV;AAAiBC,MAAAA;AAAjB,KAA4C;;AAC/C,QAAI,CAAC,KAAKC,OAAV,EAAmB;AACjB,YAAM,IAAIC,KAAJ,CAAU,kCAAV,CAAN;AACD;;AACD,UAAM;AAAEC,MAAAA;AAAF,QAAc,KAAKxB,KAAzB;AACA,UAAM;AAAEG,MAAAA,MAAF;AAAUO,MAAAA,MAAV;AAAkBD,MAAAA;AAAlB,QAA2B,KAAKa,OAAtC;AACAH,IAAAA,MAAM,CAACM,SAAP,CACEf,MADF,EAEEW,OAAO,KAAK,CAAZ,GACIlB,MADJ,GAEIA,MAAM,IACJA,MAAM,CAACW,GAAP,CAAYC,CAAD,IAAO;AAChBA,MAAAA,CAAC,CAACtB,KAAD,CAAD,GAAWsB,CAAC,CAACtB,KAAD,CAAD,GAAW4B,OAAtB;AACA,aAAON,CAAP;AACD,KAHD,CALR,EASES,OATF,EAUEf,IAVF,EAWEW,KAXF;AAaD;;AAvDD","sourcesContent":["import type { SkColor, SkPoint } from \"../../../skia/types\";\nimport { BlendMode } from \"../../../skia/types\";\nimport type { DrawingContext, PatchProps } from \"../../types\";\nimport { NodeType } from \"../../types\";\nimport { ALPHA, enumKey, processColor } from \"../datatypes\";\nimport { JsiDrawingNode } from \"../DrawingNode\";\nimport type { NodeContext } from \"../Node\";\n\nexport class PatchNode extends JsiDrawingNode<\n PatchProps,\n { points: SkPoint[]; colors: SkColor[] | undefined; mode: BlendMode }\n> {\n constructor(ctx: NodeContext, props: PatchProps) {\n super(ctx, NodeType.Patch, props);\n }\n\n deriveProps() {\n const { colors, blendMode, patch } = this.props;\n const defaultBlendMode = colors ? BlendMode.DstOver : BlendMode.SrcOver;\n const mode = blendMode ? BlendMode[enumKey(blendMode)] : defaultBlendMode;\n // Patch requires a path with the following constraints:\n // M tl\n // C c1 c2 br\n // C c1 c2 bl\n // C c1 c2 tl (the redundant point in the last command is removed)\n return {\n mode,\n points: [\n patch[0].pos,\n patch[0].c2,\n patch[1].c1,\n patch[1].pos,\n patch[1].c2,\n patch[2].c1,\n patch[2].pos,\n patch[2].c2,\n patch[3].c1,\n patch[3].pos,\n patch[3].c2,\n patch[0].c1,\n ],\n colors: colors\n ? colors.map((c) => processColor(this.Skia, c, 1))\n : undefined,\n };\n }\n\n draw({ canvas, paint, opacity }: DrawingContext) {\n if (!this.derived) {\n throw new Error(\"PatchNode: derived props not set\");\n }\n const { texture } = this.props;\n const { colors, points, mode } = this.derived;\n canvas.drawPatch(\n points,\n opacity === 1\n ? colors\n : colors &&\n colors.map((c) => {\n c[ALPHA] = c[ALPHA] * opacity;\n return c;\n }),\n texture,\n mode,\n paint\n );\n }\n}\n"]}
|
@@ -0,0 +1,55 @@
|
|
1
|
+
import { FillType } from "../../../skia/types";
|
2
|
+
import { NodeType } from "../../types";
|
3
|
+
import { enumKey, processPath } from "../datatypes";
|
4
|
+
import { JsiDrawingNode } from "../DrawingNode";
|
5
|
+
export class PathNode extends JsiDrawingNode {
|
6
|
+
constructor(ctx, props) {
|
7
|
+
super(ctx, NodeType.Path, props);
|
8
|
+
}
|
9
|
+
|
10
|
+
deriveProps() {
|
11
|
+
const {
|
12
|
+
start,
|
13
|
+
end,
|
14
|
+
fillType,
|
15
|
+
stroke,
|
16
|
+
...pathProps
|
17
|
+
} = this.props;
|
18
|
+
const hasStartOffset = start !== 0;
|
19
|
+
const hasEndOffset = end !== 1;
|
20
|
+
const hasStrokeOptions = stroke !== undefined;
|
21
|
+
const hasFillType = !!fillType;
|
22
|
+
const willMutatePath = hasStartOffset || hasEndOffset || hasStrokeOptions || hasFillType;
|
23
|
+
const pristinePath = processPath(this.Skia, pathProps.path);
|
24
|
+
const path = willMutatePath ? pristinePath.copy() : pristinePath;
|
25
|
+
|
26
|
+
if (hasFillType) {
|
27
|
+
path.setFillType(FillType[enumKey(fillType)]);
|
28
|
+
}
|
29
|
+
|
30
|
+
if (hasStrokeOptions) {
|
31
|
+
path.stroke(stroke);
|
32
|
+
}
|
33
|
+
|
34
|
+
if (hasStartOffset || hasEndOffset) {
|
35
|
+
path.trim(start, end, false);
|
36
|
+
}
|
37
|
+
|
38
|
+
return path;
|
39
|
+
}
|
40
|
+
|
41
|
+
draw(_ref) {
|
42
|
+
let {
|
43
|
+
canvas,
|
44
|
+
paint
|
45
|
+
} = _ref;
|
46
|
+
|
47
|
+
if (!this.derived) {
|
48
|
+
throw new Error("Path not initialized");
|
49
|
+
}
|
50
|
+
|
51
|
+
canvas.drawPath(this.derived, paint);
|
52
|
+
}
|
53
|
+
|
54
|
+
}
|
55
|
+
//# sourceMappingURL=PathNode.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["PathNode.ts"],"names":["FillType","NodeType","enumKey","processPath","JsiDrawingNode","PathNode","constructor","ctx","props","Path","deriveProps","start","end","fillType","stroke","pathProps","hasStartOffset","hasEndOffset","hasStrokeOptions","undefined","hasFillType","willMutatePath","pristinePath","Skia","path","copy","setFillType","trim","draw","canvas","paint","derived","Error","drawPath"],"mappings":"AAAA,SAASA,QAAT,QAAyB,qBAAzB;AAGA,SAASC,QAAT,QAAyB,aAAzB;AACA,SAASC,OAAT,EAAkBC,WAAlB,QAAqC,cAArC;AACA,SAASC,cAAT,QAA+B,gBAA/B;AAGA,OAAO,MAAMC,QAAN,SAAuBD,cAAvB,CAAyD;AAC9DE,EAAAA,WAAW,CAACC,GAAD,EAAmBC,KAAnB,EAAqC;AAC9C,UAAMD,GAAN,EAAWN,QAAQ,CAACQ,IAApB,EAA0BD,KAA1B;AACD;;AAESE,EAAAA,WAAW,GAAG;AACtB,UAAM;AAAEC,MAAAA,KAAF;AAASC,MAAAA,GAAT;AAAcC,MAAAA,QAAd;AAAwBC,MAAAA,MAAxB;AAAgC,SAAGC;AAAnC,QAAiD,KAAKP,KAA5D;AACA,UAAMQ,cAAc,GAAGL,KAAK,KAAK,CAAjC;AACA,UAAMM,YAAY,GAAGL,GAAG,KAAK,CAA7B;AACA,UAAMM,gBAAgB,GAAGJ,MAAM,KAAKK,SAApC;AACA,UAAMC,WAAW,GAAG,CAAC,CAACP,QAAtB;AACA,UAAMQ,cAAc,GAClBL,cAAc,IAAIC,YAAlB,IAAkCC,gBAAlC,IAAsDE,WADxD;AAEA,UAAME,YAAY,GAAGnB,WAAW,CAAC,KAAKoB,IAAN,EAAYR,SAAS,CAACS,IAAtB,CAAhC;AACA,UAAMA,IAAI,GAAGH,cAAc,GAAGC,YAAY,CAACG,IAAb,EAAH,GAAyBH,YAApD;;AACA,QAAIF,WAAJ,EAAiB;AACfI,MAAAA,IAAI,CAACE,WAAL,CAAiB1B,QAAQ,CAACE,OAAO,CAACW,QAAD,CAAR,CAAzB;AACD;;AACD,QAAIK,gBAAJ,EAAsB;AACpBM,MAAAA,IAAI,CAACV,MAAL,CAAYA,MAAZ;AACD;;AACD,QAAIE,cAAc,IAAIC,YAAtB,EAAoC;AAClCO,MAAAA,IAAI,CAACG,IAAL,CAAUhB,KAAV,EAAiBC,GAAjB,EAAsB,KAAtB;AACD;;AACD,WAAOY,IAAP;AACD;;AAEDI,EAAAA,IAAI,OAAoC;AAAA,QAAnC;AAAEC,MAAAA,MAAF;AAAUC,MAAAA;AAAV,KAAmC;;AACtC,QAAI,CAAC,KAAKC,OAAV,EAAmB;AACjB,YAAM,IAAIC,KAAJ,CAAU,sBAAV,CAAN;AACD;;AACDH,IAAAA,MAAM,CAACI,QAAP,CAAgB,KAAKF,OAArB,EAA8BD,KAA9B;AACD;;AAhC6D","sourcesContent":["import { FillType } from \"../../../skia/types\";\nimport type { SkPath } from \"../../../skia/types\";\nimport type { DrawingContext, PathProps } from \"../../types\";\nimport { NodeType } from \"../../types\";\nimport { enumKey, processPath } from \"../datatypes\";\nimport { JsiDrawingNode } from \"../DrawingNode\";\nimport type { NodeContext } from \"../Node\";\n\nexport class PathNode extends JsiDrawingNode<PathProps, SkPath> {\n constructor(ctx: NodeContext, props: PathProps) {\n super(ctx, NodeType.Path, props);\n }\n\n protected deriveProps() {\n const { start, end, fillType, stroke, ...pathProps } = this.props;\n const hasStartOffset = start !== 0;\n const hasEndOffset = end !== 1;\n const hasStrokeOptions = stroke !== undefined;\n const hasFillType = !!fillType;\n const willMutatePath =\n hasStartOffset || hasEndOffset || hasStrokeOptions || hasFillType;\n const pristinePath = processPath(this.Skia, pathProps.path);\n const path = willMutatePath ? pristinePath.copy() : pristinePath;\n if (hasFillType) {\n path.setFillType(FillType[enumKey(fillType)]);\n }\n if (hasStrokeOptions) {\n path.stroke(stroke);\n }\n if (hasStartOffset || hasEndOffset) {\n path.trim(start, end, false);\n }\n return path;\n }\n\n draw({ canvas, paint }: DrawingContext) {\n if (!this.derived) {\n throw new Error(\"Path not initialized\");\n }\n canvas.drawPath(this.derived, paint);\n }\n}\n"]}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import { NodeType } from "../../types";
|
2
|
+
import { JsiDrawingNode } from "../DrawingNode";
|
3
|
+
export class PictureNode extends JsiDrawingNode {
|
4
|
+
constructor(ctx, props) {
|
5
|
+
super(ctx, NodeType.Picture, props);
|
6
|
+
}
|
7
|
+
|
8
|
+
deriveProps() {
|
9
|
+
return null;
|
10
|
+
}
|
11
|
+
|
12
|
+
draw(_ref) {
|
13
|
+
let {
|
14
|
+
canvas
|
15
|
+
} = _ref;
|
16
|
+
const {
|
17
|
+
picture
|
18
|
+
} = this.props;
|
19
|
+
canvas.drawPicture(picture);
|
20
|
+
}
|
21
|
+
|
22
|
+
}
|
23
|
+
//# sourceMappingURL=PictureNode.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["PictureNode.ts"],"names":["NodeType","JsiDrawingNode","PictureNode","constructor","ctx","props","Picture","deriveProps","draw","canvas","picture","drawPicture"],"mappings":"AACA,SAASA,QAAT,QAAyB,aAAzB;AACA,SAASC,cAAT,QAA+B,gBAA/B;AAGA,OAAO,MAAMC,WAAN,SAA0BD,cAA1B,CAA6D;AAClEE,EAAAA,WAAW,CAACC,GAAD,EAAmBC,KAAnB,EAAwC;AACjD,UAAMD,GAAN,EAAWJ,QAAQ,CAACM,OAApB,EAA6BD,KAA7B;AACD;;AAEDE,EAAAA,WAAW,GAAG;AACZ,WAAO,IAAP;AACD;;AAEDC,EAAAA,IAAI,OAA6B;AAAA,QAA5B;AAAEC,MAAAA;AAAF,KAA4B;AAC/B,UAAM;AAAEC,MAAAA;AAAF,QAAc,KAAKL,KAAzB;AACAI,IAAAA,MAAM,CAACE,WAAP,CAAmBD,OAAnB;AACD;;AAZiE","sourcesContent":["import type { DrawingContext, PictureProps } from \"../../types\";\nimport { NodeType } from \"../../types\";\nimport { JsiDrawingNode } from \"../DrawingNode\";\nimport type { NodeContext } from \"../Node\";\n\nexport class PictureNode extends JsiDrawingNode<PictureProps, null> {\n constructor(ctx: NodeContext, props: PictureProps) {\n super(ctx, NodeType.Picture, props);\n }\n\n deriveProps() {\n return null;\n }\n\n draw({ canvas }: DrawingContext) {\n const { picture } = this.props;\n canvas.drawPicture(picture);\n }\n}\n"]}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import { PointMode } from "../../../skia/types";
|
2
|
+
import { NodeType } from "../../types";
|
3
|
+
import { enumKey } from "../datatypes";
|
4
|
+
import { JsiDrawingNode } from "../DrawingNode";
|
5
|
+
export class PointsNode extends JsiDrawingNode {
|
6
|
+
constructor(ctx, props) {
|
7
|
+
super(ctx, NodeType.Points, props);
|
8
|
+
}
|
9
|
+
|
10
|
+
deriveProps() {
|
11
|
+
return null;
|
12
|
+
}
|
13
|
+
|
14
|
+
draw(_ref) {
|
15
|
+
let {
|
16
|
+
canvas,
|
17
|
+
paint
|
18
|
+
} = _ref;
|
19
|
+
const {
|
20
|
+
points,
|
21
|
+
mode
|
22
|
+
} = this.props;
|
23
|
+
canvas.drawPoints(PointMode[enumKey(mode)], points, paint);
|
24
|
+
}
|
25
|
+
|
26
|
+
}
|
27
|
+
//# sourceMappingURL=PointsNode.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["PointsNode.ts"],"names":["PointMode","NodeType","enumKey","JsiDrawingNode","PointsNode","constructor","ctx","props","Points","deriveProps","draw","canvas","paint","points","mode","drawPoints"],"mappings":"AAAA,SAASA,SAAT,QAA0B,qBAA1B;AAEA,SAASC,QAAT,QAAyB,aAAzB;AACA,SAASC,OAAT,QAAwB,cAAxB;AACA,SAASC,cAAT,QAA+B,gBAA/B;AAGA,OAAO,MAAMC,UAAN,SAAyBD,cAAzB,CAA2D;AAChEE,EAAAA,WAAW,CAACC,GAAD,EAAmBC,KAAnB,EAAuC;AAChD,UAAMD,GAAN,EAAWL,QAAQ,CAACO,MAApB,EAA4BD,KAA5B;AACD;;AAEDE,EAAAA,WAAW,GAAG;AACZ,WAAO,IAAP;AACD;;AAEDC,EAAAA,IAAI,OAAoC;AAAA,QAAnC;AAAEC,MAAAA,MAAF;AAAUC,MAAAA;AAAV,KAAmC;AACtC,UAAM;AAAEC,MAAAA,MAAF;AAAUC,MAAAA;AAAV,QAAmB,KAAKP,KAA9B;AACAI,IAAAA,MAAM,CAACI,UAAP,CAAkBf,SAAS,CAACE,OAAO,CAACY,IAAD,CAAR,CAA3B,EAA4CD,MAA5C,EAAoDD,KAApD;AACD;;AAZ+D","sourcesContent":["import { PointMode } from \"../../../skia/types\";\nimport type { DrawingContext, PointsProps } from \"../../types\";\nimport { NodeType } from \"../../types\";\nimport { enumKey } from \"../datatypes\";\nimport { JsiDrawingNode } from \"../DrawingNode\";\nimport type { NodeContext } from \"../Node\";\n\nexport class PointsNode extends JsiDrawingNode<PointsProps, null> {\n constructor(ctx: NodeContext, props: PointsProps) {\n super(ctx, NodeType.Points, props);\n }\n\n deriveProps() {\n return null;\n }\n\n draw({ canvas, paint }: DrawingContext) {\n const { points, mode } = this.props;\n canvas.drawPoints(PointMode[enumKey(mode)], points, paint);\n }\n}\n"]}
|
@@ -0,0 +1,31 @@
|
|
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 { NodeType } from "../../types";
|
4
|
+
import { processRRect } from "../datatypes";
|
5
|
+
import { JsiDrawingNode } from "../DrawingNode";
|
6
|
+
export class RRectNode extends JsiDrawingNode {
|
7
|
+
constructor(ctx, props) {
|
8
|
+
super(ctx, NodeType.RRect, props);
|
9
|
+
|
10
|
+
_defineProperty(this, "rect", void 0);
|
11
|
+
}
|
12
|
+
|
13
|
+
deriveProps() {
|
14
|
+
return processRRect(this.Skia, this.props);
|
15
|
+
}
|
16
|
+
|
17
|
+
draw(_ref) {
|
18
|
+
let {
|
19
|
+
canvas,
|
20
|
+
paint
|
21
|
+
} = _ref;
|
22
|
+
|
23
|
+
if (this.derived === undefined) {
|
24
|
+
throw new Error("RRectNode: rect is undefined");
|
25
|
+
}
|
26
|
+
|
27
|
+
canvas.drawRRect(this.derived, paint);
|
28
|
+
}
|
29
|
+
|
30
|
+
}
|
31
|
+
//# sourceMappingURL=RRectNode.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["RRectNode.ts"],"names":["NodeType","processRRect","JsiDrawingNode","RRectNode","constructor","ctx","props","RRect","deriveProps","Skia","draw","canvas","paint","derived","undefined","Error","drawRRect"],"mappings":";;AAEA,SAASA,QAAT,QAAyB,aAAzB;AACA,SAASC,YAAT,QAA6B,cAA7B;AACA,SAASC,cAAT,QAA+B,gBAA/B;AAGA,OAAO,MAAMC,SAAN,SAAwBD,cAAxB,CAAkE;AAGvEE,EAAAA,WAAW,CAACC,GAAD,EAAmBC,KAAnB,EAA4C;AACrD,UAAMD,GAAN,EAAWL,QAAQ,CAACO,KAApB,EAA2BD,KAA3B;;AADqD;AAEtD;;AAESE,EAAAA,WAAW,GAAG;AACtB,WAAOP,YAAY,CAAC,KAAKQ,IAAN,EAAY,KAAKH,KAAjB,CAAnB;AACD;;AAEDI,EAAAA,IAAI,OAAoC;AAAA,QAAnC;AAAEC,MAAAA,MAAF;AAAUC,MAAAA;AAAV,KAAmC;;AACtC,QAAI,KAAKC,OAAL,KAAiBC,SAArB,EAAgC;AAC9B,YAAM,IAAIC,KAAJ,CAAU,8BAAV,CAAN;AACD;;AACDJ,IAAAA,MAAM,CAACK,SAAP,CAAiB,KAAKH,OAAtB,EAA+BD,KAA/B;AACD;;AAhBsE","sourcesContent":["import type { SkRRect } from \"../../../skia/types\";\nimport type { DrawingContext, RoundedRectProps } from \"../../types\";\nimport { NodeType } from \"../../types\";\nimport { processRRect } from \"../datatypes\";\nimport { JsiDrawingNode } from \"../DrawingNode\";\nimport type { NodeContext } from \"../Node\";\n\nexport class RRectNode extends JsiDrawingNode<RoundedRectProps, SkRRect> {\n rect?: SkRRect;\n\n constructor(ctx: NodeContext, props: RoundedRectProps) {\n super(ctx, NodeType.RRect, props);\n }\n\n protected deriveProps() {\n return processRRect(this.Skia, this.props);\n }\n\n draw({ canvas, paint }: DrawingContext) {\n if (this.derived === undefined) {\n throw new Error(\"RRectNode: rect is undefined\");\n }\n canvas.drawRRect(this.derived, paint);\n }\n}\n"]}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import { NodeType } from "../../types";
|
2
|
+
import { processRect } from "../datatypes";
|
3
|
+
import { JsiDrawingNode } from "../DrawingNode";
|
4
|
+
export class RectNode extends JsiDrawingNode {
|
5
|
+
constructor(ctx, props) {
|
6
|
+
super(ctx, NodeType.Rect, props);
|
7
|
+
}
|
8
|
+
|
9
|
+
deriveProps() {
|
10
|
+
return processRect(this.Skia, this.props);
|
11
|
+
}
|
12
|
+
|
13
|
+
draw(_ref) {
|
14
|
+
let {
|
15
|
+
canvas,
|
16
|
+
paint
|
17
|
+
} = _ref;
|
18
|
+
|
19
|
+
if (this.derived === undefined) {
|
20
|
+
throw new Error("RectNode: rect is undefined");
|
21
|
+
}
|
22
|
+
|
23
|
+
canvas.drawRect(this.derived, paint);
|
24
|
+
}
|
25
|
+
|
26
|
+
}
|
27
|
+
//# sourceMappingURL=RectNode.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["RectNode.ts"],"names":["NodeType","processRect","JsiDrawingNode","RectNode","constructor","ctx","props","Rect","deriveProps","Skia","draw","canvas","paint","derived","undefined","Error","drawRect"],"mappings":"AAEA,SAASA,QAAT,QAAyB,aAAzB;AACA,SAASC,WAAT,QAA4B,cAA5B;AACA,SAASC,cAAT,QAA+B,gBAA/B;AAGA,OAAO,MAAMC,QAAN,SAAuBD,cAAvB,CAAyD;AAC9DE,EAAAA,WAAW,CAACC,GAAD,EAAmBC,KAAnB,EAAqC;AAC9C,UAAMD,GAAN,EAAWL,QAAQ,CAACO,IAApB,EAA0BD,KAA1B;AACD;;AAEDE,EAAAA,WAAW,GAAG;AACZ,WAAOP,WAAW,CAAC,KAAKQ,IAAN,EAAY,KAAKH,KAAjB,CAAlB;AACD;;AAEDI,EAAAA,IAAI,OAAoC;AAAA,QAAnC;AAAEC,MAAAA,MAAF;AAAUC,MAAAA;AAAV,KAAmC;;AACtC,QAAI,KAAKC,OAAL,KAAiBC,SAArB,EAAgC;AAC9B,YAAM,IAAIC,KAAJ,CAAU,6BAAV,CAAN;AACD;;AACDJ,IAAAA,MAAM,CAACK,QAAP,CAAgB,KAAKH,OAArB,EAA8BD,KAA9B;AACD;;AAd6D","sourcesContent":["import type { SkRect } from \"../../../skia/types/Rect\";\nimport type { DrawingContext, RectProps } from \"../../types\";\nimport { NodeType } from \"../../types\";\nimport { processRect } from \"../datatypes\";\nimport { JsiDrawingNode } from \"../DrawingNode\";\nimport type { NodeContext } from \"../Node\";\n\nexport class RectNode extends JsiDrawingNode<RectProps, SkRect> {\n constructor(ctx: NodeContext, props: RectProps) {\n super(ctx, NodeType.Rect, props);\n }\n\n deriveProps() {\n return processRect(this.Skia, this.props);\n }\n\n draw({ canvas, paint }: DrawingContext) {\n if (this.derived === undefined) {\n throw new Error(\"RectNode: rect is undefined\");\n }\n canvas.drawRect(this.derived, paint);\n }\n}\n"]}
|
@@ -0,0 +1,164 @@
|
|
1
|
+
import { NodeType } from "../../types";
|
2
|
+
import { processPath } from "../datatypes";
|
3
|
+
import { JsiDrawingNode } from "../DrawingNode";
|
4
|
+
export class TextNode extends JsiDrawingNode {
|
5
|
+
constructor(ctx, props) {
|
6
|
+
super(ctx, NodeType.Text, props);
|
7
|
+
}
|
8
|
+
|
9
|
+
deriveProps() {
|
10
|
+
return null;
|
11
|
+
}
|
12
|
+
|
13
|
+
draw(_ref) {
|
14
|
+
let {
|
15
|
+
canvas,
|
16
|
+
paint
|
17
|
+
} = _ref;
|
18
|
+
const {
|
19
|
+
text,
|
20
|
+
x,
|
21
|
+
y,
|
22
|
+
font
|
23
|
+
} = this.props;
|
24
|
+
canvas.drawText(text, x, y, paint, font);
|
25
|
+
}
|
26
|
+
|
27
|
+
}
|
28
|
+
export class TextPathNode extends JsiDrawingNode {
|
29
|
+
constructor(ctx, props) {
|
30
|
+
super(ctx, NodeType.TextPath, props);
|
31
|
+
}
|
32
|
+
|
33
|
+
deriveProps() {
|
34
|
+
const path = processPath(this.Skia, this.props.path);
|
35
|
+
const {
|
36
|
+
font,
|
37
|
+
initialOffset
|
38
|
+
} = this.props;
|
39
|
+
let {
|
40
|
+
text
|
41
|
+
} = this.props;
|
42
|
+
const ids = font.getGlyphIDs(text);
|
43
|
+
const widths = font.getGlyphWidths(ids);
|
44
|
+
const rsx = [];
|
45
|
+
const meas = this.Skia.ContourMeasureIter(path, false, 1);
|
46
|
+
let cont = meas.next();
|
47
|
+
let dist = initialOffset;
|
48
|
+
|
49
|
+
for (let i = 0; i < text.length && cont; i++) {
|
50
|
+
const width = widths[i];
|
51
|
+
dist += width / 2;
|
52
|
+
|
53
|
+
if (dist > cont.length()) {
|
54
|
+
// jump to next contour
|
55
|
+
cont = meas.next();
|
56
|
+
|
57
|
+
if (!cont) {
|
58
|
+
// We have come to the end of the path - terminate the string
|
59
|
+
// right here.
|
60
|
+
text = text.substring(0, i);
|
61
|
+
break;
|
62
|
+
}
|
63
|
+
|
64
|
+
dist = width / 2;
|
65
|
+
} // Gives us the (x, y) coordinates as well as the cos/sin of the tangent
|
66
|
+
// line at that position.
|
67
|
+
|
68
|
+
|
69
|
+
const {
|
70
|
+
px,
|
71
|
+
py,
|
72
|
+
tx,
|
73
|
+
ty
|
74
|
+
} = cont.getPosTan(dist);
|
75
|
+
const adjustedX = px - width / 2 * tx;
|
76
|
+
const adjustedY = py - width / 2 * ty;
|
77
|
+
rsx.push(this.Skia.RSXform(tx, ty, adjustedX, adjustedY));
|
78
|
+
dist += width / 2;
|
79
|
+
}
|
80
|
+
|
81
|
+
return this.Skia.TextBlob.MakeFromRSXform(text, rsx, font);
|
82
|
+
}
|
83
|
+
|
84
|
+
draw(_ref2) {
|
85
|
+
let {
|
86
|
+
canvas,
|
87
|
+
paint
|
88
|
+
} = _ref2;
|
89
|
+
|
90
|
+
if (!this.derived) {
|
91
|
+
throw new Error("TextPathNode: blob is null");
|
92
|
+
}
|
93
|
+
|
94
|
+
canvas.drawTextBlob(this.derived, 0, 0, paint);
|
95
|
+
}
|
96
|
+
|
97
|
+
}
|
98
|
+
export class TextBlobNode extends JsiDrawingNode {
|
99
|
+
constructor(ctx, props) {
|
100
|
+
super(ctx, NodeType.TextBlob, props);
|
101
|
+
}
|
102
|
+
|
103
|
+
deriveProps() {
|
104
|
+
return null;
|
105
|
+
}
|
106
|
+
|
107
|
+
draw(_ref3) {
|
108
|
+
let {
|
109
|
+
canvas,
|
110
|
+
paint
|
111
|
+
} = _ref3;
|
112
|
+
const {
|
113
|
+
blob,
|
114
|
+
x,
|
115
|
+
y
|
116
|
+
} = this.props;
|
117
|
+
canvas.drawTextBlob(blob, x, y, paint);
|
118
|
+
}
|
119
|
+
|
120
|
+
}
|
121
|
+
export class GlyphsNode extends JsiDrawingNode {
|
122
|
+
constructor(ctx, props) {
|
123
|
+
super(ctx, NodeType.Glyphs, props);
|
124
|
+
}
|
125
|
+
|
126
|
+
deriveProps() {
|
127
|
+
return this.props.glyphs.reduce((acc, glyph) => {
|
128
|
+
const {
|
129
|
+
id,
|
130
|
+
pos
|
131
|
+
} = glyph;
|
132
|
+
acc.glyphs.push(id);
|
133
|
+
acc.positions.push(pos);
|
134
|
+
return acc;
|
135
|
+
}, {
|
136
|
+
glyphs: [],
|
137
|
+
positions: []
|
138
|
+
});
|
139
|
+
}
|
140
|
+
|
141
|
+
draw(_ref4) {
|
142
|
+
let {
|
143
|
+
canvas,
|
144
|
+
paint
|
145
|
+
} = _ref4;
|
146
|
+
|
147
|
+
if (!this.derived) {
|
148
|
+
throw new Error("GlyphsNode: processedGlyphs is null");
|
149
|
+
}
|
150
|
+
|
151
|
+
const {
|
152
|
+
glyphs,
|
153
|
+
positions
|
154
|
+
} = this.derived;
|
155
|
+
const {
|
156
|
+
x,
|
157
|
+
y,
|
158
|
+
font
|
159
|
+
} = this.props;
|
160
|
+
canvas.drawGlyphs(glyphs, positions, x, y, font, paint);
|
161
|
+
}
|
162
|
+
|
163
|
+
}
|
164
|
+
//# sourceMappingURL=Text.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["Text.ts"],"names":["NodeType","processPath","JsiDrawingNode","TextNode","constructor","ctx","props","Text","deriveProps","draw","canvas","paint","text","x","y","font","drawText","TextPathNode","TextPath","path","Skia","initialOffset","ids","getGlyphIDs","widths","getGlyphWidths","rsx","meas","ContourMeasureIter","cont","next","dist","i","length","width","substring","px","py","tx","ty","getPosTan","adjustedX","adjustedY","push","RSXform","TextBlob","MakeFromRSXform","derived","Error","drawTextBlob","TextBlobNode","blob","GlyphsNode","Glyphs","glyphs","reduce","acc","glyph","id","pos","positions","drawGlyphs"],"mappings":"AAOA,SAASA,QAAT,QAAyB,aAAzB;AACA,SAASC,WAAT,QAA4B,cAA5B;AAEA,SAASC,cAAT,QAA+B,gBAA/B;AAGA,OAAO,MAAMC,QAAN,SAAuBD,cAAvB,CAAuD;AAC5DE,EAAAA,WAAW,CAACC,GAAD,EAAmBC,KAAnB,EAAqC;AAC9C,UAAMD,GAAN,EAAWL,QAAQ,CAACO,IAApB,EAA0BD,KAA1B;AACD;;AAESE,EAAAA,WAAW,GAAG;AACtB,WAAO,IAAP;AACD;;AAEDC,EAAAA,IAAI,OAAoC;AAAA,QAAnC;AAAEC,MAAAA,MAAF;AAAUC,MAAAA;AAAV,KAAmC;AACtC,UAAM;AAAEC,MAAAA,IAAF;AAAQC,MAAAA,CAAR;AAAWC,MAAAA,CAAX;AAAcC,MAAAA;AAAd,QAAuB,KAAKT,KAAlC;AACAI,IAAAA,MAAM,CAACM,QAAP,CAAgBJ,IAAhB,EAAsBC,CAAtB,EAAyBC,CAAzB,EAA4BH,KAA5B,EAAmCI,IAAnC;AACD;;AAZ2D;AAe9D,OAAO,MAAME,YAAN,SAA2Bf,cAA3B,CAAqE;AAC1EE,EAAAA,WAAW,CAACC,GAAD,EAAmBC,KAAnB,EAAyC;AAClD,UAAMD,GAAN,EAAWL,QAAQ,CAACkB,QAApB,EAA8BZ,KAA9B;AACD;;AAEDE,EAAAA,WAAW,GAAG;AACZ,UAAMW,IAAI,GAAGlB,WAAW,CAAC,KAAKmB,IAAN,EAAY,KAAKd,KAAL,CAAWa,IAAvB,CAAxB;AACA,UAAM;AAAEJ,MAAAA,IAAF;AAAQM,MAAAA;AAAR,QAA0B,KAAKf,KAArC;AACA,QAAI;AAAEM,MAAAA;AAAF,QAAW,KAAKN,KAApB;AACA,UAAMgB,GAAG,GAAGP,IAAI,CAACQ,WAAL,CAAiBX,IAAjB,CAAZ;AACA,UAAMY,MAAM,GAAGT,IAAI,CAACU,cAAL,CAAoBH,GAApB,CAAf;AACA,UAAMI,GAAgB,GAAG,EAAzB;AACA,UAAMC,IAAI,GAAG,KAAKP,IAAL,CAAUQ,kBAAV,CAA6BT,IAA7B,EAAmC,KAAnC,EAA0C,CAA1C,CAAb;AACA,QAAIU,IAAI,GAAGF,IAAI,CAACG,IAAL,EAAX;AACA,QAAIC,IAAI,GAAGV,aAAX;;AACA,SAAK,IAAIW,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGpB,IAAI,CAACqB,MAAT,IAAmBJ,IAAnC,EAAyCG,CAAC,EAA1C,EAA8C;AAC5C,YAAME,KAAK,GAAGV,MAAM,CAACQ,CAAD,CAApB;AACAD,MAAAA,IAAI,IAAIG,KAAK,GAAG,CAAhB;;AACA,UAAIH,IAAI,GAAGF,IAAI,CAACI,MAAL,EAAX,EAA0B;AACxB;AACAJ,QAAAA,IAAI,GAAGF,IAAI,CAACG,IAAL,EAAP;;AACA,YAAI,CAACD,IAAL,EAAW;AACT;AACA;AACAjB,UAAAA,IAAI,GAAGA,IAAI,CAACuB,SAAL,CAAe,CAAf,EAAkBH,CAAlB,CAAP;AACA;AACD;;AACDD,QAAAA,IAAI,GAAGG,KAAK,GAAG,CAAf;AACD,OAb2C,CAc5C;AACA;;;AACA,YAAM;AAAEE,QAAAA,EAAF;AAAMC,QAAAA,EAAN;AAAUC,QAAAA,EAAV;AAAcC,QAAAA;AAAd,UAAqBV,IAAI,CAACW,SAAL,CAAeT,IAAf,CAA3B;AACA,YAAMU,SAAS,GAAGL,EAAE,GAAIF,KAAK,GAAG,CAAT,GAAcI,EAArC;AACA,YAAMI,SAAS,GAAGL,EAAE,GAAIH,KAAK,GAAG,CAAT,GAAcK,EAArC;AACAb,MAAAA,GAAG,CAACiB,IAAJ,CAAS,KAAKvB,IAAL,CAAUwB,OAAV,CAAkBN,EAAlB,EAAsBC,EAAtB,EAA0BE,SAA1B,EAAqCC,SAArC,CAAT;AACAX,MAAAA,IAAI,IAAIG,KAAK,GAAG,CAAhB;AACD;;AACD,WAAO,KAAKd,IAAL,CAAUyB,QAAV,CAAmBC,eAAnB,CAAmClC,IAAnC,EAAyCc,GAAzC,EAA8CX,IAA9C,CAAP;AACD;;AAEDN,EAAAA,IAAI,QAAoC;AAAA,QAAnC;AAAEC,MAAAA,MAAF;AAAUC,MAAAA;AAAV,KAAmC;;AACtC,QAAI,CAAC,KAAKoC,OAAV,EAAmB;AACjB,YAAM,IAAIC,KAAJ,CAAU,4BAAV,CAAN;AACD;;AACDtC,IAAAA,MAAM,CAACuC,YAAP,CAAoB,KAAKF,OAAzB,EAAkC,CAAlC,EAAqC,CAArC,EAAwCpC,KAAxC;AACD;;AA7CyE;AAgD5E,OAAO,MAAMuC,YAAN,SAA2BhD,cAA3B,CAA+D;AACpEE,EAAAA,WAAW,CAACC,GAAD,EAAmBC,KAAnB,EAAyC;AAClD,UAAMD,GAAN,EAAWL,QAAQ,CAAC6C,QAApB,EAA8BvC,KAA9B;AACD;;AAESE,EAAAA,WAAW,GAAG;AACtB,WAAO,IAAP;AACD;;AAEDC,EAAAA,IAAI,QAAoC;AAAA,QAAnC;AAAEC,MAAAA,MAAF;AAAUC,MAAAA;AAAV,KAAmC;AACtC,UAAM;AAAEwC,MAAAA,IAAF;AAAQtC,MAAAA,CAAR;AAAWC,MAAAA;AAAX,QAAiB,KAAKR,KAA5B;AACAI,IAAAA,MAAM,CAACuC,YAAP,CAAoBE,IAApB,EAA0BtC,CAA1B,EAA6BC,CAA7B,EAAgCH,KAAhC;AACD;;AAZmE;AAoBtE,OAAO,MAAMyC,UAAN,SAAyBlD,cAAzB,CAAsE;AAC3EE,EAAAA,WAAW,CAACC,GAAD,EAAmBC,KAAnB,EAAuC;AAChD,UAAMD,GAAN,EAAWL,QAAQ,CAACqD,MAApB,EAA4B/C,KAA5B;AACD;;AAEDE,EAAAA,WAAW,GAAG;AACZ,WAAO,KAAKF,KAAL,CAAWgD,MAAX,CAAkBC,MAAlB,CACL,CAACC,GAAD,EAAMC,KAAN,KAAgB;AACd,YAAM;AAAEC,QAAAA,EAAF;AAAMC,QAAAA;AAAN,UAAcF,KAApB;AACAD,MAAAA,GAAG,CAACF,MAAJ,CAAWX,IAAX,CAAgBe,EAAhB;AACAF,MAAAA,GAAG,CAACI,SAAJ,CAAcjB,IAAd,CAAmBgB,GAAnB;AACA,aAAOH,GAAP;AACD,KANI,EAOL;AAAEF,MAAAA,MAAM,EAAE,EAAV;AAAcM,MAAAA,SAAS,EAAE;AAAzB,KAPK,CAAP;AASD;;AAEDnD,EAAAA,IAAI,QAAoC;AAAA,QAAnC;AAAEC,MAAAA,MAAF;AAAUC,MAAAA;AAAV,KAAmC;;AACtC,QAAI,CAAC,KAAKoC,OAAV,EAAmB;AACjB,YAAM,IAAIC,KAAJ,CAAU,qCAAV,CAAN;AACD;;AACD,UAAM;AAAEM,MAAAA,MAAF;AAAUM,MAAAA;AAAV,QAAwB,KAAKb,OAAnC;AACA,UAAM;AAAElC,MAAAA,CAAF;AAAKC,MAAAA,CAAL;AAAQC,MAAAA;AAAR,QAAiB,KAAKT,KAA5B;AACAI,IAAAA,MAAM,CAACmD,UAAP,CAAkBP,MAAlB,EAA0BM,SAA1B,EAAqC/C,CAArC,EAAwCC,CAAxC,EAA2CC,IAA3C,EAAiDJ,KAAjD;AACD;;AAxB0E","sourcesContent":["import type { SkRSXform, SkTextBlob, SkPoint } from \"../../../skia/types\";\nimport type {\n DrawingContext,\n TextBlobProps,\n TextPathProps,\n TextProps,\n} from \"../../types\";\nimport { NodeType } from \"../../types\";\nimport { processPath } from \"../datatypes\";\nimport type { GlyphsProps } from \"../../types/Drawings\";\nimport { JsiDrawingNode } from \"../DrawingNode\";\nimport type { NodeContext } from \"../Node\";\n\nexport class TextNode extends JsiDrawingNode<TextProps, null> {\n constructor(ctx: NodeContext, props: TextProps) {\n super(ctx, NodeType.Text, props);\n }\n\n protected deriveProps() {\n return null;\n }\n\n draw({ canvas, paint }: DrawingContext) {\n const { text, x, y, font } = this.props;\n canvas.drawText(text, x, y, paint, font);\n }\n}\n\nexport class TextPathNode extends JsiDrawingNode<TextPathProps, SkTextBlob> {\n constructor(ctx: NodeContext, props: TextPathProps) {\n super(ctx, NodeType.TextPath, props);\n }\n\n deriveProps() {\n const path = processPath(this.Skia, this.props.path);\n const { font, initialOffset } = this.props;\n let { text } = this.props;\n const ids = font.getGlyphIDs(text);\n const widths = font.getGlyphWidths(ids);\n const rsx: SkRSXform[] = [];\n const meas = this.Skia.ContourMeasureIter(path, false, 1);\n let cont = meas.next();\n let dist = initialOffset;\n for (let i = 0; i < text.length && cont; i++) {\n const width = widths[i];\n dist += width / 2;\n if (dist > cont.length()) {\n // jump to next contour\n cont = meas.next();\n if (!cont) {\n // We have come to the end of the path - terminate the string\n // right here.\n text = text.substring(0, i);\n break;\n }\n dist = width / 2;\n }\n // Gives us the (x, y) coordinates as well as the cos/sin of the tangent\n // line at that position.\n const { px, py, tx, ty } = cont.getPosTan(dist);\n const adjustedX = px - (width / 2) * tx;\n const adjustedY = py - (width / 2) * ty;\n rsx.push(this.Skia.RSXform(tx, ty, adjustedX, adjustedY));\n dist += width / 2;\n }\n return this.Skia.TextBlob.MakeFromRSXform(text, rsx, font);\n }\n\n draw({ canvas, paint }: DrawingContext) {\n if (!this.derived) {\n throw new Error(\"TextPathNode: blob is null\");\n }\n canvas.drawTextBlob(this.derived, 0, 0, paint);\n }\n}\n\nexport class TextBlobNode extends JsiDrawingNode<TextBlobProps, null> {\n constructor(ctx: NodeContext, props: TextBlobProps) {\n super(ctx, NodeType.TextBlob, props);\n }\n\n protected deriveProps() {\n return null;\n }\n\n draw({ canvas, paint }: DrawingContext) {\n const { blob, x, y } = this.props;\n canvas.drawTextBlob(blob, x, y, paint);\n }\n}\n\ninterface ProcessedGlyphs {\n glyphs: number[];\n positions: SkPoint[];\n}\n\nexport class GlyphsNode extends JsiDrawingNode<GlyphsProps, ProcessedGlyphs> {\n constructor(ctx: NodeContext, props: GlyphsProps) {\n super(ctx, NodeType.Glyphs, props);\n }\n\n deriveProps() {\n return this.props.glyphs.reduce<ProcessedGlyphs>(\n (acc, glyph) => {\n const { id, pos } = glyph;\n acc.glyphs.push(id);\n acc.positions.push(pos);\n return acc;\n },\n { glyphs: [], positions: [] }\n );\n }\n\n draw({ canvas, paint }: DrawingContext) {\n if (!this.derived) {\n throw new Error(\"GlyphsNode: processedGlyphs is null\");\n }\n const { glyphs, positions } = this.derived;\n const { x, y, font } = this.props;\n canvas.drawGlyphs(glyphs, positions, x, y, font, paint);\n }\n}\n"]}
|
@@ -0,0 +1,42 @@
|
|
1
|
+
import { VertexMode, BlendMode } from "../../../skia/types";
|
2
|
+
import { NodeType } from "../../types";
|
3
|
+
import { enumKey, processColor } from "../datatypes";
|
4
|
+
import { JsiDrawingNode } from "../DrawingNode";
|
5
|
+
export class VerticesNode extends JsiDrawingNode {
|
6
|
+
constructor(ctx, props) {
|
7
|
+
super(ctx, NodeType.Vertices, props);
|
8
|
+
}
|
9
|
+
|
10
|
+
deriveProps() {
|
11
|
+
const {
|
12
|
+
mode,
|
13
|
+
vertices,
|
14
|
+
textures,
|
15
|
+
colors,
|
16
|
+
indices
|
17
|
+
} = this.props;
|
18
|
+
const vertexMode = mode ? VertexMode[enumKey(mode)] : VertexMode.Triangles;
|
19
|
+
return this.Skia.MakeVertices(vertexMode, vertices, textures, colors ? colors.map(c => processColor(this.Skia, c, 1)) : undefined, indices);
|
20
|
+
}
|
21
|
+
|
22
|
+
draw(_ref) {
|
23
|
+
let {
|
24
|
+
canvas,
|
25
|
+
paint
|
26
|
+
} = _ref;
|
27
|
+
const {
|
28
|
+
colors,
|
29
|
+
blendMode
|
30
|
+
} = this.props;
|
31
|
+
const defaultBlendMode = colors ? BlendMode.DstOver : BlendMode.SrcOver;
|
32
|
+
const blend = blendMode ? BlendMode[enumKey(blendMode)] : defaultBlendMode;
|
33
|
+
|
34
|
+
if (this.derived === undefined) {
|
35
|
+
throw new Error("VerticesNode: vertices is undefined");
|
36
|
+
}
|
37
|
+
|
38
|
+
canvas.drawVertices(this.derived, blend, paint);
|
39
|
+
}
|
40
|
+
|
41
|
+
}
|
42
|
+
//# sourceMappingURL=VerticesNode.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["VerticesNode.ts"],"names":["VertexMode","BlendMode","NodeType","enumKey","processColor","JsiDrawingNode","VerticesNode","constructor","ctx","props","Vertices","deriveProps","mode","vertices","textures","colors","indices","vertexMode","Triangles","Skia","MakeVertices","map","c","undefined","draw","canvas","paint","blendMode","defaultBlendMode","DstOver","SrcOver","blend","derived","Error","drawVertices"],"mappings":"AACA,SAASA,UAAT,EAAqBC,SAArB,QAAsC,qBAAtC;AAEA,SAASC,QAAT,QAAyB,aAAzB;AACA,SAASC,OAAT,EAAkBC,YAAlB,QAAsC,cAAtC;AACA,SAASC,cAAT,QAA+B,gBAA/B;AAGA,OAAO,MAAMC,YAAN,SAA2BD,cAA3B,CAAqE;AAC1EE,EAAAA,WAAW,CAACC,GAAD,EAAmBC,KAAnB,EAAyC;AAClD,UAAMD,GAAN,EAAWN,QAAQ,CAACQ,QAApB,EAA8BD,KAA9B;AACD;;AAESE,EAAAA,WAAW,GAAG;AACtB,UAAM;AAAEC,MAAAA,IAAF;AAAQC,MAAAA,QAAR;AAAkBC,MAAAA,QAAlB;AAA4BC,MAAAA,MAA5B;AAAoCC,MAAAA;AAApC,QAAgD,KAAKP,KAA3D;AACA,UAAMQ,UAAU,GAAGL,IAAI,GAAGZ,UAAU,CAACG,OAAO,CAACS,IAAD,CAAR,CAAb,GAA+BZ,UAAU,CAACkB,SAAjE;AACA,WAAO,KAAKC,IAAL,CAAUC,YAAV,CACLH,UADK,EAELJ,QAFK,EAGLC,QAHK,EAILC,MAAM,GAAGA,MAAM,CAACM,GAAP,CAAYC,CAAD,IAAOlB,YAAY,CAAC,KAAKe,IAAN,EAAYG,CAAZ,EAAe,CAAf,CAA9B,CAAH,GAAsDC,SAJvD,EAKLP,OALK,CAAP;AAOD;;AAEDQ,EAAAA,IAAI,OAAoC;AAAA,QAAnC;AAAEC,MAAAA,MAAF;AAAUC,MAAAA;AAAV,KAAmC;AACtC,UAAM;AAAEX,MAAAA,MAAF;AAAUY,MAAAA;AAAV,QAAwB,KAAKlB,KAAnC;AACA,UAAMmB,gBAAgB,GAAGb,MAAM,GAAGd,SAAS,CAAC4B,OAAb,GAAuB5B,SAAS,CAAC6B,OAAhE;AACA,UAAMC,KAAK,GAAGJ,SAAS,GAAG1B,SAAS,CAACE,OAAO,CAACwB,SAAD,CAAR,CAAZ,GAAmCC,gBAA1D;;AACA,QAAI,KAAKI,OAAL,KAAiBT,SAArB,EAAgC;AAC9B,YAAM,IAAIU,KAAJ,CAAU,qCAAV,CAAN;AACD;;AACDR,IAAAA,MAAM,CAACS,YAAP,CAAoB,KAAKF,OAAzB,EAAkCD,KAAlC,EAAyCL,KAAzC;AACD;;AAzByE","sourcesContent":["import type { SkVertices } from \"../../../skia/types\";\nimport { VertexMode, BlendMode } from \"../../../skia/types\";\nimport type { DrawingContext, VerticesProps } from \"../../types\";\nimport { NodeType } from \"../../types\";\nimport { enumKey, processColor } from \"../datatypes\";\nimport { JsiDrawingNode } from \"../DrawingNode\";\nimport type { NodeContext } from \"../Node\";\n\nexport class VerticesNode extends JsiDrawingNode<VerticesProps, SkVertices> {\n constructor(ctx: NodeContext, props: VerticesProps) {\n super(ctx, NodeType.Vertices, props);\n }\n\n protected deriveProps() {\n const { mode, vertices, textures, colors, indices } = this.props;\n const vertexMode = mode ? VertexMode[enumKey(mode)] : VertexMode.Triangles;\n return this.Skia.MakeVertices(\n vertexMode,\n vertices,\n textures,\n colors ? colors.map((c) => processColor(this.Skia, c, 1)) : undefined,\n indices\n );\n }\n\n draw({ canvas, paint }: DrawingContext) {\n const { colors, blendMode } = this.props;\n const defaultBlendMode = colors ? BlendMode.DstOver : BlendMode.SrcOver;\n const blend = blendMode ? BlendMode[enumKey(blendMode)] : defaultBlendMode;\n if (this.derived === undefined) {\n throw new Error(\"VerticesNode: vertices is undefined\");\n }\n canvas.drawVertices(this.derived, blend, paint);\n }\n}\n"]}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
export * from "./CircleNode";
|
2
|
+
export * from "./FillNode";
|
3
|
+
export * from "./ImageNode";
|
4
|
+
export * from "./PointsNode";
|
5
|
+
export * from "./PathNode";
|
6
|
+
export * from "./RectNode";
|
7
|
+
export * from "./RRectNode";
|
8
|
+
export * from "./OvalNode";
|
9
|
+
export * from "./LineNode";
|
10
|
+
export * from "./PatchNode";
|
11
|
+
export * from "./VerticesNode";
|
12
|
+
export * from "./CustomDrawingNode";
|
13
|
+
export * from "./Text";
|
14
|
+
export * from "./PictureNode";
|
15
|
+
export * from "./DiffRectNode";
|
16
|
+
export * from "./ImageSVG";
|
17
|
+
export * from "./BackdropFilterNode";
|
18
|
+
export * from "./Box";
|
19
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAd;AACA,cAAc,YAAd;AACA,cAAc,aAAd;AACA,cAAc,cAAd;AACA,cAAc,YAAd;AACA,cAAc,YAAd;AACA,cAAc,aAAd;AACA,cAAc,YAAd;AACA,cAAc,YAAd;AACA,cAAc,aAAd;AACA,cAAc,gBAAd;AACA,cAAc,qBAAd;AACA,cAAc,QAAd;AACA,cAAc,eAAd;AACA,cAAc,gBAAd;AACA,cAAc,YAAd;AACA,cAAc,sBAAd;AACA,cAAc,OAAd","sourcesContent":["export * from \"./CircleNode\";\nexport * from \"./FillNode\";\nexport * from \"./ImageNode\";\nexport * from \"./PointsNode\";\nexport * from \"./PathNode\";\nexport * from \"./RectNode\";\nexport * from \"./RRectNode\";\nexport * from \"./OvalNode\";\nexport * from \"./LineNode\";\nexport * from \"./PatchNode\";\nexport * from \"./VerticesNode\";\nexport * from \"./CustomDrawingNode\";\nexport * from \"./Text\";\nexport * from \"./PictureNode\";\nexport * from \"./DiffRectNode\";\nexport * from \"./ImageSVG\";\nexport * from \"./BackdropFilterNode\";\nexport * from \"./Box\";\n"]}
|