Skip to content

0.1.0

Compare
Choose a tag to compare
@niklasramo niklasramo released this 09 Jul 16:18
· 23 commits to main since this release
64aad6e

Summary

  • Refactored API (quite many breaking changes).
  • Improved TS typing.
  • Updated docs and dependencies.
  • Updated logo.
  • Added some initial tests (although tests in general are still a work in progress).
  • Fixed an issue with auto-scrolling where it could not always detect the end of the scroll.

Breaking changes

  • All clientX and clientY properties across the API are now named simply x and y instead.
  • BaseControllerSensor -> BaseMotionSensor.
  • KeyboardControllerSensor -> KeyboardMotionSensor .
  • BaseSensor.isActive/PointerSensor.isActive are removed, note that this affects to all classes that inherit from them. You can now instead use BaseSensor.drag/PointerSensor.drag property to check if drag is active. If it's null drag is inactive, otherwise it's active.
  • BaseSensor.clientX and BaseSensor.clientY are now moved within a new public BaseSensor.drag property, which is an object containing those two porperties when drag is active. When drag is not active BaseSensor.drag is null.
  • PointerSensor's pointerId, pointerType, clientX and clientY properties are now moved within PointerSensor.drag property when drag is active. When drag is not active PointerSensor.drag property is null.
  • BaseMotionSensor.speed and BaseMotionSensor.direction are now protected properties instead of public properties and prefixed with an underscore.
  • BaseMotionSensor.timeand BaseMotionSensor.deltaTime properties are now moved within BaseMotionSensor.drag property when drag is active.
  • Draggable settings renamed:
    • getElementStartPosition -> getStartPosition.
    • setElementPosition -> setPosition.
    • getElementPositionChange -> getPositionChange.
  • draggable.use method functionality changed a bit. Typing is better now, but plugin has more responsibility.
  • draggable.plugins property is now a plain object instead of a Map.
  • draggable.synchronize() -> draggable.updatePosition().