@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,166 +0,0 @@
|
|
1
|
-
|
2
|
-
#pragma once
|
3
|
-
|
4
|
-
#include <algorithm>
|
5
|
-
#include <chrono>
|
6
|
-
#include <functional>
|
7
|
-
#include <memory>
|
8
|
-
#include <unordered_map>
|
9
|
-
#include <utility>
|
10
|
-
|
11
|
-
#include <jsi/jsi.h>
|
12
|
-
|
13
|
-
#include "JsiSkHostObjects.h"
|
14
|
-
#include "JsiValue.h"
|
15
|
-
#include "RNSkPlatformContext.h"
|
16
|
-
|
17
|
-
namespace RNSkia {
|
18
|
-
namespace jsi = facebook::jsi;
|
19
|
-
|
20
|
-
/**
|
21
|
-
Implements a readonly Value that is updated every time the screen is redrawn.
|
22
|
-
Its value will be the number of milliseconds since the animation value was
|
23
|
-
started.
|
24
|
-
*/
|
25
|
-
class RNSkReadonlyValue
|
26
|
-
: public JsiSkHostObject,
|
27
|
-
public std::enable_shared_from_this<RNSkReadonlyValue> {
|
28
|
-
public:
|
29
|
-
explicit RNSkReadonlyValue(
|
30
|
-
std::shared_ptr<RNSkPlatformContext> platformContext)
|
31
|
-
: JsiSkHostObject(platformContext),
|
32
|
-
_valueHolder(std::make_shared<RNJsi::JsiValue>()) {}
|
33
|
-
|
34
|
-
virtual ~RNSkReadonlyValue() { invalidate(); }
|
35
|
-
|
36
|
-
JSI_PROPERTY_GET(__typename__) {
|
37
|
-
return jsi::String::createFromUtf8(runtime, "RNSkValue");
|
38
|
-
}
|
39
|
-
|
40
|
-
JSI_PROPERTY_GET(current) { return getCurrent(runtime); }
|
41
|
-
|
42
|
-
JSI_EXPORT_PROPERTY_GETTERS(JSI_EXPORT_PROP_GET(RNSkReadonlyValue,
|
43
|
-
__typename__),
|
44
|
-
JSI_EXPORT_PROP_GET(RNSkReadonlyValue, current))
|
45
|
-
|
46
|
-
JSI_HOST_FUNCTION(addListener) {
|
47
|
-
if (!arguments[0].isObject() ||
|
48
|
-
!arguments[0].asObject(runtime).isFunction(runtime)) {
|
49
|
-
throw jsi::JSError(runtime, "Expected function as first parameter.");
|
50
|
-
return jsi::Value::undefined();
|
51
|
-
}
|
52
|
-
auto callback = std::make_shared<jsi::Function>(
|
53
|
-
arguments[0].asObject(runtime).asFunction(runtime));
|
54
|
-
|
55
|
-
auto unsubscribe =
|
56
|
-
addListener([weakSelf = weak_from_this(),
|
57
|
-
callback = std::move(callback)](jsi::Runtime &runtime) {
|
58
|
-
auto self = weakSelf.lock();
|
59
|
-
if (self) {
|
60
|
-
auto selfReadonlyValue =
|
61
|
-
std::dynamic_pointer_cast<RNSkReadonlyValue>(self);
|
62
|
-
callback->call(runtime, selfReadonlyValue->get_current(runtime));
|
63
|
-
}
|
64
|
-
});
|
65
|
-
|
66
|
-
return jsi::Function::createFromHostFunction(
|
67
|
-
runtime, jsi::PropNameID::forUtf8(runtime, "unsubscribe"), 0,
|
68
|
-
JSI_HOST_FUNCTION_LAMBDA {
|
69
|
-
unsubscribe();
|
70
|
-
return jsi::Value::undefined();
|
71
|
-
});
|
72
|
-
}
|
73
|
-
|
74
|
-
JSI_HOST_FUNCTION(dispose) {
|
75
|
-
invalidate();
|
76
|
-
return jsi::Value::undefined();
|
77
|
-
}
|
78
|
-
|
79
|
-
JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(RNSkReadonlyValue, addListener),
|
80
|
-
JSI_EXPORT_FUNC(RNSkReadonlyValue, dispose))
|
81
|
-
|
82
|
-
/**
|
83
|
-
* Adds a callback that will be called whenever the value changes
|
84
|
-
* @param cb Callback
|
85
|
-
* @return unsubscribe function
|
86
|
-
*/
|
87
|
-
const std::function<void()>
|
88
|
-
addListener(const std::function<void(jsi::Runtime &)> cb) {
|
89
|
-
std::lock_guard<std::mutex> lock(_mutex);
|
90
|
-
auto listenerId = _listenerId++;
|
91
|
-
_listeners.emplace(listenerId, cb);
|
92
|
-
return [weakSelf = weak_from_this(), listenerId]() {
|
93
|
-
auto self = weakSelf.lock();
|
94
|
-
if (self) {
|
95
|
-
self->removeListener(listenerId);
|
96
|
-
}
|
97
|
-
};
|
98
|
-
}
|
99
|
-
|
100
|
-
/**
|
101
|
-
Updates the underlying value and notifies all listeners about the change.
|
102
|
-
Listeners are only notified if the value was actually changed for numeric,
|
103
|
-
boolean and string values. For all other values listeners are notified
|
104
|
-
without comparison.
|
105
|
-
@param runtime Current JS Runtime
|
106
|
-
@param value Next value
|
107
|
-
*/
|
108
|
-
virtual void update(jsi::Runtime &runtime, const jsi::Value &value) {
|
109
|
-
auto equal = _valueHolder->operator==(RNJsi::JsiValue(runtime, value));
|
110
|
-
if (!equal) {
|
111
|
-
_valueHolder->setCurrent(runtime, value);
|
112
|
-
notifyListeners(runtime);
|
113
|
-
}
|
114
|
-
}
|
115
|
-
|
116
|
-
/**
|
117
|
-
Override to implement invalidation logic for the value. In the base class
|
118
|
-
this function clears all subscribers.
|
119
|
-
*/
|
120
|
-
virtual void invalidate() {
|
121
|
-
std::lock_guard<std::mutex> lock(_mutex);
|
122
|
-
_listeners.clear();
|
123
|
-
}
|
124
|
-
|
125
|
-
/**
|
126
|
-
Returns the current value as a jsi::Value
|
127
|
-
*/
|
128
|
-
jsi::Value getCurrent(jsi::Runtime &runtime) {
|
129
|
-
return _valueHolder->getAsJsiValue(runtime);
|
130
|
-
}
|
131
|
-
|
132
|
-
/**
|
133
|
-
Returns the underlying current value wrapper. This can be used to query the
|
134
|
-
holder for data type and get pointers to elements in the holder.
|
135
|
-
*/
|
136
|
-
std::shared_ptr<RNJsi::JsiValue> getCurrent() { return _valueHolder; }
|
137
|
-
|
138
|
-
protected:
|
139
|
-
/**
|
140
|
-
Notifies listeners about changes
|
141
|
-
@param runtime Current JS Runtime
|
142
|
-
*/
|
143
|
-
void notifyListeners(jsi::Runtime &runtime) {
|
144
|
-
std::lock_guard<std::mutex> lock(_mutex);
|
145
|
-
for (const auto &listener : _listeners) {
|
146
|
-
listener.second(runtime);
|
147
|
-
}
|
148
|
-
}
|
149
|
-
|
150
|
-
/**
|
151
|
-
Removes a subscription listeners
|
152
|
-
@param listenerId identifier of listener to remove
|
153
|
-
*/
|
154
|
-
void removeListener(long listenerId) {
|
155
|
-
std::lock_guard<std::mutex> lock(_mutex);
|
156
|
-
_listeners.erase(listenerId);
|
157
|
-
}
|
158
|
-
|
159
|
-
private:
|
160
|
-
std::shared_ptr<RNJsi::JsiValue> _valueHolder;
|
161
|
-
|
162
|
-
long _listenerId = 0;
|
163
|
-
std::unordered_map<long, std::function<void(jsi::Runtime &)>> _listeners;
|
164
|
-
std::mutex _mutex;
|
165
|
-
};
|
166
|
-
} // namespace RNSkia
|
@@ -1,116 +0,0 @@
|
|
1
|
-
#pragma once
|
2
|
-
|
3
|
-
#include <functional>
|
4
|
-
#include <memory>
|
5
|
-
|
6
|
-
#include "JsiHostObject.h"
|
7
|
-
#include "RNSkAnimation.h"
|
8
|
-
#include "RNSkPlatformContext.h"
|
9
|
-
#include "RNSkReadonlyValue.h"
|
10
|
-
#include <jsi/jsi.h>
|
11
|
-
|
12
|
-
namespace RNSkia {
|
13
|
-
namespace jsi = facebook::jsi;
|
14
|
-
/**
|
15
|
-
Implements a Value that can be both read and written to. It inherits from the
|
16
|
-
ReadonlyValue with functionailty for subscribing to changes.
|
17
|
-
*/
|
18
|
-
class RNSkValue : public RNSkReadonlyValue {
|
19
|
-
public:
|
20
|
-
RNSkValue(std::shared_ptr<RNSkPlatformContext> platformContext,
|
21
|
-
jsi::Runtime &runtime, const jsi::Value *arguments, size_t count)
|
22
|
-
: RNSkReadonlyValue(platformContext) {
|
23
|
-
if (count == 1) {
|
24
|
-
update(runtime, arguments[0]);
|
25
|
-
}
|
26
|
-
}
|
27
|
-
|
28
|
-
~RNSkValue() { unsubscribe(); }
|
29
|
-
|
30
|
-
JSI_PROPERTY_SET(current) {
|
31
|
-
// When someone else is setting the value we need to stop any ongoing
|
32
|
-
// animations
|
33
|
-
unsubscribe();
|
34
|
-
update(runtime, value);
|
35
|
-
}
|
36
|
-
|
37
|
-
JSI_PROPERTY_SET(animation) {
|
38
|
-
// Cancel existing animation
|
39
|
-
unsubscribe();
|
40
|
-
|
41
|
-
// Verify input
|
42
|
-
if (value.isObject() &&
|
43
|
-
value.asObject(runtime).isHostObject<RNSkAnimation>(runtime)) {
|
44
|
-
auto animation =
|
45
|
-
value.asObject(runtime).getHostObject<RNSkAnimation>(runtime);
|
46
|
-
if (animation != nullptr) {
|
47
|
-
// Now we have a value animation - let us connect and start
|
48
|
-
subscribe(animation);
|
49
|
-
}
|
50
|
-
} else if (value.isUndefined() || value.isNull()) {
|
51
|
-
// Do nothing - we've already unsubscribed
|
52
|
-
} else {
|
53
|
-
throw jsi::JSError(runtime, "Animation expected.");
|
54
|
-
}
|
55
|
-
}
|
56
|
-
|
57
|
-
JSI_PROPERTY_GET(animation) {
|
58
|
-
if (_animation != nullptr) {
|
59
|
-
return jsi::Object::createFromHostObject(runtime, _animation);
|
60
|
-
}
|
61
|
-
return jsi::Value::undefined();
|
62
|
-
}
|
63
|
-
|
64
|
-
JSI_EXPORT_PROPERTY_SETTERS(JSI_EXPORT_PROP_SET(RNSkValue, current),
|
65
|
-
JSI_EXPORT_PROP_SET(RNSkValue, animation))
|
66
|
-
|
67
|
-
JSI_EXPORT_PROPERTY_GETTERS(JSI_EXPORT_PROP_GET(RNSkReadonlyValue,
|
68
|
-
__typename__),
|
69
|
-
JSI_EXPORT_PROP_GET(RNSkValue, current),
|
70
|
-
JSI_EXPORT_PROP_GET(RNSkValue, animation))
|
71
|
-
|
72
|
-
JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(RNSkValue, addListener),
|
73
|
-
JSI_EXPORT_FUNC(RNSkReadonlyValue, dispose))
|
74
|
-
|
75
|
-
private:
|
76
|
-
void subscribe(std::shared_ptr<RNSkAnimation> animation) {
|
77
|
-
if (animation != nullptr) {
|
78
|
-
_animation = animation;
|
79
|
-
_unsubscribe =
|
80
|
-
std::make_shared<std::function<void()>>(_animation->addListener(
|
81
|
-
[weakSelf = weak_from_this()](jsi::Runtime &runtime) {
|
82
|
-
auto self = weakSelf.lock();
|
83
|
-
if (self) {
|
84
|
-
auto selfAsThis = std::dynamic_pointer_cast<RNSkValue>(self);
|
85
|
-
selfAsThis->animationDidUpdate(runtime);
|
86
|
-
}
|
87
|
-
}));
|
88
|
-
// Start the animation
|
89
|
-
_animation->startClock();
|
90
|
-
}
|
91
|
-
}
|
92
|
-
|
93
|
-
void animationDidUpdate(jsi::Runtime &runtime) {
|
94
|
-
if (_animation != nullptr) {
|
95
|
-
// Update ourselves from the current animation value
|
96
|
-
update(runtime, _animation->get_current(runtime));
|
97
|
-
}
|
98
|
-
}
|
99
|
-
|
100
|
-
void unsubscribe() {
|
101
|
-
if (_unsubscribe != nullptr) {
|
102
|
-
(*_unsubscribe)();
|
103
|
-
_unsubscribe = nullptr;
|
104
|
-
}
|
105
|
-
|
106
|
-
if (_animation != nullptr) {
|
107
|
-
_animation->stopClock();
|
108
|
-
_animation = nullptr;
|
109
|
-
}
|
110
|
-
}
|
111
|
-
|
112
|
-
std::shared_ptr<RNSkAnimation> _animation;
|
113
|
-
std::shared_ptr<std::function<void()>> _unsubscribe;
|
114
|
-
};
|
115
|
-
|
116
|
-
} // namespace RNSkia
|
@@ -1,72 +0,0 @@
|
|
1
|
-
#ifdef RCT_NEW_ARCH_ENABLED
|
2
|
-
#import <SkiaDrawView.h>
|
3
|
-
|
4
|
-
#import <RNSkDomView.h>
|
5
|
-
#import <RNSkIOSView.h>
|
6
|
-
#import <RNSkPlatformContext.h>
|
7
|
-
|
8
|
-
#import <RNSkJsView.h>
|
9
|
-
#import <SkiaUIView.h>
|
10
|
-
|
11
|
-
#import <React/RCTBridge+Private.h>
|
12
|
-
#import <React/RCTConversions.h>
|
13
|
-
#import <React/RCTFabricComponentsPlugins.h>
|
14
|
-
|
15
|
-
#import <react/renderer/components/rnskia/ComponentDescriptors.h>
|
16
|
-
#import <react/renderer/components/rnskia/EventEmitters.h>
|
17
|
-
#import <react/renderer/components/rnskia/Props.h>
|
18
|
-
#import <react/renderer/components/rnskia/RCTComponentViewHelpers.h>
|
19
|
-
|
20
|
-
using namespace facebook::react;
|
21
|
-
|
22
|
-
@implementation SkiaDrawView
|
23
|
-
|
24
|
-
- (instancetype)initWithFrame:(CGRect)frame {
|
25
|
-
if (self = [super initWithFrame:frame]) {
|
26
|
-
[self prepareView];
|
27
|
-
static const auto defaultProps =
|
28
|
-
std::make_shared<const SkiaDrawViewProps>();
|
29
|
-
_props = defaultProps;
|
30
|
-
}
|
31
|
-
return self;
|
32
|
-
}
|
33
|
-
|
34
|
-
- (void)prepareView {
|
35
|
-
auto skManager = [[self skiaManager] skManager];
|
36
|
-
// Pass SkManager as a raw pointer to avoid circular dependenciesr
|
37
|
-
[self initCommon:skManager.get()
|
38
|
-
factory:[](std::shared_ptr<RNSkia::RNSkPlatformContext> context) {
|
39
|
-
return std::make_shared<RNSkiOSView<RNSkia::RNSkJsView>>(context);
|
40
|
-
}];
|
41
|
-
}
|
42
|
-
|
43
|
-
- (void)prepareForRecycle {
|
44
|
-
[super prepareForRecycle];
|
45
|
-
[self prepareView];
|
46
|
-
}
|
47
|
-
|
48
|
-
#pragma mark - RCTComponentViewProtocol
|
49
|
-
|
50
|
-
+ (ComponentDescriptorProvider)componentDescriptorProvider {
|
51
|
-
return concreteComponentDescriptorProvider<SkiaDrawViewComponentDescriptor>();
|
52
|
-
}
|
53
|
-
|
54
|
-
- (void)updateProps:(const Props::Shared &)props
|
55
|
-
oldProps:(const Props::Shared &)oldProps {
|
56
|
-
const auto &newProps =
|
57
|
-
*std::static_pointer_cast<const SkiaDrawViewProps>(props);
|
58
|
-
[super updateProps:props oldProps:oldProps];
|
59
|
-
int nativeId =
|
60
|
-
[[RCTConvert NSString:RCTNSStringFromString(newProps.nativeId)] intValue];
|
61
|
-
[self setNativeId:nativeId];
|
62
|
-
[self setDrawingMode:newProps.mode];
|
63
|
-
[self setDebugMode:newProps.debug];
|
64
|
-
}
|
65
|
-
|
66
|
-
@end
|
67
|
-
|
68
|
-
Class<RCTComponentViewProtocol> SkiaDrawViewCls(void) {
|
69
|
-
return SkiaDrawView.class;
|
70
|
-
}
|
71
|
-
|
72
|
-
#endif // RCT_NEW_ARCH_ENABLED
|
@@ -1,50 +0,0 @@
|
|
1
|
-
#include "SkiaDrawViewManager.h"
|
2
|
-
#include <React/RCTBridge+Private.h>
|
3
|
-
|
4
|
-
#include <RNSkIOSView.h>
|
5
|
-
#include <RNSkJsView.h>
|
6
|
-
#include <RNSkPlatformContext.h>
|
7
|
-
|
8
|
-
#include "SkiaManager.h"
|
9
|
-
#include "SkiaUIView.h"
|
10
|
-
#include <RNSkiaModule.h>
|
11
|
-
|
12
|
-
@implementation SkiaDrawViewManager
|
13
|
-
|
14
|
-
RCT_EXPORT_MODULE(SkiaDrawView)
|
15
|
-
|
16
|
-
- (SkiaManager *)skiaManager {
|
17
|
-
auto bridge = [RCTBridge currentBridge];
|
18
|
-
auto skiaModule = (RNSkiaModule *)[bridge moduleForName:@"RNSkiaModule"];
|
19
|
-
return [skiaModule manager];
|
20
|
-
}
|
21
|
-
|
22
|
-
RCT_CUSTOM_VIEW_PROPERTY(nativeID, NSNumber, SkiaUIView) {
|
23
|
-
// Get parameter
|
24
|
-
int nativeId = [[RCTConvert NSString:json] intValue];
|
25
|
-
[(SkiaUIView *)view setNativeId:nativeId];
|
26
|
-
}
|
27
|
-
|
28
|
-
RCT_CUSTOM_VIEW_PROPERTY(mode, NSString, SkiaUIView) {
|
29
|
-
std::string mode =
|
30
|
-
json != NULL ? [[RCTConvert NSString:json] UTF8String] : "default";
|
31
|
-
[(SkiaUIView *)view setDrawingMode:mode];
|
32
|
-
}
|
33
|
-
|
34
|
-
RCT_CUSTOM_VIEW_PROPERTY(debug, BOOL, SkiaUIView) {
|
35
|
-
bool debug = json != NULL ? [RCTConvert BOOL:json] : false;
|
36
|
-
[(SkiaUIView *)view setDebugMode:debug];
|
37
|
-
}
|
38
|
-
|
39
|
-
- (UIView *)view {
|
40
|
-
auto skManager = [[self skiaManager] skManager];
|
41
|
-
// Pass SkManager as a raw pointer to avoid circular dependenciesr
|
42
|
-
return [[SkiaUIView alloc]
|
43
|
-
initWithManager:skManager.get()
|
44
|
-
factory:[](std::shared_ptr<RNSkia::RNSkPlatformContext> context) {
|
45
|
-
return std::make_shared<RNSkiOSView<RNSkia::RNSkJsView>>(
|
46
|
-
context);
|
47
|
-
}];
|
48
|
-
}
|
49
|
-
|
50
|
-
@end
|
@@ -1,42 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.decay = void 0;
|
7
|
-
const VELOCITY_EPS = 1;
|
8
|
-
const SLOPE_FACTOR = 0.1;
|
9
|
-
|
10
|
-
const decay = (now, state, config) => {
|
11
|
-
const {
|
12
|
-
lastTimestamp,
|
13
|
-
startTimestamp,
|
14
|
-
initialVelocity,
|
15
|
-
current,
|
16
|
-
velocity
|
17
|
-
} = state;
|
18
|
-
const nextState = { ...state
|
19
|
-
};
|
20
|
-
const deltaTime = Math.min(now - lastTimestamp, 64);
|
21
|
-
const v = velocity * Math.exp(-(1 - config.deceleration) * (now - startTimestamp) * SLOPE_FACTOR);
|
22
|
-
nextState.current = current + v * config.velocityFactor * deltaTime / 1000; // /1000 because time is in ms not in s
|
23
|
-
|
24
|
-
nextState.velocity = v;
|
25
|
-
nextState.lastTimestamp = now;
|
26
|
-
|
27
|
-
if (config.clamp) {
|
28
|
-
if (initialVelocity < 0 && nextState.current <= config.clamp[0]) {
|
29
|
-
nextState.current = config.clamp[0];
|
30
|
-
nextState.finished = true;
|
31
|
-
} else if (initialVelocity > 0 && nextState.current >= config.clamp[1]) {
|
32
|
-
nextState.current = config.clamp[1];
|
33
|
-
nextState.finished = true;
|
34
|
-
}
|
35
|
-
}
|
36
|
-
|
37
|
-
nextState.finished = Math.abs(v) < VELOCITY_EPS;
|
38
|
-
return nextState;
|
39
|
-
};
|
40
|
-
|
41
|
-
exports.decay = decay;
|
42
|
-
//# sourceMappingURL=decay.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["VELOCITY_EPS","SLOPE_FACTOR","decay","now","state","config","lastTimestamp","startTimestamp","initialVelocity","current","velocity","nextState","deltaTime","Math","min","v","exp","deceleration","velocityFactor","clamp","finished","abs"],"sources":["decay.ts"],"sourcesContent":["import type { DecayState, DefaultDecayConfig } from \"./types\";\n\nconst VELOCITY_EPS = 1;\nconst SLOPE_FACTOR = 0.1;\n\nexport const decay = (\n now: number,\n state: DecayState,\n config: DefaultDecayConfig\n): DecayState => {\n const { lastTimestamp, startTimestamp, initialVelocity, current, velocity } =\n state;\n const nextState = { ...state };\n const deltaTime = Math.min(now - lastTimestamp, 64);\n const v =\n velocity *\n Math.exp(\n -(1 - config.deceleration) * (now - startTimestamp) * SLOPE_FACTOR\n );\n nextState.current = current + (v * config.velocityFactor * deltaTime) / 1000; // /1000 because time is in ms not in s\n nextState.velocity = v;\n nextState.lastTimestamp = now;\n\n if (config.clamp) {\n if (initialVelocity < 0 && nextState.current <= config.clamp[0]) {\n nextState.current = config.clamp[0];\n nextState.finished = true;\n } else if (initialVelocity > 0 && nextState.current >= config.clamp[1]) {\n nextState.current = config.clamp[1];\n nextState.finished = true;\n }\n }\n nextState.finished = Math.abs(v) < VELOCITY_EPS;\n return nextState;\n};\n"],"mappings":";;;;;;AAEA,MAAMA,YAAY,GAAG,CAArB;AACA,MAAMC,YAAY,GAAG,GAArB;;AAEO,MAAMC,KAAK,GAAG,CACnBC,GADmB,EAEnBC,KAFmB,EAGnBC,MAHmB,KAIJ;EACf,MAAM;IAAEC,aAAF;IAAiBC,cAAjB;IAAiCC,eAAjC;IAAkDC,OAAlD;IAA2DC;EAA3D,IACJN,KADF;EAEA,MAAMO,SAAS,GAAG,EAAE,GAAGP;EAAL,CAAlB;EACA,MAAMQ,SAAS,GAAGC,IAAI,CAACC,GAAL,CAASX,GAAG,GAAGG,aAAf,EAA8B,EAA9B,CAAlB;EACA,MAAMS,CAAC,GACLL,QAAQ,GACRG,IAAI,CAACG,GAAL,CACE,EAAE,IAAIX,MAAM,CAACY,YAAb,KAA8Bd,GAAG,GAAGI,cAApC,IAAsDN,YADxD,CAFF;EAKAU,SAAS,CAACF,OAAV,GAAoBA,OAAO,GAAIM,CAAC,GAAGV,MAAM,CAACa,cAAX,GAA4BN,SAA7B,GAA0C,IAAxE,CAVe,CAU+D;;EAC9ED,SAAS,CAACD,QAAV,GAAqBK,CAArB;EACAJ,SAAS,CAACL,aAAV,GAA0BH,GAA1B;;EAEA,IAAIE,MAAM,CAACc,KAAX,EAAkB;IAChB,IAAIX,eAAe,GAAG,CAAlB,IAAuBG,SAAS,CAACF,OAAV,IAAqBJ,MAAM,CAACc,KAAP,CAAa,CAAb,CAAhD,EAAiE;MAC/DR,SAAS,CAACF,OAAV,GAAoBJ,MAAM,CAACc,KAAP,CAAa,CAAb,CAApB;MACAR,SAAS,CAACS,QAAV,GAAqB,IAArB;IACD,CAHD,MAGO,IAAIZ,eAAe,GAAG,CAAlB,IAAuBG,SAAS,CAACF,OAAV,IAAqBJ,MAAM,CAACc,KAAP,CAAa,CAAb,CAAhD,EAAiE;MACtER,SAAS,CAACF,OAAV,GAAoBJ,MAAM,CAACc,KAAP,CAAa,CAAb,CAApB;MACAR,SAAS,CAACS,QAAV,GAAqB,IAArB;IACD;EACF;;EACDT,SAAS,CAACS,QAAV,GAAqBP,IAAI,CAACQ,GAAL,CAASN,CAAT,IAAcf,YAAnC;EACA,OAAOW,SAAP;AACD,CA7BM"}
|
@@ -1 +0,0 @@
|
|
1
|
-
export { runDecay } from "./runDecay";
|
@@ -1,14 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
Object.defineProperty(exports, "runDecay", {
|
7
|
-
enumerable: true,
|
8
|
-
get: function () {
|
9
|
-
return _runDecay.runDecay;
|
10
|
-
}
|
11
|
-
});
|
12
|
-
|
13
|
-
var _runDecay = require("./runDecay");
|
14
|
-
//# sourceMappingURL=index.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { runDecay } from \"./runDecay\";\n"],"mappings":";;;;;;;;;;;;AAAA"}
|
@@ -1,10 +0,0 @@
|
|
1
|
-
import type { SkiaMutableValue } from "../../values/types";
|
2
|
-
import type { DecayConfig } from "./types";
|
3
|
-
/**
|
4
|
-
* Runs a decay animation from the current value to zero with the given decay
|
5
|
-
* configuration.
|
6
|
-
* @param value value to animate
|
7
|
-
* @param config Configuration or default configuration
|
8
|
-
* @returns Animation
|
9
|
-
*/
|
10
|
-
export declare const runDecay: (value: SkiaMutableValue<number>, config?: DecayConfig) => import("../../values/types").SkiaAnimation;
|
@@ -1,48 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.runDecay = void 0;
|
7
|
-
|
8
|
-
var _api = require("../../values/api");
|
9
|
-
|
10
|
-
var _decay = require("./decay");
|
11
|
-
|
12
|
-
/**
|
13
|
-
* Runs a decay animation from the current value to zero with the given decay
|
14
|
-
* configuration.
|
15
|
-
* @param value value to animate
|
16
|
-
* @param config Configuration or default configuration
|
17
|
-
* @returns Animation
|
18
|
-
*/
|
19
|
-
const runDecay = (value, config) => {
|
20
|
-
const resolvedConfig = {
|
21
|
-
deceleration: 0.998,
|
22
|
-
velocityFactor: 1,
|
23
|
-
velocity: 0,
|
24
|
-
from: value.current,
|
25
|
-
...config
|
26
|
-
};
|
27
|
-
|
28
|
-
const updateFunction = (t, state) => {
|
29
|
-
if (!state) {
|
30
|
-
return {
|
31
|
-
current: resolvedConfig.from,
|
32
|
-
finished: false,
|
33
|
-
lastTimestamp: t,
|
34
|
-
startTimestamp: t,
|
35
|
-
initialVelocity: resolvedConfig.velocity,
|
36
|
-
velocity: resolvedConfig.velocity
|
37
|
-
};
|
38
|
-
}
|
39
|
-
|
40
|
-
return (0, _decay.decay)(t, state, resolvedConfig);
|
41
|
-
};
|
42
|
-
|
43
|
-
value.animation = _api.ValueApi.createAnimation(updateFunction);
|
44
|
-
return value.animation;
|
45
|
-
};
|
46
|
-
|
47
|
-
exports.runDecay = runDecay;
|
48
|
-
//# sourceMappingURL=runDecay.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["runDecay","value","config","resolvedConfig","deceleration","velocityFactor","velocity","from","current","updateFunction","t","state","finished","lastTimestamp","startTimestamp","initialVelocity","decay","animation","ValueApi","createAnimation"],"sources":["runDecay.ts"],"sourcesContent":["import { ValueApi } from \"../../values/api\";\nimport type { SkiaMutableValue } from \"../../values/types\";\n\nimport { decay } from \"./decay\";\nimport type { DecayConfig, DefaultDecayConfig, DecayState } from \"./types\";\n\n/**\n * Runs a decay animation from the current value to zero with the given decay\n * configuration.\n * @param value value to animate\n * @param config Configuration or default configuration\n * @returns Animation\n */\nexport const runDecay = (\n value: SkiaMutableValue<number>,\n config?: DecayConfig\n) => {\n const resolvedConfig: DefaultDecayConfig = {\n deceleration: 0.998,\n velocityFactor: 1,\n velocity: 0,\n from: value.current,\n ...config,\n };\n const updateFunction = (t: number, state: DecayState | undefined) => {\n if (!state) {\n return {\n current: resolvedConfig.from,\n finished: false,\n lastTimestamp: t,\n startTimestamp: t,\n initialVelocity: resolvedConfig.velocity,\n velocity: resolvedConfig.velocity,\n };\n }\n return decay(t, state, resolvedConfig);\n };\n value.animation = ValueApi.createAnimation(updateFunction);\n return value.animation;\n};\n"],"mappings":";;;;;;;AAAA;;AAGA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,QAAQ,GAAG,CACtBC,KADsB,EAEtBC,MAFsB,KAGnB;EACH,MAAMC,cAAkC,GAAG;IACzCC,YAAY,EAAE,KAD2B;IAEzCC,cAAc,EAAE,CAFyB;IAGzCC,QAAQ,EAAE,CAH+B;IAIzCC,IAAI,EAAEN,KAAK,CAACO,OAJ6B;IAKzC,GAAGN;EALsC,CAA3C;;EAOA,MAAMO,cAAc,GAAG,CAACC,CAAD,EAAYC,KAAZ,KAA8C;IACnE,IAAI,CAACA,KAAL,EAAY;MACV,OAAO;QACLH,OAAO,EAAEL,cAAc,CAACI,IADnB;QAELK,QAAQ,EAAE,KAFL;QAGLC,aAAa,EAAEH,CAHV;QAILI,cAAc,EAAEJ,CAJX;QAKLK,eAAe,EAAEZ,cAAc,CAACG,QAL3B;QAMLA,QAAQ,EAAEH,cAAc,CAACG;MANpB,CAAP;IAQD;;IACD,OAAO,IAAAU,YAAA,EAAMN,CAAN,EAASC,KAAT,EAAgBR,cAAhB,CAAP;EACD,CAZD;;EAaAF,KAAK,CAACgB,SAAN,GAAkBC,aAAA,CAASC,eAAT,CAAyBV,cAAzB,CAAlB;EACA,OAAOR,KAAK,CAACgB,SAAb;AACD,CA1BM"}
|
@@ -1,21 +0,0 @@
|
|
1
|
-
import type { AnimationState } from "../../values/types";
|
2
|
-
export interface DecayConfig {
|
3
|
-
from?: number;
|
4
|
-
deceleration?: number;
|
5
|
-
velocityFactor?: number;
|
6
|
-
clamp?: number[];
|
7
|
-
velocity?: number;
|
8
|
-
}
|
9
|
-
export interface DefaultDecayConfig {
|
10
|
-
from: number;
|
11
|
-
deceleration: number;
|
12
|
-
velocityFactor: number;
|
13
|
-
clamp?: number[];
|
14
|
-
velocity: number;
|
15
|
-
}
|
16
|
-
export interface DecayState extends AnimationState {
|
17
|
-
lastTimestamp: number;
|
18
|
-
startTimestamp: number;
|
19
|
-
initialVelocity: number;
|
20
|
-
velocity: number;
|
21
|
-
}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { AnimationState } from \"../../values/types\";\n\nexport interface DecayConfig {\n from?: number;\n deceleration?: number;\n velocityFactor?: number;\n clamp?: number[];\n velocity?: number;\n}\n\nexport interface DefaultDecayConfig {\n from: number;\n deceleration: number;\n velocityFactor: number;\n clamp?: number[];\n velocity: number;\n}\n\nexport interface DecayState extends AnimationState {\n lastTimestamp: number;\n startTimestamp: number;\n initialVelocity: number;\n velocity: number;\n}\n"],"mappings":""}
|
@@ -1,65 +0,0 @@
|
|
1
|
-
import type { SpringConfig } from "./types";
|
2
|
-
export declare const Spring: {
|
3
|
-
Config: {
|
4
|
-
Gentle: {
|
5
|
-
mass: number;
|
6
|
-
stiffness: number;
|
7
|
-
damping: number;
|
8
|
-
velocity: number;
|
9
|
-
};
|
10
|
-
Wobbly: {
|
11
|
-
mass: number;
|
12
|
-
stiffness: number;
|
13
|
-
damping: number;
|
14
|
-
velocity: number;
|
15
|
-
};
|
16
|
-
WobblySlow: {
|
17
|
-
mass: number;
|
18
|
-
stiffness: number;
|
19
|
-
damping: number;
|
20
|
-
velocity: number;
|
21
|
-
};
|
22
|
-
Stiff: {
|
23
|
-
mass: number;
|
24
|
-
stiffness: number;
|
25
|
-
damping: number;
|
26
|
-
velocity: number;
|
27
|
-
};
|
28
|
-
Default: {
|
29
|
-
mass: number;
|
30
|
-
stiffness: number;
|
31
|
-
damping: number;
|
32
|
-
velocity: number;
|
33
|
-
};
|
34
|
-
};
|
35
|
-
Gentle: (config?: SpringConfig) => {
|
36
|
-
mass: number;
|
37
|
-
stiffness: number;
|
38
|
-
velocity: number;
|
39
|
-
damping: number;
|
40
|
-
};
|
41
|
-
Wobbly: (config?: SpringConfig) => {
|
42
|
-
mass: number;
|
43
|
-
stiffness: number;
|
44
|
-
velocity: number;
|
45
|
-
damping: number;
|
46
|
-
};
|
47
|
-
WobblySlow: (config?: SpringConfig) => {
|
48
|
-
mass: number;
|
49
|
-
stiffness: number;
|
50
|
-
velocity: number;
|
51
|
-
damping: number;
|
52
|
-
};
|
53
|
-
Stiff: (config?: SpringConfig) => {
|
54
|
-
mass: number;
|
55
|
-
stiffness: number;
|
56
|
-
velocity: number;
|
57
|
-
damping: number;
|
58
|
-
};
|
59
|
-
Default: (config?: SpringConfig) => {
|
60
|
-
mass: number;
|
61
|
-
stiffness: number;
|
62
|
-
velocity: number;
|
63
|
-
damping: number;
|
64
|
-
};
|
65
|
-
};
|