advoor / nova-editor-js

Editor JS field for Laravel Nova
92 stars 54 forks source link

how to add new tools? #19

Closed rik43 closed 4 years ago

rik43 commented 5 years ago

is it possible?

nilsE commented 5 years ago

would like to do that, too

advoor commented 5 years ago

@rik43 @nilsE , have a look at: https://github.com/advoor/nova-editor-js/commit/bbbdd69ce3dacaec10a70ec8f380a82e24ee31a5

Basic steps are really, add the new tool to the package.json, and then add the relevant config in FormField.vue.

The output of the tool should then be handled in 'src/NovaEditorJs.php'. The above commit is a perfect example.

What tool are you looking to implement? I can potentially look at integrating some more tools

roelofr commented 5 years ago

Basic steps are really, add the new tool to the package.json, and then add the relevant config in FormField.vue.

Sadly this stops users from being able to fluently update their dependencies and add support for new fields. It would be awesome if some kind of hook-form could be worked out (maybe make the EditorJs macroable?)

I'll try to puzzle something together next week, because I too want to add a bunch of in-house tools.

advoor commented 5 years ago

@roelofr If you can, it would be awesome! I've not had any time at all recently to work on this, so any help is greatly appreciated!

roelofr commented 4 years ago

For now I figured out a possible way to solve this, but I'm absolutely not sure about this method, since it requires Javascript that changes stuff on the window.

However, as Nova doesn't re-compiles assets, I'm very afraid it's the only plausible method to use... Look into #33 for more information, and please discuss the fix there.

TheDeadCode commented 4 years ago

See #41