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

@animastor/web-editor

v0.1.0

Published

Schema-driven editor UI primitives for Animastor web frontend — entity add/delete dialogs, structure add dialog, canvas waveform renderer, and preview ID generator. Host capabilities (i18n, icons, modal) arrive via the injected EditorPorts contract; the p

Readme

@animastor/web-editor

Schema-driven editor UI primitives for Animastor web frontend.

Scope

This package provides reusable editor components, canvas waveform rendering, and preview ID generation:

  • Entity Editor — schema-driven Add/Delete dialogs for Characters, Locations, Voices, Behaviors
  • Structure Editor — Add dialog for Chapters, Scenes, Units (hierarchy with parent selection)
  • Waveform — canvas-based waveform renderer with draggable range selection and playback playhead
  • ID Generator — preview ID generation for chapters, scenes, units (client-side preview only)

Host capabilities injected via EditorPorts. The package imports nothing from the host app directly — i18n, icons, and modal arrive through the Ports contract.

Install

npm install @animastor/web-editor

Peer dependencies: preact >=10.5.0, @preact/signals >=1.0.0.

Usage

import { EntityAddButton, Waveform, chapterId, type EditorPorts } from '@animastor/web-editor';

// Inject host capabilities via EditorPorts
const ports: EditorPorts = {
  i18n: { t: (key) => translations[key] },
  icons: { Add: IconAdd, Minus: IconMinus },
  modal: { Modal: HostModal },
};

// Use in a component
<EntityAddButton ports={ports} onClick={handleAdd} />

// Waveform
<Waveform peaks={peaks} durationMs={60000} selection={sel} />

// Preview IDs
const id = chapterId(); // "ch-a1b2c3d4"

Public API

| Export | Kind | Purpose | |---|---|---| | EditorPorts | type | Host contract (i18n + icons + modal) | | EditorI18nKey | type | Typed i18n key union (45 keys) | | EditorT | type | Translation function signature | | EditorIconProps | type | Icon component props | | EditorIconComponent | type | Icon component function type | | EditorModalProps | type | Modal component props | | WaveformPeak | type | Package-owned peak pair (pos/neg) | | EntityKind | type | 'character' | 'location' | 'voice' | 'behavior' | | EntitySchema | type | Schema for an entity kind | | EntityFieldDef | type | Field definition in an entity schema | | StructureKind | type | 'chapter' | 'scene' | 'unit' | | StructureParentOption | type | Parent option for structure add dialog | | ENTITY_SCHEMAS | const | Maps EntityKind → EntitySchema | | EntityAddButton | component | Round "+" overlay button | | EntityDeleteButton | component | Small "−" destructive button | | EntityEditorDialog | component | Schema-driven add dialog | | BehaviorAddDialog | component | Behavior-specific add dialog (character picker) | | DeleteConfirmDialog | component | Destructive action confirmation | | StructureAddDialog | component | Chapter/Scene/Unit add dialog | | Waveform | component | Canvas waveform with range selection | | chapterId | function | Preview ID: ch-<8hex> | | sceneId | function | Preview ID: sc-<8hex> | | unitId | function | Preview ID: iu-<8hex> |

Package boundary

  • The package imports only its own internal modules — zero host imports.
  • @animastor/web-editor → host = forbidden; host → @animastor/web-editor = allowed through the public entry point only.
  • All host capabilities arrive via the injected EditorPorts contract.

Development

npm install
npm run typecheck   # tsc --noEmit
npm run test        # vitest (unit tests)
npm run build       # tsup → dist/ (ESM + d.ts + sourcemaps)

License

MIT