Highlights of Neat Features #2
simplygreatwork
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
At the core of TextBase is an event-based message bus. The bus supports interruption, so the bus can also be used to override behavior. The bus is also contextual. For example, when source code is selected in the editor, copy and paste can operate specifically for plain text and not rich text. The contextual message handlers can then override default behavior.
The editor can be extended with new features and capabilities using plain HTML. Then, the life cycle of these "atoms" and "cards" is further managed using the message bus and "atom-will-enter", "atom-did-enter", "atom-will-exit", "atom-did-exit", "card-will-enter", "card-did-enter", "card-will-exit", or "card-did-exit"
When HTML is pasted from an external source, it must be sanitized for safety but also transformed to match the preferred document schema. The sanitizer treats the pasted text nodes as first class citizens. It iterates over every text node in the pasted content, walks up each parent node to build a path of nodes relevant to the document schema. Then each path is injected into a new DOM tree which becomes the pasted content.
This project does not require a build phase. All of the examples, are served directly from GitHub Pages without a build step. Hooray! You can add a build phase for deployment if you like, but it's not an obstacle to get started quickly. Just download and go.
One feature on the road map is a plain and simple technique of enforcing document permissions (schema). It will be a very simple mechanism built around the message bus: e.g. if (allow('insert-content', node, context)) And because it will be built around the message bus, it will be totally extensible and configurable.
Thanks for reading the first post in the discussions!
Beta Was this translation helpful? Give feedback.
All reactions