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

@object-ui/plugin-editor

v3.0.3

Published

Rich text editor plugin for Object UI, powered by Monaco Editor

Readme

Plugin Editor - Lazy-Loaded Monaco Editor

A lazy-loaded code editor component for Object UI based on Monaco Editor.

Features

  • Internal Lazy Loading: The Monaco Editor is loaded on-demand using React.lazy() and Suspense
  • Zero Configuration: Just import the package and use type: 'code-editor' in your schema
  • Automatic Registration: Components auto-register with the ComponentRegistry
  • Skeleton Loading: Shows a skeleton while Monaco loads

Installation

pnpm add @object-ui/plugin-editor

Usage

Automatic Registration (Side-Effect Import)

// In your app entry point (e.g., App.tsx or main.tsx)
import '@object-ui/plugin-editor';

// Now you can use code-editor type in your schemas
const schema = {
  type: 'code-editor',
  value: 'console.log("Hello, World!");',
  language: 'javascript',
  theme: 'vs-dark',
  height: '400px'
};

Manual Integration

import { editorComponents } from '@object-ui/plugin-editor';
import { ComponentRegistry } from '@object-ui/core';

// Manually register if needed
Object.entries(editorComponents).forEach(([type, component]) => {
  ComponentRegistry.register(type, component);
});

TypeScript Support

The plugin exports TypeScript types for full type safety:

import type { CodeEditorSchema } from '@object-ui/plugin-editor';

const schema: CodeEditorSchema = {
  type: 'code-editor',
  value: 'console.log("Hello, World!");',
  language: 'javascript',
  theme: 'vs-dark',
  height: '400px'
};

Schema API

{
  type: 'code-editor',
  value?: string,              // Code content
  language?: string,           // 'javascript' | 'typescript' | 'python' | 'json' | 'html' | 'css'
  theme?: 'vs-dark' | 'light', // Editor theme
  height?: string,             // e.g., '400px'
  readOnly?: boolean,          // Read-only mode
  className?: string           // Tailwind classes
}

Lazy Loading Architecture

The plugin uses a two-file pattern for optimal code splitting:

  1. MonacoImpl.tsx: Contains the actual Monaco Editor import (heavy)
  2. index.tsx: Entry point with React.lazy() wrapper (light)

When bundled, Vite automatically creates separate chunks:

  • index.js (~200 bytes) - The entry point
  • MonacoImpl-xxx.js (~15-20 KB) - The lazy-loaded implementation

The Monaco Editor library is only downloaded when a code-editor component is actually rendered, not on initial page load.

Build Output Example

dist/index.js                 0.19 kB  # Entry point
dist/MonacoImpl-DCiwKyYW.js  19.42 kB  # Lazy chunk (loaded on demand)
dist/index.umd.cjs           30.37 kB  # UMD bundle

Development

# Build the plugin
pnpm build

# The package will generate proper ESM and UMD builds with lazy loading preserved