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

@hafley66/react-dock-and-flow

v0.0.3

Published

Dockview and React Flow workspace driven by RxJS and Hafley signals

Readme

@hafley66/react-dock-and-flow

Dockview and React Flow composition driven by RxJS and @hafley66/signals.

Install

npm install @hafley66/react-dock-and-flow dockview @xyflow/react cytoscape react react-dom rxjs

Import the package stylesheet once:

import "@hafley66/react-dock-and-flow/style.css"

Model

import { createDockAndFlowModel } from "@hafley66/react-dock-and-flow"

const model = createDockAndFlowModel(100)

model.events.$({ type: "node-count-selected", count: 500 })
model.events.$({
  type: "panel-value-changed",
  panelId: "panel-0",
  value: "retained",
})

console.log(model.state.$())
model.dispose()

events.$ accepts events. state.$() reads the current snapshot. Nested signal access such as state.nodes.$() is available through the Hafley signal proxy.

React

import type { NodeProps } from "@xyflow/react"
import {
  createDockAndFlowModel,
  DockAndFlow,
  type DockFlowNode,
} from "@hafley66/react-dock-and-flow"

const model = createDockAndFlowModel()

function PanelNode({ data }: NodeProps<DockFlowNode>) {
  return <section>{data.title}</section>
}

export function Workspace() {
  return <DockAndFlow model={model} node={PanelNode} />
}

The root containing DockAndFlow must have a measurable width and height.

Events

type DockFlowEvent =
  | { type: "node-count-selected"; count: number }
  | { type: "nodes-changed"; changes: NodeChange<DockFlowNode>[] }
  | { type: "panel-value-changed"; panelId: string; value: string }
  | { type: "layout-created"; dockPanels: number }

Additional event observables can be merged into the model:

const model = createDockAndFlowModel(100, [externalEvents$])

Rectangle journal

RectangleCanvas projects renderer-neutral rectangle state into React Flow. Its graph content adapter mounts Cytoscape inside a rectangle while session content stays ordinary DOM.

import { createRectangleModel, RectangleCanvas } from "@hafley66/react-dock-and-flow"

const model = createRectangleModel([
  {
    id: "session",
    title: "Agent session",
    position: { x: 20, y: 20 },
    size: { width: 320, height: 220 },
    z: 1,
    content: { kind: "session", lines: ["src/index.ts", "README.md"] },
  },
  {
    id: "graph",
    title: "Query graph",
    position: { x: 400, y: 20 },
    size: { width: 480, height: 300 },
    z: 2,
    content: {
      kind: "graph",
      nodes: ["source", "compile", "run"],
      edges: [["source", "compile"], ["compile", "run"]],
    },
  },
])

export function Canvas() {
  return <RectangleCanvas model={model} />
}

model.events.$({ type: "undo" })
model.events.$({ type: "redo" })

The canonical history is { events, cursor }. Undo and redo move the cursor; adding an event after undo truncates the abandoned future. React Flow and Cytoscape remain projections of the replayed rectangle state.

Verification

pnpm --filter @hafley66/react-dock-and-flow check
pnpm --filter @hafley66/react-dock-and-flow test
pnpm --filter @hafley66/react-dock-and-flow build
pnpm --filter @hafley66/react-dock-and-flow test:perf

The Playwright receipts exercise 500 logical React Flow nodes, verify viewport culling and panel state retention, and compose DOM plus Cytoscape rectangle content with movement and undo.

License

MIT