@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,165 +0,0 @@
|
|
1
|
-
// eslint-disable-next-line max-len
|
2
|
-
// Taken from https://github.com/facebook/react-native/blob/0b9ea60b4fee8cacc36e7160e31b91fc114dbc0d/Libraries/Animated/src/bezier.js
|
3
|
-
|
4
|
-
const NEWTON_ITERATIONS = 4;
|
5
|
-
const NEWTON_MIN_SLOPE = 0.001;
|
6
|
-
const SUBDIVISION_PRECISION = 0.0000001;
|
7
|
-
const SUBDIVISION_MAX_ITERATIONS = 10;
|
8
|
-
|
9
|
-
const kSplineTableSize = 11;
|
10
|
-
const kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);
|
11
|
-
|
12
|
-
const float32ArraySupported = typeof Float32Array === "function";
|
13
|
-
|
14
|
-
function a(aA1: number, aA2: number): number {
|
15
|
-
return 1.0 - 3.0 * aA2 + 3.0 * aA1;
|
16
|
-
}
|
17
|
-
|
18
|
-
function b(aA1: number, aA2: number): number {
|
19
|
-
return 3.0 * aA2 - 6.0 * aA1;
|
20
|
-
}
|
21
|
-
|
22
|
-
function c(aA1: number): number {
|
23
|
-
return 3.0 * aA1;
|
24
|
-
}
|
25
|
-
|
26
|
-
// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.
|
27
|
-
function calcBezier(aT: number, aA1: number, aA2: number): number {
|
28
|
-
return ((a(aA1, aA2) * aT + b(aA1, aA2)) * aT + c(aA1)) * aT;
|
29
|
-
}
|
30
|
-
|
31
|
-
// Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.
|
32
|
-
function getSlope(aT: number, aA1: number, aA2: number): number {
|
33
|
-
return 3.0 * a(aA1, aA2) * aT * aT + 2.0 * b(aA1, aA2) * aT + c(aA1);
|
34
|
-
}
|
35
|
-
|
36
|
-
function binarySubdivide({
|
37
|
-
aX,
|
38
|
-
_aA,
|
39
|
-
_aB,
|
40
|
-
mX1,
|
41
|
-
mX2,
|
42
|
-
}: {
|
43
|
-
aX: number;
|
44
|
-
_aA: number;
|
45
|
-
_aB: number;
|
46
|
-
mX1: number;
|
47
|
-
mX2: number;
|
48
|
-
}): number {
|
49
|
-
let currentX;
|
50
|
-
let currentT;
|
51
|
-
let i = 0;
|
52
|
-
let aA = _aA;
|
53
|
-
let aB = _aB;
|
54
|
-
do {
|
55
|
-
currentT = aA + (aB - aA) / 2.0;
|
56
|
-
currentX = calcBezier(currentT, mX1, mX2) - aX;
|
57
|
-
if (currentX > 0.0) {
|
58
|
-
aB = currentT;
|
59
|
-
} else {
|
60
|
-
aA = currentT;
|
61
|
-
}
|
62
|
-
} while (
|
63
|
-
Math.abs(currentX) > SUBDIVISION_PRECISION &&
|
64
|
-
++i < SUBDIVISION_MAX_ITERATIONS
|
65
|
-
);
|
66
|
-
|
67
|
-
return currentT;
|
68
|
-
}
|
69
|
-
|
70
|
-
function newtonRaphsonIterate(
|
71
|
-
aX: number,
|
72
|
-
_aGuessT: number,
|
73
|
-
mX1: number,
|
74
|
-
mX2: number
|
75
|
-
): number {
|
76
|
-
let aGuessT = _aGuessT;
|
77
|
-
for (let i = 0; i < NEWTON_ITERATIONS; ++i) {
|
78
|
-
const currentSlope = getSlope(aGuessT, mX1, mX2);
|
79
|
-
if (currentSlope === 0.0) {
|
80
|
-
return aGuessT;
|
81
|
-
}
|
82
|
-
|
83
|
-
const currentX = calcBezier(aGuessT, mX1, mX2) - aX;
|
84
|
-
aGuessT -= currentX / currentSlope;
|
85
|
-
}
|
86
|
-
|
87
|
-
return aGuessT;
|
88
|
-
}
|
89
|
-
|
90
|
-
export function bezier(
|
91
|
-
mX1: number,
|
92
|
-
mY1: number,
|
93
|
-
mX2: number,
|
94
|
-
mY2: number
|
95
|
-
): (x: number) => number {
|
96
|
-
if (!(mX1 >= 0 && mX1 <= 1 && mX2 >= 0 && mX2 <= 1)) {
|
97
|
-
throw new Error("bezier x values must be in [0, 1] range");
|
98
|
-
}
|
99
|
-
|
100
|
-
// Precompute samples table
|
101
|
-
const sampleValues = float32ArraySupported
|
102
|
-
? new Float32Array(kSplineTableSize)
|
103
|
-
: new Array(kSplineTableSize);
|
104
|
-
if (mX1 !== mY1 || mX2 !== mY2) {
|
105
|
-
for (let i = 0; i < kSplineTableSize; ++i) {
|
106
|
-
sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);
|
107
|
-
}
|
108
|
-
}
|
109
|
-
|
110
|
-
function getTForX(aX: number): number {
|
111
|
-
let intervalStart = 0.0;
|
112
|
-
let currentSample = 1;
|
113
|
-
const lastSample = kSplineTableSize - 1;
|
114
|
-
|
115
|
-
for (
|
116
|
-
;
|
117
|
-
currentSample !== lastSample && sampleValues[currentSample] <= aX;
|
118
|
-
++currentSample
|
119
|
-
) {
|
120
|
-
intervalStart += kSampleStepSize;
|
121
|
-
}
|
122
|
-
|
123
|
-
--currentSample;
|
124
|
-
|
125
|
-
// Interpolate to provide an initial guess for t
|
126
|
-
const dist =
|
127
|
-
(aX - sampleValues[currentSample]) /
|
128
|
-
(sampleValues[currentSample + 1] - sampleValues[currentSample]);
|
129
|
-
const guessForT = intervalStart + dist * kSampleStepSize;
|
130
|
-
|
131
|
-
const initialSlope = getSlope(guessForT, mX1, mX2);
|
132
|
-
if (initialSlope >= NEWTON_MIN_SLOPE) {
|
133
|
-
return newtonRaphsonIterate(aX, guessForT, mX1, mX2);
|
134
|
-
}
|
135
|
-
|
136
|
-
if (initialSlope === 0.0) {
|
137
|
-
return guessForT;
|
138
|
-
}
|
139
|
-
|
140
|
-
return binarySubdivide({
|
141
|
-
aX,
|
142
|
-
_aA: intervalStart,
|
143
|
-
_aB: intervalStart + kSampleStepSize,
|
144
|
-
mX1,
|
145
|
-
mX2,
|
146
|
-
});
|
147
|
-
}
|
148
|
-
|
149
|
-
return function (x: number): number {
|
150
|
-
if (mX1 === mY1 && mX2 === mY2) {
|
151
|
-
return x; // linear
|
152
|
-
}
|
153
|
-
|
154
|
-
// Because JavaScript number are imprecise, we should guarantee the extremes are right.
|
155
|
-
if (x === 0) {
|
156
|
-
return 0;
|
157
|
-
}
|
158
|
-
|
159
|
-
if (x === 1) {
|
160
|
-
return 1;
|
161
|
-
}
|
162
|
-
|
163
|
-
return calcBezier(getTForX(x), mY1, mY2);
|
164
|
-
};
|
165
|
-
}
|
@@ -1,50 +0,0 @@
|
|
1
|
-
import type {
|
2
|
-
RequiredAnimationParams,
|
3
|
-
AnimationParams,
|
4
|
-
TimingConfig,
|
5
|
-
} from "../../types";
|
6
|
-
|
7
|
-
const DefaultParameters = {
|
8
|
-
to: 1,
|
9
|
-
loop: false,
|
10
|
-
yoyo: false,
|
11
|
-
immediate: true,
|
12
|
-
};
|
13
|
-
|
14
|
-
const DefaultTimingConfig = {
|
15
|
-
duration: 1000,
|
16
|
-
easing: (t: number) => t,
|
17
|
-
};
|
18
|
-
|
19
|
-
/**
|
20
|
-
* Resolves parameters from optional values to a single object
|
21
|
-
* @param toOrParams Params or to value
|
22
|
-
* @param config timing/spring configuration
|
23
|
-
*/
|
24
|
-
export const getResolvedParams = (
|
25
|
-
toOrParams: number | AnimationParams,
|
26
|
-
config?: TimingConfig
|
27
|
-
): RequiredAnimationParams & Required<TimingConfig> => {
|
28
|
-
let resolvedParameters: RequiredAnimationParams = {
|
29
|
-
...DefaultParameters,
|
30
|
-
};
|
31
|
-
|
32
|
-
if (typeof toOrParams === "number") {
|
33
|
-
resolvedParameters.to = toOrParams;
|
34
|
-
} else {
|
35
|
-
resolvedParameters = {
|
36
|
-
from: toOrParams.from ?? resolvedParameters.from,
|
37
|
-
to: toOrParams.to ?? resolvedParameters.to,
|
38
|
-
loop: toOrParams.loop ?? resolvedParameters.loop,
|
39
|
-
yoyo: toOrParams.yoyo ?? resolvedParameters.yoyo,
|
40
|
-
};
|
41
|
-
}
|
42
|
-
|
43
|
-
const resolvedConfig: Required<TimingConfig> = { ...DefaultTimingConfig };
|
44
|
-
if (config) {
|
45
|
-
resolvedConfig.duration = config.duration ?? DefaultTimingConfig.duration;
|
46
|
-
resolvedConfig.easing = config.easing ?? DefaultTimingConfig.easing;
|
47
|
-
}
|
48
|
-
|
49
|
-
return { ...resolvedParameters, ...resolvedConfig };
|
50
|
-
};
|
@@ -1,44 +0,0 @@
|
|
1
|
-
import type { AnimationState } from "../../../values/types";
|
2
|
-
|
3
|
-
/**
|
4
|
-
* Calculates and returns a timing value based on the
|
5
|
-
* input parameters. The timing value is a number between
|
6
|
-
* 0 and 1.
|
7
|
-
* @param t
|
8
|
-
* @param duration
|
9
|
-
* @param easing
|
10
|
-
* @param loop
|
11
|
-
* @param yoyo
|
12
|
-
* @param onStop
|
13
|
-
* @returns
|
14
|
-
*/
|
15
|
-
export const timing = (
|
16
|
-
t: number,
|
17
|
-
duration: number,
|
18
|
-
easing: (t: number) => number,
|
19
|
-
loop: boolean,
|
20
|
-
yoyo: boolean,
|
21
|
-
state: AnimationState
|
22
|
-
) => {
|
23
|
-
let current = t / duration;
|
24
|
-
let { finished } = state;
|
25
|
-
// Side effect to stop animation when duration is reached (if loop is false)
|
26
|
-
if (current >= 1.0 && !loop) {
|
27
|
-
finished = true;
|
28
|
-
current = 1.0;
|
29
|
-
}
|
30
|
-
// calculate return value
|
31
|
-
let n = current % 1;
|
32
|
-
if (yoyo) {
|
33
|
-
n = current % 2.0 >= 1.0 ? 1 - (current % 1) : current % 1;
|
34
|
-
} else if (!loop) {
|
35
|
-
if (current >= 1.0) {
|
36
|
-
n = 1.0;
|
37
|
-
}
|
38
|
-
}
|
39
|
-
current = easing(Math.max(0, Math.min(1, n)));
|
40
|
-
return {
|
41
|
-
current,
|
42
|
-
finished,
|
43
|
-
};
|
44
|
-
};
|
@@ -1,36 +0,0 @@
|
|
1
|
-
import type { SkiaMutableValue, SkiaAnimation } from "../../values/types";
|
2
|
-
import type {
|
3
|
-
AnimationParams,
|
4
|
-
TimingConfig,
|
5
|
-
AnimationCallback,
|
6
|
-
} from "../types";
|
7
|
-
|
8
|
-
import { getResolvedParams } from "./functions";
|
9
|
-
import { createTiming } from "./createTiming";
|
10
|
-
/**
|
11
|
-
* @deprecated Use Reanimated 3 for animations:
|
12
|
-
* https://shopify.github.io/react-native-skia/docs/animations/animations
|
13
|
-
*
|
14
|
-
* Creates a new animation on an existing value that will be driven by
|
15
|
-
* an animation value. The value will be run from / to the value in
|
16
|
-
* params and modified by the provided easing curve for the length of
|
17
|
-
* the duration. When the value has reached its desired "to" value the
|
18
|
-
* animation will be stopped.
|
19
|
-
*
|
20
|
-
* @param value The value to animate
|
21
|
-
* @param toOrParams To value or Animation parameters
|
22
|
-
* @param config Spring or timing configuration
|
23
|
-
* @returns an animation value that can be used to start/stop
|
24
|
-
* the animation.
|
25
|
-
*/
|
26
|
-
export const runTiming = (
|
27
|
-
value: SkiaMutableValue<number>,
|
28
|
-
toOrParams: number | AnimationParams,
|
29
|
-
config?: TimingConfig,
|
30
|
-
callback?: AnimationCallback
|
31
|
-
): SkiaAnimation => {
|
32
|
-
const resolvedParameters = getResolvedParams(toOrParams, config);
|
33
|
-
const animation = createTiming(resolvedParameters, value, callback);
|
34
|
-
value.animation = animation;
|
35
|
-
return animation;
|
36
|
-
};
|
@@ -1,21 +0,0 @@
|
|
1
|
-
import type { TimingConfig } from "../types";
|
2
|
-
|
3
|
-
import { useTiming } from "./useTiming";
|
4
|
-
|
5
|
-
/**
|
6
|
-
* @deprecated Use Reanimated 3 for animations:
|
7
|
-
* https://shopify.github.io/react-native-skia/docs/animations/animations
|
8
|
-
*
|
9
|
-
* Configures a looped timing value. The value will go back and forth
|
10
|
-
* between 0 and 1 and back.
|
11
|
-
* @param config Timing configuration for easing and duration
|
12
|
-
* @returns A value that can be used for further animations
|
13
|
-
*/
|
14
|
-
export const useLoop = (config?: TimingConfig) =>
|
15
|
-
useTiming(
|
16
|
-
{
|
17
|
-
yoyo: true,
|
18
|
-
loop: true,
|
19
|
-
},
|
20
|
-
config
|
21
|
-
);
|
@@ -1,71 +0,0 @@
|
|
1
|
-
import { useEffect, useMemo, useRef } from "react";
|
2
|
-
|
3
|
-
import type { SkiaValue, SkiaAnimation } from "../../values/types";
|
4
|
-
import type {
|
5
|
-
AnimationParams,
|
6
|
-
TimingConfig,
|
7
|
-
AnimationCallback,
|
8
|
-
} from "../types";
|
9
|
-
import { useValue } from "../../values/hooks/useValue";
|
10
|
-
|
11
|
-
import { getResolvedParams } from "./functions";
|
12
|
-
import { createTiming } from "./createTiming";
|
13
|
-
|
14
|
-
/**
|
15
|
-
* @deprecated Use Reanimated 3 for animations:
|
16
|
-
* https://shopify.github.io/react-native-skia/docs/animations/animations
|
17
|
-
*
|
18
|
-
* Creats an animation value that will run whenever
|
19
|
-
* the animation parameters change. The animation start immediately.
|
20
|
-
* @param toOrParams
|
21
|
-
* @param config
|
22
|
-
* @returns A value that is animated
|
23
|
-
*/
|
24
|
-
export const useTiming = (
|
25
|
-
toOrParams: number | AnimationParams,
|
26
|
-
config?: TimingConfig,
|
27
|
-
callback?: AnimationCallback
|
28
|
-
): SkiaValue<number> => {
|
29
|
-
// Resolve parameters - keep a cached version to avoid
|
30
|
-
// unnecesary re-renders.
|
31
|
-
const prevCfgRef = useRef<ReturnType<typeof getResolvedParams>>();
|
32
|
-
const resolvedParameters = useMemo(() => {
|
33
|
-
const nextParams = getResolvedParams(toOrParams, config);
|
34
|
-
if (!equals(prevCfgRef.current, nextParams)) {
|
35
|
-
prevCfgRef.current = nextParams;
|
36
|
-
}
|
37
|
-
return prevCfgRef.current!;
|
38
|
-
}, [config, toOrParams]);
|
39
|
-
|
40
|
-
// Create value
|
41
|
-
const value = useValue(resolvedParameters.from ?? 0);
|
42
|
-
|
43
|
-
// Create timing animation - keep a cached version to avoid
|
44
|
-
// uneccessary recreation of animations
|
45
|
-
const prevAnimationRef = useRef<SkiaAnimation>();
|
46
|
-
const prevParamsRef = useRef<typeof resolvedParameters>();
|
47
|
-
const animation = useMemo(() => {
|
48
|
-
if (!equals(prevParamsRef.current, resolvedParameters)) {
|
49
|
-
prevParamsRef.current = resolvedParameters;
|
50
|
-
prevAnimationRef.current = createTiming(
|
51
|
-
resolvedParameters,
|
52
|
-
value,
|
53
|
-
callback
|
54
|
-
);
|
55
|
-
}
|
56
|
-
return prevAnimationRef.current!;
|
57
|
-
}, [callback, resolvedParameters, value]);
|
58
|
-
|
59
|
-
// Run animation on the value - and stop it on unmount
|
60
|
-
useEffect(() => {
|
61
|
-
value.animation = animation;
|
62
|
-
return () => (value.animation = undefined);
|
63
|
-
}, [animation, value]);
|
64
|
-
|
65
|
-
// Return the value that is animated
|
66
|
-
return value;
|
67
|
-
};
|
68
|
-
|
69
|
-
const equals = <T1, T2>(a: T1, b: T2) => {
|
70
|
-
return JSON.stringify(a) === JSON.stringify(b);
|
71
|
-
};
|
@@ -1,21 +0,0 @@
|
|
1
|
-
import type { CustomDrawingNodeProps, DrawingContext } from "../../types";
|
2
|
-
import { NodeType } from "../../types";
|
3
|
-
import { JsiDrawingNode } from "../DrawingNode";
|
4
|
-
import type { NodeContext } from "../Node";
|
5
|
-
|
6
|
-
export class CustomDrawingNode extends JsiDrawingNode<
|
7
|
-
CustomDrawingNodeProps,
|
8
|
-
null
|
9
|
-
> {
|
10
|
-
constructor(ctx: NodeContext, props: CustomDrawingNodeProps) {
|
11
|
-
super(ctx, NodeType.Drawing, props);
|
12
|
-
}
|
13
|
-
|
14
|
-
deriveProps() {
|
15
|
-
return null;
|
16
|
-
}
|
17
|
-
|
18
|
-
draw(ctx: DrawingContext) {
|
19
|
-
this.props.drawing(ctx);
|
20
|
-
}
|
21
|
-
}
|
@@ -1,196 +0,0 @@
|
|
1
|
-
import type { Node } from "../dom/types";
|
2
|
-
import type { SkiaValue } from "../values";
|
3
|
-
|
4
|
-
import type { AnimatedProps } from "./processors";
|
5
|
-
import { isSelector, isValue } from "./processors";
|
6
|
-
import { mapKeys } from "./typeddash";
|
7
|
-
|
8
|
-
type Unsubscribe = () => void;
|
9
|
-
type Mutator = (value: unknown) => void;
|
10
|
-
|
11
|
-
type SubscriptionState = {
|
12
|
-
nodes: Map<Node<unknown>, Mutator[]>;
|
13
|
-
unsubscribe: null | Unsubscribe;
|
14
|
-
};
|
15
|
-
|
16
|
-
export class DependencyManager {
|
17
|
-
registerValues: (values: Array<SkiaValue<unknown>>) => () => void;
|
18
|
-
subscriptions: Map<SkiaValue<unknown>, SubscriptionState> = new Map();
|
19
|
-
unregisterDependantValues: null | Unsubscribe = null;
|
20
|
-
|
21
|
-
constructor(
|
22
|
-
registerValues: (values: Array<SkiaValue<unknown>>) => () => void
|
23
|
-
) {
|
24
|
-
this.registerValues = registerValues;
|
25
|
-
}
|
26
|
-
|
27
|
-
/**
|
28
|
-
* Call to unsubscribe all value listeners from the given node based
|
29
|
-
* on the current list of subscriptions for the node. This function
|
30
|
-
* is typically called when the node is unmounted or when one or more
|
31
|
-
* properties have changed.
|
32
|
-
* @param node Node to unsubscribe value listeners from
|
33
|
-
*/
|
34
|
-
unsubscribeNode(node: Node<unknown>) {
|
35
|
-
const subscriptions = Array.from(this.subscriptions.values()).filter((p) =>
|
36
|
-
p.nodes.has(node)
|
37
|
-
);
|
38
|
-
|
39
|
-
if (subscriptions) {
|
40
|
-
subscriptions.forEach((si) => {
|
41
|
-
// Delete node from subscription
|
42
|
-
si.nodes.delete(node);
|
43
|
-
|
44
|
-
// Remove subscription if there are no listeneres left on the value
|
45
|
-
if (si.nodes.size === 0) {
|
46
|
-
// There are no more nodes subscribing to this value, we can call
|
47
|
-
// unsubscribe on it.
|
48
|
-
if (!si.unsubscribe) {
|
49
|
-
throw new Error("Failed to unsubscribe to value subscription");
|
50
|
-
}
|
51
|
-
si.unsubscribe && si.unsubscribe();
|
52
|
-
|
53
|
-
// Remove from subscription states as well
|
54
|
-
const element = Array.from(this.subscriptions.entries()).find(
|
55
|
-
([_, sub]) => sub === si
|
56
|
-
);
|
57
|
-
if (!element) {
|
58
|
-
throw new Error("Failed to find value subscription");
|
59
|
-
}
|
60
|
-
if (!this.subscriptions.delete(element[0])) {
|
61
|
-
throw new Error("Failed to delete value subscription");
|
62
|
-
}
|
63
|
-
}
|
64
|
-
});
|
65
|
-
}
|
66
|
-
}
|
67
|
-
|
68
|
-
/**
|
69
|
-
* Adds listeners to the provided values so that the node is notified
|
70
|
-
* when a value changes. This is done in an optimized way so that this
|
71
|
-
* class only needs to listen to the value once and then forwards the
|
72
|
-
* change to the node and its listener. This method is typically called
|
73
|
-
* when the node is mounted and when one or more props on the node changes.
|
74
|
-
* @param node Node to subscribe to value changes for
|
75
|
-
* @param props Node's properties
|
76
|
-
*/
|
77
|
-
subscribeNode<P>(node: Node<unknown>, props: AnimatedProps<P>) {
|
78
|
-
// Get mutators from node's properties
|
79
|
-
const propSubscriptions = initializePropertySubscriptions(node, props);
|
80
|
-
if (propSubscriptions.length === 0) {
|
81
|
-
return;
|
82
|
-
}
|
83
|
-
|
84
|
-
// Install all mutators for the node
|
85
|
-
propSubscriptions.forEach((ps) => {
|
86
|
-
// Do we already have a state for this SkiaValue
|
87
|
-
let subscriptionState = this.subscriptions.get(ps.value);
|
88
|
-
if (!subscriptionState) {
|
89
|
-
// Let's create a new subscription state for the skia value
|
90
|
-
subscriptionState = {
|
91
|
-
nodes: new Map(),
|
92
|
-
unsubscribe: null,
|
93
|
-
};
|
94
|
-
// Add single subscription to the new value
|
95
|
-
subscriptionState.unsubscribe = ps.value.addListener((v) => {
|
96
|
-
subscriptionState!.nodes.forEach((mutators) =>
|
97
|
-
mutators.forEach((m) => m(v))
|
98
|
-
);
|
99
|
-
});
|
100
|
-
this.subscriptions.set(ps.value, subscriptionState);
|
101
|
-
}
|
102
|
-
// subscription mutators
|
103
|
-
subscriptionState.nodes.set(
|
104
|
-
node,
|
105
|
-
propSubscriptions
|
106
|
-
.filter((m) => m.value === ps.value)
|
107
|
-
.map((m) => m.mutator)
|
108
|
-
);
|
109
|
-
});
|
110
|
-
}
|
111
|
-
|
112
|
-
/**
|
113
|
-
* Called when the hosting container is mounted or updated. This ensures that we have
|
114
|
-
* a ref to the underlying SkiaView so that we can registers redraw listeners
|
115
|
-
* on values used in the current View automatically.
|
116
|
-
*/
|
117
|
-
update() {
|
118
|
-
// Remove any previous registrations
|
119
|
-
if (this.unregisterDependantValues) {
|
120
|
-
this.unregisterDependantValues();
|
121
|
-
}
|
122
|
-
|
123
|
-
// Register redraw requests on the SkiaView for each unique value
|
124
|
-
this.unregisterDependantValues = this.registerValues(
|
125
|
-
Array.from(this.subscriptions.keys())
|
126
|
-
);
|
127
|
-
}
|
128
|
-
|
129
|
-
/**
|
130
|
-
* Called when the hosting container is unmounted or recreated. This ensures that we remove
|
131
|
-
* all subscriptions to Skia values so that we don't have any listeners left after
|
132
|
-
* the component is removed.
|
133
|
-
*/
|
134
|
-
remove() {
|
135
|
-
// 1) Unregister redraw requests
|
136
|
-
if (this.unregisterDependantValues) {
|
137
|
-
this.unregisterDependantValues();
|
138
|
-
this.unregisterDependantValues = null;
|
139
|
-
}
|
140
|
-
|
141
|
-
// 2) Unregister nodes
|
142
|
-
Array.from(this.subscriptions.values()).forEach((si) => {
|
143
|
-
Array.from(si.nodes.keys()).forEach((node) => this.unsubscribeNode(node));
|
144
|
-
});
|
145
|
-
|
146
|
-
// 3) Clear the rest of the subscriptions
|
147
|
-
this.subscriptions.clear();
|
148
|
-
}
|
149
|
-
}
|
150
|
-
|
151
|
-
const initializePropertySubscriptions = <P,>(
|
152
|
-
node: Node<P>,
|
153
|
-
props: AnimatedProps<P>
|
154
|
-
) => {
|
155
|
-
const nodePropSubscriptions: Array<{
|
156
|
-
value: SkiaValue<unknown>;
|
157
|
-
mutator: Mutator;
|
158
|
-
}> = [];
|
159
|
-
|
160
|
-
mapKeys(props).forEach((key) => {
|
161
|
-
if (key === "children") {
|
162
|
-
return;
|
163
|
-
}
|
164
|
-
const propvalue = props[key];
|
165
|
-
|
166
|
-
if (isValue(propvalue)) {
|
167
|
-
// Subscribe to changes
|
168
|
-
nodePropSubscriptions.push({
|
169
|
-
value: propvalue,
|
170
|
-
mutator: (v) => {
|
171
|
-
node.setProp(key, v as P[typeof key]);
|
172
|
-
},
|
173
|
-
});
|
174
|
-
// Set initial value
|
175
|
-
node.setProp(key, (propvalue as SkiaValue<P[typeof key]>).current);
|
176
|
-
} else if (isSelector(propvalue)) {
|
177
|
-
// Subscribe to changes
|
178
|
-
nodePropSubscriptions.push({
|
179
|
-
value: propvalue.value,
|
180
|
-
mutator: (v) => {
|
181
|
-
node.setProp(key, propvalue.selector(v) as P[typeof key]);
|
182
|
-
},
|
183
|
-
});
|
184
|
-
// Set initial value
|
185
|
-
node.setProp(
|
186
|
-
key,
|
187
|
-
propvalue.selector(propvalue.value.current) as P[typeof key]
|
188
|
-
);
|
189
|
-
} else {
|
190
|
-
// Set initial value
|
191
|
-
node.setProp(key, propvalue as P[typeof key]);
|
192
|
-
}
|
193
|
-
});
|
194
|
-
|
195
|
-
return nodePropSubscriptions;
|
196
|
-
};
|
@@ -1,12 +0,0 @@
|
|
1
|
-
import React from "react";
|
2
|
-
|
3
|
-
import type { CustomDrawingNodeProps } from "../../dom/types";
|
4
|
-
|
5
|
-
/**
|
6
|
-
* @deprecated If you are looking to use the Skia imperative API, you can use:
|
7
|
-
* The picture API: https://shopify.github.io/react-native-skia/docs/shapes/pictures/
|
8
|
-
* The offscreen API: https://shopify.github.io/react-native-skia/docs/animations/textures
|
9
|
-
*/
|
10
|
-
export const Drawing = (props: CustomDrawingNodeProps) => {
|
11
|
-
return <skDrawing {...props} />;
|
12
|
-
};
|
@@ -1,10 +0,0 @@
|
|
1
|
-
import codegenNativeComponent from "react-native/Libraries/Utilities/codegenNativeComponent";
|
2
|
-
import type { ViewProps } from "react-native";
|
3
|
-
|
4
|
-
export interface NativeProps extends ViewProps {
|
5
|
-
mode: string;
|
6
|
-
debug?: boolean;
|
7
|
-
}
|
8
|
-
|
9
|
-
// eslint-disable-next-line import/no-default-export
|
10
|
-
export default codegenNativeComponent<NativeProps>("SkiaDrawView");
|