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 🙏

© 2025 – Pkg Stats / Ryan Hefner

pelliote-editor

v1.0.3

Published

A modern, beautiful email editor built with React and Rust/WASM. Features block-based editing, AI generation, mobile preview, and more.

Downloads

291

Readme

pelliote-editor

A modern, beautiful email editor built with React and Rust/WASM. Features block-based editing, AI generation, mobile/desktop preview, dark mode support, and more.

Pelliote Email Editor

✨ Features

  • 🎨 Modern UI - Beautiful startup-style design with warm coral accents
  • 📱 Responsive Preview - Desktop and mobile preview modes
  • 🌙 Dark Mode - Preview emails in light and dark themes
  • 🤖 AI Generation - Generate newsletters with AI (OpenRouter integration)
  • ⌨️ Keyboard Shortcuts - Full keyboard navigation and shortcuts
  • 🔤 Slash Commands - Quick block insertion with / commands
  • 🎯 Drag & Drop - Reorder blocks with drag and drop
  • Rust/WASM - High-performance core engine
  • 📦 Block Types - Text, Hero, Image, Button, Code, Callout, Social Links, and more

📦 Installation

npm install pelliote-editor
# or
yarn add pelliote-editor
# or
pnpm add pelliote-editor

🚀 Quick Start

import { EmailEditor, createEmptyDocument } from 'pelliote-editor';
import 'pelliote-editor/styles.css';

function App() {
  const [doc, setDoc] = useState(() => createEmptyDocument());

  return (
    <EmailEditor
      value={doc}
      onChange={setDoc}
    />
  );
}

📖 Usage

Basic Editor

import { useState } from 'react';
import { EmailEditor, createEmptyDocument } from 'pelliote-editor';
import 'pelliote-editor/styles.css';

function MyEmailEditor() {
  const [doc, setDoc] = useState(() => createEmptyDocument());

  return (
    <div className="h-screen">
      <EmailEditor
        value={doc}
        onChange={setDoc}
      />
    </div>
  );
}

With AI Generation

import { useState } from 'react';
import { EmailEditor, createEmptyDocument } from 'pelliote-editor';
import 'pelliote-editor/styles.css';

function MyEmailEditor() {
  const [doc, setDoc] = useState(() => createEmptyDocument());

  const handleAiAction = async (args) => {
    // Integrate with your AI provider (OpenAI, Anthropic, etc.)
    const response = await generateNewsletter(args);
    return response;
  };

  return (
    <EmailEditor
      value={doc}
      onChange={setDoc}
      onAiAction={handleAiAction}
    />
  );
}

Render to HTML

import { renderEmailHtml } from 'pelliote-editor';

// Get the HTML output for sending
const html = renderEmailHtml(doc);
console.log(html);

Parse HTML to Blocks (NEW!)

import { parseHtmlToDocument, parseEmailContent } from 'pelliote-editor';

// Convert stored HTML back to editable blocks
const htmlFromDb = '<div><h1>My Newsletter</h1><p>Content here</p></div>';
const doc = parseHtmlToDocument(htmlFromDb);

// Or use smart parser that handles both JSON and HTML
const content = /* JSON or HTML from database */;
const doc = parseEmailContent(content);

// Now you can edit it
setDoc(doc);

🎨 Styling

The editor comes with built-in styles. Import them in your app:

import 'pelliote-editor/styles.css';

The styles use CSS custom properties that you can override:

:root {
  --color-brand-500: #f97316;
  --color-surface: #fafaf9;
  --color-text-primary: #1c1917;
}

⌨️ Keyboard Shortcuts

| Shortcut | Action | |----------|--------| | Ctrl/Cmd + Z | Undo | | Ctrl/Cmd + Shift + Z | Redo | | Ctrl/Cmd + B | Bold | | Ctrl/Cmd + I | Italic | | Ctrl/Cmd + U | Underline | | Ctrl/Cmd + D | Duplicate block | | Delete/Backspace | Delete selected blocks | | / | Open slash command menu | | Escape | Close menus / Deselect |

📦 Block Types

  • Text - Rich text paragraphs with formatting
  • Hero - Large banner sections with CTA buttons
  • Image - Image blocks with alignment options
  • Button - Call-to-action buttons with custom colors
  • Two Column - Side-by-side layout
  • Code - Syntax-highlighted code blocks
  • Callout - Info, warning, success, error message boxes
  • Social Links - Social media icon links
  • Divider - Horizontal line separators
  • Spacer - Vertical spacing

🔧 Props

EmailEditor

| Prop | Type | Description | |------|------|-------------| | value | EmailDocument | The document state | | onChange | (doc: EmailDocument) => void | Called when document changes | | onAiAction | (args: AiActionArgs) => Promise<EmailDocument> | Optional AI generation handler |

📄 Types

interface EmailDocument {
  children: Block[];
}

type Block = 
  | TextBlock 
  | HeroBlock 
  | ImageBlock 
  | ButtonBlock 
  | TwoColumnBlock
  | CodeBlock
  | CalloutBlock
  | SocialLinksBlock
  | DividerBlock 
  | SpacerBlock;

🛠️ Development

# Install dependencies
pnpm install

# Start development server
pnpm dev

# Build for production
pnpm build

# Build with WASM rebuild
pnpm build:full

📜 License

MIT © Pelliote Team

🙏 Credits

Built with: