← Back to PopCraft

PLUGINS &
MARKETPLACE!

Commands, panels, canvas widgets and importers, in a sandbox with permissions you approve. Write one in an afternoon, or install one somebody else already wrote. Then browse themes, templates, libraries, brushes and shaders while you're there.
TRY IT FREE →
Browse the marketplace from the editor0:07

The editor with a landing page open. The Marketplace button on the right rail opens the marketplace: plugins, templates, libraries and themes, with categories and a search. Templates and then Motion narrow it to animated templates, and clicking one (Synthwave tunnel visualizer) opens its listing, with its preview and description. Installing needs an account.

THE PITCH

The editor does a lot. Your team does something else.

Every team has the job the design tool doesn't do. Renaming eighty layers to a pattern. Checking every text layer against the brand's contrast rules. Importing a file format from 2003 that one client still sends. You can file a feature request and wait, or you can write forty lines of JavaScript.

PopCraft plugins are small web bundles: a JSON manifest, a JavaScript file, and an optional HTML panel. They run in a sandbox, talk to the file through an asynchronous popcraft API, and can only do what their manifest asks for and you allow. When one is good, publish it, and the rest of PopCraft can install it.

4
permissions, all opt-in
6
kinds on the marketplace
5 MB
package limit to publish
64 KB
of shared state per widget
THE SHOP

A marketplace inside the editor

Click Marketplace on the editor's right rail. Tabs split it by kind: plugins, themes, templates, libraries, brushes and shaders, each with its own categories, plus a search. Click a listing for its preview and description, and install it. Installing needs an account.

The same listings are on the website's Marketplace page, in the same order, browsable without signing in. Click install there and you are sent to the app to sign in first.

Plugins and theme packs in the editor0:06

A landing page in the editor. Marketplace on the right rail opens the marketplace, and its kind tabs switch to Plugins and then to Themes, each with its own listings.

FROM A FILE

Install, allow, run

A plugin you were sent is a .zip or a single .json. Open the main menu, then Manage plugins, then Install from file. It is listed with its commands and the permissions it asks for.

Click a command. The first time, PopCraft lists the permissions and waits for Allow and run. You see the prompt again only if an update asks for more. In the clip, Arrange in Grid asks for a column count in its own panel and lays the brainstorm stickies out in a tidy grid.

Install a plugin from a file, then run it0:11

A brainstorm board with its sticky notes selected. From ⋯, Manage plugins… opens the plugin manager, and Install from file… installs Arrange in Grid from its package: it is listed with its commands and the permissions it asks for. Its Grid command is clicked and the permissions are allowed; its panel asks for the gap and the columns, 4 is typed, and Arrange lays the stickies out in a tidy grid.

FOUR SHAPES

What a plugin can be

Most plugins are one of these, or two of them stuck together. Every clip is one of the open example plugins, installed from its file and run on a real template.

A command: Pop Palette writes colour styles0:06

A launch post with its headline selected and Pop Palette installed. Run calls the plugin’s main script, which writes to the file through the popcraft API: a pop-art palette appears as colour styles under Local colors, in one undo step.

A panel: Rename Layers renames eight at once0:08

A brainstorm board with its eight sticky notes selected and Rename Layers installed. Run opens the plugin’s own panel beside the canvas, a sandboxed page that reads the selection. The pattern is set to “Idea #” and Rename renames all eight layers, which the layers panel shows.

A widget: a poll that fills as people click0:08

A retro board with the Pow Poll example widget installed. Insert poll puts the widget in the middle of the view, and clicking its options casts votes: the bars fill in. The state is saved in the file, so everyone in it sees the same poll.

A panel and a command: stickies in one row0:06

A brainstorm board with its sticky notes selected and the Arrange in Grid example installed. Its Single row command is clicked, the permissions are allowed on the first run, its small panel opens prefilled with one row, and Arrange lines the stickies up in one evenly spaced row.

UNDER THE LID

The anatomy of a plugin

Four pieces, and only the first two are required. (A theme pack needs just the manifest: it contributes data, not code.)

manifest.json
Who it is, what it may do
{
  "id": "acme.tidy",
  "name": "Tidy",
  "version": "1.0.0",
  "main": "main.js",
  "permissions": ["read", "write"],
  "commands": [{ "id": "go", "label": "Tidy up" }]
}
main.js
Runs when a command is picked
const sel = await popcraft.getSelection()
await popcraft.notify(`${sel.length} selected`)
await popcraft.closePlugin()
ui.html
Optional panel beside the canvas
<button id="apply">Arrange</button>
<script>
  apply.onclick = () =>
    popcraft.postMessage({ type: 'apply' })
</script>
widget
A canvas object with state
popcraft.widget.register({
  initialState: { count: 0 },
  render: s => ({ type: 'Text',
    characters: String(s.count),
    onClick: () => { s.count++ } }),
})

The main script runs invisibly when someone picks one of your commands. It has no DOM access to the editor; every call goes through popcraft and returns a promise. The panel opens beside the canvas when you call showUI, from 160×120 up to 900×900 pixels, and passes messages to the main script. The types ship as @popcraft/plugins on npm, generated from the runtime itself, so autocomplete never disagrees with what actually runs.

A manifest can also contribute things without code: UI themes, sidebar panels, and importers.

WIDGETS

Objects with a memory

A widget is the fun one. Your plugin describes what it looks like for a given state, as a small tree of auto layout frames and text. A click runs your code, which changes the state, and the widget redraws.

The state and the picture are saved in the file, so everyone in it sees updates live, even people who never installed your plugin. Clicking needs the plugin and edit access. Clicks are ordinary edits: undo takes them back, and they show in version history. Widgets need no permissions at all. A tree can be 400 elements and 16 levels deep, with up to 64 KB of JSON state.

Insert a widget, then click it0:07

A comic page with the Panel Checklist widget installed. Its Insert checklist command places the widget in the middle of the view: a checklist of pencils, inks, colours and letters. Clicking an item ticks it off; the widget redraws and saves its state in the file, for every collaborator.

TRUST ISSUES

Five permissions, counting the free one

A plugin can only do what its manifest asks for. People see the list before the first run and can decline. Calls outside the approved set fail with an error.

none

Notifications, a panel, its own storage, and its own widgets. A widget plugin needs nothing else.

read

Layers, selection, pages, styles and variables, plus selection, page and document events.

write

Create, change and delete layers, set the selection and text, add paint styles, set variables.

export

Render layers to PNG, JPG, WEBP, SVG or PDF.

network

fetch, XHR and WebSockets, and remote images and fonts. Blocked unless asked for, and it must be explained in the description.

THE FIRST RUN

You see the asks before it runs

The Contrast Checker example wants to read the file and to select the layers that fail. So on its first run, the prompt lists reading and changing the file, and nothing else. No network, no export.

That is the whole security model, in one dialog: an isolated frame with its own opaque origin, no way to read the editor page, cookies, other plugins or your account, and only the permissions you allowed. On the marketplace, reviewers check the asks too.

The permissions a manifest asks for, at the first run0:06

A brainstorm board, with the Contrast Checker plugin installed. Its Check the whole page command is run from the plugin manager. The first run lists what its manifest asks for — reading and changing the file — and Allow and run lets it run; the result shows in its notice.

IMPORTERS

Teach PopCraft a file format

A plugin can add formats to File, Import, Home's New, Import and the Home drop zone. Declare the extensions it accepts in the manifest, and when somebody picks a matching file, your command runs with the bytes. Importing as a new file follows the same rules as New File; importing into the open document needs edit access.

The built-in formats go through the same path, so a plugin format sits beside them as an equal. The Publisher import on the marketplace works this way. A converter too big for the 5 MB package can fetch its WebAssembly at run time, with the network permission.

Import into the open file, the same path importers use0:03

A launch post. ⋯ → Import into this file… opens the file picker, and a .popcraft file (a quote card) is picked: its pages and layers come into the open document. A plugin’s importers are offered on this same path, beside the built-in formats.

Publish a package from the plugin manager0:05

Signed in, in the editor. ⋯ → Manage plugins… opens the plugin manager, and Publish from file… sends the Panel Checklist widget’s package to the marketplace. The first version of a new plugin waits for review before it is listed.

SHIP IT

Publishing, review and versions

SEND THE FILE

Anyone you send the .zip or .json to can install it from file. No account, no review.

THE MARKETPLACE

Publish from the plugin manager. The first version is reviewed; after that it is listed for everyone.

YOUR WORKSPACE

An owner or admin turns an approved plugin on for the workspace. Members get it and stay on the latest version.

IDS ARE YOURS

The first account to publish an id owns it. Pick a prefix like acme. and keep it: a new id is a new plugin.

ALWAYS UP

Every version must be higher than the last. Versions can't be replaced or deleted, so nobody gets a surprise.

FROM CI

A personal access token with the marketplace publish scope posts plugins, packs and templates from your repo.

Review is quick to describe: a reviewer checks that the plugin does what its name says, asks only for what it needs, explains any network use, doesn't send file contents somewhere unexpected, and doesn't dress up as PopCraft UI. A rejected version comes back with a note. A later update is reviewed again only if it asks for a permission no approved version had.

STEAL THIS

The examples are open source

The getpopcraft/plugins repository has one example of every marketplace kind, one folder each, and the SDK beside them. The plugins: Arrange in Grid, Rename Layers, Contrast Checker and Pop Palette. The widgets: a checklist, Pow Poll and a vote counter. Plus theme packs, brush packs, a shader pack and templates.

Its CI publishes all of them to the marketplace from the repo. Copy the examples folder, the publish script and the workflow, and you have a working pipeline before lunch.

FROM ZERO

Your first plugin in six moves

  1. Write a manifest

    An id with a prefix you own, a version, the commands, and only the permissions you use.
  2. Write main.js

    Talk to the file through the popcraft API. Add @popcraft/plugins for autocomplete in your editor.
  3. Add a panel if you need one

    ui.html opens beside the canvas with showUI, and trades messages with your main script.
  4. Install from file

    Main menu, Manage plugins, Install from file. Pick the .zip or the single-file .json.
  5. Run it, fix it, run it again

    Commands show in the plugin manager. The permission prompt shows on the first run.
  6. Publish

    Publish from file, or from CI with a token. The first version goes to review, then it is listed.
THE OLD WAY

Feature request, then wait

THE OLD WAYIN POPCRAFT
File a feature request and hopeWrite a command in an afternoon and run it today
Paste a script into a consoleA sandboxed plugin with permissions you approve
Email a zip and an install guideInstall from file, or from the marketplace in one click
Everyone installs it by handAn admin turns it on for the whole workspace
A shared poll lives in another appA widget on the canvas, saved in the file
GO SHOPPING

Browse, or build

Look around the Marketplace without signing in. Or open the getting started guide and have your first plugin running in ten minutes.

ASKED & ANSWERED

Questions, answered

What can a plugin do?

Read and edit the open file, show its own panel, export layers, add file formats to Import, and put interactive widgets on the canvas. It does only what its manifest’s permissions allow, and you approve those on the first run.

Can a plugin read my account or other files?

No. Every plugin runs in a sandboxed frame with its own opaque origin. It cannot read the editor page, cookies, other plugins or your account, and it has no network access unless it asks for the network permission.

Do plugins work offline?

Yes. Marketplace plugins are downloaded to your device and run offline like any other plugin, unless they use the network permission to talk to a service.

What is on the marketplace besides plugins?

Theme packs, templates, component libraries, brushes and shaders. The editor and the public Marketplace page list the same items, with the same tabs.

Is every plugin reviewed?

A plugin’s first version is reviewed before it is listed, and so is any later version that asks for a permission no approved version had. Other updates are approved straight away.

Can my team share a plugin without publishing it?

Yes. Send the .zip or .json and anyone can install it from file. Or publish it, and a workspace owner or admin can install an approved plugin for everyone in the workspace.

Can I sell a plugin?

The marketplace does not take payment. The worked example, Popprint, is a marketplace plugin that sends people to its own site, where it takes payment itself.

THE MANUAL, FOR THE DETAILS

KLIK! YOUR TURN.

Plugins, widgets, themes, templates, brushes and shaders, from you or the community. Free to start, in your browser or on your Mac.

OPEN POPCRAFT →