@pixerate/editor 0.119.0 → 0.120.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 +54 -54
- package/dist/animation-editor/index.d.cts +3 -3
- package/dist/animation-editor/index.d.ts +3 -3
- package/dist/animation-editor/index.js +2 -2
- package/dist/{chunk-KZLQY4CD.js → chunk-BOWUU4LJ.js} +2 -2
- package/dist/{chunk-KGNUFO4T.cjs → chunk-DFLJHLKA.cjs} +36 -36
- package/dist/{chunk-KGNUFO4T.cjs.map → chunk-DFLJHLKA.cjs.map} +1 -1
- package/dist/{chunk-4S2AXNQF.cjs → chunk-HTAFDTNR.cjs} +82 -82
- package/dist/{chunk-4S2AXNQF.cjs.map → chunk-HTAFDTNR.cjs.map} +1 -1
- package/dist/{chunk-LI3KTY7K.cjs → chunk-VYW7JBTM.cjs} +72 -5
- package/dist/chunk-VYW7JBTM.cjs.map +1 -0
- package/dist/{chunk-TDQDMBUR.js → chunk-WAI6ATHC.js} +2 -2
- package/dist/{chunk-CSHEI3YT.js → chunk-WORWH5K5.js} +71 -4
- package/dist/chunk-WORWH5K5.js.map +1 -0
- package/dist/{export-Ds8Ccw0K.d.ts → export-D2D8hb_u.d.ts} +1 -1
- package/dist/{export-B_jO2PrH.d.cts → export-fP2hZYjm.d.cts} +1 -1
- package/dist/image-editor/index.cjs +579 -579
- package/dist/image-editor/index.d.cts +3 -3
- package/dist/image-editor/index.d.ts +3 -3
- package/dist/image-editor/index.js +2 -2
- package/dist/paint-editor/index.cjs +7 -7
- package/dist/paint-editor/index.d.cts +2 -2
- package/dist/paint-editor/index.d.ts +2 -2
- package/dist/paint-editor/index.js +2 -2
- package/dist/{svg-hK0WQc7-.d.cts → svg-S9zzvqaZ.d.cts} +1 -1
- package/dist/{svg-CTxrB5xO.d.ts → svg-leZpRsJB.d.ts} +1 -1
- package/dist/{types-TrSSh_RB.d.ts → types-BgwxFWvn.d.ts} +23 -9
- package/dist/{types-Dq-8qgoo.d.cts → types-DdRTDnza.d.cts} +23 -9
- package/dist/vector/index.cjs +874 -872
- package/dist/vector/index.cjs.map +1 -1
- package/dist/vector/index.d.cts +12 -5
- package/dist/vector/index.d.ts +12 -5
- package/dist/vector/index.js +7 -5
- package/dist/vector/index.js.map +1 -1
- package/package.json +1 -1
- package/skills/pixerate-vector/SKILL.md +1 -1
- package/skills/pixerate-vector/references/commands.md +1 -0
- package/dist/chunk-CSHEI3YT.js.map +0 -1
- package/dist/chunk-LI3KTY7K.cjs.map +0 -1
- /package/dist/{chunk-KZLQY4CD.js.map → chunk-BOWUU4LJ.js.map} +0 -0
- /package/dist/{chunk-TDQDMBUR.js.map → chunk-WAI6ATHC.js.map} +0 -0
|
@@ -118,7 +118,7 @@ var _chunk643B2HKCcjs = require('./chunk-643B2HKC.cjs');
|
|
|
118
118
|
|
|
119
119
|
|
|
120
120
|
|
|
121
|
-
var
|
|
121
|
+
var _chunkVYW7JBTMcjs = require('./chunk-VYW7JBTM.cjs');
|
|
122
122
|
|
|
123
123
|
|
|
124
124
|
|
|
@@ -3326,7 +3326,7 @@ function mapAnchor(a, f) {
|
|
|
3326
3326
|
return out;
|
|
3327
3327
|
}
|
|
3328
3328
|
function mapSubpaths(subpaths, f) {
|
|
3329
|
-
return
|
|
3329
|
+
return _chunkVYW7JBTMcjs.expandVectorCorners.call(void 0, subpaths).map((sp) => ({ closed: sp.closed, anchors: sp.anchors.map((a) => mapAnchor(a, f)) }));
|
|
3330
3330
|
}
|
|
3331
3331
|
function liveShapeSubpaths(live) {
|
|
3332
3332
|
let out;
|
|
@@ -3334,19 +3334,19 @@ function liveShapeSubpaths(live) {
|
|
|
3334
3334
|
case "rect": {
|
|
3335
3335
|
const x = Math.min(live.x, live.x + live.width);
|
|
3336
3336
|
const y = Math.min(live.y, live.y + live.height);
|
|
3337
|
-
const sp =
|
|
3337
|
+
const sp = _chunkVYW7JBTMcjs.rectSubpath.call(void 0, { x, y, width: Math.abs(live.width), height: Math.abs(live.height) });
|
|
3338
3338
|
const r = _nullishCoalesce(live.radii, () => ( [0, 0, 0, 0]));
|
|
3339
|
-
out = [{ closed: true, anchors: sp.anchors.map((a, i) => r[i] > 0 ?
|
|
3339
|
+
out = [{ closed: true, anchors: sp.anchors.map((a, i) => r[i] > 0 ? _chunkVYW7JBTMcjs.setAnchorCorner.call(void 0, a, r[i]) : a) }];
|
|
3340
3340
|
break;
|
|
3341
3341
|
}
|
|
3342
3342
|
case "ellipse":
|
|
3343
|
-
out = [
|
|
3343
|
+
out = [_chunkVYW7JBTMcjs.ellipseSubpath.call(void 0, normBox(live))];
|
|
3344
3344
|
break;
|
|
3345
3345
|
case "polygon":
|
|
3346
|
-
out = [
|
|
3346
|
+
out = [_chunkVYW7JBTMcjs.polygonSubpath.call(void 0, normBox(live), live.sides)];
|
|
3347
3347
|
break;
|
|
3348
3348
|
case "star":
|
|
3349
|
-
out = [
|
|
3349
|
+
out = [_chunkVYW7JBTMcjs.starSubpath.call(void 0, normBox(live), live.points, Math.max(0, Math.min(1, live.innerRatio)))];
|
|
3350
3350
|
break;
|
|
3351
3351
|
case "line": {
|
|
3352
3352
|
const a = { x: live.x1, y: live.y1 };
|
|
@@ -3369,7 +3369,7 @@ function liveShapeSubpaths(live) {
|
|
|
3369
3369
|
}
|
|
3370
3370
|
}
|
|
3371
3371
|
const m = live.transform;
|
|
3372
|
-
return m && !
|
|
3372
|
+
return m && !_chunkVYW7JBTMcjs.isIdentityMatrix.call(void 0, m) ? mapSubpaths(out, (p) => _chunkVYW7JBTMcjs.applyMatrix.call(void 0, m, p)) : out;
|
|
3373
3373
|
}
|
|
3374
3374
|
function normBox(b) {
|
|
3375
3375
|
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) };
|
|
@@ -3381,7 +3381,7 @@ var pathCache = /* @__PURE__ */ new WeakMap();
|
|
|
3381
3381
|
function componentPath(c) {
|
|
3382
3382
|
let p = pathCache.get(c.subpaths);
|
|
3383
3383
|
if (!p) {
|
|
3384
|
-
p =
|
|
3384
|
+
p = _chunkVYW7JBTMcjs.subpathsToBezier.call(void 0, c.subpaths);
|
|
3385
3385
|
pathCache.set(c.subpaths, p);
|
|
3386
3386
|
}
|
|
3387
3387
|
return p;
|
|
@@ -3704,7 +3704,7 @@ function matrixArg(v, path) {
|
|
|
3704
3704
|
if (!Array.isArray(v) || v.length !== 6 || !v.every(isNum)) fail2(`${path} must be six numbers [a, b, c, d, e, f].`);
|
|
3705
3705
|
const m = v;
|
|
3706
3706
|
if (Math.abs(m[0] * m[3] - m[1] * m[2]) < 1e-12) fail2(`${path} is singular.`);
|
|
3707
|
-
return
|
|
3707
|
+
return _chunkVYW7JBTMcjs.isIdentityMatrix.call(void 0, m) ? void 0 : [...m];
|
|
3708
3708
|
}
|
|
3709
3709
|
function normalizeLiveShape(v, path = "shape") {
|
|
3710
3710
|
if (!v || typeof v !== "object") return fail2(`${path} must be an object with kind ${LIVE_SHAPE_KINDS.join(", ")}.`);
|
|
@@ -3765,7 +3765,7 @@ function normalizeSubpaths(v, path = "subpaths") {
|
|
|
3765
3765
|
if (typeof v === "string") {
|
|
3766
3766
|
let subs;
|
|
3767
3767
|
try {
|
|
3768
|
-
subs =
|
|
3768
|
+
subs = _chunkVYW7JBTMcjs.bezierToSubpaths.call(void 0, v);
|
|
3769
3769
|
} catch (e5) {
|
|
3770
3770
|
return fail2(`${path}: could not read the SVG path data.`);
|
|
3771
3771
|
}
|
|
@@ -3851,15 +3851,15 @@ function updateShapeLayer(layers, id, change, env, action = "edit it") {
|
|
|
3851
3851
|
function transformShapeComponents(components, f, affine) {
|
|
3852
3852
|
return components.map((c) => {
|
|
3853
3853
|
if (affine && c.live) {
|
|
3854
|
-
const live = { ...c.live, transform:
|
|
3855
|
-
if (
|
|
3854
|
+
const live = { ...c.live, transform: _chunkVYW7JBTMcjs.multiplyMatrices.call(void 0, _nullishCoalesce(c.live.transform, () => ( _chunkVYW7JBTMcjs.IDENTITY_MATRIX)), affine) };
|
|
3855
|
+
if (_chunkVYW7JBTMcjs.isIdentityMatrix.call(void 0, live.transform)) delete live.transform;
|
|
3856
3856
|
return { op: c.op, subpaths: liveShapeSubpaths(live), live };
|
|
3857
3857
|
}
|
|
3858
3858
|
return { op: c.op, subpaths: mapSubpaths(c.subpaths, f) };
|
|
3859
3859
|
});
|
|
3860
3860
|
}
|
|
3861
3861
|
function offsetShape(layer, dx, dy, env) {
|
|
3862
|
-
const m =
|
|
3862
|
+
const m = _chunkVYW7JBTMcjs.translateMatrix.call(void 0, dx, dy);
|
|
3863
3863
|
const next = { ...layer, components: transformShapeComponents(layer.components, (p) => ({ x: p.x + dx, y: p.y + dy }), m) };
|
|
3864
3864
|
delete next.annotation;
|
|
3865
3865
|
return rerenderShape(next, env);
|
|
@@ -3867,7 +3867,7 @@ function offsetShape(layer, dx, dy, env) {
|
|
|
3867
3867
|
function mergeShapeComponents(components, fillRule = "nonzero") {
|
|
3868
3868
|
if (components.length < 2) return [...components];
|
|
3869
3869
|
const path = shapeOutline(components, fillRule);
|
|
3870
|
-
const subpaths =
|
|
3870
|
+
const subpaths = _chunkVYW7JBTMcjs.bezierToSubpaths.call(void 0, path);
|
|
3871
3871
|
if (!subpaths.length) fail2("The components combine to nothing (the operations remove every area), so there is nothing to merge into.");
|
|
3872
3872
|
return [{ op: "combine", subpaths }];
|
|
3873
3873
|
}
|
|
@@ -3884,7 +3884,7 @@ function annotationPaint(color, opacity) {
|
|
|
3884
3884
|
function shapeFromAnnotation(a) {
|
|
3885
3885
|
const opacity = _nullishCoalesce(a.opacity, () => ( 1));
|
|
3886
3886
|
const lineWidth = "strokeWidth" in a && a.strokeWidth > 0 ? a.strokeWidth : 1;
|
|
3887
|
-
const rotation = a.rotation ?
|
|
3887
|
+
const rotation = a.rotation ? _chunkVYW7JBTMcjs.rotateMatrix.call(void 0, a.rotation, { x: a.x, y: a.y }) : void 0;
|
|
3888
3888
|
const t = rotation ? { transform: rotation } : {};
|
|
3889
3889
|
const live = (l) => liveComponent(l);
|
|
3890
3890
|
switch (a.type) {
|
|
@@ -3927,7 +3927,7 @@ function shapeFromAnnotation(a) {
|
|
|
3927
3927
|
case "pen": {
|
|
3928
3928
|
const paint = annotationPaint(a.strokeColor, opacity);
|
|
3929
3929
|
if (!paint) return null;
|
|
3930
|
-
const pts = rotation ? a.points.map((p) =>
|
|
3930
|
+
const pts = rotation ? a.points.map((p) => _chunkVYW7JBTMcjs.applyMatrix.call(void 0, rotation, p)) : a.points;
|
|
3931
3931
|
const subpaths = pts.length > 1 ? [{ closed: false, anchors: pts.map((p) => ({ x: p.x, y: p.y })) }] : [];
|
|
3932
3932
|
return {
|
|
3933
3933
|
components: [{ op: "combine", subpaths }],
|
|
@@ -3960,7 +3960,7 @@ var fail3 = (message) => {
|
|
|
3960
3960
|
};
|
|
3961
3961
|
var TEXT_RENDER_MARGIN = _chunkWMRIG4XQcjs.MAX_EFFECT_REACH;
|
|
3962
3962
|
function textMatrix(layer) {
|
|
3963
|
-
return _nullishCoalesce(layer.transform, () => (
|
|
3963
|
+
return _nullishCoalesce(layer.transform, () => ( _chunkVYW7JBTMcjs.IDENTITY_MATRIX));
|
|
3964
3964
|
}
|
|
3965
3965
|
function rectCorners(r) {
|
|
3966
3966
|
return [
|
|
@@ -3971,7 +3971,7 @@ function rectCorners(r) {
|
|
|
3971
3971
|
];
|
|
3972
3972
|
}
|
|
3973
3973
|
function docRect(r, m) {
|
|
3974
|
-
const pts = rectCorners(r).map((p) =>
|
|
3974
|
+
const pts = rectCorners(r).map((p) => _chunkVYW7JBTMcjs.applyMatrix.call(void 0, m, p));
|
|
3975
3975
|
const x0 = Math.floor(Math.min(...pts.map((p) => p.x)));
|
|
3976
3976
|
const y0 = Math.floor(Math.min(...pts.map((p) => p.y)));
|
|
3977
3977
|
const x1 = Math.ceil(Math.max(...pts.map((p) => p.x)));
|
|
@@ -4004,14 +4004,14 @@ function inkBounds(layout) {
|
|
|
4004
4004
|
}
|
|
4005
4005
|
function textOutlines(layer, shaper) {
|
|
4006
4006
|
if (!shaper.outline) fail3(`The text shaper "${shaper.id}" cannot give glyph outlines; plug in an outline shaper (createOutlineTextShaper) to convert text to shapes.`);
|
|
4007
|
-
const layout =
|
|
4007
|
+
const layout = _chunkVYW7JBTMcjs.layoutText.call(void 0, layer, shaper);
|
|
4008
4008
|
const m = textMatrix(layer);
|
|
4009
4009
|
const out = [];
|
|
4010
4010
|
for (const l of layout.lines) {
|
|
4011
4011
|
for (const f of l.fragments) {
|
|
4012
|
-
let path =
|
|
4013
|
-
for (const r of
|
|
4014
|
-
out.push({ fragment: f, path:
|
|
4012
|
+
let path = _chunkVYW7JBTMcjs.textFragmentOutline.call(void 0, shaper, layer.text, f);
|
|
4013
|
+
for (const r of _chunkVYW7JBTMcjs.textDecorations.call(void 0, f, l)) path = [...path, ..._chunkVYW7JBTMcjs.textRectPath.call(void 0, r)];
|
|
4014
|
+
out.push({ fragment: f, path: _chunkVYW7JBTMcjs.isIdentityMatrix.call(void 0, m) ? path : _chunkXGD3FSNCcjs.transformBezierPath.call(void 0, path, m) });
|
|
4015
4015
|
}
|
|
4016
4016
|
}
|
|
4017
4017
|
return out;
|
|
@@ -4067,7 +4067,7 @@ function renderOnCanvas(layer, shaper, region, env) {
|
|
|
4067
4067
|
const canvas = env.createCanvas(region.width, region.height);
|
|
4068
4068
|
const ctx = canvas.getContext("2d");
|
|
4069
4069
|
if (!ctx || typeof ctx.getImageData !== "function") return null;
|
|
4070
|
-
const layout =
|
|
4070
|
+
const layout = _chunkVYW7JBTMcjs.layoutText.call(void 0, layer, shaper);
|
|
4071
4071
|
const m = textMatrix(layer);
|
|
4072
4072
|
ctx.setTransform(1, 0, 0, 1, 0, 0);
|
|
4073
4073
|
ctx.clearRect(0, 0, region.width, region.height);
|
|
@@ -4079,8 +4079,8 @@ function renderOnCanvas(layer, shaper, region, env) {
|
|
|
4079
4079
|
ctx.globalAlpha = _nullishCoalesce(f.style.opacity, () => ( 1));
|
|
4080
4080
|
const s = layer.text.slice(f.start, f.end);
|
|
4081
4081
|
if (!f.spaced) shaper.draw(ctx, s, f.font, f.x, f.y);
|
|
4082
|
-
else for (let k = 0; k < s.length; k++) if (!
|
|
4083
|
-
for (const d of
|
|
4082
|
+
else for (let k = 0; k < s.length; k++) if (!_chunkVYW7JBTMcjs.isTextSpace.call(void 0, s[k])) shaper.draw(ctx, s[k], f.font, f.x + f.carets[k], f.y);
|
|
4083
|
+
for (const d of _chunkVYW7JBTMcjs.textDecorations.call(void 0, f, l)) ctx.fillRect(d.x, d.y, d.width, d.height);
|
|
4084
4084
|
}
|
|
4085
4085
|
}
|
|
4086
4086
|
ctx.globalAlpha = 1;
|
|
@@ -4091,7 +4091,7 @@ function renderOnCanvas(layer, shaper, region, env) {
|
|
|
4091
4091
|
function renderText(layer, env) {
|
|
4092
4092
|
const shaper = env.shaper;
|
|
4093
4093
|
if (!shaper || !shaper.outline && !shaper.draw) return null;
|
|
4094
|
-
const layout =
|
|
4094
|
+
const layout = _chunkVYW7JBTMcjs.layoutText.call(void 0, layer, shaper);
|
|
4095
4095
|
const ink = inkBounds(layout);
|
|
4096
4096
|
const clip = { x: -TEXT_RENDER_MARGIN, y: -TEXT_RENDER_MARGIN, width: env.width + 2 * TEXT_RENDER_MARGIN, height: env.height + 2 * TEXT_RENDER_MARGIN };
|
|
4097
4097
|
const region = ink ? intersect2(docRect(ink, textMatrix(layer)), clip) : null;
|
|
@@ -4186,7 +4186,7 @@ function patchParagraphStyle(base, patch, path = "paragraph") {
|
|
|
4186
4186
|
continue;
|
|
4187
4187
|
}
|
|
4188
4188
|
const value = k === "autoLeading" ? num(v, `${path}.${k}`, 0.1, 10) : num(v, `${path}.${k}`, -1e4, 1e4);
|
|
4189
|
-
if (k === "autoLeading" && value ===
|
|
4189
|
+
if (k === "autoLeading" && value === _chunkVYW7JBTMcjs.DEFAULT_AUTO_LEADING || k !== "autoLeading" && value === 0) delete o[k];
|
|
4190
4190
|
else o[k] = value;
|
|
4191
4191
|
} else fail3(`${path}.${k} is not a paragraph style field; use ${PARAGRAPH_STYLE_FIELDS.join(", ")}.`);
|
|
4192
4192
|
}
|
|
@@ -4223,14 +4223,14 @@ function createTypeLayer(init, env, id = newLayerId(), lenient = false) {
|
|
|
4223
4223
|
opacity: 1,
|
|
4224
4224
|
blend: "normal",
|
|
4225
4225
|
text: text3,
|
|
4226
|
-
runs:
|
|
4227
|
-
paragraphs:
|
|
4226
|
+
runs: _chunkVYW7JBTMcjs.fitRuns.call(void 0, init.runs, text3.length, _chunkVYW7JBTMcjs.DEFAULT_TEXT_STYLE),
|
|
4227
|
+
paragraphs: _chunkVYW7JBTMcjs.fitParagraphRuns.call(void 0, _nullishCoalesce(init.paragraphs, () => ( [{ length: text3.length, style: {} }])), text3),
|
|
4228
4228
|
frame: init.frame,
|
|
4229
4229
|
surface: _chunk7ISPWEJAcjs.emptySurface.call(void 0, 4),
|
|
4230
4230
|
offset: { x: 0, y: 0 }
|
|
4231
4231
|
};
|
|
4232
|
-
if (!layer.runs.length) layer.runs = [{ length: 0, style: _nullishCoalesce(_optionalChain([init, 'access', _62 => _62.runs, 'access', _63 => _63[0], 'optionalAccess', _64 => _64.style]), () => (
|
|
4233
|
-
if (init.transform && !
|
|
4232
|
+
if (!layer.runs.length) layer.runs = [{ length: 0, style: _nullishCoalesce(_optionalChain([init, 'access', _62 => _62.runs, 'access', _63 => _63[0], 'optionalAccess', _64 => _64.style]), () => ( _chunkVYW7JBTMcjs.DEFAULT_TEXT_STYLE)) }];
|
|
4233
|
+
if (init.transform && !_chunkVYW7JBTMcjs.isIdentityMatrix.call(void 0, init.transform)) layer.transform = init.transform;
|
|
4234
4234
|
if (lenient && !renderText(layer, env)) return { ...layer, rendering: "stored" };
|
|
4235
4235
|
return rerenderText(layer, env);
|
|
4236
4236
|
}
|
|
@@ -4240,24 +4240,24 @@ function updateTypeLayer(layers, id, change, env, action = "edit it") {
|
|
|
4240
4240
|
const patch = change(current);
|
|
4241
4241
|
const next = { ...current, ...patch };
|
|
4242
4242
|
if (!("annotation" in patch)) delete next.annotation;
|
|
4243
|
-
if ("text" in patch || "runs" in patch) next.runs =
|
|
4244
|
-
if (!next.runs.length) next.runs = [{ length: 0, style:
|
|
4245
|
-
if ("text" in patch || "paragraphs" in patch) next.paragraphs =
|
|
4243
|
+
if ("text" in patch || "runs" in patch) next.runs = _chunkVYW7JBTMcjs.fitRuns.call(void 0, next.runs, next.text.length, _nullishCoalesce(_optionalChain([current, 'access', _65 => _65.runs, 'access', _66 => _66[0], 'optionalAccess', _67 => _67.style]), () => ( _chunkVYW7JBTMcjs.DEFAULT_TEXT_STYLE)));
|
|
4244
|
+
if (!next.runs.length) next.runs = [{ length: 0, style: _chunkVYW7JBTMcjs.styleAt.call(void 0, current.runs, 0, _chunkVYW7JBTMcjs.DEFAULT_TEXT_STYLE) }];
|
|
4245
|
+
if ("text" in patch || "paragraphs" in patch) next.paragraphs = _chunkVYW7JBTMcjs.fitParagraphRuns.call(void 0, next.paragraphs, next.text);
|
|
4246
4246
|
const rendered = rerenderText(next, env);
|
|
4247
4247
|
return { layers: _chunkWMRIG4XQcjs.mapLayer.call(void 0, layers, id, () => rendered), layer: rendered };
|
|
4248
4248
|
}
|
|
4249
4249
|
function replaceTextRange(layer, start, end, insert) {
|
|
4250
4250
|
const text3 = layer.text.slice(0, start) + insert + layer.text.slice(end);
|
|
4251
|
-
const style =
|
|
4252
|
-
const runs =
|
|
4253
|
-
const pstyle =
|
|
4254
|
-
const paragraphs =
|
|
4255
|
-
return { text: text3, runs, paragraphs:
|
|
4251
|
+
const style = _chunkVYW7JBTMcjs.styleAt.call(void 0, layer.runs, start > 0 && start === layer.text.length ? start - 1 : start, _chunkVYW7JBTMcjs.DEFAULT_TEXT_STYLE);
|
|
4252
|
+
const runs = _chunkVYW7JBTMcjs.spliceRuns.call(void 0, layer.runs, start, end, insert.length, style);
|
|
4253
|
+
const pstyle = _chunkVYW7JBTMcjs.styleAt.call(void 0, layer.paragraphs, start, {});
|
|
4254
|
+
const paragraphs = _chunkVYW7JBTMcjs.spliceRuns.call(void 0, layer.paragraphs, start, end, insert.length, pstyle);
|
|
4255
|
+
return { text: text3, runs, paragraphs: _chunkVYW7JBTMcjs.fitParagraphRuns.call(void 0, paragraphs, text3) };
|
|
4256
4256
|
}
|
|
4257
4257
|
function transformTypeLayer(layer, m) {
|
|
4258
|
-
const t =
|
|
4258
|
+
const t = _chunkVYW7JBTMcjs.multiplyMatrices.call(void 0, textMatrix(layer), m);
|
|
4259
4259
|
const next = { ...layer };
|
|
4260
|
-
if (
|
|
4260
|
+
if (_chunkVYW7JBTMcjs.isIdentityMatrix.call(void 0, t)) delete next.transform;
|
|
4261
4261
|
else next.transform = t;
|
|
4262
4262
|
delete next.annotation;
|
|
4263
4263
|
return next;
|
|
@@ -4265,7 +4265,7 @@ function transformTypeLayer(layer, m) {
|
|
|
4265
4265
|
function typeFrame(layer, shaper) {
|
|
4266
4266
|
if (layer.frame.kind === "box") return { x: 0, y: 0, width: layer.frame.width, height: layer.frame.height };
|
|
4267
4267
|
if (!shaper) return fail3("Type layers need a text shaper to be measured; none is set here.");
|
|
4268
|
-
const b =
|
|
4268
|
+
const b = _chunkVYW7JBTMcjs.layoutText.call(void 0, layer, shaper).bounds;
|
|
4269
4269
|
return { x: b.x, y: b.y, width: Math.max(b.width, 1), height: Math.max(b.height, 1) };
|
|
4270
4270
|
}
|
|
4271
4271
|
function typeAsPixelLayer(layer) {
|
|
@@ -4273,7 +4273,7 @@ function typeAsPixelLayer(layer) {
|
|
|
4273
4273
|
return { ...rest, type: "pixel", surface: layer.surface, offset: { x: 0, y: 0 } };
|
|
4274
4274
|
}
|
|
4275
4275
|
function toTextSpace(layer, p) {
|
|
4276
|
-
return
|
|
4276
|
+
return _chunkVYW7JBTMcjs.applyMatrix.call(void 0, _chunkVYW7JBTMcjs.invertMatrix.call(void 0, textMatrix(layer)), p);
|
|
4277
4277
|
}
|
|
4278
4278
|
function typeFromAnnotation(a) {
|
|
4279
4279
|
if (a.type !== "text") return null;
|
|
@@ -4287,7 +4287,7 @@ function typeFromAnnotation(a) {
|
|
|
4287
4287
|
if (op !== 1) style.opacity = op;
|
|
4288
4288
|
const text3 = t.text.replace(/\r?\n|\r/g, " ");
|
|
4289
4289
|
const translate = [1, 0, 0, 1, t.x, t.y];
|
|
4290
|
-
const transform = t.rotation ?
|
|
4290
|
+
const transform = t.rotation ? _chunkVYW7JBTMcjs.multiplyMatrices.call(void 0, translate, _chunkVYW7JBTMcjs.rotateMatrix.call(void 0, t.rotation, { x: t.x, y: t.y })) : translate;
|
|
4291
4291
|
return { text: text3, runs: [{ length: text3.length, style }], frame: { kind: "point", origin: "top" }, transform };
|
|
4292
4292
|
}
|
|
4293
4293
|
function annotationOfType(layer) {
|
|
@@ -4621,7 +4621,7 @@ function identityTransform(box2) {
|
|
|
4621
4621
|
}
|
|
4622
4622
|
function cornersFromMatrix(box2, m) {
|
|
4623
4623
|
const q2 = _chunkEJVDBITDcjs.boxQuad.call(void 0, box2);
|
|
4624
|
-
return [
|
|
4624
|
+
return [_chunkVYW7JBTMcjs.applyMatrix.call(void 0, m, q2[0]), _chunkVYW7JBTMcjs.applyMatrix.call(void 0, m, q2[1]), _chunkVYW7JBTMcjs.applyMatrix.call(void 0, m, q2[2]), _chunkVYW7JBTMcjs.applyMatrix.call(void 0, m, q2[3])];
|
|
4625
4625
|
}
|
|
4626
4626
|
function matrixFromCorners(box2, corners, eps = 1e-6) {
|
|
4627
4627
|
const [tl, tr, br, bl] = corners;
|
|
@@ -4638,7 +4638,7 @@ function transformHomography(geometry) {
|
|
|
4638
4638
|
function hasWarp(geometry) {
|
|
4639
4639
|
const w = geometry.warp;
|
|
4640
4640
|
if (!w) return false;
|
|
4641
|
-
const id =
|
|
4641
|
+
const id = _chunkVYW7JBTMcjs.identityWarpMesh.call(void 0, geometry.box, w.us.length - 1, w.vs.length - 1);
|
|
4642
4642
|
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;
|
|
4643
4643
|
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);
|
|
4644
4644
|
}
|
|
@@ -4653,7 +4653,7 @@ function transformMap(geometry) {
|
|
|
4653
4653
|
const { box: box2 } = geometry;
|
|
4654
4654
|
const warp = hasWarp(geometry) ? geometry.warp : null;
|
|
4655
4655
|
if (!warp) return (p) => _chunkEJVDBITDcjs.applyHomography.call(void 0, h, p);
|
|
4656
|
-
return (p) => _chunkEJVDBITDcjs.applyHomography.call(void 0, h,
|
|
4656
|
+
return (p) => _chunkEJVDBITDcjs.applyHomography.call(void 0, h, _chunkVYW7JBTMcjs.evalWarpMesh.call(void 0, warp, (p.x - box2.x) / box2.width, (p.y - box2.y) / box2.height));
|
|
4657
4657
|
}
|
|
4658
4658
|
function transformedPoint(geometry, fx, fy) {
|
|
4659
4659
|
const f = transformMap(geometry);
|
|
@@ -4697,8 +4697,8 @@ function matrixFromParams(box2, params) {
|
|
|
4697
4697
|
const tx = Math.tan((_nullishCoalesce(params.skewX, () => ( 0))) * Math.PI / 180);
|
|
4698
4698
|
const ty = Math.tan((_nullishCoalesce(params.skewY, () => ( 0))) * Math.PI / 180);
|
|
4699
4699
|
const ref = referencePoint(box2, params.reference);
|
|
4700
|
-
const linear =
|
|
4701
|
-
return
|
|
4700
|
+
const linear = _chunkVYW7JBTMcjs.multiplyMatrices.call(void 0, _chunkVYW7JBTMcjs.multiplyMatrices.call(void 0, [1, ty, tx, 1, 0, 0], [sx, 0, 0, sy, 0, 0]), _chunkVYW7JBTMcjs.rotateMatrix.call(void 0, _nullishCoalesce(params.rotate, () => ( 0))));
|
|
4701
|
+
return _chunkVYW7JBTMcjs.multiplyMatrices.call(void 0, _chunkVYW7JBTMcjs.matrixAbout.call(void 0, linear, ref), _chunkVYW7JBTMcjs.translateMatrix.call(void 0, _nullishCoalesce(params.dx, () => ( 0)), _nullishCoalesce(params.dy, () => ( 0))));
|
|
4702
4702
|
}
|
|
4703
4703
|
function describeTransform(geometry, reference = "center") {
|
|
4704
4704
|
const m = hasWarp(geometry) ? null : matrixFromCorners(geometry.box, geometry.corners);
|
|
@@ -4715,7 +4715,7 @@ function describeTransform(geometry, reference = "center") {
|
|
|
4715
4715
|
const shear = sxAbs ? (a * c + b * d) / sxAbs : 0;
|
|
4716
4716
|
const sy = sxAbs ? (a * d - b * c) / sxAbs : 0;
|
|
4717
4717
|
const skew = sxAbs ? Math.atan(shear / sxAbs) * 180 / Math.PI : 0;
|
|
4718
|
-
const at =
|
|
4718
|
+
const at = _chunkVYW7JBTMcjs.applyMatrix.call(void 0, m, ref);
|
|
4719
4719
|
const clean = (v) => Math.abs(v) < 1e-9 ? 0 : v;
|
|
4720
4720
|
return {
|
|
4721
4721
|
affine: true,
|
|
@@ -4733,24 +4733,24 @@ function applyParams(geometry, params) {
|
|
|
4733
4733
|
const ref = params.reference && typeof params.reference === "object" ? params.reference : anchorPoint(geometry, _nullishCoalesce(params.reference, () => ( "center")));
|
|
4734
4734
|
const m = matrixFromParams({ x: ref.x, y: ref.y, width: 0, height: 0 }, { ...params, reference: ref });
|
|
4735
4735
|
const c = geometry.corners;
|
|
4736
|
-
return [
|
|
4736
|
+
return [_chunkVYW7JBTMcjs.applyMatrix.call(void 0, m, c[0]), _chunkVYW7JBTMcjs.applyMatrix.call(void 0, m, c[1]), _chunkVYW7JBTMcjs.applyMatrix.call(void 0, m, c[2]), _chunkVYW7JBTMcjs.applyMatrix.call(void 0, m, c[3])];
|
|
4737
4737
|
}
|
|
4738
4738
|
function flipCorners(geometry, axis) {
|
|
4739
4739
|
const c = anchorPoint(geometry, "center");
|
|
4740
4740
|
const m = axis === "horizontal" ? [-1, 0, 0, 1, 2 * c.x, 0] : [1, 0, 0, -1, 0, 2 * c.y];
|
|
4741
4741
|
const q2 = geometry.corners;
|
|
4742
|
-
return [
|
|
4742
|
+
return [_chunkVYW7JBTMcjs.applyMatrix.call(void 0, m, q2[0]), _chunkVYW7JBTMcjs.applyMatrix.call(void 0, m, q2[1]), _chunkVYW7JBTMcjs.applyMatrix.call(void 0, m, q2[2]), _chunkVYW7JBTMcjs.applyMatrix.call(void 0, m, q2[3])];
|
|
4743
4743
|
}
|
|
4744
4744
|
function boxPointOf(geometry, p) {
|
|
4745
4745
|
const m = matrixFromCorners(geometry.box, geometry.corners);
|
|
4746
|
-
if (m) return
|
|
4746
|
+
if (m) return _chunkVYW7JBTMcjs.applyMatrix.call(void 0, _chunkVYW7JBTMcjs.invertMatrix.call(void 0, m), p);
|
|
4747
4747
|
return null;
|
|
4748
4748
|
}
|
|
4749
4749
|
function presetWarp(box2, preset) {
|
|
4750
|
-
return
|
|
4750
|
+
return _chunkVYW7JBTMcjs.warpPresetMesh.call(void 0, preset, box2);
|
|
4751
4751
|
}
|
|
4752
4752
|
function isValidWarp(mesh) {
|
|
4753
|
-
return
|
|
4753
|
+
return _chunkVYW7JBTMcjs.isValidWarpMesh.call(void 0, mesh);
|
|
4754
4754
|
}
|
|
4755
4755
|
function geometryHomography(geometry) {
|
|
4756
4756
|
const m = matrixFromCorners(geometry.box, geometry.corners);
|
|
@@ -4983,7 +4983,7 @@ function normalizePlacement(raw, contents) {
|
|
|
4983
4983
|
}
|
|
4984
4984
|
const out = { corners: c.map((p) => ({ x: p.x, y: p.y })) };
|
|
4985
4985
|
if (raw.warp) {
|
|
4986
|
-
if (!
|
|
4986
|
+
if (!_chunkVYW7JBTMcjs.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.");
|
|
4987
4987
|
out.warp = { us: [...raw.warp.us], vs: [...raw.warp.vs], points: raw.warp.points.map((p) => ({ x: p.x, y: p.y })) };
|
|
4988
4988
|
}
|
|
4989
4989
|
if (raw.interpolation !== void 0) {
|
|
@@ -5086,7 +5086,7 @@ function translateLayer(layer, dx, dy) {
|
|
|
5086
5086
|
case "shape": {
|
|
5087
5087
|
const next = {
|
|
5088
5088
|
...layer,
|
|
5089
|
-
components: transformShapeComponents(layer.components, (p) => ({ x: p.x + dx, y: p.y + dy }),
|
|
5089
|
+
components: transformShapeComponents(layer.components, (p) => ({ x: p.x + dx, y: p.y + dy }), _chunkVYW7JBTMcjs.translateMatrix.call(void 0, dx, dy)),
|
|
5090
5090
|
surface: _chunk7ISPWEJAcjs.translateSurface.call(void 0, layer.surface, dx, dy),
|
|
5091
5091
|
mask: moveMask(layer.mask)
|
|
5092
5092
|
};
|
|
@@ -5095,7 +5095,7 @@ function translateLayer(layer, dx, dy) {
|
|
|
5095
5095
|
return next;
|
|
5096
5096
|
}
|
|
5097
5097
|
case "type": {
|
|
5098
|
-
const next = { ...transformTypeLayer(layer,
|
|
5098
|
+
const next = { ...transformTypeLayer(layer, _chunkVYW7JBTMcjs.translateMatrix.call(void 0, dx, dy)), surface: _chunk7ISPWEJAcjs.translateSurface.call(void 0, layer.surface, dx, dy), mask: moveMask(layer.mask) };
|
|
5099
5099
|
if (!next.mask) delete next.mask;
|
|
5100
5100
|
return next;
|
|
5101
5101
|
}
|
|
@@ -5281,7 +5281,7 @@ function refitPlacement(layer, contents) {
|
|
|
5281
5281
|
});
|
|
5282
5282
|
const out = { corners: pts };
|
|
5283
5283
|
if (layer.placement.interpolation) out.interpolation = layer.placement.interpolation;
|
|
5284
|
-
if (layer.placement.warp) out.warp =
|
|
5284
|
+
if (layer.placement.warp) out.warp = _chunkVYW7JBTMcjs.mapWarpMeshPoints.call(void 0, layer.placement.warp, (p) => ({ x: p.x * W1 / W0, y: p.y * H1 / H0 }));
|
|
5285
5285
|
return out;
|
|
5286
5286
|
}
|
|
5287
5287
|
function normalizeSmartFilter(raw, id = newLayerId("flt")) {
|
|
@@ -5580,7 +5580,7 @@ function readType(r, base, ctx) {
|
|
|
5580
5580
|
const text3 = normalizeText(_nullishCoalesce(r.text, () => ( "")));
|
|
5581
5581
|
const runs = (Array.isArray(r.runs) ? r.runs : []).map((run, i) => ({
|
|
5582
5582
|
length: Math.max(0, Math.floor(num2(_optionalChain([run, 'optionalAccess', _131 => _131.length]), 0, 1e9, 0))),
|
|
5583
|
-
style: patchTextStyle(
|
|
5583
|
+
style: patchTextStyle(_chunkVYW7JBTMcjs.DEFAULT_TEXT_STYLE, _optionalChain([run, 'optionalAccess', _132 => _132.style]) && typeof run.style === "object" ? run.style : {}, `runs[${i}].style`)
|
|
5584
5584
|
}));
|
|
5585
5585
|
const paragraphs = (Array.isArray(r.paragraphs) ? r.paragraphs : []).map((p, i) => ({
|
|
5586
5586
|
length: Math.max(0, Math.floor(num2(_optionalChain([p, 'optionalAccess', _133 => _133.length]), 0, 1e9, 0))),
|
|
@@ -5593,13 +5593,13 @@ function readType(r, base, ctx) {
|
|
|
5593
5593
|
...base,
|
|
5594
5594
|
type: "type",
|
|
5595
5595
|
text: text3,
|
|
5596
|
-
runs:
|
|
5597
|
-
paragraphs:
|
|
5596
|
+
runs: _chunkVYW7JBTMcjs.fitRuns.call(void 0, runs, text3.length, _chunkVYW7JBTMcjs.DEFAULT_TEXT_STYLE),
|
|
5597
|
+
paragraphs: _chunkVYW7JBTMcjs.fitParagraphRuns.call(void 0, paragraphs.length ? paragraphs : [{ length: text3.length, style: {} }], text3),
|
|
5598
5598
|
frame,
|
|
5599
5599
|
surface: _chunk7ISPWEJAcjs.emptySurface.call(void 0, 4),
|
|
5600
5600
|
offset: { x: 0, y: 0 }
|
|
5601
5601
|
};
|
|
5602
|
-
if (!layer.runs.length) layer.runs = [{ length: 0, style: _nullishCoalesce(_optionalChain([runs, 'access', _137 => _137[0], 'optionalAccess', _138 => _138.style]), () => (
|
|
5602
|
+
if (!layer.runs.length) layer.runs = [{ length: 0, style: _nullishCoalesce(_optionalChain([runs, 'access', _137 => _137[0], 'optionalAccess', _138 => _138.style]), () => ( _chunkVYW7JBTMcjs.DEFAULT_TEXT_STYLE)) }];
|
|
5603
5603
|
if (m) layer.transform = m;
|
|
5604
5604
|
if (r.antiAlias === false) layer.antiAlias = false;
|
|
5605
5605
|
if (typeof r.fillOpacity === "number" && r.fillOpacity !== 1) layer.fillOpacity = num2(r.fillOpacity, 0, 1, 1);
|
|
@@ -6037,7 +6037,7 @@ function readSmartObject(r, base, ctx) {
|
|
|
6037
6037
|
let placement;
|
|
6038
6038
|
try {
|
|
6039
6039
|
const raw = { corners: p.corners };
|
|
6040
|
-
if (p.warp &&
|
|
6040
|
+
if (p.warp && _chunkVYW7JBTMcjs.isValidWarpMesh.call(void 0, p.warp)) raw.warp = p.warp;
|
|
6041
6041
|
if (_chunkWMRIG4XQcjs.isInterpolation.call(void 0, p.interpolation)) raw.interpolation = p.interpolation;
|
|
6042
6042
|
placement = normalizePlacement(raw, contents);
|
|
6043
6043
|
} catch (e) {
|
|
@@ -7020,7 +7020,7 @@ function vectorBlockForComponents(components, inverted, width, height, flags = 0
|
|
|
7020
7020
|
const fr = (p) => ({ x: p.x / w, y: p.y / h });
|
|
7021
7021
|
const subpaths = [];
|
|
7022
7022
|
components.forEach((c, ci) => {
|
|
7023
|
-
|
|
7023
|
+
_chunkVYW7JBTMcjs.expandVectorCorners.call(void 0, c.subpaths).forEach((sp, si) => {
|
|
7024
7024
|
if (!sp.anchors.length) return;
|
|
7025
7025
|
subpaths.push({
|
|
7026
7026
|
closed: sp.closed,
|
|
@@ -7742,7 +7742,7 @@ function merged(levels) {
|
|
|
7742
7742
|
function charStyle(d, fonts, notes) {
|
|
7743
7743
|
const n = (k) => eNum(eGet(d, k));
|
|
7744
7744
|
const flag = (k) => eBool(eGet(d, k));
|
|
7745
|
-
const s = { ...
|
|
7745
|
+
const s = { ..._chunkVYW7JBTMcjs.DEFAULT_TEXT_STYLE };
|
|
7746
7746
|
const fi = n("Font");
|
|
7747
7747
|
const ps = fi !== void 0 ? fonts[fi] : void 0;
|
|
7748
7748
|
if (ps) {
|
|
@@ -7825,7 +7825,7 @@ function typeFromTySh(data, notes) {
|
|
|
7825
7825
|
}
|
|
7826
7826
|
const edText = _nullishCoalesce(eStr(ePath(_nullishCoalesce(engine, () => ( void 0)), ["EngineDict", "Editor", "Text"])), () => ( ""));
|
|
7827
7827
|
const text3 = (_nullishCoalesce(txt, () => ( edText.replace(/\r$/, "")))).replace(/\r\n?/g, "\n");
|
|
7828
|
-
let runs = [{ length: text3.length, style: { ...
|
|
7828
|
+
let runs = [{ length: text3.length, style: { ..._chunkVYW7JBTMcjs.DEFAULT_TEXT_STYLE } }];
|
|
7829
7829
|
let paragraphs = [{ length: text3.length, style: {} }];
|
|
7830
7830
|
let frame = { kind: "point" };
|
|
7831
7831
|
let transform = t.transform;
|
|
@@ -7881,14 +7881,14 @@ function typeFromTySh(data, notes) {
|
|
|
7881
7881
|
const b = eArray(ePath(shape, ["Cookie", "Photoshop", "BoxBounds"])).map((v) => _nullishCoalesce(eNum(v), () => ( 0)));
|
|
7882
7882
|
if (b.length === 4 && b[2] > b[0] && b[3] > b[1]) {
|
|
7883
7883
|
frame = { kind: "box", width: b[2] - b[0], height: b[3] - b[1] };
|
|
7884
|
-
transform =
|
|
7884
|
+
transform = _chunkVYW7JBTMcjs.multiplyMatrices.call(void 0, [1, 0, 0, 1, b[0], b[1]], t.transform);
|
|
7885
7885
|
}
|
|
7886
7886
|
}
|
|
7887
7887
|
}
|
|
7888
7888
|
return {
|
|
7889
7889
|
text: text3,
|
|
7890
|
-
runs:
|
|
7891
|
-
paragraphs:
|
|
7890
|
+
runs: _chunkVYW7JBTMcjs.fitRuns.call(void 0, runs, text3.length, _chunkVYW7JBTMcjs.DEFAULT_TEXT_STYLE),
|
|
7891
|
+
paragraphs: _chunkVYW7JBTMcjs.fitParagraphRuns.call(void 0, paragraphs, text3),
|
|
7892
7892
|
frame,
|
|
7893
7893
|
transform,
|
|
7894
7894
|
antiAlias,
|
|
@@ -7962,7 +7962,7 @@ function buildEngineData(layer, template) {
|
|
|
7962
7962
|
fonts.push(ps);
|
|
7963
7963
|
return fonts.length - 1;
|
|
7964
7964
|
};
|
|
7965
|
-
const runs =
|
|
7965
|
+
const runs = _chunkVYW7JBTMcjs.fitRuns.call(void 0, layer.runs, layer.text.length, _chunkVYW7JBTMcjs.DEFAULT_TEXT_STYLE);
|
|
7966
7966
|
const sruns = [];
|
|
7967
7967
|
const slens = [];
|
|
7968
7968
|
runs.forEach((r, i) => {
|
|
@@ -7970,10 +7970,10 @@ function buildEngineData(layer, template) {
|
|
|
7970
7970
|
slens.push(E.int(r.length + (i === runs.length - 1 ? 1 : 0)));
|
|
7971
7971
|
});
|
|
7972
7972
|
if (!runs.length) {
|
|
7973
|
-
sruns.push(E.dict([["StyleSheet", E.dict([["StyleSheetData", styleSheetData(
|
|
7973
|
+
sruns.push(E.dict([["StyleSheet", E.dict([["StyleSheetData", styleSheetData(_chunkVYW7JBTMcjs.DEFAULT_TEXT_STYLE, fontIndex(postScriptFor(_chunkVYW7JBTMcjs.DEFAULT_TEXT_STYLE)))]])]]));
|
|
7974
7974
|
slens.push(E.int(1));
|
|
7975
7975
|
}
|
|
7976
|
-
const paras =
|
|
7976
|
+
const paras = _chunkVYW7JBTMcjs.fitParagraphRuns.call(void 0, layer.paragraphs, layer.text);
|
|
7977
7977
|
const pruns = [];
|
|
7978
7978
|
const plens = [];
|
|
7979
7979
|
paras.forEach((p, i) => {
|
|
@@ -8029,7 +8029,7 @@ function buildEngineData(layer, template) {
|
|
|
8029
8029
|
eSet(e, key, rd);
|
|
8030
8030
|
}
|
|
8031
8031
|
eSet(rd, "FontSet", fontSet);
|
|
8032
|
-
if (!eGet(rd, "StyleSheetSet")) eSet(rd, "StyleSheetSet", E.array([E.dict([["Name", E.str("Normal RGB")], ["StyleSheetData", styleSheetData(_nullishCoalesce(_optionalChain([runs, 'access', _203 => _203[0], 'optionalAccess', _204 => _204.style]), () => (
|
|
8032
|
+
if (!eGet(rd, "StyleSheetSet")) eSet(rd, "StyleSheetSet", E.array([E.dict([["Name", E.str("Normal RGB")], ["StyleSheetData", styleSheetData(_nullishCoalesce(_optionalChain([runs, 'access', _203 => _203[0], 'optionalAccess', _204 => _204.style]), () => ( _chunkVYW7JBTMcjs.DEFAULT_TEXT_STYLE)), 0)]])]));
|
|
8033
8033
|
if (!eGet(rd, "ParagraphSheetSet")) eSet(rd, "ParagraphSheetSet", E.array([E.dict([["Name", E.str("Normal RGB")], ["DefaultStyleSheet", E.int(0)], ["Properties", paragraphProperties({})]])]));
|
|
8034
8034
|
if (!eGet(rd, "TheNormalStyleSheet")) eSet(rd, "TheNormalStyleSheet", E.int(0));
|
|
8035
8035
|
if (!eGet(rd, "TheNormalParagraphSheet")) eSet(rd, "TheNormalParagraphSheet", E.int(0));
|
|
@@ -8040,13 +8040,13 @@ function inkBounds2(layer) {
|
|
|
8040
8040
|
if (layer.frame.kind === "box") return [0, 0, layer.frame.width, layer.frame.height];
|
|
8041
8041
|
const b = _chunk7ISPWEJAcjs.contentBounds.call(void 0, layer.surface);
|
|
8042
8042
|
if (!b) return [0, 0, 0, 0];
|
|
8043
|
-
const inv =
|
|
8043
|
+
const inv = _chunkVYW7JBTMcjs.invertMatrix.call(void 0, textMatrix(layer));
|
|
8044
8044
|
const pts = [
|
|
8045
8045
|
{ x: b.x, y: b.y },
|
|
8046
8046
|
{ x: b.x + b.width, y: b.y },
|
|
8047
8047
|
{ x: b.x + b.width, y: b.y + b.height },
|
|
8048
8048
|
{ x: b.x, y: b.y + b.height }
|
|
8049
|
-
].map((p) =>
|
|
8049
|
+
].map((p) => _chunkVYW7JBTMcjs.applyMatrix.call(void 0, inv, p));
|
|
8050
8050
|
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))];
|
|
8051
8051
|
}
|
|
8052
8052
|
function tyShForLayer(layer) {
|
|
@@ -8513,7 +8513,7 @@ function filterMaskItem(placed, mask, area) {
|
|
|
8513
8513
|
var warpStyleOf = (name) => {
|
|
8514
8514
|
if (!name.startsWith("warp")) return null;
|
|
8515
8515
|
const s = _optionalChain([name, 'access', _218 => _218[4], 'optionalAccess', _219 => _219.toLowerCase, 'call', _220 => _220()]) + name.slice(5);
|
|
8516
|
-
return
|
|
8516
|
+
return _chunkVYW7JBTMcjs.WARP_STYLES.includes(s) ? s : null;
|
|
8517
8517
|
};
|
|
8518
8518
|
function warpFromDescriptor(w, contents) {
|
|
8519
8519
|
const full = { x: 0, y: 0, width: contents.width, height: contents.height };
|
|
@@ -8543,7 +8543,7 @@ function warpFromDescriptor(w, contents) {
|
|
|
8543
8543
|
} else {
|
|
8544
8544
|
const style = warpStyleOf(styleName);
|
|
8545
8545
|
if (!style) return void 0;
|
|
8546
|
-
mesh =
|
|
8546
|
+
mesh = _chunkVYW7JBTMcjs.warpPresetMesh.call(void 0,
|
|
8547
8547
|
{
|
|
8548
8548
|
style,
|
|
8549
8549
|
bend: _nullishCoalesce(descNumber(w, "warpValue"), () => ( 0)),
|
|
@@ -8558,7 +8558,7 @@ function warpFromDescriptor(w, contents) {
|
|
|
8558
8558
|
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;
|
|
8559
8559
|
if (!same) {
|
|
8560
8560
|
const m = mesh;
|
|
8561
|
-
mesh =
|
|
8561
|
+
mesh = _chunkVYW7JBTMcjs.fitWarpMesh.call(void 0, (s, t) => _chunkVYW7JBTMcjs.evalWarpMesh.call(void 0, m, (s * contents.width - bounds.x) / bounds.width, (t * contents.height - bounds.y) / bounds.height), [0, 1], [0, 1]);
|
|
8562
8562
|
}
|
|
8563
8563
|
return { mesh, frame };
|
|
8564
8564
|
}
|
|
@@ -10123,7 +10123,7 @@ function importSmart(ctx, rec, name, notes, props) {
|
|
|
10123
10123
|
if (placement && (size.width !== contents.width || size.height !== contents.height)) {
|
|
10124
10124
|
const kx = contents.width / size.width;
|
|
10125
10125
|
const ky = contents.height / size.height;
|
|
10126
|
-
if (placement.warp) placement = { ...placement, warp:
|
|
10126
|
+
if (placement.warp) placement = { ...placement, warp: _chunkVYW7JBTMcjs.mapWarpMeshPoints.call(void 0, placement.warp, (p) => ({ x: p.x * kx, y: p.y * ky })) };
|
|
10127
10127
|
}
|
|
10128
10128
|
}
|
|
10129
10129
|
if (!contents || !placement) {
|
|
@@ -11770,4 +11770,4 @@ function exportPsd(input) {
|
|
|
11770
11770
|
|
|
11771
11771
|
|
|
11772
11772
|
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.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.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.parseCssColor = parseCssColor; 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.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.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;
|
|
11773
|
-
//# sourceMappingURL=chunk-
|
|
11773
|
+
//# sourceMappingURL=chunk-HTAFDTNR.cjs.map
|