@shopify/react-native-skia 0.1.225 → 0.1.228
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/cpp/rnskia-android/SkiaOpenGLSurfaceFactory.h +3 -3
- package/cpp/api/JsiSkCanvas.h +2 -1
- package/cpp/api/JsiSkMatrix.h +35 -13
- package/cpp/api/JsiSkPictureRecorder.h +10 -3
- package/cpp/api/JsiSkTypeface.h +1 -0
- package/cpp/rnskia/dom/props/MatrixProp.h +19 -0
- package/cpp/rnskia/dom/props/TransformProp.h +76 -9
- package/lib/commonjs/animation/spring/runSpring.d.ts +3 -0
- package/lib/commonjs/animation/spring/runSpring.js +3 -0
- package/lib/commonjs/animation/spring/runSpring.js.map +1 -1
- package/lib/commonjs/animation/spring/useSpring.d.ts +3 -0
- package/lib/commonjs/animation/spring/useSpring.js +3 -0
- package/lib/commonjs/animation/spring/useSpring.js.map +1 -1
- package/lib/commonjs/animation/timing/runTiming.d.ts +3 -0
- package/lib/commonjs/animation/timing/runTiming.js +3 -0
- package/lib/commonjs/animation/timing/runTiming.js.map +1 -1
- package/lib/commonjs/animation/timing/useLoop.d.ts +3 -0
- package/lib/commonjs/animation/timing/useLoop.js +3 -0
- package/lib/commonjs/animation/timing/useLoop.js.map +1 -1
- package/lib/commonjs/animation/timing/useTiming.d.ts +3 -0
- package/lib/commonjs/animation/timing/useTiming.js +3 -0
- package/lib/commonjs/animation/timing/useTiming.js.map +1 -1
- package/lib/commonjs/dom/nodes/JsiSkDOM.js +2 -0
- package/lib/commonjs/dom/nodes/JsiSkDOM.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Fitting.d.ts +5 -5
- package/lib/commonjs/dom/nodes/datatypes/Fitting.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Gradient.d.ts +235 -75
- package/lib/commonjs/dom/nodes/datatypes/Gradient.js.map +1 -1
- package/lib/commonjs/dom/types/Common.d.ts +3 -3
- package/lib/commonjs/dom/types/Common.js.map +1 -1
- package/lib/commonjs/external/reanimated/interpolators.d.ts +1 -0
- package/lib/commonjs/external/reanimated/interpolators.js +24 -5
- package/lib/commonjs/external/reanimated/interpolators.js.map +1 -1
- package/lib/commonjs/external/reanimated/moduleWrapper.d.ts +2 -1
- package/lib/commonjs/external/reanimated/moduleWrapper.js +9 -7
- package/lib/commonjs/external/reanimated/moduleWrapper.js.map +1 -1
- package/lib/commonjs/renderer/Canvas.js +34 -28
- package/lib/commonjs/renderer/Canvas.js.map +1 -1
- package/lib/commonjs/renderer/components/Drawing.d.ts +5 -0
- package/lib/commonjs/renderer/components/Drawing.js +5 -0
- package/lib/commonjs/renderer/components/Drawing.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/FitBox.d.ts +5 -5
- package/lib/commonjs/skia/core/Matrix.d.ts +2 -2
- package/lib/commonjs/skia/core/Matrix.js.map +1 -1
- package/lib/commonjs/skia/core/Picture.d.ts +2 -2
- package/lib/commonjs/skia/core/Picture.js +12 -2
- package/lib/commonjs/skia/core/Picture.js.map +1 -1
- package/lib/commonjs/skia/core/Vector.d.ts +0 -5
- package/lib/commonjs/skia/core/Vector.js +1 -17
- package/lib/commonjs/skia/core/Vector.js.map +1 -1
- package/lib/commonjs/skia/types/Canvas.d.ts +1 -1
- package/lib/commonjs/skia/types/Canvas.js.map +1 -1
- package/lib/commonjs/skia/types/Matrix.d.ts +4 -20
- package/lib/commonjs/skia/types/Matrix.js +4 -70
- package/lib/commonjs/skia/types/Matrix.js.map +1 -1
- package/lib/commonjs/skia/types/Matrix4.d.ts +90 -0
- package/lib/commonjs/skia/types/Matrix4.js +312 -0
- package/lib/commonjs/skia/types/Matrix4.js.map +1 -0
- package/lib/commonjs/skia/types/Path/Path.d.ts +1 -1
- package/lib/commonjs/skia/types/Path/Path.js.map +1 -1
- package/lib/commonjs/skia/types/Picture/PictureRecorder.d.ts +1 -1
- package/lib/commonjs/skia/types/Picture/PictureRecorder.js.map +1 -1
- package/lib/commonjs/skia/types/Rect.d.ts +1 -0
- package/lib/commonjs/skia/types/Rect.js +18 -0
- package/lib/commonjs/skia/types/Rect.js.map +1 -1
- package/lib/commonjs/skia/types/index.d.ts +1 -0
- package/lib/commonjs/skia/types/index.js +13 -0
- package/lib/commonjs/skia/types/index.js.map +1 -1
- package/lib/commonjs/skia/web/Host.d.ts +2 -3
- package/lib/commonjs/skia/web/Host.js +4 -12
- package/lib/commonjs/skia/web/Host.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkCanvas.d.ts +1 -1
- package/lib/commonjs/skia/web/JsiSkCanvas.js +13 -13
- package/lib/commonjs/skia/web/JsiSkCanvas.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkColorFilterFactory.js +1 -1
- package/lib/commonjs/skia/web/JsiSkColorFilterFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkFont.js +2 -2
- package/lib/commonjs/skia/web/JsiSkFont.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkImage.js +6 -6
- package/lib/commonjs/skia/web/JsiSkImage.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkImageFactory.js +2 -2
- package/lib/commonjs/skia/web/JsiSkImageFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkImageFilterFactory.js +3 -3
- package/lib/commonjs/skia/web/JsiSkImageFilterFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkMaskFilterFactory.js +1 -1
- package/lib/commonjs/skia/web/JsiSkMaskFilterFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkMatrix.d.ts +2 -2
- package/lib/commonjs/skia/web/JsiSkMatrix.js +6 -1
- package/lib/commonjs/skia/web/JsiSkMatrix.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPaint.js +3 -3
- package/lib/commonjs/skia/web/JsiSkPaint.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPath.js +5 -5
- package/lib/commonjs/skia/web/JsiSkPath.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPathEffectFactory.js +1 -1
- package/lib/commonjs/skia/web/JsiSkPathEffectFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPathFactory.js +1 -1
- package/lib/commonjs/skia/web/JsiSkPathFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPicture.js +1 -1
- package/lib/commonjs/skia/web/JsiSkPicture.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPictureRecorder.d.ts +1 -1
- package/lib/commonjs/skia/web/JsiSkPictureRecorder.js +1 -1
- package/lib/commonjs/skia/web/JsiSkPictureRecorder.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkShaderFactory.js +5 -5
- package/lib/commonjs/skia/web/JsiSkShaderFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkVerticesFactory.js +3 -3
- package/lib/commonjs/skia/web/JsiSkVerticesFactory.js.map +1 -1
- package/lib/commonjs/values/api.d.ts +23 -2
- package/lib/commonjs/values/api.js +44 -1
- package/lib/commonjs/values/api.js.map +1 -1
- package/lib/commonjs/values/hooks/useClockValue.d.ts +3 -0
- package/lib/commonjs/values/hooks/useClockValue.js +3 -0
- package/lib/commonjs/values/hooks/useClockValue.js.map +1 -1
- package/lib/commonjs/values/hooks/useComputedValue.d.ts +3 -0
- package/lib/commonjs/values/hooks/useComputedValue.js +3 -0
- package/lib/commonjs/values/hooks/useComputedValue.js.map +1 -1
- package/lib/commonjs/values/hooks/useValue.d.ts +3 -0
- package/lib/commonjs/values/hooks/useValue.js +3 -0
- package/lib/commonjs/values/hooks/useValue.js.map +1 -1
- package/lib/commonjs/values/hooks/useValueEffect.d.ts +3 -0
- package/lib/commonjs/values/hooks/useValueEffect.js +3 -0
- package/lib/commonjs/values/hooks/useValueEffect.js.map +1 -1
- package/lib/commonjs/values/types.d.ts +4 -4
- package/lib/commonjs/values/types.js.map +1 -1
- package/lib/commonjs/views/SkiaView.d.ts +5 -0
- package/lib/commonjs/views/SkiaView.js +9 -0
- package/lib/commonjs/views/SkiaView.js.map +1 -1
- package/lib/module/animation/spring/runSpring.d.ts +3 -0
- package/lib/module/animation/spring/runSpring.js +3 -0
- package/lib/module/animation/spring/runSpring.js.map +1 -1
- package/lib/module/animation/spring/useSpring.d.ts +3 -0
- package/lib/module/animation/spring/useSpring.js +3 -0
- package/lib/module/animation/spring/useSpring.js.map +1 -1
- package/lib/module/animation/timing/runTiming.d.ts +3 -0
- package/lib/module/animation/timing/runTiming.js +3 -0
- package/lib/module/animation/timing/runTiming.js.map +1 -1
- package/lib/module/animation/timing/useLoop.d.ts +3 -0
- package/lib/module/animation/timing/useLoop.js +3 -0
- package/lib/module/animation/timing/useLoop.js.map +1 -1
- package/lib/module/animation/timing/useTiming.d.ts +3 -0
- package/lib/module/animation/timing/useTiming.js +3 -0
- package/lib/module/animation/timing/useTiming.js.map +1 -1
- package/lib/module/dom/nodes/JsiSkDOM.js +2 -0
- package/lib/module/dom/nodes/JsiSkDOM.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Fitting.d.ts +5 -5
- package/lib/module/dom/nodes/datatypes/Fitting.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Gradient.d.ts +235 -75
- package/lib/module/dom/nodes/datatypes/Gradient.js.map +1 -1
- package/lib/module/dom/types/Common.d.ts +3 -3
- package/lib/module/dom/types/Common.js.map +1 -1
- package/lib/module/external/reanimated/interpolators.d.ts +1 -0
- package/lib/module/external/reanimated/interpolators.js +22 -6
- package/lib/module/external/reanimated/interpolators.js.map +1 -1
- package/lib/module/external/reanimated/moduleWrapper.d.ts +2 -1
- package/lib/module/external/reanimated/moduleWrapper.js +7 -6
- package/lib/module/external/reanimated/moduleWrapper.js.map +1 -1
- package/lib/module/renderer/Canvas.js +35 -29
- package/lib/module/renderer/Canvas.js.map +1 -1
- package/lib/module/renderer/components/Drawing.d.ts +5 -0
- package/lib/module/renderer/components/Drawing.js +6 -0
- package/lib/module/renderer/components/Drawing.js.map +1 -1
- package/lib/module/renderer/components/shapes/FitBox.d.ts +5 -5
- package/lib/module/skia/core/Matrix.d.ts +2 -2
- package/lib/module/skia/core/Matrix.js.map +1 -1
- package/lib/module/skia/core/Picture.d.ts +2 -2
- package/lib/module/skia/core/Picture.js +12 -3
- package/lib/module/skia/core/Picture.js.map +1 -1
- package/lib/module/skia/core/Vector.d.ts +0 -5
- package/lib/module/skia/core/Vector.js +0 -13
- package/lib/module/skia/core/Vector.js.map +1 -1
- package/lib/module/skia/types/Canvas.d.ts +1 -1
- package/lib/module/skia/types/Canvas.js.map +1 -1
- package/lib/module/skia/types/Matrix.d.ts +4 -20
- package/lib/module/skia/types/Matrix.js +3 -71
- package/lib/module/skia/types/Matrix.js.map +1 -1
- package/lib/module/skia/types/Matrix4.d.ts +90 -0
- package/lib/module/skia/types/Matrix4.js +274 -0
- package/lib/module/skia/types/Matrix4.js.map +1 -0
- package/lib/module/skia/types/Path/Path.d.ts +1 -1
- package/lib/module/skia/types/Path/Path.js.map +1 -1
- package/lib/module/skia/types/Picture/PictureRecorder.d.ts +1 -1
- package/lib/module/skia/types/Picture/PictureRecorder.js.map +1 -1
- package/lib/module/skia/types/Rect.d.ts +1 -0
- package/lib/module/skia/types/Rect.js +9 -0
- package/lib/module/skia/types/Rect.js.map +1 -1
- package/lib/module/skia/types/index.d.ts +1 -0
- package/lib/module/skia/types/index.js +1 -0
- package/lib/module/skia/types/index.js.map +1 -1
- package/lib/module/skia/web/Host.d.ts +2 -3
- package/lib/module/skia/web/Host.js +2 -7
- package/lib/module/skia/web/Host.js.map +1 -1
- package/lib/module/skia/web/JsiSkCanvas.d.ts +1 -1
- package/lib/module/skia/web/JsiSkCanvas.js +14 -14
- package/lib/module/skia/web/JsiSkCanvas.js.map +1 -1
- package/lib/module/skia/web/JsiSkColorFilterFactory.js +2 -2
- package/lib/module/skia/web/JsiSkColorFilterFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkFont.js +3 -3
- package/lib/module/skia/web/JsiSkFont.js.map +1 -1
- package/lib/module/skia/web/JsiSkImage.js +7 -7
- package/lib/module/skia/web/JsiSkImage.js.map +1 -1
- package/lib/module/skia/web/JsiSkImageFactory.js +3 -3
- package/lib/module/skia/web/JsiSkImageFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkImageFilterFactory.js +4 -4
- package/lib/module/skia/web/JsiSkImageFilterFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkMaskFilterFactory.js +2 -2
- package/lib/module/skia/web/JsiSkMaskFilterFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkMatrix.d.ts +2 -2
- package/lib/module/skia/web/JsiSkMatrix.js +6 -1
- package/lib/module/skia/web/JsiSkMatrix.js.map +1 -1
- package/lib/module/skia/web/JsiSkPaint.js +4 -4
- package/lib/module/skia/web/JsiSkPaint.js.map +1 -1
- package/lib/module/skia/web/JsiSkPath.js +6 -6
- package/lib/module/skia/web/JsiSkPath.js.map +1 -1
- package/lib/module/skia/web/JsiSkPathEffectFactory.js +2 -2
- package/lib/module/skia/web/JsiSkPathEffectFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkPathFactory.js +2 -2
- package/lib/module/skia/web/JsiSkPathFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkPicture.js +2 -2
- package/lib/module/skia/web/JsiSkPicture.js.map +1 -1
- package/lib/module/skia/web/JsiSkPictureRecorder.d.ts +1 -1
- package/lib/module/skia/web/JsiSkPictureRecorder.js +1 -1
- package/lib/module/skia/web/JsiSkPictureRecorder.js.map +1 -1
- package/lib/module/skia/web/JsiSkShaderFactory.js +6 -6
- package/lib/module/skia/web/JsiSkShaderFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkVerticesFactory.js +2 -2
- package/lib/module/skia/web/JsiSkVerticesFactory.js.map +1 -1
- package/lib/module/values/api.d.ts +23 -2
- package/lib/module/values/api.js +44 -1
- package/lib/module/values/api.js.map +1 -1
- package/lib/module/values/hooks/useClockValue.d.ts +3 -0
- package/lib/module/values/hooks/useClockValue.js +3 -0
- package/lib/module/values/hooks/useClockValue.js.map +1 -1
- package/lib/module/values/hooks/useComputedValue.d.ts +3 -0
- package/lib/module/values/hooks/useComputedValue.js +3 -0
- package/lib/module/values/hooks/useComputedValue.js.map +1 -1
- package/lib/module/values/hooks/useValue.d.ts +3 -0
- package/lib/module/values/hooks/useValue.js +3 -0
- package/lib/module/values/hooks/useValue.js.map +1 -1
- package/lib/module/values/hooks/useValueEffect.d.ts +3 -0
- package/lib/module/values/hooks/useValueEffect.js +3 -0
- package/lib/module/values/hooks/useValueEffect.js.map +1 -1
- package/lib/module/values/types.d.ts +4 -4
- package/lib/module/values/types.js.map +1 -1
- package/lib/module/views/SkiaView.d.ts +5 -0
- package/lib/module/views/SkiaView.js +10 -0
- package/lib/module/views/SkiaView.js.map +1 -1
- package/lib/typescript/src/animation/spring/runSpring.d.ts +3 -0
- package/lib/typescript/src/animation/spring/useSpring.d.ts +3 -0
- package/lib/typescript/src/animation/timing/runTiming.d.ts +3 -0
- package/lib/typescript/src/animation/timing/useLoop.d.ts +3 -0
- package/lib/typescript/src/animation/timing/useTiming.d.ts +3 -0
- package/lib/typescript/src/dom/nodes/datatypes/Fitting.d.ts +5 -5
- package/lib/typescript/src/dom/nodes/datatypes/Gradient.d.ts +235 -75
- package/lib/typescript/src/dom/types/Common.d.ts +3 -3
- package/lib/typescript/src/external/reanimated/interpolators.d.ts +1 -0
- package/lib/typescript/src/external/reanimated/moduleWrapper.d.ts +2 -1
- package/lib/typescript/src/renderer/components/Drawing.d.ts +5 -0
- package/lib/typescript/src/renderer/components/shapes/FitBox.d.ts +5 -5
- package/lib/typescript/src/skia/core/Matrix.d.ts +2 -2
- package/lib/typescript/src/skia/core/Picture.d.ts +2 -2
- package/lib/typescript/src/skia/core/Vector.d.ts +0 -5
- package/lib/typescript/src/skia/types/Canvas.d.ts +1 -1
- package/lib/typescript/src/skia/types/Matrix.d.ts +4 -20
- package/lib/typescript/src/skia/types/Matrix4.d.ts +90 -0
- package/lib/typescript/src/skia/types/Path/Path.d.ts +1 -1
- package/lib/typescript/src/skia/types/Picture/PictureRecorder.d.ts +1 -1
- package/lib/typescript/src/skia/types/Rect.d.ts +1 -0
- package/lib/typescript/src/skia/types/index.d.ts +1 -0
- package/lib/typescript/src/skia/web/Host.d.ts +2 -3
- package/lib/typescript/src/skia/web/JsiSkCanvas.d.ts +1 -1
- package/lib/typescript/src/skia/web/JsiSkMatrix.d.ts +2 -2
- package/lib/typescript/src/skia/web/JsiSkPictureRecorder.d.ts +1 -1
- package/lib/typescript/src/values/api.d.ts +23 -2
- package/lib/typescript/src/values/hooks/useClockValue.d.ts +3 -0
- package/lib/typescript/src/values/hooks/useComputedValue.d.ts +3 -0
- package/lib/typescript/src/values/hooks/useValue.d.ts +3 -0
- package/lib/typescript/src/values/hooks/useValueEffect.d.ts +3 -0
- package/lib/typescript/src/values/types.d.ts +4 -4
- package/lib/typescript/src/views/SkiaView.d.ts +5 -0
- package/package.json +2 -1
- package/src/animation/spring/runSpring.ts +3 -0
- package/src/animation/spring/useSpring.ts +3 -0
- package/src/animation/timing/runTiming.ts +3 -0
- package/src/animation/timing/useLoop.ts +3 -0
- package/src/animation/timing/useTiming.ts +3 -0
- package/src/dom/nodes/JsiSkDOM.ts +4 -0
- package/src/dom/nodes/datatypes/Fitting.ts +10 -2
- package/src/dom/nodes/datatypes/Gradient.ts +2 -2
- package/src/dom/types/Common.ts +5 -3
- package/src/external/reanimated/interpolators.ts +30 -7
- package/src/external/reanimated/moduleWrapper.ts +6 -0
- package/src/renderer/Canvas.tsx +41 -30
- package/src/renderer/components/Drawing.tsx +5 -0
- package/src/skia/core/Matrix.ts +2 -2
- package/src/skia/core/Picture.ts +11 -3
- package/src/skia/core/Vector.ts +0 -4
- package/src/skia/types/Canvas.ts +1 -1
- package/src/skia/types/Matrix.ts +7 -85
- package/src/skia/types/Matrix4.ts +344 -0
- package/src/skia/types/Path/Path.ts +1 -1
- package/src/skia/types/Picture/PictureRecorder.ts +1 -1
- package/src/skia/types/Rect.ts +14 -0
- package/src/skia/types/index.ts +1 -0
- package/src/skia/web/Host.ts +4 -3
- package/src/skia/web/JsiSkCanvas.ts +24 -17
- package/src/skia/web/JsiSkColorFilterFactory.ts +5 -2
- package/src/skia/web/JsiSkFont.ts +3 -3
- package/src/skia/web/JsiSkImage.ts +14 -11
- package/src/skia/web/JsiSkImageFactory.ts +3 -3
- package/src/skia/web/JsiSkImageFilterFactory.ts +5 -5
- package/src/skia/web/JsiSkMaskFilterFactory.ts +6 -2
- package/src/skia/web/JsiSkMatrix.ts +14 -3
- package/src/skia/web/JsiSkPaint.ts +4 -4
- package/src/skia/web/JsiSkPath.ts +9 -6
- package/src/skia/web/JsiSkPathEffectFactory.ts +2 -2
- package/src/skia/web/JsiSkPathFactory.ts +2 -2
- package/src/skia/web/JsiSkPicture.ts +4 -4
- package/src/skia/web/JsiSkPictureRecorder.ts +6 -2
- package/src/skia/web/JsiSkShaderFactory.ts +6 -6
- package/src/skia/web/JsiSkVerticesFactory.ts +2 -2
- package/src/values/api.ts +55 -2
- package/src/values/hooks/useClockValue.ts +3 -0
- package/src/values/hooks/useComputedValue.ts +3 -0
- package/src/values/hooks/useValue.ts +3 -0
- package/src/values/hooks/useValueEffect.ts +3 -0
- package/src/values/types.ts +6 -6
- package/src/views/SkiaView.tsx +11 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ExtrapolationType, SharedValue } from "react-native-reanimated";
|
|
2
2
|
import type { SkPath, SkPoint } from "../../skia/types";
|
|
3
3
|
export declare const notifyChange: (value: SharedValue<unknown>) => void;
|
|
4
|
+
export declare const usePathValue: (cb: (path: SkPath) => void) => SharedValue<SkPath>;
|
|
4
5
|
export declare const useClock: () => SharedValue<number>;
|
|
5
6
|
export declare const usePathInterpolation: (value: SharedValue<number>, input: number[], outputRange: SkPath[], options?: ExtrapolationType) => SharedValue<SkPath>;
|
|
6
7
|
export declare const useVectorInterpolation: (value: SharedValue<number>, input: number[], outputRange: SkPoint[], options?: ExtrapolationType) => SharedValue<{
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { DependencyList } from "react";
|
|
2
|
-
import type { FrameCallback, FrameInfo, SharedValue } from "react-native-reanimated";
|
|
2
|
+
import type { DerivedValue, FrameCallback, FrameInfo, SharedValue } from "react-native-reanimated";
|
|
3
3
|
export declare const HAS_REANIMATED2: boolean;
|
|
4
4
|
export declare const HAS_REANIMATED3: boolean;
|
|
5
5
|
export declare function throwOnMissingReanimated(): void;
|
|
6
6
|
export declare const useSharedValue: <T>(init: T, oneWayReadsOnly?: boolean) => SharedValue<T>;
|
|
7
|
+
export declare const useDerivedValue: <T>(processor: () => T, dependencies?: DependencyList) => DerivedValue<T>;
|
|
7
8
|
export declare const useFrameCallback: (callback: (frameInfo: FrameInfo) => void, autostart?: boolean) => FrameCallback;
|
|
8
9
|
export declare const startMapper: (worklet: () => void, inputs?: unknown[], outputs?: unknown[]) => number;
|
|
9
10
|
export declare const stopMapper: (mapperID: number) => void;
|
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { CustomDrawingNodeProps } from "../../dom/types";
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated If you are looking to use the Skia imperative API, you can use:
|
|
5
|
+
* The picture API: https://shopify.github.io/react-native-skia/docs/shapes/pictures/
|
|
6
|
+
* The offscreen API: https://shopify.github.io/react-native-skia/docs/animations/textures
|
|
7
|
+
*/
|
|
3
8
|
export declare const Drawing: (props: CustomDrawingNodeProps) => React.JSX.Element;
|
|
@@ -8,14 +8,14 @@ interface FitProps {
|
|
|
8
8
|
dst: SkRect;
|
|
9
9
|
children: ReactNode | ReactNode[];
|
|
10
10
|
}
|
|
11
|
-
export declare const fitbox: (fit: Fit, src: SkRect, dst: SkRect) =>
|
|
12
|
-
|
|
11
|
+
export declare const fitbox: (fit: Fit, src: SkRect, dst: SkRect) => [{
|
|
12
|
+
translateX: number;
|
|
13
13
|
}, {
|
|
14
|
-
|
|
14
|
+
translateY: number;
|
|
15
15
|
}, {
|
|
16
|
-
|
|
16
|
+
scaleX: number;
|
|
17
17
|
}, {
|
|
18
|
-
|
|
18
|
+
scaleY: number;
|
|
19
19
|
}];
|
|
20
20
|
export declare const FitBox: ({ fit, src, dst, children }: FitProps) => React.JSX.Element;
|
|
21
21
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const processTransform2d: (transforms:
|
|
1
|
+
import type { Transforms3d } from "../types";
|
|
2
|
+
export declare const processTransform2d: (transforms: Transforms3d) => import("../types").SkMatrix;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type SkCanvas, type SkRect, type SkSize } from "../types";
|
|
2
2
|
/**
|
|
3
3
|
* Memoizes and returns an SkPicture that can be drawn to another canvas.
|
|
4
4
|
* @param rect Picture bounds
|
|
5
5
|
* @param cb Callback for drawing to the canvas
|
|
6
6
|
* @returns SkPicture
|
|
7
7
|
*/
|
|
8
|
-
export declare const createPicture: (
|
|
8
|
+
export declare const createPicture: (cb: (canvas: SkCanvas) => void, rect?: SkRect | SkSize) => import("../types").SkPicture;
|
|
@@ -5,8 +5,3 @@ export declare const neg: (a: Vector) => import("../types").SkPoint;
|
|
|
5
5
|
export declare const add: (a: Vector, b: Vector) => import("../types").SkPoint;
|
|
6
6
|
export declare const sub: (a: Vector, b: Vector) => import("../types").SkPoint;
|
|
7
7
|
export declare const dist: (a: Vector, b: Vector) => number;
|
|
8
|
-
export declare const translate: ({ x, y }: Vector) => readonly [{
|
|
9
|
-
readonly translateX: number;
|
|
10
|
-
}, {
|
|
11
|
-
readonly translateY: number;
|
|
12
|
-
}];
|
|
@@ -372,7 +372,7 @@ export interface SkCanvas {
|
|
|
372
372
|
* Replaces current matrix with m premultiplied with the existing matrix.
|
|
373
373
|
* @param m
|
|
374
374
|
*/
|
|
375
|
-
concat(m: SkMatrix): void;
|
|
375
|
+
concat(m: SkMatrix | number[]): void;
|
|
376
376
|
/**
|
|
377
377
|
* Draws the given picture using the current clip, current matrix, and the provided paint.
|
|
378
378
|
* @param skp
|
|
@@ -1,19 +1,9 @@
|
|
|
1
1
|
import type { SkJSIInstance } from "./JsiInstance";
|
|
2
2
|
import type { SkCanvas } from "./Canvas";
|
|
3
|
-
|
|
4
|
-
ScaleX = 0,
|
|
5
|
-
SkewX = 1,
|
|
6
|
-
TransX = 2,
|
|
7
|
-
SkewY = 3,
|
|
8
|
-
ScaleY = 4,
|
|
9
|
-
TransY = 5,
|
|
10
|
-
Persp0 = 6,
|
|
11
|
-
Persp1 = 7,
|
|
12
|
-
Persp2 = 8
|
|
13
|
-
}
|
|
3
|
+
import type { Matrix3, Matrix4, Transforms3d } from "./Matrix4";
|
|
14
4
|
export declare const isMatrix: (obj: unknown) => obj is SkMatrix;
|
|
15
5
|
export interface SkMatrix extends SkJSIInstance<"Matrix"> {
|
|
16
|
-
concat: (matrix: SkMatrix) => SkMatrix;
|
|
6
|
+
concat: (matrix: SkMatrix | Matrix4 | Matrix3 | number[]) => SkMatrix;
|
|
17
7
|
translate: (x: number, y: number) => SkMatrix;
|
|
18
8
|
scale: (x: number, y?: number) => SkMatrix;
|
|
19
9
|
skew: (x: number, y: number) => SkMatrix;
|
|
@@ -25,14 +15,8 @@ export interface SkMatrix extends SkJSIInstance<"Matrix"> {
|
|
|
25
15
|
identity: () => SkMatrix;
|
|
26
16
|
get: () => number[];
|
|
27
17
|
}
|
|
28
|
-
type Transform2dName = "translateX" | "translateY" | "scale" | "skewX" | "skewY" | "scaleX" | "scaleY" | "rotateZ" | "rotate";
|
|
29
|
-
type Transformations = {
|
|
30
|
-
readonly [Name in Transform2dName]: number;
|
|
31
|
-
};
|
|
32
|
-
export type Transforms2d = readonly (Pick<Transformations, "translateX"> | Pick<Transformations, "translateY"> | Pick<Transformations, "scale"> | Pick<Transformations, "scaleX"> | Pick<Transformations, "scaleY"> | Pick<Transformations, "skewX"> | Pick<Transformations, "skewY"> | Pick<Transformations, "rotate">)[];
|
|
33
18
|
export interface TransformProp {
|
|
34
|
-
transform?:
|
|
19
|
+
transform?: Transforms3d;
|
|
35
20
|
}
|
|
36
|
-
export declare const processTransform: <T extends SkMatrix | SkCanvas>(m: T, transforms:
|
|
21
|
+
export declare const processTransform: <T extends SkMatrix | SkCanvas>(m: T, transforms: Transforms3d) => T;
|
|
37
22
|
export declare const toDegrees: (rad: number) => number;
|
|
38
|
-
export {};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
type Point = {
|
|
2
|
+
x: number;
|
|
3
|
+
y: number;
|
|
4
|
+
};
|
|
5
|
+
type Vec2 = readonly [number, number];
|
|
6
|
+
type Vec3 = readonly [number, number, number];
|
|
7
|
+
export type Matrix3 = readonly [
|
|
8
|
+
number,
|
|
9
|
+
number,
|
|
10
|
+
number,
|
|
11
|
+
number,
|
|
12
|
+
number,
|
|
13
|
+
number,
|
|
14
|
+
number,
|
|
15
|
+
number,
|
|
16
|
+
number
|
|
17
|
+
];
|
|
18
|
+
export type Matrix4 = readonly [
|
|
19
|
+
number,
|
|
20
|
+
number,
|
|
21
|
+
number,
|
|
22
|
+
number,
|
|
23
|
+
number,
|
|
24
|
+
number,
|
|
25
|
+
number,
|
|
26
|
+
number,
|
|
27
|
+
number,
|
|
28
|
+
number,
|
|
29
|
+
number,
|
|
30
|
+
number,
|
|
31
|
+
number,
|
|
32
|
+
number,
|
|
33
|
+
number,
|
|
34
|
+
number
|
|
35
|
+
];
|
|
36
|
+
type Transform3dName = "translateX" | "translateY" | "translateZ" | "translate" | "scale" | "scaleX" | "scaleY" | "skewX" | "skewY" | "rotateZ" | "rotate" | "perspective" | "rotateX" | "rotateY" | "matrix";
|
|
37
|
+
type Transformations = {
|
|
38
|
+
[Name in Transform3dName]: Name extends "matrix" ? Matrix4 : Name extends "translate" ? Vec3 | Vec2 : number;
|
|
39
|
+
};
|
|
40
|
+
type Transform3d = Pick<Transformations, "translateX"> | Pick<Transformations, "translateY"> | Pick<Transformations, "translateZ"> | Pick<Transformations, "translate"> | Pick<Transformations, "scale"> | Pick<Transformations, "scaleX"> | Pick<Transformations, "scaleY"> | Pick<Transformations, "skewX"> | Pick<Transformations, "skewY"> | Pick<Transformations, "perspective"> | Pick<Transformations, "rotateX"> | Pick<Transformations, "rotateY"> | Pick<Transformations, "rotateZ"> | Pick<Transformations, "rotate"> | Pick<Transformations, "matrix">;
|
|
41
|
+
export type Transforms3d = Transform3d[];
|
|
42
|
+
/**
|
|
43
|
+
* @worklet
|
|
44
|
+
*/
|
|
45
|
+
export declare const Matrix4: () => Matrix4;
|
|
46
|
+
/**
|
|
47
|
+
* @worklet
|
|
48
|
+
*/
|
|
49
|
+
export declare const translate: (x: number, y: number, z?: number) => Matrix4;
|
|
50
|
+
/**
|
|
51
|
+
* @worklet
|
|
52
|
+
*/
|
|
53
|
+
export declare const perspective: (p: number) => Matrix4;
|
|
54
|
+
/**
|
|
55
|
+
* @worklet
|
|
56
|
+
*/
|
|
57
|
+
export declare const mapPoint3d: (m: Matrix4, v: Vec3) => readonly [number, number, number];
|
|
58
|
+
/**
|
|
59
|
+
* @worklet
|
|
60
|
+
*/
|
|
61
|
+
export declare const multiply4: (a: Matrix4, b: Matrix4) => Matrix4;
|
|
62
|
+
/**
|
|
63
|
+
* @worklet
|
|
64
|
+
*/
|
|
65
|
+
export declare const toMatrix3: (m: Matrix4) => number[];
|
|
66
|
+
/**
|
|
67
|
+
* @worklet
|
|
68
|
+
*/
|
|
69
|
+
export declare const pivot: (m: Matrix4, p: Point) => Matrix4;
|
|
70
|
+
/**
|
|
71
|
+
* @worklet
|
|
72
|
+
*/
|
|
73
|
+
export declare const scale: (sx: number, sy: number, sz?: number, p?: Point) => Matrix4;
|
|
74
|
+
/**
|
|
75
|
+
* @worklet
|
|
76
|
+
*/
|
|
77
|
+
export declare const rotateZ: (value: number, p?: Point) => Matrix4;
|
|
78
|
+
/**
|
|
79
|
+
* @worklet
|
|
80
|
+
*/
|
|
81
|
+
export declare const rotateX: (value: number, p?: Point) => Matrix4;
|
|
82
|
+
/**
|
|
83
|
+
* @worklet
|
|
84
|
+
*/
|
|
85
|
+
export declare const rotateY: (value: number, p?: Point) => Matrix4;
|
|
86
|
+
/**
|
|
87
|
+
* @worklet
|
|
88
|
+
*/
|
|
89
|
+
export declare const processTransform3d: (transforms: Transforms3d) => number[];
|
|
90
|
+
export {};
|
|
@@ -440,7 +440,7 @@ export interface SkPath extends SkJSIInstance<"Path"> {
|
|
|
440
440
|
/**
|
|
441
441
|
* Transforms the path by the specified matrix.
|
|
442
442
|
*/
|
|
443
|
-
transform(m3: SkMatrix): SkPath;
|
|
443
|
+
transform(m3: SkMatrix | number[]): SkPath;
|
|
444
444
|
/**
|
|
445
445
|
* Interpolates between Path with point array of equal size.
|
|
446
446
|
* Copy verb array and weights to result, and set result path to a weighted
|
|
@@ -7,7 +7,7 @@ export interface SkPictureRecorder {
|
|
|
7
7
|
*
|
|
8
8
|
* @param bounds - a rect to cull the results.
|
|
9
9
|
*/
|
|
10
|
-
beginRecording(bounds
|
|
10
|
+
beginRecording(bounds?: SkRect): SkCanvas;
|
|
11
11
|
/**
|
|
12
12
|
* Returns the captured draw commands as a picture and invalidates the canvas returned earlier.
|
|
13
13
|
*/
|
|
@@ -16,6 +16,5 @@ export declare abstract class BaseHostObject<T, N extends string> extends Host i
|
|
|
16
16
|
export declare abstract class HostObject<T, N extends string> extends BaseHostObject<T, N> {
|
|
17
17
|
static fromValue<T>(value: SkJSIInstance<string>): T;
|
|
18
18
|
}
|
|
19
|
-
export declare const
|
|
20
|
-
export declare const
|
|
21
|
-
export declare const optEnum: (value: number | undefined) => EmbindEnumEntity | undefined;
|
|
19
|
+
export declare const getEnum: (e: EmbindEnum, v: number) => EmbindEnumEntity;
|
|
20
|
+
export declare const optEnum: (e: EmbindEnum, value: number | undefined) => EmbindEnumEntity | undefined;
|
|
@@ -40,7 +40,7 @@ export declare class JsiSkCanvas extends HostObject<Canvas, "Canvas"> implements
|
|
|
40
40
|
clipPath(path: SkPath, op: ClipOp, doAntiAlias: boolean): void;
|
|
41
41
|
clipRect(rect: SkRect, op: ClipOp, doAntiAlias: boolean): void;
|
|
42
42
|
clipRRect(rrect: SkRRect, op: ClipOp, doAntiAlias: boolean): void;
|
|
43
|
-
concat(m: SkMatrix): void;
|
|
43
|
+
concat(m: SkMatrix | number[]): void;
|
|
44
44
|
drawPicture(skp: SkPicture): void;
|
|
45
45
|
readPixels(srcX: number, srcY: number, imageInfo: ImageInfo): Float32Array | Uint8Array | null;
|
|
46
46
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { CanvasKit, Matrix3x3 } from "canvaskit-wasm";
|
|
2
|
-
import type
|
|
2
|
+
import { type Matrix3, type Matrix4, type SkMatrix } from "../types";
|
|
3
3
|
import { HostObject } from "./Host";
|
|
4
4
|
export declare class JsiSkMatrix extends HostObject<Matrix3x3, "Matrix"> implements SkMatrix {
|
|
5
5
|
constructor(CanvasKit: CanvasKit, ref: Matrix3x3);
|
|
6
6
|
private preMultiply;
|
|
7
7
|
private postMultiply;
|
|
8
8
|
dispose: () => void;
|
|
9
|
-
concat(matrix: SkMatrix): this;
|
|
9
|
+
concat(matrix: SkMatrix | number[] | Matrix4 | Matrix3): this;
|
|
10
10
|
translate(x: number, y: number): this;
|
|
11
11
|
postTranslate(x: number, y: number): this;
|
|
12
12
|
scale(x: number, y?: number): this;
|
|
@@ -7,6 +7,6 @@ import { JsiSkPicture } from "./JsiSkPicture";
|
|
|
7
7
|
export declare class JsiSkPictureRecorder extends HostObject<PictureRecorder, "PictureRecorder"> implements SkPictureRecorder {
|
|
8
8
|
constructor(CanvasKit: CanvasKit, ref: PictureRecorder);
|
|
9
9
|
dispose: () => void;
|
|
10
|
-
beginRecording(bounds
|
|
10
|
+
beginRecording(bounds?: SkRect): JsiSkCanvas;
|
|
11
11
|
finishRecordingAsPicture(): JsiSkPicture;
|
|
12
12
|
}
|
|
@@ -1,5 +1,26 @@
|
|
|
1
|
-
import type { ISkiaValueApi } from "./types";
|
|
1
|
+
import type { AnimationState, ISkiaValueApi, SkiaAnimation, SkiaClockValue, SkiaMutableValue, SkiaValue } from "./types";
|
|
2
2
|
declare global {
|
|
3
3
|
var SkiaValueApi: ISkiaValueApi;
|
|
4
4
|
}
|
|
5
|
-
export declare const ValueApi:
|
|
5
|
+
export declare const ValueApi: {
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated Use Reanimated 3
|
|
8
|
+
* for animating Skia: https://shopify.github.io/react-native-skia/docs/animations/animations
|
|
9
|
+
*/
|
|
10
|
+
createValue<T>(initialValue: T): SkiaMutableValue<T>;
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated Use Reanimated 3
|
|
13
|
+
* for animating Skia: https://shopify.github.io/react-native-skia/docs/animations/animations
|
|
14
|
+
*/
|
|
15
|
+
createComputedValue<R>(cb: () => R, values: SkiaValue<unknown>[]): SkiaValue<R>;
|
|
16
|
+
/**
|
|
17
|
+
* @deprecated Use Reanimated 3
|
|
18
|
+
* for animating Skia: https://shopify.github.io/react-native-skia/docs/animations/animations
|
|
19
|
+
*/
|
|
20
|
+
createClockValue(): SkiaClockValue;
|
|
21
|
+
/**
|
|
22
|
+
* @deprecated Use Reanimated 3
|
|
23
|
+
* for animating Skia: https://shopify.github.io/react-native-skia/docs/animations/animations
|
|
24
|
+
*/
|
|
25
|
+
createAnimation<S extends AnimationState = AnimationState>(cb: (t: number, state: S | undefined) => S): SkiaAnimation;
|
|
26
|
+
};
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @deprecated Use Reanimated 3
|
|
3
|
+
* for animating Skia: https://shopify.github.io/react-native-skia/docs/animations/animations
|
|
4
|
+
*
|
|
2
5
|
* @returns A new value that will be updated on every frame redraw with the
|
|
3
6
|
* number of milliseconds elapsed since the value was started.
|
|
4
7
|
* The clock is created in the stopped state.
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @deprecated Use Reanimated 3
|
|
3
|
+
* for animating Skia: https://shopify.github.io/react-native-skia/docs/animations/animations
|
|
4
|
+
*
|
|
2
5
|
* Creates a new computed value - a value that will calculate its value depending
|
|
3
6
|
* on other values.
|
|
4
7
|
* @param cb Callback to calculate new value
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { SkiaMutableValue } from "../types";
|
|
2
2
|
/**
|
|
3
|
+
* @deprecated Use Reanimated 3
|
|
4
|
+
* for animating Skia: https://shopify.github.io/react-native-skia/docs/animations/animations
|
|
5
|
+
*
|
|
3
6
|
* Creates a new value that holds some data.
|
|
4
7
|
* @param v Value to hold
|
|
5
8
|
* @returns A Value of type of v
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { SkiaValue } from "../types";
|
|
2
2
|
/**
|
|
3
|
+
* @deprecated Use Reanimated 3
|
|
4
|
+
* for animating Skia: https://shopify.github.io/react-native-skia/docs/animations/animations
|
|
5
|
+
*
|
|
3
6
|
* Sets up an effect that will be run whenever the value changes
|
|
4
7
|
* @param value Value to subscribe to changes on
|
|
5
8
|
* @param cb Callback to run when value changes
|
|
@@ -43,21 +43,21 @@ export interface ISkiaValueApi {
|
|
|
43
43
|
* Creates a new value that holds the initial value and that
|
|
44
44
|
* can be changed.
|
|
45
45
|
*/
|
|
46
|
-
createValue
|
|
46
|
+
createValue<T>(initialValue: T): SkiaMutableValue<T>;
|
|
47
47
|
/**
|
|
48
48
|
* Creates a computed value. This is a calculated value that returns the result of
|
|
49
49
|
* a function that is called with the values of the dependencies.
|
|
50
50
|
*/
|
|
51
|
-
createComputedValue
|
|
51
|
+
createComputedValue<R>(cb: () => R, values: Array<SkiaValue<unknown>>): SkiaValue<R>;
|
|
52
52
|
/**
|
|
53
53
|
* Creates a clock value where the value is the number of milliseconds elapsed
|
|
54
54
|
* since the clock was created
|
|
55
55
|
*/
|
|
56
|
-
createClockValue
|
|
56
|
+
createClockValue(): SkiaClockValue;
|
|
57
57
|
/**
|
|
58
58
|
* Creates an animation that is driven from a clock and updated every frame.
|
|
59
59
|
* @param cb Callback to calculate next value from time.
|
|
60
60
|
* @returns An animation object that can control a value.
|
|
61
61
|
*/
|
|
62
|
-
createAnimation
|
|
62
|
+
createAnimation<S extends AnimationState = AnimationState>(cb: (t: number, state: S | undefined) => S): SkiaAnimation;
|
|
63
63
|
}
|
|
@@ -5,6 +5,11 @@ import type { SkiaDrawViewProps } from "./types";
|
|
|
5
5
|
export declare const SkiaViewNativeId: {
|
|
6
6
|
current: number;
|
|
7
7
|
};
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated If you are looking to use the Skia imperative API, you can use:
|
|
10
|
+
* The picture API: https://shopify.github.io/react-native-skia/docs/shapes/pictures/
|
|
11
|
+
* The offscreen API: https://shopify.github.io/react-native-skia/docs/animations/textures
|
|
12
|
+
*/
|
|
8
13
|
export declare class SkiaView extends React.Component<SkiaDrawViewProps> {
|
|
9
14
|
constructor(props: SkiaDrawViewProps);
|
|
10
15
|
private _nativeId;
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"setup-skia-web": "./scripts/setup-canvaskit.js"
|
|
8
8
|
},
|
|
9
9
|
"title": "React Native Skia",
|
|
10
|
-
"version": "0.1.
|
|
10
|
+
"version": "0.1.228",
|
|
11
11
|
"description": "High-performance React Native Graphics using Skia",
|
|
12
12
|
"main": "lib/module/index.js",
|
|
13
13
|
"files": [
|
|
@@ -94,6 +94,7 @@
|
|
|
94
94
|
"eslint-config-react-native-wcandillon": "3.10.2",
|
|
95
95
|
"eslint-plugin-reanimated": "2.0.0",
|
|
96
96
|
"jest": "29.6.4",
|
|
97
|
+
"jest-diff": "^29.7.0",
|
|
97
98
|
"merge-dirs": "^0.2.1",
|
|
98
99
|
"pixelmatch": "^5.3.0",
|
|
99
100
|
"pngjs": "^6.0.0",
|
|
@@ -10,6 +10,9 @@ import { Spring } from "./Spring";
|
|
|
10
10
|
import { createSpringEasing } from "./functions/spring";
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
+
* @deprecated Use Reanimated 3 for animations:
|
|
14
|
+
* https://shopify.github.io/react-native-skia/docs/animations/animations
|
|
15
|
+
*
|
|
13
16
|
* Creates a new animation on an existing value that will be driven by
|
|
14
17
|
* an animation value. The value will be run from / to the value in
|
|
15
18
|
* params and modified by the provided easing curve for the length of
|
|
@@ -10,6 +10,9 @@ import { Spring } from "./Spring";
|
|
|
10
10
|
import { createSpringEasing } from "./functions/spring";
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
+
* @deprecated Use Reanimated 3 for animations:
|
|
14
|
+
* https://shopify.github.io/react-native-skia/docs/animations/animations
|
|
15
|
+
*
|
|
13
16
|
* Creats a spring based animation value that will run whenever
|
|
14
17
|
* the animation parameters change.
|
|
15
18
|
* @param toOrParams
|
|
@@ -8,6 +8,9 @@ import type {
|
|
|
8
8
|
import { getResolvedParams } from "./functions";
|
|
9
9
|
import { createTiming } from "./createTiming";
|
|
10
10
|
/**
|
|
11
|
+
* @deprecated Use Reanimated 3 for animations:
|
|
12
|
+
* https://shopify.github.io/react-native-skia/docs/animations/animations
|
|
13
|
+
*
|
|
11
14
|
* Creates a new animation on an existing value that will be driven by
|
|
12
15
|
* an animation value. The value will be run from / to the value in
|
|
13
16
|
* params and modified by the provided easing curve for the length of
|
|
@@ -3,6 +3,9 @@ import type { TimingConfig } from "../types";
|
|
|
3
3
|
import { useTiming } from "./useTiming";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
+
* @deprecated Use Reanimated 3 for animations:
|
|
7
|
+
* https://shopify.github.io/react-native-skia/docs/animations/animations
|
|
8
|
+
*
|
|
6
9
|
* Configures a looped timing value. The value will go back and forth
|
|
7
10
|
* between 0 and 1 and back.
|
|
8
11
|
* @param config Timing configuration for easing and duration
|
|
@@ -12,6 +12,9 @@ import { getResolvedParams } from "./functions";
|
|
|
12
12
|
import { createTiming } from "./createTiming";
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
+
* @deprecated Use Reanimated 3 for animations:
|
|
16
|
+
* https://shopify.github.io/react-native-skia/docs/animations/animations
|
|
17
|
+
*
|
|
15
18
|
* Creats an animation value that will run whenever
|
|
16
19
|
* the animation parameters change. The animation start immediately.
|
|
17
20
|
* @param toOrParams
|
|
@@ -173,6 +173,10 @@ export class JsiSkDOM implements SkDOM {
|
|
|
173
173
|
}
|
|
174
174
|
|
|
175
175
|
CustomDrawing(props: CustomDrawingNodeProps) {
|
|
176
|
+
console.warn(
|
|
177
|
+
// eslint-disable-next-line max-len
|
|
178
|
+
"The <Drawing /> component is deprecated and will be removed in the next release. For custom drawings, please sure the <Picture /> component: https://shopify.github.io/react-native-skia/docs/shapes/pictures/"
|
|
179
|
+
);
|
|
176
180
|
return NATIVE_DOM
|
|
177
181
|
? global.SkiaDomApi.CustomDrawingNode(props ?? {})
|
|
178
182
|
: new CustomDrawingNode(this.ctx, props);
|
|
@@ -9,12 +9,20 @@ export interface Size {
|
|
|
9
9
|
|
|
10
10
|
export const size = (width = 0, height = 0) => ({ width, height });
|
|
11
11
|
|
|
12
|
-
export const rect2rect = (
|
|
12
|
+
export const rect2rect = (
|
|
13
|
+
src: SkRect,
|
|
14
|
+
dst: SkRect
|
|
15
|
+
): [
|
|
16
|
+
{ translateX: number },
|
|
17
|
+
{ translateY: number },
|
|
18
|
+
{ scaleX: number },
|
|
19
|
+
{ scaleY: number }
|
|
20
|
+
] => {
|
|
13
21
|
const scaleX = dst.width / src.width;
|
|
14
22
|
const scaleY = dst.height / src.height;
|
|
15
23
|
const translateX = dst.x - src.x * scaleX;
|
|
16
24
|
const translateY = dst.y - src.y * scaleY;
|
|
17
|
-
return [{ translateX }, { translateY }, { scaleX }, { scaleY }]
|
|
25
|
+
return [{ translateX }, { translateY }, { scaleX }, { scaleY }];
|
|
18
26
|
};
|
|
19
27
|
|
|
20
28
|
export const fitRects = (
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { Skia, SkRect,
|
|
1
|
+
import type { Skia, SkRect, Transforms3d, Vector } from "../../../skia/types";
|
|
2
2
|
import { TileMode } from "../../../skia/types";
|
|
3
3
|
import type { GradientProps, ImageShaderProps } from "../../types";
|
|
4
4
|
|
|
5
5
|
import { enumKey } from "./Enum";
|
|
6
6
|
import { processTransformProps } from "./Transform";
|
|
7
7
|
|
|
8
|
-
export const transformOrigin = (origin: Vector, transform:
|
|
8
|
+
export const transformOrigin = (origin: Vector, transform: Transforms3d) => [
|
|
9
9
|
{ translateX: origin.x },
|
|
10
10
|
{ translateY: origin.y },
|
|
11
11
|
...transform,
|
package/src/dom/types/Common.ts
CHANGED
|
@@ -3,6 +3,8 @@ import type { ReactNode } from "react";
|
|
|
3
3
|
import type {
|
|
4
4
|
BlendMode,
|
|
5
5
|
Color,
|
|
6
|
+
Matrix3,
|
|
7
|
+
Matrix4,
|
|
6
8
|
PaintStyle,
|
|
7
9
|
SkMatrix,
|
|
8
10
|
SkPaint,
|
|
@@ -11,7 +13,7 @@ import type {
|
|
|
11
13
|
SkRRect,
|
|
12
14
|
StrokeCap,
|
|
13
15
|
StrokeJoin,
|
|
14
|
-
|
|
16
|
+
Transforms3d,
|
|
15
17
|
Vector,
|
|
16
18
|
} from "../../skia/types";
|
|
17
19
|
|
|
@@ -64,9 +66,9 @@ export interface ScalarCircleDef {
|
|
|
64
66
|
export type CircleDef = PointCircleDef | ScalarCircleDef;
|
|
65
67
|
|
|
66
68
|
export interface TransformProps {
|
|
67
|
-
transform?:
|
|
69
|
+
transform?: Transforms3d;
|
|
68
70
|
origin?: Vector;
|
|
69
|
-
matrix?: SkMatrix;
|
|
71
|
+
matrix?: SkMatrix | Matrix4 | Matrix3 | number[];
|
|
70
72
|
}
|
|
71
73
|
|
|
72
74
|
export interface PaintProps extends ChildrenProps {
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type {
|
|
2
|
+
ExtrapolationType,
|
|
3
|
+
FrameInfo,
|
|
4
|
+
SharedValue,
|
|
5
|
+
} from "react-native-reanimated";
|
|
6
|
+
import { useCallback, useMemo } from "react";
|
|
3
7
|
|
|
4
8
|
import type { SkPath, SkPoint } from "../../skia/types";
|
|
5
9
|
import { interpolatePaths, interpolateVector } from "../../animation";
|
|
@@ -9,19 +13,38 @@ import {
|
|
|
9
13
|
useAnimatedReaction,
|
|
10
14
|
useFrameCallback,
|
|
11
15
|
useSharedValue,
|
|
16
|
+
useDerivedValue,
|
|
12
17
|
} from "./moduleWrapper";
|
|
13
18
|
|
|
14
19
|
export const notifyChange = (value: SharedValue<unknown>) => {
|
|
15
20
|
"worklet";
|
|
16
|
-
|
|
17
|
-
|
|
21
|
+
if (_WORKLET) {
|
|
22
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
23
|
+
(value as any)._value = value.value;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const usePathValue = (cb: (path: SkPath) => void) => {
|
|
28
|
+
const pathInit = useMemo(() => Skia.Path.Make(), []);
|
|
29
|
+
const path = useSharedValue(pathInit);
|
|
30
|
+
useDerivedValue(() => {
|
|
31
|
+
path.value.reset();
|
|
32
|
+
cb(path.value);
|
|
33
|
+
notifyChange(path);
|
|
34
|
+
});
|
|
35
|
+
return path;
|
|
18
36
|
};
|
|
19
37
|
|
|
20
38
|
export const useClock = () => {
|
|
21
39
|
const clock = useSharedValue(0);
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
40
|
+
const callback = useCallback(
|
|
41
|
+
(info: FrameInfo) => {
|
|
42
|
+
"worklet";
|
|
43
|
+
clock.value = info.timeSinceFirstFrame;
|
|
44
|
+
},
|
|
45
|
+
[clock]
|
|
46
|
+
);
|
|
47
|
+
useFrameCallback(callback);
|
|
25
48
|
return clock;
|
|
26
49
|
};
|
|
27
50
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
2
|
import type { DependencyList } from "react";
|
|
3
3
|
import type {
|
|
4
|
+
DerivedValue,
|
|
4
5
|
FrameCallback,
|
|
5
6
|
FrameInfo,
|
|
6
7
|
SharedValue,
|
|
@@ -42,6 +43,11 @@ export const useSharedValue: <T>(
|
|
|
42
43
|
oneWayReadsOnly?: boolean
|
|
43
44
|
) => SharedValue<T> = Reanimated2?.useSharedValue || throwOnMissingReanimated;
|
|
44
45
|
|
|
46
|
+
export const useDerivedValue: <T>(
|
|
47
|
+
processor: () => T,
|
|
48
|
+
dependencies?: DependencyList
|
|
49
|
+
) => DerivedValue<T> = Reanimated2?.useDerivedValue || throwOnMissingReanimated;
|
|
50
|
+
|
|
45
51
|
export const useFrameCallback: (
|
|
46
52
|
callback: (frameInfo: FrameInfo) => void,
|
|
47
53
|
autostart?: boolean
|