omnia-editor
TypeScript icon, indicating that this package has built-in type declarations

1.0.0-beta.1 • Public • Published

omnia-editor

All Contributors

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!

Readme

Keywords

none

Package Sidebar

Install

npm i omnia-editor

Weekly Downloads

4

Version

1.0.0-beta.1

License

none

Unpacked Size

22.4 kB

Total Files

20

Last publish

Collaborators

  • torstendittmann