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/plugin-slash

v0.1.1

Published

Slash commands for the Scriba editor ("/" opens a menu of blocks and actions).

Readme

@scriba-editor/plugin-slash

Menu a comandi con / (/tabella, /immagine, /titolo): una funzione che TinyMCE non offre di serie. Si scrive / a inizio riga o dopo uno spazio, si filtra scrivendo e si sceglie la voce.

pnpm add @scriba-editor/plugin-slash

Uso

import { keymap } from '@scriba-editor/core'
import {
  basicSlashItems,
  slashCommands,
  slashKeymap,
  type SlashItem,
} from '@scriba-editor/plugin-slash'

const slashItems: SlashItem[] = [
  ...basicSlashItems(schema), // paragrafo e titoli 1-3
  taskSlashItem(schema), // voci fornite da altri plugin
  calloutSlashItem(schema),
  {
    id: 'bullet_list',
    label: (tr) => tr('list.bullet'),
    keywords: ['elenco', 'puntato', 'list', 'ul'],
    icon: 'bulletList',
    command: toggleList(schema.nodes['bullet_list']!, schema.nodes['list_item']!),
  },
]

const plugins = [
  ...slashCommands(slashItems, t),
  keymap(slashKeymap(slashItems, t), { priority: 110 }), // alta priorità
]

Esportazioni

| Nome | Cosa fa | | ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | | slashCommands(items, t) | Plugin del menu / | | slashKeymap(items, t) | Tasti con il menu aperto | | basicSlashItems(schema) | Paragrafo e titoli 1-3, per i tipi presenti nello schema | | SlashItem | { id, label(t), keywords?, icon?, command?, run?(view) }: command agisce sul documento, run serve per azioni che usano la view (es. aprire un dialogo) | | filterItems(items, query, t) | Le voci che corrispondono: ogni parola deve comparire nell'etichetta o nelle parole chiave; prima chi inizia per la ricerca | | fold(text) | Minuscolo senza accenti ("Città" diventa "citta"): la ricerca ignora maiuscole e accenti | | chooseItem(view, item) | Toglie /ricerca ed esegue la voce | | getSlashState(state), slashKey, SlashState | Stato del menu |

Tastiera

/ all'inizio di un blocco o dopo uno spazio apre il menu (mai nel codice in linea né in un blocco di codice). Frecce Su/Giù spostano la selezione, Invio o Tab scelgono, Esc chiude (il testo scritto resta). Uno spazio subito dopo /, o dopo una ricerca senza risultati, chiude il menu e si continua a scrivere. La ricerca è lunga al massimo 40 caratteri.

Accessibilità

Il menu è un listbox sotto la / (sopra se sotto manca spazio) mentre il focus resta nel testo; l'editor punta al menu con aria-controls e alla voce evidenziata con aria-activedescendant, quindi i lettori di schermo annunciano la voce mentre si scrive o ci si muove. Con nessun risultato compare "Nessun comando" (slash.none).

Note

  • Etichette e icone sono testo/SVG creati dal codice, mai HTML. Le voci sono definite da te: il menu non carica nulla dall'esterno.
  • La posizione è impostata via CSSOM, quindi funziona con una CSP rigida.

Vedi plugin e accessibilità.