@pixerate/editor 0.273.0 → 0.275.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 (97) hide show
  1. package/dist/animation-editor/index.cjs +60 -60
  2. package/dist/animation-editor/index.js +4 -4
  3. package/dist/brushes/index.cjs +102 -74
  4. package/dist/brushes/index.js +34 -6
  5. package/dist/brushes/patch.d.cts +1 -1
  6. package/dist/brushes/patch.d.ts +1 -1
  7. package/dist/brushes/preview.d.cts +3 -0
  8. package/dist/brushes/preview.d.ts +3 -0
  9. package/dist/brushes/profiles.d.cts +2 -0
  10. package/dist/brushes/profiles.d.ts +2 -0
  11. package/dist/brushes/schema.d.cts +4 -0
  12. package/dist/brushes/schema.d.ts +4 -0
  13. package/dist/brushes/types.d.cts +47 -0
  14. package/dist/brushes/types.d.ts +47 -0
  15. package/dist/{brushstrokeRender-5YBCLFDQ.cjs → brushstrokeRender-2RQL46WB.cjs} +15 -15
  16. package/dist/{brushstrokeRender-DZGFU3J4.js → brushstrokeRender-WGY4DZHF.js} +3 -3
  17. package/dist/canvas/index.cjs +13 -13
  18. package/dist/canvas/index.js +1 -1
  19. package/dist/{chunk-2XDNF73E.js → chunk-43XJC3PP.js} +1 -1
  20. package/dist/{chunk-GHGBIAWQ.cjs → chunk-6QNDGMK7.cjs} +263 -45
  21. package/dist/{chunk-2F3YDXCN.js → chunk-75SYKUOT.js} +1 -1
  22. package/dist/{chunk-M3RZOF3G.cjs → chunk-C6VB7CPY.cjs} +1 -1
  23. package/dist/{chunk-N5IMDAHM.cjs → chunk-DHC4E2DU.cjs} +89 -37
  24. package/dist/{chunk-NAHJV3O6.js → chunk-G5TCMKX5.js} +28 -11
  25. package/dist/{chunk-DZVRH63Y.js → chunk-IEEY5RJV.js} +1 -1
  26. package/dist/{chunk-7W2EQQBP.cjs → chunk-JDXWLCXF.cjs} +6 -6
  27. package/dist/{chunk-N3SKPQEH.js → chunk-LMG57L5A.js} +62 -10
  28. package/dist/{chunk-5HP2VSAS.js → chunk-MSWLJI4G.js} +1 -1
  29. package/dist/{chunk-SNAFFCAX.cjs → chunk-OLZXXAER.cjs} +221 -196
  30. package/dist/{chunk-YJANF2BL.cjs → chunk-RAPNRK4R.cjs} +86 -86
  31. package/dist/{chunk-CLB2I2FU.js → chunk-RJGW3RQS.js} +2 -2
  32. package/dist/{chunk-FXVCB6YG.cjs → chunk-T6KNJVBP.cjs} +35 -35
  33. package/dist/{chunk-ZEI7ZEA4.js → chunk-Y2ISSVPH.js} +34 -9
  34. package/dist/{chunk-3JKCREEU.cjs → chunk-Y354ETAE.cjs} +76 -59
  35. package/dist/{chunk-TNLKFW7D.cjs → chunk-YYZC2EQO.cjs} +23 -23
  36. package/dist/{chunk-UXYCY3HP.js → chunk-ZM7IKQ4X.js} +239 -21
  37. package/dist/image-editor/index.cjs +789 -789
  38. package/dist/image-editor/index.js +5 -5
  39. package/dist/paint/index.cjs +2 -2
  40. package/dist/paint/index.js +1 -1
  41. package/dist/paint/wet/world.d.cts +15 -2
  42. package/dist/paint/wet/world.d.ts +15 -2
  43. package/dist/paint-editor/brush-controls.d.cts +7 -0
  44. package/dist/paint-editor/brush-controls.d.ts +7 -0
  45. package/dist/paint-editor/brush-model.d.cts +59 -1
  46. package/dist/paint-editor/brush-model.d.ts +59 -1
  47. package/dist/paint-editor/collaboration.d.cts +6 -1
  48. package/dist/paint-editor/collaboration.d.ts +6 -1
  49. package/dist/paint-editor/controller.d.cts +199 -1
  50. package/dist/paint-editor/controller.d.ts +199 -1
  51. package/dist/paint-editor/dab-stroke.d.cts +3 -0
  52. package/dist/paint-editor/dab-stroke.d.ts +3 -0
  53. package/dist/paint-editor/document.d.cts +13 -3
  54. package/dist/paint-editor/document.d.ts +13 -3
  55. package/dist/paint-editor/engine.d.cts +3 -0
  56. package/dist/paint-editor/engine.d.ts +3 -0
  57. package/dist/paint-editor/evolution-tools.d.cts +48 -0
  58. package/dist/paint-editor/evolution-tools.d.ts +48 -0
  59. package/dist/paint-editor/evolution.d.cts +175 -0
  60. package/dist/paint-editor/evolution.d.ts +175 -0
  61. package/dist/paint-editor/heat.d.cts +156 -0
  62. package/dist/paint-editor/heat.d.ts +156 -0
  63. package/dist/paint-editor/index.cjs +4905 -1525
  64. package/dist/paint-editor/index.d.cts +5 -0
  65. package/dist/paint-editor/index.d.ts +5 -0
  66. package/dist/paint-editor/index.js +10952 -7572
  67. package/dist/paint-editor/mutation-tools.d.cts +13 -0
  68. package/dist/paint-editor/mutation-tools.d.ts +13 -0
  69. package/dist/paint-editor/mutation.d.cts +67 -0
  70. package/dist/paint-editor/mutation.d.ts +67 -0
  71. package/dist/paint-editor/presence.d.cts +7 -1
  72. package/dist/paint-editor/presence.d.ts +7 -1
  73. package/dist/paint-editor/procedural.d.cts +3 -0
  74. package/dist/paint-editor/procedural.d.ts +3 -0
  75. package/dist/paint-editor/stroke.d.cts +32 -2
  76. package/dist/paint-editor/stroke.d.ts +32 -2
  77. package/dist/paint-editor/thick.d.cts +48 -7
  78. package/dist/paint-editor/thick.d.ts +48 -7
  79. package/dist/paint-editor/ui.d.cts +36 -1
  80. package/dist/paint-editor/ui.d.ts +36 -1
  81. package/dist/paint-editor/wet.d.cts +8 -1
  82. package/dist/paint-editor/wet.d.ts +8 -1
  83. package/dist/vector/index.cjs +999 -999
  84. package/dist/vector/index.js +5 -5
  85. package/package.json +1 -1
  86. package/skills/README.md +1 -0
  87. package/skills/pixerate-brushes/SKILL.md +3 -0
  88. package/skills/pixerate-paint-editor/SKILL.md +36 -53
  89. package/skills/pixerate-paint-editor/references/brush-facets.md +3 -0
  90. package/skills/pixerate-paint-editor/references/mutation.md +25 -0
  91. package/skills/pixerate-paint-editor/references/oils.md +8 -1
  92. package/skills/pixerate-paint-editor/references/smart-inks.md +51 -0
  93. package/skills/pixerate-paint-mutation/SKILL.md +76 -0
  94. package/skills/pixerate-paint-mutation/evals/decline-unanswered.json +58 -0
  95. package/skills/pixerate-paint-mutation/evals/dry-ink-answer.json +74 -0
  96. package/skills/pixerate-paint-mutation/evals/wet-wash-answer.json +76 -0
  97. package/skills/pixerate-paint-oil-impasto/SKILL.md +2 -1
@@ -156,7 +156,7 @@ export declare function guideOverlay(controller: PaintEditorController, drag?: {
156
156
  to: Point2;
157
157
  kind: GuideOverlayKind;
158
158
  }>;
159
- export { BRUSH_SLIDERS, brushEngineControls, GHOST_SLIDERS, multiColorSliders, patchBrushValue, type BrushEngineControls, type SliderControl } from './brush-controls.js';
159
+ export { BRUSH_SLIDERS, brushEngineControls, GHOST_SLIDERS, IRIDESCENCE_SLIDERS, multiColorSliders, MUTATION_SLIDERS, patchBrushValue, type BrushEngineControls, type SliderControl } from './brush-controls.js';
160
160
  import type { SliderControl } from './brush-controls.js';
161
161
  export declare const PAPER_SLIDERS: readonly SliderControl[];
162
162
  /** Reads `a.b` from an object. */
@@ -230,6 +230,39 @@ export declare const WET_MEDIUM_LABELS: Readonly<Record<WetMediumKind, string>>;
230
230
  export declare const IMPASTO_TOOL_LABELS: Readonly<Record<ImpastoTool, string>>;
231
231
  /** The light sliders (thick paint and metallic paper). */
232
232
  export declare const LIGHT_SLIDERS: readonly SliderControl[];
233
+ /** The UV blacklight sliders. */
234
+ export declare const UV_LIGHT_SLIDERS: readonly SliderControl[];
235
+ /** The view tilt sliders (thin-film iridescence and specular highlights). */
236
+ export declare const VIEW_TILT_SLIDERS: readonly SliderControl[];
237
+ /**
238
+ * Maps `DeviceOrientationEvent` angles (`beta` front-to-back in degrees, `gamma` left-to-right in
239
+ * degrees) relative to `rest` (default `{ beta: 45, gamma: 0 }`, a tablet held in hand) into a
240
+ * `viewTilt` in `-1..1` (35° reaches full tilt), rounded to 0.01.
241
+ */
242
+ export declare function deviceOrientationToViewTilt(betaOrEvent: number | {
243
+ beta?: number | null;
244
+ gamma?: number | null;
245
+ } | null | undefined, gammaOrRest?: number | {
246
+ beta: number;
247
+ gamma: number;
248
+ } | null | undefined, rest?: {
249
+ beta: number;
250
+ gamma: number;
251
+ }): {
252
+ x: number;
253
+ y: number;
254
+ };
255
+ /**
256
+ * Asks iOS Safari for `DeviceOrientationEvent` permission when `requestPermission` is present
257
+ * (must be called from a user gesture on iOS 13+). Resolves to `'granted'` on browsers that do not
258
+ * gate `deviceorientation` behind a permission prompt, or `'unsupported'` without `DeviceOrientationEvent`.
259
+ */
260
+ export declare function requestDeviceTiltPermission(): Promise<'granted' | 'denied' | 'unsupported'>;
261
+ /**
262
+ * Listens to `deviceorientation` events on `globalThis` and updates `controller.setViewTilt` relative
263
+ * to the first reading's orientation. Returns a cleanup function.
264
+ */
265
+ export declare function startDeviceTilt(controller: PaintEditorController): () => void;
233
266
  /** Labels of the particle kinds and renders. */
234
267
  export declare const PARTICLE_KIND_LABELS: Readonly<Record<ParticleKind, string>>;
235
268
  export declare const PARTICLE_RENDER_LABELS: Readonly<Record<ParticleRender, string>>;
@@ -263,6 +296,8 @@ export declare const PATH_STROKE_TAPERS: ReadonlyArray<{
263
296
  export declare const STROKE_SLIDERS: readonly SliderControl[];
264
297
  /** The sticker panel's sliders for the selected sticker. */
265
298
  export declare const STICKER_SLIDERS: readonly SliderControl[];
299
+ /** The evolution panel's mutation sliders (`0..1`). */
300
+ export declare const EVOLUTION_SLIDERS: readonly SliderControl[];
266
301
  /** Stencils a toolbar can lay with one click, centred on the canvas. */
267
302
  export declare function quickStencil(kind: 'ruler' | 'circle' | 'ellipse-mask' | 'edge-mask', canvas: {
268
303
  width: number;
@@ -32,6 +32,7 @@ import { TiledSurface, type RasterRect } from '../raster/surface.cjs';
32
32
  import type { PaintBrush, WetMediumKind } from './brushes.cjs';
33
33
  import { type PenPoint, type StrokeCopy } from './engine.cjs';
34
34
  import { type PaperGrain as PaperGrainType, type PaperSettings } from './paper.cjs';
35
+ import type { FilmBuffer } from './thick.cjs';
35
36
  /** The paper as the wet simulation reads it. */
36
37
  export declare function wetPaperInput(paper: PaperSettings): WetPaperInput;
37
38
  export interface WetStrokeInit {
@@ -60,6 +61,8 @@ export interface WetStrokeInit {
60
61
  * the water like any pigment.
61
62
  */
62
63
  effect?: EffectPaintPixels | null;
64
+ /** Thin-film iridescence channel for wet brushes with `iridescence`. */
65
+ film?: FilmBuffer | null;
63
66
  /** Simulation steps per second (for ghost fade countdown). */
64
67
  speed?: number;
65
68
  }
@@ -137,7 +140,7 @@ export interface WetEvent {
137
140
  clock: number;
138
141
  /** How many strokes were recorded before it (where it falls between strokes in a replay). */
139
142
  at?: number;
140
- kind: 'dry' | 'tilt' | 'params' | 'flow' | 'wet-paper';
143
+ kind: 'dry' | 'tilt' | 'params' | 'flow' | 'wet-paper' | 'ghost-release' | 'ghost-keep';
141
144
  layerId?: string;
142
145
  data?: unknown;
143
146
  }
@@ -296,6 +299,10 @@ export declare class PaintWetLayers {
296
299
  layerId: string;
297
300
  bounds: RasterRect | null;
298
301
  }>;
302
+ /** Starts the fade countdown of an agent-triggered ghost on `layerId`. */
303
+ releaseGhost(layerId: string, linger?: number): void;
304
+ /** Keeps an unclaimed agent-triggered ghost on `layerId` as ordinary wet paint. */
305
+ keepGhost(layerId: string): void;
299
306
  /** The layer's light paint with all its wet paint dried (`null` without a wet layer or light), without changing anything. */
300
307
  bakedLight(layerId: string): TiledSurface | null;
301
308
  /** The layer's pixels with all its wet paint dried (deterministic), without changing anything. */
@@ -32,6 +32,7 @@ import { TiledSurface, type RasterRect } from '../raster/surface.js';
32
32
  import type { PaintBrush, WetMediumKind } from './brushes.js';
33
33
  import { type PenPoint, type StrokeCopy } from './engine.js';
34
34
  import { type PaperGrain as PaperGrainType, type PaperSettings } from './paper.js';
35
+ import type { FilmBuffer } from './thick.js';
35
36
  /** The paper as the wet simulation reads it. */
36
37
  export declare function wetPaperInput(paper: PaperSettings): WetPaperInput;
37
38
  export interface WetStrokeInit {
@@ -60,6 +61,8 @@ export interface WetStrokeInit {
60
61
  * the water like any pigment.
61
62
  */
62
63
  effect?: EffectPaintPixels | null;
64
+ /** Thin-film iridescence channel for wet brushes with `iridescence`. */
65
+ film?: FilmBuffer | null;
63
66
  /** Simulation steps per second (for ghost fade countdown). */
64
67
  speed?: number;
65
68
  }
@@ -137,7 +140,7 @@ export interface WetEvent {
137
140
  clock: number;
138
141
  /** How many strokes were recorded before it (where it falls between strokes in a replay). */
139
142
  at?: number;
140
- kind: 'dry' | 'tilt' | 'params' | 'flow' | 'wet-paper';
143
+ kind: 'dry' | 'tilt' | 'params' | 'flow' | 'wet-paper' | 'ghost-release' | 'ghost-keep';
141
144
  layerId?: string;
142
145
  data?: unknown;
143
146
  }
@@ -296,6 +299,10 @@ export declare class PaintWetLayers {
296
299
  layerId: string;
297
300
  bounds: RasterRect | null;
298
301
  }>;
302
+ /** Starts the fade countdown of an agent-triggered ghost on `layerId`. */
303
+ releaseGhost(layerId: string, linger?: number): void;
304
+ /** Keeps an unclaimed agent-triggered ghost on `layerId` as ordinary wet paint. */
305
+ keepGhost(layerId: string): void;
299
306
  /** The layer's light paint with all its wet paint dried (`null` without a wet layer or light), without changing anything. */
300
307
  bakedLight(layerId: string): TiledSurface | null;
301
308
  /** The layer's pixels with all its wet paint dried (deterministic), without changing anything. */