@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.
Files changed (113) hide show
  1. package/dist/agent/index.cjs +34 -32
  2. package/dist/agent/index.js +6 -4
  3. package/dist/animation-editor/index.cjs +61 -61
  4. package/dist/animation-editor/index.js +4 -4
  5. package/dist/{brushstrokeRender-274HGNZR.js → brushstrokeRender-4542T5HP.js} +2 -2
  6. package/dist/{brushstrokeRender-C7RJZPMC.cjs → brushstrokeRender-QA5WVIDT.cjs} +5 -5
  7. package/dist/canvas/changeFeed.d.cts +71 -0
  8. package/dist/canvas/changeFeed.d.ts +71 -0
  9. package/dist/canvas/index.cjs +490 -34
  10. package/dist/canvas/index.d.cts +3 -0
  11. package/dist/canvas/index.d.ts +3 -0
  12. package/dist/canvas/index.js +483 -27
  13. package/dist/canvas/proposal-tools.d.cts +21 -0
  14. package/dist/canvas/proposal-tools.d.ts +21 -0
  15. package/dist/canvas/proposals.d.cts +112 -0
  16. package/dist/canvas/proposals.d.ts +112 -0
  17. package/dist/chart/index.cjs +21 -21
  18. package/dist/chart/index.js +2 -2
  19. package/dist/{chunk-6L3WWIDW.js → chunk-4EQY4TZJ.js} +1 -1
  20. package/dist/{chunk-5FZS7J7C.cjs → chunk-4T47Z4J3.cjs} +18 -2
  21. package/dist/{chunk-4I76OCVD.cjs → chunk-5DLCOQOQ.cjs} +16 -1
  22. package/dist/{chunk-4ZHXLFXS.js → chunk-5RFENYO5.js} +1 -1
  23. package/dist/{chunk-SRXWDOUI.js → chunk-7YQNKSQ7.js} +1 -1
  24. package/dist/{chunk-WGN7AUKB.js → chunk-7YW7T5TJ.js} +1 -1
  25. package/dist/{chunk-X3ZINLIP.js → chunk-AU6MWQKZ.js} +1 -1
  26. package/dist/{chunk-OONFIFEU.cjs → chunk-BDIH4DYR.cjs} +23 -23
  27. package/dist/{chunk-AIS56JOO.js → chunk-BVRRIW7F.js} +1 -1
  28. package/dist/{chunk-KK2FWMA2.cjs → chunk-HZ547SGQ.cjs} +1 -1
  29. package/dist/{chunk-3WOZEBXZ.cjs → chunk-IZL5V5RK.cjs} +2 -2
  30. package/dist/{chunk-IXI5KATU.js → chunk-L5PB7EG3.js} +1 -1
  31. package/dist/{chunk-R2FVAKFH.cjs → chunk-M6JORA5Z.cjs} +86 -86
  32. package/dist/{chunk-RNSANXPT.js → chunk-NS62CQ2B.js} +112 -14
  33. package/dist/{chunk-UZU6DIZA.cjs → chunk-NUTMINJZ.cjs} +45 -45
  34. package/dist/{chunk-H4Z72Z4Z.js → chunk-OSTKS3YN.js} +1 -1
  35. package/dist/{chunk-HLBTRSQJ.js → chunk-P3NIPIKS.js} +263 -63
  36. package/dist/{chunk-7V7QMFTI.cjs → chunk-QOBCBGGI.cjs} +2 -2
  37. package/dist/{chunk-UV7OOZJQ.cjs → chunk-SD23XMVJ.cjs} +35 -35
  38. package/dist/{chunk-FQVVO5YA.js → chunk-SGPIVHJB.js} +1 -1
  39. package/dist/{chunk-HQZHOPNE.js → chunk-TBJEMELS.js} +18 -2
  40. package/dist/{chunk-QTMQ5TGA.js → chunk-UCYW4M66.js} +16 -1
  41. package/dist/{chunk-XFYLA3ZO.cjs → chunk-VMROIWLL.cjs} +290 -90
  42. package/dist/{chunk-W7GRGGBH.cjs → chunk-W7L4HUT2.cjs} +8 -8
  43. package/dist/{chunk-FJ2MSI43.cjs → chunk-WKPXOGZZ.cjs} +124 -26
  44. package/dist/{chunk-D2SGV525.cjs → chunk-XZNU4DUX.cjs} +2 -2
  45. package/dist/diagram/index.cjs +2 -2
  46. package/dist/diagram/index.js +1 -1
  47. package/dist/effects/index.cjs +4 -4
  48. package/dist/effects/index.js +2 -2
  49. package/dist/extensions/index.cjs +5 -5
  50. package/dist/extensions/index.js +4 -4
  51. package/dist/gradient/index.cjs +2 -2
  52. package/dist/gradient/index.js +1 -1
  53. package/dist/history/HistoryManager.d.cts +20 -1
  54. package/dist/history/HistoryManager.d.ts +20 -1
  55. package/dist/history/index.cjs +8 -2
  56. package/dist/history/index.js +8 -2
  57. package/dist/history/types.d.cts +31 -0
  58. package/dist/history/types.d.ts +31 -0
  59. package/dist/image-editor/index.cjs +785 -777
  60. package/dist/image-editor/index.js +13 -5
  61. package/dist/index.cjs +16 -10
  62. package/dist/index.js +11 -5
  63. package/dist/kernel-wasm-4KVONDAU.js +9 -0
  64. package/dist/kernel-wasm-TTYRBGAK.cjs +9 -0
  65. package/dist/paint/index.cjs +10 -2
  66. package/dist/paint/index.js +9 -1
  67. package/dist/paint/wet/film.d.cts +19 -1
  68. package/dist/paint/wet/film.d.ts +19 -1
  69. package/dist/paint/wet/gpu-kernels.d.cts +2 -2
  70. package/dist/paint/wet/gpu-kernels.d.ts +2 -2
  71. package/dist/paint/wet/kernel-wasm.d.cts +5 -5
  72. package/dist/paint/wet/kernel-wasm.d.ts +5 -5
  73. package/dist/paint/wet/kernel.d.cts +1 -1
  74. package/dist/paint/wet/kernel.d.ts +1 -1
  75. package/dist/paint/wet/medium.d.cts +3 -1
  76. package/dist/paint/wet/medium.d.ts +3 -1
  77. package/dist/paint/wet/model.d.cts +19 -4
  78. package/dist/paint/wet/model.d.ts +19 -4
  79. package/dist/paint/wet/world.d.cts +34 -8
  80. package/dist/paint/wet/world.d.ts +34 -8
  81. package/dist/paint-editor/backlight.d.cts +77 -0
  82. package/dist/paint-editor/backlight.d.ts +77 -0
  83. package/dist/paint-editor/controller.d.cts +11 -0
  84. package/dist/paint-editor/controller.d.ts +11 -0
  85. package/dist/paint-editor/index.cjs +685 -397
  86. package/dist/paint-editor/index.d.cts +1 -0
  87. package/dist/paint-editor/index.d.ts +1 -0
  88. package/dist/paint-editor/index.js +308 -20
  89. package/dist/paint-editor/paper.d.cts +7 -0
  90. package/dist/paint-editor/paper.d.ts +7 -0
  91. package/dist/paint-editor/wet.d.cts +9 -0
  92. package/dist/paint-editor/wet.d.ts +9 -0
  93. package/dist/parameters/index.cjs +2 -2
  94. package/dist/parameters/index.js +1 -1
  95. package/dist/tools/index.cjs +4 -2
  96. package/dist/tools/index.d.cts +1 -0
  97. package/dist/tools/index.d.ts +1 -0
  98. package/dist/tools/index.js +3 -1
  99. package/dist/tools/origin.d.cts +22 -0
  100. package/dist/tools/origin.d.ts +22 -0
  101. package/dist/vector/index.cjs +964 -964
  102. package/dist/vector/index.js +5 -5
  103. package/dist/video-editor/index.cjs +4 -4
  104. package/dist/video-editor/index.js +2 -2
  105. package/package.json +1 -1
  106. package/skills/pixerate-canvas/SKILL.md +25 -0
  107. package/skills/pixerate-paint-editor/SKILL.md +3 -3
  108. package/skills/pixerate-paint-editor/references/light-paint.md +30 -7
  109. package/skills/pixerate-paint-watercolour/SKILL.md +10 -1
  110. package/skills/pixerate-paint-watercolour/evals/glowing-wash.json +22 -0
  111. package/skills/pixerate-paint-watercolour/evals/stained-glass.json +16 -0
  112. package/dist/kernel-wasm-6FPOLVUZ.cjs +0 -9
  113. package/dist/kernel-wasm-WIMMJUF2.js +0 -9
@@ -28,7 +28,7 @@
28
28
  var _chunkS6OT6CTScjs = require('../chunk-S6OT6CTS.cjs');
29
29
 
30
30
 
31
- var _chunkFJ2MSI43cjs = require('../chunk-FJ2MSI43.cjs');
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, _chunkFJ2MSI43cjs.HistoryManager)()));
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) {
@@ -28,7 +28,7 @@ import {
28
28
  } from "../chunk-KMPM5JM5.js";
29
29
  import {
30
30
  HistoryManager
31
- } from "../chunk-RNSANXPT.js";
31
+ } from "../chunk-NS62CQ2B.js";
32
32
  import "../chunk-BP6KSGVD.js";
33
33
  import "../chunk-6ADHGQ73.js";
34
34
  import {
@@ -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
  */
@@ -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
- exports.DirtyTracker = _chunkWWMWFSXMcjs.DirtyTracker; exports.HistoryManager = _chunkFJ2MSI43cjs.HistoryManager; exports.bindDirtyToHistory = _chunkWWMWFSXMcjs.bindDirtyToHistory; exports.createDirtyTracker = _chunkWWMWFSXMcjs.createDirtyTracker; exports.createHistoryManager = _chunkFJ2MSI43cjs.createHistoryManager; exports.defaultIsEqual = _chunkWWMWFSXMcjs.defaultIsEqual; exports.withoutDirty = _chunkWWMWFSXMcjs.withoutDirty;
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;
@@ -7,14 +7,20 @@ import {
7
7
  } from "../chunk-AFCXRB6O.js";
8
8
  import {
9
9
  HistoryManager,
10
- createHistoryManager
11
- } from "../chunk-RNSANXPT.js";
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
  };
@@ -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`.
@@ -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`.