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

@bendyline/docblocks-react

v2.7.0

Published

React components for DocBlocks — file explorer, workspace picker, and editor shell

Readme

@bendyline/docblocks-react

React components for DocBlocks — the complete editor shell (file explorer, workspace picker, app menu, export pipeline) plus the individual components and hooks it's built from. This is the package the DocBlocks web app and desktop renderer both mount.

Installation

npm install @bendyline/docblocks-react react react-dom
npm install --save-dev @types/react @types/react-dom

Peer dependencies: React 18 or 19. TypeScript consumers must install the matching @types/react major (and normally @types/react-dom); the React type peer is optional so JavaScript-only consumers do not need type packages. The DocBlocks core (@bendyline/docblocks) and the Squisq editor packages are regular dependencies and install automatically.

Usage

import { DocBlocksShell } from '@bendyline/docblocks-react';
import '@bendyline/docblocks-react/styles';

function App() {
  return <DocBlocksShell theme="auto" />;
}

The video-export worker uses module chunks. Vite consumers must retain the same worker setting used by the DocBlocks site and desktop renderer:

// vite.config.ts
import { defineConfig } from 'vite';

export default defineConfig({ worker: { format: 'es' } });

Formula grids can opt into the full IronCalc engine through the separately built calculation entry point. Publish @ironcalc/wasm/wasm_bg.wasm at a same-origin URL and keep the factory at module scope so the engine remains lazy and reusable:

import { createDocBlocksCalcEngineFactory } from '@bendyline/docblocks-react/calculation';

const calcEngineFactory = createDocBlocksCalcEngineFactory({
  wasmSource: '/ironcalc/wasm_bg.wasm',
});

function App() {
  return <DocBlocksShell calcEngineFactory={calcEngineFactory} />;
}

Components

DocBlocksShell

The canonical DocBlocks experience in one component — file explorer, workspace picker, app menu, the Squisq editor with its Editor / Markdown / Play views, and the export pipeline.

<DocBlocksShell theme="auto" logoUrl="/logo.png" />
  • theme — 'light' | 'dark' | 'auto' (auto follows prefers-color-scheme)
  • logoUrl — brand mark for the app menu button
  • calcEngineFactory — optional lazy calculation backend; use the calculation entry point above to enable IronCalc formulas
  • ffmpegWasm — optional same-origin ffmpeg core URLs; supplying them enables the built-in Animated GIF flow on cross-origin-isolated hosts. No first-party surface supplies this. The @ffmpeg/core WebAssembly build is GPL-2.0-or-later, which cannot be reconciled with Apple's App Store terms, so it was removed from every DocBlocks distribution. The prop remains for hosts that bring their own encoder
  • showCodeCopyButton — shows Copy controls on ordinary fenced code blocks (default: true; Mermaid fences remain diagrams)
  • onCopyCode — optional clipboard adapter for native hosts; browser hosts fall back to navigator.clipboard.writeText

Storage is abstracted behind the byte-authoritative FileSystemProviderV2 contract from @bendyline/docblocks/filesystem: browser-local (IndexedDB), native folders (File System Access API), transient memory workspaces, or the Electron host. Built-in compatibility facades expose it as provider.v2; first-party shell and file-tree operations are v2-first.

FileExplorer / FileTreeNode

File tree browser with inline create (file + folder), rename, and delete. It follows filesystem watch events automatically and re-reads the visible tree when a browser surface resumes. Long names truncate gracefully.

WorkspacePicker

Dropdown for switching between workspaces, creating new ones, and opening local folders, plus the per-workspace settings dialog (rename, download, remove, version-history overrides).

AppMenu

Top-left brand menu with the app-wide Settings dialog (theme preference, global version-history default), optional "Download all workspaces," and the About dialog.

ExportToolbarControls / ExportDialog

Consumers that need the export pipeline without the complete shell can use the public, independently built entry point:

import {
  DEFAULT_OPTIONS,
  ExportDialog,
  buildExportFilename,
  runExport,
} from '@bendyline/docblocks-react/export';

The shell overflow also offers Share link with content embedded. It creates a bounded #shared(<base64>) URL containing a compressed, Markdown-only copy and an optional initial Use mode. Opening the URL creates a session-only workspace; generated links warn after 4,096 characters and are capped at 32,768 characters.

The export flow: quick re-export of the last configuration plus the full dialog — format (PDF, Word, PowerPoint, EPUB, HTML, Markdown), visual theme, and page size. Video export is available wherever WebCodecs is, and uses the MIT-licensed mp4-muxer. A host that supplies ffmpegWasm additionally exposes Animated GIF with timing, orientation, captions, looping, and color controls; no first-party surface does. Animated GIF remains available from the CLI and MCP, which use a system FFmpeg binary rather than a distributed one.

Rendered HTML and HTML ZIP exports include Copy controls for ordinary fenced code blocks; Mermaid fences remain diagrams.

Hooks

useDocumentSession(delay?)

React binding for the revisioned DocumentSession. Active-document writes, transitions, conflicts, and close preparation must flow through this session; there is intentionally no independent autosave hook.

useFileTree(provider)

File tree state management over any v2-capable provider — returns the tree, selection, and explicit create/move/remove functions, with a temporary v1 fallback for external providers.

Styles

import '@bendyline/docblocks-react/styles';

One explicit stylesheet import covers the Squisq editor and all DocBlocks components in both themes. Theme fonts are supplied by the host application; this package does not bundle fonts.

Where new UI belongs

Cross-surface UI that lives inside the shell chrome (file tree, workspace picker, app menu, export dialog) belongs here. The VS Code extension is the deliberate exception — its webview mounts Squisq's EditorShell directly because VS Code provides the file explorer, workspace, and theme itself.

License

MIT