omnia-editor Svelte Themes

Omnia Editor

A lightweight open source block style editor built for the modern web.

omnia-editor

Usage in Svelte

npm i omnia-editor
# or
yarn add omnia-editor
<script>
import { OmniaEditor } from "omnia-editor";
</script>

<OmniaEditor />

Properties

value: string;

Initial value of the content.

editor: Editor;

TipTap instance of the Editor.

spellcheck: boolean;

Use spellcheck.

Methods

getJSON(): Object;

Get the document as JSON.

getHTML(): string;

Get the document as HTML.

getCharacterCount(): number;

Get the number of characters for the current document.

isFocused(): boolean;

Returns true when Editor is focused.

isEmpty(): boolean;

Returns true if there is no content.

blur(): boolean;

Removes focus from the editor.

focus(position): boolean;

Focus the editor at the given position.

Set the focus to the editor focus()

Set the cursor to the first position focus('start')

Set the cursor to the last position focus('end')

Selects the whole document focus('all')

Set the cursor to position 10 focus(10)

undo(): boolean;

Undo recent changes.

redo(): boolean;

Reapply reverted changes.

destroy(): void;

Destroy the editor.

Events

on:init

Triggered when the editor is initialized.

on:focus

Triggered when the editor is focused.

on:blur

Triggered when the editor looses focus.

on:change

Triggered when the editors content changes.

Contributors ✨

Thanks goes to these wonderful people (emoji key):


AntonyBoucher

💻

Torsten Dittmann

⚠️ 💻

Dennis Tobar

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

Top categories

Loading Svelte Themes