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

@techrox/page-studio-form

v1.0.0

Published

Schema-driven structured-form page editor for React. Typed fields per page key, repeaters, TipTap rich text, live preview, revision history. Companion to @techrox/page-studio for content-shaped pages where layout is fixed.

Readme

@techrox/page-studio-form

Schema-driven structured-form page editor for admin CMS UIs. Companion to @techrox/page-studio (the Puck visual builder). Both packages edit the same page record; they differ in surface area:

  • page-studio — drag-and-drop visual builder, for marketing pages where block layout matters.
  • page-studio-form — typed fields per page key (hero, summary, deliverables, pricing rows…), for content-shaped pages where layout is fixed and only the copy changes.

What you get

  • <PageStudioForm /> — full admin shell: title, publish toggle, tabbed content / SEO / preview / history panes.
  • <RichText /> — Notion-style WYSIWYG with toolbar, bubble menu, table editing, callouts, columns, image upload.
  • <HistoryPanel /> — revision viewer with side-by-side diff + one-click restore.

Install

npm i @techrox/page-studio-form antd @ant-design/icons \
      @tiptap/react @tiptap/starter-kit @tiptap/extension-underline \
      @tiptap/extension-link @tiptap/extension-placeholder \
      @tiptap/extension-text-align @tiptap/extension-text-style \
      @tiptap/extension-color @tiptap/extension-highlight \
      @tiptap/extension-table @tiptap/extension-table-row \
      @tiptap/extension-task-list @tiptap/extension-task-item \
      @tiptap/extension-character-count @tiptap/extension-typography \
      @dnd-kit/core @dnd-kit/sortable @dnd-kit/utilities \
      diff dayjs

Then import the styles once at the app root:

import '@techrox/page-studio-form/styles.css';

Usage

import { PageStudioForm } from '@techrox/page-studio-form';
import NextLink from 'next/link';
import { useRouter } from 'next/navigation';

import {
  savePage,
  deletePage,
  listRevisions,
  restoreRevision,
  uploadMedia,
} from '@/lib/admin-api';
import { getSchema, getContentDefaults } from '@/lib/page-schemas';

export default function EditorPage({ pageKey, initialPage }) {
  const router = useRouter();
  return (
    <PageStudioForm
      pageKey={pageKey}
      initialPage={initialPage}
      schema={getSchema(pageKey)}
      contentDefaults={getContentDefaults(pageKey)}
      livePath={`/pages/${pageKey}`}
      homeHref="/admin/pages"
      LinkComponent={NextLink}
      adapter={{
        savePage:        (key, payload) => savePage(key, payload),
        deletePage:      (key) => deletePage(key),
        loadHistory:     (key) => listRevisions(key),
        restoreRevision: (key, revId) => restoreRevision(key, revId),
        uploadMedia:     (formData) => uploadMedia(formData),
      }}
      onSaved={() => router.refresh()}
      onDeleted={() => router.replace('/admin/pages')}
      onRestored={() => router.refresh()}
    />
  );
}

Adapter contract

| Method | Signature | When called | |---|---|---| | savePage | (key, payload) => Promise<{ page }> | User clicks Save. payload has { title, seo, content, published }. | | deletePage | (key) => Promise<void> | User confirms "Remove override". | | loadHistory | (key) => Promise<{ revisions }> | History tab mounts or user clicks Reload. | | restoreRevision | (key, revisionId) => Promise<void> | User confirms Restore on a revision. | | uploadMedia | (FormData) => Promise<{ url }> | RichText image upload / paste / drop. |

All adapter methods may throw; errors surface to the user via the AntD message API. The package never reads cookies, talks to a router, or performs side effects beyond rendering. Wiring those is the host's job (via onSaved / onDeleted / onRestored).

Schema shape

The schema prop is a flat array of { title, help?, fields[] } sections. Each field is one of:

| type | Renders | Notes | |---|---|---| | text | <Input> | Single line | | textarea / html-text | <TextArea> | Multiline plain text | | richtext | <RichText> | TipTap WYSIWYG; emits HTML | | list | <TextArea> → string[] | One entry per line | | list-csv | <Input> → string[] | Comma-separated | | repeater | <Form.List> | Drag-sortable; itemFields[] recurses |

The host owns the schema registry — typically a getSchema(pageKey) map keyed by page identifier.

Branding

The form inherits the --tps-* CSS variables from the host. Override on :root (or any parent) to retheme without touching package internals:

:root {
  --tps-primary: #6366F1;
  --tps-accent:  #EC4899;
  --tps-bg-soft: #F1F5F9;
}

Standalone components

<RichText /> and <HistoryPanel /> are exported separately if you only need one piece:

import { RichText, HistoryPanel } from '@techrox/page-studio-form';

<RichText value={html} onChange={setHtml} uploadMedia={uploadFn} />

Companion packages