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

@quickbuilder.io/rich-text-editor-pro

v1.0.0

Published

Quick Builder Pro rich text editing, multi-page documents, and provider-backed collaboration and AI

Readme

@quickbuilder.io/rich-text-editor-pro

Pro editing and multi-page document tools built on the Quick Builder rich text engine.

Install and render

npm install @quickbuilder.io/rich-text-editor-pro @quickbuilder.io/design-system

Use Node.js 22 or 24 with React and React DOM 19.3.x. Import the Design System stylesheet once at your app entry.

import { RichTextEditorPro } from '@quickbuilder.io/rich-text-editor-pro/react';
import { QuickBuilderDesignSystemProvider } from '@quickbuilder.io/design-system/react';
import '@quickbuilder.io/design-system/styles.css';

export function ProjectNotes() {
  return (
    <QuickBuilderDesignSystemProvider theme="default" styleStrategy="external">
      <RichTextEditorPro
        ariaLabel="Project notes"
        defaultValue="<p>Record project decisions here.</p>"
        proExtensions={['tables']}
      />
    </QuickBuilderDesignSystemProvider>
  );
}

Architecture

This package separates behavior from presentation through three public entry points:

| Entry point | Responsibility | | --- | --- | | @quickbuilder.io/rich-text-editor-pro | Framework-neutral documents, extension registry, capabilities, and provider contracts | | @quickbuilder.io/rich-text-editor-pro/headless | React controllers, contexts, providers, render props, commands, and accessibility metadata; no design-system or icon imports | | @quickbuilder.io/rich-text-editor-pro/react | Quick Builder styled editors built on those same controllers, plus headless exports |

Both published module formats and their declarations expose the same API. The dependency direction is runtime → renderless controllers → styled surfaces. There is one community editing engine per mounted editor. Menus, provider lifecycle, presence, page changes, headers/footers, and view state share the same implementation in styled and custom compositions.

The current Pro implementation provides the wrapper surface, package manifest, capability registry, extension resolution contract, governed multi-page documents, table editing controls, slash commands, mentions, collaboration presence, and AI assistant provider hooks. It resolves requested modules through @quickbuilder.io/rich-text so extension schema, command metadata, and command execution stay headless.

RichTextDocumentEditor owns the document-authoring capability used by the Document stories. Its versioned controlled/uncontrolled value contains stable page IDs, sanitized per-page HTML, A3/A4/A5/Letter/Legal/Tabloid page settings, portrait/landscape orientation, four-sided margins, page gap, page background, and rich header/footer templates. One scrollable page stack keeps the active editor and inactive pages on the same paper-frame contract. First-page and odd/even variants are deterministic, {page} and {total} fields resolve in every rendered page, and users can navigate, split at the caret with a manual page break, remove pages, and edit page settings, headers, and footers through the same governed runtime. Zoom is bounded per-client view state and never emits a document-content change. Invalid ownership, duplicate IDs, unsupported formats, out-of-range settings, and oversized content fail explicitly.

When proExtensions={['tables']} is enabled, the Pro editor adds an accessible Table actions menu for insert/delete table, row insertion/deletion, and column insertion/deletion. Actions are enabled only when their selection context is valid. The community editor remains unchanged.

When proExtensions={['slash-commands']} is enabled, typing / opens a caret-positioned, grouped command palette for headings, paragraph, quote, lists, code block, separators, and table insertion. The live query is visible, keyboard navigation remains in the editor, and table insertion is not advertised unless the table extension is enabled. Selecting a command removes the slash query, applies the command through the headless runtime, and emits the normal sanitized editor change event.

When proExtensions={['mentions']} is enabled, typing @ opens a caret-positioned mention palette sourced from the typed mentions prop. onMentionQueryChange and mentionsLoading support asynchronous directory providers; refreshed results appear without another keystroke. Mention IDs are validated and deduplicated before rendering.

When collaboration is provided, the Pro editor resolves the registered collaboration presence extension, renders validated remote presences from collaborationPresence, and emits deduplicated local presence for document changes and selection changes. This is an integration surface, not a CRDT engine: realtime transport, offline recovery, cursor transport, and document conflict resolution remain explicit application/provider concerns; controlled value is the document synchronization boundary.

When aiAssistant={{ enabled: true }} is provided, onAiAssistantRequest is required. The accessible AI assistant menu emits sanitized provider requests with an AbortSignal, prevents duplicate in-flight requests, cancels work when the editor becomes unavailable or unmounts, exposes localized loading and error states, and reports non-cancellation provider failures through onAiAssistantError. In the Notion composition the same provider action is available as a labeled selection-toolbar action and grouped slash command, while the compact persistent trigger remains available for document-wide requests. The composition inherits owned insertion, drag-reordering, keyboard movement, duplication, and deletion controls for top-level blocks. Its add-block control creates and focuses the next sibling and immediately opens the same keyboard-accessible block-command palette used by typed slash queries. Applying generated content is explicit through aiAssistantSuggestion plus aiAssistantApplyMode; the editor sanitizes the suggestion before committing it.

The agent presentation connects the generic @quickbuilder.io/chat/react ChatBox to a document-specific ChatAdapter. Rich Text Editor Pro owns the header, required document context, close action, and design-system theme boundary. The responsive floating panel preserves the document width while Quick Builder Transition owns interruptible entrance, exit, and reduced-motion behavior. It fails fast unless agent.enabled, an explicit light/dark agent.panelSkin, a stable non-empty agent.providerId, and onAgentRequest are supplied. Requests contain the sanitized HTML document, plain text, current text selection, prompt, and provider routing ID, plus a cancellation signal in the request context. Providers must return a user-facing message and durable requestId; empty or malformed responses fail explicitly. Stopping a request or closing the panel aborts its signal and releases the composer even if the backend has not settled. The component never contains model credentials and never falls back to a local or browser model. The controlled document owner remains responsible for reviewing and applying backend results.

All Pro UI uses public Quick Builder design-system primitives, design tokens, owned motion, and the owned icon catalog. proTexts localizes Pro actions and states. Menus implement keyboard navigation, focus behavior, popup semantics, outside-click dismissal, bounded results, and collision-aware horizontal positioning without legacy controls or text-glyph icon fallbacks.

The host application owns provider authentication, authorization, rate limits, AI policy and audit logging, persistence, realtime transport/CRDT resolution, comments, tracked changes, document snapshots, automatic content reflow, DOCX/PDF conversion and fidelity, print generation, and server-side sanitization. Those are explicit platform integrations rather than hidden component fallbacks.

Exports

Framework-neutral root:

  • resolveRichTextEditorProExtensions
  • resolveRichTextEditorProExtensionDefinitions
  • richTextEditorProCapabilityFeatures
  • richTextEditorProPackageManifest
  • normalizeRichTextDocument
  • resolveRichTextDocumentChromeHtml
  • resolveRichTextDocumentChromeSlot
  • resolveRichTextDocumentPageSize
  • versioned document, page, header/footer, settings, and transaction types

React adapter (@quickbuilder.io/rich-text-editor-pro/react):

  • RichTextEditorPro
  • RichTextEditorProUI (owned presentation for an existing Pro provider)
  • RichTextDocumentEditor
  • React-specific Pro props

Connect the headless provider to the owned UI

import { RichTextEditorProProvider } from '@quickbuilder.io/rich-text-editor-pro/headless';
import { RichTextEditorProUI } from '@quickbuilder.io/rich-text-editor-pro/react';

<RichTextEditorProProvider defaultValue="<p>Release notes</p>" proExtensions={['tables', 'slash-commands']}>
  <RichTextEditorProUI />
</RichTextEditorProProvider>

This is the same composition used by RichTextEditorPro. Owned toolbar icons, selection actions, suggestion menus, provider states, and presence consume the existing provider. The UI accepts the community slots and slotProps for granular customization. Importing the headless entry alone does not load any of that presentation.

Build your own Pro UI

RichTextEditorProProvider creates the Pro controller and the community editor provider. Call useRichTextEditorPro() for Pro state and useRichTextEditor() for the actual editing surface. The provider renders no DOM, CSS, toolbar, or icons. Bind getEditableProps() to exactly one editing div; render the surrounding UI with any library.

import { useRichTextEditor } from '@quickbuilder.io/rich-text-editor/headless';
import {
  RichTextEditorProProvider,
  useRichTextEditorPro,
} from '@quickbuilder.io/rich-text-editor-pro/headless';

function CustomEditor() {
  const editor = useRichTextEditor();
  const pro = useRichTextEditorPro();

  return (
    <section ref={pro.rootRef}>
      <div {...editor.getRootProps()}>
        <div {...editor.getToolbarProps()}>
          <button {...editor.getCommandProps('bold')}>Bold</button>
          {pro.toolbarActions.map((action) => (
            <button key={action.id} {...editor.getCustomButtonProps(action)}>
              {action.tooltipText}
            </button>
          ))}
        </div>
        <div {...editor.getEditableProps()} />
      </div>
      {pro.actionMenu?.kind === 'tables' && (
        <div {...pro.getActionMenuProps()}>
          <button role="menuitem" onClick={() => pro.executeTableAction('insertTable')}>
            Insert table
          </button>
        </div>
      )}
    </section>
  );
}

export function CustomProEditor() {
  return (
    <RichTextEditorProProvider
      defaultValue="<p>Start writing…</p>"
      proExtensions={['tables']}
      onChange={(html, context) => console.log(html, context)}
    >
      <CustomEditor />
    </RichTextEditorProProvider>
  );
}

toolbarActions contains icon-free action IDs, labels, disabled states, popup metadata, and selection-aware callbacks. The community getCustomButtonProps() connects those callbacks to the current selection and sanitized commit boundary. getActionMenuProps() supplies IDs, labels, busy state, focus ref, Escape, and arrow-key navigation. mentionMenu, slashMenu, slashMenuItems, and their IDs expose the suggestion state; their keyboard selection remains owned by the controller. Attach rootRef around both the editor and its popups to keep outside-click dismissal scoped to the correct instance.

Choose a single ownership model:

  • Providers: RichTextEditorProProvider owns one core + Pro controller pair; RichTextDocumentEditorProvider owns one document + Pro + core chain. Their children can be a render function or ordinary components using the context hooks.
  • Hooks: useRichTextEditorProController(options, editorRef) and useRichTextDocumentEditorController(options, rootRef) return state, commands, refs, and editorProps. Pass the Pro controller's editorProps and setEditorHandle to a community provider or styled editor. Pass a document controller's editorProps to a Pro provider or styled Pro editor.
  • Styled editors: RichTextEditorPro and RichTextDocumentEditor already establish the relevant contexts. Their community slots customize individual surfaces; custom slots can read useRichTextEditor(), useRichTextEditorPro(), and, for document editors, useRichTextDocumentEditor().

Do not place another editing provider inside RichTextEditorProProvider or RichTextDocumentEditorProvider; their children already receive the complete chain. RichTextEditorProState and RichTextDocumentEditorState provide render-function access inside an existing provider.

Document controllers expose page insertion/removal, sanitized body/header/footer changes, layout updates, active page navigation, settings state, and per-client zoom. Page breaks apply to the document body and preserve the live selection until a controlled owner accepts the change. Mutation methods enforce disabled and readOnly even when a custom UI leaves a control enabled. value and defaultValue are exclusive and their ownership mode cannot change after mounting. Controlled document owners must accept both document and active-page callbacks when an insert/remove changes both controlled values.

Validation

Package tests exercise both the Quick Builder styled surfaces and native HTML custom renderers. They cover one-engine composition, mention keyboard selection, sanitized page changes, provider isolation, read-only command guards, page ownership, and cancellation races. Run npm run typecheck, npm test, and npm run build from this package.

Run npm run validate:package --workspace @quickbuilder.io/rich-text-editor-pro from the repository root to qualify the tarball. Its required Quick Builder dependencies include Chat, Rich Text, Rich Text Editor, Design System, and Icons.

Document editing identity includes the document ID, page ID, active region, and header/footer variant. Changing that identity resets the community history and pending upload boundary. AI and agent requests cancel when the document, provider, request handler, or editor availability changes. A previously received AI suggestion cannot be applied to a different document/provider identity; applications should also honor request signals before publishing asynchronous results. The owned agent conversation resets when its document or provider changes.

For a plain Pro provider that switches between documents, supply a stable documentPageContentKey for the selected document. Document providers derive this key automatically. Keep request callbacks stable with useCallback while their routing is unchanged; changing a request callback explicitly reconfigures and cancels the provider lifecycle.

After building, npm run test:package checks both public module formats, declaration exports, shared provider/UI contexts across entry points, renderless server rendering, and transitive runtime import boundaries.