@pixerate/editor 0.106.0 → 0.108.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/THIRD_PARTY_NOTICES.md +4 -0
- package/dist/animation-editor/index.cjs +39 -39
- package/dist/animation-editor/index.d.cts +1 -1
- package/dist/animation-editor/index.d.ts +1 -1
- package/dist/animation-editor/index.js +1 -1
- package/dist/{chunk-DS7KDKPX.js → chunk-3PHA3UKI.js} +2 -2
- package/dist/{chunk-ZID226ZG.cjs → chunk-FRD3FUXI.cjs} +172 -172
- package/dist/{chunk-ZID226ZG.cjs.map → chunk-FRD3FUXI.cjs.map} +1 -1
- package/dist/{chunk-67FRIOPZ.js → chunk-G4BIYE6R.js} +2 -2
- package/dist/{chunk-PV42JITT.cjs → chunk-HUFQD4CB.cjs} +44 -44
- package/dist/{chunk-PV42JITT.cjs.map → chunk-HUFQD4CB.cjs.map} +1 -1
- package/dist/{chunk-63EFQCT5.js → chunk-HUQ7EHVI.js} +1140 -371
- package/dist/chunk-HUQ7EHVI.js.map +1 -0
- package/dist/{chunk-4X5MIVCE.js → chunk-SOROZ2BF.js} +3 -3
- package/dist/{chunk-CRMAXIUV.cjs → chunk-SZ6KMZNM.cjs} +157 -8
- package/dist/chunk-SZ6KMZNM.cjs.map +1 -0
- package/dist/{chunk-WSTEXEKD.cjs → chunk-T3QZ6S47.cjs} +92 -92
- package/dist/{chunk-WSTEXEKD.cjs.map → chunk-T3QZ6S47.cjs.map} +1 -1
- package/dist/{chunk-KANRAHTL.cjs → chunk-UTEVPQTS.cjs} +1353 -584
- package/dist/chunk-UTEVPQTS.cjs.map +1 -0
- package/dist/{chunk-HEW6KDNI.js → chunk-WMBIJCHA.js} +155 -6
- package/dist/chunk-WMBIJCHA.js.map +1 -0
- package/dist/{compositor-Bc3PNP3C.d.cts → compositor-D92URMlm.d.cts} +1 -1
- package/dist/{compositor-BsYYllvR.d.ts → compositor-Kt_M4ruo.d.ts} +1 -1
- package/dist/{export-_m3Es4ru.d.cts → export-JGWQEPJn.d.cts} +3 -3
- package/dist/{export-iMrop3Jm.d.ts → export-a9bnF7Cl.d.ts} +3 -3
- package/dist/image-editor/index.cjs +627 -619
- package/dist/image-editor/index.cjs.map +1 -1
- package/dist/image-editor/index.d.cts +8 -8
- package/dist/image-editor/index.d.ts +8 -8
- package/dist/image-editor/index.js +12 -4
- package/dist/image-editor/index.js.map +1 -1
- package/dist/{mixer-C1M1Nua_.d.cts → mixer-5ziHU8OS.d.cts} +1 -1
- package/dist/{mixer-Cu5a9Bzd.d.ts → mixer-DNqiYXYQ.d.ts} +1 -1
- package/dist/paint/index.cjs +3 -3
- package/dist/paint/index.d.cts +2 -2
- package/dist/paint/index.d.ts +2 -2
- package/dist/paint/index.js +2 -2
- package/dist/paint-editor/index.cjs +365 -132
- package/dist/paint-editor/index.cjs.map +1 -1
- package/dist/paint-editor/index.d.cts +113 -8
- package/dist/paint-editor/index.d.ts +113 -8
- package/dist/paint-editor/index.js +249 -16
- package/dist/paint-editor/index.js.map +1 -1
- package/dist/raster/index.cjs +11 -3
- package/dist/raster/index.cjs.map +1 -1
- package/dist/raster/index.d.cts +4 -4
- package/dist/raster/index.d.ts +4 -4
- package/dist/raster/index.js +10 -2
- package/dist/{surface-BBJN9wxg.d.ts → surface-CkKOHGPm.d.cts} +20 -2
- package/dist/{surface-BBJN9wxg.d.cts → surface-CkKOHGPm.d.ts} +20 -2
- package/dist/{svg-Bj1MQFh6.d.cts → svg-ClVIG4T7.d.cts} +26 -2
- package/dist/{svg-vme0PLNo.d.ts → svg-SseJTIrA.d.ts} +26 -2
- package/dist/vector/index.cjs +977 -948
- package/dist/vector/index.cjs.map +1 -1
- package/dist/vector/index.d.cts +266 -7
- package/dist/vector/index.d.ts +266 -7
- package/dist/vector/index.js +427 -398
- package/dist/vector/index.js.map +1 -1
- package/package.json +1 -1
- package/skills/pixerate-image-editor/SKILL.md +50 -7
- package/skills/pixerate-paint-editor/SKILL.md +21 -1
- package/skills/pixerate-vector/SKILL.md +35 -5
- package/dist/chunk-63EFQCT5.js.map +0 -1
- package/dist/chunk-CRMAXIUV.cjs.map +0 -1
- package/dist/chunk-HEW6KDNI.js.map +0 -1
- package/dist/chunk-KANRAHTL.cjs.map +0 -1
- /package/dist/{chunk-DS7KDKPX.js.map → chunk-3PHA3UKI.js.map} +0 -0
- /package/dist/{chunk-67FRIOPZ.js.map → chunk-G4BIYE6R.js.map} +0 -0
- /package/dist/{chunk-4X5MIVCE.js.map → chunk-SOROZ2BF.js.map} +0 -0
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { R as RasterLayer, a as RasterGroupLayer, b as RasterPixelLayer, C as CompositorLayer, c as RasterCompositor, d as RasterSources, L as LayerLocks } from '../compositor-
|
|
2
|
-
import { B as BrushSettings, M as MixerSettings, C as CoverageMap, D as Dab, S as StrokePoint, a as MixerLoad } from '../mixer-
|
|
3
|
-
export { b as MAX_BRUSH_SIZE } from '../mixer-
|
|
4
|
-
import { R as RasterRect, a as TiledSurface, B as BlendMode } from '../surface-
|
|
5
|
-
export {
|
|
6
|
-
import { I as ImageEditorAssetStore, S as SerializedLayer, P as PsdExportResult } from '../export-
|
|
1
|
+
import { R as RasterLayer, a as RasterGroupLayer, b as RasterPixelLayer, C as CompositorLayer, c as RasterCompositor, d as RasterSources, L as LayerLocks } from '../compositor-D92URMlm.cjs';
|
|
2
|
+
import { B as BrushSettings, M as MixerSettings, C as CoverageMap, D as Dab, S as StrokePoint, a as MixerLoad } from '../mixer-5ziHU8OS.cjs';
|
|
3
|
+
export { b as MAX_BRUSH_SIZE } from '../mixer-5ziHU8OS.cjs';
|
|
4
|
+
import { R as RasterRect, a as TiledSurface, B as BlendMode, b as BlendModeInfo } from '../surface-CkKOHGPm.cjs';
|
|
5
|
+
export { c as BLEND_MODES, d as PAINTERLY_BLEND_MODES, e as Tile, i as isBlendMode, f as isPainterlyBlendMode, s as standardBlendMode } from '../surface-CkKOHGPm.cjs';
|
|
6
|
+
import { I as ImageEditorAssetStore, S as SerializedLayer, P as PsdExportResult } from '../export-JGWQEPJn.cjs';
|
|
7
|
+
import { g as PresenceStore, e as PresenceClock, d as PresenceActorInfo, c as PresenceActor, f as PresenceState } from '../presence-Cb6WhcrQ.cjs';
|
|
7
8
|
import { a as AgentToolProvider } from '../registry-BqA1AZt0.cjs';
|
|
8
9
|
import '../types-CwMPoRMU.cjs';
|
|
9
10
|
import '../warp-D5jz_tN7.cjs';
|
|
@@ -1385,7 +1386,8 @@ declare class PaintEditorController {
|
|
|
1385
1386
|
paintStroke(init: PaintStrokeInit & {
|
|
1386
1387
|
points: readonly PenPoint[];
|
|
1387
1388
|
}): PaintStrokeResult;
|
|
1388
|
-
|
|
1389
|
+
/** Checks stroke samples (finite x and y, pressure 0..1) and returns them; throws a sentence naming the bad point. */
|
|
1390
|
+
checkPoints(points: readonly PenPoint[]): PenPoint[];
|
|
1389
1391
|
/** Every recorded stroke, oldest first. */
|
|
1390
1392
|
getStrokes(): readonly RecordedStroke[];
|
|
1391
1393
|
/**
|
|
@@ -1533,6 +1535,91 @@ declare class PaintEditorController {
|
|
|
1533
1535
|
/** Largest tracing or reference image side, in pixels. */
|
|
1534
1536
|
declare const MAX_IMAGE_SIDE = 8192;
|
|
1535
1537
|
|
|
1538
|
+
type PaintPresenceActor = PresenceActor;
|
|
1539
|
+
type PaintPresenceState = PresenceState;
|
|
1540
|
+
/** Cursor positions (document pixels) and notes of agents painting, for an overlay. */
|
|
1541
|
+
declare class PaintPresence extends PresenceStore {
|
|
1542
|
+
}
|
|
1543
|
+
/** What an agent asks for. Each command that paints commits as one undo step. */
|
|
1544
|
+
type PaintAgentCommand = {
|
|
1545
|
+
kind: 'stroke';
|
|
1546
|
+
stroke: PaintStrokeInit & {
|
|
1547
|
+
points: readonly PenPoint[];
|
|
1548
|
+
};
|
|
1549
|
+
note?: string;
|
|
1550
|
+
} | {
|
|
1551
|
+
kind: 'fill';
|
|
1552
|
+
fill: FillLayerOptions;
|
|
1553
|
+
note?: string;
|
|
1554
|
+
} | {
|
|
1555
|
+
kind: 'replay';
|
|
1556
|
+
replay: ReplayOptions;
|
|
1557
|
+
note?: string;
|
|
1558
|
+
} | {
|
|
1559
|
+
kind: 'point';
|
|
1560
|
+
at: {
|
|
1561
|
+
x: number;
|
|
1562
|
+
y: number;
|
|
1563
|
+
};
|
|
1564
|
+
note?: string;
|
|
1565
|
+
} | {
|
|
1566
|
+
kind: 'say';
|
|
1567
|
+
text: string;
|
|
1568
|
+
};
|
|
1569
|
+
type PaintPerformanceResult = {
|
|
1570
|
+
ok: true;
|
|
1571
|
+
command: PaintAgentCommand;
|
|
1572
|
+
result?: unknown;
|
|
1573
|
+
} | {
|
|
1574
|
+
ok: false;
|
|
1575
|
+
command: PaintAgentCommand;
|
|
1576
|
+
message: string;
|
|
1577
|
+
};
|
|
1578
|
+
interface PaintDirectorOptions {
|
|
1579
|
+
clock?: PresenceClock;
|
|
1580
|
+
/** 1 = natural speed; 2 = twice as fast. */
|
|
1581
|
+
speed?: number;
|
|
1582
|
+
/** Hide each actor's cursor this long after its last command (ms, default 1500; 0 keeps it). */
|
|
1583
|
+
linger?: number;
|
|
1584
|
+
/** Longest a stroke takes to paint at speed 1 (ms, default 1800); longer strokes are sped up. */
|
|
1585
|
+
maxStrokeMs?: number;
|
|
1586
|
+
}
|
|
1587
|
+
/** Where along a stroke each point is reached, 0..1: by its time `t` when the points have times, else by distance. */
|
|
1588
|
+
declare function strokeSchedule(points: readonly PenPoint[]): number[];
|
|
1589
|
+
/** How long a stroke takes to paint at speed 1 (ms): its recorded duration, else ~1.5 px/ms, between 250 ms and `max`. */
|
|
1590
|
+
declare function strokeDuration(points: readonly PenPoint[], max?: number): number;
|
|
1591
|
+
/** A zig-zag across `rect` (for a fill rubbed over the sheet), `rows` passes from the top. */
|
|
1592
|
+
declare function sweepPath(rect: RasterRect, rows?: number): Array<{
|
|
1593
|
+
x: number;
|
|
1594
|
+
y: number;
|
|
1595
|
+
}>;
|
|
1596
|
+
/**
|
|
1597
|
+
* Acts out agent commands on a paint canvas: the actor's cursor glides to the stroke's start and
|
|
1598
|
+
* paints it live along its points (paced by their times, or evenly), the stroke committing as
|
|
1599
|
+
* one undo step; fills are rubbed across the sheet first; replays start from the strokes they
|
|
1600
|
+
* copy and end on what they painted. Commands queue per actor. A command that cannot apply (an
|
|
1601
|
+
* unknown or locked layer, a stroke the user is still painting) fails with the controller's
|
|
1602
|
+
* sentence before anything is painted.
|
|
1603
|
+
*/
|
|
1604
|
+
declare class PaintDirector {
|
|
1605
|
+
private readonly controller;
|
|
1606
|
+
readonly presence: PaintPresence;
|
|
1607
|
+
private readonly options;
|
|
1608
|
+
private readonly clock;
|
|
1609
|
+
private readonly queue;
|
|
1610
|
+
constructor(controller: PaintEditorController, presence: PaintPresence, options?: PaintDirectorOptions);
|
|
1611
|
+
/** Acts out `commands` in order for `actor`. Resolves with one result per command. */
|
|
1612
|
+
perform(actor: PresenceActorInfo, commands: readonly PaintAgentCommand[]): Promise<PaintPerformanceResult[]>;
|
|
1613
|
+
private ms;
|
|
1614
|
+
private where;
|
|
1615
|
+
/** Glides to `to`; an actor that just appeared starts there instead of the corner. */
|
|
1616
|
+
private glide;
|
|
1617
|
+
private say;
|
|
1618
|
+
private performOne;
|
|
1619
|
+
/** Paints a stroke live: begins it, pushes its points frame by frame as the cursor reaches them, then ends it (one undo step). */
|
|
1620
|
+
private stroke;
|
|
1621
|
+
}
|
|
1622
|
+
|
|
1536
1623
|
/**
|
|
1537
1624
|
* Agent tools for the paint editor (`createPaintEditorToolProvider`). Strict schemas, every
|
|
1538
1625
|
* argument described, all four annotations. Each write is one undo step (or editor state, said so)
|
|
@@ -1545,6 +1632,13 @@ interface PaintEditorToolProviderOptions {
|
|
|
1545
1632
|
id?: string;
|
|
1546
1633
|
/** Always prefix tool names with `<namespace>__`. */
|
|
1547
1634
|
namespace?: string;
|
|
1635
|
+
/**
|
|
1636
|
+
* Acts out strokes, fills and replays with an agent cursor on the canvas (see `PaintDirector`):
|
|
1637
|
+
* strokes paint live along their points. Each call is still one undo step. Without it, they apply at once.
|
|
1638
|
+
*/
|
|
1639
|
+
director?: PaintDirector;
|
|
1640
|
+
/** The agent's cursor (default `{ id: 'agent', name: 'Agent' }`). */
|
|
1641
|
+
actor?: PresenceActorInfo;
|
|
1548
1642
|
}
|
|
1549
1643
|
/** Agent tools for one paint editor. */
|
|
1550
1644
|
declare function createPaintEditorToolProvider(controller: PaintEditorController, options?: PaintEditorToolProviderOptions): AgentToolProvider;
|
|
@@ -1676,5 +1770,16 @@ declare function renderColorWheel(size: number, wheel: ColorWheel, inner?: numbe
|
|
|
1676
1770
|
};
|
|
1677
1771
|
/** The colour for a click on the wheel ring at (dx, dy) from its centre, keeping `color`'s saturation and value. */
|
|
1678
1772
|
declare function wheelPick(dx: number, dy: number, wheel: ColorWheel, color: string): string;
|
|
1773
|
+
/** A group of the blend menu: the Photoshop modes, then pigment and the painterly modes. */
|
|
1774
|
+
interface BlendMenuGroup {
|
|
1775
|
+
label: string;
|
|
1776
|
+
modes: readonly BlendModeInfo[];
|
|
1777
|
+
}
|
|
1778
|
+
/**
|
|
1779
|
+
* The layer and brush blend menus as groups: the 26 standard modes, then the paint modes
|
|
1780
|
+
* (`pigment` and the painterly `watercolor`, `tint`, `highlight`, `shadow`), each with its
|
|
1781
|
+
* description as a tooltip. Both bindings render this as `<optgroup>`s.
|
|
1782
|
+
*/
|
|
1783
|
+
declare const BLEND_MENU_GROUPS: readonly BlendMenuGroup[];
|
|
1679
1784
|
|
|
1680
|
-
export { type Affine, BRUSH_ID, BRUSH_ROTATIONS, BRUSH_SLIDERS, BUILTIN_BRUSHES, BlendMode, type BrushDynamics, type BrushLibraryFile, type BrushRotation, type BrushThumbnail, type ColorWheel, DEFAULT_BRUSH_ID, DEFAULT_DPI, DEFAULT_DYNAMICS, DEFAULT_PAPER, DEFAULT_SWATCHES, DEFAULT_VIEW, DryStroke, type DryStrokeOptions, type FillLayerOptions, GRAIN_PATTERNS, GRAIN_TILE, type GrainPattern, type GrainTuning, HARMONY_KINDS, type Hand, type HarmonyColor, type HarmonyKind, IDENTITY_AFFINE, IDENTITY_COPY, type ImageEncoder, type ImageFormat, type ImageNode, type LayerUpdate, type Linear2, type LoadedPaintDocument, MAX_CANVAS_SIDE, MAX_COORDINATE, MAX_IMAGE_SIDE, MAX_ZOOM, MIN_CANVAS_SIDE, MIN_ZOOM, MIXING_PAD_HEIGHT, MIXING_PAD_WIDTH, MixingPad, type MixingPadTool, PAINT_BRUSH_CATEGORIES, PAINT_BRUSH_ENGINES, PAINT_FORMAT, PAINT_SCHEMA_VERSION, PAINT_TOOLS, PAPER_FAMILIES, PAPER_LIBRARY, PAPER_NODE_ID, PAPER_SLIDERS, type Paint2DContext, type PaintAssetStore, type PaintBrush, type PaintBrushCategory, type PaintBrushEngine, type PaintBrushInput, type PaintCanvas, PaintCanvasPresenter, PaintDocumentError, type PaintDocumentExtensions, type PaintDocumentState, PaintEditorController, PaintEditorError, type PaintEditorOptions, type PaintEditorState, type PaintEditorToolProviderOptions, PaintGesture, type PaintGroupLayer, type PaintGuides, type PaintLayer, type PaintLayerInfo, type PaintPixelLayer, type PaintPointerEvent, type PaintStrokeInit, type PaintStrokeResult, PaintStrokeSession, type PaintTool, type PaintView, type PaperFamily, PaperGrain, type PaperNode, type PaperSettings, type PaperTiling, type PenDab, PenDabWalker, type PenPoint, PenSmoother, type PerspectiveGuide, PerspectiveSnapper, type PixelImage, type Point2, type PointerSample, type RecordedStroke, type ReferenceImage, type RenderOptions, type ReplayOptions, type Rgb255, SNAP_DECIDE_DISTANCE, SYMMETRY_MODES, type SerializeOptions, type SerializedPaintDocument, type SliderControl, type StrokeCopy, type StrokeSessionHost, type StrokeSessionInit, type StrokeVariation, type Swatch, type SymmetryGuide, type SymmetryMode, TRACING_NODE_ID, TileableNoise, type TracingImage, type ViewLayer, type ViewportBox, affineCopy, applyAffine, brushToJSON, clonePaper, colorHarmony, composeAffine, createPaintCompositor, createPaintDocument, createPaintEditorToolProvider, createPaintLayer, decodeImageBlob, defaultGuides, defaultImageEncoder, deserializePaintDocument, deserializePaintDocumentAsync, documentExtensions, documentToScreen, downloadBytes, downsampleRgba, fitZoom, grainCatch, grainHeights, guideOverlay, handlePaintShortcut, hash2, hexToRgb8, hslToRgb, hsvToRgb, hueToWheel, invertAffine, isPalmTouch, mapPenPoint, mix32, mixerLoadForStroke, mixerTip, newPaintLayerId, normalizeBrushStroke, normalizeCanvas, normalizeDynamics, normalizePaintBrush, normalizePaper, normalizePerspective, normalizeRotation, normalizeSymmetry, normalizeView, paperGrain, paperKey, paperNode, paperPreset, parseBrushLibrary, parseHexColor, patchPath, penOrientation, perspectiveDirections, perspectiveGuideLines, pointerToPenPoint, rand01, randSigned, readPath, renderBrushThumbnail, renderColorWheel, renderPaper, rgbToHexColor, rgbToHsl, rgbToHsv, samplePressure, screenToDocument, seedFromString, serializePaintDocument, serializePaintDocumentExternal, strokeBounds, symmetryAxisAngles, symmetryAxisSegments, symmetryCopies, thumbnailStroke, tiltToOrientation, toStrokePoint, variationAffine, varyStroke, viewCssTransform, viewMatrix, viewPenToDocument, wheelAngle, wheelPick, wheelPoint, wheelToHue };
|
|
1785
|
+
export { type Affine, BLEND_MENU_GROUPS, BRUSH_ID, BRUSH_ROTATIONS, BRUSH_SLIDERS, BUILTIN_BRUSHES, type BlendMenuGroup, BlendMode, BlendModeInfo, type BrushDynamics, type BrushLibraryFile, type BrushRotation, type BrushThumbnail, type ColorWheel, DEFAULT_BRUSH_ID, DEFAULT_DPI, DEFAULT_DYNAMICS, DEFAULT_PAPER, DEFAULT_SWATCHES, DEFAULT_VIEW, DryStroke, type DryStrokeOptions, type FillLayerOptions, GRAIN_PATTERNS, GRAIN_TILE, type GrainPattern, type GrainTuning, HARMONY_KINDS, type Hand, type HarmonyColor, type HarmonyKind, IDENTITY_AFFINE, IDENTITY_COPY, type ImageEncoder, type ImageFormat, type ImageNode, type LayerUpdate, type Linear2, type LoadedPaintDocument, MAX_CANVAS_SIDE, MAX_COORDINATE, MAX_IMAGE_SIDE, MAX_ZOOM, MIN_CANVAS_SIDE, MIN_ZOOM, MIXING_PAD_HEIGHT, MIXING_PAD_WIDTH, MixingPad, type MixingPadTool, PAINT_BRUSH_CATEGORIES, PAINT_BRUSH_ENGINES, PAINT_FORMAT, PAINT_SCHEMA_VERSION, PAINT_TOOLS, PAPER_FAMILIES, PAPER_LIBRARY, PAPER_NODE_ID, PAPER_SLIDERS, type Paint2DContext, type PaintAgentCommand, type PaintAssetStore, type PaintBrush, type PaintBrushCategory, type PaintBrushEngine, type PaintBrushInput, type PaintCanvas, PaintCanvasPresenter, PaintDirector, type PaintDirectorOptions, PaintDocumentError, type PaintDocumentExtensions, type PaintDocumentState, PaintEditorController, PaintEditorError, type PaintEditorOptions, type PaintEditorState, type PaintEditorToolProviderOptions, PaintGesture, type PaintGroupLayer, type PaintGuides, type PaintLayer, type PaintLayerInfo, type PaintPerformanceResult, type PaintPixelLayer, type PaintPointerEvent, PaintPresence, type PaintPresenceActor, type PaintPresenceState, type PaintStrokeInit, type PaintStrokeResult, PaintStrokeSession, type PaintTool, type PaintView, type PaperFamily, PaperGrain, type PaperNode, type PaperSettings, type PaperTiling, type PenDab, PenDabWalker, type PenPoint, PenSmoother, type PerspectiveGuide, PerspectiveSnapper, type PixelImage, type Point2, type PointerSample, type RecordedStroke, type ReferenceImage, type RenderOptions, type ReplayOptions, type Rgb255, SNAP_DECIDE_DISTANCE, SYMMETRY_MODES, type SerializeOptions, type SerializedPaintDocument, type SliderControl, type StrokeCopy, type StrokeSessionHost, type StrokeSessionInit, type StrokeVariation, type Swatch, type SymmetryGuide, type SymmetryMode, TRACING_NODE_ID, TileableNoise, type TracingImage, type ViewLayer, type ViewportBox, affineCopy, applyAffine, brushToJSON, clonePaper, colorHarmony, composeAffine, createPaintCompositor, createPaintDocument, createPaintEditorToolProvider, createPaintLayer, decodeImageBlob, defaultGuides, defaultImageEncoder, deserializePaintDocument, deserializePaintDocumentAsync, documentExtensions, documentToScreen, downloadBytes, downsampleRgba, fitZoom, grainCatch, grainHeights, guideOverlay, handlePaintShortcut, hash2, hexToRgb8, hslToRgb, hsvToRgb, hueToWheel, invertAffine, isPalmTouch, mapPenPoint, mix32, mixerLoadForStroke, mixerTip, newPaintLayerId, normalizeBrushStroke, normalizeCanvas, normalizeDynamics, normalizePaintBrush, normalizePaper, normalizePerspective, normalizeRotation, normalizeSymmetry, normalizeView, paperGrain, paperKey, paperNode, paperPreset, parseBrushLibrary, parseHexColor, patchPath, penOrientation, perspectiveDirections, perspectiveGuideLines, pointerToPenPoint, rand01, randSigned, readPath, renderBrushThumbnail, renderColorWheel, renderPaper, rgbToHexColor, rgbToHsl, rgbToHsv, samplePressure, screenToDocument, seedFromString, serializePaintDocument, serializePaintDocumentExternal, strokeBounds, strokeDuration, strokeSchedule, sweepPath, symmetryAxisAngles, symmetryAxisSegments, symmetryCopies, thumbnailStroke, tiltToOrientation, toStrokePoint, variationAffine, varyStroke, viewCssTransform, viewMatrix, viewPenToDocument, wheelAngle, wheelPick, wheelPoint, wheelToHue };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { R as RasterLayer, a as RasterGroupLayer, b as RasterPixelLayer, C as CompositorLayer, c as RasterCompositor, d as RasterSources, L as LayerLocks } from '../compositor-
|
|
2
|
-
import { B as BrushSettings, M as MixerSettings, C as CoverageMap, D as Dab, S as StrokePoint, a as MixerLoad } from '../mixer-
|
|
3
|
-
export { b as MAX_BRUSH_SIZE } from '../mixer-
|
|
4
|
-
import { R as RasterRect, a as TiledSurface, B as BlendMode } from '../surface-
|
|
5
|
-
export {
|
|
6
|
-
import { I as ImageEditorAssetStore, S as SerializedLayer, P as PsdExportResult } from '../export-
|
|
1
|
+
import { R as RasterLayer, a as RasterGroupLayer, b as RasterPixelLayer, C as CompositorLayer, c as RasterCompositor, d as RasterSources, L as LayerLocks } from '../compositor-Kt_M4ruo.js';
|
|
2
|
+
import { B as BrushSettings, M as MixerSettings, C as CoverageMap, D as Dab, S as StrokePoint, a as MixerLoad } from '../mixer-DNqiYXYQ.js';
|
|
3
|
+
export { b as MAX_BRUSH_SIZE } from '../mixer-DNqiYXYQ.js';
|
|
4
|
+
import { R as RasterRect, a as TiledSurface, B as BlendMode, b as BlendModeInfo } from '../surface-CkKOHGPm.js';
|
|
5
|
+
export { c as BLEND_MODES, d as PAINTERLY_BLEND_MODES, e as Tile, i as isBlendMode, f as isPainterlyBlendMode, s as standardBlendMode } from '../surface-CkKOHGPm.js';
|
|
6
|
+
import { I as ImageEditorAssetStore, S as SerializedLayer, P as PsdExportResult } from '../export-a9bnF7Cl.js';
|
|
7
|
+
import { g as PresenceStore, e as PresenceClock, d as PresenceActorInfo, c as PresenceActor, f as PresenceState } from '../presence-Cb6WhcrQ.js';
|
|
7
8
|
import { a as AgentToolProvider } from '../registry-D-4fit9C.js';
|
|
8
9
|
import '../types-CwMPoRMU.js';
|
|
9
10
|
import '../warp-CWHZzE3x.js';
|
|
@@ -1385,7 +1386,8 @@ declare class PaintEditorController {
|
|
|
1385
1386
|
paintStroke(init: PaintStrokeInit & {
|
|
1386
1387
|
points: readonly PenPoint[];
|
|
1387
1388
|
}): PaintStrokeResult;
|
|
1388
|
-
|
|
1389
|
+
/** Checks stroke samples (finite x and y, pressure 0..1) and returns them; throws a sentence naming the bad point. */
|
|
1390
|
+
checkPoints(points: readonly PenPoint[]): PenPoint[];
|
|
1389
1391
|
/** Every recorded stroke, oldest first. */
|
|
1390
1392
|
getStrokes(): readonly RecordedStroke[];
|
|
1391
1393
|
/**
|
|
@@ -1533,6 +1535,91 @@ declare class PaintEditorController {
|
|
|
1533
1535
|
/** Largest tracing or reference image side, in pixels. */
|
|
1534
1536
|
declare const MAX_IMAGE_SIDE = 8192;
|
|
1535
1537
|
|
|
1538
|
+
type PaintPresenceActor = PresenceActor;
|
|
1539
|
+
type PaintPresenceState = PresenceState;
|
|
1540
|
+
/** Cursor positions (document pixels) and notes of agents painting, for an overlay. */
|
|
1541
|
+
declare class PaintPresence extends PresenceStore {
|
|
1542
|
+
}
|
|
1543
|
+
/** What an agent asks for. Each command that paints commits as one undo step. */
|
|
1544
|
+
type PaintAgentCommand = {
|
|
1545
|
+
kind: 'stroke';
|
|
1546
|
+
stroke: PaintStrokeInit & {
|
|
1547
|
+
points: readonly PenPoint[];
|
|
1548
|
+
};
|
|
1549
|
+
note?: string;
|
|
1550
|
+
} | {
|
|
1551
|
+
kind: 'fill';
|
|
1552
|
+
fill: FillLayerOptions;
|
|
1553
|
+
note?: string;
|
|
1554
|
+
} | {
|
|
1555
|
+
kind: 'replay';
|
|
1556
|
+
replay: ReplayOptions;
|
|
1557
|
+
note?: string;
|
|
1558
|
+
} | {
|
|
1559
|
+
kind: 'point';
|
|
1560
|
+
at: {
|
|
1561
|
+
x: number;
|
|
1562
|
+
y: number;
|
|
1563
|
+
};
|
|
1564
|
+
note?: string;
|
|
1565
|
+
} | {
|
|
1566
|
+
kind: 'say';
|
|
1567
|
+
text: string;
|
|
1568
|
+
};
|
|
1569
|
+
type PaintPerformanceResult = {
|
|
1570
|
+
ok: true;
|
|
1571
|
+
command: PaintAgentCommand;
|
|
1572
|
+
result?: unknown;
|
|
1573
|
+
} | {
|
|
1574
|
+
ok: false;
|
|
1575
|
+
command: PaintAgentCommand;
|
|
1576
|
+
message: string;
|
|
1577
|
+
};
|
|
1578
|
+
interface PaintDirectorOptions {
|
|
1579
|
+
clock?: PresenceClock;
|
|
1580
|
+
/** 1 = natural speed; 2 = twice as fast. */
|
|
1581
|
+
speed?: number;
|
|
1582
|
+
/** Hide each actor's cursor this long after its last command (ms, default 1500; 0 keeps it). */
|
|
1583
|
+
linger?: number;
|
|
1584
|
+
/** Longest a stroke takes to paint at speed 1 (ms, default 1800); longer strokes are sped up. */
|
|
1585
|
+
maxStrokeMs?: number;
|
|
1586
|
+
}
|
|
1587
|
+
/** Where along a stroke each point is reached, 0..1: by its time `t` when the points have times, else by distance. */
|
|
1588
|
+
declare function strokeSchedule(points: readonly PenPoint[]): number[];
|
|
1589
|
+
/** How long a stroke takes to paint at speed 1 (ms): its recorded duration, else ~1.5 px/ms, between 250 ms and `max`. */
|
|
1590
|
+
declare function strokeDuration(points: readonly PenPoint[], max?: number): number;
|
|
1591
|
+
/** A zig-zag across `rect` (for a fill rubbed over the sheet), `rows` passes from the top. */
|
|
1592
|
+
declare function sweepPath(rect: RasterRect, rows?: number): Array<{
|
|
1593
|
+
x: number;
|
|
1594
|
+
y: number;
|
|
1595
|
+
}>;
|
|
1596
|
+
/**
|
|
1597
|
+
* Acts out agent commands on a paint canvas: the actor's cursor glides to the stroke's start and
|
|
1598
|
+
* paints it live along its points (paced by their times, or evenly), the stroke committing as
|
|
1599
|
+
* one undo step; fills are rubbed across the sheet first; replays start from the strokes they
|
|
1600
|
+
* copy and end on what they painted. Commands queue per actor. A command that cannot apply (an
|
|
1601
|
+
* unknown or locked layer, a stroke the user is still painting) fails with the controller's
|
|
1602
|
+
* sentence before anything is painted.
|
|
1603
|
+
*/
|
|
1604
|
+
declare class PaintDirector {
|
|
1605
|
+
private readonly controller;
|
|
1606
|
+
readonly presence: PaintPresence;
|
|
1607
|
+
private readonly options;
|
|
1608
|
+
private readonly clock;
|
|
1609
|
+
private readonly queue;
|
|
1610
|
+
constructor(controller: PaintEditorController, presence: PaintPresence, options?: PaintDirectorOptions);
|
|
1611
|
+
/** Acts out `commands` in order for `actor`. Resolves with one result per command. */
|
|
1612
|
+
perform(actor: PresenceActorInfo, commands: readonly PaintAgentCommand[]): Promise<PaintPerformanceResult[]>;
|
|
1613
|
+
private ms;
|
|
1614
|
+
private where;
|
|
1615
|
+
/** Glides to `to`; an actor that just appeared starts there instead of the corner. */
|
|
1616
|
+
private glide;
|
|
1617
|
+
private say;
|
|
1618
|
+
private performOne;
|
|
1619
|
+
/** Paints a stroke live: begins it, pushes its points frame by frame as the cursor reaches them, then ends it (one undo step). */
|
|
1620
|
+
private stroke;
|
|
1621
|
+
}
|
|
1622
|
+
|
|
1536
1623
|
/**
|
|
1537
1624
|
* Agent tools for the paint editor (`createPaintEditorToolProvider`). Strict schemas, every
|
|
1538
1625
|
* argument described, all four annotations. Each write is one undo step (or editor state, said so)
|
|
@@ -1545,6 +1632,13 @@ interface PaintEditorToolProviderOptions {
|
|
|
1545
1632
|
id?: string;
|
|
1546
1633
|
/** Always prefix tool names with `<namespace>__`. */
|
|
1547
1634
|
namespace?: string;
|
|
1635
|
+
/**
|
|
1636
|
+
* Acts out strokes, fills and replays with an agent cursor on the canvas (see `PaintDirector`):
|
|
1637
|
+
* strokes paint live along their points. Each call is still one undo step. Without it, they apply at once.
|
|
1638
|
+
*/
|
|
1639
|
+
director?: PaintDirector;
|
|
1640
|
+
/** The agent's cursor (default `{ id: 'agent', name: 'Agent' }`). */
|
|
1641
|
+
actor?: PresenceActorInfo;
|
|
1548
1642
|
}
|
|
1549
1643
|
/** Agent tools for one paint editor. */
|
|
1550
1644
|
declare function createPaintEditorToolProvider(controller: PaintEditorController, options?: PaintEditorToolProviderOptions): AgentToolProvider;
|
|
@@ -1676,5 +1770,16 @@ declare function renderColorWheel(size: number, wheel: ColorWheel, inner?: numbe
|
|
|
1676
1770
|
};
|
|
1677
1771
|
/** The colour for a click on the wheel ring at (dx, dy) from its centre, keeping `color`'s saturation and value. */
|
|
1678
1772
|
declare function wheelPick(dx: number, dy: number, wheel: ColorWheel, color: string): string;
|
|
1773
|
+
/** A group of the blend menu: the Photoshop modes, then pigment and the painterly modes. */
|
|
1774
|
+
interface BlendMenuGroup {
|
|
1775
|
+
label: string;
|
|
1776
|
+
modes: readonly BlendModeInfo[];
|
|
1777
|
+
}
|
|
1778
|
+
/**
|
|
1779
|
+
* The layer and brush blend menus as groups: the 26 standard modes, then the paint modes
|
|
1780
|
+
* (`pigment` and the painterly `watercolor`, `tint`, `highlight`, `shadow`), each with its
|
|
1781
|
+
* description as a tooltip. Both bindings render this as `<optgroup>`s.
|
|
1782
|
+
*/
|
|
1783
|
+
declare const BLEND_MENU_GROUPS: readonly BlendMenuGroup[];
|
|
1679
1784
|
|
|
1680
|
-
export { type Affine, BRUSH_ID, BRUSH_ROTATIONS, BRUSH_SLIDERS, BUILTIN_BRUSHES, BlendMode, type BrushDynamics, type BrushLibraryFile, type BrushRotation, type BrushThumbnail, type ColorWheel, DEFAULT_BRUSH_ID, DEFAULT_DPI, DEFAULT_DYNAMICS, DEFAULT_PAPER, DEFAULT_SWATCHES, DEFAULT_VIEW, DryStroke, type DryStrokeOptions, type FillLayerOptions, GRAIN_PATTERNS, GRAIN_TILE, type GrainPattern, type GrainTuning, HARMONY_KINDS, type Hand, type HarmonyColor, type HarmonyKind, IDENTITY_AFFINE, IDENTITY_COPY, type ImageEncoder, type ImageFormat, type ImageNode, type LayerUpdate, type Linear2, type LoadedPaintDocument, MAX_CANVAS_SIDE, MAX_COORDINATE, MAX_IMAGE_SIDE, MAX_ZOOM, MIN_CANVAS_SIDE, MIN_ZOOM, MIXING_PAD_HEIGHT, MIXING_PAD_WIDTH, MixingPad, type MixingPadTool, PAINT_BRUSH_CATEGORIES, PAINT_BRUSH_ENGINES, PAINT_FORMAT, PAINT_SCHEMA_VERSION, PAINT_TOOLS, PAPER_FAMILIES, PAPER_LIBRARY, PAPER_NODE_ID, PAPER_SLIDERS, type Paint2DContext, type PaintAssetStore, type PaintBrush, type PaintBrushCategory, type PaintBrushEngine, type PaintBrushInput, type PaintCanvas, PaintCanvasPresenter, PaintDocumentError, type PaintDocumentExtensions, type PaintDocumentState, PaintEditorController, PaintEditorError, type PaintEditorOptions, type PaintEditorState, type PaintEditorToolProviderOptions, PaintGesture, type PaintGroupLayer, type PaintGuides, type PaintLayer, type PaintLayerInfo, type PaintPixelLayer, type PaintPointerEvent, type PaintStrokeInit, type PaintStrokeResult, PaintStrokeSession, type PaintTool, type PaintView, type PaperFamily, PaperGrain, type PaperNode, type PaperSettings, type PaperTiling, type PenDab, PenDabWalker, type PenPoint, PenSmoother, type PerspectiveGuide, PerspectiveSnapper, type PixelImage, type Point2, type PointerSample, type RecordedStroke, type ReferenceImage, type RenderOptions, type ReplayOptions, type Rgb255, SNAP_DECIDE_DISTANCE, SYMMETRY_MODES, type SerializeOptions, type SerializedPaintDocument, type SliderControl, type StrokeCopy, type StrokeSessionHost, type StrokeSessionInit, type StrokeVariation, type Swatch, type SymmetryGuide, type SymmetryMode, TRACING_NODE_ID, TileableNoise, type TracingImage, type ViewLayer, type ViewportBox, affineCopy, applyAffine, brushToJSON, clonePaper, colorHarmony, composeAffine, createPaintCompositor, createPaintDocument, createPaintEditorToolProvider, createPaintLayer, decodeImageBlob, defaultGuides, defaultImageEncoder, deserializePaintDocument, deserializePaintDocumentAsync, documentExtensions, documentToScreen, downloadBytes, downsampleRgba, fitZoom, grainCatch, grainHeights, guideOverlay, handlePaintShortcut, hash2, hexToRgb8, hslToRgb, hsvToRgb, hueToWheel, invertAffine, isPalmTouch, mapPenPoint, mix32, mixerLoadForStroke, mixerTip, newPaintLayerId, normalizeBrushStroke, normalizeCanvas, normalizeDynamics, normalizePaintBrush, normalizePaper, normalizePerspective, normalizeRotation, normalizeSymmetry, normalizeView, paperGrain, paperKey, paperNode, paperPreset, parseBrushLibrary, parseHexColor, patchPath, penOrientation, perspectiveDirections, perspectiveGuideLines, pointerToPenPoint, rand01, randSigned, readPath, renderBrushThumbnail, renderColorWheel, renderPaper, rgbToHexColor, rgbToHsl, rgbToHsv, samplePressure, screenToDocument, seedFromString, serializePaintDocument, serializePaintDocumentExternal, strokeBounds, symmetryAxisAngles, symmetryAxisSegments, symmetryCopies, thumbnailStroke, tiltToOrientation, toStrokePoint, variationAffine, varyStroke, viewCssTransform, viewMatrix, viewPenToDocument, wheelAngle, wheelPick, wheelPoint, wheelToHue };
|
|
1785
|
+
export { type Affine, BLEND_MENU_GROUPS, BRUSH_ID, BRUSH_ROTATIONS, BRUSH_SLIDERS, BUILTIN_BRUSHES, type BlendMenuGroup, BlendMode, BlendModeInfo, type BrushDynamics, type BrushLibraryFile, type BrushRotation, type BrushThumbnail, type ColorWheel, DEFAULT_BRUSH_ID, DEFAULT_DPI, DEFAULT_DYNAMICS, DEFAULT_PAPER, DEFAULT_SWATCHES, DEFAULT_VIEW, DryStroke, type DryStrokeOptions, type FillLayerOptions, GRAIN_PATTERNS, GRAIN_TILE, type GrainPattern, type GrainTuning, HARMONY_KINDS, type Hand, type HarmonyColor, type HarmonyKind, IDENTITY_AFFINE, IDENTITY_COPY, type ImageEncoder, type ImageFormat, type ImageNode, type LayerUpdate, type Linear2, type LoadedPaintDocument, MAX_CANVAS_SIDE, MAX_COORDINATE, MAX_IMAGE_SIDE, MAX_ZOOM, MIN_CANVAS_SIDE, MIN_ZOOM, MIXING_PAD_HEIGHT, MIXING_PAD_WIDTH, MixingPad, type MixingPadTool, PAINT_BRUSH_CATEGORIES, PAINT_BRUSH_ENGINES, PAINT_FORMAT, PAINT_SCHEMA_VERSION, PAINT_TOOLS, PAPER_FAMILIES, PAPER_LIBRARY, PAPER_NODE_ID, PAPER_SLIDERS, type Paint2DContext, type PaintAgentCommand, type PaintAssetStore, type PaintBrush, type PaintBrushCategory, type PaintBrushEngine, type PaintBrushInput, type PaintCanvas, PaintCanvasPresenter, PaintDirector, type PaintDirectorOptions, PaintDocumentError, type PaintDocumentExtensions, type PaintDocumentState, PaintEditorController, PaintEditorError, type PaintEditorOptions, type PaintEditorState, type PaintEditorToolProviderOptions, PaintGesture, type PaintGroupLayer, type PaintGuides, type PaintLayer, type PaintLayerInfo, type PaintPerformanceResult, type PaintPixelLayer, type PaintPointerEvent, PaintPresence, type PaintPresenceActor, type PaintPresenceState, type PaintStrokeInit, type PaintStrokeResult, PaintStrokeSession, type PaintTool, type PaintView, type PaperFamily, PaperGrain, type PaperNode, type PaperSettings, type PaperTiling, type PenDab, PenDabWalker, type PenPoint, PenSmoother, type PerspectiveGuide, PerspectiveSnapper, type PixelImage, type Point2, type PointerSample, type RecordedStroke, type ReferenceImage, type RenderOptions, type ReplayOptions, type Rgb255, SNAP_DECIDE_DISTANCE, SYMMETRY_MODES, type SerializeOptions, type SerializedPaintDocument, type SliderControl, type StrokeCopy, type StrokeSessionHost, type StrokeSessionInit, type StrokeVariation, type Swatch, type SymmetryGuide, type SymmetryMode, TRACING_NODE_ID, TileableNoise, type TracingImage, type ViewLayer, type ViewportBox, affineCopy, applyAffine, brushToJSON, clonePaper, colorHarmony, composeAffine, createPaintCompositor, createPaintDocument, createPaintEditorToolProvider, createPaintLayer, decodeImageBlob, defaultGuides, defaultImageEncoder, deserializePaintDocument, deserializePaintDocumentAsync, documentExtensions, documentToScreen, downloadBytes, downsampleRgba, fitZoom, grainCatch, grainHeights, guideOverlay, handlePaintShortcut, hash2, hexToRgb8, hslToRgb, hsvToRgb, hueToWheel, invertAffine, isPalmTouch, mapPenPoint, mix32, mixerLoadForStroke, mixerTip, newPaintLayerId, normalizeBrushStroke, normalizeCanvas, normalizeDynamics, normalizePaintBrush, normalizePaper, normalizePerspective, normalizeRotation, normalizeSymmetry, normalizeView, paperGrain, paperKey, paperNode, paperPreset, parseBrushLibrary, parseHexColor, patchPath, penOrientation, perspectiveDirections, perspectiveGuideLines, pointerToPenPoint, rand01, randSigned, readPath, renderBrushThumbnail, renderColorWheel, renderPaper, rgbToHexColor, rgbToHsl, rgbToHsv, samplePressure, screenToDocument, seedFromString, serializePaintDocument, serializePaintDocumentExternal, strokeBounds, strokeDuration, strokeSchedule, sweepPath, symmetryAxisAngles, symmetryAxisSegments, symmetryCopies, thumbnailStroke, tiltToOrientation, toStrokePoint, variationAffine, varyStroke, viewCssTransform, viewMatrix, viewPenToDocument, wheelAngle, wheelPick, wheelPoint, wheelToHue };
|