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

@singapore-editor/plugin-ui

v0.2.15

Published

Shared hover tooltips and anchored popups for Singapore editor plugins.

Readme

@singapore-editor/plugin-ui

Shared hover tooltips, anchored popups and optional touch selection chrome for Singapore editor plugins.

Part of Singapore. A code editor for the browser that keeps every version.

Install

npm install @singapore-editor/core @singapore-editor/plugin-ui

Usage

Show a standalone tooltip. Editor plugins can also register shared hover participants.

import { createTooltipController } from '@singapore-editor/plugin-ui/tooltip'
import '@singapore-editor/core/style.css'

const tooltip = createTooltipController({
  document,
  themeSource: document.body,
  reentryElement: document.body,
})
tooltip.show({
  anchor: new DOMRect(24, 80, 100, 20),
  hoverText: '**Hello** from a plugin',
  theme: null,
})
// Call tooltip.dispose() when removing the popup.

API highlights

  • EDITOR_HOVER_PARTICIPANT lets plugins answer into the shared hover.
  • createTooltipController() controls a tooltip.
  • createAnchoredSurface() places a popup beside an anchor.
  • createTouchSelectionPlugin() adds touch edit actions and optional haptics.

Generated API reference

Touch selection menu

Status: experimental. The menu is in the source only: @singapore-editor/plugin-ui 0.1.0 on npm has no touch plugin, and mobile is not a supported target. The gestures it reacts to live in @singapore-editor/core. See Touch selection for what tests cover.

Add createTouchSelectionPlugin({ haptics: true }) to the editor's plugins option. Import the factory from @singapore-editor/plugin-ui/touch-selection-plugin.

The plugin opens a light/dark touch menu after a word, line or document selection gesture settles. Cut, Copy, Paste and Select all use core input commands. Undo and Redo appear when the editable document has the corresponding history. Desktop context menus keep their existing ownership. Removing the plugin removes its menu, styles and listeners; core touch selection continues to work.

items(context) appends host actions. Its context contains selectedText and editable; each item supplies id, label, optional disabled and failureMessage, and run(): void | Promise<void>. The callback runs in the menu click's activation turn. Pending actions settle before dismissal, and failures keep the action available with retry guidance.

haptics defaults to false. Supported Vibration API devices get light ticks on selection start, changed word/line snaps and menu appearance. Safari's supported native switch control can tick on a trusted menu tap through an associated hidden switch; keyboard and scripted activations still run the action. Current iOS blocks programmable gesture-time haptics. Physical iPhone feedback from the hidden switch remains unverified. Browser tests cover action dispatch, focus and accessibility on engines exposing that control. See Browser quirks.

In the Singapore family

@singapore-editor/core owns the editor view. Plugins use this package to share hover content and position popups.

Singapore README · Documentation

License

MIT. License