Syp-Editor - VanillaJS/Typescript Wrapper & Toolbar for @tiptap
SYP-Editor is an wrapper with a toolbar for @tiptap. This project was created, as the default simple template from @tiptap needs React as dependency. Our goal was to create a very lightweight editor, therefore we have created a dynamic, yet extendable wrapper-component with a toolbar to make tiptap usable without the need of React.
In addition the wrapper takes apart the nasty setup-process of setting up the buttons and actions for tiptap and comes with ready made presets, making the setup of tiptap even easier then ever.
import { SypEditor, SypEditorLinkExtension } from '@syntaxphoenix/syp-editor';
const element = document.querySelector('#editor');
const tiptapEditor = new Editor({
element: element,
extensions: [
...
],
content: '',
});
const sypEditor = new SypEditor(
element,
tiptapEditor,
{
configuration: [
{
type: 'preset',
name: 'fontawesome5_redo_undo_group'
},
{
type: 'separator'
},
{
type: 'group',
elements: [
{
type: 'preset',
name: 'fontawesome5_heading_dropdown'
},
{
type: 'preset',
name: 'fontawesome5_list_dropdown'
},
{
type: 'button',
icon: 'code',
iconProvider: 'fontawesome5',
name: 'code block',
command: 'toggleCodeBlock'
},
{
type: 'button',
icon: 'quote-right',
iconProvider: 'fontawesome5',
name: 'blockquote',
command: 'toggleBlockquote'
},
{
type: 'preset',
name: 'fontawesome5_link'
}
]
},
{
type: 'separator'
},
{
type: 'preset',
name: 'fontawesome5_textalign_group'
},
{
type: 'separator'
},
{
type: 'preset',
name: 'fontawesome5_fontstyle_group'
}
],
settings: {
presetsEnabled: true
},
elementExtensions: [
new SypEditorLinkExtension()
]
}
);This example creates a instance like shown in this picture:
A more detailed guide on the setup of SypEditor can be found here.
npm install @syntaxphoenix/syp-editorMore about the installation can be found here.
See the open issues for a list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.
@SyntaxPhoenix - [email protected]
Project Link: https://github.com/SyntaxPhoenix/syp-editor
