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

sns-boardview

v0.0.32

Published

a "preact" editor component for "shareable-note-stickers"

Readme

sns-boardview

a "preact" editor component for "shareable-note-stickers"

NoteStickers Screenshot

Overview

While shareable-note-stickers implements the underlying data model for a shareable hierarchical collection of "boards" containing scriptable widgets (called "stickers"), this module provides a preact component that displays one of these boards of stickers and offers all methods to visually select and edit them.

While the data model is principally shareable, you will have to add a "sharing adapter" such as the sns-collabs-adapter to actually provide that feature.

Finally, to get a real application, you'll have to combine both modules and add a proper user interface - similar to NoteStickers.

Because of this modularity, it is not too difficult to use a different sharing framework (such as Y.js or automerge), modify the user interface according to your personal needs or even develop a headless tool that analyzes and/or changes the shared data without user intervention.

Usage

"sns-boardview" is intended for being used as a module within a "host application". In order to use it, simply import the SNS_BoardView class:

  import { SNS_BoardView } from '[sns-boardview](https://rozek.github.io/sns-boardview/dist/sns-boardview.modern.js)'

Then, as part of your user interface, instantiate the SNS_BoardView like any other preact component:

  html`<${SNS_BoardView}
    PUX=${...}
    Mode=${...} Board=${...} StickerList=${...}
    LassoMode="..." selectedStickers=${...}
    onSelectionChange=${(selectedStickers:SNS_Sticker[]) => {...}}
    onGeometryChange=${(StickerList:SNS_Sticker[],GeometryList:SNS_Geometry[]) => {...}}
    SnapToGrid=${...} GridWidth=${...} GridHeight=${...}
  />`

Attributes

SNS_BoardView handles the following attributes:

  • PUX - specifies a previously created ProtoUX instance
  • Classes - specifies an optional string with additional CSS classes that should be used to style this SNS_BoardView
  • Board - specifies the SNS_Board that should be shown (and may be null if there is no SNS_Project or the current SNS_Project does not yet contain any boards)
  • StickerList - specifies the actual list of stickers that should be shown (usually, its just the Board.StickerList)
  • Placeholder - specifies a text that is shown when Board is not defined (or null)
  • Mode - in edit mode, all stickers can be principally selected and layouted (unless they are locked or not visible). In 'run' mode, only the those stickers can be selected and layouted that support builtinSelection or builtinDragging
  • SelectionLimit - SNS_BoardView allows multiple stickers to be selected simultaneously. If you want to limit the number of selected stickers, just provide the limit here
  • selectedStickers - specifies a callback with the signature selectedStickers:SNS_Sticker[] that is invoked (with the new list of selected stickers) whenever the list of selected stickers has changed
  • onSelectionChange - specifies a callback with the signature Sticker:SNS_Sticker that is invoked whenever a sticker was deselected
  • onStickerSelected - specifies a callback with the signature Sticker:SNS_Sticker that is invoked whenever a sticker was selected
  • onStickerDeselected - specifies a callback with the signature Sticker:SNS_Sticker that is invoked whenever a sticker was deselected
  • SelectionFrameStyle - specifies CSS settings to style selection frames (default is dotted 2px orangered)
  • SelectionHandleStyle - specifies CSS settings to style selection handles (default is background:orangered; border:solid 1px darkgray)
  • LassoMode - when set to enclose the selection lasso has to fully enclose a sticker in order to select it, when set to touch, the lasso only has to "touch" it
  • onGeometryChange - specifies a callback with the signature StickerList:SNS_Sticker[], GeometryList:SNS_Geometry[] that is invoked whenever the selectedStickers where moved or sized by the SNS_BoardView
  • SnapToGrid - when set to true, SNS_BoardView constrains the position and size of visually layouted stickers to multiples of GridWidth in horizontal and multiples of GridHeight in vertical direction
  • GridWidth - specifies the horizontal distance between adjacent grid points while SnapToGrid is true
  • GridHeight - specifies the vertical distance between adjacent grid points while SnapToGrid is true

Methods

Actually, SNS_BoardView offers only one meaningful method:

  • rerender () - call this method whenever the specified Board, its StickerList or any of its contents have changed. preact will then take care that only those HTML elements will be rerendered that need to.

License

MIT License