Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zedix/prose-editor-element
Prose Editor is a web component wrapping TipTap 2.
https://github.com/zedix/prose-editor-element
custom-elements lit rich-text-editor tiptap webcomponent wysiwyg-editor
Last synced: 24 days ago
JSON representation
Prose Editor is a web component wrapping TipTap 2.
- Host: GitHub
- URL: https://github.com/zedix/prose-editor-element
- Owner: zedix
- License: mit
- Created: 2023-08-28T17:05:21.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-07T21:53:54.000Z (7 months ago)
- Last Synced: 2024-10-01T02:42:00.548Z (about 1 month ago)
- Topics: custom-elements, lit, rich-text-editor, tiptap, webcomponent, wysiwyg-editor
- Language: TypeScript
- Homepage:
- Size: 1.07 MB
- Stars: 8
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Prose Editor
![version](https://img.shields.io/github/package-json/v/zedix/prose-editor-element.svg?maxAge=60) [![lit](https://img.shields.io/badge/lib-lit-blue.svg?maxAge=60)](https://github.com/lit/lit/)
Prose Editor is a web component wrapping [TipTap 2](https://www.tiptap.dev/).
![image](https://github.com/zedix/prose-editor-element/assets/27975/e1fd0d1e-38a4-4de7-9ef9-35ea3a9fa491)
## Demo
[Demo ↗](https://zedix-prose-editor-element.netlify.app)
## Installation
```
❯ yarn add @zedix/prose-editor-element
```## Usage
This above global stylesheet is needed because ProseEditor must be in the light DOM (instead of the shadow tree) until these bugs are resolved:
- [Firefox #1496769](https://bugzilla.mozilla.org/show_bug.cgi?id=1496769)
- [WebKit #163921](https://bugs.webkit.org/show_bug.cgi?id=163921)```css
@import '@zedix/prose-editor/dist/prose-editor.css';
``````html
document.addEventListener('DOMContentLoaded', function () {
document
.querySelector('zx-prose-editor')
.addEventListener('change', function (event) {
console.log('HTML', event.detail.html);
console.log('JSON', event.detail.json);
});
});```