@shopify/react-native-skia 0.1.228 → 0.1.230
Sign up to get free protection for your applications and to get access to all the features.
- package/android/cpp/jni/JniLoad.cpp +0 -2
- package/android/src/main/java/com/shopify/reactnative/skia/RNSkiaModule.java +0 -1
- package/android/src/main/java/com/shopify/reactnative/skia/RNSkiaPackage.java +1 -2
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaBaseView.java +7 -12
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaDomView.java +1 -1
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaPictureView.java +1 -1
- package/cpp/api/JsiSkApi.h +4 -1
- package/cpp/api/JsiSkParagraph.h +15 -0
- package/cpp/api/JsiSkParagraphBuilder.h +3 -32
- package/cpp/api/JsiSkParagraphBuilderFactory.h +54 -0
- package/cpp/rnskia/RNSkJsiViewApi.h +0 -52
- package/cpp/rnskia/RNSkManager.cpp +0 -6
- package/cpp/rnskia/RNSkView.h +2 -91
- package/cpp/rnskia/dom/JsiDomApi.h +0 -9
- package/lib/commonjs/animation/index.d.ts +0 -3
- package/lib/commonjs/animation/index.js +0 -39
- package/lib/commonjs/animation/index.js.map +1 -1
- package/lib/commonjs/dom/nodes/JsiSkDOM.d.ts +1 -2
- package/lib/commonjs/dom/nodes/JsiSkDOM.js +0 -6
- package/lib/commonjs/dom/nodes/JsiSkDOM.js.map +1 -1
- package/lib/commonjs/dom/nodes/Node.d.ts +0 -3
- package/lib/commonjs/dom/nodes/Node.js +0 -5
- package/lib/commonjs/dom/nodes/Node.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/index.d.ts +0 -1
- package/lib/commonjs/dom/nodes/drawings/index.js +0 -13
- package/lib/commonjs/dom/nodes/drawings/index.js.map +1 -1
- package/lib/commonjs/dom/types/Common.d.ts +2 -2
- package/lib/commonjs/dom/types/Common.js.map +1 -1
- package/lib/commonjs/dom/types/Drawings.d.ts +0 -4
- package/lib/commonjs/dom/types/Drawings.js.map +1 -1
- package/lib/commonjs/dom/types/NodeType.d.ts +0 -1
- package/lib/commonjs/dom/types/NodeType.js +0 -1
- package/lib/commonjs/dom/types/NodeType.js.map +1 -1
- package/lib/commonjs/dom/types/SkDOM.d.ts +1 -2
- package/lib/commonjs/dom/types/SkDOM.js.map +1 -1
- package/lib/commonjs/index.d.ts +0 -1
- package/lib/commonjs/index.js +0 -14
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/mock/index.js +0 -4
- package/lib/commonjs/mock/index.js.map +1 -1
- package/lib/commonjs/renderer/Canvas.js +9 -34
- package/lib/commonjs/renderer/Canvas.js.map +1 -1
- package/lib/commonjs/renderer/Container.d.ts +1 -3
- package/lib/commonjs/renderer/Container.js +4 -6
- package/lib/commonjs/renderer/Container.js.map +1 -1
- package/lib/commonjs/renderer/HostComponents.d.ts +1 -6
- package/lib/commonjs/renderer/HostComponents.js +0 -3
- package/lib/commonjs/renderer/HostComponents.js.map +1 -1
- package/lib/commonjs/renderer/HostConfig.js +2 -23
- package/lib/commonjs/renderer/HostConfig.js.map +1 -1
- package/lib/commonjs/renderer/Reconciler.d.ts +1 -5
- package/lib/commonjs/renderer/Reconciler.js +3 -18
- package/lib/commonjs/renderer/Reconciler.js.map +1 -1
- package/lib/commonjs/renderer/components/index.d.ts +0 -1
- package/lib/commonjs/renderer/components/index.js +0 -13
- package/lib/commonjs/renderer/components/index.js.map +1 -1
- package/lib/commonjs/renderer/index.d.ts +0 -1
- package/lib/commonjs/renderer/index.js +0 -13
- package/lib/commonjs/renderer/index.js.map +1 -1
- package/lib/commonjs/renderer/processors/Animations/Animations.d.ts +1 -8
- package/lib/commonjs/renderer/processors/Animations/Animations.js +0 -44
- package/lib/commonjs/renderer/processors/Animations/Animations.js.map +1 -1
- package/lib/commonjs/skia/types/Canvas.d.ts +2 -2
- package/lib/commonjs/skia/types/Canvas.js.map +1 -1
- package/lib/commonjs/skia/types/Matrix.d.ts +2 -1
- package/lib/commonjs/skia/types/Matrix.js.map +1 -1
- package/lib/commonjs/skia/types/Matrix4.d.ts +9 -1
- package/lib/commonjs/skia/types/Matrix4.js +49 -3
- package/lib/commonjs/skia/types/Matrix4.js.map +1 -1
- package/lib/commonjs/skia/types/Paragraph/Paragraph.d.ts +23 -0
- package/lib/commonjs/skia/types/Paragraph/Paragraph.js.map +1 -1
- package/lib/commonjs/skia/types/Path/Path.d.ts +2 -2
- package/lib/commonjs/skia/types/Path/Path.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkMatrix.d.ts +2 -2
- package/lib/commonjs/skia/web/JsiSkMatrix.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkParagraph.d.ts +3 -0
- package/lib/commonjs/skia/web/JsiSkParagraph.js +12 -0
- package/lib/commonjs/skia/web/JsiSkParagraph.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkParagraphBuilderFactory.js +5 -2
- package/lib/commonjs/skia/web/JsiSkParagraphBuilderFactory.js.map +1 -1
- package/lib/commonjs/views/SkiaBaseWebView.d.ts +0 -7
- package/lib/commonjs/views/SkiaBaseWebView.js +0 -17
- package/lib/commonjs/views/SkiaBaseWebView.js.map +1 -1
- package/lib/commonjs/views/SkiaDomView.d.ts +0 -7
- package/lib/commonjs/views/SkiaDomView.js +3 -14
- package/lib/commonjs/views/SkiaDomView.js.map +1 -1
- package/lib/commonjs/views/SkiaDomView.web.js +4 -14
- package/lib/commonjs/views/SkiaDomView.web.js.map +1 -1
- package/lib/commonjs/views/SkiaPictureView.d.ts +0 -7
- package/lib/commonjs/views/SkiaPictureView.js +3 -14
- package/lib/commonjs/views/SkiaPictureView.js.map +1 -1
- package/lib/commonjs/views/SkiaViewNativeId.d.ts +3 -0
- package/lib/commonjs/views/SkiaViewNativeId.js +11 -0
- package/lib/commonjs/views/SkiaViewNativeId.js.map +1 -0
- package/lib/commonjs/views/index.d.ts +0 -2
- package/lib/commonjs/views/index.js +0 -26
- package/lib/commonjs/views/index.js.map +1 -1
- package/lib/commonjs/views/types.d.ts +2 -15
- package/lib/commonjs/views/types.js.map +1 -1
- package/lib/module/animation/index.d.ts +0 -3
- package/lib/module/animation/index.js +0 -3
- package/lib/module/animation/index.js.map +1 -1
- package/lib/module/dom/nodes/JsiSkDOM.d.ts +1 -2
- package/lib/module/dom/nodes/JsiSkDOM.js +1 -7
- package/lib/module/dom/nodes/JsiSkDOM.js.map +1 -1
- package/lib/module/dom/nodes/Node.d.ts +0 -3
- package/lib/module/dom/nodes/Node.js +0 -5
- package/lib/module/dom/nodes/Node.js.map +1 -1
- package/lib/module/dom/nodes/drawings/index.d.ts +0 -1
- package/lib/module/dom/nodes/drawings/index.js +0 -1
- package/lib/module/dom/nodes/drawings/index.js.map +1 -1
- package/lib/module/dom/types/Common.d.ts +2 -2
- package/lib/module/dom/types/Common.js.map +1 -1
- package/lib/module/dom/types/Drawings.d.ts +0 -4
- package/lib/module/dom/types/Drawings.js.map +1 -1
- package/lib/module/dom/types/NodeType.d.ts +0 -1
- package/lib/module/dom/types/NodeType.js +0 -1
- package/lib/module/dom/types/NodeType.js.map +1 -1
- package/lib/module/dom/types/SkDOM.d.ts +1 -2
- package/lib/module/dom/types/SkDOM.js.map +1 -1
- package/lib/module/index.d.ts +0 -1
- package/lib/module/index.js +0 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/mock/index.js +1 -4
- package/lib/module/mock/index.js.map +1 -1
- package/lib/module/renderer/Canvas.js +9 -32
- package/lib/module/renderer/Canvas.js.map +1 -1
- package/lib/module/renderer/Container.d.ts +1 -3
- package/lib/module/renderer/Container.js +4 -6
- package/lib/module/renderer/Container.js.map +1 -1
- package/lib/module/renderer/HostComponents.d.ts +1 -6
- package/lib/module/renderer/HostComponents.js +0 -3
- package/lib/module/renderer/HostComponents.js.map +1 -1
- package/lib/module/renderer/HostConfig.js +3 -23
- package/lib/module/renderer/HostConfig.js.map +1 -1
- package/lib/module/renderer/Reconciler.d.ts +1 -5
- package/lib/module/renderer/Reconciler.js +3 -16
- package/lib/module/renderer/Reconciler.js.map +1 -1
- package/lib/module/renderer/components/index.d.ts +0 -1
- package/lib/module/renderer/components/index.js +0 -1
- package/lib/module/renderer/components/index.js.map +1 -1
- package/lib/module/renderer/index.d.ts +0 -1
- package/lib/module/renderer/index.js +0 -1
- package/lib/module/renderer/index.js.map +1 -1
- package/lib/module/renderer/processors/Animations/Animations.d.ts +1 -8
- package/lib/module/renderer/processors/Animations/Animations.js +0 -28
- package/lib/module/renderer/processors/Animations/Animations.js.map +1 -1
- package/lib/module/skia/types/Canvas.d.ts +2 -2
- package/lib/module/skia/types/Canvas.js.map +1 -1
- package/lib/module/skia/types/Matrix.d.ts +2 -1
- package/lib/module/skia/types/Matrix.js.map +1 -1
- package/lib/module/skia/types/Matrix4.d.ts +9 -1
- package/lib/module/skia/types/Matrix4.js +42 -2
- package/lib/module/skia/types/Matrix4.js.map +1 -1
- package/lib/module/skia/types/Paragraph/Paragraph.d.ts +23 -0
- package/lib/module/skia/types/Paragraph/Paragraph.js.map +1 -1
- package/lib/module/skia/types/Path/Path.d.ts +2 -2
- package/lib/module/skia/types/Path/Path.js.map +1 -1
- package/lib/module/skia/web/JsiSkMatrix.d.ts +2 -2
- package/lib/module/skia/web/JsiSkMatrix.js.map +1 -1
- package/lib/module/skia/web/JsiSkParagraph.d.ts +3 -0
- package/lib/module/skia/web/JsiSkParagraph.js +12 -0
- package/lib/module/skia/web/JsiSkParagraph.js.map +1 -1
- package/lib/module/skia/web/JsiSkParagraphBuilderFactory.js +5 -2
- package/lib/module/skia/web/JsiSkParagraphBuilderFactory.js.map +1 -1
- package/lib/module/views/SkiaBaseWebView.d.ts +0 -7
- package/lib/module/views/SkiaBaseWebView.js +0 -17
- package/lib/module/views/SkiaBaseWebView.js.map +1 -1
- package/lib/module/views/SkiaDomView.d.ts +0 -7
- package/lib/module/views/SkiaDomView.js +2 -13
- package/lib/module/views/SkiaDomView.js.map +1 -1
- package/lib/module/views/SkiaDomView.web.js +4 -13
- package/lib/module/views/SkiaDomView.web.js.map +1 -1
- package/lib/module/views/SkiaPictureView.d.ts +0 -7
- package/lib/module/views/SkiaPictureView.js +2 -13
- package/lib/module/views/SkiaPictureView.js.map +1 -1
- package/lib/module/views/SkiaViewNativeId.d.ts +3 -0
- package/lib/module/views/SkiaViewNativeId.js +4 -0
- package/lib/module/views/SkiaViewNativeId.js.map +1 -0
- package/lib/module/views/index.d.ts +0 -2
- package/lib/module/views/index.js +0 -2
- package/lib/module/views/index.js.map +1 -1
- package/lib/module/views/types.d.ts +2 -15
- package/lib/module/views/types.js.map +1 -1
- package/lib/typescript/src/animation/index.d.ts +0 -3
- package/lib/typescript/src/dom/nodes/JsiSkDOM.d.ts +1 -2
- package/lib/typescript/src/dom/nodes/Node.d.ts +0 -3
- package/lib/typescript/src/dom/nodes/drawings/index.d.ts +0 -1
- package/lib/typescript/src/dom/types/Common.d.ts +2 -2
- package/lib/typescript/src/dom/types/Drawings.d.ts +0 -4
- package/lib/typescript/src/dom/types/NodeType.d.ts +0 -1
- package/lib/typescript/src/dom/types/SkDOM.d.ts +1 -2
- package/lib/typescript/src/index.d.ts +0 -1
- package/lib/typescript/src/renderer/Container.d.ts +1 -3
- package/lib/typescript/src/renderer/HostComponents.d.ts +1 -6
- package/lib/typescript/src/renderer/Reconciler.d.ts +1 -5
- package/lib/typescript/src/renderer/components/index.d.ts +0 -1
- package/lib/typescript/src/renderer/index.d.ts +0 -1
- package/lib/typescript/src/renderer/processors/Animations/Animations.d.ts +1 -8
- package/lib/typescript/src/skia/types/Canvas.d.ts +2 -2
- package/lib/typescript/src/skia/types/Matrix.d.ts +2 -1
- package/lib/typescript/src/skia/types/Matrix4.d.ts +9 -1
- package/lib/typescript/src/skia/types/Paragraph/Paragraph.d.ts +23 -0
- package/lib/typescript/src/skia/types/Path/Path.d.ts +2 -2
- package/lib/typescript/src/skia/web/JsiSkMatrix.d.ts +2 -2
- package/lib/typescript/src/skia/web/JsiSkParagraph.d.ts +3 -0
- package/lib/typescript/src/views/SkiaBaseWebView.d.ts +0 -7
- package/lib/typescript/src/views/SkiaDomView.d.ts +0 -7
- package/lib/typescript/src/views/SkiaPictureView.d.ts +0 -7
- package/lib/typescript/src/views/SkiaViewNativeId.d.ts +3 -0
- package/lib/typescript/src/views/index.d.ts +0 -2
- package/lib/typescript/src/views/types.d.ts +2 -15
- package/package.json +1 -1
- package/src/animation/index.ts +0 -3
- package/src/dom/nodes/JsiSkDOM.ts +0 -12
- package/src/dom/nodes/Node.ts +0 -5
- package/src/dom/nodes/drawings/index.ts +0 -1
- package/src/dom/types/Common.ts +2 -4
- package/src/dom/types/Drawings.ts +0 -5
- package/src/dom/types/NodeType.ts +0 -1
- package/src/dom/types/SkDOM.ts +0 -4
- package/src/index.ts +0 -1
- package/src/mock/index.ts +0 -3
- package/src/renderer/Canvas.tsx +9 -34
- package/src/renderer/Container.tsx +1 -4
- package/src/renderer/HostComponents.ts +0 -13
- package/src/renderer/HostConfig.ts +3 -24
- package/src/renderer/Reconciler.tsx +1 -19
- package/src/renderer/components/index.ts +0 -1
- package/src/renderer/index.ts +0 -1
- package/src/renderer/processors/Animations/Animations.ts +1 -51
- package/src/skia/types/Canvas.ts +2 -2
- package/src/skia/types/Matrix.ts +3 -1
- package/src/skia/types/Matrix4.ts +94 -63
- package/src/skia/types/Paragraph/Paragraph.ts +25 -0
- package/src/skia/types/Path/Path.ts +2 -2
- package/src/skia/web/JsiSkMatrix.ts +5 -5
- package/src/skia/web/JsiSkParagraph.ts +11 -0
- package/src/skia/web/JsiSkParagraphBuilderFactory.ts +9 -3
- package/src/views/SkiaBaseWebView.tsx +0 -19
- package/src/views/SkiaDomView.tsx +1 -13
- package/src/views/SkiaDomView.web.tsx +1 -6
- package/src/views/SkiaPictureView.tsx +1 -13
- package/src/views/SkiaViewNativeId.ts +1 -0
- package/src/views/index.ts +0 -2
- package/src/views/types.ts +2 -26
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaDrawView.java +0 -44
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaDrawViewManager.java +0 -34
- package/cpp/rnskia/RNSkAnimation.h +0 -65
- package/cpp/rnskia/RNSkValueApi.h +0 -72
- package/cpp/rnskia/dom/base/JsiDependencyManager.h +0 -297
- package/cpp/rnskia/dom/nodes/JsiCustomDrawingNode.h +0 -127
- package/cpp/rnskia/dom/props/DrawingProp.h +0 -35
- package/cpp/rnskia/values/RNSkClockValue.h +0 -140
- package/cpp/rnskia/values/RNSkComputedValue.h +0 -104
- package/cpp/rnskia/values/RNSkReadonlyValue.h +0 -166
- package/cpp/rnskia/values/RNSkValue.h +0 -116
- package/ios/RNSkia-iOS/SkiaDrawView.h +0 -7
- package/ios/RNSkia-iOS/SkiaDrawView.mm +0 -72
- package/ios/RNSkia-iOS/SkiaDrawViewManager.h +0 -7
- package/ios/RNSkia-iOS/SkiaDrawViewManager.mm +0 -50
- package/lib/commonjs/animation/decay/decay.d.ts +0 -2
- package/lib/commonjs/animation/decay/decay.js +0 -42
- package/lib/commonjs/animation/decay/decay.js.map +0 -1
- package/lib/commonjs/animation/decay/index.d.ts +0 -1
- package/lib/commonjs/animation/decay/index.js +0 -14
- package/lib/commonjs/animation/decay/index.js.map +0 -1
- package/lib/commonjs/animation/decay/runDecay.d.ts +0 -10
- package/lib/commonjs/animation/decay/runDecay.js +0 -48
- package/lib/commonjs/animation/decay/runDecay.js.map +0 -1
- package/lib/commonjs/animation/decay/types.d.ts +0 -21
- package/lib/commonjs/animation/decay/types.js +0 -6
- package/lib/commonjs/animation/decay/types.js.map +0 -1
- package/lib/commonjs/animation/spring/Spring.d.ts +0 -65
- package/lib/commonjs/animation/spring/Spring.js +0 -77
- package/lib/commonjs/animation/spring/Spring.js.map +0 -1
- package/lib/commonjs/animation/spring/functions/index.d.ts +0 -1
- package/lib/commonjs/animation/spring/functions/index.js +0 -14
- package/lib/commonjs/animation/spring/functions/index.js.map +0 -1
- package/lib/commonjs/animation/spring/functions/spring.d.ts +0 -10
- package/lib/commonjs/animation/spring/functions/spring.js +0 -94
- package/lib/commonjs/animation/spring/functions/spring.js.map +0 -1
- package/lib/commonjs/animation/spring/index.d.ts +0 -3
- package/lib/commonjs/animation/spring/index.js +0 -30
- package/lib/commonjs/animation/spring/index.js.map +0 -1
- package/lib/commonjs/animation/spring/runSpring.d.ts +0 -19
- package/lib/commonjs/animation/spring/runSpring.js +0 -35
- package/lib/commonjs/animation/spring/runSpring.js.map +0 -1
- package/lib/commonjs/animation/spring/types.d.ts +0 -6
- package/lib/commonjs/animation/spring/types.js +0 -2
- package/lib/commonjs/animation/spring/types.js.map +0 -1
- package/lib/commonjs/animation/spring/useSpring.d.ts +0 -13
- package/lib/commonjs/animation/spring/useSpring.js +0 -27
- package/lib/commonjs/animation/spring/useSpring.js.map +0 -1
- package/lib/commonjs/animation/timing/Easing.d.ts +0 -19
- package/lib/commonjs/animation/timing/Easing.js +0 -108
- package/lib/commonjs/animation/timing/Easing.js.map +0 -1
- package/lib/commonjs/animation/timing/createTiming.d.ts +0 -17
- package/lib/commonjs/animation/timing/createTiming.js +0 -55
- package/lib/commonjs/animation/timing/createTiming.js.map +0 -1
- package/lib/commonjs/animation/timing/functions/bezier.d.ts +0 -1
- package/lib/commonjs/animation/timing/functions/bezier.js +0 -147
- package/lib/commonjs/animation/timing/functions/bezier.js.map +0 -1
- package/lib/commonjs/animation/timing/functions/getResolvedParams.d.ts +0 -7
- package/lib/commonjs/animation/timing/functions/getResolvedParams.js +0 -52
- package/lib/commonjs/animation/timing/functions/getResolvedParams.js.map +0 -1
- package/lib/commonjs/animation/timing/functions/index.d.ts +0 -4
- package/lib/commonjs/animation/timing/functions/index.js +0 -54
- package/lib/commonjs/animation/timing/functions/index.js.map +0 -1
- package/lib/commonjs/animation/timing/functions/timing.d.ts +0 -17
- package/lib/commonjs/animation/timing/functions/timing.js +0 -50
- package/lib/commonjs/animation/timing/functions/timing.js.map +0 -1
- package/lib/commonjs/animation/timing/functions/types.d.ts +0 -7
- package/lib/commonjs/animation/timing/functions/types.js +0 -2
- package/lib/commonjs/animation/timing/functions/types.js.map +0 -1
- package/lib/commonjs/animation/timing/index.d.ts +0 -4
- package/lib/commonjs/animation/timing/index.js +0 -38
- package/lib/commonjs/animation/timing/index.js.map +0 -1
- package/lib/commonjs/animation/timing/runTiming.d.ts +0 -19
- package/lib/commonjs/animation/timing/runTiming.js +0 -36
- package/lib/commonjs/animation/timing/runTiming.js.map +0 -1
- package/lib/commonjs/animation/timing/useLoop.d.ts +0 -11
- package/lib/commonjs/animation/timing/useLoop.js +0 -25
- package/lib/commonjs/animation/timing/useLoop.js.map +0 -1
- package/lib/commonjs/animation/timing/useTiming.d.ts +0 -13
- package/lib/commonjs/animation/timing/useTiming.js +0 -67
- package/lib/commonjs/animation/timing/useTiming.js.map +0 -1
- package/lib/commonjs/dom/nodes/drawings/CustomDrawingNode.d.ts +0 -8
- package/lib/commonjs/dom/nodes/drawings/CustomDrawingNode.js +0 -28
- package/lib/commonjs/dom/nodes/drawings/CustomDrawingNode.js.map +0 -1
- package/lib/commonjs/renderer/DependencyManager.d.ts +0 -46
- package/lib/commonjs/renderer/DependencyManager.js +0 -185
- package/lib/commonjs/renderer/DependencyManager.js.map +0 -1
- package/lib/commonjs/renderer/components/Drawing.d.ts +0 -8
- package/lib/commonjs/renderer/components/Drawing.js +0 -22
- package/lib/commonjs/renderer/components/Drawing.js.map +0 -1
- package/lib/commonjs/specs/SkiaDrawViewNativeComponent.d.ts +0 -8
- package/lib/commonjs/specs/SkiaDrawViewNativeComponent.js +0 -16
- package/lib/commonjs/specs/SkiaDrawViewNativeComponent.js.map +0 -1
- package/lib/commonjs/values/api.d.ts +0 -26
- package/lib/commonjs/values/api.js +0 -55
- package/lib/commonjs/values/api.js.map +0 -1
- package/lib/commonjs/values/api.web.d.ts +0 -2
- package/lib/commonjs/values/api.web.js +0 -18
- package/lib/commonjs/values/api.web.js.map +0 -1
- package/lib/commonjs/values/hooks/index.d.ts +0 -4
- package/lib/commonjs/values/hooks/index.js +0 -58
- package/lib/commonjs/values/hooks/index.js.map +0 -1
- package/lib/commonjs/values/hooks/useClockValue.d.ts +0 -9
- package/lib/commonjs/values/hooks/useClockValue.js +0 -30
- package/lib/commonjs/values/hooks/useClockValue.js.map +0 -1
- package/lib/commonjs/values/hooks/useComputedValue.d.ts +0 -11
- package/lib/commonjs/values/hooks/useComputedValue.js +0 -32
- package/lib/commonjs/values/hooks/useComputedValue.js.map +0 -1
- package/lib/commonjs/values/hooks/useValue.d.ts +0 -10
- package/lib/commonjs/values/hooks/useValue.js +0 -26
- package/lib/commonjs/values/hooks/useValue.js.map +0 -1
- package/lib/commonjs/values/hooks/useValueEffect.d.ts +0 -10
- package/lib/commonjs/values/hooks/useValueEffect.js +0 -25
- package/lib/commonjs/values/hooks/useValueEffect.js.map +0 -1
- package/lib/commonjs/values/index.d.ts +0 -4
- package/lib/commonjs/values/index.js +0 -58
- package/lib/commonjs/values/index.js.map +0 -1
- package/lib/commonjs/values/selector.d.ts +0 -14
- package/lib/commonjs/values/selector.js +0 -24
- package/lib/commonjs/values/selector.js.map +0 -1
- package/lib/commonjs/values/types.d.ts +0 -63
- package/lib/commonjs/values/types.js +0 -2
- package/lib/commonjs/values/types.js.map +0 -1
- package/lib/commonjs/values/web/RNSkAnimation.d.ts +0 -9
- package/lib/commonjs/values/web/RNSkAnimation.js +0 -46
- package/lib/commonjs/values/web/RNSkAnimation.js.map +0 -1
- package/lib/commonjs/values/web/RNSkClockValue.d.ts +0 -13
- package/lib/commonjs/values/web/RNSkClockValue.js +0 -75
- package/lib/commonjs/values/web/RNSkClockValue.js.map +0 -1
- package/lib/commonjs/values/web/RNSkComputedValue.d.ts +0 -10
- package/lib/commonjs/values/web/RNSkComputedValue.js +0 -59
- package/lib/commonjs/values/web/RNSkComputedValue.js.map +0 -1
- package/lib/commonjs/values/web/RNSkReadonlyValue.d.ts +0 -12
- package/lib/commonjs/values/web/RNSkReadonlyValue.js +0 -51
- package/lib/commonjs/values/web/RNSkReadonlyValue.js.map +0 -1
- package/lib/commonjs/values/web/RNSkValue.d.ts +0 -14
- package/lib/commonjs/values/web/RNSkValue.js +0 -73
- package/lib/commonjs/values/web/RNSkValue.js.map +0 -1
- package/lib/commonjs/values/web/api.d.ts +0 -2
- package/lib/commonjs/values/web/api.js +0 -31
- package/lib/commonjs/values/web/api.js.map +0 -1
- package/lib/commonjs/values/web/index.d.ts +0 -1
- package/lib/commonjs/values/web/index.js +0 -19
- package/lib/commonjs/values/web/index.js.map +0 -1
- package/lib/commonjs/views/SkiaView.d.ts +0 -35
- package/lib/commonjs/views/SkiaView.js +0 -139
- package/lib/commonjs/views/SkiaView.js.map +0 -1
- package/lib/commonjs/views/SkiaView.web.d.ts +0 -7
- package/lib/commonjs/views/SkiaView.web.js +0 -30
- package/lib/commonjs/views/SkiaView.web.js.map +0 -1
- package/lib/commonjs/views/useDrawCallback.d.ts +0 -8
- package/lib/commonjs/views/useDrawCallback.js +0 -23
- package/lib/commonjs/views/useDrawCallback.js.map +0 -1
- package/lib/module/animation/decay/decay.d.ts +0 -2
- package/lib/module/animation/decay/decay.js +0 -33
- package/lib/module/animation/decay/decay.js.map +0 -1
- package/lib/module/animation/decay/index.d.ts +0 -1
- package/lib/module/animation/decay/index.js +0 -2
- package/lib/module/animation/decay/index.js.map +0 -1
- package/lib/module/animation/decay/runDecay.d.ts +0 -10
- package/lib/module/animation/decay/runDecay.js +0 -38
- package/lib/module/animation/decay/runDecay.js.map +0 -1
- package/lib/module/animation/decay/types.d.ts +0 -21
- package/lib/module/animation/decay/types.js +0 -2
- package/lib/module/animation/decay/types.js.map +0 -1
- package/lib/module/animation/spring/Spring.d.ts +0 -65
- package/lib/module/animation/spring/Spring.js +0 -69
- package/lib/module/animation/spring/Spring.js.map +0 -1
- package/lib/module/animation/spring/functions/index.d.ts +0 -1
- package/lib/module/animation/spring/functions/index.js +0 -2
- package/lib/module/animation/spring/functions/index.js.map +0 -1
- package/lib/module/animation/spring/functions/spring.d.ts +0 -10
- package/lib/module/animation/spring/functions/spring.js +0 -85
- package/lib/module/animation/spring/functions/spring.js.map +0 -1
- package/lib/module/animation/spring/index.d.ts +0 -3
- package/lib/module/animation/spring/index.js +0 -4
- package/lib/module/animation/spring/index.js.map +0 -1
- package/lib/module/animation/spring/runSpring.d.ts +0 -19
- package/lib/module/animation/spring/runSpring.js +0 -24
- package/lib/module/animation/spring/runSpring.js.map +0 -1
- package/lib/module/animation/spring/types.d.ts +0 -6
- package/lib/module/animation/spring/types.js +0 -2
- package/lib/module/animation/spring/types.js.map +0 -1
- package/lib/module/animation/spring/useSpring.d.ts +0 -13
- package/lib/module/animation/spring/useSpring.js +0 -16
- package/lib/module/animation/spring/useSpring.js.map +0 -1
- package/lib/module/animation/timing/Easing.d.ts +0 -19
- package/lib/module/animation/timing/Easing.js +0 -98
- package/lib/module/animation/timing/Easing.js.map +0 -1
- package/lib/module/animation/timing/createTiming.d.ts +0 -17
- package/lib/module/animation/timing/createTiming.js +0 -49
- package/lib/module/animation/timing/createTiming.js.map +0 -1
- package/lib/module/animation/timing/functions/bezier.d.ts +0 -1
- package/lib/module/animation/timing/functions/bezier.js +0 -141
- package/lib/module/animation/timing/functions/bezier.js.map +0 -1
- package/lib/module/animation/timing/functions/getResolvedParams.d.ts +0 -7
- package/lib/module/animation/timing/functions/getResolvedParams.js +0 -48
- package/lib/module/animation/timing/functions/getResolvedParams.js.map +0 -1
- package/lib/module/animation/timing/functions/index.d.ts +0 -4
- package/lib/module/animation/timing/functions/index.js +0 -5
- package/lib/module/animation/timing/functions/index.js.map +0 -1
- package/lib/module/animation/timing/functions/timing.d.ts +0 -17
- package/lib/module/animation/timing/functions/timing.js +0 -41
- package/lib/module/animation/timing/functions/timing.js.map +0 -1
- package/lib/module/animation/timing/functions/types.d.ts +0 -7
- package/lib/module/animation/timing/functions/types.js +0 -2
- package/lib/module/animation/timing/functions/types.js.map +0 -1
- package/lib/module/animation/timing/index.d.ts +0 -4
- package/lib/module/animation/timing/index.js +0 -5
- package/lib/module/animation/timing/index.js.map +0 -1
- package/lib/module/animation/timing/runTiming.d.ts +0 -19
- package/lib/module/animation/timing/runTiming.js +0 -26
- package/lib/module/animation/timing/runTiming.js.map +0 -1
- package/lib/module/animation/timing/useLoop.d.ts +0 -11
- package/lib/module/animation/timing/useLoop.js +0 -16
- package/lib/module/animation/timing/useLoop.js.map +0 -1
- package/lib/module/animation/timing/useTiming.d.ts +0 -13
- package/lib/module/animation/timing/useTiming.js +0 -57
- package/lib/module/animation/timing/useTiming.js.map +0 -1
- package/lib/module/dom/nodes/drawings/CustomDrawingNode.d.ts +0 -8
- package/lib/module/dom/nodes/drawings/CustomDrawingNode.js +0 -17
- package/lib/module/dom/nodes/drawings/CustomDrawingNode.js.map +0 -1
- package/lib/module/renderer/DependencyManager.d.ts +0 -46
- package/lib/module/renderer/DependencyManager.js +0 -174
- package/lib/module/renderer/DependencyManager.js.map +0 -1
- package/lib/module/renderer/components/Drawing.d.ts +0 -8
- package/lib/module/renderer/components/Drawing.js +0 -11
- package/lib/module/renderer/components/Drawing.js.map +0 -1
- package/lib/module/specs/SkiaDrawViewNativeComponent.d.ts +0 -8
- package/lib/module/specs/SkiaDrawViewNativeComponent.js +0 -4
- package/lib/module/specs/SkiaDrawViewNativeComponent.js.map +0 -1
- package/lib/module/values/api.d.ts +0 -26
- package/lib/module/values/api.js +0 -48
- package/lib/module/values/api.js.map +0 -1
- package/lib/module/values/api.web.d.ts +0 -2
- package/lib/module/values/api.web.js +0 -7
- package/lib/module/values/api.web.js.map +0 -1
- package/lib/module/values/hooks/index.d.ts +0 -4
- package/lib/module/values/hooks/index.js +0 -5
- package/lib/module/values/hooks/index.js.map +0 -1
- package/lib/module/values/hooks/useClockValue.d.ts +0 -9
- package/lib/module/values/hooks/useClockValue.js +0 -20
- package/lib/module/values/hooks/useClockValue.js.map +0 -1
- package/lib/module/values/hooks/useComputedValue.d.ts +0 -11
- package/lib/module/values/hooks/useComputedValue.js +0 -21
- package/lib/module/values/hooks/useComputedValue.js.map +0 -1
- package/lib/module/values/hooks/useValue.d.ts +0 -10
- package/lib/module/values/hooks/useValue.js +0 -16
- package/lib/module/values/hooks/useValue.js.map +0 -1
- package/lib/module/values/hooks/useValueEffect.d.ts +0 -10
- package/lib/module/values/hooks/useValueEffect.js +0 -16
- package/lib/module/values/hooks/useValueEffect.js.map +0 -1
- package/lib/module/values/index.d.ts +0 -4
- package/lib/module/values/index.js +0 -5
- package/lib/module/values/index.js.map +0 -1
- package/lib/module/values/selector.d.ts +0 -14
- package/lib/module/values/selector.js +0 -15
- package/lib/module/values/selector.js.map +0 -1
- package/lib/module/values/types.d.ts +0 -63
- package/lib/module/values/types.js +0 -2
- package/lib/module/values/types.js.map +0 -1
- package/lib/module/values/web/RNSkAnimation.d.ts +0 -9
- package/lib/module/values/web/RNSkAnimation.js +0 -36
- package/lib/module/values/web/RNSkAnimation.js.map +0 -1
- package/lib/module/values/web/RNSkClockValue.d.ts +0 -13
- package/lib/module/values/web/RNSkClockValue.js +0 -65
- package/lib/module/values/web/RNSkClockValue.js.map +0 -1
- package/lib/module/values/web/RNSkComputedValue.d.ts +0 -10
- package/lib/module/values/web/RNSkComputedValue.js +0 -49
- package/lib/module/values/web/RNSkComputedValue.js.map +0 -1
- package/lib/module/values/web/RNSkReadonlyValue.d.ts +0 -12
- package/lib/module/values/web/RNSkReadonlyValue.js +0 -42
- package/lib/module/values/web/RNSkReadonlyValue.js.map +0 -1
- package/lib/module/values/web/RNSkValue.d.ts +0 -14
- package/lib/module/values/web/RNSkValue.js +0 -63
- package/lib/module/values/web/RNSkValue.js.map +0 -1
- package/lib/module/values/web/api.d.ts +0 -2
- package/lib/module/values/web/api.js +0 -19
- package/lib/module/values/web/api.js.map +0 -1
- package/lib/module/values/web/index.d.ts +0 -1
- package/lib/module/values/web/index.js +0 -2
- package/lib/module/values/web/index.js.map +0 -1
- package/lib/module/views/SkiaView.d.ts +0 -35
- package/lib/module/views/SkiaView.js +0 -119
- package/lib/module/views/SkiaView.js.map +0 -1
- package/lib/module/views/SkiaView.web.d.ts +0 -7
- package/lib/module/views/SkiaView.web.js +0 -20
- package/lib/module/views/SkiaView.web.js.map +0 -1
- package/lib/module/views/useDrawCallback.d.ts +0 -8
- package/lib/module/views/useDrawCallback.js +0 -14
- package/lib/module/views/useDrawCallback.js.map +0 -1
- package/lib/typescript/src/animation/decay/decay.d.ts +0 -2
- package/lib/typescript/src/animation/decay/index.d.ts +0 -1
- package/lib/typescript/src/animation/decay/runDecay.d.ts +0 -10
- package/lib/typescript/src/animation/decay/types.d.ts +0 -21
- package/lib/typescript/src/animation/spring/Spring.d.ts +0 -65
- package/lib/typescript/src/animation/spring/functions/index.d.ts +0 -1
- package/lib/typescript/src/animation/spring/functions/spring.d.ts +0 -10
- package/lib/typescript/src/animation/spring/index.d.ts +0 -3
- package/lib/typescript/src/animation/spring/runSpring.d.ts +0 -19
- package/lib/typescript/src/animation/spring/types.d.ts +0 -6
- package/lib/typescript/src/animation/spring/useSpring.d.ts +0 -13
- package/lib/typescript/src/animation/timing/Easing.d.ts +0 -19
- package/lib/typescript/src/animation/timing/createTiming.d.ts +0 -17
- package/lib/typescript/src/animation/timing/functions/bezier.d.ts +0 -1
- package/lib/typescript/src/animation/timing/functions/getResolvedParams.d.ts +0 -7
- package/lib/typescript/src/animation/timing/functions/index.d.ts +0 -4
- package/lib/typescript/src/animation/timing/functions/timing.d.ts +0 -17
- package/lib/typescript/src/animation/timing/functions/types.d.ts +0 -7
- package/lib/typescript/src/animation/timing/index.d.ts +0 -4
- package/lib/typescript/src/animation/timing/runTiming.d.ts +0 -19
- package/lib/typescript/src/animation/timing/useLoop.d.ts +0 -11
- package/lib/typescript/src/animation/timing/useTiming.d.ts +0 -13
- package/lib/typescript/src/dom/nodes/drawings/CustomDrawingNode.d.ts +0 -8
- package/lib/typescript/src/renderer/DependencyManager.d.ts +0 -46
- package/lib/typescript/src/renderer/components/Drawing.d.ts +0 -8
- package/lib/typescript/src/specs/SkiaDrawViewNativeComponent.d.ts +0 -8
- package/lib/typescript/src/values/api.d.ts +0 -26
- package/lib/typescript/src/values/api.web.d.ts +0 -2
- package/lib/typescript/src/values/hooks/index.d.ts +0 -4
- package/lib/typescript/src/values/hooks/useClockValue.d.ts +0 -9
- package/lib/typescript/src/values/hooks/useComputedValue.d.ts +0 -11
- package/lib/typescript/src/values/hooks/useValue.d.ts +0 -10
- package/lib/typescript/src/values/hooks/useValueEffect.d.ts +0 -10
- package/lib/typescript/src/values/index.d.ts +0 -4
- package/lib/typescript/src/values/selector.d.ts +0 -14
- package/lib/typescript/src/values/types.d.ts +0 -63
- package/lib/typescript/src/values/web/RNSkAnimation.d.ts +0 -9
- package/lib/typescript/src/values/web/RNSkClockValue.d.ts +0 -13
- package/lib/typescript/src/values/web/RNSkComputedValue.d.ts +0 -10
- package/lib/typescript/src/values/web/RNSkReadonlyValue.d.ts +0 -12
- package/lib/typescript/src/values/web/RNSkValue.d.ts +0 -14
- package/lib/typescript/src/values/web/api.d.ts +0 -2
- package/lib/typescript/src/values/web/index.d.ts +0 -1
- package/lib/typescript/src/views/SkiaView.d.ts +0 -35
- package/lib/typescript/src/views/SkiaView.web.d.ts +0 -7
- package/lib/typescript/src/views/useDrawCallback.d.ts +0 -8
- package/src/animation/decay/decay.ts +0 -35
- package/src/animation/decay/index.ts +0 -1
- package/src/animation/decay/runDecay.ts +0 -40
- package/src/animation/decay/types.ts +0 -24
- package/src/animation/spring/Spring.ts +0 -61
- package/src/animation/spring/functions/index.ts +0 -1
- package/src/animation/spring/functions/spring.ts +0 -86
- package/src/animation/spring/index.ts +0 -3
- package/src/animation/spring/runSpring.ts +0 -40
- package/src/animation/spring/types.ts +0 -6
- package/src/animation/spring/useSpring.ts +0 -31
- package/src/animation/timing/Easing.ts +0 -102
- package/src/animation/timing/createTiming.ts +0 -62
- package/src/animation/timing/functions/bezier.ts +0 -165
- package/src/animation/timing/functions/getResolvedParams.ts +0 -50
- package/src/animation/timing/functions/index.ts +0 -4
- package/src/animation/timing/functions/timing.ts +0 -44
- package/src/animation/timing/functions/types.ts +0 -8
- package/src/animation/timing/index.ts +0 -4
- package/src/animation/timing/runTiming.ts +0 -36
- package/src/animation/timing/useLoop.ts +0 -21
- package/src/animation/timing/useTiming.ts +0 -71
- package/src/dom/nodes/drawings/CustomDrawingNode.ts +0 -21
- package/src/renderer/DependencyManager.tsx +0 -196
- package/src/renderer/components/Drawing.tsx +0 -12
- package/src/specs/SkiaDrawViewNativeComponent.ts +0 -10
- package/src/values/api.ts +0 -61
- package/src/values/api.web.ts +0 -5
- package/src/values/hooks/index.ts +0 -4
- package/src/values/hooks/useClockValue.ts +0 -21
- package/src/values/hooks/useComputedValue.ts +0 -24
- package/src/values/hooks/useValue.ts +0 -17
- package/src/values/hooks/useValueEffect.ts +0 -18
- package/src/values/index.ts +0 -4
- package/src/values/selector.ts +0 -24
- package/src/values/types.ts +0 -73
- package/src/values/web/RNSkAnimation.ts +0 -33
- package/src/values/web/RNSkClockValue.ts +0 -58
- package/src/values/web/RNSkComputedValue.ts +0 -49
- package/src/values/web/RNSkReadonlyValue.ts +0 -38
- package/src/values/web/RNSkValue.ts +0 -57
- package/src/values/web/api.ts +0 -33
- package/src/values/web/index.ts +0 -1
- package/src/views/SkiaView.tsx +0 -111
- package/src/views/SkiaView.web.tsx +0 -22
- package/src/views/useDrawCallback.ts +0 -19
package/src/renderer/index.ts
CHANGED
@@ -1,58 +1,8 @@
|
|
1
|
-
import type { SkiaSelector, SkiaValue } from "../../../values";
|
2
|
-
|
3
1
|
export type SharedValueType<T = number> = {
|
4
2
|
value: T;
|
5
3
|
};
|
6
4
|
|
7
|
-
export
|
8
|
-
if (value === undefined || value === null) {
|
9
|
-
return false;
|
10
|
-
}
|
11
|
-
try {
|
12
|
-
if (
|
13
|
-
typeof value === "object" &&
|
14
|
-
"__typename__" in value &&
|
15
|
-
(value as unknown as SkiaValue<unknown>).__typename__ === "RNSkValue"
|
16
|
-
) {
|
17
|
-
return true;
|
18
|
-
}
|
19
|
-
} catch {}
|
20
|
-
return false;
|
21
|
-
};
|
22
|
-
|
23
|
-
export const isSelector = <T, R>(
|
24
|
-
value: unknown
|
25
|
-
): value is {
|
26
|
-
selector: (v: T) => R;
|
27
|
-
value: SkiaValue<T>;
|
28
|
-
} => {
|
29
|
-
if (value) {
|
30
|
-
return (
|
31
|
-
typeof value === "object" &&
|
32
|
-
"selector" in value &&
|
33
|
-
"value" in value &&
|
34
|
-
(value as Record<string, unknown>).selector !== undefined &&
|
35
|
-
(value as Record<string, unknown>).value !== undefined
|
36
|
-
);
|
37
|
-
}
|
38
|
-
return false;
|
39
|
-
};
|
40
|
-
|
41
|
-
export const isAnimated = <T>(props: AnimatedProps<T>) => {
|
42
|
-
for (const value of Object.values(props)) {
|
43
|
-
if (isValue(value) || isSelector(value)) {
|
44
|
-
return true;
|
45
|
-
}
|
46
|
-
}
|
47
|
-
return false;
|
48
|
-
};
|
49
|
-
|
50
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
51
|
-
export type AnimatedProp<T, P = any> =
|
52
|
-
| T
|
53
|
-
| SkiaValue<T>
|
54
|
-
| SkiaSelector<T, P>
|
55
|
-
| SharedValueType<T>;
|
5
|
+
export type AnimatedProp<T> = T | SharedValueType<T>;
|
56
6
|
|
57
7
|
export type AnimatedProps<T, O extends keyof T | never = never> = {
|
58
8
|
[K in keyof T]: K extends "children"
|
package/src/skia/types/Canvas.ts
CHANGED
@@ -8,7 +8,7 @@ import type { SkColor } from "./Color";
|
|
8
8
|
import type { SkRRect } from "./RRect";
|
9
9
|
import type { BlendMode } from "./Paint/BlendMode";
|
10
10
|
import type { SkPoint, PointMode } from "./Point";
|
11
|
-
import type {
|
11
|
+
import type { InputMatrix } from "./Matrix";
|
12
12
|
import type { SkImageFilter } from "./ImageFilter";
|
13
13
|
import type { SkVertices } from "./Vertices";
|
14
14
|
import type { SkTextBlob } from "./TextBlob";
|
@@ -485,7 +485,7 @@ export interface SkCanvas {
|
|
485
485
|
* Replaces current matrix with m premultiplied with the existing matrix.
|
486
486
|
* @param m
|
487
487
|
*/
|
488
|
-
concat(m:
|
488
|
+
concat(m: InputMatrix): void;
|
489
489
|
|
490
490
|
/**
|
491
491
|
* Draws the given picture using the current clip, current matrix, and the provided paint.
|
package/src/skia/types/Matrix.ts
CHANGED
@@ -7,7 +7,7 @@ export const isMatrix = (obj: unknown): obj is SkMatrix =>
|
|
7
7
|
obj !== null && (obj as SkJSIInstance<string>).__typename__ === "Matrix";
|
8
8
|
|
9
9
|
export interface SkMatrix extends SkJSIInstance<"Matrix"> {
|
10
|
-
concat: (matrix:
|
10
|
+
concat: (matrix: InputMatrix) => SkMatrix;
|
11
11
|
translate: (x: number, y: number) => SkMatrix;
|
12
12
|
scale: (x: number, y?: number) => SkMatrix;
|
13
13
|
skew: (x: number, y: number) => SkMatrix;
|
@@ -20,6 +20,8 @@ export interface SkMatrix extends SkJSIInstance<"Matrix"> {
|
|
20
20
|
get: () => number[];
|
21
21
|
}
|
22
22
|
|
23
|
+
export type InputMatrix = SkMatrix | Matrix3 | Matrix4 | number[];
|
24
|
+
|
23
25
|
export interface TransformProp {
|
24
26
|
transform?: Transforms3d;
|
25
27
|
}
|
@@ -278,67 +278,98 @@ export const rotateY = (value: number, p?: Point) => {
|
|
278
278
|
*/
|
279
279
|
export const processTransform3d = (transforms: Transforms3d) => {
|
280
280
|
"worklet";
|
281
|
-
return
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
281
|
+
return transforms.reduce((acc, val) => {
|
282
|
+
const key = Object.keys(val)[0] as Transform3dName;
|
283
|
+
const transform = val as Pick<Transformations, typeof key>;
|
284
|
+
if (key === "translateX") {
|
285
|
+
const value = transform[key];
|
286
|
+
return multiply4(acc, translate(value, 0, 0));
|
287
|
+
}
|
288
|
+
if (key === "translate") {
|
289
|
+
const [x, y, z = 0] = transform[key];
|
290
|
+
return multiply4(acc, translate(x, y, z));
|
291
|
+
}
|
292
|
+
if (key === "translateY") {
|
293
|
+
const value = transform[key];
|
294
|
+
return multiply4(acc, translate(0, value, 0));
|
295
|
+
}
|
296
|
+
if (key === "translateZ") {
|
297
|
+
const value = transform[key];
|
298
|
+
return multiply4(acc, translate(0, 0, value));
|
299
|
+
}
|
300
|
+
if (key === "scale") {
|
301
|
+
const value = transform[key];
|
302
|
+
return multiply4(acc, scale(value, value, 1));
|
303
|
+
}
|
304
|
+
if (key === "scaleX") {
|
305
|
+
const value = transform[key];
|
306
|
+
return multiply4(acc, scale(value, 1, 1));
|
307
|
+
}
|
308
|
+
if (key === "scaleY") {
|
309
|
+
const value = transform[key];
|
310
|
+
return multiply4(acc, scale(1, value, 1));
|
311
|
+
}
|
312
|
+
if (key === "skewX") {
|
313
|
+
const value = transform[key];
|
314
|
+
return multiply4(acc, skewX(value));
|
315
|
+
}
|
316
|
+
if (key === "skewY") {
|
317
|
+
const value = transform[key];
|
318
|
+
return multiply4(acc, skewY(value));
|
319
|
+
}
|
320
|
+
if (key === "rotateX") {
|
321
|
+
const value = transform[key];
|
322
|
+
return multiply4(acc, rotate([1, 0, 0], value));
|
323
|
+
}
|
324
|
+
if (key === "rotateY") {
|
325
|
+
const value = transform[key];
|
326
|
+
return multiply4(acc, rotate([0, 1, 0], value));
|
327
|
+
}
|
328
|
+
if (key === "perspective") {
|
329
|
+
const value = transform[key];
|
330
|
+
return multiply4(acc, perspective(value));
|
331
|
+
}
|
332
|
+
if (key === "rotate" || key === "rotateZ") {
|
333
|
+
const value = transform[key];
|
334
|
+
return multiply4(acc, rotate([0, 0, 1], value));
|
335
|
+
}
|
336
|
+
if (key === "matrix") {
|
337
|
+
const value = transform[key];
|
338
|
+
return multiply4(acc, value);
|
339
|
+
}
|
340
|
+
return exhaustiveCheck(key);
|
341
|
+
}, Matrix4());
|
342
|
+
};
|
343
|
+
|
344
|
+
/**
|
345
|
+
* @worklet
|
346
|
+
*/
|
347
|
+
export const convertToColumnMajor = (rowMajorMatrix: Matrix4) => {
|
348
|
+
"worklet";
|
349
|
+
|
350
|
+
const colMajorMatrix = new Array<number>(16);
|
351
|
+
const size = 4;
|
352
|
+
for (let row = 0; row < size; row++) {
|
353
|
+
for (let col = 0; col < size; col++) {
|
354
|
+
colMajorMatrix[col * size + row] = rowMajorMatrix[row * size + col];
|
355
|
+
}
|
356
|
+
}
|
357
|
+
return colMajorMatrix;
|
358
|
+
};
|
359
|
+
|
360
|
+
/**
|
361
|
+
* @worklet
|
362
|
+
*/
|
363
|
+
export const convertToAffineMatrix = (m4: number[]) => {
|
364
|
+
"worklet";
|
365
|
+
// Extracting the relevant components from the 4x4 matrix
|
366
|
+
const a = m4[0]; // Scale X
|
367
|
+
const b = m4[1]; // Skew Y
|
368
|
+
const c = m4[4]; // Skew X
|
369
|
+
const d = m4[5]; // Scale Y
|
370
|
+
const tx = m4[12]; // Translate X
|
371
|
+
const ty = m4[13]; // Translate Y
|
372
|
+
|
373
|
+
// Returning the 6-element affine transformation matrix
|
374
|
+
return [a, b, c, d, tx, ty];
|
344
375
|
};
|
@@ -32,6 +32,31 @@ export interface SkParagraph extends SkJSIInstance<"Paragraph"> {
|
|
32
32
|
* method to have been called first.
|
33
33
|
*/
|
34
34
|
getMaxWidth(): number;
|
35
|
+
/**
|
36
|
+
* Returns the minimum intrinsic width of the paragraph.
|
37
|
+
* The minimum intrinsic width is the width beyond which increasing the width of the paragraph
|
38
|
+
* does not decrease the height. This is effectively the width at which the paragraph
|
39
|
+
* can no longer wrap lines and is forced to overflow.
|
40
|
+
* This method requires the layout method to have been called first.
|
41
|
+
* @returns {number} The minimum intrinsic width of the paragraph.
|
42
|
+
*/
|
43
|
+
getMinIntrinsicWidth(): number;
|
44
|
+
/**
|
45
|
+
* Returns the maximum intrinsic width of the paragraph.
|
46
|
+
* The maximum intrinsic width is the width at which the paragraph can layout its content without line breaks,
|
47
|
+
* meaning it's the width of the widest line or the widest word if the widest line is shorter than that.
|
48
|
+
* This width represents the ideal width for the paragraph to display all content in a single line without overflow.
|
49
|
+
* This method requires the layout method to have been called first.
|
50
|
+
* @returns {number} The maximum intrinsic width of the paragraph.
|
51
|
+
*/
|
52
|
+
getMaxIntrinsicWidth(): number;
|
53
|
+
|
54
|
+
/**
|
55
|
+
* Returns the width of the longest line in the paragraph.
|
56
|
+
* This method requires the layout method to have been called first.
|
57
|
+
*/
|
58
|
+
getLongestLine(): number;
|
59
|
+
|
35
60
|
/**
|
36
61
|
* Returns the index of the glyph at the given position. This method requires
|
37
62
|
* the layout method to have been called first.
|
@@ -2,7 +2,7 @@ import type { SkRect } from "../Rect";
|
|
2
2
|
import type { SkPoint } from "../Point";
|
3
3
|
import type { SkRRect } from "../RRect";
|
4
4
|
import type { StrokeJoin, StrokeCap } from "../Paint";
|
5
|
-
import type { SkMatrix } from "../Matrix";
|
5
|
+
import type { InputMatrix, SkMatrix } from "../Matrix";
|
6
6
|
import type { SkJSIInstance } from "../JsiInstance";
|
7
7
|
|
8
8
|
/**
|
@@ -540,7 +540,7 @@ export interface SkPath extends SkJSIInstance<"Path"> {
|
|
540
540
|
/**
|
541
541
|
* Transforms the path by the specified matrix.
|
542
542
|
*/
|
543
|
-
transform(m3:
|
543
|
+
transform(m3: InputMatrix): SkPath;
|
544
544
|
|
545
545
|
/**
|
546
546
|
* Interpolates between Path with point array of equal size.
|
@@ -1,12 +1,12 @@
|
|
1
1
|
import type { CanvasKit, Matrix3x3 } from "canvaskit-wasm";
|
2
2
|
|
3
|
-
import { toMatrix3
|
3
|
+
import { toMatrix3 } from "../types";
|
4
|
+
import type { SkMatrix, InputMatrix, Matrix4 } from "../types";
|
4
5
|
|
5
6
|
import { HostObject } from "./Host";
|
6
7
|
|
7
|
-
const isMatrixHostObject = (
|
8
|
-
obj
|
9
|
-
): obj is SkMatrix => !Array.isArray(obj);
|
8
|
+
const isMatrixHostObject = (obj: InputMatrix): obj is SkMatrix =>
|
9
|
+
!Array.isArray(obj);
|
10
10
|
|
11
11
|
export class JsiSkMatrix
|
12
12
|
extends HostObject<Matrix3x3, "Matrix">
|
@@ -28,7 +28,7 @@ export class JsiSkMatrix
|
|
28
28
|
// Do nothing - the matrix is represenetd by a Float32Array
|
29
29
|
};
|
30
30
|
|
31
|
-
concat(matrix:
|
31
|
+
concat(matrix: InputMatrix) {
|
32
32
|
this.preMultiply(
|
33
33
|
// eslint-disable-next-line no-nested-ternary
|
34
34
|
isMatrixHostObject(matrix)
|
@@ -12,6 +12,17 @@ export class JsiSkParagraph
|
|
12
12
|
constructor(CanvasKit: CanvasKit, ref: Paragraph) {
|
13
13
|
super(CanvasKit, ref, "Paragraph");
|
14
14
|
}
|
15
|
+
getMinIntrinsicWidth(): number {
|
16
|
+
return this.ref.getMinIntrinsicWidth();
|
17
|
+
}
|
18
|
+
|
19
|
+
getMaxIntrinsicWidth(): number {
|
20
|
+
return this.ref.getMaxIntrinsicWidth();
|
21
|
+
}
|
22
|
+
|
23
|
+
getLongestLine(): number {
|
24
|
+
return this.ref.getLongestLine();
|
25
|
+
}
|
15
26
|
|
16
27
|
layout(width: number): void {
|
17
28
|
this.ref.layout(width);
|
@@ -9,7 +9,7 @@ import type {
|
|
9
9
|
import { Host } from "./Host";
|
10
10
|
import { JsiSkParagraphBuilder } from "./JsiSkParagraphBuilder";
|
11
11
|
import { JsiSkParagraphStyle } from "./JsiSkParagraphStyle";
|
12
|
-
import {
|
12
|
+
import { JsiSkTypefaceFontProvider } from "./JsiSkTypefaceFontProvider";
|
13
13
|
|
14
14
|
export class JsiSkParagraphBuilderFactory
|
15
15
|
extends Host
|
@@ -31,11 +31,17 @@ export class JsiSkParagraphBuilderFactory
|
|
31
31
|
"SkTypefaceFontProvider is required on React Native Web."
|
32
32
|
);
|
33
33
|
}
|
34
|
+
const fontCollection = this.CanvasKit.FontCollection.Make();
|
35
|
+
fontCollection.setDefaultFontManager(
|
36
|
+
JsiSkTypefaceFontProvider.fromValue(typefaceProvider)
|
37
|
+
);
|
38
|
+
fontCollection.enableFontFallback();
|
39
|
+
|
34
40
|
return new JsiSkParagraphBuilder(
|
35
41
|
this.CanvasKit,
|
36
|
-
this.CanvasKit.ParagraphBuilder.
|
42
|
+
this.CanvasKit.ParagraphBuilder.MakeFromFontCollection(
|
37
43
|
style,
|
38
|
-
|
44
|
+
fontCollection
|
39
45
|
)
|
40
46
|
);
|
41
47
|
}
|
@@ -4,7 +4,6 @@ import type { PointerEvent } from "react";
|
|
4
4
|
import type { LayoutChangeEvent } from "react-native";
|
5
5
|
|
6
6
|
import type { SkRect, SkCanvas } from "../skia/types";
|
7
|
-
import type { SkiaValue } from "../values";
|
8
7
|
import { JsiSkSurface } from "../skia/web/JsiSkSurface";
|
9
8
|
import { Platform } from "../Platform";
|
10
9
|
|
@@ -148,24 +147,6 @@ export abstract class SkiaBaseWebView<
|
|
148
147
|
this.tick();
|
149
148
|
}
|
150
149
|
|
151
|
-
/**
|
152
|
-
* Registers one or move values as a dependant value of the Skia View. The view will
|
153
|
-
* The view will redraw itself when any of the values change.
|
154
|
-
* @param values Values to register
|
155
|
-
*/
|
156
|
-
public registerValues(_values: SkiaValue<unknown>[]) {
|
157
|
-
// Unsubscribe from dependency values
|
158
|
-
this.unsubscribeAll();
|
159
|
-
// Register redraw dependencies on values
|
160
|
-
_values.forEach((v) => {
|
161
|
-
this._unsubscriptions.push(
|
162
|
-
v.addListener(() => {
|
163
|
-
this.redraw();
|
164
|
-
})
|
165
|
-
);
|
166
|
-
});
|
167
|
-
}
|
168
|
-
|
169
150
|
private handleTouchEvent(evt: PointerEvent, touchType: TouchType) {
|
170
151
|
this._touches.push({
|
171
152
|
id: evt.pointerId,
|
@@ -2,13 +2,12 @@ import React from "react";
|
|
2
2
|
import type { HostComponent } from "react-native";
|
3
3
|
|
4
4
|
import type { SkRect } from "../skia/types";
|
5
|
-
import type { SkiaValue } from "../values";
|
6
5
|
import { Platform } from "../Platform";
|
7
6
|
import SkiaDomViewNativeComponent from "../specs/SkiaDomViewNativeComponent";
|
8
7
|
|
9
8
|
import { SkiaViewApi } from "./api";
|
10
|
-
import { SkiaViewNativeId } from "./SkiaView";
|
11
9
|
import type { SkiaDomViewProps } from "./types";
|
10
|
+
import { SkiaViewNativeId } from "./SkiaViewNativeId";
|
12
11
|
|
13
12
|
const NativeSkiaDomView: HostComponent<SkiaDomViewProps> =
|
14
13
|
Platform.OS !== "web"
|
@@ -75,16 +74,6 @@ export class SkiaDomView extends React.Component<SkiaDomViewProps> {
|
|
75
74
|
SkiaViewApi.requestRedraw(this._nativeId);
|
76
75
|
}
|
77
76
|
|
78
|
-
/**
|
79
|
-
* Registers one or move values as a dependant value of the Skia View. The view will
|
80
|
-
* The view will redraw itself when any of the values change.
|
81
|
-
* @param values Values to register
|
82
|
-
*/
|
83
|
-
public registerValues(values: SkiaValue<unknown>[]): () => void {
|
84
|
-
assertSkiaViewApi();
|
85
|
-
return SkiaViewApi.registerValuesInView(this._nativeId, values);
|
86
|
-
}
|
87
|
-
|
88
77
|
/**
|
89
78
|
* Clear up the dom node when unmounting to release resources.
|
90
79
|
*/
|
@@ -112,7 +101,6 @@ const assertSkiaViewApi = () => {
|
|
112
101
|
SkiaViewApi === null ||
|
113
102
|
SkiaViewApi.setJsiProperty === null ||
|
114
103
|
SkiaViewApi.callJsiMethod === null ||
|
115
|
-
SkiaViewApi.registerValuesInView === null ||
|
116
104
|
SkiaViewApi.requestRedraw === null ||
|
117
105
|
SkiaViewApi.makeImageSnapshot === null
|
118
106
|
) {
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import { Skia } from "../skia";
|
2
2
|
import type { SkCanvas } from "../skia/types";
|
3
3
|
import { JsiDrawingContext } from "../dom/types/DrawingContext";
|
4
|
-
import { isValue } from "../renderer/processors/Animations/Animations";
|
5
4
|
|
6
5
|
import { SkiaBaseWebView } from "./SkiaBaseWebView";
|
7
6
|
import type { SkiaDomViewProps, TouchInfo } from "./types";
|
@@ -17,11 +16,7 @@ export class SkiaDomView extends SkiaBaseWebView<SkiaDomViewProps> {
|
|
17
16
|
}
|
18
17
|
if (this.props.onSize) {
|
19
18
|
const { width, height } = this.getSize();
|
20
|
-
|
21
|
-
this.props.onSize.current = { width, height };
|
22
|
-
} else {
|
23
|
-
this.props.onSize.value = { width, height };
|
24
|
-
}
|
19
|
+
this.props.onSize.value = { width, height };
|
25
20
|
}
|
26
21
|
if (this.props.root) {
|
27
22
|
const ctx = new JsiDrawingContext(Skia, canvas);
|
@@ -1,12 +1,11 @@
|
|
1
1
|
import React from "react";
|
2
2
|
|
3
3
|
import type { SkRect } from "../skia/types";
|
4
|
-
import type { SkiaValue } from "../values";
|
5
4
|
import SkiaPictureViewNativeComponent from "../specs/SkiaPictureViewNativeComponent";
|
6
5
|
|
7
6
|
import { SkiaViewApi } from "./api";
|
8
|
-
import { SkiaViewNativeId } from "./SkiaView";
|
9
7
|
import type { SkiaPictureViewProps } from "./types";
|
8
|
+
import { SkiaViewNativeId } from "./SkiaViewNativeId";
|
10
9
|
|
11
10
|
const NativeSkiaPictureView = SkiaPictureViewNativeComponent;
|
12
11
|
|
@@ -61,16 +60,6 @@ export class SkiaPictureView extends React.Component<SkiaPictureViewProps> {
|
|
61
60
|
SkiaViewApi.requestRedraw(this._nativeId);
|
62
61
|
}
|
63
62
|
|
64
|
-
/**
|
65
|
-
* Registers one or move values as a dependant value of the Skia View. The view will
|
66
|
-
* The view will redraw itself when any of the values change.
|
67
|
-
* @param values Values to register
|
68
|
-
*/
|
69
|
-
public registerValues(values: SkiaValue<unknown>[]): () => void {
|
70
|
-
assertSkiaViewApi();
|
71
|
-
return SkiaViewApi.registerValuesInView(this._nativeId, values);
|
72
|
-
}
|
73
|
-
|
74
63
|
render() {
|
75
64
|
const { mode, debug = false, ...viewProps } = this.props;
|
76
65
|
return (
|
@@ -90,7 +79,6 @@ const assertSkiaViewApi = () => {
|
|
90
79
|
SkiaViewApi === null ||
|
91
80
|
SkiaViewApi.setJsiProperty === null ||
|
92
81
|
SkiaViewApi.callJsiMethod === null ||
|
93
|
-
SkiaViewApi.registerValuesInView === null ||
|
94
82
|
SkiaViewApi.requestRedraw === null ||
|
95
83
|
SkiaViewApi.makeImageSnapshot === null
|
96
84
|
) {
|
@@ -0,0 +1 @@
|
|
1
|
+
export const SkiaViewNativeId = { current: 1000 };
|
package/src/views/index.ts
CHANGED
package/src/views/types.ts
CHANGED
@@ -1,14 +1,7 @@
|
|
1
1
|
import type { ViewProps } from "react-native";
|
2
2
|
|
3
3
|
import type { GroupProps, RenderNode } from "../dom/types";
|
4
|
-
import type {
|
5
|
-
SkCanvas,
|
6
|
-
SkImage,
|
7
|
-
SkPicture,
|
8
|
-
SkRect,
|
9
|
-
SkSize,
|
10
|
-
} from "../skia/types";
|
11
|
-
import type { SkiaMutableValue, SkiaValue } from "../values";
|
4
|
+
import type { SkImage, SkPicture, SkRect, SkSize } from "../skia/types";
|
12
5
|
import type { SharedValueType } from "../renderer/processors/Animations/Animations";
|
13
6
|
|
14
7
|
export type DrawMode = "continuous" | "default";
|
@@ -55,8 +48,6 @@ export type TouchHandlers = {
|
|
55
48
|
|
56
49
|
export type TouchHandler = (touchInfo: Array<Array<TouchInfo>>) => void;
|
57
50
|
|
58
|
-
export type RNSkiaDrawCallback = (canvas: SkCanvas, info: DrawingInfo) => void;
|
59
|
-
|
60
51
|
/**
|
61
52
|
* Listener interface for value changes
|
62
53
|
*/
|
@@ -72,10 +63,6 @@ export interface ISkiaViewApi {
|
|
72
63
|
name: string,
|
73
64
|
...args: T
|
74
65
|
) => void;
|
75
|
-
registerValuesInView: (
|
76
|
-
nativeId: number,
|
77
|
-
values: SkiaValue<unknown>[]
|
78
|
-
) => () => void;
|
79
66
|
requestRedraw: (nativeId: number) => void;
|
80
67
|
makeImageSnapshot: (nativeId: number, rect?: SkRect) => SkImage;
|
81
68
|
}
|
@@ -98,18 +85,7 @@ export interface SkiaBaseViewProps extends ViewProps {
|
|
98
85
|
* Pass an animated value to the onSize property to get updates when
|
99
86
|
* the Skia view is resized.
|
100
87
|
*/
|
101
|
-
onSize?:
|
102
|
-
}
|
103
|
-
|
104
|
-
export interface SkiaDrawViewProps extends SkiaBaseViewProps {
|
105
|
-
/**
|
106
|
-
* Draw callback. Will be called whenever the view is invalidated and
|
107
|
-
* needs to redraw. This is either caused by a change in a react
|
108
|
-
* property, a touch event, or a call to redraw. If the view is in
|
109
|
-
* continuous mode the callback will be called 60 frames per second
|
110
|
-
* by the native view.
|
111
|
-
*/
|
112
|
-
onDraw?: RNSkiaDrawCallback;
|
88
|
+
onSize?: SharedValueType<SkSize>;
|
113
89
|
}
|
114
90
|
|
115
91
|
export interface SkiaPictureViewProps extends SkiaBaseViewProps {
|
@@ -1,44 +0,0 @@
|
|
1
|
-
package com.shopify.reactnative.skia;
|
2
|
-
|
3
|
-
import android.content.Context;
|
4
|
-
|
5
|
-
import com.facebook.jni.HybridData;
|
6
|
-
import com.facebook.jni.annotations.DoNotStrip;
|
7
|
-
import com.facebook.react.bridge.ReactContext;
|
8
|
-
|
9
|
-
public class SkiaDrawView extends SkiaBaseView {
|
10
|
-
@DoNotStrip
|
11
|
-
private HybridData mHybridData;
|
12
|
-
|
13
|
-
public SkiaDrawView(Context context) {
|
14
|
-
super(context, false);
|
15
|
-
RNSkiaModule skiaModule = ((ReactContext) context).getNativeModule(RNSkiaModule.class);
|
16
|
-
mHybridData = initHybrid(skiaModule.getSkiaManager());
|
17
|
-
}
|
18
|
-
|
19
|
-
@Override
|
20
|
-
protected void finalize() throws Throwable {
|
21
|
-
super.finalize();
|
22
|
-
mHybridData.resetNative();
|
23
|
-
}
|
24
|
-
|
25
|
-
private native HybridData initHybrid(SkiaManager skiaManager);
|
26
|
-
|
27
|
-
protected native void surfaceAvailable(Object surface, int width, int height);
|
28
|
-
|
29
|
-
protected native void surfaceSizeChanged(int width, int height);
|
30
|
-
|
31
|
-
protected native void surfaceDestroyed();
|
32
|
-
|
33
|
-
protected native void setBgColor(int color);
|
34
|
-
|
35
|
-
protected native void setMode(String mode);
|
36
|
-
|
37
|
-
protected native void setDebugMode(boolean show);
|
38
|
-
|
39
|
-
protected native void updateTouchPoints(double[] points);
|
40
|
-
|
41
|
-
protected native void registerView(int nativeId);
|
42
|
-
|
43
|
-
protected native void unregisterView();
|
44
|
-
}
|