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

@openworkflowspec/diagram-editor

v1.1.0

Published

React open workflow diagram component

Downloads

249

Readme

@openworkflowspec/diagram-editor

Official visual diagram editor for the Open Workflow Specification. A vendor-neutral, embeddable React component with strict separation between core logic and platform APIs.

Getting Started

Requirements

This package requires React 19 in the consuming application:

npm install react@^19 react-dom@^19

Non-React Usage

If your application doesn't use React, you can embed the editor as a Web Component.
See the Vanilla Web Component example for a working setup.

Installation

npm install @openworkflowspec/diagram-editor
# or
pnpm add @openworkflowspec/diagram-editor
# or
yarn add @openworkflowspec/diagram-editor

Usage

Basic example:

import { DiagramEditor } from "@openworkflowspec/diagram-editor";
import "@openworkflowspec/diagram-editor/styles.css";

const workflowContent = `
document:
  dsl: "1.0.3"
  namespace: examples
  name: call-http-shorthand-endpoint
  version: "0.1.0"
do:
  - getPet:
      call: http
      with:
        method: get
        endpoint: https://petstore.swagger.io/v2/pet/{petId}
`;

function App() {
  return (
    <div style={{ height: "100vh" }}>
      <DiagramEditor content={workflowContent} locale="en" isReadOnly={true} />
    </div>
  );
}

Props

| Prop | Type | Required | Default | Description | | ------------ | ------------------------------- | -------- | ---------- | -------------------------------------------------------- | | content | string | Yes | - | Serverless Workflow specification in YAML or JSON format | | isReadOnly | boolean | Yes | - | Enable read-only mode to prevent editing | | locale | string | Yes | - | Language locale for the editor UI | | colorMode | 'light' \| 'dark' \| 'system' | No | 'system' | Color theme for the editor |

Development

# Navigate to the package
cd packages/open-workflow-diagram-editor

# Install dependencies (or run from repo root)
pnpm install

# Start Storybook dev server on port 6006
pnpm start

# Run unit tests
pnpm test

# Run E2E tests
pnpm test-e2e
pnpm test-e2e:ui  # with Playwright UI

# Type checking
pnpm typecheck

# Linting
pnpm lint

# Build package (development)
pnpm run build:dev

# Build package (production - includes linting and tests)
pnpm run build:prod

# Build Storybook static site
pnpm run build:storybook

Architecture

Core Principles

  • Vendor-neutral: Platform-agnostic editor that can be embedded anywhere
  • SDK isolation: SDK integration helpers live under src/core/ (e.g., workflowSdk.ts, graph.ts, taskSubType.ts, taskDetails.ts, mermaidExport.ts); other layers may also import SDK types/enums (e.g., Specification, GraphNodeType) when needed.
  • React Flow isolation: React Flow rendering components live in src/react-flow/ (nodes/edges/diagram); other layers may import @xyflow/react types and/or ReactFlowProvider.
  • TypeScript strict mode: Enforced with noUncheckedIndexedAccess and exactOptionalPropertyTypes

Directory Structure

Test Structure

Tests mirror the source structure:

UI Components (shadcn/ui)

This package uses shadcn/ui for UI primitives. Configuration: components.json

Key Settings

  • Style: new-york — compact spacing and sharper corners
  • Tailwind prefix: dec: — all generated classes prefixed to avoid conflicts with host applications
  • CSS target: src/components/ui/shadcn.css — CSS variables
  • Path aliases: @/components, @/lib, @/hooks — resolved via tsconfig
  • Icon library: lucide-react

Adding a shadcn Component

The shadcn CLI doesn't understand pnpm catalogs, so adding a component requires manual steps:

  1. Generate the component

    cd packages/open-workflow-diagram-editor
    pnpm dlx shadcn@latest add <component>
  2. Move dependency to pnpm catalog

    The CLI adds pinned versions (e.g., "@radix-ui/react-tooltip": "^1.2.3"). Move them to the catalog:

    • Add package and version to catalog: in root pnpm-workspace.yaml
    • Replace the version in package.json with "catalog:"
  3. Verify consistency

    pnpm dependencies:check  # from repo root
    pnpm dependencies:fix    # if needed
  4. Install

    pnpm install