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

@ashu000/prosemirror-track-editor

v0.1.5

Published

A headless-first React editor with track-changes (insertion/deletion marks), phrase navigation, and a clean ref API.

Readme

prosemirror-track-editor

npm npm bundle size license demo

A headless-first React editor with track-changes (insertion/deletion marks), phrase navigation, and a clean ref API.

Install

npm i @ashu000/prosemirror-track-editor
# peer deps
npm i react react-dom prosemirror-state prosemirror-view prosemirror-model \
      prosemirror-schema-basic prosemirror-history prosemirror-keymap prosemirror-commands

Quick start

import { useRef } from 'react';
import { TrackEditor, TrackEditorRef } from '@ashu000/prosemirror-track-editor';

export function MyEditor() {
  const editorRef = useRef<TrackEditorRef>(null);

  return (
    <TrackEditor
      ref={editorRef}
      initialText="The applicant shall furnish a document..."
      onContentChange={(changed) => console.log('dirty:', changed)}
    />
  );
}

useTrackEditor hook

If you prefer a hook-driven API over a ref:

import { useTrackEditor, TrackEditor } from '@ashu000/prosemirror-track-editor';

export function MyEditor() {
  const { ref, getText, getChangesWithOffsets, setText } = useTrackEditor();

  const handleProcess = async () => {
    const res = await fetch('/process', {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({ text: getText() }),
    });
    const { html } = await res.json();
    setText(html);
  };

  return <TrackEditor ref={ref} initialText="Original clause text..." />;
}

Development

# install deps
npm install

# run demo app + backend together
npm run dev

# build the package
npm run build

# run tests
npm test
  • Live demo: https://prosemirror-track-editor.vercel.app
  • Local demo: http://localhost:5173
  • Local API: http://localhost:3001

Theming

Override editor colors via CSS variables on any parent element:

<div style={{
  '--te-border-focus': '#00c9a7',
  '--te-ins-color': '#4d9fff',
  '--te-del-color': '#ff6070',
} as React.CSSProperties}>
  <TrackEditor ref={ref} />
</div>

Import themeVars for autocomplete on all variable names:

import { themeVars } from '@ashu000/prosemirror-track-editor';
// themeVars.borderFocus === '--te-border-focus'

| Variable | Default | Purpose | |---|---|---| | --te-border | #e5e7eb | Editor border | | --te-border-focus | #3b82f6 | Focused border | | --te-focus-ring | rgba(59,130,246,0.1) | Focus ring shadow | | --te-bg | #ffffff | Editor background | | --te-font-family | Calibri, sans-serif | Editor font | | --te-font-size | 0.975rem | Editor font size | | --te-line-height | 1.5 | Editor line height | | --te-ins-color | #2563eb | Insertion text color | | --te-del-color | #b91c1c | Deletion text (strikethrough) | | --te-blank-bg | #fbbf24 | Blank highlight background | | --te-blank-color | #92400e | Blank highlight text | | --te-phrase-bg | rgba(74,222,128,0.4) | Phrase highlight background | | --te-phrase-border | rgb(34,197,94) | Phrase highlight border | | --te-phrase-shadow | rgba(34,197,94,0.2) | Phrase highlight box-shadow |

Browser support

| Browser | Minimum version | |---|---| | Chrome / Edge | 88+ | | Firefox | 85+ | | Safari | 14+ |

Requires a runtime that supports ResizeObserver and MutationObserver (all modern browsers).

Full API

See SPEC.md for the complete props, ref API, theming variables, backend contract, and internals documentation.