Skip to content

An vanillajs wrapper-extension with toolbar for ueberdosis/tiptap to make creation of a tiptap editor way easier

License

Notifications You must be signed in to change notification settings

SyntaxPhoenix/syp-editor

Repository files navigation

Contributors Stargazers Issues GPLv3 License


Logo

Syp-Editor - VanillaJS/Typescript Wrapper & Toolbar for @tiptap

Table of Contents

  1. About The Project
  2. Usage
  3. Full documentation
  4. Roadmap
  5. Contributing
  6. License
  7. Contact

About The Project

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.

Built With

Usage

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: Example of syp-editor in action

A more detailed guide on the setup of SypEditor can be found here.

Installation

npm install @syntaxphoenix/syp-editor

More about the installation can be found here.

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

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.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

@SyntaxPhoenix - support@syntaxphoenix.com

Project Link: https://github.com/SyntaxPhoenix/syp-editor

About

An vanillajs wrapper-extension with toolbar for ueberdosis/tiptap to make creation of a tiptap editor way easier

Resources

License

Stars

Watchers

Forks

Packages

No packages published