@shopify/react-native-skia 0.1.229 → 0.1.231
Sign up to get free protection for your applications and to get access to all the features.
- package/android/CMakeLists.txt +1 -0
- package/android/cpp/jni/JniLoad.cpp +0 -2
- package/android/cpp/rnskia-android/SkiaOpenGLSurfaceFactory.cpp +2 -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/JsiSkAnimatedImage.h +1 -1
- package/cpp/api/JsiSkApi.h +4 -1
- package/cpp/api/JsiSkDataFactory.h +6 -6
- package/cpp/api/JsiSkImage.h +4 -4
- package/cpp/api/JsiSkParagraph.h +15 -0
- package/cpp/api/JsiSkParagraphBuilder.h +3 -32
- package/cpp/api/JsiSkParagraphBuilderFactory.h +54 -0
- package/cpp/api/JsiSkPath.h +1 -1
- package/cpp/api/JsiSkRRect.h +30 -3
- package/cpp/api/third_party/base64.cpp +153 -0
- package/cpp/api/third_party/base64.h +50 -0
- package/cpp/jsi/JsiPromises.h +1 -1
- 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/cpp/rnskia/dom/props/FontProp.h +4 -1
- package/cpp/rnskia/dom/props/RRectProp.h +50 -0
- package/ios/RNSkia-iOS/SkiaMetalSurfaceFactory.mm +1 -1
- 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 +3 -3
- 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/datatypes/Rect.d.ts +1 -1
- package/lib/commonjs/dom/nodes/drawings/RRectNode.d.ts +3 -3
- package/lib/commonjs/dom/nodes/drawings/RRectNode.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/headless/index.d.ts +3 -1
- package/lib/commonjs/headless/index.js +12 -6
- package/lib/commonjs/headless/index.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/Canvas.d.ts +4 -4
- package/lib/commonjs/skia/types/Canvas.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/types/RRect.d.ts +9 -0
- package/lib/commonjs/skia/types/RRect.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkCanvas.d.ts +4 -4
- package/lib/commonjs/skia/web/JsiSkCanvas.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/skia/web/JsiSkPath.d.ts +2 -2
- package/lib/commonjs/skia/web/JsiSkPath.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkRRect.d.ts +2 -2
- package/lib/commonjs/skia/web/JsiSkRRect.js +4 -0
- package/lib/commonjs/skia/web/JsiSkRRect.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 +3 -3
- 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/datatypes/Rect.d.ts +1 -1
- package/lib/module/dom/nodes/drawings/RRectNode.d.ts +3 -3
- package/lib/module/dom/nodes/drawings/RRectNode.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/headless/index.d.ts +3 -1
- package/lib/module/headless/index.js +5 -3
- package/lib/module/headless/index.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/Canvas.d.ts +4 -4
- package/lib/module/skia/types/Canvas.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/types/RRect.d.ts +9 -0
- package/lib/module/skia/types/RRect.js.map +1 -1
- package/lib/module/skia/web/JsiSkCanvas.d.ts +4 -4
- package/lib/module/skia/web/JsiSkCanvas.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/skia/web/JsiSkPath.d.ts +2 -2
- package/lib/module/skia/web/JsiSkPath.js.map +1 -1
- package/lib/module/skia/web/JsiSkRRect.d.ts +2 -2
- package/lib/module/skia/web/JsiSkRRect.js +4 -0
- package/lib/module/skia/web/JsiSkRRect.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 +3 -3
- package/lib/typescript/src/dom/nodes/Node.d.ts +0 -3
- package/lib/typescript/src/dom/nodes/datatypes/Rect.d.ts +1 -1
- package/lib/typescript/src/dom/nodes/drawings/RRectNode.d.ts +3 -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/headless/index.d.ts +3 -1
- 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 +4 -4
- 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/types/RRect.d.ts +9 -0
- package/lib/typescript/src/skia/web/JsiSkCanvas.d.ts +4 -4
- package/lib/typescript/src/skia/web/JsiSkParagraph.d.ts +3 -0
- package/lib/typescript/src/skia/web/JsiSkPath.d.ts +2 -2
- package/lib/typescript/src/skia/web/JsiSkRRect.d.ts +2 -2
- 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/libs/android/arm64-v8a/libskia.a +0 -0
- package/libs/android/armeabi-v7a/libskia.a +0 -0
- package/libs/android/x86/libskia.a +0 -0
- package/libs/android/x86_64/libskia.a +0 -0
- package/libs/ios/libskia.xcframework/ios-arm64_arm64e/libskia.a +0 -0
- package/libs/ios/libskia.xcframework/ios-arm64_arm64e_x86_64-simulator/libskia.a +0 -0
- package/libs/ios/libskottie.xcframework/Info.plist +5 -5
- package/libs/ios/libskottie.xcframework/ios-arm64_arm64e/libskottie.a +0 -0
- package/libs/ios/libskottie.xcframework/ios-arm64_arm64e_x86_64-simulator/libskottie.a +0 -0
- package/libs/ios/libskparagraph.xcframework/ios-arm64_arm64e/libskparagraph.a +0 -0
- package/libs/ios/libskparagraph.xcframework/ios-arm64_arm64e_x86_64-simulator/libskparagraph.a +0 -0
- package/libs/ios/libsksg.xcframework/ios-arm64_arm64e/libsksg.a +0 -0
- package/libs/ios/libsksg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsksg.a +0 -0
- package/libs/ios/libskshaper.xcframework/Info.plist +5 -5
- package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e/libskshaper.a +0 -0
- package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e_x86_64-simulator/libskshaper.a +0 -0
- package/libs/ios/libskunicode.xcframework/ios-arm64_arm64e/libskunicode.a +0 -0
- package/libs/ios/libskunicode.xcframework/ios-arm64_arm64e_x86_64-simulator/libskunicode.a +0 -0
- package/libs/ios/libsvg.xcframework/Info.plist +5 -5
- package/libs/ios/libsvg.xcframework/ios-arm64_arm64e/libsvg.a +0 -0
- package/libs/ios/libsvg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsvg.a +0 -0
- 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/RRectNode.ts +2 -2
- package/src/dom/nodes/drawings/index.ts +0 -1
- package/src/dom/types/Common.ts +2 -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/headless/index.ts +7 -3
- 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/Canvas.ts +4 -4
- package/src/skia/types/Paragraph/Paragraph.ts +25 -0
- package/src/skia/types/Path/Path.ts +2 -2
- package/src/skia/types/RRect.ts +11 -0
- package/src/skia/web/JsiSkCanvas.ts +4 -4
- package/src/skia/web/JsiSkParagraph.ts +11 -0
- package/src/skia/web/JsiSkParagraphBuilderFactory.ts +9 -3
- package/src/skia/web/JsiSkPath.ts +2 -2
- package/src/skia/web/JsiSkRRect.ts +23 -2
- 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,147 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.bezier = bezier;
|
7
|
-
// eslint-disable-next-line max-len
|
8
|
-
// Taken from https://github.com/facebook/react-native/blob/0b9ea60b4fee8cacc36e7160e31b91fc114dbc0d/Libraries/Animated/src/bezier.js
|
9
|
-
const NEWTON_ITERATIONS = 4;
|
10
|
-
const NEWTON_MIN_SLOPE = 0.001;
|
11
|
-
const SUBDIVISION_PRECISION = 0.0000001;
|
12
|
-
const SUBDIVISION_MAX_ITERATIONS = 10;
|
13
|
-
const kSplineTableSize = 11;
|
14
|
-
const kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);
|
15
|
-
const float32ArraySupported = typeof Float32Array === "function";
|
16
|
-
|
17
|
-
function a(aA1, aA2) {
|
18
|
-
return 1.0 - 3.0 * aA2 + 3.0 * aA1;
|
19
|
-
}
|
20
|
-
|
21
|
-
function b(aA1, aA2) {
|
22
|
-
return 3.0 * aA2 - 6.0 * aA1;
|
23
|
-
}
|
24
|
-
|
25
|
-
function c(aA1) {
|
26
|
-
return 3.0 * aA1;
|
27
|
-
} // Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.
|
28
|
-
|
29
|
-
|
30
|
-
function calcBezier(aT, aA1, aA2) {
|
31
|
-
return ((a(aA1, aA2) * aT + b(aA1, aA2)) * aT + c(aA1)) * aT;
|
32
|
-
} // Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.
|
33
|
-
|
34
|
-
|
35
|
-
function getSlope(aT, aA1, aA2) {
|
36
|
-
return 3.0 * a(aA1, aA2) * aT * aT + 2.0 * b(aA1, aA2) * aT + c(aA1);
|
37
|
-
}
|
38
|
-
|
39
|
-
function binarySubdivide(_ref) {
|
40
|
-
let {
|
41
|
-
aX,
|
42
|
-
_aA,
|
43
|
-
_aB,
|
44
|
-
mX1,
|
45
|
-
mX2
|
46
|
-
} = _ref;
|
47
|
-
let currentX;
|
48
|
-
let currentT;
|
49
|
-
let i = 0;
|
50
|
-
let aA = _aA;
|
51
|
-
let aB = _aB;
|
52
|
-
|
53
|
-
do {
|
54
|
-
currentT = aA + (aB - aA) / 2.0;
|
55
|
-
currentX = calcBezier(currentT, mX1, mX2) - aX;
|
56
|
-
|
57
|
-
if (currentX > 0.0) {
|
58
|
-
aB = currentT;
|
59
|
-
} else {
|
60
|
-
aA = currentT;
|
61
|
-
}
|
62
|
-
} while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);
|
63
|
-
|
64
|
-
return currentT;
|
65
|
-
}
|
66
|
-
|
67
|
-
function newtonRaphsonIterate(aX, _aGuessT, mX1, mX2) {
|
68
|
-
let aGuessT = _aGuessT;
|
69
|
-
|
70
|
-
for (let i = 0; i < NEWTON_ITERATIONS; ++i) {
|
71
|
-
const currentSlope = getSlope(aGuessT, mX1, mX2);
|
72
|
-
|
73
|
-
if (currentSlope === 0.0) {
|
74
|
-
return aGuessT;
|
75
|
-
}
|
76
|
-
|
77
|
-
const currentX = calcBezier(aGuessT, mX1, mX2) - aX;
|
78
|
-
aGuessT -= currentX / currentSlope;
|
79
|
-
}
|
80
|
-
|
81
|
-
return aGuessT;
|
82
|
-
}
|
83
|
-
|
84
|
-
function bezier(mX1, mY1, mX2, mY2) {
|
85
|
-
if (!(mX1 >= 0 && mX1 <= 1 && mX2 >= 0 && mX2 <= 1)) {
|
86
|
-
throw new Error("bezier x values must be in [0, 1] range");
|
87
|
-
} // Precompute samples table
|
88
|
-
|
89
|
-
|
90
|
-
const sampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);
|
91
|
-
|
92
|
-
if (mX1 !== mY1 || mX2 !== mY2) {
|
93
|
-
for (let i = 0; i < kSplineTableSize; ++i) {
|
94
|
-
sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);
|
95
|
-
}
|
96
|
-
}
|
97
|
-
|
98
|
-
function getTForX(aX) {
|
99
|
-
let intervalStart = 0.0;
|
100
|
-
let currentSample = 1;
|
101
|
-
const lastSample = kSplineTableSize - 1;
|
102
|
-
|
103
|
-
for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) {
|
104
|
-
intervalStart += kSampleStepSize;
|
105
|
-
}
|
106
|
-
|
107
|
-
--currentSample; // Interpolate to provide an initial guess for t
|
108
|
-
|
109
|
-
const dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]);
|
110
|
-
const guessForT = intervalStart + dist * kSampleStepSize;
|
111
|
-
const initialSlope = getSlope(guessForT, mX1, mX2);
|
112
|
-
|
113
|
-
if (initialSlope >= NEWTON_MIN_SLOPE) {
|
114
|
-
return newtonRaphsonIterate(aX, guessForT, mX1, mX2);
|
115
|
-
}
|
116
|
-
|
117
|
-
if (initialSlope === 0.0) {
|
118
|
-
return guessForT;
|
119
|
-
}
|
120
|
-
|
121
|
-
return binarySubdivide({
|
122
|
-
aX,
|
123
|
-
_aA: intervalStart,
|
124
|
-
_aB: intervalStart + kSampleStepSize,
|
125
|
-
mX1,
|
126
|
-
mX2
|
127
|
-
});
|
128
|
-
}
|
129
|
-
|
130
|
-
return function (x) {
|
131
|
-
if (mX1 === mY1 && mX2 === mY2) {
|
132
|
-
return x; // linear
|
133
|
-
} // Because JavaScript number are imprecise, we should guarantee the extremes are right.
|
134
|
-
|
135
|
-
|
136
|
-
if (x === 0) {
|
137
|
-
return 0;
|
138
|
-
}
|
139
|
-
|
140
|
-
if (x === 1) {
|
141
|
-
return 1;
|
142
|
-
}
|
143
|
-
|
144
|
-
return calcBezier(getTForX(x), mY1, mY2);
|
145
|
-
};
|
146
|
-
}
|
147
|
-
//# sourceMappingURL=bezier.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["NEWTON_ITERATIONS","NEWTON_MIN_SLOPE","SUBDIVISION_PRECISION","SUBDIVISION_MAX_ITERATIONS","kSplineTableSize","kSampleStepSize","float32ArraySupported","Float32Array","a","aA1","aA2","b","c","calcBezier","aT","getSlope","binarySubdivide","aX","_aA","_aB","mX1","mX2","currentX","currentT","i","aA","aB","Math","abs","newtonRaphsonIterate","_aGuessT","aGuessT","currentSlope","bezier","mY1","mY2","Error","sampleValues","Array","getTForX","intervalStart","currentSample","lastSample","dist","guessForT","initialSlope","x"],"sources":["bezier.ts"],"sourcesContent":["// eslint-disable-next-line max-len\n// Taken from https://github.com/facebook/react-native/blob/0b9ea60b4fee8cacc36e7160e31b91fc114dbc0d/Libraries/Animated/src/bezier.js\n\nconst NEWTON_ITERATIONS = 4;\nconst NEWTON_MIN_SLOPE = 0.001;\nconst SUBDIVISION_PRECISION = 0.0000001;\nconst SUBDIVISION_MAX_ITERATIONS = 10;\n\nconst kSplineTableSize = 11;\nconst kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);\n\nconst float32ArraySupported = typeof Float32Array === \"function\";\n\nfunction a(aA1: number, aA2: number): number {\n return 1.0 - 3.0 * aA2 + 3.0 * aA1;\n}\n\nfunction b(aA1: number, aA2: number): number {\n return 3.0 * aA2 - 6.0 * aA1;\n}\n\nfunction c(aA1: number): number {\n return 3.0 * aA1;\n}\n\n// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.\nfunction calcBezier(aT: number, aA1: number, aA2: number): number {\n return ((a(aA1, aA2) * aT + b(aA1, aA2)) * aT + c(aA1)) * aT;\n}\n\n// Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.\nfunction getSlope(aT: number, aA1: number, aA2: number): number {\n return 3.0 * a(aA1, aA2) * aT * aT + 2.0 * b(aA1, aA2) * aT + c(aA1);\n}\n\nfunction binarySubdivide({\n aX,\n _aA,\n _aB,\n mX1,\n mX2,\n}: {\n aX: number;\n _aA: number;\n _aB: number;\n mX1: number;\n mX2: number;\n}): number {\n let currentX;\n let currentT;\n let i = 0;\n let aA = _aA;\n let aB = _aB;\n do {\n currentT = aA + (aB - aA) / 2.0;\n currentX = calcBezier(currentT, mX1, mX2) - aX;\n if (currentX > 0.0) {\n aB = currentT;\n } else {\n aA = currentT;\n }\n } while (\n Math.abs(currentX) > SUBDIVISION_PRECISION &&\n ++i < SUBDIVISION_MAX_ITERATIONS\n );\n\n return currentT;\n}\n\nfunction newtonRaphsonIterate(\n aX: number,\n _aGuessT: number,\n mX1: number,\n mX2: number\n): number {\n let aGuessT = _aGuessT;\n for (let i = 0; i < NEWTON_ITERATIONS; ++i) {\n const currentSlope = getSlope(aGuessT, mX1, mX2);\n if (currentSlope === 0.0) {\n return aGuessT;\n }\n\n const currentX = calcBezier(aGuessT, mX1, mX2) - aX;\n aGuessT -= currentX / currentSlope;\n }\n\n return aGuessT;\n}\n\nexport function bezier(\n mX1: number,\n mY1: number,\n mX2: number,\n mY2: number\n): (x: number) => number {\n if (!(mX1 >= 0 && mX1 <= 1 && mX2 >= 0 && mX2 <= 1)) {\n throw new Error(\"bezier x values must be in [0, 1] range\");\n }\n\n // Precompute samples table\n const sampleValues = float32ArraySupported\n ? new Float32Array(kSplineTableSize)\n : new Array(kSplineTableSize);\n if (mX1 !== mY1 || mX2 !== mY2) {\n for (let i = 0; i < kSplineTableSize; ++i) {\n sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);\n }\n }\n\n function getTForX(aX: number): number {\n let intervalStart = 0.0;\n let currentSample = 1;\n const lastSample = kSplineTableSize - 1;\n\n for (\n ;\n currentSample !== lastSample && sampleValues[currentSample] <= aX;\n ++currentSample\n ) {\n intervalStart += kSampleStepSize;\n }\n\n --currentSample;\n\n // Interpolate to provide an initial guess for t\n const dist =\n (aX - sampleValues[currentSample]) /\n (sampleValues[currentSample + 1] - sampleValues[currentSample]);\n const guessForT = intervalStart + dist * kSampleStepSize;\n\n const initialSlope = getSlope(guessForT, mX1, mX2);\n if (initialSlope >= NEWTON_MIN_SLOPE) {\n return newtonRaphsonIterate(aX, guessForT, mX1, mX2);\n }\n\n if (initialSlope === 0.0) {\n return guessForT;\n }\n\n return binarySubdivide({\n aX,\n _aA: intervalStart,\n _aB: intervalStart + kSampleStepSize,\n mX1,\n mX2,\n });\n }\n\n return function (x: number): number {\n if (mX1 === mY1 && mX2 === mY2) {\n return x; // linear\n }\n\n // Because JavaScript number are imprecise, we should guarantee the extremes are right.\n if (x === 0) {\n return 0;\n }\n\n if (x === 1) {\n return 1;\n }\n\n return calcBezier(getTForX(x), mY1, mY2);\n };\n}\n"],"mappings":"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"}
|
@@ -1,7 +0,0 @@
|
|
1
|
-
import type { RequiredAnimationParams, AnimationParams, TimingConfig } from "../../types";
|
2
|
-
/**
|
3
|
-
* Resolves parameters from optional values to a single object
|
4
|
-
* @param toOrParams Params or to value
|
5
|
-
* @param config timing/spring configuration
|
6
|
-
*/
|
7
|
-
export declare const getResolvedParams: (toOrParams: number | AnimationParams, config?: TimingConfig) => RequiredAnimationParams & Required<TimingConfig>;
|
@@ -1,52 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.getResolvedParams = void 0;
|
7
|
-
const DefaultParameters = {
|
8
|
-
to: 1,
|
9
|
-
loop: false,
|
10
|
-
yoyo: false,
|
11
|
-
immediate: true
|
12
|
-
};
|
13
|
-
const DefaultTimingConfig = {
|
14
|
-
duration: 1000,
|
15
|
-
easing: t => t
|
16
|
-
};
|
17
|
-
/**
|
18
|
-
* Resolves parameters from optional values to a single object
|
19
|
-
* @param toOrParams Params or to value
|
20
|
-
* @param config timing/spring configuration
|
21
|
-
*/
|
22
|
-
|
23
|
-
const getResolvedParams = (toOrParams, config) => {
|
24
|
-
let resolvedParameters = { ...DefaultParameters
|
25
|
-
};
|
26
|
-
|
27
|
-
if (typeof toOrParams === "number") {
|
28
|
-
resolvedParameters.to = toOrParams;
|
29
|
-
} else {
|
30
|
-
resolvedParameters = {
|
31
|
-
from: toOrParams.from ?? resolvedParameters.from,
|
32
|
-
to: toOrParams.to ?? resolvedParameters.to,
|
33
|
-
loop: toOrParams.loop ?? resolvedParameters.loop,
|
34
|
-
yoyo: toOrParams.yoyo ?? resolvedParameters.yoyo
|
35
|
-
};
|
36
|
-
}
|
37
|
-
|
38
|
-
const resolvedConfig = { ...DefaultTimingConfig
|
39
|
-
};
|
40
|
-
|
41
|
-
if (config) {
|
42
|
-
resolvedConfig.duration = config.duration ?? DefaultTimingConfig.duration;
|
43
|
-
resolvedConfig.easing = config.easing ?? DefaultTimingConfig.easing;
|
44
|
-
}
|
45
|
-
|
46
|
-
return { ...resolvedParameters,
|
47
|
-
...resolvedConfig
|
48
|
-
};
|
49
|
-
};
|
50
|
-
|
51
|
-
exports.getResolvedParams = getResolvedParams;
|
52
|
-
//# sourceMappingURL=getResolvedParams.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["DefaultParameters","to","loop","yoyo","immediate","DefaultTimingConfig","duration","easing","t","getResolvedParams","toOrParams","config","resolvedParameters","from","resolvedConfig"],"sources":["getResolvedParams.ts"],"sourcesContent":["import type {\n RequiredAnimationParams,\n AnimationParams,\n TimingConfig,\n} from \"../../types\";\n\nconst DefaultParameters = {\n to: 1,\n loop: false,\n yoyo: false,\n immediate: true,\n};\n\nconst DefaultTimingConfig = {\n duration: 1000,\n easing: (t: number) => t,\n};\n\n/**\n * Resolves parameters from optional values to a single object\n * @param toOrParams Params or to value\n * @param config timing/spring configuration\n */\nexport const getResolvedParams = (\n toOrParams: number | AnimationParams,\n config?: TimingConfig\n): RequiredAnimationParams & Required<TimingConfig> => {\n let resolvedParameters: RequiredAnimationParams = {\n ...DefaultParameters,\n };\n\n if (typeof toOrParams === \"number\") {\n resolvedParameters.to = toOrParams;\n } else {\n resolvedParameters = {\n from: toOrParams.from ?? resolvedParameters.from,\n to: toOrParams.to ?? resolvedParameters.to,\n loop: toOrParams.loop ?? resolvedParameters.loop,\n yoyo: toOrParams.yoyo ?? resolvedParameters.yoyo,\n };\n }\n\n const resolvedConfig: Required<TimingConfig> = { ...DefaultTimingConfig };\n if (config) {\n resolvedConfig.duration = config.duration ?? DefaultTimingConfig.duration;\n resolvedConfig.easing = config.easing ?? DefaultTimingConfig.easing;\n }\n\n return { ...resolvedParameters, ...resolvedConfig };\n};\n"],"mappings":";;;;;;AAMA,MAAMA,iBAAiB,GAAG;EACxBC,EAAE,EAAE,CADoB;EAExBC,IAAI,EAAE,KAFkB;EAGxBC,IAAI,EAAE,KAHkB;EAIxBC,SAAS,EAAE;AAJa,CAA1B;AAOA,MAAMC,mBAAmB,GAAG;EAC1BC,QAAQ,EAAE,IADgB;EAE1BC,MAAM,EAAGC,CAAD,IAAeA;AAFG,CAA5B;AAKA;AACA;AACA;AACA;AACA;;AACO,MAAMC,iBAAiB,GAAG,CAC/BC,UAD+B,EAE/BC,MAF+B,KAGsB;EACrD,IAAIC,kBAA2C,GAAG,EAChD,GAAGZ;EAD6C,CAAlD;;EAIA,IAAI,OAAOU,UAAP,KAAsB,QAA1B,EAAoC;IAClCE,kBAAkB,CAACX,EAAnB,GAAwBS,UAAxB;EACD,CAFD,MAEO;IACLE,kBAAkB,GAAG;MACnBC,IAAI,EAAEH,UAAU,CAACG,IAAX,IAAmBD,kBAAkB,CAACC,IADzB;MAEnBZ,EAAE,EAAES,UAAU,CAACT,EAAX,IAAiBW,kBAAkB,CAACX,EAFrB;MAGnBC,IAAI,EAAEQ,UAAU,CAACR,IAAX,IAAmBU,kBAAkB,CAACV,IAHzB;MAInBC,IAAI,EAAEO,UAAU,CAACP,IAAX,IAAmBS,kBAAkB,CAACT;IAJzB,CAArB;EAMD;;EAED,MAAMW,cAAsC,GAAG,EAAE,GAAGT;EAAL,CAA/C;;EACA,IAAIM,MAAJ,EAAY;IACVG,cAAc,CAACR,QAAf,GAA0BK,MAAM,CAACL,QAAP,IAAmBD,mBAAmB,CAACC,QAAjE;IACAQ,cAAc,CAACP,MAAf,GAAwBI,MAAM,CAACJ,MAAP,IAAiBF,mBAAmB,CAACE,MAA7D;EACD;;EAED,OAAO,EAAE,GAAGK,kBAAL;IAAyB,GAAGE;EAA5B,CAAP;AACD,CA1BM"}
|
@@ -1,54 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
var _exportNames = {
|
7
|
-
bezier: true,
|
8
|
-
timing: true
|
9
|
-
};
|
10
|
-
Object.defineProperty(exports, "bezier", {
|
11
|
-
enumerable: true,
|
12
|
-
get: function () {
|
13
|
-
return _bezier.bezier;
|
14
|
-
}
|
15
|
-
});
|
16
|
-
Object.defineProperty(exports, "timing", {
|
17
|
-
enumerable: true,
|
18
|
-
get: function () {
|
19
|
-
return _timing.timing;
|
20
|
-
}
|
21
|
-
});
|
22
|
-
|
23
|
-
var _bezier = require("./bezier");
|
24
|
-
|
25
|
-
var _timing = require("./timing");
|
26
|
-
|
27
|
-
var _types = require("./types");
|
28
|
-
|
29
|
-
Object.keys(_types).forEach(function (key) {
|
30
|
-
if (key === "default" || key === "__esModule") return;
|
31
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
32
|
-
if (key in exports && exports[key] === _types[key]) return;
|
33
|
-
Object.defineProperty(exports, key, {
|
34
|
-
enumerable: true,
|
35
|
-
get: function () {
|
36
|
-
return _types[key];
|
37
|
-
}
|
38
|
-
});
|
39
|
-
});
|
40
|
-
|
41
|
-
var _getResolvedParams = require("./getResolvedParams");
|
42
|
-
|
43
|
-
Object.keys(_getResolvedParams).forEach(function (key) {
|
44
|
-
if (key === "default" || key === "__esModule") return;
|
45
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
46
|
-
if (key in exports && exports[key] === _getResolvedParams[key]) return;
|
47
|
-
Object.defineProperty(exports, key, {
|
48
|
-
enumerable: true,
|
49
|
-
get: function () {
|
50
|
-
return _getResolvedParams[key];
|
51
|
-
}
|
52
|
-
});
|
53
|
-
});
|
54
|
-
//# sourceMappingURL=index.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { bezier } from \"./bezier\";\nexport { timing } from \"./timing\";\nexport * from \"./types\";\nexport * from \"./getResolvedParams\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|
@@ -1,17 +0,0 @@
|
|
1
|
-
import type { AnimationState } from "../../../values/types";
|
2
|
-
/**
|
3
|
-
* Calculates and returns a timing value based on the
|
4
|
-
* input parameters. The timing value is a number between
|
5
|
-
* 0 and 1.
|
6
|
-
* @param t
|
7
|
-
* @param duration
|
8
|
-
* @param easing
|
9
|
-
* @param loop
|
10
|
-
* @param yoyo
|
11
|
-
* @param onStop
|
12
|
-
* @returns
|
13
|
-
*/
|
14
|
-
export declare const timing: (t: number, duration: number, easing: (t: number) => number, loop: boolean, yoyo: boolean, state: AnimationState) => {
|
15
|
-
current: number;
|
16
|
-
finished: boolean;
|
17
|
-
};
|
@@ -1,50 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.timing = void 0;
|
7
|
-
|
8
|
-
/**
|
9
|
-
* Calculates and returns a timing value based on the
|
10
|
-
* input parameters. The timing value is a number between
|
11
|
-
* 0 and 1.
|
12
|
-
* @param t
|
13
|
-
* @param duration
|
14
|
-
* @param easing
|
15
|
-
* @param loop
|
16
|
-
* @param yoyo
|
17
|
-
* @param onStop
|
18
|
-
* @returns
|
19
|
-
*/
|
20
|
-
const timing = (t, duration, easing, loop, yoyo, state) => {
|
21
|
-
let current = t / duration;
|
22
|
-
let {
|
23
|
-
finished
|
24
|
-
} = state; // Side effect to stop animation when duration is reached (if loop is false)
|
25
|
-
|
26
|
-
if (current >= 1.0 && !loop) {
|
27
|
-
finished = true;
|
28
|
-
current = 1.0;
|
29
|
-
} // calculate return value
|
30
|
-
|
31
|
-
|
32
|
-
let n = current % 1;
|
33
|
-
|
34
|
-
if (yoyo) {
|
35
|
-
n = current % 2.0 >= 1.0 ? 1 - current % 1 : current % 1;
|
36
|
-
} else if (!loop) {
|
37
|
-
if (current >= 1.0) {
|
38
|
-
n = 1.0;
|
39
|
-
}
|
40
|
-
}
|
41
|
-
|
42
|
-
current = easing(Math.max(0, Math.min(1, n)));
|
43
|
-
return {
|
44
|
-
current,
|
45
|
-
finished
|
46
|
-
};
|
47
|
-
};
|
48
|
-
|
49
|
-
exports.timing = timing;
|
50
|
-
//# sourceMappingURL=timing.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["timing","t","duration","easing","loop","yoyo","state","current","finished","n","Math","max","min"],"sources":["timing.ts"],"sourcesContent":["import type { AnimationState } from \"../../../values/types\";\n\n/**\n * Calculates and returns a timing value based on the\n * input parameters. The timing value is a number between\n * 0 and 1.\n * @param t\n * @param duration\n * @param easing\n * @param loop\n * @param yoyo\n * @param onStop\n * @returns\n */\nexport const timing = (\n t: number,\n duration: number,\n easing: (t: number) => number,\n loop: boolean,\n yoyo: boolean,\n state: AnimationState\n) => {\n let current = t / duration;\n let { finished } = state;\n // Side effect to stop animation when duration is reached (if loop is false)\n if (current >= 1.0 && !loop) {\n finished = true;\n current = 1.0;\n }\n // calculate return value\n let n = current % 1;\n if (yoyo) {\n n = current % 2.0 >= 1.0 ? 1 - (current % 1) : current % 1;\n } else if (!loop) {\n if (current >= 1.0) {\n n = 1.0;\n }\n }\n current = easing(Math.max(0, Math.min(1, n)));\n return {\n current,\n finished,\n };\n};\n"],"mappings":";;;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,MAAM,GAAG,CACpBC,CADoB,EAEpBC,QAFoB,EAGpBC,MAHoB,EAIpBC,IAJoB,EAKpBC,IALoB,EAMpBC,KANoB,KAOjB;EACH,IAAIC,OAAO,GAAGN,CAAC,GAAGC,QAAlB;EACA,IAAI;IAAEM;EAAF,IAAeF,KAAnB,CAFG,CAGH;;EACA,IAAIC,OAAO,IAAI,GAAX,IAAkB,CAACH,IAAvB,EAA6B;IAC3BI,QAAQ,GAAG,IAAX;IACAD,OAAO,GAAG,GAAV;EACD,CAPE,CAQH;;;EACA,IAAIE,CAAC,GAAGF,OAAO,GAAG,CAAlB;;EACA,IAAIF,IAAJ,EAAU;IACRI,CAAC,GAAGF,OAAO,GAAG,GAAV,IAAiB,GAAjB,GAAuB,IAAKA,OAAO,GAAG,CAAtC,GAA2CA,OAAO,GAAG,CAAzD;EACD,CAFD,MAEO,IAAI,CAACH,IAAL,EAAW;IAChB,IAAIG,OAAO,IAAI,GAAf,EAAoB;MAClBE,CAAC,GAAG,GAAJ;IACD;EACF;;EACDF,OAAO,GAAGJ,MAAM,CAACO,IAAI,CAACC,GAAL,CAAS,CAAT,EAAYD,IAAI,CAACE,GAAL,CAAS,CAAT,EAAYH,CAAZ,CAAZ,CAAD,CAAhB;EACA,OAAO;IACLF,OADK;IAELC;EAFK,CAAP;AAID,CA7BM"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["export type EasingFunction = (value: number) => number;\n\nexport interface TimingConfig {\n from?: number;\n to?: number;\n duration?: number;\n easing?: EasingFunction;\n}\n"],"mappings":""}
|
@@ -1,38 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
Object.defineProperty(exports, "Easing", {
|
7
|
-
enumerable: true,
|
8
|
-
get: function () {
|
9
|
-
return _Easing.Easing;
|
10
|
-
}
|
11
|
-
});
|
12
|
-
Object.defineProperty(exports, "runTiming", {
|
13
|
-
enumerable: true,
|
14
|
-
get: function () {
|
15
|
-
return _runTiming.runTiming;
|
16
|
-
}
|
17
|
-
});
|
18
|
-
Object.defineProperty(exports, "useLoop", {
|
19
|
-
enumerable: true,
|
20
|
-
get: function () {
|
21
|
-
return _useLoop.useLoop;
|
22
|
-
}
|
23
|
-
});
|
24
|
-
Object.defineProperty(exports, "useTiming", {
|
25
|
-
enumerable: true,
|
26
|
-
get: function () {
|
27
|
-
return _useTiming.useTiming;
|
28
|
-
}
|
29
|
-
});
|
30
|
-
|
31
|
-
var _Easing = require("./Easing");
|
32
|
-
|
33
|
-
var _useTiming = require("./useTiming");
|
34
|
-
|
35
|
-
var _useLoop = require("./useLoop");
|
36
|
-
|
37
|
-
var _runTiming = require("./runTiming");
|
38
|
-
//# sourceMappingURL=index.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { Easing } from \"./Easing\";\nexport { useTiming } from \"./useTiming\";\nexport { useLoop } from \"./useLoop\";\nexport { runTiming } from \"./runTiming\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA"}
|
@@ -1,19 +0,0 @@
|
|
1
|
-
import type { SkiaMutableValue, SkiaAnimation } from "../../values/types";
|
2
|
-
import type { AnimationParams, TimingConfig, AnimationCallback } from "../types";
|
3
|
-
/**
|
4
|
-
* @deprecated Use Reanimated 3 for animations:
|
5
|
-
* https://shopify.github.io/react-native-skia/docs/animations/animations
|
6
|
-
*
|
7
|
-
* Creates a new animation on an existing value that will be driven by
|
8
|
-
* an animation value. The value will be run from / to the value in
|
9
|
-
* params and modified by the provided easing curve for the length of
|
10
|
-
* the duration. When the value has reached its desired "to" value the
|
11
|
-
* animation will be stopped.
|
12
|
-
*
|
13
|
-
* @param value The value to animate
|
14
|
-
* @param toOrParams To value or Animation parameters
|
15
|
-
* @param config Spring or timing configuration
|
16
|
-
* @returns an animation value that can be used to start/stop
|
17
|
-
* the animation.
|
18
|
-
*/
|
19
|
-
export declare const runTiming: (value: SkiaMutableValue<number>, toOrParams: number | AnimationParams, config?: TimingConfig, callback?: AnimationCallback) => SkiaAnimation;
|
@@ -1,36 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.runTiming = void 0;
|
7
|
-
|
8
|
-
var _functions = require("./functions");
|
9
|
-
|
10
|
-
var _createTiming = require("./createTiming");
|
11
|
-
|
12
|
-
/**
|
13
|
-
* @deprecated Use Reanimated 3 for animations:
|
14
|
-
* https://shopify.github.io/react-native-skia/docs/animations/animations
|
15
|
-
*
|
16
|
-
* Creates a new animation on an existing value that will be driven by
|
17
|
-
* an animation value. The value will be run from / to the value in
|
18
|
-
* params and modified by the provided easing curve for the length of
|
19
|
-
* the duration. When the value has reached its desired "to" value the
|
20
|
-
* animation will be stopped.
|
21
|
-
*
|
22
|
-
* @param value The value to animate
|
23
|
-
* @param toOrParams To value or Animation parameters
|
24
|
-
* @param config Spring or timing configuration
|
25
|
-
* @returns an animation value that can be used to start/stop
|
26
|
-
* the animation.
|
27
|
-
*/
|
28
|
-
const runTiming = (value, toOrParams, config, callback) => {
|
29
|
-
const resolvedParameters = (0, _functions.getResolvedParams)(toOrParams, config);
|
30
|
-
const animation = (0, _createTiming.createTiming)(resolvedParameters, value, callback);
|
31
|
-
value.animation = animation;
|
32
|
-
return animation;
|
33
|
-
};
|
34
|
-
|
35
|
-
exports.runTiming = runTiming;
|
36
|
-
//# sourceMappingURL=runTiming.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["runTiming","value","toOrParams","config","callback","resolvedParameters","getResolvedParams","animation","createTiming"],"sources":["runTiming.ts"],"sourcesContent":["import type { SkiaMutableValue, SkiaAnimation } from \"../../values/types\";\nimport type {\n AnimationParams,\n TimingConfig,\n AnimationCallback,\n} from \"../types\";\n\nimport { getResolvedParams } from \"./functions\";\nimport { createTiming } from \"./createTiming\";\n/**\n * @deprecated Use Reanimated 3 for animations:\n * https://shopify.github.io/react-native-skia/docs/animations/animations\n *\n * Creates a new animation on an existing value that will be driven by\n * an animation value. The value will be run from / to the value in\n * params and modified by the provided easing curve for the length of\n * the duration. When the value has reached its desired \"to\" value the\n * animation will be stopped.\n *\n * @param value The value to animate\n * @param toOrParams To value or Animation parameters\n * @param config Spring or timing configuration\n * @returns an animation value that can be used to start/stop\n * the animation.\n */\nexport const runTiming = (\n value: SkiaMutableValue<number>,\n toOrParams: number | AnimationParams,\n config?: TimingConfig,\n callback?: AnimationCallback\n): SkiaAnimation => {\n const resolvedParameters = getResolvedParams(toOrParams, config);\n const animation = createTiming(resolvedParameters, value, callback);\n value.animation = animation;\n return animation;\n};\n"],"mappings":";;;;;;;AAOA;;AACA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,SAAS,GAAG,CACvBC,KADuB,EAEvBC,UAFuB,EAGvBC,MAHuB,EAIvBC,QAJuB,KAKL;EAClB,MAAMC,kBAAkB,GAAG,IAAAC,4BAAA,EAAkBJ,UAAlB,EAA8BC,MAA9B,CAA3B;EACA,MAAMI,SAAS,GAAG,IAAAC,0BAAA,EAAaH,kBAAb,EAAiCJ,KAAjC,EAAwCG,QAAxC,CAAlB;EACAH,KAAK,CAACM,SAAN,GAAkBA,SAAlB;EACA,OAAOA,SAAP;AACD,CAVM"}
|
@@ -1,11 +0,0 @@
|
|
1
|
-
import type { TimingConfig } from "../types";
|
2
|
-
/**
|
3
|
-
* @deprecated Use Reanimated 3 for animations:
|
4
|
-
* https://shopify.github.io/react-native-skia/docs/animations/animations
|
5
|
-
*
|
6
|
-
* Configures a looped timing value. The value will go back and forth
|
7
|
-
* between 0 and 1 and back.
|
8
|
-
* @param config Timing configuration for easing and duration
|
9
|
-
* @returns A value that can be used for further animations
|
10
|
-
*/
|
11
|
-
export declare const useLoop: (config?: TimingConfig) => import("../..").SkiaValue<number>;
|
@@ -1,25 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.useLoop = void 0;
|
7
|
-
|
8
|
-
var _useTiming = require("./useTiming");
|
9
|
-
|
10
|
-
/**
|
11
|
-
* @deprecated Use Reanimated 3 for animations:
|
12
|
-
* https://shopify.github.io/react-native-skia/docs/animations/animations
|
13
|
-
*
|
14
|
-
* Configures a looped timing value. The value will go back and forth
|
15
|
-
* between 0 and 1 and back.
|
16
|
-
* @param config Timing configuration for easing and duration
|
17
|
-
* @returns A value that can be used for further animations
|
18
|
-
*/
|
19
|
-
const useLoop = config => (0, _useTiming.useTiming)({
|
20
|
-
yoyo: true,
|
21
|
-
loop: true
|
22
|
-
}, config);
|
23
|
-
|
24
|
-
exports.useLoop = useLoop;
|
25
|
-
//# sourceMappingURL=useLoop.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["useLoop","config","useTiming","yoyo","loop"],"sources":["useLoop.ts"],"sourcesContent":["import type { TimingConfig } from \"../types\";\n\nimport { useTiming } from \"./useTiming\";\n\n/**\n * @deprecated Use Reanimated 3 for animations:\n * https://shopify.github.io/react-native-skia/docs/animations/animations\n *\n * Configures a looped timing value. The value will go back and forth\n * between 0 and 1 and back.\n * @param config Timing configuration for easing and duration\n * @returns A value that can be used for further animations\n */\nexport const useLoop = (config?: TimingConfig) =>\n useTiming(\n {\n yoyo: true,\n loop: true,\n },\n config\n );\n"],"mappings":";;;;;;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,OAAO,GAAIC,MAAD,IACrB,IAAAC,oBAAA,EACE;EACEC,IAAI,EAAE,IADR;EAEEC,IAAI,EAAE;AAFR,CADF,EAKEH,MALF,CADK"}
|
@@ -1,13 +0,0 @@
|
|
1
|
-
import type { SkiaValue } from "../../values/types";
|
2
|
-
import type { AnimationParams, TimingConfig, AnimationCallback } from "../types";
|
3
|
-
/**
|
4
|
-
* @deprecated Use Reanimated 3 for animations:
|
5
|
-
* https://shopify.github.io/react-native-skia/docs/animations/animations
|
6
|
-
*
|
7
|
-
* Creats an animation value that will run whenever
|
8
|
-
* the animation parameters change. The animation start immediately.
|
9
|
-
* @param toOrParams
|
10
|
-
* @param config
|
11
|
-
* @returns A value that is animated
|
12
|
-
*/
|
13
|
-
export declare const useTiming: (toOrParams: number | AnimationParams, config?: TimingConfig, callback?: AnimationCallback) => SkiaValue<number>;
|
@@ -1,67 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.useTiming = void 0;
|
7
|
-
|
8
|
-
var _react = require("react");
|
9
|
-
|
10
|
-
var _useValue = require("../../values/hooks/useValue");
|
11
|
-
|
12
|
-
var _functions = require("./functions");
|
13
|
-
|
14
|
-
var _createTiming = require("./createTiming");
|
15
|
-
|
16
|
-
/**
|
17
|
-
* @deprecated Use Reanimated 3 for animations:
|
18
|
-
* https://shopify.github.io/react-native-skia/docs/animations/animations
|
19
|
-
*
|
20
|
-
* Creats an animation value that will run whenever
|
21
|
-
* the animation parameters change. The animation start immediately.
|
22
|
-
* @param toOrParams
|
23
|
-
* @param config
|
24
|
-
* @returns A value that is animated
|
25
|
-
*/
|
26
|
-
const useTiming = (toOrParams, config, callback) => {
|
27
|
-
// Resolve parameters - keep a cached version to avoid
|
28
|
-
// unnecesary re-renders.
|
29
|
-
const prevCfgRef = (0, _react.useRef)();
|
30
|
-
const resolvedParameters = (0, _react.useMemo)(() => {
|
31
|
-
const nextParams = (0, _functions.getResolvedParams)(toOrParams, config);
|
32
|
-
|
33
|
-
if (!equals(prevCfgRef.current, nextParams)) {
|
34
|
-
prevCfgRef.current = nextParams;
|
35
|
-
}
|
36
|
-
|
37
|
-
return prevCfgRef.current;
|
38
|
-
}, [config, toOrParams]); // Create value
|
39
|
-
|
40
|
-
const value = (0, _useValue.useValue)(resolvedParameters.from ?? 0); // Create timing animation - keep a cached version to avoid
|
41
|
-
// uneccessary recreation of animations
|
42
|
-
|
43
|
-
const prevAnimationRef = (0, _react.useRef)();
|
44
|
-
const prevParamsRef = (0, _react.useRef)();
|
45
|
-
const animation = (0, _react.useMemo)(() => {
|
46
|
-
if (!equals(prevParamsRef.current, resolvedParameters)) {
|
47
|
-
prevParamsRef.current = resolvedParameters;
|
48
|
-
prevAnimationRef.current = (0, _createTiming.createTiming)(resolvedParameters, value, callback);
|
49
|
-
}
|
50
|
-
|
51
|
-
return prevAnimationRef.current;
|
52
|
-
}, [callback, resolvedParameters, value]); // Run animation on the value - and stop it on unmount
|
53
|
-
|
54
|
-
(0, _react.useEffect)(() => {
|
55
|
-
value.animation = animation;
|
56
|
-
return () => value.animation = undefined;
|
57
|
-
}, [animation, value]); // Return the value that is animated
|
58
|
-
|
59
|
-
return value;
|
60
|
-
};
|
61
|
-
|
62
|
-
exports.useTiming = useTiming;
|
63
|
-
|
64
|
-
const equals = (a, b) => {
|
65
|
-
return JSON.stringify(a) === JSON.stringify(b);
|
66
|
-
};
|
67
|
-
//# sourceMappingURL=useTiming.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["useTiming","toOrParams","config","callback","prevCfgRef","useRef","resolvedParameters","useMemo","nextParams","getResolvedParams","equals","current","value","useValue","from","prevAnimationRef","prevParamsRef","animation","createTiming","useEffect","undefined","a","b","JSON","stringify"],"sources":["useTiming.ts"],"sourcesContent":["import { useEffect, useMemo, useRef } from \"react\";\n\nimport type { SkiaValue, SkiaAnimation } from \"../../values/types\";\nimport type {\n AnimationParams,\n TimingConfig,\n AnimationCallback,\n} from \"../types\";\nimport { useValue } from \"../../values/hooks/useValue\";\n\nimport { getResolvedParams } from \"./functions\";\nimport { createTiming } from \"./createTiming\";\n\n/**\n * @deprecated Use Reanimated 3 for animations:\n * https://shopify.github.io/react-native-skia/docs/animations/animations\n *\n * Creats an animation value that will run whenever\n * the animation parameters change. The animation start immediately.\n * @param toOrParams\n * @param config\n * @returns A value that is animated\n */\nexport const useTiming = (\n toOrParams: number | AnimationParams,\n config?: TimingConfig,\n callback?: AnimationCallback\n): SkiaValue<number> => {\n // Resolve parameters - keep a cached version to avoid\n // unnecesary re-renders.\n const prevCfgRef = useRef<ReturnType<typeof getResolvedParams>>();\n const resolvedParameters = useMemo(() => {\n const nextParams = getResolvedParams(toOrParams, config);\n if (!equals(prevCfgRef.current, nextParams)) {\n prevCfgRef.current = nextParams;\n }\n return prevCfgRef.current!;\n }, [config, toOrParams]);\n\n // Create value\n const value = useValue(resolvedParameters.from ?? 0);\n\n // Create timing animation - keep a cached version to avoid\n // uneccessary recreation of animations\n const prevAnimationRef = useRef<SkiaAnimation>();\n const prevParamsRef = useRef<typeof resolvedParameters>();\n const animation = useMemo(() => {\n if (!equals(prevParamsRef.current, resolvedParameters)) {\n prevParamsRef.current = resolvedParameters;\n prevAnimationRef.current = createTiming(\n resolvedParameters,\n value,\n callback\n );\n }\n return prevAnimationRef.current!;\n }, [callback, resolvedParameters, value]);\n\n // Run animation on the value - and stop it on unmount\n useEffect(() => {\n value.animation = animation;\n return () => (value.animation = undefined);\n }, [animation, value]);\n\n // Return the value that is animated\n return value;\n};\n\nconst equals = <T1, T2>(a: T1, b: T2) => {\n return JSON.stringify(a) === JSON.stringify(b);\n};\n"],"mappings":";;;;;;;AAAA;;AAQA;;AAEA;;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,SAAS,GAAG,CACvBC,UADuB,EAEvBC,MAFuB,EAGvBC,QAHuB,KAID;EACtB;EACA;EACA,MAAMC,UAAU,GAAG,IAAAC,aAAA,GAAnB;EACA,MAAMC,kBAAkB,GAAG,IAAAC,cAAA,EAAQ,MAAM;IACvC,MAAMC,UAAU,GAAG,IAAAC,4BAAA,EAAkBR,UAAlB,EAA8BC,MAA9B,CAAnB;;IACA,IAAI,CAACQ,MAAM,CAACN,UAAU,CAACO,OAAZ,EAAqBH,UAArB,CAAX,EAA6C;MAC3CJ,UAAU,CAACO,OAAX,GAAqBH,UAArB;IACD;;IACD,OAAOJ,UAAU,CAACO,OAAlB;EACD,CAN0B,EAMxB,CAACT,MAAD,EAASD,UAAT,CANwB,CAA3B,CAJsB,CAYtB;;EACA,MAAMW,KAAK,GAAG,IAAAC,kBAAA,EAASP,kBAAkB,CAACQ,IAAnB,IAA2B,CAApC,CAAd,CAbsB,CAetB;EACA;;EACA,MAAMC,gBAAgB,GAAG,IAAAV,aAAA,GAAzB;EACA,MAAMW,aAAa,GAAG,IAAAX,aAAA,GAAtB;EACA,MAAMY,SAAS,GAAG,IAAAV,cAAA,EAAQ,MAAM;IAC9B,IAAI,CAACG,MAAM,CAACM,aAAa,CAACL,OAAf,EAAwBL,kBAAxB,CAAX,EAAwD;MACtDU,aAAa,CAACL,OAAd,GAAwBL,kBAAxB;MACAS,gBAAgB,CAACJ,OAAjB,GAA2B,IAAAO,0BAAA,EACzBZ,kBADyB,EAEzBM,KAFyB,EAGzBT,QAHyB,CAA3B;IAKD;;IACD,OAAOY,gBAAgB,CAACJ,OAAxB;EACD,CAViB,EAUf,CAACR,QAAD,EAAWG,kBAAX,EAA+BM,KAA/B,CAVe,CAAlB,CAnBsB,CA+BtB;;EACA,IAAAO,gBAAA,EAAU,MAAM;IACdP,KAAK,CAACK,SAAN,GAAkBA,SAAlB;IACA,OAAO,MAAOL,KAAK,CAACK,SAAN,GAAkBG,SAAhC;EACD,CAHD,EAGG,CAACH,SAAD,EAAYL,KAAZ,CAHH,EAhCsB,CAqCtB;;EACA,OAAOA,KAAP;AACD,CA3CM;;;;AA6CP,MAAMF,MAAM,GAAG,CAASW,CAAT,EAAgBC,CAAhB,KAA0B;EACvC,OAAOC,IAAI,CAACC,SAAL,CAAeH,CAAf,MAAsBE,IAAI,CAACC,SAAL,CAAeF,CAAf,CAA7B;AACD,CAFD"}
|
@@ -1,8 +0,0 @@
|
|
1
|
-
import type { CustomDrawingNodeProps, DrawingContext } from "../../types";
|
2
|
-
import { JsiDrawingNode } from "../DrawingNode";
|
3
|
-
import type { NodeContext } from "../Node";
|
4
|
-
export declare class CustomDrawingNode extends JsiDrawingNode<CustomDrawingNodeProps, null> {
|
5
|
-
constructor(ctx: NodeContext, props: CustomDrawingNodeProps);
|
6
|
-
deriveProps(): null;
|
7
|
-
draw(ctx: DrawingContext): void;
|
8
|
-
}
|