@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
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["JsiSkParagraphBuilderFactory","Host","constructor","CanvasKit","Make","paragraphStyle","typefaceProvider","style","ParagraphStyle","JsiSkParagraphStyle","toParagraphStyle","undefined","Error","
|
1
|
+
{"version":3,"names":["JsiSkParagraphBuilderFactory","Host","constructor","CanvasKit","Make","paragraphStyle","typefaceProvider","style","ParagraphStyle","JsiSkParagraphStyle","toParagraphStyle","undefined","Error","fontCollection","FontCollection","setDefaultFontManager","JsiSkTypefaceFontProvider","fromValue","enableFontFallback","JsiSkParagraphBuilder","ParagraphBuilder","MakeFromFontCollection"],"sources":["JsiSkParagraphBuilderFactory.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type {\n ParagraphBuilderFactory,\n SkParagraphStyle,\n SkTypefaceFontProvider,\n} from \"../types\";\n\nimport { Host } from \"./Host\";\nimport { JsiSkParagraphBuilder } from \"./JsiSkParagraphBuilder\";\nimport { JsiSkParagraphStyle } from \"./JsiSkParagraphStyle\";\nimport { JsiSkTypefaceFontProvider } from \"./JsiSkTypefaceFontProvider\";\n\nexport class JsiSkParagraphBuilderFactory\n extends Host\n implements ParagraphBuilderFactory\n{\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n Make(\n paragraphStyle: SkParagraphStyle,\n typefaceProvider?: SkTypefaceFontProvider\n ) {\n const style = new this.CanvasKit.ParagraphStyle(\n JsiSkParagraphStyle.toParagraphStyle(this.CanvasKit, paragraphStyle ?? {})\n );\n if (typefaceProvider === undefined) {\n throw new Error(\n \"SkTypefaceFontProvider is required on React Native Web.\"\n );\n }\n const fontCollection = this.CanvasKit.FontCollection.Make();\n fontCollection.setDefaultFontManager(\n JsiSkTypefaceFontProvider.fromValue(typefaceProvider)\n );\n fontCollection.enableFontFallback();\n\n return new JsiSkParagraphBuilder(\n this.CanvasKit,\n this.CanvasKit.ParagraphBuilder.MakeFromFontCollection(\n style,\n fontCollection\n )\n );\n }\n}\n"],"mappings":";;;;;;;AAQA;;AACA;;AACA;;AACA;;AAEO,MAAMA,4BAAN,SACGC,UADH,CAGP;EACEC,WAAW,CAACC,SAAD,EAAuB;IAChC,MAAMA,SAAN;EACD;;EAEDC,IAAI,CACFC,cADE,EAEFC,gBAFE,EAGF;IACA,MAAMC,KAAK,GAAG,IAAI,KAAKJ,SAAL,CAAeK,cAAnB,CACZC,wCAAA,CAAoBC,gBAApB,CAAqC,KAAKP,SAA1C,EAAqDE,cAAc,IAAI,EAAvE,CADY,CAAd;;IAGA,IAAIC,gBAAgB,KAAKK,SAAzB,EAAoC;MAClC,MAAM,IAAIC,KAAJ,CACJ,yDADI,CAAN;IAGD;;IACD,MAAMC,cAAc,GAAG,KAAKV,SAAL,CAAeW,cAAf,CAA8BV,IAA9B,EAAvB;IACAS,cAAc,CAACE,qBAAf,CACEC,oDAAA,CAA0BC,SAA1B,CAAoCX,gBAApC,CADF;IAGAO,cAAc,CAACK,kBAAf;IAEA,OAAO,IAAIC,4CAAJ,CACL,KAAKhB,SADA,EAEL,KAAKA,SAAL,CAAeiB,gBAAf,CAAgCC,sBAAhC,CACEd,KADF,EAEEM,cAFF,CAFK,CAAP;EAOD;;AA9BH"}
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import React from "react";
|
2
2
|
import type { PointerEvent } from "react";
|
3
3
|
import type { SkRect, SkCanvas } from "../skia/types";
|
4
|
-
import type { SkiaValue } from "../values";
|
5
4
|
import type { DrawMode, SkiaBaseViewProps, TouchInfo } from "./types";
|
6
5
|
import { TouchType } from "./types";
|
7
6
|
export declare abstract class SkiaBaseWebView<TProps extends SkiaBaseViewProps> extends React.Component<TProps> {
|
@@ -50,12 +49,6 @@ export declare abstract class SkiaBaseWebView<TProps extends SkiaBaseViewProps>
|
|
50
49
|
* @param mode Drawing mode to use.
|
51
50
|
*/
|
52
51
|
setDrawMode(mode: DrawMode): void;
|
53
|
-
/**
|
54
|
-
* Registers one or move values as a dependant value of the Skia View. The view will
|
55
|
-
* The view will redraw itself when any of the values change.
|
56
|
-
* @param values Values to register
|
57
|
-
*/
|
58
|
-
registerValues(_values: SkiaValue<unknown>[]): void;
|
59
52
|
private handleTouchEvent;
|
60
53
|
createTouchHandler(touchType: TouchType): (evt: PointerEvent) => void;
|
61
54
|
private onStart;
|
@@ -186,23 +186,6 @@ class SkiaBaseWebView extends _react.default.Component {
|
|
186
186
|
this._mode = mode;
|
187
187
|
this.tick();
|
188
188
|
}
|
189
|
-
/**
|
190
|
-
* Registers one or move values as a dependant value of the Skia View. The view will
|
191
|
-
* The view will redraw itself when any of the values change.
|
192
|
-
* @param values Values to register
|
193
|
-
*/
|
194
|
-
|
195
|
-
|
196
|
-
registerValues(_values) {
|
197
|
-
// Unsubscribe from dependency values
|
198
|
-
this.unsubscribeAll(); // Register redraw dependencies on values
|
199
|
-
|
200
|
-
_values.forEach(v => {
|
201
|
-
this._unsubscriptions.push(v.addListener(() => {
|
202
|
-
this.redraw();
|
203
|
-
}));
|
204
|
-
});
|
205
|
-
}
|
206
189
|
|
207
190
|
handleTouchEvent(evt, touchType) {
|
208
191
|
this._touches.push({
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["pd","Platform","PixelRatio","SkiaBaseWebView","React","Component","constructor","props","createRef","createTouchHandler","TouchType","Start","Active","Cancelled","End","onLayoutEvent","bind","_mode","mode","unsubscribeAll","_unsubscriptions","forEach","u","evt","CanvasKit","global","canvas","_canvasRef","current","width","clientWidth","height","clientHeight","surface","MakeWebGLCanvasSurface","Error","_surface","JsiSkSurface","_canvas","getCanvas","redraw","onLayout","getSize","componentDidMount","tick","componentDidUpdate","componentWillUnmount","cancelAnimationFrame","requestId","getContext","getExtension","loseContext","makeImageSnapshot","rect","clear","TRANSPARENT","renderInCanvas","ref","flush","_redrawRequests","touches","_touches","Float32Array","of","save","scale","restore","requestAnimationFrame","setDrawMode","registerValues","_values","v","push","addListener","handleTouchEvent","touchType","id","pointerId","x","clientX","currentTarget","getClientRects","left","y","clientY","top","force","pressure","type","timestamp","Date","now","render","debug","viewProps","display","flex","onStart","onActive","onEnd","onCancel"],"sources":["SkiaBaseWebView.tsx"],"sourcesContent":["/* global HTMLCanvasElement */\nimport React from \"react\";\nimport type { PointerEvent } from \"react\";\nimport type { LayoutChangeEvent } from \"react-native\";\n\nimport type { SkRect, SkCanvas } from \"../skia/types\";\nimport type { SkiaValue } from \"../values\";\nimport { JsiSkSurface } from \"../skia/web/JsiSkSurface\";\nimport { Platform } from \"../Platform\";\n\nimport type { DrawMode, SkiaBaseViewProps, TouchInfo } from \"./types\";\nimport { TouchType } from \"./types\";\n\nconst pd = Platform.PixelRatio;\n\nexport abstract class SkiaBaseWebView<\n TProps extends SkiaBaseViewProps\n> extends React.Component<TProps> {\n constructor(props: TProps) {\n super(props);\n this._mode = props.mode ?? \"default\";\n }\n\n private _surface: JsiSkSurface | null = null;\n private _unsubscriptions: Array<() => void> = [];\n private _touches: Array<TouchInfo> = [];\n private _canvas: SkCanvas | null = null;\n private _canvasRef = React.createRef<HTMLCanvasElement>();\n private _mode: DrawMode;\n private _redrawRequests = 0;\n private requestId = 0;\n\n protected width = 0;\n protected height = 0;\n\n private unsubscribeAll() {\n this._unsubscriptions.forEach((u) => u());\n this._unsubscriptions = [];\n }\n\n private onLayoutEvent(evt: LayoutChangeEvent) {\n const { CanvasKit } = global;\n // Reset canvas / surface on layout change\n const canvas = this._canvasRef.current;\n if (canvas) {\n this.width = canvas.clientWidth;\n this.height = canvas.clientHeight;\n canvas.width = this.width * pd;\n canvas.height = this.height * pd;\n const surface = CanvasKit.MakeWebGLCanvasSurface(canvas);\n if (!surface) {\n throw new Error(\"Could not create surface\");\n }\n this._surface = new JsiSkSurface(CanvasKit, surface);\n this._canvas = this._surface.getCanvas();\n this.redraw();\n }\n // Call onLayout callback if it exists\n if (this.props.onLayout) {\n this.props.onLayout(evt);\n }\n }\n\n protected getSize() {\n return { width: this.width, height: this.height };\n }\n\n componentDidMount() {\n // Start render loop\n this.tick();\n }\n\n componentDidUpdate() {\n this.redraw();\n }\n\n componentWillUnmount() {\n this.unsubscribeAll();\n cancelAnimationFrame(this.requestId);\n // eslint-disable-next-line max-len\n // https://stackoverflow.com/questions/23598471/how-do-i-clean-up-and-unload-a-webgl-canvas-context-from-gpu-after-use\n // https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_lose_context\n // We delete the context, only if the context has been intialized\n if (this._surface) {\n this._canvasRef.current\n ?.getContext(\"webgl2\")\n ?.getExtension(\"WEBGL_lose_context\")\n ?.loseContext();\n }\n }\n\n /**\n * Creates a snapshot from the canvas in the surface\n * @param rect Rect to use as bounds. Optional.\n * @returns An Image object.\n */\n public makeImageSnapshot(rect?: SkRect) {\n this._canvas!.clear(CanvasKit.TRANSPARENT);\n this.renderInCanvas(this._canvas!, []);\n this._surface?.ref.flush();\n return this._surface?.makeImageSnapshot(rect);\n }\n\n /**\n * Override to render\n */\n protected abstract renderInCanvas(\n canvas: SkCanvas,\n touches: TouchInfo[]\n ): void;\n\n /**\n * Sends a redraw request to the native SkiaView.\n */\n private tick() {\n if (this._mode === \"continuous\" || this._redrawRequests > 0) {\n this._redrawRequests = 0;\n if (this._canvas) {\n const touches = [...this._touches];\n this._touches = [];\n const canvas = this._canvas!;\n canvas.clear(Float32Array.of(0, 0, 0, 0));\n canvas.save();\n canvas.scale(pd, pd);\n this.renderInCanvas(canvas, touches);\n canvas.restore();\n this._surface?.ref.flush();\n }\n }\n this.requestId = requestAnimationFrame(this.tick.bind(this));\n }\n\n public redraw() {\n this._redrawRequests++;\n }\n\n /**\n * Updates the drawing mode for the skia view. This is the same\n * as declaratively setting the mode property on the SkiaView.\n * There are two drawing modes, \"continuous\" and \"default\",\n * where the continuous mode will continuously redraw the view and\n * the default mode will only redraw when any of the regular react\n * properties are changed like size and margins.\n * @param mode Drawing mode to use.\n */\n public setDrawMode(mode: DrawMode) {\n this._mode = mode;\n this.tick();\n }\n\n /**\n * Registers one or move values as a dependant value of the Skia View. The view will\n * The view will redraw itself when any of the values change.\n * @param values Values to register\n */\n public registerValues(_values: SkiaValue<unknown>[]) {\n // Unsubscribe from dependency values\n this.unsubscribeAll();\n // Register redraw dependencies on values\n _values.forEach((v) => {\n this._unsubscriptions.push(\n v.addListener(() => {\n this.redraw();\n })\n );\n });\n }\n\n private handleTouchEvent(evt: PointerEvent, touchType: TouchType) {\n this._touches.push({\n id: evt.pointerId,\n x: evt.clientX - evt.currentTarget.getClientRects()[0].left,\n y: evt.clientY - evt.currentTarget.getClientRects()[0].top,\n force: evt.pressure,\n type: touchType,\n timestamp: Date.now(),\n });\n this.redraw();\n }\n\n createTouchHandler(touchType: TouchType) {\n return (evt: PointerEvent) => this.handleTouchEvent(evt, touchType);\n }\n\n private onStart = this.createTouchHandler(TouchType.Start);\n private onActive = this.createTouchHandler(TouchType.Active);\n private onCancel = this.createTouchHandler(TouchType.Cancelled);\n private onEnd = this.createTouchHandler(TouchType.End);\n private onLayout = this.onLayoutEvent.bind(this);\n\n render() {\n const { mode, debug = false, ...viewProps } = this.props;\n return (\n <Platform.View {...viewProps} onLayout={this.onLayout}>\n <canvas\n ref={this._canvasRef}\n style={{ display: \"flex\", flex: 1 }}\n onPointerDown={this.onStart}\n onPointerMove={this.onActive}\n onPointerUp={this.onEnd}\n onPointerCancel={this.onCancel}\n onPointerLeave={this.onEnd}\n onPointerOut={this.onEnd}\n />\n </Platform.View>\n );\n }\n}\n"],"mappings":";;;;;;;AACA;;AAMA;;AACA;;AAGA;;;;;;kNAXA;;AAaA,MAAMA,EAAE,GAAGC,kBAAA,CAASC,UAApB;;AAEO,MAAeC,eAAf,SAEGC,cAAA,CAAMC,SAFT,CAE2B;EAChCC,WAAW,CAACC,KAAD,EAAgB;IACzB,MAAMA,KAAN;;IADyB,kCAKa,IALb;;IAAA,0CAMmB,EANnB;;IAAA,kCAOU,EAPV;;IAAA,iCAQQ,IARR;;IAAA,iDASNH,cAAA,CAAMI,SAAN,EATM;;IAAA;;IAAA,yCAWD,CAXC;;IAAA,mCAYP,CAZO;;IAAA,+BAcT,CAdS;;IAAA,gCAeR,CAfQ;;IAAA,iCAsKT,KAAKC,kBAAL,CAAwBC,gBAAA,CAAUC,KAAlC,CAtKS;;IAAA,kCAuKR,KAAKF,kBAAL,CAAwBC,gBAAA,CAAUE,MAAlC,CAvKQ;;IAAA,kCAwKR,KAAKH,kBAAL,CAAwBC,gBAAA,CAAUG,SAAlC,CAxKQ;;IAAA,+BAyKX,KAAKJ,kBAAL,CAAwBC,gBAAA,CAAUI,GAAlC,CAzKW;;IAAA,kCA0KR,KAAKC,aAAL,CAAmBC,IAAnB,CAAwB,IAAxB,CA1KQ;;IAEzB,KAAKC,KAAL,GAAaV,KAAK,CAACW,IAAN,IAAc,SAA3B;EACD;;EAcOC,cAAc,GAAG;IACvB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AAKvF,KAAnD;IACA,oBACE,6BAAC,kBAAD,CAAU,IAAV,eAAmBuF,SAAnB;MAA8B,QAAQ,EAAE,KAAKrD;IAA7C,iBACE;MACE,GAAG,EAAE,KAAKd,UADZ;MAEE,KAAK,EAAE;QAAEoE,OAAO,EAAE,MAAX;QAAmBC,IAAI,EAAE;MAAzB,CAFT;MAGE,aAAa,EAAE,KAAKC,OAHtB;MAIE,aAAa,EAAE,KAAKC,QAJtB;MAKE,WAAW,EAAE,KAAKC,KALpB;MAME,eAAe,EAAE,KAAKC,QANxB;MAOE,cAAc,EAAE,KAAKD,KAPvB;MAQE,YAAY,EAAE,KAAKA;IARrB,EADF,CADF;EAcD;;AA7L+B"}
|
1
|
+
{"version":3,"names":["pd","Platform","PixelRatio","SkiaBaseWebView","React","Component","constructor","props","createRef","createTouchHandler","TouchType","Start","Active","Cancelled","End","onLayoutEvent","bind","_mode","mode","unsubscribeAll","_unsubscriptions","forEach","u","evt","CanvasKit","global","canvas","_canvasRef","current","width","clientWidth","height","clientHeight","surface","MakeWebGLCanvasSurface","Error","_surface","JsiSkSurface","_canvas","getCanvas","redraw","onLayout","getSize","componentDidMount","tick","componentDidUpdate","componentWillUnmount","cancelAnimationFrame","requestId","getContext","getExtension","loseContext","makeImageSnapshot","rect","clear","TRANSPARENT","renderInCanvas","ref","flush","_redrawRequests","touches","_touches","Float32Array","of","save","scale","restore","requestAnimationFrame","setDrawMode","handleTouchEvent","touchType","push","id","pointerId","x","clientX","currentTarget","getClientRects","left","y","clientY","top","force","pressure","type","timestamp","Date","now","render","debug","viewProps","display","flex","onStart","onActive","onEnd","onCancel"],"sources":["SkiaBaseWebView.tsx"],"sourcesContent":["/* global HTMLCanvasElement */\nimport React from \"react\";\nimport type { PointerEvent } from \"react\";\nimport type { LayoutChangeEvent } from \"react-native\";\n\nimport type { SkRect, SkCanvas } from \"../skia/types\";\nimport { JsiSkSurface } from \"../skia/web/JsiSkSurface\";\nimport { Platform } from \"../Platform\";\n\nimport type { DrawMode, SkiaBaseViewProps, TouchInfo } from \"./types\";\nimport { TouchType } from \"./types\";\n\nconst pd = Platform.PixelRatio;\n\nexport abstract class SkiaBaseWebView<\n TProps extends SkiaBaseViewProps\n> extends React.Component<TProps> {\n constructor(props: TProps) {\n super(props);\n this._mode = props.mode ?? \"default\";\n }\n\n private _surface: JsiSkSurface | null = null;\n private _unsubscriptions: Array<() => void> = [];\n private _touches: Array<TouchInfo> = [];\n private _canvas: SkCanvas | null = null;\n private _canvasRef = React.createRef<HTMLCanvasElement>();\n private _mode: DrawMode;\n private _redrawRequests = 0;\n private requestId = 0;\n\n protected width = 0;\n protected height = 0;\n\n private unsubscribeAll() {\n this._unsubscriptions.forEach((u) => u());\n this._unsubscriptions = [];\n }\n\n private onLayoutEvent(evt: LayoutChangeEvent) {\n const { CanvasKit } = global;\n // Reset canvas / surface on layout change\n const canvas = this._canvasRef.current;\n if (canvas) {\n this.width = canvas.clientWidth;\n this.height = canvas.clientHeight;\n canvas.width = this.width * pd;\n canvas.height = this.height * pd;\n const surface = CanvasKit.MakeWebGLCanvasSurface(canvas);\n if (!surface) {\n throw new Error(\"Could not create surface\");\n }\n this._surface = new JsiSkSurface(CanvasKit, surface);\n this._canvas = this._surface.getCanvas();\n this.redraw();\n }\n // Call onLayout callback if it exists\n if (this.props.onLayout) {\n this.props.onLayout(evt);\n }\n }\n\n protected getSize() {\n return { width: this.width, height: this.height };\n }\n\n componentDidMount() {\n // Start render loop\n this.tick();\n }\n\n componentDidUpdate() {\n this.redraw();\n }\n\n componentWillUnmount() {\n this.unsubscribeAll();\n cancelAnimationFrame(this.requestId);\n // eslint-disable-next-line max-len\n // https://stackoverflow.com/questions/23598471/how-do-i-clean-up-and-unload-a-webgl-canvas-context-from-gpu-after-use\n // https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_lose_context\n // We delete the context, only if the context has been intialized\n if (this._surface) {\n this._canvasRef.current\n ?.getContext(\"webgl2\")\n ?.getExtension(\"WEBGL_lose_context\")\n ?.loseContext();\n }\n }\n\n /**\n * Creates a snapshot from the canvas in the surface\n * @param rect Rect to use as bounds. Optional.\n * @returns An Image object.\n */\n public makeImageSnapshot(rect?: SkRect) {\n this._canvas!.clear(CanvasKit.TRANSPARENT);\n this.renderInCanvas(this._canvas!, []);\n this._surface?.ref.flush();\n return this._surface?.makeImageSnapshot(rect);\n }\n\n /**\n * Override to render\n */\n protected abstract renderInCanvas(\n canvas: SkCanvas,\n touches: TouchInfo[]\n ): void;\n\n /**\n * Sends a redraw request to the native SkiaView.\n */\n private tick() {\n if (this._mode === \"continuous\" || this._redrawRequests > 0) {\n this._redrawRequests = 0;\n if (this._canvas) {\n const touches = [...this._touches];\n this._touches = [];\n const canvas = this._canvas!;\n canvas.clear(Float32Array.of(0, 0, 0, 0));\n canvas.save();\n canvas.scale(pd, pd);\n this.renderInCanvas(canvas, touches);\n canvas.restore();\n this._surface?.ref.flush();\n }\n }\n this.requestId = requestAnimationFrame(this.tick.bind(this));\n }\n\n public redraw() {\n this._redrawRequests++;\n }\n\n /**\n * Updates the drawing mode for the skia view. This is the same\n * as declaratively setting the mode property on the SkiaView.\n * There are two drawing modes, \"continuous\" and \"default\",\n * where the continuous mode will continuously redraw the view and\n * the default mode will only redraw when any of the regular react\n * properties are changed like size and margins.\n * @param mode Drawing mode to use.\n */\n public setDrawMode(mode: DrawMode) {\n this._mode = mode;\n this.tick();\n }\n\n private handleTouchEvent(evt: PointerEvent, touchType: TouchType) {\n this._touches.push({\n id: evt.pointerId,\n x: evt.clientX - evt.currentTarget.getClientRects()[0].left,\n y: evt.clientY - evt.currentTarget.getClientRects()[0].top,\n force: evt.pressure,\n type: touchType,\n timestamp: Date.now(),\n });\n this.redraw();\n }\n\n createTouchHandler(touchType: TouchType) {\n return (evt: PointerEvent) => this.handleTouchEvent(evt, touchType);\n }\n\n private onStart = this.createTouchHandler(TouchType.Start);\n private onActive = this.createTouchHandler(TouchType.Active);\n private onCancel = this.createTouchHandler(TouchType.Cancelled);\n private onEnd = this.createTouchHandler(TouchType.End);\n private onLayout = this.onLayoutEvent.bind(this);\n\n render() {\n const { mode, debug = false, ...viewProps } = this.props;\n return (\n <Platform.View {...viewProps} onLayout={this.onLayout}>\n <canvas\n ref={this._canvasRef}\n style={{ display: \"flex\", flex: 1 }}\n onPointerDown={this.onStart}\n onPointerMove={this.onActive}\n onPointerUp={this.onEnd}\n onPointerCancel={this.onCancel}\n onPointerLeave={this.onEnd}\n onPointerOut={this.onEnd}\n />\n </Platform.View>\n );\n }\n}\n"],"mappings":";;;;;;;AACA;;AAKA;;AACA;;AAGA;;;;;;kNAVA;;AAYA,MAAMA,EAAE,GAAGC,kBAAA,CAASC,UAApB;;AAEO,MAAeC,eAAf,SAEGC,cAAA,CAAMC,SAFT,CAE2B;EAChCC,WAAW,CAACC,KAAD,EAAgB;IACzB,MAAMA,KAAN;;IADyB,kCAKa,IALb;;IAAA,0CAMmB,EANnB;;IAAA,kCAOU,EAPV;;IAAA,iCAQQ,IARR;;IAAA,iDASNH,cAAA,CAAMI,SAAN,EATM;;IAAA;;IAAA,yCAWD,CAXC;;IAAA,mCAYP,CAZO;;IAAA,+BAcT,CAdS;;IAAA,gCAeR,CAfQ;;IAAA,iCAoJT,KAAKC,kBAAL,CAAwBC,gBAAA,CAAUC,KAAlC,CApJS;;IAAA,kCAqJR,KAAKF,kBAAL,CAAwBC,gBAAA,CAAUE,MAAlC,CArJQ;;IAAA,kCAsJR,KAAKH,kBAAL,CAAwBC,gBAAA,CAAUG,SAAlC,CAtJQ;;IAAA,+BAuJX,KAAKJ,kBAAL,CAAwBC,gBAAA,CAAUI,GAAlC,CAvJW;;IAAA,kCAwJR,KAAKC,aAAL,CAAmBC,IAAnB,CAAwB,IAAxB,CAxJQ;;IAEzB,KAAKC,KAAL,GAAaV,KAAK,CAACW,IAAN,IAAc,SAA3B;EACD;;EAcOC,cAAc,GAAG;IACvB,KAAKC,gBAAL,CAAsBC,OAAtB,CAA+BC,CAAD,IAAOA,CAAC,EAA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KC,QANxB;MAOE,cAAc,EAAE,KAAKD,KAPvB;MAQE,YAAY,EAAE,KAAKA;IARrB,EADF,CADF;EAcD;;AA3K+B"}
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import React from "react";
|
2
2
|
import type { SkRect } from "../skia/types";
|
3
|
-
import type { SkiaValue } from "../values";
|
4
3
|
import type { SkiaDomViewProps } from "./types";
|
5
4
|
export declare class SkiaDomView extends React.Component<SkiaDomViewProps> {
|
6
5
|
constructor(props: SkiaDomViewProps);
|
@@ -17,12 +16,6 @@ export declare class SkiaDomView extends React.Component<SkiaDomViewProps> {
|
|
17
16
|
* Sends a redraw request to the native SkiaView.
|
18
17
|
*/
|
19
18
|
redraw(): void;
|
20
|
-
/**
|
21
|
-
* Registers one or move values as a dependant value of the Skia View. The view will
|
22
|
-
* The view will redraw itself when any of the values change.
|
23
|
-
* @param values Values to register
|
24
|
-
*/
|
25
|
-
registerValues(values: SkiaValue<unknown>[]): () => void;
|
26
19
|
/**
|
27
20
|
* Clear up the dom node when unmounting to release resources.
|
28
21
|
*/
|
@@ -13,7 +13,7 @@ var _SkiaDomViewNativeComponent = _interopRequireDefault(require("../specs/SkiaD
|
|
13
13
|
|
14
14
|
var _api = require("./api");
|
15
15
|
|
16
|
-
var
|
16
|
+
var _SkiaViewNativeId = require("./SkiaViewNativeId");
|
17
17
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
19
19
|
|
@@ -30,7 +30,7 @@ class SkiaDomView extends _react.default.Component {
|
|
30
30
|
|
31
31
|
_defineProperty(this, "_nativeId", void 0);
|
32
32
|
|
33
|
-
this._nativeId =
|
33
|
+
this._nativeId = _SkiaViewNativeId.SkiaViewNativeId.current++;
|
34
34
|
const {
|
35
35
|
root,
|
36
36
|
onTouch,
|
@@ -106,17 +106,6 @@ class SkiaDomView extends _react.default.Component {
|
|
106
106
|
|
107
107
|
_api.SkiaViewApi.requestRedraw(this._nativeId);
|
108
108
|
}
|
109
|
-
/**
|
110
|
-
* Registers one or move values as a dependant value of the Skia View. The view will
|
111
|
-
* The view will redraw itself when any of the values change.
|
112
|
-
* @param values Values to register
|
113
|
-
*/
|
114
|
-
|
115
|
-
|
116
|
-
registerValues(values) {
|
117
|
-
assertSkiaViewApi();
|
118
|
-
return _api.SkiaViewApi.registerValuesInView(this._nativeId, values);
|
119
|
-
}
|
120
109
|
/**
|
121
110
|
* Clear up the dom node when unmounting to release resources.
|
122
111
|
*/
|
@@ -147,7 +136,7 @@ class SkiaDomView extends _react.default.Component {
|
|
147
136
|
exports.SkiaDomView = SkiaDomView;
|
148
137
|
|
149
138
|
const assertSkiaViewApi = () => {
|
150
|
-
if (_api.SkiaViewApi === null || _api.SkiaViewApi.setJsiProperty === null || _api.SkiaViewApi.callJsiMethod === null || _api.SkiaViewApi.
|
139
|
+
if (_api.SkiaViewApi === null || _api.SkiaViewApi.setJsiProperty === null || _api.SkiaViewApi.callJsiMethod === null || _api.SkiaViewApi.requestRedraw === null || _api.SkiaViewApi.makeImageSnapshot === null) {
|
151
140
|
throw Error("Skia View Api was not found.");
|
152
141
|
}
|
153
142
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["NativeSkiaDomView","Platform","OS","SkiaDomViewNativeComponent","SkiaDomView","React","Component","constructor","props","_nativeId","SkiaViewNativeId","current","root","onTouch","onSize","assertSkiaViewApi","SkiaViewApi","setJsiProperty","nativeId","componentDidUpdate","prevProps","makeImageSnapshot","rect","redraw","requestRedraw","
|
1
|
+
{"version":3,"names":["NativeSkiaDomView","Platform","OS","SkiaDomViewNativeComponent","SkiaDomView","React","Component","constructor","props","_nativeId","SkiaViewNativeId","current","root","onTouch","onSize","assertSkiaViewApi","SkiaViewApi","setJsiProperty","nativeId","componentDidUpdate","prevProps","makeImageSnapshot","rect","redraw","requestRedraw","componentWillUnmount","render","mode","debug","viewProps","callJsiMethod","Error"],"sources":["SkiaDomView.tsx"],"sourcesContent":["import React from \"react\";\nimport type { HostComponent } from \"react-native\";\n\nimport type { SkRect } from \"../skia/types\";\nimport { Platform } from \"../Platform\";\nimport SkiaDomViewNativeComponent from \"../specs/SkiaDomViewNativeComponent\";\n\nimport { SkiaViewApi } from \"./api\";\nimport type { SkiaDomViewProps } from \"./types\";\nimport { SkiaViewNativeId } from \"./SkiaViewNativeId\";\n\nconst NativeSkiaDomView: HostComponent<SkiaDomViewProps> =\n Platform.OS !== \"web\"\n ? SkiaDomViewNativeComponent\n : // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (null as any);\n\nexport class SkiaDomView extends React.Component<SkiaDomViewProps> {\n constructor(props: SkiaDomViewProps) {\n super(props);\n this._nativeId = SkiaViewNativeId.current++;\n const { root, onTouch, onSize } = props;\n if (root) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"root\", root);\n }\n if (onTouch) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"onTouch\", onTouch);\n }\n if (onSize) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"onSize\", onSize);\n }\n }\n\n private _nativeId: number;\n\n public get nativeId() {\n return this._nativeId;\n }\n\n componentDidUpdate(prevProps: SkiaDomViewProps) {\n const { root, onTouch, onSize } = this.props;\n if (root !== prevProps.root) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"root\", root);\n }\n if (onTouch !== prevProps.onTouch) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"onTouch\", onTouch);\n }\n if (onSize !== prevProps.onSize) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"onSize\", onSize);\n }\n }\n\n /**\n * Creates a snapshot from the canvas in the surface\n * @param rect Rect to use as bounds. Optional.\n * @returns An Image object.\n */\n public makeImageSnapshot(rect?: SkRect) {\n assertSkiaViewApi();\n return SkiaViewApi.makeImageSnapshot(this._nativeId, rect);\n }\n\n /**\n * Sends a redraw request to the native SkiaView.\n */\n public redraw() {\n assertSkiaViewApi();\n SkiaViewApi.requestRedraw(this._nativeId);\n }\n\n /**\n * Clear up the dom node when unmounting to release resources.\n */\n componentWillUnmount(): void {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"root\", null);\n }\n\n render() {\n const { mode, debug = false, ...viewProps } = this.props;\n return (\n <NativeSkiaDomView\n collapsable={false}\n nativeID={`${this._nativeId}`}\n mode={mode}\n debug={debug}\n {...viewProps}\n />\n );\n }\n}\n\nconst assertSkiaViewApi = () => {\n if (\n SkiaViewApi === null ||\n SkiaViewApi.setJsiProperty === null ||\n SkiaViewApi.callJsiMethod === null ||\n SkiaViewApi.requestRedraw === null ||\n SkiaViewApi.makeImageSnapshot === null\n ) {\n throw Error(\"Skia View Api was not found.\");\n }\n};\n"],"mappings":";;;;;;;AAAA;;AAIA;;AACA;;AAEA;;AAEA;;;;;;;;AAEA,MAAMA,iBAAkD,GACtDC,kBAAA,CAASC,EAAT,KAAgB,KAAhB,GACIC,mCADJ,GAEI;AACC,IAJP;;AAMO,MAAMC,WAAN,SAA0BC,cAAA,CAAMC,SAAhC,CAA4D;EACjEC,WAAW,CAACC,KAAD,EAA0B;IACnC,MAAMA,KAAN;;IADmC;;IAEnC,KAAKC,SAAL,GAAiBC,kCAAA,CAAiBC,OAAjB,EAAjB;IACA,MAAM;MAAEC,IAAF;MAAQC,OAAR;MAAiBC;IAAjB,IAA4BN,KAAlC;;IACA,IAAII,IAAJ,EAAU;MACRG,iBAAiB;;MACjBC,gBAAA,CAAYC,cAAZ,CAA2B,KAAKR,SAAhC,EAA2C,MAA3C,EAAmDG,IAAnD;IACD;;IACD,IAAIC,OAAJ,EAAa;MACXE,iBAAiB;;MACjBC,gBAAA,CAAYC,cAAZ,CAA2B,KAAKR,SAAhC,EAA2C,SAA3C,EAAsDI,OAAtD;IACD;;IACD,IAAIC,MAAJ,EAAY;MACVC,iBAAiB;;MACjBC,gBAAA,CAAYC,cAAZ,CAA2B,KAAKR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C,iBAAD;MACE,WAAW,EAAE,KADf;MAEE,QAAQ,EAAG,GAAE,KAAKC,SAAU,EAF9B;MAGE,IAAI,EAAEkB,IAHR;MAIE,KAAK,EAAEC;IAJT,GAKMC,SALN,EADF;EASD;;AA9EgE;;;;AAiFnE,MAAMd,iBAAiB,GAAG,MAAM;EAC9B,IACEC,gBAAA,KAAgB,IAAhB,IACAA,gBAAA,CAAYC,cAAZ,KAA+B,IAD/B,IAEAD,gBAAA,CAAYc,aAAZ,KAA8B,IAF9B,IAGAd,gBAAA,CAAYQ,aAAZ,KAA8B,IAH9B,IAIAR,gBAAA,CAAYK,iBAAZ,KAAkC,IALpC,EAME;IACA,MAAMU,KAAK,CAAC,8BAAD,CAAX;EACD;AACF,CAVD"}
|
@@ -9,8 +9,6 @@ var _skia = require("../skia");
|
|
9
9
|
|
10
10
|
var _DrawingContext = require("../dom/types/DrawingContext");
|
11
11
|
|
12
|
-
var _Animations = require("../renderer/processors/Animations/Animations");
|
13
|
-
|
14
12
|
var _SkiaBaseWebView = require("./SkiaBaseWebView");
|
15
13
|
|
16
14
|
class SkiaDomView extends _SkiaBaseWebView.SkiaBaseWebView {
|
@@ -28,18 +26,10 @@ class SkiaDomView extends _SkiaBaseWebView.SkiaBaseWebView {
|
|
28
26
|
width,
|
29
27
|
height
|
30
28
|
} = this.getSize();
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
height
|
36
|
-
};
|
37
|
-
} else {
|
38
|
-
this.props.onSize.value = {
|
39
|
-
width,
|
40
|
-
height
|
41
|
-
};
|
42
|
-
}
|
29
|
+
this.props.onSize.value = {
|
30
|
+
width,
|
31
|
+
height
|
32
|
+
};
|
43
33
|
}
|
44
34
|
|
45
35
|
if (this.props.root) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["SkiaDomView","SkiaBaseWebView","constructor","props","renderInCanvas","canvas","touches","onTouch","onSize","width","height","getSize","
|
1
|
+
{"version":3,"names":["SkiaDomView","SkiaBaseWebView","constructor","props","renderInCanvas","canvas","touches","onTouch","onSize","width","height","getSize","value","root","ctx","JsiDrawingContext","Skia","render"],"sources":["SkiaDomView.web.tsx"],"sourcesContent":["import { Skia } from \"../skia\";\nimport type { SkCanvas } from \"../skia/types\";\nimport { JsiDrawingContext } from \"../dom/types/DrawingContext\";\n\nimport { SkiaBaseWebView } from \"./SkiaBaseWebView\";\nimport type { SkiaDomViewProps, TouchInfo } from \"./types\";\n\nexport class SkiaDomView extends SkiaBaseWebView<SkiaDomViewProps> {\n constructor(props: SkiaDomViewProps) {\n super(props);\n }\n\n protected renderInCanvas(canvas: SkCanvas, touches: TouchInfo[]): void {\n if (this.props.onTouch) {\n this.props.onTouch([touches]);\n }\n if (this.props.onSize) {\n const { width, height } = this.getSize();\n this.props.onSize.value = { width, height };\n }\n if (this.props.root) {\n const ctx = new JsiDrawingContext(Skia, canvas);\n this.props.root.render(ctx);\n }\n }\n}\n"],"mappings":";;;;;;;AAAA;;AAEA;;AAEA;;AAGO,MAAMA,WAAN,SAA0BC,gCAA1B,CAA4D;EACjEC,WAAW,CAACC,KAAD,EAA0B;IACnC,MAAMA,KAAN;EACD;;EAESC,cAAc,CAACC,MAAD,EAAmBC,OAAnB,EAA+C;IACrE,IAAI,KAAKH,KAAL,CAAWI,OAAf,EAAwB;MACtB,KAAKJ,KAAL,CAAWI,OAAX,CAAmB,CAACD,OAAD,CAAnB;IACD;;IACD,IAAI,KAAKH,KAAL,CAAWK,MAAf,EAAuB;MACrB,MAAM;QAAEC,KAAF;QAASC;MAAT,IAAoB,KAAKC,OAAL,EAA1B;MACA,KAAKR,KAAL,CAAWK,MAAX,CAAkBI,KAAlB,GAA0B;QAAEH,KAAF;QAASC;MAAT,CAA1B;IACD;;IACD,IAAI,KAAKP,KAAL,CAAWU,IAAf,EAAqB;MACnB,MAAMC,GAAG,GAAG,IAAIC,iCAAJ,CAAsBC,UAAtB,EAA4BX,MAA5B,CAAZ;MACA,KAAKF,KAAL,CAAWU,IAAX,CAAgBI,MAAhB,CAAuBH,GAAvB;IACD;EACF;;AAjBgE"}
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import React from "react";
|
2
2
|
import type { SkRect } from "../skia/types";
|
3
|
-
import type { SkiaValue } from "../values";
|
4
3
|
import type { SkiaPictureViewProps } from "./types";
|
5
4
|
export declare class SkiaPictureView extends React.Component<SkiaPictureViewProps> {
|
6
5
|
constructor(props: SkiaPictureViewProps);
|
@@ -17,11 +16,5 @@ export declare class SkiaPictureView extends React.Component<SkiaPictureViewProp
|
|
17
16
|
* Sends a redraw request to the native SkiaView.
|
18
17
|
*/
|
19
18
|
redraw(): void;
|
20
|
-
/**
|
21
|
-
* Registers one or move values as a dependant value of the Skia View. The view will
|
22
|
-
* The view will redraw itself when any of the values change.
|
23
|
-
* @param values Values to register
|
24
|
-
*/
|
25
|
-
registerValues(values: SkiaValue<unknown>[]): () => void;
|
26
19
|
render(): React.JSX.Element;
|
27
20
|
}
|
@@ -11,7 +11,7 @@ var _SkiaPictureViewNativeComponent = _interopRequireDefault(require("../specs/S
|
|
11
11
|
|
12
12
|
var _api = require("./api");
|
13
13
|
|
14
|
-
var
|
14
|
+
var _SkiaViewNativeId = require("./SkiaViewNativeId");
|
15
15
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
17
17
|
|
@@ -27,7 +27,7 @@ class SkiaPictureView extends _react.default.Component {
|
|
27
27
|
|
28
28
|
_defineProperty(this, "_nativeId", void 0);
|
29
29
|
|
30
|
-
this._nativeId =
|
30
|
+
this._nativeId = _SkiaViewNativeId.SkiaViewNativeId.current++;
|
31
31
|
const {
|
32
32
|
picture,
|
33
33
|
onSize
|
@@ -89,17 +89,6 @@ class SkiaPictureView extends _react.default.Component {
|
|
89
89
|
|
90
90
|
_api.SkiaViewApi.requestRedraw(this._nativeId);
|
91
91
|
}
|
92
|
-
/**
|
93
|
-
* Registers one or move values as a dependant value of the Skia View. The view will
|
94
|
-
* The view will redraw itself when any of the values change.
|
95
|
-
* @param values Values to register
|
96
|
-
*/
|
97
|
-
|
98
|
-
|
99
|
-
registerValues(values) {
|
100
|
-
assertSkiaViewApi();
|
101
|
-
return _api.SkiaViewApi.registerValuesInView(this._nativeId, values);
|
102
|
-
}
|
103
92
|
|
104
93
|
render() {
|
105
94
|
const {
|
@@ -120,7 +109,7 @@ class SkiaPictureView extends _react.default.Component {
|
|
120
109
|
exports.SkiaPictureView = SkiaPictureView;
|
121
110
|
|
122
111
|
const assertSkiaViewApi = () => {
|
123
|
-
if (_api.SkiaViewApi === null || _api.SkiaViewApi.setJsiProperty === null || _api.SkiaViewApi.callJsiMethod === null || _api.SkiaViewApi.
|
112
|
+
if (_api.SkiaViewApi === null || _api.SkiaViewApi.setJsiProperty === null || _api.SkiaViewApi.callJsiMethod === null || _api.SkiaViewApi.requestRedraw === null || _api.SkiaViewApi.makeImageSnapshot === null) {
|
124
113
|
throw Error("Skia View Api was not found.");
|
125
114
|
}
|
126
115
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["NativeSkiaPictureView","SkiaPictureViewNativeComponent","SkiaPictureView","React","Component","constructor","props","_nativeId","SkiaViewNativeId","current","picture","onSize","assertSkiaViewApi","SkiaViewApi","setJsiProperty","nativeId","componentDidUpdate","prevProps","makeImageSnapshot","rect","redraw","requestRedraw","
|
1
|
+
{"version":3,"names":["NativeSkiaPictureView","SkiaPictureViewNativeComponent","SkiaPictureView","React","Component","constructor","props","_nativeId","SkiaViewNativeId","current","picture","onSize","assertSkiaViewApi","SkiaViewApi","setJsiProperty","nativeId","componentDidUpdate","prevProps","makeImageSnapshot","rect","redraw","requestRedraw","render","mode","debug","viewProps","callJsiMethod","Error"],"sources":["SkiaPictureView.tsx"],"sourcesContent":["import React from \"react\";\n\nimport type { SkRect } from \"../skia/types\";\nimport SkiaPictureViewNativeComponent from \"../specs/SkiaPictureViewNativeComponent\";\n\nimport { SkiaViewApi } from \"./api\";\nimport type { SkiaPictureViewProps } from \"./types\";\nimport { SkiaViewNativeId } from \"./SkiaViewNativeId\";\n\nconst NativeSkiaPictureView = SkiaPictureViewNativeComponent;\n\nexport class SkiaPictureView extends React.Component<SkiaPictureViewProps> {\n constructor(props: SkiaPictureViewProps) {\n super(props);\n this._nativeId = SkiaViewNativeId.current++;\n const { picture, onSize } = props;\n if (picture) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"picture\", picture);\n }\n if (onSize) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"onSize\", onSize);\n }\n }\n\n private _nativeId: number;\n\n public get nativeId() {\n return this._nativeId;\n }\n\n componentDidUpdate(prevProps: SkiaPictureViewProps) {\n const { picture, onSize } = this.props;\n if (picture !== prevProps.picture) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"picture\", picture);\n }\n if (onSize !== prevProps.onSize) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"onSize\", onSize);\n }\n }\n\n /**\n * Creates a snapshot from the canvas in the surface\n * @param rect Rect to use as bounds. Optional.\n * @returns An Image object.\n */\n public makeImageSnapshot(rect?: SkRect) {\n assertSkiaViewApi();\n return SkiaViewApi.makeImageSnapshot(this._nativeId, rect);\n }\n\n /**\n * Sends a redraw request to the native SkiaView.\n */\n public redraw() {\n assertSkiaViewApi();\n SkiaViewApi.requestRedraw(this._nativeId);\n }\n\n render() {\n const { mode, debug = false, ...viewProps } = this.props;\n return (\n <NativeSkiaPictureView\n collapsable={false}\n nativeID={`${this._nativeId}`}\n mode={mode ?? \"default\"}\n debug={debug}\n {...viewProps}\n />\n );\n }\n}\n\nconst assertSkiaViewApi = () => {\n if (\n SkiaViewApi === null ||\n SkiaViewApi.setJsiProperty === null ||\n SkiaViewApi.callJsiMethod === null ||\n SkiaViewApi.requestRedraw === null ||\n SkiaViewApi.makeImageSnapshot === null\n ) {\n throw Error(\"Skia View Api was not found.\");\n }\n};\n"],"mappings":";;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R,iBAAiB;;IACjBC,gBAAA,CAAYQ,aAAZ,CAA0B,KAAKd,SAA/B;EACD;;EAEDe,MAAM,GAAG;IACP,MAAM;MAAEC,IAAF;MAAQC,KAAK,GAAG,KAAhB;MAAuB,GAAGC;IAA1B,IAAwC,KAAKnB,KAAnD;IACA,oBACE,6BAAC,qBAAD;MACE,WAAW,EAAE,KADf;MAEE,QAAQ,EAAG,GAAE,KAAKC,SAAU,EAF9B;MAGE,IAAI,EAAEgB,IAAI,IAAI,SAHhB;MAIE,KAAK,EAAEC;IAJT,GAKMC,SALN,EADF;EASD;;AA9DwE;;;;AAiE3E,MAAMb,iBAAiB,GAAG,MAAM;EAC9B,IACEC,gBAAA,KAAgB,IAAhB,IACAA,gBAAA,CAAYC,cAAZ,KAA+B,IAD/B,IAEAD,gBAAA,CAAYa,aAAZ,KAA8B,IAF9B,IAGAb,gBAAA,CAAYQ,aAAZ,KAA8B,IAH9B,IAIAR,gBAAA,CAAYK,iBAAZ,KAAkC,IALpC,EAME;IACA,MAAMS,KAAK,CAAC,8BAAD,CAAX;EACD;AACF,CAVD"}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.SkiaViewNativeId = void 0;
|
7
|
+
const SkiaViewNativeId = {
|
8
|
+
current: 1000
|
9
|
+
};
|
10
|
+
exports.SkiaViewNativeId = SkiaViewNativeId;
|
11
|
+
//# sourceMappingURL=SkiaViewNativeId.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["SkiaViewNativeId","current"],"sources":["SkiaViewNativeId.ts"],"sourcesContent":["export const SkiaViewNativeId = { current: 1000 };\n"],"mappings":";;;;;;AAAO,MAAMA,gBAAgB,GAAG;EAAEC,OAAO,EAAE;AAAX,CAAzB"}
|
@@ -4,19 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
|
7
|
-
var _SkiaView = require("./SkiaView");
|
8
|
-
|
9
|
-
Object.keys(_SkiaView).forEach(function (key) {
|
10
|
-
if (key === "default" || key === "__esModule") return;
|
11
|
-
if (key in exports && exports[key] === _SkiaView[key]) return;
|
12
|
-
Object.defineProperty(exports, key, {
|
13
|
-
enumerable: true,
|
14
|
-
get: function () {
|
15
|
-
return _SkiaView[key];
|
16
|
-
}
|
17
|
-
});
|
18
|
-
});
|
19
|
-
|
20
7
|
var _SkiaPictureView = require("./SkiaPictureView");
|
21
8
|
|
22
9
|
Object.keys(_SkiaPictureView).forEach(function (key) {
|
@@ -56,19 +43,6 @@ Object.keys(_types).forEach(function (key) {
|
|
56
43
|
});
|
57
44
|
});
|
58
45
|
|
59
|
-
var _useDrawCallback = require("./useDrawCallback");
|
60
|
-
|
61
|
-
Object.keys(_useDrawCallback).forEach(function (key) {
|
62
|
-
if (key === "default" || key === "__esModule") return;
|
63
|
-
if (key in exports && exports[key] === _useDrawCallback[key]) return;
|
64
|
-
Object.defineProperty(exports, key, {
|
65
|
-
enumerable: true,
|
66
|
-
get: function () {
|
67
|
-
return _useDrawCallback[key];
|
68
|
-
}
|
69
|
-
});
|
70
|
-
});
|
71
|
-
|
72
46
|
var _useTouchHandler = require("./useTouchHandler");
|
73
47
|
|
74
48
|
Object.keys(_useTouchHandler).forEach(function (key) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./SkiaPictureView\";\nexport * from \"./SkiaDomView\";\nexport * from \"./types\";\nexport * from \"./useTouchHandler\";\n"],"mappings":";;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import type { ViewProps } from "react-native";
|
2
2
|
import type { GroupProps, RenderNode } from "../dom/types";
|
3
|
-
import type {
|
4
|
-
import type { SkiaMutableValue, SkiaValue } from "../values";
|
3
|
+
import type { SkImage, SkPicture, SkRect, SkSize } from "../skia/types";
|
5
4
|
import type { SharedValueType } from "../renderer/processors/Animations/Animations";
|
6
5
|
export type DrawMode = "continuous" | "default";
|
7
6
|
export type NativeSkiaViewProps = ViewProps & {
|
@@ -38,7 +37,6 @@ export type TouchHandlers = {
|
|
38
37
|
onEnd?: (touchInfo: ExtendedTouchInfo) => void;
|
39
38
|
};
|
40
39
|
export type TouchHandler = (touchInfo: Array<Array<TouchInfo>>) => void;
|
41
|
-
export type RNSkiaDrawCallback = (canvas: SkCanvas, info: DrawingInfo) => void;
|
42
40
|
/**
|
43
41
|
* Listener interface for value changes
|
44
42
|
*/
|
@@ -49,7 +47,6 @@ export interface ValueListener {
|
|
49
47
|
export interface ISkiaViewApi {
|
50
48
|
setJsiProperty: <T>(nativeId: number, name: string, value: T) => void;
|
51
49
|
callJsiMethod: <T extends Array<unknown>>(nativeId: number, name: string, ...args: T) => void;
|
52
|
-
registerValuesInView: (nativeId: number, values: SkiaValue<unknown>[]) => () => void;
|
53
50
|
requestRedraw: (nativeId: number) => void;
|
54
51
|
makeImageSnapshot: (nativeId: number, rect?: SkRect) => SkImage;
|
55
52
|
}
|
@@ -71,17 +68,7 @@ export interface SkiaBaseViewProps extends ViewProps {
|
|
71
68
|
* Pass an animated value to the onSize property to get updates when
|
72
69
|
* the Skia view is resized.
|
73
70
|
*/
|
74
|
-
onSize?:
|
75
|
-
}
|
76
|
-
export interface SkiaDrawViewProps extends SkiaBaseViewProps {
|
77
|
-
/**
|
78
|
-
* Draw callback. Will be called whenever the view is invalidated and
|
79
|
-
* needs to redraw. This is either caused by a change in a react
|
80
|
-
* property, a touch event, or a call to redraw. If the view is in
|
81
|
-
* continuous mode the callback will be called 60 frames per second
|
82
|
-
* by the native view.
|
83
|
-
*/
|
84
|
-
onDraw?: RNSkiaDrawCallback;
|
71
|
+
onSize?: SharedValueType<SkSize>;
|
85
72
|
}
|
86
73
|
export interface SkiaPictureViewProps extends SkiaBaseViewProps {
|
87
74
|
picture?: SkPicture;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["TouchType"],"sources":["types.ts"],"sourcesContent":["import type { ViewProps } from \"react-native\";\n\nimport type { GroupProps, RenderNode } from \"../dom/types\";\nimport type {
|
1
|
+
{"version":3,"names":["TouchType"],"sources":["types.ts"],"sourcesContent":["import type { ViewProps } from \"react-native\";\n\nimport type { GroupProps, RenderNode } from \"../dom/types\";\nimport type { SkImage, SkPicture, SkRect, SkSize } from \"../skia/types\";\nimport type { SharedValueType } from \"../renderer/processors/Animations/Animations\";\n\nexport type DrawMode = \"continuous\" | \"default\";\n\nexport type NativeSkiaViewProps = ViewProps & {\n mode?: DrawMode;\n debug?: boolean;\n};\n\nexport enum TouchType {\n Start,\n Active,\n End,\n Cancelled,\n}\n\nexport interface TouchInfo {\n x: number;\n y: number;\n force: number;\n type: TouchType;\n id: number;\n timestamp: number;\n}\n\nexport interface DrawingInfo {\n width: number;\n height: number;\n timestamp: number;\n touches: Array<Array<TouchInfo>>;\n}\n\nexport type ExtendedTouchInfo = TouchInfo & {\n // points per second\n velocityX: number;\n velocityY: number;\n};\n\nexport type TouchHandlers = {\n onStart?: (touchInfo: TouchInfo) => void;\n onActive?: (touchInfo: ExtendedTouchInfo) => void;\n onEnd?: (touchInfo: ExtendedTouchInfo) => void;\n};\n\nexport type TouchHandler = (touchInfo: Array<Array<TouchInfo>>) => void;\n\n/**\n * Listener interface for value changes\n */\nexport interface ValueListener {\n addListener: (callback: () => void) => number;\n removeListener: (id: number) => void;\n}\n\nexport interface ISkiaViewApi {\n setJsiProperty: <T>(nativeId: number, name: string, value: T) => void;\n callJsiMethod: <T extends Array<unknown>>(\n nativeId: number,\n name: string,\n ...args: T\n ) => void;\n requestRedraw: (nativeId: number) => void;\n makeImageSnapshot: (nativeId: number, rect?: SkRect) => SkImage;\n}\n\nexport interface SkiaBaseViewProps extends ViewProps {\n /**\n * Sets the drawing mode for the skia view. There are two drawing\n * modes, \"continuous\" and \"default\", where the continuous mode will\n * continuously redraw the view, and the default mode will only\n * redraw when any of the regular react properties are changed like\n * sizes and margins.\n */\n mode?: DrawMode;\n /**\n * When set to true the view will display information about the\n * average time it takes to render.\n */\n debug?: boolean;\n /**\n * Pass an animated value to the onSize property to get updates when\n * the Skia view is resized.\n */\n onSize?: SharedValueType<SkSize>;\n}\n\nexport interface SkiaPictureViewProps extends SkiaBaseViewProps {\n picture?: SkPicture;\n}\n\nexport interface SkiaDomViewProps extends SkiaBaseViewProps {\n root?: RenderNode<GroupProps>;\n onTouch?: TouchHandler;\n}\n"],"mappings":";;;;;;IAaYA,S;;;WAAAA,S;EAAAA,S,CAAAA,S;EAAAA,S,CAAAA,S;EAAAA,S,CAAAA,S;EAAAA,S,CAAAA,S;GAAAA,S,yBAAAA,S;AAqCZ;AACA;AACA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./functions\";\n"],"mappings":"AAAA,cAAc,aAAd"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { PathProps, SkDOM, GroupProps, ImageProps, BlurImageFilterProps, MatrixColorFilterProps, CircleProps, BlurMaskFilterProps, LinearGradientProps, PaintProps, ShaderProps, ImageShaderProps,
|
1
|
+
import type { PathProps, SkDOM, GroupProps, ImageProps, BlurImageFilterProps, MatrixColorFilterProps, CircleProps, BlurMaskFilterProps, LinearGradientProps, PaintProps, ShaderProps, ImageShaderProps, LineProps, OvalProps, PatchProps, PointsProps, RectProps, RoundedRectProps, VerticesProps, TextProps, DiffRectProps, OffsetImageFilterProps, BlendColorFilterProps, TextPathProps, TextBlobProps, GlyphsProps, TwoPointConicalGradientProps, TurbulenceProps, SweepGradientProps, RadialGradientProps, FractalNoiseProps, ColorProps, PictureProps, ImageSVGProps, LerpColorFilterProps, DrawingNodeProps, BoxProps, BoxShadowProps, ChildrenProps } from "../types";
|
2
2
|
import type { BlendImageFilterProps, BlendProps, DisplacementMapImageFilterProps, DropShadowImageFilterProps, MorphologyImageFilterProps, RuntimeShaderImageFilterProps } from "../types/ImageFilters";
|
3
3
|
import type { CornerPathEffectProps, DashPathEffectProps, DiscretePathEffectProps, Line2DPathEffectProps, Path1DPathEffectProps, Path2DPathEffectProps } from "../types/PathEffects";
|
4
4
|
import type { ParagraphProps } from "../types/Paragraph";
|
@@ -13,7 +13,6 @@ export declare class JsiSkDOM implements SkDOM {
|
|
13
13
|
Image(props: ImageProps): import("../types").RenderNode<ImageProps>;
|
14
14
|
Circle(props: CircleProps): import("../types").RenderNode<CircleProps>;
|
15
15
|
Path(props: PathProps): import("../types").RenderNode<PathProps>;
|
16
|
-
CustomDrawing(props: CustomDrawingNodeProps): import("../types").RenderNode<CustomDrawingNodeProps>;
|
17
16
|
Line(props: LineProps): import("../types").RenderNode<LineProps>;
|
18
17
|
Oval(props: OvalProps): import("../types").RenderNode<OvalProps>;
|
19
18
|
Patch(props: PatchProps): import("../types").RenderNode<PatchProps>;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { NATIVE_DOM } from "../../renderer/HostComponents";
|
2
|
-
import { FillNode, ImageNode, CircleNode, PathNode, LineNode, PatchNode, PointsNode, RectNode, RRectNode, VerticesNode, TextNode, OvalNode,
|
2
|
+
import { FillNode, ImageNode, CircleNode, PathNode, LineNode, PatchNode, PointsNode, RectNode, RRectNode, VerticesNode, TextNode, OvalNode, TextPathNode, TextBlobNode, GlyphsNode, DiffRectNode, PictureNode, ImageSVGNode, BackdropFilterNode, BoxNode, BoxShadowNode } from "./drawings";
|
3
3
|
import { BlendImageFilterNode, BlurImageFilterNode, BlurMaskFilterNode, DisplacementMapImageFilterNode, DropShadowImageFilterNode, OffsetImageFilterNode, RuntimeShaderImageFilterNode, CornerPathEffectNode, DiscretePathEffectNode, DashPathEffectNode, Path1DPathEffectNode, Path2DPathEffectNode, SumPathEffectNode, Line2DPathEffectNode, BlendNode } from "./paint";
|
4
4
|
import { MatrixColorFilterNode, LumaColorFilterNode, LinearToSRGBGammaColorFilterNode, SRGBToLinearGammaColorFilterNode, BlendColorFilterNode, LerpColorFilterNode } from "./paint/ColorFilters";
|
5
5
|
import { LinearGradientNode, ShaderNode, ImageShaderNode, TwoPointConicalGradientNode, TurbulenceNode, SweepGradientNode, RadialGradientNode, FractalNoiseNode, ColorNode } from "./paint/Shaders";
|
@@ -42,12 +42,6 @@ export class JsiSkDOM {
|
|
42
42
|
return NATIVE_DOM ? global.SkiaDomApi.PathNode(props !== null && props !== void 0 ? props : {}) : new PathNode(this.ctx, props);
|
43
43
|
}
|
44
44
|
|
45
|
-
CustomDrawing(props) {
|
46
|
-
console.warn( // eslint-disable-next-line max-len
|
47
|
-
"The <Drawing /> component is deprecated and will be removed in the next release. For custom drawings, please sure the <Picture /> component: https://shopify.github.io/react-native-skia/docs/shapes/pictures/");
|
48
|
-
return NATIVE_DOM ? global.SkiaDomApi.CustomDrawingNode(props !== null && props !== void 0 ? props : {}) : new CustomDrawingNode(this.ctx, props);
|
49
|
-
}
|
50
|
-
|
51
45
|
Line(props) {
|
52
46
|
return NATIVE_DOM ? global.SkiaDomApi.LineNode(props !== null && props !== void 0 ? props : {}) : new LineNode(this.ctx, props);
|
53
47
|
}
|