@pixerate/editor-react 0.171.0 → 0.172.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.
@@ -0,0 +1,29 @@
1
+ import React from 'react';
2
+ import { type Brush, type BrushHostProfile } from '@pixerate/editor/brushes';
3
+ type Pixels = {
4
+ width: number;
5
+ height: number;
6
+ data: Uint8ClampedArray;
7
+ };
8
+ export interface BrushEditorProps {
9
+ /** The brush being edited, as facets. */
10
+ brush: Brush;
11
+ /** What the host renders (default the paint editor): other controls are left out. */
12
+ profile?: BrushHostProfile;
13
+ /** Called with the whole brush after each change (normalised). */
14
+ onChange: (brush: Brush) => void;
15
+ /** A live preview stroke of `brush` (e.g. `controller.brushThumbnail`). */
16
+ preview?: Pixels | null;
17
+ /** With it, a name field and "Save brush" save the brush under that name. */
18
+ onSaveAs?: (name: string) => unknown;
19
+ /** Extra controls a host adds to a section (e.g. the sticker picker for stamps). */
20
+ renderExtra?: (section: string) => React.ReactNode;
21
+ className?: string;
22
+ }
23
+ /**
24
+ * Edits a brush by its facets (`brushEditorSections`): Medium, Shape, Marks, Feel, Behaviour,
25
+ * Light, Motion and Colour, each control a facet, with a live preview stroke and "Save as". Only
26
+ * what the host profile renders is shown; settings it paints without carry a note.
27
+ */
28
+ export declare const BrushEditor: React.FC<BrushEditorProps>;
29
+ export {};
@@ -0,0 +1,29 @@
1
+ import React from 'react';
2
+ import { type Brush, type BrushHostProfile } from '@pixerate/editor/brushes';
3
+ type Pixels = {
4
+ width: number;
5
+ height: number;
6
+ data: Uint8ClampedArray;
7
+ };
8
+ export interface BrushEditorProps {
9
+ /** The brush being edited, as facets. */
10
+ brush: Brush;
11
+ /** What the host renders (default the paint editor): other controls are left out. */
12
+ profile?: BrushHostProfile;
13
+ /** Called with the whole brush after each change (normalised). */
14
+ onChange: (brush: Brush) => void;
15
+ /** A live preview stroke of `brush` (e.g. `controller.brushThumbnail`). */
16
+ preview?: Pixels | null;
17
+ /** With it, a name field and "Save brush" save the brush under that name. */
18
+ onSaveAs?: (name: string) => unknown;
19
+ /** Extra controls a host adds to a section (e.g. the sticker picker for stamps). */
20
+ renderExtra?: (section: string) => React.ReactNode;
21
+ className?: string;
22
+ }
23
+ /**
24
+ * Edits a brush by its facets (`brushEditorSections`): Medium, Shape, Marks, Feel, Behaviour,
25
+ * Light, Motion and Colour, each control a facet, with a live preview stroke and "Save as". Only
26
+ * what the host profile renders is shown; settings it paints without carry a note.
27
+ */
28
+ export declare const BrushEditor: React.FC<BrushEditorProps>;
29
+ export {};
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+ import { type BrushHostProfile, type BrushLibraryEntry } from '@pixerate/editor/brushes';
3
+ type Pixels = {
4
+ width: number;
5
+ height: number;
6
+ data: Uint8ClampedArray;
7
+ };
8
+ export interface BrushLibraryBrowserProps {
9
+ /** The library's brushes (built-in presets and saved ones), as facets. */
10
+ entries: readonly BrushLibraryEntry[];
11
+ /** The active brush id. */
12
+ activeId?: string;
13
+ onSelect: (id: string) => void;
14
+ /** Only brushes this host renders. */
15
+ profile?: BrushHostProfile;
16
+ /** A thumbnail for a brush (a test stroke). */
17
+ thumbnail?: (id: string) => Pixels | null;
18
+ thumbnailWidth?: number;
19
+ thumbnailHeight?: number;
20
+ className?: string;
21
+ }
22
+ /** The brush library grouped by medium, then variety, with tools as their own group, and a filter (`brushLibraryGroups`). */
23
+ export declare const BrushLibraryBrowser: React.FC<BrushLibraryBrowserProps>;
24
+ export {};
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+ import { type BrushHostProfile, type BrushLibraryEntry } from '@pixerate/editor/brushes';
3
+ type Pixels = {
4
+ width: number;
5
+ height: number;
6
+ data: Uint8ClampedArray;
7
+ };
8
+ export interface BrushLibraryBrowserProps {
9
+ /** The library's brushes (built-in presets and saved ones), as facets. */
10
+ entries: readonly BrushLibraryEntry[];
11
+ /** The active brush id. */
12
+ activeId?: string;
13
+ onSelect: (id: string) => void;
14
+ /** Only brushes this host renders. */
15
+ profile?: BrushHostProfile;
16
+ /** A thumbnail for a brush (a test stroke). */
17
+ thumbnail?: (id: string) => Pixels | null;
18
+ thumbnailWidth?: number;
19
+ thumbnailHeight?: number;
20
+ className?: string;
21
+ }
22
+ /** The brush library grouped by medium, then variety, with tools as their own group, and a filter (`brushLibraryGroups`). */
23
+ export declare const BrushLibraryBrowser: React.FC<BrushLibraryBrowserProps>;
24
+ export {};
@@ -8,11 +8,10 @@ export interface BrushPanelProps {
8
8
  className?: string;
9
9
  }
10
10
  /**
11
- * The brush library (thumbnails rendered from a test stroke on the current paper, grouped by
12
- * category) and the active brush's settings: size, opacity, flow, hardness, spacing, roundness,
13
- * angle, paper grain, position and pressure smoothing, dynamics, rotation mode and blend mode;
14
- * then the engine's own controls (`brushEngineControls`): blender strength and blend distance,
15
- * smudge strength and length, pick-up and mix ratios, RGB / pigment mixing, dirty brush,
16
- * the brush's own gradient paint (the multi-colour brush) and the brush load. Save the edited brush, import and export libraries as JSON.
11
+ * The brush library (`BrushLibraryBrowser`: thumbnails of a test stroke on the current paper,
12
+ * grouped by medium and variety, tools apart) and the active brush in the `BrushEditor`: its
13
+ * facets with a live preview, and "Save brush" into the editor's brush library. The paint
14
+ * editor adds the brush's own gradient, the sticker stamps, what the brush carries (Load /
15
+ * Clean), and import and export of library files.
17
16
  */
18
17
  export declare const BrushPanel: React.FC<BrushPanelProps>;
@@ -8,11 +8,10 @@ export interface BrushPanelProps {
8
8
  className?: string;
9
9
  }
10
10
  /**
11
- * The brush library (thumbnails rendered from a test stroke on the current paper, grouped by
12
- * category) and the active brush's settings: size, opacity, flow, hardness, spacing, roundness,
13
- * angle, paper grain, position and pressure smoothing, dynamics, rotation mode and blend mode;
14
- * then the engine's own controls (`brushEngineControls`): blender strength and blend distance,
15
- * smudge strength and length, pick-up and mix ratios, RGB / pigment mixing, dirty brush,
16
- * the brush's own gradient paint (the multi-colour brush) and the brush load. Save the edited brush, import and export libraries as JSON.
11
+ * The brush library (`BrushLibraryBrowser`: thumbnails of a test stroke on the current paper,
12
+ * grouped by medium and variety, tools apart) and the active brush in the `BrushEditor`: its
13
+ * facets with a live preview, and "Save brush" into the editor's brush library. The paint
14
+ * editor adds the brush's own gradient, the sticker stamps, what the brush carries (Load /
15
+ * Clean), and import and export of library files.
17
16
  */
18
17
  export declare const BrushPanel: React.FC<BrushPanelProps>;