back to home

livingdocsIO / editable.js

Friendly contenteditable API

View on GitHub
248 stars
25 forks
12 issues

AI Architecture Analysis

This repository is indexed by RepoMind. By analyzing livingdocsIO/editable.js in our AI interface, you can instantly generate complete architecture diagrams, visualize control flows, and perform automated security audits across the entire codebase.

Our Agentic Context Augmented Generation (Agentic CAG) engine loads full source files into context on-demand, avoiding the fragmentation of traditional RAG systems. Ask questions about the architecture, dependencies, or specific features to see it in action.

Source files are only loaded when you start an analysis to optimize performance.

Embed this Badge

Showcase RepoMind's analysis directly in your repository's README.

[![Analyzed by RepoMind](https://img.shields.io/badge/Analyzed%20by-RepoMind-4F46E5?style=for-the-badge)](https://repomind.in/repo/livingdocsIO/editable.js)
Preview:Analyzed by RepoMind

Repository Overview (README excerpt)

Crawler view

editable.js What is it about? A JavaScript API that defines a friendly and browser-consistent content editable interface. Check out the demo. It features a formatting toolbar and the default insert, split and merge behavior that allow to add and remove content blocks like paragraphs easily. Editable is built for block level elements containing only phrasing content. This normally means , - , etc. elements. This allows editable to be lean and mean since it is only concerned with formatting and not with layouting. We made editable.js to support our vision of online document editing. Have a look at livingdocs.io. Installation Via npm: You can either or find a prebuilt file in the npm bundle . Events Overview • **focus** Fired when an editable element gets focus. • **blur** Fired when an editable element loses focus. • **selection** Fired when the user selects some text inside an editable element. • **cursor** Fired when the cursor position changes. • **change** Fired when the user has made a change. • **spellcheckUpdated** Fired when the spellcheckService has updated the spellcheck highlights. • **clipboard** Fired for , and events. • **insert** Fired when the user presses at the beginning or end of an editable (For example you can insert a new paragraph after the element if this happens). • **split** Fired when the user presses in the middle of an element. • **merge** Fired when the user pressed at the end or at the beginning of an element. • **switch** Fired when the user pressed an at the top or bottom so that you may want to set the cursor into the preceding or following element. • **newline** Fired when the user presses to insert a newline. How to use To make an element editable: Example for Selection Changes In a event you get the editable element that triggered the event as well as a selection object. Through the selection object you can get information about the selection like coordinates or the text it contains and you can manipulate the selection. In the following example we are going to show a toolbar on top of the selection whenever the user has selected something inside of an editable element. Dive Deeper We haven't got around to make this documentation comprehensive enough. In the meantime you can find the API methods in src/core.js and the default implementation in src/default-behavior.js. To find out what you can do with the the editable.js and objects see src/cursor.js and src/selection.js. Development Setup: Tasks: License editable.js is licensed under the MIT License.