svelte-editorjs icon indicating copy to clipboard operation
svelte-editorjs copied to clipboard

How to add tools?

Open xanderjakeq opened this issue 4 years ago • 8 comments

I am trying to add tools to editorjs following their docs.

i added the tools in createEditor but I get this error. image

any idea why this is happening? thanks!

xanderjakeq avatar Jul 30 '21 20:07 xanderjakeq

Hi! Do you maybe have a CodeSandbox (or a small repo) where I can see what you're trying to do?

pablo-abc avatar Jul 31 '21 14:07 pablo-abc

hello I tried doing it on codesandbox... and it works fine.

I think it's because I am using sapper for my project and it defaults to be compatible with ssr? Guess I need to figure out how to do that.

xanderjakeq avatar Aug 02 '21 16:08 xanderjakeq

I am aware editorjs fails on SSR so you need to dynamically import it on the client. But I am doing that in this package by default: https://github.com/pablo-abc/svelte-editorjs/blob/44871bb108c5979adf99824ba43ff11410444ae5/src/index.ts#L56-L57

Maybe there's something else I'm missing? I haven't used Sapper in a while. Do you have a repo I could use to check this locally?

pablo-abc avatar Aug 04 '21 15:08 pablo-abc

There is no problem with your package on its own. What I'm having trouble with is adding the "tools" that adds more options to the editor.

I will make a small repo when I try your project again! looks cool!

xanderjakeq avatar Aug 04 '21 15:08 xanderjakeq

Ah. That might be an oversight on my part eventually as well. I guess this means tool packages also require window or document. This means that I should allow for asynchronous loading of these as well within this package. When I get some free time I'll get around to checking how I could do this.

Thanks a lot for your interest!

pablo-abc avatar Aug 05 '21 01:08 pablo-abc

i would love to be able to use all of the tools out of the box.

ohbob avatar Sep 04 '21 08:09 ohbob

running into the same issue when trying to add tools...

Screenshot 2023-01-15 at 11 02 25 PM

...dunno if you are still maintaining this action, but it would be great if all the tools worked out of the box :-) At least the ones that support ESM

rchrdnsh avatar Jan 16 '23 07:01 rchrdnsh

did this get resolved ?

vexkiddy avatar May 15 '24 20:05 vexkiddy