@pixerate/editor 0.243.0 → 0.245.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-274HGNZR.js → brushstrokeRender-4542T5HP.js} +2 -2
- package/dist/{brushstrokeRender-C7RJZPMC.cjs → brushstrokeRender-QA5WVIDT.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-6L3WWIDW.js → chunk-4EQY4TZJ.js} +1 -1
- package/dist/{chunk-5FZS7J7C.cjs → chunk-4T47Z4J3.cjs} +18 -2
- package/dist/{chunk-4I76OCVD.cjs → chunk-5DLCOQOQ.cjs} +16 -1
- package/dist/{chunk-4ZHXLFXS.js → chunk-5RFENYO5.js} +1 -1
- package/dist/{chunk-SRXWDOUI.js → chunk-7YQNKSQ7.js} +1 -1
- package/dist/{chunk-WGN7AUKB.js → chunk-7YW7T5TJ.js} +1 -1
- package/dist/{chunk-X3ZINLIP.js → chunk-AU6MWQKZ.js} +1 -1
- package/dist/{chunk-OONFIFEU.cjs → chunk-BDIH4DYR.cjs} +23 -23
- package/dist/{chunk-AIS56JOO.js → chunk-BVRRIW7F.js} +1 -1
- package/dist/{chunk-KK2FWMA2.cjs → chunk-HZ547SGQ.cjs} +1 -1
- package/dist/{chunk-3WOZEBXZ.cjs → chunk-IZL5V5RK.cjs} +2 -2
- package/dist/{chunk-IXI5KATU.js → chunk-L5PB7EG3.js} +1 -1
- package/dist/{chunk-R2FVAKFH.cjs → chunk-M6JORA5Z.cjs} +86 -86
- package/dist/{chunk-RNSANXPT.js → chunk-NS62CQ2B.js} +112 -14
- package/dist/{chunk-UZU6DIZA.cjs → chunk-NUTMINJZ.cjs} +45 -45
- package/dist/{chunk-H4Z72Z4Z.js → chunk-OSTKS3YN.js} +1 -1
- package/dist/{chunk-HLBTRSQJ.js → chunk-P3NIPIKS.js} +263 -63
- package/dist/{chunk-7V7QMFTI.cjs → chunk-QOBCBGGI.cjs} +2 -2
- package/dist/{chunk-UV7OOZJQ.cjs → chunk-SD23XMVJ.cjs} +35 -35
- package/dist/{chunk-FQVVO5YA.js → chunk-SGPIVHJB.js} +1 -1
- package/dist/{chunk-HQZHOPNE.js → chunk-TBJEMELS.js} +18 -2
- package/dist/{chunk-QTMQ5TGA.js → chunk-UCYW4M66.js} +16 -1
- package/dist/{chunk-XFYLA3ZO.cjs → chunk-VMROIWLL.cjs} +290 -90
- package/dist/{chunk-W7GRGGBH.cjs → chunk-W7L4HUT2.cjs} +8 -8
- package/dist/{chunk-FJ2MSI43.cjs → chunk-WKPXOGZZ.cjs} +124 -26
- 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 +785 -777
- package/dist/image-editor/index.js +13 -5
- package/dist/index.cjs +16 -10
- package/dist/index.js +11 -5
- package/dist/kernel-wasm-4KVONDAU.js +9 -0
- package/dist/kernel-wasm-TTYRBGAK.cjs +9 -0
- package/dist/paint/index.cjs +10 -2
- package/dist/paint/index.js +9 -1
- package/dist/paint/wet/film.d.cts +19 -1
- package/dist/paint/wet/film.d.ts +19 -1
- package/dist/paint/wet/gpu-kernels.d.cts +2 -2
- package/dist/paint/wet/gpu-kernels.d.ts +2 -2
- package/dist/paint/wet/kernel-wasm.d.cts +5 -5
- package/dist/paint/wet/kernel-wasm.d.ts +5 -5
- package/dist/paint/wet/kernel.d.cts +1 -1
- package/dist/paint/wet/kernel.d.ts +1 -1
- package/dist/paint/wet/medium.d.cts +3 -1
- package/dist/paint/wet/medium.d.ts +3 -1
- package/dist/paint/wet/model.d.cts +19 -4
- package/dist/paint/wet/model.d.ts +19 -4
- package/dist/paint/wet/world.d.cts +34 -8
- package/dist/paint/wet/world.d.ts +34 -8
- package/dist/paint-editor/backlight.d.cts +77 -0
- package/dist/paint-editor/backlight.d.ts +77 -0
- package/dist/paint-editor/controller.d.cts +11 -0
- package/dist/paint-editor/controller.d.ts +11 -0
- package/dist/paint-editor/index.cjs +685 -397
- package/dist/paint-editor/index.d.cts +1 -0
- package/dist/paint-editor/index.d.ts +1 -0
- package/dist/paint-editor/index.js +308 -20
- package/dist/paint-editor/paper.d.cts +7 -0
- package/dist/paint-editor/paper.d.ts +7 -0
- package/dist/paint-editor/wet.d.cts +9 -0
- package/dist/paint-editor/wet.d.ts +9 -0
- 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/SKILL.md +3 -3
- package/skills/pixerate-paint-editor/references/light-paint.md +30 -7
- package/skills/pixerate-paint-watercolour/SKILL.md +10 -1
- package/skills/pixerate-paint-watercolour/evals/glowing-wash.json +22 -0
- package/skills/pixerate-paint-watercolour/evals/stained-glass.json +16 -0
- package/dist/kernel-wasm-6FPOLVUZ.cjs +0 -9
- package/dist/kernel-wasm-WIMMJUF2.js +0 -9
package/dist/gradient/index.cjs
CHANGED
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
var _chunkS6OT6CTScjs = require('../chunk-S6OT6CTS.cjs');
|
|
29
29
|
|
|
30
30
|
|
|
31
|
-
var
|
|
31
|
+
var _chunkWKPXOGZZcjs = require('../chunk-WKPXOGZZ.cjs');
|
|
32
32
|
require('../chunk-7PT4RJL5.cjs');
|
|
33
33
|
require('../chunk-PPFJHTW5.cjs');
|
|
34
34
|
|
|
@@ -101,7 +101,7 @@ var GradientController = (_class = class {
|
|
|
101
101
|
} else {
|
|
102
102
|
this._gradient = _chunkS6OT6CTScjs.createGradient.call(void 0, ["#000000", "#ffffff"]);
|
|
103
103
|
}
|
|
104
|
-
this._history = _nullishCoalesce(options.history, () => ( new (0,
|
|
104
|
+
this._history = _nullishCoalesce(options.history, () => ( new (0, _chunkWKPXOGZZcjs.HistoryManager)()));
|
|
105
105
|
this._readOnlyOption = options.readOnly;
|
|
106
106
|
this._onChange = options.onChange;
|
|
107
107
|
if (this._gradient.stops.length > 0) {
|
package/dist/gradient/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Command, HistoryEntry, HistoryManagerOptions, HistoryMark, HistoryState, MergedExecutionOptions, SnapshotCommandOptions } from "./types.cjs";
|
|
1
|
+
import { Command, HistoryCommitEvent, HistoryEntry, HistoryManagerOptions, HistoryMark, HistoryState, MergedExecutionOptions, SnapshotCommandOptions } from "./types.cjs";
|
|
2
2
|
/**
|
|
3
3
|
* UI-agnostic History and Undo/Redo manager supporting command closures,
|
|
4
4
|
* snapshot diffs, transaction batching, high-frequency event coalescing,
|
|
@@ -14,6 +14,9 @@ export declare class HistoryManager {
|
|
|
14
14
|
private batchDepth;
|
|
15
15
|
private currentBatch;
|
|
16
16
|
private listeners;
|
|
17
|
+
private commitListeners;
|
|
18
|
+
/** Origins set by `withOrigin`, innermost last. */
|
|
19
|
+
private origins;
|
|
17
20
|
private onStateChange?;
|
|
18
21
|
private cachedState;
|
|
19
22
|
private cachedEntries;
|
|
@@ -136,6 +139,22 @@ export declare class HistoryManager {
|
|
|
136
139
|
* Returns an unsubscribe function.
|
|
137
140
|
*/
|
|
138
141
|
subscribe(listener: (state: HistoryState) => void): () => void;
|
|
142
|
+
/**
|
|
143
|
+
* Listens to each change as it lands: what happened (`execute`, `merge`, `undo`, `redo`,
|
|
144
|
+
* `revert`, `clear`), the step and who made it. Unlike `subscribe`, it is not called at once
|
|
145
|
+
* and it hears every step of a `goTo`. Returns an unsubscribe function.
|
|
146
|
+
*/
|
|
147
|
+
onCommit(listener: (event: HistoryCommitEvent) => void): () => void;
|
|
148
|
+
private emit;
|
|
149
|
+
/** The origin a change is recorded with when its command names none (see `withOrigin`). */
|
|
150
|
+
getOrigin(): string;
|
|
151
|
+
/**
|
|
152
|
+
* Records the changes `fn` makes as made by `origin` (`agent:<id>` for an agent), unless a
|
|
153
|
+
* command names its own. When `fn` returns a promise, the origin holds until it settles, so
|
|
154
|
+
* anything else recorded on this history meanwhile (the user's own edits) is stamped with it
|
|
155
|
+
* too: give those commands an explicit `origin`, or keep agent work synchronous.
|
|
156
|
+
*/
|
|
157
|
+
withOrigin<T>(origin: string, fn: () => T): T;
|
|
139
158
|
/**
|
|
140
159
|
* Utility helper to create a Command from before/after state snapshots.
|
|
141
160
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Command, HistoryEntry, HistoryManagerOptions, HistoryMark, HistoryState, MergedExecutionOptions, SnapshotCommandOptions } from "./types.js";
|
|
1
|
+
import { Command, HistoryCommitEvent, HistoryEntry, HistoryManagerOptions, HistoryMark, HistoryState, MergedExecutionOptions, SnapshotCommandOptions } from "./types.js";
|
|
2
2
|
/**
|
|
3
3
|
* UI-agnostic History and Undo/Redo manager supporting command closures,
|
|
4
4
|
* snapshot diffs, transaction batching, high-frequency event coalescing,
|
|
@@ -14,6 +14,9 @@ export declare class HistoryManager {
|
|
|
14
14
|
private batchDepth;
|
|
15
15
|
private currentBatch;
|
|
16
16
|
private listeners;
|
|
17
|
+
private commitListeners;
|
|
18
|
+
/** Origins set by `withOrigin`, innermost last. */
|
|
19
|
+
private origins;
|
|
17
20
|
private onStateChange?;
|
|
18
21
|
private cachedState;
|
|
19
22
|
private cachedEntries;
|
|
@@ -136,6 +139,22 @@ export declare class HistoryManager {
|
|
|
136
139
|
* Returns an unsubscribe function.
|
|
137
140
|
*/
|
|
138
141
|
subscribe(listener: (state: HistoryState) => void): () => void;
|
|
142
|
+
/**
|
|
143
|
+
* Listens to each change as it lands: what happened (`execute`, `merge`, `undo`, `redo`,
|
|
144
|
+
* `revert`, `clear`), the step and who made it. Unlike `subscribe`, it is not called at once
|
|
145
|
+
* and it hears every step of a `goTo`. Returns an unsubscribe function.
|
|
146
|
+
*/
|
|
147
|
+
onCommit(listener: (event: HistoryCommitEvent) => void): () => void;
|
|
148
|
+
private emit;
|
|
149
|
+
/** The origin a change is recorded with when its command names none (see `withOrigin`). */
|
|
150
|
+
getOrigin(): string;
|
|
151
|
+
/**
|
|
152
|
+
* Records the changes `fn` makes as made by `origin` (`agent:<id>` for an agent), unless a
|
|
153
|
+
* command names its own. When `fn` returns a promise, the origin holds until it settles, so
|
|
154
|
+
* anything else recorded on this history meanwhile (the user's own edits) is stamped with it
|
|
155
|
+
* too: give those commands an explicit `origin`, or keep agent work synchronous.
|
|
156
|
+
*/
|
|
157
|
+
withOrigin<T>(origin: string, fn: () => T): T;
|
|
139
158
|
/**
|
|
140
159
|
* Utility helper to create a Command from before/after state snapshots.
|
|
141
160
|
*/
|
package/dist/history/index.cjs
CHANGED
|
@@ -8,13 +8,19 @@ var _chunkWWMWFSXMcjs = require('../chunk-WWMWFSXM.cjs');
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var _chunkFJ2MSI43cjs = require('../chunk-FJ2MSI43.cjs');
|
|
12
11
|
|
|
13
12
|
|
|
14
13
|
|
|
14
|
+
var _chunkWKPXOGZZcjs = require('../chunk-WKPXOGZZ.cjs');
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
exports.DirtyTracker = _chunkWWMWFSXMcjs.DirtyTracker; exports.HistoryManager = _chunkWKPXOGZZcjs.HistoryManager; exports.USER_ORIGIN = _chunkWKPXOGZZcjs.USER_ORIGIN; exports.agentOrigin = _chunkWKPXOGZZcjs.agentOrigin; exports.bindDirtyToHistory = _chunkWWMWFSXMcjs.bindDirtyToHistory; exports.createDirtyTracker = _chunkWWMWFSXMcjs.createDirtyTracker; exports.createHistoryManager = _chunkWKPXOGZZcjs.createHistoryManager; exports.defaultIsEqual = _chunkWWMWFSXMcjs.defaultIsEqual; exports.originAgentId = _chunkWKPXOGZZcjs.originAgentId; exports.withoutDirty = _chunkWWMWFSXMcjs.withoutDirty;
|
package/dist/history/index.js
CHANGED
|
@@ -7,14 +7,20 @@ import {
|
|
|
7
7
|
} from "../chunk-AFCXRB6O.js";
|
|
8
8
|
import {
|
|
9
9
|
HistoryManager,
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
USER_ORIGIN,
|
|
11
|
+
agentOrigin,
|
|
12
|
+
createHistoryManager,
|
|
13
|
+
originAgentId
|
|
14
|
+
} from "../chunk-NS62CQ2B.js";
|
|
12
15
|
export {
|
|
13
16
|
DirtyTracker,
|
|
14
17
|
HistoryManager,
|
|
18
|
+
USER_ORIGIN,
|
|
19
|
+
agentOrigin,
|
|
15
20
|
bindDirtyToHistory,
|
|
16
21
|
createDirtyTracker,
|
|
17
22
|
createHistoryManager,
|
|
18
23
|
defaultIsEqual,
|
|
24
|
+
originAgentId,
|
|
19
25
|
withoutDirty
|
|
20
26
|
};
|
package/dist/history/types.d.cts
CHANGED
|
@@ -10,7 +10,18 @@ export interface Command {
|
|
|
10
10
|
* Counted against `HistoryManagerOptions.maxBytes` when no `sizeOf` hook is set.
|
|
11
11
|
*/
|
|
12
12
|
byteSize?: number;
|
|
13
|
+
/**
|
|
14
|
+
* Who made the change: `user` (the default) or `agent:<id>` for an agent. Falls back to the
|
|
15
|
+
* origin set with `HistoryManager.withOrigin`, then to `user`.
|
|
16
|
+
*/
|
|
17
|
+
origin?: string;
|
|
13
18
|
}
|
|
19
|
+
/** The origin of changes no one has claimed: the person at the keyboard. */
|
|
20
|
+
export declare const USER_ORIGIN = "user";
|
|
21
|
+
/** The origin of an agent's changes: `agent:<id>`. */
|
|
22
|
+
export declare function agentOrigin(agentId: string): string;
|
|
23
|
+
/** The agent id of an `agent:<id>` origin, or `null` for any other origin. */
|
|
24
|
+
export declare function originAgentId(origin: string | undefined): string | null;
|
|
14
25
|
export interface HistoryState {
|
|
15
26
|
canUndo: boolean;
|
|
16
27
|
canRedo: boolean;
|
|
@@ -71,6 +82,26 @@ export interface HistoryEntry {
|
|
|
71
82
|
current: boolean;
|
|
72
83
|
/** True for steps on the redo stack (undone, can be redone). */
|
|
73
84
|
undone: boolean;
|
|
85
|
+
/** Who made the step: `user` or `agent:<id>` (see `Command.origin`). */
|
|
86
|
+
origin: string;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* What a `HistoryManager.onCommit` listener hears:
|
|
90
|
+
* - `execute`: a new step was recorded (also a `batch`).
|
|
91
|
+
* - `merge`: a change folded into the top step (a gesture or a coalesced `executeMerged`).
|
|
92
|
+
* - `undo` / `redo`: one step was taken back or re-applied (`goTo` reports one per step).
|
|
93
|
+
* - `revert`: `revertTo` took steps back for good.
|
|
94
|
+
* - `clear`: the history was emptied.
|
|
95
|
+
*/
|
|
96
|
+
export type HistoryCommitKind = "execute" | "merge" | "undo" | "redo" | "revert" | "clear";
|
|
97
|
+
export interface HistoryCommitEvent {
|
|
98
|
+
kind: HistoryCommitKind;
|
|
99
|
+
/** The step recorded, merged into, undone or redone. Absent for `revert` and `clear`. */
|
|
100
|
+
entry?: HistoryEntry;
|
|
101
|
+
/** Who made the change: the step's origin for `execute` / `merge`, else the origin in effect. */
|
|
102
|
+
origin: string;
|
|
103
|
+
/** `HistoryManager.getRevision()` after the change. */
|
|
104
|
+
revision: number;
|
|
74
105
|
}
|
|
75
106
|
/**
|
|
76
107
|
* A point in the undo history, from `HistoryManager.mark()`, for `revertTo`.
|
package/dist/history/types.d.ts
CHANGED
|
@@ -10,7 +10,18 @@ export interface Command {
|
|
|
10
10
|
* Counted against `HistoryManagerOptions.maxBytes` when no `sizeOf` hook is set.
|
|
11
11
|
*/
|
|
12
12
|
byteSize?: number;
|
|
13
|
+
/**
|
|
14
|
+
* Who made the change: `user` (the default) or `agent:<id>` for an agent. Falls back to the
|
|
15
|
+
* origin set with `HistoryManager.withOrigin`, then to `user`.
|
|
16
|
+
*/
|
|
17
|
+
origin?: string;
|
|
13
18
|
}
|
|
19
|
+
/** The origin of changes no one has claimed: the person at the keyboard. */
|
|
20
|
+
export declare const USER_ORIGIN = "user";
|
|
21
|
+
/** The origin of an agent's changes: `agent:<id>`. */
|
|
22
|
+
export declare function agentOrigin(agentId: string): string;
|
|
23
|
+
/** The agent id of an `agent:<id>` origin, or `null` for any other origin. */
|
|
24
|
+
export declare function originAgentId(origin: string | undefined): string | null;
|
|
14
25
|
export interface HistoryState {
|
|
15
26
|
canUndo: boolean;
|
|
16
27
|
canRedo: boolean;
|
|
@@ -71,6 +82,26 @@ export interface HistoryEntry {
|
|
|
71
82
|
current: boolean;
|
|
72
83
|
/** True for steps on the redo stack (undone, can be redone). */
|
|
73
84
|
undone: boolean;
|
|
85
|
+
/** Who made the step: `user` or `agent:<id>` (see `Command.origin`). */
|
|
86
|
+
origin: string;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* What a `HistoryManager.onCommit` listener hears:
|
|
90
|
+
* - `execute`: a new step was recorded (also a `batch`).
|
|
91
|
+
* - `merge`: a change folded into the top step (a gesture or a coalesced `executeMerged`).
|
|
92
|
+
* - `undo` / `redo`: one step was taken back or re-applied (`goTo` reports one per step).
|
|
93
|
+
* - `revert`: `revertTo` took steps back for good.
|
|
94
|
+
* - `clear`: the history was emptied.
|
|
95
|
+
*/
|
|
96
|
+
export type HistoryCommitKind = "execute" | "merge" | "undo" | "redo" | "revert" | "clear";
|
|
97
|
+
export interface HistoryCommitEvent {
|
|
98
|
+
kind: HistoryCommitKind;
|
|
99
|
+
/** The step recorded, merged into, undone or redone. Absent for `revert` and `clear`. */
|
|
100
|
+
entry?: HistoryEntry;
|
|
101
|
+
/** Who made the change: the step's origin for `execute` / `merge`, else the origin in effect. */
|
|
102
|
+
origin: string;
|
|
103
|
+
/** `HistoryManager.getRevision()` after the change. */
|
|
104
|
+
revision: number;
|
|
74
105
|
}
|
|
75
106
|
/**
|
|
76
107
|
* A point in the undo history, from `HistoryManager.mark()`, for `revertTo`.
|