@pixerate/editor 0.244.0 → 0.246.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/dist/agent/index.cjs +34 -32
- package/dist/agent/index.js +6 -4
- package/dist/animation-editor/index.cjs +61 -61
- package/dist/animation-editor/index.js +4 -4
- package/dist/{brushstrokeRender-4542T5HP.js → brushstrokeRender-AKUI3SEJ.js} +2 -2
- package/dist/{brushstrokeRender-QA5WVIDT.cjs → brushstrokeRender-ZDHMXJAE.cjs} +5 -5
- package/dist/canvas/changeFeed.d.cts +71 -0
- package/dist/canvas/changeFeed.d.ts +71 -0
- package/dist/canvas/index.cjs +490 -34
- package/dist/canvas/index.d.cts +3 -0
- package/dist/canvas/index.d.ts +3 -0
- package/dist/canvas/index.js +483 -27
- package/dist/canvas/proposal-tools.d.cts +21 -0
- package/dist/canvas/proposal-tools.d.ts +21 -0
- package/dist/canvas/proposals.d.cts +112 -0
- package/dist/canvas/proposals.d.ts +112 -0
- package/dist/chart/index.cjs +21 -21
- package/dist/chart/index.js +2 -2
- package/dist/{chunk-7YQNKSQ7.js → chunk-4PMCMWQS.js} +1 -1
- package/dist/{chunk-4I76OCVD.cjs → chunk-5DLCOQOQ.cjs} +16 -1
- package/dist/{chunk-HZ547SGQ.cjs → chunk-5MFDD7SP.cjs} +1 -1
- package/dist/{chunk-WGN7AUKB.js → chunk-7YW7T5TJ.js} +1 -1
- package/dist/{chunk-5RFENYO5.js → chunk-A23PSOBB.js} +1 -1
- package/dist/{chunk-X3ZINLIP.js → chunk-AU6MWQKZ.js} +1 -1
- package/dist/{chunk-AIS56JOO.js → chunk-BVRRIW7F.js} +1 -1
- package/dist/{chunk-BDIH4DYR.cjs → chunk-CEPKXLBS.cjs} +23 -23
- package/dist/{chunk-OSTKS3YN.js → chunk-DQWPMGH2.js} +1 -1
- package/dist/{chunk-IZL5V5RK.cjs → chunk-FK5LTDOO.cjs} +2 -2
- package/dist/{chunk-L5PB7EG3.js → chunk-LDPLEZ5T.js} +1 -1
- package/dist/{chunk-4EQY4TZJ.js → chunk-N6WUB3Y5.js} +1 -1
- package/dist/{chunk-RNSANXPT.js → chunk-NS62CQ2B.js} +112 -14
- package/dist/{chunk-UZU6DIZA.cjs → chunk-NUTMINJZ.cjs} +45 -45
- package/dist/{chunk-4T47Z4J3.cjs → chunk-Q2UYUWAZ.cjs} +10 -0
- package/dist/{chunk-7V7QMFTI.cjs → chunk-QOBCBGGI.cjs} +2 -2
- package/dist/{chunk-FQVVO5YA.js → chunk-SGPIVHJB.js} +1 -1
- package/dist/{chunk-QTMQ5TGA.js → chunk-UCYW4M66.js} +16 -1
- package/dist/{chunk-SD23XMVJ.cjs → chunk-UVPD55UZ.cjs} +35 -35
- package/dist/{chunk-TBJEMELS.js → chunk-VDAWA546.js} +10 -0
- package/dist/{chunk-W7GRGGBH.cjs → chunk-W7L4HUT2.cjs} +8 -8
- package/dist/{chunk-FJ2MSI43.cjs → chunk-WKPXOGZZ.cjs} +124 -26
- package/dist/{chunk-M6JORA5Z.cjs → chunk-XTWXBQD4.cjs} +86 -86
- package/dist/{chunk-D2SGV525.cjs → chunk-XZNU4DUX.cjs} +2 -2
- package/dist/diagram/index.cjs +2 -2
- package/dist/diagram/index.js +1 -1
- package/dist/effects/index.cjs +4 -4
- package/dist/effects/index.js +2 -2
- package/dist/extensions/index.cjs +5 -5
- package/dist/extensions/index.js +4 -4
- package/dist/gradient/index.cjs +2 -2
- package/dist/gradient/index.js +1 -1
- package/dist/history/HistoryManager.d.cts +20 -1
- package/dist/history/HistoryManager.d.ts +20 -1
- package/dist/history/index.cjs +8 -2
- package/dist/history/index.js +8 -2
- package/dist/history/types.d.cts +31 -0
- package/dist/history/types.d.ts +31 -0
- package/dist/image-editor/index.cjs +775 -775
- package/dist/image-editor/index.js +4 -4
- package/dist/index.cjs +16 -10
- package/dist/index.js +11 -5
- package/dist/paint-editor/index.cjs +136 -136
- package/dist/paint-editor/index.js +4 -4
- package/dist/parameters/index.cjs +2 -2
- package/dist/parameters/index.js +1 -1
- package/dist/tools/index.cjs +4 -2
- package/dist/tools/index.d.cts +1 -0
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/index.js +3 -1
- package/dist/tools/origin.d.cts +22 -0
- package/dist/tools/origin.d.ts +22 -0
- package/dist/vector/index.cjs +964 -964
- package/dist/vector/index.js +5 -5
- package/dist/video-editor/index.cjs +4 -4
- package/dist/video-editor/index.js +2 -2
- package/package.json +1 -1
- package/skills/pixerate-canvas/SKILL.md +25 -0
- package/skills/pixerate-paint-editor/references/light-paint.md +7 -1
package/dist/vector/index.js
CHANGED
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
traceField,
|
|
27
27
|
traceVectorImage,
|
|
28
28
|
vectorTraceContours
|
|
29
|
-
} from "../chunk-
|
|
29
|
+
} from "../chunk-DQWPMGH2.js";
|
|
30
30
|
import {
|
|
31
31
|
applyHomography,
|
|
32
32
|
homographyFromPoints,
|
|
@@ -53,7 +53,7 @@ import {
|
|
|
53
53
|
reverseMorphContour,
|
|
54
54
|
subpathToMorphContour,
|
|
55
55
|
turnMorphContour
|
|
56
|
-
} from "../chunk-
|
|
56
|
+
} from "../chunk-A23PSOBB.js";
|
|
57
57
|
import {
|
|
58
58
|
DEFAULT_VECTOR_FONT,
|
|
59
59
|
IDENTITY_MATRIX,
|
|
@@ -526,8 +526,8 @@ import {
|
|
|
526
526
|
withVectorStrokes,
|
|
527
527
|
withVectorTargetPaint,
|
|
528
528
|
zigzagPaths
|
|
529
|
-
} from "../chunk-
|
|
530
|
-
import "../chunk-
|
|
529
|
+
} from "../chunk-N6WUB3Y5.js";
|
|
530
|
+
import "../chunk-VDAWA546.js";
|
|
531
531
|
import {
|
|
532
532
|
createProvenance
|
|
533
533
|
} from "../chunk-M6DNZNVY.js";
|
|
@@ -582,7 +582,7 @@ import {
|
|
|
582
582
|
import "../chunk-HF5QZS7Z.js";
|
|
583
583
|
import {
|
|
584
584
|
HistoryManager
|
|
585
|
-
} from "../chunk-
|
|
585
|
+
} from "../chunk-NS62CQ2B.js";
|
|
586
586
|
import "../chunk-5UJHB3BW.js";
|
|
587
587
|
import "../chunk-V6DT2CDH.js";
|
|
588
588
|
import {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2; var _class3; var _class4; var _class5; var _class6; var _class7; var _class8;
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkQOBCBGGIcjs = require('../chunk-QOBCBGGI.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -179,7 +179,7 @@ var _chunkSJ2CPTQCcjs = require('../chunk-SJ2CPTQC.cjs');
|
|
|
179
179
|
require('../chunk-2BSBFBOA.cjs');
|
|
180
180
|
|
|
181
181
|
|
|
182
|
-
var
|
|
182
|
+
var _chunkWKPXOGZZcjs = require('../chunk-WKPXOGZZ.cjs');
|
|
183
183
|
|
|
184
184
|
|
|
185
185
|
var _chunkLJZRHVZVcjs = require('../chunk-LJZRHVZV.cjs');
|
|
@@ -3663,7 +3663,7 @@ var VideoEditorController = (_class8 = class _VideoEditorController {
|
|
|
3663
3663
|
__init54() {this.planBasis = /* @__PURE__ */ new Map()}
|
|
3664
3664
|
__init55() {this.planCount = 0}
|
|
3665
3665
|
constructor(options = {}) {;_class8.prototype.__init46.call(this);_class8.prototype.__init47.call(this);_class8.prototype.__init48.call(this);_class8.prototype.__init49.call(this);_class8.prototype.__init50.call(this);_class8.prototype.__init51.call(this);_class8.prototype.__init52.call(this);_class8.prototype.__init53.call(this);_class8.prototype.__init54.call(this);_class8.prototype.__init55.call(this);_class8.prototype.__init56.call(this);_class8.prototype.__init57.call(this);_class8.prototype.__init58.call(this);
|
|
3666
|
-
this.history = _nullishCoalesce(options.history, () => ( new (0,
|
|
3666
|
+
this.history = _nullishCoalesce(options.history, () => ( new (0, _chunkWKPXOGZZcjs.HistoryManager)()));
|
|
3667
3667
|
this.audioPeaks = options.audioPeaks instanceof VideoAudioPeaksCache ? options.audioPeaks : new VideoAudioPeaksCache(options.audioPeaks);
|
|
3668
3668
|
this.luts = options.luts instanceof _chunkXNZFVYC2cjs.VideoLutCache ? options.luts : new (0, _chunkXNZFVYC2cjs.VideoLutCache)(options.luts);
|
|
3669
3669
|
this.frameCache = _nullishCoalesce(options.frameCache, () => ( null));
|
|
@@ -6773,7 +6773,7 @@ async function openVideoClipEffectAuthoring(controller, clip, instance, options
|
|
|
6773
6773
|
const at = _chunkXNZFVYC2cjs.findVideoClip.call(void 0, controller.getProject(), clip);
|
|
6774
6774
|
if (!at) throw new Error(`There is no clip "${clip}".`);
|
|
6775
6775
|
const doc = videoClipEffectDocument(at.clip, instance, provider.id);
|
|
6776
|
-
const session = await
|
|
6776
|
+
const session = await _chunkQOBCBGGIcjs.createEffectAuthoringSession.call(void 0, { document: doc }, { ...options, provider });
|
|
6777
6777
|
return {
|
|
6778
6778
|
clip,
|
|
6779
6779
|
instance,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createEffectAuthoringSession
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-AU6MWQKZ.js";
|
|
4
4
|
import {
|
|
5
5
|
VIDEO_ADJUSTMENT_SCOPES,
|
|
6
6
|
VIDEO_BLEND_MODES,
|
|
@@ -179,7 +179,7 @@ import {
|
|
|
179
179
|
import "../chunk-HF5QZS7Z.js";
|
|
180
180
|
import {
|
|
181
181
|
HistoryManager
|
|
182
|
-
} from "../chunk-
|
|
182
|
+
} from "../chunk-NS62CQ2B.js";
|
|
183
183
|
import {
|
|
184
184
|
AnimationPlayer
|
|
185
185
|
} from "../chunk-CXXXAZ7H.js";
|
package/package.json
CHANGED
|
@@ -50,6 +50,14 @@ the pitfalls, and uses the tools below.
|
|
|
50
50
|
`scope: "canvas"` for the whole drawing. Fix overlaps, misalignment and clipped text, then show
|
|
51
51
|
the user with `canvas_select` or `canvas_highlight`.
|
|
52
52
|
|
|
53
|
+
**Working alongside the user** (they are building and you add to it unasked): suggest instead of
|
|
54
|
+
editing. `propose_nodes` shows ghosts the user accepts or dismisses, and nothing reaches the canvas
|
|
55
|
+
or its history until then. Keep each proposal small and about one idea (a caption, the next card in
|
|
56
|
+
a series, a missing connector), give it a `title` and a one-sentence `rationale`, and anchor it to
|
|
57
|
+
the node it complements with `nearNodeId`. Never accept your own proposals unless the user asked
|
|
58
|
+
you to. Withdraw stale ones with `reject_proposal`: when the user changes what a proposal builds on,
|
|
59
|
+
`list_proposals` shows it under `missing`.
|
|
60
|
+
|
|
53
61
|
## Best practices
|
|
54
62
|
|
|
55
63
|
- **Design-system thinking.** Anything that appears twice should be a component: build one main,
|
|
@@ -143,6 +151,19 @@ undo step and is not saved with the document. The host decides what the children
|
|
|
143
151
|
| `explode_node` | Explode `node` (an id from `list_explodable_nodes`). Unless `multiple`, the node exploded before collapses (it comes back in `collapsed`). Exploding an exploded node changes nothing (`changed: false`). Returns the ids now `exploded`. Then use `get_editor_state` or `capture_view` to read or see the children. |
|
|
144
152
|
| `collapse_node` | Collapse an exploded `node`. Returns the ids still `exploded` and those still `collapsing` (their children leave when the collapse animation ends). Fails when the node is not exploded. |
|
|
145
153
|
|
|
154
|
+
### Proposals (suggest, don't edit)
|
|
155
|
+
|
|
156
|
+
Hosts that let agents suggest additions add these. A proposal is new nodes and edges shown as ghosts
|
|
157
|
+
(not draggable, selectable or saved). Accepting adds them as one undo step, recorded as made by
|
|
158
|
+
whoever proposed it (`agent:<id>`); rejecting leaves the canvas and its history untouched.
|
|
159
|
+
|
|
160
|
+
| Tool | Use it to |
|
|
161
|
+
| --- | --- |
|
|
162
|
+
| `propose_nodes` | Suggest nodes and edges without adding them: `title` (also the undo step name), `rationale`, `nodes` (each optional `id`, `type`, `data`, `position`, `width`, `height`, `nearNodeId`, `side`), `edges` (`source`, `target`, `label`). A node with `nearNodeId` (a canvas node or an earlier node of the proposal) is placed beside it and connected from it. Returns `proposalId`, the planned node ids and positions, edge ids and `anchors` (the canvas nodes it builds on). Read ids with `get_editor_state` first. |
|
|
163
|
+
| `list_proposals` | List pending proposals: `id`, `title`, `rationale`, `origin`, nodes, edges, `anchors`, `missing` (anchors since removed: it can no longer be accepted) and the `readOnly` reason if accepting is disabled. Call it before `accept_proposal` or `reject_proposal`. |
|
|
164
|
+
| `accept_proposal` | Add a pending proposal (`proposalId`) to the canvas as one undo step and drop it from the list. Returns the added `nodeIds`, `edgeIds` and `historyLabel`. Refuses, changing nothing, when the canvas is read-only or an anchor is `missing`. Only when the user asked. |
|
|
165
|
+
| `reject_proposal` | Dismiss a pending proposal (`proposalId`): its ghosts go and nothing else changes. Use it to withdraw a suggestion that no longer fits. Returns the `proposalId` and `title`. |
|
|
166
|
+
|
|
146
167
|
### Write: components
|
|
147
168
|
|
|
148
169
|
These are strict-schema tools. Each returns `{ ids }` of what it created or changed, or fails with
|
|
@@ -320,6 +341,10 @@ effects provider (for example Flair); without one the read tools say so and the
|
|
|
320
341
|
|
|
321
342
|
## Pitfalls
|
|
322
343
|
|
|
344
|
+
- **Proposals are not on the canvas.** Their ids are not in `get_editor_state` until accepted, and
|
|
345
|
+
`canvas_connect` or `canvas_update_node` on them fails. Put the whole idea in one proposal (an
|
|
346
|
+
edge between two proposed nodes goes in its `edges`), or wait for the user to accept it.
|
|
347
|
+
|
|
323
348
|
- **A shape node holds one effect.** `apply_effect` replaces the effect that is there. Effects draw on shape nodes only (nodes with `data.shape`).
|
|
324
349
|
- **Effects belong to the provider they came from.** Each saved effect keeps its provider id. After the provider changes (another effects library), check `list_applied_effects` for `available: false` and re-apply those effects with ids from the new provider's `search_effects`; the old effect ids mean nothing to it.
|
|
325
350
|
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
Light paint is paint that gives off light: neon, light painting, glow-in-the-dark, glowing glassy
|
|
4
4
|
tubes, glowing watercolour. Any dab, particle, bristle, Mixer Brush, impasto or wet paint brush
|
|
5
5
|
lays it with `light.amount` above 0 (`set_brush`); the Light category presets are ready-made
|
|
6
|
-
(`glow-gel`, `neon-marker`, `light-airbrush`, `spark-trail`, `glow-wash
|
|
6
|
+
(`glow-gel`, `neon-marker`, `light-airbrush`, `spark-trail`, `glow-wash`,
|
|
7
|
+
`highlighter`).
|
|
7
8
|
|
|
8
9
|
- **What it does.** Each layer keeps a light channel next to its colour. The light's colour is the
|
|
9
10
|
paint's colour at that pixel, so recolouring paint recolours its light. It glows (the paint
|
|
@@ -22,6 +23,11 @@ lays it with `light.amount` above 0 (`set_brush`); the Light category presets ar
|
|
|
22
23
|
gradient (`set_paint`) for glowing glass tubes.
|
|
23
24
|
- **Crossings.** Beads on one layer fuse where they cross (their heights combine by maximum), so
|
|
24
25
|
clarity only shows other layers: paint one loop per layer for glassy crossings.
|
|
26
|
+
- **Highlighter** (`highlighter`): fluorescent ink. A transparent chisel marker that multiplies,
|
|
27
|
+
so it glows a little brighter than the paper and text under it stays dark. Paint it on the
|
|
28
|
+
layer that holds the text (a tip blend works within its layer), and turn that layer's spill off
|
|
29
|
+
(`set_light_spill` `radius` 0): fluorescent ink does not light its surroundings, and spill would
|
|
30
|
+
wash the text out.
|
|
25
31
|
- **Spill vs a glow layer style.** Spill takes each stroke's colour and strength. For a one-colour
|
|
26
32
|
halo around everything on a layer, use a blend or an effect layer instead.
|
|
27
33
|
- **Glowing watercolour** (wet paint brushes with `light.amount`, e.g. `glow-wash`): the light is
|