npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@mindfiredigital/canvas-editor

v1.3.0

Published

rich text editor by canvas/svg

Readme

Canvas Editor extends canvas-editor-plugin with table support, font size improvements, and exported DOM handlers so you can build your own toolbar UI on top of it. Thanks to the upstream authors for their work.


Table of Contents

Features

  • Canvas / SVG rendering — pixel-accurate layout, page-aware editing.
  • Tables — insert and edit tables inside the document.
  • Exported DOM handlers — drive the editor from any toolbar component (React, Vue, plain JS).
  • Improved font sizing — better readability over upstream defaults.
  • TypeScript types — full .d.ts shipped in the package.

Installation

npm install @mindfiredigital/canvas-editor
# or
yarn add @mindfiredigital/canvas-editor
# or
pnpm add @mindfiredigital/canvas-editor

Requires Node.js >= 12 for build tooling.

Quick Start

import Editor, { EditorMode, PageMode } from '@mindfiredigital/canvas-editor'

const container = document.querySelector('.canvas-editor')

const options = {
  width: 816,
  height: 1056,
  mode: EditorMode.EDIT,
  pageMode: PageMode.PAGING,
  pageNumber: { format: '{pageNo}/{pageCount}' },
  minSize: 1,
  maxSize: 72,
}

const editor = new Editor(container, [], options)

Wire DOM handlers into your own toolbar:

import { DOMEventHandlers } from '@mindfiredigital/canvas-editor'

<ButtonWrapper title="bold"      handleClick={DOMEventHandlers.handleBold}><FormatBoldIcon /></ButtonWrapper>
<ButtonWrapper title="italic"    handleClick={DOMEventHandlers.handleItalic}><FormatItalicIcon /></ButtonWrapper>
<ButtonWrapper title="underline" handleClick={DOMEventHandlers.handleUnderline}><FormatUnderlinedIcon /></ButtonWrapper>

API

Exports

Named exports from @mindfiredigital/canvas-editor:

| Symbol | Kind | Purpose | |---|---|---| | Editor (default) | class | Main editor constructor | | DOMEventHandlers | object | Toolbar action handlers (see below) | | EditorMode | enum | EDIT / READONLY / FORM / etc. | | PageMode | enum | PAGING / CONTINUITY | | ElementType | enum | Element kinds (TEXT, IMAGE, TABLE, …) | | ControlType | enum | Form control types | | RowFlex / VerticalAlign | enum | Alignment | | ListType / ListStyle | enum | List variants | | BlockType, TitleLevel, NumberType | enum | Block-level formatting | | ImageDisplay, WordBreak, TableBorder | enum | Visual options | | PaperDirection, MaxHeightRatio | enum | Page setup | | Command, KeyMap | enum | Commands & shortcuts | | EditorZone, EditorComponent, EDITOR_COMPONENT | enum/const | Zone identifiers |

Type-only exports: IElement, IEditorData, IEditorOption, IEditorResult, IContextMenuContext, IRegisterContextMenu, IWatermark, INavigateInfo, IBlock, ILang, ICatalog, ICatalogItem, IRangeStyle.

DOM Handlers

All exposed through DOMEventHandlers.*.

| Handler | Description | |---|---| | handleUndo | Undo previous action | | handleRedo | Redo previously undone action | | handleBold | Toggle bold on selection | | handleItalic | Toggle italic on selection | | handleUnderline | Toggle underline on selection | | handleStrikeout | Toggle strikeout on selection | | handleSuperscript | Toggle superscript on selection | | handleSubscript | Toggle subscript on selection | | handleFontFamily | Change font family on selection | | handleAlign | Align left / center / right / justify | | handleList | Create bulleted or numbered list | | setFontColor | Set font color on selection | | highlightText | Toggle highlight on selection | | setFont | Set font of selection | | setSize | Set font size of selection | | increaseFontSize | Increment font size | | decreaseFontSize | Decrement font size | | getContent | Read editor content | | setContent | Replace editor content | | createTable | Insert a table | | setTitle | Set document title | | getContentStyles | Read computed content styles | | setImage | Insert an image | | createHyperLink | Insert a hyperlink | | setHorizontalLine | Insert a horizontal line | | setPaperMargins | Set paper margins | | getSelectedText | Read selected text | | insertElement | Insert a custom element |

Documentation

Full guides, references, and contribution docs live in the Canvas Editor docs site.

Contributing

Pull requests and issues are welcome. See the contributing guide and code of conduct before opening a PR.

Local development:

git clone https://github.com/mindfiredigital/canvas-editor.git
cd canvas-editor
npm install
npm run dev          # launch demo app
npm run lib          # build library bundle
npm run cypress:open # run e2e tests

License

MIT © Mindfire Digital LLP.