@pixerate/editor 0.101.0 → 0.103.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 +2 -0
- package/dist/agent/index.cjs +7 -7
- package/dist/agent/index.cjs.map +1 -1
- package/dist/agent/index.js +7 -7
- package/dist/canvas/index.cjs +3 -3
- package/dist/canvas/index.cjs.map +1 -1
- package/dist/canvas/index.js +4 -4
- package/dist/{chunk-WIR377F6.js → chunk-67FRIOPZ.js} +15 -12
- package/dist/chunk-67FRIOPZ.js.map +1 -0
- package/dist/chunk-6BU5WU4R.cjs +1 -0
- package/dist/chunk-6BU5WU4R.cjs.map +1 -0
- package/dist/{chunk-IB53LVGV.js → chunk-DS7KDKPX.js} +1 -1
- package/dist/chunk-NQLQ2JOI.js +7176 -0
- package/dist/chunk-NQLQ2JOI.js.map +1 -0
- package/dist/{chunk-ZZOTHJ4K.cjs → chunk-PV42JITT.cjs} +1 -1
- package/dist/{chunk-ZZOTHJ4K.cjs.map → chunk-PV42JITT.cjs.map} +1 -1
- package/dist/chunk-VSMM7B3P.cjs +7176 -0
- package/dist/chunk-VSMM7B3P.cjs.map +1 -0
- package/dist/{chunk-WT6ZAWJP.cjs → chunk-WSTEXEKD.cjs} +27 -24
- package/dist/chunk-WSTEXEKD.cjs.map +1 -0
- package/dist/chunk-XYBJKUAU.js +1 -0
- package/dist/chunk-XYBJKUAU.js.map +1 -0
- package/dist/compositor-B1ZrKR89.d.ts +835 -0
- package/dist/compositor-CTMU-B1t.d.cts +835 -0
- package/dist/export-BLpMyCYg.d.ts +3139 -0
- package/dist/export-X9rY79p0.d.cts +3139 -0
- package/dist/homography-CZ-tFjay.d.cts +50 -0
- package/dist/homography-Ctfjoc1b.d.ts +50 -0
- package/dist/image-editor/index.cjs +3889 -8657
- package/dist/image-editor/index.cjs.map +1 -1
- package/dist/image-editor/index.d.cts +224 -2723
- package/dist/image-editor/index.d.ts +224 -2723
- package/dist/image-editor/index.js +3326 -8094
- package/dist/image-editor/index.js.map +1 -1
- package/dist/mixer-DG_9Yu2W.d.ts +282 -0
- package/dist/mixer-DGcH6HLu.d.cts +282 -0
- package/dist/paint/index.cjs +4 -3
- package/dist/paint/index.cjs.map +1 -1
- package/dist/paint/index.d.cts +3 -281
- package/dist/paint/index.d.ts +3 -281
- package/dist/paint/index.js +2 -1
- package/dist/paint-editor/index.cjs +3330 -0
- package/dist/paint-editor/index.cjs.map +1 -0
- package/dist/paint-editor/index.d.cts +1233 -0
- package/dist/paint-editor/index.d.ts +1233 -0
- package/dist/paint-editor/index.js +3330 -0
- package/dist/paint-editor/index.js.map +1 -0
- package/dist/raster/index.cjs +2 -2
- package/dist/raster/index.d.cts +6 -827
- package/dist/raster/index.d.ts +6 -827
- package/dist/raster/index.js +1 -1
- package/dist/{surface-DIA-XatS.d.cts → surface-AfHCH7BR.d.cts} +1 -1
- package/dist/{surface-DIA-XatS.d.ts → surface-AfHCH7BR.d.ts} +1 -1
- package/dist/tools/index.cjs +3 -3
- package/dist/tools/index.cjs.map +1 -1
- package/dist/tools/index.js +3 -3
- package/dist/vector/index.d.cts +2 -1
- package/dist/vector/index.d.ts +2 -1
- package/dist/{warp-B8rAguzs.d.ts → warp-CWHZzE3x.d.ts} +2 -49
- package/dist/{warp-nYs2DPrx.d.cts → warp-D5jz_tN7.d.cts} +2 -49
- package/package.json +6 -1
- package/skills/README.md +1 -0
- package/skills/pixerate-image-editor/SKILL.md +69 -11
- package/skills/pixerate-paint-editor/SKILL.md +162 -0
- package/dist/chunk-WIR377F6.js.map +0 -1
- package/dist/chunk-WT6ZAWJP.cjs.map +0 -1
- /package/dist/{chunk-IB53LVGV.js.map → chunk-DS7KDKPX.js.map} +0 -0
package/dist/canvas/index.js
CHANGED
|
@@ -63,6 +63,10 @@ import {
|
|
|
63
63
|
overlaps,
|
|
64
64
|
placeBeside
|
|
65
65
|
} from "../chunk-VHZCXHS4.js";
|
|
66
|
+
import {
|
|
67
|
+
DEFAULT_ARRANGE_SHORTCUTS,
|
|
68
|
+
matchArrangeShortcut
|
|
69
|
+
} from "../chunk-7DWMJCAT.js";
|
|
66
70
|
import {
|
|
67
71
|
CAPTURE_EXCLUDE_SELECTOR,
|
|
68
72
|
CAPTURE_OVERLAY_SELECTORS,
|
|
@@ -72,10 +76,6 @@ import {
|
|
|
72
76
|
createCaptureToolProvider,
|
|
73
77
|
unionCaptureRects
|
|
74
78
|
} from "../chunk-REOJJIY3.js";
|
|
75
|
-
import {
|
|
76
|
-
DEFAULT_ARRANGE_SHORTCUTS,
|
|
77
|
-
matchArrangeShortcut
|
|
78
|
-
} from "../chunk-7DWMJCAT.js";
|
|
79
79
|
import {
|
|
80
80
|
layoutChart
|
|
81
81
|
} from "../chunk-OEFCLWZ3.js";
|
|
@@ -2170,7 +2170,6 @@ function lerpTile(dst, before, alpha, coverage) {
|
|
|
2170
2170
|
}
|
|
2171
2171
|
var ZERO_TILE = new Uint8ClampedArray(TILE_BYTES);
|
|
2172
2172
|
var isGroup = (l) => l.type === "group";
|
|
2173
|
-
var isPixel = (l) => l.type === "pixel";
|
|
2174
2173
|
var RasterCompositor = class {
|
|
2175
2174
|
constructor(profile = {}, options = {}) {
|
|
2176
2175
|
this.profile = profile;
|
|
@@ -2285,6 +2284,10 @@ var RasterCompositor = class {
|
|
|
2285
2284
|
return this.maskTile(layer, r);
|
|
2286
2285
|
}
|
|
2287
2286
|
// --- Steps -------------------------------------------------------------------
|
|
2287
|
+
/** Pixel layers, and the layer kinds the profile composites like them. */
|
|
2288
|
+
isPixel(l) {
|
|
2289
|
+
return l.type === "pixel" || (this.profile.isPixelLike?.(l) ?? false);
|
|
2290
|
+
}
|
|
2288
2291
|
isFilter(l) {
|
|
2289
2292
|
return this.profile.isFilterLayer?.(l) ?? false;
|
|
2290
2293
|
}
|
|
@@ -2325,7 +2328,7 @@ var RasterCompositor = class {
|
|
|
2325
2328
|
if (key !== void 0) return key;
|
|
2326
2329
|
const mask = layer.mask ? [layer.mask.enabled !== false, layer.mask.density ?? 1, layer.mask.feather ?? 0, layer.mask.defaultValue, layer.mask.source ?? null] : null;
|
|
2327
2330
|
const base = [layer.type, layer.id, layer.visible, layer.opacity, layer.blend, Boolean(layer.clipped), mask];
|
|
2328
|
-
if (isPixel(layer)) base.push(layer.offset?.x ?? 0, layer.offset?.y ?? 0, layer.fillOpacity ?? 1);
|
|
2331
|
+
if (this.isPixel(layer)) base.push(layer.offset?.x ?? 0, layer.offset?.y ?? 0, layer.fillOpacity ?? 1);
|
|
2329
2332
|
if (this.hasEffects(layer)) base.push(effectsFingerprint(layer.effects));
|
|
2330
2333
|
const extra = this.profile.layerKey?.(layer);
|
|
2331
2334
|
if (extra !== void 0) base.push(extra);
|
|
@@ -2489,7 +2492,7 @@ var RasterCompositor = class {
|
|
|
2489
2492
|
plainContentSig(layer, tx, ty) {
|
|
2490
2493
|
const key = "C" + this.propsKey(layer);
|
|
2491
2494
|
if (!layer.visible) return { key, refs: [] };
|
|
2492
|
-
if (!isPixel(layer)) return { key, refs: this.maskRefs(layer, tx, ty, 0, 0) };
|
|
2495
|
+
if (!this.isPixel(layer)) return { key, refs: this.maskRefs(layer, tx, ty, 0, 0) };
|
|
2493
2496
|
const { surface, dx, dy } = this.layerPixels(layer);
|
|
2494
2497
|
const refs = [surface.defaultValue];
|
|
2495
2498
|
const r = { x: tx * TILE - dx, y: ty * TILE - dy, width: TILE, height: TILE };
|
|
@@ -2543,7 +2546,7 @@ var RasterCompositor = class {
|
|
|
2543
2546
|
effectRegion(layer) {
|
|
2544
2547
|
const m = effectsMargin(layer.effects);
|
|
2545
2548
|
const canvas = { x: -m, y: -m, width: this.sources.width + 2 * m, height: this.sources.height + 2 * m };
|
|
2546
|
-
if (!isPixel(layer)) return canvas;
|
|
2549
|
+
if (!this.isPixel(layer)) return canvas;
|
|
2547
2550
|
const { surface, dx, dy } = this.layerPixels(layer);
|
|
2548
2551
|
if (surface.defaultValue !== 0) return canvas;
|
|
2549
2552
|
const b = surface.bounds;
|
|
@@ -2652,7 +2655,7 @@ var RasterCompositor = class {
|
|
|
2652
2655
|
* without filters or a feathered or parametric mask (those spread a change beyond it).
|
|
2653
2656
|
*/
|
|
2654
2657
|
dirtyCoversShape(layer) {
|
|
2655
|
-
if (!isPixel(layer) || this.profile.pixelFilters?.(layer)) return false;
|
|
2658
|
+
if (!this.isPixel(layer) || this.profile.pixelFilters?.(layer)) return false;
|
|
2656
2659
|
const mask = layer.mask;
|
|
2657
2660
|
return !mask || mask.enabled === false || !mask.source && !((mask.feather ?? 0) > 0);
|
|
2658
2661
|
}
|
|
@@ -2711,7 +2714,7 @@ var RasterCompositor = class {
|
|
|
2711
2714
|
maps,
|
|
2712
2715
|
blend: blend2,
|
|
2713
2716
|
opacity: layer.opacity,
|
|
2714
|
-
fillOpacity: isPixel(layer) ? layer.fillOpacity ?? 1 : 1,
|
|
2717
|
+
fillOpacity: this.isPixel(layer) ? layer.fillOpacity ?? 1 : 1,
|
|
2715
2718
|
canvas: { x: 0, y: 0, width: this.sources.width, height: this.sources.height },
|
|
2716
2719
|
ctx: this.effectContext()
|
|
2717
2720
|
});
|
|
@@ -2760,7 +2763,7 @@ var RasterCompositor = class {
|
|
|
2760
2763
|
}
|
|
2761
2764
|
/** RGBA of a content layer over `r` (document space, inside one tile), or `null` when it has nothing there. */
|
|
2762
2765
|
contentTile(layer, r) {
|
|
2763
|
-
if (!isPixel(layer)) return this.profile.contentTile?.(layer, r, this.sources) ?? null;
|
|
2766
|
+
if (!this.isPixel(layer)) return this.profile.contentTile?.(layer, r, this.sources) ?? null;
|
|
2764
2767
|
const { surface, dx, dy, perPixel } = this.layerPixels(layer);
|
|
2765
2768
|
const src = { x: r.x - dx, y: r.y - dy, width: r.width, height: r.height };
|
|
2766
2769
|
const covered = tilesInRect(src).map((t) => surface.getTile(t.tx, t.ty));
|
|
@@ -2832,8 +2835,8 @@ var RasterCompositor = class {
|
|
|
2832
2835
|
maskTile(layer, r) {
|
|
2833
2836
|
const mask = layer.mask;
|
|
2834
2837
|
if (!mask || mask.enabled === false) return null;
|
|
2835
|
-
const ox = isPixel(layer) ? layer.offset?.x ?? 0 : 0;
|
|
2836
|
-
const oy = isPixel(layer) ? layer.offset?.y ?? 0 : 0;
|
|
2838
|
+
const ox = this.isPixel(layer) ? layer.offset?.x ?? 0 : 0;
|
|
2839
|
+
const oy = this.isPixel(layer) ? layer.offset?.y ?? 0 : 0;
|
|
2837
2840
|
const n = r.width * r.height;
|
|
2838
2841
|
const out = new Float32Array(n);
|
|
2839
2842
|
const density = mask.density ?? 1;
|
|
@@ -2894,7 +2897,7 @@ var RasterCompositor = class {
|
|
|
2894
2897
|
}
|
|
2895
2898
|
const content = this.contentTile(step.layer, r);
|
|
2896
2899
|
if (!content) return empty;
|
|
2897
|
-
const fill2 = isPixel(step.layer) ? step.layer.fillOpacity ?? 1 : 1;
|
|
2900
|
+
const fill2 = this.isPixel(step.layer) ? step.layer.fillOpacity ?? 1 : 1;
|
|
2898
2901
|
const blend2 = this.contentBlend(step.layer);
|
|
2899
2902
|
if (!clipped.length) return this.blendOnto(acc, content, empty, blend2, layer.opacity * fill2, coverage);
|
|
2900
2903
|
const buf = new Uint8ClampedArray(acc.length);
|
|
@@ -2944,7 +2947,7 @@ var RasterCompositor = class {
|
|
|
2944
2947
|
}
|
|
2945
2948
|
const content = this.contentTile(c, r);
|
|
2946
2949
|
if (!content) continue;
|
|
2947
|
-
const fill2 = isPixel(c) ? c.fillOpacity ?? 1 : 1;
|
|
2950
|
+
const fill2 = this.isPixel(c) ? c.fillOpacity ?? 1 : 1;
|
|
2948
2951
|
blendAtop(buf, content, this.contentBlend(c), c.opacity * fill2, coverage);
|
|
2949
2952
|
}
|
|
2950
2953
|
flush();
|
|
@@ -4649,4 +4652,4 @@ export {
|
|
|
4649
4652
|
parseDataUrl,
|
|
4650
4653
|
pngDataUrl
|
|
4651
4654
|
};
|
|
4652
|
-
//# sourceMappingURL=chunk-
|
|
4655
|
+
//# sourceMappingURL=chunk-67FRIOPZ.js.map
|