@pixerate/editor 0.246.0 → 0.248.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 (50) hide show
  1. package/dist/animation-editor/index.cjs +59 -59
  2. package/dist/animation-editor/index.js +3 -3
  3. package/dist/{brushstrokeRender-ZDHMXJAE.cjs → brushstrokeRender-DTDPFBLC.cjs} +5 -5
  4. package/dist/{brushstrokeRender-AKUI3SEJ.js → brushstrokeRender-QLCXROJK.js} +2 -2
  5. package/dist/canvas/index.cjs +8 -8
  6. package/dist/canvas/index.js +1 -1
  7. package/dist/{chunk-DQWPMGH2.js → chunk-5GLYUSNT.js} +1 -1
  8. package/dist/{chunk-Q2UYUWAZ.cjs → chunk-6G6ZDDDB.cjs} +390 -27
  9. package/dist/chunk-7T7JWTVE.cjs +192 -0
  10. package/dist/{chunk-UVPD55UZ.cjs → chunk-IBDU6EGZ.cjs} +35 -35
  11. package/dist/{chunk-FK5LTDOO.cjs → chunk-L6REDLNB.cjs} +2 -2
  12. package/dist/{chunk-LDPLEZ5T.js → chunk-NZ3O3A5C.js} +1 -1
  13. package/dist/{chunk-N6WUB3Y5.js → chunk-Q2HA52V4.js} +1 -1
  14. package/dist/chunk-SC2RZ5EF.js +192 -0
  15. package/dist/{chunk-5MFDD7SP.cjs → chunk-TPWB4Y6L.cjs} +1 -1
  16. package/dist/{chunk-VDAWA546.js → chunk-VNBUDVD4.js} +388 -25
  17. package/dist/{chunk-XTWXBQD4.cjs → chunk-WVS5KQDH.cjs} +442 -87
  18. package/dist/{chunk-A23PSOBB.js → chunk-XNRBMYNB.js} +1 -1
  19. package/dist/{chunk-CEPKXLBS.cjs → chunk-XWTRATIM.cjs} +23 -23
  20. package/dist/{chunk-4PMCMWQS.js → chunk-ZFSLEOSQ.js} +357 -2
  21. package/dist/image-editor/effect-tools.d.cts +37 -4
  22. package/dist/image-editor/effect-tools.d.ts +37 -4
  23. package/dist/image-editor/index.cjs +1059 -1552
  24. package/dist/image-editor/index.d.cts +1 -1
  25. package/dist/image-editor/index.d.ts +1 -1
  26. package/dist/image-editor/index.js +275 -768
  27. package/dist/paint-editor/controller.d.cts +34 -1
  28. package/dist/paint-editor/controller.d.ts +34 -1
  29. package/dist/paint-editor/index.cjs +426 -257
  30. package/dist/paint-editor/index.js +184 -15
  31. package/dist/paint-editor/procedural.d.cts +82 -5
  32. package/dist/paint-editor/procedural.d.ts +82 -5
  33. package/dist/paint-editor/tools.d.cts +1 -1
  34. package/dist/paint-editor/tools.d.ts +1 -1
  35. package/dist/paint-editor/ui.d.cts +15 -2
  36. package/dist/paint-editor/ui.d.ts +15 -2
  37. package/dist/{image-editor/layers/effects-ui.d.ts → raster/effects/ui.d.cts} +32 -5
  38. package/dist/{image-editor/layers/effects-ui.d.cts → raster/effects/ui.d.ts} +32 -5
  39. package/dist/raster/index.cjs +13 -1
  40. package/dist/raster/index.d.cts +1 -0
  41. package/dist/raster/index.d.ts +1 -0
  42. package/dist/raster/index.js +12 -0
  43. package/dist/vector/index.cjs +962 -962
  44. package/dist/vector/index.js +4 -4
  45. package/package.json +1 -1
  46. package/skills/pixerate-paint-editor/SKILL.md +18 -27
  47. package/skills/pixerate-paint-editor/references/gradient-paint.md +23 -0
  48. package/skills/pixerate-paint-editor/references/layer-effects.md +28 -0
  49. package/skills/pixerate-paint-editor/references/light-paint.md +10 -2
  50. package/skills/pixerate-paint-editor/references/particle-brushes.md +66 -0
@@ -1,11 +1,44 @@
1
1
  import type { AgentTool } from '../tools/registry.js';
2
2
  import type { ImageEditorController } from './controller.js';
3
- import { type LayerEffects } from '../raster/effects/model.js';
3
+ import { type LayerEffectKind, type GlobalLight, type LayerEffects } from '../raster/effects/model.js';
4
+ import { type EffectPattern } from '../raster/effects/patterns.js';
4
5
  /** A layer's effects for agents: the master switch, scale, reach and every effect with its settings. */
5
6
  export declare function describeLayerEffects(effects: LayerEffects): Record<string, unknown>;
6
7
  /**
7
- * Agent tools for layer effects: `list_layer_effects`, `add_layer_effect`, `update_layer_effect`,
8
- * `remove_layer_effect`, `set_layer_effects_enabled` and `set_global_light`. Each write validates
9
- * every setting first, is one undo step and returns the layer's effects after the change.
8
+ * What the layer effect tools need of an editor. The image and paint editors both provide it, so
9
+ * both get the same tools, schemas and defaults (`../raster/effects/model`).
10
10
  */
11
+ export interface LayerEffectsHost {
12
+ /** Throws a helpful error when `id` is not a layer that can take effects. */
13
+ requireLayer(id: string): void;
14
+ getLayerEffects(id: string): LayerEffects;
15
+ addLayerEffect(id: string, kind: LayerEffectKind, settings: Record<string, unknown>, index?: number): {
16
+ effect: {
17
+ id: string;
18
+ };
19
+ };
20
+ updateLayerEffect(id: string, effectId: string, changes: Record<string, unknown>): unknown;
21
+ removeLayerEffect(id: string, effectId: string): unknown;
22
+ setLayerEffectsEnabled(id: string, enabled: boolean, scale?: number): unknown;
23
+ /** The light shadows and bevels with useGlobalLight follow; without it, the default 120° / 30°. */
24
+ getGlobalLight?(): GlobalLight;
25
+ /** With it, the `set_global_light` tool is offered. */
26
+ setGlobalLight?(light: Partial<GlobalLight>): GlobalLight;
27
+ /** Document patterns beside the built-in ones (from a PSD). */
28
+ getDocumentPatterns?(): readonly EffectPattern[];
29
+ }
30
+ export interface LayerEffectToolsOptions {
31
+ /** What a layerId may name, for its description (e.g. "a pixel, shape, smart object, annotation or group layer"). */
32
+ layers: string;
33
+ /** Turns a refusal into the host's error type (default LayerOperationError). */
34
+ error?: (message: string) => Error;
35
+ }
36
+ /** The image editor's layer effect tools (see `createLayerEffectTools`). */
11
37
  export declare function createImageEffectTools(controller: ImageEditorController): AgentTool[];
38
+ /**
39
+ * Agent tools for layer effects: `list_layer_effects`, `add_layer_effect`, `update_layer_effect`,
40
+ * `remove_layer_effect`, `set_layer_effects_enabled` and, when the host has a global light to set,
41
+ * `set_global_light`. Each write validates every setting first, is one undo step and returns the
42
+ * layer's effects after the change.
43
+ */
44
+ export declare function createLayerEffectTools(host: LayerEffectsHost, options: LayerEffectToolsOptions): AgentTool[];