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

@richhtmleditor/workflows

v1.1.2

Published

Enterprise approval workflows plugin for Rich HTML Editor.

Readme

@richhtmleditor/workflows

Enterprise approval workflows plugin for Rich HTML Editor. Draft, in-review, changes-requested, approved, and published states with role-based editing permissions, track-changes tools, audit trail, and workflow bar — requires features.workflows from @richhtmleditor/enterprise, built on @richhtmleditor/core.

Current release: 1.1.2 — Depends on @richhtmleditor/core ^1.1.2.

Repository: github.com/rajkishorsahu89/richhtmleditor

Demo: richhtmleditor.vercel.appdemo · guide · API. Doc Preview joint demo: doc-preview-app.vercel.app/demo/enterprise

What's in 1.1.2

  • createWorkflowsPlugin — workflow toolbar row and status bar
  • Document statesdraftin_reviewapprovedpublished (with changes_requested)
  • Role-based permissions — viewer, commenter, editor, approver, publisher
  • Track changes — mark deletion, accept/reject selection, accept/reject all
  • Audit trail — transitions recorded in document metadata and workflow bar
  • getWorkflowsHandle — programmatic access to role and snapshot
  • exportImmutableAudit — export tamper-evident audit log

Requires features.workflows: true. Demo key: RHE-ENT-DEMO-2026-FULL. Pairs with editor.exportForPreview() for workflow watermarks.

Keywords: richhtmleditor enterprise workflow approval track-changes permissions

Install

npm install @richhtmleditor/workflows @richhtmleditor/enterprise
# Requires @richhtmleditor/core (via framework wrapper or direct install).

Usage

import { createEditor } from "@richhtmleditor/core";
import { createWorkflowsPlugin, getWorkflowsHandle } from "@richhtmleditor/workflows";
import { resolveEnterpriseFeatures } from "@richhtmleditor/enterprise/browser";

const gate = resolveEnterpriseFeatures({ token: "RHE-ENT-DEMO-2026-FULL" });

const editor = createEditor({
  element: host,
  toolbar: { preset: "full" },
  features: gate.features,
  plugins: [
    createWorkflowsPlugin({
      actor: "Legal Team",
      role: "editor",
      initialState: "draft",
      onChange: (snapshot) => console.log(snapshot.state, snapshot.audit)
    })
  ]
});

editor.on("workflow:change", (snapshot) => {
  // React to state transitions
});

const handle = getWorkflowsHandle(editor);
handle?.setRole("approver");

Use toolbar workflow buttons (Submit for review, Approve, Publish, etc.) to transition states. Editing is automatically disabled for viewers, commenters, and published documents.

Usage — export with workflow watermark

const snapshot = getWorkflowsHandle(editor)?.getSnapshot();

const preview = editor.exportForPreview({
  workflowState: snapshot?.state ?? "draft",
  includePrintCss: true
});
// preview.watermarkText — e.g. "IN REVIEW", "APPROVED · PUBLISHED"

API

createWorkflowsPlugin(options?)

| Option | Type | Description | | --- | --- | --- | | actor | string | Display name for audit entries (default "Reviewer"). | | role | EditorRole | Initial role (default "editor"). | | initialState | DocumentWorkflowState | Starting state (default "draft"). | | initialAudit | WorkflowAuditEntry[] | Pre-load audit log. | | onChange | (snapshot: WorkflowSnapshot) => void | Fired on state or role changes. |

Document states

| State | Label | Editing | | --- | --- | --- | | draft | Draft | Editors+ can edit | | in_review | In review | Editors+ can edit; track changes active | | changes_requested | Changes requested | Editors+ can edit | | approved | Approved | Read-only | | published | Published | Read-only |

Roles

| Role | Can edit | Can approve | Can publish | | --- | --- | --- | --- | | viewer | No | No | No | | commenter | No | No | No | | editor | Yes (draft/review) | No | No | | approver | Yes (draft/review) | Yes | No | | publisher | Yes (draft/review) | Yes | Yes |

Toolbar transitions

| Tool ID | Action | | --- | --- | | workflowSubmit | Submit for review (draftin_review) | | workflowRequestChanges | Request changes (in_reviewchanges_requested) | | workflowApprove | Approve (in_review / changes_requestedapproved) | | workflowPublish | Publish (approvedpublished) | | workflowReopen | Reopen draft |

getWorkflowsHandle(editor)

| Method | Description | | --- | --- | | setRole(role) | Change the active editor role. | | getSnapshot() | { state, role, audit } current workflow snapshot. |

Events

| Event | Payload | Description | | --- | --- | --- | | workflow:change | WorkflowSnapshot | State or role changed. | | workflow:status | WorkflowSnapshot | Emitted from Workflow status button. |

Related packages

License

MIT