0.1.1 • Published 5 months ago

blocknote-draw v0.1.1

Weekly downloads
-
License
ISC
Repository
github
Last release
5 months ago

Drawing Canvas for Blocknote

Stability Badge npm.io

Code block for Blocknote.

npm.io

Installation

Install via YARN

Get the package

$ yarn add blocknote-draw

Usage

Include module at your application

import { Draw, insertDraw } from "blocknote-draw";

Create schema with code block.

const schema = BlockNoteSchema.create({
  blockSpecs: {
    ...defaultBlockSpecs,
    draw: Draw,
  },
});

Add slash menu item.

<BlockNoteView editor={editor} slashMenu={false}>
  <SuggestionMenuController
    triggerCharacter={"/"}
    getItems={async (query) =>
      filterSuggestionItems(
        [...getDefaultReactSlashMenuItems(editor), insertDraw()],
        query
      )
    }
  />
</BlockNoteView>