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

@sciflow/editor-core

v0.0.3

Published

Documentation: [docs.sciflow.org](https://docs.sciflow.org)

Readme

@sciflow/editor-core

Documentation: docs.sciflow.org

SciFlow’s core editor runtime. The package bundles the ProseMirror schema for every node and mark that ships with core features (citation, figure, headings, mark-formatting, math, etc.). The schema elements are always present in the base bundle so documents remain valid even when a feature is toggled off at runtime—turning a feature back on simply re-registers its commands, plugins, or node views. This also guarantees that core transformations to XML and other formats remain operational.

Note: External or custom features do not have that guarantee. If an extension introduces new node/mark types or otherwise alters the schema, documents containing those nodes will only load correctly when the corresponding feature is enabled and has registered its schema additions.

Feature system

Editor.create accepts an array of feature modules defined in packages/editor/core/src/lib/features. Each feature can register commands, provide ProseMirror plugins, and expose node views that are scoped to the editor instance that imports them. Built-in features (citations, figures, headings, mark formatting, etc.) live in this directory so they can be toggled per editor without affecting the global runtime. Custom feature packages should follow the same interface and keep their registration side effects inside initialize() to avoid leaking behavior across editors.

Building

Run nx build @sciflow/editor-core to build the library.

Math feature (equations)

The math feature renders TeX as SVG in the editor using MathJax 4. The host application must load MathJax before the editor uses math nodes:

  • Loading: Add a script tag for the MathJax 4 tex-svg component, e.g.
    <script defer src="https://cdn.jsdelivr.net/npm/mathjax@4/tex-svg.js"></script>
  • Fallback: If MathJax is not loaded, math nodes show a placeholder message and raw TeX; the document is not corrupted.
  • Errors and warnings: Invalid TeX produces an error message in the node view and in the selection sidebar when a math node is selected. MathJax errors and warnings are surfaced so users can fix equations.

Shortcuts and input rules:

  • Mod-m (Ctrl/Cmd+M): Wraps the current selection in a math node. Uses selected text as TeX; display style if the selection contains a newline, otherwise inline. With no selection, inserts an empty math node.
  • $$ + space: At the start of a block, creates an empty display math node.
  • $$...$$: Typing e.g. $$\frac{1}{2}$$ converts the content into a display math node.

Behavior: After insertion, the new math node is selected. Selected math nodes are highlighted. Empty math nodes use dashed-border styling.

Enable the feature by including mathFeature (or createMathFeature()) in the features array when creating the editor. See @sciflow/editor-core/features/math for the public API.

Citation query helpers

The citation feature exports read-only helpers for inspecting which references a document uses and validating that all external resources are present. Import them from @sciflow/editor-core (or @sciflow/editor-core/features/citation):

import { getCitedReferenceIds, validateDocumentResources } from '@sciflow/editor-core';
  • getCitedReferenceIds(doc, from?, to?) — returns unique reference IDs cited in the document. Pass optional from/to positions to restrict to a selection range (useful for highlighting references matching the current cursor).
  • validateDocumentResources(doc, files, references) — checks that every figure src and citation source in the document JSON resolves against the provided file and reference arrays. Returns an array of MissingResource objects ({ type: 'file' | 'reference', id: string }), empty when everything is valid.

Running unit tests

Run nx test @sciflow/editor-core to execute the unit tests via Vitest.