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

@skulptor-ai/richtext

v0.1.1

Published

Universal block-tree rich-text editor + renderer for Skulptor CMS. Source-of-truth block tree with surgical DOM projection. No execCommand, no innerHTML re-sets, no cursor jumps.

Downloads

247

Readme

@skulptor-ai/richtext

Block-tree rich text editor + renderer for Skulptor CMS.

A source-of-truth block tree (Portable-Text-style JSON) with surgical DOM projection. No execCommand, no innerHTML re-sets, no cursor jumps. Same JSON document round-trips between the editor in the Skulptor admin and the renderer in your site.

Install

npm install @skulptor-ai/richtext

Peer dependencies (you already have most of these):

npm install react react-dom zod zustand

Render content on a public page

The renderer is a pure JSX walker — no event listeners, no dangerouslySetInnerHTML. Drop it on any Skulptor CMS field of type rich_text:

import { RichTextRenderer } from "@skulptor-ai/richtext/renderer";

export default function ArticlePage({ doc }: { doc: unknown }) {
  return (
    <article className="prose">
      <RichTextRenderer doc={doc} />
    </article>
  );
}

The doc value is whatever you get back from the Skulptor CMS for a rich_text field — already JSON-parsed.

Edit content (admin / builder side)

"use client";

import { useState } from "react";
import { RichTextEditor, createEmptyDoc, type BlockTree } from "@skulptor-ai/richtext";

export function ArticleEditor() {
  const [doc, setDoc] = useState<BlockTree>(() => createEmptyDoc());
  return <RichTextEditor value={doc} onChange={setDoc} />;
}

The block model

{
  "type": "doc",
  "version": 1,
  "blocks": [
    {
      "id": "…",
      "type": "heading",
      "level": 2,
      "content": [
        { "type": "text", "text": "Hello ", "marks": [{ "type": "bold" }] },
        { "type": "text", "text": "world",
          "marks": [{ "type": "link", "href": "https://example.com" }] }
      ]
    },
    { "id": "…", "type": "paragraph", "content": [{ "type": "text", "text": "..." }] }
  ]
}

Block types (13): paragraph, heading (h2/h3), image, code, list (recursive), table, callout (recursive, variants), pull_quote, faq_item, cta_insert, stats_bar, related_resources, references_list. Plus unknown_block as forward-compat fallback.

Inline nodes: text (with marks: bold | italic | code | link) and ref_marker (footnote).

Subpath exports

| Import path | What you get | When to use | |---|---|---| | @skulptor-ai/richtext/renderer | RichTextRenderer + types | Consumer pages (public site) — tiny bundle | | @skulptor-ai/richtext | Editor + renderer + state helpers + schema validation | Admin / builder / authoring UIs |

Importing /renderer keeps the editor + Zustand store out of your client bundle.

Validation helpers

import { validateDoc, safeValidateDoc, migrateDoc, isEmptyDoc } from "@skulptor-ai/richtext";

// Throws on invalid input — for trusted shapes
const doc = validateDoc(rawJson);

// Returns { ok, value } | { ok, error } — for untrusted inputs
const result = safeValidateDoc(rawJson);

// Migrates older doc versions to the current schema
const migrated = migrateDoc(doc);

Status

0.x — API may change before 1.0. Used in production at skulptor.ai and on customer sites built on the Skulptor CMS pool.

License

MIT © Solomon Technologies