1.1.3 • Published 15 days ago

preview-shortcut v1.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
15 days ago

Preview Siri Shortcut

Build with Vite License Version

Siri Shortcut cross-framework preview for the web.

  • Accepts JSON or Property List (.plist) data.
  • 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
});

Screenshots

Screenshot 2023-11-25 at 19 50 52

Dark Mode Support

Screenshot 2023-11-25 at 19 51 04

Work in Progress

  • Framework7 needs to be bundled: instead of borrowing only what we need, we need to bundle and purge what we don't use.
  • Inline variables are not properly handled.
  • 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.

1.1.3

15 days ago

1.1.2

15 days ago

1.1.1

17 days ago

1.1.0

17 days ago

1.0.1

2 months ago

1.0.0

6 months ago

0.1.8

6 months ago

0.1.7

6 months ago

0.1.9

6 months ago

0.1.6

6 months ago

0.1.5

10 months ago

0.1.4

11 months ago

0.1.3

11 months ago

0.1.2

11 months ago

0.1.1

11 months ago

0.1.0

11 months ago

0.0.9

11 months ago

0.0.8

11 months ago

0.0.7

11 months ago

0.0.6

11 months ago

0.0.5

11 months ago

0.0.4

11 months ago

0.0.3

11 months ago

0.0.2

11 months ago

0.0.1

11 months ago