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

@asteby/metacore-inbox

v0.2.0

Published

Channel-agnostic inbox components for Metacore: virtualized conversation list, thread view, composer with drafts, sandboxed HTML frame, AI proposal card and Superhuman-style shortcuts

Readme

@asteby/metacore-inbox

Channel-agnostic inbox components (email, WhatsApp, team chat). Everything channel-specific arrives through props and adapters; nothing is hardcoded. Dependencies: react and lucide-react only. The package is sideEffects: false and every export is tree-shakeable.

pnpm add @asteby/metacore-inbox lucide-react

Tailwind v4 must scan the package (same as other metacore UI packages):

@source "../node_modules/@asteby/metacore-inbox/dist/**/*.{js,mjs}";

Styling uses the semantic theme tokens (bg-card, text-muted-foreground, border-border, ring-ring, bg-primary), so light/dark follows the host theme.

Pieces

| Export | Purpose | | --- | --- | | InboxProvider | locale (es default, en) and partial labels overrides. Optional; every component also takes labels. | | ConversationList | Virtualized listbox (fixed row height, thousands of rows). items, selectedId, onSelect, onEndReached, loading, error, onRetry. | | ThreadView | Grouped messages, collapsible quotes, attachments, delivery status. messages, title, actions, footer, onOpenAttachment, onRetrySend. | | Composer | Light rich text (markdown subset, outputs text + safe html), attachments, autosaved drafts, send-as identity. Ref handle: focus(), clear(). | | HtmlSandboxFrame | Untrusted HTML in a script-less sandboxed iframe with strict CSP. Remote images blocked until the user clicks load. | | ProposalCard | AI-suggested action with confirm / dismiss. | | useInboxShortcuts, ShortcutsHelp | j k e r a # c / cmd+enter ?, remappable via keymap. | | EmptyState, ErrorState, ListSkeleton, ThreadSkeleton | Polished states. |

Example

const [selected, setSelected] = useState<string | null>(null)
const composer = useRef<ComposerHandle>(null)

useInboxShortcuts({
  next: () => move(1),
  prev: () => move(-1),
  reply: () => composer.current?.focus(),
  archive: () => archive(selected),
})

<InboxProvider locale={i18n.language}>
  <ConversationList items={rows} selectedId={selected} onSelect={setSelected} onEndReached={loadMore} />
  <ThreadView messages={messages} title={subject} footer={
    <Composer ref={composer} draftKey={selected ?? undefined} identities={identities}
      onSend={({ text, html, identityId, attachments }) => api.send(...)} />
  } />
</InboxProvider>

Security model of HtmlSandboxFrame

  • sandbox="allow-same-origin allow-popups allow-popups-to-escape-sandbox": no allow-scripts, so nothing executes. allow-same-origin exists only to measure the document height from the host; without scripts it cannot be abused, and the CSP also sets default-src 'none'.
  • CSP in the document: no scripts, no network except images; img-src is data: blob: cid: until the user opts in (then https:/http:, optionally rewritten through rewriteImageUrl for an image proxy).
  • The HTML is also sanitized with DOMParser (scripts, iframes, forms, on* attributes, javascript: links removed). The iframe boundary is the real defence; the sanitizer is a second layer.
  • cid: images resolve through message.inlineResources.
  • Styles never leak in or out: the document is isolated.

Drafts, attachments, adapters

draftStore (load/save/remove) defaults to localStorage; swap it for an API. uploadAttachment(file) uploads on pick and returns a server reference; without it, onSend receives the raw File objects.

Borradores y sandbox HTML

  • createLocalDraftStore(prefix) guarda el texto de los borradores en localStorage. Usa un prefijo por usuario/tenant (metacore.inbox.draft:${userId}:) y llama a store.clear() al cerrar sesión o cambiar de cuenta.
  • El iframe del HTML recibido NUNCA debe combinar allow-scripts con allow-same-origin. El sanitizador es propio (el repo no depende de DOMPurify); la frontera real es el sandbox del iframe más la CSP. Con rewriteImageUrl, la CSP limita img-src al origen del proxy.