0.19.0 • Published 2 years ago
kangxi-editor v0.19.0
kangxi-editor
Another web-based rich text editor.
Demo
Installation
npm add kangxi-editor
Usage
Example
- Clone or download this repo
- Build the project
npm i && npm run r build
- Run the example in browser
npm run r serve
API
class Editor {
// The underlying ProseMirror editor view.
view: EditorView;
// The underlying ProseMirror document schema.
schema: Schema;
// The underlying ProseMirror plugin array mounted.
plugins: Plugin[];
// The HTML element where editor is mounted.
rootElement: HTMLElement;
// The HTML element where editor toolbar is mounted.
toolbarElement: HTMLElement;
// The HTML element where editor content area is mounted.
contentElement: HTMLElement;
// Fires when editor content changes.
contentChanged?: (sender: Editor) => void;
// Creates a new editor.
// * `src`: HTML element or a query selector to mount the editor.
// * `opt`: Options [see details below].
constructor(src: string | HTMLElement, opt?: Options): Editor;
// Gets the inner HTML of the editor.
contentHTML(): string;
// Gets the text content of the editor.
contentText(): string;
// Sets the inner HTML of the editor.
// Unlike `resetContentHTML`, this can be reverted by undo.
setContentHTML(html: string);
// Resets the inner HTML of the editor.
// Unlike `setContentHTML`, this clears undo history.
resetContentHTML(html: string);
}
// Options
interface Options {
// Initial content HTML upon creation.
contentHTML?: string;
// Localized strings. See `./dist/lang.d.ts` for definition.
lang?: Lang;
}
CSS Variables
--kx-back-color
--kx-fore-color
--kx-toolbar-separator-color
0.19.0
2 years ago
0.18.1
2 years ago
0.18.2
2 years ago
0.18.3
2 years ago
0.16.0
2 years ago
0.17.0
2 years ago
0.18.0
2 years ago
0.15.0
3 years ago
0.14.2
4 years ago
0.14.0
4 years ago
0.14.1
4 years ago
0.13.1
4 years ago
0.13.2
4 years ago
0.12.0
4 years ago
0.13.0
4 years ago
0.11.0
4 years ago
0.10.3
4 years ago
0.10.1
4 years ago
0.10.2
4 years ago
0.10.0
4 years ago
0.8.0
4 years ago
0.7.1
5 years ago
0.7.0
5 years ago
0.6.0
5 years ago
0.5.0
5 years ago
0.4.0
5 years ago
0.3.2
5 years ago
0.3.1
6 years ago
0.3.0
6 years ago
0.2.0
6 years ago
0.1.0
6 years ago
0.0.9
6 years ago
0.0.8
6 years ago
0.0.7
6 years ago
0.0.6
6 years ago
0.0.5
6 years ago
0.0.4
6 years ago
0.0.3
6 years ago
0.0.2
6 years ago
0.0.1
6 years ago