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

slate-poor-mentions

v0.1.2

Published

A Naive and Poor mention plugin for SlateJS

Readme

slate-poor-mentions

NPM version

Mentions plugin for SlateJS. You can have a try by pressing @ at this repo demo.

slate-poor-mentions

Install

yarn add slate-poor-mentions

Simple Usage

import MentionsPlugin from "slate-poor-mentions";
const mentions = [{ name: "@ Tom" }, { name: "@ Jerry" }];
export default MentionsPlugin({ mentions } /* options */);

Options

Consider a slate text like

 <paragraph> Here is $ To<cursor/>m </paragraph>

The plugin options are an object of

  • mentions : Array<{name: string}> (necessary)

An array of mentions, in each mention object, a name property is necessary as the string for mention replacement.

  • beforeMatchRegex: RegExp (optional)

The pattern matches the text between the mention triggering char and the cursor. In this case, it shall matches $ To By default, this pattern will consider {$ and @ as mention triggering char.

  • afterMatchRegex: RegexExp (optional)

The pattern matches the text between the cursor and mention ending char in text context. If no match is found, it will use the editing text ending in the cursor position to match the mention.

By default, this pattern will match }

  • getText: string => string (optional)

Triming the mention triggering and ending chars to compare the editing text with mention texts.

By default, the getText will remove all chars not in alpha-beta and numbers in the double ends.

  • MentionItemChild: React.Component<{mention: Mention, text: string}> (optional)

Render the mention items with a customized component. The props is a object containing two properties:

  • mention: {name: string} The mention object of mentions : Array<Mention> passed to plugin.
  • text: string the editing text captured by beforeMatchRegex and afterMatchRegex. Used for highlighting the matched text in mention items for example.

By default, it is only <span>{mention.name}</span>

Styling

Containers

To style the container, you can specify the CSS for ul.RichEditor-mention-menu. To style the single mention item, you can specify CSS for ul.RichEditor-mention-menu > li or customize MentionItemChild in creating the plugin.

Padding

By the relative position between selection and mention pop-up, the mention container ul.RichEditor-mention-menu is decorated by classes RichEditor-mention-position-top, RichEditor-mention-position-bottom, RichEditor-mention-position-left and RichEditor-mention-position-right respectively. If you always wants a 10px * 10 px distance between selection and mention pop up, you can

.RichEditor-mention-position-top {
  margin-top: 10px;
}

.RichEditor-mention-position-bottom {
  margin-top: -10px;
}

.RichEditor-mention-position-left {
  margin-left: 10px;
}

.RichEditor-mention-position-right {
  margin-right: -10px;
}

Why poor in package name?

Because all sensible names are taken in npm. :lol