@shopify/react-native-skia 0.1.224 → 0.1.227
Sign up to get free protection for your applications and to get access to all the features.
- package/android/cpp/rnskia-android/SkiaOpenGLSurfaceFactory.h +3 -3
- package/cpp/api/JsiSkMatrix.h +8 -2
- package/cpp/api/JsiSkParagraphStyle.h +3 -2
- package/cpp/api/JsiSkPictureRecorder.h +10 -3
- package/cpp/api/JsiSkStrutStyle.h +10 -3
- package/cpp/rnskia/dom/props/MatrixProp.h +8 -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.js +10 -4
- package/lib/commonjs/external/reanimated/interpolators.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 +3 -3
- 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 -9
- package/lib/commonjs/skia/types/Matrix.js +5 -56
- package/lib/commonjs/skia/types/Matrix.js.map +1 -1
- package/lib/commonjs/skia/types/Matrix4.d.ts +39 -0
- package/lib/commonjs/skia/types/Matrix4.js +213 -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/JsiSkCanvas.d.ts +1 -1
- package/lib/commonjs/skia/web/JsiSkCanvas.js +1 -1
- package/lib/commonjs/skia/web/JsiSkCanvas.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkMatrix.d.ts +1 -1
- package/lib/commonjs/skia/web/JsiSkMatrix.js +1 -1
- package/lib/commonjs/skia/web/JsiSkMatrix.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPath.js +1 -1
- package/lib/commonjs/skia/web/JsiSkPath.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/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.js +11 -5
- package/lib/module/external/reanimated/interpolators.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 +3 -3
- 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 -9
- package/lib/module/skia/types/Matrix.js +3 -57
- package/lib/module/skia/types/Matrix.js.map +1 -1
- package/lib/module/skia/types/Matrix4.d.ts +39 -0
- package/lib/module/skia/types/Matrix4.js +200 -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/JsiSkCanvas.d.ts +1 -1
- package/lib/module/skia/web/JsiSkCanvas.js +1 -1
- package/lib/module/skia/web/JsiSkCanvas.js.map +1 -1
- package/lib/module/skia/web/JsiSkMatrix.d.ts +1 -1
- package/lib/module/skia/web/JsiSkMatrix.js +1 -1
- package/lib/module/skia/web/JsiSkMatrix.js.map +1 -1
- package/lib/module/skia/web/JsiSkPath.js +1 -1
- package/lib/module/skia/web/JsiSkPath.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/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/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 +3 -3
- package/lib/typescript/src/skia/types/Canvas.d.ts +1 -1
- package/lib/typescript/src/skia/types/Matrix.d.ts +4 -9
- package/lib/typescript/src/skia/types/Matrix4.d.ts +39 -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/JsiSkCanvas.d.ts +1 -1
- package/lib/typescript/src/skia/web/JsiSkMatrix.d.ts +1 -1
- 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 +1 -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 +3 -3
- package/src/external/reanimated/interpolators.ts +14 -6
- 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 +5 -2
- package/src/skia/types/Canvas.ts +1 -1
- package/src/skia/types/Matrix.ts +7 -74
- package/src/skia/types/Matrix4.ts +266 -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/JsiSkCanvas.ts +2 -2
- package/src/skia/web/JsiSkMatrix.ts +4 -2
- package/src/skia/web/JsiSkPath.ts +1 -1
- package/src/skia/web/JsiSkPictureRecorder.ts +6 -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 +1 @@
|
|
1
|
-
{"version":3,"names":["size","width","height","rect2rect","src","dst","scaleX","scaleY","translateX","x","translateY","y","fitRects","fit","rect","sizes","applyBoxFit","inscribe","halfWidthDelta","halfHeightDelta","input","output","Math","min","aspectRatio","exhaustiveCheck"],"sources":["Fitting.ts"],"sourcesContent":["import { exhaustiveCheck } from \"../../../renderer/typeddash\";\nimport type { SkRect } from \"../../../skia/types\";\nimport type { Fit } from \"../../types\";\n\nexport interface Size {\n width: number;\n height: number;\n}\n\nexport const size = (width = 0, height = 0) => ({ width, height });\n\nexport const rect2rect = (src: SkRect
|
1
|
+
{"version":3,"names":["size","width","height","rect2rect","src","dst","scaleX","scaleY","translateX","x","translateY","y","fitRects","fit","rect","sizes","applyBoxFit","inscribe","halfWidthDelta","halfHeightDelta","input","output","Math","min","aspectRatio","exhaustiveCheck"],"sources":["Fitting.ts"],"sourcesContent":["import { exhaustiveCheck } from \"../../../renderer/typeddash\";\nimport type { SkRect } from \"../../../skia/types\";\nimport type { Fit } from \"../../types\";\n\nexport interface Size {\n width: number;\n height: number;\n}\n\nexport const size = (width = 0, height = 0) => ({ width, height });\n\nexport const rect2rect = (\n src: SkRect,\n dst: SkRect\n): [\n { translateX: number },\n { translateY: number },\n { scaleX: number },\n { scaleY: number }\n] => {\n const scaleX = dst.width / src.width;\n const scaleY = dst.height / src.height;\n const translateX = dst.x - src.x * scaleX;\n const translateY = dst.y - src.y * scaleY;\n return [{ translateX }, { translateY }, { scaleX }, { scaleY }];\n};\n\nexport const fitRects = (\n fit: Fit,\n rect: SkRect,\n { x, y, width, height }: SkRect\n) => {\n const sizes = applyBoxFit(\n fit,\n { width: rect.width, height: rect.height },\n { width, height }\n );\n const src = inscribe(sizes.src, rect);\n const dst = inscribe(sizes.dst, {\n x,\n y,\n width,\n height,\n });\n return { src, dst };\n};\n\nconst inscribe = (\n { width, height }: Size,\n rect: { x: number; y: number; width: number; height: number }\n) => {\n const halfWidthDelta = (rect.width - width) / 2.0;\n const halfHeightDelta = (rect.height - height) / 2.0;\n return {\n x: rect.x + halfWidthDelta,\n y: rect.y + halfHeightDelta,\n width,\n height,\n };\n};\n\nconst applyBoxFit = (fit: Fit, input: Size, output: Size) => {\n let src = size(),\n dst = size();\n if (\n input.height <= 0.0 ||\n input.width <= 0.0 ||\n output.height <= 0.0 ||\n output.width <= 0.0\n ) {\n return { src, dst };\n }\n switch (fit) {\n case \"fill\":\n src = input;\n dst = output;\n break;\n case \"contain\":\n src = input;\n if (output.width / output.height > src.width / src.height) {\n dst = size((src.width * output.height) / src.height, output.height);\n } else {\n dst = size(output.width, (src.height * output.width) / src.width);\n }\n break;\n case \"cover\":\n if (output.width / output.height > input.width / input.height) {\n src = size(input.width, (input.width * output.height) / output.width);\n } else {\n src = size((input.height * output.width) / output.height, input.height);\n }\n dst = output;\n break;\n case \"fitWidth\":\n src = size(input.width, (input.width * output.height) / output.width);\n dst = size(output.width, (src.height * output.width) / src.width);\n break;\n case \"fitHeight\":\n src = size((input.height * output.width) / output.height, input.height);\n dst = size((src.width * output.height) / src.height, output.height);\n break;\n case \"none\":\n src = size(\n Math.min(input.width, output.width),\n Math.min(input.height, output.height)\n );\n dst = src;\n break;\n case \"scaleDown\":\n src = input;\n dst = input;\n const aspectRatio = input.width / input.height;\n if (dst.height > output.height) {\n dst = size(output.height * aspectRatio, output.height);\n }\n if (dst.width > output.width) {\n dst = size(output.width, output.width / aspectRatio);\n }\n break;\n default:\n exhaustiveCheck(fit);\n }\n return { src, dst };\n};\n"],"mappings":";;;;;;;AAAA;;AASO,MAAMA,IAAI,GAAG;EAAA,IAACC,KAAD,uEAAS,CAAT;EAAA,IAAYC,MAAZ,uEAAqB,CAArB;EAAA,OAA4B;IAAED,KAAF;IAASC;EAAT,CAA5B;AAAA,CAAb;;;;AAEA,MAAMC,SAAS,GAAG,CACvBC,GADuB,EAEvBC,GAFuB,KAQp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AAf,EAAuBmB,MAAM,CAACnB,MAA9B,CAFQ,CAAV;MAIAG,GAAG,GAAGD,GAAN;MACA;;IACF,KAAK,WAAL;MACEA,GAAG,GAAGgB,KAAN;MACAf,GAAG,GAAGe,KAAN;MACA,MAAMI,WAAW,GAAGJ,KAAK,CAACnB,KAAN,GAAcmB,KAAK,CAAClB,MAAxC;;MACA,IAAIG,GAAG,CAACH,MAAJ,GAAamB,MAAM,CAACnB,MAAxB,EAAgC;QAC9BG,GAAG,GAAGL,IAAI,CAACqB,MAAM,CAACnB,MAAP,GAAgBsB,WAAjB,EAA8BH,MAAM,CAACnB,MAArC,CAAV;MACD;;MACD,IAAIG,GAAG,CAACJ,KAAJ,GAAYoB,MAAM,CAACpB,KAAvB,EAA8B;QAC5BI,GAAG,GAAGL,IAAI,CAACqB,MAAM,CAACpB,KAAR,EAAeoB,MAAM,CAACpB,KAAP,GAAeuB,WAA9B,CAAV;MACD;;MACD;;IACF;MACE,IAAAC,0BAAA,EAAgBZ,GAAhB;EAhDJ;;EAkDA,OAAO;IAAET,GAAF;IAAOC;EAAP,CAAP;AACD,CA9DD"}
|
@@ -1,87 +1,247 @@
|
|
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
|
-
export declare const transformOrigin: (origin: Vector, transform:
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
readonly
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
4
|
+
export declare const transformOrigin: (origin: Vector, transform: Transforms3d) => (Pick<{
|
5
|
+
translateX: number;
|
6
|
+
translateY: number;
|
7
|
+
translateZ: number;
|
8
|
+
translate: readonly [number, number] | readonly [number, number, number];
|
9
|
+
scale: number;
|
10
|
+
scaleX: number;
|
11
|
+
scaleY: number;
|
12
|
+
skewX: number;
|
13
|
+
skewY: number;
|
14
|
+
rotateZ: number;
|
15
|
+
rotate: number;
|
16
|
+
perspective: number;
|
17
|
+
rotateX: number;
|
18
|
+
rotateY: number;
|
19
|
+
matrix: import("../../../skia/types").Matrix4;
|
14
20
|
}, "translateX"> | Pick<{
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
readonly
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
21
|
+
translateX: number;
|
22
|
+
translateY: number;
|
23
|
+
translateZ: number;
|
24
|
+
translate: readonly [number, number] | readonly [number, number, number];
|
25
|
+
scale: number;
|
26
|
+
scaleX: number;
|
27
|
+
scaleY: number;
|
28
|
+
skewX: number;
|
29
|
+
skewY: number;
|
30
|
+
rotateZ: number;
|
31
|
+
rotate: number;
|
32
|
+
perspective: number;
|
33
|
+
rotateX: number;
|
34
|
+
rotateY: number;
|
35
|
+
matrix: import("../../../skia/types").Matrix4;
|
24
36
|
}, "translateY"> | Pick<{
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
readonly
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
37
|
+
translateX: number;
|
38
|
+
translateY: number;
|
39
|
+
translateZ: number;
|
40
|
+
translate: readonly [number, number] | readonly [number, number, number];
|
41
|
+
scale: number;
|
42
|
+
scaleX: number;
|
43
|
+
scaleY: number;
|
44
|
+
skewX: number;
|
45
|
+
skewY: number;
|
46
|
+
rotateZ: number;
|
47
|
+
rotate: number;
|
48
|
+
perspective: number;
|
49
|
+
rotateX: number;
|
50
|
+
rotateY: number;
|
51
|
+
matrix: import("../../../skia/types").Matrix4;
|
52
|
+
}, "translateZ"> | Pick<{
|
53
|
+
translateX: number;
|
54
|
+
translateY: number;
|
55
|
+
translateZ: number;
|
56
|
+
translate: readonly [number, number] | readonly [number, number, number];
|
57
|
+
scale: number;
|
58
|
+
scaleX: number;
|
59
|
+
scaleY: number;
|
60
|
+
skewX: number;
|
61
|
+
skewY: number;
|
62
|
+
rotateZ: number;
|
63
|
+
rotate: number;
|
64
|
+
perspective: number;
|
65
|
+
rotateX: number;
|
66
|
+
rotateY: number;
|
67
|
+
matrix: import("../../../skia/types").Matrix4;
|
68
|
+
}, "translate"> | Pick<{
|
69
|
+
translateX: number;
|
70
|
+
translateY: number;
|
71
|
+
translateZ: number;
|
72
|
+
translate: readonly [number, number] | readonly [number, number, number];
|
73
|
+
scale: number;
|
74
|
+
scaleX: number;
|
75
|
+
scaleY: number;
|
76
|
+
skewX: number;
|
77
|
+
skewY: number;
|
78
|
+
rotateZ: number;
|
79
|
+
rotate: number;
|
80
|
+
perspective: number;
|
81
|
+
rotateX: number;
|
82
|
+
rotateY: number;
|
83
|
+
matrix: import("../../../skia/types").Matrix4;
|
34
84
|
}, "scale"> | Pick<{
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
readonly
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
85
|
+
translateX: number;
|
86
|
+
translateY: number;
|
87
|
+
translateZ: number;
|
88
|
+
translate: readonly [number, number] | readonly [number, number, number];
|
89
|
+
scale: number;
|
90
|
+
scaleX: number;
|
91
|
+
scaleY: number;
|
92
|
+
skewX: number;
|
93
|
+
skewY: number;
|
94
|
+
rotateZ: number;
|
95
|
+
rotate: number;
|
96
|
+
perspective: number;
|
97
|
+
rotateX: number;
|
98
|
+
rotateY: number;
|
99
|
+
matrix: import("../../../skia/types").Matrix4;
|
44
100
|
}, "scaleX"> | Pick<{
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
readonly
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
101
|
+
translateX: number;
|
102
|
+
translateY: number;
|
103
|
+
translateZ: number;
|
104
|
+
translate: readonly [number, number] | readonly [number, number, number];
|
105
|
+
scale: number;
|
106
|
+
scaleX: number;
|
107
|
+
scaleY: number;
|
108
|
+
skewX: number;
|
109
|
+
skewY: number;
|
110
|
+
rotateZ: number;
|
111
|
+
rotate: number;
|
112
|
+
perspective: number;
|
113
|
+
rotateX: number;
|
114
|
+
rotateY: number;
|
115
|
+
matrix: import("../../../skia/types").Matrix4;
|
54
116
|
}, "scaleY"> | Pick<{
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
readonly
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
117
|
+
translateX: number;
|
118
|
+
translateY: number;
|
119
|
+
translateZ: number;
|
120
|
+
translate: readonly [number, number] | readonly [number, number, number];
|
121
|
+
scale: number;
|
122
|
+
scaleX: number;
|
123
|
+
scaleY: number;
|
124
|
+
skewX: number;
|
125
|
+
skewY: number;
|
126
|
+
rotateZ: number;
|
127
|
+
rotate: number;
|
128
|
+
perspective: number;
|
129
|
+
rotateX: number;
|
130
|
+
rotateY: number;
|
131
|
+
matrix: import("../../../skia/types").Matrix4;
|
64
132
|
}, "skewX"> | Pick<{
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
readonly
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
133
|
+
translateX: number;
|
134
|
+
translateY: number;
|
135
|
+
translateZ: number;
|
136
|
+
translate: readonly [number, number] | readonly [number, number, number];
|
137
|
+
scale: number;
|
138
|
+
scaleX: number;
|
139
|
+
scaleY: number;
|
140
|
+
skewX: number;
|
141
|
+
skewY: number;
|
142
|
+
rotateZ: number;
|
143
|
+
rotate: number;
|
144
|
+
perspective: number;
|
145
|
+
rotateX: number;
|
146
|
+
rotateY: number;
|
147
|
+
matrix: import("../../../skia/types").Matrix4;
|
74
148
|
}, "skewY"> | Pick<{
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
readonly
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
149
|
+
translateX: number;
|
150
|
+
translateY: number;
|
151
|
+
translateZ: number;
|
152
|
+
translate: readonly [number, number] | readonly [number, number, number];
|
153
|
+
scale: number;
|
154
|
+
scaleX: number;
|
155
|
+
scaleY: number;
|
156
|
+
skewX: number;
|
157
|
+
skewY: number;
|
158
|
+
rotateZ: number;
|
159
|
+
rotate: number;
|
160
|
+
perspective: number;
|
161
|
+
rotateX: number;
|
162
|
+
rotateY: number;
|
163
|
+
matrix: import("../../../skia/types").Matrix4;
|
164
|
+
}, "perspective"> | Pick<{
|
165
|
+
translateX: number;
|
166
|
+
translateY: number;
|
167
|
+
translateZ: number;
|
168
|
+
translate: readonly [number, number] | readonly [number, number, number];
|
169
|
+
scale: number;
|
170
|
+
scaleX: number;
|
171
|
+
scaleY: number;
|
172
|
+
skewX: number;
|
173
|
+
skewY: number;
|
174
|
+
rotateZ: number;
|
175
|
+
rotate: number;
|
176
|
+
perspective: number;
|
177
|
+
rotateX: number;
|
178
|
+
rotateY: number;
|
179
|
+
matrix: import("../../../skia/types").Matrix4;
|
180
|
+
}, "rotateX"> | Pick<{
|
181
|
+
translateX: number;
|
182
|
+
translateY: number;
|
183
|
+
translateZ: number;
|
184
|
+
translate: readonly [number, number] | readonly [number, number, number];
|
185
|
+
scale: number;
|
186
|
+
scaleX: number;
|
187
|
+
scaleY: number;
|
188
|
+
skewX: number;
|
189
|
+
skewY: number;
|
190
|
+
rotateZ: number;
|
191
|
+
rotate: number;
|
192
|
+
perspective: number;
|
193
|
+
rotateX: number;
|
194
|
+
rotateY: number;
|
195
|
+
matrix: import("../../../skia/types").Matrix4;
|
196
|
+
}, "rotateY"> | Pick<{
|
197
|
+
translateX: number;
|
198
|
+
translateY: number;
|
199
|
+
translateZ: number;
|
200
|
+
translate: readonly [number, number] | readonly [number, number, number];
|
201
|
+
scale: number;
|
202
|
+
scaleX: number;
|
203
|
+
scaleY: number;
|
204
|
+
skewX: number;
|
205
|
+
skewY: number;
|
206
|
+
rotateZ: number;
|
207
|
+
rotate: number;
|
208
|
+
perspective: number;
|
209
|
+
rotateX: number;
|
210
|
+
rotateY: number;
|
211
|
+
matrix: import("../../../skia/types").Matrix4;
|
212
|
+
}, "rotateZ"> | Pick<{
|
213
|
+
translateX: number;
|
214
|
+
translateY: number;
|
215
|
+
translateZ: number;
|
216
|
+
translate: readonly [number, number] | readonly [number, number, number];
|
217
|
+
scale: number;
|
218
|
+
scaleX: number;
|
219
|
+
scaleY: number;
|
220
|
+
skewX: number;
|
221
|
+
skewY: number;
|
222
|
+
rotateZ: number;
|
223
|
+
rotate: number;
|
224
|
+
perspective: number;
|
225
|
+
rotateX: number;
|
226
|
+
rotateY: number;
|
227
|
+
matrix: import("../../../skia/types").Matrix4;
|
228
|
+
}, "rotate"> | Pick<{
|
229
|
+
translateX: number;
|
230
|
+
translateY: number;
|
231
|
+
translateZ: number;
|
232
|
+
translate: readonly [number, number] | readonly [number, number, number];
|
233
|
+
scale: number;
|
234
|
+
scaleX: number;
|
235
|
+
scaleY: number;
|
236
|
+
skewX: number;
|
237
|
+
skewY: number;
|
238
|
+
rotateZ: number;
|
239
|
+
rotate: number;
|
240
|
+
perspective: number;
|
241
|
+
rotateX: number;
|
242
|
+
rotateY: number;
|
243
|
+
matrix: import("../../../skia/types").Matrix4;
|
244
|
+
}, "matrix">)[];
|
85
245
|
export declare const processGradientProps: (Skia: Skia, { colors, positions, mode, flags, ...transform }: GradientProps) => {
|
86
246
|
colors: Float32Array[];
|
87
247
|
positions: number[] | null;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["transformOrigin","origin","transform","translateX","x","translateY","y","processGradientProps","Skia","colors","positions","mode","flags","localMatrix","Matrix","processTransformProps","map","color","Color","TileMode","enumKey","getRect","props","width","height","rect","undefined","XYWHRect"],"sources":["Gradient.ts"],"sourcesContent":["import type { Skia, SkRect,
|
1
|
+
{"version":3,"names":["transformOrigin","origin","transform","translateX","x","translateY","y","processGradientProps","Skia","colors","positions","mode","flags","localMatrix","Matrix","processTransformProps","map","color","Color","TileMode","enumKey","getRect","props","width","height","rect","undefined","XYWHRect"],"sources":["Gradient.ts"],"sourcesContent":["import type { Skia, SkRect, Transforms3d, Vector } from \"../../../skia/types\";\nimport { TileMode } from \"../../../skia/types\";\nimport type { GradientProps, ImageShaderProps } from \"../../types\";\n\nimport { enumKey } from \"./Enum\";\nimport { processTransformProps } from \"./Transform\";\n\nexport const transformOrigin = (origin: Vector, transform: Transforms3d) => [\n { translateX: origin.x },\n { translateY: origin.y },\n ...transform,\n { translateX: -origin.x },\n { translateY: -origin.y },\n];\n\nexport const processGradientProps = (\n Skia: Skia,\n { colors, positions, mode, flags, ...transform }: GradientProps\n) => {\n const localMatrix = Skia.Matrix();\n processTransformProps(localMatrix, transform);\n return {\n colors: colors.map((color) => Skia.Color(color)),\n positions: positions ?? null,\n mode: TileMode[enumKey(mode ?? \"clamp\")],\n flags,\n localMatrix,\n };\n};\n\nexport const getRect = (\n Skia: Skia,\n props: Omit<ImageShaderProps, \"tx\" | \"ty\" | \"fm\" | \"mm\" | \"fit\" | \"image\">\n): SkRect | undefined => {\n const { x, y, width, height } = props;\n if (props.rect) {\n return props.rect;\n } else if (\n x !== undefined &&\n y !== undefined &&\n width !== undefined &&\n height !== undefined\n ) {\n return Skia.XYWHRect(x, y, width, height);\n } else {\n return undefined;\n }\n};\n"],"mappings":";;;;;;;AACA;;AAGA;;AACA;;AAEO,MAAMA,eAAe,GAAG,CAACC,MAAD,EAAiBC,SAAjB,KAA6C,CAC1E;EAAEC,UAAU,EAAEF,MAAM,CAACG;AAArB,CAD0E,EAE1E;EAAEC,UAAU,EAAEJ,MAAM,CAACK;AAArB,CAF0E,EAG1E,GAAGJ,SAHuE,EAI1E;EAAEC,UAAU,EAAE,CAACF,MAAM,CAACG;AAAtB,CAJ0E,EAK1E;EAAEC,UAAU,EAAE,CAACJ,MAAM,CAACK;AAAtB,CAL0E,CAArE;;;;AAQA,MAAMC,oBAAoB,GAAG,CAClCC,IADkC,WAG/B;EAAA,IADH;IAAEC,MAAF;IAAUC,SAAV;IAAqBC,IAArB;IAA2BC,KAA3B;IAAkC,GAAGV;EAArC,CACG;EACH,MAAMW,WAAW,GAAGL,IAAI,CAACM,MAAL,EAApB;EACA,IAAAC,gCAAA,EAAsBF,WAAtB,EAAmCX,SAAnC;EACA,OAAO;IACLO,MAAM,EAAEA,MAAM,CAACO,GAAP,CAAYC,KAAD,IAAWT,IAAI,CAACU,KAAL,CAAWD,KAAX,CAAtB,CADH;IAELP,SAAS,EAAEA,SAAS,IAAI,IAFnB;IAGLC,IAAI,EAAEQ,eAAA,CAAS,IAAAC,aAAA,EAAQT,IAAI,IAAI,OAAhB,CAAT,CAHD;IAILC,KAJK;IAKLC;EALK,CAAP;AAOD,CAbM;;;;AAeA,MAAMQ,OAAO,GAAG,CACrBb,IADqB,EAErBc,KAFqB,KAGE;EACvB,MAAM;IAAElB,CAAF;IAAKE,CAAL;IAAQiB,KAAR;IAAeC;EAAf,IAA0BF,KAAhC;;EACA,IAAIA,KAAK,CAACG,IAAV,EAAgB;IACd,OAAOH,KAAK,CAACG,IAAb;EACD,CAFD,MAEO,IACLrB,CAAC,KAAKsB,SAAN,IACApB,CAAC,KAAKoB,SADN,IAEAH,KAAK,KAAKG,SAFV,IAGAF,MAAM,KAAKE,SAJN,EAKL;IACA,OAAOlB,IAAI,CAACmB,QAAL,CAAcvB,CAAd,EAAiBE,CAAjB,EAAoBiB,KAApB,EAA2BC,MAA3B,CAAP;EACD,CAPM,MAOA;IACL,OAAOE,SAAP;EACD;AACF,CAjBM"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import type { ReactNode } from "react";
|
2
|
-
import type { BlendMode, Color, PaintStyle, SkMatrix, SkPaint, SkPath, SkRect, SkRRect, StrokeCap, StrokeJoin,
|
2
|
+
import type { BlendMode, Color, PaintStyle, SkMatrix, SkPaint, SkPath, SkRect, SkRRect, StrokeCap, StrokeJoin, Transforms3d, Vector } from "../../skia/types";
|
3
3
|
export type SkEnum<T> = Uncapitalize<keyof T extends string ? keyof T : never>;
|
4
4
|
export type PathDef = string | SkPath;
|
5
5
|
export type ClipDef = SkRRect | SkRect | PathDef;
|
@@ -34,9 +34,9 @@ export interface ScalarCircleDef {
|
|
34
34
|
}
|
35
35
|
export type CircleDef = PointCircleDef | ScalarCircleDef;
|
36
36
|
export interface TransformProps {
|
37
|
-
transform?:
|
37
|
+
transform?: Transforms3d;
|
38
38
|
origin?: Vector;
|
39
|
-
matrix?: SkMatrix;
|
39
|
+
matrix?: SkMatrix | number[];
|
40
40
|
}
|
41
41
|
export interface PaintProps extends ChildrenProps {
|
42
42
|
color?: Color;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":[],"sources":["Common.ts"],"sourcesContent":["import type { ReactNode } from \"react\";\n\nimport type {\n BlendMode,\n Color,\n PaintStyle,\n SkMatrix,\n SkPaint,\n SkPath,\n SkRect,\n SkRRect,\n StrokeCap,\n StrokeJoin,\n
|
1
|
+
{"version":3,"names":[],"sources":["Common.ts"],"sourcesContent":["import type { ReactNode } from \"react\";\n\nimport type {\n BlendMode,\n Color,\n PaintStyle,\n SkMatrix,\n SkPaint,\n SkPath,\n SkRect,\n SkRRect,\n StrokeCap,\n StrokeJoin,\n Transforms3d,\n Vector,\n} from \"../../skia/types\";\n\nexport type SkEnum<T> = Uncapitalize<keyof T extends string ? keyof T : never>;\n\nexport type PathDef = string | SkPath;\n\nexport type ClipDef = SkRRect | SkRect | PathDef;\n\nexport type Fit =\n | \"cover\"\n | \"contain\"\n | \"fill\"\n | \"fitHeight\"\n | \"fitWidth\"\n | \"none\"\n | \"scaleDown\";\n\nexport type Radius = number | Vector;\n\nexport interface ChildrenProps {\n children?: ReactNode | ReactNode[];\n}\n\nexport interface RectCtor {\n x?: number;\n y?: number;\n width: number;\n height: number;\n}\n\nexport interface RRectCtor extends RectCtor {\n r?: Radius;\n}\n\nexport type RectDef = RectCtor | { rect: SkRect };\nexport type RRectDef = RRectCtor | { rect: SkRRect };\n\nexport interface PointCircleDef {\n c?: Vector;\n r: number;\n}\n\nexport interface ScalarCircleDef {\n cx: number;\n cy: number;\n r: number;\n}\n\nexport type CircleDef = PointCircleDef | ScalarCircleDef;\n\nexport interface TransformProps {\n transform?: Transforms3d;\n origin?: Vector;\n matrix?: SkMatrix | number[];\n}\n\nexport interface PaintProps extends ChildrenProps {\n color?: Color;\n strokeWidth?: number;\n blendMode?: SkEnum<typeof BlendMode>;\n style?: SkEnum<typeof PaintStyle>;\n strokeJoin?: SkEnum<typeof StrokeJoin>;\n strokeCap?: SkEnum<typeof StrokeCap>;\n strokeMiter?: number;\n opacity?: number;\n antiAlias?: boolean;\n dither?: boolean;\n}\n\nexport interface GroupProps extends PaintProps, TransformProps {\n clip?: ClipDef;\n invertClip?: boolean;\n layer?: SkPaint | boolean;\n}\n"],"mappings":""}
|
@@ -14,18 +14,24 @@ var _skia = require("../../skia");
|
|
14
14
|
var _moduleWrapper = require("./moduleWrapper");
|
15
15
|
|
16
16
|
const notifyChange = value => {
|
17
|
-
"worklet";
|
17
|
+
"worklet";
|
18
18
|
|
19
|
-
|
19
|
+
if (_WORKLET) {
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
21
|
+
value._value = value.value;
|
22
|
+
}
|
20
23
|
};
|
21
24
|
|
22
25
|
exports.notifyChange = notifyChange;
|
23
26
|
|
24
27
|
const useClock = () => {
|
25
28
|
const clock = (0, _moduleWrapper.useSharedValue)(0);
|
26
|
-
(0,
|
29
|
+
const callback = (0, _react.useRef)(info => {
|
30
|
+
"worklet";
|
31
|
+
|
27
32
|
clock.value = info.timeSinceFirstFrame;
|
28
|
-
});
|
33
|
+
}).current;
|
34
|
+
(0, _moduleWrapper.useFrameCallback)(callback);
|
29
35
|
return clock;
|
30
36
|
};
|
31
37
|
/**
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["notifyChange","value","_value","useClock","clock","useSharedValue","
|
1
|
+
{"version":3,"names":["notifyChange","value","_WORKLET","_value","useClock","clock","useSharedValue","callback","useRef","info","timeSinceFirstFrame","current","useFrameCallback","useInterpolator","factory","interpolator","input","output","options","init","useMemo","result","useAnimatedReaction","val","usePathInterpolation","outputRange","Skia","Path","Make","interpolatePaths","useVectorInterpolation","Point","interpolateVector"],"sources":["interpolators.ts"],"sourcesContent":["import type {\n ExtrapolationType,\n FrameInfo,\n SharedValue,\n} from \"react-native-reanimated\";\nimport { useMemo, useRef } from \"react\";\n\nimport type { SkPath, SkPoint } from \"../../skia/types\";\nimport { interpolatePaths, interpolateVector } from \"../../animation\";\nimport { Skia } from \"../../skia\";\n\nimport {\n useAnimatedReaction,\n useFrameCallback,\n useSharedValue,\n} from \"./moduleWrapper\";\n\nexport const notifyChange = (value: SharedValue<unknown>) => {\n \"worklet\";\n if (_WORKLET) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (value as any)._value = value.value;\n }\n};\n\nexport const useClock = () => {\n const clock = useSharedValue(0);\n const callback = useRef((info: FrameInfo) => {\n \"worklet\";\n clock.value = info.timeSinceFirstFrame;\n }).current;\n useFrameCallback(callback);\n return clock;\n};\n\n/**\n * @worklet\n */\ntype Interpolator<T> = (\n value: number,\n input: number[],\n output: T[],\n options: ExtrapolationType,\n result: T\n) => T;\n\nconst useInterpolator = <T>(\n factory: () => T,\n value: SharedValue<number>,\n interpolator: Interpolator<T>,\n input: number[],\n output: T[],\n options?: ExtrapolationType\n) => {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const init = useMemo(() => factory(), []);\n const result = useSharedValue(init);\n useAnimatedReaction(\n () => value.value,\n (val) => {\n result.value = interpolator(val, input, output, options, result.value);\n notifyChange(result);\n },\n [input, output, options]\n );\n return result;\n};\n\nexport const usePathInterpolation = (\n value: SharedValue<number>,\n input: number[],\n outputRange: SkPath[],\n options?: ExtrapolationType\n) =>\n useInterpolator(\n () => Skia.Path.Make(),\n value,\n interpolatePaths,\n input,\n outputRange,\n options\n );\n\nexport const useVectorInterpolation = (\n value: SharedValue<number>,\n input: number[],\n outputRange: SkPoint[],\n options?: ExtrapolationType\n) =>\n useInterpolator(\n () => Skia.Point(0, 0),\n value,\n interpolateVector,\n input,\n outputRange,\n options\n );\n"],"mappings":";;;;;;;AAKA;;AAGA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b3B,KAFa,EAGb4B,2BAHa,EAIbb,KAJa,EAKbS,WALa,EAMbP,OANa,CANV;;;;AAeA,MAAMY,sBAAsB,GAAG,CACpC7B,KADoC,EAEpCe,KAFoC,EAGpCS,WAHoC,EAIpCP,OAJoC,KAMpCL,eAAe,CACb,MAAMa,UAAA,CAAKK,KAAL,CAAW,CAAX,EAAc,CAAd,CADO,EAEb9B,KAFa,EAGb+B,4BAHa,EAIbhB,KAJa,EAKbS,WALa,EAMbP,OANa,CANV"}
|
@@ -13,8 +13,6 @@ var _Skia = require("../skia/Skia");
|
|
13
13
|
|
14
14
|
var _types = require("../dom/types");
|
15
15
|
|
16
|
-
var _values = require("../values");
|
17
|
-
|
18
16
|
var _Reconciler = require("./Reconciler");
|
19
17
|
|
20
18
|
var _HostComponents = require("./HostComponents");
|
@@ -31,25 +29,29 @@ const useCanvasRef = () => (0, _react.useRef)(null);
|
|
31
29
|
|
32
30
|
exports.useCanvasRef = useCanvasRef;
|
33
31
|
|
34
|
-
const useOnSizeEvent = resultValue => {
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
});
|
39
|
-
(0, _react.useLayoutEffect)(() => {
|
40
|
-
if (!resultValue) {
|
41
|
-
return;
|
32
|
+
const useOnSizeEvent = (resultValue, onLayout) => {
|
33
|
+
return (0, _react.useCallback)(event => {
|
34
|
+
if (onLayout) {
|
35
|
+
onLayout(event);
|
42
36
|
}
|
43
37
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
38
|
+
const {
|
39
|
+
width,
|
40
|
+
height
|
41
|
+
} = event.nativeEvent.layout;
|
42
|
+
|
43
|
+
if ((0, _processors.isValue)(resultValue)) {
|
44
|
+
resultValue.current = {
|
45
|
+
width,
|
46
|
+
height
|
47
|
+
};
|
48
|
+
} else if (resultValue) {
|
49
|
+
resultValue.value = {
|
50
|
+
width,
|
51
|
+
height
|
52
|
+
};
|
53
|
+
}
|
54
|
+
}, [onLayout, resultValue]);
|
53
55
|
};
|
54
56
|
|
55
57
|
const Canvas = /*#__PURE__*/(0, _react.forwardRef)((_ref, forwardedRef) => {
|
@@ -60,9 +62,10 @@ const Canvas = /*#__PURE__*/(0, _react.forwardRef)((_ref, forwardedRef) => {
|
|
60
62
|
mode,
|
61
63
|
onTouch,
|
62
64
|
onSize: _onSize,
|
65
|
+
onLayout: _onLayout,
|
63
66
|
...props
|
64
67
|
} = _ref;
|
65
|
-
const
|
68
|
+
const onLayout = useOnSizeEvent(_onSize, _onLayout);
|
66
69
|
const innerRef = useCanvasRef();
|
67
70
|
const ref = useCombinedRefs(forwardedRef, innerRef);
|
68
71
|
const redraw = (0, _react.useCallback)(() => {
|
@@ -100,23 +103,26 @@ const Canvas = /*#__PURE__*/(0, _react.forwardRef)((_ref, forwardedRef) => {
|
|
100
103
|
style: style,
|
101
104
|
root: root.dom,
|
102
105
|
onTouch: onTouch,
|
103
|
-
|
106
|
+
onLayout: onLayout,
|
104
107
|
mode: mode,
|
105
108
|
debug: debug
|
106
109
|
}, props));
|
107
110
|
} else {
|
108
|
-
|
111
|
+
// This is for debugging
|
112
|
+
const recorder = _Skia.Skia.PictureRecorder();
|
113
|
+
|
114
|
+
const canvas = recorder.beginRecording(_Skia.Skia.XYWHRect(0, 0, 2_000_000, 2_000_000));
|
115
|
+
const ctx = new _types.JsiDrawingContext(_Skia.Skia, canvas);
|
116
|
+
root.dom.render(ctx);
|
117
|
+
const picture = recorder.finishRecordingAsPicture();
|
118
|
+
return /*#__PURE__*/_react.default.createElement(_views.SkiaPictureView // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
109
119
|
, _extends({
|
110
120
|
ref: ref,
|
111
121
|
style: style,
|
112
122
|
mode: mode,
|
113
123
|
debug: debug,
|
114
|
-
|
115
|
-
|
116
|
-
onTouch && onTouch(info.touches);
|
117
|
-
const ctx = new _types.JsiDrawingContext(_Skia.Skia, canvas);
|
118
|
-
root.dom.render(ctx);
|
119
|
-
}
|
124
|
+
picture: picture,
|
125
|
+
onLayout: onLayout
|
120
126
|
}, props));
|
121
127
|
}
|
122
128
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["useCanvasRef","useRef","useOnSizeEvent","resultValue","
|
1
|
+
{"version":3,"names":["useCanvasRef","useRef","useOnSizeEvent","resultValue","onLayout","useCallback","event","width","height","nativeEvent","layout","isValue","current","value","Canvas","forwardRef","forwardedRef","children","style","debug","mode","onTouch","onSize","_onSize","_onLayout","props","innerRef","ref","useCombinedRefs","redraw","getNativeId","id","nativeId","registerValues","values","root","useMemo","SkiaRoot","Skia","useEffect","render","unmount","NATIVE_DOM","dom","recorder","PictureRecorder","canvas","beginRecording","XYWHRect","ctx","JsiDrawingContext","picture","finishRecordingAsPicture","refs","targetRef","React","forEach"],"sources":["Canvas.tsx"],"sourcesContent":["import React, {\n useEffect,\n useCallback,\n useMemo,\n forwardRef,\n useRef,\n} from \"react\";\nimport type {\n RefObject,\n ReactNode,\n MutableRefObject,\n ForwardedRef,\n FunctionComponent,\n} from \"react\";\nimport type { LayoutChangeEvent } from \"react-native\";\n\nimport { SkiaDomView, SkiaPictureView } from \"../views\";\nimport { Skia } from \"../skia/Skia\";\nimport type { TouchHandler, SkiaBaseViewProps } from \"../views\";\nimport type { SkiaValue } from \"../values/types\";\nimport { JsiDrawingContext } from \"../dom/types\";\n\nimport { SkiaRoot } from \"./Reconciler\";\nimport { NATIVE_DOM } from \"./HostComponents\";\nimport { isValue } from \"./processors\";\n\nexport const useCanvasRef = () => useRef<SkiaDomView>(null);\n\nexport interface CanvasProps extends SkiaBaseViewProps {\n ref?: RefObject<SkiaDomView>;\n children: ReactNode;\n onTouch?: TouchHandler;\n}\n\nconst useOnSizeEvent = (\n resultValue: SkiaBaseViewProps[\"onSize\"],\n onLayout?: (event: LayoutChangeEvent) => void\n) => {\n return useCallback(\n (event: LayoutChangeEvent) => {\n if (onLayout) {\n onLayout(event);\n }\n const { width, height } = event.nativeEvent.layout;\n\n if (isValue(resultValue)) {\n resultValue.current = { width, height };\n } else if (resultValue) {\n resultValue.value = { width, height };\n }\n },\n [onLayout, resultValue]\n );\n};\n\nexport const Canvas = forwardRef<SkiaDomView, CanvasProps>(\n (\n {\n children,\n style,\n debug,\n mode,\n onTouch,\n onSize: _onSize,\n onLayout: _onLayout,\n ...props\n },\n forwardedRef\n ) => {\n const onLayout = useOnSizeEvent(_onSize, _onLayout);\n const innerRef = useCanvasRef();\n const ref = useCombinedRefs(forwardedRef, innerRef);\n const redraw = useCallback(() => {\n innerRef.current?.redraw();\n }, [innerRef]);\n const getNativeId = useCallback(() => {\n const id = innerRef.current?.nativeId ?? -1;\n return id;\n }, [innerRef]);\n\n const registerValues = useCallback(\n (values: Array<SkiaValue<unknown>>) => {\n if (ref.current !== null) {\n return ref.current.registerValues(values);\n }\n return () => {};\n },\n [ref]\n );\n const root = useMemo(\n () => new SkiaRoot(Skia, registerValues, redraw, getNativeId),\n [redraw, registerValues, getNativeId]\n );\n\n // Render effect\n useEffect(() => {\n root.render(children);\n }, [children, root, redraw]);\n\n useEffect(() => {\n return () => {\n root.unmount();\n };\n }, [root]);\n if (NATIVE_DOM) {\n return (\n <SkiaDomView\n ref={ref}\n style={style}\n root={root.dom}\n onTouch={onTouch}\n onLayout={onLayout}\n mode={mode}\n debug={debug}\n {...props}\n />\n );\n } else {\n // This is for debugging\n const recorder = Skia.PictureRecorder();\n const canvas = recorder.beginRecording(\n Skia.XYWHRect(0, 0, 2_000_000, 2_000_000)\n );\n const ctx = new JsiDrawingContext(Skia, canvas);\n root.dom.render(ctx);\n const picture = recorder.finishRecordingAsPicture();\n return (\n <SkiaPictureView\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref={ref as any}\n style={style}\n mode={mode}\n debug={debug}\n picture={picture}\n onLayout={onLayout}\n {...props}\n />\n );\n }\n }\n) as FunctionComponent<CanvasProps & React.RefAttributes<SkiaDomView>>;\n\n/**\n * Combines a list of refs into a single ref. This can be used to provide\n * both a forwarded ref and an internal ref keeping the same functionality\n * on both of the refs.\n * @param refs Array of refs to combine\n * @returns A single ref that can be used in a ref prop.\n */\nconst useCombinedRefs = <T,>(\n ...refs: Array<MutableRefObject<T> | ForwardedRef<T>>\n) => {\n const targetRef = React.useRef<T>(null);\n React.useEffect(() => {\n refs.forEach((ref) => {\n if (ref) {\n if (typeof ref === \"function\") {\n ref(targetRef.current);\n } else {\n ref.current = targetRef.current;\n }\n }\n });\n }, [refs]);\n return targetRef;\n};\n"],"mappings":";;;;;;;AAAA;;AAgBA;;AACA;;AAGA;;AAEA;;AACA;;AACA;;;;;;;;AAEO,MAAMA,YAAY,GAAG,MAAM,IAAAC,aAAA,EAAoB,IAApB,CAA3B;;;;AAQP,MAAMC,cAAc,GAAG,CACrBC,WADqB,EAErBC,QAFqB,KAGlB;EACH,OAAO,IAAAC,kBAAA,EACJC,KAAD,IAA8B;IAC5B,IAAIF,QAAJ,EAAc;MACZA,QAAQ,CAACE,KAAD,CAAR;IACD;;IACD,MAAM;MAAEC,KAAF;MAASC;IAAT,IAAoBF,KAAK,CAACG,WAAN,CAAkBC,MAA5C;;IAEA,IAAI,IAAAC,mBAAA,EAAQR,WAAR,CAAJ,EAA0B;MACxBA,WAAW,CAACS,OAAZ,GAAsB;QAAEL,KAAF;QAASC;MAAT,CAAtB;IACD,CAFD,MAEO,IAAIL,WAAJ,EAAiB;MACtBA,WAAW,CAACU,KAAZ,GAAoB;QAAEN,KAAF;QAASC;MAAT,CAApB;IACD;EACF,CAZI,EAaL,CAACJ,QAAD,EAAWD,WAAX,CAbK,CAAP;AAeD,CAnBD;;AAqBO,MAAMW,MAAM,gBAAG,IAAAC,iBAAA,EACpB,OAWEC,YAXF,KAYK;EAAA,IAXH;IACEC,QADF;IAEEC,KAFF;IAGEC,KAHF;IAIEC,IAJF;IAKEC,OALF;IAMEC,MAAM,EAAEC,OANV;IAOEnB,QAAQ,EAAEoB,SAPZ;IAQE,GAAGC;EARL,CAWG;EACH,M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AAP,KAAe,UAAnB,EAA+B;UAC7BA,GAAG,CAAC2B,SAAS,CAAC1C,OAAX,CAAH;QACD,CAFD,MAEO;UACLe,GAAG,CAACf,OAAJ,GAAc0C,SAAS,CAAC1C,OAAxB;QACD;MACF;IACF,CARD;EASD,CAVD,EAUG,CAACyC,IAAD,CAVH;;EAWA,OAAOC,SAAP;AACD,CAhBD"}
|
@@ -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;
|
@@ -9,6 +9,11 @@ var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
11
11
|
|
12
|
+
/**
|
13
|
+
* @deprecated If you are looking to use the Skia imperative API, you can use:
|
14
|
+
* The picture API: https://shopify.github.io/react-native-skia/docs/shapes/pictures/
|
15
|
+
* The offscreen API: https://shopify.github.io/react-native-skia/docs/animations/textures
|
16
|
+
*/
|
12
17
|
const Drawing = props => {
|
13
18
|
return /*#__PURE__*/_react.default.createElement("skDrawing", props);
|
14
19
|
};
|