@pixerate/editor 0.251.0 → 0.253.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/brushes/index.cjs +240 -1344
- package/dist/brushes/index.d.cts +10 -1
- package/dist/brushes/index.d.ts +10 -1
- package/dist/brushes/index.js +250 -1354
- package/dist/brushes/library.d.cts +104 -0
- package/dist/brushes/library.d.ts +104 -0
- package/dist/brushes/patch.d.cts +23 -0
- package/dist/brushes/patch.d.ts +23 -0
- package/dist/brushes/profiles.d.cts +85 -0
- package/dist/brushes/profiles.d.ts +85 -0
- package/dist/brushes/tools.d.cts +37 -0
- package/dist/brushes/tools.d.ts +37 -0
- package/dist/brushes/ui.d.cts +105 -0
- package/dist/brushes/ui.d.ts +105 -0
- package/dist/chunk-34KLWUH4.cjs +2284 -0
- package/dist/chunk-QPHNVZHO.js +2284 -0
- package/dist/paint-editor/brush-controls.d.cts +57 -0
- package/dist/paint-editor/brush-controls.d.ts +57 -0
- package/dist/paint-editor/brush-library-tools.d.cts +15 -0
- package/dist/paint-editor/brush-library-tools.d.ts +15 -0
- package/dist/paint-editor/brush-library.d.cts +29 -0
- package/dist/paint-editor/brush-library.d.ts +29 -0
- package/dist/paint-editor/controller.d.cts +76 -17
- package/dist/paint-editor/controller.d.ts +76 -17
- package/dist/paint-editor/index.cjs +537 -852
- package/dist/paint-editor/index.d.cts +1 -0
- package/dist/paint-editor/index.d.ts +1 -0
- package/dist/paint-editor/index.js +327 -642
- package/dist/paint-editor/serialize.d.cts +7 -4
- package/dist/paint-editor/serialize.d.ts +7 -4
- package/dist/paint-editor/sticker-tools.d.cts +1 -1
- package/dist/paint-editor/sticker-tools.d.ts +1 -1
- package/dist/paint-editor/strokes.d.cts +10 -1
- package/dist/paint-editor/strokes.d.ts +10 -1
- package/dist/paint-editor/tools.d.cts +1 -1
- package/dist/paint-editor/tools.d.ts +1 -1
- package/dist/paint-editor/ui.d.cts +3 -51
- package/dist/paint-editor/ui.d.ts +3 -51
- package/dist/paint-editor/wet-tools.d.cts +1 -1
- package/dist/paint-editor/wet-tools.d.ts +1 -1
- package/dist/tools/skill-evals.d.cts +8 -1
- package/dist/tools/skill-evals.d.ts +8 -1
- package/package.json +1 -1
- package/skills/README.md +2 -0
- package/skills/pixerate-brushes/SKILL.md +106 -0
- package/skills/pixerate-brushes-design/SKILL.md +88 -0
- package/skills/pixerate-brushes-design/evals/canvas-chalk.json +15 -0
- package/skills/pixerate-brushes-design/evals/pink-highlighter.json +15 -0
- package/skills/pixerate-brushes-design/evals/port-to-vector.json +17 -0
- package/skills/pixerate-paint-editor/SKILL.md +26 -24
- package/skills/pixerate-paint-editor/references/brush-facets.md +30 -0
- package/skills/pixerate-paint-editor/references/gradient-paint.md +1 -1
- package/skills/pixerate-paint-editor/references/light-paint.md +2 -2
- package/skills/pixerate-paint-editor/references/oils.md +1 -1
- package/skills/pixerate-paint-editor/references/particle-brushes.md +8 -5
- package/skills/pixerate-paint-oil-impasto/SKILL.md +1 -1
- package/skills/pixerate-stickers/SKILL.md +1 -1
- package/skills/pixerate-video-editor/SKILL.md +1 -1
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The brush editor as data, for the React and Svelte `BrushEditor` and `BrushLibraryBrowser`:
|
|
3
|
+
* `brushEditorSections` lists a brush's facets as ordered sections of controls (Medium, Shape,
|
|
4
|
+
* Marks, Feel, Behaviour, Light, Motion, Colour), each control a facet path with its value,
|
|
5
|
+
* range and label, leaving out what the host profile can't render. `setBrushEditorValue` applies
|
|
6
|
+
* one control's change; `brushLibraryGroups` groups a library by medium and variety, tools apart.
|
|
7
|
+
*
|
|
8
|
+
* Sliders reuse the paint editor's tables (`BRUSH_SLIDERS`, `brushEngineControls`), mapped from
|
|
9
|
+
* engine paths to facet paths through `BRUSH_FIELDS`, so the panels and the editor agree.
|
|
10
|
+
*/
|
|
11
|
+
import type { BrushLibraryEntry } from './library.js';
|
|
12
|
+
import { type BrushHostProfile } from './profiles.js';
|
|
13
|
+
import { type Brush } from './types.js';
|
|
14
|
+
export type BrushEditorSectionId = 'medium' | 'shape' | 'marks' | 'feel' | 'behaviour' | 'light' | 'motion' | 'colour';
|
|
15
|
+
interface ControlBase {
|
|
16
|
+
/** Facet path the control sets (`tip.size`, `behaviour.exchange.pickup`…). */
|
|
17
|
+
path: string;
|
|
18
|
+
label: string;
|
|
19
|
+
/** Accessible name (stable across hosts, for tests and assistive tech). */
|
|
20
|
+
ariaLabel: string;
|
|
21
|
+
/** Set when the host paints without this setting (its profile ignores it). */
|
|
22
|
+
note?: string;
|
|
23
|
+
}
|
|
24
|
+
export type BrushEditorControl = (ControlBase & {
|
|
25
|
+
kind: 'slider';
|
|
26
|
+
min: number;
|
|
27
|
+
max: number;
|
|
28
|
+
step: number;
|
|
29
|
+
value: number;
|
|
30
|
+
}) | (ControlBase & {
|
|
31
|
+
kind: 'choice';
|
|
32
|
+
options: ReadonlyArray<{
|
|
33
|
+
value: string;
|
|
34
|
+
label: string;
|
|
35
|
+
}>;
|
|
36
|
+
value: string;
|
|
37
|
+
}) | (ControlBase & {
|
|
38
|
+
kind: 'toggle';
|
|
39
|
+
value: boolean;
|
|
40
|
+
}) | (ControlBase & {
|
|
41
|
+
kind: 'text';
|
|
42
|
+
value: string;
|
|
43
|
+
placeholder?: string;
|
|
44
|
+
})
|
|
45
|
+
/** A solid colour (#rrggbb), or `null` when there is none (or the default is a gradient or effect). */
|
|
46
|
+
| (ControlBase & {
|
|
47
|
+
kind: 'colour';
|
|
48
|
+
value: string | null;
|
|
49
|
+
}) | (ControlBase & {
|
|
50
|
+
kind: 'palette';
|
|
51
|
+
value: string[];
|
|
52
|
+
max: number;
|
|
53
|
+
})
|
|
54
|
+
/** Stamp refs (`editor:star`…): `options` are the editor's stamps; hosts may offer more refs. */
|
|
55
|
+
| (ControlBase & {
|
|
56
|
+
kind: 'stamps';
|
|
57
|
+
value: string[];
|
|
58
|
+
max: number;
|
|
59
|
+
options: ReadonlyArray<{
|
|
60
|
+
value: string;
|
|
61
|
+
label: string;
|
|
62
|
+
}>;
|
|
63
|
+
});
|
|
64
|
+
export interface BrushEditorSection {
|
|
65
|
+
id: BrushEditorSectionId;
|
|
66
|
+
title: string;
|
|
67
|
+
controls: BrushEditorControl[];
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Sections of controls for a brush, in order, as the host `profile` (default the paint editor)
|
|
71
|
+
* can render them: sections and controls it refuses are left out, ones it paints without carry
|
|
72
|
+
* a note. Values are the brush's own, else the defaults of the engine it resolves to.
|
|
73
|
+
*/
|
|
74
|
+
export declare function brushEditorSections(brush: Brush, profile?: BrushHostProfile): BrushEditorSection[];
|
|
75
|
+
/**
|
|
76
|
+
* The brush with one control's value set (`undefined` removes it), normalised. Changing the kind,
|
|
77
|
+
* the marks or the tip shape starts that facet afresh. Returns the brush and what was clamped or
|
|
78
|
+
* dropped; an invalid change returns the brush unchanged with the reason.
|
|
79
|
+
*/
|
|
80
|
+
export declare function setBrushEditorValue(brush: Brush, path: string, value: unknown): {
|
|
81
|
+
brush: Brush;
|
|
82
|
+
problems: string[];
|
|
83
|
+
};
|
|
84
|
+
export interface BrushLibraryGroup {
|
|
85
|
+
/** `tools`, or a medium (`paint`, `ink`, `dry`, `spray`), or `other`. */
|
|
86
|
+
id: string;
|
|
87
|
+
title: string;
|
|
88
|
+
/** Brushes by variety (`''`: no variety), in library order. */
|
|
89
|
+
varieties: Array<{
|
|
90
|
+
variety: string;
|
|
91
|
+
title: string;
|
|
92
|
+
entries: BrushLibraryEntry[];
|
|
93
|
+
}>;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* A library grouped for a browser: marks by medium, then variety; tools as their own group.
|
|
97
|
+
* `text` keeps brushes whose id, name, variety or tags start with each word; `profile` keeps only
|
|
98
|
+
* what that host renders.
|
|
99
|
+
*/
|
|
100
|
+
export declare function brushLibraryGroups(entries: readonly BrushLibraryEntry[], filter?: {
|
|
101
|
+
text?: string;
|
|
102
|
+
profile?: BrushHostProfile;
|
|
103
|
+
source?: 'builtin' | 'user';
|
|
104
|
+
}): BrushLibraryGroup[];
|
|
105
|
+
export {};
|