0.6.1 • Published 1 year ago

@kinzie/ash-editor v0.6.1

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

AshEditor

A wrapper around ProseMirror to be used as a WYSIWYG editor.

Usage

import { AshEditor } from "@kinzie/ash-editor/src";
import { ToolbarPlugin } from "@kinzie/ash-editor/src/plugins";

import "@kinzie/ash-editor/src/css/style.css";
import "@kinzie/ash-editor/src/plugins/toolbar/style/menu.css";

function createEditor(element: HTMLElement, content?: HTMLElement) {
  let editor = new AshEditor(element, {
    content: content,
    plugins: [
      ToolbarPlugin.setup({
        layout: [
          ["headings"],
          ["bold", "italic", "color", "link"],
          ["undo", "redo"],
          ["image_figure"],
          [
            "horizontal_rule",
            "bullet_list",
            "ordered_list",
            "blockquote",
            "join_up",
            "lift",
            "select_parent_npde",
          ],
        ],
      }),
    ],
  });
}