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

@wizestudio/canvas-bridge

v0.1.2

Published

The versioned, framework-neutral protocol between the WizeStudio editor and a rendered canvas.

Readme

@wizestudio/canvas-bridge

The versioned, framework-neutral postMessage protocol between the WizeStudio editor and a rendered canvas.

Where this sits

WizeStudio is a visual page builder for headless CMS platforms. Its editor runs inside the CMS admin; the widgets it edits live in the developer's own application — a different bundle, a different React instance, in production a different origin. The editor therefore cannot import those components. Rather than shipping approximations of them, which is how a builder's canvas quietly stops resembling the real site, WizeStudio frames the developer's own application at an edit-mode route and drives it over this protocol.

That makes this package the framework-agnosticism boundary. A Vue, Svelte or Angular SDK means implementing this contract plus a recursive renderer, and changing nothing else in the system. @wizestudio/editor holds the host end; @wizestudio/renderer-react's WizeCanvas holds the client end.

Install

npm install @wizestudio/canvas-bridge

Usage

Editor side:

import { createBridgeHost, createWindowTransport } from '@wizestudio/canvas-bridge';

const transport = createWindowTransport({
  target: iframe.contentWindow!,
  targetOrigin: 'https://preview.example.com',
  allowedOrigins: ['https://preview.example.com'],
});

const host = createBridgeHost(transport, {
  onClick: (id) => selection.select(id!),
  onGeometry: (nodes) => overlay.reposition(nodes),
});

host.connect();
host.sendDocument(document);

Canvas side:

import { createBridgeClient } from '@wizestudio/canvas-bridge';

const client = createBridgeClient(transport, { renderer: 'react' }, {
  onDocument: (doc) => setDocument(doc),
  onMeasure: () => client.reportGeometry(measureAll(), currentScroll()),
});

targetOrigin and allowedOrigins are the security boundary, never "*". Posting to a wildcard leaks the page being edited to whatever happens to be framed; accepting from one lets anything rewrite it.

Design

The editor never touches the canvas DOM — in production it cannot, since the two are different origins. All hit-testing and measurement happen on the canvas side and travel back as geometry; overlays are drawn in the parent document. That restriction is not a limitation to work around, it is what keeps a non-React canvas viable later.

Messages carry PROTOCOL_VERSION. An incompatible peer is reported through onIncompatible rather than silently misinterpreted.

Key exports

| Area | Exports | |---|---| | Protocol | HostMessage, ClientMessage, Envelope, PROTOCOL_VERSION, PROTOCOL_NAMESPACE, envelope, isEnvelope, isCompatible, isHostMessage, isClientMessage | | Transports | createWindowTransport, createMemoryTransportPair, Transport | | Host end | createBridgeHost, BridgeHost, HostHandlers | | Client end | createBridgeClient, BridgeClient, ClientHandlers, BridgeClientOptions | | Geometry | NodeGeometry, Rect, Modifiers, ClientCapabilities |

createMemoryTransportPair connects both ends in-process, which is how the protocol is tested without a browser.

Licence

MIT.

WizeStudio is open core, and this package is on the production render path — the canvas client ships inside the customer's own frontend. It is MIT deliberately and contains no licensing code of any kind, which is what makes "a lapsed subscription cannot break your live site" a property of the build rather than a promise. schema, core, renderer-react, renderer-next and cli are MIT for the same reason; the authoring side — editor, plugin-strapi, components, cms-strapi — is commercial.


wizestudio.wizeb.com