@shopify/react-native-skia 0.1.164 → 0.1.166
Sign up to get free protection for your applications and to get access to all the features.
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaBaseView.java +16 -5
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaBaseViewManager.java +34 -0
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaDomViewManager.java +2 -47
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaDrawViewManager.java +2 -44
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaPictureViewManager.java +2 -47
- package/cpp/api/JsiSkRuntimeEffect.h +7 -2
- package/cpp/rnskia/RNSkDomView.cpp +1 -1
- package/cpp/rnskia/RNSkPlatformContext.h +2 -6
- package/cpp/rnskia/dom/base/DerivedNodeProp.h +4 -4
- package/cpp/rnskia/dom/base/DrawingContext.cpp +5 -38
- package/cpp/rnskia/dom/base/DrawingContext.h +3 -17
- package/cpp/rnskia/dom/nodes/JsiBoxNode.h +4 -4
- package/cpp/rnskia/dom/nodes/JsiCircleNode.h +0 -2
- package/cpp/rnskia/dom/nodes/JsiCustomDrawingNode.h +1 -3
- package/cpp/rnskia/dom/nodes/JsiImageFilterNodes.h +2 -2
- package/cpp/rnskia/dom/nodes/JsiPathNode.h +12 -5
- package/cpp/rnskia/dom/nodes/JsiShaderNodes.h +17 -7
- package/cpp/rnskia/dom/props/CircleProp.h +2 -0
- package/cpp/rnskia/dom/props/ClipProp.h +6 -6
- package/cpp/rnskia/dom/props/ColorProp.h +9 -4
- package/cpp/rnskia/dom/props/ImageProps.h +6 -3
- package/cpp/rnskia/dom/props/PaintProps.h +15 -22
- package/cpp/rnskia/dom/props/RectProp.h +11 -4
- package/cpp/rnskia/dom/props/UniformsProp.h +86 -123
- package/cpp/rnskia/dom/props/VerticesProps.h +2 -2
- package/cpp/rnskia/values/RNSkReadonlyValue.h +2 -6
- package/lib/commonjs/dom/nodes/datatypes/Circle.js +6 -1
- package/lib/commonjs/dom/nodes/datatypes/Circle.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Rect.js +3 -3
- package/lib/commonjs/dom/nodes/datatypes/Rect.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/Box.js +1 -1
- package/lib/commonjs/dom/nodes/drawings/Box.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/ImageNode.js +2 -2
- package/lib/commonjs/dom/nodes/drawings/ImageNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/paint/ImageFilters.js +1 -1
- package/lib/commonjs/dom/nodes/paint/ImageFilters.js.map +1 -1
- package/lib/commonjs/dom/nodes/paint/Shaders.js +5 -2
- package/lib/commonjs/dom/nodes/paint/Shaders.js.map +1 -1
- package/lib/commonjs/dom/types/Common.js.map +1 -1
- package/lib/commonjs/dom/types/Drawings.js.map +1 -1
- package/lib/commonjs/renderer/components/Mask.js +2 -6
- package/lib/commonjs/renderer/components/Mask.js.map +1 -1
- package/lib/commonjs/renderer/components/image/Image.js +0 -5
- package/lib/commonjs/renderer/components/image/Image.js.map +1 -1
- package/lib/commonjs/renderer/components/image/ImageShader.js +20 -10
- package/lib/commonjs/renderer/components/image/ImageShader.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/Blur.js +10 -5
- package/lib/commonjs/renderer/components/imageFilters/Blur.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/Morphology.js +10 -5
- package/lib/commonjs/renderer/components/imageFilters/Morphology.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/Offset.js +12 -6
- package/lib/commonjs/renderer/components/imageFilters/Offset.js.map +1 -1
- package/lib/commonjs/renderer/components/maskFilters/Blur.js +12 -6
- package/lib/commonjs/renderer/components/maskFilters/Blur.js.map +1 -1
- package/lib/commonjs/renderer/components/pathEffects/Discrete.js +10 -5
- package/lib/commonjs/renderer/components/pathEffects/Discrete.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/FractalNoise.js +14 -7
- package/lib/commonjs/renderer/components/shaders/FractalNoise.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/Shader.js +10 -5
- package/lib/commonjs/renderer/components/shaders/Shader.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/Turbulence.js +14 -7
- package/lib/commonjs/renderer/components/shaders/Turbulence.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Circle.js +0 -6
- package/lib/commonjs/renderer/components/shapes/Circle.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/FitBox.js +1 -4
- package/lib/commonjs/renderer/components/shapes/FitBox.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Oval.js +0 -4
- package/lib/commonjs/renderer/components/shapes/Oval.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Path.js +12 -6
- package/lib/commonjs/renderer/components/shapes/Path.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Points.js +10 -5
- package/lib/commonjs/renderer/components/shapes/Points.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/RoundedRect.js +0 -3
- package/lib/commonjs/renderer/components/shapes/RoundedRect.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Vertices.js +10 -5
- package/lib/commonjs/renderer/components/shapes/Vertices.js.map +1 -1
- package/lib/commonjs/renderer/components/text/Glyphs.js +12 -6
- package/lib/commonjs/renderer/components/text/Glyphs.js.map +1 -1
- package/lib/commonjs/renderer/components/text/Text.js +12 -6
- package/lib/commonjs/renderer/components/text/Text.js.map +1 -1
- package/lib/commonjs/renderer/components/text/TextBlob.js +12 -6
- package/lib/commonjs/renderer/components/text/TextBlob.js.map +1 -1
- package/lib/commonjs/renderer/components/text/TextPath.js +10 -5
- package/lib/commonjs/renderer/components/text/TextPath.js.map +1 -1
- package/lib/commonjs/renderer/processors/Animations/Animations.js.map +1 -1
- package/lib/commonjs/skia/types/RuntimeEffect/RuntimeEffect.js.map +1 -1
- package/lib/commonjs/skia/types/Shader/Shader.js +25 -25
- package/lib/commonjs/skia/types/Shader/Shader.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkRuntimeEffect.js +6 -1
- package/lib/commonjs/skia/web/JsiSkRuntimeEffect.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkRuntimeEffectFactory.js +1 -1
- package/lib/commonjs/skia/web/JsiSkRuntimeEffectFactory.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Circle.js +8 -1
- package/lib/module/dom/nodes/datatypes/Circle.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Rect.js +7 -3
- package/lib/module/dom/nodes/datatypes/Rect.js.map +1 -1
- package/lib/module/dom/nodes/drawings/Box.js +1 -1
- package/lib/module/dom/nodes/drawings/Box.js.map +1 -1
- package/lib/module/dom/nodes/drawings/ImageNode.js +4 -2
- package/lib/module/dom/nodes/drawings/ImageNode.js.map +1 -1
- package/lib/module/dom/nodes/paint/ImageFilters.js +1 -1
- package/lib/module/dom/nodes/paint/ImageFilters.js.map +1 -1
- package/lib/module/dom/nodes/paint/Shaders.js +5 -4
- package/lib/module/dom/nodes/paint/Shaders.js.map +1 -1
- package/lib/module/dom/types/Common.js.map +1 -1
- package/lib/module/dom/types/Drawings.js.map +1 -1
- package/lib/module/renderer/components/Mask.js +2 -6
- package/lib/module/renderer/components/Mask.js.map +1 -1
- package/lib/module/renderer/components/image/Image.js +0 -5
- package/lib/module/renderer/components/image/Image.js.map +1 -1
- package/lib/module/renderer/components/image/ImageShader.js +20 -10
- package/lib/module/renderer/components/image/ImageShader.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/Blur.js +10 -5
- package/lib/module/renderer/components/imageFilters/Blur.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/Morphology.js +10 -5
- package/lib/module/renderer/components/imageFilters/Morphology.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/Offset.js +12 -6
- package/lib/module/renderer/components/imageFilters/Offset.js.map +1 -1
- package/lib/module/renderer/components/maskFilters/Blur.js +12 -6
- package/lib/module/renderer/components/maskFilters/Blur.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/Discrete.js +10 -5
- package/lib/module/renderer/components/pathEffects/Discrete.js.map +1 -1
- package/lib/module/renderer/components/shaders/FractalNoise.js +14 -7
- package/lib/module/renderer/components/shaders/FractalNoise.js.map +1 -1
- package/lib/module/renderer/components/shaders/Shader.js +10 -5
- package/lib/module/renderer/components/shaders/Shader.js.map +1 -1
- package/lib/module/renderer/components/shaders/Turbulence.js +14 -7
- package/lib/module/renderer/components/shaders/Turbulence.js.map +1 -1
- package/lib/module/renderer/components/shapes/Circle.js +0 -6
- package/lib/module/renderer/components/shapes/Circle.js.map +1 -1
- package/lib/module/renderer/components/shapes/FitBox.js +1 -4
- package/lib/module/renderer/components/shapes/FitBox.js.map +1 -1
- package/lib/module/renderer/components/shapes/Oval.js +0 -4
- package/lib/module/renderer/components/shapes/Oval.js.map +1 -1
- package/lib/module/renderer/components/shapes/Path.js +12 -6
- package/lib/module/renderer/components/shapes/Path.js.map +1 -1
- package/lib/module/renderer/components/shapes/Points.js +10 -5
- package/lib/module/renderer/components/shapes/Points.js.map +1 -1
- package/lib/module/renderer/components/shapes/RoundedRect.js +0 -3
- package/lib/module/renderer/components/shapes/RoundedRect.js.map +1 -1
- package/lib/module/renderer/components/shapes/Vertices.js +10 -5
- package/lib/module/renderer/components/shapes/Vertices.js.map +1 -1
- package/lib/module/renderer/components/text/Glyphs.js +12 -6
- package/lib/module/renderer/components/text/Glyphs.js.map +1 -1
- package/lib/module/renderer/components/text/Text.js +12 -6
- package/lib/module/renderer/components/text/Text.js.map +1 -1
- package/lib/module/renderer/components/text/TextBlob.js +12 -6
- package/lib/module/renderer/components/text/TextBlob.js.map +1 -1
- package/lib/module/renderer/components/text/TextPath.js +10 -5
- package/lib/module/renderer/components/text/TextPath.js.map +1 -1
- package/lib/module/renderer/processors/Animations/Animations.js.map +1 -1
- package/lib/module/skia/types/RuntimeEffect/RuntimeEffect.js.map +1 -1
- package/lib/module/skia/types/Shader/Shader.js +25 -25
- package/lib/module/skia/types/Shader/Shader.js.map +1 -1
- package/lib/module/skia/web/JsiSkRuntimeEffect.js +6 -1
- package/lib/module/skia/web/JsiSkRuntimeEffect.js.map +1 -1
- package/lib/module/skia/web/JsiSkRuntimeEffectFactory.js +1 -1
- package/lib/module/skia/web/JsiSkRuntimeEffectFactory.js.map +1 -1
- package/lib/typescript/src/dom/nodes/datatypes/Circle.d.ts +4 -1
- package/lib/typescript/src/dom/types/Common.d.ts +4 -4
- package/lib/typescript/src/dom/types/Drawings.d.ts +1 -1
- package/lib/typescript/src/renderer/components/Mask.d.ts +3 -9
- package/lib/typescript/src/renderer/components/image/Image.d.ts +1 -8
- package/lib/typescript/src/renderer/components/image/ImageShader.d.ts +2 -12
- package/lib/typescript/src/renderer/components/imageFilters/Blur.d.ts +2 -7
- package/lib/typescript/src/renderer/components/imageFilters/Morphology.d.ts +2 -7
- package/lib/typescript/src/renderer/components/imageFilters/Offset.d.ts +2 -8
- package/lib/typescript/src/renderer/components/maskFilters/Blur.d.ts +2 -8
- package/lib/typescript/src/renderer/components/pathEffects/Discrete.d.ts +2 -7
- package/lib/typescript/src/renderer/components/shaders/FractalNoise.d.ts +2 -9
- package/lib/typescript/src/renderer/components/shaders/Shader.d.ts +2 -7
- package/lib/typescript/src/renderer/components/shaders/Turbulence.d.ts +2 -9
- package/lib/typescript/src/renderer/components/shapes/Circle.d.ts +1 -9
- package/lib/typescript/src/renderer/components/shapes/FitBox.d.ts +2 -7
- package/lib/typescript/src/renderer/components/shapes/Oval.d.ts +1 -7
- package/lib/typescript/src/renderer/components/shapes/Path.d.ts +2 -8
- package/lib/typescript/src/renderer/components/shapes/Points.d.ts +2 -7
- package/lib/typescript/src/renderer/components/shapes/RoundedRect.d.ts +1 -6
- package/lib/typescript/src/renderer/components/shapes/Vertices.d.ts +2 -7
- package/lib/typescript/src/renderer/components/text/Glyphs.d.ts +2 -8
- package/lib/typescript/src/renderer/components/text/Text.d.ts +2 -8
- package/lib/typescript/src/renderer/components/text/TextBlob.d.ts +2 -8
- package/lib/typescript/src/renderer/components/text/TextPath.d.ts +2 -7
- package/lib/typescript/src/renderer/processors/Animations/Animations.d.ts +5 -0
- package/lib/typescript/src/skia/types/RuntimeEffect/RuntimeEffect.d.ts +4 -0
- package/lib/typescript/src/skia/types/Shader/Shader.d.ts +1 -2
- package/lib/typescript/src/skia/web/JsiSkRuntimeEffect.d.ts +3 -1
- package/package.json +1 -1
- package/src/dom/nodes/datatypes/Circle.ts +1 -1
- package/src/dom/nodes/datatypes/Rect.ts +3 -3
- package/src/dom/nodes/drawings/Box.ts +1 -1
- package/src/dom/nodes/drawings/ImageNode.ts +2 -1
- package/src/dom/nodes/paint/ImageFilters.ts +1 -1
- package/src/dom/nodes/paint/Shaders.ts +5 -5
- package/src/dom/types/Common.ts +4 -4
- package/src/dom/types/Drawings.ts +1 -1
- package/src/renderer/components/Mask.tsx +8 -8
- package/src/renderer/components/image/Image.tsx +0 -6
- package/src/renderer/components/image/ImageShader.tsx +24 -12
- package/src/renderer/components/imageFilters/Blur.tsx +6 -7
- package/src/renderer/components/imageFilters/Morphology.tsx +6 -7
- package/src/renderer/components/imageFilters/Offset.tsx +7 -8
- package/src/renderer/components/maskFilters/Blur.tsx +7 -8
- package/src/renderer/components/pathEffects/Discrete.tsx +6 -9
- package/src/renderer/components/shaders/FractalNoise.tsx +18 -9
- package/src/renderer/components/shaders/Shader.tsx +6 -7
- package/src/renderer/components/shaders/Turbulence.tsx +15 -9
- package/src/renderer/components/shapes/Circle.tsx +0 -4
- package/src/renderer/components/shapes/FitBox.tsx +2 -6
- package/src/renderer/components/shapes/Oval.tsx +0 -5
- package/src/renderer/components/shapes/Path.tsx +7 -8
- package/src/renderer/components/shapes/Points.tsx +6 -7
- package/src/renderer/components/shapes/RoundedRect.tsx +0 -4
- package/src/renderer/components/shapes/Vertices.tsx +6 -7
- package/src/renderer/components/text/Glyphs.tsx +7 -8
- package/src/renderer/components/text/Text.tsx +7 -8
- package/src/renderer/components/text/TextBlob.tsx +7 -8
- package/src/renderer/components/text/TextPath.tsx +6 -7
- package/src/renderer/processors/Animations/Animations.ts +9 -3
- package/src/skia/types/RuntimeEffect/RuntimeEffect.ts +5 -0
- package/src/skia/types/Shader/Shader.ts +30 -36
- package/src/skia/web/JsiSkRuntimeEffect.ts +5 -1
- package/src/skia/web/JsiSkRuntimeEffectFactory.ts +1 -1
@@ -1,11 +1,4 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import type { SkiaProps } from "../../processors";
|
3
3
|
import type { ImageProps } from "../../../dom/types";
|
4
|
-
export declare const Image:
|
5
|
-
(props: SkiaProps<ImageProps>): JSX.Element;
|
6
|
-
defaultProps: {
|
7
|
-
x: number;
|
8
|
-
y: number;
|
9
|
-
fit: string;
|
10
|
-
};
|
11
|
-
};
|
4
|
+
export declare const Image: (props: SkiaProps<ImageProps>) => JSX.Element;
|
@@ -1,14 +1,4 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import type { ImageShaderProps } from "../../../dom/types";
|
3
|
-
import type {
|
4
|
-
export declare const ImageShader: {
|
5
|
-
(props: SkiaProps<ImageShaderProps>): JSX.Element;
|
6
|
-
defaultProps: {
|
7
|
-
readonly tx: "decal";
|
8
|
-
readonly ty: "decal";
|
9
|
-
readonly fm: "nearest";
|
10
|
-
readonly mm: "none";
|
11
|
-
readonly fit: "none";
|
12
|
-
readonly transform: readonly [];
|
13
|
-
};
|
14
|
-
};
|
3
|
+
import type { SkiaDefaultProps } from "../../processors";
|
4
|
+
export declare const ImageShader: ({ tx, ty, fm, mm, fit, transform, ...props }: SkiaDefaultProps<ImageShaderProps, "tx" | "ty" | "fm" | "mm" | "fit" | "transform">) => JSX.Element;
|
@@ -1,9 +1,4 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import type {
|
2
|
+
import type { SkiaDefaultProps } from "../../processors/Animations/Animations";
|
3
3
|
import type { BlurImageFilterProps } from "../../../dom/types";
|
4
|
-
export declare const Blur: {
|
5
|
-
(props: SkiaProps<BlurImageFilterProps>): JSX.Element;
|
6
|
-
defaultProps: {
|
7
|
-
mode: string;
|
8
|
-
};
|
9
|
-
};
|
4
|
+
export declare const Blur: ({ mode, ...props }: SkiaDefaultProps<BlurImageFilterProps, "mode">) => JSX.Element;
|
@@ -1,9 +1,4 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import type { MorphologyImageFilterProps } from "../../../dom/types";
|
3
|
-
import type {
|
4
|
-
export declare const Morphology: {
|
5
|
-
(props: SkiaProps<MorphologyImageFilterProps>): JSX.Element;
|
6
|
-
defaultProps: {
|
7
|
-
operator: string;
|
8
|
-
};
|
9
|
-
};
|
3
|
+
import type { SkiaDefaultProps } from "../../processors";
|
4
|
+
export declare const Morphology: ({ operator, ...props }: SkiaDefaultProps<MorphologyImageFilterProps, "operator">) => JSX.Element;
|
@@ -1,10 +1,4 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import type {
|
2
|
+
import type { SkiaDefaultProps } from "../../processors/Animations/Animations";
|
3
3
|
import type { OffsetImageFilterProps } from "../../../dom/types";
|
4
|
-
export declare const Offset: {
|
5
|
-
(props: SkiaProps<OffsetImageFilterProps>): JSX.Element;
|
6
|
-
defaultProps: {
|
7
|
-
x: number;
|
8
|
-
y: number;
|
9
|
-
};
|
10
|
-
};
|
4
|
+
export declare const Offset: ({ x, y, ...props }: SkiaDefaultProps<OffsetImageFilterProps, "x" | "y">) => JSX.Element;
|
@@ -1,10 +1,4 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import type { BlurMaskFilterProps } from "../../../dom/types";
|
3
|
-
import type {
|
4
|
-
export declare const BlurMask: {
|
5
|
-
(props: SkiaProps<BlurMaskFilterProps>): JSX.Element;
|
6
|
-
defaultProps: {
|
7
|
-
style: string;
|
8
|
-
respectCTM: boolean;
|
9
|
-
};
|
10
|
-
};
|
3
|
+
import type { SkiaDefaultProps } from "../../processors/Animations/Animations";
|
4
|
+
export declare const BlurMask: ({ style, respectCTM, ...props }: SkiaDefaultProps<BlurMaskFilterProps, "style" | "respectCTM">) => JSX.Element;
|
@@ -1,9 +1,4 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import type {
|
2
|
+
import type { SkiaDefaultProps } from "../../processors/Animations/Animations";
|
3
3
|
import type { DiscretePathEffectProps } from "../../../dom/types";
|
4
|
-
export declare const DiscretePathEffect: {
|
5
|
-
(props: SkiaProps<DiscretePathEffectProps>): JSX.Element;
|
6
|
-
defaultProps: {
|
7
|
-
seed: number;
|
8
|
-
};
|
9
|
-
};
|
4
|
+
export declare const DiscretePathEffect: ({ seed, ...props }: SkiaDefaultProps<DiscretePathEffectProps, "seed">) => JSX.Element;
|
@@ -1,11 +1,4 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import type { FractalNoiseProps } from "../../../dom/types";
|
3
|
-
import type {
|
4
|
-
export declare const FractalNoise: {
|
5
|
-
(props: SkiaProps<FractalNoiseProps>): JSX.Element;
|
6
|
-
defaultProps: {
|
7
|
-
seed: number;
|
8
|
-
tileWidth: number;
|
9
|
-
tileHeight: number;
|
10
|
-
};
|
11
|
-
};
|
3
|
+
import type { SkiaDefaultProps } from "../../processors/Animations/Animations";
|
4
|
+
export declare const FractalNoise: ({ seed, tileWidth, tileHeight, ...props }: SkiaDefaultProps<FractalNoiseProps, "seed" | "tileHeight" | "tileWidth">) => JSX.Element;
|
@@ -1,9 +1,4 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import type {
|
2
|
+
import type { SkiaDefaultProps } from "../../processors";
|
3
3
|
import type { ShaderProps } from "../../../dom/types";
|
4
|
-
export declare const Shader: {
|
5
|
-
(props: SkiaProps<ShaderProps>): JSX.Element;
|
6
|
-
defaultProps: {
|
7
|
-
uniforms: never[];
|
8
|
-
};
|
9
|
-
};
|
4
|
+
export declare const Shader: ({ uniforms, ...props }: SkiaDefaultProps<ShaderProps, "uniforms">) => JSX.Element;
|
@@ -1,11 +1,4 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import type { TurbulenceProps } from "../../../dom/types";
|
3
|
-
import type {
|
4
|
-
export declare const Turbulence: {
|
5
|
-
(props: SkiaProps<TurbulenceProps>): JSX.Element;
|
6
|
-
defaultProps: {
|
7
|
-
seed: number;
|
8
|
-
tileWidth: number;
|
9
|
-
tileHeight: number;
|
10
|
-
};
|
11
|
-
};
|
3
|
+
import type { SkiaDefaultProps } from "../../processors/Animations/Animations";
|
4
|
+
export declare const Turbulence: ({ seed, tileWidth, tileHeight, ...props }: SkiaDefaultProps<TurbulenceProps, "seed" | "tileWidth" | "tileHeight">) => JSX.Element;
|
@@ -1,12 +1,4 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import type { SkiaProps } from "../../processors";
|
3
3
|
import type { CircleProps } from "../../../dom/types";
|
4
|
-
export declare const Circle:
|
5
|
-
(props: SkiaProps<CircleProps>): JSX.Element;
|
6
|
-
defaultProps: {
|
7
|
-
c: {
|
8
|
-
x: number;
|
9
|
-
y: number;
|
10
|
-
};
|
11
|
-
};
|
12
|
-
};
|
4
|
+
export declare const Circle: (props: SkiaProps<CircleProps>) => JSX.Element;
|
@@ -2,7 +2,7 @@ import type { ReactNode } from "react";
|
|
2
2
|
import type { Fit } from "../../../dom/nodes";
|
3
3
|
import type { SkRect } from "../../../skia/types";
|
4
4
|
interface FitProps {
|
5
|
-
fit
|
5
|
+
fit?: Fit;
|
6
6
|
src: SkRect;
|
7
7
|
dst: SkRect;
|
8
8
|
children: ReactNode | ReactNode[];
|
@@ -16,10 +16,5 @@ export declare const fitbox: (fit: Fit, src: SkRect, dst: SkRect) => readonly [{
|
|
16
16
|
}, {
|
17
17
|
readonly scaleY: number;
|
18
18
|
}];
|
19
|
-
export declare const FitBox: {
|
20
|
-
({ fit, src, dst, children }: FitProps): JSX.Element;
|
21
|
-
defaultProps: {
|
22
|
-
fit: string;
|
23
|
-
};
|
24
|
-
};
|
19
|
+
export declare const FitBox: ({ fit, src, dst, children }: FitProps) => JSX.Element;
|
25
20
|
export {};
|
@@ -1,10 +1,4 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import type { OvalProps } from "../../../dom/types";
|
3
3
|
import type { SkiaProps } from "../../processors";
|
4
|
-
export declare const Oval:
|
5
|
-
(props: SkiaProps<OvalProps>): JSX.Element;
|
6
|
-
defaultProps: {
|
7
|
-
x: number;
|
8
|
-
y: number;
|
9
|
-
};
|
10
|
-
};
|
4
|
+
export declare const Oval: (props: SkiaProps<OvalProps>) => JSX.Element;
|
@@ -1,10 +1,4 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import type {
|
2
|
+
import type { SkiaDefaultProps } from "../../processors";
|
3
3
|
import type { PathProps } from "../../../dom/types";
|
4
|
-
export declare const Path: {
|
5
|
-
(props: SkiaProps<PathProps>): JSX.Element;
|
6
|
-
defaultProps: {
|
7
|
-
start: number;
|
8
|
-
end: number;
|
9
|
-
};
|
10
|
-
};
|
4
|
+
export declare const Path: ({ start, end, ...props }: SkiaDefaultProps<PathProps, "start" | "end">) => JSX.Element;
|
@@ -1,9 +1,4 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import type {
|
2
|
+
import type { SkiaDefaultProps } from "../../processors/Animations/Animations";
|
3
3
|
import type { PointsProps } from "../../../dom/types";
|
4
|
-
export declare const Points: {
|
5
|
-
(props: SkiaProps<PointsProps>): JSX.Element;
|
6
|
-
defaultProps: {
|
7
|
-
mode: string;
|
8
|
-
};
|
9
|
-
};
|
4
|
+
export declare const Points: ({ mode, ...props }: SkiaDefaultProps<PointsProps, "mode">) => JSX.Element;
|
@@ -1,9 +1,4 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import type { RoundedRectProps } from "../../../dom/types";
|
3
3
|
import type { SkiaProps } from "../../processors";
|
4
|
-
export declare const RoundedRect:
|
5
|
-
(props: SkiaProps<RoundedRectProps>): JSX.Element;
|
6
|
-
defaultProps: {
|
7
|
-
r: number;
|
8
|
-
};
|
9
|
-
};
|
4
|
+
export declare const RoundedRect: (props: SkiaProps<RoundedRectProps>) => JSX.Element;
|
@@ -1,9 +1,4 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import type {
|
2
|
+
import type { SkiaDefaultProps } from "../../processors";
|
3
3
|
import type { VerticesProps } from "../../../dom/types";
|
4
|
-
export declare const Vertices: {
|
5
|
-
(props: SkiaProps<VerticesProps>): JSX.Element;
|
6
|
-
defaultProps: {
|
7
|
-
mode: string;
|
8
|
-
};
|
9
|
-
};
|
4
|
+
export declare const Vertices: ({ mode, ...props }: SkiaDefaultProps<VerticesProps, "mode">) => JSX.Element;
|
@@ -1,10 +1,4 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import type { GlyphsProps } from "../../../dom/types";
|
3
|
-
import type {
|
4
|
-
export declare const Glyphs: {
|
5
|
-
(props: SkiaProps<GlyphsProps>): JSX.Element;
|
6
|
-
defaultProps: {
|
7
|
-
x: number;
|
8
|
-
y: number;
|
9
|
-
};
|
10
|
-
};
|
3
|
+
import type { SkiaDefaultProps } from "../../processors/Animations/Animations";
|
4
|
+
export declare const Glyphs: ({ x, y, ...props }: SkiaDefaultProps<GlyphsProps, "x" | "y">) => JSX.Element;
|
@@ -1,10 +1,4 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import type {
|
2
|
+
import type { SkiaDefaultProps } from "../../processors";
|
3
3
|
import type { TextProps } from "../../../dom/types";
|
4
|
-
export declare const Text: {
|
5
|
-
(props: SkiaProps<TextProps>): JSX.Element;
|
6
|
-
defaultProps: {
|
7
|
-
x: number;
|
8
|
-
y: number;
|
9
|
-
};
|
10
|
-
};
|
4
|
+
export declare const Text: ({ x, y, ...props }: SkiaDefaultProps<TextProps, "x" | "y">) => JSX.Element;
|
@@ -1,10 +1,4 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import type {
|
2
|
+
import type { SkiaDefaultProps } from "../../processors";
|
3
3
|
import type { TextBlobProps } from "../../../dom/types";
|
4
|
-
export declare const TextBlob: {
|
5
|
-
(props: SkiaProps<TextBlobProps>): JSX.Element;
|
6
|
-
defaultProps: {
|
7
|
-
x: number;
|
8
|
-
y: number;
|
9
|
-
};
|
10
|
-
};
|
4
|
+
export declare const TextBlob: ({ x, y, ...props }: SkiaDefaultProps<TextBlobProps, "x" | "y">) => JSX.Element;
|
@@ -1,9 +1,4 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import type {
|
2
|
+
import type { SkiaDefaultProps } from "../../processors";
|
3
3
|
import type { TextPathProps } from "../../../dom/types";
|
4
|
-
export declare const TextPath: {
|
5
|
-
(props: SkiaProps<TextPathProps>): JSX.Element;
|
6
|
-
defaultProps: {
|
7
|
-
initialOffset: number;
|
8
|
-
};
|
9
|
-
};
|
4
|
+
export declare const TextPath: ({ initialOffset, ...props }: SkiaDefaultProps<TextPathProps, "initialOffset">) => JSX.Element;
|
@@ -10,3 +10,8 @@ export declare type AnimatedProps<T, O extends keyof T | never = never> = {
|
|
10
10
|
[K in keyof T]: K extends "children" ? T[K] : K extends O ? T[K] : AnimatedProp<T[K]>;
|
11
11
|
};
|
12
12
|
export declare type SkiaProps<P = object, O extends keyof P | never = never> = AnimatedProps<P, O>;
|
13
|
+
declare type WithOptional<T extends object, N extends keyof T> = Omit<T, N> & {
|
14
|
+
[K in N]?: T[K];
|
15
|
+
};
|
16
|
+
export declare type SkiaDefaultProps<T extends object, N extends keyof T> = WithOptional<SkiaProps<T>, N>;
|
17
|
+
export {};
|
@@ -3,8 +3,7 @@ import type { Vector } from "../Point";
|
|
3
3
|
import type { SkRuntimeEffect, SkRuntimeShaderBuilder } from "../RuntimeEffect";
|
4
4
|
export declare const isShader: (obj: SkJSIInstance<string> | null) => obj is SkShader;
|
5
5
|
export declare type SkShader = SkJSIInstance<"Shader">;
|
6
|
-
export declare type
|
7
|
-
export declare type Uniform = UniformValue | readonly UniformValue[];
|
6
|
+
export declare type Uniform = number | Vector | Float32Array | Uniform[];
|
8
7
|
export interface Uniforms {
|
9
8
|
[name: string]: Uniform;
|
10
9
|
}
|
@@ -4,7 +4,9 @@ import type { SkRuntimeEffect } from "../types/RuntimeEffect/RuntimeEffect";
|
|
4
4
|
import { HostObject } from "./Host";
|
5
5
|
import { JsiSkShader } from "./JsiSkShader";
|
6
6
|
export declare class JsiSkRuntimeEffect extends HostObject<RuntimeEffect, "RuntimeEffect"> implements SkRuntimeEffect {
|
7
|
-
|
7
|
+
private sksl;
|
8
|
+
constructor(CanvasKit: CanvasKit, ref: RuntimeEffect, sksl: string);
|
9
|
+
source(): string;
|
8
10
|
makeShader(uniforms: number[], localMatrix?: SkMatrix): JsiSkShader;
|
9
11
|
makeShaderWithChildren(uniforms: number[], children?: SkShader[], localMatrix?: SkMatrix): JsiSkShader;
|
10
12
|
getUniform(index: number): import("canvaskit-wasm").SkSLUniform;
|
package/package.json
CHANGED
@@ -16,7 +16,7 @@ const isRectCtor = (def: RectDef): def is RectCtor =>
|
|
16
16
|
|
17
17
|
export const processRect = (Skia: Skia, def: RectDef) => {
|
18
18
|
if (isRectCtor(def)) {
|
19
|
-
return Skia.XYWHRect(def.x, def.y, def.width, def.height);
|
19
|
+
return Skia.XYWHRect(def.x ?? 0, def.y ?? 0, def.width, def.height);
|
20
20
|
} else {
|
21
21
|
return def.rect;
|
22
22
|
}
|
@@ -24,9 +24,9 @@ export const processRect = (Skia: Skia, def: RectDef) => {
|
|
24
24
|
|
25
25
|
export const processRRect = (Skia: Skia, def: RRectDef) => {
|
26
26
|
if (isRRectCtor(def)) {
|
27
|
-
const r = processRadius(Skia, def.r);
|
27
|
+
const r = processRadius(Skia, def.r ?? 0);
|
28
28
|
return Skia.RRectXY(
|
29
|
-
Skia.XYWHRect(def.x, def.y, def.width, def.height),
|
29
|
+
Skia.XYWHRect(def.x ?? 0, def.y ?? 0, def.width, def.height),
|
30
30
|
r.x,
|
31
31
|
r.y
|
32
32
|
);
|
@@ -40,7 +40,7 @@ export class BoxShadowNode extends JsiDeclarationNode<
|
|
40
40
|
BoxShadowProps
|
41
41
|
> {
|
42
42
|
constructor(ctx: NodeContext, props: BoxShadowProps) {
|
43
|
-
super(ctx, DeclarationType.Unknown, NodeType.
|
43
|
+
super(ctx, DeclarationType.Unknown, NodeType.BoxShadow, props);
|
44
44
|
}
|
45
45
|
|
46
46
|
materialize() {
|
@@ -14,7 +14,8 @@ export class ImageNode extends JsiDrawingNode<
|
|
14
14
|
}
|
15
15
|
|
16
16
|
deriveProps() {
|
17
|
-
const { image
|
17
|
+
const { image } = this.props;
|
18
|
+
const fit = this.props.fit ?? "contain";
|
18
19
|
const rect = processRect(this.Skia, this.props);
|
19
20
|
const { src, dst } = fitRects(
|
20
21
|
fit,
|
@@ -140,7 +140,7 @@ export class BlurImageFilterNode extends ImageFilterDeclaration<BlurImageFilterP
|
|
140
140
|
|
141
141
|
export class DropShadowImageFilterNode extends ImageFilterDeclaration<DropShadowImageFilterProps> {
|
142
142
|
constructor(ctx: NodeContext, props: DropShadowImageFilterProps) {
|
143
|
-
super(ctx, NodeType.
|
143
|
+
super(ctx, NodeType.DropShadowImageFilter, props);
|
144
144
|
}
|
145
145
|
|
146
146
|
materialize() {
|
@@ -67,20 +67,20 @@ export class ImageShaderNode extends ShaderDeclaration<ImageShaderProps> {
|
|
67
67
|
materialize() {
|
68
68
|
const { fit, image, tx, ty, fm, mm, ...imageShaderProps } = this.props;
|
69
69
|
const rct = getRect(this.Skia, imageShaderProps);
|
70
|
+
const m3 = this.Skia.Matrix();
|
70
71
|
if (rct) {
|
71
72
|
const rects = fitRects(
|
72
73
|
fit,
|
73
74
|
{ x: 0, y: 0, width: image.width(), height: image.height() },
|
74
75
|
rct
|
75
76
|
);
|
76
|
-
const
|
77
|
-
|
78
|
-
|
79
|
-
...m3,
|
80
|
-
];
|
77
|
+
const [x, y, sx, sy] = rect2rect(rects.src, rects.dst);
|
78
|
+
m3.translate(x.translateX, y.translateY);
|
79
|
+
m3.scale(sx.scaleX, sy.scaleY);
|
81
80
|
}
|
82
81
|
const lm = this.Skia.Matrix();
|
83
82
|
processTransformProps(lm, imageShaderProps);
|
83
|
+
lm.concat(m3);
|
84
84
|
return image.makeShaderOptions(
|
85
85
|
TileMode[enumKey(tx)],
|
86
86
|
TileMode[enumKey(ty)],
|
package/src/dom/types/Common.ts
CHANGED
@@ -37,21 +37,21 @@ export interface ChildrenProps {
|
|
37
37
|
}
|
38
38
|
|
39
39
|
export interface RectCtor {
|
40
|
-
x
|
41
|
-
y
|
40
|
+
x?: number;
|
41
|
+
y?: number;
|
42
42
|
width: number;
|
43
43
|
height: number;
|
44
44
|
}
|
45
45
|
|
46
46
|
export interface RRectCtor extends RectCtor {
|
47
|
-
r
|
47
|
+
r?: Radius;
|
48
48
|
}
|
49
49
|
|
50
50
|
export type RectDef = RectCtor | { rect: SkRect };
|
51
51
|
export type RRectDef = RRectCtor | { rect: SkRRect };
|
52
52
|
|
53
53
|
export interface PointCircleDef {
|
54
|
-
c
|
54
|
+
c?: Vector;
|
55
55
|
r: number;
|
56
56
|
}
|
57
57
|
|
@@ -6,13 +6,18 @@ import { LumaColorFilter } from "./colorFilters/LumaColorFilter";
|
|
6
6
|
import { Paint } from "./Paint";
|
7
7
|
|
8
8
|
interface MaskProps {
|
9
|
-
mode
|
10
|
-
clip
|
9
|
+
mode?: "luminance" | "alpha";
|
10
|
+
clip?: boolean;
|
11
11
|
mask: ReactNode | ReactNode[];
|
12
12
|
children: ReactNode | ReactNode[];
|
13
13
|
}
|
14
14
|
|
15
|
-
export const Mask = ({
|
15
|
+
export const Mask = ({
|
16
|
+
children,
|
17
|
+
mask,
|
18
|
+
mode = "alpha",
|
19
|
+
clip = true,
|
20
|
+
}: MaskProps) => {
|
16
21
|
return (
|
17
22
|
<Group layer>
|
18
23
|
<Group
|
@@ -29,8 +34,3 @@ export const Mask = ({ children, mask, mode, clip }: MaskProps) => {
|
|
29
34
|
</Group>
|
30
35
|
);
|
31
36
|
};
|
32
|
-
|
33
|
-
Mask.defaultProps = {
|
34
|
-
mode: "alpha",
|
35
|
-
clip: true,
|
36
|
-
};
|
@@ -1,17 +1,29 @@
|
|
1
1
|
import React from "react";
|
2
2
|
|
3
3
|
import type { ImageShaderProps } from "../../../dom/types";
|
4
|
-
import type {
|
4
|
+
import type { SkiaDefaultProps } from "../../processors";
|
5
5
|
|
6
|
-
export const ImageShader = (
|
7
|
-
|
6
|
+
export const ImageShader = ({
|
7
|
+
tx = "decal",
|
8
|
+
ty = "decal",
|
9
|
+
fm = "nearest",
|
10
|
+
mm = "none",
|
11
|
+
fit = "none",
|
12
|
+
transform = [],
|
13
|
+
...props
|
14
|
+
}: SkiaDefaultProps<
|
15
|
+
ImageShaderProps,
|
16
|
+
"tx" | "ty" | "fm" | "mm" | "fit" | "transform"
|
17
|
+
>) => {
|
18
|
+
return (
|
19
|
+
<skImageShader
|
20
|
+
tx={tx}
|
21
|
+
ty={ty}
|
22
|
+
fm={fm}
|
23
|
+
mm={mm}
|
24
|
+
fit={fit}
|
25
|
+
transform={transform}
|
26
|
+
{...props}
|
27
|
+
/>
|
28
|
+
);
|
8
29
|
};
|
9
|
-
|
10
|
-
ImageShader.defaultProps = {
|
11
|
-
tx: "decal",
|
12
|
-
ty: "decal",
|
13
|
-
fm: "nearest",
|
14
|
-
mm: "none",
|
15
|
-
fit: "none",
|
16
|
-
transform: [],
|
17
|
-
} as const;
|
@@ -1,12 +1,11 @@
|
|
1
1
|
import React from "react";
|
2
2
|
|
3
|
-
import type {
|
3
|
+
import type { SkiaDefaultProps } from "../../processors/Animations/Animations";
|
4
4
|
import type { BlurImageFilterProps } from "../../../dom/types";
|
5
5
|
|
6
|
-
export const Blur = (
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
mode: "decal",
|
6
|
+
export const Blur = ({
|
7
|
+
mode = "decal",
|
8
|
+
...props
|
9
|
+
}: SkiaDefaultProps<BlurImageFilterProps, "mode">) => {
|
10
|
+
return <skBlurImageFilter mode={mode} {...props} />;
|
12
11
|
};
|
@@ -1,12 +1,11 @@
|
|
1
1
|
import React from "react";
|
2
2
|
|
3
3
|
import type { MorphologyImageFilterProps } from "../../../dom/types";
|
4
|
-
import type {
|
4
|
+
import type { SkiaDefaultProps } from "../../processors";
|
5
5
|
|
6
|
-
export const Morphology = (
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
operator: "dilate",
|
6
|
+
export const Morphology = ({
|
7
|
+
operator = "dilate",
|
8
|
+
...props
|
9
|
+
}: SkiaDefaultProps<MorphologyImageFilterProps, "operator">) => {
|
10
|
+
return <skMorphologyImageFilter operator={operator} {...props} />;
|
12
11
|
};
|
@@ -1,13 +1,12 @@
|
|
1
1
|
import React from "react";
|
2
2
|
|
3
|
-
import type {
|
3
|
+
import type { SkiaDefaultProps } from "../../processors/Animations/Animations";
|
4
4
|
import type { OffsetImageFilterProps } from "../../../dom/types";
|
5
5
|
|
6
|
-
export const Offset = (
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
x
|
12
|
-
y: 0,
|
6
|
+
export const Offset = ({
|
7
|
+
x = 0,
|
8
|
+
y = 0,
|
9
|
+
...props
|
10
|
+
}: SkiaDefaultProps<OffsetImageFilterProps, "x" | "y">) => {
|
11
|
+
return <skOffsetImageFilter x={x} y={y} {...props} />;
|
13
12
|
};
|