Gathering detailed insights and metrics for editorjs-drag-drop
Gathering detailed insights and metrics for editorjs-drag-drop
npm install editorjs-drag-drop
Typescript
Module System
Node Version
NPM Version
94.4
Supply Chain
94.4
Quality
80.6
Maintenance
100
Vulnerability
100
License
JavaScript (95.27%)
CSS (4.73%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
1,275,737
Last Day
568
Last Week
33,509
Last Month
100,821
Last Year
886,716
MIT License
193 Stars
122 Commits
27 Forks
7 Watchers
11 Branches
18 Contributors
Updated on Jan 27, 2025
Minified
Minified + Gzipped
Latest Version
1.1.16
Package Id
editorjs-drag-drop@1.1.16
Unpacked Size
37.25 kB
Size
14.22 kB
File Count
16
NPM Version
10.8.2
Node Version
20.17.0
Published on
Sep 13, 2024
Cumulative downloads
Total Downloads
Last Day
35.6%
568
Compared to previous day
Last Week
46.8%
33,509
Compared to previous week
Last Month
83.4%
100,821
Compared to previous month
Last Year
272.9%
886,716
Compared to previous year
Drag/Drop feature for Editor.js.
Get the package
1$ npm i --save-dev editorjs-drag-drop
Include module at your application
1import DragDrop from "editorjs-drag-drop";
You can load a specific version of the package from jsDelivr CDN.
Require this script on a page with Editor.js.
1<script src="https://cdn.jsdelivr.net/npm/editorjs-drag-drop"></script>
Add the plugin to the onReady property of the Editor.js configuration to initialize it:
1const editor = new EditorJS({ 2 onReady: () => { 3 new DragDrop(editor); 4 }, 5});
You can customize the indicator border style by passing a second parameter to the plugin constructor:
1const editor = new EditorJS({ 2 onReady: () => { 3 new DragDrop(editor, "2px solid #fff"); 4 }, 5});
If no parameter is provided, the default border style 1px dashed #aaa
is used.
Select the block, drag the toolbar settings button, and drop it at the desired position.
If you're already using editorjs-undo, your code might look like this:
1const editor = new EditorJS({ 2 onReady: () => { 3 new Undo({ editor }); 4 new DragDrop(editor); 5 }, 6});
If you are using React, you could create a function to handle the onReady property, the function will store the DragDrop instance. Then, you must call the function in onReady in the editorJS instance.
1const handleReady = (editor) => { 2 new DragDrop(editor); 3}; 4 5class ReactEditor extends Component { 6 render() { 7 return ( 8 <EditorJs 9 onReady = { handleReady } 10 tools = { ... } 11 /> 12 ) 13 } 14}
Note: If you are also using editorjs-undo your handleReady function must have the editorjs-undo instance as well.
1const handleReady = (editor) => { 2 new Undo({ editor }); 3 new DragDrop(editor); 4};
If you are using react-editor-js, you should use the 'onInitialize' prop in the ReactEditorJS component to obtain the abstract editorjs as follow:
1........ 2export const ReactEditor = () => { 3 const editorCore = React.useRef(null) 4 5 const handleInitialize = React.useCallback((instance) => { 6 editorCore.current = instance 7 }, []) 8 9 const handleReady = () => { 10 const editor = editorCore.current._editorJS; 11 new Undo({ editor }) 12 new DragDrop(editor); 13 }; 14 15 const ReactEditorJS = createReactEditorJS() 16 return( 17 <ReactEditorJS 18 onInitialize={handleInitialize} 19 onReady = {handleReady} 20 tools={....} 21 defaultValue={....} 22 /> 23 ) 24}
Development mode
1$ yarn build:dev
Production release
1$ yarn build
dist/bundle.js
Run tests
1$ yarn test
We welcome everyone to contribute. Make sure you have read the CODE_OF_CONDUCT before.
For information on how to contribute, please refer to our CONTRIBUTING guide.
Features and bug fixes are listed in the CHANGELOG file.
This library is licensed under an MIT license. See LICENSE for details.
Made with 💙 by kommitters Open Source
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
3 different organizations found -- score normalized to 10
Details
Reason
no dangerous workflow patterns detected
Reason
update tool detected
Details
Reason
license file detected
Details
Reason
publishing workflow detected
Details
Reason
all dependencies are pinned
Details
Reason
GitHub workflow tokens follow principle of least privilege
Details
Reason
security policy file detected
Details
Reason
found 3 unreviewed changesets out of 24 -- score normalized to 8
Reason
SAST tool detected but not run on all commits
Details
Reason
badge detected: passing
Reason
14 out of 29 merged PRs checked by a CI test -- score normalized to 4
Reason
6 existing vulnerabilities detected
Details
Reason
project is not fuzzed
Details
Reason
0 commit(s) out of 30 and 0 issue activity out of 30 found in the last 90 days -- score normalized to 0
Score
Last Scanned on 2025-02-16T01:53:45Z
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More