@pixerate/editor 0.132.0 → 0.134.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/dist/animation-editor/index.cjs +55 -55
- package/dist/animation-editor/index.d.cts +4 -4
- package/dist/animation-editor/index.d.ts +4 -4
- package/dist/animation-editor/index.js +2 -2
- package/dist/{bezier-oCBfrGDG.d.cts → bezier-J8i4uqSH.d.cts} +1 -1
- package/dist/{bezier-0IHDCvv_.d.ts → bezier-lNEOp0Jx.d.ts} +1 -1
- package/dist/canvas/index.d.cts +7 -7
- package/dist/canvas/index.d.ts +7 -7
- package/dist/{chunk-MZXQTKUM.cjs → chunk-24ATT2PE.cjs} +10 -6
- package/dist/chunk-24ATT2PE.cjs.map +1 -0
- package/dist/{chunk-AHUYMDYW.js → chunk-2HC4DRF4.js} +10 -6
- package/dist/chunk-2HC4DRF4.js.map +1 -0
- package/dist/{chunk-YRZ6NVE3.js → chunk-6CTZAGZ2.js} +235 -4
- package/dist/chunk-6CTZAGZ2.js.map +1 -0
- package/dist/{chunk-ECVI5QRE.js → chunk-7RJ6P7MI.js} +2 -2
- package/dist/{chunk-G5FX56KX.js → chunk-ESIWZMMK.js} +51 -11
- package/dist/chunk-ESIWZMMK.js.map +1 -0
- package/dist/{chunk-IEYXYMRQ.js → chunk-HHTCDFZC.js} +99 -5
- package/dist/chunk-HHTCDFZC.js.map +1 -0
- package/dist/{chunk-W6M7C7R3.cjs → chunk-NVTHUPJ6.cjs} +236 -5
- package/dist/chunk-NVTHUPJ6.cjs.map +1 -0
- package/dist/{chunk-OYPJGGF3.cjs → chunk-T6TV6HY6.cjs} +36 -36
- package/dist/{chunk-OYPJGGF3.cjs.map → chunk-T6TV6HY6.cjs.map} +1 -1
- package/dist/{chunk-55UEZIU4.cjs → chunk-YAFS2QFZ.cjs} +231 -191
- package/dist/chunk-YAFS2QFZ.cjs.map +1 -0
- package/dist/{chunk-YYJKIESX.cjs → chunk-Z2H7KECK.cjs} +153 -59
- package/dist/chunk-Z2H7KECK.cjs.map +1 -0
- package/dist/effects/index.d.cts +4 -4
- package/dist/effects/index.d.ts +4 -4
- package/dist/{export-D-gkjBkB.d.cts → export-BGdT02aL.d.cts} +10 -10
- package/dist/{export-CfAogLEr.d.cts → export-DMeG6E06.d.ts} +1 -1
- package/dist/{export-ByJvAvR7.d.ts → export-Dng22YB8.d.ts} +10 -10
- package/dist/{export-Crl82sbE.d.ts → export-KzubBKo7.d.cts} +1 -1
- package/dist/{helpers-BCd2-PAR.d.ts → helpers-Coa4e2j_.d.ts} +35 -1
- package/dist/{helpers-CoIeXQnW.d.cts → helpers-DHl28yLO.d.cts} +35 -1
- package/dist/image-editor/index.cjs +983 -874
- package/dist/image-editor/index.cjs.map +1 -1
- package/dist/image-editor/index.d.cts +32 -13
- package/dist/image-editor/index.d.ts +32 -13
- package/dist/image-editor/index.js +124 -15
- package/dist/image-editor/index.js.map +1 -1
- package/dist/{opentype-BDahNRTe.d.cts → opentype-BWR7Qv8W.d.cts} +1 -1
- package/dist/{opentype-BQFEvy-t.d.ts → opentype-Dfcx6wFx.d.ts} +1 -1
- package/dist/paint/index.cjs +8 -2
- package/dist/paint/index.cjs.map +1 -1
- package/dist/paint/index.d.cts +14 -3
- package/dist/paint/index.d.ts +14 -3
- package/dist/paint/index.js +7 -1
- package/dist/paint-editor/index.cjs +78 -78
- package/dist/paint-editor/index.d.cts +7 -7
- package/dist/paint-editor/index.d.ts +7 -7
- package/dist/paint-editor/index.js +3 -3
- package/dist/{pathfinder-DaVdT8jq.d.ts → pathfinder-Celbi3e6.d.ts} +1 -1
- package/dist/{pathfinder-01ZgAwqV.d.cts → pathfinder-D8KQ6blQ.d.cts} +1 -1
- package/dist/{pool-D2A3WTt9.d.ts → pool-8JZGWHvR.d.ts} +1 -1
- package/dist/{pool-D6a45MoE.d.cts → pool-BfuxBKTd.d.cts} +1 -1
- package/dist/{rand-pQQ2sJTk.d.ts → rand-BaqEOs1Y.d.ts} +17 -4
- package/dist/{rand-DTXAssW1.d.cts → rand-DdpFzCo6.d.cts} +17 -4
- package/dist/raster/index.cjs +2 -2
- package/dist/raster/index.d.cts +4 -4
- package/dist/raster/index.d.ts +4 -4
- package/dist/raster/index.js +1 -1
- package/dist/{svg-DELNVerw.d.ts → svg-CxxqG3_W.d.ts} +2 -2
- package/dist/{svg-CcDz7Zq2.d.cts → svg-pwXWq6s2.d.cts} +2 -2
- package/dist/{tools-BFvkFnRj.d.cts → tools-3EBjR91b.d.cts} +1 -1
- package/dist/{tools-D7ws-OKL.d.ts → tools-y1M6O3UT.d.ts} +1 -1
- package/dist/vector/index.cjs +1642 -1046
- package/dist/vector/index.cjs.map +1 -1
- package/dist/vector/index.d.cts +275 -93
- package/dist/vector/index.d.ts +275 -93
- package/dist/vector/index.js +607 -11
- package/dist/vector/index.js.map +1 -1
- package/dist/video-editor/index.d.cts +4 -4
- package/dist/video-editor/index.d.ts +4 -4
- package/dist/{warp-2N9wkOkL.d.ts → warp-C1gwu2G_.d.ts} +1 -1
- package/dist/{warp-DErXW5rz.d.cts → warp-Ceqdz7kj.d.cts} +1 -1
- package/package.json +1 -1
- package/skills/pixerate-image-editor/SKILL.md +1 -1
- package/skills/pixerate-image-editor/references/retouching.md +3 -2
- package/skills/pixerate-vector/SKILL.md +12 -53
- package/skills/pixerate-vector/references/pitfalls.md +62 -0
- package/dist/chunk-55UEZIU4.cjs.map +0 -1
- package/dist/chunk-AHUYMDYW.js.map +0 -1
- package/dist/chunk-G5FX56KX.js.map +0 -1
- package/dist/chunk-IEYXYMRQ.js.map +0 -1
- package/dist/chunk-MZXQTKUM.cjs.map +0 -1
- package/dist/chunk-W6M7C7R3.cjs.map +0 -1
- package/dist/chunk-YRZ6NVE3.js.map +0 -1
- package/dist/chunk-YYJKIESX.cjs.map +0 -1
- /package/dist/{chunk-ECVI5QRE.js.map → chunk-7RJ6P7MI.js.map} +0 -0
|
@@ -37,7 +37,7 @@ var _chunk2YQONY6Gcjs = require('./chunk-2YQONY6G.cjs');
|
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
|
|
40
|
-
var
|
|
40
|
+
var _chunk24ATT2PEcjs = require('./chunk-24ATT2PE.cjs');
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
|
|
@@ -66,8 +66,6 @@ var _chunkMUUXNRU4cjs = require('./chunk-MUUXNRU4.cjs');
|
|
|
66
66
|
|
|
67
67
|
|
|
68
68
|
|
|
69
|
-
|
|
70
|
-
|
|
71
69
|
|
|
72
70
|
|
|
73
71
|
var _chunkJ5BA3BQ6cjs = require('./chunk-J5BA3BQ6.cjs');
|
|
@@ -125,7 +123,7 @@ var _chunk643B2HKCcjs = require('./chunk-643B2HKC.cjs');
|
|
|
125
123
|
|
|
126
124
|
|
|
127
125
|
|
|
128
|
-
var
|
|
126
|
+
var _chunkZ2H7KECKcjs = require('./chunk-Z2H7KECK.cjs');
|
|
129
127
|
|
|
130
128
|
|
|
131
129
|
|
|
@@ -1144,7 +1142,7 @@ function smoothCoverage(m, w, h, r) {
|
|
|
1144
1142
|
return src;
|
|
1145
1143
|
}
|
|
1146
1144
|
function featherCoverage(m, w, h, radius) {
|
|
1147
|
-
const out =
|
|
1145
|
+
const out = _chunk24ATT2PEcjs.gaussianBlur.call(void 0, m, w, h, Number.isFinite(radius) ? Math.max(0, radius) : 0, "zero");
|
|
1148
1146
|
for (let i = 0; i < out.length; i++) if (Math.abs(out[i]) < 1e-7) out[i] = 0;
|
|
1149
1147
|
return out;
|
|
1150
1148
|
}
|
|
@@ -1292,7 +1290,7 @@ function layerMaskCoverage(mask) {
|
|
|
1292
1290
|
let v = new Float32Array(sel.data.length);
|
|
1293
1291
|
for (let i = 0; i < v.length; i++) v[i] = sel.data[i] / 255;
|
|
1294
1292
|
const feather = _nullishCoalesce(mask.feather, () => ( 0));
|
|
1295
|
-
if (feather > 0) v =
|
|
1293
|
+
if (feather > 0) v = _chunk24ATT2PEcjs.gaussianBlur.call(void 0, v, mask.width, mask.height, feather, "clamp");
|
|
1296
1294
|
const density = _nullishCoalesce(mask.density, () => ( 1));
|
|
1297
1295
|
if (density !== 1) for (let i = 0; i < v.length; i++) v[i] = 1 - density * (1 - v[i]);
|
|
1298
1296
|
return v;
|
|
@@ -1535,7 +1533,7 @@ function normalizeAdjustmentLayers(raw) {
|
|
|
1535
1533
|
return out;
|
|
1536
1534
|
}
|
|
1537
1535
|
function curveLutFromLevels(points) {
|
|
1538
|
-
return
|
|
1536
|
+
return _chunk24ATT2PEcjs.curveLut.call(void 0, points.map((p) => ({ input: p.input / 255, output: p.output / 255 })));
|
|
1539
1537
|
}
|
|
1540
1538
|
var toUnitLevels = (c) => ({
|
|
1541
1539
|
inBlack: c.inBlack / 255,
|
|
@@ -2085,6 +2083,52 @@ function applyLegacyAdjustments(imageData, adjustments) {
|
|
|
2085
2083
|
}
|
|
2086
2084
|
}
|
|
2087
2085
|
}
|
|
2086
|
+
function applyLegacyFloat(data, adjustments, linear) {
|
|
2087
|
+
const { brightness, contrast, saturation, exposure, temperature } = adjustments;
|
|
2088
|
+
if (!brightness && !contrast && !saturation && !exposure && !temperature) return;
|
|
2089
|
+
const k = 259 * (contrast + 255) / (255 * (259 - contrast));
|
|
2090
|
+
const ex = Math.pow(2, exposure / 50);
|
|
2091
|
+
const sat = 1 + saturation / 100;
|
|
2092
|
+
const temp = temperature * 0.8;
|
|
2093
|
+
const cl = (v) => v < 0 ? 0 : v > 255 ? 255 : v;
|
|
2094
|
+
const enc = (v) => v <= 0 ? 0 : v >= 1 ? 1 : v <= 31308e-7 ? v * 12.92 : 1.055 * Math.pow(v, 1 / 2.4) - 0.055;
|
|
2095
|
+
const dec = (v) => v <= 0.04045 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4);
|
|
2096
|
+
for (let i = 0; i < data.length; i += 4) {
|
|
2097
|
+
if (!(data[i + 3] > 0)) continue;
|
|
2098
|
+
let r = (linear ? enc(data[i]) : data[i]) * 255;
|
|
2099
|
+
let g = (linear ? enc(data[i + 1]) : data[i + 1]) * 255;
|
|
2100
|
+
let b = (linear ? enc(data[i + 2]) : data[i + 2]) * 255;
|
|
2101
|
+
if (exposure) {
|
|
2102
|
+
r = cl(r * ex);
|
|
2103
|
+
g = cl(g * ex);
|
|
2104
|
+
b = cl(b * ex);
|
|
2105
|
+
}
|
|
2106
|
+
if (brightness) {
|
|
2107
|
+
const o = brightness * 2.55;
|
|
2108
|
+
r = cl(r + o);
|
|
2109
|
+
g = cl(g + o);
|
|
2110
|
+
b = cl(b + o);
|
|
2111
|
+
}
|
|
2112
|
+
if (contrast) {
|
|
2113
|
+
r = cl(k * (r - 128) + 128);
|
|
2114
|
+
g = cl(k * (g - 128) + 128);
|
|
2115
|
+
b = cl(k * (b - 128) + 128);
|
|
2116
|
+
}
|
|
2117
|
+
if (saturation) {
|
|
2118
|
+
const l = 0.2989 * r + 0.587 * g + 0.114 * b;
|
|
2119
|
+
r = cl(l + (r - l) * sat);
|
|
2120
|
+
g = cl(l + (g - l) * sat);
|
|
2121
|
+
b = cl(l + (b - l) * sat);
|
|
2122
|
+
}
|
|
2123
|
+
if (temperature) {
|
|
2124
|
+
r = cl(r + temp);
|
|
2125
|
+
b = cl(b - temp);
|
|
2126
|
+
}
|
|
2127
|
+
data[i] = linear ? dec(r / 255) : r / 255;
|
|
2128
|
+
data[i + 1] = linear ? dec(g / 255) : g / 255;
|
|
2129
|
+
data[i + 2] = linear ? dec(b / 255) : b / 255;
|
|
2130
|
+
}
|
|
2131
|
+
}
|
|
2088
2132
|
var DECODE_LUT = (() => {
|
|
2089
2133
|
const lut = new Float32Array(256);
|
|
2090
2134
|
for (let i = 0; i < 256; i++) lut[i] = srgbToLinear(i / 255);
|
|
@@ -2350,7 +2394,7 @@ function newLayerId(prefix = "layer") {
|
|
|
2350
2394
|
return `${prefix}_${Date.now().toString(36)}_${(++idCounter).toString(36)}`;
|
|
2351
2395
|
}
|
|
2352
2396
|
function pixelLayers(layers) {
|
|
2353
|
-
return
|
|
2397
|
+
return _chunk24ATT2PEcjs.flattenLayers.call(void 0, layers).filter((l) => l.type === "pixel");
|
|
2354
2398
|
}
|
|
2355
2399
|
function developFilter(layer) {
|
|
2356
2400
|
return _optionalChain([layer, 'access', _10 => _10.filters, 'optionalAccess', _11 => _11.find, 'call', _12 => _12((f) => f.kind === "develop")]);
|
|
@@ -2381,10 +2425,10 @@ function isRenderedLayer(layer) {
|
|
|
2381
2425
|
return layer.type === "smart" || layer.type === "shape" || layer.type === "type";
|
|
2382
2426
|
}
|
|
2383
2427
|
function shapeLayers(layers) {
|
|
2384
|
-
return
|
|
2428
|
+
return _chunk24ATT2PEcjs.flattenLayers.call(void 0, layers).filter((l) => l.type === "shape");
|
|
2385
2429
|
}
|
|
2386
2430
|
function smartObjectLayers(layers) {
|
|
2387
|
-
return
|
|
2431
|
+
return _chunk24ATT2PEcjs.flattenLayers.call(void 0, layers).filter((l) => l.type === "smart");
|
|
2388
2432
|
}
|
|
2389
2433
|
|
|
2390
2434
|
// src/image-editor/layers/compositor.ts
|
|
@@ -2454,12 +2498,7 @@ function runLayerFiltersFloat(data, width, height, filters, linear) {
|
|
|
2454
2498
|
else if (f.kind === "develop") {
|
|
2455
2499
|
const adj = developAdjustments(f);
|
|
2456
2500
|
if (normalizeProcessVersion(adj.process) === LATEST_PROCESS_VERSION) applyProcess2Float(data, adj, linear);
|
|
2457
|
-
else
|
|
2458
|
-
const bytes = linear ? _chunkJ5BA3BQ6cjs.to8From32.call(void 0, data, 4) : Uint8ClampedArray.from(data, (v) => v * 255);
|
|
2459
|
-
applyLegacyAdjustments({ data: bytes }, adj);
|
|
2460
|
-
if (linear) data.set(_chunkJ5BA3BQ6cjs.to32From8.call(void 0, bytes, 4));
|
|
2461
|
-
else for (let i = 0; i < data.length; i++) data[i] = bytes[i] / 255;
|
|
2462
|
-
}
|
|
2501
|
+
else applyLegacyFloat(data, adj, linear);
|
|
2463
2502
|
}
|
|
2464
2503
|
}
|
|
2465
2504
|
}
|
|
@@ -2511,13 +2550,13 @@ var PHOTO_PROFILE = {
|
|
|
2511
2550
|
return v;
|
|
2512
2551
|
}
|
|
2513
2552
|
};
|
|
2514
|
-
var LayerCompositor = class extends
|
|
2553
|
+
var LayerCompositor = class extends _chunk24ATT2PEcjs.RasterCompositor {
|
|
2515
2554
|
constructor(options = {}) {
|
|
2516
2555
|
super(PHOTO_PROFILE, options);
|
|
2517
2556
|
}
|
|
2518
2557
|
};
|
|
2519
2558
|
function compositeDeep(layers, rect, sources, depth) {
|
|
2520
|
-
const deep = new (0,
|
|
2559
|
+
const deep = new (0, _chunk24ATT2PEcjs.DeepCompositor)(new LayerCompositor(), PHOTO_PROFILE, {
|
|
2521
2560
|
applyFilterRunDeep: (run, acc, _r, masks) => applyAdjustmentLayersFloat(acc, run.map(adjustmentNodeAsLayer), masks),
|
|
2522
2561
|
pixelFiltersDeep: (l) => {
|
|
2523
2562
|
if (l.type !== "pixel") return null;
|
|
@@ -2873,47 +2912,47 @@ var fail = (message) => {
|
|
|
2873
2912
|
throw new LayerOperationError(message);
|
|
2874
2913
|
};
|
|
2875
2914
|
function requireLayer(layers, id) {
|
|
2876
|
-
const loc =
|
|
2915
|
+
const loc = _chunk24ATT2PEcjs.findLayer.call(void 0, layers, id);
|
|
2877
2916
|
if (!loc) {
|
|
2878
|
-
const ids =
|
|
2917
|
+
const ids = _chunk24ATT2PEcjs.flattenLayers.call(void 0, layers).map((l) => l.id);
|
|
2879
2918
|
fail(`Unknown layer "${id}". ${ids.length ? `Layers: ${ids.join(", ")}.` : "The document has no layers."} Call list_layers for ids.`);
|
|
2880
2919
|
}
|
|
2881
2920
|
return loc;
|
|
2882
2921
|
}
|
|
2883
2922
|
function requireUnlocked(layer, what, action) {
|
|
2884
|
-
if (
|
|
2885
|
-
if (what !== "all" &&
|
|
2923
|
+
if (_chunk24ATT2PEcjs.isLayerLocked.call(void 0, layer, "all")) fail(`Layer "${layer.name || layer.id}" is locked (all); unlock it before you ${action}.`);
|
|
2924
|
+
if (what !== "all" && _chunk24ATT2PEcjs.isLayerLocked.call(void 0, layer, what)) fail(`Layer "${layer.name || layer.id}" has its ${what} locked; unlock it before you ${action}.`);
|
|
2886
2925
|
}
|
|
2887
2926
|
function placeLayer(layers, layer, placement = {}, defaultIndex) {
|
|
2888
2927
|
const given = [placement.aboveId, placement.belowId, placement.parentId].filter((v) => v !== void 0).length;
|
|
2889
2928
|
if (given > 1) fail("Give only one of aboveId, belowId and parentId.");
|
|
2890
2929
|
if (placement.aboveId || placement.belowId) {
|
|
2891
2930
|
const ref = requireLayer(layers, _nullishCoalesce(placement.aboveId, () => ( placement.belowId)));
|
|
2892
|
-
return
|
|
2931
|
+
return _chunk24ATT2PEcjs.insertLayer.call(void 0, layers, layer, _nullishCoalesce(_optionalChain([ref, 'access', _21 => _21.parent, 'optionalAccess', _22 => _22.id]), () => ( null)), ref.index + (placement.aboveId ? 1 : 0));
|
|
2893
2932
|
}
|
|
2894
2933
|
if (placement.parentId) {
|
|
2895
2934
|
const ref = requireLayer(layers, placement.parentId);
|
|
2896
2935
|
if (ref.layer.type !== "group") fail(`Layer "${placement.parentId}" is not a group; parentId must be a group id.`);
|
|
2897
|
-
return
|
|
2936
|
+
return _chunk24ATT2PEcjs.insertLayer.call(void 0, layers, layer, ref.layer.id, placement.index);
|
|
2898
2937
|
}
|
|
2899
|
-
return
|
|
2938
|
+
return _chunk24ATT2PEcjs.insertLayer.call(void 0, layers, layer, null, _nullishCoalesce(placement.index, () => ( defaultIndex)));
|
|
2900
2939
|
}
|
|
2901
2940
|
function removeLayer(layers, id) {
|
|
2902
2941
|
const loc = requireLayer(layers, id);
|
|
2903
2942
|
requireUnlocked(loc.layer, "all", "delete it");
|
|
2904
|
-
return
|
|
2943
|
+
return _chunk24ATT2PEcjs.mapLayer.call(void 0, layers, id, () => null);
|
|
2905
2944
|
}
|
|
2906
2945
|
function moveLayer(layers, id, placement) {
|
|
2907
2946
|
const loc = requireLayer(layers, id);
|
|
2908
2947
|
requireUnlocked(loc.layer, "all", "move it");
|
|
2909
2948
|
const target = _nullishCoalesce(_nullishCoalesce(placement.aboveId, () => ( placement.belowId)), () => ( placement.parentId));
|
|
2910
2949
|
if (target === id) fail("A layer cannot be placed relative to itself.");
|
|
2911
|
-
if (target && loc.layer.type === "group" &&
|
|
2950
|
+
if (target && loc.layer.type === "group" && _chunk24ATT2PEcjs.flattenLayers.call(void 0, loc.layer.children).some((l) => l.id === target)) {
|
|
2912
2951
|
fail(`Group "${id}" cannot be moved into its own child "${target}".`);
|
|
2913
2952
|
}
|
|
2914
2953
|
if (target) requireLayer(layers, target);
|
|
2915
2954
|
if (!target && placement.index === void 0) fail("Give aboveId, belowId, parentId or index.");
|
|
2916
|
-
const without =
|
|
2955
|
+
const without = _chunk24ATT2PEcjs.mapLayer.call(void 0, layers, id, () => null);
|
|
2917
2956
|
return placeLayer(without, loc.layer, placement);
|
|
2918
2957
|
}
|
|
2919
2958
|
function withNewIds(layer) {
|
|
@@ -2932,7 +2971,7 @@ function duplicateLayer(layers, id, name) {
|
|
|
2932
2971
|
const copy = withNewIds(loc.layer);
|
|
2933
2972
|
copy.name = _nullishCoalesce(name, () => ( `${loc.layer.name || "Layer"} copy`));
|
|
2934
2973
|
delete copy.locks;
|
|
2935
|
-
return { layers:
|
|
2974
|
+
return { layers: _chunk24ATT2PEcjs.insertLayer.call(void 0, layers, copy, _nullishCoalesce(_optionalChain([loc, 'access', _25 => _25.parent, 'optionalAccess', _26 => _26.id]), () => ( null)), loc.index + 1), id: copy.id };
|
|
2936
2975
|
}
|
|
2937
2976
|
function setLayerProperties(layers, id, props) {
|
|
2938
2977
|
const loc = requireLayer(layers, id);
|
|
@@ -2979,7 +3018,7 @@ function setLayerProperties(layers, id, props) {
|
|
|
2979
3018
|
if (props.collapsed) g.collapsed = true;
|
|
2980
3019
|
else delete g.collapsed;
|
|
2981
3020
|
}
|
|
2982
|
-
return
|
|
3021
|
+
return _chunk24ATT2PEcjs.mapLayer.call(void 0, layers, id, () => next);
|
|
2983
3022
|
}
|
|
2984
3023
|
function groupLayers(layers, ids, name = "Group") {
|
|
2985
3024
|
if (!ids.length) fail("Give at least one layer id to group.");
|
|
@@ -3008,17 +3047,17 @@ function groupLayers(layers, ids, name = "Group") {
|
|
|
3008
3047
|
group.children[0] = c;
|
|
3009
3048
|
}
|
|
3010
3049
|
let out = layers;
|
|
3011
|
-
for (const l of ordered) out =
|
|
3012
|
-
return { layers:
|
|
3050
|
+
for (const l of ordered) out = _chunk24ATT2PEcjs.mapLayer.call(void 0, out, l.layer.id, () => null);
|
|
3051
|
+
return { layers: _chunk24ATT2PEcjs.insertLayer.call(void 0, out, group, parent, top - below), id: group.id };
|
|
3013
3052
|
}
|
|
3014
3053
|
function ungroupLayer(layers, id) {
|
|
3015
3054
|
const loc = requireLayer(layers, id);
|
|
3016
3055
|
if (loc.layer.type !== "group") fail(`Layer "${id}" is not a group.`);
|
|
3017
3056
|
requireUnlocked(loc.layer, "all", "ungroup it");
|
|
3018
3057
|
const group = loc.layer;
|
|
3019
|
-
let out =
|
|
3058
|
+
let out = _chunk24ATT2PEcjs.mapLayer.call(void 0, layers, id, () => null);
|
|
3020
3059
|
group.children.forEach((c, i) => {
|
|
3021
|
-
out =
|
|
3060
|
+
out = _chunk24ATT2PEcjs.insertLayer.call(void 0, out, c, _nullishCoalesce(_optionalChain([loc, 'access', _35 => _35.parent, 'optionalAccess', _36 => _36.id]), () => ( null)), loc.index + i);
|
|
3022
3061
|
});
|
|
3023
3062
|
return { layers: out, ids: group.children.map((c) => c.id) };
|
|
3024
3063
|
}
|
|
@@ -3033,12 +3072,12 @@ function offsetLayer(layers, id, offset) {
|
|
|
3033
3072
|
if (mask && mask.linked === false && !mask.source) {
|
|
3034
3073
|
next.mask = { ...mask, surface: _chunkJ5BA3BQ6cjs.translateSurface.call(void 0, mask.surface, layer.offset.x - next.offset.x, layer.offset.y - next.offset.y) };
|
|
3035
3074
|
}
|
|
3036
|
-
return
|
|
3075
|
+
return _chunk24ATT2PEcjs.mapLayer.call(void 0, layers, id, () => next);
|
|
3037
3076
|
}
|
|
3038
3077
|
function setLayerMask(layers, id, mask) {
|
|
3039
3078
|
const loc = requireLayer(layers, id);
|
|
3040
3079
|
requireUnlocked(loc.layer, "all", "change its mask");
|
|
3041
|
-
return
|
|
3080
|
+
return _chunk24ATT2PEcjs.mapLayer.call(void 0, layers, id, (l) => {
|
|
3042
3081
|
const next = { ...l };
|
|
3043
3082
|
if (mask) next.mask = mask;
|
|
3044
3083
|
else delete next.mask;
|
|
@@ -3077,7 +3116,7 @@ function requirePixelLayer(layers, id) {
|
|
|
3077
3116
|
function addLayerFilter(layers, id, filter) {
|
|
3078
3117
|
const layer = requirePixelLayer(layers, id);
|
|
3079
3118
|
if (_optionalChain([layer, 'access', _37 => _37.filters, 'optionalAccess', _38 => _38.some, 'call', _39 => _39((f) => f.kind === filter.kind)])) fail(`Layer "${id}" already has a ${filter.kind} filter; change it with update_layer_filter.`);
|
|
3080
|
-
return
|
|
3119
|
+
return _chunk24ATT2PEcjs.mapLayer.call(void 0, layers, id, () => ({ ...layer, filters: [..._nullishCoalesce(layer.filters, () => ( [])), filter] }));
|
|
3081
3120
|
}
|
|
3082
3121
|
function updateLayerFilter(layers, id, filterId, changes) {
|
|
3083
3122
|
const layer = requirePixelLayer(layers, id);
|
|
@@ -3088,7 +3127,7 @@ function updateLayerFilter(layers, id, filterId, changes) {
|
|
|
3088
3127
|
const merged2 = normalizeFilter({ ...current, ...changes, kind: current.kind }, current.id);
|
|
3089
3128
|
const filters = [...layer.filters];
|
|
3090
3129
|
filters[i] = merged2;
|
|
3091
|
-
return
|
|
3130
|
+
return _chunk24ATT2PEcjs.mapLayer.call(void 0, layers, id, () => ({ ...layer, filters }));
|
|
3092
3131
|
}
|
|
3093
3132
|
function removeLayerFilter(layers, id, filterId) {
|
|
3094
3133
|
const layer = requirePixelLayer(layers, id);
|
|
@@ -3097,7 +3136,7 @@ function removeLayerFilter(layers, id, filterId) {
|
|
|
3097
3136
|
const next = { ...layer };
|
|
3098
3137
|
if (filters.length) next.filters = filters;
|
|
3099
3138
|
else delete next.filters;
|
|
3100
|
-
return
|
|
3139
|
+
return _chunk24ATT2PEcjs.mapLayer.call(void 0, layers, id, () => next);
|
|
3101
3140
|
}
|
|
3102
3141
|
function requireEffectLayer(layers, id, action) {
|
|
3103
3142
|
const layer = requireLayer(layers, id).layer;
|
|
@@ -3112,7 +3151,7 @@ function guard(fn) {
|
|
|
3112
3151
|
try {
|
|
3113
3152
|
return fn();
|
|
3114
3153
|
} catch (e) {
|
|
3115
|
-
if (e instanceof
|
|
3154
|
+
if (e instanceof _chunk24ATT2PEcjs.LayerEffectError) fail(e.message);
|
|
3116
3155
|
throw e;
|
|
3117
3156
|
}
|
|
3118
3157
|
}
|
|
@@ -3120,20 +3159,20 @@ function setLayerEffects(layers, id, effects) {
|
|
|
3120
3159
|
const layer = requireEffectLayer(layers, id, "change its effects");
|
|
3121
3160
|
const next = { ...layer };
|
|
3122
3161
|
if (effects && (effects.items.length || effects.psd || effects.scale !== void 0 || !effects.enabled)) {
|
|
3123
|
-
guard(() =>
|
|
3162
|
+
guard(() => _chunk24ATT2PEcjs.validateLayerEffects.call(void 0, effects));
|
|
3124
3163
|
next.effects = effects;
|
|
3125
3164
|
} else delete next.effects;
|
|
3126
|
-
return
|
|
3165
|
+
return _chunk24ATT2PEcjs.mapLayer.call(void 0, layers, id, () => next);
|
|
3127
3166
|
}
|
|
3128
3167
|
function addLayerEffect(layers, id, kind, params = {}, index) {
|
|
3129
|
-
if (!
|
|
3168
|
+
if (!_chunk24ATT2PEcjs.isLayerEffectKind.call(void 0, kind)) fail(`Unknown effect kind "${String(kind)}". Kinds: ${_chunk24ATT2PEcjs.LAYER_EFFECT_KINDS.join(", ")}.`);
|
|
3130
3169
|
const layer = requireEffectLayer(layers, id, "add effects");
|
|
3131
3170
|
const current = layerEffectsOf(layer);
|
|
3132
3171
|
const ids = new Set(current.items.map((e) => e.id));
|
|
3133
|
-
let effectId =
|
|
3134
|
-
while (ids.has(effectId)) effectId =
|
|
3172
|
+
let effectId = _chunk24ATT2PEcjs.newEffectId.call(void 0, );
|
|
3173
|
+
while (ids.has(effectId)) effectId = _chunk24ATT2PEcjs.newEffectId.call(void 0, );
|
|
3135
3174
|
const { id: _ignored, kind: _kind, ...rest } = params;
|
|
3136
|
-
const effect = guard(() =>
|
|
3175
|
+
const effect = guard(() => _chunk24ATT2PEcjs.mergeLayerEffect.call(void 0, _chunk24ATT2PEcjs.defaultLayerEffect.call(void 0, kind, effectId), rest));
|
|
3137
3176
|
const items = [...current.items];
|
|
3138
3177
|
const at = index === void 0 ? items.length : Math.max(0, Math.min(items.length, Math.floor(index)));
|
|
3139
3178
|
items.splice(at, 0, effect);
|
|
@@ -3150,7 +3189,7 @@ function updateLayerEffect(layers, id, effectId, changes) {
|
|
|
3150
3189
|
const i = requireEffect(layer, effectId);
|
|
3151
3190
|
const current = layer.effects;
|
|
3152
3191
|
const items = [...current.items];
|
|
3153
|
-
items[i] = guard(() =>
|
|
3192
|
+
items[i] = guard(() => _chunk24ATT2PEcjs.mergeLayerEffect.call(void 0, items[i], changes));
|
|
3154
3193
|
return setLayerEffects(layers, id, { ...current, items });
|
|
3155
3194
|
}
|
|
3156
3195
|
function removeLayerEffect(layers, id, effectId) {
|
|
@@ -3185,7 +3224,7 @@ function unionRect(a, b) {
|
|
|
3185
3224
|
}
|
|
3186
3225
|
|
|
3187
3226
|
// src/image-editor/layers/shape.ts
|
|
3188
|
-
var SHAPE_RENDER_MARGIN =
|
|
3227
|
+
var SHAPE_RENDER_MARGIN = _chunk24ATT2PEcjs.MAX_EFFECT_REACH;
|
|
3189
3228
|
var DEFAULT_MITER_LIMIT = 100;
|
|
3190
3229
|
var fail2 = (message) => {
|
|
3191
3230
|
throw new LayerOperationError(message);
|
|
@@ -3225,7 +3264,7 @@ function mapAnchor(a, f) {
|
|
|
3225
3264
|
return out;
|
|
3226
3265
|
}
|
|
3227
3266
|
function mapSubpaths(subpaths, f) {
|
|
3228
|
-
return
|
|
3267
|
+
return _chunkZ2H7KECKcjs.expandVectorCorners.call(void 0, subpaths).map((sp) => ({ closed: sp.closed, anchors: sp.anchors.map((a) => mapAnchor(a, f)) }));
|
|
3229
3268
|
}
|
|
3230
3269
|
function liveShapeSubpaths(live) {
|
|
3231
3270
|
let out;
|
|
@@ -3233,19 +3272,19 @@ function liveShapeSubpaths(live) {
|
|
|
3233
3272
|
case "rect": {
|
|
3234
3273
|
const x = Math.min(live.x, live.x + live.width);
|
|
3235
3274
|
const y = Math.min(live.y, live.y + live.height);
|
|
3236
|
-
const sp =
|
|
3275
|
+
const sp = _chunkZ2H7KECKcjs.rectSubpath.call(void 0, { x, y, width: Math.abs(live.width), height: Math.abs(live.height) });
|
|
3237
3276
|
const r = _nullishCoalesce(live.radii, () => ( [0, 0, 0, 0]));
|
|
3238
|
-
out = [{ closed: true, anchors: sp.anchors.map((a, i) => r[i] > 0 ?
|
|
3277
|
+
out = [{ closed: true, anchors: sp.anchors.map((a, i) => r[i] > 0 ? _chunkZ2H7KECKcjs.setAnchorCorner.call(void 0, a, r[i]) : a) }];
|
|
3239
3278
|
break;
|
|
3240
3279
|
}
|
|
3241
3280
|
case "ellipse":
|
|
3242
|
-
out = [
|
|
3281
|
+
out = [_chunkZ2H7KECKcjs.ellipseSubpath.call(void 0, normBox(live))];
|
|
3243
3282
|
break;
|
|
3244
3283
|
case "polygon":
|
|
3245
|
-
out = [
|
|
3284
|
+
out = [_chunkZ2H7KECKcjs.polygonSubpath.call(void 0, normBox(live), live.sides)];
|
|
3246
3285
|
break;
|
|
3247
3286
|
case "star":
|
|
3248
|
-
out = [
|
|
3287
|
+
out = [_chunkZ2H7KECKcjs.starSubpath.call(void 0, normBox(live), live.points, Math.max(0, Math.min(1, live.innerRatio)))];
|
|
3249
3288
|
break;
|
|
3250
3289
|
case "line": {
|
|
3251
3290
|
const a = { x: live.x1, y: live.y1 };
|
|
@@ -3268,7 +3307,7 @@ function liveShapeSubpaths(live) {
|
|
|
3268
3307
|
}
|
|
3269
3308
|
}
|
|
3270
3309
|
const m = live.transform;
|
|
3271
|
-
return m && !
|
|
3310
|
+
return m && !_chunkZ2H7KECKcjs.isIdentityMatrix.call(void 0, m) ? mapSubpaths(out, (p) => _chunkZ2H7KECKcjs.applyMatrix.call(void 0, m, p)) : out;
|
|
3272
3311
|
}
|
|
3273
3312
|
function normBox(b) {
|
|
3274
3313
|
return { x: Math.min(b.x, b.x + b.width), y: Math.min(b.y, b.y + b.height), width: Math.abs(b.width), height: Math.abs(b.height) };
|
|
@@ -3280,7 +3319,7 @@ var pathCache = /* @__PURE__ */ new WeakMap();
|
|
|
3280
3319
|
function componentPath(c) {
|
|
3281
3320
|
let p = pathCache.get(c.subpaths);
|
|
3282
3321
|
if (!p) {
|
|
3283
|
-
p =
|
|
3322
|
+
p = _chunkZ2H7KECKcjs.subpathsToBezier.call(void 0, c.subpaths);
|
|
3284
3323
|
pathCache.set(c.subpaths, p);
|
|
3285
3324
|
}
|
|
3286
3325
|
return p;
|
|
@@ -3401,11 +3440,11 @@ function fillCoverage(geo, rect, rule, inverted = false) {
|
|
|
3401
3440
|
function paintContext(env) {
|
|
3402
3441
|
const tiles = /* @__PURE__ */ new Map();
|
|
3403
3442
|
return {
|
|
3404
|
-
light:
|
|
3443
|
+
light: _chunk24ATT2PEcjs.DEFAULT_GLOBAL_LIGHT,
|
|
3405
3444
|
pattern: (id) => {
|
|
3406
3445
|
if (tiles.has(id)) return tiles.get(id);
|
|
3407
|
-
const p = _nullishCoalesce(_optionalChain([env, 'access', _44 => _44.pattern, 'optionalCall', _45 => _45(id)]), () => (
|
|
3408
|
-
const t = p && p.width > 0 && p.height > 0 && p.data.length >= p.width * p.height * 4 ? new (0,
|
|
3446
|
+
const p = _nullishCoalesce(_optionalChain([env, 'access', _44 => _44.pattern, 'optionalCall', _45 => _45(id)]), () => ( _chunk24ATT2PEcjs.builtinPattern.call(void 0, id)));
|
|
3447
|
+
const t = p && p.width > 0 && p.height > 0 && p.data.length >= p.width * p.height * 4 ? new (0, _chunk24ATT2PEcjs.PatternTile)(p) : null;
|
|
3409
3448
|
tiles.set(id, t);
|
|
3410
3449
|
return t;
|
|
3411
3450
|
}
|
|
@@ -3436,9 +3475,9 @@ function renderShapeRect(layer, rect, env, ctx = paintContext(env)) {
|
|
|
3436
3475
|
if (!fCov && !sCov) return null;
|
|
3437
3476
|
const canvas = { x: 0, y: 0, width: env.width, height: env.height };
|
|
3438
3477
|
const anchor = { x: geo.frame.x, y: geo.frame.y };
|
|
3439
|
-
const fc = fCov ?
|
|
3478
|
+
const fc = fCov ? _chunk24ATT2PEcjs.effectFillColors.call(void 0, layer.fill, rect, geo.frame, canvas, anchor, ctx) : null;
|
|
3440
3479
|
const fo = _nullishCoalesce(_optionalChain([layer, 'access', _46 => _46.fill, 'optionalAccess', _47 => _47.opacity]), () => ( 1));
|
|
3441
|
-
const sc = sCov ?
|
|
3480
|
+
const sc = sCov ? _chunk24ATT2PEcjs.effectFillColors.call(void 0, layer.stroke.paint, rect, geo.frame, canvas, anchor, ctx) : null;
|
|
3442
3481
|
const so = _nullishCoalesce(_optionalChain([layer, 'access', _48 => _48.stroke, 'optionalAccess', _49 => _49.paint, 'access', _50 => _50.opacity]), () => ( 1));
|
|
3443
3482
|
const out = new Uint8ClampedArray(n * 4);
|
|
3444
3483
|
let any = false;
|
|
@@ -3531,9 +3570,9 @@ function normalizeShapePaint(v, path = "paint") {
|
|
|
3531
3570
|
offset: _nullishCoalesce(g.offset, () => ( { x: 0, y: 0 }))
|
|
3532
3571
|
};
|
|
3533
3572
|
try {
|
|
3534
|
-
|
|
3573
|
+
_chunk24ATT2PEcjs.validateEffectGradient.call(void 0, gradient, `${path}.gradient`);
|
|
3535
3574
|
} catch (e) {
|
|
3536
|
-
if (e instanceof
|
|
3575
|
+
if (e instanceof _chunk24ATT2PEcjs.LayerEffectError) fail2(e.message);
|
|
3537
3576
|
throw e;
|
|
3538
3577
|
}
|
|
3539
3578
|
if (gradient.stops.length < 1) fail2(`${path}.gradient.stops needs at least one { position, color }.`);
|
|
@@ -3603,7 +3642,7 @@ function matrixArg(v, path) {
|
|
|
3603
3642
|
if (!Array.isArray(v) || v.length !== 6 || !v.every(isNum)) fail2(`${path} must be six numbers [a, b, c, d, e, f].`);
|
|
3604
3643
|
const m = v;
|
|
3605
3644
|
if (Math.abs(m[0] * m[3] - m[1] * m[2]) < 1e-12) fail2(`${path} is singular.`);
|
|
3606
|
-
return
|
|
3645
|
+
return _chunkZ2H7KECKcjs.isIdentityMatrix.call(void 0, m) ? void 0 : [...m];
|
|
3607
3646
|
}
|
|
3608
3647
|
function normalizeLiveShape(v, path = "shape") {
|
|
3609
3648
|
if (!v || typeof v !== "object") return fail2(`${path} must be an object with kind ${LIVE_SHAPE_KINDS.join(", ")}.`);
|
|
@@ -3664,7 +3703,7 @@ function normalizeSubpaths(v, path = "subpaths") {
|
|
|
3664
3703
|
if (typeof v === "string") {
|
|
3665
3704
|
let subs;
|
|
3666
3705
|
try {
|
|
3667
|
-
subs =
|
|
3706
|
+
subs = _chunkZ2H7KECKcjs.bezierToSubpaths.call(void 0, v);
|
|
3668
3707
|
} catch (e5) {
|
|
3669
3708
|
return fail2(`${path}: could not read the SVG path data.`);
|
|
3670
3709
|
}
|
|
@@ -3745,20 +3784,20 @@ function updateShapeLayer(layers, id, change, env, action = "edit it") {
|
|
|
3745
3784
|
if (!("annotation" in patch)) delete next.annotation;
|
|
3746
3785
|
if (!next.components.length) fail2("A shape needs at least one component; delete the layer instead.");
|
|
3747
3786
|
const rendered = rerenderShape(next, env);
|
|
3748
|
-
return { layers:
|
|
3787
|
+
return { layers: _chunk24ATT2PEcjs.mapLayer.call(void 0, layers, id, () => rendered), layer: rendered };
|
|
3749
3788
|
}
|
|
3750
3789
|
function transformShapeComponents(components, f, affine) {
|
|
3751
3790
|
return components.map((c) => {
|
|
3752
3791
|
if (affine && c.live) {
|
|
3753
|
-
const live = { ...c.live, transform:
|
|
3754
|
-
if (
|
|
3792
|
+
const live = { ...c.live, transform: _chunkZ2H7KECKcjs.multiplyMatrices.call(void 0, _nullishCoalesce(c.live.transform, () => ( _chunkZ2H7KECKcjs.IDENTITY_MATRIX)), affine) };
|
|
3793
|
+
if (_chunkZ2H7KECKcjs.isIdentityMatrix.call(void 0, live.transform)) delete live.transform;
|
|
3755
3794
|
return { op: c.op, subpaths: liveShapeSubpaths(live), live };
|
|
3756
3795
|
}
|
|
3757
3796
|
return { op: c.op, subpaths: mapSubpaths(c.subpaths, f) };
|
|
3758
3797
|
});
|
|
3759
3798
|
}
|
|
3760
3799
|
function offsetShape(layer, dx, dy, env) {
|
|
3761
|
-
const m =
|
|
3800
|
+
const m = _chunkZ2H7KECKcjs.translateMatrix.call(void 0, dx, dy);
|
|
3762
3801
|
const next = { ...layer, components: transformShapeComponents(layer.components, (p) => ({ x: p.x + dx, y: p.y + dy }), m) };
|
|
3763
3802
|
delete next.annotation;
|
|
3764
3803
|
return rerenderShape(next, env);
|
|
@@ -3766,7 +3805,7 @@ function offsetShape(layer, dx, dy, env) {
|
|
|
3766
3805
|
function mergeShapeComponents(components, fillRule = "nonzero") {
|
|
3767
3806
|
if (components.length < 2) return [...components];
|
|
3768
3807
|
const path = shapeOutline(components, fillRule);
|
|
3769
|
-
const subpaths =
|
|
3808
|
+
const subpaths = _chunkZ2H7KECKcjs.bezierToSubpaths.call(void 0, path);
|
|
3770
3809
|
if (!subpaths.length) fail2("The components combine to nothing (the operations remove every area), so there is nothing to merge into.");
|
|
3771
3810
|
return [{ op: "combine", subpaths }];
|
|
3772
3811
|
}
|
|
@@ -3776,14 +3815,14 @@ function shapeAsPixelLayer(layer) {
|
|
|
3776
3815
|
}
|
|
3777
3816
|
function annotationPaint(color, opacity) {
|
|
3778
3817
|
const c = _chunk2YQONY6Gcjs.parseCssColor.call(void 0, color);
|
|
3779
|
-
if (!c || !
|
|
3818
|
+
if (!c || !_chunk24ATT2PEcjs.parseEffectColor.call(void 0, c.hex)) return void 0;
|
|
3780
3819
|
const a = c.alpha * opacity;
|
|
3781
3820
|
return a !== 1 ? { type: "color", color: c.hex, opacity: a } : { type: "color", color: c.hex };
|
|
3782
3821
|
}
|
|
3783
3822
|
function shapeFromAnnotation(a) {
|
|
3784
3823
|
const opacity = _nullishCoalesce(a.opacity, () => ( 1));
|
|
3785
3824
|
const lineWidth = "strokeWidth" in a && a.strokeWidth > 0 ? a.strokeWidth : 1;
|
|
3786
|
-
const rotation = a.rotation ?
|
|
3825
|
+
const rotation = a.rotation ? _chunkZ2H7KECKcjs.rotateMatrix.call(void 0, a.rotation, { x: a.x, y: a.y }) : void 0;
|
|
3787
3826
|
const t = rotation ? { transform: rotation } : {};
|
|
3788
3827
|
const live = (l) => liveComponent(l);
|
|
3789
3828
|
switch (a.type) {
|
|
@@ -3826,7 +3865,7 @@ function shapeFromAnnotation(a) {
|
|
|
3826
3865
|
case "pen": {
|
|
3827
3866
|
const paint = annotationPaint(a.strokeColor, opacity);
|
|
3828
3867
|
if (!paint) return null;
|
|
3829
|
-
const pts = rotation ? a.points.map((p) =>
|
|
3868
|
+
const pts = rotation ? a.points.map((p) => _chunkZ2H7KECKcjs.applyMatrix.call(void 0, rotation, p)) : a.points;
|
|
3830
3869
|
const subpaths = pts.length > 1 ? [{ closed: false, anchors: pts.map((p) => ({ x: p.x, y: p.y })) }] : [];
|
|
3831
3870
|
return {
|
|
3832
3871
|
components: [{ op: "combine", subpaths }],
|
|
@@ -3857,9 +3896,9 @@ function annotationOfShape(layer) {
|
|
|
3857
3896
|
var fail3 = (message) => {
|
|
3858
3897
|
throw new LayerOperationError(message);
|
|
3859
3898
|
};
|
|
3860
|
-
var TEXT_RENDER_MARGIN =
|
|
3899
|
+
var TEXT_RENDER_MARGIN = _chunk24ATT2PEcjs.MAX_EFFECT_REACH;
|
|
3861
3900
|
function textMatrix(layer) {
|
|
3862
|
-
return _nullishCoalesce(layer.transform, () => (
|
|
3901
|
+
return _nullishCoalesce(layer.transform, () => ( _chunkZ2H7KECKcjs.IDENTITY_MATRIX));
|
|
3863
3902
|
}
|
|
3864
3903
|
function rectCorners(r) {
|
|
3865
3904
|
return [
|
|
@@ -3870,7 +3909,7 @@ function rectCorners(r) {
|
|
|
3870
3909
|
];
|
|
3871
3910
|
}
|
|
3872
3911
|
function docRect(r, m) {
|
|
3873
|
-
const pts = rectCorners(r).map((p) =>
|
|
3912
|
+
const pts = rectCorners(r).map((p) => _chunkZ2H7KECKcjs.applyMatrix.call(void 0, m, p));
|
|
3874
3913
|
const x0 = Math.floor(Math.min(...pts.map((p) => p.x)));
|
|
3875
3914
|
const y0 = Math.floor(Math.min(...pts.map((p) => p.y)));
|
|
3876
3915
|
const x1 = Math.ceil(Math.max(...pts.map((p) => p.x)));
|
|
@@ -3903,14 +3942,14 @@ function inkBounds(layout) {
|
|
|
3903
3942
|
}
|
|
3904
3943
|
function textOutlines(layer, shaper) {
|
|
3905
3944
|
if (!shaper.outline) fail3(`The text shaper "${shaper.id}" cannot give glyph outlines; plug in an outline shaper (createOutlineTextShaper) to convert text to shapes.`);
|
|
3906
|
-
const layout =
|
|
3945
|
+
const layout = _chunkZ2H7KECKcjs.layoutText.call(void 0, layer, shaper);
|
|
3907
3946
|
const m = textMatrix(layer);
|
|
3908
3947
|
const out = [];
|
|
3909
3948
|
for (const l of layout.lines) {
|
|
3910
3949
|
for (const f of l.fragments) {
|
|
3911
|
-
let path =
|
|
3912
|
-
for (const r of
|
|
3913
|
-
out.push({ fragment: f, path:
|
|
3950
|
+
let path = _chunkZ2H7KECKcjs.textFragmentOutline.call(void 0, shaper, layer.text, f);
|
|
3951
|
+
for (const r of _chunkZ2H7KECKcjs.textDecorations.call(void 0, f, l)) path = [...path, ..._chunkZ2H7KECKcjs.textRectPath.call(void 0, r)];
|
|
3952
|
+
out.push({ fragment: f, path: _chunkZ2H7KECKcjs.isIdentityMatrix.call(void 0, m) ? path : _chunkBJTCSLF6cjs.transformBezierPath.call(void 0, path, m) });
|
|
3914
3953
|
}
|
|
3915
3954
|
}
|
|
3916
3955
|
return out;
|
|
@@ -3966,7 +4005,7 @@ function renderOnCanvas(layer, shaper, region, env) {
|
|
|
3966
4005
|
const canvas = env.createCanvas(region.width, region.height);
|
|
3967
4006
|
const ctx = canvas.getContext("2d");
|
|
3968
4007
|
if (!ctx || typeof ctx.getImageData !== "function") return null;
|
|
3969
|
-
const layout =
|
|
4008
|
+
const layout = _chunkZ2H7KECKcjs.layoutText.call(void 0, layer, shaper);
|
|
3970
4009
|
const m = textMatrix(layer);
|
|
3971
4010
|
ctx.setTransform(1, 0, 0, 1, 0, 0);
|
|
3972
4011
|
ctx.clearRect(0, 0, region.width, region.height);
|
|
@@ -3978,8 +4017,8 @@ function renderOnCanvas(layer, shaper, region, env) {
|
|
|
3978
4017
|
ctx.globalAlpha = _nullishCoalesce(f.style.opacity, () => ( 1));
|
|
3979
4018
|
const s = layer.text.slice(f.start, f.end);
|
|
3980
4019
|
if (!f.spaced) shaper.draw(ctx, s, f.font, f.x, f.y);
|
|
3981
|
-
else for (let k = 0; k < s.length; k++) if (!
|
|
3982
|
-
for (const d of
|
|
4020
|
+
else for (let k = 0; k < s.length; k++) if (!_chunkZ2H7KECKcjs.isTextSpace.call(void 0, s[k])) shaper.draw(ctx, s[k], f.font, f.x + f.carets[k], f.y);
|
|
4021
|
+
for (const d of _chunkZ2H7KECKcjs.textDecorations.call(void 0, f, l)) ctx.fillRect(d.x, d.y, d.width, d.height);
|
|
3983
4022
|
}
|
|
3984
4023
|
}
|
|
3985
4024
|
ctx.globalAlpha = 1;
|
|
@@ -3990,7 +4029,7 @@ function renderOnCanvas(layer, shaper, region, env) {
|
|
|
3990
4029
|
function renderText(layer, env) {
|
|
3991
4030
|
const shaper = env.shaper;
|
|
3992
4031
|
if (!shaper || !shaper.outline && !shaper.draw) return null;
|
|
3993
|
-
const layout =
|
|
4032
|
+
const layout = _chunkZ2H7KECKcjs.layoutText.call(void 0, layer, shaper);
|
|
3994
4033
|
const ink = inkBounds(layout);
|
|
3995
4034
|
const clip = { x: -TEXT_RENDER_MARGIN, y: -TEXT_RENDER_MARGIN, width: env.width + 2 * TEXT_RENDER_MARGIN, height: env.height + 2 * TEXT_RENDER_MARGIN };
|
|
3996
4035
|
const region = ink ? intersect2(docRect(ink, textMatrix(layer)), clip) : null;
|
|
@@ -4085,7 +4124,7 @@ function patchParagraphStyle(base, patch, path = "paragraph") {
|
|
|
4085
4124
|
continue;
|
|
4086
4125
|
}
|
|
4087
4126
|
const value = k === "autoLeading" ? num(v, `${path}.${k}`, 0.1, 10) : num(v, `${path}.${k}`, -1e4, 1e4);
|
|
4088
|
-
if (k === "autoLeading" && value ===
|
|
4127
|
+
if (k === "autoLeading" && value === _chunkZ2H7KECKcjs.DEFAULT_AUTO_LEADING || k !== "autoLeading" && value === 0) delete o[k];
|
|
4089
4128
|
else o[k] = value;
|
|
4090
4129
|
} else fail3(`${path}.${k} is not a paragraph style field; use ${PARAGRAPH_STYLE_FIELDS.join(", ")}.`);
|
|
4091
4130
|
}
|
|
@@ -4122,14 +4161,14 @@ function createTypeLayer(init, env, id = newLayerId(), lenient = false) {
|
|
|
4122
4161
|
opacity: 1,
|
|
4123
4162
|
blend: "normal",
|
|
4124
4163
|
text: text3,
|
|
4125
|
-
runs:
|
|
4126
|
-
paragraphs:
|
|
4164
|
+
runs: _chunkZ2H7KECKcjs.fitRuns.call(void 0, init.runs, text3.length, _chunkZ2H7KECKcjs.DEFAULT_TEXT_STYLE),
|
|
4165
|
+
paragraphs: _chunkZ2H7KECKcjs.fitParagraphRuns.call(void 0, _nullishCoalesce(init.paragraphs, () => ( [{ length: text3.length, style: {} }])), text3),
|
|
4127
4166
|
frame: init.frame,
|
|
4128
4167
|
surface: _chunkJ5BA3BQ6cjs.emptySurface.call(void 0, 4),
|
|
4129
4168
|
offset: { x: 0, y: 0 }
|
|
4130
4169
|
};
|
|
4131
|
-
if (!layer.runs.length) layer.runs = [{ length: 0, style: _nullishCoalesce(_optionalChain([init, 'access', _61 => _61.runs, 'access', _62 => _62[0], 'optionalAccess', _63 => _63.style]), () => (
|
|
4132
|
-
if (init.transform && !
|
|
4170
|
+
if (!layer.runs.length) layer.runs = [{ length: 0, style: _nullishCoalesce(_optionalChain([init, 'access', _61 => _61.runs, 'access', _62 => _62[0], 'optionalAccess', _63 => _63.style]), () => ( _chunkZ2H7KECKcjs.DEFAULT_TEXT_STYLE)) }];
|
|
4171
|
+
if (init.transform && !_chunkZ2H7KECKcjs.isIdentityMatrix.call(void 0, init.transform)) layer.transform = init.transform;
|
|
4133
4172
|
if (lenient && !renderText(layer, env)) return { ...layer, rendering: "stored" };
|
|
4134
4173
|
return rerenderText(layer, env);
|
|
4135
4174
|
}
|
|
@@ -4139,24 +4178,24 @@ function updateTypeLayer(layers, id, change, env, action = "edit it") {
|
|
|
4139
4178
|
const patch = change(current);
|
|
4140
4179
|
const next = { ...current, ...patch };
|
|
4141
4180
|
if (!("annotation" in patch)) delete next.annotation;
|
|
4142
|
-
if ("text" in patch || "runs" in patch) next.runs =
|
|
4143
|
-
if (!next.runs.length) next.runs = [{ length: 0, style:
|
|
4144
|
-
if ("text" in patch || "paragraphs" in patch) next.paragraphs =
|
|
4181
|
+
if ("text" in patch || "runs" in patch) next.runs = _chunkZ2H7KECKcjs.fitRuns.call(void 0, next.runs, next.text.length, _nullishCoalesce(_optionalChain([current, 'access', _64 => _64.runs, 'access', _65 => _65[0], 'optionalAccess', _66 => _66.style]), () => ( _chunkZ2H7KECKcjs.DEFAULT_TEXT_STYLE)));
|
|
4182
|
+
if (!next.runs.length) next.runs = [{ length: 0, style: _chunkZ2H7KECKcjs.styleAt.call(void 0, current.runs, 0, _chunkZ2H7KECKcjs.DEFAULT_TEXT_STYLE) }];
|
|
4183
|
+
if ("text" in patch || "paragraphs" in patch) next.paragraphs = _chunkZ2H7KECKcjs.fitParagraphRuns.call(void 0, next.paragraphs, next.text);
|
|
4145
4184
|
const rendered = rerenderText(next, env);
|
|
4146
|
-
return { layers:
|
|
4185
|
+
return { layers: _chunk24ATT2PEcjs.mapLayer.call(void 0, layers, id, () => rendered), layer: rendered };
|
|
4147
4186
|
}
|
|
4148
4187
|
function replaceTextRange(layer, start, end, insert) {
|
|
4149
4188
|
const text3 = layer.text.slice(0, start) + insert + layer.text.slice(end);
|
|
4150
|
-
const style =
|
|
4151
|
-
const runs =
|
|
4152
|
-
const pstyle =
|
|
4153
|
-
const paragraphs =
|
|
4154
|
-
return { text: text3, runs, paragraphs:
|
|
4189
|
+
const style = _chunkZ2H7KECKcjs.styleAt.call(void 0, layer.runs, start > 0 && start === layer.text.length ? start - 1 : start, _chunkZ2H7KECKcjs.DEFAULT_TEXT_STYLE);
|
|
4190
|
+
const runs = _chunkZ2H7KECKcjs.spliceRuns.call(void 0, layer.runs, start, end, insert.length, style);
|
|
4191
|
+
const pstyle = _chunkZ2H7KECKcjs.styleAt.call(void 0, layer.paragraphs, start, {});
|
|
4192
|
+
const paragraphs = _chunkZ2H7KECKcjs.spliceRuns.call(void 0, layer.paragraphs, start, end, insert.length, pstyle);
|
|
4193
|
+
return { text: text3, runs, paragraphs: _chunkZ2H7KECKcjs.fitParagraphRuns.call(void 0, paragraphs, text3) };
|
|
4155
4194
|
}
|
|
4156
4195
|
function transformTypeLayer(layer, m) {
|
|
4157
|
-
const t =
|
|
4196
|
+
const t = _chunkZ2H7KECKcjs.multiplyMatrices.call(void 0, textMatrix(layer), m);
|
|
4158
4197
|
const next = { ...layer };
|
|
4159
|
-
if (
|
|
4198
|
+
if (_chunkZ2H7KECKcjs.isIdentityMatrix.call(void 0, t)) delete next.transform;
|
|
4160
4199
|
else next.transform = t;
|
|
4161
4200
|
delete next.annotation;
|
|
4162
4201
|
return next;
|
|
@@ -4164,7 +4203,7 @@ function transformTypeLayer(layer, m) {
|
|
|
4164
4203
|
function typeFrame(layer, shaper) {
|
|
4165
4204
|
if (layer.frame.kind === "box") return { x: 0, y: 0, width: layer.frame.width, height: layer.frame.height };
|
|
4166
4205
|
if (!shaper) return fail3("Type layers need a text shaper to be measured; none is set here.");
|
|
4167
|
-
const b =
|
|
4206
|
+
const b = _chunkZ2H7KECKcjs.layoutText.call(void 0, layer, shaper).bounds;
|
|
4168
4207
|
return { x: b.x, y: b.y, width: Math.max(b.width, 1), height: Math.max(b.height, 1) };
|
|
4169
4208
|
}
|
|
4170
4209
|
function typeAsPixelLayer(layer) {
|
|
@@ -4172,7 +4211,7 @@ function typeAsPixelLayer(layer) {
|
|
|
4172
4211
|
return { ...rest, type: "pixel", surface: layer.surface, offset: { x: 0, y: 0 } };
|
|
4173
4212
|
}
|
|
4174
4213
|
function toTextSpace(layer, p) {
|
|
4175
|
-
return
|
|
4214
|
+
return _chunkZ2H7KECKcjs.applyMatrix.call(void 0, _chunkZ2H7KECKcjs.invertMatrix.call(void 0, textMatrix(layer)), p);
|
|
4176
4215
|
}
|
|
4177
4216
|
function typeFromAnnotation(a) {
|
|
4178
4217
|
if (a.type !== "text") return null;
|
|
@@ -4186,7 +4225,7 @@ function typeFromAnnotation(a) {
|
|
|
4186
4225
|
if (op !== 1) style.opacity = op;
|
|
4187
4226
|
const text3 = t.text.replace(/\r?\n|\r/g, " ");
|
|
4188
4227
|
const translate = [1, 0, 0, 1, t.x, t.y];
|
|
4189
|
-
const transform = t.rotation ?
|
|
4228
|
+
const transform = t.rotation ? _chunkZ2H7KECKcjs.multiplyMatrices.call(void 0, translate, _chunkZ2H7KECKcjs.rotateMatrix.call(void 0, t.rotation, { x: t.x, y: t.y })) : translate;
|
|
4190
4229
|
return { text: text3, runs: [{ length: text3.length, style }], frame: { kind: "point", origin: "top" }, transform };
|
|
4191
4230
|
}
|
|
4192
4231
|
function annotationOfType(layer) {
|
|
@@ -4520,7 +4559,7 @@ function identityTransform(box2) {
|
|
|
4520
4559
|
}
|
|
4521
4560
|
function cornersFromMatrix(box2, m) {
|
|
4522
4561
|
const q2 = _chunkMUUXNRU4cjs.boxQuad.call(void 0, box2);
|
|
4523
|
-
return [
|
|
4562
|
+
return [_chunkZ2H7KECKcjs.applyMatrix.call(void 0, m, q2[0]), _chunkZ2H7KECKcjs.applyMatrix.call(void 0, m, q2[1]), _chunkZ2H7KECKcjs.applyMatrix.call(void 0, m, q2[2]), _chunkZ2H7KECKcjs.applyMatrix.call(void 0, m, q2[3])];
|
|
4524
4563
|
}
|
|
4525
4564
|
function matrixFromCorners(box2, corners, eps = 1e-6) {
|
|
4526
4565
|
const [tl, tr, br, bl] = corners;
|
|
@@ -4537,7 +4576,7 @@ function transformHomography(geometry) {
|
|
|
4537
4576
|
function hasWarp(geometry) {
|
|
4538
4577
|
const w = geometry.warp;
|
|
4539
4578
|
if (!w) return false;
|
|
4540
|
-
const id =
|
|
4579
|
+
const id = _chunkZ2H7KECKcjs.identityWarpMesh.call(void 0, geometry.box, w.us.length - 1, w.vs.length - 1);
|
|
4541
4580
|
if (id.points.length !== w.points.length || id.us.some((u, i) => Math.abs(u - w.us[i]) > 1e-12) || id.vs.some((v, i) => Math.abs(v - w.vs[i]) > 1e-12)) return true;
|
|
4542
4581
|
return w.points.some((p, i) => Math.abs(p.x - id.points[i].x) > 1e-6 || Math.abs(p.y - id.points[i].y) > 1e-6);
|
|
4543
4582
|
}
|
|
@@ -4552,7 +4591,7 @@ function transformMap(geometry) {
|
|
|
4552
4591
|
const { box: box2 } = geometry;
|
|
4553
4592
|
const warp = hasWarp(geometry) ? geometry.warp : null;
|
|
4554
4593
|
if (!warp) return (p) => _chunkMUUXNRU4cjs.applyHomography.call(void 0, h, p);
|
|
4555
|
-
return (p) => _chunkMUUXNRU4cjs.applyHomography.call(void 0, h,
|
|
4594
|
+
return (p) => _chunkMUUXNRU4cjs.applyHomography.call(void 0, h, _chunkZ2H7KECKcjs.evalWarpMesh.call(void 0, warp, (p.x - box2.x) / box2.width, (p.y - box2.y) / box2.height));
|
|
4556
4595
|
}
|
|
4557
4596
|
function transformedPoint(geometry, fx, fy) {
|
|
4558
4597
|
const f = transformMap(geometry);
|
|
@@ -4596,8 +4635,8 @@ function matrixFromParams(box2, params) {
|
|
|
4596
4635
|
const tx = Math.tan((_nullishCoalesce(params.skewX, () => ( 0))) * Math.PI / 180);
|
|
4597
4636
|
const ty = Math.tan((_nullishCoalesce(params.skewY, () => ( 0))) * Math.PI / 180);
|
|
4598
4637
|
const ref = referencePoint(box2, params.reference);
|
|
4599
|
-
const linear =
|
|
4600
|
-
return
|
|
4638
|
+
const linear = _chunkZ2H7KECKcjs.multiplyMatrices.call(void 0, _chunkZ2H7KECKcjs.multiplyMatrices.call(void 0, [1, ty, tx, 1, 0, 0], [sx, 0, 0, sy, 0, 0]), _chunkZ2H7KECKcjs.rotateMatrix.call(void 0, _nullishCoalesce(params.rotate, () => ( 0))));
|
|
4639
|
+
return _chunkZ2H7KECKcjs.multiplyMatrices.call(void 0, _chunkZ2H7KECKcjs.matrixAbout.call(void 0, linear, ref), _chunkZ2H7KECKcjs.translateMatrix.call(void 0, _nullishCoalesce(params.dx, () => ( 0)), _nullishCoalesce(params.dy, () => ( 0))));
|
|
4601
4640
|
}
|
|
4602
4641
|
function describeTransform(geometry, reference = "center") {
|
|
4603
4642
|
const m = hasWarp(geometry) ? null : matrixFromCorners(geometry.box, geometry.corners);
|
|
@@ -4614,7 +4653,7 @@ function describeTransform(geometry, reference = "center") {
|
|
|
4614
4653
|
const shear = sxAbs ? (a * c + b * d) / sxAbs : 0;
|
|
4615
4654
|
const sy = sxAbs ? (a * d - b * c) / sxAbs : 0;
|
|
4616
4655
|
const skew = sxAbs ? Math.atan(shear / sxAbs) * 180 / Math.PI : 0;
|
|
4617
|
-
const at =
|
|
4656
|
+
const at = _chunkZ2H7KECKcjs.applyMatrix.call(void 0, m, ref);
|
|
4618
4657
|
const clean = (v) => Math.abs(v) < 1e-9 ? 0 : v;
|
|
4619
4658
|
return {
|
|
4620
4659
|
affine: true,
|
|
@@ -4632,24 +4671,24 @@ function applyParams(geometry, params) {
|
|
|
4632
4671
|
const ref = params.reference && typeof params.reference === "object" ? params.reference : anchorPoint(geometry, _nullishCoalesce(params.reference, () => ( "center")));
|
|
4633
4672
|
const m = matrixFromParams({ x: ref.x, y: ref.y, width: 0, height: 0 }, { ...params, reference: ref });
|
|
4634
4673
|
const c = geometry.corners;
|
|
4635
|
-
return [
|
|
4674
|
+
return [_chunkZ2H7KECKcjs.applyMatrix.call(void 0, m, c[0]), _chunkZ2H7KECKcjs.applyMatrix.call(void 0, m, c[1]), _chunkZ2H7KECKcjs.applyMatrix.call(void 0, m, c[2]), _chunkZ2H7KECKcjs.applyMatrix.call(void 0, m, c[3])];
|
|
4636
4675
|
}
|
|
4637
4676
|
function flipCorners(geometry, axis) {
|
|
4638
4677
|
const c = anchorPoint(geometry, "center");
|
|
4639
4678
|
const m = axis === "horizontal" ? [-1, 0, 0, 1, 2 * c.x, 0] : [1, 0, 0, -1, 0, 2 * c.y];
|
|
4640
4679
|
const q2 = geometry.corners;
|
|
4641
|
-
return [
|
|
4680
|
+
return [_chunkZ2H7KECKcjs.applyMatrix.call(void 0, m, q2[0]), _chunkZ2H7KECKcjs.applyMatrix.call(void 0, m, q2[1]), _chunkZ2H7KECKcjs.applyMatrix.call(void 0, m, q2[2]), _chunkZ2H7KECKcjs.applyMatrix.call(void 0, m, q2[3])];
|
|
4642
4681
|
}
|
|
4643
4682
|
function boxPointOf(geometry, p) {
|
|
4644
4683
|
const m = matrixFromCorners(geometry.box, geometry.corners);
|
|
4645
|
-
if (m) return
|
|
4684
|
+
if (m) return _chunkZ2H7KECKcjs.applyMatrix.call(void 0, _chunkZ2H7KECKcjs.invertMatrix.call(void 0, m), p);
|
|
4646
4685
|
return null;
|
|
4647
4686
|
}
|
|
4648
4687
|
function presetWarp(box2, preset) {
|
|
4649
|
-
return
|
|
4688
|
+
return _chunkZ2H7KECKcjs.warpPresetMesh.call(void 0, preset, box2);
|
|
4650
4689
|
}
|
|
4651
4690
|
function isValidWarp(mesh) {
|
|
4652
|
-
return
|
|
4691
|
+
return _chunkZ2H7KECKcjs.isValidWarpMesh.call(void 0, mesh);
|
|
4653
4692
|
}
|
|
4654
4693
|
function geometryHomography(geometry) {
|
|
4655
4694
|
const m = matrixFromCorners(geometry.box, geometry.corners);
|
|
@@ -4660,7 +4699,7 @@ function geometryHomography(geometry) {
|
|
|
4660
4699
|
var fail4 = (message) => {
|
|
4661
4700
|
throw new LayerOperationError(message);
|
|
4662
4701
|
};
|
|
4663
|
-
var SMART_RENDER_MARGIN =
|
|
4702
|
+
var SMART_RENDER_MARGIN = _chunk24ATT2PEcjs.MAX_EFFECT_REACH;
|
|
4664
4703
|
var incompleteSurfaces = /* @__PURE__ */ new WeakSet();
|
|
4665
4704
|
var isSmartSurfaceIncomplete = (surface) => incompleteSurfaces.has(surface);
|
|
4666
4705
|
var surfaceIds = /* @__PURE__ */ new WeakMap();
|
|
@@ -4776,7 +4815,7 @@ function placeContents(layer, canvas, options = {}) {
|
|
|
4776
4815
|
k = step;
|
|
4777
4816
|
let r = _optionalChain([options, 'access', _83 => _83.reduced, 'optionalAccess', _84 => _84.get, 'call', _85 => _85(k)]);
|
|
4778
4817
|
if (!r) {
|
|
4779
|
-
r =
|
|
4818
|
+
r = _chunk24ATT2PEcjs.reduceSurface.call(void 0, src, k);
|
|
4780
4819
|
_optionalChain([options, 'access', _86 => _86.reduced, 'optionalAccess', _87 => _87.set, 'call', _88 => _88(k, r)]);
|
|
4781
4820
|
}
|
|
4782
4821
|
source = r;
|
|
@@ -4786,15 +4825,15 @@ function placeContents(layer, canvas, options = {}) {
|
|
|
4786
4825
|
if (hasWarp(g)) {
|
|
4787
4826
|
const f = transformMap(g);
|
|
4788
4827
|
if (!f) fail4("The placement folds the contents over itself or through the horizon; keep the corners a convex quad.");
|
|
4789
|
-
out =
|
|
4828
|
+
out = _chunk24ATT2PEcjs.warpSurface.call(void 0, source, (p) => f({ x: p.x * k, y: p.y * k }), { interpolation, source: box2, clip, step: step > 1 ? step : void 0 });
|
|
4790
4829
|
} else {
|
|
4791
4830
|
const h = transformHomography(g);
|
|
4792
4831
|
if (!h) fail4("The placement folds the contents over itself or through the horizon; keep the corners a convex quad.");
|
|
4793
4832
|
const hk = _chunkMUUXNRU4cjs.multiplyHomographies.call(void 0, [k, 0, 0, 0, k, 0, 0, 0, 1], h);
|
|
4794
|
-
out =
|
|
4833
|
+
out = _chunk24ATT2PEcjs.transformSurface.call(void 0, source, hk, { interpolation, source: box2, clip, step: step > 1 ? step : void 0 });
|
|
4795
4834
|
}
|
|
4796
4835
|
} catch (e) {
|
|
4797
|
-
if (e instanceof
|
|
4836
|
+
if (e instanceof _chunk24ATT2PEcjs.TransformTooLargeError) fail4(e.message);
|
|
4798
4837
|
throw e;
|
|
4799
4838
|
}
|
|
4800
4839
|
}
|
|
@@ -4834,7 +4873,7 @@ function filterMaskCoverage(mask, canvas) {
|
|
|
4834
4873
|
}
|
|
4835
4874
|
const feather = _nullishCoalesce(mask.feather, () => ( 0));
|
|
4836
4875
|
if (all && !(feather > 0)) return null;
|
|
4837
|
-
if (feather > 0) v =
|
|
4876
|
+
if (feather > 0) v = _chunk24ATT2PEcjs.gaussianBlur.call(void 0, v, W, H, feather, "clamp");
|
|
4838
4877
|
const density = _nullishCoalesce(mask.density, () => ( 1));
|
|
4839
4878
|
if (density !== 1) for (let i = 0; i < v.length; i++) v[i] = 1 - density * (1 - v[i]);
|
|
4840
4879
|
return v;
|
|
@@ -4870,7 +4909,7 @@ function applySmartFilters(placed, stack, canvas) {
|
|
|
4870
4909
|
if (f.opacity >= 1) acc = out2;
|
|
4871
4910
|
else lerpInto(acc, out2, f.opacity, null);
|
|
4872
4911
|
} else {
|
|
4873
|
-
|
|
4912
|
+
_chunk24ATT2PEcjs.blendTile.call(void 0, acc, out2, f.blend, f.opacity, null);
|
|
4874
4913
|
}
|
|
4875
4914
|
}
|
|
4876
4915
|
entry = { key, base, filtered: acc };
|
|
@@ -4915,11 +4954,11 @@ function normalizePlacement(raw, contents) {
|
|
|
4915
4954
|
}
|
|
4916
4955
|
const out = { corners: c.map((p) => ({ x: p.x, y: p.y })) };
|
|
4917
4956
|
if (raw.warp) {
|
|
4918
|
-
if (!
|
|
4957
|
+
if (!_chunkZ2H7KECKcjs.isValidWarpMesh.call(void 0, raw.warp)) fail4("warp must be a mesh with us and vs (knots from 0 to 1, increasing) and (3\xB7columns + 1) \xD7 (3\xB7rows + 1) finite points in contents pixels.");
|
|
4919
4958
|
out.warp = { us: [...raw.warp.us], vs: [...raw.warp.vs], points: raw.warp.points.map((p) => ({ x: p.x, y: p.y })) };
|
|
4920
4959
|
}
|
|
4921
4960
|
if (raw.interpolation !== void 0) {
|
|
4922
|
-
if (!
|
|
4961
|
+
if (!_chunk24ATT2PEcjs.isInterpolation.call(void 0, raw.interpolation)) fail4(`Unknown interpolation "${String(raw.interpolation)}"; use nearest, bilinear or bicubic.`);
|
|
4923
4962
|
if (raw.interpolation !== "bicubic") out.interpolation = raw.interpolation;
|
|
4924
4963
|
}
|
|
4925
4964
|
const g = { box: { x: 0, y: 0, width: contents.width, height: contents.height }, corners: out.corners, warp: _nullishCoalesce(out.warp, () => ( null)) };
|
|
@@ -4939,7 +4978,7 @@ function followMask(mask, before, after) {
|
|
|
4939
4978
|
const inv = _chunkMUUXNRU4cjs.invertHomography.call(void 0, h0);
|
|
4940
4979
|
if (!inv) return mask;
|
|
4941
4980
|
const delta = _chunkMUUXNRU4cjs.multiplyHomographies.call(void 0, inv, h1);
|
|
4942
|
-
const surface =
|
|
4981
|
+
const surface = _chunk24ATT2PEcjs.transformSurface.call(void 0, mask.surface, delta, { interpolation: "bilinear" });
|
|
4943
4982
|
return { ...mask, surface };
|
|
4944
4983
|
}
|
|
4945
4984
|
function setSmartPlacement(layers, id, placement, canvas) {
|
|
@@ -4960,7 +4999,7 @@ function setSmartPlacement(layers, id, placement, canvas) {
|
|
|
4960
4999
|
next.smartFilters = { ...next.smartFilters, mask: m };
|
|
4961
5000
|
}
|
|
4962
5001
|
next = rerender(next, canvas, "be transformed");
|
|
4963
|
-
return { layers:
|
|
5002
|
+
return { layers: _chunk24ATT2PEcjs.mapLayer.call(void 0, layers, id, () => next), layer: next, masksMoved };
|
|
4964
5003
|
}
|
|
4965
5004
|
function offsetSmartObject(layers, id, dx, dy, canvas) {
|
|
4966
5005
|
const layer = requireSmartObject(layers, id);
|
|
@@ -4982,7 +5021,7 @@ function offsetSmartObject(layers, id, dx, dy, canvas) {
|
|
|
4982
5021
|
} else {
|
|
4983
5022
|
next = rerender(next, canvas, "move");
|
|
4984
5023
|
}
|
|
4985
|
-
return
|
|
5024
|
+
return _chunk24ATT2PEcjs.mapLayer.call(void 0, layers, id, () => next);
|
|
4986
5025
|
}
|
|
4987
5026
|
function translateLayer(layer, dx, dy) {
|
|
4988
5027
|
if (!dx && !dy) return layer;
|
|
@@ -5018,7 +5057,7 @@ function translateLayer(layer, dx, dy) {
|
|
|
5018
5057
|
case "shape": {
|
|
5019
5058
|
const next = {
|
|
5020
5059
|
...layer,
|
|
5021
|
-
components: transformShapeComponents(layer.components, (p) => ({ x: p.x + dx, y: p.y + dy }),
|
|
5060
|
+
components: transformShapeComponents(layer.components, (p) => ({ x: p.x + dx, y: p.y + dy }), _chunkZ2H7KECKcjs.translateMatrix.call(void 0, dx, dy)),
|
|
5022
5061
|
surface: _chunkJ5BA3BQ6cjs.translateSurface.call(void 0, layer.surface, dx, dy),
|
|
5023
5062
|
mask: moveMask(layer.mask)
|
|
5024
5063
|
};
|
|
@@ -5027,7 +5066,7 @@ function translateLayer(layer, dx, dy) {
|
|
|
5027
5066
|
return next;
|
|
5028
5067
|
}
|
|
5029
5068
|
case "type": {
|
|
5030
|
-
const next = { ...transformTypeLayer(layer,
|
|
5069
|
+
const next = { ...transformTypeLayer(layer, _chunkZ2H7KECKcjs.translateMatrix.call(void 0, dx, dy)), surface: _chunkJ5BA3BQ6cjs.translateSurface.call(void 0, layer.surface, dx, dy), mask: moveMask(layer.mask) };
|
|
5031
5070
|
if (!next.mask) delete next.mask;
|
|
5032
5071
|
return next;
|
|
5033
5072
|
}
|
|
@@ -5050,7 +5089,7 @@ function layerExtent(layer, surfaceOf, canvas) {
|
|
|
5050
5089
|
} else {
|
|
5051
5090
|
b = full;
|
|
5052
5091
|
}
|
|
5053
|
-
const m =
|
|
5092
|
+
const m = _chunk24ATT2PEcjs.effectsMargin.call(void 0, layer.effects);
|
|
5054
5093
|
if (b && m > 0) b = { x: b.x - Math.ceil(m), y: b.y - Math.ceil(m), width: b.width + 2 * Math.ceil(m), height: b.height + 2 * Math.ceil(m) };
|
|
5055
5094
|
return b;
|
|
5056
5095
|
}
|
|
@@ -5119,7 +5158,7 @@ function convertToSmartObject(layers, ids, canvas, options) {
|
|
|
5119
5158
|
delete resolved.source;
|
|
5120
5159
|
layer = resolved;
|
|
5121
5160
|
}
|
|
5122
|
-
if (
|
|
5161
|
+
if (_chunk24ATT2PEcjs.flattenLayers.call(void 0, [layer]).some((x) => x.type === "pixel" && x.source === "document")) fail4(`Layer "${layer.name || layer.id}" holds the document image inside a group; convert the Background on its own.`);
|
|
5123
5162
|
return translateLayer(layer, -b.x, -b.y);
|
|
5124
5163
|
});
|
|
5125
5164
|
if (nested[0].clipped) {
|
|
@@ -5146,8 +5185,8 @@ function convertToSmartObject(layers, ids, canvas, options) {
|
|
|
5146
5185
|
smart = { ...smart, surface: renderSmartObject(smart, canvas) };
|
|
5147
5186
|
const below = ordered.filter((l) => l.index < top.index).length;
|
|
5148
5187
|
let out = layers;
|
|
5149
|
-
for (const l of ordered) out =
|
|
5150
|
-
return { layers:
|
|
5188
|
+
for (const l of ordered) out = _chunk24ATT2PEcjs.mapLayer.call(void 0, out, l.layer.id, () => null);
|
|
5189
|
+
return { layers: _chunk24ATT2PEcjs.insertLayer.call(void 0, out, smart, parent, top.index - below), layer: smart };
|
|
5151
5190
|
}
|
|
5152
5191
|
function rasterizeSmartObject(layers, id) {
|
|
5153
5192
|
const layer = requireSmartObject(layers, id);
|
|
@@ -5167,7 +5206,7 @@ function rasterizeSmartObject(layers, id) {
|
|
|
5167
5206
|
if (layer.locks) out.locks = layer.locks;
|
|
5168
5207
|
if (layer.effects) out.effects = layer.effects;
|
|
5169
5208
|
if (layer.fillOpacity !== void 0) out.fillOpacity = layer.fillOpacity;
|
|
5170
|
-
return { layers:
|
|
5209
|
+
return { layers: _chunk24ATT2PEcjs.mapLayer.call(void 0, layers, id, () => out), layer: out };
|
|
5171
5210
|
}
|
|
5172
5211
|
function copySmartObject(layers, id, linked, name) {
|
|
5173
5212
|
const loc = requireLayer(layers, id);
|
|
@@ -5177,19 +5216,19 @@ function copySmartObject(layers, id, linked, name) {
|
|
|
5177
5216
|
delete copy.psd;
|
|
5178
5217
|
if (!linked) copy.contents = { ...layer.contents, id: newContentsId() };
|
|
5179
5218
|
if (copy.smartFilters) copy.smartFilters = { ...copy.smartFilters, filters: copy.smartFilters.filters.map((f) => ({ ...f, id: newLayerId("flt") })) };
|
|
5180
|
-
return { layers:
|
|
5219
|
+
return { layers: _chunk24ATT2PEcjs.insertLayer.call(void 0, layers, copy, _nullishCoalesce(_optionalChain([loc, 'access', _122 => _122.parent, 'optionalAccess', _123 => _123.id]), () => ( null)), loc.index + 1), layer: copy };
|
|
5181
5220
|
}
|
|
5182
5221
|
function instancesOf(layers, contentsId) {
|
|
5183
|
-
return
|
|
5222
|
+
return _chunk24ATT2PEcjs.flattenLayers.call(void 0, layers).filter((l) => l.type === "smart" && l.contents.id === contentsId).map((l) => l.id);
|
|
5184
5223
|
}
|
|
5185
5224
|
function replaceContents(layers, contentsId, contents, canvas) {
|
|
5186
5225
|
const ids = instancesOf(layers, contentsId);
|
|
5187
5226
|
if (!ids.length) fail4(`No smart object uses contents "${contentsId}".`);
|
|
5188
|
-
for (const id of ids) requireUnlocked(
|
|
5227
|
+
for (const id of ids) requireUnlocked(_chunk24ATT2PEcjs.findLayer.call(void 0, layers, id).layer, "all", "replace its contents");
|
|
5189
5228
|
const next = { ...contents, id: contentsId };
|
|
5190
5229
|
let out = layers;
|
|
5191
5230
|
for (const id of ids) {
|
|
5192
|
-
out =
|
|
5231
|
+
out = _chunk24ATT2PEcjs.mapLayer.call(void 0, out, id, (l) => {
|
|
5193
5232
|
const layer = l;
|
|
5194
5233
|
return rerender({ ...layer, contents: next, placement: refitPlacement(layer, next) }, canvas, "take the new contents");
|
|
5195
5234
|
});
|
|
@@ -5213,7 +5252,7 @@ function refitPlacement(layer, contents) {
|
|
|
5213
5252
|
});
|
|
5214
5253
|
const out = { corners: pts };
|
|
5215
5254
|
if (layer.placement.interpolation) out.interpolation = layer.placement.interpolation;
|
|
5216
|
-
if (layer.placement.warp) out.warp =
|
|
5255
|
+
if (layer.placement.warp) out.warp = _chunkZ2H7KECKcjs.mapWarpMeshPoints.call(void 0, layer.placement.warp, (p) => ({ x: p.x * W1 / W0, y: p.y * H1 / H0 }));
|
|
5217
5256
|
return out;
|
|
5218
5257
|
}
|
|
5219
5258
|
function normalizeSmartFilter(raw, id = newLayerId("flt")) {
|
|
@@ -5266,7 +5305,7 @@ function addSmartFilter(layers, id, filter, canvas, index) {
|
|
|
5266
5305
|
const at = index === void 0 ? filters.length : Math.max(0, Math.min(filters.length, Math.floor(index)));
|
|
5267
5306
|
filters.splice(at, 0, filter);
|
|
5268
5307
|
const next = withStack(layer, { ...stack, filters }, canvas);
|
|
5269
|
-
return { layers:
|
|
5308
|
+
return { layers: _chunk24ATT2PEcjs.mapLayer.call(void 0, layers, id, () => next), layer: next, filter };
|
|
5270
5309
|
}
|
|
5271
5310
|
function updateSmartFilter(layers, id, filterId, changes, canvas) {
|
|
5272
5311
|
const layer = editableSmart(layers, id);
|
|
@@ -5288,7 +5327,7 @@ function updateSmartFilter(layers, id, filterId, changes, canvas) {
|
|
|
5288
5327
|
const filters = [...layer.smartFilters.filters];
|
|
5289
5328
|
filters[i] = merged2;
|
|
5290
5329
|
const next = withStack(layer, { ...layer.smartFilters, filters }, canvas);
|
|
5291
|
-
return { layers:
|
|
5330
|
+
return { layers: _chunk24ATT2PEcjs.mapLayer.call(void 0, layers, id, () => next), layer: next, filter: merged2 };
|
|
5292
5331
|
}
|
|
5293
5332
|
function removeSmartFilter(layers, id, filterId, canvas) {
|
|
5294
5333
|
const layer = editableSmart(layers, id);
|
|
@@ -5296,7 +5335,7 @@ function removeSmartFilter(layers, id, filterId, canvas) {
|
|
|
5296
5335
|
const stack = layer.smartFilters;
|
|
5297
5336
|
const filters = stack.filters.filter((f) => f.id !== filterId);
|
|
5298
5337
|
const next = withStack(layer, filters.length ? { ...stack, filters } : stack.enabled ? void 0 : { enabled: false, filters }, canvas);
|
|
5299
|
-
return { layers:
|
|
5338
|
+
return { layers: _chunk24ATT2PEcjs.mapLayer.call(void 0, layers, id, () => next), layer: next };
|
|
5300
5339
|
}
|
|
5301
5340
|
function moveSmartFilter(layers, id, filterId, index, canvas) {
|
|
5302
5341
|
const layer = editableSmart(layers, id);
|
|
@@ -5307,12 +5346,12 @@ function moveSmartFilter(layers, id, filterId, index, canvas) {
|
|
|
5307
5346
|
const [f] = filters.splice(i, 1);
|
|
5308
5347
|
filters.splice(index, 0, f);
|
|
5309
5348
|
const next = withStack(layer, { ...layer.smartFilters, filters }, canvas);
|
|
5310
|
-
return { layers:
|
|
5349
|
+
return { layers: _chunk24ATT2PEcjs.mapLayer.call(void 0, layers, id, () => next), layer: next };
|
|
5311
5350
|
}
|
|
5312
5351
|
function setSmartFiltersEnabled(layers, id, enabled, canvas) {
|
|
5313
5352
|
const layer = editableSmart(layers, id);
|
|
5314
5353
|
const next = withStack(layer, { ...stackOf(layer), enabled: Boolean(enabled) }, canvas);
|
|
5315
|
-
return { layers:
|
|
5354
|
+
return { layers: _chunk24ATT2PEcjs.mapLayer.call(void 0, layers, id, () => next), layer: next };
|
|
5316
5355
|
}
|
|
5317
5356
|
function setSmartFilterMask(layers, id, mask, canvas) {
|
|
5318
5357
|
const layer = editableSmart(layers, id);
|
|
@@ -5321,7 +5360,7 @@ function setSmartFilterMask(layers, id, mask, canvas) {
|
|
|
5321
5360
|
if (mask) stack.mask = mask;
|
|
5322
5361
|
else delete stack.mask;
|
|
5323
5362
|
const next = withStack(layer, stack, canvas);
|
|
5324
|
-
return { layers:
|
|
5363
|
+
return { layers: _chunk24ATT2PEcjs.mapLayer.call(void 0, layers, id, () => next), layer: next };
|
|
5325
5364
|
}
|
|
5326
5365
|
function withFilterMaskSurface(layer, surface, canvas) {
|
|
5327
5366
|
const stack = stackOf(layer);
|
|
@@ -5431,7 +5470,7 @@ function deserializeEffects(raw) {
|
|
|
5431
5470
|
psd = void 0;
|
|
5432
5471
|
}
|
|
5433
5472
|
}
|
|
5434
|
-
return
|
|
5473
|
+
return _chunk24ATT2PEcjs.normalizeLayerEffects.call(void 0, { ...r, psd });
|
|
5435
5474
|
}
|
|
5436
5475
|
function serializeMask(mask, hint, ctx) {
|
|
5437
5476
|
const out = { defaultValue: mask.defaultValue };
|
|
@@ -5527,7 +5566,7 @@ function readType(r, base, ctx) {
|
|
|
5527
5566
|
const text3 = normalizeText(_nullishCoalesce(r.text, () => ( "")));
|
|
5528
5567
|
const runs = (Array.isArray(r.runs) ? r.runs : []).map((run, i) => ({
|
|
5529
5568
|
length: Math.max(0, Math.floor(num2(_optionalChain([run, 'optionalAccess', _139 => _139.length]), 0, 1e9, 0))),
|
|
5530
|
-
style: patchTextStyle(
|
|
5569
|
+
style: patchTextStyle(_chunkZ2H7KECKcjs.DEFAULT_TEXT_STYLE, _optionalChain([run, 'optionalAccess', _140 => _140.style]) && typeof run.style === "object" ? run.style : {}, `runs[${i}].style`)
|
|
5531
5570
|
}));
|
|
5532
5571
|
const paragraphs = (Array.isArray(r.paragraphs) ? r.paragraphs : []).map((p, i) => ({
|
|
5533
5572
|
length: Math.max(0, Math.floor(num2(_optionalChain([p, 'optionalAccess', _141 => _141.length]), 0, 1e9, 0))),
|
|
@@ -5540,13 +5579,13 @@ function readType(r, base, ctx) {
|
|
|
5540
5579
|
...base,
|
|
5541
5580
|
type: "type",
|
|
5542
5581
|
text: text3,
|
|
5543
|
-
runs:
|
|
5544
|
-
paragraphs:
|
|
5582
|
+
runs: _chunkZ2H7KECKcjs.fitRuns.call(void 0, runs, text3.length, _chunkZ2H7KECKcjs.DEFAULT_TEXT_STYLE),
|
|
5583
|
+
paragraphs: _chunkZ2H7KECKcjs.fitParagraphRuns.call(void 0, paragraphs.length ? paragraphs : [{ length: text3.length, style: {} }], text3),
|
|
5545
5584
|
frame,
|
|
5546
5585
|
surface: _chunkJ5BA3BQ6cjs.emptySurface.call(void 0, 4),
|
|
5547
5586
|
offset: { x: 0, y: 0 }
|
|
5548
5587
|
};
|
|
5549
|
-
if (!layer.runs.length) layer.runs = [{ length: 0, style: _nullishCoalesce(_optionalChain([runs, 'access', _145 => _145[0], 'optionalAccess', _146 => _146.style]), () => (
|
|
5588
|
+
if (!layer.runs.length) layer.runs = [{ length: 0, style: _nullishCoalesce(_optionalChain([runs, 'access', _145 => _145[0], 'optionalAccess', _146 => _146.style]), () => ( _chunkZ2H7KECKcjs.DEFAULT_TEXT_STYLE)) }];
|
|
5550
5589
|
if (m) layer.transform = m;
|
|
5551
5590
|
if (r.antiAlias === false) layer.antiAlias = false;
|
|
5552
5591
|
if (typeof r.fillOpacity === "number" && r.fillOpacity !== 1) layer.fillOpacity = num2(r.fillOpacity, 0, 1, 1);
|
|
@@ -5999,8 +6038,8 @@ function readSmartObject(r, base, ctx) {
|
|
|
5999
6038
|
let placement;
|
|
6000
6039
|
try {
|
|
6001
6040
|
const raw = { corners: p.corners };
|
|
6002
|
-
if (p.warp &&
|
|
6003
|
-
if (
|
|
6041
|
+
if (p.warp && _chunkZ2H7KECKcjs.isValidWarpMesh.call(void 0, p.warp)) raw.warp = p.warp;
|
|
6042
|
+
if (_chunk24ATT2PEcjs.isInterpolation.call(void 0, p.interpolation)) raw.interpolation = p.interpolation;
|
|
6004
6043
|
placement = normalizePlacement(raw, contents);
|
|
6005
6044
|
} catch (e) {
|
|
6006
6045
|
ctx.problems.push(`${what}: its placement is invalid (${e instanceof Error ? e.message : String(e)}); it was placed at the top left`);
|
|
@@ -6982,7 +7021,7 @@ function vectorBlockForComponents(components, inverted, width, height, flags = 0
|
|
|
6982
7021
|
const fr = (p) => ({ x: p.x / w, y: p.y / h });
|
|
6983
7022
|
const subpaths = [];
|
|
6984
7023
|
components.forEach((c, ci) => {
|
|
6985
|
-
|
|
7024
|
+
_chunkZ2H7KECKcjs.expandVectorCorners.call(void 0, c.subpaths).forEach((sp, si) => {
|
|
6986
7025
|
if (!sp.anchors.length) return;
|
|
6987
7026
|
subpaths.push({
|
|
6988
7027
|
closed: sp.closed,
|
|
@@ -7704,7 +7743,7 @@ function merged(levels) {
|
|
|
7704
7743
|
function charStyle(d, fonts, notes) {
|
|
7705
7744
|
const n = (k) => eNum(eGet(d, k));
|
|
7706
7745
|
const flag = (k) => eBool(eGet(d, k));
|
|
7707
|
-
const s = { ...
|
|
7746
|
+
const s = { ..._chunkZ2H7KECKcjs.DEFAULT_TEXT_STYLE };
|
|
7708
7747
|
const fi = n("Font");
|
|
7709
7748
|
const ps = fi !== void 0 ? fonts[fi] : void 0;
|
|
7710
7749
|
if (ps) {
|
|
@@ -7787,7 +7826,7 @@ function typeFromTySh(data, notes) {
|
|
|
7787
7826
|
}
|
|
7788
7827
|
const edText = _nullishCoalesce(eStr(ePath(_nullishCoalesce(engine, () => ( void 0)), ["EngineDict", "Editor", "Text"])), () => ( ""));
|
|
7789
7828
|
const text3 = (_nullishCoalesce(txt, () => ( edText.replace(/\r$/, "")))).replace(/\r\n?/g, "\n");
|
|
7790
|
-
let runs = [{ length: text3.length, style: { ...
|
|
7829
|
+
let runs = [{ length: text3.length, style: { ..._chunkZ2H7KECKcjs.DEFAULT_TEXT_STYLE } }];
|
|
7791
7830
|
let paragraphs = [{ length: text3.length, style: {} }];
|
|
7792
7831
|
let frame = { kind: "point" };
|
|
7793
7832
|
let transform = t.transform;
|
|
@@ -7843,14 +7882,14 @@ function typeFromTySh(data, notes) {
|
|
|
7843
7882
|
const b = eArray(ePath(shape, ["Cookie", "Photoshop", "BoxBounds"])).map((v) => _nullishCoalesce(eNum(v), () => ( 0)));
|
|
7844
7883
|
if (b.length === 4 && b[2] > b[0] && b[3] > b[1]) {
|
|
7845
7884
|
frame = { kind: "box", width: b[2] - b[0], height: b[3] - b[1] };
|
|
7846
|
-
transform =
|
|
7885
|
+
transform = _chunkZ2H7KECKcjs.multiplyMatrices.call(void 0, [1, 0, 0, 1, b[0], b[1]], t.transform);
|
|
7847
7886
|
}
|
|
7848
7887
|
}
|
|
7849
7888
|
}
|
|
7850
7889
|
return {
|
|
7851
7890
|
text: text3,
|
|
7852
|
-
runs:
|
|
7853
|
-
paragraphs:
|
|
7891
|
+
runs: _chunkZ2H7KECKcjs.fitRuns.call(void 0, runs, text3.length, _chunkZ2H7KECKcjs.DEFAULT_TEXT_STYLE),
|
|
7892
|
+
paragraphs: _chunkZ2H7KECKcjs.fitParagraphRuns.call(void 0, paragraphs, text3),
|
|
7854
7893
|
frame,
|
|
7855
7894
|
transform,
|
|
7856
7895
|
antiAlias,
|
|
@@ -7924,7 +7963,7 @@ function buildEngineData(layer, template) {
|
|
|
7924
7963
|
fonts.push(ps);
|
|
7925
7964
|
return fonts.length - 1;
|
|
7926
7965
|
};
|
|
7927
|
-
const runs =
|
|
7966
|
+
const runs = _chunkZ2H7KECKcjs.fitRuns.call(void 0, layer.runs, layer.text.length, _chunkZ2H7KECKcjs.DEFAULT_TEXT_STYLE);
|
|
7928
7967
|
const sruns = [];
|
|
7929
7968
|
const slens = [];
|
|
7930
7969
|
runs.forEach((r, i) => {
|
|
@@ -7932,10 +7971,10 @@ function buildEngineData(layer, template) {
|
|
|
7932
7971
|
slens.push(E.int(r.length + (i === runs.length - 1 ? 1 : 0)));
|
|
7933
7972
|
});
|
|
7934
7973
|
if (!runs.length) {
|
|
7935
|
-
sruns.push(E.dict([["StyleSheet", E.dict([["StyleSheetData", styleSheetData(
|
|
7974
|
+
sruns.push(E.dict([["StyleSheet", E.dict([["StyleSheetData", styleSheetData(_chunkZ2H7KECKcjs.DEFAULT_TEXT_STYLE, fontIndex(postScriptFor(_chunkZ2H7KECKcjs.DEFAULT_TEXT_STYLE)))]])]]));
|
|
7936
7975
|
slens.push(E.int(1));
|
|
7937
7976
|
}
|
|
7938
|
-
const paras =
|
|
7977
|
+
const paras = _chunkZ2H7KECKcjs.fitParagraphRuns.call(void 0, layer.paragraphs, layer.text);
|
|
7939
7978
|
const pruns = [];
|
|
7940
7979
|
const plens = [];
|
|
7941
7980
|
paras.forEach((p, i) => {
|
|
@@ -7991,7 +8030,7 @@ function buildEngineData(layer, template) {
|
|
|
7991
8030
|
eSet(e, key, rd);
|
|
7992
8031
|
}
|
|
7993
8032
|
eSet(rd, "FontSet", fontSet);
|
|
7994
|
-
if (!eGet(rd, "StyleSheetSet")) eSet(rd, "StyleSheetSet", E.array([E.dict([["Name", E.str("Normal RGB")], ["StyleSheetData", styleSheetData(_nullishCoalesce(_optionalChain([runs, 'access', _211 => _211[0], 'optionalAccess', _212 => _212.style]), () => (
|
|
8033
|
+
if (!eGet(rd, "StyleSheetSet")) eSet(rd, "StyleSheetSet", E.array([E.dict([["Name", E.str("Normal RGB")], ["StyleSheetData", styleSheetData(_nullishCoalesce(_optionalChain([runs, 'access', _211 => _211[0], 'optionalAccess', _212 => _212.style]), () => ( _chunkZ2H7KECKcjs.DEFAULT_TEXT_STYLE)), 0)]])]));
|
|
7995
8034
|
if (!eGet(rd, "ParagraphSheetSet")) eSet(rd, "ParagraphSheetSet", E.array([E.dict([["Name", E.str("Normal RGB")], ["DefaultStyleSheet", E.int(0)], ["Properties", paragraphProperties({})]])]));
|
|
7996
8035
|
if (!eGet(rd, "TheNormalStyleSheet")) eSet(rd, "TheNormalStyleSheet", E.int(0));
|
|
7997
8036
|
if (!eGet(rd, "TheNormalParagraphSheet")) eSet(rd, "TheNormalParagraphSheet", E.int(0));
|
|
@@ -8002,13 +8041,13 @@ function inkBounds2(layer) {
|
|
|
8002
8041
|
if (layer.frame.kind === "box") return [0, 0, layer.frame.width, layer.frame.height];
|
|
8003
8042
|
const b = _chunkJ5BA3BQ6cjs.contentBounds.call(void 0, layer.surface);
|
|
8004
8043
|
if (!b) return [0, 0, 0, 0];
|
|
8005
|
-
const inv =
|
|
8044
|
+
const inv = _chunkZ2H7KECKcjs.invertMatrix.call(void 0, textMatrix(layer));
|
|
8006
8045
|
const pts = [
|
|
8007
8046
|
{ x: b.x, y: b.y },
|
|
8008
8047
|
{ x: b.x + b.width, y: b.y },
|
|
8009
8048
|
{ x: b.x + b.width, y: b.y + b.height },
|
|
8010
8049
|
{ x: b.x, y: b.y + b.height }
|
|
8011
|
-
].map((p) =>
|
|
8050
|
+
].map((p) => _chunkZ2H7KECKcjs.applyMatrix.call(void 0, inv, p));
|
|
8012
8051
|
return [Math.min(...pts.map((p) => p.x)), Math.min(...pts.map((p) => p.y)), Math.max(...pts.map((p) => p.x)), Math.max(...pts.map((p) => p.y))];
|
|
8013
8052
|
}
|
|
8014
8053
|
function tyShForLayer(layer) {
|
|
@@ -8475,7 +8514,7 @@ function filterMaskItem(placed, mask, area) {
|
|
|
8475
8514
|
var warpStyleOf = (name) => {
|
|
8476
8515
|
if (!name.startsWith("warp")) return null;
|
|
8477
8516
|
const s = _optionalChain([name, 'access', _226 => _226[4], 'optionalAccess', _227 => _227.toLowerCase, 'call', _228 => _228()]) + name.slice(5);
|
|
8478
|
-
return
|
|
8517
|
+
return _chunkZ2H7KECKcjs.WARP_STYLES.includes(s) ? s : null;
|
|
8479
8518
|
};
|
|
8480
8519
|
function warpFromDescriptor(w, contents) {
|
|
8481
8520
|
const full = { x: 0, y: 0, width: contents.width, height: contents.height };
|
|
@@ -8505,7 +8544,7 @@ function warpFromDescriptor(w, contents) {
|
|
|
8505
8544
|
} else {
|
|
8506
8545
|
const style = warpStyleOf(styleName);
|
|
8507
8546
|
if (!style) return void 0;
|
|
8508
|
-
mesh =
|
|
8547
|
+
mesh = _chunkZ2H7KECKcjs.warpPresetMesh.call(void 0,
|
|
8509
8548
|
{
|
|
8510
8549
|
style,
|
|
8511
8550
|
bend: _nullishCoalesce(descNumber(w, "warpValue"), () => ( 0)),
|
|
@@ -8520,7 +8559,7 @@ function warpFromDescriptor(w, contents) {
|
|
|
8520
8559
|
const same = Math.abs(bounds.x) < 1e-6 && Math.abs(bounds.y) < 1e-6 && Math.abs(bounds.width - contents.width) < 1e-6 && Math.abs(bounds.height - contents.height) < 1e-6;
|
|
8521
8560
|
if (!same) {
|
|
8522
8561
|
const m = mesh;
|
|
8523
|
-
mesh =
|
|
8562
|
+
mesh = _chunkZ2H7KECKcjs.fitWarpMesh.call(void 0, (s, t) => _chunkZ2H7KECKcjs.evalWarpMesh.call(void 0, m, (s * contents.width - bounds.x) / bounds.width, (t * contents.height - bounds.y) / bounds.height), [0, 1], [0, 1]);
|
|
8524
8563
|
}
|
|
8525
8564
|
return { mesh, frame };
|
|
8526
8565
|
}
|
|
@@ -9844,7 +9883,7 @@ function recordEffects(ctx, rec, name, notes, group) {
|
|
|
9844
9883
|
}
|
|
9845
9884
|
for (const e of parsed.effects.items) {
|
|
9846
9885
|
for (const id of patternIds(e)) {
|
|
9847
|
-
if (ctx.patterns.has(id) ||
|
|
9886
|
+
if (ctx.patterns.has(id) || _chunk24ATT2PEcjs.builtinPattern.call(void 0, id)) continue;
|
|
9848
9887
|
ctx.warn.add("A pattern effect uses a pattern the file does not contain, and paints nothing", name);
|
|
9849
9888
|
notes.push(`pattern "${id}" is not in the file`);
|
|
9850
9889
|
}
|
|
@@ -10096,7 +10135,7 @@ function importSmart(ctx, rec, name, notes, props) {
|
|
|
10096
10135
|
if (placement && (size.width !== contents.width || size.height !== contents.height)) {
|
|
10097
10136
|
const kx = contents.width / size.width;
|
|
10098
10137
|
const ky = contents.height / size.height;
|
|
10099
|
-
if (placement.warp) placement = { ...placement, warp:
|
|
10138
|
+
if (placement.warp) placement = { ...placement, warp: _chunkZ2H7KECKcjs.mapWarpMeshPoints.call(void 0, placement.warp, (p) => ({ x: p.x * kx, y: p.y * ky })) };
|
|
10100
10139
|
}
|
|
10101
10140
|
}
|
|
10102
10141
|
if (!contents || !placement) {
|
|
@@ -10399,34 +10438,34 @@ function blendOf(d, key, fallback, notes) {
|
|
|
10399
10438
|
function colorOf(d, fallback = "#000000") {
|
|
10400
10439
|
if (!d) return fallback;
|
|
10401
10440
|
const g = (k) => descNumber(d, k);
|
|
10402
|
-
if (g("redFloat") !== void 0) return
|
|
10441
|
+
if (g("redFloat") !== void 0) return _chunk24ATT2PEcjs.effectColorHex.call(void 0, [g("redFloat"), _nullishCoalesce(g("greenFloat"), () => ( 0)), _nullishCoalesce(g("blueFloat"), () => ( 0))]);
|
|
10403
10442
|
switch (d.classId) {
|
|
10404
10443
|
case "HSBC": {
|
|
10405
10444
|
const rgb = decodePsdColor(1, [(_nullishCoalesce(g("H "), () => ( 0))) / 360 * 65535, (_nullishCoalesce(g("Strt"), () => ( 0))) / 100 * 65535, (_nullishCoalesce(g("Brgh"), () => ( 0))) / 100 * 65535]);
|
|
10406
|
-
return rgb ?
|
|
10445
|
+
return rgb ? _chunk24ATT2PEcjs.effectColorHex.call(void 0, rgb) : fallback;
|
|
10407
10446
|
}
|
|
10408
10447
|
case "CMYC": {
|
|
10409
10448
|
const inv = (k) => (1 - (_nullishCoalesce(g(k), () => ( 0))) / 100) * 65535;
|
|
10410
10449
|
const rgb = decodePsdColor(2, [inv("Cyn "), inv("Mgnt"), inv("Ylw "), inv("Blck")]);
|
|
10411
|
-
return rgb ?
|
|
10450
|
+
return rgb ? _chunk24ATT2PEcjs.effectColorHex.call(void 0, rgb) : fallback;
|
|
10412
10451
|
}
|
|
10413
10452
|
case "LbCl": {
|
|
10414
10453
|
const rgb = decodePsdColor(7, [(_nullishCoalesce(g("Lmnc"), () => ( 0))) * 100, Math.round((_nullishCoalesce(g("A "), () => ( 0))) * 100) & 65535, Math.round((_nullishCoalesce(g("B "), () => ( 0))) * 100) & 65535]);
|
|
10415
|
-
return rgb ?
|
|
10454
|
+
return rgb ? _chunk24ATT2PEcjs.effectColorHex.call(void 0, rgb) : fallback;
|
|
10416
10455
|
}
|
|
10417
10456
|
case "Grsc": {
|
|
10418
10457
|
const v = 1 - (_nullishCoalesce(g("Gry "), () => ( 0))) / 100;
|
|
10419
|
-
return
|
|
10458
|
+
return _chunk24ATT2PEcjs.effectColorHex.call(void 0, [v, v, v]);
|
|
10420
10459
|
}
|
|
10421
10460
|
}
|
|
10422
10461
|
const r = g("Rd ");
|
|
10423
10462
|
const gr = g("Grn ");
|
|
10424
10463
|
const b = g("Bl ");
|
|
10425
10464
|
if (r === void 0 || gr === void 0 || b === void 0) return fallback;
|
|
10426
|
-
return
|
|
10465
|
+
return _chunk24ATT2PEcjs.effectColorHex.call(void 0, [r / 255, gr / 255, b / 255]);
|
|
10427
10466
|
}
|
|
10428
10467
|
function colorDesc(hex) {
|
|
10429
|
-
const [r, g, b] = _nullishCoalesce(
|
|
10468
|
+
const [r, g, b] = _nullishCoalesce(_chunk24ATT2PEcjs.parseEffectColor.call(void 0, hex), () => ( [0, 0, 0]));
|
|
10430
10469
|
return descriptor("RGBC", [
|
|
10431
10470
|
["Rd ", dbl3(r * 255)],
|
|
10432
10471
|
["Grn ", dbl3(g * 255)],
|
|
@@ -10509,9 +10548,9 @@ function gradientOf(d, notes) {
|
|
|
10509
10548
|
raw.forEach((s, i) => {
|
|
10510
10549
|
if (i > 0 && Math.abs(s.mid - 0.5) > 1e-3) {
|
|
10511
10550
|
const a = raw[i - 1];
|
|
10512
|
-
const ca =
|
|
10513
|
-
const cb =
|
|
10514
|
-
stops.push({ position: a.position + (s.position - a.position) * s.mid, color:
|
|
10551
|
+
const ca = _chunk24ATT2PEcjs.parseEffectColor.call(void 0, a.color);
|
|
10552
|
+
const cb = _chunk24ATT2PEcjs.parseEffectColor.call(void 0, s.color);
|
|
10553
|
+
stops.push({ position: a.position + (s.position - a.position) * s.mid, color: _chunk24ATT2PEcjs.effectColorHex.call(void 0, ca.map((v, k) => (v + cb[k]) / 2)) });
|
|
10515
10554
|
notes.add("gradient midpoints are drawn as straight segments");
|
|
10516
10555
|
}
|
|
10517
10556
|
stops.push({ position: s.position, color: s.color });
|
|
@@ -10623,8 +10662,8 @@ var KINDS = [
|
|
|
10623
10662
|
["FrFX", "frameFXMulti", "stroke"]
|
|
10624
10663
|
];
|
|
10625
10664
|
function common(d, kind, notes) {
|
|
10626
|
-
const def =
|
|
10627
|
-
return { id:
|
|
10665
|
+
const def = _chunk24ATT2PEcjs.defaultLayerEffect.call(void 0, kind, "x");
|
|
10666
|
+
return { id: _chunk24ATT2PEcjs.newEffectId.call(void 0, ), enabled: descBool(d, "enab") !== false, blend: blendOf(d, "Md ", def.blend, notes), opacity: clamp3(pct(d, "Opct", def.opacity), 0, 1) };
|
|
10628
10667
|
}
|
|
10629
10668
|
function readOne(kind, d, notes) {
|
|
10630
10669
|
const size = (key, fallback) => clamp3(num3(d, key, fallback), 0, 250);
|
|
@@ -10667,7 +10706,7 @@ function readOne(kind, d, notes) {
|
|
|
10667
10706
|
case "bevel-emboss": {
|
|
10668
10707
|
const styles = { OtrB: "outer-bevel", InrB: "inner-bevel", Embs: "emboss", PlEb: "pillow-emboss", strokeEmboss: "stroke-emboss" };
|
|
10669
10708
|
const out = {
|
|
10670
|
-
id:
|
|
10709
|
+
id: _chunk24ATT2PEcjs.newEffectId.call(void 0, ),
|
|
10671
10710
|
enabled: descBool(d, "enab") !== false,
|
|
10672
10711
|
kind,
|
|
10673
10712
|
style: _nullishCoalesce(styles[_nullishCoalesce(enumOf3(d, "bvlS"), () => ( ""))], () => ( "inner-bevel")),
|
|
@@ -10878,10 +10917,10 @@ function writeLfx2(effects) {
|
|
|
10878
10917
|
["Scl ", unit3("#Prc", 100)],
|
|
10879
10918
|
["masterFXSwitch", boolV3(effects.enabled)]
|
|
10880
10919
|
];
|
|
10881
|
-
const scale =
|
|
10920
|
+
const scale = _chunk24ATT2PEcjs.effectsScale.call(void 0, effects);
|
|
10882
10921
|
let dropped = 0;
|
|
10883
10922
|
for (const [single, multi, kind] of KINDS) {
|
|
10884
|
-
const of = effects.items.filter((e) => e.kind === kind).map((e) => writeOne(
|
|
10923
|
+
const of = effects.items.filter((e) => e.kind === kind).map((e) => writeOne(_chunk24ATT2PEcjs.scaleLayerEffect.call(void 0, e, scale)));
|
|
10885
10924
|
if (!of.length) continue;
|
|
10886
10925
|
if (of.length === 1) items.push([single, obj3(of[0])]);
|
|
10887
10926
|
else if (multi) items.push([multi, { type: "VlLs", items: of.map(obj3) }]);
|
|
@@ -10913,7 +10952,7 @@ function parseLrfx(data) {
|
|
|
10913
10952
|
const colorAt = (rd) => {
|
|
10914
10953
|
rd.u16();
|
|
10915
10954
|
const c = [rd.u16(), rd.u16(), rd.u16(), rd.u16()];
|
|
10916
|
-
return
|
|
10955
|
+
return _chunk24ATT2PEcjs.effectColorHex.call(void 0, [c[0] >> 8, c[1] >> 8, c[2] >> 8].map((v) => v / 255));
|
|
10917
10956
|
};
|
|
10918
10957
|
const blendAt = (rd) => {
|
|
10919
10958
|
rd.skip(4);
|
|
@@ -10932,7 +10971,7 @@ function parseLrfx(data) {
|
|
|
10932
10971
|
const enabled = b.u8() !== 0;
|
|
10933
10972
|
const useGlobalLight = b.u8() !== 0;
|
|
10934
10973
|
const opacity = b.u8() / 255;
|
|
10935
|
-
const base = { id:
|
|
10974
|
+
const base = { id: _chunk24ATT2PEcjs.newEffectId.call(void 0, ), enabled, blend, opacity, color, angle, useGlobalLight, distance: clamp3(distance, 0, 3e4), size: clamp3(blur, 0, 250), antiAlias: false, noise: 0 };
|
|
10936
10975
|
items.push(key === "dsdw" ? { ...base, kind: "drop-shadow", spread: 0, knocksOut: true } : { ...base, kind: "inner-shadow", choke: 0 });
|
|
10937
10976
|
} else if (key === "oglw" || key === "iglw") {
|
|
10938
10977
|
b.u32();
|
|
@@ -10942,7 +10981,7 @@ function parseLrfx(data) {
|
|
|
10942
10981
|
const blend = blendAt(b);
|
|
10943
10982
|
const enabled = b.u8() !== 0;
|
|
10944
10983
|
const opacity = b.u8() / 255;
|
|
10945
|
-
const base = { id:
|
|
10984
|
+
const base = { id: _chunk24ATT2PEcjs.newEffectId.call(void 0, ), enabled, blend, opacity, fill: { type: "color", color }, technique: "softer", size: clamp3(blur, 0, 250), antiAlias: false, range: 0.5, jitter: 0, noise: 0 };
|
|
10946
10985
|
items.push(key === "oglw" ? { ...base, kind: "outer-glow", spread: 0 } : { ...base, kind: "inner-glow", choke: 0, source: "edge" });
|
|
10947
10986
|
} else if (key === "sofi") {
|
|
10948
10987
|
b.u32();
|
|
@@ -10950,7 +10989,7 @@ function parseLrfx(data) {
|
|
|
10950
10989
|
const color = colorAt(b);
|
|
10951
10990
|
const opacity = b.u8() / 255;
|
|
10952
10991
|
const enabled = b.u8() !== 0;
|
|
10953
|
-
items.push({ id:
|
|
10992
|
+
items.push({ id: _chunk24ATT2PEcjs.newEffectId.call(void 0, ), kind: "color-overlay", enabled, blend, opacity, color });
|
|
10954
10993
|
} else if (key === "bevl") notes.add("legacy bevels are not read");
|
|
10955
10994
|
}
|
|
10956
10995
|
return { effects: { enabled: true, items }, notes: [...notes] };
|
|
@@ -11142,7 +11181,7 @@ function exportPsd(input) {
|
|
|
11142
11181
|
const key = layer.type === "group" ? "lfxs" : "lfx2";
|
|
11143
11182
|
if (fx.psd) {
|
|
11144
11183
|
const original = parseLfx2(fx.psd.data);
|
|
11145
|
-
if (original ?
|
|
11184
|
+
if (original ? _chunk24ATT2PEcjs.effectsFingerprint.call(void 0, original.effects) === _chunk24ATT2PEcjs.effectsFingerprint.call(void 0, fx) : !fx.items.length) return { key, data: padEven(fx.psd.data) };
|
|
11146
11185
|
}
|
|
11147
11186
|
if (!fx.items.length && fx.enabled && (_nullishCoalesce(fx.scale, () => ( 1))) === 1) return null;
|
|
11148
11187
|
const { data, dropped } = writeLfx2(fx);
|
|
@@ -11370,7 +11409,7 @@ function exportPsd(input) {
|
|
|
11370
11409
|
const byId = new Map((_nullishCoalesce(input.patterns, () => ( []))).map((p) => [p.id, p]));
|
|
11371
11410
|
const embed = [];
|
|
11372
11411
|
for (const id of patternIds2) {
|
|
11373
|
-
const p = _nullishCoalesce(byId.get(id), () => (
|
|
11412
|
+
const p = _nullishCoalesce(byId.get(id), () => ( _chunk24ATT2PEcjs.builtinPattern.call(void 0, id)));
|
|
11374
11413
|
if (p) embed.push(p);
|
|
11375
11414
|
else note(`Pattern "${id}" is not in the document and was not embedded`, id);
|
|
11376
11415
|
}
|
|
@@ -11764,5 +11803,6 @@ function exportPsd(input) {
|
|
|
11764
11803
|
|
|
11765
11804
|
|
|
11766
11805
|
|
|
11767
|
-
exports.LEGACY_PROCESS_VERSION = LEGACY_PROCESS_VERSION; exports.LATEST_PROCESS_VERSION = LATEST_PROCESS_VERSION; exports.normalizeProcessVersion = normalizeProcessVersion; exports.srgbToLinear = srgbToLinear; exports.linearToSrgb = linearToSrgb; exports.LUMA_709 = LUMA_709; exports.IDENTITY_MATRIX3 = IDENTITY_MATRIX3; exports.mulMatrix3 = mulMatrix3; exports.applyMatrix3 = applyMatrix3; exports.invertMatrix3 = invertMatrix3; exports.D65 = D65; exports.bradfordAdaptation = bradfordAdaptation; exports.wbMatrix = wbMatrix; exports.linearSrgbToXy = linearSrgbToXy; exports.TINT_SCALE = TINT_SCALE; exports.MIN_KELVIN = MIN_KELVIN; exports.MAX_KELVIN = MAX_KELVIN; exports.xyToUv = xyToUv; exports.uvToXy = uvToXy; exports.tempTintToXy = tempTintToXy; exports.xyToTempTint = xyToTempTint; exports.AS_SHOT_KELVIN = AS_SHOT_KELVIN; exports.MIRED_PER_TEMPERATURE_UNIT = MIRED_PER_TEMPERATURE_UNIT; exports.temperatureToKelvin = temperatureToKelvin; exports.kelvinToTemperature = kelvinToTemperature; exports.whiteBalanceMatrix = whiteBalanceMatrix; exports.whiteBalanceFromSample = whiteBalanceFromSample; exports.TONE_LUT_SIZE = TONE_LUT_SIZE; exports.toneCurve = toneCurve; exports.buildToneLut = buildToneLut; exports.sampleToneLut = sampleToneLut; exports.normalizeAngle = normalizeAngle; exports.isQuarterTurnSwapped = isQuarterTurnSwapped; exports.getRotatedSize = getRotatedSize; exports.projectImagePoint = projectImagePoint; exports.unprojectCanvasPoint = unprojectCanvasPoint; exports.applyImageProjectionToContext = applyImageProjectionToContext; exports.projectImageRect = projectImageRect; exports.clampCropToImage = clampCropToImage; exports.getViewportProjection = getViewportProjection; exports.getViewportMetrics = getViewportMetrics; exports.canvasToImagePoint = canvasToImagePoint; exports.imageToCanvasPoint = imageToCanvasPoint; exports.mapCropHandle = mapCropHandle; exports.hitTestCrop = hitTestCrop; exports.getCropCursor = getCropCursor; exports.calculateCropDrag = calculateCropDrag; exports.getAnnotationBounds = getAnnotationBounds; exports.hitTestAnnotation = hitTestAnnotation; exports.SELECTION_MODES = SELECTION_MODES; exports.isSelectionMode = isSelectionMode; exports.parseSelectionMode = parseSelectionMode; exports.computeSelectionBounds = computeSelectionBounds; exports.createSelectionMask = createSelectionMask; exports.fullSelection = fullSelection; exports.isSelectionEmpty = isSelectionEmpty; exports.selectionValueAt = selectionValueAt; exports.coverageToByte = coverageToByte; exports.selectionFromCoverage = selectionFromCoverage; exports.selectionToCoverage = selectionToCoverage; exports.selectionArea = selectionArea; exports.combineSelections = combineSelections; exports.invertSelection = invertSelection; exports.resizeSelection = resizeSelection; exports.selectionFromPixels = selectionFromPixels; exports.selectionToPixels = selectionToPixels; exports.encodeSelectionRle = encodeSelectionRle; exports.decodeSelectionRle = decodeSelectionRle; exports.serializeSelection = serializeSelection; exports.deserializeSelection = deserializeSelection; exports.hashMaskContent = hashMaskContent; exports.EMPTY_DISTANCE = EMPTY_DISTANCE; exports.distanceTransform = distanceTransform; exports.expandCoverage = expandCoverage; exports.contractCoverage = contractCoverage; exports.borderCoverage = borderCoverage; exports.smoothCoverage = smoothCoverage; exports.featherCoverage = featherCoverage; exports.greyMorphology = greyMorphology; exports.shiftCoverage = shiftCoverage; exports.SELECTION_MODIFY_OPS = SELECTION_MODIFY_OPS; exports.modifySelection = modifySelection; exports.normalizeLayerMask = normalizeLayerMask; exports.layerMaskFromSelection = layerMaskFromSelection; exports.updateLayerMaskProps = updateLayerMaskProps; exports.decodeLayerMask = decodeLayerMask; exports.layerMaskKey = layerMaskKey; exports.layerMaskCoverage = layerMaskCoverage; exports.projectMaskCoverage = projectMaskCoverage; exports.buildLayerMaskPlanes = buildLayerMaskPlanes; exports.ADJUSTMENT_LUT_SIZE = ADJUSTMENT_LUT_SIZE; exports.sampleLut = sampleLut; exports.ADJUSTMENT_KINDS = ADJUSTMENT_KINDS; exports.isAdjustmentKind = isAdjustmentKind; exports.adjustmentKindLabel = adjustmentKindLabel; exports.HUE_RANGE_LABELS = HUE_RANGE_LABELS; exports.neutralHueRange = neutralHueRange; exports.identityCurve = identityCurve; exports.identityLevels = identityLevels; exports.defaultAdjustmentParams = defaultAdjustmentParams; exports.createAdjustmentLayer = createAdjustmentLayer; exports.normalizeAdjustmentLayer = normalizeAdjustmentLayer; exports.normalizeAdjustmentLayers = normalizeAdjustmentLayers; exports.curveLutFromLevels = curveLutFromLevels; exports.levelsValue = levelsValue; exports.rgbToHsl = rgbToHsl; exports.hslToRgb = hslToRgb; exports.hueRangeWeight = hueRangeWeight; exports.hueRangeTables = hueRangeTables; exports.hueSaturation = hueSaturation; exports.rangeLightness = rangeLightness; exports.VIBRANCE_GREY = VIBRANCE_GREY; exports.vibranceLinear = vibranceLinear; exports.vibrancePixel = vibrancePixel; exports.colorBalanceChannel = colorBalanceChannel; exports.blackWhiteGray = blackWhiteGray; exports.D50 = D50; exports.XYZ_D50_TO_SRGB = XYZ_D50_TO_SRGB; exports.photoFilterMatrix = photoFilterMatrix; exports.posterizeValue = posterizeValue; exports.rgbToGray = rgbToGray; exports.hexToRgb = hexToRgb; exports.toneLuts = toneLuts; exports.compileAdjustmentLayer = compileAdjustmentLayer; exports.activeAdjustmentLayers = activeAdjustmentLayers; exports.evaluateAdjustmentLayers = evaluateAdjustmentLayers; exports.applyAdjustmentLayers = applyAdjustmentLayers; exports.applyAdjustmentLayersFloat = applyAdjustmentLayersFloat; exports.adjustmentLayersKey = adjustmentLayersKey; exports.applyAdjustments = applyAdjustments; exports.applyLegacyAdjustments = applyLegacyAdjustments; exports.applyProcess2Adjustments = applyProcess2Adjustments; exports.applyProcess2Float = applyProcess2Float; exports.applyBoxBlurFloat = applyBoxBlurFloat; exports.applyBoxBlur = applyBoxBlur; exports.applyDepthMask = applyDepthMask; exports.removeAlpha = removeAlpha; exports.TEXT_ALIGNS = TEXT_ALIGNS; exports.SHAPE_OPERATIONS = SHAPE_OPERATIONS; exports.LIVE_SHAPE_KINDS = LIVE_SHAPE_KINDS; exports.newLayerId = newLayerId; exports.pixelLayers = pixelLayers; exports.developFilter = developFilter; exports.blurFilter = blurFilter; exports.isActiveFilter = isActiveFilter; exports.isSpatialFilter = isSpatialFilter; exports.pixelLayerBounds = pixelLayerBounds; exports.layerTypeLabel = layerTypeLabel; exports.hasSurface = hasSurface; exports.isRenderedLayer = isRenderedLayer; exports.shapeLayers = shapeLayers; exports.smartObjectLayers = smartObjectLayers; exports.adjustmentNodeAsLayer = adjustmentNodeAsLayer; exports.depthMaskAlpha = depthMaskAlpha; exports.runLayerFilters = runLayerFilters; exports.runLayerFiltersFloat = runLayerFiltersFloat; exports.LayerCompositor = LayerCompositor; exports.compositeDeep = compositeDeep; exports.DEFAULT_ADJUSTMENTS_VALUES = DEFAULT_ADJUSTMENTS_VALUES; exports.DEFAULT_TRANSFORM_VALUES = DEFAULT_TRANSFORM_VALUES; exports.DEFAULT_DEPTH_MASK_VALUES = DEFAULT_DEPTH_MASK_VALUES; exports.flattenPath = flattenPath; exports.rasterizeCoverage = rasterizeCoverage; exports.LayerOperationError = LayerOperationError; exports.requireLayer = requireLayer; exports.requireUnlocked = requireUnlocked; exports.placeLayer = placeLayer; exports.removeLayer = removeLayer; exports.moveLayer = moveLayer; exports.withNewIds = withNewIds; exports.duplicateLayer = duplicateLayer; exports.setLayerProperties = setLayerProperties; exports.groupLayers = groupLayers; exports.ungroupLayer = ungroupLayer; exports.offsetLayer = offsetLayer; exports.setLayerMask = setLayerMask; exports.normalizeFilter = normalizeFilter; exports.addLayerFilter = addLayerFilter; exports.updateLayerFilter = updateLayerFilter; exports.removeLayerFilter = removeLayerFilter; exports.layerEffectsOf = layerEffectsOf; exports.setLayerEffects = setLayerEffects; exports.addLayerEffect = addLayerEffect; exports.updateLayerEffect = updateLayerEffect; exports.removeLayerEffect = removeLayerEffect; exports.setLayerEffectsEnabled = setLayerEffectsEnabled; exports.parseBlend = parseBlend; exports.unionRect = unionRect; exports.SHAPE_RENDER_MARGIN = SHAPE_RENDER_MARGIN; exports.DEFAULT_MITER_LIMIT = DEFAULT_MITER_LIMIT; exports.mapSubpaths = mapSubpaths; exports.liveShapeSubpaths = liveShapeSubpaths; exports.liveComponent = liveComponent; exports.componentPath = componentPath; exports.shapeOutline = shapeOutline; exports.shapeGeometryBounds = shapeGeometryBounds; exports.shapeRenderClip = shapeRenderClip; exports.renderShapeRect = renderShapeRect; exports.renderShape = renderShape; exports.rerenderShape = rerenderShape; exports.normalizeShapePaint = normalizeShapePaint; exports.normalizeShapeStroke = normalizeShapeStroke; exports.normalizeLiveShape = normalizeLiveShape; exports.normalizeSubpaths = normalizeSubpaths; exports.requireOperation = requireOperation; exports.requireShapeLayer = requireShapeLayer; exports.createShapeLayer = createShapeLayer; exports.defaultShapeName = defaultShapeName; exports.updateShapeLayer = updateShapeLayer; exports.transformShapeComponents = transformShapeComponents; exports.offsetShape = offsetShape; exports.mergeShapeComponents = mergeShapeComponents; exports.shapeAsPixelLayer = shapeAsPixelLayer; exports.shapeFromAnnotation = shapeFromAnnotation; exports.annotationBlend = annotationBlend; exports.annotationOfShape = annotationOfShape; exports.TEXT_RENDER_MARGIN = TEXT_RENDER_MARGIN; exports.textMatrix = textMatrix; exports.textOutlines = textOutlines; exports.renderText = renderText; exports.rerenderText = rerenderText; exports.TEXT_STYLE_FIELDS = TEXT_STYLE_FIELDS; exports.patchTextStyle = patchTextStyle; exports.PARAGRAPH_STYLE_FIELDS = PARAGRAPH_STYLE_FIELDS; exports.patchParagraphStyle = patchParagraphStyle; exports.textRange = textRange; exports.requireTypeLayer = requireTypeLayer; exports.normalizeText = normalizeText; exports.typeLayerName = typeLayerName; exports.createTypeLayer = createTypeLayer; exports.updateTypeLayer = updateTypeLayer; exports.replaceTextRange = replaceTextRange; exports.transformTypeLayer = transformTypeLayer; exports.typeFrame = typeFrame; exports.typeAsPixelLayer = typeAsPixelLayer; exports.toTextSpace = toTextSpace; exports.typeFromAnnotation = typeFromAnnotation; exports.annotationOfType = annotationOfType; exports.BACKGROUND_LAYER_ID = BACKGROUND_LAYER_ID; exports.BACKGROUND_LAYER_NAME = BACKGROUND_LAYER_NAME; exports.DEVELOP_FILTER_ID = DEVELOP_FILTER_ID; exports.BLUR_FILTER_ID = BLUR_FILTER_ID; exports.rasterMaskFromLegacy = rasterMaskFromLegacy; exports.hasResampledLegacyMask = hasResampledLegacyMask; exports.legacyMaskOf = legacyMaskOf; exports.isDefaultDepthMask = isDefaultDepthMask; exports.developFromAdjustments = developFromAdjustments; exports.annotationLayerName = annotationLayerName; exports.annotationLayerFor = annotationLayerFor; exports.annotationOfLayer = annotationOfLayer; exports.adjustmentNodeFromLegacy = adjustmentNodeFromLegacy; exports.backgroundLayer = backgroundLayer; exports.depthRasterMask = depthRasterMask; exports.layersFromLegacy = layersFromLegacy; exports.legacyAdjustmentLayer = legacyAdjustmentLayer; exports.developTarget = developTarget; exports.legacyView = legacyView; exports.isLegacyShape = isLegacyShape; exports.FREE_TRANSFORM_MODES = FREE_TRANSFORM_MODES; exports.TRANSFORM_ANCHORS = TRANSFORM_ANCHORS; exports.isTransformAnchor = isTransformAnchor; exports.identityTransform = identityTransform; exports.cornersFromMatrix = cornersFromMatrix; exports.matrixFromCorners = matrixFromCorners; exports.transformHomography = transformHomography; exports.hasWarp = hasWarp; exports.isIdentityTransform = isIdentityTransform; exports.transformMap = transformMap; exports.transformedPoint = transformedPoint; exports.anchorPoint = anchorPoint; exports.transformedBox = transformedBox; exports.referencePoint = referencePoint; exports.matrixFromParams = matrixFromParams; exports.describeTransform = describeTransform; exports.applyParams = applyParams; exports.flipCorners = flipCorners; exports.boxPointOf = boxPointOf; exports.presetWarp = presetWarp; exports.isValidWarp = isValidWarp; exports.geometryHomography = geometryHomography; exports.SMART_RENDER_MARGIN = SMART_RENDER_MARGIN; exports.isSmartSurfaceIncomplete = isSmartSurfaceIncomplete; exports.newContentsId = newContentsId; exports.contentsBox = contentsBox; exports.placementGeometry = placementGeometry; exports.placementAt = placementAt; exports.isContentsDecoded = isContentsDecoded; exports.requireSmartObject = requireSmartObject; exports.contentsSurface = contentsSurface; exports.rasterContents = rasterContents; exports.documentContents = documentContents; exports.placeContents = placeContents; exports.activeSmartFilters = activeSmartFilters; exports.activeEffectSmartFilters = activeEffectSmartFilters; exports.filterMaskCoverage = filterMaskCoverage; exports.applySmartFilters = applySmartFilters; exports.renderSmartObject = renderSmartObject; exports.rerender = rerender; exports.normalizePlacement = normalizePlacement; exports.setSmartPlacement = setSmartPlacement; exports.offsetSmartObject = offsetSmartObject; exports.convertToSmartObject = convertToSmartObject; exports.rasterizeSmartObject = rasterizeSmartObject; exports.copySmartObject = copySmartObject; exports.instancesOf = instancesOf; exports.replaceContents = replaceContents; exports.normalizeSmartFilter = normalizeSmartFilter; exports.addSmartFilter = addSmartFilter; exports.updateSmartFilter = updateSmartFilter; exports.removeSmartFilter = removeSmartFilter; exports.moveSmartFilter = moveSmartFilter; exports.setSmartFiltersEnabled = setSmartFiltersEnabled; exports.setSmartFilterMask = setSmartFilterMask; exports.withFilterMaskSurface = withFilterMaskSurface; exports.placementBounds = placementBounds; exports.LAYERED_SCHEMA_VERSION = LAYERED_SCHEMA_VERSION; exports.serializePatterns = serializePatterns; exports.deserializePatterns = deserializePatterns; exports.encodeSurface = encodeSurface; exports.encodeDeepSurface = encodeDeepSurface; exports.decodeDeepSurface = decodeDeepSurface; exports.serializeEffects = serializeEffects; exports.deserializeEffects = deserializeEffects; exports.serializeLayer = serializeLayer; exports.serializeContents = serializeContents; exports.serializeLayers = serializeLayers; exports.serializeLayersExternal = serializeLayersExternal; exports.resolveExternalAssets = resolveExternalAssets; exports.decodePngDataUrl = decodePngDataUrl; exports.deserializeLayer = deserializeLayer; exports.deserializeLayers = deserializeLayers; exports.PsdError = PsdError; exports.parseVersionedDescriptor = parseVersionedDescriptor; exports.versionedDescriptorBytes = versionedDescriptorBytes; exports.ADJUSTMENT_KEYS = ADJUSTMENT_KEYS; exports.SUPPORTED_ADJUSTMENT_KEYS = SUPPORTED_ADJUSTMENT_KEYS; exports.parseAdjustmentBlock = parseAdjustmentBlock; exports.writeAdjustmentBlock = writeAdjustmentBlock; exports.parseLfx2 = parseLfx2; exports.writeLfx2 = writeLfx2; exports.parseLrfx = parseLrfx; exports.decodePlanes = decodePlanes; exports.encodeRle = encodeRle; exports.BROWSER_IMAGE_TYPES = BROWSER_IMAGE_TYPES; exports.readPsd = readPsd; exports.layerName = layerName; exports.layerTree = layerTree; exports.decodeLayerChannel = decodeLayerChannel; exports.decodeMergedImage = decodeMergedImage; exports.writePsd = writePsd; exports.PATTERN_BLOCK_KEYS = PATTERN_BLOCK_KEYS; exports.parsePatternBlock = parsePatternBlock; exports.psdPatternToEffectPattern = psdPatternToEffectPattern; exports.writePatternBlock = writePatternBlock; exports.PSD_BLEND_KEYS = PSD_BLEND_KEYS; exports.psdToLayers = psdToLayers; exports.importPsd = importPsd; exports.smartContentsFile = smartContentsFile; exports.exportPsd = exportPsd;
|
|
11768
|
-
//# sourceMappingURL=chunk-55UEZIU4.cjs.map
|
|
11806
|
+
|
|
11807
|
+
exports.LEGACY_PROCESS_VERSION = LEGACY_PROCESS_VERSION; exports.LATEST_PROCESS_VERSION = LATEST_PROCESS_VERSION; exports.normalizeProcessVersion = normalizeProcessVersion; exports.srgbToLinear = srgbToLinear; exports.linearToSrgb = linearToSrgb; exports.LUMA_709 = LUMA_709; exports.IDENTITY_MATRIX3 = IDENTITY_MATRIX3; exports.mulMatrix3 = mulMatrix3; exports.applyMatrix3 = applyMatrix3; exports.invertMatrix3 = invertMatrix3; exports.D65 = D65; exports.bradfordAdaptation = bradfordAdaptation; exports.wbMatrix = wbMatrix; exports.linearSrgbToXy = linearSrgbToXy; exports.TINT_SCALE = TINT_SCALE; exports.MIN_KELVIN = MIN_KELVIN; exports.MAX_KELVIN = MAX_KELVIN; exports.xyToUv = xyToUv; exports.uvToXy = uvToXy; exports.tempTintToXy = tempTintToXy; exports.xyToTempTint = xyToTempTint; exports.AS_SHOT_KELVIN = AS_SHOT_KELVIN; exports.MIRED_PER_TEMPERATURE_UNIT = MIRED_PER_TEMPERATURE_UNIT; exports.temperatureToKelvin = temperatureToKelvin; exports.kelvinToTemperature = kelvinToTemperature; exports.whiteBalanceMatrix = whiteBalanceMatrix; exports.whiteBalanceFromSample = whiteBalanceFromSample; exports.TONE_LUT_SIZE = TONE_LUT_SIZE; exports.toneCurve = toneCurve; exports.buildToneLut = buildToneLut; exports.sampleToneLut = sampleToneLut; exports.normalizeAngle = normalizeAngle; exports.isQuarterTurnSwapped = isQuarterTurnSwapped; exports.getRotatedSize = getRotatedSize; exports.projectImagePoint = projectImagePoint; exports.unprojectCanvasPoint = unprojectCanvasPoint; exports.applyImageProjectionToContext = applyImageProjectionToContext; exports.projectImageRect = projectImageRect; exports.clampCropToImage = clampCropToImage; exports.getViewportProjection = getViewportProjection; exports.getViewportMetrics = getViewportMetrics; exports.canvasToImagePoint = canvasToImagePoint; exports.imageToCanvasPoint = imageToCanvasPoint; exports.mapCropHandle = mapCropHandle; exports.hitTestCrop = hitTestCrop; exports.getCropCursor = getCropCursor; exports.calculateCropDrag = calculateCropDrag; exports.getAnnotationBounds = getAnnotationBounds; exports.hitTestAnnotation = hitTestAnnotation; exports.SELECTION_MODES = SELECTION_MODES; exports.isSelectionMode = isSelectionMode; exports.parseSelectionMode = parseSelectionMode; exports.computeSelectionBounds = computeSelectionBounds; exports.createSelectionMask = createSelectionMask; exports.fullSelection = fullSelection; exports.isSelectionEmpty = isSelectionEmpty; exports.selectionValueAt = selectionValueAt; exports.coverageToByte = coverageToByte; exports.selectionFromCoverage = selectionFromCoverage; exports.selectionToCoverage = selectionToCoverage; exports.selectionArea = selectionArea; exports.combineSelections = combineSelections; exports.invertSelection = invertSelection; exports.resizeSelection = resizeSelection; exports.selectionFromPixels = selectionFromPixels; exports.selectionToPixels = selectionToPixels; exports.encodeSelectionRle = encodeSelectionRle; exports.decodeSelectionRle = decodeSelectionRle; exports.serializeSelection = serializeSelection; exports.deserializeSelection = deserializeSelection; exports.hashMaskContent = hashMaskContent; exports.EMPTY_DISTANCE = EMPTY_DISTANCE; exports.distanceTransform = distanceTransform; exports.expandCoverage = expandCoverage; exports.contractCoverage = contractCoverage; exports.borderCoverage = borderCoverage; exports.smoothCoverage = smoothCoverage; exports.featherCoverage = featherCoverage; exports.greyMorphology = greyMorphology; exports.shiftCoverage = shiftCoverage; exports.SELECTION_MODIFY_OPS = SELECTION_MODIFY_OPS; exports.modifySelection = modifySelection; exports.normalizeLayerMask = normalizeLayerMask; exports.layerMaskFromSelection = layerMaskFromSelection; exports.updateLayerMaskProps = updateLayerMaskProps; exports.decodeLayerMask = decodeLayerMask; exports.layerMaskKey = layerMaskKey; exports.layerMaskCoverage = layerMaskCoverage; exports.projectMaskCoverage = projectMaskCoverage; exports.buildLayerMaskPlanes = buildLayerMaskPlanes; exports.ADJUSTMENT_LUT_SIZE = ADJUSTMENT_LUT_SIZE; exports.sampleLut = sampleLut; exports.ADJUSTMENT_KINDS = ADJUSTMENT_KINDS; exports.isAdjustmentKind = isAdjustmentKind; exports.adjustmentKindLabel = adjustmentKindLabel; exports.HUE_RANGE_LABELS = HUE_RANGE_LABELS; exports.neutralHueRange = neutralHueRange; exports.identityCurve = identityCurve; exports.identityLevels = identityLevels; exports.defaultAdjustmentParams = defaultAdjustmentParams; exports.createAdjustmentLayer = createAdjustmentLayer; exports.normalizeAdjustmentLayer = normalizeAdjustmentLayer; exports.normalizeAdjustmentLayers = normalizeAdjustmentLayers; exports.curveLutFromLevels = curveLutFromLevels; exports.levelsValue = levelsValue; exports.rgbToHsl = rgbToHsl; exports.hslToRgb = hslToRgb; exports.hueRangeWeight = hueRangeWeight; exports.hueRangeTables = hueRangeTables; exports.hueSaturation = hueSaturation; exports.rangeLightness = rangeLightness; exports.VIBRANCE_GREY = VIBRANCE_GREY; exports.vibranceLinear = vibranceLinear; exports.vibrancePixel = vibrancePixel; exports.colorBalanceChannel = colorBalanceChannel; exports.blackWhiteGray = blackWhiteGray; exports.D50 = D50; exports.XYZ_D50_TO_SRGB = XYZ_D50_TO_SRGB; exports.photoFilterMatrix = photoFilterMatrix; exports.posterizeValue = posterizeValue; exports.rgbToGray = rgbToGray; exports.hexToRgb = hexToRgb; exports.toneLuts = toneLuts; exports.compileAdjustmentLayer = compileAdjustmentLayer; exports.activeAdjustmentLayers = activeAdjustmentLayers; exports.evaluateAdjustmentLayers = evaluateAdjustmentLayers; exports.applyAdjustmentLayers = applyAdjustmentLayers; exports.applyAdjustmentLayersFloat = applyAdjustmentLayersFloat; exports.adjustmentLayersKey = adjustmentLayersKey; exports.applyAdjustments = applyAdjustments; exports.applyLegacyAdjustments = applyLegacyAdjustments; exports.applyLegacyFloat = applyLegacyFloat; exports.applyProcess2Adjustments = applyProcess2Adjustments; exports.applyProcess2Float = applyProcess2Float; exports.applyBoxBlurFloat = applyBoxBlurFloat; exports.applyBoxBlur = applyBoxBlur; exports.applyDepthMask = applyDepthMask; exports.removeAlpha = removeAlpha; exports.TEXT_ALIGNS = TEXT_ALIGNS; exports.SHAPE_OPERATIONS = SHAPE_OPERATIONS; exports.LIVE_SHAPE_KINDS = LIVE_SHAPE_KINDS; exports.newLayerId = newLayerId; exports.pixelLayers = pixelLayers; exports.developFilter = developFilter; exports.blurFilter = blurFilter; exports.isActiveFilter = isActiveFilter; exports.isSpatialFilter = isSpatialFilter; exports.pixelLayerBounds = pixelLayerBounds; exports.layerTypeLabel = layerTypeLabel; exports.hasSurface = hasSurface; exports.isRenderedLayer = isRenderedLayer; exports.shapeLayers = shapeLayers; exports.smartObjectLayers = smartObjectLayers; exports.adjustmentNodeAsLayer = adjustmentNodeAsLayer; exports.depthMaskAlpha = depthMaskAlpha; exports.runLayerFilters = runLayerFilters; exports.runLayerFiltersFloat = runLayerFiltersFloat; exports.LayerCompositor = LayerCompositor; exports.compositeDeep = compositeDeep; exports.DEFAULT_ADJUSTMENTS_VALUES = DEFAULT_ADJUSTMENTS_VALUES; exports.DEFAULT_TRANSFORM_VALUES = DEFAULT_TRANSFORM_VALUES; exports.DEFAULT_DEPTH_MASK_VALUES = DEFAULT_DEPTH_MASK_VALUES; exports.flattenPath = flattenPath; exports.rasterizeCoverage = rasterizeCoverage; exports.LayerOperationError = LayerOperationError; exports.requireLayer = requireLayer; exports.requireUnlocked = requireUnlocked; exports.placeLayer = placeLayer; exports.removeLayer = removeLayer; exports.moveLayer = moveLayer; exports.withNewIds = withNewIds; exports.duplicateLayer = duplicateLayer; exports.setLayerProperties = setLayerProperties; exports.groupLayers = groupLayers; exports.ungroupLayer = ungroupLayer; exports.offsetLayer = offsetLayer; exports.setLayerMask = setLayerMask; exports.normalizeFilter = normalizeFilter; exports.addLayerFilter = addLayerFilter; exports.updateLayerFilter = updateLayerFilter; exports.removeLayerFilter = removeLayerFilter; exports.layerEffectsOf = layerEffectsOf; exports.setLayerEffects = setLayerEffects; exports.addLayerEffect = addLayerEffect; exports.updateLayerEffect = updateLayerEffect; exports.removeLayerEffect = removeLayerEffect; exports.setLayerEffectsEnabled = setLayerEffectsEnabled; exports.parseBlend = parseBlend; exports.unionRect = unionRect; exports.SHAPE_RENDER_MARGIN = SHAPE_RENDER_MARGIN; exports.DEFAULT_MITER_LIMIT = DEFAULT_MITER_LIMIT; exports.mapSubpaths = mapSubpaths; exports.liveShapeSubpaths = liveShapeSubpaths; exports.liveComponent = liveComponent; exports.componentPath = componentPath; exports.shapeOutline = shapeOutline; exports.shapeGeometryBounds = shapeGeometryBounds; exports.shapeRenderClip = shapeRenderClip; exports.renderShapeRect = renderShapeRect; exports.renderShape = renderShape; exports.rerenderShape = rerenderShape; exports.normalizeShapePaint = normalizeShapePaint; exports.normalizeShapeStroke = normalizeShapeStroke; exports.normalizeLiveShape = normalizeLiveShape; exports.normalizeSubpaths = normalizeSubpaths; exports.requireOperation = requireOperation; exports.requireShapeLayer = requireShapeLayer; exports.createShapeLayer = createShapeLayer; exports.defaultShapeName = defaultShapeName; exports.updateShapeLayer = updateShapeLayer; exports.transformShapeComponents = transformShapeComponents; exports.offsetShape = offsetShape; exports.mergeShapeComponents = mergeShapeComponents; exports.shapeAsPixelLayer = shapeAsPixelLayer; exports.shapeFromAnnotation = shapeFromAnnotation; exports.annotationBlend = annotationBlend; exports.annotationOfShape = annotationOfShape; exports.TEXT_RENDER_MARGIN = TEXT_RENDER_MARGIN; exports.textMatrix = textMatrix; exports.textOutlines = textOutlines; exports.renderText = renderText; exports.rerenderText = rerenderText; exports.TEXT_STYLE_FIELDS = TEXT_STYLE_FIELDS; exports.patchTextStyle = patchTextStyle; exports.PARAGRAPH_STYLE_FIELDS = PARAGRAPH_STYLE_FIELDS; exports.patchParagraphStyle = patchParagraphStyle; exports.textRange = textRange; exports.requireTypeLayer = requireTypeLayer; exports.normalizeText = normalizeText; exports.typeLayerName = typeLayerName; exports.createTypeLayer = createTypeLayer; exports.updateTypeLayer = updateTypeLayer; exports.replaceTextRange = replaceTextRange; exports.transformTypeLayer = transformTypeLayer; exports.typeFrame = typeFrame; exports.typeAsPixelLayer = typeAsPixelLayer; exports.toTextSpace = toTextSpace; exports.typeFromAnnotation = typeFromAnnotation; exports.annotationOfType = annotationOfType; exports.BACKGROUND_LAYER_ID = BACKGROUND_LAYER_ID; exports.BACKGROUND_LAYER_NAME = BACKGROUND_LAYER_NAME; exports.DEVELOP_FILTER_ID = DEVELOP_FILTER_ID; exports.BLUR_FILTER_ID = BLUR_FILTER_ID; exports.rasterMaskFromLegacy = rasterMaskFromLegacy; exports.hasResampledLegacyMask = hasResampledLegacyMask; exports.legacyMaskOf = legacyMaskOf; exports.isDefaultDepthMask = isDefaultDepthMask; exports.developFromAdjustments = developFromAdjustments; exports.annotationLayerName = annotationLayerName; exports.annotationLayerFor = annotationLayerFor; exports.annotationOfLayer = annotationOfLayer; exports.adjustmentNodeFromLegacy = adjustmentNodeFromLegacy; exports.backgroundLayer = backgroundLayer; exports.depthRasterMask = depthRasterMask; exports.layersFromLegacy = layersFromLegacy; exports.legacyAdjustmentLayer = legacyAdjustmentLayer; exports.developTarget = developTarget; exports.legacyView = legacyView; exports.isLegacyShape = isLegacyShape; exports.FREE_TRANSFORM_MODES = FREE_TRANSFORM_MODES; exports.TRANSFORM_ANCHORS = TRANSFORM_ANCHORS; exports.isTransformAnchor = isTransformAnchor; exports.identityTransform = identityTransform; exports.cornersFromMatrix = cornersFromMatrix; exports.matrixFromCorners = matrixFromCorners; exports.transformHomography = transformHomography; exports.hasWarp = hasWarp; exports.isIdentityTransform = isIdentityTransform; exports.transformMap = transformMap; exports.transformedPoint = transformedPoint; exports.anchorPoint = anchorPoint; exports.transformedBox = transformedBox; exports.referencePoint = referencePoint; exports.matrixFromParams = matrixFromParams; exports.describeTransform = describeTransform; exports.applyParams = applyParams; exports.flipCorners = flipCorners; exports.boxPointOf = boxPointOf; exports.presetWarp = presetWarp; exports.isValidWarp = isValidWarp; exports.geometryHomography = geometryHomography; exports.SMART_RENDER_MARGIN = SMART_RENDER_MARGIN; exports.isSmartSurfaceIncomplete = isSmartSurfaceIncomplete; exports.newContentsId = newContentsId; exports.contentsBox = contentsBox; exports.placementGeometry = placementGeometry; exports.placementAt = placementAt; exports.isContentsDecoded = isContentsDecoded; exports.requireSmartObject = requireSmartObject; exports.contentsSurface = contentsSurface; exports.rasterContents = rasterContents; exports.documentContents = documentContents; exports.placeContents = placeContents; exports.activeSmartFilters = activeSmartFilters; exports.activeEffectSmartFilters = activeEffectSmartFilters; exports.filterMaskCoverage = filterMaskCoverage; exports.applySmartFilters = applySmartFilters; exports.renderSmartObject = renderSmartObject; exports.rerender = rerender; exports.normalizePlacement = normalizePlacement; exports.setSmartPlacement = setSmartPlacement; exports.offsetSmartObject = offsetSmartObject; exports.convertToSmartObject = convertToSmartObject; exports.rasterizeSmartObject = rasterizeSmartObject; exports.copySmartObject = copySmartObject; exports.instancesOf = instancesOf; exports.replaceContents = replaceContents; exports.normalizeSmartFilter = normalizeSmartFilter; exports.addSmartFilter = addSmartFilter; exports.updateSmartFilter = updateSmartFilter; exports.removeSmartFilter = removeSmartFilter; exports.moveSmartFilter = moveSmartFilter; exports.setSmartFiltersEnabled = setSmartFiltersEnabled; exports.setSmartFilterMask = setSmartFilterMask; exports.withFilterMaskSurface = withFilterMaskSurface; exports.placementBounds = placementBounds; exports.LAYERED_SCHEMA_VERSION = LAYERED_SCHEMA_VERSION; exports.serializePatterns = serializePatterns; exports.deserializePatterns = deserializePatterns; exports.encodeSurface = encodeSurface; exports.encodeDeepSurface = encodeDeepSurface; exports.decodeDeepSurface = decodeDeepSurface; exports.serializeEffects = serializeEffects; exports.deserializeEffects = deserializeEffects; exports.serializeLayer = serializeLayer; exports.serializeContents = serializeContents; exports.serializeLayers = serializeLayers; exports.serializeLayersExternal = serializeLayersExternal; exports.resolveExternalAssets = resolveExternalAssets; exports.decodePngDataUrl = decodePngDataUrl; exports.deserializeLayer = deserializeLayer; exports.deserializeLayers = deserializeLayers; exports.PsdError = PsdError; exports.parseVersionedDescriptor = parseVersionedDescriptor; exports.versionedDescriptorBytes = versionedDescriptorBytes; exports.ADJUSTMENT_KEYS = ADJUSTMENT_KEYS; exports.SUPPORTED_ADJUSTMENT_KEYS = SUPPORTED_ADJUSTMENT_KEYS; exports.parseAdjustmentBlock = parseAdjustmentBlock; exports.writeAdjustmentBlock = writeAdjustmentBlock; exports.parseLfx2 = parseLfx2; exports.writeLfx2 = writeLfx2; exports.parseLrfx = parseLrfx; exports.decodePlanes = decodePlanes; exports.encodeRle = encodeRle; exports.BROWSER_IMAGE_TYPES = BROWSER_IMAGE_TYPES; exports.readPsd = readPsd; exports.layerName = layerName; exports.layerTree = layerTree; exports.decodeLayerChannel = decodeLayerChannel; exports.decodeMergedImage = decodeMergedImage; exports.writePsd = writePsd; exports.PATTERN_BLOCK_KEYS = PATTERN_BLOCK_KEYS; exports.parsePatternBlock = parsePatternBlock; exports.psdPatternToEffectPattern = psdPatternToEffectPattern; exports.writePatternBlock = writePatternBlock; exports.PSD_BLEND_KEYS = PSD_BLEND_KEYS; exports.psdToLayers = psdToLayers; exports.importPsd = importPsd; exports.smartContentsFile = smartContentsFile; exports.exportPsd = exportPsd;
|
|
11808
|
+
//# sourceMappingURL=chunk-YAFS2QFZ.cjs.map
|