PLUGINS &
MARKETPLACE!
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 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.
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.
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.
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.
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.
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 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 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 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 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.
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.)
{
"id": "acme.tidy",
"name": "Tidy",
"version": "1.0.0",
"main": "main.js",
"permissions": ["read", "write"],
"commands": [{ "id": "go", "label": "Tidy up" }]
}const sel = await popcraft.getSelection()
await popcraft.notify(`${sel.length} selected`)
await popcraft.closePlugin()<button id="apply">Arrange</button>
<script>
apply.onclick = () =>
popcraft.postMessage({ type: 'apply' })
</script>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.
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.
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.
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.
Notifications, a panel, its own storage, and its own widgets. A widget plugin needs nothing else.
Layers, selection, pages, styles and variables, plus selection, page and document events.
Create, change and delete layers, set the selection and text, add paint styles, set variables.
Render layers to PNG, JPG, WEBP, SVG or PDF.
fetch, XHR and WebSockets, and remote images and fonts. Blocked unless asked for, and it must be explained in the description.
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.
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.
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.
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.
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.
Publishing, review and versions
THE MARKETPLACE
KA-CHING!YOUR WORKSPACE
TEAM!IDS ARE YOURS
MINE!ALWAYS UP
+1!FROM CI
BEEP!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.
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.
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.
Feature request, then wait
| THE OLD WAY | IN POPCRAFT |
|---|---|
| File a feature request and hope | Write a command in an afternoon and run it today |
| Paste a script into a console | A sandboxed plugin with permissions you approve |
| Email a zip and an install guide | Install from file, or from the marketplace in one click |
| Everyone installs it by hand | An admin turns it on for the whole workspace |
| A shared poll lives in another app | A widget on the canvas, saved in the file |
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.
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.
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.