@pixerate/editor 0.107.0 → 0.109.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 (78) hide show
  1. package/THIRD_PARTY_NOTICES.md +4 -0
  2. package/dist/animation/index.cjs +5 -5
  3. package/dist/animation/index.cjs.map +1 -1
  4. package/dist/animation/index.js +9 -9
  5. package/dist/animation-editor/index.cjs +59 -59
  6. package/dist/animation-editor/index.cjs.map +1 -1
  7. package/dist/animation-editor/index.d.cts +2 -1
  8. package/dist/animation-editor/index.d.ts +2 -1
  9. package/dist/animation-editor/index.js +29 -29
  10. package/dist/canvas/index.cjs +27 -27
  11. package/dist/canvas/index.cjs.map +1 -1
  12. package/dist/canvas/index.js +11 -11
  13. package/dist/{chunk-2FGRTYJN.cjs → chunk-477UVMNR.cjs} +3 -3
  14. package/dist/{chunk-2FGRTYJN.cjs.map → chunk-477UVMNR.cjs.map} +1 -1
  15. package/dist/{chunk-T3QZ6S47.cjs → chunk-AZTZRLDI.cjs} +40 -2
  16. package/dist/chunk-AZTZRLDI.cjs.map +1 -0
  17. package/dist/{chunk-63EFQCT5.js → chunk-BLWCAQCW.js} +2879 -3362
  18. package/dist/chunk-BLWCAQCW.js.map +1 -0
  19. package/dist/{chunk-G4BIYE6R.js → chunk-CFMWALBM.js} +39 -1
  20. package/dist/chunk-CFMWALBM.js.map +1 -0
  21. package/dist/{chunk-FRD3FUXI.cjs → chunk-D37BX2ZA.cjs} +2081 -460
  22. package/dist/chunk-D37BX2ZA.cjs.map +1 -0
  23. package/dist/chunk-JLYX4V57.cjs +2001 -0
  24. package/dist/chunk-JLYX4V57.cjs.map +1 -0
  25. package/dist/chunk-KB2YBCVS.js +2001 -0
  26. package/dist/chunk-KB2YBCVS.js.map +1 -0
  27. package/dist/{chunk-SOROZ2BF.js → chunk-RE77QYUF.js} +1938 -317
  28. package/dist/chunk-RE77QYUF.js.map +1 -0
  29. package/dist/{chunk-KANRAHTL.cjs → chunk-W3GXSUSQ.cjs} +2830 -3313
  30. package/dist/chunk-W3GXSUSQ.cjs.map +1 -0
  31. package/dist/{chunk-JK6M6V7G.js → chunk-Z3YWVUWT.js} +4 -4
  32. package/dist/{export-a9bnF7Cl.d.ts → export-BLPLaE6Z.d.ts} +417 -16
  33. package/dist/{export-JGWQEPJn.d.cts → export-DSUc4fQD.d.cts} +417 -16
  34. package/dist/image-editor/index.cjs +1527 -1001
  35. package/dist/image-editor/index.cjs.map +1 -1
  36. package/dist/image-editor/index.d.cts +73 -9
  37. package/dist/image-editor/index.d.ts +73 -9
  38. package/dist/image-editor/index.js +814 -288
  39. package/dist/image-editor/index.js.map +1 -1
  40. package/dist/paint-editor/index.cjs +252 -64
  41. package/dist/paint-editor/index.cjs.map +1 -1
  42. package/dist/paint-editor/index.d.cts +101 -4
  43. package/dist/paint-editor/index.d.ts +101 -4
  44. package/dist/paint-editor/index.js +196 -8
  45. package/dist/paint-editor/index.js.map +1 -1
  46. package/dist/raster/index.cjs +4 -2
  47. package/dist/raster/index.cjs.map +1 -1
  48. package/dist/raster/index.d.cts +3 -129
  49. package/dist/raster/index.d.ts +3 -129
  50. package/dist/raster/index.js +3 -1
  51. package/dist/{compositor-D92URMlm.d.cts → render-C-fO_mes.d.cts} +135 -1
  52. package/dist/{compositor-Kt_M4ruo.d.ts → render-OLIMk_v0.d.ts} +135 -1
  53. package/dist/{svg-vme0PLNo.d.ts → svg-D_cfkhlB.d.cts} +6 -608
  54. package/dist/{svg-Bj1MQFh6.d.cts → svg-wIaKLrU0.d.ts} +6 -608
  55. package/dist/types-DtL_qLFz.d.ts +630 -0
  56. package/dist/types-DyQq-WPY.d.cts +630 -0
  57. package/dist/vector/index.cjs +1080 -1051
  58. package/dist/vector/index.cjs.map +1 -1
  59. package/dist/vector/index.d.cts +268 -7
  60. package/dist/vector/index.d.ts +268 -7
  61. package/dist/vector/index.js +495 -466
  62. package/dist/vector/index.js.map +1 -1
  63. package/dist/video-editor/index.cjs +3 -3
  64. package/dist/video-editor/index.js +2 -2
  65. package/package.json +1 -1
  66. package/skills/pixerate-image-editor/SKILL.md +50 -7
  67. package/skills/pixerate-vector/SKILL.md +35 -5
  68. package/dist/chunk-63EFQCT5.js.map +0 -1
  69. package/dist/chunk-DWGZUSES.cjs +0 -694
  70. package/dist/chunk-DWGZUSES.cjs.map +0 -1
  71. package/dist/chunk-FRD3FUXI.cjs.map +0 -1
  72. package/dist/chunk-G4BIYE6R.js.map +0 -1
  73. package/dist/chunk-KANRAHTL.cjs.map +0 -1
  74. package/dist/chunk-KKREERP2.js +0 -694
  75. package/dist/chunk-KKREERP2.js.map +0 -1
  76. package/dist/chunk-SOROZ2BF.js.map +0 -1
  77. package/dist/chunk-T3QZ6S47.cjs.map +0 -1
  78. /package/dist/{chunk-JK6M6V7G.js.map → chunk-Z3YWVUWT.js.map} +0 -0
@@ -832,4 +832,138 @@ declare class RasterCompositor<L extends CompositorLayer = CompositorLayer, S ex
832
832
  /** Tiles that differ between two surfaces (by tile identity), as tile keys. */
833
833
  declare function changedTiles(a: TiledSurface, b: TiledSurface): TileKey[];
834
834
 
835
- export { TransformTooLargeError as $, type GradientColorStop as A, type BevelContour as B, type CompositorLayer as C, DEFAULT_GLOBAL_LIGHT as D, type EffectPattern as E, type GradientOpacityStop as F, type GroupBlendMode as G, type GradientOverlayEffect as H, type Interpolation as I, type GradientStyle as J, INTERPOLATIONS as K, type LayerLocks as L, type InnerGlowEffect as M, type InnerShadowEffect as N, LAYER_EFFECT_KINDS as O, LayerEffectError as P, MAX_EFFECT_REACH as Q, type RasterLayer as R, MAX_TRANSFORM_PIXELS as S, type OuterGlowEffect as T, type PatternOverlayEffect as U, PatternPlacement as V, PatternTile as W, type ResampleOptions as X, type SatinEffect as Y, type StrokeEffect as Z, type StrokePosition as _, type RasterGroupLayer as a, blendTile as a0, builtinPattern as a1, builtinPatternIds as a2, changedTiles as a3, compositeSurfaceOver as a4, defaultEffectGradient as a5, defaultLayerEffect as a6, effectColorHex as a7, effectReach as a8, effectsFingerprint as a9, type CompositorProfile as aA, type GroupIn as aB, type PixelFilterSpec as aC, type RasterNode as aD, effectsMargin as aa, effectsScale as ab, findLayer as ac, flattenLayers as ad, hasActiveEffects as ae, hashNoise as af, insertLayer as ag, isInterpolation as ah, isLayerEffectKind as ai, isLayerLocked as aj, keysWeight as ak, layerEffectFields as al, layerEffectLabel as am, mapLayer as an, mergeLayerEffect as ao, newEffectId as ap, normalizeLayerEffects as aq, parseEffectColor as ar, reduceSurface as as, scaleLayerEffect as at, transformSurface as au, transformedBounds as av, validateEffectGradient as aw, validateLayerEffect as ax, validateLayerEffects as ay, warpSurface as az, type RasterPixelLayer as b, RasterCompositor as c, type RasterSources as d, type RasterLayerBase as e, type RasterMask as f, type GlobalLight as g, type LayerLocation as h, type LayerEffect as i, type LayerEffects as j, type CompositorOptions as k, type LayerEffectKind as l, type BevelEmbossEffect as m, type BevelStyle as n, type BevelTechnique as o, type BevelTexture as p, type ColorOverlayEffect as q, type CompositeCallOptions as r, type CompositeStats as s, type ContourPoint as t, type DropShadowEffect as u, type EffectContour as v, type EffectFill as w, type EffectGradient as x, type EffectPatternRef as y, type GlowTechnique as z };
835
+ /**
836
+ * CPU renderer for layer effects.
837
+ *
838
+ * Render order, bottom to top (Photoshop's layer-style stack read upwards): drop shadows, outer
839
+ * glows, then the layer itself (content at fill opacity) with pattern, gradient and colour
840
+ * overlays, satin, inner glows, inner shadows, the inside part of strokes and inner bevels on
841
+ * top. The outside part of strokes and outer bevels go beneath the layer, onto the backdrop.
842
+ * Exterior effects blend straight into the backdrop with their own modes; the layer blends with
843
+ * its mode and, in a mode other than Normal, is merged into the backdrop before the interior
844
+ * effects paint over it (Photoshop's "Blend Interior Effects as Group" off). Emboss and pillow
845
+ * emboss then shade the composited result. Layer opacity applies to the whole stack; fill
846
+ * opacity only to the layer's own pixels.
847
+ *
848
+ * Every map depends only on the layer's shape (its alpha after the mask), the effect settings
849
+ * and the global light, never on the backdrop. {@link buildEffectMaps} computes them once over the
850
+ * layer's whole region; {@link compositeLayerEffects} paints any part of that region (a tile) from
851
+ * them, pixel by pixel, so a tiled render equals a whole-image render.
852
+ *
853
+ * Distances: a stroke's outer edge uses the 5 × 5 chamfer below 20 px and an exact Euclidean
854
+ * transform from there (the chamfer's octagonal level sets facet wide strokes); inside strokes and
855
+ * spread / choke keep the chamfer; precise glows and chiselled bevels use the exact transform.
856
+ * Soft falloffs are two box blurs (a tent).
857
+ */
858
+
859
+ interface EffectRect {
860
+ x: number;
861
+ y: number;
862
+ width: number;
863
+ height: number;
864
+ }
865
+ /** Outside stroke width from which the outer edge uses the exact Euclidean transform. */
866
+ declare const STROKE_CHAMFER_MAX = 20;
867
+ /** A contour as a 0..1 LUT (corner points split the spline), or `null` for linear. */
868
+ declare function contourLut(c: EffectContour | undefined): Float32Array | null;
869
+ /** Where a bevel paints: inside the shape, outside it, or both (emboss styles). */
870
+ type BevelPaint = 'inner' | 'outer' | 'both';
871
+ interface EffectContext {
872
+ light: GlobalLight;
873
+ /** A pattern tile by id, or `null` when missing (pattern effects then paint nothing). */
874
+ pattern(id: string): PatternTile | null;
875
+ }
876
+ /** Effect maps of one layer over its region: see {@link buildEffectMaps}. */
877
+ interface EffectMaps {
878
+ /** The region the maps cover (document space). */
879
+ rect: EffectRect;
880
+ /** The enabled effects, Scale Effects applied, in list order. */
881
+ items: LayerEffect[];
882
+ /** Pixel bounds of the shape (alpha above half a step), or `null` when the shape is empty. */
883
+ bounds: EffectRect | null;
884
+ shape: Float32Array;
885
+ /** Per item: the maps it paints through. */
886
+ per: Float32Array[][];
887
+ bevelPaint: (BevelPaint | null)[];
888
+ din: Float32Array | null;
889
+ dout: Float32Array | null;
890
+ doutExact: Float32Array | null;
891
+ /** Frames of gradient strokes by item index. */
892
+ frames: Map<number, EffectRect>;
893
+ /** Approximate size in bytes (cache budgeting). */
894
+ bytes: number;
895
+ }
896
+ /** The enabled effects of `effects` with Scale Effects applied (empty when the master switch is off). */
897
+ declare function activeEffectItems(effects: LayerEffects | undefined | null): LayerEffect[];
898
+ /**
899
+ * Whether every map pixel of `items` depends only on the shape within the effects' margin, so a
900
+ * tile is unchanged while the layer is unchanged within its margin. Not local: anything laid out
901
+ * over the layer's bounds (aligned gradient overlays, gradient strokes, linked patterns) and noise
902
+ * (it speckles any coverage above zero, which picks up the blur's float noise from far away).
903
+ */
904
+ declare function effectsAreLocal(items: readonly LayerEffect[]): boolean;
905
+ /**
906
+ * Builds every map `items` paints through from the layer's alpha `shape` (0..1) over `rect`.
907
+ * `rect` should cover the layer's shape plus the effects' margin.
908
+ */
909
+ declare function buildEffectMaps(items: LayerEffect[], shape: Float32Array, rect: EffectRect, ctx: EffectContext): EffectMaps;
910
+ /**
911
+ * `prev` brought up to date for a shape over `rect` that differs from the one it was built from only
912
+ * inside `changed` (document rects), or `null` when a full {@link buildEffectMaps} is the better
913
+ * deal (the change covers much of the region) or the effects are not local
914
+ * ({@link effectsAreLocal}). `items` must be the ones `prev` was built with, reaching at most
915
+ * `margin` px, and `shapeOver(r)` returns the new shape over `r`.
916
+ *
917
+ * Every map pixel within `margin` of a change, or outside `prev.rect`, is rebuilt from the shape
918
+ * within `margin` of it (a window of the change grown by twice the margin) and pasted in; the rest
919
+ * is kept. A local map pixel depends only on the shape within the margin and the blur sums exactly,
920
+ * so the result paints exactly what a full build over `rect` would. `prev`'s buffers are reused
921
+ * when `rect` is unchanged.
922
+ */
923
+ declare function patchEffectMaps(prev: EffectMaps, items: LayerEffect[], rect: EffectRect, changed: readonly EffectRect[], margin: number, shapeOver: (r: EffectRect) => Float32Array, ctx: EffectContext): EffectMaps | null;
924
+ /** Gradient parameter `t` (0..1) at pixel centre `(x, y)` of a gradient laid out in `frame`. */
925
+ declare function gradientT(style: GradientStyle, angle: number, scale: number, reverse: boolean, offset: {
926
+ x: number;
927
+ y: number;
928
+ }, frame: EffectRect, x: number, y: number): number;
929
+ /**
930
+ * The colours an effect fill paints over `rect`, as straight float RGBA (0..1, `width × height`
931
+ * pixels, row by row): a solid colour, a gradient laid out in `frame` (when aligned with the layer)
932
+ * or `canvas`, or a pattern tiled from `anchor` (when linked). Shape layers paint with it, so their
933
+ * fills and strokes match the overlays of layer effects.
934
+ */
935
+ declare function effectFillColors(fill: EffectFill, rect: EffectRect, frame: EffectRect, canvas: EffectRect, anchor: {
936
+ x: number;
937
+ y: number;
938
+ }, ctx: EffectContext): Float32Array;
939
+ interface EffectCompositeInput {
940
+ /** The accumulator (straight RGBA over `rect`); receives the layer and its effects. */
941
+ backdrop: Uint8ClampedArray;
942
+ /** The layer's pixels over `rect` (straight RGBA, mask applied to alpha, clipped layers applied). */
943
+ content: Uint8ClampedArray;
944
+ rect: EffectRect;
945
+ maps: EffectMaps;
946
+ blend: BlendMode;
947
+ /** Layer opacity: the whole stack. */
948
+ opacity: number;
949
+ /** Fill opacity: the layer's own pixels only. */
950
+ fillOpacity: number;
951
+ /** The canvas (unaligned gradients span it). */
952
+ canvas: EffectRect;
953
+ ctx: EffectContext;
954
+ }
955
+ /** Composites a layer's content and its effects onto `backdrop` in place (see the module comment for the order). */
956
+ declare function compositeLayerEffects(input: EffectCompositeInput): void;
957
+ /**
958
+ * Renders one layer with its effects over a whole region in one pass (no tiles): the reference
959
+ * the per-tile compositor is checked against, and a convenience for one-off renders.
960
+ */
961
+ declare function renderLayerEffects(effects: LayerEffects, layer: {
962
+ content: Uint8ClampedArray;
963
+ rect: EffectRect;
964
+ blend: BlendMode;
965
+ opacity: number;
966
+ fillOpacity?: number;
967
+ }, backdrop: Uint8ClampedArray, canvas: EffectRect, ctx: EffectContext): void;
968
+
969
+ export { type StrokeEffect as $, type EffectRect as A, type BevelContour as B, type CompositorLayer as C, DEFAULT_GLOBAL_LIGHT as D, type EffectFill as E, type GlowTechnique as F, type GroupBlendMode as G, type GradientColorStop as H, type Interpolation as I, type GradientOpacityStop as J, type GradientOverlayEffect as K, type LayerLocks as L, type GradientStyle as M, INTERPOLATIONS as N, type InnerGlowEffect as O, type InnerShadowEffect as P, LAYER_EFFECT_KINDS as Q, type RasterLayer as R, LayerEffectError as S, MAX_EFFECT_REACH as T, MAX_TRANSFORM_PIXELS as U, type OuterGlowEffect as V, type PatternOverlayEffect as W, PatternPlacement as X, PatternTile as Y, type ResampleOptions as Z, type SatinEffect as _, type RasterGroupLayer as a, type StrokePosition as a0, TransformTooLargeError as a1, blendTile as a2, builtinPattern as a3, builtinPatternIds as a4, changedTiles as a5, compositeSurfaceOver as a6, defaultEffectGradient as a7, defaultLayerEffect as a8, effectColorHex as a9, validateLayerEffect as aA, validateLayerEffects as aB, warpSurface as aC, type CompositorProfile as aD, type EffectCompositeInput as aE, type EffectMaps as aF, type GroupIn as aG, type PixelFilterSpec as aH, type RasterNode as aI, STROKE_CHAMFER_MAX as aJ, activeEffectItems as aK, buildEffectMaps as aL, compositeLayerEffects as aM, contourLut as aN, effectFillColors as aO, effectsAreLocal as aP, gradientT as aQ, patchEffectMaps as aR, effectReach as aa, effectsFingerprint as ab, effectsMargin as ac, effectsScale as ad, findLayer as ae, flattenLayers as af, hasActiveEffects as ag, hashNoise as ah, insertLayer as ai, isInterpolation as aj, isLayerEffectKind as ak, isLayerLocked as al, keysWeight as am, layerEffectFields as an, layerEffectLabel as ao, mapLayer as ap, mergeLayerEffect as aq, newEffectId as ar, normalizeLayerEffects as as, parseEffectColor as at, reduceSurface as au, renderLayerEffects as av, scaleLayerEffect as aw, transformSurface as ax, transformedBounds as ay, validateEffectGradient as az, type RasterPixelLayer as b, RasterCompositor as c, type RasterSources as d, type RasterLayerBase as e, type RasterMask as f, type GlobalLight as g, type EffectPattern as h, type LayerLocation as i, type LayerEffect as j, type LayerEffects as k, type CompositorOptions as l, type LayerEffectKind as m, type EffectContext as n, type BevelEmbossEffect as o, type BevelStyle as p, type BevelTechnique as q, type BevelTexture as r, type ColorOverlayEffect as s, type CompositeCallOptions as t, type CompositeStats as u, type ContourPoint as v, type DropShadowEffect as w, type EffectContour as x, type EffectGradient as y, type EffectPatternRef as z };