@elegant-editor/core
v0.0.1
Published
Framework-agnostic rich text editor core based on TipTap
Downloads
8
Maintainers
Readme
@frame-flex/core
Framework-agnostic rich text editor core based on TipTap.
Features
- ✅ Framework-agnostic (works with any JS framework)
- ✅ Extensible architecture
- ✅ Resource registry system
- ✅ TypeScript support
- ✅ Multiple export formats
- ✅ Math equations support (KaTeX)
- ✅ Code highlighting support
- ✅ Template system
- ✅ Media embedding (images, audio, video)
Installation
npm install @frame-flex/core @tiptap/core @tiptap/pm @tiptap/starter-kitQuick Start
import { Editor } from '@frame-flex/core';
import '@frame-flex/core/styles';
const editor = new Editor(document.getElementById('editor'), {
content: '<p>Hello World</p>',
editable: true,
onUpdate: (content) => {
console.log('Content updated:', content);
},
});API
Constructor
new Editor(element: HTMLElement, options: EditorOptions)Methods
getHTML(): string- Get editor content as HTMLgetJSON(): JSONContent- Get editor content as JSONsetContent(content: string | JSONContent): void- Set editor contentdestroy(): void- Destroy the editor instance
License
MIT © 柒林
