@pixerate/editor 0.114.0 → 0.115.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.
@@ -52,6 +52,8 @@ reproduced at the end of this file. Paths are relative to each source repository
52
52
 
53
53
  © 2026 ArtCraft Team and the EffectCraft contributors.
54
54
 
55
+ - `crates/path/src/trace.rs` (`trace`, `contours`: marching squares at pixel centres with interpolated crossings, saddles by the cell mean and a padded field so contours close; Douglas–Peucker; minimum area; nesting depth) → `packages/core/src/vector/trace.ts`, fitted with our `fitCubics` instead of its per-span cubics, plus median-cut colour tracing stacked by coverage; test cases our own → `packages/core/tests/vector-trace.test.ts`
56
+ - `crates/pdf/src/shading.rs` (`patches`: Coons and tensor-product patch meshes, PDF shading types 6 and 7, tessellated into small cells whose colours blend between the patch's corners) → gradient meshes in `packages/core/src/vector/shading.ts` (`vectorMeshPointAt`, `vectorMeshColorAt`, `vectorShadedSvgDefs`), the patch sides being Catmull-Rom curves through the lattice and the cells drawn as SVG pattern tiles; test cases our own → `packages/core/tests/vector-shading.test.ts`
55
57
  - `crates/path/src/varstroke.rs` (`outline`: a variable-width stroke as the union of positively wound trapezoids per flattened segment, round wedges at bends and the caps, filled non-zero; `flatten` with a width-sampling step; `dash_intervals`; `width_factor` with the `Taper` lengths, widths and quarter-circle `ease` and the `Wave` amount, cycles and phase) → `variableStrokeRings` / `variableStrokeOutline` / `dashIntervals` in `packages/core/src/vector/varstroke.ts` and `taperWaveFactor` / `generateWidthProfile` in `packages/core/src/vector/width.ts`; the pieces are emitted as the boundary they add up to (offset sides, outer joins, inner sides trimmed at the offsets' crossing or routed through the centre) instead of being unioned one by one, and the result is refitted with cubics; test cases re-expressed → `packages/core/tests/vector-width.test.ts`
56
58
  - `crates/path/src/interp.rs` (`with_vertex_count`: largest-remainder allocation of new vertices by segment length and de Casteljau splits at equal arc length; `correspond`: same winding, then the cyclic offset with the lowest cost of normalised positions plus χ² distances of log-polar shape-context histograms, coarse then refined for long contours; `interpolate`: Procrustes rotation and scale interpolated with the residual blended in and a straight-line mix; `paths_cross`) → `refineMorphContour`, `correspondMorphContours`, `interpolateMorphContours` and `morphPathsCross` in `packages/core/src/vector/blend.ts`; the offset cost is what remains after the best-fit rotation (plus a small turn penalty) and the histograms measure angles from the contour's direction, so a turned shape corresponds by turning; test cases re-expressed → `packages/core/tests/vector-blend.test.ts`
57
59
  - `crates/path/src/ops.rs` (`trim` / `trim_individually` with `trim_intervals` and `Measured::append`: start / end percentages swapped when reversed, an offset in degrees wrapping round, a piece that starts where the last ended continuing it; `pucker_bloat`; `round_corners`; `offset` with copies at `amount · (i + 1 + copy_offset)`; `twist` with subdivided segments and handles mapped through the warp's derivative; `resample` and `emit` (corner bisectors, smooth handles as a fraction of the pieces); `zigzag`; `WiggleParams`, `splitmix`, `hash`, the Catmull-Rom `noise` and `wiggle`; `MergeMode` and `merge`) → `trimPaths`, `trimPathsIndividually`, `puckerBloatPaths`, `offsetPaths`, `twistPaths`, `zigzagPaths`, `wigglePaths` and `mergePaths` in `packages/core/src/vector/pathEffects.ts`; arc lengths come from our `segmentLength` / `trimSegments`, offsets from `offsetPath`, booleans from `pathBoolean`, and Round Corners (`roundCornerPaths`) uses our live-corner maths (a true radius) instead of the port's setback arc; the wiggle's time is a plain parameter; test cases from `crates/path/src/ops/tests.rs` re-expressed → `packages/core/tests/vector-effects.test.ts`
@@ -230,6 +232,7 @@ GridCraft. Apache POI is © The Apache Software Foundation, licensed under the A
230
232
 
231
233
  © 2026 ArtCraft Team and the VectorCraft contributors.
232
234
 
235
+ - `crates/color/src/freeform.rs` (`Freeform`, `FreeformPoint` with `spread`, `spread_scale`, `Freeform::auto`, `segments` (Catmull-Rom lines), `remove_point`, `Field` / `Field::sample`: discs of pure colour, inverse-square blending beyond them, line pieces weighted by their share of the line) → freeform gradients in `packages/core/src/vector/shading.ts`, drawn as SVG strips each with a linear gradient through the field; test cases re-expressed → `packages/core/tests/vector-shading.test.ts`
233
236
  - `crates/doc/src/symbols.rs` (`Symbol { name, art }` and `SymbolInstance { symbol, xf }`: a document's symbols drawn and measured by instances through their own affine transform, art boxes measured per symbol, nesting bounded, and a symbol that would hold itself measured as nothing) → the concepts of `VectorSymbol`, `VectorInstanceNode`, `resolveVectorSymbols` and `vectorInstanceGroup` in `packages/core/src/vector/symbols.ts`; our instances carry their symbol's art resolved, and draw it as a group whose rotation stays rigid while scale and skew are baked into the art (strokes scaled by √|det| unless `scaleStrokes` is false); the editing (Make Symbol, isolation mode, Detach, Replace, overrides) is our own
234
237
  - `crates/tools/src/guides.rs` (`snap_scale`) → `packages/core/src/canvas/resizeSnap.ts`
235
238
  - `crates/tools/src/guides.rs` (`Targets` gathered once per gesture and kept x / y sorted with `within` bisection lookups; `for_move`, `for_drawing`, `for_handle`, `for_anchor_drag` leaving the moving anchors and their segments out, `push_segments`; the `snap_from` priority — Shift-constrained ray, point, intersection, on-segment, construction angle, x / y alignment — with `slide`, `lined_up`, `on_segment`, `crossing`; `align_rects`, `snap_rects`, `even_spacing`, `gap_marks`; `snap_scale` for rotated boxes; `Leave`, `construction`; the "anchor" / "centre" / "path" / "intersect" / "align" labels) → `packages/core/src/vector/snap.ts`; the curve–curve `meeting` search was not ported (`segmentIntersections` in `packages/core/src/canvas/pathops/boolean.ts` finds every crossing instead)
@@ -76,6 +76,12 @@ var _chunkTFOPHZ3Ucjs = require('./chunk-TFOPHZ3U.cjs');
76
76
 
77
77
 
78
78
 
79
+
80
+ var _chunkG5NMLUVFcjs = require('./chunk-G5NMLUVF.cjs');
81
+
82
+
83
+
84
+
79
85
  var _chunk643B2HKCcjs = require('./chunk-643B2HKC.cjs');
80
86
 
81
87
 
@@ -9321,6 +9327,15 @@ function toRgba8(set) {
9321
9327
  }
9322
9328
  return out;
9323
9329
  }
9330
+ if (mode === MODE_CMYK && set.cmykToRgb) {
9331
+ const ink = new Uint8Array(n * 4);
9332
+ for (let i = 0, o = 0; i < n; i++, o += 4) {
9333
+ for (let c = 0; c < 4; c++) ink[o + c] = Math.round((1 - (planes[c] ? planes[c](i) : 1)) * 255);
9334
+ out[o + 3] = Math.round(alpha(i) * 255);
9335
+ }
9336
+ set.cmykToRgb(ink, out);
9337
+ return out;
9338
+ }
9324
9339
  const palette = set.palette;
9325
9340
  for (let i = 0, o = 0; i < n; i++, o += 4) {
9326
9341
  let r;
@@ -9745,9 +9760,10 @@ function recordPixels(ctx, rec, name) {
9745
9760
  mode: ctx.file.header.colorMode,
9746
9761
  color: planes.slice(0, ctx.colorCount),
9747
9762
  alpha: planes[ctx.colorCount],
9748
- palette: ctx.palette
9763
+ palette: ctx.palette,
9764
+ cmykToRgb: ctx.cmykToRgb
9749
9765
  };
9750
- const deep = toRgbaDeep(set);
9766
+ const deep = set.cmykToRgb ? null : toRgbaDeep(set);
9751
9767
  if (deep) return _chunkST7E3NEEcjs.surfaceFromDeepPixels.call(void 0, { width, height, data: deep }, 4, rec.rect.left, rec.rect.top);
9752
9768
  return _chunkTFOPHZ3Ucjs.surfaceFromPixels.call(void 0, { width, height, data: toRgba8(set) }, 4, rec.rect.left, rec.rect.top);
9753
9769
  }
@@ -10154,9 +10170,10 @@ function mergedLayer(ctx) {
10154
10170
  mode: header.colorMode,
10155
10171
  color: Array.from({ length: cc }, (_, i) => plane(i)),
10156
10172
  alpha: hasAlpha ? plane(cc) : void 0,
10157
- palette: ctx.palette
10173
+ palette: ctx.palette,
10174
+ cmykToRgb: ctx.cmykToRgb
10158
10175
  };
10159
- const deep = hasAlpha ? null : toRgbaDeep(set);
10176
+ const deep = hasAlpha || set.cmykToRgb ? null : toRgbaDeep(set);
10160
10177
  let surface;
10161
10178
  if (deep) surface = _chunkST7E3NEEcjs.surfaceFromDeepPixels.call(void 0, { width, height, data: deep }, 4);
10162
10179
  else {
@@ -10194,6 +10211,28 @@ function psdToLayers(file, options = {}) {
10194
10211
  depth: _nullishCoalesce(options.depth, () => ( 0)),
10195
10212
  dpi: _nullishCoalesce(resolution(file), () => ( 72))
10196
10213
  };
10214
+ let cmykProfile = null;
10215
+ if (header.colorMode === MODE_CMYK && !ctx.skipPixels) {
10216
+ const icc = resource(file, 1039);
10217
+ let src = null;
10218
+ if (icc) {
10219
+ try {
10220
+ const p = _chunkG5NMLUVFcjs.parseProfile.call(void 0, icc);
10221
+ if (p.colorSpace === "cmyk") {
10222
+ src = p;
10223
+ cmykProfile = { name: p.description || "Embedded CMYK profile", icc: icc.slice() };
10224
+ } else warn.extra.push(`The CMYK file embeds a ${p.colorSpace.toUpperCase()} profile; the default coated CMYK profile was used.`);
10225
+ } catch (e) {
10226
+ warn.extra.push(`The CMYK profile could not be read (${e instanceof Error ? e.message : String(e)}); the default coated CMYK profile was used.`);
10227
+ }
10228
+ }
10229
+ if (!src) {
10230
+ src = _chunkG5NMLUVFcjs.builtinProfile.call(void 0, "coated-cmyk");
10231
+ cmykProfile = { builtin: "coated-cmyk", name: src.description };
10232
+ }
10233
+ const t = _chunkG5NMLUVFcjs.Transform.create(src, _chunkG5NMLUVFcjs.srgbProfile.call(void 0, ), { intent: "relative", bpc: true });
10234
+ ctx.cmykToRgb = (ink, out) => t.convert8(ink, 4, out, 4, false);
10235
+ }
10197
10236
  for (const block of file.globalBlocks) {
10198
10237
  if (LINKED_FILE_KEYS.includes(block.key)) {
10199
10238
  for (const f of parseLinkedFiles(block.data)) if (!ctx.linked.has(f.uuid)) ctx.linked.set(f.uuid, f);
@@ -10218,7 +10257,8 @@ function psdToLayers(file, options = {}) {
10218
10257
  if (mode !== "rgb" && header.depth > 8 && header.colorMode !== MODE_INDEXED && header.colorMode !== MODE_BITMAP) {
10219
10258
  warn.extra.push(`The file is ${header.depth}-bit ${mode}; it was converted to ${header.depth}-bit RGB.`);
10220
10259
  } else if (mode !== "rgb" || header.depth !== 8 && header.depth !== 16 && header.depth !== 32) {
10221
- warn.extra.push(`The file is ${header.depth}-bit ${mode}; it was converted to 8-bit RGB.`);
10260
+ const how = header.colorMode === MODE_CMYK ? ` through ${_nullishCoalesce(_optionalChain([cmykProfile, 'optionalAccess', _241 => _241.name]), () => ( "its profile"))}` : "";
10261
+ warn.extra.push(`The file is ${header.depth}-bit ${mode}; it was converted to 8-bit RGB${how}.`);
10222
10262
  }
10223
10263
  let layers = [];
10224
10264
  if (file.layers.length) {
@@ -10253,6 +10293,7 @@ function psdToLayers(file, options = {}) {
10253
10293
  patterns: [...ctx.patterns.values()],
10254
10294
  ...angle !== void 0 || altitude !== void 0 ? { globalLight: { angle: Math.max(-360, Math.min(360, _nullishCoalesce(angle, () => ( 120)))), altitude: Math.max(0, Math.min(90, _nullishCoalesce(altitude, () => ( 30)))) } } : {},
10255
10295
  info: { psb: header.psb, depth: header.depth, colorMode: mode, channels: header.channels },
10296
+ ...cmykProfile ? { sourceMode: { mode: "cmyk", profile: cmykProfile } } : header.colorMode === MODE_LAB ? { sourceMode: { mode: "lab" } } : {},
10256
10297
  ...resource(file, 1039) ? { iccProfile: resource(file, 1039).slice() } : {},
10257
10298
  bitDepth: (header.depth === 16 || header.depth === 32) && header.colorMode !== MODE_INDEXED && header.colorMode !== MODE_BITMAP ? header.depth : 8
10258
10299
  };
@@ -10322,15 +10363,15 @@ var pct = (d, key, fallback) => num3(d, key, fallback * 100) / 100;
10322
10363
  var bool = (d, key) => descBool(d, key) === true;
10323
10364
  var enumOf3 = (d, key) => {
10324
10365
  const v = descGet(d, key);
10325
- return _optionalChain([v, 'optionalAccess', _241 => _241.type]) === "enum" ? v.value : void 0;
10366
+ return _optionalChain([v, 'optionalAccess', _242 => _242.type]) === "enum" ? v.value : void 0;
10326
10367
  };
10327
10368
  var text2 = (d, key) => {
10328
10369
  const v = d ? descGet(d, key) : void 0;
10329
- return _optionalChain([v, 'optionalAccess', _242 => _242.type]) === "TEXT" ? v.value : "";
10370
+ return _optionalChain([v, 'optionalAccess', _243 => _243.type]) === "TEXT" ? v.value : "";
10330
10371
  };
10331
10372
  var list = (d, key) => {
10332
10373
  const v = descGet(d, key);
10333
- if (_optionalChain([v, 'optionalAccess', _243 => _243.type]) !== "VlLs") return [];
10374
+ if (_optionalChain([v, 'optionalAccess', _244 => _244.type]) !== "VlLs") return [];
10334
10375
  return v.items.flatMap((it) => it.type === "Objc" || it.type === "GlbO" ? [it.value] : []);
10335
10376
  };
10336
10377
  var clamp3 = (v, lo, hi) => Number.isFinite(v) ? Math.min(hi, Math.max(lo, v)) : lo;
@@ -10400,8 +10441,8 @@ function contourOf(d, key) {
10400
10441
  return { name, points };
10401
10442
  }
10402
10443
  function contourDesc(c) {
10403
- const name = _nullishCoalesce(_optionalChain([c, 'optionalAccess', _244 => _244.name]), () => ( "Linear"));
10404
- const points = _nullishCoalesce(_optionalChain([c, 'optionalAccess', _245 => _245.points]), () => ( [
10444
+ const name = _nullishCoalesce(_optionalChain([c, 'optionalAccess', _245 => _245.name]), () => ( "Linear"));
10445
+ const points = _nullishCoalesce(_optionalChain([c, 'optionalAccess', _246 => _246.points]), () => ( [
10405
10446
  { input: 0, output: 0 },
10406
10447
  { input: 1, output: 1 }
10407
10448
  ]));
@@ -10436,7 +10477,7 @@ function gradientOf(d, notes) {
10436
10477
  { position: 0, color: "#000000" },
10437
10478
  { position: 1, color: "#ffffff" }
10438
10479
  ],
10439
- style: _nullishCoalesce(_optionalChain([GRADIENT_STYLES, 'access', _246 => _246.find, 'call', _247 => _247(([, id]) => id === enumOf3(d, "Type")), 'optionalAccess', _248 => _248[0]]), () => ( "linear")),
10480
+ style: _nullishCoalesce(_optionalChain([GRADIENT_STYLES, 'access', _247 => _247.find, 'call', _248 => _248(([, id]) => id === enumOf3(d, "Type")), 'optionalAccess', _249 => _249[0]]), () => ( "linear")),
10440
10481
  angle: clamp3(num3(d, "Angl", 90), -360, 360),
10441
10482
  scale: clamp3(pct(d, "Scl ", 1), 0.1, 1.5),
10442
10483
  reverse: bool(d, "Rvrs"),
@@ -10490,7 +10531,7 @@ function gradientItems(g) {
10490
10531
  )
10491
10532
  )
10492
10533
  };
10493
- const op = _optionalChain([g, 'access', _249 => _249.opacityStops, 'optionalAccess', _250 => _250.length]) ? g.opacityStops : g.stops.map((s) => ({ position: s.position, opacity: 1 }));
10534
+ const op = _optionalChain([g, 'access', _250 => _250.opacityStops, 'optionalAccess', _251 => _251.length]) ? g.opacityStops : g.stops.map((s) => ({ position: s.position, opacity: 1 }));
10494
10535
  const trns = {
10495
10536
  type: "VlLs",
10496
10537
  items: op.map(
@@ -10983,9 +11024,9 @@ function prepareNestedLayers(layers) {
10983
11024
  if (l.type === "annotation") continue;
10984
11025
  let next = l;
10985
11026
  if (l.type === "group") next = { ...l, children: prepareNestedLayers(l.children) };
10986
- else if (l.type === "pixel" && (_optionalChain([l, 'access', _251 => _251.filters, 'optionalAccess', _252 => _252.length]) || l.source === "document")) {
11027
+ else if (l.type === "pixel" && (_optionalChain([l, 'access', _252 => _252.filters, 'optionalAccess', _253 => _253.length]) || l.source === "document")) {
10987
11028
  const p = { ...l };
10988
- if (_optionalChain([l, 'access', _253 => _253.filters, 'optionalAccess', _254 => _254.some, 'call', _255 => _255(isActiveFilter)])) {
11029
+ if (_optionalChain([l, 'access', _254 => _254.filters, 'optionalAccess', _255 => _255.some, 'call', _256 => _256(isActiveFilter)])) {
10989
11030
  const b = l.surface.bounds;
10990
11031
  if (b) {
10991
11032
  const r = { x: b.x + l.offset.x - 64, y: b.y + l.offset.y - 64, width: b.width + 128, height: b.height + 128 };
@@ -11002,7 +11043,7 @@ function prepareNestedLayers(layers) {
11002
11043
  delete p.source;
11003
11044
  next = p;
11004
11045
  }
11005
- if (_optionalChain([next, 'access', _256 => _256.mask, 'optionalAccess', _257 => _257.source])) {
11046
+ if (_optionalChain([next, 'access', _257 => _257.mask, 'optionalAccess', _258 => _258.source])) {
11006
11047
  next = { ...next };
11007
11048
  delete next.mask;
11008
11049
  }
@@ -11051,6 +11092,21 @@ function exportPsd(input) {
11051
11092
  const { width, height } = input;
11052
11093
  const depth = _nullishCoalesce(input.depth, () => ( 8));
11053
11094
  if (width < 1 || height < 1) throw new PsdError("The document is empty.");
11095
+ const mode = _nullishCoalesce(input.colorMode, () => ( "rgb"));
11096
+ if (mode !== "rgb" && !input.colorPlanes) throw new PsdError(`A ${mode.toUpperCase()} file needs colorPlanes to convert the pixels.`);
11097
+ if (mode !== "rgb" && depth !== 8) throw new PsdError(`${mode.toUpperCase()} files are written at 8 bits per channel.`);
11098
+ const colorIds = mode === "cmyk" ? [0, 1, 2, 3] : [0, 1, 2];
11099
+ const colorPlanes = (rgba, n2) => mode === "rgb" ? rgbaToPlanes(rgba, n2).slice(0, 3) : input.colorPlanes(rgba, n2);
11100
+ const pixelChannels = (rgba, w, h) => {
11101
+ const n2 = w * h;
11102
+ const alpha = rgbaToPlanes(rgba, n2)[3];
11103
+ return [rleChannel(CHANNEL_ALPHA, alpha, w, h, psb), ...colorPlanes(rgba, n2).map((p, i) => rleChannel(i, p, w, h, psb))];
11104
+ };
11105
+ const surfaceChannels = (surface, bounds) => {
11106
+ if (mode !== "rgb") return pixelChannels(_chunkTFOPHZ3Ucjs.readRegion.call(void 0, surface, bounds), bounds.width, bounds.height);
11107
+ const [r, g, b, a2] = surfacePlanes(surface, bounds, depth);
11108
+ return [CHANNEL_ALPHA, 0, 1, 2].map((id, i) => rleChannel(id, [a2, r, g, b][i], bounds.width, bounds.height, psb, depth));
11109
+ };
11054
11110
  const psb = width > PSD_MAX_DIMENSION || height > PSD_MAX_DIMENSION;
11055
11111
  const records = [];
11056
11112
  let nextId = 0;
@@ -11084,7 +11140,7 @@ function exportPsd(input) {
11084
11140
  return {
11085
11141
  opacity: Math.round(Math.min(1, Math.max(0, layer.opacity)) * 255),
11086
11142
  clipping: layer.clipped ? 1 : 0,
11087
- flags: (layer.visible ? 0 : LAYER_FLAG_HIDDEN) | (_optionalChain([layer, 'access', _258 => _258.locks, 'optionalAccess', _259 => _259.transparency]) ? LAYER_FLAG_TRANSPARENCY_PROTECTED : 0),
11143
+ flags: (layer.visible ? 0 : LAYER_FLAG_HIDDEN) | (_optionalChain([layer, 'access', _259 => _259.locks, 'optionalAccess', _260 => _260.transparency]) ? LAYER_FLAG_TRANSPARENCY_PROTECTED : 0),
11088
11144
  legacyName: name,
11089
11145
  blocks
11090
11146
  };
@@ -11094,7 +11150,7 @@ function exportPsd(input) {
11094
11150
  case "group": {
11095
11151
  records.push({
11096
11152
  rect: EMPTY_RECT,
11097
- channels: [CHANNEL_ALPHA, 0, 1, 2].map(emptyChannel),
11153
+ channels: [CHANNEL_ALPHA, ...colorIds].map(emptyChannel),
11098
11154
  blendKey: "norm",
11099
11155
  opacity: 255,
11100
11156
  clipping: 0,
@@ -11111,7 +11167,7 @@ function exportPsd(input) {
11111
11167
  const rec = {
11112
11168
  ...base,
11113
11169
  rect: EMPTY_RECT,
11114
- channels: [CHANNEL_ALPHA, 0, 1, 2].map(emptyChannel),
11170
+ channels: [CHANNEL_ALPHA, ...colorIds].map(emptyChannel),
11115
11171
  blendKey,
11116
11172
  flags: base.flags | FLAG_PIXELS_IRRELEVANT
11117
11173
  };
@@ -11128,7 +11184,7 @@ function exportPsd(input) {
11128
11184
  const rec = {
11129
11185
  ...common2(layer, [{ key: block.key, data: block.data }]),
11130
11186
  rect: EMPTY_RECT,
11131
- channels: [CHANNEL_ALPHA, 0, 1, 2].map(emptyChannel),
11187
+ channels: [CHANNEL_ALPHA, ...colorIds].map(emptyChannel),
11132
11188
  blendKey: _nullishCoalesce(BLEND_TO_PSD[layer.blend], () => ( "norm"))
11133
11189
  };
11134
11190
  if (layer.mask) {
@@ -11141,7 +11197,7 @@ function exportPsd(input) {
11141
11197
  }
11142
11198
  case "pixel": {
11143
11199
  if (layer.source === "document") throw new PsdError(`Layer "${layer.name}" reads the document image; resolve its pixels before export.`);
11144
- if (_optionalChain([layer, 'access', _260 => _260.filters, 'optionalAccess', _261 => _261.some, 'call', _262 => _262(isActiveFilter)])) throw new PsdError(`Layer "${layer.name}" has live filters; bake them before export.`);
11200
+ if (_optionalChain([layer, 'access', _261 => _261.filters, 'optionalAccess', _262 => _262.some, 'call', _263 => _263(isActiveFilter)])) throw new PsdError(`Layer "${layer.name}" has live filters; bake them before export.`);
11145
11201
  const extra = [];
11146
11202
  if (layer.fillOpacity !== void 0 && layer.fillOpacity < 1) {
11147
11203
  extra.push({ key: "iOpa", data: Uint8Array.from([Math.round(Math.max(0, layer.fillOpacity) * 255), 0, 0, 0]) });
@@ -11149,16 +11205,10 @@ function exportPsd(input) {
11149
11205
  const rec = { ...common2(layer, extra), rect: EMPTY_RECT, channels: [], blendKey: _nullishCoalesce(BLEND_TO_PSD[layer.blend], () => ( "norm")) };
11150
11206
  const bounds = _chunkTFOPHZ3Ucjs.contentBounds.call(void 0, layer.surface);
11151
11207
  if (bounds) {
11152
- const [r2, g2, b2, a2] = surfacePlanes(layer.surface, bounds, depth);
11153
11208
  rec.rect = toRect({ ...bounds, x: bounds.x + layer.offset.x, y: bounds.y + layer.offset.y });
11154
- rec.channels = [
11155
- rleChannel(CHANNEL_ALPHA, a2, bounds.width, bounds.height, psb, depth),
11156
- rleChannel(0, r2, bounds.width, bounds.height, psb, depth),
11157
- rleChannel(1, g2, bounds.width, bounds.height, psb, depth),
11158
- rleChannel(2, b2, bounds.width, bounds.height, psb, depth)
11159
- ];
11209
+ rec.channels = surfaceChannels(layer.surface, bounds);
11160
11210
  } else {
11161
- rec.channels = [CHANNEL_ALPHA, 0, 1, 2].map(emptyChannel);
11211
+ rec.channels = [CHANNEL_ALPHA, ...colorIds].map(emptyChannel);
11162
11212
  }
11163
11213
  if (layer.mask) {
11164
11214
  const m = maskChannel(layer.mask, layer.offset.x, layer.offset.y, psb, depth);
@@ -11179,7 +11229,7 @@ function exportPsd(input) {
11179
11229
  if (c.linked) note("Linked smart objects were embedded (their preview is written as the contents)", layer.name);
11180
11230
  linkedFiles.set(idnt, smartContentsFile(c));
11181
11231
  }
11182
- let placedId = _nullishCoalesce(_optionalChain([layer, 'access', _263 => _263.psd, 'optionalAccess', _264 => _264.placed]), () => ( psdUuid(`${layer.id}:placed`)));
11232
+ let placedId = _nullishCoalesce(_optionalChain([layer, 'access', _264 => _264.psd, 'optionalAccess', _265 => _265.placed]), () => ( psdUuid(`${layer.id}:placed`)));
11183
11233
  if (placedIds.has(placedId)) placedId = psdUuid(`${layer.id}:placed:${placedIds.size}`);
11184
11234
  placedIds.add(placedId);
11185
11235
  if (placedUnchanged(layer, idnt, placedId)) {
@@ -11189,26 +11239,20 @@ function exportPsd(input) {
11189
11239
  const filterFX = layer.smartFilters ? filterFXDescriptor(layer.smartFilters, dropped) : void 0;
11190
11240
  if (dropped.length) note("Develop smart filters have no Photoshop filter and were left out of the filter list (the layer\u2019s pixels still show them)", layer.name);
11191
11241
  const raw = layer.psd && layer.psd.key !== "PlLd" ? parsePlaced(layer.psd.key, layer.psd.data) : null;
11192
- const spec = { idnt, placed: placedId, placement: layer.placement, size: { width: c.width, height: c.height }, filterFX, template: _optionalChain([raw, 'optionalAccess', _265 => _265.descriptor]) };
11242
+ const spec = { idnt, placed: placedId, placement: layer.placement, size: { width: c.width, height: c.height }, filterFX, template: _optionalChain([raw, 'optionalAccess', _266 => _266.descriptor]) };
11193
11243
  const wnotes = [];
11194
11244
  extra.push({ key: "PlLd", data: plldBytes(spec) }, { key: "SoLd", data: soldBytes(spec, wnotes) });
11195
11245
  for (const n2 of wnotes) note(`A smart object: ${n2}`, layer.name);
11196
11246
  }
11197
- const fm = _optionalChain([layer, 'access', _266 => _266.smartFilters, 'optionalAccess', _267 => _267.mask]);
11247
+ const fm = _optionalChain([layer, 'access', _267 => _267.smartFilters, 'optionalAccess', _268 => _268.mask]);
11198
11248
  if (fm && !fm.source) filterItems.push(filterMaskItem(placedId, fm, { x: 0, y: 0, width, height }));
11199
11249
  const rec = { ...common2(layer, extra), rect: EMPTY_RECT, channels: [], blendKey: _nullishCoalesce(BLEND_TO_PSD[layer.blend], () => ( "norm")) };
11200
11250
  const bounds = _chunkTFOPHZ3Ucjs.contentBounds.call(void 0, layer.surface);
11201
11251
  if (bounds) {
11202
- const [r2, g2, b2, a2] = surfacePlanes(layer.surface, bounds, depth);
11203
11252
  rec.rect = toRect(bounds);
11204
- rec.channels = [
11205
- rleChannel(CHANNEL_ALPHA, a2, bounds.width, bounds.height, psb, depth),
11206
- rleChannel(0, r2, bounds.width, bounds.height, psb, depth),
11207
- rleChannel(1, g2, bounds.width, bounds.height, psb, depth),
11208
- rleChannel(2, b2, bounds.width, bounds.height, psb, depth)
11209
- ];
11253
+ rec.channels = surfaceChannels(layer.surface, bounds);
11210
11254
  } else {
11211
- rec.channels = [CHANNEL_ALPHA, 0, 1, 2].map(emptyChannel);
11255
+ rec.channels = [CHANNEL_ALPHA, ...colorIds].map(emptyChannel);
11212
11256
  }
11213
11257
  if (layer.mask) {
11214
11258
  const m = maskChannel(layer.mask, 0, 0, psb, depth);
@@ -11226,26 +11270,20 @@ function exportPsd(input) {
11226
11270
  }
11227
11271
  if (layer.type === "shape") {
11228
11272
  const losses = /* @__PURE__ */ new Set();
11229
- for (const b2 of shapeBlocks(layer, width, height, _nullishCoalesce(input.resolution, () => ( 72)), losses)) extra.push({ key: b2.key, data: padEven(b2.data) });
11273
+ for (const b of shapeBlocks(layer, width, height, _nullishCoalesce(input.resolution, () => ( 72)), losses)) extra.push({ key: b.key, data: padEven(b.data) });
11230
11274
  for (const n2 of losses) note(n2, layer.name);
11231
- if (_optionalChain([layer, 'access', _268 => _268.fill, 'optionalAccess', _269 => _269.type]) === "pattern") patternIds2.add(layer.fill.patternId);
11232
- if (_optionalChain([layer, 'access', _270 => _270.stroke, 'optionalAccess', _271 => _271.paint, 'access', _272 => _272.type]) === "pattern") patternIds2.add(layer.stroke.paint.patternId);
11275
+ if (_optionalChain([layer, 'access', _269 => _269.fill, 'optionalAccess', _270 => _270.type]) === "pattern") patternIds2.add(layer.fill.patternId);
11276
+ if (_optionalChain([layer, 'access', _271 => _271.stroke, 'optionalAccess', _272 => _272.paint, 'access', _273 => _273.type]) === "pattern") patternIds2.add(layer.stroke.paint.patternId);
11233
11277
  } else {
11234
11278
  extra.push({ key: "TySh", data: padEven(tyShForLayer(layer)) });
11235
11279
  }
11236
11280
  const rec = { ...common2(layer, extra), rect: EMPTY_RECT, channels: [], blendKey: _nullishCoalesce(BLEND_TO_PSD[layer.blend], () => ( "norm")) };
11237
11281
  const bounds = _chunkTFOPHZ3Ucjs.contentBounds.call(void 0, layer.surface);
11238
11282
  if (bounds) {
11239
- const [r2, g2, b2, a2] = surfacePlanes(layer.surface, bounds, depth);
11240
11283
  rec.rect = toRect(bounds);
11241
- rec.channels = [
11242
- rleChannel(CHANNEL_ALPHA, a2, bounds.width, bounds.height, psb, depth),
11243
- rleChannel(0, r2, bounds.width, bounds.height, psb, depth),
11244
- rleChannel(1, g2, bounds.width, bounds.height, psb, depth),
11245
- rleChannel(2, b2, bounds.width, bounds.height, psb, depth)
11246
- ];
11284
+ rec.channels = surfaceChannels(layer.surface, bounds);
11247
11285
  } else {
11248
- rec.channels = [CHANNEL_ALPHA, 0, 1, 2].map(emptyChannel);
11286
+ rec.channels = [CHANNEL_ALPHA, ...colorIds].map(emptyChannel);
11249
11287
  }
11250
11288
  if (layer.mask) {
11251
11289
  const m = maskChannel(layer.mask, 0, 0, psb, depth);
@@ -11263,9 +11301,10 @@ function exportPsd(input) {
11263
11301
  if (records.length > 32767) throw new PsdError("A PSD holds at most 32767 layer records.");
11264
11302
  const n = width * height;
11265
11303
  if (input.merged.length < n * 4) throw new PsdError(`The merged image has ${input.merged.length} bytes, expected ${n * 4}.`);
11266
- const [r, g, b, a] = rgbaToPlanes(matteWhite(input.merged), n);
11304
+ const matted = matteWhite(input.merged);
11305
+ const a = rgbaToPlanes(matted, n)[3];
11267
11306
  const transparent = a.some((v) => v !== 255);
11268
- let planes = (transparent ? [r, g, b, a] : [r, g, b]).map((p) => planeAtDepth(p, depth));
11307
+ let planes = [...colorPlanes(matted, n), ...transparent ? [a] : []].map((p) => planeAtDepth(p, depth));
11269
11308
  const deep = input.mergedDeep;
11270
11309
  if (deep && depth !== 8 && deep.length >= n * 4 && (deep instanceof Uint16Array ? depth === 16 : depth === 32)) {
11271
11310
  const dp = deepToPlanes(matteWhiteDeep(deep), n);
@@ -11291,7 +11330,7 @@ function exportPsd(input) {
11291
11330
  { id: 1005, name: "", data: rw.result() },
11292
11331
  { id: 1057, name: "", data: version.result() }
11293
11332
  ];
11294
- if (_optionalChain([input, 'access', _273 => _273.iccProfile, 'optionalAccess', _274 => _274.length])) resources.push({ id: 1039, name: "", data: input.iccProfile });
11333
+ if (_optionalChain([input, 'access', _274 => _274.iccProfile, 'optionalAccess', _275 => _275.length])) resources.push({ id: 1039, name: "", data: input.iccProfile });
11295
11334
  if (input.globalLight) {
11296
11335
  const i32 = (v) => {
11297
11336
  const w = new PsdWriter();
@@ -11324,7 +11363,7 @@ function exportPsd(input) {
11324
11363
  if (filterItems.length) globalBlocks.push({ key: "FEid", data: writeFilterEffects(filterItems) });
11325
11364
  const bytes = writePsd(
11326
11365
  {
11327
- header: { psb, channels: planes.length, width, height, depth, colorMode: 3 },
11366
+ header: { psb, channels: planes.length, width, height, depth, colorMode: mode === "cmyk" ? 4 : mode === "lab" ? 9 : 3 },
11328
11367
  colorModeData: new Uint8Array(0),
11329
11368
  resources,
11330
11369
  layers: records,
@@ -11696,4 +11735,4 @@ function exportPsd(input) {
11696
11735
 
11697
11736
 
11698
11737
  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;
11699
- //# sourceMappingURL=chunk-5OVJHMZQ.cjs.map
11738
+ //# sourceMappingURL=chunk-I7FQBWMQ.cjs.map