In our app we have lot's of "Enrichments". They can have several different types (eg. image, audio, ...). Because of legacy reasons we cannot simply render a <img> or <audio> tag.
Nevertheless, I was able to register and add custom tools (with React support) for each enrichment type. _BUT_ when one moves them with CMD+X and CMD+P they are added as a simple paragraph _or_ when the block is detected without data.
FTR:
pasteConfig is correct, as I render a div with some other elements inside. Not sure what's the correct pattern/tag then.onPaste receives existing data from the pasted block as well.I can copy and paste existing blocks with all it's data within the Editor container.
An example codesandbox can be found here: https://codesandbox.io/s/epic-feynman-myinj.

"react": "16.11.0""@editorjs/editorjs": "2.15.1"i am getting a number in the text object of theresult , if i copy and paste text it puts numbers as shown below :
{
"time" : 1574519623180,
"blocks" : [
{
"type" : "paragraph",
"data" : {
"text" : "2"
}
},
{
"type" : "paragraph",
"data" : {
"text" : "2"
}
}
],
"version" : "2.15.1"
}
We can add special formatting to the copied text that will allow us to determine block types on pasting. But in this case, copying/pasting to the other regular text documents will contain unwanted extra symbols.
We will research this case and find a solution. Maybe this can be done by modifying the DataTransfer object by adding our own mime-type. Or we can provide options on how you want to copy selected fragment: as simple text or as Editorjs format.
Hi @neSpecc, thanks for the feedback. If I came up with an idea, I'll let you know.
Resolved by #1060
Released in 2.17.0
Awesome, so far I can confirm it works. Thank you @neSpecc.
Most helpful comment
Awesome, so far I can confirm it works. Thank you @neSpecc.