Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

editorjs-drag-drop

Package Overview
Dependencies
Maintainers
2
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

editorjs-drag-drop - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

4

CHANGELOG.md
# Changelog
## 1.0.2 (18.01.2022)
* Added react-editor-js support
## 1.0.1 (10.12.2021)

@@ -4,0 +8,0 @@

2

package.json
{
"name": "editorjs-drag-drop",
"version": "1.0.1",
"version": "1.0.2",
"keywords": [

@@ -5,0 +5,0 @@ "drag",

@@ -47,5 +47,5 @@ ![](https://badgen.net/badge/Editor.js/v2.0/blue)

```
### Usage with [react-editor-js](https://github.com/Jungwoo-An/react-editor-js).
### Usage with React.
If you are using [react-editor-js](https://github.com/Jungwoo-An/react-editor-js), 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.
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.

@@ -77,3 +77,33 @@ ```javascript

```
### Usage with [react-editor-js](https://github.com/Jungwoo-An/react-editor-js).
If you are using [react-editor-js](https://github.com/Jungwoo-An/react-editor-js), you should use the 'onInitialize' prop in the ReactEditorJS component to obtain the abstract editorjs as follow:
```javascript
........
export const ReactEditor = () => {
const editorCore = React.useRef(null)
const handleInitialize = React.useCallback((instance) => {
editorCore.current = instance
}, [])
const handleReady = () => {
const editor = editorCore.current._editorJS;
new Undo({ editor })
new DragDrop(editor);
};
const ReactEditorJS = createReactEditorJS()
return(
<ReactEditorJS
onInitialize={handleInitialize}
onReady = {handleReady}
tools={....}
defaultValue={....}
/>
)
}
```
## Development

@@ -80,0 +110,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc