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

@sutrata/editor

v0.2.0

Published

React + ProseMirror screenplay editor for Sutra, with first-class support for Indic and other complex scripts.

Readme

@sutrata/editor

The React screenplay editor behind Sutrata, for writing scripts in Sutra, a plain-text screenplay format for world languages. It's built on ProseMirror and handles Indic and other complex scripts properly:

  • Text is stored in logical order.
  • The cursor and selection move by grapheme cluster (user-perceived character).
  • Find/replace matches after NFC normalization, so differently encoded forms of the same text still match.

This package contains the complete editor:

  • WYSIWYG and source modes, with smart Enter that cycles through screenplay elements.
  • A scene navigator, find/replace, a title-page form and screenplay styles.
  • Statistics, autocomplete and spellcheck.
  • Export to PDF, DOCX, Fountain and workflow reports, including romanized exports.
  • Localized UI.

Sutra parsing and serialization come from @sutrata/parser.

Install

npm install @sutrata/editor react react-dom

react and react-dom (^18.3) are peer dependencies.

Usage

The editor doesn't read or write files itself. You pass it a StorageAdapter, and it saves, opens and keeps version history through that adapter. The same editor can therefore run on local files, in a desktop shell or against a server.

import React from 'react'
import { createRoot } from 'react-dom/client'
import {
  TranslationProvider,
  LanguageProvider,
  DocumentProvider,
  AppShell,
  type StorageAdapter,
} from '@sutrata/editor'
import '@sutrata/editor/dist/shell/fonts/fonts.css'
import '@sutrata/editor/dist/styles/screenplay.css'

const storageAdapter: StorageAdapter = {
  // documents and version history
  saveDocument: async (path, content) => { /* ... */ },
  loadDocument: async (path) => null,
  listVersions: async (path) => [],
  // file dialogs
  openFile: async () => null,        // { name, content, handle }
  openDocx: async () => null,        // { name, buffer }
  openStyleJson: async () => null,   // { name, text }
  saveFile: async (name, content, handle) => null, // { savedName, handle }
  // custom screenplay styles
  saveStyle: async (style) => {},
  loadAllStyles: async () => [],
  deleteStyle: async (id) => {},
}

createRoot(document.getElementById('root')!).render(
  <TranslationProvider>
    <LanguageProvider>
      <DocumentProvider storageAdapter={storageAdapter}>
        <AppShell />
      </DocumentProvider>
    </LanguageProvider>
  </TranslationProvider>,
)

StorageAdapter also has optional methods: saveVersion, deleteAllVersions, persistFileHandle and restoreFileHandle. For a complete implementation built on IndexedDB and the File System Access API, see local-storage-adapter.ts in the Sutrata app.

Inside the providers, useDocument() gives you the current Sutra text, its parsed AST and the editor state.

Fonts

fonts.css declares Noto font faces for every supported script, loaded from /fonts/*.woff2 on your own site. This package does not include the font files. Copy them from packages/app/public/fonts into your app's /fonts/ path, or use your own @font-face rules. Without them, some scripts may display as missing-glyph boxes (tofu).

Extension points

Beyond StorageAdapter, the package exports type definitions for more extension points: AIProvider, SpeechProvider, SessionContext, PanelRegistry, CommandRegistry, ExportRegistry, CollabBinding and DecorationProvider. These are type-only previews and are not wired into the editor yet. Their shapes may change before 1.0.

Status

Pre-1.0. The API may change between minor versions.

License

GPL-3.0-or-later.