@popcraft/plugins 1.0.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +58 -5
- package/dist/generated/runtime.d.ts +1 -1
- package/dist/generated/runtime.d.ts.map +1 -1
- package/dist/generated/runtime.js +1 -1
- package/dist/generated/runtime.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/runtime/main.d.ts +363 -1
- package/dist/runtime/main.d.ts.map +1 -1
- package/dist/runtime/main.js +151 -1
- package/dist/runtime/main.js.map +1 -1
- package/dist/types.d.ts +55 -2
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -23,7 +23,8 @@ Full developer guide: <https://popcraft.app/docs/plugins>.
|
|
|
23
23
|
| `src/runtime/` | The `popcraft` global itself — the RPC client, the main-script API, the UI shim. Compiled to a self-contained IIFE and injected into the plugin sandbox by the editor. |
|
|
24
24
|
| `src/host.ts` | `buildMainDocument` / `buildUIDocument`: the sandboxed documents, with their CSP. |
|
|
25
25
|
| `src/types.ts`, `src/widget.ts` | The manifest, node and widget types. |
|
|
26
|
-
| `examples/` |
|
|
26
|
+
| `examples/` | One example of every marketplace kind, published to the marketplace by CI. Not in the npm package. |
|
|
27
|
+
| `scripts/publish.mjs` | Builds and publishes the examples (see [Publishing](#publishing-to-the-marketplace)). |
|
|
27
28
|
|
|
28
29
|
**The types are generated, not written.** `dist/generated/global.d.ts` declares the ambient
|
|
29
30
|
`popcraft` global as `PopCraftApi`, which is `ReturnType<typeof createMainApi>` — the type of the
|
|
@@ -32,15 +33,67 @@ no second description to keep in step.
|
|
|
32
33
|
|
|
33
34
|
## The examples
|
|
34
35
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
One folder per marketplace kind:
|
|
37
|
+
|
|
38
|
+
| Folder | Kind | Examples |
|
|
39
|
+
| --- | --- | --- |
|
|
40
|
+
| [`plugins/`](examples/plugins) | Plugins | [`arrange-grid`](examples/plugins/arrange-grid) (commands, a UI, storage), [`rename-layers`](examples/plugins/rename-layers) (UI panel, events, storage), [`contrast-checker`](examples/plugins/contrast-checker) (WCAG checks, `findNodes`, `setSelection`), [`pop-palette`](examples/plugins/pop-palette) (paint styles), [`storefront-preview`](examples/plugins/storefront-preview) (a File → Export format built on `getStorefront()`) |
|
|
41
|
+
| [`widgets/`](examples/widgets) | Canvas widgets (plugins that register a widget) | [`vote-counter`](examples/widgets/vote-counter), [`poll`](examples/widgets/poll), [`checklist`](examples/widgets/checklist) (named handlers) |
|
|
42
|
+
| [`themes/`](examples/themes) | Theme packs (data-only plugins) | [`comic-themes`](examples/themes/comic-themes) (two light themes), [`comic-noir`](examples/themes/comic-noir) (semi-dark) |
|
|
43
|
+
| [`brushes/`](examples/brushes) | Brush packs | [`comic-inkers`](examples/brushes/comic-inkers): liner, brush pen, stipple |
|
|
44
|
+
| [`shaders/`](examples/shaders) | Shader packs | [`pop-shaders`](examples/shaders/pop-shaders): Ben-Day dots, speed burst, misregistration (one `.wgsl` per shader) |
|
|
45
|
+
| [`templates/`](examples/templates) | Templates | [`pop-cover`](examples/templates/pop-cover), [`halftone-quote`](examples/templates/halftone-quote), [`comic-kanban`](examples/templates/comic-kanban), [`pixel-platformer`](examples/templates/pixel-platformer) (a playable game: layers with physics roles) |
|
|
46
|
+
|
|
47
|
+
Component libraries are the one kind with no example here: a library is published from a cloud file in
|
|
48
|
+
the editor (**Assets → Publish library**), not from files in a repo.
|
|
39
49
|
|
|
40
50
|
Install one from **Main menu → Manage plugins… → Install from file…**, with either a `.zip` of the
|
|
41
51
|
folder (`manifest.json` at the root) or a single-file `.json` bundle:
|
|
42
52
|
`{ "manifest": { … }, "main": "…code…", "ui": "<html>…" }`.
|
|
43
53
|
|
|
54
|
+
## Importers and exporters
|
|
55
|
+
|
|
56
|
+
A plugin can add a File → Import or File → Export format in its manifest:
|
|
57
|
+
|
|
58
|
+
```json
|
|
59
|
+
"contributes": {
|
|
60
|
+
"importers": [{ "id": "pub", "label": "Publisher (.pub)", "accept": [".pub"] }],
|
|
61
|
+
"exporters": [{ "id": "ai", "label": "Adobe Illustrator (.ai)", "extension": ".ai" }]
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
An importer runs with `popcraft.importMode` and `popcraft.importFile` set, and builds the document with the
|
|
66
|
+
editor methods. An exporter runs with `popcraft.exportRequest` set, renders what it needs with `exportNode`, and
|
|
67
|
+
hands the file back with `popcraft.saveExport({ name, bytes })`.
|
|
68
|
+
|
|
69
|
+
An exporter for a store reads the open page as a storefront with `popcraft.getStorefront()`: each page's HTML with
|
|
70
|
+
the store's data marked rather than filled (`{{page.title}}`, `{{item.price}}`, lists between
|
|
71
|
+
`<!-- pc:each list="Products" schema="commerce.product" as="item" -->` and `<!-- pc:end -->`, forms with
|
|
72
|
+
`data-pc-action`), and the collections it reads with their schema and sample records. It turns those marks into its
|
|
73
|
+
platform's templates; [`storefront-preview`](examples/plugins/storefront-preview) fills them with the samples instead.
|
|
74
|
+
|
|
75
|
+
## Publishing to the marketplace
|
|
76
|
+
|
|
77
|
+
Each item folder holds one of `manifest.json` (a plugin, widget or theme pack), `pack.json` (a brush or
|
|
78
|
+
shader pack: `{ meta, payload }`, images and `.wgsl` files referenced by path) or `template.json`
|
|
79
|
+
(`{ meta, payload }`). `scripts/publish.mjs` turns each folder into what the REST API takes and posts it:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
node scripts/publish.mjs --dry-run # build and check everything
|
|
83
|
+
POPCRAFT_TOKEN=pop_… node scripts/publish.mjs # publish
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
The `Marketplace` workflow runs the dry run on pull requests and publishes on `main`. It needs:
|
|
87
|
+
|
|
88
|
+
- the secret **`POPCRAFT_TOKEN`**: a personal access token (Account → Personal access tokens) with the
|
|
89
|
+
**`marketplace:publish`** scope, owned by the account the listings should belong to;
|
|
90
|
+
- optionally the variable **`POPCRAFT_URL`** to target another deployment (default `https://popcraft.app`).
|
|
91
|
+
|
|
92
|
+
Plugins publish when their `version` is new: bump it to ship a change (an existing version is skipped).
|
|
93
|
+
Packs and templates are keyed by `meta.localId` and update in place when their folder changes. New plugin
|
|
94
|
+
versions go through marketplace review; new packs and templates start private, and you list them once
|
|
95
|
+
from the editor (**Publish** → *List on the marketplace*). After that, updates stay listed.
|
|
96
|
+
|
|
44
97
|
## Sandbox
|
|
45
98
|
|
|
46
99
|
Each plugin runs in an opaque-origin iframe (`sandbox="allow-scripts"`), talks to the editor only
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** The `popcraft` global for a plugin main script, as injectable inline script. */
|
|
2
|
-
export declare const MAIN_RUNTIME = "\"use strict\";\n(() => {\n // src/runtime/rpc.ts\n function createRpcClient() {\n let port = null;\n const queue = [];\n const pending = {};\n const listeners = {};\n let nextId = 1;\n function send(msg) {\n if (port) port.postMessage(msg);\n else queue.push(msg);\n }\n function call(method, params) {\n return new Promise((resolve, reject) => {\n const id = nextId++;\n pending[id] = { resolve, reject };\n send({ kind: \"rpc\", id, method, params });\n });\n }\n function emit(event, data) {\n for (const cb of (listeners[event] || []).slice()) {\n try {\n cb(data);\n } catch (e) {\n console.error(e);\n }\n }\n }\n window.addEventListener(\"message\", (e) => {\n const data = e.data;\n if (e.source !== window.parent || !data || data.type !== \"popcraft-plugin-port\" || port) return;\n port = e.ports[0];\n port.onmessage = (ev) => {\n const m = ev.data || {};\n if (m.kind === \"result\" && m.id !== void 0 && pending[m.id]) {\n const p = pending[m.id];\n delete pending[m.id];\n if (m.error) p.reject(new Error(m.error));\n else p.resolve(m.result);\n } else if (m.kind === \"event\" && m.event) {\n emit(m.event, m.data);\n }\n };\n for (const msg of queue.splice(0)) port.postMessage(msg);\n });\n return {\n call,\n send,\n on(event, cb) {\n (listeners[event] = listeners[event] || []).push(cb);\n },\n off(event, cb) {\n listeners[event] = (listeners[event] || []).filter((x) => x !== cb);\n }\n };\n }\n\n // src/runtime/main.ts\n function clone(v) {\n return v === void 0 ? {} : JSON.parse(JSON.stringify(v));\n }\n function createMainApi(rpc = createRpcClient()) {\n const uiHandlers = [];\n let uiOnMessage = null;\n const uiQueue = [];\n function deliverUI(msg) {\n for (const cb of uiHandlers) {\n try {\n cb(msg);\n } catch (e) {\n console.error(e);\n }\n }\n if (typeof uiOnMessage === \"function\") {\n try {\n uiOnMessage(msg);\n } catch (e) {\n console.error(e);\n }\n }\n }\n function flushUI() {\n if (uiHandlers.length || typeof uiOnMessage === \"function\") uiQueue.splice(0).forEach(deliverUI);\n }\n rpc.on(\"uimessage\", (msg) => {\n if (!uiHandlers.length && typeof uiOnMessage !== \"function\") uiQueue.push(msg);\n else deliverUI(msg);\n });\n let widgetDef = null;\n const widgetQueue = [];\n function renderWidget(state) {\n const handlers = {};\n function walk(el, path) {\n if (!el || typeof el !== \"object\") return el;\n const out = {};\n for (const k of Object.keys(el)) {\n const v = el[k];\n if (k === \"children\") {\n out.children = (Array.isArray(v) ? v : [v]).filter((c) => c !== null && c !== void 0 && c !== false).map((c, i) => walk(c, path + \".\" + i));\n } else if (k === \"onClick\" && typeof v === \"function\") {\n handlers[path] = v;\n out.onClick = path;\n } else {\n out[k] = v;\n }\n }\n return out;\n }\n return { tree: walk(widgetDef.render(state), \"root\"), handlers };\n }\n function initialWidgetState() {\n const s = widgetDef && widgetDef.initialState;\n return clone(typeof s === \"function\" ? s() : s);\n }\n function commitWidget(nodeId, state) {\n return rpc.call(\"widgetUpdate\", { id: nodeId, state, tree: renderWidget(clone(state)).tree });\n }\n function handleWidgetClick(e) {\n Promise.resolve().then(() => {\n const state = clone(e.state);\n const rendered = renderWidget(state);\n const h = rendered.handlers[e.handler] || widgetDef.handlers && widgetDef.handlers[e.handler];\n if (typeof h !== \"function\") return;\n return Promise.resolve(h(state, { nodeId: e.nodeId })).then((ret) => commitWidget(e.nodeId, ret === void 0 ? state : ret));\n }).catch((err) => rpc.send({ kind: \"error\", message: String((err == null ? void 0 : err.message) || err) }));\n }\n rpc.on(\"widgetclick\", (e) => {\n if (widgetDef) handleWidgetClick(e);\n else widgetQueue.push(e);\n });\n const popcraft = {\n /** Which menu command the user picked, or null when the plugin ran some other way. */\n command: null,\n getSelection: () => rpc.call(\"getSelection\"),\n setSelection: (ids) => rpc.call(\"setSelection\", { ids }),\n getNode: (id) => rpc.call(\"getNode\", { id }),\n findNodes: (query) => rpc.call(\"findNodes\", query || {}),\n getCurrentPage: () => rpc.call(\"getCurrentPage\"),\n createNode: (type, props) => rpc.call(\"createNode\", { type, props: props || {} }),\n updateNode: (id, props) => rpc.call(\"updateNode\", { id, props }),\n deleteNode: (id) => rpc.call(\"deleteNode\", { id }),\n setText: (id, characters) => rpc.call(\"setText\", { id, characters }),\n getStyles: () => rpc.call(\"getStyles\"),\n createPaintStyle: (name, paints) => rpc.call(\"createPaintStyle\", { name, paints }),\n getVariables: () => rpc.call(\"getVariables\"),\n setVariableValue: (variableId, modeId, value) => rpc.call(\"setVariableValue\", { variableId, modeId, value }),\n exportNode: (id, options) => rpc.call(\"exportNode\", { id, options: options || {} }),\n openExternal: (url) => rpc.call(\"openExternal\", { url }),\n notify: (message, options) => rpc.call(\"notify\", { message: String(message), error: !!(options && options.error) }),\n showUI: (options) => rpc.call(\"showUI\", options || {}),\n hideUI: () => rpc.call(\"hideUI\"),\n /** Ends the run. The optional message is shown as a notification. */\n closePlugin: (message) => rpc.call(\"closePlugin\", { message }),\n storage: {\n get: (key) => rpc.call(\"storageGet\", { key }),\n set: (key, value) => rpc.call(\"storageSet\", { key, value })\n },\n ui: {\n get onmessage() {\n return uiOnMessage;\n },\n set onmessage(cb) {\n uiOnMessage = cb;\n flushUI();\n },\n postMessage: (msg) => rpc.send({ kind: \"toUI\", data: msg }),\n on: (cb) => {\n uiHandlers.push(cb);\n flushUI();\n }\n },\n widget: {\n register(def) {\n if (!def || typeof def.render !== \"function\") throw new Error(\"popcraft.widget.register needs a render(state) function\");\n widgetDef = def;\n widgetQueue.splice(0).forEach(handleWidgetClick);\n },\n insert(options) {\n if (!widgetDef) return Promise.reject(new Error(\"Call popcraft.widget.register first\"));\n const o = options || {};\n const state = o.state !== void 0 ? clone(o.state) : initialWidgetState();\n return rpc.call(\"widgetInsert\", { state, tree: renderWidget(state).tree, x: o.x, y: o.y });\n },\n getState: (nodeId) => rpc.call(\"widgetGet\", { id: nodeId }),\n setState(nodeId, state) {\n if (!widgetDef) return Promise.reject(new Error(\"Call popcraft.widget.register first\"));\n return commitWidget(nodeId, clone(state));\n }\n },\n on: (event, cb) => rpc.on(event, cb),\n off: (event, cb) => rpc.off(event, cb)\n };\n rpc.on(\"init\", (data) => {\n popcraft.command = data.command;\n });\n return popcraft;\n }\n function installMainApi() {\n const rpc = createRpcClient();\n const api = createMainApi(rpc);\n const w = window;\n w.__popcraftRpc = rpc;\n w.popcraft = api;\n w.vizpops = api;\n window.addEventListener(\"error\", (e) => rpc.send({ kind: \"error\", message: String(e.message || e) }));\n window.addEventListener(\"unhandledrejection\", (e) => rpc.send({ kind: \"error\", message: String(e.reason && e.reason.message || e.reason) }));\n return api;\n }\n\n // src/runtime/main.entry.ts\n installMainApi();\n})();";
|
|
2
|
+
export declare const MAIN_RUNTIME = "\"use strict\";\n(() => {\n // src/runtime/rpc.ts\n function createRpcClient() {\n let port = null;\n const queue = [];\n const pending = {};\n const listeners = {};\n let nextId = 1;\n function send(msg) {\n if (port) port.postMessage(msg);\n else queue.push(msg);\n }\n function call(method, params) {\n return new Promise((resolve, reject) => {\n const id = nextId++;\n pending[id] = { resolve, reject };\n send({ kind: \"rpc\", id, method, params });\n });\n }\n function emit(event, data) {\n for (const cb of (listeners[event] || []).slice()) {\n try {\n cb(data);\n } catch (e) {\n console.error(e);\n }\n }\n }\n window.addEventListener(\"message\", (e) => {\n const data = e.data;\n if (e.source !== window.parent || !data || data.type !== \"popcraft-plugin-port\" || port) return;\n port = e.ports[0];\n port.onmessage = (ev) => {\n const m = ev.data || {};\n if (m.kind === \"result\" && m.id !== void 0 && pending[m.id]) {\n const p = pending[m.id];\n delete pending[m.id];\n if (m.error) p.reject(new Error(m.error));\n else p.resolve(m.result);\n } else if (m.kind === \"event\" && m.event) {\n emit(m.event, m.data);\n }\n };\n for (const msg of queue.splice(0)) port.postMessage(msg);\n });\n return {\n call,\n send,\n on(event, cb) {\n (listeners[event] = listeners[event] || []).push(cb);\n },\n off(event, cb) {\n listeners[event] = (listeners[event] || []).filter((x) => x !== cb);\n }\n };\n }\n\n // src/runtime/main.ts\n function clone(v) {\n return v === void 0 ? {} : JSON.parse(JSON.stringify(v));\n }\n function createMainApi(rpc = createRpcClient()) {\n const uiHandlers = [];\n let uiOnMessage = null;\n const uiQueue = [];\n function deliverUI(msg) {\n for (const cb of uiHandlers) {\n try {\n cb(msg);\n } catch (e) {\n console.error(e);\n }\n }\n if (typeof uiOnMessage === \"function\") {\n try {\n uiOnMessage(msg);\n } catch (e) {\n console.error(e);\n }\n }\n }\n function flushUI() {\n if (uiHandlers.length || typeof uiOnMessage === \"function\") uiQueue.splice(0).forEach(deliverUI);\n }\n rpc.on(\"uimessage\", (msg) => {\n if (!uiHandlers.length && typeof uiOnMessage !== \"function\") uiQueue.push(msg);\n else deliverUI(msg);\n });\n let widgetDef = null;\n const widgetQueue = [];\n function renderWidget(state) {\n const handlers = {};\n function walk(el, path) {\n if (!el || typeof el !== \"object\") return el;\n const out = {};\n for (const k of Object.keys(el)) {\n const v = el[k];\n if (k === \"children\") {\n out.children = (Array.isArray(v) ? v : [v]).filter((c) => c !== null && c !== void 0 && c !== false).map((c, i) => walk(c, path + \".\" + i));\n } else if (k === \"onClick\" && typeof v === \"function\") {\n handlers[path] = v;\n out.onClick = path;\n } else {\n out[k] = v;\n }\n }\n return out;\n }\n return { tree: walk(widgetDef.render(state), \"root\"), handlers };\n }\n function initialWidgetState() {\n const s = widgetDef && widgetDef.initialState;\n return clone(typeof s === \"function\" ? s() : s);\n }\n function commitWidget(nodeId, state) {\n return rpc.call(\"widgetUpdate\", { id: nodeId, state, tree: renderWidget(clone(state)).tree });\n }\n function handleWidgetClick(e) {\n Promise.resolve().then(() => {\n const state = clone(e.state);\n const rendered = renderWidget(state);\n const h = rendered.handlers[e.handler] || widgetDef.handlers && widgetDef.handlers[e.handler];\n if (typeof h !== \"function\") return;\n return Promise.resolve(h(state, { nodeId: e.nodeId })).then((ret) => commitWidget(e.nodeId, ret === void 0 ? state : ret));\n }).catch((err) => rpc.send({ kind: \"error\", message: String((err == null ? void 0 : err.message) || err) }));\n }\n rpc.on(\"widgetclick\", (e) => {\n if (widgetDef) handleWidgetClick(e);\n else widgetQueue.push(e);\n });\n const popcraft = {\n /** Which menu command the user picked, or null when the plugin ran some other way. */\n command: null,\n /** Host import mode when launched as an importer, else null. */\n importMode: null,\n /** Pending import file when the host handed one over, else null. */\n importFile: null,\n /** Pending export request (File \u2192 Export \u2192 this plugin's format), else null. */\n exportRequest: null,\n getSelection: () => rpc.call(\"getSelection\"),\n setSelection: (ids) => rpc.call(\"setSelection\", { ids }),\n getNode: (id) => rpc.call(\"getNode\", { id }),\n findNodes: (query) => rpc.call(\"findNodes\", query || {}),\n getCurrentPage: () => rpc.call(\"getCurrentPage\"),\n createNode: (type, props) => rpc.call(\"createNode\", { type, props: props || {} }),\n updateNode: (id, props) => rpc.call(\"updateNode\", { id, props }),\n deleteNode: (id) => rpc.call(\"deleteNode\", { id }),\n setText: (id, characters) => rpc.call(\"setText\", { id, characters }),\n /** Put TEXT layers on a path (another layer's outline, or their own arc, circle or wave), or tune one: brackets, alignment, placement, effect, overflow. */\n setTextPath: (opts) => rpc.call(\"setTextPath\", opts || {}),\n /** Area type: flow a TEXT layer inside a closed shape, kept `inset` px in. */\n flowTextIntoShape: (opts) => rpc.call(\"flowTextIntoShape\", opts || {}),\n /** Take TEXT layers off their path or out of their shape (or free every text linked to a path / shape). */\n detachText: (opts) => rpc.call(\"detachText\", opts || {}),\n /** Auto-size TEXT layers' type to their box, shape or path. */\n setTextFit: (opts) => rpc.call(\"setTextFit\", opts || {}),\n createPage: (name) => rpc.call(\"createPage\", name != null ? { name: String(name) } : {}),\n setCurrentPage: (pageId) => rpc.call(\"setCurrentPage\", { pageId }),\n createImage: (opts) => rpc.call(\"createImage\", opts || {}),\n createDocument: (opts) => rpc.call(\"createDocument\", opts || {}),\n getImportMode: () => rpc.call(\"getImportMode\"),\n getImportFile: () => rpc.call(\"getImportFile\"),\n /**\n * The open page as a storefront design in a neutral form, for an exporter that writes its own store's templates:\n * each page's HTML with the store's data marked (`{{page.title}}`, `{{item.price}}`, `<!-- pc:each \u2026 -->` lists,\n * `data-pc-action` forms), and its collections with their commerce schema and sample records.\n */\n getStorefront: () => rpc.call(\"getStorefront\"),\n /**\n * A design's data (docs: Collections): a collection and its fields (`schema`: what it stands for, e.g.\n * `commerce.product`, whose fields are made for it), its records, and reading them.\n */\n editCollection: (opts) => rpc.call(\"editCollection\", opts || {}),\n editRecords: (opts) => rpc.call(\"editRecords\", opts || {}),\n getRecords: (opts) => rpc.call(\"getRecords\", opts || {}),\n /** A layer as a web page's form control (a FORM's `formAction`, an INPUT's name and value), repeated per record, a page's address, its semantics. */\n setControl: (opts) => rpc.call(\"setControl\", opts || {}),\n setRepeat: (opts) => rpc.call(\"setRepeat\", opts || {}),\n setRoute: (opts) => rpc.call(\"setRoute\", opts || {}),\n setSemantics: (opts) => rpc.call(\"setSemantics\", opts || {}),\n /** Which record layers are about (one product, picked from a collection), and which of its fields a layer's words, picture or an instance's properties follow. */\n setRecord: (opts) => rpc.call(\"setRecord\", opts || {}),\n bindField: (opts) => rpc.call(\"bindField\", opts || {}),\n /** The site's environment: public settings its host reads by name when it is deployed (never a secret: the file keeps them). */\n getSiteEnvironment: () => rpc.call(\"getSiteEnvironment\"),\n setSiteEnvironment: (set) => rpc.call(\"setSiteEnvironment\", { set }),\n /** What this plugin keeps with the open file (its settings for this design), under its own id; JSON only. */\n getFileData: (key) => rpc.call(\"getFileData\", { key }),\n setFileData: (key, value) => rpc.call(\"setFileData\", { key, value }),\n /** A store's project built from the open page, zipped (needs `export`): what an exporter saves with `saveExport`. */\n getStorefrontFiles: (target) => rpc.call(\"getStorefrontFiles\", { target }),\n getExportRequest: () => rpc.call(\"getExportRequest\"),\n /** Save the exporter's file (once per export request); the host enforces the contributed extension. */\n saveExport: (file) => rpc.call(\"saveExport\", file || {}),\n /**\n * Presentation audio (docs/plugins/presentation-audio.md): the deck's slides, notes, narration and timing; the\n * soundtrack's settings, bed and stinger.\n */\n getPresentationAudio: (opts) => rpc.call(\"getPresentationAudio\", opts || {}),\n /** Change the soundtrack's settings (voice, style, mood, loudness, beat alignment, levels) and re-time it. */\n setPresentationAudioSettings: (opts) => rpc.call(\"setPresentationAudioSettings\", opts || {}),\n /** Put a sound in (a slide's narration, the bed or the stinger): bytes are normalised to the soundtrack's target and stored. */\n setPresentationAudioClip: (opts) => rpc.call(\"setPresentationAudioClip\", opts || {}),\n removePresentationAudioClip: (opts) => rpc.call(\"removePresentationAudioClip\", opts || {}),\n /** Re-time: fixed slide lengths (ms, null clears) and beat-aligned changes. */\n setPresentationTiming: (opts) => rpc.call(\"setPresentationTiming\", opts || {}),\n /** The mix as the export carries it: loudness, true peak, and (wav: true) the 48 kHz stereo WAV. */\n getPresentationMix: (opts) => rpc.call(\"getPresentationMix\", opts || {}),\n /** Ask the user to generate with AI (the panel opens with the request filled in; the user decides). */\n requestPresentationAudio: (opts) => rpc.call(\"requestPresentationAudio\", opts || {}),\n /** Editor commands: each takes the arguments documented in docs/plugins/methods.md (the agent tool of the same purpose). */\n moveNodes: (opts) => rpc.call(\"moveNodes\", opts || {}),\n resizeNodes: (opts) => rpc.call(\"resizeNodes\", opts || {}),\n renameNodes: (opts) => rpc.call(\"renameNodes\", opts || {}),\n reparentNodes: (opts) => rpc.call(\"reparentNodes\", opts || {}),\n duplicateNodes: (opts) => rpc.call(\"duplicateNodes\", opts || {}),\n groupNodes: (opts) => rpc.call(\"groupNodes\", opts || {}),\n ungroupNodes: (opts) => rpc.call(\"ungroupNodes\", opts || {}),\n alignNodes: (opts) => rpc.call(\"alignNodes\", opts || {}),\n distributeNodes: (opts) => rpc.call(\"distributeNodes\", opts || {}),\n flipNodes: (opts) => rpc.call(\"flipNodes\", opts || {}),\n rotateNodes: (opts) => rpc.call(\"rotateNodes\", opts || {}),\n reorderNodes: (opts) => rpc.call(\"reorderNodes\", opts || {}),\n setLocked: (opts) => rpc.call(\"setLocked\", opts || {}),\n setVisible: (opts) => rpc.call(\"setVisible\", opts || {}),\n setAutoLayout: (opts) => rpc.call(\"setAutoLayout\", opts || {}),\n importSvg: (opts) => rpc.call(\"importSvg\", opts || {}),\n measureNodes: (opts) => rpc.call(\"measureNodes\", opts || {}),\n setFills: (opts) => rpc.call(\"setFills\", opts || {}),\n setStrokes: (opts) => rpc.call(\"setStrokes\", opts || {}),\n setEffects: (opts) => rpc.call(\"setEffects\", opts || {}),\n replaceColor: (opts) => rpc.call(\"replaceColor\", opts || {}),\n setTypography: (opts) => rpc.call(\"setTypography\", opts || {}),\n applyStyle: (opts) => rpc.call(\"applyStyle\", opts || {}),\n createComponent: (opts) => rpc.call(\"createComponent\", opts || {}),\n createInstance: (opts) => rpc.call(\"createInstance\", opts || {}),\n renamePage: (opts) => rpc.call(\"renamePage\", opts || {}),\n getDocumentOutline: (opts) => rpc.call(\"getDocumentOutline\", opts || {}),\n setPageSetup: (opts) => rpc.call(\"setPageSetup\", opts || {}),\n setShowAdvance: (opts) => rpc.call(\"setShowAdvance\", opts || {}),\n booleanOperation: (opts) => rpc.call(\"booleanOperation\", opts || {}),\n flattenNodes: (opts) => rpc.call(\"flattenNodes\", opts || {}),\n outlineStroke: (opts) => rpc.call(\"outlineStroke\", opts || {}),\n setMask: (opts) => rpc.call(\"setMask\", opts || {}),\n setMaskType: (opts) => rpc.call(\"setMaskType\", opts || {}),\n shapeBuilder: (opts) => rpc.call(\"shapeBuilder\", opts || {}),\n setKeyframes: (opts) => rpc.call(\"setKeyframes\", opts || {}),\n getAnimation: (opts) => rpc.call(\"getAnimation\", opts || {}),\n getCompositions: (opts) => rpc.call(\"getCompositions\", opts || {}),\n editBehaviours: (opts) => rpc.call(\"editBehaviours\", opts || {}),\n setTimeline: (opts) => rpc.call(\"setTimeline\", opts || {}),\n setLayerTiming: (opts) => rpc.call(\"setLayerTiming\", opts || {}),\n editTextAnimation: (opts) => rpc.call(\"editTextAnimation\", opts || {}),\n edit3DScene: (opts) => rpc.call(\"edit3DScene\", opts || {}),\n setInstancePlayback: (opts) => rpc.call(\"setInstancePlayback\", opts || {}),\n editComponentProperty: (opts) => rpc.call(\"editComponentProperty\", opts || {}),\n setShaderFill: (opts) => rpc.call(\"setShaderFill\", opts || {}),\n createComposition: (opts) => rpc.call(\"createComposition\", opts || {}),\n editComposition: (opts) => rpc.call(\"editComposition\", opts || {}),\n editStateMachine: (opts) => rpc.call(\"editStateMachine\", opts || {}),\n getStateMachine: (opts) => rpc.call(\"getStateMachine\", opts || {}),\n applyMotionPreset: (opts) => rpc.call(\"applyMotionPreset\", opts || {}),\n staggerMotion: (opts) => rpc.call(\"staggerMotion\", opts || {}),\n createMotionComponent: (opts) => rpc.call(\"createMotionComponent\", opts || {}),\n addAudio: (opts) => rpc.call(\"addAudio\", opts || {}),\n editFrameAudio: (opts) => rpc.call(\"editFrameAudio\", opts || {}),\n editVideoClip: (opts) => rpc.call(\"editVideoClip\", opts || {}),\n detectAudioOnsets: (opts) => rpc.call(\"detectAudioOnsets\", opts || {}),\n cutToBeat: (opts) => rpc.call(\"cutToBeat\", opts || {}),\n editPrototype: (opts) => rpc.call(\"editPrototype\", opts || {}),\n usePresentationFallbackAudio: (opts) => rpc.call(\"usePresentationFallbackAudio\", opts || {}),\n /** Bring a Lottie, PDF or PopCraft file into the open document (the `importFile` field is the file an importer was handed). */\n importDocumentFile: (opts) => rpc.call(\"importDocumentFile\", opts || {}),\n getStyles: () => rpc.call(\"getStyles\"),\n createPaintStyle: (name, paints) => rpc.call(\"createPaintStyle\", { name, paints }),\n getVariables: () => rpc.call(\"getVariables\"),\n setVariableValue: (variableId, modeId, value) => rpc.call(\"setVariableValue\", { variableId, modeId, value }),\n exportNode: (id, options) => rpc.call(\"exportNode\", { id, options: options || {} }),\n openExternal: (url) => rpc.call(\"openExternal\", { url }),\n /**\n * Send a file to an https URL. PopCraft makes the request, not the sandbox, so it works for files of\n * any size the server accepts, including straight to a presigned storage URL. Needs `network`.\n */\n upload: (url, options) => {\n const body = options.body instanceof ArrayBuffer ? new Uint8Array(options.body) : options.body;\n return rpc.call(\"upload\", {\n url,\n body,\n method: options.method,\n contentType: options.contentType,\n headers: options.headers\n });\n },\n notify: (message, options) => rpc.call(\"notify\", { message: String(message), error: !!(options && options.error) }),\n showUI: (options) => rpc.call(\"showUI\", options || {}),\n hideUI: () => rpc.call(\"hideUI\"),\n /** Ends the run. The optional message is shown as a notification. */\n closePlugin: (message) => rpc.call(\"closePlugin\", { message }),\n storage: {\n get: (key) => rpc.call(\"storageGet\", { key }),\n set: (key, value) => rpc.call(\"storageSet\", { key, value })\n },\n ui: {\n get onmessage() {\n return uiOnMessage;\n },\n set onmessage(cb) {\n uiOnMessage = cb;\n flushUI();\n },\n postMessage: (msg) => rpc.send({ kind: \"toUI\", data: msg }),\n on: (cb) => {\n uiHandlers.push(cb);\n flushUI();\n }\n },\n widget: {\n register(def) {\n if (!def || typeof def.render !== \"function\") throw new Error(\"popcraft.widget.register needs a render(state) function\");\n widgetDef = def;\n widgetQueue.splice(0).forEach(handleWidgetClick);\n },\n insert(options) {\n if (!widgetDef) return Promise.reject(new Error(\"Call popcraft.widget.register first\"));\n const o = options || {};\n const state = o.state !== void 0 ? clone(o.state) : initialWidgetState();\n return rpc.call(\"widgetInsert\", { state, tree: renderWidget(state).tree, x: o.x, y: o.y });\n },\n getState: (nodeId) => rpc.call(\"widgetGet\", { id: nodeId }),\n setState(nodeId, state) {\n if (!widgetDef) return Promise.reject(new Error(\"Call popcraft.widget.register first\"));\n return commitWidget(nodeId, clone(state));\n }\n },\n on: (event, cb) => rpc.on(event, cb),\n off: (event, cb) => rpc.off(event, cb)\n };\n rpc.on(\"init\", (data) => {\n var _a, _b, _c;\n popcraft.command = data.command;\n popcraft.importMode = (_a = data.importMode) != null ? _a : null;\n popcraft.importFile = (_b = data.importFile) != null ? _b : null;\n popcraft.exportRequest = (_c = data.exportRequest) != null ? _c : null;\n });\n return popcraft;\n }\n function installMainApi() {\n const rpc = createRpcClient();\n const api = createMainApi(rpc);\n const w = window;\n w.__popcraftRpc = rpc;\n w.popcraft = api;\n w.vizpops = api;\n window.addEventListener(\"error\", (e) => rpc.send({ kind: \"error\", message: String(e.message || e) }));\n window.addEventListener(\"unhandledrejection\", (e) => rpc.send({ kind: \"error\", message: String(e.reason && e.reason.message || e.reason) }));\n return api;\n }\n\n // src/runtime/main.entry.ts\n installMainApi();\n})();";
|
|
3
3
|
/** The `popcraft` shim for a plugin UI document, as injectable inline script. */
|
|
4
4
|
export declare const UI_RUNTIME = "\"use strict\";\n(() => {\n // src/runtime/rpc.ts\n function createRpcClient() {\n let port = null;\n const queue = [];\n const pending = {};\n const listeners = {};\n let nextId = 1;\n function send(msg) {\n if (port) port.postMessage(msg);\n else queue.push(msg);\n }\n function call(method, params) {\n return new Promise((resolve, reject) => {\n const id = nextId++;\n pending[id] = { resolve, reject };\n send({ kind: \"rpc\", id, method, params });\n });\n }\n function emit(event, data) {\n for (const cb of (listeners[event] || []).slice()) {\n try {\n cb(data);\n } catch (e) {\n console.error(e);\n }\n }\n }\n window.addEventListener(\"message\", (e) => {\n const data = e.data;\n if (e.source !== window.parent || !data || data.type !== \"popcraft-plugin-port\" || port) return;\n port = e.ports[0];\n port.onmessage = (ev) => {\n const m = ev.data || {};\n if (m.kind === \"result\" && m.id !== void 0 && pending[m.id]) {\n const p = pending[m.id];\n delete pending[m.id];\n if (m.error) p.reject(new Error(m.error));\n else p.resolve(m.result);\n } else if (m.kind === \"event\" && m.event) {\n emit(m.event, m.data);\n }\n };\n for (const msg of queue.splice(0)) port.postMessage(msg);\n });\n return {\n call,\n send,\n on(event, cb) {\n (listeners[event] = listeners[event] || []).push(cb);\n },\n off(event, cb) {\n listeners[event] = (listeners[event] || []).filter((x) => x !== cb);\n }\n };\n }\n\n // src/runtime/ui.ts\n function createUiApi(rpc = createRpcClient()) {\n const popcraft = {\n onmessage: null,\n postMessage: (msg) => rpc.send({ kind: \"fromUI\", data: msg }),\n close: () => rpc.send({ kind: \"closeUI\" })\n };\n rpc.on(\"message\", (msg) => {\n if (typeof popcraft.onmessage === \"function\") popcraft.onmessage(msg);\n window.dispatchEvent(new MessageEvent(\"message\", { data: { pluginMessage: msg } }));\n });\n return popcraft;\n }\n function installUiApi() {\n const rpc = createRpcClient();\n const api = createUiApi(rpc);\n const w = window;\n w.__popcraftRpc = rpc;\n w.popcraft = api;\n w.vizpops = api;\n return api;\n }\n\n // src/runtime/ui.entry.ts\n installUiApi();\n})();";
|
|
5
5
|
//# sourceMappingURL=runtime.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/generated/runtime.ts"],"names":[],"mappings":"AAEA,mFAAmF;AACnF,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/generated/runtime.ts"],"names":[],"mappings":"AAEA,mFAAmF;AACnF,eAAO,MAAM,YAAY,0zlBAA2ylB,CAAA;AAEp0lB,iFAAiF;AACjF,eAAO,MAAM,UAAU,o7EAAo7E,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Generated by scripts/build.mjs from src/runtime — do not edit.
|
|
2
2
|
/** The `popcraft` global for a plugin main script, as injectable inline script. */
|
|
3
|
-
export const MAIN_RUNTIME = "\"use strict\";\n(() => {\n // src/runtime/rpc.ts\n function createRpcClient() {\n let port = null;\n const queue = [];\n const pending = {};\n const listeners = {};\n let nextId = 1;\n function send(msg) {\n if (port) port.postMessage(msg);\n else queue.push(msg);\n }\n function call(method, params) {\n return new Promise((resolve, reject) => {\n const id = nextId++;\n pending[id] = { resolve, reject };\n send({ kind: \"rpc\", id, method, params });\n });\n }\n function emit(event, data) {\n for (const cb of (listeners[event] || []).slice()) {\n try {\n cb(data);\n } catch (e) {\n console.error(e);\n }\n }\n }\n window.addEventListener(\"message\", (e) => {\n const data = e.data;\n if (e.source !== window.parent || !data || data.type !== \"popcraft-plugin-port\" || port) return;\n port = e.ports[0];\n port.onmessage = (ev) => {\n const m = ev.data || {};\n if (m.kind === \"result\" && m.id !== void 0 && pending[m.id]) {\n const p = pending[m.id];\n delete pending[m.id];\n if (m.error) p.reject(new Error(m.error));\n else p.resolve(m.result);\n } else if (m.kind === \"event\" && m.event) {\n emit(m.event, m.data);\n }\n };\n for (const msg of queue.splice(0)) port.postMessage(msg);\n });\n return {\n call,\n send,\n on(event, cb) {\n (listeners[event] = listeners[event] || []).push(cb);\n },\n off(event, cb) {\n listeners[event] = (listeners[event] || []).filter((x) => x !== cb);\n }\n };\n }\n\n // src/runtime/main.ts\n function clone(v) {\n return v === void 0 ? {} : JSON.parse(JSON.stringify(v));\n }\n function createMainApi(rpc = createRpcClient()) {\n const uiHandlers = [];\n let uiOnMessage = null;\n const uiQueue = [];\n function deliverUI(msg) {\n for (const cb of uiHandlers) {\n try {\n cb(msg);\n } catch (e) {\n console.error(e);\n }\n }\n if (typeof uiOnMessage === \"function\") {\n try {\n uiOnMessage(msg);\n } catch (e) {\n console.error(e);\n }\n }\n }\n function flushUI() {\n if (uiHandlers.length || typeof uiOnMessage === \"function\") uiQueue.splice(0).forEach(deliverUI);\n }\n rpc.on(\"uimessage\", (msg) => {\n if (!uiHandlers.length && typeof uiOnMessage !== \"function\") uiQueue.push(msg);\n else deliverUI(msg);\n });\n let widgetDef = null;\n const widgetQueue = [];\n function renderWidget(state) {\n const handlers = {};\n function walk(el, path) {\n if (!el || typeof el !== \"object\") return el;\n const out = {};\n for (const k of Object.keys(el)) {\n const v = el[k];\n if (k === \"children\") {\n out.children = (Array.isArray(v) ? v : [v]).filter((c) => c !== null && c !== void 0 && c !== false).map((c, i) => walk(c, path + \".\" + i));\n } else if (k === \"onClick\" && typeof v === \"function\") {\n handlers[path] = v;\n out.onClick = path;\n } else {\n out[k] = v;\n }\n }\n return out;\n }\n return { tree: walk(widgetDef.render(state), \"root\"), handlers };\n }\n function initialWidgetState() {\n const s = widgetDef && widgetDef.initialState;\n return clone(typeof s === \"function\" ? s() : s);\n }\n function commitWidget(nodeId, state) {\n return rpc.call(\"widgetUpdate\", { id: nodeId, state, tree: renderWidget(clone(state)).tree });\n }\n function handleWidgetClick(e) {\n Promise.resolve().then(() => {\n const state = clone(e.state);\n const rendered = renderWidget(state);\n const h = rendered.handlers[e.handler] || widgetDef.handlers && widgetDef.handlers[e.handler];\n if (typeof h !== \"function\") return;\n return Promise.resolve(h(state, { nodeId: e.nodeId })).then((ret) => commitWidget(e.nodeId, ret === void 0 ? state : ret));\n }).catch((err) => rpc.send({ kind: \"error\", message: String((err == null ? void 0 : err.message) || err) }));\n }\n rpc.on(\"widgetclick\", (e) => {\n if (widgetDef) handleWidgetClick(e);\n else widgetQueue.push(e);\n });\n const popcraft = {\n /** Which menu command the user picked, or null when the plugin ran some other way. */\n command: null,\n getSelection: () => rpc.call(\"getSelection\"),\n setSelection: (ids) => rpc.call(\"setSelection\", { ids }),\n getNode: (id) => rpc.call(\"getNode\", { id }),\n findNodes: (query) => rpc.call(\"findNodes\", query || {}),\n getCurrentPage: () => rpc.call(\"getCurrentPage\"),\n createNode: (type, props) => rpc.call(\"createNode\", { type, props: props || {} }),\n updateNode: (id, props) => rpc.call(\"updateNode\", { id, props }),\n deleteNode: (id) => rpc.call(\"deleteNode\", { id }),\n setText: (id, characters) => rpc.call(\"setText\", { id, characters }),\n getStyles: () => rpc.call(\"getStyles\"),\n createPaintStyle: (name, paints) => rpc.call(\"createPaintStyle\", { name, paints }),\n getVariables: () => rpc.call(\"getVariables\"),\n setVariableValue: (variableId, modeId, value) => rpc.call(\"setVariableValue\", { variableId, modeId, value }),\n exportNode: (id, options) => rpc.call(\"exportNode\", { id, options: options || {} }),\n openExternal: (url) => rpc.call(\"openExternal\", { url }),\n notify: (message, options) => rpc.call(\"notify\", { message: String(message), error: !!(options && options.error) }),\n showUI: (options) => rpc.call(\"showUI\", options || {}),\n hideUI: () => rpc.call(\"hideUI\"),\n /** Ends the run. The optional message is shown as a notification. */\n closePlugin: (message) => rpc.call(\"closePlugin\", { message }),\n storage: {\n get: (key) => rpc.call(\"storageGet\", { key }),\n set: (key, value) => rpc.call(\"storageSet\", { key, value })\n },\n ui: {\n get onmessage() {\n return uiOnMessage;\n },\n set onmessage(cb) {\n uiOnMessage = cb;\n flushUI();\n },\n postMessage: (msg) => rpc.send({ kind: \"toUI\", data: msg }),\n on: (cb) => {\n uiHandlers.push(cb);\n flushUI();\n }\n },\n widget: {\n register(def) {\n if (!def || typeof def.render !== \"function\") throw new Error(\"popcraft.widget.register needs a render(state) function\");\n widgetDef = def;\n widgetQueue.splice(0).forEach(handleWidgetClick);\n },\n insert(options) {\n if (!widgetDef) return Promise.reject(new Error(\"Call popcraft.widget.register first\"));\n const o = options || {};\n const state = o.state !== void 0 ? clone(o.state) : initialWidgetState();\n return rpc.call(\"widgetInsert\", { state, tree: renderWidget(state).tree, x: o.x, y: o.y });\n },\n getState: (nodeId) => rpc.call(\"widgetGet\", { id: nodeId }),\n setState(nodeId, state) {\n if (!widgetDef) return Promise.reject(new Error(\"Call popcraft.widget.register first\"));\n return commitWidget(nodeId, clone(state));\n }\n },\n on: (event, cb) => rpc.on(event, cb),\n off: (event, cb) => rpc.off(event, cb)\n };\n rpc.on(\"init\", (data) => {\n popcraft.command = data.command;\n });\n return popcraft;\n }\n function installMainApi() {\n const rpc = createRpcClient();\n const api = createMainApi(rpc);\n const w = window;\n w.__popcraftRpc = rpc;\n w.popcraft = api;\n w.vizpops = api;\n window.addEventListener(\"error\", (e) => rpc.send({ kind: \"error\", message: String(e.message || e) }));\n window.addEventListener(\"unhandledrejection\", (e) => rpc.send({ kind: \"error\", message: String(e.reason && e.reason.message || e.reason) }));\n return api;\n }\n\n // src/runtime/main.entry.ts\n installMainApi();\n})();";
|
|
3
|
+
export const MAIN_RUNTIME = "\"use strict\";\n(() => {\n // src/runtime/rpc.ts\n function createRpcClient() {\n let port = null;\n const queue = [];\n const pending = {};\n const listeners = {};\n let nextId = 1;\n function send(msg) {\n if (port) port.postMessage(msg);\n else queue.push(msg);\n }\n function call(method, params) {\n return new Promise((resolve, reject) => {\n const id = nextId++;\n pending[id] = { resolve, reject };\n send({ kind: \"rpc\", id, method, params });\n });\n }\n function emit(event, data) {\n for (const cb of (listeners[event] || []).slice()) {\n try {\n cb(data);\n } catch (e) {\n console.error(e);\n }\n }\n }\n window.addEventListener(\"message\", (e) => {\n const data = e.data;\n if (e.source !== window.parent || !data || data.type !== \"popcraft-plugin-port\" || port) return;\n port = e.ports[0];\n port.onmessage = (ev) => {\n const m = ev.data || {};\n if (m.kind === \"result\" && m.id !== void 0 && pending[m.id]) {\n const p = pending[m.id];\n delete pending[m.id];\n if (m.error) p.reject(new Error(m.error));\n else p.resolve(m.result);\n } else if (m.kind === \"event\" && m.event) {\n emit(m.event, m.data);\n }\n };\n for (const msg of queue.splice(0)) port.postMessage(msg);\n });\n return {\n call,\n send,\n on(event, cb) {\n (listeners[event] = listeners[event] || []).push(cb);\n },\n off(event, cb) {\n listeners[event] = (listeners[event] || []).filter((x) => x !== cb);\n }\n };\n }\n\n // src/runtime/main.ts\n function clone(v) {\n return v === void 0 ? {} : JSON.parse(JSON.stringify(v));\n }\n function createMainApi(rpc = createRpcClient()) {\n const uiHandlers = [];\n let uiOnMessage = null;\n const uiQueue = [];\n function deliverUI(msg) {\n for (const cb of uiHandlers) {\n try {\n cb(msg);\n } catch (e) {\n console.error(e);\n }\n }\n if (typeof uiOnMessage === \"function\") {\n try {\n uiOnMessage(msg);\n } catch (e) {\n console.error(e);\n }\n }\n }\n function flushUI() {\n if (uiHandlers.length || typeof uiOnMessage === \"function\") uiQueue.splice(0).forEach(deliverUI);\n }\n rpc.on(\"uimessage\", (msg) => {\n if (!uiHandlers.length && typeof uiOnMessage !== \"function\") uiQueue.push(msg);\n else deliverUI(msg);\n });\n let widgetDef = null;\n const widgetQueue = [];\n function renderWidget(state) {\n const handlers = {};\n function walk(el, path) {\n if (!el || typeof el !== \"object\") return el;\n const out = {};\n for (const k of Object.keys(el)) {\n const v = el[k];\n if (k === \"children\") {\n out.children = (Array.isArray(v) ? v : [v]).filter((c) => c !== null && c !== void 0 && c !== false).map((c, i) => walk(c, path + \".\" + i));\n } else if (k === \"onClick\" && typeof v === \"function\") {\n handlers[path] = v;\n out.onClick = path;\n } else {\n out[k] = v;\n }\n }\n return out;\n }\n return { tree: walk(widgetDef.render(state), \"root\"), handlers };\n }\n function initialWidgetState() {\n const s = widgetDef && widgetDef.initialState;\n return clone(typeof s === \"function\" ? s() : s);\n }\n function commitWidget(nodeId, state) {\n return rpc.call(\"widgetUpdate\", { id: nodeId, state, tree: renderWidget(clone(state)).tree });\n }\n function handleWidgetClick(e) {\n Promise.resolve().then(() => {\n const state = clone(e.state);\n const rendered = renderWidget(state);\n const h = rendered.handlers[e.handler] || widgetDef.handlers && widgetDef.handlers[e.handler];\n if (typeof h !== \"function\") return;\n return Promise.resolve(h(state, { nodeId: e.nodeId })).then((ret) => commitWidget(e.nodeId, ret === void 0 ? state : ret));\n }).catch((err) => rpc.send({ kind: \"error\", message: String((err == null ? void 0 : err.message) || err) }));\n }\n rpc.on(\"widgetclick\", (e) => {\n if (widgetDef) handleWidgetClick(e);\n else widgetQueue.push(e);\n });\n const popcraft = {\n /** Which menu command the user picked, or null when the plugin ran some other way. */\n command: null,\n /** Host import mode when launched as an importer, else null. */\n importMode: null,\n /** Pending import file when the host handed one over, else null. */\n importFile: null,\n /** Pending export request (File → Export → this plugin's format), else null. */\n exportRequest: null,\n getSelection: () => rpc.call(\"getSelection\"),\n setSelection: (ids) => rpc.call(\"setSelection\", { ids }),\n getNode: (id) => rpc.call(\"getNode\", { id }),\n findNodes: (query) => rpc.call(\"findNodes\", query || {}),\n getCurrentPage: () => rpc.call(\"getCurrentPage\"),\n createNode: (type, props) => rpc.call(\"createNode\", { type, props: props || {} }),\n updateNode: (id, props) => rpc.call(\"updateNode\", { id, props }),\n deleteNode: (id) => rpc.call(\"deleteNode\", { id }),\n setText: (id, characters) => rpc.call(\"setText\", { id, characters }),\n /** Put TEXT layers on a path (another layer's outline, or their own arc, circle or wave), or tune one: brackets, alignment, placement, effect, overflow. */\n setTextPath: (opts) => rpc.call(\"setTextPath\", opts || {}),\n /** Area type: flow a TEXT layer inside a closed shape, kept `inset` px in. */\n flowTextIntoShape: (opts) => rpc.call(\"flowTextIntoShape\", opts || {}),\n /** Take TEXT layers off their path or out of their shape (or free every text linked to a path / shape). */\n detachText: (opts) => rpc.call(\"detachText\", opts || {}),\n /** Auto-size TEXT layers' type to their box, shape or path. */\n setTextFit: (opts) => rpc.call(\"setTextFit\", opts || {}),\n createPage: (name) => rpc.call(\"createPage\", name != null ? { name: String(name) } : {}),\n setCurrentPage: (pageId) => rpc.call(\"setCurrentPage\", { pageId }),\n createImage: (opts) => rpc.call(\"createImage\", opts || {}),\n createDocument: (opts) => rpc.call(\"createDocument\", opts || {}),\n getImportMode: () => rpc.call(\"getImportMode\"),\n getImportFile: () => rpc.call(\"getImportFile\"),\n /**\n * The open page as a storefront design in a neutral form, for an exporter that writes its own store's templates:\n * each page's HTML with the store's data marked (`{{page.title}}`, `{{item.price}}`, `<!-- pc:each … -->` lists,\n * `data-pc-action` forms), and its collections with their commerce schema and sample records.\n */\n getStorefront: () => rpc.call(\"getStorefront\"),\n /**\n * A design's data (docs: Collections): a collection and its fields (`schema`: what it stands for, e.g.\n * `commerce.product`, whose fields are made for it), its records, and reading them.\n */\n editCollection: (opts) => rpc.call(\"editCollection\", opts || {}),\n editRecords: (opts) => rpc.call(\"editRecords\", opts || {}),\n getRecords: (opts) => rpc.call(\"getRecords\", opts || {}),\n /** A layer as a web page's form control (a FORM's `formAction`, an INPUT's name and value), repeated per record, a page's address, its semantics. */\n setControl: (opts) => rpc.call(\"setControl\", opts || {}),\n setRepeat: (opts) => rpc.call(\"setRepeat\", opts || {}),\n setRoute: (opts) => rpc.call(\"setRoute\", opts || {}),\n setSemantics: (opts) => rpc.call(\"setSemantics\", opts || {}),\n /** Which record layers are about (one product, picked from a collection), and which of its fields a layer's words, picture or an instance's properties follow. */\n setRecord: (opts) => rpc.call(\"setRecord\", opts || {}),\n bindField: (opts) => rpc.call(\"bindField\", opts || {}),\n /** The site's environment: public settings its host reads by name when it is deployed (never a secret: the file keeps them). */\n getSiteEnvironment: () => rpc.call(\"getSiteEnvironment\"),\n setSiteEnvironment: (set) => rpc.call(\"setSiteEnvironment\", { set }),\n /** What this plugin keeps with the open file (its settings for this design), under its own id; JSON only. */\n getFileData: (key) => rpc.call(\"getFileData\", { key }),\n setFileData: (key, value) => rpc.call(\"setFileData\", { key, value }),\n /** A store's project built from the open page, zipped (needs `export`): what an exporter saves with `saveExport`. */\n getStorefrontFiles: (target) => rpc.call(\"getStorefrontFiles\", { target }),\n getExportRequest: () => rpc.call(\"getExportRequest\"),\n /** Save the exporter's file (once per export request); the host enforces the contributed extension. */\n saveExport: (file) => rpc.call(\"saveExport\", file || {}),\n /**\n * Presentation audio (docs/plugins/presentation-audio.md): the deck's slides, notes, narration and timing; the\n * soundtrack's settings, bed and stinger.\n */\n getPresentationAudio: (opts) => rpc.call(\"getPresentationAudio\", opts || {}),\n /** Change the soundtrack's settings (voice, style, mood, loudness, beat alignment, levels) and re-time it. */\n setPresentationAudioSettings: (opts) => rpc.call(\"setPresentationAudioSettings\", opts || {}),\n /** Put a sound in (a slide's narration, the bed or the stinger): bytes are normalised to the soundtrack's target and stored. */\n setPresentationAudioClip: (opts) => rpc.call(\"setPresentationAudioClip\", opts || {}),\n removePresentationAudioClip: (opts) => rpc.call(\"removePresentationAudioClip\", opts || {}),\n /** Re-time: fixed slide lengths (ms, null clears) and beat-aligned changes. */\n setPresentationTiming: (opts) => rpc.call(\"setPresentationTiming\", opts || {}),\n /** The mix as the export carries it: loudness, true peak, and (wav: true) the 48 kHz stereo WAV. */\n getPresentationMix: (opts) => rpc.call(\"getPresentationMix\", opts || {}),\n /** Ask the user to generate with AI (the panel opens with the request filled in; the user decides). */\n requestPresentationAudio: (opts) => rpc.call(\"requestPresentationAudio\", opts || {}),\n /** Editor commands: each takes the arguments documented in docs/plugins/methods.md (the agent tool of the same purpose). */\n moveNodes: (opts) => rpc.call(\"moveNodes\", opts || {}),\n resizeNodes: (opts) => rpc.call(\"resizeNodes\", opts || {}),\n renameNodes: (opts) => rpc.call(\"renameNodes\", opts || {}),\n reparentNodes: (opts) => rpc.call(\"reparentNodes\", opts || {}),\n duplicateNodes: (opts) => rpc.call(\"duplicateNodes\", opts || {}),\n groupNodes: (opts) => rpc.call(\"groupNodes\", opts || {}),\n ungroupNodes: (opts) => rpc.call(\"ungroupNodes\", opts || {}),\n alignNodes: (opts) => rpc.call(\"alignNodes\", opts || {}),\n distributeNodes: (opts) => rpc.call(\"distributeNodes\", opts || {}),\n flipNodes: (opts) => rpc.call(\"flipNodes\", opts || {}),\n rotateNodes: (opts) => rpc.call(\"rotateNodes\", opts || {}),\n reorderNodes: (opts) => rpc.call(\"reorderNodes\", opts || {}),\n setLocked: (opts) => rpc.call(\"setLocked\", opts || {}),\n setVisible: (opts) => rpc.call(\"setVisible\", opts || {}),\n setAutoLayout: (opts) => rpc.call(\"setAutoLayout\", opts || {}),\n importSvg: (opts) => rpc.call(\"importSvg\", opts || {}),\n measureNodes: (opts) => rpc.call(\"measureNodes\", opts || {}),\n setFills: (opts) => rpc.call(\"setFills\", opts || {}),\n setStrokes: (opts) => rpc.call(\"setStrokes\", opts || {}),\n setEffects: (opts) => rpc.call(\"setEffects\", opts || {}),\n replaceColor: (opts) => rpc.call(\"replaceColor\", opts || {}),\n setTypography: (opts) => rpc.call(\"setTypography\", opts || {}),\n applyStyle: (opts) => rpc.call(\"applyStyle\", opts || {}),\n createComponent: (opts) => rpc.call(\"createComponent\", opts || {}),\n createInstance: (opts) => rpc.call(\"createInstance\", opts || {}),\n renamePage: (opts) => rpc.call(\"renamePage\", opts || {}),\n getDocumentOutline: (opts) => rpc.call(\"getDocumentOutline\", opts || {}),\n setPageSetup: (opts) => rpc.call(\"setPageSetup\", opts || {}),\n setShowAdvance: (opts) => rpc.call(\"setShowAdvance\", opts || {}),\n booleanOperation: (opts) => rpc.call(\"booleanOperation\", opts || {}),\n flattenNodes: (opts) => rpc.call(\"flattenNodes\", opts || {}),\n outlineStroke: (opts) => rpc.call(\"outlineStroke\", opts || {}),\n setMask: (opts) => rpc.call(\"setMask\", opts || {}),\n setMaskType: (opts) => rpc.call(\"setMaskType\", opts || {}),\n shapeBuilder: (opts) => rpc.call(\"shapeBuilder\", opts || {}),\n setKeyframes: (opts) => rpc.call(\"setKeyframes\", opts || {}),\n getAnimation: (opts) => rpc.call(\"getAnimation\", opts || {}),\n getCompositions: (opts) => rpc.call(\"getCompositions\", opts || {}),\n editBehaviours: (opts) => rpc.call(\"editBehaviours\", opts || {}),\n setTimeline: (opts) => rpc.call(\"setTimeline\", opts || {}),\n setLayerTiming: (opts) => rpc.call(\"setLayerTiming\", opts || {}),\n editTextAnimation: (opts) => rpc.call(\"editTextAnimation\", opts || {}),\n edit3DScene: (opts) => rpc.call(\"edit3DScene\", opts || {}),\n setInstancePlayback: (opts) => rpc.call(\"setInstancePlayback\", opts || {}),\n editComponentProperty: (opts) => rpc.call(\"editComponentProperty\", opts || {}),\n setShaderFill: (opts) => rpc.call(\"setShaderFill\", opts || {}),\n createComposition: (opts) => rpc.call(\"createComposition\", opts || {}),\n editComposition: (opts) => rpc.call(\"editComposition\", opts || {}),\n editStateMachine: (opts) => rpc.call(\"editStateMachine\", opts || {}),\n getStateMachine: (opts) => rpc.call(\"getStateMachine\", opts || {}),\n applyMotionPreset: (opts) => rpc.call(\"applyMotionPreset\", opts || {}),\n staggerMotion: (opts) => rpc.call(\"staggerMotion\", opts || {}),\n createMotionComponent: (opts) => rpc.call(\"createMotionComponent\", opts || {}),\n addAudio: (opts) => rpc.call(\"addAudio\", opts || {}),\n editFrameAudio: (opts) => rpc.call(\"editFrameAudio\", opts || {}),\n editVideoClip: (opts) => rpc.call(\"editVideoClip\", opts || {}),\n detectAudioOnsets: (opts) => rpc.call(\"detectAudioOnsets\", opts || {}),\n cutToBeat: (opts) => rpc.call(\"cutToBeat\", opts || {}),\n editPrototype: (opts) => rpc.call(\"editPrototype\", opts || {}),\n usePresentationFallbackAudio: (opts) => rpc.call(\"usePresentationFallbackAudio\", opts || {}),\n /** Bring a Lottie, PDF or PopCraft file into the open document (the `importFile` field is the file an importer was handed). */\n importDocumentFile: (opts) => rpc.call(\"importDocumentFile\", opts || {}),\n getStyles: () => rpc.call(\"getStyles\"),\n createPaintStyle: (name, paints) => rpc.call(\"createPaintStyle\", { name, paints }),\n getVariables: () => rpc.call(\"getVariables\"),\n setVariableValue: (variableId, modeId, value) => rpc.call(\"setVariableValue\", { variableId, modeId, value }),\n exportNode: (id, options) => rpc.call(\"exportNode\", { id, options: options || {} }),\n openExternal: (url) => rpc.call(\"openExternal\", { url }),\n /**\n * Send a file to an https URL. PopCraft makes the request, not the sandbox, so it works for files of\n * any size the server accepts, including straight to a presigned storage URL. Needs `network`.\n */\n upload: (url, options) => {\n const body = options.body instanceof ArrayBuffer ? new Uint8Array(options.body) : options.body;\n return rpc.call(\"upload\", {\n url,\n body,\n method: options.method,\n contentType: options.contentType,\n headers: options.headers\n });\n },\n notify: (message, options) => rpc.call(\"notify\", { message: String(message), error: !!(options && options.error) }),\n showUI: (options) => rpc.call(\"showUI\", options || {}),\n hideUI: () => rpc.call(\"hideUI\"),\n /** Ends the run. The optional message is shown as a notification. */\n closePlugin: (message) => rpc.call(\"closePlugin\", { message }),\n storage: {\n get: (key) => rpc.call(\"storageGet\", { key }),\n set: (key, value) => rpc.call(\"storageSet\", { key, value })\n },\n ui: {\n get onmessage() {\n return uiOnMessage;\n },\n set onmessage(cb) {\n uiOnMessage = cb;\n flushUI();\n },\n postMessage: (msg) => rpc.send({ kind: \"toUI\", data: msg }),\n on: (cb) => {\n uiHandlers.push(cb);\n flushUI();\n }\n },\n widget: {\n register(def) {\n if (!def || typeof def.render !== \"function\") throw new Error(\"popcraft.widget.register needs a render(state) function\");\n widgetDef = def;\n widgetQueue.splice(0).forEach(handleWidgetClick);\n },\n insert(options) {\n if (!widgetDef) return Promise.reject(new Error(\"Call popcraft.widget.register first\"));\n const o = options || {};\n const state = o.state !== void 0 ? clone(o.state) : initialWidgetState();\n return rpc.call(\"widgetInsert\", { state, tree: renderWidget(state).tree, x: o.x, y: o.y });\n },\n getState: (nodeId) => rpc.call(\"widgetGet\", { id: nodeId }),\n setState(nodeId, state) {\n if (!widgetDef) return Promise.reject(new Error(\"Call popcraft.widget.register first\"));\n return commitWidget(nodeId, clone(state));\n }\n },\n on: (event, cb) => rpc.on(event, cb),\n off: (event, cb) => rpc.off(event, cb)\n };\n rpc.on(\"init\", (data) => {\n var _a, _b, _c;\n popcraft.command = data.command;\n popcraft.importMode = (_a = data.importMode) != null ? _a : null;\n popcraft.importFile = (_b = data.importFile) != null ? _b : null;\n popcraft.exportRequest = (_c = data.exportRequest) != null ? _c : null;\n });\n return popcraft;\n }\n function installMainApi() {\n const rpc = createRpcClient();\n const api = createMainApi(rpc);\n const w = window;\n w.__popcraftRpc = rpc;\n w.popcraft = api;\n w.vizpops = api;\n window.addEventListener(\"error\", (e) => rpc.send({ kind: \"error\", message: String(e.message || e) }));\n window.addEventListener(\"unhandledrejection\", (e) => rpc.send({ kind: \"error\", message: String(e.reason && e.reason.message || e.reason) }));\n return api;\n }\n\n // src/runtime/main.entry.ts\n installMainApi();\n})();";
|
|
4
4
|
/** The `popcraft` shim for a plugin UI document, as injectable inline script. */
|
|
5
5
|
export const UI_RUNTIME = "\"use strict\";\n(() => {\n // src/runtime/rpc.ts\n function createRpcClient() {\n let port = null;\n const queue = [];\n const pending = {};\n const listeners = {};\n let nextId = 1;\n function send(msg) {\n if (port) port.postMessage(msg);\n else queue.push(msg);\n }\n function call(method, params) {\n return new Promise((resolve, reject) => {\n const id = nextId++;\n pending[id] = { resolve, reject };\n send({ kind: \"rpc\", id, method, params });\n });\n }\n function emit(event, data) {\n for (const cb of (listeners[event] || []).slice()) {\n try {\n cb(data);\n } catch (e) {\n console.error(e);\n }\n }\n }\n window.addEventListener(\"message\", (e) => {\n const data = e.data;\n if (e.source !== window.parent || !data || data.type !== \"popcraft-plugin-port\" || port) return;\n port = e.ports[0];\n port.onmessage = (ev) => {\n const m = ev.data || {};\n if (m.kind === \"result\" && m.id !== void 0 && pending[m.id]) {\n const p = pending[m.id];\n delete pending[m.id];\n if (m.error) p.reject(new Error(m.error));\n else p.resolve(m.result);\n } else if (m.kind === \"event\" && m.event) {\n emit(m.event, m.data);\n }\n };\n for (const msg of queue.splice(0)) port.postMessage(msg);\n });\n return {\n call,\n send,\n on(event, cb) {\n (listeners[event] = listeners[event] || []).push(cb);\n },\n off(event, cb) {\n listeners[event] = (listeners[event] || []).filter((x) => x !== cb);\n }\n };\n }\n\n // src/runtime/ui.ts\n function createUiApi(rpc = createRpcClient()) {\n const popcraft = {\n onmessage: null,\n postMessage: (msg) => rpc.send({ kind: \"fromUI\", data: msg }),\n close: () => rpc.send({ kind: \"closeUI\" })\n };\n rpc.on(\"message\", (msg) => {\n if (typeof popcraft.onmessage === \"function\") popcraft.onmessage(msg);\n window.dispatchEvent(new MessageEvent(\"message\", { data: { pluginMessage: msg } }));\n });\n return popcraft;\n }\n function installUiApi() {\n const rpc = createRpcClient();\n const api = createUiApi(rpc);\n const w = window;\n w.__popcraftRpc = rpc;\n w.popcraft = api;\n w.vizpops = api;\n return api;\n }\n\n // src/runtime/ui.entry.ts\n installUiApi();\n})();";
|
|
6
6
|
//# sourceMappingURL=runtime.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/generated/runtime.ts"],"names":[],"mappings":"AAAA,iEAAiE;AAEjE,mFAAmF;AACnF,MAAM,CAAC,MAAM,YAAY,GAAG,
|
|
1
|
+
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/generated/runtime.ts"],"names":[],"mappings":"AAAA,iEAAiE;AAEjE,mFAAmF;AACnF,MAAM,CAAC,MAAM,YAAY,GAAG,wylBAAwylB,CAAA;AAEp0lB,iFAAiF;AACjF,MAAM,CAAC,MAAM,UAAU,GAAG,i7EAAi7E,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { buildMainDocument, buildUIDocument, csp } from './host.js';
|
|
2
2
|
export { mainApiMethods } from './runtime/main.js';
|
|
3
3
|
export { MAIN_RUNTIME, UI_RUNTIME } from './generated/runtime.js';
|
|
4
|
-
export type { PopCraftApi } from './runtime/main.js';
|
|
4
|
+
export type { PopCraftApi, PopCraftCommandArgs, PopCraftPresentationAsset, PopCraftPresentationDeck, PopCraftPresentationSettings, PopCraftSlideTiming } from './runtime/main.js';
|
|
5
5
|
export type { PopCraftUiApi } from './runtime/ui.js';
|
|
6
6
|
export * from './types.js';
|
|
7
7
|
export * from './widget.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAClD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAEjE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAClD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAEjE,YAAY,EAAE,WAAW,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,4BAA4B,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AACjL,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAEpD,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA"}
|
package/dist/runtime/main.d.ts
CHANGED
|
@@ -1,9 +1,97 @@
|
|
|
1
1
|
import { type RpcClient } from './rpc.js';
|
|
2
|
-
import type { PopCraftEvents, PopCraftExportOptions, PopCraftFindQuery, PopCraftNode, PopCraftNodeType, PopCraftPage, PopCraftPaint, PopCraftShowUIOptions, PopCraftVariables } from '../types.js';
|
|
2
|
+
import type { PopCraftEvents, PopCraftExportOptions, PopCraftFindQuery, PopCraftNode, PopCraftNodeType, PopCraftPage, PopCraftPaint, PopCraftShowUIOptions, PopCraftUploadOptions, PopCraftUploadResult, PopCraftVariables } from '../types.js';
|
|
3
3
|
import type { PopCraftWidgetDefinition } from '../widget.js';
|
|
4
|
+
export interface PopCraftPresentationSettings {
|
|
5
|
+
voice: string;
|
|
6
|
+
voiceModel: 'natural' | 'hd' | 'standard';
|
|
7
|
+
speed: number;
|
|
8
|
+
style: 'conversational' | 'corporate' | 'energetic' | 'calm' | 'documentary';
|
|
9
|
+
mood: 'uplifting' | 'ambient' | 'cinematic' | 'lofi' | 'electronic' | 'acoustic' | 'none';
|
|
10
|
+
musicModel: 'hq' | 'standard';
|
|
11
|
+
stingers: boolean;
|
|
12
|
+
loudness: number;
|
|
13
|
+
truePeak: number;
|
|
14
|
+
beatAlign: boolean;
|
|
15
|
+
autoAdvance: boolean;
|
|
16
|
+
musicDb: number;
|
|
17
|
+
duckDb: number;
|
|
18
|
+
stingerDb: number;
|
|
19
|
+
leadInMs: number;
|
|
20
|
+
introMs: number;
|
|
21
|
+
tailMs: number;
|
|
22
|
+
minSlideMs: number;
|
|
23
|
+
}
|
|
24
|
+
export interface PopCraftPresentationAsset {
|
|
25
|
+
mediaHash: string;
|
|
26
|
+
name: string;
|
|
27
|
+
durationMs: number;
|
|
28
|
+
source: 'generated' | 'imported' | 'plugin' | 'fallback';
|
|
29
|
+
model?: string;
|
|
30
|
+
loudness?: {
|
|
31
|
+
lufs: number;
|
|
32
|
+
truePeak: number;
|
|
33
|
+
};
|
|
34
|
+
beats?: number[];
|
|
35
|
+
bpm?: number | null;
|
|
36
|
+
hitMs?: number;
|
|
37
|
+
}
|
|
38
|
+
export interface PopCraftSlideTiming {
|
|
39
|
+
frameId: string;
|
|
40
|
+
index: number;
|
|
41
|
+
start: number;
|
|
42
|
+
duration: number;
|
|
43
|
+
transitionMs: number;
|
|
44
|
+
voiceStart: number | null;
|
|
45
|
+
voiceMs: number;
|
|
46
|
+
leaveAfterMs: number;
|
|
47
|
+
advanceAfterMs: number;
|
|
48
|
+
hit: number | null;
|
|
49
|
+
}
|
|
50
|
+
export interface PopCraftPresentationDeck {
|
|
51
|
+
pageId: string;
|
|
52
|
+
soundtrackId: string | null;
|
|
53
|
+
settings: PopCraftPresentationSettings;
|
|
54
|
+
total: number;
|
|
55
|
+
trimDb: number;
|
|
56
|
+
slides: {
|
|
57
|
+
frameId: string;
|
|
58
|
+
index: number;
|
|
59
|
+
name: string;
|
|
60
|
+
notes: string;
|
|
61
|
+
script: string;
|
|
62
|
+
animationMs: number;
|
|
63
|
+
transition: {
|
|
64
|
+
type: string;
|
|
65
|
+
duration: number;
|
|
66
|
+
} | null;
|
|
67
|
+
voice: PopCraftPresentationAsset | null;
|
|
68
|
+
stale: boolean;
|
|
69
|
+
holdMs: number | null;
|
|
70
|
+
timing: PopCraftSlideTiming;
|
|
71
|
+
}[];
|
|
72
|
+
music: PopCraftPresentationAsset | null;
|
|
73
|
+
stinger: PopCraftPresentationAsset | null;
|
|
74
|
+
}
|
|
75
|
+
/** Arguments of an editor command method: see docs/plugins/methods.md for each one's schema. */
|
|
76
|
+
export type PopCraftCommandArgs = Record<string, unknown>;
|
|
4
77
|
export declare function createMainApi(rpc?: RpcClient): {
|
|
5
78
|
/** Which menu command the user picked, or null when the plugin ran some other way. */
|
|
6
79
|
command: string | null;
|
|
80
|
+
/** Host import mode when launched as an importer, else null. */
|
|
81
|
+
importMode: "new" | "into-current" | null;
|
|
82
|
+
/** Pending import file when the host handed one over, else null. */
|
|
83
|
+
importFile: {
|
|
84
|
+
name: string;
|
|
85
|
+
dataUrl: string;
|
|
86
|
+
byteLength: number;
|
|
87
|
+
} | null;
|
|
88
|
+
/** Pending export request (File → Export → this plugin's format), else null. */
|
|
89
|
+
exportRequest: {
|
|
90
|
+
exporterId: string;
|
|
91
|
+
extension: string;
|
|
92
|
+
name: string;
|
|
93
|
+
nodeIds: string[];
|
|
94
|
+
} | null;
|
|
7
95
|
getSelection: () => Promise<PopCraftNode[]>;
|
|
8
96
|
setSelection: (ids: string[]) => Promise<void>;
|
|
9
97
|
getNode: (id: string) => Promise<PopCraftNode | null>;
|
|
@@ -13,12 +101,286 @@ export declare function createMainApi(rpc?: RpcClient): {
|
|
|
13
101
|
updateNode: (id: string, props: Partial<PopCraftNode>) => Promise<void>;
|
|
14
102
|
deleteNode: (id: string) => Promise<void>;
|
|
15
103
|
setText: (id: string, characters: string) => Promise<void>;
|
|
104
|
+
/** Put TEXT layers on a path (another layer's outline, or their own arc, circle or wave), or tune one: brackets, alignment, placement, effect, overflow. */
|
|
105
|
+
setTextPath: (opts: {
|
|
106
|
+
ids?: string[];
|
|
107
|
+
mode?: "PATH" | "ARC" | "CIRCLE" | "WAVE" | "NONE";
|
|
108
|
+
pathId?: string;
|
|
109
|
+
bend?: number;
|
|
110
|
+
radius?: number;
|
|
111
|
+
amplitude?: number;
|
|
112
|
+
frequency?: number;
|
|
113
|
+
offset?: number;
|
|
114
|
+
endOffset?: number;
|
|
115
|
+
flip?: boolean;
|
|
116
|
+
align?: "LEFT" | "CENTER" | "RIGHT" | "JUSTIFY";
|
|
117
|
+
placement?: "BASELINE" | "ASCENDER" | "DESCENDER" | "CENTER";
|
|
118
|
+
baselineShift?: number;
|
|
119
|
+
spacing?: number;
|
|
120
|
+
effect?: "RAINBOW" | "SKEW" | "RIBBON" | "STAIR" | "GRAVITY";
|
|
121
|
+
overflow?: "CLIP" | "VISIBLE" | "SHRINK";
|
|
122
|
+
}) => Promise<unknown>;
|
|
123
|
+
/** Area type: flow a TEXT layer inside a closed shape, kept `inset` px in. */
|
|
124
|
+
flowTextIntoShape: (opts: {
|
|
125
|
+
id?: string;
|
|
126
|
+
shapeId?: string;
|
|
127
|
+
inset?: number;
|
|
128
|
+
fit?: "NONE" | "SHRINK" | "FIT";
|
|
129
|
+
}) => Promise<unknown>;
|
|
130
|
+
/** Take TEXT layers off their path or out of their shape (or free every text linked to a path / shape). */
|
|
131
|
+
detachText: (opts?: {
|
|
132
|
+
ids?: string[];
|
|
133
|
+
}) => Promise<unknown>;
|
|
134
|
+
/** Auto-size TEXT layers' type to their box, shape or path. */
|
|
135
|
+
setTextFit: (opts: {
|
|
136
|
+
ids?: string[];
|
|
137
|
+
fit: "NONE" | "SHRINK" | "FIT";
|
|
138
|
+
}) => Promise<unknown>;
|
|
139
|
+
createPage: (name?: string) => Promise<string>;
|
|
140
|
+
setCurrentPage: (pageId: string) => Promise<void>;
|
|
141
|
+
createImage: (opts: {
|
|
142
|
+
dataUrl?: string;
|
|
143
|
+
bytes?: number[];
|
|
144
|
+
mimeType?: string;
|
|
145
|
+
name?: string;
|
|
146
|
+
x?: number;
|
|
147
|
+
y?: number;
|
|
148
|
+
width?: number;
|
|
149
|
+
height?: number;
|
|
150
|
+
parentId?: string;
|
|
151
|
+
}) => Promise<string>;
|
|
152
|
+
createDocument: (opts?: {
|
|
153
|
+
name?: string;
|
|
154
|
+
}) => Promise<{
|
|
155
|
+
key?: string;
|
|
156
|
+
docId: string;
|
|
157
|
+
name: string;
|
|
158
|
+
}>;
|
|
159
|
+
getImportMode: () => Promise<"new" | "into-current" | null>;
|
|
160
|
+
getImportFile: () => Promise<{
|
|
161
|
+
name: string;
|
|
162
|
+
dataUrl: string;
|
|
163
|
+
byteLength: number;
|
|
164
|
+
} | null>;
|
|
165
|
+
/**
|
|
166
|
+
* The open page as a storefront design in a neutral form, for an exporter that writes its own store's templates:
|
|
167
|
+
* each page's HTML with the store's data marked (`{{page.title}}`, `{{item.price}}`, `<!-- pc:each … -->` lists,
|
|
168
|
+
* `data-pc-action` forms), and its collections with their commerce schema and sample records.
|
|
169
|
+
*/
|
|
170
|
+
getStorefront: () => Promise<{
|
|
171
|
+
name: string;
|
|
172
|
+
pages: {
|
|
173
|
+
name: string;
|
|
174
|
+
route: string | null;
|
|
175
|
+
about: string | null;
|
|
176
|
+
html: string;
|
|
177
|
+
}[];
|
|
178
|
+
collections: {
|
|
179
|
+
id: string;
|
|
180
|
+
name: string;
|
|
181
|
+
schema: string | null;
|
|
182
|
+
fields: string[];
|
|
183
|
+
samples: Record<string, unknown>[];
|
|
184
|
+
}[];
|
|
185
|
+
}>;
|
|
186
|
+
/**
|
|
187
|
+
* A design's data (docs: Collections): a collection and its fields (`schema`: what it stands for, e.g.
|
|
188
|
+
* `commerce.product`, whose fields are made for it), its records, and reading them.
|
|
189
|
+
*/
|
|
190
|
+
editCollection: (opts: PopCraftCommandArgs) => Promise<unknown>;
|
|
191
|
+
editRecords: (opts: PopCraftCommandArgs) => Promise<unknown>;
|
|
192
|
+
getRecords: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
193
|
+
/** A layer as a web page's form control (a FORM's `formAction`, an INPUT's name and value), repeated per record, a page's address, its semantics. */
|
|
194
|
+
setControl: (opts: PopCraftCommandArgs) => Promise<unknown>;
|
|
195
|
+
setRepeat: (opts: PopCraftCommandArgs) => Promise<unknown>;
|
|
196
|
+
setRoute: (opts: PopCraftCommandArgs) => Promise<unknown>;
|
|
197
|
+
setSemantics: (opts: PopCraftCommandArgs) => Promise<unknown>;
|
|
198
|
+
/** Which record layers are about (one product, picked from a collection), and which of its fields a layer's words, picture or an instance's properties follow. */
|
|
199
|
+
setRecord: (opts: PopCraftCommandArgs) => Promise<unknown>;
|
|
200
|
+
bindField: (opts: PopCraftCommandArgs) => Promise<unknown>;
|
|
201
|
+
/** The site's environment: public settings its host reads by name when it is deployed (never a secret: the file keeps them). */
|
|
202
|
+
getSiteEnvironment: () => Promise<Record<string, string>>;
|
|
203
|
+
setSiteEnvironment: (set: Record<string, string | null>) => Promise<unknown>;
|
|
204
|
+
/** What this plugin keeps with the open file (its settings for this design), under its own id; JSON only. */
|
|
205
|
+
getFileData: <T = unknown>(key: string) => Promise<T | undefined>;
|
|
206
|
+
setFileData: (key: string, value: unknown) => Promise<void>;
|
|
207
|
+
/** A store's project built from the open page, zipped (needs `export`): what an exporter saves with `saveExport`. */
|
|
208
|
+
getStorefrontFiles: (target: "shopify-theme" | "next-commerce" | "next-commerce-store") => Promise<{
|
|
209
|
+
name: string;
|
|
210
|
+
files: number;
|
|
211
|
+
bytes: Uint8Array;
|
|
212
|
+
}>;
|
|
213
|
+
getExportRequest: () => Promise<{
|
|
214
|
+
exporterId: string;
|
|
215
|
+
extension: string;
|
|
216
|
+
name: string;
|
|
217
|
+
nodeIds: string[];
|
|
218
|
+
} | null>;
|
|
219
|
+
/** Save the exporter's file (once per export request); the host enforces the contributed extension. */
|
|
220
|
+
saveExport: (file: {
|
|
221
|
+
name?: string;
|
|
222
|
+
mimeType?: string;
|
|
223
|
+
bytes?: Uint8Array | number[];
|
|
224
|
+
dataUrl?: string;
|
|
225
|
+
}) => Promise<{
|
|
226
|
+
name: string;
|
|
227
|
+
byteLength: number;
|
|
228
|
+
}>;
|
|
229
|
+
/**
|
|
230
|
+
* Presentation audio (docs/plugins/presentation-audio.md): the deck's slides, notes, narration and timing; the
|
|
231
|
+
* soundtrack's settings, bed and stinger.
|
|
232
|
+
*/
|
|
233
|
+
getPresentationAudio: (opts?: {
|
|
234
|
+
pageId?: string;
|
|
235
|
+
}) => Promise<PopCraftPresentationDeck>;
|
|
236
|
+
/** Change the soundtrack's settings (voice, style, mood, loudness, beat alignment, levels) and re-time it. */
|
|
237
|
+
setPresentationAudioSettings: (opts: {
|
|
238
|
+
pageId?: string;
|
|
239
|
+
} & Partial<PopCraftPresentationSettings>) => Promise<{
|
|
240
|
+
soundtrackId: string | null;
|
|
241
|
+
settings: PopCraftPresentationSettings;
|
|
242
|
+
total: number;
|
|
243
|
+
}>;
|
|
244
|
+
/** Put a sound in (a slide's narration, the bed or the stinger): bytes are normalised to the soundtrack's target and stored. */
|
|
245
|
+
setPresentationAudioClip: (opts: {
|
|
246
|
+
pageId?: string;
|
|
247
|
+
role: "voice" | "music" | "stinger";
|
|
248
|
+
frameId?: string;
|
|
249
|
+
bytes?: Uint8Array | number[];
|
|
250
|
+
mediaHash?: string;
|
|
251
|
+
url?: string;
|
|
252
|
+
name?: string;
|
|
253
|
+
normalize?: boolean;
|
|
254
|
+
bpm?: number;
|
|
255
|
+
beats?: number[];
|
|
256
|
+
hitMs?: number;
|
|
257
|
+
}) => Promise<{
|
|
258
|
+
soundtrackId: string | null;
|
|
259
|
+
asset: PopCraftPresentationAsset;
|
|
260
|
+
total: number;
|
|
261
|
+
mix: {
|
|
262
|
+
lufs: number;
|
|
263
|
+
truePeak: number;
|
|
264
|
+
} | null;
|
|
265
|
+
}>;
|
|
266
|
+
removePresentationAudioClip: (opts: {
|
|
267
|
+
pageId?: string;
|
|
268
|
+
role: "voice" | "music" | "stinger";
|
|
269
|
+
frameId?: string;
|
|
270
|
+
}) => Promise<{
|
|
271
|
+
total: number;
|
|
272
|
+
}>;
|
|
273
|
+
/** Re-time: fixed slide lengths (ms, null clears) and beat-aligned changes. */
|
|
274
|
+
setPresentationTiming: (opts: {
|
|
275
|
+
pageId?: string;
|
|
276
|
+
holds?: Record<string, number | null>;
|
|
277
|
+
beatAlign?: boolean;
|
|
278
|
+
}) => Promise<{
|
|
279
|
+
total: number;
|
|
280
|
+
slides: PopCraftSlideTiming[];
|
|
281
|
+
}>;
|
|
282
|
+
/** The mix as the export carries it: loudness, true peak, and (wav: true) the 48 kHz stereo WAV. */
|
|
283
|
+
getPresentationMix: (opts?: {
|
|
284
|
+
pageId?: string;
|
|
285
|
+
wav?: boolean;
|
|
286
|
+
range?: [number, number];
|
|
287
|
+
}) => Promise<{
|
|
288
|
+
lufs: number | null;
|
|
289
|
+
truePeak: number | null;
|
|
290
|
+
target?: number;
|
|
291
|
+
ceiling?: number;
|
|
292
|
+
durationMs: number;
|
|
293
|
+
sampleRate?: number;
|
|
294
|
+
wav?: Uint8Array;
|
|
295
|
+
}>;
|
|
296
|
+
/** Ask the user to generate with AI (the panel opens with the request filled in; the user decides). */
|
|
297
|
+
requestPresentationAudio: (opts?: {
|
|
298
|
+
pageId?: string;
|
|
299
|
+
what?: "all" | "voice" | "music" | "stingers";
|
|
300
|
+
slides?: string[];
|
|
301
|
+
} & Partial<PopCraftPresentationSettings>) => Promise<{
|
|
302
|
+
status: "generated";
|
|
303
|
+
summary: string;
|
|
304
|
+
} | {
|
|
305
|
+
status: "declined";
|
|
306
|
+
} | {
|
|
307
|
+
status: "failed";
|
|
308
|
+
error: string;
|
|
309
|
+
}>;
|
|
310
|
+
/** Editor commands: each takes the arguments documented in docs/plugins/methods.md (the agent tool of the same purpose). */
|
|
311
|
+
moveNodes: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
312
|
+
resizeNodes: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
313
|
+
renameNodes: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
314
|
+
reparentNodes: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
315
|
+
duplicateNodes: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
316
|
+
groupNodes: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
317
|
+
ungroupNodes: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
318
|
+
alignNodes: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
319
|
+
distributeNodes: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
320
|
+
flipNodes: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
321
|
+
rotateNodes: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
322
|
+
reorderNodes: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
323
|
+
setLocked: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
324
|
+
setVisible: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
325
|
+
setAutoLayout: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
326
|
+
importSvg: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
327
|
+
measureNodes: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
328
|
+
setFills: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
329
|
+
setStrokes: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
330
|
+
setEffects: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
331
|
+
replaceColor: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
332
|
+
setTypography: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
333
|
+
applyStyle: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
334
|
+
createComponent: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
335
|
+
createInstance: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
336
|
+
renamePage: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
337
|
+
getDocumentOutline: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
338
|
+
setPageSetup: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
339
|
+
setShowAdvance: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
340
|
+
booleanOperation: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
341
|
+
flattenNodes: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
342
|
+
outlineStroke: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
343
|
+
setMask: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
344
|
+
setMaskType: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
345
|
+
shapeBuilder: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
346
|
+
setKeyframes: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
347
|
+
getAnimation: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
348
|
+
getCompositions: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
349
|
+
editBehaviours: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
350
|
+
setTimeline: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
351
|
+
setLayerTiming: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
352
|
+
editTextAnimation: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
353
|
+
edit3DScene: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
354
|
+
setInstancePlayback: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
355
|
+
editComponentProperty: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
356
|
+
setShaderFill: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
357
|
+
createComposition: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
358
|
+
editComposition: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
359
|
+
editStateMachine: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
360
|
+
getStateMachine: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
361
|
+
applyMotionPreset: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
362
|
+
staggerMotion: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
363
|
+
createMotionComponent: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
364
|
+
addAudio: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
365
|
+
editFrameAudio: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
366
|
+
editVideoClip: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
367
|
+
detectAudioOnsets: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
368
|
+
cutToBeat: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
369
|
+
editPrototype: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
370
|
+
usePresentationFallbackAudio: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
371
|
+
/** Bring a Lottie, PDF or PopCraft file into the open document (the `importFile` field is the file an importer was handed). */
|
|
372
|
+
importDocumentFile: (opts?: PopCraftCommandArgs) => Promise<unknown>;
|
|
16
373
|
getStyles: () => Promise<unknown[]>;
|
|
17
374
|
createPaintStyle: (name: string, paints: PopCraftPaint[]) => Promise<string>;
|
|
18
375
|
getVariables: () => Promise<PopCraftVariables>;
|
|
19
376
|
setVariableValue: (variableId: string, modeId: string, value: unknown) => Promise<void>;
|
|
20
377
|
exportNode: (id: string, options?: PopCraftExportOptions) => Promise<string | Uint8Array<ArrayBufferLike>>;
|
|
21
378
|
openExternal: (url: string) => Promise<void>;
|
|
379
|
+
/**
|
|
380
|
+
* Send a file to an https URL. PopCraft makes the request, not the sandbox, so it works for files of
|
|
381
|
+
* any size the server accepts, including straight to a presigned storage URL. Needs `network`.
|
|
382
|
+
*/
|
|
383
|
+
upload: (url: string, options: PopCraftUploadOptions) => Promise<PopCraftUploadResult>;
|
|
22
384
|
notify: (message: string, options?: {
|
|
23
385
|
error?: boolean;
|
|
24
386
|
}) => Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/runtime/main.ts"],"names":[],"mappings":"AAIA,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,UAAU,CAAA;AAC1D,OAAO,KAAK,EACV,cAAc,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,YAAY,EAAE,gBAAgB,EACxF,YAAY,EAAE,aAAa,EAAE,qBAAqB,EAAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/runtime/main.ts"],"names":[],"mappings":"AAIA,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,UAAU,CAAA;AAC1D,OAAO,KAAK,EACV,cAAc,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,YAAY,EAAE,gBAAgB,EACxF,YAAY,EAAE,aAAa,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,oBAAoB,EAC/F,iBAAiB,EAClB,MAAM,aAAa,CAAA;AACpB,OAAO,KAAK,EACgB,wBAAwB,EACnD,MAAM,cAAc,CAAA;AAErB,MAAM,WAAW,4BAA4B;IAC3C,KAAK,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,SAAS,GAAG,IAAI,GAAG,UAAU,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IACxE,KAAK,EAAE,gBAAgB,GAAG,WAAW,GAAG,WAAW,GAAG,MAAM,GAAG,aAAa,CAAC;IAC7E,IAAI,EAAE,WAAW,GAAG,SAAS,GAAG,WAAW,GAAG,MAAM,GAAG,YAAY,GAAG,UAAU,GAAG,MAAM,CAAC;IAC1F,UAAU,EAAE,IAAI,GAAG,UAAU,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,OAAO,CAAC;IAAC,WAAW,EAAE,OAAO,CAAC;IAC/H,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE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YAAC,CAAC,CAAC,EAAE,MAAM,CAAC;YAAC,CAAC,CAAC,EAAE,MAAM,CAAA;SAAE,GAAG,OAAO,CAAC,MAAM,CAAC;mBAMvF,KAAK,SAAS,MAAM,gBAAgB,MAAM;iBAC5C,KAAK,SAAS,MAAM,UAAU,MAAM,SAAS,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC;;SAMxE,CAAC,SAAS,MAAM,cAAc,SAAS,CAAC,MAAM,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC,KAAK,IAAI;UAC9E,CAAC,SAAS,MAAM,cAAc,SAAS,CAAC,MAAM,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC,KAAK,IAAI;EAUxF;AAQD,iFAAiF;AACjF,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAA;AAE1D,oFAAoF;AACpF,wBAAgB,cAAc,IAAI,WAAW,CAU5C;AAED;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,MAAM,EAAE,CAQzC"}
|
package/dist/runtime/main.js
CHANGED
|
@@ -97,6 +97,12 @@ export function createMainApi(rpc = createRpcClient()) {
|
|
|
97
97
|
const popcraft = {
|
|
98
98
|
/** Which menu command the user picked, or null when the plugin ran some other way. */
|
|
99
99
|
command: null,
|
|
100
|
+
/** Host import mode when launched as an importer, else null. */
|
|
101
|
+
importMode: null,
|
|
102
|
+
/** Pending import file when the host handed one over, else null. */
|
|
103
|
+
importFile: null,
|
|
104
|
+
/** Pending export request (File → Export → this plugin's format), else null. */
|
|
105
|
+
exportRequest: null,
|
|
100
106
|
getSelection: () => rpc.call('getSelection'),
|
|
101
107
|
setSelection: (ids) => rpc.call('setSelection', { ids }),
|
|
102
108
|
getNode: (id) => rpc.call('getNode', { id }),
|
|
@@ -106,12 +112,151 @@ export function createMainApi(rpc = createRpcClient()) {
|
|
|
106
112
|
updateNode: (id, props) => rpc.call('updateNode', { id, props }),
|
|
107
113
|
deleteNode: (id) => rpc.call('deleteNode', { id }),
|
|
108
114
|
setText: (id, characters) => rpc.call('setText', { id, characters }),
|
|
115
|
+
/** Put TEXT layers on a path (another layer's outline, or their own arc, circle or wave), or tune one: brackets, alignment, placement, effect, overflow. */
|
|
116
|
+
setTextPath: (opts) => rpc.call('setTextPath', opts || {}),
|
|
117
|
+
/** Area type: flow a TEXT layer inside a closed shape, kept `inset` px in. */
|
|
118
|
+
flowTextIntoShape: (opts) => rpc.call('flowTextIntoShape', opts || {}),
|
|
119
|
+
/** Take TEXT layers off their path or out of their shape (or free every text linked to a path / shape). */
|
|
120
|
+
detachText: (opts) => rpc.call('detachText', opts || {}),
|
|
121
|
+
/** Auto-size TEXT layers' type to their box, shape or path. */
|
|
122
|
+
setTextFit: (opts) => rpc.call('setTextFit', opts || {}),
|
|
123
|
+
createPage: (name) => rpc.call('createPage', name != null ? { name: String(name) } : {}),
|
|
124
|
+
setCurrentPage: (pageId) => rpc.call('setCurrentPage', { pageId }),
|
|
125
|
+
createImage: (opts) => rpc.call('createImage', opts || {}),
|
|
126
|
+
createDocument: (opts) => rpc.call('createDocument', opts || {}),
|
|
127
|
+
getImportMode: () => rpc.call('getImportMode'),
|
|
128
|
+
getImportFile: () => rpc.call('getImportFile'),
|
|
129
|
+
/**
|
|
130
|
+
* The open page as a storefront design in a neutral form, for an exporter that writes its own store's templates:
|
|
131
|
+
* each page's HTML with the store's data marked (`{{page.title}}`, `{{item.price}}`, `<!-- pc:each … -->` lists,
|
|
132
|
+
* `data-pc-action` forms), and its collections with their commerce schema and sample records.
|
|
133
|
+
*/
|
|
134
|
+
getStorefront: () => rpc.call('getStorefront'),
|
|
135
|
+
/**
|
|
136
|
+
* A design's data (docs: Collections): a collection and its fields (`schema`: what it stands for, e.g.
|
|
137
|
+
* `commerce.product`, whose fields are made for it), its records, and reading them.
|
|
138
|
+
*/
|
|
139
|
+
editCollection: (opts) => rpc.call('editCollection', opts || {}),
|
|
140
|
+
editRecords: (opts) => rpc.call('editRecords', opts || {}),
|
|
141
|
+
getRecords: (opts) => rpc.call('getRecords', opts || {}),
|
|
142
|
+
/** A layer as a web page's form control (a FORM's `formAction`, an INPUT's name and value), repeated per record, a page's address, its semantics. */
|
|
143
|
+
setControl: (opts) => rpc.call('setControl', opts || {}),
|
|
144
|
+
setRepeat: (opts) => rpc.call('setRepeat', opts || {}),
|
|
145
|
+
setRoute: (opts) => rpc.call('setRoute', opts || {}),
|
|
146
|
+
setSemantics: (opts) => rpc.call('setSemantics', opts || {}),
|
|
147
|
+
/** Which record layers are about (one product, picked from a collection), and which of its fields a layer's words, picture or an instance's properties follow. */
|
|
148
|
+
setRecord: (opts) => rpc.call('setRecord', opts || {}),
|
|
149
|
+
bindField: (opts) => rpc.call('bindField', opts || {}),
|
|
150
|
+
/** The site's environment: public settings its host reads by name when it is deployed (never a secret: the file keeps them). */
|
|
151
|
+
getSiteEnvironment: () => rpc.call('getSiteEnvironment'),
|
|
152
|
+
setSiteEnvironment: (set) => rpc.call('setSiteEnvironment', { set }),
|
|
153
|
+
/** What this plugin keeps with the open file (its settings for this design), under its own id; JSON only. */
|
|
154
|
+
getFileData: (key) => rpc.call('getFileData', { key }),
|
|
155
|
+
setFileData: (key, value) => rpc.call('setFileData', { key, value }),
|
|
156
|
+
/** A store's project built from the open page, zipped (needs `export`): what an exporter saves with `saveExport`. */
|
|
157
|
+
getStorefrontFiles: (target) => rpc.call('getStorefrontFiles', { target }),
|
|
158
|
+
getExportRequest: () => rpc.call('getExportRequest'),
|
|
159
|
+
/** Save the exporter's file (once per export request); the host enforces the contributed extension. */
|
|
160
|
+
saveExport: (file) => rpc.call('saveExport', file || {}),
|
|
161
|
+
/**
|
|
162
|
+
* Presentation audio (docs/plugins/presentation-audio.md): the deck's slides, notes, narration and timing; the
|
|
163
|
+
* soundtrack's settings, bed and stinger.
|
|
164
|
+
*/
|
|
165
|
+
getPresentationAudio: (opts) => rpc.call('getPresentationAudio', opts || {}),
|
|
166
|
+
/** Change the soundtrack's settings (voice, style, mood, loudness, beat alignment, levels) and re-time it. */
|
|
167
|
+
setPresentationAudioSettings: (opts) => rpc.call('setPresentationAudioSettings', opts || {}),
|
|
168
|
+
/** Put a sound in (a slide's narration, the bed or the stinger): bytes are normalised to the soundtrack's target and stored. */
|
|
169
|
+
setPresentationAudioClip: (opts) => rpc.call('setPresentationAudioClip', opts || {}),
|
|
170
|
+
removePresentationAudioClip: (opts) => rpc.call('removePresentationAudioClip', opts || {}),
|
|
171
|
+
/** Re-time: fixed slide lengths (ms, null clears) and beat-aligned changes. */
|
|
172
|
+
setPresentationTiming: (opts) => rpc.call('setPresentationTiming', opts || {}),
|
|
173
|
+
/** The mix as the export carries it: loudness, true peak, and (wav: true) the 48 kHz stereo WAV. */
|
|
174
|
+
getPresentationMix: (opts) => rpc.call('getPresentationMix', opts || {}),
|
|
175
|
+
/** Ask the user to generate with AI (the panel opens with the request filled in; the user decides). */
|
|
176
|
+
requestPresentationAudio: (opts) => rpc.call('requestPresentationAudio', opts || {}),
|
|
177
|
+
/** Editor commands: each takes the arguments documented in docs/plugins/methods.md (the agent tool of the same purpose). */
|
|
178
|
+
moveNodes: (opts) => rpc.call('moveNodes', opts || {}),
|
|
179
|
+
resizeNodes: (opts) => rpc.call('resizeNodes', opts || {}),
|
|
180
|
+
renameNodes: (opts) => rpc.call('renameNodes', opts || {}),
|
|
181
|
+
reparentNodes: (opts) => rpc.call('reparentNodes', opts || {}),
|
|
182
|
+
duplicateNodes: (opts) => rpc.call('duplicateNodes', opts || {}),
|
|
183
|
+
groupNodes: (opts) => rpc.call('groupNodes', opts || {}),
|
|
184
|
+
ungroupNodes: (opts) => rpc.call('ungroupNodes', opts || {}),
|
|
185
|
+
alignNodes: (opts) => rpc.call('alignNodes', opts || {}),
|
|
186
|
+
distributeNodes: (opts) => rpc.call('distributeNodes', opts || {}),
|
|
187
|
+
flipNodes: (opts) => rpc.call('flipNodes', opts || {}),
|
|
188
|
+
rotateNodes: (opts) => rpc.call('rotateNodes', opts || {}),
|
|
189
|
+
reorderNodes: (opts) => rpc.call('reorderNodes', opts || {}),
|
|
190
|
+
setLocked: (opts) => rpc.call('setLocked', opts || {}),
|
|
191
|
+
setVisible: (opts) => rpc.call('setVisible', opts || {}),
|
|
192
|
+
setAutoLayout: (opts) => rpc.call('setAutoLayout', opts || {}),
|
|
193
|
+
importSvg: (opts) => rpc.call('importSvg', opts || {}),
|
|
194
|
+
measureNodes: (opts) => rpc.call('measureNodes', opts || {}),
|
|
195
|
+
setFills: (opts) => rpc.call('setFills', opts || {}),
|
|
196
|
+
setStrokes: (opts) => rpc.call('setStrokes', opts || {}),
|
|
197
|
+
setEffects: (opts) => rpc.call('setEffects', opts || {}),
|
|
198
|
+
replaceColor: (opts) => rpc.call('replaceColor', opts || {}),
|
|
199
|
+
setTypography: (opts) => rpc.call('setTypography', opts || {}),
|
|
200
|
+
applyStyle: (opts) => rpc.call('applyStyle', opts || {}),
|
|
201
|
+
createComponent: (opts) => rpc.call('createComponent', opts || {}),
|
|
202
|
+
createInstance: (opts) => rpc.call('createInstance', opts || {}),
|
|
203
|
+
renamePage: (opts) => rpc.call('renamePage', opts || {}),
|
|
204
|
+
getDocumentOutline: (opts) => rpc.call('getDocumentOutline', opts || {}),
|
|
205
|
+
setPageSetup: (opts) => rpc.call('setPageSetup', opts || {}),
|
|
206
|
+
setShowAdvance: (opts) => rpc.call('setShowAdvance', opts || {}),
|
|
207
|
+
booleanOperation: (opts) => rpc.call('booleanOperation', opts || {}),
|
|
208
|
+
flattenNodes: (opts) => rpc.call('flattenNodes', opts || {}),
|
|
209
|
+
outlineStroke: (opts) => rpc.call('outlineStroke', opts || {}),
|
|
210
|
+
setMask: (opts) => rpc.call('setMask', opts || {}),
|
|
211
|
+
setMaskType: (opts) => rpc.call('setMaskType', opts || {}),
|
|
212
|
+
shapeBuilder: (opts) => rpc.call('shapeBuilder', opts || {}),
|
|
213
|
+
setKeyframes: (opts) => rpc.call('setKeyframes', opts || {}),
|
|
214
|
+
getAnimation: (opts) => rpc.call('getAnimation', opts || {}),
|
|
215
|
+
getCompositions: (opts) => rpc.call('getCompositions', opts || {}),
|
|
216
|
+
editBehaviours: (opts) => rpc.call('editBehaviours', opts || {}),
|
|
217
|
+
setTimeline: (opts) => rpc.call('setTimeline', opts || {}),
|
|
218
|
+
setLayerTiming: (opts) => rpc.call('setLayerTiming', opts || {}),
|
|
219
|
+
editTextAnimation: (opts) => rpc.call('editTextAnimation', opts || {}),
|
|
220
|
+
edit3DScene: (opts) => rpc.call('edit3DScene', opts || {}),
|
|
221
|
+
setInstancePlayback: (opts) => rpc.call('setInstancePlayback', opts || {}),
|
|
222
|
+
editComponentProperty: (opts) => rpc.call('editComponentProperty', opts || {}),
|
|
223
|
+
setShaderFill: (opts) => rpc.call('setShaderFill', opts || {}),
|
|
224
|
+
createComposition: (opts) => rpc.call('createComposition', opts || {}),
|
|
225
|
+
editComposition: (opts) => rpc.call('editComposition', opts || {}),
|
|
226
|
+
editStateMachine: (opts) => rpc.call('editStateMachine', opts || {}),
|
|
227
|
+
getStateMachine: (opts) => rpc.call('getStateMachine', opts || {}),
|
|
228
|
+
applyMotionPreset: (opts) => rpc.call('applyMotionPreset', opts || {}),
|
|
229
|
+
staggerMotion: (opts) => rpc.call('staggerMotion', opts || {}),
|
|
230
|
+
createMotionComponent: (opts) => rpc.call('createMotionComponent', opts || {}),
|
|
231
|
+
addAudio: (opts) => rpc.call('addAudio', opts || {}),
|
|
232
|
+
editFrameAudio: (opts) => rpc.call('editFrameAudio', opts || {}),
|
|
233
|
+
editVideoClip: (opts) => rpc.call('editVideoClip', opts || {}),
|
|
234
|
+
detectAudioOnsets: (opts) => rpc.call('detectAudioOnsets', opts || {}),
|
|
235
|
+
cutToBeat: (opts) => rpc.call('cutToBeat', opts || {}),
|
|
236
|
+
editPrototype: (opts) => rpc.call('editPrototype', opts || {}),
|
|
237
|
+
usePresentationFallbackAudio: (opts) => rpc.call('usePresentationFallbackAudio', opts || {}),
|
|
238
|
+
/** Bring a Lottie, PDF or PopCraft file into the open document (the `importFile` field is the file an importer was handed). */
|
|
239
|
+
importDocumentFile: (opts) => rpc.call('importDocumentFile', opts || {}),
|
|
109
240
|
getStyles: () => rpc.call('getStyles'),
|
|
110
241
|
createPaintStyle: (name, paints) => rpc.call('createPaintStyle', { name, paints }),
|
|
111
242
|
getVariables: () => rpc.call('getVariables'),
|
|
112
243
|
setVariableValue: (variableId, modeId, value) => rpc.call('setVariableValue', { variableId, modeId, value }),
|
|
113
244
|
exportNode: (id, options) => rpc.call('exportNode', { id, options: options || {} }),
|
|
114
245
|
openExternal: (url) => rpc.call('openExternal', { url }),
|
|
246
|
+
/**
|
|
247
|
+
* Send a file to an https URL. PopCraft makes the request, not the sandbox, so it works for files of
|
|
248
|
+
* any size the server accepts, including straight to a presigned storage URL. Needs `network`.
|
|
249
|
+
*/
|
|
250
|
+
upload: (url, options) => {
|
|
251
|
+
const body = options.body instanceof ArrayBuffer ? new Uint8Array(options.body) : options.body;
|
|
252
|
+
return rpc.call('upload', {
|
|
253
|
+
url,
|
|
254
|
+
body,
|
|
255
|
+
method: options.method,
|
|
256
|
+
contentType: options.contentType,
|
|
257
|
+
headers: options.headers,
|
|
258
|
+
});
|
|
259
|
+
},
|
|
115
260
|
notify: (message, options) => rpc.call('notify', { message: String(message), error: !!(options && options.error) }),
|
|
116
261
|
showUI: (options) => rpc.call('showUI', options || {}),
|
|
117
262
|
hideUI: () => rpc.call('hideUI'),
|
|
@@ -151,7 +296,12 @@ export function createMainApi(rpc = createRpcClient()) {
|
|
|
151
296
|
on: (event, cb) => rpc.on(event, cb),
|
|
152
297
|
off: (event, cb) => rpc.off(event, cb),
|
|
153
298
|
};
|
|
154
|
-
rpc.on('init', (data) => {
|
|
299
|
+
rpc.on('init', (data) => {
|
|
300
|
+
popcraft.command = data.command;
|
|
301
|
+
popcraft.importMode = data.importMode ?? null;
|
|
302
|
+
popcraft.importFile = data.importFile ?? null;
|
|
303
|
+
popcraft.exportRequest = data.exportRequest ?? null;
|
|
304
|
+
});
|
|
155
305
|
return popcraft;
|
|
156
306
|
}
|
|
157
307
|
/** Called by the generated sandbox document — not part of the authoring surface. */
|
package/dist/runtime/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../src/runtime/main.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,4FAA4F;AAC5F,qFAAqF;AAErF,OAAO,EAAE,eAAe,EAAkB,MAAM,UAAU,CAAA;AAS1D,SAAS,KAAK,CAAI,CAAI;IACpB,OAAO,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAM,CAAA;AACpE,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,MAAiB,eAAe,EAAE;IAC9D,+FAA+F;IAC/F,8CAA8C;IAC9C,MAAM,UAAU,GAA2B,EAAE,CAAA;IAC7C,IAAI,WAAW,GAAgC,IAAI,CAAA;IACnD,MAAM,OAAO,GAAc,EAAE,CAAA;IAE7B,SAAS,SAAS,CAAC,GAAY;QAC7B,KAAK,MAAM,EAAE,IAAI,UAAU,EAAE,CAAC;YAAC,IAAI,CAAC;gBAAC,EAAE,CAAC,GAAG,CAAC,CAAA;YAAC,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;YAAC,CAAC;QAAC,CAAC;QAC/E,IAAI,OAAO,WAAW,KAAK,UAAU,EAAE,CAAC;YAAC,IAAI,CAAC;gBAAC,WAAW,CAAC,GAAG,CAAC,CAAA;YAAC,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;YAAC,CAAC;QAAC,CAAC;IACpG,CAAC;IACD,SAAS,OAAO;QACd,IAAI,UAAU,CAAC,MAAM,IAAI,OAA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AC,GAAG,OAAO,EAAE,GAAG,OAAO,EAAE,GAAG,MAAM,CAAC,CAAC,IAAI,EAAE,CAAA;AACnD,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** What a plugin may do. `notify`, `showUI` and per-plugin storage are always allowed. */
|
|
2
2
|
export type PopCraftPermission = 'read' | 'write' | 'export' | 'network' | 'comments';
|
|
3
3
|
export declare const ALL_PERMISSIONS: readonly PopCraftPermission[];
|
|
4
|
-
export type PopCraftNodeType = 'RECTANGLE' | 'ELLIPSE' | 'POLYGON' | 'STAR' | 'LINE' | 'ARROW' | 'FRAME' | 'SECTION' | 'TEXT' | 'STICKY' | 'VECTOR' | 'WIDGET';
|
|
4
|
+
export type PopCraftNodeType = 'RECTANGLE' | 'ELLIPSE' | 'POLYGON' | 'STAR' | 'LINE' | 'ARROW' | 'FRAME' | 'SECTION' | 'SLICE' | 'GROUP' | 'TEXT' | 'STICKY' | 'VECTOR' | 'BOOLEAN' | 'WIDGET' | 'IMAGE' | 'COMPONENT' | 'COMPONENT_SET' | 'INSTANCE' | 'PIXEL_GRID' | 'RASTER';
|
|
5
5
|
export interface PopCraftCommand {
|
|
6
6
|
/** Passed to the plugin as `popcraft.command`. */
|
|
7
7
|
id: string;
|
|
@@ -21,9 +21,43 @@ export interface PopCraftThemeContribution {
|
|
|
21
21
|
/** Path of the theme JSON inside the package. */
|
|
22
22
|
path: string;
|
|
23
23
|
}
|
|
24
|
-
/**
|
|
24
|
+
/** A File → Import format this plugin handles. */
|
|
25
|
+
export interface PopCraftImporterContribution {
|
|
26
|
+
id: string;
|
|
27
|
+
label: string;
|
|
28
|
+
/** Extensions (`.pub`) and/or MIME types. */
|
|
29
|
+
accept: string[];
|
|
30
|
+
/** Command run with `importMode` / `importFile` set. Defaults to the first command. */
|
|
31
|
+
command?: string;
|
|
32
|
+
}
|
|
33
|
+
/** A File → Export format this plugin writes. */
|
|
34
|
+
export interface PopCraftExporterContribution {
|
|
35
|
+
id: string;
|
|
36
|
+
label: string;
|
|
37
|
+
/** The saved file's extension with its dot (`.ai`). */
|
|
38
|
+
extension: string;
|
|
39
|
+
/** Command run with `exportRequest` set. Defaults to the first command. */
|
|
40
|
+
command?: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* What a plugin adds besides commands: themes (static, loaded without running the sandbox), and the File → Import and
|
|
44
|
+
* File → Export formats it handles.
|
|
45
|
+
*/
|
|
46
|
+
/** A panel docked as a tab on the side of the editor, running the plugin's UI while it is open. */
|
|
47
|
+
export interface PopCraftPanelContribution {
|
|
48
|
+
id: string;
|
|
49
|
+
title: string;
|
|
50
|
+
/** A data: URL or a path in the package (svg, png or webp). */
|
|
51
|
+
icon?: string;
|
|
52
|
+
side?: 'left' | 'right';
|
|
53
|
+
/** The command the panel starts the plugin with (default: the panel's id). */
|
|
54
|
+
command?: string;
|
|
55
|
+
}
|
|
25
56
|
export interface PopCraftContributions {
|
|
26
57
|
themes?: PopCraftThemeContribution[];
|
|
58
|
+
panels?: PopCraftPanelContribution[];
|
|
59
|
+
importers?: PopCraftImporterContribution[];
|
|
60
|
+
exporters?: PopCraftExporterContribution[];
|
|
27
61
|
}
|
|
28
62
|
export interface PopCraftManifest {
|
|
29
63
|
id: string;
|
|
@@ -88,6 +122,25 @@ export interface PopCraftExportOptions {
|
|
|
88
122
|
/** Pixel scale for raster formats. */
|
|
89
123
|
scale?: number;
|
|
90
124
|
}
|
|
125
|
+
/** What `popcraft.upload` sends. */
|
|
126
|
+
export interface PopCraftUploadOptions {
|
|
127
|
+
/** The file: bytes (an `exportNode` result, say) or text. */
|
|
128
|
+
body: Uint8Array | ArrayBuffer | string;
|
|
129
|
+
/** Defaults to `PUT`, the verb presigned storage URLs expect. */
|
|
130
|
+
method?: 'PUT' | 'POST';
|
|
131
|
+
/** Sent as the request's `Content-Type`. */
|
|
132
|
+
contentType?: string;
|
|
133
|
+
/** Extra request headers, such as one a storage service asks for. */
|
|
134
|
+
headers?: Record<string, string>;
|
|
135
|
+
}
|
|
136
|
+
/** The server's answer to `popcraft.upload`. */
|
|
137
|
+
export interface PopCraftUploadResult {
|
|
138
|
+
ok: boolean;
|
|
139
|
+
status: number;
|
|
140
|
+
headers: Record<string, string>;
|
|
141
|
+
/** The response body as text (parse it yourself if it is JSON). */
|
|
142
|
+
body: string;
|
|
143
|
+
}
|
|
91
144
|
export interface PopCraftShowUIOptions {
|
|
92
145
|
width?: number;
|
|
93
146
|
height?: number;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAIA,0FAA0F;AAC1F,MAAM,MAAM,kBAAkB,GAC1B,MAAM,GACN,OAAO,GACP,QAAQ,GACR,SAAS,GACT,UAAU,CAAA;AAEd,eAAO,MAAM,eAAe,EAAE,SAAS,kBAAkB,EAAuD,CAAA;AAEhH,MAAM,MAAM,gBAAgB,GACxB,WAAW,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAC/D,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAIA,0FAA0F;AAC1F,MAAM,MAAM,kBAAkB,GAC1B,MAAM,GACN,OAAO,GACP,QAAQ,GACR,SAAS,GACT,UAAU,CAAA;AAEd,eAAO,MAAM,eAAe,EAAE,SAAS,kBAAkB,EAAuD,CAAA;AAEhH,MAAM,MAAM,gBAAgB,GACxB,WAAW,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAC/D,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAC7F,OAA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