SortableJS / Sortable

Reorderable drag-and-drop lists for modern browsers and touch devices. No jQuery or framework required.
https://sortablejs.github.io/Sortable/
MIT License
29.77k stars 3.71k forks source link

Can't implement a SortableJS plugin without referencing unexported symbols from `sortablejs` source code #2356

Closed borisgoro closed 8 months ago

borisgoro commented 9 months ago

I want to write a SortableJS plugin that gets mounted to a Sortable instance from the sortablejs package:

import Sortable from 'sortablejs'
Sortable.mount(new MyPlugin())

However, looking at the shipped plugins, it looks like they depend on unexported symbols imported directly from the source code. For example MultiDrag.js imports expando from ../../src/utils.js.

Can I write a plugin without referencing sortablejs source code?

owen-m1 commented 8 months ago

Thank you, it should be fixed in the next version: https://github.com/SortableJS/Sortable/commit/41ff81f4aa3bc0d71c6f90a5b8972d016abbe1d7

Expando will be available in Sortable.utils and the src of Sortable can be imported directly from the npm package

borisgoro commented 7 months ago

Thank you!