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

@mova-ui/can-react

v0.1.0

Published

Can SDK is the complete local canvas used by the official Web and Desktop apps. The preview targets React 19 and modern desktop browsers. It has no account or cloud service.

Readme

@mova-ui/can-react

Can SDK is the complete local canvas used by the official Web and Desktop apps. The preview targets React 19 and modern desktop browsers. It has no account or cloud service.

Install the preview

The npm package name is @mova-ui/can-react (React 19 peer dependencies). Install version 0.1.0 with:

npm install @mova-ui/[email protected] react@^19 react-dom@^19

To build and test local distribution archives, run npm run build:sdk and npm run test:sdk; install the three mova-ui-can-*-0.1.0.tgz files from release/sdk together.

import { CanCanvas } from "@mova-ui/can-react";
import "@mova-ui/can-react/style.css";

export function Board() {
  return (
    <div style={{ height: 720 }}>
      <CanCanvas boardId="my-board" namespace="my-product" />
    </div>
  );
}

The component includes editing, selection, movement, zoom, menus, history and browser local saving. Give its parent a definite height. namespace and boardId determine persistence identity; changing either opens different local data. Same-origin instances with the same identity share a single writer lease. A second instance opens read-only until it can take over.

Commands and events

Capture the instance with onReady or a component ref. Commands are the authoritative mutation interface; do not mutate the objects returned by getLibrary().

<CanCanvas
  boardId="notes"
  onReady={(canvas) => {
    // Trigger this from your own UI, not on every mount:
    // canvas.create('note', { title: 'Hello', content: 'Markdown text' });
  }}
  onChange={(library) => console.log("Content changed", library.items.length)}
  onSaveStateChange={(state) => console.log(state.status)}
  onError={(error) => console.error(error)}
/>

Save states are pending, saving, saved and error. Only saved confirms storage committed. onChange does not confirm persistence. flush() waits for queued storage work. exportFile() opens the platform backup flow for the current board; exportFile({ scope: "workspace" }) includes every board. import() opens the platform import flow. export() returns the runtime workspace snapshot and exportBoard() returns the current board snapshot; neither embeds media bytes. Raw snapshot imports reject media references: use a portable .can archive when transferring assets.

In browsers, file-picker activation must happen directly in the user gesture. If import() is called while edits are still pending, the SDK saves those edits and reports that the import should be started again; invoke it again from a fresh click. This keeps the existing board safe and lets the browser open the picker without losing the user gesture.

Other methods include update, remove, undo, redo, getSelection, setSelection, getView, setView, and navigate. readOnly blocks content editing; theme accepts the library theme values. The SDK cleans its own subscriptions and default storage on unmount. A supplied storage adapter remains owned by the host. flushCanInstances() flushes every mounted instance, including open editors. Browser page exit requests a flush and prompts while edits are pending; Electron coordinates the flush before closing. Hosts that control navigation should await flush() before unmounting.

Custom cards

import type { CustomCardProps } from "@mova-ui/can-react";

function Counter({ item, update, readOnly }: CustomCardProps) {
  const value = Number(item.data?.value ?? 0);
  return (
    <button
      disabled={readOnly}
      onClick={() => update({ data: { ...item.data, value: value + 1 } })}
    >
      Count: {value}
    </button>
  );
}

// <CanCanvas customCards={{ counter: Counter }} ... />
// canvas.create('custom', { customType: 'counter', data: { value: 0 } });

Custom data must be JSON-serializable. The canvas owns geometry, selection, resize and history. Keep editor events scoped to the card so typing and pointer actions do not accidentally become canvas commands.

Composition and storage

CanProvider owns the same runtime used by CanCanvas. Place CanvasSurface and your controls inside it. useCan() returns the current controller and state after initialization; the provider delays its children until that runtime is ready. CanvasSurface inherits the provider’s theme, read-only mode, custom cards and selection callback. CanvasToolbar is an optional command toolbar. Built-in exports include Card, RichTextEditor, MindMapEditor, MediaFocus and metadata/dialog components; their typed props describe required content and callbacks.

storage accepts the CanAPI contract exported from @mova-ui/can-core. @mova-ui/can-storage-browser supplies createBrowserStorage. The desktop app supplies its restricted IPC adapter. capabilities supplies host operations. Node and Electron modules are absent from the browser SDK distribution.

Logical can-asset:// references are resolved by the adapter. Persist asset identifiers, never transient Blob URLs. Browser data stays local to its origin. Export a portable .can backup before changing origins or clearing browser data.