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

@scriba-editor/ui

v0.1.1

Published

UI for the Scriba editor as vanilla Web Components (toolbar…).

Readme

@scriba-editor/ui

L'interfaccia di Scriba come Web Components vanilla: barra degli strumenti, barra dei menu, menu, dialog, menu del tasto destro e modalità inline. Funzionano con qualsiasi framework, o senza.

pnpm add @scriba-editor/ui @scriba-editor/view @scriba-editor/core @scriba-editor/i18n @scriba-editor/themes

I componenti parlano con l'editor solo tramite comandi pubblici: un pulsante è abilitato esattamente quando il suo comando può essere eseguito (e non lo è in sola lettura).

Uso

import { createTranslator } from '@scriba-editor/i18n'
import { defineScribaToolbar, defaultToolbarItems } from '@scriba-editor/ui'
import '@scriba-editor/themes/scriba.css'

// `view` è l'EditorView di @scriba-editor/view, `schema` lo schema dell'editor
const t = createTranslator('it')

defineScribaToolbar() // registra <scriba-toolbar> (una sola volta)
const toolbar = document.createElement('scriba-toolbar')
document.querySelector('#editor')!.before(toolbar)
toolbar.translator = t
toolbar.items = defaultToolbarItems(schema)
toolbar.view = view

Le voci aggiuntive dei plugin (liste, tabelle, immagini…) si aggiungono all'array: [...defaultToolbarItems(schema), ...listToolbarItems(schema)]. Esempio completo in Iniziare.

Esportazioni

| Esportazione | Descrizione | | ------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | | ScribaToolbar, defineScribaToolbar() | <scriba-toolbar>: proprietà view, items, translator. | | ScribaMenubar, defineScribaMenubar() | <scriba-menubar>: barra dei menu (File, Modifica…), proprietà view, menus, translator. | | defaultToolbarItems(schema) | Le voci predefinite (cronologia, formati, stili dei blocchi…) per lo schema dato. | | toolbarGroup, historyItems, markItems, blockStyleMenu, clearFormatItem, selectAllItem, nonBreakingSpaceItem, clipboardItems | Costruttori delle singole voci e gruppi. | | ToolbarItem, ToolbarButton, ToolbarGroup, ToolbarMenu, … | Tipi per scrivere voci proprie (id, label, command, isActive, shortcut…). | | contextMenu(view, options) | Menu del tasto destro: sezioni che si applicano dove si clicca. | | MenuPopup, popupEntries | Menu a comparsa riusabili. | | openDialog | Dialog modale (focus trap, ritorno del focus). | | inlineToolbar(container, toolbar) | Modalità inline: la barra compare solo mentre si scrive. Restituisce { update, destroy }. | | createIcon, formatShortcut, isMac | Icone e testo delle scorciatoie (Mod = Ctrl o ⌘). |

Le voci di un pulsante (ToolbarButton) hanno id, label: (t) => string, command, facoltativi icon, shortcut, isActive, isVisible, priority e run (azione personalizzata, ad esempio per aprire un dialog).

Accessibilità

  • role="toolbar" con navigazione a frecce (un solo punto di tabulazione), stato aria-pressed sui pulsanti attivi, aria-haspopup/aria-expanded sui menu, scorciatoie nei suggerimenti.
  • La barra dei menu segue il pattern WAI-ARIA menubar; il menu del tasto destro il pattern menu (anche da tastiera: tasto Menu e Maiusc+F10).
  • I dialog hanno il focus trap e restituiscono il focus alla chiusura; Esc li chiude.
  • Con la barra che non entra nello schermo, le voci meno importanti passano in "Altro".
  • Tutti i testi vengono dal traduttore (@scriba-editor/i18n), mai stringhe fisse.

Dettagli: Accessibilità.

Sicurezza e CSP

I componenti non usano innerHTML né stili inline: gli stili dinamici passano dal CSSOM, quindi funzionano con una CSP rigida (senza unsafe-inline). I testi mostrati (nomi, etichette, parametri di traduzione) sono sempre inseriti come testo, mai come HTML. Per l'aspetto (variabili --scriba-*, tocco, barra fissa) vedi @scriba-editor/themes.