npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

katavorio

v1.4.11

Published

Lightweight drag/drop handler

Downloads

121

Readme

Katavorio

Katavorio is a lightweight drag/drop handler, supporting containment, multiple element drag, custom css classes, drop filters, drag filters, drag clones, drag handles, constraining movement to a grid, and zooming.

Katavorio does not work "out of the box" - it was developed as part of jsPlumb 1.6.0, to support a "no dependency" version (all previous versions of jsPlumb required either jQuery, MooTools or YUI, to provide a bunch of functionality such as CSS manipulation, getting/setting element positions, supporting drag/drop etc). So, rather than re-write simple methods such as addClass, removeClass, getPosition etc, Katavorio expects those methods to be provided in the constructor's options object.

All is not lost, though, as this project also contains DefaultKatavorioHelper - the set of missing methods.

Installation

npm install katavorio

NOTE: Katavorio does not follow strict semantic versioning. It is not at all recommended that you use wildcards when specifying a dependency on Katavorio.

Dependencies

None

Imports

If you have jsPlumb in your page then you already have Katavorio - it is bundled into jsPlumb. Otherwise you'll need to import two scripts:

node_modules/katavorio/src/default-katavorio-helper.js
node_modules/katavorio/src/katavorio.js

For more information, take a look in the wiki.

Changelog

1.4.11

  • support constrain functions in a drag selector

1.4.10

  • support ghost proxy handling by selectors in a drag.

1.4.9

  • return grid position from snap method on draggable.

1.4.8

  • support filter and filterExclude in delegated drag handlers

1.4.7

  • pass current drag element in callback to "should proxy" function. Required when a delegate drag is occurring.

1.4.6

  • pass the return value of a delegate to the code that tests if a drag can begin.

1.4.5

  • fixed an issue with drag stop event for single node drags.

1.4.4

  • support revert function being passed in to constructor.

1.4.3

  • added support for "combinator rooted" queries for delegated drags.

1.4.2

  • added support for provision of ghostProxyParent when using a ghost proxy to drag.

1.4.1

  • add test to ensure event's default not prevented when responding to initial mouse down

1.4.0

  • Add support for multiple selector definitions on a single Drag object, via the new addSelector method. You can make some element draggable and then attach more listeners to that object, rather than having to create a whole new draggable:
let d = katavorioInstance.draggable(someElement, {
  selector:".childSelector",
  start:function(p) { ... },
  etc
});

d.addSelector({
  selector:".someOtherChildSelector",
  start:function(p) { ... },
  etc
});

1.3.0

  • for delegated draggables (ie when you provide a selector in the params), we use the class katavorio-delegated-draggable now, instead of where we previously used the default draggable class of katavorio-draggable. This can also be overridden in the constructor by setting the value of delegatedDraggable.

0.28.0

  • add the ability for a user to specify the parent to use when cloning a node for dragging.

0.26.0

  • added the ability to remove specific drag/drop handlers (previous we could only completely switch off drag/drop)