Full Changelog: https://github.com/niklasramo/dragdoll/compare/0.3.0...0.4.0
Published by niklasramo 7 months ago
Full Changelog: https://github.com/niklasramo/dragdoll/compare/0.2.0...0.3.0
Published by niklasramo 11 months ago
Published by niklasramo over 1 year ago
Summary
Breaking changes
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.time
and 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()
.Published by niklasramo almost 2 years ago
Overview
Draggable
class, which allows extending it's functionality.Draggable
s autoscroll feature to a separate plugin so that you don't have to load all the autoscroll code if you don't need it (as it's quite a chunk of code).Breaking changes
_isActive
property from private to public -> isActive
._isDestroyed
property from private to public -> isDestroyed
.Draggable
destroyElements
-> releaseElements
.getElementPosition
-> getElementStartPosition
.renderElementPosition
-> setElementPosition
.data
argument, which is an object containing all the data you might need in that specific callback. This change was made because the amount of individual arguments was getting a bit out of hand and was becoming confusing for the end user to manage.autoScroll
option and baked all that functionality into a separate autoscroll plugin.isActive
method.getDragData
method._drag
property to drag
and make it public.BaseSensor
_start
, _move
, _end
and _cancel
protected methods now need the full event data object as argument which includes the type
property too.Sensor
on
method to be less strict about the emitter implementation -> the method's return type was changed tovoid
and the third (optional) listenerId
argument removed. The types were previously modeled based on the event emitter used internally by DragDoll, but it made sense to make this part less specific and leave more room for impelementation details.KeyboardMotionSensor
KeyboardControllerSensor
.speed
option renamed to computeSpeed
.tickTime
property renamed to time
.tickDeltaTime
property renamed to deltaTime
.directionX
and directionY
properties replaced by direction
porperty, an object with x and
y` components which is assumed to be the current direction (unit) vector.speedX
and speedY
properties replaced by speed
property.tick
method renamed to _tick
and demoted as protected property.New features
KeyboardSensor
moveDistance
, which allows you to define the default distance the sensor is moved per "move" event during dragging.Draggable
use
method.AutoScroll
BaseControllerSensor
.Published by niklasramo about 2 years ago
It's born! Still in very experimental phase, please don't use in production.