@shopify/react-native-skia 0.1.229 → 0.1.230
Sign up to get free protection for your applications and to get access to all the features.
- package/android/cpp/jni/JniLoad.cpp +0 -2
- package/android/src/main/java/com/shopify/reactnative/skia/RNSkiaModule.java +0 -1
- package/android/src/main/java/com/shopify/reactnative/skia/RNSkiaPackage.java +1 -2
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaBaseView.java +7 -12
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaDomView.java +1 -1
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaPictureView.java +1 -1
- package/cpp/api/JsiSkApi.h +4 -1
- package/cpp/api/JsiSkParagraph.h +15 -0
- package/cpp/api/JsiSkParagraphBuilder.h +3 -32
- package/cpp/api/JsiSkParagraphBuilderFactory.h +54 -0
- package/cpp/rnskia/RNSkJsiViewApi.h +0 -52
- package/cpp/rnskia/RNSkManager.cpp +0 -6
- package/cpp/rnskia/RNSkView.h +2 -91
- package/cpp/rnskia/dom/JsiDomApi.h +0 -9
- package/lib/commonjs/animation/index.d.ts +0 -3
- package/lib/commonjs/animation/index.js +0 -39
- package/lib/commonjs/animation/index.js.map +1 -1
- package/lib/commonjs/dom/nodes/JsiSkDOM.d.ts +1 -2
- package/lib/commonjs/dom/nodes/JsiSkDOM.js +0 -6
- package/lib/commonjs/dom/nodes/JsiSkDOM.js.map +1 -1
- package/lib/commonjs/dom/nodes/Node.d.ts +0 -3
- package/lib/commonjs/dom/nodes/Node.js +0 -5
- package/lib/commonjs/dom/nodes/Node.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/index.d.ts +0 -1
- package/lib/commonjs/dom/nodes/drawings/index.js +0 -13
- package/lib/commonjs/dom/nodes/drawings/index.js.map +1 -1
- package/lib/commonjs/dom/types/Drawings.d.ts +0 -4
- package/lib/commonjs/dom/types/Drawings.js.map +1 -1
- package/lib/commonjs/dom/types/NodeType.d.ts +0 -1
- package/lib/commonjs/dom/types/NodeType.js +0 -1
- package/lib/commonjs/dom/types/NodeType.js.map +1 -1
- package/lib/commonjs/dom/types/SkDOM.d.ts +1 -2
- package/lib/commonjs/dom/types/SkDOM.js.map +1 -1
- package/lib/commonjs/index.d.ts +0 -1
- package/lib/commonjs/index.js +0 -14
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/mock/index.js +0 -4
- package/lib/commonjs/mock/index.js.map +1 -1
- package/lib/commonjs/renderer/Canvas.js +2 -21
- package/lib/commonjs/renderer/Canvas.js.map +1 -1
- package/lib/commonjs/renderer/Container.d.ts +1 -3
- package/lib/commonjs/renderer/Container.js +4 -6
- package/lib/commonjs/renderer/Container.js.map +1 -1
- package/lib/commonjs/renderer/HostComponents.d.ts +1 -6
- package/lib/commonjs/renderer/HostComponents.js +0 -3
- package/lib/commonjs/renderer/HostComponents.js.map +1 -1
- package/lib/commonjs/renderer/HostConfig.js +2 -23
- package/lib/commonjs/renderer/HostConfig.js.map +1 -1
- package/lib/commonjs/renderer/Reconciler.d.ts +1 -5
- package/lib/commonjs/renderer/Reconciler.js +3 -18
- package/lib/commonjs/renderer/Reconciler.js.map +1 -1
- package/lib/commonjs/renderer/components/index.d.ts +0 -1
- package/lib/commonjs/renderer/components/index.js +0 -13
- package/lib/commonjs/renderer/components/index.js.map +1 -1
- package/lib/commonjs/renderer/index.d.ts +0 -1
- package/lib/commonjs/renderer/index.js +0 -13
- package/lib/commonjs/renderer/index.js.map +1 -1
- package/lib/commonjs/renderer/processors/Animations/Animations.d.ts +1 -8
- package/lib/commonjs/renderer/processors/Animations/Animations.js +0 -44
- package/lib/commonjs/renderer/processors/Animations/Animations.js.map +1 -1
- package/lib/commonjs/skia/types/Paragraph/Paragraph.d.ts +23 -0
- package/lib/commonjs/skia/types/Paragraph/Paragraph.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkParagraph.d.ts +3 -0
- package/lib/commonjs/skia/web/JsiSkParagraph.js +12 -0
- package/lib/commonjs/skia/web/JsiSkParagraph.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkParagraphBuilderFactory.js +5 -2
- package/lib/commonjs/skia/web/JsiSkParagraphBuilderFactory.js.map +1 -1
- package/lib/commonjs/views/SkiaBaseWebView.d.ts +0 -7
- package/lib/commonjs/views/SkiaBaseWebView.js +0 -17
- package/lib/commonjs/views/SkiaBaseWebView.js.map +1 -1
- package/lib/commonjs/views/SkiaDomView.d.ts +0 -7
- package/lib/commonjs/views/SkiaDomView.js +3 -14
- package/lib/commonjs/views/SkiaDomView.js.map +1 -1
- package/lib/commonjs/views/SkiaDomView.web.js +4 -14
- package/lib/commonjs/views/SkiaDomView.web.js.map +1 -1
- package/lib/commonjs/views/SkiaPictureView.d.ts +0 -7
- package/lib/commonjs/views/SkiaPictureView.js +3 -14
- package/lib/commonjs/views/SkiaPictureView.js.map +1 -1
- package/lib/commonjs/views/SkiaViewNativeId.d.ts +3 -0
- package/lib/commonjs/views/SkiaViewNativeId.js +11 -0
- package/lib/commonjs/views/SkiaViewNativeId.js.map +1 -0
- package/lib/commonjs/views/index.d.ts +0 -2
- package/lib/commonjs/views/index.js +0 -26
- package/lib/commonjs/views/index.js.map +1 -1
- package/lib/commonjs/views/types.d.ts +2 -15
- package/lib/commonjs/views/types.js.map +1 -1
- package/lib/module/animation/index.d.ts +0 -3
- package/lib/module/animation/index.js +0 -3
- package/lib/module/animation/index.js.map +1 -1
- package/lib/module/dom/nodes/JsiSkDOM.d.ts +1 -2
- package/lib/module/dom/nodes/JsiSkDOM.js +1 -7
- package/lib/module/dom/nodes/JsiSkDOM.js.map +1 -1
- package/lib/module/dom/nodes/Node.d.ts +0 -3
- package/lib/module/dom/nodes/Node.js +0 -5
- package/lib/module/dom/nodes/Node.js.map +1 -1
- package/lib/module/dom/nodes/drawings/index.d.ts +0 -1
- package/lib/module/dom/nodes/drawings/index.js +0 -1
- package/lib/module/dom/nodes/drawings/index.js.map +1 -1
- package/lib/module/dom/types/Drawings.d.ts +0 -4
- package/lib/module/dom/types/Drawings.js.map +1 -1
- package/lib/module/dom/types/NodeType.d.ts +0 -1
- package/lib/module/dom/types/NodeType.js +0 -1
- package/lib/module/dom/types/NodeType.js.map +1 -1
- package/lib/module/dom/types/SkDOM.d.ts +1 -2
- package/lib/module/dom/types/SkDOM.js.map +1 -1
- package/lib/module/index.d.ts +0 -1
- package/lib/module/index.js +0 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/mock/index.js +1 -4
- package/lib/module/mock/index.js.map +1 -1
- package/lib/module/renderer/Canvas.js +2 -20
- package/lib/module/renderer/Canvas.js.map +1 -1
- package/lib/module/renderer/Container.d.ts +1 -3
- package/lib/module/renderer/Container.js +4 -6
- package/lib/module/renderer/Container.js.map +1 -1
- package/lib/module/renderer/HostComponents.d.ts +1 -6
- package/lib/module/renderer/HostComponents.js +0 -3
- package/lib/module/renderer/HostComponents.js.map +1 -1
- package/lib/module/renderer/HostConfig.js +3 -23
- package/lib/module/renderer/HostConfig.js.map +1 -1
- package/lib/module/renderer/Reconciler.d.ts +1 -5
- package/lib/module/renderer/Reconciler.js +3 -16
- package/lib/module/renderer/Reconciler.js.map +1 -1
- package/lib/module/renderer/components/index.d.ts +0 -1
- package/lib/module/renderer/components/index.js +0 -1
- package/lib/module/renderer/components/index.js.map +1 -1
- package/lib/module/renderer/index.d.ts +0 -1
- package/lib/module/renderer/index.js +0 -1
- package/lib/module/renderer/index.js.map +1 -1
- package/lib/module/renderer/processors/Animations/Animations.d.ts +1 -8
- package/lib/module/renderer/processors/Animations/Animations.js +0 -28
- package/lib/module/renderer/processors/Animations/Animations.js.map +1 -1
- package/lib/module/skia/types/Paragraph/Paragraph.d.ts +23 -0
- package/lib/module/skia/types/Paragraph/Paragraph.js.map +1 -1
- package/lib/module/skia/web/JsiSkParagraph.d.ts +3 -0
- package/lib/module/skia/web/JsiSkParagraph.js +12 -0
- package/lib/module/skia/web/JsiSkParagraph.js.map +1 -1
- package/lib/module/skia/web/JsiSkParagraphBuilderFactory.js +5 -2
- package/lib/module/skia/web/JsiSkParagraphBuilderFactory.js.map +1 -1
- package/lib/module/views/SkiaBaseWebView.d.ts +0 -7
- package/lib/module/views/SkiaBaseWebView.js +0 -17
- package/lib/module/views/SkiaBaseWebView.js.map +1 -1
- package/lib/module/views/SkiaDomView.d.ts +0 -7
- package/lib/module/views/SkiaDomView.js +2 -13
- package/lib/module/views/SkiaDomView.js.map +1 -1
- package/lib/module/views/SkiaDomView.web.js +4 -13
- package/lib/module/views/SkiaDomView.web.js.map +1 -1
- package/lib/module/views/SkiaPictureView.d.ts +0 -7
- package/lib/module/views/SkiaPictureView.js +2 -13
- package/lib/module/views/SkiaPictureView.js.map +1 -1
- package/lib/module/views/SkiaViewNativeId.d.ts +3 -0
- package/lib/module/views/SkiaViewNativeId.js +4 -0
- package/lib/module/views/SkiaViewNativeId.js.map +1 -0
- package/lib/module/views/index.d.ts +0 -2
- package/lib/module/views/index.js +0 -2
- package/lib/module/views/index.js.map +1 -1
- package/lib/module/views/types.d.ts +2 -15
- package/lib/module/views/types.js.map +1 -1
- package/lib/typescript/src/animation/index.d.ts +0 -3
- package/lib/typescript/src/dom/nodes/JsiSkDOM.d.ts +1 -2
- package/lib/typescript/src/dom/nodes/Node.d.ts +0 -3
- package/lib/typescript/src/dom/nodes/drawings/index.d.ts +0 -1
- package/lib/typescript/src/dom/types/Drawings.d.ts +0 -4
- package/lib/typescript/src/dom/types/NodeType.d.ts +0 -1
- package/lib/typescript/src/dom/types/SkDOM.d.ts +1 -2
- package/lib/typescript/src/index.d.ts +0 -1
- package/lib/typescript/src/renderer/Container.d.ts +1 -3
- package/lib/typescript/src/renderer/HostComponents.d.ts +1 -6
- package/lib/typescript/src/renderer/Reconciler.d.ts +1 -5
- package/lib/typescript/src/renderer/components/index.d.ts +0 -1
- package/lib/typescript/src/renderer/index.d.ts +0 -1
- package/lib/typescript/src/renderer/processors/Animations/Animations.d.ts +1 -8
- package/lib/typescript/src/skia/types/Paragraph/Paragraph.d.ts +23 -0
- package/lib/typescript/src/skia/web/JsiSkParagraph.d.ts +3 -0
- package/lib/typescript/src/views/SkiaBaseWebView.d.ts +0 -7
- package/lib/typescript/src/views/SkiaDomView.d.ts +0 -7
- package/lib/typescript/src/views/SkiaPictureView.d.ts +0 -7
- package/lib/typescript/src/views/SkiaViewNativeId.d.ts +3 -0
- package/lib/typescript/src/views/index.d.ts +0 -2
- package/lib/typescript/src/views/types.d.ts +2 -15
- package/package.json +1 -1
- package/src/animation/index.ts +0 -3
- package/src/dom/nodes/JsiSkDOM.ts +0 -12
- package/src/dom/nodes/Node.ts +0 -5
- package/src/dom/nodes/drawings/index.ts +0 -1
- package/src/dom/types/Drawings.ts +0 -5
- package/src/dom/types/NodeType.ts +0 -1
- package/src/dom/types/SkDOM.ts +0 -4
- package/src/index.ts +0 -1
- package/src/mock/index.ts +0 -3
- package/src/renderer/Canvas.tsx +3 -21
- package/src/renderer/Container.tsx +1 -4
- package/src/renderer/HostComponents.ts +0 -13
- package/src/renderer/HostConfig.ts +3 -24
- package/src/renderer/Reconciler.tsx +1 -19
- package/src/renderer/components/index.ts +0 -1
- package/src/renderer/index.ts +0 -1
- package/src/renderer/processors/Animations/Animations.ts +1 -51
- package/src/skia/types/Paragraph/Paragraph.ts +25 -0
- package/src/skia/web/JsiSkParagraph.ts +11 -0
- package/src/skia/web/JsiSkParagraphBuilderFactory.ts +9 -3
- package/src/views/SkiaBaseWebView.tsx +0 -19
- package/src/views/SkiaDomView.tsx +1 -13
- package/src/views/SkiaDomView.web.tsx +1 -6
- package/src/views/SkiaPictureView.tsx +1 -13
- package/src/views/SkiaViewNativeId.ts +1 -0
- package/src/views/index.ts +0 -2
- package/src/views/types.ts +2 -26
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaDrawView.java +0 -44
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaDrawViewManager.java +0 -34
- package/cpp/rnskia/RNSkAnimation.h +0 -65
- package/cpp/rnskia/RNSkValueApi.h +0 -72
- package/cpp/rnskia/dom/base/JsiDependencyManager.h +0 -297
- package/cpp/rnskia/dom/nodes/JsiCustomDrawingNode.h +0 -127
- package/cpp/rnskia/dom/props/DrawingProp.h +0 -35
- package/cpp/rnskia/values/RNSkClockValue.h +0 -140
- package/cpp/rnskia/values/RNSkComputedValue.h +0 -104
- package/cpp/rnskia/values/RNSkReadonlyValue.h +0 -166
- package/cpp/rnskia/values/RNSkValue.h +0 -116
- package/ios/RNSkia-iOS/SkiaDrawView.h +0 -7
- package/ios/RNSkia-iOS/SkiaDrawView.mm +0 -72
- package/ios/RNSkia-iOS/SkiaDrawViewManager.h +0 -7
- package/ios/RNSkia-iOS/SkiaDrawViewManager.mm +0 -50
- package/lib/commonjs/animation/decay/decay.d.ts +0 -2
- package/lib/commonjs/animation/decay/decay.js +0 -42
- package/lib/commonjs/animation/decay/decay.js.map +0 -1
- package/lib/commonjs/animation/decay/index.d.ts +0 -1
- package/lib/commonjs/animation/decay/index.js +0 -14
- package/lib/commonjs/animation/decay/index.js.map +0 -1
- package/lib/commonjs/animation/decay/runDecay.d.ts +0 -10
- package/lib/commonjs/animation/decay/runDecay.js +0 -48
- package/lib/commonjs/animation/decay/runDecay.js.map +0 -1
- package/lib/commonjs/animation/decay/types.d.ts +0 -21
- package/lib/commonjs/animation/decay/types.js +0 -6
- package/lib/commonjs/animation/decay/types.js.map +0 -1
- package/lib/commonjs/animation/spring/Spring.d.ts +0 -65
- package/lib/commonjs/animation/spring/Spring.js +0 -77
- package/lib/commonjs/animation/spring/Spring.js.map +0 -1
- package/lib/commonjs/animation/spring/functions/index.d.ts +0 -1
- package/lib/commonjs/animation/spring/functions/index.js +0 -14
- package/lib/commonjs/animation/spring/functions/index.js.map +0 -1
- package/lib/commonjs/animation/spring/functions/spring.d.ts +0 -10
- package/lib/commonjs/animation/spring/functions/spring.js +0 -94
- package/lib/commonjs/animation/spring/functions/spring.js.map +0 -1
- package/lib/commonjs/animation/spring/index.d.ts +0 -3
- package/lib/commonjs/animation/spring/index.js +0 -30
- package/lib/commonjs/animation/spring/index.js.map +0 -1
- package/lib/commonjs/animation/spring/runSpring.d.ts +0 -19
- package/lib/commonjs/animation/spring/runSpring.js +0 -35
- package/lib/commonjs/animation/spring/runSpring.js.map +0 -1
- package/lib/commonjs/animation/spring/types.d.ts +0 -6
- package/lib/commonjs/animation/spring/types.js +0 -2
- package/lib/commonjs/animation/spring/types.js.map +0 -1
- package/lib/commonjs/animation/spring/useSpring.d.ts +0 -13
- package/lib/commonjs/animation/spring/useSpring.js +0 -27
- package/lib/commonjs/animation/spring/useSpring.js.map +0 -1
- package/lib/commonjs/animation/timing/Easing.d.ts +0 -19
- package/lib/commonjs/animation/timing/Easing.js +0 -108
- package/lib/commonjs/animation/timing/Easing.js.map +0 -1
- package/lib/commonjs/animation/timing/createTiming.d.ts +0 -17
- package/lib/commonjs/animation/timing/createTiming.js +0 -55
- package/lib/commonjs/animation/timing/createTiming.js.map +0 -1
- package/lib/commonjs/animation/timing/functions/bezier.d.ts +0 -1
- package/lib/commonjs/animation/timing/functions/bezier.js +0 -147
- package/lib/commonjs/animation/timing/functions/bezier.js.map +0 -1
- package/lib/commonjs/animation/timing/functions/getResolvedParams.d.ts +0 -7
- package/lib/commonjs/animation/timing/functions/getResolvedParams.js +0 -52
- package/lib/commonjs/animation/timing/functions/getResolvedParams.js.map +0 -1
- package/lib/commonjs/animation/timing/functions/index.d.ts +0 -4
- package/lib/commonjs/animation/timing/functions/index.js +0 -54
- package/lib/commonjs/animation/timing/functions/index.js.map +0 -1
- package/lib/commonjs/animation/timing/functions/timing.d.ts +0 -17
- package/lib/commonjs/animation/timing/functions/timing.js +0 -50
- package/lib/commonjs/animation/timing/functions/timing.js.map +0 -1
- package/lib/commonjs/animation/timing/functions/types.d.ts +0 -7
- package/lib/commonjs/animation/timing/functions/types.js +0 -2
- package/lib/commonjs/animation/timing/functions/types.js.map +0 -1
- package/lib/commonjs/animation/timing/index.d.ts +0 -4
- package/lib/commonjs/animation/timing/index.js +0 -38
- package/lib/commonjs/animation/timing/index.js.map +0 -1
- package/lib/commonjs/animation/timing/runTiming.d.ts +0 -19
- package/lib/commonjs/animation/timing/runTiming.js +0 -36
- package/lib/commonjs/animation/timing/runTiming.js.map +0 -1
- package/lib/commonjs/animation/timing/useLoop.d.ts +0 -11
- package/lib/commonjs/animation/timing/useLoop.js +0 -25
- package/lib/commonjs/animation/timing/useLoop.js.map +0 -1
- package/lib/commonjs/animation/timing/useTiming.d.ts +0 -13
- package/lib/commonjs/animation/timing/useTiming.js +0 -67
- package/lib/commonjs/animation/timing/useTiming.js.map +0 -1
- package/lib/commonjs/dom/nodes/drawings/CustomDrawingNode.d.ts +0 -8
- package/lib/commonjs/dom/nodes/drawings/CustomDrawingNode.js +0 -28
- package/lib/commonjs/dom/nodes/drawings/CustomDrawingNode.js.map +0 -1
- package/lib/commonjs/renderer/DependencyManager.d.ts +0 -46
- package/lib/commonjs/renderer/DependencyManager.js +0 -185
- package/lib/commonjs/renderer/DependencyManager.js.map +0 -1
- package/lib/commonjs/renderer/components/Drawing.d.ts +0 -8
- package/lib/commonjs/renderer/components/Drawing.js +0 -22
- package/lib/commonjs/renderer/components/Drawing.js.map +0 -1
- package/lib/commonjs/specs/SkiaDrawViewNativeComponent.d.ts +0 -8
- package/lib/commonjs/specs/SkiaDrawViewNativeComponent.js +0 -16
- package/lib/commonjs/specs/SkiaDrawViewNativeComponent.js.map +0 -1
- package/lib/commonjs/values/api.d.ts +0 -26
- package/lib/commonjs/values/api.js +0 -55
- package/lib/commonjs/values/api.js.map +0 -1
- package/lib/commonjs/values/api.web.d.ts +0 -2
- package/lib/commonjs/values/api.web.js +0 -18
- package/lib/commonjs/values/api.web.js.map +0 -1
- package/lib/commonjs/values/hooks/index.d.ts +0 -4
- package/lib/commonjs/values/hooks/index.js +0 -58
- package/lib/commonjs/values/hooks/index.js.map +0 -1
- package/lib/commonjs/values/hooks/useClockValue.d.ts +0 -9
- package/lib/commonjs/values/hooks/useClockValue.js +0 -30
- package/lib/commonjs/values/hooks/useClockValue.js.map +0 -1
- package/lib/commonjs/values/hooks/useComputedValue.d.ts +0 -11
- package/lib/commonjs/values/hooks/useComputedValue.js +0 -32
- package/lib/commonjs/values/hooks/useComputedValue.js.map +0 -1
- package/lib/commonjs/values/hooks/useValue.d.ts +0 -10
- package/lib/commonjs/values/hooks/useValue.js +0 -26
- package/lib/commonjs/values/hooks/useValue.js.map +0 -1
- package/lib/commonjs/values/hooks/useValueEffect.d.ts +0 -10
- package/lib/commonjs/values/hooks/useValueEffect.js +0 -25
- package/lib/commonjs/values/hooks/useValueEffect.js.map +0 -1
- package/lib/commonjs/values/index.d.ts +0 -4
- package/lib/commonjs/values/index.js +0 -58
- package/lib/commonjs/values/index.js.map +0 -1
- package/lib/commonjs/values/selector.d.ts +0 -14
- package/lib/commonjs/values/selector.js +0 -24
- package/lib/commonjs/values/selector.js.map +0 -1
- package/lib/commonjs/values/types.d.ts +0 -63
- package/lib/commonjs/values/types.js +0 -2
- package/lib/commonjs/values/types.js.map +0 -1
- package/lib/commonjs/values/web/RNSkAnimation.d.ts +0 -9
- package/lib/commonjs/values/web/RNSkAnimation.js +0 -46
- package/lib/commonjs/values/web/RNSkAnimation.js.map +0 -1
- package/lib/commonjs/values/web/RNSkClockValue.d.ts +0 -13
- package/lib/commonjs/values/web/RNSkClockValue.js +0 -75
- package/lib/commonjs/values/web/RNSkClockValue.js.map +0 -1
- package/lib/commonjs/values/web/RNSkComputedValue.d.ts +0 -10
- package/lib/commonjs/values/web/RNSkComputedValue.js +0 -59
- package/lib/commonjs/values/web/RNSkComputedValue.js.map +0 -1
- package/lib/commonjs/values/web/RNSkReadonlyValue.d.ts +0 -12
- package/lib/commonjs/values/web/RNSkReadonlyValue.js +0 -51
- package/lib/commonjs/values/web/RNSkReadonlyValue.js.map +0 -1
- package/lib/commonjs/values/web/RNSkValue.d.ts +0 -14
- package/lib/commonjs/values/web/RNSkValue.js +0 -73
- package/lib/commonjs/values/web/RNSkValue.js.map +0 -1
- package/lib/commonjs/values/web/api.d.ts +0 -2
- package/lib/commonjs/values/web/api.js +0 -31
- package/lib/commonjs/values/web/api.js.map +0 -1
- package/lib/commonjs/values/web/index.d.ts +0 -1
- package/lib/commonjs/values/web/index.js +0 -19
- package/lib/commonjs/values/web/index.js.map +0 -1
- package/lib/commonjs/views/SkiaView.d.ts +0 -35
- package/lib/commonjs/views/SkiaView.js +0 -139
- package/lib/commonjs/views/SkiaView.js.map +0 -1
- package/lib/commonjs/views/SkiaView.web.d.ts +0 -7
- package/lib/commonjs/views/SkiaView.web.js +0 -30
- package/lib/commonjs/views/SkiaView.web.js.map +0 -1
- package/lib/commonjs/views/useDrawCallback.d.ts +0 -8
- package/lib/commonjs/views/useDrawCallback.js +0 -23
- package/lib/commonjs/views/useDrawCallback.js.map +0 -1
- package/lib/module/animation/decay/decay.d.ts +0 -2
- package/lib/module/animation/decay/decay.js +0 -33
- package/lib/module/animation/decay/decay.js.map +0 -1
- package/lib/module/animation/decay/index.d.ts +0 -1
- package/lib/module/animation/decay/index.js +0 -2
- package/lib/module/animation/decay/index.js.map +0 -1
- package/lib/module/animation/decay/runDecay.d.ts +0 -10
- package/lib/module/animation/decay/runDecay.js +0 -38
- package/lib/module/animation/decay/runDecay.js.map +0 -1
- package/lib/module/animation/decay/types.d.ts +0 -21
- package/lib/module/animation/decay/types.js +0 -2
- package/lib/module/animation/decay/types.js.map +0 -1
- package/lib/module/animation/spring/Spring.d.ts +0 -65
- package/lib/module/animation/spring/Spring.js +0 -69
- package/lib/module/animation/spring/Spring.js.map +0 -1
- package/lib/module/animation/spring/functions/index.d.ts +0 -1
- package/lib/module/animation/spring/functions/index.js +0 -2
- package/lib/module/animation/spring/functions/index.js.map +0 -1
- package/lib/module/animation/spring/functions/spring.d.ts +0 -10
- package/lib/module/animation/spring/functions/spring.js +0 -85
- package/lib/module/animation/spring/functions/spring.js.map +0 -1
- package/lib/module/animation/spring/index.d.ts +0 -3
- package/lib/module/animation/spring/index.js +0 -4
- package/lib/module/animation/spring/index.js.map +0 -1
- package/lib/module/animation/spring/runSpring.d.ts +0 -19
- package/lib/module/animation/spring/runSpring.js +0 -24
- package/lib/module/animation/spring/runSpring.js.map +0 -1
- package/lib/module/animation/spring/types.d.ts +0 -6
- package/lib/module/animation/spring/types.js +0 -2
- package/lib/module/animation/spring/types.js.map +0 -1
- package/lib/module/animation/spring/useSpring.d.ts +0 -13
- package/lib/module/animation/spring/useSpring.js +0 -16
- package/lib/module/animation/spring/useSpring.js.map +0 -1
- package/lib/module/animation/timing/Easing.d.ts +0 -19
- package/lib/module/animation/timing/Easing.js +0 -98
- package/lib/module/animation/timing/Easing.js.map +0 -1
- package/lib/module/animation/timing/createTiming.d.ts +0 -17
- package/lib/module/animation/timing/createTiming.js +0 -49
- package/lib/module/animation/timing/createTiming.js.map +0 -1
- package/lib/module/animation/timing/functions/bezier.d.ts +0 -1
- package/lib/module/animation/timing/functions/bezier.js +0 -141
- package/lib/module/animation/timing/functions/bezier.js.map +0 -1
- package/lib/module/animation/timing/functions/getResolvedParams.d.ts +0 -7
- package/lib/module/animation/timing/functions/getResolvedParams.js +0 -48
- package/lib/module/animation/timing/functions/getResolvedParams.js.map +0 -1
- package/lib/module/animation/timing/functions/index.d.ts +0 -4
- package/lib/module/animation/timing/functions/index.js +0 -5
- package/lib/module/animation/timing/functions/index.js.map +0 -1
- package/lib/module/animation/timing/functions/timing.d.ts +0 -17
- package/lib/module/animation/timing/functions/timing.js +0 -41
- package/lib/module/animation/timing/functions/timing.js.map +0 -1
- package/lib/module/animation/timing/functions/types.d.ts +0 -7
- package/lib/module/animation/timing/functions/types.js +0 -2
- package/lib/module/animation/timing/functions/types.js.map +0 -1
- package/lib/module/animation/timing/index.d.ts +0 -4
- package/lib/module/animation/timing/index.js +0 -5
- package/lib/module/animation/timing/index.js.map +0 -1
- package/lib/module/animation/timing/runTiming.d.ts +0 -19
- package/lib/module/animation/timing/runTiming.js +0 -26
- package/lib/module/animation/timing/runTiming.js.map +0 -1
- package/lib/module/animation/timing/useLoop.d.ts +0 -11
- package/lib/module/animation/timing/useLoop.js +0 -16
- package/lib/module/animation/timing/useLoop.js.map +0 -1
- package/lib/module/animation/timing/useTiming.d.ts +0 -13
- package/lib/module/animation/timing/useTiming.js +0 -57
- package/lib/module/animation/timing/useTiming.js.map +0 -1
- package/lib/module/dom/nodes/drawings/CustomDrawingNode.d.ts +0 -8
- package/lib/module/dom/nodes/drawings/CustomDrawingNode.js +0 -17
- package/lib/module/dom/nodes/drawings/CustomDrawingNode.js.map +0 -1
- package/lib/module/renderer/DependencyManager.d.ts +0 -46
- package/lib/module/renderer/DependencyManager.js +0 -174
- package/lib/module/renderer/DependencyManager.js.map +0 -1
- package/lib/module/renderer/components/Drawing.d.ts +0 -8
- package/lib/module/renderer/components/Drawing.js +0 -11
- package/lib/module/renderer/components/Drawing.js.map +0 -1
- package/lib/module/specs/SkiaDrawViewNativeComponent.d.ts +0 -8
- package/lib/module/specs/SkiaDrawViewNativeComponent.js +0 -4
- package/lib/module/specs/SkiaDrawViewNativeComponent.js.map +0 -1
- package/lib/module/values/api.d.ts +0 -26
- package/lib/module/values/api.js +0 -48
- package/lib/module/values/api.js.map +0 -1
- package/lib/module/values/api.web.d.ts +0 -2
- package/lib/module/values/api.web.js +0 -7
- package/lib/module/values/api.web.js.map +0 -1
- package/lib/module/values/hooks/index.d.ts +0 -4
- package/lib/module/values/hooks/index.js +0 -5
- package/lib/module/values/hooks/index.js.map +0 -1
- package/lib/module/values/hooks/useClockValue.d.ts +0 -9
- package/lib/module/values/hooks/useClockValue.js +0 -20
- package/lib/module/values/hooks/useClockValue.js.map +0 -1
- package/lib/module/values/hooks/useComputedValue.d.ts +0 -11
- package/lib/module/values/hooks/useComputedValue.js +0 -21
- package/lib/module/values/hooks/useComputedValue.js.map +0 -1
- package/lib/module/values/hooks/useValue.d.ts +0 -10
- package/lib/module/values/hooks/useValue.js +0 -16
- package/lib/module/values/hooks/useValue.js.map +0 -1
- package/lib/module/values/hooks/useValueEffect.d.ts +0 -10
- package/lib/module/values/hooks/useValueEffect.js +0 -16
- package/lib/module/values/hooks/useValueEffect.js.map +0 -1
- package/lib/module/values/index.d.ts +0 -4
- package/lib/module/values/index.js +0 -5
- package/lib/module/values/index.js.map +0 -1
- package/lib/module/values/selector.d.ts +0 -14
- package/lib/module/values/selector.js +0 -15
- package/lib/module/values/selector.js.map +0 -1
- package/lib/module/values/types.d.ts +0 -63
- package/lib/module/values/types.js +0 -2
- package/lib/module/values/types.js.map +0 -1
- package/lib/module/values/web/RNSkAnimation.d.ts +0 -9
- package/lib/module/values/web/RNSkAnimation.js +0 -36
- package/lib/module/values/web/RNSkAnimation.js.map +0 -1
- package/lib/module/values/web/RNSkClockValue.d.ts +0 -13
- package/lib/module/values/web/RNSkClockValue.js +0 -65
- package/lib/module/values/web/RNSkClockValue.js.map +0 -1
- package/lib/module/values/web/RNSkComputedValue.d.ts +0 -10
- package/lib/module/values/web/RNSkComputedValue.js +0 -49
- package/lib/module/values/web/RNSkComputedValue.js.map +0 -1
- package/lib/module/values/web/RNSkReadonlyValue.d.ts +0 -12
- package/lib/module/values/web/RNSkReadonlyValue.js +0 -42
- package/lib/module/values/web/RNSkReadonlyValue.js.map +0 -1
- package/lib/module/values/web/RNSkValue.d.ts +0 -14
- package/lib/module/values/web/RNSkValue.js +0 -63
- package/lib/module/values/web/RNSkValue.js.map +0 -1
- package/lib/module/values/web/api.d.ts +0 -2
- package/lib/module/values/web/api.js +0 -19
- package/lib/module/values/web/api.js.map +0 -1
- package/lib/module/values/web/index.d.ts +0 -1
- package/lib/module/values/web/index.js +0 -2
- package/lib/module/values/web/index.js.map +0 -1
- package/lib/module/views/SkiaView.d.ts +0 -35
- package/lib/module/views/SkiaView.js +0 -119
- package/lib/module/views/SkiaView.js.map +0 -1
- package/lib/module/views/SkiaView.web.d.ts +0 -7
- package/lib/module/views/SkiaView.web.js +0 -20
- package/lib/module/views/SkiaView.web.js.map +0 -1
- package/lib/module/views/useDrawCallback.d.ts +0 -8
- package/lib/module/views/useDrawCallback.js +0 -14
- package/lib/module/views/useDrawCallback.js.map +0 -1
- package/lib/typescript/src/animation/decay/decay.d.ts +0 -2
- package/lib/typescript/src/animation/decay/index.d.ts +0 -1
- package/lib/typescript/src/animation/decay/runDecay.d.ts +0 -10
- package/lib/typescript/src/animation/decay/types.d.ts +0 -21
- package/lib/typescript/src/animation/spring/Spring.d.ts +0 -65
- package/lib/typescript/src/animation/spring/functions/index.d.ts +0 -1
- package/lib/typescript/src/animation/spring/functions/spring.d.ts +0 -10
- package/lib/typescript/src/animation/spring/index.d.ts +0 -3
- package/lib/typescript/src/animation/spring/runSpring.d.ts +0 -19
- package/lib/typescript/src/animation/spring/types.d.ts +0 -6
- package/lib/typescript/src/animation/spring/useSpring.d.ts +0 -13
- package/lib/typescript/src/animation/timing/Easing.d.ts +0 -19
- package/lib/typescript/src/animation/timing/createTiming.d.ts +0 -17
- package/lib/typescript/src/animation/timing/functions/bezier.d.ts +0 -1
- package/lib/typescript/src/animation/timing/functions/getResolvedParams.d.ts +0 -7
- package/lib/typescript/src/animation/timing/functions/index.d.ts +0 -4
- package/lib/typescript/src/animation/timing/functions/timing.d.ts +0 -17
- package/lib/typescript/src/animation/timing/functions/types.d.ts +0 -7
- package/lib/typescript/src/animation/timing/index.d.ts +0 -4
- package/lib/typescript/src/animation/timing/runTiming.d.ts +0 -19
- package/lib/typescript/src/animation/timing/useLoop.d.ts +0 -11
- package/lib/typescript/src/animation/timing/useTiming.d.ts +0 -13
- package/lib/typescript/src/dom/nodes/drawings/CustomDrawingNode.d.ts +0 -8
- package/lib/typescript/src/renderer/DependencyManager.d.ts +0 -46
- package/lib/typescript/src/renderer/components/Drawing.d.ts +0 -8
- package/lib/typescript/src/specs/SkiaDrawViewNativeComponent.d.ts +0 -8
- package/lib/typescript/src/values/api.d.ts +0 -26
- package/lib/typescript/src/values/api.web.d.ts +0 -2
- package/lib/typescript/src/values/hooks/index.d.ts +0 -4
- package/lib/typescript/src/values/hooks/useClockValue.d.ts +0 -9
- package/lib/typescript/src/values/hooks/useComputedValue.d.ts +0 -11
- package/lib/typescript/src/values/hooks/useValue.d.ts +0 -10
- package/lib/typescript/src/values/hooks/useValueEffect.d.ts +0 -10
- package/lib/typescript/src/values/index.d.ts +0 -4
- package/lib/typescript/src/values/selector.d.ts +0 -14
- package/lib/typescript/src/values/types.d.ts +0 -63
- package/lib/typescript/src/values/web/RNSkAnimation.d.ts +0 -9
- package/lib/typescript/src/values/web/RNSkClockValue.d.ts +0 -13
- package/lib/typescript/src/values/web/RNSkComputedValue.d.ts +0 -10
- package/lib/typescript/src/values/web/RNSkReadonlyValue.d.ts +0 -12
- package/lib/typescript/src/values/web/RNSkValue.d.ts +0 -14
- package/lib/typescript/src/values/web/api.d.ts +0 -2
- package/lib/typescript/src/values/web/index.d.ts +0 -1
- package/lib/typescript/src/views/SkiaView.d.ts +0 -35
- package/lib/typescript/src/views/SkiaView.web.d.ts +0 -7
- package/lib/typescript/src/views/useDrawCallback.d.ts +0 -8
- package/src/animation/decay/decay.ts +0 -35
- package/src/animation/decay/index.ts +0 -1
- package/src/animation/decay/runDecay.ts +0 -40
- package/src/animation/decay/types.ts +0 -24
- package/src/animation/spring/Spring.ts +0 -61
- package/src/animation/spring/functions/index.ts +0 -1
- package/src/animation/spring/functions/spring.ts +0 -86
- package/src/animation/spring/index.ts +0 -3
- package/src/animation/spring/runSpring.ts +0 -40
- package/src/animation/spring/types.ts +0 -6
- package/src/animation/spring/useSpring.ts +0 -31
- package/src/animation/timing/Easing.ts +0 -102
- package/src/animation/timing/createTiming.ts +0 -62
- package/src/animation/timing/functions/bezier.ts +0 -165
- package/src/animation/timing/functions/getResolvedParams.ts +0 -50
- package/src/animation/timing/functions/index.ts +0 -4
- package/src/animation/timing/functions/timing.ts +0 -44
- package/src/animation/timing/functions/types.ts +0 -8
- package/src/animation/timing/index.ts +0 -4
- package/src/animation/timing/runTiming.ts +0 -36
- package/src/animation/timing/useLoop.ts +0 -21
- package/src/animation/timing/useTiming.ts +0 -71
- package/src/dom/nodes/drawings/CustomDrawingNode.ts +0 -21
- package/src/renderer/DependencyManager.tsx +0 -196
- package/src/renderer/components/Drawing.tsx +0 -12
- package/src/specs/SkiaDrawViewNativeComponent.ts +0 -10
- package/src/values/api.ts +0 -61
- package/src/values/api.web.ts +0 -5
- package/src/values/hooks/index.ts +0 -4
- package/src/values/hooks/useClockValue.ts +0 -21
- package/src/values/hooks/useComputedValue.ts +0 -24
- package/src/values/hooks/useValue.ts +0 -17
- package/src/values/hooks/useValueEffect.ts +0 -18
- package/src/values/index.ts +0 -4
- package/src/values/selector.ts +0 -24
- package/src/values/types.ts +0 -73
- package/src/values/web/RNSkAnimation.ts +0 -33
- package/src/values/web/RNSkClockValue.ts +0 -58
- package/src/values/web/RNSkComputedValue.ts +0 -49
- package/src/values/web/RNSkReadonlyValue.ts +0 -38
- package/src/values/web/RNSkValue.ts +0 -57
- package/src/values/web/api.ts +0 -33
- package/src/values/web/index.ts +0 -1
- package/src/views/SkiaView.tsx +0 -111
- package/src/views/SkiaView.web.tsx +0 -22
- package/src/views/useDrawCallback.ts +0 -19
@@ -1,69 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
Spring animation configurations
|
3
|
-
*/
|
4
|
-
const Config = {
|
5
|
-
Gentle: {
|
6
|
-
mass: 1,
|
7
|
-
stiffness: 170,
|
8
|
-
damping: 19,
|
9
|
-
velocity: 0
|
10
|
-
},
|
11
|
-
Wobbly: {
|
12
|
-
mass: 1,
|
13
|
-
stiffness: 180,
|
14
|
-
damping: 12,
|
15
|
-
velocity: 0
|
16
|
-
},
|
17
|
-
WobblySlow: {
|
18
|
-
mass: 4,
|
19
|
-
stiffness: 180,
|
20
|
-
damping: 25,
|
21
|
-
velocity: 0
|
22
|
-
},
|
23
|
-
Stiff: {
|
24
|
-
mass: 1,
|
25
|
-
stiffness: 200,
|
26
|
-
damping: 20,
|
27
|
-
velocity: 0
|
28
|
-
},
|
29
|
-
Default: {
|
30
|
-
mass: 1,
|
31
|
-
stiffness: 100,
|
32
|
-
damping: 10,
|
33
|
-
velocity: 0
|
34
|
-
}
|
35
|
-
};
|
36
|
-
export const Spring = {
|
37
|
-
Config,
|
38
|
-
Gentle: function () {
|
39
|
-
let config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
40
|
-
return { ...Config.Gentle,
|
41
|
-
...config
|
42
|
-
};
|
43
|
-
},
|
44
|
-
Wobbly: function () {
|
45
|
-
let config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
46
|
-
return { ...Config.Wobbly,
|
47
|
-
...config
|
48
|
-
};
|
49
|
-
},
|
50
|
-
WobblySlow: function () {
|
51
|
-
let config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
52
|
-
return { ...Config.WobblySlow,
|
53
|
-
...config
|
54
|
-
};
|
55
|
-
},
|
56
|
-
Stiff: function () {
|
57
|
-
let config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
58
|
-
return { ...Config.Stiff,
|
59
|
-
...config
|
60
|
-
};
|
61
|
-
},
|
62
|
-
Default: function () {
|
63
|
-
let config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
64
|
-
return { ...Config.Default,
|
65
|
-
...config
|
66
|
-
};
|
67
|
-
}
|
68
|
-
};
|
69
|
-
//# sourceMappingURL=Spring.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["Config","Gentle","mass","stiffness","damping","velocity","Wobbly","WobblySlow","Stiff","Default","Spring","config"],"sources":["Spring.ts"],"sourcesContent":["import type { SpringConfig } from \"./types\";\n\n/*\n Spring animation configurations\n*/\nconst Config = {\n Gentle: {\n mass: 1,\n stiffness: 170,\n damping: 19,\n velocity: 0,\n },\n Wobbly: {\n mass: 1,\n stiffness: 180,\n damping: 12,\n velocity: 0,\n },\n WobblySlow: {\n mass: 4,\n stiffness: 180,\n damping: 25,\n velocity: 0,\n },\n Stiff: {\n mass: 1,\n stiffness: 200,\n damping: 20,\n velocity: 0,\n },\n Default: {\n mass: 1,\n stiffness: 100,\n damping: 10,\n velocity: 0,\n },\n};\n\nexport const Spring = {\n Config,\n Gentle: (config: SpringConfig = {}) => ({\n ...Config.Gentle,\n ...config,\n }),\n Wobbly: (config: SpringConfig = {}) => ({\n ...Config.Wobbly,\n ...config,\n }),\n WobblySlow: (config: SpringConfig = {}) => ({\n ...Config.WobblySlow,\n ...config,\n }),\n Stiff: (config: SpringConfig = {}) => ({\n ...Config.Stiff,\n ...config,\n }),\n Default: (config: SpringConfig = {}) => ({\n ...Config.Default,\n ...config,\n }),\n};\n"],"mappings":"AAEA;AACA;AACA;AACA,MAAMA,MAAM,GAAG;EACbC,MAAM,EAAE;IACNC,IAAI,EAAE,CADA;IAENC,SAAS,EAAE,GAFL;IAGNC,OAAO,EAAE,EAHH;IAINC,QAAQ,EAAE;EAJJ,CADK;EAObC,MAAM,EAAE;IACNJ,IAAI,EAAE,CADA;IAENC,SAAS,EAAE,GAFL;IAGNC,OAAO,EAAE,EAHH;IAINC,QAAQ,EAAE;EAJJ,CAPK;EAabE,UAAU,EAAE;IACVL,IAAI,EAAE,CADI;IAEVC,SAAS,EAAE,GAFD;IAGVC,OAAO,EAAE,EAHC;IAIVC,QAAQ,EAAE;EAJA,CAbC;EAmBbG,KAAK,EAAE;IACLN,IAAI,EAAE,CADD;IAELC,SAAS,EAAE,GAFN;IAGLC,OAAO,EAAE,EAHJ;IAILC,QAAQ,EAAE;EAJL,CAnBM;EAyBbI,OAAO,EAAE;IACPP,IAAI,EAAE,CADC;IAEPC,SAAS,EAAE,GAFJ;IAGPC,OAAO,EAAE,EAHF;IAIPC,QAAQ,EAAE;EAJH;AAzBI,CAAf;AAiCA,OAAO,MAAMK,MAAM,GAAG;EACpBV,MADoB;EAEpBC,MAAM,EAAE;IAAA,IAACU,MAAD,uEAAwB,EAAxB;IAAA,OAAgC,EACtC,GAAGX,MAAM,CAACC,MAD4B;MAEtC,GAAGU;IAFmC,CAAhC;EAAA,CAFY;EAMpBL,MAAM,EAAE;IAAA,IAACK,MAAD,uEAAwB,EAAxB;IAAA,OAAgC,EACtC,GAAGX,MAAM,CAACM,MAD4B;MAEtC,GAAGK;IAFmC,CAAhC;EAAA,CANY;EAUpBJ,UAAU,EAAE;IAAA,IAACI,MAAD,uEAAwB,EAAxB;IAAA,OAAgC,EAC1C,GAAGX,MAAM,CAACO,UADgC;MAE1C,GAAGI;IAFuC,CAAhC;EAAA,CAVQ;EAcpBH,KAAK,EAAE;IAAA,IAACG,MAAD,uEAAwB,EAAxB;IAAA,OAAgC,EACrC,GAAGX,MAAM,CAACQ,KAD2B;MAErC,GAAGG;IAFkC,CAAhC;EAAA,CAda;EAkBpBF,OAAO,EAAE;IAAA,IAACE,MAAD,uEAAwB,EAAxB;IAAA,OAAgC,EACvC,GAAGX,MAAM,CAACS,OAD6B;MAEvC,GAAGE;IAFoC,CAAhC;EAAA;AAlBW,CAAf"}
|
@@ -1 +0,0 @@
|
|
1
|
-
export { createSpringEasing } from "./spring";
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["createSpringEasing"],"sources":["index.ts"],"sourcesContent":["export { createSpringEasing } from \"./spring\";\n"],"mappings":"AAAA,SAASA,kBAAT,QAAmC,UAAnC"}
|
@@ -1,10 +0,0 @@
|
|
1
|
-
import type { SpringConfig } from "../types";
|
2
|
-
import type { TimingConfig } from "../../types";
|
3
|
-
/**
|
4
|
-
* @description Returns a cached jsContext function for a spring with duration
|
5
|
-
* @param mass The mass of the spring
|
6
|
-
* @param stiffness The stiffness of the spring
|
7
|
-
* @param damping Spring damping
|
8
|
-
* @param velocity The initial velocity
|
9
|
-
*/
|
10
|
-
export declare const createSpringEasing: (params: Partial<SpringConfig>) => TimingConfig;
|
@@ -1,85 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @description Returns a cached jsContext function for a spring with duration
|
3
|
-
* @param mass The mass of the spring
|
4
|
-
* @param stiffness The stiffness of the spring
|
5
|
-
* @param damping Spring damping
|
6
|
-
* @param velocity The initial velocity
|
7
|
-
*/
|
8
|
-
export const createSpringEasing = params => {
|
9
|
-
const config = {
|
10
|
-
mass: 1,
|
11
|
-
stiffness: 100,
|
12
|
-
damping: 10,
|
13
|
-
velocity: 0,
|
14
|
-
...params
|
15
|
-
};
|
16
|
-
config.velocity /= 100;
|
17
|
-
return getSpringEasing(config);
|
18
|
-
};
|
19
|
-
|
20
|
-
const getSpringEasing = config => {
|
21
|
-
const {
|
22
|
-
stiffness,
|
23
|
-
mass,
|
24
|
-
damping,
|
25
|
-
velocity: initialVelocity
|
26
|
-
} = config; // Setup spring state
|
27
|
-
|
28
|
-
const state = {
|
29
|
-
w0: Math.sqrt(stiffness / mass),
|
30
|
-
zeta: 0,
|
31
|
-
wd: 0,
|
32
|
-
a: 1,
|
33
|
-
b: 0
|
34
|
-
};
|
35
|
-
state.zeta = damping / (2 * Math.sqrt(stiffness * mass));
|
36
|
-
state.wd = state.zeta < 1 ? state.w0 * Math.sqrt(1 - state.zeta * state.zeta) : 0;
|
37
|
-
state.a = 1;
|
38
|
-
state.b = state.zeta < 1 ? (state.zeta * state.w0 + -initialVelocity) / state.wd : -initialVelocity + state.w0;
|
39
|
-
|
40
|
-
const update = (t, duration) => {
|
41
|
-
let progress = duration ? duration * t / 1000 : t;
|
42
|
-
|
43
|
-
if (state.zeta < 1) {
|
44
|
-
progress = Math.exp(-progress * state.zeta * state.w0) * (state.a * Math.cos(state.wd * progress) + state.b * Math.sin(state.wd * progress));
|
45
|
-
} else {
|
46
|
-
progress = (state.a + state.b * progress) * Math.exp(-progress * state.w0);
|
47
|
-
}
|
48
|
-
|
49
|
-
if (t === 0 || t === 1) {
|
50
|
-
return t;
|
51
|
-
}
|
52
|
-
|
53
|
-
return 1 - progress;
|
54
|
-
};
|
55
|
-
|
56
|
-
const getDurationMs = () => {
|
57
|
-
var frame = 1 / 6;
|
58
|
-
var elapsed = 0;
|
59
|
-
var rest = 0;
|
60
|
-
|
61
|
-
while (true) {
|
62
|
-
elapsed += frame;
|
63
|
-
|
64
|
-
if (update(elapsed) === 1) {
|
65
|
-
rest++;
|
66
|
-
|
67
|
-
if (rest >= 6) {
|
68
|
-
break;
|
69
|
-
}
|
70
|
-
} else {
|
71
|
-
rest = 0;
|
72
|
-
}
|
73
|
-
}
|
74
|
-
|
75
|
-
var durationMs = elapsed * frame * 1000;
|
76
|
-
return durationMs + 1000;
|
77
|
-
};
|
78
|
-
|
79
|
-
const durationMs = getDurationMs();
|
80
|
-
return {
|
81
|
-
easing: t => update(t, durationMs),
|
82
|
-
duration: durationMs
|
83
|
-
};
|
84
|
-
};
|
85
|
-
//# sourceMappingURL=spring.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["createSpringEasing","params","config","mass","stiffness","damping","velocity","getSpringEasing","initialVelocity","state","w0","Math","sqrt","zeta","wd","a","b","update","t","duration","progress","exp","cos","sin","getDurationMs","frame","elapsed","rest","durationMs","easing"],"sources":["spring.ts"],"sourcesContent":["import type { SpringConfig } from \"../types\";\nimport type { TimingConfig } from \"../../types\";\n\n/**\n * @description Returns a cached jsContext function for a spring with duration\n * @param mass The mass of the spring\n * @param stiffness The stiffness of the spring\n * @param damping Spring damping\n * @param velocity The initial velocity\n */\nexport const createSpringEasing = (\n params: Partial<SpringConfig>\n): TimingConfig => {\n const config = {\n mass: 1,\n stiffness: 100,\n damping: 10,\n velocity: 0,\n ...params,\n };\n config.velocity /= 100;\n return getSpringEasing(config);\n};\n\nconst getSpringEasing = (config: Required<SpringConfig>) => {\n const { stiffness, mass, damping, velocity: initialVelocity } = config;\n // Setup spring state\n const state = {\n w0: Math.sqrt(stiffness / mass),\n zeta: 0,\n wd: 0,\n a: 1,\n b: 0,\n };\n state.zeta = damping / (2 * Math.sqrt(stiffness * mass));\n state.wd =\n state.zeta < 1 ? state.w0 * Math.sqrt(1 - state.zeta * state.zeta) : 0;\n state.a = 1;\n state.b =\n state.zeta < 1\n ? (state.zeta * state.w0 + -initialVelocity) / state.wd\n : -initialVelocity + state.w0;\n\n const update = (t: number, duration?: number) => {\n let progress = duration ? (duration * t) / 1000 : t;\n if (state.zeta < 1) {\n progress =\n Math.exp(-progress * state.zeta * state.w0) *\n (state.a * Math.cos(state.wd * progress) +\n state.b * Math.sin(state.wd * progress));\n } else {\n progress =\n (state.a + state.b * progress) * Math.exp(-progress * state.w0);\n }\n if (t === 0 || t === 1) {\n return t;\n }\n return 1 - progress;\n };\n\n const getDurationMs = () => {\n var frame = 1 / 6;\n var elapsed = 0;\n var rest = 0;\n while (true) {\n elapsed += frame;\n if (update(elapsed) === 1) {\n rest++;\n if (rest >= 6) {\n break;\n }\n } else {\n rest = 0;\n }\n }\n var durationMs = elapsed * frame * 1000;\n return durationMs + 1000;\n };\n\n const durationMs = getDurationMs();\n\n return {\n easing: (t: number) => update(t, durationMs),\n duration: durationMs,\n };\n};\n"],"mappings":"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"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["Spring","runSpring","useSpring"],"sources":["index.ts"],"sourcesContent":["export { Spring } from \"./Spring\";\nexport { runSpring } from \"./runSpring\";\nexport { useSpring } from \"./useSpring\";\n"],"mappings":"AAAA,SAASA,MAAT,QAAuB,UAAvB;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SAASC,SAAT,QAA0B,aAA1B"}
|
@@ -1,19 +0,0 @@
|
|
1
|
-
import type { SkiaMutableValue, SkiaAnimation } from "../../values/types";
|
2
|
-
import type { AnimationParams, SpringConfig, 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 configuration
|
16
|
-
* @returns an animation value that can be used to start/stop
|
17
|
-
* the animation.
|
18
|
-
*/
|
19
|
-
export declare const runSpring: (value: SkiaMutableValue<number>, toOrParams: number | AnimationParams, config?: SpringConfig, callback?: AnimationCallback) => SkiaAnimation;
|
@@ -1,24 +0,0 @@
|
|
1
|
-
import { runTiming } from "../timing/runTiming";
|
2
|
-
import { Spring } from "./Spring";
|
3
|
-
import { createSpringEasing } from "./functions/spring";
|
4
|
-
/**
|
5
|
-
* @deprecated Use Reanimated 3 for animations:
|
6
|
-
* https://shopify.github.io/react-native-skia/docs/animations/animations
|
7
|
-
*
|
8
|
-
* Creates a new animation on an existing value that will be driven by
|
9
|
-
* an animation value. The value will be run from / to the value in
|
10
|
-
* params and modified by the provided easing curve for the length of
|
11
|
-
* the duration. When the value has reached its desired "to" value the
|
12
|
-
* animation will be stopped.
|
13
|
-
*
|
14
|
-
* @param value The value to animate
|
15
|
-
* @param toOrParams To value or Animation parameters
|
16
|
-
* @param config Spring configuration
|
17
|
-
* @returns an animation value that can be used to start/stop
|
18
|
-
* the animation.
|
19
|
-
*/
|
20
|
-
|
21
|
-
export const runSpring = (value, toOrParams, config, callback) => {
|
22
|
-
return runTiming(value, toOrParams, createSpringEasing(config !== null && config !== void 0 ? config : Spring.Config.Default), callback);
|
23
|
-
};
|
24
|
-
//# sourceMappingURL=runSpring.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["runTiming","Spring","createSpringEasing","runSpring","value","toOrParams","config","callback","Config","Default"],"sources":["runSpring.ts"],"sourcesContent":["import type { SkiaMutableValue, SkiaAnimation } from \"../../values/types\";\nimport type {\n AnimationParams,\n SpringConfig,\n AnimationCallback,\n} from \"../types\";\nimport { runTiming } from \"../timing/runTiming\";\n\nimport { Spring } from \"./Spring\";\nimport { createSpringEasing } from \"./functions/spring\";\n\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 configuration\n * @returns an animation value that can be used to start/stop\n * the animation.\n */\nexport const runSpring = (\n value: SkiaMutableValue<number>,\n toOrParams: number | AnimationParams,\n config?: SpringConfig,\n callback?: AnimationCallback\n): SkiaAnimation => {\n return runTiming(\n value,\n toOrParams,\n createSpringEasing(config ?? Spring.Config.Default),\n callback\n );\n};\n"],"mappings":"AAMA,SAASA,SAAT,QAA0B,qBAA1B;AAEA,SAASC,MAAT,QAAuB,UAAvB;AACA,SAASC,kBAAT,QAAmC,oBAAnC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,SAAS,GAAG,CACvBC,KADuB,EAEvBC,UAFuB,EAGvBC,MAHuB,EAIvBC,QAJuB,KAKL;EAClB,OAAOP,SAAS,CACdI,KADc,EAEdC,UAFc,EAGdH,kBAAkB,CAACI,MAAD,aAACA,MAAD,cAACA,MAAD,GAAWL,MAAM,CAACO,MAAP,CAAcC,OAAzB,CAHJ,EAIdF,QAJc,CAAhB;AAMD,CAZM"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["export interface SpringConfig {\n mass?: number;\n stiffness?: number;\n velocity?: number;\n damping?: number;\n}\n"],"mappings":""}
|
@@ -1,13 +0,0 @@
|
|
1
|
-
import type { SkiaValue } from "../../values/types";
|
2
|
-
import type { SpringConfig, AnimationParams, 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 a spring based animation value that will run whenever
|
8
|
-
* the animation parameters change.
|
9
|
-
* @param toOrParams
|
10
|
-
* @param config
|
11
|
-
* @returns
|
12
|
-
*/
|
13
|
-
export declare const useSpring: (toOrParams: number | AnimationParams, config?: SpringConfig, callback?: AnimationCallback) => SkiaValue<number>;
|
@@ -1,16 +0,0 @@
|
|
1
|
-
import { useTiming } from "../timing";
|
2
|
-
import { Spring } from "./Spring";
|
3
|
-
import { createSpringEasing } from "./functions/spring";
|
4
|
-
/**
|
5
|
-
* @deprecated Use Reanimated 3 for animations:
|
6
|
-
* https://shopify.github.io/react-native-skia/docs/animations/animations
|
7
|
-
*
|
8
|
-
* Creats a spring based animation value that will run whenever
|
9
|
-
* the animation parameters change.
|
10
|
-
* @param toOrParams
|
11
|
-
* @param config
|
12
|
-
* @returns
|
13
|
-
*/
|
14
|
-
|
15
|
-
export const useSpring = (toOrParams, config, callback) => useTiming(toOrParams, createSpringEasing(config !== null && config !== void 0 ? config : Spring.Config.Default), callback);
|
16
|
-
//# sourceMappingURL=useSpring.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["useTiming","Spring","createSpringEasing","useSpring","toOrParams","config","callback","Config","Default"],"sources":["useSpring.ts"],"sourcesContent":["import type { SkiaValue } from \"../../values/types\";\nimport type {\n SpringConfig,\n AnimationParams,\n AnimationCallback,\n} from \"../types\";\nimport { useTiming } from \"../timing\";\n\nimport { Spring } from \"./Spring\";\nimport { createSpringEasing } from \"./functions/spring\";\n\n/**\n * @deprecated Use Reanimated 3 for animations:\n * https://shopify.github.io/react-native-skia/docs/animations/animations\n *\n * Creats a spring based animation value that will run whenever\n * the animation parameters change.\n * @param toOrParams\n * @param config\n * @returns\n */\nexport const useSpring = (\n toOrParams: number | AnimationParams,\n config?: SpringConfig,\n callback?: AnimationCallback\n): SkiaValue<number> =>\n useTiming(\n toOrParams,\n createSpringEasing(config ?? Spring.Config.Default),\n callback\n );\n"],"mappings":"AAMA,SAASA,SAAT,QAA0B,WAA1B;AAEA,SAASC,MAAT,QAAuB,UAAvB;AACA,SAASC,kBAAT,QAAmC,oBAAnC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,SAAS,GAAG,CACvBC,UADuB,EAEvBC,MAFuB,EAGvBC,QAHuB,KAKvBN,SAAS,CACPI,UADO,EAEPF,kBAAkB,CAACG,MAAD,aAACA,MAAD,cAACA,MAAD,GAAWJ,MAAM,CAACM,MAAP,CAAcC,OAAzB,CAFX,EAGPF,QAHO,CALJ"}
|
@@ -1,19 +0,0 @@
|
|
1
|
-
export declare class Easing {
|
2
|
-
static step0(n: number): number;
|
3
|
-
static step1(n: number): number;
|
4
|
-
static linear(t: number): number;
|
5
|
-
static ease(t: number): number;
|
6
|
-
static quad(t: number): number;
|
7
|
-
static cubic(t: number): number;
|
8
|
-
static poly(n: number): (t: number) => number;
|
9
|
-
static sin(t: number): number;
|
10
|
-
static circle(t: number): number;
|
11
|
-
static exp(t: number): number;
|
12
|
-
static elastic(bounciness?: number): (t: number) => number;
|
13
|
-
static back(s?: number): (t: number) => number;
|
14
|
-
static bounce(t: number): number;
|
15
|
-
static bezier(x1: number, y1: number, x2: number, y2: number): (t: number) => number;
|
16
|
-
static in(easing: (t: number) => number): (t: number) => number;
|
17
|
-
static out(easing: (t: number) => number): (t: number) => number;
|
18
|
-
static inOut(easing: (t: number) => number): (t: number) => number;
|
19
|
-
}
|
@@ -1,98 +0,0 @@
|
|
1
|
-
// eslint-disable-next-line max-len
|
2
|
-
// Taken from https://github.com/facebook/react-native/blob/0b9ea60b4fee8cacc36e7160e31b91fc114dbc0d/Libraries/Animated/src/Easing.js
|
3
|
-
import { bezier } from "./functions";
|
4
|
-
export class Easing {
|
5
|
-
static step0(n) {
|
6
|
-
return n > 0 ? 1 : 0;
|
7
|
-
}
|
8
|
-
|
9
|
-
static step1(n) {
|
10
|
-
return n >= 1 ? 1 : 0;
|
11
|
-
}
|
12
|
-
|
13
|
-
static linear(t) {
|
14
|
-
return t;
|
15
|
-
}
|
16
|
-
|
17
|
-
static ease(t) {
|
18
|
-
return Easing.bezier(0.42, 0, 1, 1)(t);
|
19
|
-
}
|
20
|
-
|
21
|
-
static quad(t) {
|
22
|
-
return t * t;
|
23
|
-
}
|
24
|
-
|
25
|
-
static cubic(t) {
|
26
|
-
return t * t * t;
|
27
|
-
}
|
28
|
-
|
29
|
-
static poly(n) {
|
30
|
-
return t => t ** n;
|
31
|
-
}
|
32
|
-
|
33
|
-
static sin(t) {
|
34
|
-
return 1 - Math.cos(t * Math.PI / 2);
|
35
|
-
}
|
36
|
-
|
37
|
-
static circle(t) {
|
38
|
-
return 1 - Math.sqrt(1 - t * t);
|
39
|
-
}
|
40
|
-
|
41
|
-
static exp(t) {
|
42
|
-
return 2 ** (10 * (t - 1));
|
43
|
-
}
|
44
|
-
|
45
|
-
static elastic() {
|
46
|
-
let bounciness = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
47
|
-
const p = bounciness * Math.PI;
|
48
|
-
return t => 1 - Math.cos(t * Math.PI / 2) ** 3 * Math.cos(t * p);
|
49
|
-
}
|
50
|
-
|
51
|
-
static back() {
|
52
|
-
let s = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1.70158;
|
53
|
-
return t => t * t * ((s + 1) * t - s);
|
54
|
-
}
|
55
|
-
|
56
|
-
static bounce(t) {
|
57
|
-
if (t < 1 / 2.75) {
|
58
|
-
return 7.5625 * t * t;
|
59
|
-
}
|
60
|
-
|
61
|
-
if (t < 2 / 2.75) {
|
62
|
-
const t2_ = t - 1.5 / 2.75;
|
63
|
-
return 7.5625 * t2_ * t2_ + 0.75;
|
64
|
-
}
|
65
|
-
|
66
|
-
if (t < 2.5 / 2.75) {
|
67
|
-
const t2_ = t - 2.25 / 2.75;
|
68
|
-
return 7.5625 * t2_ * t2_ + 0.9375;
|
69
|
-
}
|
70
|
-
|
71
|
-
const t2 = t - 2.625 / 2.75;
|
72
|
-
return 7.5625 * t2 * t2 + 0.984375;
|
73
|
-
}
|
74
|
-
|
75
|
-
static bezier(x1, y1, x2, y2) {
|
76
|
-
return bezier(x1, y1, x2, y2);
|
77
|
-
}
|
78
|
-
|
79
|
-
static in(easing) {
|
80
|
-
return easing;
|
81
|
-
}
|
82
|
-
|
83
|
-
static out(easing) {
|
84
|
-
return t => 1 - easing(1 - t);
|
85
|
-
}
|
86
|
-
|
87
|
-
static inOut(easing) {
|
88
|
-
return t => {
|
89
|
-
if (t < 0.5) {
|
90
|
-
return easing(t * 2) / 2;
|
91
|
-
}
|
92
|
-
|
93
|
-
return 1 - easing((1 - t) * 2) / 2;
|
94
|
-
};
|
95
|
-
}
|
96
|
-
|
97
|
-
}
|
98
|
-
//# sourceMappingURL=Easing.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["bezier","Easing","step0","n","step1","linear","t","ease","quad","cubic","poly","sin","Math","cos","PI","circle","sqrt","exp","elastic","bounciness","p","back","s","bounce","t2_","t2","x1","y1","x2","y2","in","easing","out","inOut"],"sources":["Easing.ts"],"sourcesContent":["// eslint-disable-next-line max-len\n// Taken from https://github.com/facebook/react-native/blob/0b9ea60b4fee8cacc36e7160e31b91fc114dbc0d/Libraries/Animated/src/Easing.js\n\nimport { bezier } from \"./functions\";\n\nexport class Easing {\n static step0(n: number): number {\n return n > 0 ? 1 : 0;\n }\n\n static step1(n: number): number {\n return n >= 1 ? 1 : 0;\n }\n\n static linear(t: number): number {\n return t;\n }\n\n static ease(t: number): number {\n return Easing.bezier(0.42, 0, 1, 1)(t);\n }\n\n static quad(t: number): number {\n return t * t;\n }\n\n static cubic(t: number): number {\n return t * t * t;\n }\n\n static poly(n: number): (t: number) => number {\n return (t: number): number => t ** n;\n }\n\n static sin(t: number): number {\n return 1 - Math.cos((t * Math.PI) / 2);\n }\n\n static circle(t: number): number {\n return 1 - Math.sqrt(1 - t * t);\n }\n\n static exp(t: number): number {\n return 2 ** (10 * (t - 1));\n }\n\n static elastic(bounciness = 1): (t: number) => number {\n const p = bounciness * Math.PI;\n return (t): number =>\n 1 - Math.cos((t * Math.PI) / 2) ** 3 * Math.cos(t * p);\n }\n\n static back(s = 1.70158): (t: number) => number {\n return (t): number => t * t * ((s + 1) * t - s);\n }\n\n static bounce(t: number): number {\n if (t < 1 / 2.75) {\n return 7.5625 * t * t;\n }\n\n if (t < 2 / 2.75) {\n const t2_ = t - 1.5 / 2.75;\n return 7.5625 * t2_ * t2_ + 0.75;\n }\n\n if (t < 2.5 / 2.75) {\n const t2_ = t - 2.25 / 2.75;\n return 7.5625 * t2_ * t2_ + 0.9375;\n }\n\n const t2 = t - 2.625 / 2.75;\n return 7.5625 * t2 * t2 + 0.984375;\n }\n\n static bezier(\n x1: number,\n y1: number,\n x2: number,\n y2: number\n ): (t: number) => number {\n return bezier(x1, y1, x2, y2);\n }\n\n static in(easing: (t: number) => number): (t: number) => number {\n return easing;\n }\n\n static out(easing: (t: number) => number): (t: number) => number {\n return (t): number => 1 - easing(1 - t);\n }\n\n static inOut(easing: (t: number) => number): (t: number) => number {\n return (t): number => {\n if (t < 0.5) {\n return easing(t * 2) / 2;\n }\n\n return 1 - easing((1 - t) * 2) / 2;\n };\n }\n}\n"],"mappings":"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"}
|
@@ -1,17 +0,0 @@
|
|
1
|
-
import type { TimingConfig, RequiredAnimationParams, AnimationCallback } from "../types";
|
2
|
-
import type { SkiaMutableValue } from "../../values/types";
|
3
|
-
/**
|
4
|
-
* Creates an animation that is driven by a clock value.
|
5
|
-
* The value will be run from / to the value in params and modified
|
6
|
-
* by the provided easing curve for the length of the duration. When
|
7
|
-
* the value has reached its desired "to" value the animation
|
8
|
-
* will be stopped. If loop is set to true, the animation will continue
|
9
|
-
* to run until stopped.
|
10
|
-
*
|
11
|
-
* @param params Animation parameters
|
12
|
-
* @param config Spring or timing configuration
|
13
|
-
* @param value Optional value that the animation will update
|
14
|
-
* @params an animation value that can be used to start/stop
|
15
|
-
* the animation.
|
16
|
-
*/
|
17
|
-
export declare const createTiming: (params: RequiredAnimationParams & Required<TimingConfig>, value?: SkiaMutableValue<number>, callback?: AnimationCallback) => import("../../values/types").SkiaAnimation;
|
@@ -1,49 +0,0 @@
|
|
1
|
-
import { ValueApi } from "../../values/api";
|
2
|
-
import { timing } from "./functions";
|
3
|
-
/**
|
4
|
-
* Creates an animation that is driven by a clock value.
|
5
|
-
* The value will be run from / to the value in params and modified
|
6
|
-
* by the provided easing curve for the length of the duration. When
|
7
|
-
* the value has reached its desired "to" value the animation
|
8
|
-
* will be stopped. If loop is set to true, the animation will continue
|
9
|
-
* to run until stopped.
|
10
|
-
*
|
11
|
-
* @param params Animation parameters
|
12
|
-
* @param config Spring or timing configuration
|
13
|
-
* @param value Optional value that the animation will update
|
14
|
-
* @params an animation value that can be used to start/stop
|
15
|
-
* the animation.
|
16
|
-
*/
|
17
|
-
|
18
|
-
export const createTiming = (params, value, callback) => {
|
19
|
-
var _ref, _params$from;
|
20
|
-
|
21
|
-
// Update from to be either the declared from value,
|
22
|
-
// the current value of the value or zero
|
23
|
-
const resolvedParams = { ...params,
|
24
|
-
from: (_ref = (_params$from = params.from) !== null && _params$from !== void 0 ? _params$from : value === null || value === void 0 ? void 0 : value.current) !== null && _ref !== void 0 ? _ref : 0
|
25
|
-
}; // Update function for the animation value
|
26
|
-
|
27
|
-
const animationFunction = (t, state) => {
|
28
|
-
var _params$loop, _params$yoyo;
|
29
|
-
|
30
|
-
// Update the input value using the provided update function
|
31
|
-
const nextState = timing(t, params.duration, params.easing, (_params$loop = params.loop) !== null && _params$loop !== void 0 ? _params$loop : false, (_params$yoyo = params.yoyo) !== null && _params$yoyo !== void 0 ? _params$yoyo : false, state !== null && state !== void 0 ? state : {
|
32
|
-
current: params.from,
|
33
|
-
finished: false
|
34
|
-
});
|
35
|
-
const current = nextState.current * (resolvedParams.to - resolvedParams.from) + resolvedParams.from;
|
36
|
-
|
37
|
-
if (callback && nextState.finished === true) {
|
38
|
-
callback(current);
|
39
|
-
}
|
40
|
-
|
41
|
-
return { ...nextState,
|
42
|
-
current
|
43
|
-
};
|
44
|
-
}; // Create animation value
|
45
|
-
|
46
|
-
|
47
|
-
return ValueApi.createAnimation(animationFunction);
|
48
|
-
};
|
49
|
-
//# sourceMappingURL=createTiming.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["ValueApi","timing","createTiming","params","value","callback","resolvedParams","from","current","animationFunction","t","state","nextState","duration","easing","loop","yoyo","finished","to","createAnimation"],"sources":["createTiming.ts"],"sourcesContent":["import type {\n TimingConfig,\n RequiredAnimationParams,\n AnimationCallback,\n} from \"../types\";\nimport type { AnimationState, SkiaMutableValue } from \"../../values/types\";\nimport { ValueApi } from \"../../values/api\";\n\nimport { timing } from \"./functions\";\n\n/**\n * Creates an animation that is driven by a clock value.\n * The value will be run from / to the value in params and modified\n * by the provided easing curve for the length of the duration. When\n * the value has reached its desired \"to\" value the animation\n * will be stopped. If loop is set to true, the animation will continue\n * to run until stopped.\n *\n * @param params Animation parameters\n * @param config Spring or timing configuration\n * @param value Optional value that the animation will update\n * @params an animation value that can be used to start/stop\n * the animation.\n */\nexport const createTiming = (\n params: RequiredAnimationParams & Required<TimingConfig>,\n value?: SkiaMutableValue<number>,\n callback?: AnimationCallback\n) => {\n // Update from to be either the declared from value,\n // the current value of the value or zero\n const resolvedParams = {\n ...params,\n from: params.from ?? value?.current ?? 0,\n };\n\n // Update function for the animation value\n const animationFunction = (t: number, state: AnimationState | undefined) => {\n // Update the input value using the provided update function\n const nextState = timing(\n t,\n params.duration,\n params.easing,\n params.loop ?? false,\n params.yoyo ?? false,\n state ?? { current: params.from!, finished: false }\n );\n const current =\n nextState.current * (resolvedParams.to - resolvedParams.from!) +\n resolvedParams.from!;\n if (callback && nextState.finished === true) {\n callback(current);\n }\n return {\n ...nextState,\n current,\n };\n };\n\n // Create animation value\n return ValueApi.createAnimation(animationFunction);\n};\n"],"mappings":"AAMA,SAASA,QAAT,QAAyB,kBAAzB;AAEA,SAASC,MAAT,QAAuB,aAAvB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,YAAY,GAAG,CAC1BC,MAD0B,EAE1BC,KAF0B,EAG1BC,QAH0B,KAIvB;EAAA;;EACH;EACA;EACA,MAAMC,cAAc,GAAG,EACrB,GAAGH,MADkB;IAErBI,IAAI,0BAAEJ,MAAM,CAACI,IAAT,uDAAiBH,KAAjB,aAAiBA,KAAjB,uBAAiBA,KAAK,CAAEI,OAAxB,uCAAmC;EAFlB,CAAvB,CAHG,CAQH;;EACA,MAAMC,iBAAiB,GAAG,CAACC,CAAD,EAAYC,KAAZ,KAAkD;IAAA;;IAC1E;IACA,MAAMC,SAAS,GAAGX,MAAM,CACtBS,CADsB,EAEtBP,MAAM,CAACU,QAFe,EAGtBV,MAAM,CAACW,MAHe,kBAItBX,MAAM,CAACY,IAJe,uDAIP,KAJO,kBAKtBZ,MAAM,CAACa,IALe,uDAKP,KALO,EAMtBL,KANsB,aAMtBA,KANsB,cAMtBA,KANsB,GAMb;MAAEH,OAAO,EAAEL,MAAM,CAACI,IAAlB;MAAyBU,QAAQ,EAAE;IAAnC,CANa,CAAxB;IAQA,MAAMT,OAAO,GACXI,SAAS,CAACJ,OAAV,IAAqBF,cAAc,CAACY,EAAf,GAAoBZ,cAAc,CAACC,IAAxD,IACAD,cAAc,CAACC,IAFjB;;IAGA,IAAIF,QAAQ,IAAIO,SAAS,CAACK,QAAV,KAAuB,IAAvC,EAA6C;MAC3CZ,QAAQ,CAACG,OAAD,CAAR;IACD;;IACD,OAAO,EACL,GAAGI,SADE;MAELJ;IAFK,CAAP;EAID,CApBD,CATG,CA+BH;;;EACA,OAAOR,QAAQ,CAACmB,eAAT,CAAyBV,iBAAzB,CAAP;AACD,CArCM"}
|
@@ -1 +0,0 @@
|
|
1
|
-
export declare function bezier(mX1: number, mY1: number, mX2: number, mY2: number): (x: number) => number;
|