@pixerate/editor 0.264.1 → 0.266.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 +4 -3
- package/dist/agent/index.js +3 -2
- package/dist/animation-editor/index.cjs +60 -61
- package/dist/animation-editor/index.js +4 -5
- package/dist/brushes/index.cjs +73 -60
- package/dist/brushes/index.d.cts +1 -0
- package/dist/brushes/index.d.ts +1 -0
- package/dist/brushes/index.js +17 -4
- package/dist/brushes/preview.d.cts +59 -0
- package/dist/brushes/preview.d.ts +59 -0
- package/dist/brushes/tools.d.cts +12 -5
- package/dist/brushes/tools.d.ts +12 -5
- package/dist/{brushstrokeRender-3MOI7PH4.js → brushstrokeRender-4UB6NRJW.js} +11 -4
- package/dist/{brushstrokeRender-SMMPIJF2.cjs → brushstrokeRender-JQ2XQRUD.cjs} +22 -15
- package/dist/canvas/brushstroke.d.cts +6 -1
- package/dist/canvas/brushstroke.d.ts +6 -1
- package/dist/canvas/index.cjs +18 -18
- package/dist/canvas/index.js +4 -4
- package/dist/{chunk-TMDDMJCR.js → chunk-472INMWH.js} +4 -2
- package/dist/chunk-55ALHYJY.js +289 -0
- package/dist/{chunk-F3KKR6DD.cjs → chunk-5OE4ZZ6V.cjs} +30 -30
- package/dist/{chunk-BY5EBP26.cjs → chunk-677777GH.cjs} +3 -3
- package/dist/{chunk-NHA26O5X.cjs → chunk-7KNW3WXZ.cjs} +14 -12
- package/dist/{chunk-G5ADO47G.cjs → chunk-7NQOGWLM.cjs} +3 -2
- package/dist/{chunk-WWI6FLH2.js → chunk-7PW6VCNW.js} +2 -2
- package/dist/{chunk-CECCP2V7.js → chunk-BLR4KWYQ.js} +1 -1
- package/dist/chunk-DEBIFWY6.cjs +77 -0
- package/dist/{chunk-KXNZNOEF.cjs → chunk-DGXTEPCU.cjs} +94 -94
- package/dist/{chunk-3CI7FRMK.js → chunk-DVPQFMH6.js} +13 -1
- package/dist/chunk-E2Z4UARJ.cjs +289 -0
- package/dist/chunk-HAEB3MZD.js +664 -0
- package/dist/{chunk-EE7SAYBF.js → chunk-J4SGJCPW.js} +3 -3
- package/dist/{chunk-A2IS7EHE.cjs → chunk-JBZRVLXV.cjs} +14 -2
- package/dist/chunk-KIJIONZF.cjs +664 -0
- package/dist/{chunk-V7MJ4HIN.cjs → chunk-NOP4Y5AB.cjs} +23 -23
- package/dist/{chunk-FQC5TDB6.cjs → chunk-O53MOGXG.cjs} +35 -35
- package/dist/{chunk-LPFQHVCO.js → chunk-PXXXRCME.js} +1 -284
- package/dist/{chunk-4OJC4MCD.js → chunk-Q6RVVJW6.js} +1 -1
- package/dist/{chunk-T7QSEKDY.cjs → chunk-QJVOJUTD.cjs} +4 -287
- package/dist/{chunk-HAUDEVMC.js → chunk-WY23AUCA.js} +2 -2
- package/dist/{chunk-JEML4FSA.js → chunk-XDNWQMHY.js} +3 -2
- package/dist/{chunk-ROBSFJ6F.js → chunk-Z2Z2OHRM.js} +1 -1
- package/dist/{chunk-USJX5SW4.cjs → chunk-ZHRVCW3M.cjs} +12 -12
- package/dist/chunk-ZS7LB2MV.js +77 -0
- package/dist/commands/index.cjs +26 -656
- package/dist/commands/index.js +18 -648
- package/dist/image-editor/index.cjs +788 -790
- package/dist/image-editor/index.js +6 -8
- package/dist/paint-editor/index.cjs +88 -84
- package/dist/paint-editor/index.js +12 -8
- package/dist/vector/contract.d.cts +52 -0
- package/dist/vector/contract.d.ts +52 -0
- package/dist/vector/index.cjs +1168 -971
- package/dist/vector/index.d.cts +1 -0
- package/dist/vector/index.d.ts +1 -0
- package/dist/vector/index.js +204 -7
- package/package.json +1 -1
- package/skills/pixerate-brushes/SKILL.md +7 -2
- package/dist/chunk-FJBQTZS4.js +0 -17
- package/dist/chunk-LRTR4ASZ.cjs +0 -17
|
@@ -11,11 +11,15 @@ import {
|
|
|
11
11
|
mergeBrushPatch,
|
|
12
12
|
multiColorSliders,
|
|
13
13
|
patchBrushValue
|
|
14
|
-
} from "../chunk-
|
|
14
|
+
} from "../chunk-Q6RVVJW6.js";
|
|
15
15
|
import {
|
|
16
16
|
createStickerTools,
|
|
17
17
|
describeStickerRef
|
|
18
18
|
} from "../chunk-6JL2D5SG.js";
|
|
19
|
+
import {
|
|
20
|
+
BRUSH_PREVIEW_DARK_PAPER,
|
|
21
|
+
brushPreviewsOnDark
|
|
22
|
+
} from "../chunk-ZS7LB2MV.js";
|
|
19
23
|
import {
|
|
20
24
|
toVideoFfmpeg
|
|
21
25
|
} from "../chunk-MWUZCEFT.js";
|
|
@@ -30,7 +34,7 @@ import {
|
|
|
30
34
|
resolveExternalAssets,
|
|
31
35
|
serializeLayers,
|
|
32
36
|
serializeLayersExternal
|
|
33
|
-
} from "../chunk-
|
|
37
|
+
} from "../chunk-WY23AUCA.js";
|
|
34
38
|
import "../chunk-WJ4WQJCC.js";
|
|
35
39
|
import {
|
|
36
40
|
LAYER_EFFECT_KINDS,
|
|
@@ -88,7 +92,7 @@ import {
|
|
|
88
92
|
realPresenceClock,
|
|
89
93
|
tweenPresenceCursor
|
|
90
94
|
} from "../chunk-IVSWRVB4.js";
|
|
91
|
-
import "../chunk-
|
|
95
|
+
import "../chunk-7PW6VCNW.js";
|
|
92
96
|
import {
|
|
93
97
|
BRUSH_ID,
|
|
94
98
|
BRUSH_PRESETS,
|
|
@@ -143,7 +147,7 @@ import {
|
|
|
143
147
|
parseBrushLibrary,
|
|
144
148
|
resolveBrush,
|
|
145
149
|
usesPaintExchange
|
|
146
|
-
} from "../chunk-
|
|
150
|
+
} from "../chunk-J4SGJCPW.js";
|
|
147
151
|
import {
|
|
148
152
|
STAMP_KINDS,
|
|
149
153
|
StickersSlot,
|
|
@@ -162,8 +166,7 @@ import {
|
|
|
162
166
|
import "../chunk-PWBZH3FK.js";
|
|
163
167
|
import {
|
|
164
168
|
brushColourHex
|
|
165
|
-
} from "../chunk-
|
|
166
|
-
import "../chunk-3CI7FRMK.js";
|
|
169
|
+
} from "../chunk-DVPQFMH6.js";
|
|
167
170
|
import {
|
|
168
171
|
StickerError
|
|
169
172
|
} from "../chunk-SZTI6EER.js";
|
|
@@ -4728,7 +4731,7 @@ function renderBrushThumbnail(brush, options) {
|
|
|
4728
4731
|
if (b.engine === "wet") surface = paintWetTestStroke(b, options.paper, options.color, width, height);
|
|
4729
4732
|
else ({ surface, light } = paintTestStroke(surface, b, options.paper, options.color, width, height));
|
|
4730
4733
|
const layer = { type: "pixel", id: "thumbnail", name: "thumbnail", visible: true, opacity: 1, blend: "normal", surface, offset: { x: 0, y: 0 } };
|
|
4731
|
-
const paper = light ? { ...options.paper, color:
|
|
4734
|
+
const paper = light && brushPreviewsOnDark(b) ? { ...options.paper, color: BRUSH_PREVIEW_DARK_PAPER } : options.paper;
|
|
4732
4735
|
const spill = light ? computeSpill(surface, light, { radius: Math.max(4, height / 6), strength: 1 }) : null;
|
|
4733
4736
|
const layers = [paperNode(paper), layer];
|
|
4734
4737
|
if (spill) layers.push({ type: "pixel", id: "thumbnail-light", name: "light", visible: true, opacity: 1, blend: "linear-dodge", surface: spill, offset: { x: 0, y: 0 } });
|
|
@@ -12152,10 +12155,11 @@ function strokeSummary(s, withPoints, live) {
|
|
|
12152
12155
|
|
|
12153
12156
|
// src/paint-editor/brush-library-tools.ts
|
|
12154
12157
|
function paintBrushPreviewRenderer(paper = () => DEFAULT_PAPER) {
|
|
12155
|
-
|
|
12158
|
+
const render = (brush, { width, height, color }) => {
|
|
12156
12159
|
const t = renderBrushThumbnail(resolveBrush(brush), { paper: paper(), width, height, color: color.toLowerCase() });
|
|
12157
12160
|
return { data: bytesToBase64(encodePng(t.width, t.height, t.data)), mimeType: "image/png" };
|
|
12158
12161
|
};
|
|
12162
|
+
return Object.defineProperty(render, "paper", { get: () => paper().color, enumerable: true });
|
|
12159
12163
|
}
|
|
12160
12164
|
function createPaintBrushLibraryToolProvider(controller, options = {}) {
|
|
12161
12165
|
return createBrushLibraryToolProvider(controller.brushLibrary, {
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The vector editor as language-neutral contracts (`@pixerate/conformance` `domains/vector`), so
|
|
3
|
+
* another implementation (the Swift port, #618) offers the same commands, tools, controls and
|
|
4
|
+
* documents: the commands agents run through `run_command` (`createVectorCommands`), the tools of
|
|
5
|
+
* the command, effect and generation providers, the UI tables React and Svelte render, and a JSON
|
|
6
|
+
* Schema of a saved vector document. `scripts/export-contracts.mjs` writes them; a core test fails
|
|
7
|
+
* when the committed files differ from what this returns.
|
|
8
|
+
*
|
|
9
|
+
* Everything here is data from this module's own tables and providers; nothing depends on the
|
|
10
|
+
* package version, so a release does not change the files.
|
|
11
|
+
*/
|
|
12
|
+
import type { EffectProvider } from '../effects/types.cjs';
|
|
13
|
+
import type { ModelCapabilities } from '../generation/capabilities.cjs';
|
|
14
|
+
import type { ConformanceHost } from '../tools/conformance.cjs';
|
|
15
|
+
import type { JsonSchema } from '../tools/schema.cjs';
|
|
16
|
+
import { type VectorArtGenerator } from './generate.cjs';
|
|
17
|
+
/** Bumped when a contract file changes shape (not when its data changes). */
|
|
18
|
+
export declare const VECTOR_CONTRACT_FORMAT_VERSION = 1;
|
|
19
|
+
/**
|
|
20
|
+
* JSON Schema of a saved vector document: the `pixerate.editor-document` envelope of kind
|
|
21
|
+
* `vector` around a `VectorDocument` (`createVectorEditorDocument`). Readers keep fields they do
|
|
22
|
+
* not know, so objects stay open; nodes are described by their common fields and `type`.
|
|
23
|
+
*/
|
|
24
|
+
export declare const VECTOR_DOCUMENT_JSON_SCHEMA: JsonSchema;
|
|
25
|
+
/**
|
|
26
|
+
* The generation models and generator the contracts and scenarios use: one text model that
|
|
27
|
+
* writes a fixed SVG from the prompt (a circle whose size and colour follow the prompt's length),
|
|
28
|
+
* so generation tools replay the same everywhere without a network.
|
|
29
|
+
*/
|
|
30
|
+
export declare const FAKE_VECTOR_ART_MODELS: readonly ModelCapabilities[];
|
|
31
|
+
export declare const fakeVectorArtGenerator: VectorArtGenerator;
|
|
32
|
+
/**
|
|
33
|
+
* Every vector contract file, by its path under `domains/vector/` (plain JSON values). `effects`
|
|
34
|
+
* is the effect provider the effect tools are listed with (the export uses the fake provider, so
|
|
35
|
+
* the files do not depend on a catalogue).
|
|
36
|
+
*/
|
|
37
|
+
export declare function vectorContracts(options: {
|
|
38
|
+
effects: EffectProvider;
|
|
39
|
+
}): Record<string, unknown>;
|
|
40
|
+
/**
|
|
41
|
+
* A fresh vector editor for replaying a conformance scenario (`domains/vector/fixtures`): every
|
|
42
|
+
* vector tool provider in one registry that validates arguments, and the saved document. Node ids
|
|
43
|
+
* come from a counter (`n1`, `n2`, …), so they are part of the contract; text uses the metric
|
|
44
|
+
* shaper, the one every implementation can match. `setup` is the scenario's artboard size
|
|
45
|
+
* (`{ width, height }`, default the editor's); `effects` is the effect provider the effect tools use.
|
|
46
|
+
*/
|
|
47
|
+
export declare function createVectorConformanceHost(setup: {
|
|
48
|
+
width?: number;
|
|
49
|
+
height?: number;
|
|
50
|
+
}, options: {
|
|
51
|
+
effects: EffectProvider;
|
|
52
|
+
}): ConformanceHost;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The vector editor as language-neutral contracts (`@pixerate/conformance` `domains/vector`), so
|
|
3
|
+
* another implementation (the Swift port, #618) offers the same commands, tools, controls and
|
|
4
|
+
* documents: the commands agents run through `run_command` (`createVectorCommands`), the tools of
|
|
5
|
+
* the command, effect and generation providers, the UI tables React and Svelte render, and a JSON
|
|
6
|
+
* Schema of a saved vector document. `scripts/export-contracts.mjs` writes them; a core test fails
|
|
7
|
+
* when the committed files differ from what this returns.
|
|
8
|
+
*
|
|
9
|
+
* Everything here is data from this module's own tables and providers; nothing depends on the
|
|
10
|
+
* package version, so a release does not change the files.
|
|
11
|
+
*/
|
|
12
|
+
import type { EffectProvider } from '../effects/types.js';
|
|
13
|
+
import type { ModelCapabilities } from '../generation/capabilities.js';
|
|
14
|
+
import type { ConformanceHost } from '../tools/conformance.js';
|
|
15
|
+
import type { JsonSchema } from '../tools/schema.js';
|
|
16
|
+
import { type VectorArtGenerator } from './generate.js';
|
|
17
|
+
/** Bumped when a contract file changes shape (not when its data changes). */
|
|
18
|
+
export declare const VECTOR_CONTRACT_FORMAT_VERSION = 1;
|
|
19
|
+
/**
|
|
20
|
+
* JSON Schema of a saved vector document: the `pixerate.editor-document` envelope of kind
|
|
21
|
+
* `vector` around a `VectorDocument` (`createVectorEditorDocument`). Readers keep fields they do
|
|
22
|
+
* not know, so objects stay open; nodes are described by their common fields and `type`.
|
|
23
|
+
*/
|
|
24
|
+
export declare const VECTOR_DOCUMENT_JSON_SCHEMA: JsonSchema;
|
|
25
|
+
/**
|
|
26
|
+
* The generation models and generator the contracts and scenarios use: one text model that
|
|
27
|
+
* writes a fixed SVG from the prompt (a circle whose size and colour follow the prompt's length),
|
|
28
|
+
* so generation tools replay the same everywhere without a network.
|
|
29
|
+
*/
|
|
30
|
+
export declare const FAKE_VECTOR_ART_MODELS: readonly ModelCapabilities[];
|
|
31
|
+
export declare const fakeVectorArtGenerator: VectorArtGenerator;
|
|
32
|
+
/**
|
|
33
|
+
* Every vector contract file, by its path under `domains/vector/` (plain JSON values). `effects`
|
|
34
|
+
* is the effect provider the effect tools are listed with (the export uses the fake provider, so
|
|
35
|
+
* the files do not depend on a catalogue).
|
|
36
|
+
*/
|
|
37
|
+
export declare function vectorContracts(options: {
|
|
38
|
+
effects: EffectProvider;
|
|
39
|
+
}): Record<string, unknown>;
|
|
40
|
+
/**
|
|
41
|
+
* A fresh vector editor for replaying a conformance scenario (`domains/vector/fixtures`): every
|
|
42
|
+
* vector tool provider in one registry that validates arguments, and the saved document. Node ids
|
|
43
|
+
* come from a counter (`n1`, `n2`, …), so they are part of the contract; text uses the metric
|
|
44
|
+
* shaper, the one every implementation can match. `setup` is the scenario's artboard size
|
|
45
|
+
* (`{ width, height }`, default the editor's); `effects` is the effect provider the effect tools use.
|
|
46
|
+
*/
|
|
47
|
+
export declare function createVectorConformanceHost(setup: {
|
|
48
|
+
width?: number;
|
|
49
|
+
height?: number;
|
|
50
|
+
}, options: {
|
|
51
|
+
effects: EffectProvider;
|
|
52
|
+
}): ConformanceHost;
|