@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,73 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.RNSkValue = void 0;
|
7
|
-
|
8
|
-
var _RNSkReadonlyValue = require("./RNSkReadonlyValue");
|
9
|
-
|
10
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
11
|
-
|
12
|
-
class RNSkValue extends _RNSkReadonlyValue.RNSkReadonlyValue {
|
13
|
-
constructor(value) {
|
14
|
-
super(value);
|
15
|
-
|
16
|
-
_defineProperty(this, "_unsubscribe", void 0);
|
17
|
-
|
18
|
-
_defineProperty(this, "_animation", void 0);
|
19
|
-
|
20
|
-
this._unsubscribe = undefined;
|
21
|
-
}
|
22
|
-
|
23
|
-
set current(value) {
|
24
|
-
this.update(value);
|
25
|
-
}
|
26
|
-
|
27
|
-
get current() {
|
28
|
-
return super.current;
|
29
|
-
}
|
30
|
-
|
31
|
-
unsubscribe() {
|
32
|
-
if (this._unsubscribe) {
|
33
|
-
this._unsubscribe();
|
34
|
-
|
35
|
-
this._unsubscribe = undefined;
|
36
|
-
}
|
37
|
-
|
38
|
-
if (this._animation) {
|
39
|
-
this._animation.cancel();
|
40
|
-
|
41
|
-
this._animation = undefined;
|
42
|
-
}
|
43
|
-
}
|
44
|
-
|
45
|
-
subscribe(animation) {
|
46
|
-
this.unsubscribe();
|
47
|
-
|
48
|
-
if (animation) {
|
49
|
-
this._animation = animation;
|
50
|
-
this._unsubscribe = animation.addListener( // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
51
|
-
// @ts-ignore
|
52
|
-
this.animationDidUpdate.bind(this));
|
53
|
-
|
54
|
-
this._animation.start();
|
55
|
-
}
|
56
|
-
}
|
57
|
-
|
58
|
-
animationDidUpdate(value) {
|
59
|
-
this.update(value);
|
60
|
-
}
|
61
|
-
|
62
|
-
get animation() {
|
63
|
-
return this._animation;
|
64
|
-
}
|
65
|
-
|
66
|
-
set animation(v) {
|
67
|
-
this.subscribe(v);
|
68
|
-
}
|
69
|
-
|
70
|
-
}
|
71
|
-
|
72
|
-
exports.RNSkValue = RNSkValue;
|
73
|
-
//# sourceMappingURL=RNSkValue.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["RNSkValue","RNSkReadonlyValue","constructor","value","_unsubscribe","undefined","current","update","unsubscribe","_animation","cancel","subscribe","animation","addListener","animationDidUpdate","bind","start","v"],"sources":["RNSkValue.ts"],"sourcesContent":["import type { SkiaAnimation, SkiaValue } from \"../types\";\n\nimport { RNSkReadonlyValue } from \"./RNSkReadonlyValue\";\n\nexport class RNSkValue<T> extends RNSkReadonlyValue<T> implements SkiaValue<T> {\n constructor(value: T) {\n super(value);\n this._unsubscribe = undefined;\n }\n\n public set current(value: T) {\n this.update(value);\n }\n\n public get current(): T {\n return super.current;\n }\n\n private _unsubscribe: (() => void) | undefined;\n\n private unsubscribe() {\n if (this._unsubscribe) {\n this._unsubscribe();\n this._unsubscribe = undefined;\n }\n if (this._animation) {\n this._animation.cancel();\n this._animation = undefined;\n }\n }\n\n private subscribe(animation: SkiaAnimation | undefined) {\n this.unsubscribe();\n if (animation) {\n this._animation = animation;\n this._unsubscribe = animation.addListener(\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n this.animationDidUpdate.bind(this)\n );\n this._animation.start();\n }\n }\n\n private animationDidUpdate(value: T) {\n this.update(value);\n }\n\n private _animation: SkiaAnimation | undefined;\n public get animation(): SkiaAnimation | undefined {\n return this._animation;\n }\n\n public set animation(v: SkiaAnimation | undefined) {\n this.subscribe(v);\n }\n}\n"],"mappings":";;;;;;;AAEA;;;;AAEO,MAAMA,SAAN,SAA2BC,oCAA3B,CAAwE;EAC7EC,WAAW,CAACC,KAAD,EAAW;IACpB,MAAMA,KAAN;;IADoB;;IAAA;;IAEpB,KAAKC,YAAL,GAAoBC,SAApB;EACD;;EAEiB,IAAPC,OAAO,CAACH,KAAD,EAAW;IAC3B,KAAKI,MAAL,CAAYJ,KAAZ;EACD;;EAEiB,IAAPG,OAAO,GAAM;IACtB,OAAO,MAAMA,OAAb;EACD;;EAIOE,WAAW,GAAG;IACpB,IAAI,KAAKJ,YAAT,EAAuB;MACrB,KAAKA,YAAL;;MACA,KAAKA,YAAL,GAAoBC,SAApB;IACD;;IACD,IAAI,KAAKI,UAAT,EAAqB;MACnB,KAAKA,UAAL,CAAgBC,MAAhB;;MACA,KAAKD,UAAL,GAAkBJ,SAAlB;IACD;EACF;;EAEOM,SAAS,CAACC,SAAD,EAAuC;IACtD,KAAKJ,WAAL;;IACA,IAAII,SAAJ,EAAe;MACb,KAAKH,UAAL,GAAkBG,SAAlB;MACA,KAAKR,YAAL,GAAoBQ,SAAS,CAACC,WAAV,EAClB;MACA;MACA,KAAKC,kBAAL,CAAwBC,IAAxB,CAA6B,IAA7B,CAHkB,CAApB;;MAKA,KAAKN,UAAL,CAAgBO,KAAhB;IACD;EACF;;EAEOF,kBAAkB,CAACX,KAAD,EAAW;IACnC,KAAKI,MAAL,CAAYJ,KAAZ;EACD;;EAGmB,IAATS,SAAS,GAA8B;IAChD,OAAO,KAAKH,UAAZ;EACD;;EAEmB,IAATG,SAAS,CAACK,CAAD,EAA+B;IACjD,KAAKN,SAAL,CAAeM,CAAf;EACD;;AAnD4E"}
|
@@ -1,31 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.ValueApi = void 0;
|
7
|
-
|
8
|
-
var _RNSkAnimation = require("./RNSkAnimation");
|
9
|
-
|
10
|
-
var _RNSkClockValue = require("./RNSkClockValue");
|
11
|
-
|
12
|
-
var _RNSkComputedValue = require("./RNSkComputedValue");
|
13
|
-
|
14
|
-
var _RNSkValue = require("./RNSkValue");
|
15
|
-
|
16
|
-
const ValueApi = {
|
17
|
-
createValue: function (initialValue) {
|
18
|
-
return new _RNSkValue.RNSkValue(initialValue);
|
19
|
-
},
|
20
|
-
createComputedValue: function (cb, values) {
|
21
|
-
return new _RNSkComputedValue.RNSkComputedValue(cb, values);
|
22
|
-
},
|
23
|
-
createClockValue: function () {
|
24
|
-
return new _RNSkClockValue.RNSkClockValue(requestAnimationFrame.bind(window));
|
25
|
-
},
|
26
|
-
createAnimation: function (cb) {
|
27
|
-
return new _RNSkAnimation.RNSkAnimation(cb, requestAnimationFrame.bind(window));
|
28
|
-
}
|
29
|
-
};
|
30
|
-
exports.ValueApi = ValueApi;
|
31
|
-
//# sourceMappingURL=api.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["ValueApi","createValue","initialValue","RNSkValue","createComputedValue","cb","values","RNSkComputedValue","createClockValue","RNSkClockValue","requestAnimationFrame","bind","window","createAnimation","RNSkAnimation"],"sources":["api.ts"],"sourcesContent":["import type {\n ISkiaValueApi,\n SkiaMutableValue,\n SkiaValue,\n SkiaClockValue,\n AnimationState,\n SkiaAnimation,\n} from \"../types\";\n\nimport { RNSkAnimation } from \"./RNSkAnimation\";\nimport { RNSkClockValue } from \"./RNSkClockValue\";\nimport { RNSkComputedValue } from \"./RNSkComputedValue\";\nimport { RNSkValue } from \"./RNSkValue\";\n\nexport const ValueApi: ISkiaValueApi = {\n createValue: function <T>(initialValue: T): SkiaMutableValue<T> {\n return new RNSkValue(initialValue);\n },\n createComputedValue: function <R>(\n cb: () => R,\n values: SkiaValue<unknown>[]\n ): SkiaValue<R> {\n return new RNSkComputedValue(cb, values);\n },\n createClockValue: function (): SkiaClockValue {\n return new RNSkClockValue(requestAnimationFrame.bind(window));\n },\n createAnimation: function <S extends AnimationState = AnimationState>(\n cb: (t: number, state: S | undefined) => S\n ): SkiaAnimation {\n return new RNSkAnimation(cb, requestAnimationFrame.bind(window));\n },\n};\n"],"mappings":";;;;;;;AASA;;AACA;;AACA;;AACA;;AAEO,MAAMA,QAAuB,GAAG;EACrCC,WAAW,EAAE,UAAaC,YAAb,EAAmD;IAC9D,OAAO,IAAIC,oBAAJ,CAAcD,YAAd,CAAP;EACD,CAHoC;EAIrCE,mBAAmB,EAAE,UACnBC,EADmB,EAEnBC,MAFmB,EAGL;IACd,OAAO,IAAIC,oCAAJ,CAAsBF,EAAtB,EAA0BC,MAA1B,CAAP;EACD,CAToC;EAUrCE,gBAAgB,EAAE,YAA4B;IAC5C,OAAO,IAAIC,8BAAJ,CAAmBC,qBAAqB,CAACC,IAAtB,CAA2BC,MAA3B,CAAnB,CAAP;EACD,CAZoC;EAarCC,eAAe,EAAE,UACfR,EADe,EAEA;IACf,OAAO,IAAIS,4BAAJ,CAAkBT,EAAlB,EAAsBK,qBAAqB,CAACC,IAAtB,CAA2BC,MAA3B,CAAtB,CAAP;EACD;AAjBoC,CAAhC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
export * from "./api";
|
@@ -1,19 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
|
7
|
-
var _api = require("./api");
|
8
|
-
|
9
|
-
Object.keys(_api).forEach(function (key) {
|
10
|
-
if (key === "default" || key === "__esModule") return;
|
11
|
-
if (key in exports && exports[key] === _api[key]) return;
|
12
|
-
Object.defineProperty(exports, key, {
|
13
|
-
enumerable: true,
|
14
|
-
get: function () {
|
15
|
-
return _api[key];
|
16
|
-
}
|
17
|
-
});
|
18
|
-
});
|
19
|
-
//# sourceMappingURL=index.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./api\";\n"],"mappings":";;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|
@@ -1,35 +0,0 @@
|
|
1
|
-
import React from "react";
|
2
|
-
import type { SkRect } from "../skia/types";
|
3
|
-
import type { SkiaValue } from "../values";
|
4
|
-
import type { SkiaDrawViewProps } from "./types";
|
5
|
-
export declare const SkiaViewNativeId: {
|
6
|
-
current: number;
|
7
|
-
};
|
8
|
-
/**
|
9
|
-
* @deprecated If you are looking to use the Skia imperative API, you can use:
|
10
|
-
* The picture API: https://shopify.github.io/react-native-skia/docs/shapes/pictures/
|
11
|
-
* The offscreen API: https://shopify.github.io/react-native-skia/docs/animations/textures
|
12
|
-
*/
|
13
|
-
export declare class SkiaView extends React.Component<SkiaDrawViewProps> {
|
14
|
-
constructor(props: SkiaDrawViewProps);
|
15
|
-
private _nativeId;
|
16
|
-
get nativeId(): number;
|
17
|
-
componentDidUpdate(prevProps: SkiaDrawViewProps): void;
|
18
|
-
/**
|
19
|
-
* Creates a snapshot from the canvas in the surface
|
20
|
-
* @param rect Rect to use as bounds. Optional.
|
21
|
-
* @returns An Image object.
|
22
|
-
*/
|
23
|
-
makeImageSnapshot(rect?: SkRect): import("../skia/types").SkImage;
|
24
|
-
/**
|
25
|
-
* Sends a redraw request to the native SkiaView.
|
26
|
-
*/
|
27
|
-
redraw(): void;
|
28
|
-
/**
|
29
|
-
* Registers one or move values as a dependant value of the Skia View. The view will
|
30
|
-
* The view will redraw itself when any of the values change.
|
31
|
-
* @param values Values to register
|
32
|
-
*/
|
33
|
-
registerValues(values: SkiaValue<unknown>[]): () => void;
|
34
|
-
render(): React.JSX.Element;
|
35
|
-
}
|
@@ -1,139 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.SkiaViewNativeId = exports.SkiaView = void 0;
|
7
|
-
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
9
|
-
|
10
|
-
var _SkiaDrawViewNativeComponent = _interopRequireDefault(require("../specs/SkiaDrawViewNativeComponent"));
|
11
|
-
|
12
|
-
var _api = require("./api");
|
13
|
-
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
15
|
-
|
16
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
17
|
-
|
18
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
19
|
-
|
20
|
-
const SkiaViewNativeId = {
|
21
|
-
current: 1000
|
22
|
-
};
|
23
|
-
exports.SkiaViewNativeId = SkiaViewNativeId;
|
24
|
-
const NativeSkiaView = _SkiaDrawViewNativeComponent.default;
|
25
|
-
/**
|
26
|
-
* @deprecated If you are looking to use the Skia imperative API, you can use:
|
27
|
-
* The picture API: https://shopify.github.io/react-native-skia/docs/shapes/pictures/
|
28
|
-
* The offscreen API: https://shopify.github.io/react-native-skia/docs/animations/textures
|
29
|
-
*/
|
30
|
-
|
31
|
-
class SkiaView extends _react.default.Component {
|
32
|
-
constructor(props) {
|
33
|
-
super(props);
|
34
|
-
|
35
|
-
_defineProperty(this, "_nativeId", void 0);
|
36
|
-
|
37
|
-
console.warn(`The SkiaView component is deprecated and will be removed in the next release.
|
38
|
-
If you are looking to use the Skia imperative API, you can use:
|
39
|
-
* The picture API: https://shopify.github.io/react-native-skia/docs/shapes/pictures/
|
40
|
-
* The offscreen API: https://shopify.github.io/react-native-skia/docs/animations/textures`);
|
41
|
-
this._nativeId = SkiaViewNativeId.current++;
|
42
|
-
const {
|
43
|
-
onDraw,
|
44
|
-
onSize
|
45
|
-
} = props;
|
46
|
-
|
47
|
-
if (onDraw) {
|
48
|
-
assertSkiaViewApi();
|
49
|
-
|
50
|
-
_api.SkiaViewApi.setJsiProperty(this._nativeId, "drawCallback", onDraw);
|
51
|
-
}
|
52
|
-
|
53
|
-
if (onSize) {
|
54
|
-
assertSkiaViewApi();
|
55
|
-
|
56
|
-
_api.SkiaViewApi.setJsiProperty(this._nativeId, "onSize", onSize);
|
57
|
-
}
|
58
|
-
}
|
59
|
-
|
60
|
-
get nativeId() {
|
61
|
-
return this._nativeId;
|
62
|
-
}
|
63
|
-
|
64
|
-
componentDidUpdate(prevProps) {
|
65
|
-
const {
|
66
|
-
onDraw,
|
67
|
-
onSize
|
68
|
-
} = this.props;
|
69
|
-
|
70
|
-
if (onDraw !== prevProps.onDraw) {
|
71
|
-
assertSkiaViewApi();
|
72
|
-
|
73
|
-
_api.SkiaViewApi.setJsiProperty(this._nativeId, "drawCallback", onDraw);
|
74
|
-
}
|
75
|
-
|
76
|
-
if (onSize !== prevProps.onSize) {
|
77
|
-
assertSkiaViewApi();
|
78
|
-
|
79
|
-
_api.SkiaViewApi.setJsiProperty(this._nativeId, "onSize", onSize);
|
80
|
-
}
|
81
|
-
}
|
82
|
-
/**
|
83
|
-
* Creates a snapshot from the canvas in the surface
|
84
|
-
* @param rect Rect to use as bounds. Optional.
|
85
|
-
* @returns An Image object.
|
86
|
-
*/
|
87
|
-
|
88
|
-
|
89
|
-
makeImageSnapshot(rect) {
|
90
|
-
assertSkiaViewApi();
|
91
|
-
return _api.SkiaViewApi.makeImageSnapshot(this._nativeId, rect);
|
92
|
-
}
|
93
|
-
/**
|
94
|
-
* Sends a redraw request to the native SkiaView.
|
95
|
-
*/
|
96
|
-
|
97
|
-
|
98
|
-
redraw() {
|
99
|
-
assertSkiaViewApi();
|
100
|
-
|
101
|
-
_api.SkiaViewApi.requestRedraw(this._nativeId);
|
102
|
-
}
|
103
|
-
/**
|
104
|
-
* Registers one or move values as a dependant value of the Skia View. The view will
|
105
|
-
* The view will redraw itself when any of the values change.
|
106
|
-
* @param values Values to register
|
107
|
-
*/
|
108
|
-
|
109
|
-
|
110
|
-
registerValues(values) {
|
111
|
-
assertSkiaViewApi();
|
112
|
-
return _api.SkiaViewApi.registerValuesInView(this._nativeId, values);
|
113
|
-
}
|
114
|
-
|
115
|
-
render() {
|
116
|
-
const {
|
117
|
-
mode,
|
118
|
-
debug = false,
|
119
|
-
onSize,
|
120
|
-
...viewProps
|
121
|
-
} = this.props;
|
122
|
-
return /*#__PURE__*/_react.default.createElement(NativeSkiaView, _extends({
|
123
|
-
collapsable: false,
|
124
|
-
nativeID: `${this._nativeId}`,
|
125
|
-
mode: mode ?? "default",
|
126
|
-
debug: debug
|
127
|
-
}, viewProps));
|
128
|
-
}
|
129
|
-
|
130
|
-
}
|
131
|
-
|
132
|
-
exports.SkiaView = SkiaView;
|
133
|
-
|
134
|
-
const assertSkiaViewApi = () => {
|
135
|
-
if (_api.SkiaViewApi === null || _api.SkiaViewApi.setJsiProperty === null || _api.SkiaViewApi.callJsiMethod === null || _api.SkiaViewApi.registerValuesInView === null || _api.SkiaViewApi.requestRedraw === null || _api.SkiaViewApi.makeImageSnapshot === null) {
|
136
|
-
throw Error("Skia View Api was not found.");
|
137
|
-
}
|
138
|
-
};
|
139
|
-
//# sourceMappingURL=SkiaView.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["SkiaViewNativeId","current","NativeSkiaView","SkiaDrawViewNativeComponent","SkiaView","React","Component","constructor","props","console","warn","_nativeId","onDraw","onSize","assertSkiaViewApi","SkiaViewApi","setJsiProperty","nativeId","componentDidUpdate","prevProps","makeImageSnapshot","rect","redraw","requestRedraw","registerValues","values","registerValuesInView","render","mode","debug","viewProps","callJsiMethod","Error"],"sources":["SkiaView.tsx"],"sourcesContent":["import React from \"react\";\n\nimport type { SkRect } from \"../skia/types\";\nimport type { SkiaValue } from \"../values\";\nimport SkiaDrawViewNativeComponent from \"../specs/SkiaDrawViewNativeComponent\";\n\nimport { SkiaViewApi } from \"./api\";\nimport type { SkiaDrawViewProps } from \"./types\";\n\nexport const SkiaViewNativeId = { current: 1000 };\n\nconst NativeSkiaView = SkiaDrawViewNativeComponent;\n\n/**\n * @deprecated If you are looking to use the Skia imperative API, you can use:\n * The picture API: https://shopify.github.io/react-native-skia/docs/shapes/pictures/\n * The offscreen API: https://shopify.github.io/react-native-skia/docs/animations/textures\n */\nexport class SkiaView extends React.Component<SkiaDrawViewProps> {\n constructor(props: SkiaDrawViewProps) {\n super(props);\n console.warn(\n `The SkiaView component is deprecated and will be removed in the next release.\nIf you are looking to use the Skia imperative API, you can use:\n* The picture API: https://shopify.github.io/react-native-skia/docs/shapes/pictures/\n* The offscreen API: https://shopify.github.io/react-native-skia/docs/animations/textures`\n );\n this._nativeId = SkiaViewNativeId.current++;\n const { onDraw, onSize } = props;\n if (onDraw) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"drawCallback\", onDraw);\n }\n if (onSize) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"onSize\", onSize);\n }\n }\n\n private _nativeId: number;\n\n public get nativeId() {\n return this._nativeId;\n }\n\n componentDidUpdate(prevProps: SkiaDrawViewProps) {\n const { onDraw, onSize } = this.props;\n if (onDraw !== prevProps.onDraw) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"drawCallback\", onDraw);\n }\n if (onSize !== prevProps.onSize) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"onSize\", onSize);\n }\n }\n\n /**\n * Creates a snapshot from the canvas in the surface\n * @param rect Rect to use as bounds. Optional.\n * @returns An Image object.\n */\n public makeImageSnapshot(rect?: SkRect) {\n assertSkiaViewApi();\n return SkiaViewApi.makeImageSnapshot(this._nativeId, rect);\n }\n\n /**\n * Sends a redraw request to the native SkiaView.\n */\n public redraw() {\n assertSkiaViewApi();\n SkiaViewApi.requestRedraw(this._nativeId);\n }\n\n /**\n * Registers one or move values as a dependant value of the Skia View. The view will\n * The view will redraw itself when any of the values change.\n * @param values Values to register\n */\n public registerValues(values: SkiaValue<unknown>[]): () => void {\n assertSkiaViewApi();\n return SkiaViewApi.registerValuesInView(this._nativeId, values);\n }\n\n render() {\n const { mode, debug = false, onSize, ...viewProps } = this.props;\n return (\n <NativeSkiaView\n collapsable={false}\n nativeID={`${this._nativeId}`}\n mode={mode ?? \"default\"}\n debug={debug}\n {...viewProps}\n />\n );\n }\n}\n\nconst assertSkiaViewApi = () => {\n if (\n SkiaViewApi === null ||\n SkiaViewApi.setJsiProperty === null ||\n SkiaViewApi.callJsiMethod === null ||\n SkiaViewApi.registerValuesInView === null ||\n SkiaViewApi.requestRedraw === null ||\n SkiaViewApi.makeImageSnapshot === null\n ) {\n throw Error(\"Skia View Api was not found.\");\n }\n};\n"],"mappings":";;;;;;;AAAA;;AAIA;;AAEA;;;;;;;;AAGO,MAAMA,gBAAgB,GAAG;EAAEC,OAAO,EAAE;AAAX,CAAzB;;AAEP,MAAMC,cAAc,GAAGC,oCAAvB;AAEA;AACA;AACA;AACA;AACA;;AACO,MAAMC,QAAN,SAAuBC,cAAA,CAAMC,SAA7B,CAA0D;EAC/DC,WAAW,CAACC,KAAD,EAA2B;IACpC,MAAMA,KAAN;;IADoC;;IAEpCC,OAAO,CAACC,IAAR,CACG;AACP;AACA;AACA,0FAJI;IAMA,KAAKC,SAAL,GAAiBX,gBAAgB,CAACC,OAAjB,EAAjB;IACA,MAAM;MAAEW,MAAF;MAAUC;IAAV,IAAqBL,KAA3B;;IACA,IAAII,MAAJ,EAAY;MACVE,iBAAiB;;MACjBC,gBAAA,CAAYC,cAAZ,CAA2B,KAAKL,SAAhC,EAA2C,cAA3C,EAA2DC,MAA3D;IACD;;IACD,IAAIC,MAAJ,EAAY;MACVC,iBAAiB;;MACjBC,gBAAA,CAAYC,cAAZ,CAA2B,KAAKL,SAAhC,EAA2C,QAA3C,EAAqDE,MAArD;IACD;EACF;;EAIkB,IAARI,QAAQ,GAAG;IACpB,OAAO,KAAKN,SAAZ;EACD;;EAEDO,kBAAkB,CAACC,SAAD,EAA+B;IAC/C,MAAM;MAAEP,MAAF;MAAUC;IAAV,IAAqB,KAAKL,KAAhC;;IACA,IAAII,MAAM,KAAKO,SAAS,CAACP,MAAzB,EAAiC;MAC/BE,iBAAiB;;MACjBC,gBAAA,CAAYC,cAAZ,CAA2B,KAAKL,SAAhC,EAA2C,cAA3C,EAA2DC,MAA3D;IACD;;IACD,IAAIC,MAAM,KAAKM,SAAS,CAACN,MAAzB,EAAiC;MAC/BC,iBAAiB;;MACjBC,gBAAA,CAAYC,cAAZ,CAA2B,KAAKL,SAAhC,EAA2C,QAA3C,EAAqDE,MAArD;IACD;EACF;EAED;AACF;AACA;AACA;AACA;;;EACSO,iBAAiB,CAACC,IAAD,EAAgB;IACtCP,iBAAiB;IACjB,OAAOC,gBAAA,CAAYK,iBAAZ,CAA8B,KAAKT,SAAnC,EAA8CU,IAA9C,CAAP;EACD;EAED;AACF;AACA;;;EACSC,MAAM,GAAG;IACdR,iBAAiB;;IACjBC,gBAAA,CAAYQ,aAAZ,CAA0B,KAAKZ,SAA/B;EACD;EAED;AACF;AACA;AACA;AACA;;;EACSa,cAAc,CAACC,MAAD,EAA2C;IAC9DX,iBAAiB;IACjB,OAAOC,gBAAA,CAAYW,oBAAZ,CAAiC,KAAKf,SAAtC,EAAiDc,MAAjD,CAAP;EACD;;EAEDE,MAAM,GAAG;IACP,MAAM;MAAEC,IAAF;MAAQC,KAAK,GAAG,KAAhB;MAAuBhB,MAAvB;MAA+B,GAAGiB;IAAlC,IAAgD,KAAKtB,KAA3D;IACA,oBACE,6BAAC,cAAD;MACE,WAAW,EAAE,KADf;MAEE,QAAQ,EAAG,GAAE,KAAKG,SAAU,EAF9B;MAGE,IAAI,EAAEiB,IAAI,IAAI,SAHhB;MAIE,KAAK,EAAEC;IAJT,GAKMC,SALN,EADF;EASD;;AA9E8D;;;;AAiFjE,MAAMhB,iBAAiB,GAAG,MAAM;EAC9B,IACEC,gBAAA,KAAgB,IAAhB,IACAA,gBAAA,CAAYC,cAAZ,KAA+B,IAD/B,IAEAD,gBAAA,CAAYgB,aAAZ,KAA8B,IAF9B,IAGAhB,gBAAA,CAAYW,oBAAZ,KAAqC,IAHrC,IAIAX,gBAAA,CAAYQ,aAAZ,KAA8B,IAJ9B,IAKAR,gBAAA,CAAYK,iBAAZ,KAAkC,IANpC,EAOE;IACA,MAAMY,KAAK,CAAC,8BAAD,CAAX;EACD;AACF,CAXD"}
|
@@ -1,7 +0,0 @@
|
|
1
|
-
import type { SkCanvas } from "../skia/types";
|
2
|
-
import type { SkiaDrawViewProps, TouchInfo } from "./types";
|
3
|
-
import { SkiaBaseWebView } from "./SkiaBaseWebView";
|
4
|
-
export declare class SkiaView extends SkiaBaseWebView<SkiaDrawViewProps> {
|
5
|
-
constructor(props: SkiaDrawViewProps);
|
6
|
-
protected renderInCanvas(canvas: SkCanvas, touches: TouchInfo[]): void;
|
7
|
-
}
|
@@ -1,30 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.SkiaView = void 0;
|
7
|
-
|
8
|
-
var _SkiaBaseWebView = require("./SkiaBaseWebView");
|
9
|
-
|
10
|
-
class SkiaView extends _SkiaBaseWebView.SkiaBaseWebView {
|
11
|
-
constructor(props) {
|
12
|
-
super(props);
|
13
|
-
}
|
14
|
-
|
15
|
-
renderInCanvas(canvas, touches) {
|
16
|
-
if (this.props.onDraw) {
|
17
|
-
const info = {
|
18
|
-
height: this.height,
|
19
|
-
width: this.width,
|
20
|
-
timestamp: Date.now(),
|
21
|
-
touches: touches.map(t => [t])
|
22
|
-
};
|
23
|
-
this.props.onDraw(canvas, info);
|
24
|
-
}
|
25
|
-
}
|
26
|
-
|
27
|
-
}
|
28
|
-
|
29
|
-
exports.SkiaView = SkiaView;
|
30
|
-
//# sourceMappingURL=SkiaView.web.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["SkiaView","SkiaBaseWebView","constructor","props","renderInCanvas","canvas","touches","onDraw","info","height","width","timestamp","Date","now","map","t"],"sources":["SkiaView.web.tsx"],"sourcesContent":["import type { SkCanvas } from \"../skia/types\";\n\nimport type { DrawingInfo, SkiaDrawViewProps, TouchInfo } from \"./types\";\nimport { SkiaBaseWebView } from \"./SkiaBaseWebView\";\n\nexport class SkiaView extends SkiaBaseWebView<SkiaDrawViewProps> {\n constructor(props: SkiaDrawViewProps) {\n super(props);\n }\n\n protected renderInCanvas(canvas: SkCanvas, touches: TouchInfo[]): void {\n if (this.props.onDraw) {\n const info: DrawingInfo = {\n height: this.height,\n width: this.width,\n timestamp: Date.now(),\n touches: touches.map((t) => [t]),\n };\n this.props.onDraw(canvas, info);\n }\n }\n}\n"],"mappings":";;;;;;;AAGA;;AAEO,MAAMA,QAAN,SAAuBC,gCAAvB,CAA0D;EAC/DC,WAAW,CAACC,KAAD,EAA2B;IACpC,MAAMA,KAAN;EACD;;EAESC,cAAc,CAACC,MAAD,EAAmBC,OAAnB,EAA+C;IACrE,IAAI,KAAKH,KAAL,CAAWI,MAAf,EAAuB;MACrB,MAAMC,IAAiB,GAAG;QACxBC,MAAM,EAAE,KAAKA,MADW;QAExBC,KAAK,EAAE,KAAKA,KAFY;QAGxBC,SAAS,EAAEC,IAAI,CAACC,GAAL,EAHa;QAIxBP,OAAO,EAAEA,OAAO,CAACQ,GAAR,CAAaC,CAAD,IAAO,CAACA,CAAD,CAAnB;MAJe,CAA1B;MAMA,KAAKZ,KAAL,CAAWI,MAAX,CAAkBF,MAAlB,EAA0BG,IAA1B;IACD;EACF;;AAf8D"}
|
@@ -1,8 +0,0 @@
|
|
1
|
-
import type { DependencyList } from "react";
|
2
|
-
import type { RNSkiaDrawCallback } from "./types";
|
3
|
-
/**
|
4
|
-
* Creates a memoized callback for the onDraw handler of a Skia component.
|
5
|
-
* @param callback The callback to memoize.
|
6
|
-
* @param deps Dependencies for the callback.
|
7
|
-
* */
|
8
|
-
export declare const useDrawCallback: (callback: RNSkiaDrawCallback, deps?: DependencyList) => RNSkiaDrawCallback;
|
@@ -1,23 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.useDrawCallback = void 0;
|
7
|
-
|
8
|
-
var _react = require("react");
|
9
|
-
|
10
|
-
/**
|
11
|
-
* Creates a memoized callback for the onDraw handler of a Skia component.
|
12
|
-
* @param callback The callback to memoize.
|
13
|
-
* @param deps Dependencies for the callback.
|
14
|
-
* */
|
15
|
-
const useDrawCallback = function (callback) {
|
16
|
-
let deps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
17
|
-
return (0, _react.useMemo)(() => {
|
18
|
-
return callback; // eslint-disable-next-line react-hooks/exhaustive-deps
|
19
|
-
}, deps);
|
20
|
-
};
|
21
|
-
|
22
|
-
exports.useDrawCallback = useDrawCallback;
|
23
|
-
//# sourceMappingURL=useDrawCallback.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["useDrawCallback","callback","deps","useMemo"],"sources":["useDrawCallback.ts"],"sourcesContent":["import type { DependencyList } from \"react\";\nimport { useMemo } from \"react\";\n\nimport type { RNSkiaDrawCallback } from \"./types\";\n\n/**\n * Creates a memoized callback for the onDraw handler of a Skia component.\n * @param callback The callback to memoize.\n * @param deps Dependencies for the callback.\n * */\nexport const useDrawCallback = (\n callback: RNSkiaDrawCallback,\n deps: DependencyList = []\n) => {\n return useMemo(() => {\n return callback;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, deps);\n};\n"],"mappings":";;;;;;;AACA;;AAIA;AACA;AACA;AACA;AACA;AACO,MAAMA,eAAe,GAAG,UAC7BC,QAD6B,EAG1B;EAAA,IADHC,IACG,uEADoB,EACpB;EACH,OAAO,IAAAC,cAAA,EAAQ,MAAM;IACnB,OAAOF,QAAP,CADmB,CAEnB;EACD,CAHM,EAGJC,IAHI,CAAP;AAID,CARM"}
|
@@ -1,33 +0,0 @@
|
|
1
|
-
const VELOCITY_EPS = 1;
|
2
|
-
const SLOPE_FACTOR = 0.1;
|
3
|
-
export const decay = (now, state, config) => {
|
4
|
-
const {
|
5
|
-
lastTimestamp,
|
6
|
-
startTimestamp,
|
7
|
-
initialVelocity,
|
8
|
-
current,
|
9
|
-
velocity
|
10
|
-
} = state;
|
11
|
-
const nextState = { ...state
|
12
|
-
};
|
13
|
-
const deltaTime = Math.min(now - lastTimestamp, 64);
|
14
|
-
const v = velocity * Math.exp(-(1 - config.deceleration) * (now - startTimestamp) * SLOPE_FACTOR);
|
15
|
-
nextState.current = current + v * config.velocityFactor * deltaTime / 1000; // /1000 because time is in ms not in s
|
16
|
-
|
17
|
-
nextState.velocity = v;
|
18
|
-
nextState.lastTimestamp = now;
|
19
|
-
|
20
|
-
if (config.clamp) {
|
21
|
-
if (initialVelocity < 0 && nextState.current <= config.clamp[0]) {
|
22
|
-
nextState.current = config.clamp[0];
|
23
|
-
nextState.finished = true;
|
24
|
-
} else if (initialVelocity > 0 && nextState.current >= config.clamp[1]) {
|
25
|
-
nextState.current = config.clamp[1];
|
26
|
-
nextState.finished = true;
|
27
|
-
}
|
28
|
-
}
|
29
|
-
|
30
|
-
nextState.finished = Math.abs(v) < VELOCITY_EPS;
|
31
|
-
return nextState;
|
32
|
-
};
|
33
|
-
//# 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;AAEA,OAAO,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 +0,0 @@
|
|
1
|
-
{"version":3,"names":["runDecay"],"sources":["index.ts"],"sourcesContent":["export { runDecay } from \"./runDecay\";\n"],"mappings":"AAAA,SAASA,QAAT,QAAyB,YAAzB"}
|
@@ -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,38 +0,0 @@
|
|
1
|
-
import { ValueApi } from "../../values/api";
|
2
|
-
import { decay } from "./decay";
|
3
|
-
|
4
|
-
/**
|
5
|
-
* Runs a decay animation from the current value to zero with the given decay
|
6
|
-
* configuration.
|
7
|
-
* @param value value to animate
|
8
|
-
* @param config Configuration or default configuration
|
9
|
-
* @returns Animation
|
10
|
-
*/
|
11
|
-
export const runDecay = (value, config) => {
|
12
|
-
const resolvedConfig = {
|
13
|
-
deceleration: 0.998,
|
14
|
-
velocityFactor: 1,
|
15
|
-
velocity: 0,
|
16
|
-
from: value.current,
|
17
|
-
...config
|
18
|
-
};
|
19
|
-
|
20
|
-
const updateFunction = (t, state) => {
|
21
|
-
if (!state) {
|
22
|
-
return {
|
23
|
-
current: resolvedConfig.from,
|
24
|
-
finished: false,
|
25
|
-
lastTimestamp: t,
|
26
|
-
startTimestamp: t,
|
27
|
-
initialVelocity: resolvedConfig.velocity,
|
28
|
-
velocity: resolvedConfig.velocity
|
29
|
-
};
|
30
|
-
}
|
31
|
-
|
32
|
-
return decay(t, state, resolvedConfig);
|
33
|
-
};
|
34
|
-
|
35
|
-
value.animation = ValueApi.createAnimation(updateFunction);
|
36
|
-
return value.animation;
|
37
|
-
};
|
38
|
-
//# sourceMappingURL=runDecay.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["ValueApi","decay","runDecay","value","config","resolvedConfig","deceleration","velocityFactor","velocity","from","current","updateFunction","t","state","finished","lastTimestamp","startTimestamp","initialVelocity","animation","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,SAASA,QAAT,QAAyB,kBAAzB;AAGA,SAASC,KAAT,QAAsB,SAAtB;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,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,OAAOP,KAAK,CAACW,CAAD,EAAIC,KAAJ,EAAWR,cAAX,CAAZ;EACD,CAZD;;EAaAF,KAAK,CAACe,SAAN,GAAkBlB,QAAQ,CAACmB,eAAT,CAAyBR,cAAzB,CAAlB;EACA,OAAOR,KAAK,CAACe,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
|
-
};
|