@shopify/react-native-skia 0.1.229 → 0.1.230
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/cpp/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/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 +2 -21
- 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/Paragraph/Paragraph.d.ts +23 -0
- package/lib/commonjs/skia/types/Paragraph/Paragraph.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/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 +2 -20
- 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/Paragraph/Paragraph.d.ts +23 -0
- package/lib/module/skia/types/Paragraph/Paragraph.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/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/Paragraph/Paragraph.d.ts +23 -0
- 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/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 +3 -21
- 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/Paragraph/Paragraph.ts +25 -0
- 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/values/api.ts
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
AnimationState,
|
|
3
|
-
ISkiaValueApi,
|
|
4
|
-
SkiaAnimation,
|
|
5
|
-
SkiaClockValue,
|
|
6
|
-
SkiaMutableValue,
|
|
7
|
-
SkiaValue,
|
|
8
|
-
} from "./types";
|
|
9
|
-
|
|
10
|
-
declare global {
|
|
11
|
-
var SkiaValueApi: ISkiaValueApi;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const { SkiaValueApi } = global;
|
|
15
|
-
|
|
16
|
-
const deprecatedWarning = () => {
|
|
17
|
-
console.warn(
|
|
18
|
-
`Skia values are deprecated and will be removed in the next Skia release.
|
|
19
|
-
Please use Reanimated instead: https://shopify.github.io/react-native-skia/docs/animations/animations`
|
|
20
|
-
);
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export const ValueApi = {
|
|
24
|
-
/**
|
|
25
|
-
* @deprecated Use Reanimated 3
|
|
26
|
-
* for animating Skia: https://shopify.github.io/react-native-skia/docs/animations/animations
|
|
27
|
-
*/
|
|
28
|
-
createValue<T>(initialValue: T): SkiaMutableValue<T> {
|
|
29
|
-
deprecatedWarning();
|
|
30
|
-
return SkiaValueApi.createValue(initialValue);
|
|
31
|
-
},
|
|
32
|
-
/**
|
|
33
|
-
* @deprecated Use Reanimated 3
|
|
34
|
-
* for animating Skia: https://shopify.github.io/react-native-skia/docs/animations/animations
|
|
35
|
-
*/
|
|
36
|
-
createComputedValue<R>(
|
|
37
|
-
cb: () => R,
|
|
38
|
-
values: SkiaValue<unknown>[]
|
|
39
|
-
): SkiaValue<R> {
|
|
40
|
-
deprecatedWarning();
|
|
41
|
-
return SkiaValueApi.createComputedValue(cb, values);
|
|
42
|
-
},
|
|
43
|
-
/**
|
|
44
|
-
* @deprecated Use Reanimated 3
|
|
45
|
-
* for animating Skia: https://shopify.github.io/react-native-skia/docs/animations/animations
|
|
46
|
-
*/
|
|
47
|
-
createClockValue(): SkiaClockValue {
|
|
48
|
-
deprecatedWarning();
|
|
49
|
-
return SkiaValueApi.createClockValue();
|
|
50
|
-
},
|
|
51
|
-
/**
|
|
52
|
-
* @deprecated Use Reanimated 3
|
|
53
|
-
* for animating Skia: https://shopify.github.io/react-native-skia/docs/animations/animations
|
|
54
|
-
*/
|
|
55
|
-
createAnimation<S extends AnimationState = AnimationState>(
|
|
56
|
-
cb: (t: number, state: S | undefined) => S
|
|
57
|
-
): SkiaAnimation {
|
|
58
|
-
deprecatedWarning();
|
|
59
|
-
return SkiaValueApi.createAnimation(cb);
|
|
60
|
-
},
|
|
61
|
-
};
|
package/src/values/api.web.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { useEffect, useMemo } from "react";
|
|
2
|
-
|
|
3
|
-
import { ValueApi } from "../api";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* @deprecated Use Reanimated 3
|
|
7
|
-
* for animating Skia: https://shopify.github.io/react-native-skia/docs/animations/animations
|
|
8
|
-
*
|
|
9
|
-
* @returns A new value that will be updated on every frame redraw with the
|
|
10
|
-
* number of milliseconds elapsed since the value was started.
|
|
11
|
-
* The clock is created in the stopped state.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
export const useClockValue = () => {
|
|
15
|
-
const clock = useMemo(() => ValueApi.createClockValue(), []);
|
|
16
|
-
useEffect(() => {
|
|
17
|
-
clock.start();
|
|
18
|
-
return clock.stop;
|
|
19
|
-
}, [clock]);
|
|
20
|
-
return clock;
|
|
21
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { useEffect, useMemo } from "react";
|
|
2
|
-
|
|
3
|
-
import { ValueApi } from "../api";
|
|
4
|
-
import { isValue } from "../../renderer/processors/Animations";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @deprecated Use Reanimated 3
|
|
8
|
-
* for animating Skia: https://shopify.github.io/react-native-skia/docs/animations/animations
|
|
9
|
-
*
|
|
10
|
-
* Creates a new computed value - a value that will calculate its value depending
|
|
11
|
-
* on other values.
|
|
12
|
-
* @param cb Callback to calculate new value
|
|
13
|
-
* @param values Dependant values
|
|
14
|
-
* @returns A readonly value
|
|
15
|
-
*/
|
|
16
|
-
export const useComputedValue = <R>(cb: () => R, values: unknown[]) => {
|
|
17
|
-
const value = useMemo(
|
|
18
|
-
() => ValueApi.createComputedValue<R>(cb, values.filter(isValue)),
|
|
19
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
20
|
-
values
|
|
21
|
-
);
|
|
22
|
-
useEffect(() => () => value.dispose(), [value]);
|
|
23
|
-
return value;
|
|
24
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { useMemo } from "react";
|
|
2
|
-
|
|
3
|
-
import { ValueApi } from "../api";
|
|
4
|
-
import type { SkiaMutableValue } from "../types";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @deprecated Use Reanimated 3
|
|
8
|
-
* for animating Skia: https://shopify.github.io/react-native-skia/docs/animations/animations
|
|
9
|
-
*
|
|
10
|
-
* Creates a new value that holds some data.
|
|
11
|
-
* @param v Value to hold
|
|
12
|
-
* @returns A Value of type of v
|
|
13
|
-
*/
|
|
14
|
-
export const useValue = <T>(v: T): SkiaMutableValue<T> => {
|
|
15
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
16
|
-
return useMemo(() => ValueApi.createValue(v), []);
|
|
17
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { useEffect } from "react";
|
|
2
|
-
|
|
3
|
-
import type { SkiaValue } from "../types";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* @deprecated Use Reanimated 3
|
|
7
|
-
* for animating Skia: https://shopify.github.io/react-native-skia/docs/animations/animations
|
|
8
|
-
*
|
|
9
|
-
* Sets up an effect that will be run whenever the value changes
|
|
10
|
-
* @param value Value to subscribe to changes on
|
|
11
|
-
* @param cb Callback to run when value changes
|
|
12
|
-
*/
|
|
13
|
-
export const useValueEffect = <T>(value: SkiaValue<T>, cb: (v: T) => void) => {
|
|
14
|
-
useEffect(() => {
|
|
15
|
-
return value.addListener(cb);
|
|
16
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
17
|
-
}, [value]);
|
|
18
|
-
};
|
package/src/values/index.ts
DELETED
package/src/values/selector.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { SkiaValue } from "./types";
|
|
2
|
-
|
|
3
|
-
export type SkiaSelector<TReturn, TInput = unknown> = {
|
|
4
|
-
value: SkiaValue<TInput>;
|
|
5
|
-
selector: (v: TInput) => TReturn;
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Wraps a Skia Value with a selector function. The selector function can access the
|
|
10
|
-
* inner values of the Skia Value so that we can dynamically ready array values and
|
|
11
|
-
* object values when doing animations in Skia.
|
|
12
|
-
* @param value Dependant value
|
|
13
|
-
* @param selector Selector function to calculate new value from the Skia Value's value
|
|
14
|
-
* @returns A descriptor that will be used by the reconciler to calculate the value
|
|
15
|
-
*/
|
|
16
|
-
export const Selector = <TInput, TReturn>(
|
|
17
|
-
value: SkiaValue<TInput>,
|
|
18
|
-
selector: (v: TInput) => TReturn
|
|
19
|
-
): SkiaSelector<TReturn, TInput> => {
|
|
20
|
-
return {
|
|
21
|
-
selector,
|
|
22
|
-
value,
|
|
23
|
-
};
|
|
24
|
-
};
|
package/src/values/types.ts
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
export interface SkiaValue<T = number> {
|
|
2
|
-
/**
|
|
3
|
-
* Gets the value hold by the Value object
|
|
4
|
-
*/
|
|
5
|
-
readonly current: T;
|
|
6
|
-
/**
|
|
7
|
-
* Adds a listener that is called when value changes.
|
|
8
|
-
* Returns unsubscribe method.
|
|
9
|
-
*/
|
|
10
|
-
addListener: (cb: (value: T) => void) => () => void;
|
|
11
|
-
/**
|
|
12
|
-
* Invalidates the value. Has different meaning depending on the type of the value.
|
|
13
|
-
*/
|
|
14
|
-
dispose: () => void;
|
|
15
|
-
/**
|
|
16
|
-
* Field to make typechecking easier
|
|
17
|
-
*/
|
|
18
|
-
__typename__: "RNSkValue";
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export interface SkiaMutableValue<T = number> extends SkiaValue<T> {
|
|
22
|
-
/**
|
|
23
|
-
* Get/sets the value hold by the Value object
|
|
24
|
-
*/
|
|
25
|
-
current: T;
|
|
26
|
-
/**
|
|
27
|
-
* Get/sets the animation controlling the value
|
|
28
|
-
* */
|
|
29
|
-
animation: SkiaAnimation | undefined;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export interface SkiaClockValue extends SkiaValue<number> {
|
|
33
|
-
start: () => void;
|
|
34
|
-
stop: () => void;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export interface SkiaAnimation extends SkiaClockValue {
|
|
38
|
-
cancel: () => void;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export interface AnimationState {
|
|
42
|
-
current: number;
|
|
43
|
-
finished: boolean;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export interface ISkiaValueApi {
|
|
47
|
-
/**
|
|
48
|
-
* Creates a new value that holds the initial value and that
|
|
49
|
-
* can be changed.
|
|
50
|
-
*/
|
|
51
|
-
createValue<T>(initialValue: T): SkiaMutableValue<T>;
|
|
52
|
-
/**
|
|
53
|
-
* Creates a computed value. This is a calculated value that returns the result of
|
|
54
|
-
* a function that is called with the values of the dependencies.
|
|
55
|
-
*/
|
|
56
|
-
createComputedValue<R>(
|
|
57
|
-
cb: () => R,
|
|
58
|
-
values: Array<SkiaValue<unknown>>
|
|
59
|
-
): SkiaValue<R>;
|
|
60
|
-
/**
|
|
61
|
-
* Creates a clock value where the value is the number of milliseconds elapsed
|
|
62
|
-
* since the clock was created
|
|
63
|
-
*/
|
|
64
|
-
createClockValue(): SkiaClockValue;
|
|
65
|
-
/**
|
|
66
|
-
* Creates an animation that is driven from a clock and updated every frame.
|
|
67
|
-
* @param cb Callback to calculate next value from time.
|
|
68
|
-
* @returns An animation object that can control a value.
|
|
69
|
-
*/
|
|
70
|
-
createAnimation<S extends AnimationState = AnimationState>(
|
|
71
|
-
cb: (t: number, state: S | undefined) => S
|
|
72
|
-
): SkiaAnimation;
|
|
73
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { AnimationState, SkiaAnimation } from "../types";
|
|
2
|
-
|
|
3
|
-
import { RNSkClockValue } from "./RNSkClockValue";
|
|
4
|
-
|
|
5
|
-
export class RNSkAnimation<S extends AnimationState = AnimationState>
|
|
6
|
-
extends RNSkClockValue
|
|
7
|
-
implements SkiaAnimation
|
|
8
|
-
{
|
|
9
|
-
constructor(
|
|
10
|
-
callback: (t: number, state: S | undefined) => S,
|
|
11
|
-
raf: (callback: (time: number) => void) => number
|
|
12
|
-
) {
|
|
13
|
-
super(raf);
|
|
14
|
-
this._callback = callback;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
private _callback: (t: number, state: S | undefined) => S;
|
|
18
|
-
private _animationState: S | undefined = undefined;
|
|
19
|
-
|
|
20
|
-
public cancel() {
|
|
21
|
-
this.stop();
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
protected update(nextValue: number): void {
|
|
25
|
-
if (this._callback) {
|
|
26
|
-
this._animationState = this._callback(nextValue, this._animationState);
|
|
27
|
-
if (this._animationState?.finished) {
|
|
28
|
-
this.stop();
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
super.update(this._animationState?.current ?? nextValue);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import type { SkiaClockValue } from "../types";
|
|
2
|
-
|
|
3
|
-
import { RNSkReadonlyValue } from "./RNSkReadonlyValue";
|
|
4
|
-
|
|
5
|
-
enum RNSkClockState {
|
|
6
|
-
NotStarted = 0,
|
|
7
|
-
Running = 1,
|
|
8
|
-
Stopped = 2,
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export class RNSkClockValue
|
|
12
|
-
extends RNSkReadonlyValue<number>
|
|
13
|
-
implements SkiaClockValue
|
|
14
|
-
{
|
|
15
|
-
constructor(raf: (callback: (time: number) => void) => number) {
|
|
16
|
-
super(0);
|
|
17
|
-
this._raf = raf;
|
|
18
|
-
this.update(0);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
private _raf: (callback: (time: number) => void) => number;
|
|
22
|
-
private _start: number | undefined;
|
|
23
|
-
private _stop: number | undefined;
|
|
24
|
-
private _state: RNSkClockState = RNSkClockState.NotStarted;
|
|
25
|
-
|
|
26
|
-
private notifyUpdate = (_: number) => {
|
|
27
|
-
if (this._state === RNSkClockState.Running) {
|
|
28
|
-
const now = Date.now();
|
|
29
|
-
const deltaFromStart = now - this._start!;
|
|
30
|
-
this.tick(deltaFromStart);
|
|
31
|
-
this._raf(this.notifyUpdate);
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
protected tick(value: number) {
|
|
36
|
-
this.update(value);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
public start() {
|
|
40
|
-
if (this._state === RNSkClockState.NotStarted) {
|
|
41
|
-
this._start = Date.now();
|
|
42
|
-
this._stop = this._start;
|
|
43
|
-
}
|
|
44
|
-
// Subtract pause time from start
|
|
45
|
-
const timeSinceStop = Date.now() - this._stop!;
|
|
46
|
-
this._start! += timeSinceStop;
|
|
47
|
-
|
|
48
|
-
this._state = RNSkClockState.Running;
|
|
49
|
-
this._raf(this.notifyUpdate);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
public stop() {
|
|
53
|
-
if (this._state === RNSkClockState.Running) {
|
|
54
|
-
this._state = RNSkClockState.Stopped;
|
|
55
|
-
this._stop = Date.now();
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { DependencyList } from "react";
|
|
2
|
-
|
|
3
|
-
import { RNSkReadonlyValue } from "./RNSkReadonlyValue";
|
|
4
|
-
|
|
5
|
-
export class RNSkComputedValue<T> extends RNSkReadonlyValue<T> {
|
|
6
|
-
constructor(callback: () => T, dependencies: DependencyList) {
|
|
7
|
-
// Initialize dependencies - we can't call this yet, since
|
|
8
|
-
// super if not called and it requires a start value to be set.
|
|
9
|
-
const unsubscribers: Array<() => void> = [];
|
|
10
|
-
const notifyUpdateRef: { current: (() => void) | undefined } = {
|
|
11
|
-
current: undefined,
|
|
12
|
-
};
|
|
13
|
-
dependencies.forEach((dep) => {
|
|
14
|
-
if (
|
|
15
|
-
dep &&
|
|
16
|
-
typeof dep === "object" &&
|
|
17
|
-
"__typename__" in dep &&
|
|
18
|
-
"addListener" in dep
|
|
19
|
-
) {
|
|
20
|
-
unsubscribers.push(
|
|
21
|
-
(dep as RNSkReadonlyValue<unknown>).addListener(() =>
|
|
22
|
-
notifyUpdateRef.current?.()
|
|
23
|
-
)
|
|
24
|
-
);
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
super(callback());
|
|
28
|
-
this._unsubscribers = unsubscribers;
|
|
29
|
-
notifyUpdateRef.current = this.dependecyUpdated.bind(this);
|
|
30
|
-
this._callback = callback;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
private dependecyUpdated() {
|
|
34
|
-
this.update(this._callback());
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
private _callback: () => T;
|
|
38
|
-
private _unsubscribers: Array<() => void>;
|
|
39
|
-
|
|
40
|
-
public unsubscribe() {
|
|
41
|
-
this._unsubscribers.forEach((unsubscribe) => unsubscribe());
|
|
42
|
-
this._unsubscribers = [];
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
public dispose(): void {
|
|
46
|
-
this._unsubscribers.forEach((unsubscribe) => unsubscribe());
|
|
47
|
-
this._unsubscribers = [];
|
|
48
|
-
}
|
|
49
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import type { SkiaValue } from "../types";
|
|
2
|
-
|
|
3
|
-
export class RNSkReadonlyValue<T> implements SkiaValue<T> {
|
|
4
|
-
constructor(value: T) {
|
|
5
|
-
this._current = value;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
private _current: T;
|
|
9
|
-
private _listeners: Array<(value: T) => void> = [];
|
|
10
|
-
|
|
11
|
-
private notifyListeners(): void {
|
|
12
|
-
this._listeners.forEach((cb) => cb(this._current));
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
protected update(nextValue: T): void {
|
|
16
|
-
if (this._current !== nextValue) {
|
|
17
|
-
this._current = nextValue;
|
|
18
|
-
this.notifyListeners();
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
public readonly __typename__ = "RNSkValue";
|
|
23
|
-
|
|
24
|
-
public get current(): T {
|
|
25
|
-
return this._current;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
public addListener(cb: (value: T) => void) {
|
|
29
|
-
this._listeners.push(cb);
|
|
30
|
-
return () => {
|
|
31
|
-
this._listeners.splice(this._listeners.indexOf(cb), 1);
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
public dispose(): void {
|
|
36
|
-
this._listeners = [];
|
|
37
|
-
}
|
|
38
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import type { SkiaAnimation, SkiaValue } from "../types";
|
|
2
|
-
|
|
3
|
-
import { RNSkReadonlyValue } from "./RNSkReadonlyValue";
|
|
4
|
-
|
|
5
|
-
export class RNSkValue<T> extends RNSkReadonlyValue<T> implements SkiaValue<T> {
|
|
6
|
-
constructor(value: T) {
|
|
7
|
-
super(value);
|
|
8
|
-
this._unsubscribe = undefined;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
public set current(value: T) {
|
|
12
|
-
this.update(value);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
public get current(): T {
|
|
16
|
-
return super.current;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
private _unsubscribe: (() => void) | undefined;
|
|
20
|
-
|
|
21
|
-
private unsubscribe() {
|
|
22
|
-
if (this._unsubscribe) {
|
|
23
|
-
this._unsubscribe();
|
|
24
|
-
this._unsubscribe = undefined;
|
|
25
|
-
}
|
|
26
|
-
if (this._animation) {
|
|
27
|
-
this._animation.cancel();
|
|
28
|
-
this._animation = undefined;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
private subscribe(animation: SkiaAnimation | undefined) {
|
|
33
|
-
this.unsubscribe();
|
|
34
|
-
if (animation) {
|
|
35
|
-
this._animation = animation;
|
|
36
|
-
this._unsubscribe = animation.addListener(
|
|
37
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
38
|
-
// @ts-ignore
|
|
39
|
-
this.animationDidUpdate.bind(this)
|
|
40
|
-
);
|
|
41
|
-
this._animation.start();
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
private animationDidUpdate(value: T) {
|
|
46
|
-
this.update(value);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
private _animation: SkiaAnimation | undefined;
|
|
50
|
-
public get animation(): SkiaAnimation | undefined {
|
|
51
|
-
return this._animation;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
public set animation(v: SkiaAnimation | undefined) {
|
|
55
|
-
this.subscribe(v);
|
|
56
|
-
}
|
|
57
|
-
}
|
package/src/values/web/api.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
ISkiaValueApi,
|
|
3
|
-
SkiaMutableValue,
|
|
4
|
-
SkiaValue,
|
|
5
|
-
SkiaClockValue,
|
|
6
|
-
AnimationState,
|
|
7
|
-
SkiaAnimation,
|
|
8
|
-
} from "../types";
|
|
9
|
-
|
|
10
|
-
import { RNSkAnimation } from "./RNSkAnimation";
|
|
11
|
-
import { RNSkClockValue } from "./RNSkClockValue";
|
|
12
|
-
import { RNSkComputedValue } from "./RNSkComputedValue";
|
|
13
|
-
import { RNSkValue } from "./RNSkValue";
|
|
14
|
-
|
|
15
|
-
export const ValueApi: ISkiaValueApi = {
|
|
16
|
-
createValue: function <T>(initialValue: T): SkiaMutableValue<T> {
|
|
17
|
-
return new RNSkValue(initialValue);
|
|
18
|
-
},
|
|
19
|
-
createComputedValue: function <R>(
|
|
20
|
-
cb: () => R,
|
|
21
|
-
values: SkiaValue<unknown>[]
|
|
22
|
-
): SkiaValue<R> {
|
|
23
|
-
return new RNSkComputedValue(cb, values);
|
|
24
|
-
},
|
|
25
|
-
createClockValue: function (): SkiaClockValue {
|
|
26
|
-
return new RNSkClockValue(requestAnimationFrame.bind(window));
|
|
27
|
-
},
|
|
28
|
-
createAnimation: function <S extends AnimationState = AnimationState>(
|
|
29
|
-
cb: (t: number, state: S | undefined) => S
|
|
30
|
-
): SkiaAnimation {
|
|
31
|
-
return new RNSkAnimation(cb, requestAnimationFrame.bind(window));
|
|
32
|
-
},
|
|
33
|
-
};
|
package/src/values/web/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./api";
|
package/src/views/SkiaView.tsx
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
|
|
3
|
-
import type { SkRect } from "../skia/types";
|
|
4
|
-
import type { SkiaValue } from "../values";
|
|
5
|
-
import SkiaDrawViewNativeComponent from "../specs/SkiaDrawViewNativeComponent";
|
|
6
|
-
|
|
7
|
-
import { SkiaViewApi } from "./api";
|
|
8
|
-
import type { SkiaDrawViewProps } from "./types";
|
|
9
|
-
|
|
10
|
-
export const SkiaViewNativeId = { current: 1000 };
|
|
11
|
-
|
|
12
|
-
const NativeSkiaView = SkiaDrawViewNativeComponent;
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* @deprecated If you are looking to use the Skia imperative API, you can use:
|
|
16
|
-
* The picture API: https://shopify.github.io/react-native-skia/docs/shapes/pictures/
|
|
17
|
-
* The offscreen API: https://shopify.github.io/react-native-skia/docs/animations/textures
|
|
18
|
-
*/
|
|
19
|
-
export class SkiaView extends React.Component<SkiaDrawViewProps> {
|
|
20
|
-
constructor(props: SkiaDrawViewProps) {
|
|
21
|
-
super(props);
|
|
22
|
-
console.warn(
|
|
23
|
-
`The SkiaView component is deprecated and will be removed in the next release.
|
|
24
|
-
If you are looking to use the Skia imperative API, you can use:
|
|
25
|
-
* The picture API: https://shopify.github.io/react-native-skia/docs/shapes/pictures/
|
|
26
|
-
* The offscreen API: https://shopify.github.io/react-native-skia/docs/animations/textures`
|
|
27
|
-
);
|
|
28
|
-
this._nativeId = SkiaViewNativeId.current++;
|
|
29
|
-
const { onDraw, onSize } = props;
|
|
30
|
-
if (onDraw) {
|
|
31
|
-
assertSkiaViewApi();
|
|
32
|
-
SkiaViewApi.setJsiProperty(this._nativeId, "drawCallback", onDraw);
|
|
33
|
-
}
|
|
34
|
-
if (onSize) {
|
|
35
|
-
assertSkiaViewApi();
|
|
36
|
-
SkiaViewApi.setJsiProperty(this._nativeId, "onSize", onSize);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
private _nativeId: number;
|
|
41
|
-
|
|
42
|
-
public get nativeId() {
|
|
43
|
-
return this._nativeId;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
componentDidUpdate(prevProps: SkiaDrawViewProps) {
|
|
47
|
-
const { onDraw, onSize } = this.props;
|
|
48
|
-
if (onDraw !== prevProps.onDraw) {
|
|
49
|
-
assertSkiaViewApi();
|
|
50
|
-
SkiaViewApi.setJsiProperty(this._nativeId, "drawCallback", onDraw);
|
|
51
|
-
}
|
|
52
|
-
if (onSize !== prevProps.onSize) {
|
|
53
|
-
assertSkiaViewApi();
|
|
54
|
-
SkiaViewApi.setJsiProperty(this._nativeId, "onSize", onSize);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Creates a snapshot from the canvas in the surface
|
|
60
|
-
* @param rect Rect to use as bounds. Optional.
|
|
61
|
-
* @returns An Image object.
|
|
62
|
-
*/
|
|
63
|
-
public makeImageSnapshot(rect?: SkRect) {
|
|
64
|
-
assertSkiaViewApi();
|
|
65
|
-
return SkiaViewApi.makeImageSnapshot(this._nativeId, rect);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Sends a redraw request to the native SkiaView.
|
|
70
|
-
*/
|
|
71
|
-
public redraw() {
|
|
72
|
-
assertSkiaViewApi();
|
|
73
|
-
SkiaViewApi.requestRedraw(this._nativeId);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Registers one or move values as a dependant value of the Skia View. The view will
|
|
78
|
-
* The view will redraw itself when any of the values change.
|
|
79
|
-
* @param values Values to register
|
|
80
|
-
*/
|
|
81
|
-
public registerValues(values: SkiaValue<unknown>[]): () => void {
|
|
82
|
-
assertSkiaViewApi();
|
|
83
|
-
return SkiaViewApi.registerValuesInView(this._nativeId, values);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
render() {
|
|
87
|
-
const { mode, debug = false, onSize, ...viewProps } = this.props;
|
|
88
|
-
return (
|
|
89
|
-
<NativeSkiaView
|
|
90
|
-
collapsable={false}
|
|
91
|
-
nativeID={`${this._nativeId}`}
|
|
92
|
-
mode={mode ?? "default"}
|
|
93
|
-
debug={debug}
|
|
94
|
-
{...viewProps}
|
|
95
|
-
/>
|
|
96
|
-
);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
const assertSkiaViewApi = () => {
|
|
101
|
-
if (
|
|
102
|
-
SkiaViewApi === null ||
|
|
103
|
-
SkiaViewApi.setJsiProperty === null ||
|
|
104
|
-
SkiaViewApi.callJsiMethod === null ||
|
|
105
|
-
SkiaViewApi.registerValuesInView === null ||
|
|
106
|
-
SkiaViewApi.requestRedraw === null ||
|
|
107
|
-
SkiaViewApi.makeImageSnapshot === null
|
|
108
|
-
) {
|
|
109
|
-
throw Error("Skia View Api was not found.");
|
|
110
|
-
}
|
|
111
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { SkCanvas } from "../skia/types";
|
|
2
|
-
|
|
3
|
-
import type { DrawingInfo, SkiaDrawViewProps, TouchInfo } from "./types";
|
|
4
|
-
import { SkiaBaseWebView } from "./SkiaBaseWebView";
|
|
5
|
-
|
|
6
|
-
export class SkiaView extends SkiaBaseWebView<SkiaDrawViewProps> {
|
|
7
|
-
constructor(props: SkiaDrawViewProps) {
|
|
8
|
-
super(props);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
protected renderInCanvas(canvas: SkCanvas, touches: TouchInfo[]): void {
|
|
12
|
-
if (this.props.onDraw) {
|
|
13
|
-
const info: DrawingInfo = {
|
|
14
|
-
height: this.height,
|
|
15
|
-
width: this.width,
|
|
16
|
-
timestamp: Date.now(),
|
|
17
|
-
touches: touches.map((t) => [t]),
|
|
18
|
-
};
|
|
19
|
-
this.props.onDraw(canvas, info);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|