codex-team / codex-team/editor.js

Improve integration points into CMS and admin sections

Open
#864 0 comments 9 reactions 0 assignees View on GitHub
important
Dominant language
TypeScript
Stars
31.9k
Forks
2.2k
Avg merge
1d 1h
Merged PRs (30d)
1

Description

First things first: **Thank you** for building Editor.js and releasing it to the open source community. It's a massive step forward for block editors. You picked up where SirTrevor left off a few years back and the flow of Editor.js is a huge improvement for content creators! 👍 🥇

I am in the [process of integrating Editor.js](https://github.com/mindrevolution/umbraco-editorjs) into the [Umbraco CMS](https://github.com/umbraco/Umbraco-CMS) and realized that while building blocks is quite easy, meshing the editor up with the CMS feels clumsy.

If we would have events that get triggered i.e. when a tools button is clicked or a inline tool is used, we could step in and intercept/change. Right now I couldn't find a clean way but hacked my ways with DOM manipulation, event hijacking and such. The only way to change a blocks behaviour is to replace it with your own. If there would be a few standardized events, everybody could hook into them. I.e. inline link tool clicked => open CMS menu for link selection, process result and return URL to editor. Replacing the internal (and bundled) inline tool is possible (I did it) but leads to 99.9% copy+paste code because range, surround, clear, etc. are completely the same. If Editor.js would trigger "onToolAction", "onInlineToolAction", "afterToolAction", "beforeInlineToolDataChange", "afterInlineToolDataChange" and such, everybody could step in and improve functionality.

Also, maybe a few callbacks for blocks (inline or not) would help. Like so:
"beforeUpload", "afterUpload", "beforeDataChange" or "onLinkSelect" and such. Sure, it will be hard to decide on which ones, because they should be generic but again that could be the overall solution: Provide an easy way for triggering events and implement them in the standard blocks already. Add the event triggering to the docs so developers will adopt the idea.

Right now to me it feels like each block is very self contained (a good idea) but unable to talk to "the others" if these two blocks are not build by yourself (and thus use their own event bus).

Hope this makes sense. Feel free to inquire further! 😏

Maybe I am missing something fundamentally here? Thanks for any heads up if that is the case. :smile:

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.