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

@edv4h/usketch-tool-helpers

v0.2.1

Published

uSketch v2 のツールプラグインで再利用可能な state machine helper 集。

Readme

@edv4h/usketch-tool-helpers

uSketch v2 のツールプラグインで再利用可能な state machine helper 集。

@edv4h/usketch-plugin-tool-select で baked されていた drag / resize / rotate / marquee / hover のロジックを単独で取り出して公開しており、サードパーティが「ドラッグで描画」「ハンドルでリサイズ」「マーキーで矩形選択」といったツールを書くときに、コアと同じ挙動 (snap・undo・子要素追従・handle flip 等) を 30 行程度で揃えられる。

@edv4h/usketch-shared@edv4h/usketch-store にしか依存しないので、React なしのサーバサイド計算でも使える。

Install

pnpm add @edv4h/usketch-tool-helpers @edv4h/usketch-shared @edv4h/usketch-store

公開 API

Session helpers

各 helper は pointerdown で生成、pointermoveupdate(event)pointerupcommit() するセッションを返す。commit() は undo 用 Command を返すので、呼び出し側で ctx.commands.execute(...) する。

| 関数 | 用途 | |------|------| | startDragSession(opts) | 選択した shape (子孫含む) を pointer delta だけ平行移動 | | startResizeSession(opts) | single / multi 両対応のリサイズ。8 方向ハンドル、flip 検出、aspect 維持 | | startRotateSession(opts) | 中心点回りで回転、shift で 15° snap、子要素の剛体回転 | | startMarqueeSession(opts) | intersect / contain (alt) の矩形選択 |

Pure helpers

| 関数 | 用途 | |------|------| | trackHover(ctx, event) | hover 中の cursor / shape ID / handle hit を返す | | findShapeAtPoint(ctx, point) | shape vs container の選択優先度を考慮した hit test | | findShapesInRect(ctx, rect, mode) | marquee 風の矩形 hit test | | findHandleAtScreenPoint(...) | screen 座標での 8 方向ハンドル hit test | | findRotationHandleAtScreenPoint(...) | corner 外側の回転ハンドル hit test | | getCursorForHandle(handle) / getRotatedCursorForHandle(handle, deg) | カーソル文字列生成 | | computeRawBounds, applyFlip, getAnchorEdges, fixAnchorDrift, computeRelativeProps, computeMultiResizeUpdates | リサイズ計算の構成要素 |

ドキュメント

英: Building a Tool Plugin 日: ツールプラグインの作り方