Coder Social home page Coder Social logo

torstendittmann / omnia-editor Goto Github PK

View Code? Open in Web Editor NEW
19.0 4.0 2.0 360 KB

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

Home Page: https://omnia-editor.vercel.app

License: MIT License

JavaScript 4.06% Svelte 92.77% HTML 2.84% SCSS 0.32%
omnia-editor svelte sveltejs editor wysiwyg-editor wysiwyg-html-editor html-editor

omnia-editor's Introduction

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!

omnia-editor's People

Contributors

allcontributors[bot] avatar dennistobar avatar torstendittmann avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

omnia-editor's Issues

add feature to join paragraphs

  • when the caret is at position 0 and backspace is hit, join it with the previous paragraph
  • check if the previous block is a paragraph

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.