@shopify/react-native-skia 0.1.164 → 0.1.165
Sign up to get free protection for your applications and to get access to all the features.
- 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/DrawingContext.cpp +5 -38
- package/cpp/rnskia/dom/base/DrawingContext.h +3 -17
- 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/props/CircleProp.h +2 -0
- package/cpp/rnskia/dom/props/ColorProp.h +9 -4
- package/cpp/rnskia/dom/props/ImageProps.h +3 -2
- package/cpp/rnskia/dom/props/PaintProps.h +15 -6
- package/cpp/rnskia/dom/props/RectProp.h +11 -4
- package/cpp/rnskia/dom/props/UniformsProp.h +86 -123
- 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/ImageNode.js +2 -2
- package/lib/commonjs/dom/nodes/drawings/ImageNode.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 +3 -2
- 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/ImageNode.js +4 -2
- package/lib/module/dom/nodes/drawings/ImageNode.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 +3 -2
- 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 -1
- 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/ImageNode.ts +2 -1
- 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 +5 -3
- package/src/skia/web/JsiSkRuntimeEffect.ts +5 -1
- package/src/skia/web/JsiSkRuntimeEffectFactory.ts +1 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["Host","JsiSkRuntimeEffect","JsiSkRuntimeEffectFactory","constructor","CanvasKit","Make","sksl","re","RuntimeEffect"],"sources":["JsiSkRuntimeEffectFactory.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type { RuntimeEffectFactory } from \"../types/RuntimeEffect/RuntimeEffectFactory\";\n\nimport { Host } from \"./Host\";\nimport { JsiSkRuntimeEffect } from \"./JsiSkRuntimeEffect\";\n\nexport class JsiSkRuntimeEffectFactory\n extends Host\n implements RuntimeEffectFactory\n{\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n Make(sksl: string) {\n const re = this.CanvasKit.RuntimeEffect.Make(sksl);\n if (re === null) {\n return null;\n }\n return new JsiSkRuntimeEffect(this.CanvasKit, re);\n }\n}\n"],"mappings":"AAIA,SAASA,IAAT,QAAqB,QAArB;AACA,SAASC,kBAAT,QAAmC,sBAAnC;AAEA,OAAO,MAAMC,yBAAN,SACGF,IADH,CAGP;EACEG,WAAW,CAACC,SAAD,EAAuB;IAChC,MAAMA,SAAN;EACD;;EAEDC,IAAI,CAACC,IAAD,EAAe;IACjB,MAAMC,EAAE,GAAG,KAAKH,SAAL,CAAeI,aAAf,CAA6BH,IAA7B,CAAkCC,IAAlC,CAAX;;IACA,IAAIC,EAAE,KAAK,IAAX,EAAiB;MACf,OAAO,IAAP;IACD;;IACD,OAAO,IAAIN,kBAAJ,CAAuB,KAAKG,SAA5B,EAAuCG,EAAvC,CAAP;EACD;;AAXH"}
|
1
|
+
{"version":3,"names":["Host","JsiSkRuntimeEffect","JsiSkRuntimeEffectFactory","constructor","CanvasKit","Make","sksl","re","RuntimeEffect"],"sources":["JsiSkRuntimeEffectFactory.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type { RuntimeEffectFactory } from \"../types/RuntimeEffect/RuntimeEffectFactory\";\n\nimport { Host } from \"./Host\";\nimport { JsiSkRuntimeEffect } from \"./JsiSkRuntimeEffect\";\n\nexport class JsiSkRuntimeEffectFactory\n extends Host\n implements RuntimeEffectFactory\n{\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n Make(sksl: string) {\n const re = this.CanvasKit.RuntimeEffect.Make(sksl);\n if (re === null) {\n return null;\n }\n return new JsiSkRuntimeEffect(this.CanvasKit, re, sksl);\n }\n}\n"],"mappings":"AAIA,SAASA,IAAT,QAAqB,QAArB;AACA,SAASC,kBAAT,QAAmC,sBAAnC;AAEA,OAAO,MAAMC,yBAAN,SACGF,IADH,CAGP;EACEG,WAAW,CAACC,SAAD,EAAuB;IAChC,MAAMA,SAAN;EACD;;EAEDC,IAAI,CAACC,IAAD,EAAe;IACjB,MAAMC,EAAE,GAAG,KAAKH,SAAL,CAAeI,aAAf,CAA6BH,IAA7B,CAAkCC,IAAlC,CAAX;;IACA,IAAIC,EAAE,KAAK,IAAX,EAAiB;MACf,OAAO,IAAP;IACD;;IACD,OAAO,IAAIN,kBAAJ,CAAuB,KAAKG,SAA5B,EAAuCG,EAAvC,EAA2CD,IAA3C,CAAP;EACD;;AAXH"}
|
@@ -1,4 +1,7 @@
|
|
1
1
|
import type { Skia } from "../../../skia/types";
|
2
2
|
import type { CircleDef, ScalarCircleDef } from "../../types";
|
3
3
|
export declare const isCircleScalarDef: (def: CircleDef) => def is ScalarCircleDef;
|
4
|
-
export declare const processCircle: (Skia: Skia, def: CircleDef) =>
|
4
|
+
export declare const processCircle: (Skia: Skia, def: CircleDef) => {
|
5
|
+
c: import("../../../skia/types").SkPoint;
|
6
|
+
r: number;
|
7
|
+
};
|
@@ -9,13 +9,13 @@ export interface ChildrenProps {
|
|
9
9
|
children?: ReactNode | ReactNode[];
|
10
10
|
}
|
11
11
|
export interface RectCtor {
|
12
|
-
x
|
13
|
-
y
|
12
|
+
x?: number;
|
13
|
+
y?: number;
|
14
14
|
width: number;
|
15
15
|
height: number;
|
16
16
|
}
|
17
17
|
export interface RRectCtor extends RectCtor {
|
18
|
-
r
|
18
|
+
r?: Radius;
|
19
19
|
}
|
20
20
|
export declare type RectDef = RectCtor | {
|
21
21
|
rect: SkRect;
|
@@ -24,7 +24,7 @@ export declare type RRectDef = RRectCtor | {
|
|
24
24
|
rect: SkRRect;
|
25
25
|
};
|
26
26
|
export interface PointCircleDef {
|
27
|
-
c
|
27
|
+
c?: Vector;
|
28
28
|
r: number;
|
29
29
|
}
|
30
30
|
export interface ScalarCircleDef {
|
@@ -1,15 +1,9 @@
|
|
1
1
|
import type { ReactNode } from "react";
|
2
2
|
interface MaskProps {
|
3
|
-
mode
|
4
|
-
clip
|
3
|
+
mode?: "luminance" | "alpha";
|
4
|
+
clip?: boolean;
|
5
5
|
mask: ReactNode | ReactNode[];
|
6
6
|
children: ReactNode | ReactNode[];
|
7
7
|
}
|
8
|
-
export declare const Mask: {
|
9
|
-
({ children, mask, mode, clip }: MaskProps): JSX.Element;
|
10
|
-
defaultProps: {
|
11
|
-
mode: string;
|
12
|
-
clip: boolean;
|
13
|
-
};
|
14
|
-
};
|
8
|
+
export declare const Mask: ({ children, mask, mode, clip, }: MaskProps) => JSX.Element;
|
15
9
|
export {};
|
@@ -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 {};
|
@@ -4,7 +4,7 @@ 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
6
|
export declare type UniformValue = number | Vector | readonly number[];
|
7
|
-
export declare type Uniform = UniformValue | readonly UniformValue[];
|
7
|
+
export declare type Uniform = UniformValue | readonly UniformValue[] | Float32Array;
|
8
8
|
export interface Uniforms {
|
9
9
|
[name: string]: Uniform;
|
10
10
|
}
|
@@ -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
|
);
|
@@ -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,
|
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
|
};
|