@rafaelaugusto/jolt 0.1.0-beta.9 → 0.1.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +167 -21
- package/dist/animate.d.ts +25 -4
- package/dist/animate.d.ts.map +1 -1
- package/dist/animate.js +67 -26
- package/dist/animate.js.map +1 -1
- package/dist/blur/index.d.ts +6 -0
- package/dist/blur/index.d.ts.map +1 -0
- package/dist/blur/index.js +196 -0
- package/dist/blur/index.js.map +1 -0
- package/dist/blur/native.d.ts +17 -0
- package/dist/blur/native.d.ts.map +1 -0
- package/dist/blur/native.js +44 -0
- package/dist/blur/native.js.map +1 -0
- package/dist/blur/types.d.ts +32 -0
- package/dist/blur/types.d.ts.map +1 -0
- package/dist/blur/types.js +2 -0
- package/dist/blur/types.js.map +1 -0
- package/dist/bottom-sheet/geometry.d.ts +18 -0
- package/dist/bottom-sheet/geometry.d.ts.map +1 -0
- package/dist/bottom-sheet/geometry.js +51 -0
- package/dist/bottom-sheet/geometry.js.map +1 -0
- package/dist/bottom-sheet/index.d.ts +56 -0
- package/dist/bottom-sheet/index.d.ts.map +1 -0
- package/dist/bottom-sheet/index.js +462 -0
- package/dist/bottom-sheet/index.js.map +1 -0
- package/dist/bottom-sheet/native.d.ts +11 -0
- package/dist/bottom-sheet/native.d.ts.map +1 -0
- package/dist/bottom-sheet/native.js +173 -0
- package/dist/bottom-sheet/native.js.map +1 -0
- package/dist/config.d.ts +9 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +40 -1
- package/dist/config.js.map +1 -1
- package/dist/decay.d.ts +1 -0
- package/dist/decay.d.ts.map +1 -1
- package/dist/decay.js +7 -0
- package/dist/decay.js.map +1 -1
- package/dist/drag-physics.d.ts +6 -1
- package/dist/drag-physics.d.ts.map +1 -1
- package/dist/drag.d.ts +17 -3
- package/dist/drag.d.ts.map +1 -1
- package/dist/drag.js +34 -11
- package/dist/drag.js.map +1 -1
- package/dist/driver/android-gradient.d.ts +5 -0
- package/dist/driver/android-gradient.d.ts.map +1 -0
- package/dist/driver/android-gradient.js +99 -0
- package/dist/driver/android-gradient.js.map +1 -0
- package/dist/driver/android-particles.d.ts +6 -0
- package/dist/driver/android-particles.d.ts.map +1 -0
- package/dist/driver/android-particles.js +93 -0
- package/dist/driver/android-particles.js.map +1 -0
- package/dist/driver/android.d.ts.map +1 -1
- package/dist/driver/android.js +27 -1
- package/dist/driver/android.js.map +1 -1
- package/dist/driver/frame.d.ts +3 -0
- package/dist/driver/frame.d.ts.map +1 -0
- package/dist/driver/frame.js +7 -0
- package/dist/driver/frame.js.map +1 -0
- package/dist/driver/index.d.ts +4 -0
- package/dist/driver/index.d.ts.map +1 -1
- package/dist/driver/index.js.map +1 -1
- package/dist/driver/ios-gradient.d.ts +5 -0
- package/dist/driver/ios-gradient.d.ts.map +1 -0
- package/dist/driver/ios-gradient.js +131 -0
- package/dist/driver/ios-gradient.js.map +1 -0
- package/dist/driver/ios-scroll-delegate.d.ts +4 -0
- package/dist/driver/ios-scroll-delegate.d.ts.map +1 -0
- package/dist/driver/ios-scroll-delegate.js +26 -0
- package/dist/driver/ios-scroll-delegate.js.map +1 -0
- package/dist/driver/ios.d.ts.map +1 -1
- package/dist/driver/ios.js +9 -0
- package/dist/driver/ios.js.map +1 -1
- package/dist/easing.d.ts +3 -1
- package/dist/easing.d.ts.map +1 -1
- package/dist/easing.js +18 -1
- package/dist/easing.js.map +1 -1
- package/dist/engine.d.ts +31 -2
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +194 -42
- package/dist/engine.js.map +1 -1
- package/dist/gesture-native.d.ts +28 -0
- package/dist/gesture-native.d.ts.map +1 -0
- package/dist/gesture-native.js +61 -0
- package/dist/gesture-native.js.map +1 -0
- package/dist/gestures/index.d.ts +69 -0
- package/dist/gestures/index.d.ts.map +1 -0
- package/dist/gestures/index.js +262 -0
- package/dist/gestures/index.js.map +1 -0
- package/dist/glass/index.d.ts +55 -0
- package/dist/glass/index.d.ts.map +1 -0
- package/dist/glass/index.js +205 -0
- package/dist/glass/index.js.map +1 -0
- package/dist/gradient-binding.d.ts +38 -0
- package/dist/gradient-binding.d.ts.map +1 -0
- package/dist/gradient-binding.js +128 -0
- package/dist/gradient-binding.js.map +1 -0
- package/dist/gradient.d.ts +105 -0
- package/dist/gradient.d.ts.map +1 -0
- package/dist/gradient.js +514 -0
- package/dist/gradient.js.map +1 -0
- package/dist/gravity.d.ts +13 -0
- package/dist/gravity.d.ts.map +1 -0
- package/dist/gravity.js +84 -0
- package/dist/gravity.js.map +1 -0
- package/dist/haptics.d.ts.map +1 -1
- package/dist/haptics.js +101 -28
- package/dist/haptics.js.map +1 -1
- package/dist/image-effect.d.ts +1 -0
- package/dist/image-effect.d.ts.map +1 -1
- package/dist/image-effect.js +10 -2
- package/dist/image-effect.js.map +1 -1
- package/dist/index.d.ts +19 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -4
- package/dist/index.js.map +1 -1
- package/dist/inspector/index.d.ts +86 -0
- package/dist/inspector/index.d.ts.map +1 -0
- package/dist/inspector/index.js +419 -0
- package/dist/inspector/index.js.map +1 -0
- package/dist/inspector/plot.d.ts +4 -0
- package/dist/inspector/plot.d.ts.map +1 -0
- package/dist/inspector/plot.js +23 -0
- package/dist/inspector/plot.js.map +1 -0
- package/dist/inspector/probe.d.ts +19 -0
- package/dist/inspector/probe.d.ts.map +1 -0
- package/dist/inspector/probe.js +37 -0
- package/dist/inspector/probe.js.map +1 -0
- package/dist/inspector/tuning.d.ts +19 -0
- package/dist/inspector/tuning.d.ts.map +1 -0
- package/dist/inspector/tuning.js +37 -0
- package/dist/inspector/tuning.js.map +1 -0
- package/dist/interactive-navigation/index.d.ts +44 -0
- package/dist/interactive-navigation/index.d.ts.map +1 -0
- package/dist/interactive-navigation/index.js +350 -0
- package/dist/interactive-navigation/index.js.map +1 -0
- package/dist/keyboard.d.ts +24 -0
- package/dist/keyboard.d.ts.map +1 -1
- package/dist/keyboard.js +199 -6
- package/dist/keyboard.js.map +1 -1
- package/dist/live-spring-driver.d.ts +52 -0
- package/dist/live-spring-driver.d.ts.map +1 -0
- package/dist/live-spring-driver.js +104 -0
- package/dist/live-spring-driver.js.map +1 -0
- package/dist/mixer.d.ts +55 -0
- package/dist/mixer.d.ts.map +1 -0
- package/dist/mixer.js +286 -0
- package/dist/mixer.js.map +1 -0
- package/dist/motion-scope.d.ts +8 -2
- package/dist/motion-scope.d.ts.map +1 -1
- package/dist/motion-scope.js +24 -3
- package/dist/motion-scope.js.map +1 -1
- package/dist/motion-states.d.ts +19 -7
- package/dist/motion-states.d.ts.map +1 -1
- package/dist/motion-states.js +116 -26
- package/dist/motion-states.js.map +1 -1
- package/dist/motion-value.d.ts +227 -0
- package/dist/motion-value.d.ts.map +1 -0
- package/dist/motion-value.js +1074 -0
- package/dist/motion-value.js.map +1 -0
- package/dist/native/index.d.ts +10 -0
- package/dist/native/index.d.ts.map +1 -0
- package/dist/native/index.js +6 -0
- package/dist/native/index.js.map +1 -0
- package/dist/native-properties.d.ts +28 -0
- package/dist/native-properties.d.ts.map +1 -0
- package/dist/native-properties.js +154 -0
- package/dist/native-properties.js.map +1 -0
- package/dist/native-property-driver.d.ts +19 -0
- package/dist/native-property-driver.d.ts.map +1 -0
- package/dist/native-property-driver.js +69 -0
- package/dist/native-property-driver.js.map +1 -0
- package/dist/native-property.d.ts +37 -0
- package/dist/native-property.d.ts.map +1 -0
- package/dist/native-property.js +285 -0
- package/dist/native-property.js.map +1 -0
- package/dist/particles.d.ts +5 -2
- package/dist/particles.d.ts.map +1 -1
- package/dist/particles.js +16 -10
- package/dist/particles.js.map +1 -1
- package/dist/path.d.ts.map +1 -1
- package/dist/path.js +2 -2
- package/dist/path.js.map +1 -1
- package/dist/physics/index.d.ts +139 -0
- package/dist/physics/index.d.ts.map +1 -0
- package/dist/physics/index.js +316 -0
- package/dist/physics/index.js.map +1 -0
- package/dist/physics/native.d.ts +54 -0
- package/dist/physics/native.d.ts.map +1 -0
- package/dist/physics/native.js +64 -0
- package/dist/physics/native.js.map +1 -0
- package/dist/playback-group.d.ts.map +1 -1
- package/dist/playback-group.js +17 -1
- package/dist/playback-group.js.map +1 -1
- package/dist/playback.d.ts +15 -0
- package/dist/playback.d.ts.map +1 -1
- package/dist/playback.js +23 -0
- package/dist/playback.js.map +1 -1
- package/dist/predictive-back/index.d.ts +45 -0
- package/dist/predictive-back/index.d.ts.map +1 -0
- package/dist/predictive-back/index.js +220 -0
- package/dist/predictive-back/index.js.map +1 -0
- package/dist/predictive-back/presentation.d.ts +4 -0
- package/dist/predictive-back/presentation.d.ts.map +1 -0
- package/dist/predictive-back/presentation.js +3 -0
- package/dist/predictive-back/presentation.js.map +1 -0
- package/dist/press.d.ts.map +1 -1
- package/dist/press.js +11 -2
- package/dist/press.js.map +1 -1
- package/dist/reorder/handle.d.ts +6 -0
- package/dist/reorder/handle.d.ts.map +1 -0
- package/dist/reorder/handle.js +10 -0
- package/dist/reorder/handle.js.map +1 -0
- package/dist/reorder/index.d.ts +10 -0
- package/dist/reorder/index.d.ts.map +1 -0
- package/dist/reorder/index.js +233 -0
- package/dist/reorder/index.js.map +1 -0
- package/dist/reorder/list-view.d.ts +5 -0
- package/dist/reorder/list-view.d.ts.map +1 -0
- package/dist/reorder/list-view.js +238 -0
- package/dist/reorder/list-view.js.map +1 -0
- package/dist/reorder/model.d.ts +6 -0
- package/dist/reorder/model.d.ts.map +1 -0
- package/dist/reorder/model.js +30 -0
- package/dist/reorder/model.js.map +1 -0
- package/dist/reorder/surface.d.ts +6 -0
- package/dist/reorder/surface.d.ts.map +1 -0
- package/dist/reorder/surface.js +10 -0
- package/dist/reorder/surface.js.map +1 -0
- package/dist/reorder/types.d.ts +92 -0
- package/dist/reorder/types.d.ts.map +1 -0
- package/dist/reorder/types.js +2 -0
- package/dist/reorder/types.js.map +1 -0
- package/dist/sampling.d.ts +35 -0
- package/dist/sampling.d.ts.map +1 -0
- package/dist/sampling.js +123 -0
- package/dist/sampling.js.map +1 -0
- package/dist/scene-appearance.d.ts +14 -0
- package/dist/scene-appearance.d.ts.map +1 -0
- package/dist/scene-appearance.js +68 -0
- package/dist/scene-appearance.js.map +1 -0
- package/dist/scene-camera.d.ts +5 -0
- package/dist/scene-camera.d.ts.map +1 -0
- package/dist/scene-camera.js +23 -0
- package/dist/scene-camera.js.map +1 -0
- package/dist/scene-shader.d.ts +18 -0
- package/dist/scene-shader.d.ts.map +1 -0
- package/dist/scene-shader.js +76 -0
- package/dist/scene-shader.js.map +1 -0
- package/dist/scroll-header/geometry.d.ts +18 -0
- package/dist/scroll-header/geometry.d.ts.map +1 -0
- package/dist/scroll-header/geometry.js +46 -0
- package/dist/scroll-header/geometry.js.map +1 -0
- package/dist/scroll-header/index.d.ts +48 -0
- package/dist/scroll-header/index.d.ts.map +1 -0
- package/dist/scroll-header/index.js +399 -0
- package/dist/scroll-header/index.js.map +1 -0
- package/dist/scroll-header/native.d.ts +28 -0
- package/dist/scroll-header/native.d.ts.map +1 -0
- package/dist/scroll-header/native.js +43 -0
- package/dist/scroll-header/native.js.map +1 -0
- package/dist/sensors/index.d.ts +69 -0
- package/dist/sensors/index.d.ts.map +1 -0
- package/dist/sensors/index.js +149 -0
- package/dist/sensors/index.js.map +1 -0
- package/dist/sensors/native.d.ts +20 -0
- package/dist/sensors/native.d.ts.map +1 -0
- package/dist/sensors/native.js +48 -0
- package/dist/sensors/native.js.map +1 -0
- package/dist/sequence.d.ts +24 -0
- package/dist/sequence.d.ts.map +1 -1
- package/dist/sequence.js +181 -19
- package/dist/sequence.js.map +1 -1
- package/dist/shapes/android.d.ts +3 -0
- package/dist/shapes/android.d.ts.map +1 -0
- package/dist/shapes/android.js +51 -0
- package/dist/shapes/android.js.map +1 -0
- package/dist/shapes/index.d.ts +6 -0
- package/dist/shapes/index.d.ts.map +1 -0
- package/dist/shapes/index.js +238 -0
- package/dist/shapes/index.js.map +1 -0
- package/dist/shapes/ios.d.ts +3 -0
- package/dist/shapes/ios.d.ts.map +1 -0
- package/dist/shapes/ios.js +164 -0
- package/dist/shapes/ios.js.map +1 -0
- package/dist/shapes/native.d.ts +18 -0
- package/dist/shapes/native.d.ts.map +1 -0
- package/dist/shapes/native.js +10 -0
- package/dist/shapes/native.js.map +1 -0
- package/dist/shapes/path.d.ts +10 -0
- package/dist/shapes/path.d.ts.map +1 -0
- package/dist/shapes/path.js +106 -0
- package/dist/shapes/path.js.map +1 -0
- package/dist/shapes/types.d.ts +55 -0
- package/dist/shapes/types.d.ts.map +1 -0
- package/dist/shapes/types.js +11 -0
- package/dist/shapes/types.js.map +1 -0
- package/dist/shared-layout/index.d.ts +40 -0
- package/dist/shared-layout/index.d.ts.map +1 -0
- package/dist/shared-layout/index.js +267 -0
- package/dist/shared-layout/index.js.map +1 -0
- package/dist/shared-layout/native.d.ts +15 -0
- package/dist/shared-layout/native.d.ts.map +1 -0
- package/dist/shared-layout/native.js +79 -0
- package/dist/shared-layout/native.js.map +1 -0
- package/dist/shared-layout/timing.d.ts +9 -0
- package/dist/shared-layout/timing.d.ts.map +1 -0
- package/dist/shared-layout/timing.js +68 -0
- package/dist/shared-layout/timing.js.map +1 -0
- package/dist/shared-navigation/entry.d.ts +51 -0
- package/dist/shared-navigation/entry.d.ts.map +1 -0
- package/dist/shared-navigation/entry.js +619 -0
- package/dist/shared-navigation/entry.js.map +1 -0
- package/dist/shared-navigation/index.d.ts +58 -0
- package/dist/shared-navigation/index.d.ts.map +1 -0
- package/dist/shared-navigation/index.js +318 -0
- package/dist/shared-navigation/index.js.map +1 -0
- package/dist/shared-navigation/return-signal.d.ts +16 -0
- package/dist/shared-navigation/return-signal.d.ts.map +1 -0
- package/dist/shared-navigation/return-signal.js +35 -0
- package/dist/shared-navigation/return-signal.js.map +1 -0
- package/dist/shared-navigation/return-target.d.ts +32 -0
- package/dist/shared-navigation/return-target.d.ts.map +1 -0
- package/dist/shared-navigation/return-target.js +168 -0
- package/dist/shared-navigation/return-target.js.map +1 -0
- package/dist/shared-navigation/scope.d.ts +4 -0
- package/dist/shared-navigation/scope.d.ts.map +1 -0
- package/dist/shared-navigation/scope.js +2 -0
- package/dist/shared-navigation/scope.js.map +1 -0
- package/dist/shared-navigation/targets.d.ts +6 -0
- package/dist/shared-navigation/targets.d.ts.map +1 -0
- package/dist/shared-navigation/targets.js +36 -0
- package/dist/shared-navigation/targets.js.map +1 -0
- package/dist/size-layout.d.ts +19 -0
- package/dist/size-layout.d.ts.map +1 -0
- package/dist/size-layout.js +216 -0
- package/dist/size-layout.js.map +1 -0
- package/dist/size.d.ts +19 -0
- package/dist/size.d.ts.map +1 -0
- package/dist/size.js +251 -0
- package/dist/size.js.map +1 -0
- package/dist/spring.d.ts +2 -0
- package/dist/spring.d.ts.map +1 -1
- package/dist/spring.js +11 -0
- package/dist/spring.js.map +1 -1
- package/dist/svg-path.d.ts +18 -0
- package/dist/svg-path.d.ts.map +1 -1
- package/dist/svg-path.js +3 -2
- package/dist/svg-path.js.map +1 -1
- package/dist/testing/clock.d.ts +40 -0
- package/dist/testing/clock.d.ts.map +1 -0
- package/dist/testing/clock.js +116 -0
- package/dist/testing/clock.js.map +1 -0
- package/dist/testing/handoff-recorder.d.ts +8 -0
- package/dist/testing/handoff-recorder.d.ts.map +1 -0
- package/dist/testing/handoff-recorder.js +77 -0
- package/dist/testing/handoff-recorder.js.map +1 -0
- package/dist/testing/index.d.ts +5 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +5 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/native.d.ts +46 -0
- package/dist/testing/native.d.ts.map +1 -0
- package/dist/testing/native.js +313 -0
- package/dist/testing/native.js.map +1 -0
- package/dist/testing/presentation.d.ts +11 -0
- package/dist/testing/presentation.d.ts.map +1 -0
- package/dist/testing/presentation.js +45 -0
- package/dist/testing/presentation.js.map +1 -0
- package/dist/testing/replay.d.ts +39 -0
- package/dist/testing/replay.d.ts.map +1 -0
- package/dist/testing/replay.js +99 -0
- package/dist/testing/replay.js.map +1 -0
- package/dist/testing/scroll-handoff-native.d.ts +10 -0
- package/dist/testing/scroll-handoff-native.d.ts.map +1 -0
- package/dist/testing/scroll-handoff-native.js +151 -0
- package/dist/testing/scroll-handoff-native.js.map +1 -0
- package/dist/testing/scroll-handoff.d.ts +25 -0
- package/dist/testing/scroll-handoff.d.ts.map +1 -0
- package/dist/testing/scroll-handoff.js +127 -0
- package/dist/testing/scroll-handoff.js.map +1 -0
- package/dist/testing/sensors.d.ts +13 -0
- package/dist/testing/sensors.d.ts.map +1 -0
- package/dist/testing/sensors.js +26 -0
- package/dist/testing/sensors.js.map +1 -0
- package/dist/testing/trace.d.ts +101 -0
- package/dist/testing/trace.d.ts.map +1 -0
- package/dist/testing/trace.js +263 -0
- package/dist/testing/trace.js.map +1 -0
- package/dist/timed-animation.d.ts +38 -0
- package/dist/timed-animation.d.ts.map +1 -0
- package/dist/timed-animation.js +177 -0
- package/dist/timed-animation.js.map +1 -0
- package/dist/track.d.ts +3 -0
- package/dist/track.d.ts.map +1 -1
- package/dist/track.js +281 -40
- package/dist/track.js.map +1 -1
- package/dist/transition.d.ts +54 -2
- package/dist/transition.d.ts.map +1 -1
- package/dist/transition.js +128 -8
- package/dist/transition.js.map +1 -1
- package/dist/types.d.ts +10 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/value-observers.d.ts +22 -0
- package/dist/value-observers.d.ts.map +1 -0
- package/dist/value-observers.js +122 -0
- package/dist/value-observers.js.map +1 -0
- package/dist/value-track.d.ts +13 -0
- package/dist/value-track.d.ts.map +1 -0
- package/dist/value-track.js +59 -0
- package/dist/value-track.js.map +1 -0
- package/dist/vue/index.d.ts +33 -3
- package/dist/vue/index.d.ts.map +1 -1
- package/dist/vue/index.js +118 -3
- package/dist/vue/index.js.map +1 -1
- package/dist/zoomable.d.ts +1 -1
- package/dist/zoomable.d.ts.map +1 -1
- package/package.json +68 -3
- package/platforms/android/include.gradle +10 -0
- package/platforms/android/java/org/rafaelaugusto/jolt/BlurEffect.java +89 -0
- package/platforms/android/java/org/rafaelaugusto/jolt/CircleMath.java +158 -0
- package/platforms/android/java/org/rafaelaugusto/jolt/CircleWorld.java +221 -0
- package/platforms/android/java/org/rafaelaugusto/jolt/GestureSession.java +227 -0
- package/platforms/android/java/org/rafaelaugusto/jolt/GestureSurface.java +54 -0
- package/platforms/android/java/org/rafaelaugusto/jolt/GradientLayer.java +224 -0
- package/platforms/android/java/org/rafaelaugusto/jolt/KeyboardFrame.java +53 -0
- package/platforms/android/java/org/rafaelaugusto/jolt/KeyboardFrameFollower.java +57 -0
- package/platforms/android/java/org/rafaelaugusto/jolt/KeyboardObserver.java +97 -0
- package/platforms/android/java/org/rafaelaugusto/jolt/LiveSpring.java +277 -0
- package/platforms/android/java/org/rafaelaugusto/jolt/MotionProbe.java +70 -0
- package/platforms/android/java/org/rafaelaugusto/jolt/ParticleEmitter.java +192 -0
- package/platforms/android/java/org/rafaelaugusto/jolt/ParticleSimulation.java +114 -0
- package/platforms/android/java/org/rafaelaugusto/jolt/PredictiveBackSession.java +212 -0
- package/platforms/android/java/org/rafaelaugusto/jolt/ReorderHandle.java +25 -0
- package/platforms/android/java/org/rafaelaugusto/jolt/ReorderSession.java +213 -0
- package/platforms/android/java/org/rafaelaugusto/jolt/ReorderSurface.java +27 -0
- package/platforms/android/java/org/rafaelaugusto/jolt/ScrollHeader.java +84 -0
- package/platforms/android/java/org/rafaelaugusto/jolt/SensorMath.java +28 -0
- package/platforms/android/java/org/rafaelaugusto/jolt/SensorSource.java +217 -0
- package/platforms/android/java/org/rafaelaugusto/jolt/ShapeLayer.java +120 -0
- package/platforms/android/java/org/rafaelaugusto/jolt/SharedLayoutFlight.java +287 -0
- package/platforms/android/java/org/rafaelaugusto/jolt/SharedNavigationScene.java +115 -0
- package/platforms/android/java/org/rafaelaugusto/jolt/SpringState.java +39 -0
- package/platforms/android/proguard-rules.pro +20 -0
- package/platforms/ios/build.xcconfig +1 -1
- package/platforms/ios/src/JoltBlur.h +14 -0
- package/platforms/ios/src/JoltBlur.m +86 -0
- package/platforms/ios/src/JoltCircleMath.h +191 -0
- package/platforms/ios/src/JoltCircleWorld.h +18 -0
- package/platforms/ios/src/JoltCircleWorld.m +218 -0
- package/platforms/ios/src/JoltGestureSession.h +23 -0
- package/platforms/ios/src/JoltGestureSession.m +251 -0
- package/platforms/ios/src/JoltInteractiveNavigation.h +23 -0
- package/platforms/ios/src/JoltInteractiveNavigation.m +255 -0
- package/platforms/ios/src/JoltLiveSpring.h +29 -0
- package/platforms/ios/src/JoltLiveSpring.m +243 -0
- package/platforms/ios/src/JoltMotionProbe.h +9 -0
- package/platforms/ios/src/JoltMotionProbe.m +72 -0
- package/platforms/ios/src/JoltReorderSession.h +15 -0
- package/platforms/ios/src/JoltReorderSession.m +205 -0
- package/platforms/ios/src/JoltScrollHeader.h +13 -0
- package/platforms/ios/src/JoltScrollHeader.m +101 -0
- package/platforms/ios/src/JoltSensorMath.h +39 -0
- package/platforms/ios/src/JoltSensorSource.h +13 -0
- package/platforms/ios/src/JoltSensorSource.m +201 -0
- package/platforms/ios/src/JoltSharedLayoutFlight.h +19 -0
- package/platforms/ios/src/JoltSharedLayoutFlight.m +250 -0
- package/platforms/ios/src/JoltSpringState.h +35 -0
- package/platforms/ios/src/module.modulemap +10 -0
- package/src/android-plugin.d.ts +464 -0
- package/src/animate.ts +129 -15
- package/src/blur/index.ts +195 -0
- package/src/blur/native.ts +70 -0
- package/src/blur/types.ts +32 -0
- package/src/bottom-sheet/geometry.ts +84 -0
- package/src/bottom-sheet/index.ts +536 -0
- package/src/bottom-sheet/native.ts +214 -0
- package/src/config.ts +39 -1
- package/src/decay.ts +9 -0
- package/src/drag.ts +67 -21
- package/src/driver/android-gradient.ts +116 -0
- package/src/driver/android-particles.ts +118 -0
- package/src/driver/android.ts +31 -1
- package/src/driver/frame.ts +10 -0
- package/src/driver/index.ts +4 -0
- package/src/driver/ios-gradient.ts +136 -0
- package/src/driver/ios-scroll-delegate.ts +23 -0
- package/src/driver/ios.ts +10 -0
- package/src/easing.ts +21 -1
- package/src/engine.ts +209 -60
- package/src/gesture-native.ts +139 -0
- package/src/gestures/index.ts +365 -0
- package/src/glass/index.ts +218 -0
- package/src/gradient-binding.ts +158 -0
- package/src/gradient.ts +663 -0
- package/src/gravity.ts +107 -0
- package/src/haptics.ts +106 -28
- package/src/image-effect.ts +10 -2
- package/src/index.ts +56 -7
- package/src/inspector/index.ts +523 -0
- package/src/inspector/plot.ts +27 -0
- package/src/inspector/probe.ts +50 -0
- package/src/inspector/tuning.ts +51 -0
- package/src/interactive-navigation/index.ts +427 -0
- package/src/ios-plugin.d.ts +280 -0
- package/src/keyboard.ts +231 -7
- package/src/live-spring-driver.ts +181 -0
- package/src/mixer.ts +312 -0
- package/src/motion-scope.ts +39 -6
- package/src/motion-states.ts +149 -42
- package/src/motion-value.ts +1289 -0
- package/src/native/index.ts +30 -0
- package/src/native-properties.ts +188 -0
- package/src/native-property-driver.ts +123 -0
- package/src/native-property.ts +366 -0
- package/src/particles.ts +18 -17
- package/src/path.ts +2 -1
- package/src/physics/index.ts +476 -0
- package/src/physics/native.ts +121 -0
- package/src/playback-group.ts +17 -1
- package/src/playback.ts +41 -0
- package/src/predictive-back/index.ts +280 -0
- package/src/predictive-back/presentation.ts +6 -0
- package/src/press.ts +10 -2
- package/src/reorder/handle.ts +9 -0
- package/src/reorder/index.ts +243 -0
- package/src/reorder/list-view.ts +262 -0
- package/src/reorder/model.ts +47 -0
- package/src/reorder/surface.ts +10 -0
- package/src/reorder/types.ts +87 -0
- package/src/sampling.ts +173 -0
- package/src/scene-appearance.ts +92 -0
- package/src/scene-camera.ts +30 -0
- package/src/scene-shader.ts +139 -0
- package/src/scroll-header/geometry.ts +88 -0
- package/src/scroll-header/index.ts +530 -0
- package/src/scroll-header/native.ts +89 -0
- package/src/sensors/index.ts +246 -0
- package/src/sensors/native.ts +72 -0
- package/src/sequence.ts +209 -20
- package/src/shapes/android.ts +63 -0
- package/src/shapes/index.ts +267 -0
- package/src/shapes/ios.ts +194 -0
- package/src/shapes/native.ts +27 -0
- package/src/shapes/path.ts +127 -0
- package/src/shapes/types.ts +63 -0
- package/src/shared-layout/index.ts +343 -0
- package/src/shared-layout/native.ts +138 -0
- package/src/shared-layout/timing.ts +87 -0
- package/src/shared-navigation/entry.ts +695 -0
- package/src/shared-navigation/index.ts +414 -0
- package/src/shared-navigation/return-signal.ts +41 -0
- package/src/shared-navigation/return-target.ts +197 -0
- package/src/shared-navigation/scope.ts +3 -0
- package/src/shared-navigation/targets.ts +38 -0
- package/src/size-layout.ts +237 -0
- package/src/size.ts +302 -0
- package/src/spring.ts +18 -0
- package/src/svg-path.ts +8 -3
- package/src/testing/clock.ts +128 -0
- package/src/testing/handoff-recorder.ts +98 -0
- package/src/testing/index.ts +4 -0
- package/src/testing/native.ts +386 -0
- package/src/testing/presentation.ts +46 -0
- package/src/testing/replay.ts +149 -0
- package/src/testing/scroll-handoff-native.ts +201 -0
- package/src/testing/scroll-handoff.ts +140 -0
- package/src/testing/sensors.ts +41 -0
- package/src/testing/trace.ts +340 -0
- package/src/timed-animation.ts +192 -0
- package/src/track.ts +334 -38
- package/src/transition.ts +197 -9
- package/src/types.ts +11 -1
- package/src/value-observers.ts +147 -0
- package/src/value-track.ts +71 -0
- package/src/vue/index.ts +147 -1
- package/src/zoomable.ts +1 -1
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { Application, Color, Utils, type View } from '@nativescript/core'
|
|
2
|
+
import { onReducedMotion, reducedMotion } from '../config.js'
|
|
3
|
+
import type { ParticleSettings } from '../particles.js'
|
|
4
|
+
|
|
5
|
+
type NativeEmitter = org.rafaelaugusto.jolt.ParticleEmitter
|
|
6
|
+
const live = new WeakMap<View, { emitter?: NativeEmitter; burst?: NativeEmitter }>()
|
|
7
|
+
|
|
8
|
+
/** Internal diagnostic seam for native conformance, not a public animation API. */
|
|
9
|
+
export function currentAndroidParticles(view: View, overlay = false) {
|
|
10
|
+
return live.get(view)?.[overlay ? 'burst' : 'emitter']
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function androidParticles(
|
|
14
|
+
view: View,
|
|
15
|
+
settings: ParticleSettings,
|
|
16
|
+
overlay: boolean,
|
|
17
|
+
owners: WeakMap<View, () => void>,
|
|
18
|
+
): () => void {
|
|
19
|
+
let stopped = false,
|
|
20
|
+
queued = false
|
|
21
|
+
let emitter: NativeEmitter | undefined,
|
|
22
|
+
target: android.view.View | undefined,
|
|
23
|
+
unwatch: (() => void) | undefined
|
|
24
|
+
const key = overlay ? 'burst' : 'emitter'
|
|
25
|
+
const stop = () => {
|
|
26
|
+
if (stopped) return
|
|
27
|
+
stopped = true
|
|
28
|
+
view.off('loaded', schedule)
|
|
29
|
+
view.off('layoutChanged', schedule)
|
|
30
|
+
view.off('unloaded', stop)
|
|
31
|
+
view.style.off('borderTopLeftRadiusChange', schedule)
|
|
32
|
+
Application.off(Application.suspendEvent, stop)
|
|
33
|
+
unwatch?.()
|
|
34
|
+
unwatch = undefined
|
|
35
|
+
if (owners.get(view) === stop) owners.delete(view)
|
|
36
|
+
const active = live.get(view)
|
|
37
|
+
if (active && active[key] === emitter) {
|
|
38
|
+
delete active[key]
|
|
39
|
+
if (!active.emitter && !active.burst) live.delete(view)
|
|
40
|
+
}
|
|
41
|
+
const native = emitter
|
|
42
|
+
emitter = target = undefined
|
|
43
|
+
native?.stop()
|
|
44
|
+
}
|
|
45
|
+
const update = () => {
|
|
46
|
+
if (!view.isLoaded) return
|
|
47
|
+
if (reducedMotion()) return stop()
|
|
48
|
+
const native = view.nativeViewProtected as android.view.View | undefined
|
|
49
|
+
if (target && target !== native) return stop()
|
|
50
|
+
if (emitter) {
|
|
51
|
+
emitter.refresh(
|
|
52
|
+
(typeof view.borderRadius === 'number' ? view.borderRadius : 0) *
|
|
53
|
+
Utils.layout.getDisplayDensity(),
|
|
54
|
+
)
|
|
55
|
+
return
|
|
56
|
+
}
|
|
57
|
+
if (!native?.getWindowToken() || native.getWidth() <= 0 || native.getHeight() <= 0)
|
|
58
|
+
return
|
|
59
|
+
const colors = Array.create('int', settings.colors.length)
|
|
60
|
+
settings.colors.forEach((color, i) => {
|
|
61
|
+
colors[i] = new Color(color).argb | 0
|
|
62
|
+
})
|
|
63
|
+
target = native
|
|
64
|
+
emitter = new org.rafaelaugusto.jolt.ParticleEmitter(
|
|
65
|
+
native,
|
|
66
|
+
overlay,
|
|
67
|
+
colors,
|
|
68
|
+
settings.shape === 'circle' ? 0 : settings.shape === 'rectangle' ? 1 : 2,
|
|
69
|
+
settings.source === 'center' ? 0 : settings.source === 'top' ? 1 : 2,
|
|
70
|
+
settings.rate,
|
|
71
|
+
settings.lifetime,
|
|
72
|
+
settings.size,
|
|
73
|
+
settings.velocity,
|
|
74
|
+
settings.velocityRange,
|
|
75
|
+
settings.angle,
|
|
76
|
+
settings.spread,
|
|
77
|
+
settings.gravity,
|
|
78
|
+
settings.spin,
|
|
79
|
+
settings.spinRange,
|
|
80
|
+
settings.fadeOut,
|
|
81
|
+
settings.duration ?? -1,
|
|
82
|
+
new org.rafaelaugusto.jolt.ParticleEmitter.Listener({ onEnd: stop }),
|
|
83
|
+
)
|
|
84
|
+
const active = live.get(view) ?? {}
|
|
85
|
+
active[key] = emitter
|
|
86
|
+
live.set(view, active)
|
|
87
|
+
emitter.refresh(
|
|
88
|
+
(typeof view.borderRadius === 'number' ? view.borderRadius : 0) *
|
|
89
|
+
Utils.layout.getDisplayDensity(),
|
|
90
|
+
)
|
|
91
|
+
emitter.start()
|
|
92
|
+
}
|
|
93
|
+
function schedule() {
|
|
94
|
+
if (stopped || queued) return
|
|
95
|
+
queued = true
|
|
96
|
+
void Promise.resolve().then(() => {
|
|
97
|
+
queued = false
|
|
98
|
+
if (stopped) return
|
|
99
|
+
try {
|
|
100
|
+
update()
|
|
101
|
+
} catch (error) {
|
|
102
|
+
stop()
|
|
103
|
+
throw error
|
|
104
|
+
}
|
|
105
|
+
})
|
|
106
|
+
}
|
|
107
|
+
owners.set(view, stop)
|
|
108
|
+
view.on('loaded', schedule)
|
|
109
|
+
view.on('layoutChanged', schedule)
|
|
110
|
+
view.on('unloaded', stop)
|
|
111
|
+
view.style.on('borderTopLeftRadiusChange', schedule)
|
|
112
|
+
Application.on(Application.suspendEvent, stop)
|
|
113
|
+
unwatch = onReducedMotion((reduced) => {
|
|
114
|
+
if (reduced) stop()
|
|
115
|
+
})
|
|
116
|
+
schedule()
|
|
117
|
+
return stop
|
|
118
|
+
}
|
package/src/driver/android.ts
CHANGED
|
@@ -4,14 +4,16 @@ import {
|
|
|
4
4
|
type AndroidPlayback,
|
|
5
5
|
} from './android-playback.js'
|
|
6
6
|
import { isDecorationProperty } from '../decoration.js'
|
|
7
|
+
import { syncLiveSprings } from '../live-spring-driver.js'
|
|
7
8
|
import {
|
|
8
9
|
syncAndroidDecoration,
|
|
9
10
|
playAndroidDecoration,
|
|
10
11
|
presentedAndroidDecoration,
|
|
11
12
|
} from './android-decoration.js'
|
|
12
|
-
import { Utils, type View } from '@nativescript/core'
|
|
13
|
+
import { Application, Utils, type View } from '@nativescript/core'
|
|
13
14
|
import type { NumericProperty } from '../properties.js'
|
|
14
15
|
import type { Driver } from './index.js'
|
|
16
|
+
import { frame } from './frame.js'
|
|
15
17
|
import { isColorProperty } from '../color.js'
|
|
16
18
|
import {
|
|
17
19
|
playAndroidColor,
|
|
@@ -31,6 +33,7 @@ function fadeLayer(view: View, nativeView: NativeView): (() => void) | undefined
|
|
|
31
33
|
view.nativeViewProtected !== nativeView ||
|
|
32
34
|
!(nativeView instanceof ViewGroup) ||
|
|
33
35
|
nativeView.getChildCount() === 0 ||
|
|
36
|
+
!nativeView.getClipChildren() ||
|
|
34
37
|
!nativeView.isHardwareAccelerated() ||
|
|
35
38
|
nativeView.getLayerType() !== View.LAYER_TYPE_NONE
|
|
36
39
|
)
|
|
@@ -57,6 +60,23 @@ function fadeLayer(view: View, nativeView: NativeView): (() => void) | undefined
|
|
|
57
60
|
return restore
|
|
58
61
|
}
|
|
59
62
|
|
|
63
|
+
/**
|
|
64
|
+
* A translucent view is drawn into a buffer of its own size, which cuts off children
|
|
65
|
+
* that draw outside it. Fade those children one by one instead.
|
|
66
|
+
*/
|
|
67
|
+
function keepOverflow(nativeView: NativeView) {
|
|
68
|
+
if (
|
|
69
|
+
android.os.Build.VERSION.SDK_INT >= 24 &&
|
|
70
|
+
nativeView instanceof android.view.ViewGroup &&
|
|
71
|
+
!nativeView.getClipChildren() &&
|
|
72
|
+
nativeView.getHasOverlappingRendering()
|
|
73
|
+
) {
|
|
74
|
+
nativeView.forceHasOverlappingRendering(false)
|
|
75
|
+
// The render node only picks the flag up when the view draws again.
|
|
76
|
+
nativeView.invalidate()
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
60
80
|
const accessors: Record<
|
|
61
81
|
NumericProperty,
|
|
62
82
|
{ get(view: NativeView): number; set(view: NativeView, value: number): void }
|
|
@@ -91,6 +111,7 @@ export function createAndroidDriver(): Driver {
|
|
|
91
111
|
|
|
92
112
|
return {
|
|
93
113
|
now: () => android.os.SystemClock.uptimeMillis(),
|
|
114
|
+
frame,
|
|
94
115
|
clock,
|
|
95
116
|
control(_view, handle, elapsed, paused, command) {
|
|
96
117
|
;(handle as Handle).control(elapsed, paused, command)
|
|
@@ -143,6 +164,8 @@ export function createAndroidDriver(): Driver {
|
|
|
143
164
|
: android.animation.ValueAnimator.RESTART,
|
|
144
165
|
)
|
|
145
166
|
}
|
|
167
|
+
if (track.property === 'opacity' && track.values.some((value) => value < 1))
|
|
168
|
+
keepOverflow(nativeView)
|
|
146
169
|
accessors[track.property].set(nativeView, track.values[0]! * scale)
|
|
147
170
|
return androidPlayback(
|
|
148
171
|
animator,
|
|
@@ -166,6 +189,7 @@ export function createAndroidDriver(): Driver {
|
|
|
166
189
|
sync(view) {
|
|
167
190
|
syncAndroidDecoration(view)
|
|
168
191
|
syncAndroidColor(view)
|
|
192
|
+
syncLiveSprings(view)
|
|
169
193
|
},
|
|
170
194
|
|
|
171
195
|
elapsed: (handle) => (handle as Handle).elapsed(),
|
|
@@ -259,5 +283,11 @@ export function createAndroidDriver(): Driver {
|
|
|
259
283
|
) === 0
|
|
260
284
|
)
|
|
261
285
|
},
|
|
286
|
+
|
|
287
|
+
watchReducedMotion(callback) {
|
|
288
|
+
// Android has no broadcast for the animator scale; it can only change in Settings.
|
|
289
|
+
Application.on(Application.resumeEvent, callback)
|
|
290
|
+
return () => Application.off(Application.resumeEvent, callback)
|
|
291
|
+
},
|
|
262
292
|
}
|
|
263
293
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cancelAnimationFrame,
|
|
3
|
+
requestAnimationFrame,
|
|
4
|
+
} from '@nativescript/core/animation-frame'
|
|
5
|
+
|
|
6
|
+
/** NativeScript schedules subsequent frames with CADisplayLink / Choreographer. */
|
|
7
|
+
export function frame(callback: () => void): () => void {
|
|
8
|
+
const id = requestAnimationFrame(callback)
|
|
9
|
+
return () => cancelAnimationFrame(id)
|
|
10
|
+
}
|
package/src/driver/index.ts
CHANGED
|
@@ -15,6 +15,8 @@ export interface LayoutFrame {
|
|
|
15
15
|
export interface Driver {
|
|
16
16
|
/** Milliseconds, on the clock the platform's animations run on. */
|
|
17
17
|
now(): number
|
|
18
|
+
/** One native animation frame; returns an idempotent cancellation function. */
|
|
19
|
+
frame(callback: () => void): () => void
|
|
18
20
|
/** Starts the track at `startedAt + track.delay` and calls `onEnd` once, however it ends. */
|
|
19
21
|
play(
|
|
20
22
|
view: View,
|
|
@@ -47,6 +49,8 @@ export interface Driver {
|
|
|
47
49
|
afterLayout?(view: View, callback: () => void): () => void
|
|
48
50
|
/** The platform's accessibility setting: Reduce Motion on iOS, Remove animations on Android. */
|
|
49
51
|
reducedMotion?(): boolean
|
|
52
|
+
/** Calls back when that setting may have changed; returns a cleanup function. */
|
|
53
|
+
watchReducedMotion?(callback: () => void): () => void
|
|
50
54
|
}
|
|
51
55
|
|
|
52
56
|
export function after(ms: number, callback: () => void) {
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { Color, type View } from '@nativescript/core'
|
|
2
|
+
import {
|
|
3
|
+
gradientPoints,
|
|
4
|
+
type GradientFrame,
|
|
5
|
+
type GradientPainter,
|
|
6
|
+
type GradientType,
|
|
7
|
+
} from '../gradient.js'
|
|
8
|
+
|
|
9
|
+
const keys = ['colors', 'locations', 'startPoint', 'endPoint'] as const
|
|
10
|
+
|
|
11
|
+
/** A CAGradientLayer at the back of the view's layer: above its background, below its children. */
|
|
12
|
+
export function iosGradient(view: View, type: GradientType): GradientPainter {
|
|
13
|
+
const layer = CAGradientLayer.new()
|
|
14
|
+
layer.type =
|
|
15
|
+
type === 'linear'
|
|
16
|
+
? kCAGradientLayerAxial
|
|
17
|
+
: type === 'radial'
|
|
18
|
+
? kCAGradientLayerRadial
|
|
19
|
+
: kCAGradientLayerConic
|
|
20
|
+
let current: GradientFrame | undefined
|
|
21
|
+
let generation = 0
|
|
22
|
+
|
|
23
|
+
const native = () => view.nativeViewProtected as UIView | undefined
|
|
24
|
+
const size = () => {
|
|
25
|
+
const bounds = native()?.layer.bounds
|
|
26
|
+
return { width: bounds?.size.width ?? 0, height: bounds?.size.height ?? 0 }
|
|
27
|
+
}
|
|
28
|
+
const values = (frame: GradientFrame) => {
|
|
29
|
+
const { width, height } = size()
|
|
30
|
+
const { start, end: toward } = gradientPoints(type, frame, width, height)
|
|
31
|
+
// Core Animation starts a conic gradient on the side opposite its end point.
|
|
32
|
+
const end =
|
|
33
|
+
type === 'conic' ? { x: 2 * start.x - toward.x, y: 2 * start.y - toward.y } : toward
|
|
34
|
+
return {
|
|
35
|
+
colors: NSArray.arrayWithArray(
|
|
36
|
+
frame.colors.map((argb) => new Color(argb).ios.CGColor),
|
|
37
|
+
),
|
|
38
|
+
locations: NSArray.arrayWithArray(frame.stops),
|
|
39
|
+
startPoint: NSValue.valueWithCGPoint(CGPointMake(start.x, start.y)),
|
|
40
|
+
endPoint: NSValue.valueWithCGPoint(CGPointMake(end.x, end.y)),
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
const attach = () => {
|
|
44
|
+
const host = native()
|
|
45
|
+
if (!host) return
|
|
46
|
+
CATransaction.begin()
|
|
47
|
+
CATransaction.setDisableActions(true)
|
|
48
|
+
if (layer.superlayer !== host.layer) host.layer.insertSublayerAtIndex(layer, 0)
|
|
49
|
+
layer.frame = host.layer.bounds
|
|
50
|
+
layer.cornerRadius =
|
|
51
|
+
typeof view.borderRadius === 'number' ? view.borderRadius : host.layer.cornerRadius
|
|
52
|
+
if (current) {
|
|
53
|
+
const model = values(current)
|
|
54
|
+
layer.colors = model.colors
|
|
55
|
+
layer.locations = model.locations
|
|
56
|
+
layer.startPoint = model.startPoint.CGPointValue
|
|
57
|
+
layer.endPoint = model.endPoint.CGPointValue
|
|
58
|
+
}
|
|
59
|
+
CATransaction.commit()
|
|
60
|
+
}
|
|
61
|
+
view.on('loaded', attach)
|
|
62
|
+
view.on('layoutChanged', attach)
|
|
63
|
+
view.style.on('borderTopLeftRadiusChange', attach)
|
|
64
|
+
|
|
65
|
+
return {
|
|
66
|
+
paint(frame) {
|
|
67
|
+
layer.speed = 1
|
|
68
|
+
layer.timeOffset = 0
|
|
69
|
+
layer.beginTime = 0
|
|
70
|
+
current = frame
|
|
71
|
+
generation++
|
|
72
|
+
for (const key of keys) layer.removeAnimationForKey(`jolt:gradient:${key}`)
|
|
73
|
+
attach()
|
|
74
|
+
},
|
|
75
|
+
play(frames, times, timing, onEnd) {
|
|
76
|
+
const instance = ++generation
|
|
77
|
+
current = frames[frames.length - 1]!
|
|
78
|
+
attach()
|
|
79
|
+
const sampled = frames.map(values)
|
|
80
|
+
const now = CACurrentMediaTime()
|
|
81
|
+
const parentTime = () =>
|
|
82
|
+
layer.superlayer?.convertTimeFromLayer(CACurrentMediaTime(), null) ??
|
|
83
|
+
CACurrentMediaTime()
|
|
84
|
+
CATransaction.begin()
|
|
85
|
+
CATransaction.setDisableActions(true)
|
|
86
|
+
layer.speed = 1
|
|
87
|
+
layer.timeOffset = 0
|
|
88
|
+
layer.beginTime = layer.superlayer?.convertTimeFromLayer(now, null) ?? now
|
|
89
|
+
if (timing.repeat !== Infinity)
|
|
90
|
+
CATransaction.setCompletionBlock(() => {
|
|
91
|
+
if (instance === generation) onEnd(true)
|
|
92
|
+
})
|
|
93
|
+
for (const key of keys) {
|
|
94
|
+
const animation = CAKeyframeAnimation.animationWithKeyPath(key)
|
|
95
|
+
animation.values = NSArray.arrayWithArray(sampled.map((value) => value[key]))
|
|
96
|
+
animation.keyTimes = NSArray.arrayWithArray(times as number[])
|
|
97
|
+
animation.duration = Math.max(timing.duration, 1) / 1000
|
|
98
|
+
animation.beginTime = Math.max(0.000001, timing.delay / 1000)
|
|
99
|
+
animation.fillMode = kCAFillModeBackwards
|
|
100
|
+
if (timing.repeat > 0) {
|
|
101
|
+
animation.autoreverses = timing.reverse
|
|
102
|
+
animation.repeatCount = timing.reverse
|
|
103
|
+
? (timing.repeat + 1) / 2
|
|
104
|
+
: timing.repeat + 1
|
|
105
|
+
}
|
|
106
|
+
layer.addAnimationForKey(animation, `jolt:gradient:${key}`)
|
|
107
|
+
}
|
|
108
|
+
CATransaction.commit()
|
|
109
|
+
return {
|
|
110
|
+
control(elapsed, paused) {
|
|
111
|
+
if (instance !== generation) return
|
|
112
|
+
CATransaction.begin()
|
|
113
|
+
CATransaction.setDisableActions(true)
|
|
114
|
+
layer.speed = paused ? 0 : 1
|
|
115
|
+
layer.timeOffset = paused ? elapsed / 1000 : 0
|
|
116
|
+
layer.beginTime = paused ? 0 : parentTime() - elapsed / 1000
|
|
117
|
+
CATransaction.commit()
|
|
118
|
+
},
|
|
119
|
+
cancel() {
|
|
120
|
+
if (instance !== generation) return
|
|
121
|
+
generation++
|
|
122
|
+
for (const key of keys) layer.removeAnimationForKey(`jolt:gradient:${key}`)
|
|
123
|
+
onEnd(false)
|
|
124
|
+
},
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
remove() {
|
|
128
|
+
generation++
|
|
129
|
+
view.off('loaded', attach)
|
|
130
|
+
view.off('layoutChanged', attach)
|
|
131
|
+
view.style.off('borderTopLeftRadiusChange', attach)
|
|
132
|
+
layer.removeAllAnimations()
|
|
133
|
+
layer.removeFromSuperlayer()
|
|
134
|
+
},
|
|
135
|
+
}
|
|
136
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ScrollView } from '@nativescript/core'
|
|
2
|
+
|
|
3
|
+
/** Preserve Core's lazy scroll listener attach/detach without adding a JS scroll observer. */
|
|
4
|
+
export function retainScrollDelegate(scroll: ScrollView, refresh: () => void) {
|
|
5
|
+
const host = scroll as ScrollView & { attachNative(): void; detachNative(): void }
|
|
6
|
+
const restore: (() => void)[] = []
|
|
7
|
+
for (const key of ['attachNative', 'detachNative'] as const) {
|
|
8
|
+
const original = host[key]
|
|
9
|
+
if (typeof original !== 'function') continue
|
|
10
|
+
const descriptor = Object.getOwnPropertyDescriptor(host, key)
|
|
11
|
+
const wrapper = function (this: typeof host) {
|
|
12
|
+
original.call(this)
|
|
13
|
+
refresh()
|
|
14
|
+
}
|
|
15
|
+
host[key] = wrapper
|
|
16
|
+
restore.push(() => {
|
|
17
|
+
if (host[key] !== wrapper) return
|
|
18
|
+
if (descriptor) Object.defineProperty(host, key, descriptor)
|
|
19
|
+
else delete (host as Partial<typeof host>)[key]
|
|
20
|
+
})
|
|
21
|
+
}
|
|
22
|
+
return () => restore.forEach((action) => action())
|
|
23
|
+
}
|
package/src/driver/ios.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { iosPlayback } from './ios-playback.js'
|
|
2
|
+
import { syncLiveSprings } from '../live-spring-driver.js'
|
|
2
3
|
import { isDecorationProperty } from '../decoration.js'
|
|
3
4
|
import {
|
|
4
5
|
playIOSDecoration,
|
|
@@ -13,6 +14,7 @@ import { playIOSColor, presentedIOSColor } from './ios-color.js'
|
|
|
13
14
|
import { after, type Driver } from './index.js'
|
|
14
15
|
import { hasInteractionSurface } from '../interaction-surface.js'
|
|
15
16
|
import { retainInteractiveLayout } from './ios-layout.js'
|
|
17
|
+
import { frame } from './frame.js'
|
|
16
18
|
|
|
17
19
|
interface Handle {
|
|
18
20
|
stop(): void
|
|
@@ -59,6 +61,7 @@ function ensurePerspective(view: View, layers: CALayer[]) {
|
|
|
59
61
|
export function createIOSDriver(): Driver {
|
|
60
62
|
return {
|
|
61
63
|
now: () => CACurrentMediaTime() * 1000,
|
|
64
|
+
frame,
|
|
62
65
|
|
|
63
66
|
play(view, track, startedAt, onEnd): Handle {
|
|
64
67
|
if (isDecorationProperty(track.property))
|
|
@@ -195,6 +198,7 @@ export function createIOSDriver(): Driver {
|
|
|
195
198
|
view.nativeViewProtected,
|
|
196
199
|
excluding ? (keyPaths[excluding as NumericProperty] ?? null) : null,
|
|
197
200
|
)
|
|
201
|
+
syncLiveSprings(view)
|
|
198
202
|
},
|
|
199
203
|
|
|
200
204
|
presented(view, property) {
|
|
@@ -247,5 +251,11 @@ export function createIOSDriver(): Driver {
|
|
|
247
251
|
after,
|
|
248
252
|
|
|
249
253
|
reducedMotion: () => UIAccessibilityIsReduceMotionEnabled(),
|
|
254
|
+
|
|
255
|
+
watchReducedMotion(callback) {
|
|
256
|
+
const name = UIAccessibilityReduceMotionStatusDidChangeNotification
|
|
257
|
+
const observer = Application.ios.addNotificationObserver(name, callback)
|
|
258
|
+
return () => Application.ios.removeNotificationObserver(observer, name)
|
|
259
|
+
},
|
|
250
260
|
}
|
|
251
261
|
}
|
package/src/easing.ts
CHANGED
|
@@ -15,10 +15,14 @@ export type EasingName =
|
|
|
15
15
|
| 'backOut'
|
|
16
16
|
| 'backInOut'
|
|
17
17
|
| 'anticipate'
|
|
18
|
+
| `${'quad' | 'cubic' | 'quart' | 'quint' | 'sine' | 'expo'}${'In' | 'Out' | 'InOut'}`
|
|
18
19
|
|
|
19
20
|
export type Easing = EasingName | CubicBezier | EasingFunction
|
|
20
21
|
|
|
21
22
|
export const linear: EasingFunction = (p) => p
|
|
23
|
+
const builtins = new WeakSet<EasingFunction>([linear])
|
|
24
|
+
/** Internal sampler hint. Arbitrary callbacks are never assumed to be band limited. */
|
|
25
|
+
export const isBuiltinEasing = (ease: EasingFunction) => builtins.has(ease)
|
|
22
26
|
|
|
23
27
|
export function cubicBezier(x1: number, y1: number, x2: number, y2: number) {
|
|
24
28
|
if (x1 === y1 && x2 === y2) return linear
|
|
@@ -57,7 +61,9 @@ export function cubicBezier(x1: number, y1: number, x2: number, y2: number) {
|
|
|
57
61
|
return t
|
|
58
62
|
}
|
|
59
63
|
|
|
60
|
-
|
|
64
|
+
const result = (p: number) => (p <= 0 ? 0 : p >= 1 ? 1 : sampleY(solveX(p)))
|
|
65
|
+
builtins.add(result)
|
|
66
|
+
return result
|
|
61
67
|
}
|
|
62
68
|
|
|
63
69
|
const backIn = cubicBezier(0.36, 0, 0.66, -0.56)
|
|
@@ -73,6 +79,13 @@ const mirror =
|
|
|
73
79
|
(p) =>
|
|
74
80
|
p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2
|
|
75
81
|
|
|
82
|
+
const family = <N extends string>(name: N, easeIn: EasingFunction) =>
|
|
83
|
+
({
|
|
84
|
+
[`${name}In`]: easeIn,
|
|
85
|
+
[`${name}Out`]: reverse(easeIn),
|
|
86
|
+
[`${name}InOut`]: mirror(easeIn),
|
|
87
|
+
}) as Record<`${N}${'In' | 'Out' | 'InOut'}`, EasingFunction>
|
|
88
|
+
|
|
76
89
|
const easings: Record<EasingName, EasingFunction> = {
|
|
77
90
|
linear,
|
|
78
91
|
ease: cubicBezier(0.25, 0.1, 0.25, 1),
|
|
@@ -87,7 +100,14 @@ const easings: Record<EasingName, EasingFunction> = {
|
|
|
87
100
|
backInOut: mirror(backIn),
|
|
88
101
|
anticipate: (p) =>
|
|
89
102
|
p <= 0.5 ? backIn(2 * p) / 2 : p >= 1 ? 1 : 1 - Math.pow(2, 10 - 20 * p) / 2,
|
|
103
|
+
...family('quad', (p) => p ** 2),
|
|
104
|
+
...family('cubic', (p) => p ** 3),
|
|
105
|
+
...family('quart', (p) => p ** 4),
|
|
106
|
+
...family('quint', (p) => p ** 5),
|
|
107
|
+
...family('sine', (p) => (p >= 1 ? 1 : 1 - Math.cos((p * Math.PI) / 2))),
|
|
108
|
+
...family('expo', (p) => (p <= 0 ? 0 : 2 ** (10 * p - 10))),
|
|
90
109
|
}
|
|
110
|
+
Object.values(easings).forEach((ease) => builtins.add(ease))
|
|
91
111
|
|
|
92
112
|
export function resolveEasing(easing: Easing): EasingFunction {
|
|
93
113
|
if (typeof easing === 'function') return easing
|