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 🙏

© 2024 – Pkg Stats / Ryan Hefner

preview-shortcut

v1.1.4

Published

iOS Shortcuts cross-framework preview.

Downloads

7

Readme

Screenshot 2024-05-22 at 20 38 54

Siri Shortcut Preview for the Web.

Build with Vite License Version

Preview Shortcut renders a fairly accurate Siri Shortcut preview from JSON or property list (PLIST) Shortcut data. It works across frameworks, rendering to a single HTML element.

  • Accepts JSON or Property List (.plist) data (will support encrypted in the future).
  • Agnostic to any framework, written in vanilla TypeScript.
  • Displays Shortcut metadata like the icon and name.
  • Dark mode support.

Sites that use it:

Usage

Install

NPM:

npm i preview-shortcut

Yarn:

yarn add preview-shortcut

HTML


<div id="shortcut-preview"></div>

Load a Shortcut

import 'preview-shortcut/css';
import {ShortcutPreview} from 'preview-shortcut';

const preview = new ShortcutPreview({
    selector? : string // default: #shortcut-preview
    name? : string
    url? : string
    data? : object
    header? : boolean // default: true
    meta? : boolean // default: true
    framework7 : Framework7 // defaults to internal instance
});

Dark Mode Support

Screenshot 2023-11-25 at 19 51 04

Work in Progress

  • [x] ~~Framework7 needs to be bundled: instead of borrowing only what we need, we need to bundle and purge what we don't use.~~
  • [x] ~~Inline variables are not properly handled.~~
  • [x] ~~Plans to display more metadata about the Shortcut, like what inputs it accepts, etc.~~
  • [ ] Most actions are not defined, meaning raw action data shows up instead, or they do not look exactly like what they look like in the Shortcuts app.
  • [ ] Optional components for JS frameworks instead of having to use a DOM selector.

These are growing pains and are planned to be resolved by version 1.0.

Dependencies

Colors

Colors are either picked from the Shortcuts app on Mac, pulled from the official Apple color palette, or from Framework7.

Icons

This package uses Framework7 Icons to achieve somewhat similar icons to what is available on Apple Platforms, as the official icons (SF Symbols) can only be used under license. The glyphs for Shortcut icons are provided by atnbueno/shortcut-icons under the MIT license.

Styling

This package includes CSS from Framework7 to make it look as close to iOS as possible with some custom styling added on top to make sure it also looks as close to the Shortcuts app as possible.