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

@infinite-canvas-tutorial/webcomponents

v0.0.8

Published

WebComponents UI implementation

Readme

@infinite-canvas-tutorial/webcomponents

Developing Web UIs with Lit and Spectrum.

For more information, please refer to: Lesson 7 - Web UI which used Shoelace at that time.

Getting Started

For now we provide these web components implementations based on Spectrum:

import '@infinite-canvas-tutorial/webcomponents/spectrum';

Using web components in HTML:

<ic-spectrum-canvas></ic-spectrum-canvas>

Use API (a more recommended way)

Listening to Events in JS:

import { Event } from '@infinite-canvas-tutorial/webcomponents';

// Get container element.
const canvas = document.querySelector<HTMLElement>('ic-spectrum-canvas')!;

// Waiting for the canvas to be ready...
canvas.addEventListener(Event.READY, (e) => {
    // Get API.
    const api = e.detail;

    // Append initial nodes to canvas.
    api.updateNodes(nodes);

    // Set cursor style.
    api.setCursor('grabbing');
});

For more information, please refer to API section.

Use ECS

Please refer to @infinite-canvas-tutorial/ecs.

API

Just like Figma API and Excalidraw API, we provide ours which is also friendly to MCP. MCP: What It Is and Why It Matters:

Instead of only having a GUI or API that humans use, you get an AI interface “for free.” This idea has led to the concept of “MCP-first development”, where you build the MCP server for your app before or alongside the GUI.

get/setAppState

api.getAppState();
api.setAppState({
    penbarSelected: Pen.HAND,
});

penbarVisible

penbarAll

export enum Pen {
    SELECT = 'select',
    HAND = 'hand',
    DRAW_RECT = 'draw-rect',
    DRAW_ELLIPSE = 'draw-ellipse',
    DRAW_LINE = 'draw-line',
    DRAW_ROUGH_RECT = 'draw-rough-rect',
    IMAGE = 'image',
    TEXT = 'text',
    PENCIL = 'pencil',
    BRUSH = 'brush',
    VECTOR_NETWORK = 'vector-network',
}

penbarSelected

checkboardStyle

Set the checkboard style of grid, refer to Lesson 5 - Grid.

api.setAppState({
    checkboardStyle: CheckboardStyle.GRID,
});

Valid values to take include:

enum CheckboardStyle {
    NONE = 'none',
    GRID = 'grid',
    DOTS = 'dots',
}

contextMenuVisible

contextBarVisible

topbarVisible

taskbarVisible

taskbarAll

taskbarSelected

setCursor

Set current cursor style, the valid values are detailed: cursor.

setCursor(cursor: string): void;

updateNodes

updateNodes(nodes: SerializedNode[]): void;

undo

redo

isUndoStackEmpty

isRedoStackEmpty

destroy

Delete canvas entity.

Events

canvas.addEventListener(Event.READY, (e) => {
    // Get API.
    const api = e.detail;
});
  • READY
  • RESIZED
  • CAMERA_ZOOM_CHANGED
  • SCREENSHOT_REQUESTED
  • SCREENSHOT_DOWNLOADED

Built-in plugin and systems

  • UI plugin
    • InitCanvas System
    • ZoomLevel System
    • DownloadScreenshot System

FAQ

Registry conflicts

Failed to execute 'define' on 'CustomElementRegistry':
the name "sp-overlay" has already been used with this registry

https://opensource.adobe.com/spectrum-web-components/registry-conflicts/