@pixerate/editor 0.187.0 → 0.189.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/{chunk-X2KQQZBT.cjs → chunk-ED4L4UD6.cjs} +389 -180
- package/dist/{chunk-FW7N64XK.js → chunk-ZEHTUR7Z.js} +229 -20
- package/dist/image-editor/controller.d.cts +20 -3
- package/dist/image-editor/controller.d.ts +20 -3
- package/dist/image-editor/index.cjs +1618 -1467
- package/dist/image-editor/index.js +623 -472
- package/dist/image-editor/layers/paint-ui.d.cts +2 -1
- package/dist/image-editor/layers/paint-ui.d.ts +2 -1
- package/dist/image-editor/layers/panel.d.cts +3 -2
- package/dist/image-editor/layers/panel.d.ts +3 -2
- package/dist/image-editor/renderer.d.cts +6 -0
- package/dist/image-editor/renderer.d.ts +6 -0
- package/dist/image-editor/selection/gesture.d.cts +10 -0
- package/dist/image-editor/selection/gesture.d.ts +10 -0
- package/dist/image-editor/selection/layer-mask.d.cts +6 -0
- package/dist/image-editor/selection/layer-mask.d.ts +6 -0
- package/dist/image-editor/selection/mask.d.cts +20 -1
- package/dist/image-editor/selection/mask.d.ts +20 -1
- package/dist/image-editor/selection/shapes.d.cts +8 -0
- package/dist/image-editor/selection/shapes.d.ts +8 -0
- package/dist/image-editor/selection/tool-options.d.cts +1 -1
- package/dist/image-editor/selection/tool-options.d.ts +1 -1
- package/dist/image-editor/types.d.cts +8 -0
- package/dist/image-editor/types.d.ts +8 -0
- package/dist/paint-editor/index.cjs +6 -6
- package/dist/paint-editor/index.js +1 -1
- package/package.json +1 -1
- package/skills/pixerate-image-editor/SKILL.md +1 -0
- package/skills/pixerate-image-selection-masking/SKILL.md +4 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2;
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2; var _class3;
|
|
2
2
|
|
|
3
3
|
var _chunkA2IS7EHEcjs = require('./chunk-A2IS7EHE.cjs');
|
|
4
4
|
|
|
@@ -118,6 +118,10 @@ var _chunkGF2RBSDMcjs = require('./chunk-GF2RBSDM.cjs');
|
|
|
118
118
|
|
|
119
119
|
|
|
120
120
|
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
121
125
|
|
|
122
126
|
|
|
123
127
|
|
|
@@ -750,15 +754,159 @@ function computeSelectionBounds(width, height, data) {
|
|
|
750
754
|
if (y0 < 0) return null;
|
|
751
755
|
return { x: x0, y: y0, width: x1 - x0 + 1, height: y1 - y0 + 1 };
|
|
752
756
|
}
|
|
757
|
+
var TILE_PIXELS = _chunkCWM3CUUXcjs.TILE * _chunkCWM3CUUXcjs.TILE;
|
|
758
|
+
var MATERIALIZED_LIMIT = 4;
|
|
759
|
+
var materialized = /* @__PURE__ */ new Map();
|
|
760
|
+
var lastRead = null;
|
|
761
|
+
var lastData = null;
|
|
762
|
+
var TiledSelectionMask = (_class = class {
|
|
763
|
+
constructor(width, height, surface, bounds, data) {;_class.prototype.__init.call(this);
|
|
764
|
+
this.width = width;
|
|
765
|
+
this.height = height;
|
|
766
|
+
this.surface = surface;
|
|
767
|
+
this.cachedBounds = bounds;
|
|
768
|
+
if (data) this.remember(data);
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
|
|
772
|
+
|
|
773
|
+
|
|
774
|
+
__init() {this.weak = null}
|
|
775
|
+
get bounds() {
|
|
776
|
+
if (this.cachedBounds === void 0) this.cachedBounds = _chunkCWM3CUUXcjs.contentBounds.call(void 0, this.surface);
|
|
777
|
+
return this.cachedBounds;
|
|
778
|
+
}
|
|
779
|
+
get data() {
|
|
780
|
+
if (lastRead === this) return lastData;
|
|
781
|
+
let d = materialized.get(this);
|
|
782
|
+
if (d) {
|
|
783
|
+
materialized.delete(this);
|
|
784
|
+
materialized.set(this, d);
|
|
785
|
+
lastRead = this;
|
|
786
|
+
lastData = d;
|
|
787
|
+
return d;
|
|
788
|
+
}
|
|
789
|
+
d = _optionalChain([this, 'access', _2 => _2.weak, 'optionalAccess', _3 => _3.deref, 'call', _4 => _4()]);
|
|
790
|
+
if (!d) {
|
|
791
|
+
const all = _chunkCWM3CUUXcjs.readRegion.call(void 0, this.surface, { x: 0, y: 0, width: this.width, height: this.height });
|
|
792
|
+
d = new Uint8Array(all.buffer, all.byteOffset, all.length);
|
|
793
|
+
}
|
|
794
|
+
this.remember(d);
|
|
795
|
+
return d;
|
|
796
|
+
}
|
|
797
|
+
remember(d) {
|
|
798
|
+
lastRead = this;
|
|
799
|
+
lastData = d;
|
|
800
|
+
this.weak = typeof WeakRef === "function" ? new WeakRef(d) : null;
|
|
801
|
+
materialized.set(this, d);
|
|
802
|
+
while (materialized.size > MATERIALIZED_LIMIT) materialized.delete(materialized.keys().next().value);
|
|
803
|
+
}
|
|
804
|
+
}, _class);
|
|
805
|
+
function tileGrid(width, height) {
|
|
806
|
+
return { cols: Math.ceil(width / _chunkCWM3CUUXcjs.TILE), rows: Math.ceil(height / _chunkCWM3CUUXcjs.TILE) };
|
|
807
|
+
}
|
|
808
|
+
function insideTile(tx, ty, width, height) {
|
|
809
|
+
return (tx + 1) * _chunkCWM3CUUXcjs.TILE <= width && (ty + 1) * _chunkCWM3CUUXcjs.TILE <= height;
|
|
810
|
+
}
|
|
811
|
+
function surfaceFromCoverage(width, height, data) {
|
|
812
|
+
const tiles = /* @__PURE__ */ new Map();
|
|
813
|
+
const { cols, rows } = tileGrid(width, height);
|
|
814
|
+
for (let ty = 0; ty < rows; ty++) {
|
|
815
|
+
for (let tx = 0; tx < cols; tx++) {
|
|
816
|
+
const ox = tx * _chunkCWM3CUUXcjs.TILE;
|
|
817
|
+
const oy = ty * _chunkCWM3CUUXcjs.TILE;
|
|
818
|
+
const w = Math.min(_chunkCWM3CUUXcjs.TILE, width - ox);
|
|
819
|
+
const h = Math.min(_chunkCWM3CUUXcjs.TILE, height - oy);
|
|
820
|
+
let lo = 255;
|
|
821
|
+
let hi = 0;
|
|
822
|
+
for (let y = 0; y < h && !(hi > 0 && lo < hi); y++) {
|
|
823
|
+
const row = (oy + y) * width + ox;
|
|
824
|
+
for (let x = 0; x < w; x++) {
|
|
825
|
+
const v = data[row + x];
|
|
826
|
+
if (v < lo) lo = v;
|
|
827
|
+
if (v > hi) hi = v;
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
if (hi === 0) continue;
|
|
831
|
+
if (lo === hi && w === _chunkCWM3CUUXcjs.TILE && h === _chunkCWM3CUUXcjs.TILE) {
|
|
832
|
+
tiles.set(_chunkCWM3CUUXcjs.tileKey.call(void 0, tx, ty), _chunkCWM3CUUXcjs.uniformTile.call(void 0, 1, hi));
|
|
833
|
+
continue;
|
|
834
|
+
}
|
|
835
|
+
const t = new Uint8ClampedArray(TILE_PIXELS);
|
|
836
|
+
for (let y = 0; y < h; y++) {
|
|
837
|
+
const row = (oy + y) * width + ox;
|
|
838
|
+
for (let x = 0; x < w; x++) t[y * _chunkCWM3CUUXcjs.TILE + x] = data[row + x];
|
|
839
|
+
}
|
|
840
|
+
tiles.set(_chunkCWM3CUUXcjs.tileKey.call(void 0, tx, ty), { data: t, uniform: null });
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
return new (0, _chunkCWM3CUUXcjs.TiledSurface)(1, tiles, 0);
|
|
844
|
+
}
|
|
845
|
+
function clipTile(tile, w, h) {
|
|
846
|
+
const d = tile.data;
|
|
847
|
+
let outside = false;
|
|
848
|
+
for (let y = 0; y < _chunkCWM3CUUXcjs.TILE && !outside; y++) {
|
|
849
|
+
for (let x = y < h ? w : 0; x < _chunkCWM3CUUXcjs.TILE; x++) {
|
|
850
|
+
if (d[y * _chunkCWM3CUUXcjs.TILE + x] !== 0) {
|
|
851
|
+
outside = true;
|
|
852
|
+
break;
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
if (!outside) return tile;
|
|
857
|
+
const t = new Uint8ClampedArray(TILE_PIXELS);
|
|
858
|
+
for (let y = 0; y < h; y++) t.set(d.subarray(y * _chunkCWM3CUUXcjs.TILE, y * _chunkCWM3CUUXcjs.TILE + w), y * _chunkCWM3CUUXcjs.TILE);
|
|
859
|
+
return _chunkCWM3CUUXcjs.finishTile.call(void 0, t, 1, 0);
|
|
860
|
+
}
|
|
861
|
+
function selectionFromTiles(width, height, surface) {
|
|
862
|
+
checkSize(width, height);
|
|
863
|
+
if (surface.channels !== 1) throw new Error("A selection needs a 1-channel surface");
|
|
864
|
+
if (surface.defaultValue !== 0) {
|
|
865
|
+
const all = _chunkCWM3CUUXcjs.readRegion.call(void 0, surface, { x: 0, y: 0, width, height });
|
|
866
|
+
return createSelectionMask(width, height, new Uint8Array(all.buffer, all.byteOffset, all.length));
|
|
867
|
+
}
|
|
868
|
+
const { cols, rows } = tileGrid(width, height);
|
|
869
|
+
let tiles = null;
|
|
870
|
+
for (const [key, tile] of surface.tiles) {
|
|
871
|
+
const { tx, ty } = _chunkCWM3CUUXcjs.tileCoord.call(void 0, key);
|
|
872
|
+
let next = tile;
|
|
873
|
+
if (tx < 0 || ty < 0 || tx >= cols || ty >= rows) next = null;
|
|
874
|
+
else if (!insideTile(tx, ty, width, height)) next = clipTile(tile, Math.min(_chunkCWM3CUUXcjs.TILE, width - tx * _chunkCWM3CUUXcjs.TILE), Math.min(_chunkCWM3CUUXcjs.TILE, height - ty * _chunkCWM3CUUXcjs.TILE));
|
|
875
|
+
if (next === tile) continue;
|
|
876
|
+
tiles ??= new Map(surface.tiles);
|
|
877
|
+
if (next) tiles.set(key, next);
|
|
878
|
+
else tiles.delete(key);
|
|
879
|
+
}
|
|
880
|
+
return new TiledSelectionMask(width, height, tiles ? new (0, _chunkCWM3CUUXcjs.TiledSurface)(1, tiles, 0) : surface);
|
|
881
|
+
}
|
|
753
882
|
function createSelectionMask(width, height, data) {
|
|
754
883
|
checkSize(width, height);
|
|
755
|
-
|
|
756
|
-
if (
|
|
757
|
-
return
|
|
884
|
+
if (!data) return new TiledSelectionMask(width, height, new (0, _chunkCWM3CUUXcjs.TiledSurface)(1, /* @__PURE__ */ new Map(), 0), null);
|
|
885
|
+
if (data.length !== width * height) throw new Error("Selection data does not match its size");
|
|
886
|
+
return new TiledSelectionMask(width, height, surfaceFromCoverage(width, height, data), void 0, data);
|
|
887
|
+
}
|
|
888
|
+
function selectionFromRegion(width, height, rect, data) {
|
|
889
|
+
checkSize(width, height);
|
|
890
|
+
if (rect.x < 0 || rect.y < 0 || rect.x + rect.width > width || rect.y + rect.height > height) throw new Error("The region lies outside the selection");
|
|
891
|
+
return new TiledSelectionMask(width, height, _chunkCWM3CUUXcjs.writeRegion.call(void 0, new (0, _chunkCWM3CUUXcjs.TiledSurface)(1, /* @__PURE__ */ new Map(), 0), rect, data));
|
|
758
892
|
}
|
|
759
893
|
function fullSelection(width, height) {
|
|
760
894
|
checkSize(width, height);
|
|
761
|
-
|
|
895
|
+
const tiles = /* @__PURE__ */ new Map();
|
|
896
|
+
const { cols, rows } = tileGrid(width, height);
|
|
897
|
+
for (let ty = 0; ty < rows; ty++) {
|
|
898
|
+
for (let tx = 0; tx < cols; tx++) {
|
|
899
|
+
if (insideTile(tx, ty, width, height)) {
|
|
900
|
+
tiles.set(_chunkCWM3CUUXcjs.tileKey.call(void 0, tx, ty), _chunkCWM3CUUXcjs.uniformTile.call(void 0, 1, 255));
|
|
901
|
+
continue;
|
|
902
|
+
}
|
|
903
|
+
const t = new Uint8ClampedArray(TILE_PIXELS);
|
|
904
|
+
const w = Math.min(_chunkCWM3CUUXcjs.TILE, width - tx * _chunkCWM3CUUXcjs.TILE);
|
|
905
|
+
for (let y = 0; y < Math.min(_chunkCWM3CUUXcjs.TILE, height - ty * _chunkCWM3CUUXcjs.TILE); y++) t.fill(255, y * _chunkCWM3CUUXcjs.TILE, y * _chunkCWM3CUUXcjs.TILE + w);
|
|
906
|
+
tiles.set(_chunkCWM3CUUXcjs.tileKey.call(void 0, tx, ty), { data: t, uniform: null });
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
return new TiledSelectionMask(width, height, new (0, _chunkCWM3CUUXcjs.TiledSurface)(1, tiles, 0), { x: 0, y: 0, width, height });
|
|
762
910
|
}
|
|
763
911
|
function isSelectionEmpty(mask) {
|
|
764
912
|
return !mask || mask.bounds === null;
|
|
@@ -767,7 +915,7 @@ function selectionValueAt(mask, x, y) {
|
|
|
767
915
|
const xi = Math.floor(x);
|
|
768
916
|
const yi = Math.floor(y);
|
|
769
917
|
if (xi < 0 || yi < 0 || xi >= mask.width || yi >= mask.height) return 0;
|
|
770
|
-
return
|
|
918
|
+
return _chunkCWM3CUUXcjs.readPixel.call(void 0, mask.surface, xi, yi)[0] / 255;
|
|
771
919
|
}
|
|
772
920
|
function coverageToByte(v) {
|
|
773
921
|
if (!(v > 0)) return 0;
|
|
@@ -788,10 +936,13 @@ function selectionToCoverage(mask) {
|
|
|
788
936
|
function selectionArea(mask) {
|
|
789
937
|
if (!mask || !mask.bounds) return 0;
|
|
790
938
|
let sum = 0;
|
|
791
|
-
const
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
939
|
+
for (const tile of mask.surface.tiles.values()) {
|
|
940
|
+
if (tile.uniform !== null) {
|
|
941
|
+
sum += tile.uniform * TILE_PIXELS;
|
|
942
|
+
continue;
|
|
943
|
+
}
|
|
944
|
+
const d = tile.data;
|
|
945
|
+
for (let i = 0; i < d.length; i++) sum += d[i];
|
|
795
946
|
}
|
|
796
947
|
return sum / 255;
|
|
797
948
|
}
|
|
@@ -803,20 +954,68 @@ function combineSelections(prev, next, mode) {
|
|
|
803
954
|
return null;
|
|
804
955
|
} else {
|
|
805
956
|
if (prev.width !== next.width || prev.height !== next.height) throw new Error("Selections differ in size");
|
|
806
|
-
|
|
807
|
-
const b = next.data;
|
|
808
|
-
const out = new Uint8Array(a.length);
|
|
809
|
-
if (mode === "add") for (let i = 0; i < a.length; i++) out[i] = a[i] > b[i] ? a[i] : b[i];
|
|
810
|
-
else if (mode === "subtract") for (let i = 0; i < a.length; i++) out[i] = a[i] > b[i] ? a[i] - b[i] : 0;
|
|
811
|
-
else for (let i = 0; i < a.length; i++) out[i] = a[i] < b[i] ? a[i] : b[i];
|
|
812
|
-
result = createSelectionMask(prev.width, prev.height, out);
|
|
957
|
+
result = new TiledSelectionMask(prev.width, prev.height, combineSurfaces(prev.surface, next.surface, mode));
|
|
813
958
|
}
|
|
814
959
|
return result.bounds ? result : null;
|
|
815
960
|
}
|
|
961
|
+
var FULL = 255;
|
|
962
|
+
function combineTile(a, b, mode) {
|
|
963
|
+
if (mode === "add") {
|
|
964
|
+
if (!b || _optionalChain([a, 'optionalAccess', _5 => _5.uniform]) === FULL) return a;
|
|
965
|
+
if (!a || b.uniform === FULL) return b;
|
|
966
|
+
} else if (mode === "subtract") {
|
|
967
|
+
if (!a || !b) return a;
|
|
968
|
+
if (b.uniform === FULL) return void 0;
|
|
969
|
+
} else {
|
|
970
|
+
if (!a || !b) return void 0;
|
|
971
|
+
if (a.uniform === FULL) return b;
|
|
972
|
+
if (b.uniform === FULL) return a;
|
|
973
|
+
}
|
|
974
|
+
const x = a.data;
|
|
975
|
+
const y = b.data;
|
|
976
|
+
const out = new Uint8ClampedArray(TILE_PIXELS);
|
|
977
|
+
if (mode === "add") for (let i = 0; i < out.length; i++) out[i] = x[i] > y[i] ? x[i] : y[i];
|
|
978
|
+
else if (mode === "subtract") for (let i = 0; i < out.length; i++) out[i] = x[i] > y[i] ? x[i] - y[i] : 0;
|
|
979
|
+
else for (let i = 0; i < out.length; i++) out[i] = x[i] < y[i] ? x[i] : y[i];
|
|
980
|
+
return _nullishCoalesce(_chunkCWM3CUUXcjs.finishTile.call(void 0, out, 1, 0), () => ( void 0));
|
|
981
|
+
}
|
|
982
|
+
function combineSurfaces(a, b, mode) {
|
|
983
|
+
const tiles = /* @__PURE__ */ new Map();
|
|
984
|
+
for (const key of /* @__PURE__ */ new Set([...a.tiles.keys(), ...b.tiles.keys()])) {
|
|
985
|
+
const tile = combineTile(a.tiles.get(key), b.tiles.get(key), mode);
|
|
986
|
+
if (tile) tiles.set(key, tile);
|
|
987
|
+
}
|
|
988
|
+
return new (0, _chunkCWM3CUUXcjs.TiledSurface)(1, tiles, 0);
|
|
989
|
+
}
|
|
816
990
|
function invertSelection(mask) {
|
|
817
|
-
const
|
|
818
|
-
|
|
819
|
-
|
|
991
|
+
const { width, height } = mask;
|
|
992
|
+
const tiles = /* @__PURE__ */ new Map();
|
|
993
|
+
const { cols, rows } = tileGrid(width, height);
|
|
994
|
+
for (let ty = 0; ty < rows; ty++) {
|
|
995
|
+
for (let tx = 0; tx < cols; tx++) {
|
|
996
|
+
const src = mask.surface.getTile(tx, ty);
|
|
997
|
+
const key = _chunkCWM3CUUXcjs.tileKey.call(void 0, tx, ty);
|
|
998
|
+
if (insideTile(tx, ty, width, height)) {
|
|
999
|
+
if (!src) tiles.set(key, _chunkCWM3CUUXcjs.uniformTile.call(void 0, 1, FULL));
|
|
1000
|
+
else if (src.uniform !== null) {
|
|
1001
|
+
if (src.uniform !== FULL) tiles.set(key, _chunkCWM3CUUXcjs.uniformTile.call(void 0, 1, FULL - src.uniform));
|
|
1002
|
+
} else {
|
|
1003
|
+
const out2 = new Uint8ClampedArray(TILE_PIXELS);
|
|
1004
|
+
for (let i = 0; i < out2.length; i++) out2[i] = FULL - src.data[i];
|
|
1005
|
+
const t2 = _chunkCWM3CUUXcjs.finishTile.call(void 0, out2, 1, 0);
|
|
1006
|
+
if (t2) tiles.set(key, t2);
|
|
1007
|
+
}
|
|
1008
|
+
continue;
|
|
1009
|
+
}
|
|
1010
|
+
const w = Math.min(_chunkCWM3CUUXcjs.TILE, width - tx * _chunkCWM3CUUXcjs.TILE);
|
|
1011
|
+
const h = Math.min(_chunkCWM3CUUXcjs.TILE, height - ty * _chunkCWM3CUUXcjs.TILE);
|
|
1012
|
+
const out = new Uint8ClampedArray(TILE_PIXELS);
|
|
1013
|
+
for (let y = 0; y < h; y++) for (let x = 0; x < w; x++) out[y * _chunkCWM3CUUXcjs.TILE + x] = FULL - (src ? src.data[y * _chunkCWM3CUUXcjs.TILE + x] : 0);
|
|
1014
|
+
const t = _chunkCWM3CUUXcjs.finishTile.call(void 0, out, 1, 0);
|
|
1015
|
+
if (t) tiles.set(key, t);
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
return new TiledSelectionMask(width, height, new (0, _chunkCWM3CUUXcjs.TiledSurface)(1, tiles, 0));
|
|
820
1019
|
}
|
|
821
1020
|
function resizeSelection(mask, width, height) {
|
|
822
1021
|
if (mask.width === width && mask.height === height) return mask;
|
|
@@ -1222,6 +1421,13 @@ function modifySelection(mask, op, radius) {
|
|
|
1222
1421
|
}
|
|
1223
1422
|
|
|
1224
1423
|
// src/image-editor/selection/layer-mask.ts
|
|
1424
|
+
function layerMaskSelection(layer, width, height) {
|
|
1425
|
+
if (!layer.mask || layer.mask.source) return null;
|
|
1426
|
+
const ox = layer.type === "pixel" ? layer.offset.x : 0;
|
|
1427
|
+
const oy = layer.type === "pixel" ? layer.offset.y : 0;
|
|
1428
|
+
const data = _chunkCWM3CUUXcjs.readRegion.call(void 0, layer.mask.surface, { x: -ox, y: -oy, width, height });
|
|
1429
|
+
return createSelectionMask(width, height, new Uint8Array(data.buffer, data.byteOffset, data.length));
|
|
1430
|
+
}
|
|
1225
1431
|
var MAX_SIDE2 = 1 << 15;
|
|
1226
1432
|
function normalizeLayerMask(raw) {
|
|
1227
1433
|
if (!raw || typeof raw !== "object") return null;
|
|
@@ -1332,7 +1538,7 @@ function projectMaskCoverage(coverage, maskWidth, maskHeight, naturalWidth, natu
|
|
|
1332
1538
|
return out;
|
|
1333
1539
|
}
|
|
1334
1540
|
function buildLayerMaskPlanes(layers, naturalWidth, naturalHeight, projection, targetWidth, targetHeight) {
|
|
1335
|
-
if (!_optionalChain([layers, 'optionalAccess',
|
|
1541
|
+
if (!_optionalChain([layers, 'optionalAccess', _6 => _6.some, 'call', _7 => _7((l) => l.mask && l.mask.enabled !== false)])) return void 0;
|
|
1336
1542
|
const planes = /* @__PURE__ */ new Map();
|
|
1337
1543
|
for (const layer of layers) {
|
|
1338
1544
|
if (!layer.mask) continue;
|
|
@@ -1923,7 +2129,7 @@ function compiledFor(layer, deep = false) {
|
|
|
1923
2129
|
return op;
|
|
1924
2130
|
}
|
|
1925
2131
|
function activeAdjustmentLayers(layers) {
|
|
1926
|
-
if (!_optionalChain([layers, 'optionalAccess',
|
|
2132
|
+
if (!_optionalChain([layers, 'optionalAccess', _8 => _8.length])) return [];
|
|
1927
2133
|
return layers.filter((l) => l.enabled !== false && (_nullishCoalesce(l.opacity, () => ( 1))) > 0 && compiledFor(l) !== null);
|
|
1928
2134
|
}
|
|
1929
2135
|
function evaluateAdjustmentLayers(color, layers) {
|
|
@@ -1955,7 +2161,7 @@ function applyAdjustmentLayers(imageData, layers, masks) {
|
|
|
1955
2161
|
const active = activeAdjustmentLayers(layers);
|
|
1956
2162
|
if (!active.length) return;
|
|
1957
2163
|
const ops = active.map((l) => compiledFor(l));
|
|
1958
|
-
const planes = active.map((l) => _optionalChain([masks, 'optionalAccess',
|
|
2164
|
+
const planes = active.map((l) => _optionalChain([masks, 'optionalAccess', _9 => _9.get, 'call', _10 => _10(l.id)]));
|
|
1959
2165
|
const data = imageData.data;
|
|
1960
2166
|
const len = data.length;
|
|
1961
2167
|
const c = [0, 0, 0];
|
|
@@ -1982,7 +2188,7 @@ function applyAdjustmentLayersFloat(data, layers, masks) {
|
|
|
1982
2188
|
const active = activeAdjustmentLayers(layers);
|
|
1983
2189
|
if (!active.length) return;
|
|
1984
2190
|
const ops = active.map((l) => compiledFor(l, true));
|
|
1985
|
-
const planes = active.map((l) => _optionalChain([masks, 'optionalAccess',
|
|
2191
|
+
const planes = active.map((l) => _optionalChain([masks, 'optionalAccess', _11 => _11.get, 'call', _12 => _12(l.id)]));
|
|
1986
2192
|
const c = [0, 0, 0];
|
|
1987
2193
|
for (let i = 0; i < data.length; i += 4) {
|
|
1988
2194
|
if (!(data[i + 3] > 0)) continue;
|
|
@@ -2002,7 +2208,7 @@ function applyAdjustmentLayersFloat(data, layers, masks) {
|
|
|
2002
2208
|
}
|
|
2003
2209
|
}
|
|
2004
2210
|
function adjustmentLayersKey(layers) {
|
|
2005
|
-
if (!_optionalChain([layers, 'optionalAccess',
|
|
2211
|
+
if (!_optionalChain([layers, 'optionalAccess', _13 => _13.length])) return "";
|
|
2006
2212
|
return JSON.stringify(
|
|
2007
2213
|
layers.map((l) => {
|
|
2008
2214
|
const key = [l.kind, l.enabled !== false, _nullishCoalesce(l.opacity, () => ( 1)), _nullishCoalesce(l.blend, () => ( "normal")), l.params];
|
|
@@ -2398,10 +2604,10 @@ function pixelLayers(layers) {
|
|
|
2398
2604
|
return _chunkHGTDMKNEcjs.flattenLayers.call(void 0, layers).filter((l) => l.type === "pixel");
|
|
2399
2605
|
}
|
|
2400
2606
|
function developFilter(layer) {
|
|
2401
|
-
return _optionalChain([layer, 'access',
|
|
2607
|
+
return _optionalChain([layer, 'access', _14 => _14.filters, 'optionalAccess', _15 => _15.find, 'call', _16 => _16((f) => f.kind === "develop")]);
|
|
2402
2608
|
}
|
|
2403
2609
|
function blurFilter(layer) {
|
|
2404
|
-
return _optionalChain([layer, 'access',
|
|
2610
|
+
return _optionalChain([layer, 'access', _17 => _17.filters, 'optionalAccess', _18 => _18.find, 'call', _19 => _19((f) => f.kind === "blur")]);
|
|
2405
2611
|
}
|
|
2406
2612
|
function isActiveFilter(f) {
|
|
2407
2613
|
if (!f.enabled) return false;
|
|
@@ -2511,7 +2717,7 @@ function filterReach(filters) {
|
|
|
2511
2717
|
var filterSpecCache = /* @__PURE__ */ new WeakMap();
|
|
2512
2718
|
function pixelFilterSpec(layer) {
|
|
2513
2719
|
const list2 = layer.filters;
|
|
2514
|
-
if (!_optionalChain([list2, 'optionalAccess',
|
|
2720
|
+
if (!_optionalChain([list2, 'optionalAccess', _20 => _20.length])) return null;
|
|
2515
2721
|
if (filterSpecCache.has(list2)) return filterSpecCache.get(list2);
|
|
2516
2722
|
const filters = list2.filter(isActiveFilter);
|
|
2517
2723
|
let spec = null;
|
|
@@ -2532,7 +2738,7 @@ var PHOTO_PROFILE = {
|
|
|
2532
2738
|
const views = layers.map(adjustmentNodeAsLayer);
|
|
2533
2739
|
applyAdjustmentLayers({ data: acc }, views, masks);
|
|
2534
2740
|
},
|
|
2535
|
-
contentTile: (l, r, sources) => l.type === "annotation" ? _nullishCoalesce(_optionalChain([sources, 'access',
|
|
2741
|
+
contentTile: (l, r, sources) => l.type === "annotation" ? _nullishCoalesce(_optionalChain([sources, 'access', _21 => _21.rasterizeAnnotation, 'optionalCall', _22 => _22(l.annotation, r)]), () => ( null)) : null,
|
|
2536
2742
|
/** Annotation layers draw with their annotation's blend mode unless the layer sets one. */
|
|
2537
2743
|
contentBlend: (l) => l.type === "annotation" && l.blend === "normal" && l.annotation.blend ? l.annotation.blend : l.blend,
|
|
2538
2744
|
layerKey: (l) => l.type === "pixel" ? [_nullishCoalesce(l.filters, () => ( null)), _nullishCoalesce(l.source, () => ( null))] : l.type === "adjustment" ? [l.kind, l.params] : l.type === "annotation" ? l.annotation : void 0,
|
|
@@ -2544,7 +2750,7 @@ var PHOTO_PROFILE = {
|
|
|
2544
2750
|
isPixelLike: (l) => l.type === "smart" || l.type === "shape" || l.type === "type",
|
|
2545
2751
|
maskSourcePlane: (source, W, H, sources) => {
|
|
2546
2752
|
const opts = source;
|
|
2547
|
-
const depth = _nullishCoalesce(_optionalChain([sources, 'access',
|
|
2753
|
+
const depth = _nullishCoalesce(_optionalChain([sources, 'access', _23 => _23.depthMap, 'optionalCall', _24 => _24(opts)]), () => ( null));
|
|
2548
2754
|
if (!depth || depth.width !== W || depth.height !== H) return null;
|
|
2549
2755
|
const v = new Float32Array(W * H);
|
|
2550
2756
|
for (let i = 0; i < v.length; i++) v[i] = depthMaskAlpha(depth.data[i * 4], opts) / 255;
|
|
@@ -2921,7 +3127,7 @@ function isPaintableLayer(layer) {
|
|
|
2921
3127
|
function defaultActiveLayerId(layers) {
|
|
2922
3128
|
const pixels = _chunkHGTDMKNEcjs.flattenLayers.call(void 0, layers).filter((l) => l.type === "pixel");
|
|
2923
3129
|
for (let i = pixels.length - 1; i >= 0; i--) if (isPaintableLayer(pixels[i])) return pixels[i].id;
|
|
2924
|
-
return _nullishCoalesce(_optionalChain([pixels, 'access',
|
|
3130
|
+
return _nullishCoalesce(_optionalChain([pixels, 'access', _25 => _25[pixels.length - 1], 'optionalAccess', _26 => _26.id]), () => ( null));
|
|
2925
3131
|
}
|
|
2926
3132
|
function activeLayerAfterRemoval(prev, next, removedId) {
|
|
2927
3133
|
const before = _chunkHGTDMKNEcjs.flattenLayers.call(void 0, prev);
|
|
@@ -2952,7 +3158,7 @@ function placeLayer(layers, layer, placement = {}, defaultIndex) {
|
|
|
2952
3158
|
if (given > 1) fail("Give only one of aboveId, belowId and parentId.");
|
|
2953
3159
|
if (placement.aboveId || placement.belowId) {
|
|
2954
3160
|
const ref = requireLayer(layers, _nullishCoalesce(placement.aboveId, () => ( placement.belowId)));
|
|
2955
|
-
return _chunkHGTDMKNEcjs.insertLayer.call(void 0, layers, layer, _nullishCoalesce(_optionalChain([ref, 'access',
|
|
3161
|
+
return _chunkHGTDMKNEcjs.insertLayer.call(void 0, layers, layer, _nullishCoalesce(_optionalChain([ref, 'access', _27 => _27.parent, 'optionalAccess', _28 => _28.id]), () => ( null)), ref.index + (placement.aboveId ? 1 : 0));
|
|
2956
3162
|
}
|
|
2957
3163
|
if (placement.parentId) {
|
|
2958
3164
|
const ref = requireLayer(layers, placement.parentId);
|
|
@@ -2984,7 +3190,7 @@ function withNewIds(layer) {
|
|
|
2984
3190
|
if (next.type === "group") next.children = next.children.map(withNewIds);
|
|
2985
3191
|
if (next.type === "annotation") next.annotation = { ...next.annotation, id: next.id };
|
|
2986
3192
|
if (next.type === "shape" || next.type === "type") delete next.annotation;
|
|
2987
|
-
if (next.type === "smart" && _optionalChain([next, 'access',
|
|
3193
|
+
if (next.type === "smart" && _optionalChain([next, 'access', _29 => _29.psd, 'optionalAccess', _30 => _30.placed])) {
|
|
2988
3194
|
next.psd = { ...next.psd };
|
|
2989
3195
|
delete next.psd.placed;
|
|
2990
3196
|
}
|
|
@@ -2995,7 +3201,7 @@ function duplicateLayer(layers, id, name) {
|
|
|
2995
3201
|
const copy = withNewIds(loc.layer);
|
|
2996
3202
|
copy.name = _nullishCoalesce(name, () => ( `${loc.layer.name || "Layer"} copy`));
|
|
2997
3203
|
delete copy.locks;
|
|
2998
|
-
return { layers: _chunkHGTDMKNEcjs.insertLayer.call(void 0, layers, copy, _nullishCoalesce(_optionalChain([loc, 'access',
|
|
3204
|
+
return { layers: _chunkHGTDMKNEcjs.insertLayer.call(void 0, layers, copy, _nullishCoalesce(_optionalChain([loc, 'access', _31 => _31.parent, 'optionalAccess', _32 => _32.id]), () => ( null)), loc.index + 1), id: copy.id };
|
|
2999
3205
|
}
|
|
3000
3206
|
function setLayerProperties(layers, id, props) {
|
|
3001
3207
|
const loc = requireLayer(layers, id);
|
|
@@ -3047,8 +3253,8 @@ function setLayerProperties(layers, id, props) {
|
|
|
3047
3253
|
function groupLayers(layers, ids, name = "Group") {
|
|
3048
3254
|
if (!ids.length) fail("Give at least one layer id to group.");
|
|
3049
3255
|
const locs = ids.map((id) => requireLayer(layers, id));
|
|
3050
|
-
const parent = _nullishCoalesce(_optionalChain([locs, 'access',
|
|
3051
|
-
if (locs.some((l) => (_nullishCoalesce(_optionalChain([l, 'access',
|
|
3256
|
+
const parent = _nullishCoalesce(_optionalChain([locs, 'access', _33 => _33[0], 'access', _34 => _34.parent, 'optionalAccess', _35 => _35.id]), () => ( null));
|
|
3257
|
+
if (locs.some((l) => (_nullishCoalesce(_optionalChain([l, 'access', _36 => _36.parent, 'optionalAccess', _37 => _37.id]), () => ( null))) !== parent)) fail("Layers to group must share one parent; move them next to each other first.");
|
|
3052
3258
|
for (const l of locs) requireUnlocked(l.layer, "all", "group it");
|
|
3053
3259
|
const ordered = [...new Set(locs)].sort((a, b) => a.index - b.index);
|
|
3054
3260
|
const top = ordered[ordered.length - 1].index;
|
|
@@ -3065,7 +3271,7 @@ function groupLayers(layers, ids, name = "Group") {
|
|
|
3065
3271
|
return c;
|
|
3066
3272
|
})
|
|
3067
3273
|
};
|
|
3068
|
-
if (_optionalChain([group, 'access',
|
|
3274
|
+
if (_optionalChain([group, 'access', _38 => _38.children, 'access', _39 => _39[0], 'optionalAccess', _40 => _40.clipped])) {
|
|
3069
3275
|
const c = { ...group.children[0] };
|
|
3070
3276
|
delete c.clipped;
|
|
3071
3277
|
group.children[0] = c;
|
|
@@ -3081,7 +3287,7 @@ function ungroupLayer(layers, id) {
|
|
|
3081
3287
|
const group = loc.layer;
|
|
3082
3288
|
let out = _chunkHGTDMKNEcjs.mapLayer.call(void 0, layers, id, () => null);
|
|
3083
3289
|
group.children.forEach((c, i) => {
|
|
3084
|
-
out = _chunkHGTDMKNEcjs.insertLayer.call(void 0, out, c, _nullishCoalesce(_optionalChain([loc, 'access',
|
|
3290
|
+
out = _chunkHGTDMKNEcjs.insertLayer.call(void 0, out, c, _nullishCoalesce(_optionalChain([loc, 'access', _41 => _41.parent, 'optionalAccess', _42 => _42.id]), () => ( null)), loc.index + i);
|
|
3085
3291
|
});
|
|
3086
3292
|
return { layers: out, ids: group.children.map((c) => c.id) };
|
|
3087
3293
|
}
|
|
@@ -3139,7 +3345,7 @@ function requirePixelLayer(layers, id) {
|
|
|
3139
3345
|
}
|
|
3140
3346
|
function addLayerFilter(layers, id, filter) {
|
|
3141
3347
|
const layer = requirePixelLayer(layers, id);
|
|
3142
|
-
if (_optionalChain([layer, 'access',
|
|
3348
|
+
if (_optionalChain([layer, 'access', _43 => _43.filters, 'optionalAccess', _44 => _44.some, 'call', _45 => _45((f) => f.kind === filter.kind)])) fail(`Layer "${id}" already has a ${filter.kind} filter; change it with update_layer_filter.`);
|
|
3143
3349
|
return _chunkHGTDMKNEcjs.mapLayer.call(void 0, layers, id, () => ({ ...layer, filters: [..._nullishCoalesce(layer.filters, () => ( [])), filter] }));
|
|
3144
3350
|
}
|
|
3145
3351
|
function updateLayerFilter(layers, id, filterId, changes) {
|
|
@@ -3203,7 +3409,7 @@ function addLayerEffect(layers, id, kind, params = {}, index) {
|
|
|
3203
3409
|
return { layers: setLayerEffects(layers, id, { ...current, items }), effect };
|
|
3204
3410
|
}
|
|
3205
3411
|
function requireEffect(layer, effectId) {
|
|
3206
|
-
const items = _nullishCoalesce(_optionalChain([layer, 'access',
|
|
3412
|
+
const items = _nullishCoalesce(_optionalChain([layer, 'access', _46 => _46.effects, 'optionalAccess', _47 => _47.items]), () => ( []));
|
|
3207
3413
|
const i = items.findIndex((e) => e.id === effectId);
|
|
3208
3414
|
if (i === -1) fail(`Layer "${layer.name || layer.id}" has no effect "${effectId}". Effects: ${items.map((e) => `${e.id} (${e.kind})`).join(", ") || "none"}; call list_layer_effects.`);
|
|
3209
3415
|
return i;
|
|
@@ -3391,7 +3597,7 @@ function closedOutline(path) {
|
|
|
3391
3597
|
function strokeArea(path, stroke, double) {
|
|
3392
3598
|
const w = stroke.width * (double ? 2 : 1);
|
|
3393
3599
|
if (!(w > 0) || !path.length) return [];
|
|
3394
|
-
const dashes = _optionalChain([stroke, 'access',
|
|
3600
|
+
const dashes = _optionalChain([stroke, 'access', _48 => _48.dashes, 'optionalAccess', _49 => _49.length]) && stroke.dashes.some((d) => d > 0) ? stroke.dashes.map((d) => d * stroke.width) : void 0;
|
|
3395
3601
|
const options = {
|
|
3396
3602
|
width: w,
|
|
3397
3603
|
cap: _nullishCoalesce(stroke.cap, () => ( "butt")),
|
|
@@ -3467,7 +3673,7 @@ function paintContext(env) {
|
|
|
3467
3673
|
light: _chunkHGTDMKNEcjs.DEFAULT_GLOBAL_LIGHT,
|
|
3468
3674
|
pattern: (id) => {
|
|
3469
3675
|
if (tiles.has(id)) return tiles.get(id);
|
|
3470
|
-
const p = _nullishCoalesce(_optionalChain([env, 'access',
|
|
3676
|
+
const p = _nullishCoalesce(_optionalChain([env, 'access', _50 => _50.pattern, 'optionalCall', _51 => _51(id)]), () => ( _chunkHGTDMKNEcjs.builtinPattern.call(void 0, id)));
|
|
3471
3677
|
const t = p && p.width > 0 && p.height > 0 && p.data.length >= p.width * p.height * 4 ? new (0, _chunkHGTDMKNEcjs.PatternTile)(p) : null;
|
|
3472
3678
|
tiles.set(id, t);
|
|
3473
3679
|
return t;
|
|
@@ -3500,9 +3706,9 @@ function renderShapeRect(layer, rect, env, ctx = paintContext(env)) {
|
|
|
3500
3706
|
const canvas = { x: 0, y: 0, width: env.width, height: env.height };
|
|
3501
3707
|
const anchor = { x: geo.frame.x, y: geo.frame.y };
|
|
3502
3708
|
const fc = fCov ? _chunkHGTDMKNEcjs.effectFillColors.call(void 0, layer.fill, rect, geo.frame, canvas, anchor, ctx) : null;
|
|
3503
|
-
const fo = _nullishCoalesce(_optionalChain([layer, 'access',
|
|
3709
|
+
const fo = _nullishCoalesce(_optionalChain([layer, 'access', _52 => _52.fill, 'optionalAccess', _53 => _53.opacity]), () => ( 1));
|
|
3504
3710
|
const sc = sCov ? _chunkHGTDMKNEcjs.effectFillColors.call(void 0, layer.stroke.paint, rect, geo.frame, canvas, anchor, ctx) : null;
|
|
3505
|
-
const so = _nullishCoalesce(_optionalChain([layer, 'access',
|
|
3711
|
+
const so = _nullishCoalesce(_optionalChain([layer, 'access', _54 => _54.stroke, 'optionalAccess', _55 => _55.paint, 'access', _56 => _56.opacity]), () => ( 1));
|
|
3506
3712
|
const out = new Uint8ClampedArray(n * 4);
|
|
3507
3713
|
let any = false;
|
|
3508
3714
|
for (let i = 0; i < n; i++) {
|
|
@@ -3584,7 +3790,7 @@ function normalizeShapePaint(v, path = "paint") {
|
|
|
3584
3790
|
const g = o.gradient;
|
|
3585
3791
|
if (!g || typeof g !== "object") return fail2(`${path}.gradient is required: { stops: [{ position, color }], style, angle, \u2026 }.`);
|
|
3586
3792
|
const gradient = {
|
|
3587
|
-
stops: Array.isArray(g.stops) ? g.stops.map((s) => ({ position: s.position, color: _nullishCoalesce(_optionalChain([_chunkA2IS7EHEcjs.parseCssColor.call(void 0, s.color), 'optionalAccess',
|
|
3793
|
+
stops: Array.isArray(g.stops) ? g.stops.map((s) => ({ position: s.position, color: _nullishCoalesce(_optionalChain([_chunkA2IS7EHEcjs.parseCssColor.call(void 0, s.color), 'optionalAccess', _57 => _57.hex]), () => ( s.color)) })) : [],
|
|
3588
3794
|
...g.opacityStops ? { opacityStops: g.opacityStops } : {},
|
|
3589
3795
|
style: _nullishCoalesce(g.style, () => ( "linear")),
|
|
3590
3796
|
angle: _nullishCoalesce(g.angle, () => ( 90)),
|
|
@@ -3610,7 +3816,7 @@ function normalizeShapePaint(v, path = "paint") {
|
|
|
3610
3816
|
if (o.link !== void 0) p.link = Boolean(o.link);
|
|
3611
3817
|
if (o.phase !== void 0) {
|
|
3612
3818
|
const ph = o.phase;
|
|
3613
|
-
p.phase = { x: requireNum(_optionalChain([ph, 'optionalAccess',
|
|
3819
|
+
p.phase = { x: requireNum(_optionalChain([ph, 'optionalAccess', _58 => _58.x]), `${path}.phase.x`), y: requireNum(_optionalChain([ph, 'optionalAccess', _59 => _59.y]), `${path}.phase.y`) };
|
|
3614
3820
|
}
|
|
3615
3821
|
return withOpacity(p);
|
|
3616
3822
|
}
|
|
@@ -3623,7 +3829,7 @@ function normalizeShapeStroke(v, path = "stroke", base) {
|
|
|
3623
3829
|
const paint = o.paint === void 0 && base ? base.paint : o.paint === void 0 && o.color !== void 0 ? normalizeShapePaint(o.color, `${path}.color`) : normalizeShapePaint(o.paint, `${path}.paint`);
|
|
3624
3830
|
const out = { width, paint };
|
|
3625
3831
|
const pick = (k, allowed) => {
|
|
3626
|
-
const value = o[k] === void 0 ? _optionalChain([base, 'optionalAccess',
|
|
3832
|
+
const value = o[k] === void 0 ? _optionalChain([base, 'optionalAccess', _60 => _60[k]]) : o[k];
|
|
3627
3833
|
if (value === void 0) return;
|
|
3628
3834
|
if (!allowed.includes(value)) fail2(`${path}.${k} must be one of ${allowed.join(", ")}, got ${JSON.stringify(value)}.`);
|
|
3629
3835
|
if (value !== (k === "align" ? "center" : k === "cap" ? "butt" : "miter")) out[k] = value;
|
|
@@ -3631,9 +3837,9 @@ function normalizeShapeStroke(v, path = "stroke", base) {
|
|
|
3631
3837
|
pick("align", ["inside", "center", "outside"]);
|
|
3632
3838
|
pick("cap", ["butt", "round", "square"]);
|
|
3633
3839
|
pick("join", ["miter", "round", "bevel"]);
|
|
3634
|
-
const miter = o.miterLimit === void 0 ? _optionalChain([base, 'optionalAccess',
|
|
3840
|
+
const miter = o.miterLimit === void 0 ? _optionalChain([base, 'optionalAccess', _61 => _61.miterLimit]) : requireNum(o.miterLimit, `${path}.miterLimit`, 1, 500);
|
|
3635
3841
|
if (miter !== void 0 && miter !== DEFAULT_MITER_LIMIT) out.miterLimit = miter;
|
|
3636
|
-
const dashes = o.dashes === void 0 ? _optionalChain([base, 'optionalAccess',
|
|
3842
|
+
const dashes = o.dashes === void 0 ? _optionalChain([base, 'optionalAccess', _62 => _62.dashes]) : o.dashes;
|
|
3637
3843
|
if (dashes !== void 0 && dashes !== null) {
|
|
3638
3844
|
if (!Array.isArray(dashes) || dashes.length > 32 || !dashes.every((d) => isNum(d) && d >= 0 && d <= 1e4)) fail2(`${path}.dashes must be at most 32 lengths 0..10000 (multiples of the width).`);
|
|
3639
3845
|
if (dashes.length) {
|
|
@@ -3641,7 +3847,7 @@ function normalizeShapeStroke(v, path = "stroke", base) {
|
|
|
3641
3847
|
out.dashes = [...dashes];
|
|
3642
3848
|
}
|
|
3643
3849
|
}
|
|
3644
|
-
const offset = o.dashOffset === void 0 ? _optionalChain([base, 'optionalAccess',
|
|
3850
|
+
const offset = o.dashOffset === void 0 ? _optionalChain([base, 'optionalAccess', _63 => _63.dashOffset]) : requireNum(o.dashOffset, `${path}.dashOffset`, -1e6, 1e6);
|
|
3645
3851
|
if (offset) out.dashOffset = offset;
|
|
3646
3852
|
return out;
|
|
3647
3853
|
}
|
|
@@ -3785,7 +3991,7 @@ function createShapeLayer(init, env, id = newLayerId()) {
|
|
|
3785
3991
|
return rerenderShape(layer, env);
|
|
3786
3992
|
}
|
|
3787
3993
|
function defaultShapeName(c) {
|
|
3788
|
-
switch (_optionalChain([c, 'optionalAccess',
|
|
3994
|
+
switch (_optionalChain([c, 'optionalAccess', _64 => _64.live, 'optionalAccess', _65 => _65.kind])) {
|
|
3789
3995
|
case "rect":
|
|
3790
3996
|
return "Rectangle";
|
|
3791
3997
|
case "ellipse":
|
|
@@ -3980,7 +4186,7 @@ function textOutlines(layer, shaper) {
|
|
|
3980
4186
|
}
|
|
3981
4187
|
var rgbOf = (hex) => {
|
|
3982
4188
|
const c = _chunkA2IS7EHEcjs.parseCssColor.call(void 0, hex);
|
|
3983
|
-
const h = (_nullishCoalesce(_optionalChain([c, 'optionalAccess',
|
|
4189
|
+
const h = (_nullishCoalesce(_optionalChain([c, 'optionalAccess', _66 => _66.hex]), () => ( "#000000"))).slice(1);
|
|
3984
4190
|
return [parseInt(h.slice(0, 2), 16), parseInt(h.slice(2, 4), 16), parseInt(h.slice(4, 6), 16)];
|
|
3985
4191
|
};
|
|
3986
4192
|
function renderOutlines(layer, shaper, region) {
|
|
@@ -4196,7 +4402,7 @@ function createTypeLayer(init, env, id = newLayerId(), lenient = false) {
|
|
|
4196
4402
|
surface: _chunkCWM3CUUXcjs.emptySurface.call(void 0, 4),
|
|
4197
4403
|
offset: { x: 0, y: 0 }
|
|
4198
4404
|
};
|
|
4199
|
-
if (!layer.runs.length) layer.runs = [{ length: 0, style: _nullishCoalesce(_optionalChain([init, 'access',
|
|
4405
|
+
if (!layer.runs.length) layer.runs = [{ length: 0, style: _nullishCoalesce(_optionalChain([init, 'access', _67 => _67.runs, 'access', _68 => _68[0], 'optionalAccess', _69 => _69.style]), () => ( _chunkEGZM52EOcjs.DEFAULT_TEXT_STYLE)) }];
|
|
4200
4406
|
if (init.transform && !_chunkEGZM52EOcjs.isIdentityMatrix.call(void 0, init.transform)) layer.transform = init.transform;
|
|
4201
4407
|
if (lenient && !renderText(layer, env)) return { ...layer, rendering: "stored" };
|
|
4202
4408
|
return rerenderText(layer, env);
|
|
@@ -4207,7 +4413,7 @@ function updateTypeLayer(layers, id, change, env, action = "edit it") {
|
|
|
4207
4413
|
const patch = change(current);
|
|
4208
4414
|
const next = { ...current, ...patch };
|
|
4209
4415
|
if (!("annotation" in patch)) delete next.annotation;
|
|
4210
|
-
if ("text" in patch || "runs" in patch) next.runs = _chunkEGZM52EOcjs.fitRuns.call(void 0, next.runs, next.text.length, _nullishCoalesce(_optionalChain([current, 'access',
|
|
4416
|
+
if ("text" in patch || "runs" in patch) next.runs = _chunkEGZM52EOcjs.fitRuns.call(void 0, next.runs, next.text.length, _nullishCoalesce(_optionalChain([current, 'access', _70 => _70.runs, 'access', _71 => _71[0], 'optionalAccess', _72 => _72.style]), () => ( _chunkEGZM52EOcjs.DEFAULT_TEXT_STYLE)));
|
|
4211
4417
|
if (!next.runs.length) next.runs = [{ length: 0, style: _chunkEGZM52EOcjs.styleAt.call(void 0, current.runs, 0, _chunkEGZM52EOcjs.DEFAULT_TEXT_STYLE) }];
|
|
4212
4418
|
if ("text" in patch || "paragraphs" in patch) next.paragraphs = _chunkEGZM52EOcjs.fitParagraphRuns.call(void 0, next.paragraphs, next.text);
|
|
4213
4419
|
const rendered = rerenderText(next, env);
|
|
@@ -4494,7 +4700,7 @@ function legacyView(stack, width, height, activeLayerId = null) {
|
|
|
4494
4700
|
const { layers } = stack;
|
|
4495
4701
|
const target = developTarget(layers, activeLayerId);
|
|
4496
4702
|
const develop = target ? developFilter(target) : void 0;
|
|
4497
|
-
const blur = _nullishCoalesce(_nullishCoalesce(stack.legacyOutputBlur, () => ( (target ? _optionalChain([blurFilter, 'call',
|
|
4703
|
+
const blur = _nullishCoalesce(_nullishCoalesce(stack.legacyOutputBlur, () => ( (target ? _optionalChain([blurFilter, 'call', _73 => _73(target), 'optionalAccess', _74 => _74.radius]) : void 0))), () => ( 0));
|
|
4498
4704
|
const adjustments = {
|
|
4499
4705
|
...DEFAULT_ADJUSTMENTS_VALUES,
|
|
4500
4706
|
...develop ? {
|
|
@@ -4523,7 +4729,7 @@ function legacyView(stack, width, height, activeLayerId = null) {
|
|
|
4523
4729
|
};
|
|
4524
4730
|
walk(layers);
|
|
4525
4731
|
if (adjNodes.length) adjustments.layers = adjNodes.map((n) => legacyAdjustmentLayer(n, width, height));
|
|
4526
|
-
const depthSource = _optionalChain([target, 'optionalAccess',
|
|
4732
|
+
const depthSource = _optionalChain([target, 'optionalAccess', _75 => _75.mask, 'optionalAccess', _76 => _76.source]);
|
|
4527
4733
|
const depthMask = depthSource ? { ...depthSource, depthRange: [...depthSource.depthRange] } : { ...DEFAULT_DEPTH_MASK_VALUES, depthRange: [...DEFAULT_DEPTH_MASK_VALUES.depthRange] };
|
|
4528
4734
|
return { adjustments, depthMask, annotations, exact: isLegacyShape(stack) };
|
|
4529
4735
|
}
|
|
@@ -4548,7 +4754,7 @@ function isLegacyShape(stack) {
|
|
|
4548
4754
|
let adjustments = 0;
|
|
4549
4755
|
for (; i < layers.length && layers[i].type === "adjustment"; i++) {
|
|
4550
4756
|
const l = layers[i];
|
|
4551
|
-
if (l.clipped || l.locks || _optionalChain([l, 'access',
|
|
4757
|
+
if (l.clipped || l.locks || _optionalChain([l, 'access', _77 => _77.mask, 'optionalAccess', _78 => _78.source]) || l.effects) return false;
|
|
4552
4758
|
adjustments++;
|
|
4553
4759
|
}
|
|
4554
4760
|
for (; i < layers.length; i++) {
|
|
@@ -4755,7 +4961,7 @@ function isContentsDecoded(contents) {
|
|
|
4755
4961
|
}
|
|
4756
4962
|
function requireDecoded(layer, action) {
|
|
4757
4963
|
if (isContentsDecoded(layer.contents)) return;
|
|
4758
|
-
const what = _optionalChain([layer, 'access',
|
|
4964
|
+
const what = _optionalChain([layer, 'access', _79 => _79.contents, 'access', _80 => _80.file, 'optionalAccess', _81 => _81.type]) ? `a ${layer.contents.file.type.toUpperCase()} file` : "a file";
|
|
4759
4965
|
fail4(
|
|
4760
4966
|
`The contents of smart object "${layer.name || layer.id}" are ${what} that could not be decoded here, so it cannot ${action}. Run prepareSmartObjects() in a browser first, or rasterize it.`
|
|
4761
4967
|
);
|
|
@@ -4780,7 +4986,7 @@ function contentsSurface(contents) {
|
|
|
4780
4986
|
width: W,
|
|
4781
4987
|
height: H,
|
|
4782
4988
|
globalLight: doc.globalLight,
|
|
4783
|
-
pattern: (id) => _nullishCoalesce(_optionalChain([doc, 'access',
|
|
4989
|
+
pattern: (id) => _nullishCoalesce(_optionalChain([doc, 'access', _82 => _82.patterns, 'optionalAccess', _83 => _83.find, 'call', _84 => _84((p) => p.id === id)]), () => ( null))
|
|
4784
4990
|
});
|
|
4785
4991
|
s = _chunkCWM3CUUXcjs.surfaceFromPixels.call(void 0, { width: W, height: H, data }, 4, 0, 0);
|
|
4786
4992
|
}
|
|
@@ -4815,7 +5021,7 @@ function placeContents(layer, canvas, options = {}) {
|
|
|
4815
5021
|
const preview = Boolean(options.step && options.step > 1) || Boolean(options.clip);
|
|
4816
5022
|
const key = placementKey(placement, canvas);
|
|
4817
5023
|
if (!preview) {
|
|
4818
|
-
const hit = _optionalChain([placedCache, 'access',
|
|
5024
|
+
const hit = _optionalChain([placedCache, 'access', _85 => _85.get, 'call', _86 => _86(contents), 'optionalAccess', _87 => _87.get, 'call', _88 => _88(key)]);
|
|
4819
5025
|
if (hit) return hit;
|
|
4820
5026
|
}
|
|
4821
5027
|
const src = contentsSurface(contents);
|
|
@@ -4842,10 +5048,10 @@ function placeContents(layer, canvas, options = {}) {
|
|
|
4842
5048
|
let k = 1;
|
|
4843
5049
|
if (step > 1) {
|
|
4844
5050
|
k = step;
|
|
4845
|
-
let r = _optionalChain([options, 'access',
|
|
5051
|
+
let r = _optionalChain([options, 'access', _89 => _89.reduced, 'optionalAccess', _90 => _90.get, 'call', _91 => _91(k)]);
|
|
4846
5052
|
if (!r) {
|
|
4847
5053
|
r = _chunkHGTDMKNEcjs.reduceSurface.call(void 0, src, k);
|
|
4848
|
-
_optionalChain([options, 'access',
|
|
5054
|
+
_optionalChain([options, 'access', _92 => _92.reduced, 'optionalAccess', _93 => _93.set, 'call', _94 => _94(k, r)]);
|
|
4849
5055
|
}
|
|
4850
5056
|
source = r;
|
|
4851
5057
|
}
|
|
@@ -4878,15 +5084,15 @@ function placeContents(layer, canvas, options = {}) {
|
|
|
4878
5084
|
return out;
|
|
4879
5085
|
}
|
|
4880
5086
|
function activeSmartFilters(stack) {
|
|
4881
|
-
if (!_optionalChain([stack, 'optionalAccess',
|
|
5087
|
+
if (!_optionalChain([stack, 'optionalAccess', _95 => _95.enabled])) return [];
|
|
4882
5088
|
return stack.filters.filter((f) => f.kind !== "psd" && f.kind !== "effect" && isActiveFilter(f) && f.opacity > 0);
|
|
4883
5089
|
}
|
|
4884
5090
|
function activeEffectSmartFilters(stack) {
|
|
4885
|
-
if (!_optionalChain([stack, 'optionalAccess',
|
|
5091
|
+
if (!_optionalChain([stack, 'optionalAccess', _96 => _96.enabled])) return [];
|
|
4886
5092
|
return stack.filters.filter((f) => f.kind === "effect" && f.enabled && f.opacity > 0);
|
|
4887
5093
|
}
|
|
4888
5094
|
function runnableSmartFilters(stack) {
|
|
4889
|
-
if (!_optionalChain([stack, 'optionalAccess',
|
|
5095
|
+
if (!_optionalChain([stack, 'optionalAccess', _97 => _97.enabled])) return [];
|
|
4890
5096
|
return stack.filters.filter((f) => f.opacity > 0 && (f.kind === "effect" ? f.enabled : f.kind !== "psd" && isActiveFilter(f)));
|
|
4891
5097
|
}
|
|
4892
5098
|
function filterMaskCoverage(mask, canvas) {
|
|
@@ -4912,7 +5118,7 @@ function applySmartFilters(placed, stack, canvas) {
|
|
|
4912
5118
|
if (!active.length || !(canvas.width > 0 && canvas.height > 0)) return placed;
|
|
4913
5119
|
const W = canvas.width;
|
|
4914
5120
|
const H = canvas.height;
|
|
4915
|
-
const token = active.some((f) => f.kind === "effect") ? _nullishCoalesce(_optionalChain([canvas, 'access',
|
|
5121
|
+
const token = active.some((f) => f.kind === "effect") ? _nullishCoalesce(_optionalChain([canvas, 'access', _98 => _98.effects, 'optionalAccess', _99 => _99.token]), () => ( -1)) : 0;
|
|
4916
5122
|
const key = JSON.stringify([W, H, token, active.map((f) => ({ ...f, id: void 0 }))]);
|
|
4917
5123
|
let entry = filteredCache.get(placed);
|
|
4918
5124
|
let incomplete = false;
|
|
@@ -4924,9 +5130,9 @@ function applySmartFilters(placed, stack, canvas) {
|
|
|
4924
5130
|
if (f.kind === "effect") {
|
|
4925
5131
|
if (incomplete) continue;
|
|
4926
5132
|
const inputKey = JSON.stringify([surfaceId(placed), W, H, active.slice(0, i + 1).map((x) => ({ ...x, id: void 0, blend: x === f ? void 0 : x.blend, opacity: x === f ? void 0 : x.opacity }))]);
|
|
4927
|
-
const r = _optionalChain([canvas, 'access',
|
|
4928
|
-
if (!_optionalChain([r, 'optionalAccess',
|
|
4929
|
-
if (_optionalChain([r, 'optionalAccess',
|
|
5133
|
+
const r = _optionalChain([canvas, 'access', _100 => _100.effects, 'optionalAccess', _101 => _101.resolve, 'call', _102 => _102(f, acc, W, H, inputKey)]);
|
|
5134
|
+
if (!_optionalChain([r, 'optionalAccess', _103 => _103.result])) {
|
|
5135
|
+
if (_optionalChain([r, 'optionalAccess', _104 => _104.pending])) incomplete = true;
|
|
4930
5136
|
continue;
|
|
4931
5137
|
}
|
|
4932
5138
|
out2 = new Uint8ClampedArray(r.result);
|
|
@@ -4977,7 +5183,7 @@ function rerender(layer, canvas, action = "change") {
|
|
|
4977
5183
|
return { ...layer, surface: renderSmartObject(layer, canvas) };
|
|
4978
5184
|
}
|
|
4979
5185
|
function normalizePlacement(raw, contents) {
|
|
4980
|
-
const c = _optionalChain([raw, 'optionalAccess',
|
|
5186
|
+
const c = _optionalChain([raw, 'optionalAccess', _105 => _105.corners]);
|
|
4981
5187
|
if (!Array.isArray(c) || c.length !== 4 || !c.every((p) => p && Number.isFinite(p.x) && Number.isFinite(p.y))) {
|
|
4982
5188
|
fail4("corners must be four finite points [top-left, top-right, bottom-right, bottom-left] in document pixels.");
|
|
4983
5189
|
}
|
|
@@ -5022,7 +5228,7 @@ function setSmartPlacement(layers, id, placement, canvas) {
|
|
|
5022
5228
|
masksMoved ||= m !== layer.mask;
|
|
5023
5229
|
next.mask = m;
|
|
5024
5230
|
}
|
|
5025
|
-
if (_optionalChain([next, 'access',
|
|
5231
|
+
if (_optionalChain([next, 'access', _106 => _106.smartFilters, 'optionalAccess', _107 => _107.mask])) {
|
|
5026
5232
|
const m = followMask(next.smartFilters.mask, layer, next);
|
|
5027
5233
|
masksMoved ||= m !== next.smartFilters.mask;
|
|
5028
5234
|
next.smartFilters = { ...next.smartFilters, mask: m };
|
|
@@ -5040,12 +5246,12 @@ function offsetSmartObject(layers, id, dx, dy, canvas) {
|
|
|
5040
5246
|
let next = { ...layer, placement: { ...layer.placement, corners } };
|
|
5041
5247
|
const moveMask = (m2) => m2 && m2.linked !== false && !m2.source ? { ...m2, surface: _chunkCWM3CUUXcjs.translateSurface.call(void 0, m2.surface, mx, my) } : m2;
|
|
5042
5248
|
if (layer.mask) next.mask = moveMask(layer.mask);
|
|
5043
|
-
if (_optionalChain([layer, 'access',
|
|
5249
|
+
if (_optionalChain([layer, 'access', _108 => _108.smartFilters, 'optionalAccess', _109 => _109.mask])) next.smartFilters = { ...layer.smartFilters, mask: moveMask(layer.smartFilters.mask) };
|
|
5044
5250
|
const spatial = activeSmartFilters(layer.smartFilters).some((f) => f.kind === "blur") || activeEffectSmartFilters(layer.smartFilters).length > 0;
|
|
5045
5251
|
const b = _chunkCWM3CUUXcjs.contentBounds.call(void 0, layer.surface);
|
|
5046
5252
|
const m = SMART_RENDER_MARGIN;
|
|
5047
5253
|
const cut = b && (b.x <= -m || b.y <= -m || b.x + b.width >= canvas.width + m || b.y + b.height >= canvas.height + m);
|
|
5048
|
-
if (!spatial && !cut && !(_optionalChain([next, 'access',
|
|
5254
|
+
if (!spatial && !cut && !(_optionalChain([next, 'access', _110 => _110.smartFilters, 'optionalAccess', _111 => _111.mask]) && activeSmartFilters(next.smartFilters).length && next.smartFilters.mask.linked === false)) {
|
|
5049
5255
|
next = { ...next, surface: _chunkCWM3CUUXcjs.translateSurface.call(void 0, layer.surface, mx, my) };
|
|
5050
5256
|
} else {
|
|
5051
5257
|
next = rerender(next, canvas, "move");
|
|
@@ -5070,7 +5276,7 @@ function translateLayer(layer, dx, dy) {
|
|
|
5070
5276
|
mask: moveMask(layer.mask)
|
|
5071
5277
|
};
|
|
5072
5278
|
if (!next.mask) delete next.mask;
|
|
5073
|
-
if (_optionalChain([layer, 'access',
|
|
5279
|
+
if (_optionalChain([layer, 'access', _112 => _112.smartFilters, 'optionalAccess', _113 => _113.mask])) next.smartFilters = { ...layer.smartFilters, mask: moveMask(layer.smartFilters.mask) };
|
|
5074
5280
|
return next;
|
|
5075
5281
|
}
|
|
5076
5282
|
case "group": {
|
|
@@ -5130,14 +5336,14 @@ function union(a, b) {
|
|
|
5130
5336
|
return { x, y, width: Math.max(a.x + a.width, b.x + b.width) - x, height: Math.max(a.y + a.height, b.y + b.height) - y };
|
|
5131
5337
|
}
|
|
5132
5338
|
function asSmartFilters(filters) {
|
|
5133
|
-
if (!_optionalChain([filters, 'optionalAccess',
|
|
5339
|
+
if (!_optionalChain([filters, 'optionalAccess', _114 => _114.length])) return void 0;
|
|
5134
5340
|
return { enabled: true, filters: filters.map((f) => ({ ...f, blend: "normal", opacity: 1 })) };
|
|
5135
5341
|
}
|
|
5136
5342
|
function convertToSmartObject(layers, ids, canvas, options) {
|
|
5137
5343
|
if (!ids.length) fail4("Give at least one layer id to convert.");
|
|
5138
5344
|
const locs = [...new Set(ids)].map((id) => requireLayer(layers, id));
|
|
5139
|
-
const parent = _nullishCoalesce(_optionalChain([locs, 'access',
|
|
5140
|
-
if (locs.some((l) => (_nullishCoalesce(_optionalChain([l, 'access',
|
|
5345
|
+
const parent = _nullishCoalesce(_optionalChain([locs, 'access', _115 => _115[0], 'access', _116 => _116.parent, 'optionalAccess', _117 => _117.id]), () => ( null));
|
|
5346
|
+
if (locs.some((l) => (_nullishCoalesce(_optionalChain([l, 'access', _118 => _118.parent, 'optionalAccess', _119 => _119.id]), () => ( null))) !== parent)) fail4("Layers to convert must share one parent; move them next to each other first.");
|
|
5141
5347
|
for (const l of locs) requireUnlocked(l.layer, "all", "convert it");
|
|
5142
5348
|
const ordered = locs.sort((a, b) => a.index - b.index);
|
|
5143
5349
|
const top = ordered[ordered.length - 1];
|
|
@@ -5195,7 +5401,7 @@ function convertToSmartObject(layers, ids, canvas, options) {
|
|
|
5195
5401
|
delete first.clipped;
|
|
5196
5402
|
nested[0] = first;
|
|
5197
5403
|
}
|
|
5198
|
-
const name = _optionalChain([options, 'access',
|
|
5404
|
+
const name = _optionalChain([options, 'access', _120 => _120.name, 'optionalAccess', _121 => _121.trim, 'call', _122 => _122()]) || top.layer.name || "Smart Object";
|
|
5199
5405
|
const contents = documentContents({ layers: nested }, b.width, b.height, `${name}.psb`);
|
|
5200
5406
|
smart = {
|
|
5201
5407
|
type: "smart",
|
|
@@ -5210,7 +5416,7 @@ function convertToSmartObject(layers, ids, canvas, options) {
|
|
|
5210
5416
|
offset: { x: 0, y: 0 }
|
|
5211
5417
|
};
|
|
5212
5418
|
}
|
|
5213
|
-
if (_optionalChain([options, 'access',
|
|
5419
|
+
if (_optionalChain([options, 'access', _123 => _123.name, 'optionalAccess', _124 => _124.trim, 'call', _125 => _125()])) smart.name = options.name.trim();
|
|
5214
5420
|
smart = { ...smart, surface: renderSmartObject(smart, canvas) };
|
|
5215
5421
|
const below = ordered.filter((l) => l.index < top.index).length;
|
|
5216
5422
|
let out = layers;
|
|
@@ -5240,12 +5446,12 @@ function rasterizeSmartObject(layers, id) {
|
|
|
5240
5446
|
function copySmartObject(layers, id, linked, name) {
|
|
5241
5447
|
const loc = requireLayer(layers, id);
|
|
5242
5448
|
const layer = requireSmartObject(layers, id);
|
|
5243
|
-
const copy = { ...layer, id: newLayerId("smart"), name: _optionalChain([name, 'optionalAccess',
|
|
5449
|
+
const copy = { ...layer, id: newLayerId("smart"), name: _optionalChain([name, 'optionalAccess', _126 => _126.trim, 'call', _127 => _127()]) || `${layer.name || "Smart Object"} copy` };
|
|
5244
5450
|
delete copy.locks;
|
|
5245
5451
|
delete copy.psd;
|
|
5246
5452
|
if (!linked) copy.contents = { ...layer.contents, id: newContentsId() };
|
|
5247
5453
|
if (copy.smartFilters) copy.smartFilters = { ...copy.smartFilters, filters: copy.smartFilters.filters.map((f) => ({ ...f, id: newLayerId("flt") })) };
|
|
5248
|
-
return { layers: _chunkHGTDMKNEcjs.insertLayer.call(void 0, layers, copy, _nullishCoalesce(_optionalChain([loc, 'access',
|
|
5454
|
+
return { layers: _chunkHGTDMKNEcjs.insertLayer.call(void 0, layers, copy, _nullishCoalesce(_optionalChain([loc, 'access', _128 => _128.parent, 'optionalAccess', _129 => _129.id]), () => ( null)), loc.index + 1), layer: copy };
|
|
5249
5455
|
}
|
|
5250
5456
|
function instancesOf(layers, contentsId) {
|
|
5251
5457
|
return _chunkHGTDMKNEcjs.flattenLayers.call(void 0, layers).filter((l) => l.type === "smart" && l.contents.id === contentsId).map((l) => l.id);
|
|
@@ -5317,7 +5523,7 @@ function stackOf(layer) {
|
|
|
5317
5523
|
return _nullishCoalesce(layer.smartFilters, () => ( { enabled: true, filters: [] }));
|
|
5318
5524
|
}
|
|
5319
5525
|
function requireFilter(layer, filterId) {
|
|
5320
|
-
const list2 = _nullishCoalesce(_optionalChain([layer, 'access',
|
|
5526
|
+
const list2 = _nullishCoalesce(_optionalChain([layer, 'access', _130 => _130.smartFilters, 'optionalAccess', _131 => _131.filters]), () => ( []));
|
|
5321
5527
|
const i = list2.findIndex((f) => f.id === filterId);
|
|
5322
5528
|
if (i === -1) fail4(`Smart object "${layer.name || layer.id}" has no smart filter "${filterId}". Filters: ${list2.map((f) => `${f.id} (${f.kind})`).join(", ") || "none"}; call get_smart_object.`);
|
|
5323
5529
|
return i;
|
|
@@ -5384,7 +5590,7 @@ function setSmartFiltersEnabled(layers, id, enabled, canvas) {
|
|
|
5384
5590
|
}
|
|
5385
5591
|
function setSmartFilterMask(layers, id, mask, canvas) {
|
|
5386
5592
|
const layer = editableSmart(layers, id);
|
|
5387
|
-
if (_optionalChain([mask, 'optionalAccess',
|
|
5593
|
+
if (_optionalChain([mask, 'optionalAccess', _132 => _132.source])) fail4("A smart filter mask is painted, not generated; use a raster mask.");
|
|
5388
5594
|
const stack = { ...stackOf(layer) };
|
|
5389
5595
|
if (mask) stack.mask = mask;
|
|
5390
5596
|
else delete stack.mask;
|
|
@@ -5536,7 +5742,7 @@ function serializeLayer(layer, ctx) {
|
|
|
5536
5742
|
}
|
|
5537
5743
|
}
|
|
5538
5744
|
if (layer.fillOpacity !== void 0 && layer.fillOpacity !== 1) out.fillOpacity = layer.fillOpacity;
|
|
5539
|
-
if (_optionalChain([layer, 'access',
|
|
5745
|
+
if (_optionalChain([layer, 'access', _133 => _133.filters, 'optionalAccess', _134 => _134.length])) out.filters = JSON.parse(JSON.stringify(layer.filters));
|
|
5540
5746
|
if (layer.generator) out.generator = JSON.parse(JSON.stringify(layer.generator));
|
|
5541
5747
|
if (layer.source !== "document") {
|
|
5542
5748
|
const deep = encodeDeepSurface(layer.surface);
|
|
@@ -5579,12 +5785,12 @@ function serializeType(layer, base, ctx) {
|
|
|
5579
5785
|
out.x = enc.x;
|
|
5580
5786
|
out.y = enc.y;
|
|
5581
5787
|
}
|
|
5582
|
-
if (_optionalChain([layer, 'access',
|
|
5788
|
+
if (_optionalChain([layer, 'access', _135 => _135.missingFonts, 'optionalAccess', _136 => _136.length])) out.missingFonts = [...layer.missingFonts];
|
|
5583
5789
|
if (layer.annotation) out.annotation = JSON.parse(JSON.stringify(layer.annotation));
|
|
5584
|
-
if (_optionalChain([layer, 'access',
|
|
5790
|
+
if (_optionalChain([layer, 'access', _137 => _137.psd, 'optionalAccess', _138 => _138.tySh]) || _optionalChain([layer, 'access', _139 => _139.psd, 'optionalAccess', _140 => _140.blocks, 'optionalAccess', _141 => _141.length])) {
|
|
5585
5791
|
out.psd = {};
|
|
5586
5792
|
if (layer.psd.tySh) out.psd.tySh = _chunkCWM3CUUXcjs.bytesToBase64.call(void 0, layer.psd.tySh);
|
|
5587
|
-
if (_optionalChain([layer, 'access',
|
|
5793
|
+
if (_optionalChain([layer, 'access', _142 => _142.psd, 'access', _143 => _143.blocks, 'optionalAccess', _144 => _144.length])) out.psd.blocks = layer.psd.blocks.map((b) => ({ key: b.key, data: _chunkCWM3CUUXcjs.bytesToBase64.call(void 0, b.data) }));
|
|
5588
5794
|
if (layer.psd.signature) out.psd.signature = layer.psd.signature;
|
|
5589
5795
|
}
|
|
5590
5796
|
return out;
|
|
@@ -5594,15 +5800,15 @@ function readType(r, base, ctx) {
|
|
|
5594
5800
|
try {
|
|
5595
5801
|
const text3 = normalizeText(_nullishCoalesce(r.text, () => ( "")));
|
|
5596
5802
|
const runs = (Array.isArray(r.runs) ? r.runs : []).map((run, i) => ({
|
|
5597
|
-
length: Math.max(0, Math.floor(num2(_optionalChain([run, 'optionalAccess',
|
|
5598
|
-
style: patchTextStyle(_chunkEGZM52EOcjs.DEFAULT_TEXT_STYLE, _optionalChain([run, 'optionalAccess',
|
|
5803
|
+
length: Math.max(0, Math.floor(num2(_optionalChain([run, 'optionalAccess', _145 => _145.length]), 0, 1e9, 0))),
|
|
5804
|
+
style: patchTextStyle(_chunkEGZM52EOcjs.DEFAULT_TEXT_STYLE, _optionalChain([run, 'optionalAccess', _146 => _146.style]) && typeof run.style === "object" ? run.style : {}, `runs[${i}].style`)
|
|
5599
5805
|
}));
|
|
5600
5806
|
const paragraphs = (Array.isArray(r.paragraphs) ? r.paragraphs : []).map((p, i) => ({
|
|
5601
|
-
length: Math.max(0, Math.floor(num2(_optionalChain([p, 'optionalAccess',
|
|
5602
|
-
style: patchParagraphStyle({}, _optionalChain([p, 'optionalAccess',
|
|
5807
|
+
length: Math.max(0, Math.floor(num2(_optionalChain([p, 'optionalAccess', _147 => _147.length]), 0, 1e9, 0))),
|
|
5808
|
+
style: patchParagraphStyle({}, _optionalChain([p, 'optionalAccess', _148 => _148.style]) && typeof p.style === "object" ? p.style : {}, `paragraphs[${i}].style`)
|
|
5603
5809
|
}));
|
|
5604
5810
|
const f = r.frame;
|
|
5605
|
-
const frame = _optionalChain([f, 'optionalAccess',
|
|
5811
|
+
const frame = _optionalChain([f, 'optionalAccess', _149 => _149.kind]) === "box" ? { kind: "box", width: num2(f.width, 1, 1e6, 100), height: num2(f.height, 1, 1e6, 100) } : _optionalChain([f, 'optionalAccess', _150 => _150.origin]) === "top" ? { kind: "point", origin: "top" } : { kind: "point" };
|
|
5606
5812
|
const m = Array.isArray(r.transform) && r.transform.length === 6 && r.transform.every((v) => typeof v === "number" && Number.isFinite(v)) ? r.transform : void 0;
|
|
5607
5813
|
const layer = {
|
|
5608
5814
|
...base,
|
|
@@ -5614,7 +5820,7 @@ function readType(r, base, ctx) {
|
|
|
5614
5820
|
surface: _chunkCWM3CUUXcjs.emptySurface.call(void 0, 4),
|
|
5615
5821
|
offset: { x: 0, y: 0 }
|
|
5616
5822
|
};
|
|
5617
|
-
if (!layer.runs.length) layer.runs = [{ length: 0, style: _nullishCoalesce(_optionalChain([runs, 'access',
|
|
5823
|
+
if (!layer.runs.length) layer.runs = [{ length: 0, style: _nullishCoalesce(_optionalChain([runs, 'access', _151 => _151[0], 'optionalAccess', _152 => _152.style]), () => ( _chunkEGZM52EOcjs.DEFAULT_TEXT_STYLE)) }];
|
|
5618
5824
|
if (m) layer.transform = m;
|
|
5619
5825
|
if (r.antiAlias === false) layer.antiAlias = false;
|
|
5620
5826
|
if (typeof r.fillOpacity === "number" && r.fillOpacity !== 1) layer.fillOpacity = num2(r.fillOpacity, 0, 1, 1);
|
|
@@ -5625,10 +5831,10 @@ function readType(r, base, ctx) {
|
|
|
5625
5831
|
if (typeof r.psd.tySh === "string") psd.tySh = _chunkCWM3CUUXcjs.base64ToBytes.call(void 0, r.psd.tySh);
|
|
5626
5832
|
if (Array.isArray(r.psd.blocks)) psd.blocks = r.psd.blocks.filter((b) => b && typeof b.key === "string" && typeof b.data === "string").map((b) => ({ key: b.key, data: _chunkCWM3CUUXcjs.base64ToBytes.call(void 0, b.data) }));
|
|
5627
5833
|
if (typeof r.psd.signature === "string") psd.signature = r.psd.signature;
|
|
5628
|
-
if (psd.tySh || _optionalChain([psd, 'access',
|
|
5834
|
+
if (psd.tySh || _optionalChain([psd, 'access', _153 => _153.blocks, 'optionalAccess', _154 => _154.length])) layer.psd = psd;
|
|
5629
5835
|
}
|
|
5630
5836
|
if (typeof r.asset === "string") return { ...layer, surface: readSurface(r.asset, r.x, r.y, 4, 0, ctx, label), rendering: "stored" };
|
|
5631
|
-
const env = { ..._nullishCoalesce(ctx.canvas, () => ( { width: 1, height: 1 })), shaper: _nullishCoalesce(_optionalChain([ctx, 'access',
|
|
5837
|
+
const env = { ..._nullishCoalesce(ctx.canvas, () => ( { width: 1, height: 1 })), shaper: _nullishCoalesce(_optionalChain([ctx, 'access', _155 => _155.text, 'optionalAccess', _156 => _156.shaper]), () => ( null)), createCanvas: _optionalChain([ctx, 'access', _157 => _157.text, 'optionalAccess', _158 => _158.createCanvas]) };
|
|
5632
5838
|
try {
|
|
5633
5839
|
return rerenderText(layer, env);
|
|
5634
5840
|
} catch (e8) {
|
|
@@ -5651,7 +5857,7 @@ function serializeShape(layer, base) {
|
|
|
5651
5857
|
if (layer.inverted) out.inverted = true;
|
|
5652
5858
|
if (layer.fillOpacity !== void 0 && layer.fillOpacity !== 1) out.fillOpacity = layer.fillOpacity;
|
|
5653
5859
|
if (layer.annotation) out.annotation = JSON.parse(JSON.stringify(layer.annotation));
|
|
5654
|
-
if (_optionalChain([layer, 'access',
|
|
5860
|
+
if (_optionalChain([layer, 'access', _159 => _159.psd, 'optionalAccess', _160 => _160.blocks, 'optionalAccess', _161 => _161.length])) out.psd = { blocks: layer.psd.blocks.map((b) => ({ key: b.key, data: _chunkCWM3CUUXcjs.bytesToBase64.call(void 0, b.data) })), ...layer.psd.signature ? { signature: layer.psd.signature } : {} };
|
|
5655
5861
|
return out;
|
|
5656
5862
|
}
|
|
5657
5863
|
function readShape(r, base, ctx) {
|
|
@@ -5665,12 +5871,12 @@ function readShape(r, base, ctx) {
|
|
|
5665
5871
|
if (!data) {
|
|
5666
5872
|
if (!Array.isArray(r.components) || !r.components.length) throw new Error("it has no components");
|
|
5667
5873
|
const components = r.components.map((c, i) => {
|
|
5668
|
-
const op = requireOperation(_optionalChain([c, 'optionalAccess',
|
|
5669
|
-
if (_optionalChain([c, 'optionalAccess',
|
|
5874
|
+
const op = requireOperation(_optionalChain([c, 'optionalAccess', _162 => _162.op]), `components[${i}].op`);
|
|
5875
|
+
if (_optionalChain([c, 'optionalAccess', _163 => _163.live])) {
|
|
5670
5876
|
const live = normalizeLiveShape(c.live, `components[${i}].live`);
|
|
5671
5877
|
return { op, subpaths: liveShapeSubpaths(live), live };
|
|
5672
5878
|
}
|
|
5673
|
-
return { op, subpaths: Array.isArray(_optionalChain([c, 'optionalAccess',
|
|
5879
|
+
return { op, subpaths: Array.isArray(_optionalChain([c, 'optionalAccess', _164 => _164.subpaths])) && !c.subpaths.length ? [] : normalizeSubpaths(_optionalChain([c, 'optionalAccess', _165 => _165.subpaths]), `components[${i}].subpaths`) };
|
|
5674
5880
|
});
|
|
5675
5881
|
data = {
|
|
5676
5882
|
components,
|
|
@@ -5741,7 +5947,7 @@ function serializeContents(c, ctx) {
|
|
|
5741
5947
|
if (c.kind === "document" && c.document) {
|
|
5742
5948
|
out.layers = c.document.layers.map((l) => serializeLayer(l, ctx));
|
|
5743
5949
|
if (c.document.globalLight) out.globalLight = { ...c.document.globalLight };
|
|
5744
|
-
if (_optionalChain([c, 'access',
|
|
5950
|
+
if (_optionalChain([c, 'access', _166 => _166.document, 'access', _167 => _167.patterns, 'optionalAccess', _168 => _168.length])) out.patterns = serializePatterns(c.document.patterns);
|
|
5745
5951
|
}
|
|
5746
5952
|
if (c.file) out.file = { type: c.file.type, data: _chunkCWM3CUUXcjs.bytesToBase64.call(void 0, c.file.bytes) };
|
|
5747
5953
|
if (c.linked) out.linked = { path: c.linked.path };
|
|
@@ -5921,7 +6127,7 @@ function deserializeLayer(raw, ctx) {
|
|
|
5921
6127
|
...base,
|
|
5922
6128
|
type: "pixel",
|
|
5923
6129
|
surface: r.source === "document" ? _chunkCWM3CUUXcjs.emptySurface.call(void 0, 4) : readSurface(r.asset, r.x, r.y, 4, 0, ctx, `Layer "${base.name || id}"`),
|
|
5924
|
-
offset: { x: Math.round(num2(_optionalChain([r, 'access',
|
|
6130
|
+
offset: { x: Math.round(num2(_optionalChain([r, 'access', _169 => _169.offset, 'optionalAccess', _170 => _170.x]), -1e7, 1e7, 0)), y: Math.round(num2(_optionalChain([r, 'access', _171 => _171.offset, 'optionalAccess', _172 => _172.y]), -1e7, 1e7, 0)) }
|
|
5925
6131
|
};
|
|
5926
6132
|
if (r.source === "document") layer.source = "document";
|
|
5927
6133
|
else if (r.deep) layer.surface = decodeDeepSurface(layer.surface, r.deep, ctx.problems, `Layer "${base.name || id}"`);
|
|
@@ -5930,7 +6136,7 @@ function deserializeLayer(raw, ctx) {
|
|
|
5930
6136
|
if (filters) layer.filters = filters;
|
|
5931
6137
|
const generator = readEffectRef(r.generator);
|
|
5932
6138
|
if (generator) {
|
|
5933
|
-
const duration = _optionalChain([r, 'access',
|
|
6139
|
+
const duration = _optionalChain([r, 'access', _173 => _173.generator, 'access', _174 => _174.animate, 'optionalAccess', _175 => _175.duration]);
|
|
5934
6140
|
layer.generator = {
|
|
5935
6141
|
...generator,
|
|
5936
6142
|
...typeof r.generator.time === "number" && r.generator.time > 0 ? { time: r.generator.time } : {},
|
|
@@ -5961,7 +6167,7 @@ function deserializeLayer(raw, ctx) {
|
|
|
5961
6167
|
return null;
|
|
5962
6168
|
}
|
|
5963
6169
|
const annotation = JSON.parse(JSON.stringify({ ...a, id: typeof a.id === "string" ? a.id : id }));
|
|
5964
|
-
const migrated = annotationLayerFor(annotation, { ..._nullishCoalesce(ctx.canvas, () => ( { width: 1, height: 1 })), shaper: _nullishCoalesce(_optionalChain([ctx, 'access',
|
|
6170
|
+
const migrated = annotationLayerFor(annotation, { ..._nullishCoalesce(ctx.canvas, () => ( { width: 1, height: 1 })), shaper: _nullishCoalesce(_optionalChain([ctx, 'access', _176 => _176.text, 'optionalAccess', _177 => _177.shaper]), () => ( null)), createCanvas: _optionalChain([ctx, 'access', _178 => _178.text, 'optionalAccess', _179 => _179.createCanvas]) });
|
|
5965
6171
|
if (migrated.type === "shape" || migrated.type === "type") {
|
|
5966
6172
|
const blend = base.blend === "normal" ? migrated.blend : base.blend;
|
|
5967
6173
|
return { ...migrated, ...base, blend, id, name: base.name };
|
|
@@ -6241,9 +6447,9 @@ var PsdReader = class _PsdReader {
|
|
|
6241
6447
|
return s.replace(/\u0000+$/, "");
|
|
6242
6448
|
}
|
|
6243
6449
|
};
|
|
6244
|
-
var PsdWriter = (
|
|
6245
|
-
|
|
6246
|
-
|
|
6450
|
+
var PsdWriter = (_class2 = class {constructor() { _class2.prototype.__init2.call(this);_class2.prototype.__init3.call(this); }
|
|
6451
|
+
__init2() {this.buf = new Uint8Array(1 << 16)}
|
|
6452
|
+
__init3() {this.length = 0}
|
|
6247
6453
|
ensure(n) {
|
|
6248
6454
|
if (this.length + n <= this.buf.length) return;
|
|
6249
6455
|
let size = this.buf.length * 2;
|
|
@@ -6328,7 +6534,7 @@ var PsdWriter = (_class = class {constructor() { _class.prototype.__init.call(th
|
|
|
6328
6534
|
result() {
|
|
6329
6535
|
return this.buf.slice(0, this.length);
|
|
6330
6536
|
}
|
|
6331
|
-
},
|
|
6537
|
+
}, _class2);
|
|
6332
6538
|
function decodeLegacyName(b) {
|
|
6333
6539
|
try {
|
|
6334
6540
|
return new TextDecoder("utf-8", { fatal: true }).decode(b);
|
|
@@ -6539,7 +6745,7 @@ function descriptor(classId, items = []) {
|
|
|
6539
6745
|
return { name: "", classId, items };
|
|
6540
6746
|
}
|
|
6541
6747
|
function descGet(d, key) {
|
|
6542
|
-
return _optionalChain([d, 'access',
|
|
6748
|
+
return _optionalChain([d, 'access', _180 => _180.items, 'access', _181 => _181.find, 'call', _182 => _182(([k]) => k === key), 'optionalAccess', _183 => _183[1]]);
|
|
6543
6749
|
}
|
|
6544
6750
|
function descNumber(d, key) {
|
|
6545
6751
|
const v = descGet(d, key);
|
|
@@ -6549,7 +6755,7 @@ function descNumber(d, key) {
|
|
|
6549
6755
|
}
|
|
6550
6756
|
function descBool(d, key) {
|
|
6551
6757
|
const v = descGet(d, key);
|
|
6552
|
-
return _optionalChain([v, 'optionalAccess',
|
|
6758
|
+
return _optionalChain([v, 'optionalAccess', _184 => _184.type]) === "bool" ? v.value : void 0;
|
|
6553
6759
|
}
|
|
6554
6760
|
function descObject(d, key) {
|
|
6555
6761
|
const v = descGet(d, key);
|
|
@@ -7133,7 +7339,7 @@ function writeAdjustmentBlock(kind, params) {
|
|
|
7133
7339
|
|
|
7134
7340
|
// src/image-editor/psd/channels.ts
|
|
7135
7341
|
var hexToRgb2 = (hex) => {
|
|
7136
|
-
const v = parseInt(_nullishCoalesce(_optionalChain([/^#?([0-9a-f]{6})$/i, 'access',
|
|
7342
|
+
const v = parseInt(_nullishCoalesce(_optionalChain([/^#?([0-9a-f]{6})$/i, 'access', _185 => _185.exec, 'call', _186 => _186(hex), 'optionalAccess', _187 => _187[1]]), () => ( "ff0000")), 16);
|
|
7137
7343
|
return [v >> 16 & 255, v >> 8 & 255, v & 255];
|
|
7138
7344
|
};
|
|
7139
7345
|
var rgbToHex = (r, g, b) => `#${[r, g, b].map((c) => c.toString(16).padStart(2, "0")).join("")}`;
|
|
@@ -7207,16 +7413,16 @@ function readAlphaChannels(planes, header, first, resource2, warn) {
|
|
|
7207
7413
|
if (start + size > planes.length) break;
|
|
7208
7414
|
const d = display[i];
|
|
7209
7415
|
const name = names[i] || `Alpha ${i + 1}`;
|
|
7210
|
-
if (_optionalChain([d, 'optionalAccess',
|
|
7416
|
+
if (_optionalChain([d, 'optionalAccess', _188 => _188.kind]) === 2) {
|
|
7211
7417
|
warn(`Spot colour channel "${name}" is not supported and was left out.`);
|
|
7212
7418
|
continue;
|
|
7213
7419
|
}
|
|
7214
7420
|
out.push({
|
|
7215
7421
|
name,
|
|
7216
7422
|
data: planeTo8(planes.subarray(start, start + size), n, header.depth),
|
|
7217
|
-
color: _nullishCoalesce(_optionalChain([d, 'optionalAccess',
|
|
7218
|
-
opacity: _nullishCoalesce(_optionalChain([d, 'optionalAccess',
|
|
7219
|
-
indicates: _optionalChain([d, 'optionalAccess',
|
|
7423
|
+
color: _nullishCoalesce(_optionalChain([d, 'optionalAccess', _189 => _189.color]), () => ( "#ff0000")),
|
|
7424
|
+
opacity: _nullishCoalesce(_optionalChain([d, 'optionalAccess', _190 => _190.opacity]), () => ( 0.5)),
|
|
7425
|
+
indicates: _optionalChain([d, 'optionalAccess', _191 => _191.kind]) === 0 ? "selected" : "masked"
|
|
7220
7426
|
});
|
|
7221
7427
|
}
|
|
7222
7428
|
return out;
|
|
@@ -7361,7 +7567,7 @@ var enumV = (typeId, value) => ({ type: "enum", typeId, value });
|
|
|
7361
7567
|
var obj = (d) => ({ type: "Objc", value: d });
|
|
7362
7568
|
var enumOf = (d, key) => {
|
|
7363
7569
|
const v = descGet(d, key);
|
|
7364
|
-
return _optionalChain([v, 'optionalAccess',
|
|
7570
|
+
return _optionalChain([v, 'optionalAccess', _192 => _192.type]) === "enum" ? v.value : void 0;
|
|
7365
7571
|
};
|
|
7366
7572
|
function read(data) {
|
|
7367
7573
|
try {
|
|
@@ -7443,7 +7649,7 @@ function strokeFromVstk(data, dpi, notes) {
|
|
|
7443
7649
|
const miter = descNumber(d, "strokeStyleMiterLimit");
|
|
7444
7650
|
if (miter !== void 0 && miter !== 100) stroke.miterLimit = Math.max(1, Math.min(500, miter));
|
|
7445
7651
|
const dashes = descGet(d, "strokeStyleLineDashSet");
|
|
7446
|
-
if (_optionalChain([dashes, 'optionalAccess',
|
|
7652
|
+
if (_optionalChain([dashes, 'optionalAccess', _193 => _193.type]) === "VlLs") {
|
|
7447
7653
|
const list2 = dashes.items.map((v) => v.type === "UntF" || v.type === "doub" || v.type === "long" ? v.value : NaN).filter((v) => Number.isFinite(v) && v >= 0);
|
|
7448
7654
|
if (list2.length && list2.some((v) => v > 0)) stroke.dashes = list2;
|
|
7449
7655
|
}
|
|
@@ -7595,7 +7801,7 @@ function vogkBytes(components, dpi) {
|
|
|
7595
7801
|
["keyOriginLineArrowEnd", boolV(Boolean(live.endArrow))],
|
|
7596
7802
|
["keyOriginLineArrWdth", dbl(head ? head.width / w * 100 : 0)],
|
|
7597
7803
|
["keyOriginLineArrLngth", dbl(head ? head.length / w * 100 : 0)],
|
|
7598
|
-
["keyOriginLineArrConc", long2(_optionalChain([head, 'optionalAccess',
|
|
7804
|
+
["keyOriginLineArrConc", long2(_optionalChain([head, 'optionalAccess', _194 => _194.concavity]) ? head.concavity * 100 : 0)]
|
|
7599
7805
|
];
|
|
7600
7806
|
}
|
|
7601
7807
|
const m = live.transform;
|
|
@@ -7628,7 +7834,7 @@ function shapeSignature(layer) {
|
|
|
7628
7834
|
return JSON.stringify([layer.components, layer.fill, layer.stroke, _nullishCoalesce(layer.fillRule, () => ( "nonzero")), Boolean(layer.inverted)]);
|
|
7629
7835
|
}
|
|
7630
7836
|
function shapeFromBlocks(blocks, width, height, dpi, notes) {
|
|
7631
|
-
const block = (k) => _optionalChain([blocks, 'access',
|
|
7837
|
+
const block = (k) => _optionalChain([blocks, 'access', _195 => _195.find, 'call', _196 => _196((b) => b.key === k), 'optionalAccess', _197 => _197.data]);
|
|
7632
7838
|
const vector = _nullishCoalesce(block("vsms"), () => ( block("vmsk")));
|
|
7633
7839
|
const path = vector ? componentsFromVectorBlock(vector, width, height) : null;
|
|
7634
7840
|
if (!path) return null;
|
|
@@ -7683,18 +7889,18 @@ function sameExtent(sub, c) {
|
|
|
7683
7889
|
return a.every((v, i) => Math.abs(v - b[i]) < 1);
|
|
7684
7890
|
}
|
|
7685
7891
|
function shapeBlocks(layer, width, height, dpi, notes) {
|
|
7686
|
-
const kept = _optionalChain([layer, 'access',
|
|
7687
|
-
if (_optionalChain([kept, 'optionalAccess',
|
|
7892
|
+
const kept = _optionalChain([layer, 'access', _198 => _198.psd, 'optionalAccess', _199 => _199.blocks]);
|
|
7893
|
+
if (_optionalChain([kept, 'optionalAccess', _200 => _200.length]) && _optionalChain([layer, 'access', _201 => _201.psd, 'optionalAccess', _202 => _202.signature]) === shapeSignature(layer)) return kept.map((b) => ({ key: b.key, data: b.data }));
|
|
7688
7894
|
const out = [];
|
|
7689
7895
|
out.push({ key: "vsms", data: vectorBlockForComponents(layer.components, Boolean(layer.inverted), width, height) });
|
|
7690
7896
|
if (layer.fillRule === "evenodd" && layer.components.some((c) => c.subpaths.length > 1)) notes.add("Even-odd fill rules were written as nonzero (Photoshop fills shapes nonzero)");
|
|
7691
7897
|
const fill = _nullishCoalesce(layer.fill, () => ( { type: "color", color: "#000000" }));
|
|
7692
|
-
if (_optionalChain([layer, 'access',
|
|
7898
|
+
if (_optionalChain([layer, 'access', _203 => _203.fill, 'optionalAccess', _204 => _204.opacity]) !== void 0 && layer.fill.opacity < 1) notes.add("Shape fill opacity has no PSD equivalent and was written as 100 % (use the layer fill opacity)");
|
|
7693
7899
|
out.push({ key: "vscg", data: vscgBytes(fill) });
|
|
7694
7900
|
if (layer.stroke || !layer.fill) out.push({ key: "vstk", data: vstkBytes(layer.stroke, Boolean(layer.fill), dpi) });
|
|
7695
7901
|
const vogk = vogkBytes(layer.components, dpi);
|
|
7696
7902
|
if (vogk) out.push({ key: "vogk", data: vogk });
|
|
7697
|
-
if (layer.components.some((c) => _optionalChain([c, 'access',
|
|
7903
|
+
if (layer.components.some((c) => _optionalChain([c, 'access', _205 => _205.live, 'optionalAccess', _206 => _206.kind]) === "line" && (c.live.startArrow && c.live.endArrow && JSON.stringify(c.live.startArrow) !== JSON.stringify(c.live.endArrow) || false))) {
|
|
7698
7904
|
notes.add("Lines with different start and end arrowheads were written with one arrowhead size (Photoshop has one)");
|
|
7699
7905
|
}
|
|
7700
7906
|
return out;
|
|
@@ -7903,7 +8109,7 @@ var E = {
|
|
|
7903
8109
|
bool: (value) => ({ t: "bool", value })
|
|
7904
8110
|
};
|
|
7905
8111
|
function eGet(v, key) {
|
|
7906
|
-
return _optionalChain([v, 'optionalAccess',
|
|
8112
|
+
return _optionalChain([v, 'optionalAccess', _207 => _207.t]) === "dict" ? _optionalChain([v, 'access', _208 => _208.items, 'access', _209 => _209.find, 'call', _210 => _210(([k]) => k === key), 'optionalAccess', _211 => _211[1]]) : void 0;
|
|
7907
8113
|
}
|
|
7908
8114
|
function ePath(v, keys) {
|
|
7909
8115
|
return keys.reduce((at, k) => eGet(at, k), v);
|
|
@@ -7921,7 +8127,7 @@ function eStr(v) {
|
|
|
7921
8127
|
return v && (v.t === "string" || v.t === "name") ? v.value : void 0;
|
|
7922
8128
|
}
|
|
7923
8129
|
function eArray(v) {
|
|
7924
|
-
return _optionalChain([v, 'optionalAccess',
|
|
8130
|
+
return _optionalChain([v, 'optionalAccess', _212 => _212.t]) === "array" ? v.items : [];
|
|
7925
8131
|
}
|
|
7926
8132
|
function eSet(d, key, value) {
|
|
7927
8133
|
if (d.t !== "dict") return;
|
|
@@ -8023,7 +8229,7 @@ function fontFromPostScript(ps) {
|
|
|
8023
8229
|
}
|
|
8024
8230
|
family += suffix;
|
|
8025
8231
|
const s = style.toLowerCase();
|
|
8026
|
-
const weight = _nullishCoalesce(_optionalChain([WEIGHTS, 'access',
|
|
8232
|
+
const weight = _nullishCoalesce(_optionalChain([WEIGHTS, 'access', _213 => _213.find, 'call', _214 => _214(([re]) => re.test(s)), 'optionalAccess', _215 => _215[1]]), () => ( 400));
|
|
8027
8233
|
return { family: family || ps, weight, italic: /italic|oblique|it$/.test(s) };
|
|
8028
8234
|
}
|
|
8029
8235
|
var STYLE_NAMES = [
|
|
@@ -8048,7 +8254,7 @@ var hex2 = (v) => Math.round(Math.max(0, Math.min(1, v)) * 255).toString(16).pad
|
|
|
8048
8254
|
function merged(levels) {
|
|
8049
8255
|
const items = [];
|
|
8050
8256
|
for (const l of levels) {
|
|
8051
|
-
if (_optionalChain([l, 'optionalAccess',
|
|
8257
|
+
if (_optionalChain([l, 'optionalAccess', _216 => _216.t]) !== "dict") continue;
|
|
8052
8258
|
for (const [k, v] of l.items) if (!items.some(([o]) => o === k)) items.push([k, v]);
|
|
8053
8259
|
}
|
|
8054
8260
|
return E.dict(items);
|
|
@@ -8119,10 +8325,10 @@ function typeFromTySh(data, notes) {
|
|
|
8119
8325
|
const t = parseTySh(data);
|
|
8120
8326
|
if (!t) return null;
|
|
8121
8327
|
const txtV = descGet(t.text, "Txt ");
|
|
8122
|
-
const txt = _optionalChain([txtV, 'optionalAccess',
|
|
8328
|
+
const txt = _optionalChain([txtV, 'optionalAccess', _217 => _217.type]) === "TEXT" ? txtV.value.replace(/\0+$/, "") : void 0;
|
|
8123
8329
|
const ed = descGet(t.text, "EngineData");
|
|
8124
8330
|
let engine = null;
|
|
8125
|
-
if (_optionalChain([ed, 'optionalAccess',
|
|
8331
|
+
if (_optionalChain([ed, 'optionalAccess', _218 => _218.type]) === "tdta") {
|
|
8126
8332
|
try {
|
|
8127
8333
|
engine = parseEngineData(ed.data);
|
|
8128
8334
|
} catch (e18) {
|
|
@@ -8130,12 +8336,12 @@ function typeFromTySh(data, notes) {
|
|
|
8130
8336
|
}
|
|
8131
8337
|
}
|
|
8132
8338
|
const anti = descGet(t.text, "AntA");
|
|
8133
|
-
const antiAlias = !(_optionalChain([anti, 'optionalAccess',
|
|
8339
|
+
const antiAlias = !(_optionalChain([anti, 'optionalAccess', _219 => _219.type]) === "enum" && (anti.value === "Anno" || anti.value === "antiAliasNone"));
|
|
8134
8340
|
const ornt = descGet(t.text, "Ornt");
|
|
8135
|
-
if (_optionalChain([ornt, 'optionalAccess',
|
|
8341
|
+
if (_optionalChain([ornt, 'optionalAccess', _220 => _220.type]) === "enum" && ornt.value === "Vrtc") notes.add("vertical type is laid out horizontally");
|
|
8136
8342
|
if (t.warp) {
|
|
8137
8343
|
const style = descGet(t.warp, "warpStyle");
|
|
8138
|
-
if (_optionalChain([style, 'optionalAccess',
|
|
8344
|
+
if (_optionalChain([style, 'optionalAccess', _221 => _221.type]) === "enum" && style.value !== "warpNone") notes.add("warped text is drawn without its warp when edited");
|
|
8139
8345
|
}
|
|
8140
8346
|
const edText = _nullishCoalesce(eStr(ePath(_nullishCoalesce(engine, () => ( void 0)), ["EngineDict", "Editor", "Text"])), () => ( ""));
|
|
8141
8347
|
const text3 = (_nullishCoalesce(txt, () => ( edText.replace(/\r$/, "")))).replace(/\r\n?/g, "\n");
|
|
@@ -8184,7 +8390,7 @@ function typeFromTySh(data, notes) {
|
|
|
8184
8390
|
let at = 0;
|
|
8185
8391
|
runs = ssheets.map((sheet, i) => {
|
|
8186
8392
|
const own = named(styleSet, sheet);
|
|
8187
|
-
const paraDefault = _optionalChain([paraBases, 'access',
|
|
8393
|
+
const paraDefault = _optionalChain([paraBases, 'access', _222 => _222[paraAt(at)], 'optionalAccess', _223 => _223.charDefault]);
|
|
8188
8394
|
at += _nullishCoalesce(slens[i], () => ( 0));
|
|
8189
8395
|
const d = merged([eGet(sheet, "StyleSheetData"), eGet(own, "StyleSheetData"), eGet(paraDefault, "StyleSheetData"), eGet(normalStyle, "StyleSheetData")]);
|
|
8190
8396
|
return { length: _nullishCoalesce(slens[i], () => ( 0)), style: charStyle(d, fonts, notes) };
|
|
@@ -8263,8 +8469,8 @@ var fontEntry = (name) => E.dict([
|
|
|
8263
8469
|
["Synthetic", E.int(0)]
|
|
8264
8470
|
]);
|
|
8265
8471
|
function buildEngineData(layer, template) {
|
|
8266
|
-
const e = _optionalChain([template, 'optionalAccess',
|
|
8267
|
-
if (_optionalChain([eGet, 'call',
|
|
8472
|
+
const e = _optionalChain([template, 'optionalAccess', _224 => _224.t]) === "dict" ? eClone(template) : E.dict([["EngineDict", E.dict()], ["ResourceDict", E.dict()]]);
|
|
8473
|
+
if (_optionalChain([eGet, 'call', _225 => _225(e, "EngineDict"), 'optionalAccess', _226 => _226.t]) !== "dict") eSet(e, "EngineDict", E.dict());
|
|
8268
8474
|
const dict = eGet(e, "EngineDict");
|
|
8269
8475
|
const text3 = layer.text.replace(/\n/g, "\r");
|
|
8270
8476
|
const edText = `${text3}\r`;
|
|
@@ -8343,7 +8549,7 @@ function buildEngineData(layer, template) {
|
|
|
8343
8549
|
eSet(e, key, rd);
|
|
8344
8550
|
}
|
|
8345
8551
|
eSet(rd, "FontSet", fontSet);
|
|
8346
|
-
if (!eGet(rd, "StyleSheetSet")) eSet(rd, "StyleSheetSet", E.array([E.dict([["Name", E.str("Normal RGB")], ["StyleSheetData", styleSheetData(_nullishCoalesce(_optionalChain([runs, 'access',
|
|
8552
|
+
if (!eGet(rd, "StyleSheetSet")) eSet(rd, "StyleSheetSet", E.array([E.dict([["Name", E.str("Normal RGB")], ["StyleSheetData", styleSheetData(_nullishCoalesce(_optionalChain([runs, 'access', _227 => _227[0], 'optionalAccess', _228 => _228.style]), () => ( _chunkEGZM52EOcjs.DEFAULT_TEXT_STYLE)), 0)]])]));
|
|
8347
8553
|
if (!eGet(rd, "ParagraphSheetSet")) eSet(rd, "ParagraphSheetSet", E.array([E.dict([["Name", E.str("Normal RGB")], ["DefaultStyleSheet", E.int(0)], ["Properties", paragraphProperties({})]])]));
|
|
8348
8554
|
if (!eGet(rd, "TheNormalStyleSheet")) eSet(rd, "TheNormalStyleSheet", E.int(0));
|
|
8349
8555
|
if (!eGet(rd, "TheNormalParagraphSheet")) eSet(rd, "TheNormalParagraphSheet", E.int(0));
|
|
@@ -8364,12 +8570,12 @@ function inkBounds2(layer) {
|
|
|
8364
8570
|
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))];
|
|
8365
8571
|
}
|
|
8366
8572
|
function tyShForLayer(layer) {
|
|
8367
|
-
const raw = _optionalChain([layer, 'access',
|
|
8368
|
-
if (raw && _optionalChain([layer, 'access',
|
|
8573
|
+
const raw = _optionalChain([layer, 'access', _229 => _229.psd, 'optionalAccess', _230 => _230.tySh]);
|
|
8574
|
+
if (raw && _optionalChain([layer, 'access', _231 => _231.psd, 'optionalAccess', _232 => _232.signature]) === typeSignature(layer)) return raw;
|
|
8369
8575
|
const old = raw ? parseTySh(raw) : null;
|
|
8370
8576
|
const oldEd = old ? descGet(old.text, "EngineData") : void 0;
|
|
8371
8577
|
let template = null;
|
|
8372
|
-
if (_optionalChain([oldEd, 'optionalAccess',
|
|
8578
|
+
if (_optionalChain([oldEd, 'optionalAccess', _233 => _233.type]) === "tdta") {
|
|
8373
8579
|
try {
|
|
8374
8580
|
template = parseEngineData(oldEd.data);
|
|
8375
8581
|
} catch (e19) {
|
|
@@ -8401,8 +8607,8 @@ function tyShForLayer(layer) {
|
|
|
8401
8607
|
set("boundingBox", rect("boundingBox"));
|
|
8402
8608
|
if (!descGet(text3, "TextIndex")) set("TextIndex", { type: "long", value: 0 });
|
|
8403
8609
|
set("EngineData", { type: "tdta", data: writeEngineData(engine) });
|
|
8404
|
-
const warpStyle = _optionalChain([old, 'optionalAccess',
|
|
8405
|
-
const warp = _optionalChain([old, 'optionalAccess',
|
|
8610
|
+
const warpStyle = _optionalChain([old, 'optionalAccess', _234 => _234.warp]) ? descGet(old.warp, "warpStyle") : void 0;
|
|
8611
|
+
const warp = _optionalChain([old, 'optionalAccess', _235 => _235.warp]) && _optionalChain([warpStyle, 'optionalAccess', _236 => _236.type]) === "enum" && warpStyle.value === "warpNone" ? old.warp : null;
|
|
8406
8612
|
return writeTySh({ transform: textMatrix(layer), text: text3, warp, tail: new Uint8Array(16) });
|
|
8407
8613
|
}
|
|
8408
8614
|
|
|
@@ -8416,15 +8622,15 @@ var textV = (value) => ({ type: "TEXT", value });
|
|
|
8416
8622
|
var obj2 = (d) => ({ type: "Objc", value: d });
|
|
8417
8623
|
var text = (d, key) => {
|
|
8418
8624
|
const v = descGet(d, key);
|
|
8419
|
-
return _optionalChain([v, 'optionalAccess',
|
|
8625
|
+
return _optionalChain([v, 'optionalAccess', _237 => _237.type]) === "TEXT" ? v.value : void 0;
|
|
8420
8626
|
};
|
|
8421
8627
|
var enumOf2 = (d, key) => {
|
|
8422
8628
|
const v = descGet(d, key);
|
|
8423
|
-
return _optionalChain([v, 'optionalAccess',
|
|
8629
|
+
return _optionalChain([v, 'optionalAccess', _238 => _238.type]) === "enum" ? v.value : void 0;
|
|
8424
8630
|
};
|
|
8425
8631
|
var numbers = (d, key) => {
|
|
8426
8632
|
const v = descGet(d, key);
|
|
8427
|
-
if (_optionalChain([v, 'optionalAccess',
|
|
8633
|
+
if (_optionalChain([v, 'optionalAccess', _239 => _239.type]) !== "VlLs") return null;
|
|
8428
8634
|
const out = [];
|
|
8429
8635
|
for (const it of v.items) {
|
|
8430
8636
|
if (it.type === "doub" || it.type === "UntF" || it.type === "long") out.push(it.value);
|
|
@@ -8619,8 +8825,8 @@ function filterMaskItem(placed, mask, area) {
|
|
|
8619
8825
|
const painted = _chunkCWM3CUUXcjs.contentBounds.call(void 0, mask.surface);
|
|
8620
8826
|
let b = _nullishCoalesce(painted, () => ( { x: 0, y: 0, width: 1, height: 1 }));
|
|
8621
8827
|
if (mask.defaultValue !== 255 && area) {
|
|
8622
|
-
const x0 = Math.min(area.x, _nullishCoalesce(_optionalChain([painted, 'optionalAccess',
|
|
8623
|
-
const y0 = Math.min(area.y, _nullishCoalesce(_optionalChain([painted, 'optionalAccess',
|
|
8828
|
+
const x0 = Math.min(area.x, _nullishCoalesce(_optionalChain([painted, 'optionalAccess', _240 => _240.x]), () => ( area.x)));
|
|
8829
|
+
const y0 = Math.min(area.y, _nullishCoalesce(_optionalChain([painted, 'optionalAccess', _241 => _241.y]), () => ( area.y)));
|
|
8624
8830
|
const x1 = Math.max(area.x + area.width, painted ? painted.x + painted.width : 0);
|
|
8625
8831
|
const y1 = Math.max(area.y + area.height, painted ? painted.y + painted.height : 0);
|
|
8626
8832
|
b = { x: x0, y: y0, width: x1 - x0, height: y1 - y0 };
|
|
@@ -8640,7 +8846,7 @@ function filterMaskItem(placed, mask, area) {
|
|
|
8640
8846
|
}
|
|
8641
8847
|
var warpStyleOf = (name) => {
|
|
8642
8848
|
if (!name.startsWith("warp")) return null;
|
|
8643
|
-
const s = _optionalChain([name, 'access',
|
|
8849
|
+
const s = _optionalChain([name, 'access', _242 => _242[4], 'optionalAccess', _243 => _243.toLowerCase, 'call', _244 => _244()]) + name.slice(5);
|
|
8644
8850
|
return _chunkEGZM52EOcjs.WARP_STYLES.includes(s) ? s : null;
|
|
8645
8851
|
};
|
|
8646
8852
|
function warpFromDescriptor(w, contents) {
|
|
@@ -8662,7 +8868,7 @@ function warpFromDescriptor(w, contents) {
|
|
|
8662
8868
|
if (!arr || arr.type !== "ObAr") return void 0;
|
|
8663
8869
|
const xs = descGet(arr.body, "Hrzn");
|
|
8664
8870
|
const ys = descGet(arr.body, "Vrtc");
|
|
8665
|
-
if (_optionalChain([xs, 'optionalAccess',
|
|
8871
|
+
if (_optionalChain([xs, 'optionalAccess', _245 => _245.type]) !== "UnFl" || _optionalChain([ys, 'optionalAccess', _246 => _246.type]) !== "UnFl" || xs.values.length !== 16 || ys.values.length !== 16) return void 0;
|
|
8666
8872
|
mesh = { us: [0, 1], vs: [0, 1], points: xs.values.map((x, i) => ({ x, y: ys.values[i] })) };
|
|
8667
8873
|
const px2 = mesh.points.map((p) => p.x);
|
|
8668
8874
|
const py = mesh.points.map((p) => p.y);
|
|
@@ -8829,13 +9035,13 @@ function blendOptions(f) {
|
|
|
8829
9035
|
function smartFiltersFromPsd(fx, newId, notes) {
|
|
8830
9036
|
const filters = [];
|
|
8831
9037
|
const list2 = descGet(fx, "filterFXList");
|
|
8832
|
-
for (const v of _optionalChain([list2, 'optionalAccess',
|
|
9038
|
+
for (const v of _optionalChain([list2, 'optionalAccess', _247 => _247.type]) === "VlLs" ? list2.items : []) {
|
|
8833
9039
|
if (v.type !== "Objc" && v.type !== "GlbO") continue;
|
|
8834
9040
|
const item = v.value;
|
|
8835
9041
|
const { blend, opacity } = blendOptionsOf(item);
|
|
8836
9042
|
const enabled = descBool(item, "enab") !== false;
|
|
8837
9043
|
const fltr = descObject(item, "Fltr");
|
|
8838
|
-
const radius = _optionalChain([fltr, 'optionalAccess',
|
|
9044
|
+
const radius = _optionalChain([fltr, 'optionalAccess', _248 => _248.classId]) === BOX_BLUR.classId ? descNumber(fltr, "Rds ") : void 0;
|
|
8839
9045
|
if (radius !== void 0 && radius >= 0 && radius <= 50) {
|
|
8840
9046
|
filters.push({ id: newId(), kind: "blur", enabled, radius, blend, opacity });
|
|
8841
9047
|
continue;
|
|
@@ -9188,7 +9394,7 @@ function readPsd(bytes) {
|
|
|
9188
9394
|
return { header, colorModeData, resources, layers, mergedAlpha, globalBlocks, imageCompression, imageData: r.rest() };
|
|
9189
9395
|
}
|
|
9190
9396
|
function layerBlock(rec, key) {
|
|
9191
|
-
return _optionalChain([rec, 'access',
|
|
9397
|
+
return _optionalChain([rec, 'access', _249 => _249.blocks, 'access', _250 => _250.find, 'call', _251 => _251((b) => b.key === key), 'optionalAccess', _252 => _252.data]);
|
|
9192
9398
|
}
|
|
9193
9399
|
function layerName(rec) {
|
|
9194
9400
|
const luni = layerBlock(rec, "luni");
|
|
@@ -9219,7 +9425,7 @@ function u8Block(rec, key) {
|
|
|
9219
9425
|
function layerTree(file) {
|
|
9220
9426
|
const stack = [[]];
|
|
9221
9427
|
file.layers.forEach((rec, index) => {
|
|
9222
|
-
const kind = _nullishCoalesce(_optionalChain([sectionDivider, 'call',
|
|
9428
|
+
const kind = _nullishCoalesce(_optionalChain([sectionDivider, 'call', _253 => _253(rec), 'optionalAccess', _254 => _254.kind]), () => ( SECTION_OTHER));
|
|
9223
9429
|
if (kind === SECTION_DIVIDER) {
|
|
9224
9430
|
stack.push([]);
|
|
9225
9431
|
} else if (kind === SECTION_OPEN || kind === SECTION_CLOSED) {
|
|
@@ -9237,7 +9443,7 @@ function layerTree(file) {
|
|
|
9237
9443
|
}
|
|
9238
9444
|
function channelRect(rec, id) {
|
|
9239
9445
|
if (id === CHANNEL_USER_MASK && rec.mask) return rec.mask.rect;
|
|
9240
|
-
if (id === CHANNEL_REAL_USER_MASK && rec.mask) return _nullishCoalesce(_optionalChain([rec, 'access',
|
|
9446
|
+
if (id === CHANNEL_REAL_USER_MASK && rec.mask) return _nullishCoalesce(_optionalChain([rec, 'access', _255 => _255.mask, 'access', _256 => _256.real, 'optionalAccess', _257 => _257.rect]), () => ( rec.mask.rect));
|
|
9241
9447
|
return rec.rect;
|
|
9242
9448
|
}
|
|
9243
9449
|
function decodeLayerChannel(file, rec, id) {
|
|
@@ -9255,7 +9461,7 @@ function decodeMergedImage(file) {
|
|
|
9255
9461
|
return decodePlanes(file.imageCompression, file.imageData, { planes: channels, width, height, depth, psb });
|
|
9256
9462
|
}
|
|
9257
9463
|
function resource(file, id) {
|
|
9258
|
-
return _optionalChain([file, 'access',
|
|
9464
|
+
return _optionalChain([file, 'access', _258 => _258.resources, 'access', _259 => _259.find, 'call', _260 => _260((r) => r.id === id), 'optionalAccess', _261 => _261.data]);
|
|
9259
9465
|
}
|
|
9260
9466
|
function resolution(file) {
|
|
9261
9467
|
const d = resource(file, 1005);
|
|
@@ -9858,9 +10064,9 @@ var SMART_KEYS = ["SoLd", "SoLE", "PlLd"];
|
|
|
9858
10064
|
var VECTOR_KEYS = ["vmsk", "vsms"];
|
|
9859
10065
|
var MAX_CONTENTS_DEPTH = 6;
|
|
9860
10066
|
var percent = (v) => Math.round(v / 255 * 100) / 100;
|
|
9861
|
-
var Warnings = (
|
|
9862
|
-
|
|
9863
|
-
|
|
10067
|
+
var Warnings = (_class3 = class {constructor() { _class3.prototype.__init4.call(this);_class3.prototype.__init5.call(this); }
|
|
10068
|
+
__init4() {this.groups = /* @__PURE__ */ new Map()}
|
|
10069
|
+
__init5() {this.extra = []}
|
|
9864
10070
|
add(message, layer) {
|
|
9865
10071
|
const list2 = _nullishCoalesce(this.groups.get(message), () => ( []));
|
|
9866
10072
|
if (!list2.includes(layer)) list2.push(layer);
|
|
@@ -9875,7 +10081,7 @@ var Warnings = (_class2 = class {constructor() { _class2.prototype.__init3.call(
|
|
|
9875
10081
|
}
|
|
9876
10082
|
return out;
|
|
9877
10083
|
}
|
|
9878
|
-
},
|
|
10084
|
+
}, _class3);
|
|
9879
10085
|
function psdKind(rec) {
|
|
9880
10086
|
if (rec.blocks.some((b) => TYPE_KEYS.includes(b.key))) return "type";
|
|
9881
10087
|
if (rec.blocks.some((b) => SMART_KEYS.includes(b.key))) return "smart-object";
|
|
@@ -10039,7 +10245,7 @@ function importNode(ctx, node, depth) {
|
|
|
10039
10245
|
if (node.children) {
|
|
10040
10246
|
const props2 = baseProps(ctx, rec, name, notes);
|
|
10041
10247
|
const divider = sectionDivider(rec);
|
|
10042
|
-
const key = _nullishCoalesce(_optionalChain([divider, 'optionalAccess',
|
|
10248
|
+
const key = _nullishCoalesce(_optionalChain([divider, 'optionalAccess', _262 => _262.blendKey]), () => ( rec.blendKey));
|
|
10043
10249
|
const groupBlend = key === "pass" ? "pass-through" : _nullishCoalesce(PSD_BLEND_KEYS[key], () => ( "normal"));
|
|
10044
10250
|
const children = [];
|
|
10045
10251
|
for (const child of node.children) {
|
|
@@ -10049,7 +10255,7 @@ function importNode(ctx, node, depth) {
|
|
|
10049
10255
|
const group = { type: "group", id: ctx.newId(name), ...props2, blend: groupBlend, children };
|
|
10050
10256
|
const effects2 = recordEffects(ctx, rec, name, notes, true);
|
|
10051
10257
|
if (effects2) group.effects = effects2;
|
|
10052
|
-
if (_optionalChain([divider, 'optionalAccess',
|
|
10258
|
+
if (_optionalChain([divider, 'optionalAccess', _263 => _263.kind]) === SECTION_CLOSED) group.collapsed = true;
|
|
10053
10259
|
const mask2 = recordMask(ctx, rec, name);
|
|
10054
10260
|
if (mask2) group.mask = mask2;
|
|
10055
10261
|
entry.type = "group";
|
|
@@ -10272,7 +10478,7 @@ function importSmart(ctx, rec, name, notes, props) {
|
|
|
10272
10478
|
const file = ctx.linked.get(placed.idnt);
|
|
10273
10479
|
contents = {
|
|
10274
10480
|
id: placed.idnt || ctx.newId(`${name}-contents`),
|
|
10275
|
-
name: _optionalChain([file, 'optionalAccess',
|
|
10481
|
+
name: _optionalChain([file, 'optionalAccess', _264 => _264.name]) || `${name}.png`,
|
|
10276
10482
|
width,
|
|
10277
10483
|
height,
|
|
10278
10484
|
kind: "raster",
|
|
@@ -10429,7 +10635,7 @@ function psdToLayers(file, options = {}) {
|
|
|
10429
10635
|
if (mode !== "rgb" && header.depth > 8 && header.colorMode !== MODE_INDEXED && header.colorMode !== MODE_BITMAP) {
|
|
10430
10636
|
warn.extra.push(`The file is ${header.depth}-bit ${mode}; it was converted to ${header.depth}-bit RGB.`);
|
|
10431
10637
|
} else if (mode !== "rgb" || header.depth !== 8 && header.depth !== 16 && header.depth !== 32) {
|
|
10432
|
-
const how = header.colorMode === MODE_CMYK ? ` through ${_nullishCoalesce(_optionalChain([cmykProfile, 'optionalAccess',
|
|
10638
|
+
const how = header.colorMode === MODE_CMYK ? ` through ${_nullishCoalesce(_optionalChain([cmykProfile, 'optionalAccess', _265 => _265.name]), () => ( "its profile"))}` : "";
|
|
10433
10639
|
warn.extra.push(`The file is ${header.depth}-bit ${mode}; it was converted to 8-bit RGB${how}.`);
|
|
10434
10640
|
}
|
|
10435
10641
|
let layers = [];
|
|
@@ -10546,15 +10752,15 @@ var pct = (d, key, fallback) => num3(d, key, fallback * 100) / 100;
|
|
|
10546
10752
|
var bool = (d, key) => descBool(d, key) === true;
|
|
10547
10753
|
var enumOf3 = (d, key) => {
|
|
10548
10754
|
const v = descGet(d, key);
|
|
10549
|
-
return _optionalChain([v, 'optionalAccess',
|
|
10755
|
+
return _optionalChain([v, 'optionalAccess', _266 => _266.type]) === "enum" ? v.value : void 0;
|
|
10550
10756
|
};
|
|
10551
10757
|
var text2 = (d, key) => {
|
|
10552
10758
|
const v = d ? descGet(d, key) : void 0;
|
|
10553
|
-
return _optionalChain([v, 'optionalAccess',
|
|
10759
|
+
return _optionalChain([v, 'optionalAccess', _267 => _267.type]) === "TEXT" ? v.value : "";
|
|
10554
10760
|
};
|
|
10555
10761
|
var list = (d, key) => {
|
|
10556
10762
|
const v = descGet(d, key);
|
|
10557
|
-
if (_optionalChain([v, 'optionalAccess',
|
|
10763
|
+
if (_optionalChain([v, 'optionalAccess', _268 => _268.type]) !== "VlLs") return [];
|
|
10558
10764
|
return v.items.flatMap((it) => it.type === "Objc" || it.type === "GlbO" ? [it.value] : []);
|
|
10559
10765
|
};
|
|
10560
10766
|
var clamp3 = (v, lo, hi) => Number.isFinite(v) ? Math.min(hi, Math.max(lo, v)) : lo;
|
|
@@ -10624,8 +10830,8 @@ function contourOf(d, key) {
|
|
|
10624
10830
|
return { name, points };
|
|
10625
10831
|
}
|
|
10626
10832
|
function contourDesc(c) {
|
|
10627
|
-
const name = _nullishCoalesce(_optionalChain([c, 'optionalAccess',
|
|
10628
|
-
const points = _nullishCoalesce(_optionalChain([c, 'optionalAccess',
|
|
10833
|
+
const name = _nullishCoalesce(_optionalChain([c, 'optionalAccess', _269 => _269.name]), () => ( "Linear"));
|
|
10834
|
+
const points = _nullishCoalesce(_optionalChain([c, 'optionalAccess', _270 => _270.points]), () => ( [
|
|
10629
10835
|
{ input: 0, output: 0 },
|
|
10630
10836
|
{ input: 1, output: 1 }
|
|
10631
10837
|
]));
|
|
@@ -10660,7 +10866,7 @@ function gradientOf(d, notes) {
|
|
|
10660
10866
|
{ position: 0, color: "#000000" },
|
|
10661
10867
|
{ position: 1, color: "#ffffff" }
|
|
10662
10868
|
],
|
|
10663
|
-
style: _nullishCoalesce(_optionalChain([GRADIENT_STYLES, 'access',
|
|
10869
|
+
style: _nullishCoalesce(_optionalChain([GRADIENT_STYLES, 'access', _271 => _271.find, 'call', _272 => _272(([, id]) => id === enumOf3(d, "Type")), 'optionalAccess', _273 => _273[0]]), () => ( "linear")),
|
|
10664
10870
|
angle: clamp3(num3(d, "Angl", 90), -360, 360),
|
|
10665
10871
|
scale: clamp3(pct(d, "Scl ", 1), 0.1, 1.5),
|
|
10666
10872
|
reverse: bool(d, "Rvrs"),
|
|
@@ -10714,7 +10920,7 @@ function gradientItems(g) {
|
|
|
10714
10920
|
)
|
|
10715
10921
|
)
|
|
10716
10922
|
};
|
|
10717
|
-
const op = _optionalChain([g, 'access',
|
|
10923
|
+
const op = _optionalChain([g, 'access', _274 => _274.opacityStops, 'optionalAccess', _275 => _275.length]) ? g.opacityStops : g.stops.map((s) => ({ position: s.position, opacity: 1 }));
|
|
10718
10924
|
const trns = {
|
|
10719
10925
|
type: "VlLs",
|
|
10720
10926
|
items: op.map(
|
|
@@ -11211,9 +11417,9 @@ function prepareNestedLayers(layers) {
|
|
|
11211
11417
|
if (l.type === "annotation") continue;
|
|
11212
11418
|
let next = l;
|
|
11213
11419
|
if (l.type === "group") next = { ...l, children: prepareNestedLayers(l.children) };
|
|
11214
|
-
else if (l.type === "pixel" && (_optionalChain([l, 'access',
|
|
11420
|
+
else if (l.type === "pixel" && (_optionalChain([l, 'access', _276 => _276.filters, 'optionalAccess', _277 => _277.length]) || l.source === "document")) {
|
|
11215
11421
|
const p = { ...l };
|
|
11216
|
-
if (_optionalChain([l, 'access',
|
|
11422
|
+
if (_optionalChain([l, 'access', _278 => _278.filters, 'optionalAccess', _279 => _279.some, 'call', _280 => _280(isActiveFilter)])) {
|
|
11217
11423
|
const b = l.surface.bounds;
|
|
11218
11424
|
if (b) {
|
|
11219
11425
|
const r = { x: b.x + l.offset.x - 64, y: b.y + l.offset.y - 64, width: b.width + 128, height: b.height + 128 };
|
|
@@ -11230,7 +11436,7 @@ function prepareNestedLayers(layers) {
|
|
|
11230
11436
|
delete p.source;
|
|
11231
11437
|
next = p;
|
|
11232
11438
|
}
|
|
11233
|
-
if (_optionalChain([next, 'access',
|
|
11439
|
+
if (_optionalChain([next, 'access', _281 => _281.mask, 'optionalAccess', _282 => _282.source])) {
|
|
11234
11440
|
next = { ...next };
|
|
11235
11441
|
delete next.mask;
|
|
11236
11442
|
}
|
|
@@ -11336,7 +11542,7 @@ function exportPsd(input) {
|
|
|
11336
11542
|
return {
|
|
11337
11543
|
opacity: Math.round(Math.min(1, Math.max(0, layer.opacity)) * 255),
|
|
11338
11544
|
clipping: layer.clipped ? 1 : 0,
|
|
11339
|
-
flags: (layer.visible ? 0 : LAYER_FLAG_HIDDEN) | (_optionalChain([layer, 'access',
|
|
11545
|
+
flags: (layer.visible ? 0 : LAYER_FLAG_HIDDEN) | (_optionalChain([layer, 'access', _283 => _283.locks, 'optionalAccess', _284 => _284.transparency]) ? LAYER_FLAG_TRANSPARENCY_PROTECTED : 0),
|
|
11340
11546
|
legacyName: name,
|
|
11341
11547
|
blocks
|
|
11342
11548
|
};
|
|
@@ -11393,7 +11599,7 @@ function exportPsd(input) {
|
|
|
11393
11599
|
}
|
|
11394
11600
|
case "pixel": {
|
|
11395
11601
|
if (layer.source === "document") throw new PsdError(`Layer "${layer.name}" reads the document image; resolve its pixels before export.`);
|
|
11396
|
-
if (_optionalChain([layer, 'access',
|
|
11602
|
+
if (_optionalChain([layer, 'access', _285 => _285.filters, 'optionalAccess', _286 => _286.some, 'call', _287 => _287(isActiveFilter)])) throw new PsdError(`Layer "${layer.name}" has live filters; bake them before export.`);
|
|
11397
11603
|
const extra = [];
|
|
11398
11604
|
if (layer.fillOpacity !== void 0 && layer.fillOpacity < 1) {
|
|
11399
11605
|
extra.push({ key: "iOpa", data: Uint8Array.from([Math.round(Math.max(0, layer.fillOpacity) * 255), 0, 0, 0]) });
|
|
@@ -11425,7 +11631,7 @@ function exportPsd(input) {
|
|
|
11425
11631
|
if (c.linked) note("Linked smart objects were embedded (their preview is written as the contents)", layer.name);
|
|
11426
11632
|
linkedFiles.set(idnt, smartContentsFile(c));
|
|
11427
11633
|
}
|
|
11428
|
-
let placedId = _nullishCoalesce(_optionalChain([layer, 'access',
|
|
11634
|
+
let placedId = _nullishCoalesce(_optionalChain([layer, 'access', _288 => _288.psd, 'optionalAccess', _289 => _289.placed]), () => ( psdUuid(`${layer.id}:placed`)));
|
|
11429
11635
|
if (placedIds.has(placedId)) placedId = psdUuid(`${layer.id}:placed:${placedIds.size}`);
|
|
11430
11636
|
placedIds.add(placedId);
|
|
11431
11637
|
if (placedUnchanged(layer, idnt, placedId)) {
|
|
@@ -11435,12 +11641,12 @@ function exportPsd(input) {
|
|
|
11435
11641
|
const filterFX = layer.smartFilters ? filterFXDescriptor(layer.smartFilters, dropped) : void 0;
|
|
11436
11642
|
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);
|
|
11437
11643
|
const raw = layer.psd && layer.psd.key !== "PlLd" ? parsePlaced(layer.psd.key, layer.psd.data) : null;
|
|
11438
|
-
const spec = { idnt, placed: placedId, placement: layer.placement, size: { width: c.width, height: c.height }, filterFX, template: _optionalChain([raw, 'optionalAccess',
|
|
11644
|
+
const spec = { idnt, placed: placedId, placement: layer.placement, size: { width: c.width, height: c.height }, filterFX, template: _optionalChain([raw, 'optionalAccess', _290 => _290.descriptor]) };
|
|
11439
11645
|
const wnotes = [];
|
|
11440
11646
|
extra.push({ key: "PlLd", data: plldBytes(spec) }, { key: "SoLd", data: soldBytes(spec, wnotes) });
|
|
11441
11647
|
for (const n2 of wnotes) note(`A smart object: ${n2}`, layer.name);
|
|
11442
11648
|
}
|
|
11443
|
-
const fm = _optionalChain([layer, 'access',
|
|
11649
|
+
const fm = _optionalChain([layer, 'access', _291 => _291.smartFilters, 'optionalAccess', _292 => _292.mask]);
|
|
11444
11650
|
if (fm && !fm.source) filterItems.push(filterMaskItem(placedId, fm, { x: 0, y: 0, width, height }));
|
|
11445
11651
|
const rec = { ...common2(layer, extra), rect: EMPTY_RECT, channels: [], blendKey: _nullishCoalesce(BLEND_TO_PSD[layer.blend], () => ( "norm")) };
|
|
11446
11652
|
const bounds = _chunkCWM3CUUXcjs.contentBounds.call(void 0, layer.surface);
|
|
@@ -11468,8 +11674,8 @@ function exportPsd(input) {
|
|
|
11468
11674
|
const losses = /* @__PURE__ */ new Set();
|
|
11469
11675
|
for (const b of shapeBlocks(layer, width, height, _nullishCoalesce(input.resolution, () => ( 72)), losses)) extra.push({ key: b.key, data: padEven(b.data) });
|
|
11470
11676
|
for (const n2 of losses) note(n2, layer.name);
|
|
11471
|
-
if (_optionalChain([layer, 'access',
|
|
11472
|
-
if (_optionalChain([layer, 'access',
|
|
11677
|
+
if (_optionalChain([layer, 'access', _293 => _293.fill, 'optionalAccess', _294 => _294.type]) === "pattern") patternIds2.add(layer.fill.patternId);
|
|
11678
|
+
if (_optionalChain([layer, 'access', _295 => _295.stroke, 'optionalAccess', _296 => _296.paint, 'access', _297 => _297.type]) === "pattern") patternIds2.add(layer.stroke.paint.patternId);
|
|
11473
11679
|
} else {
|
|
11474
11680
|
extra.push({ key: "TySh", data: padEven(tyShForLayer(layer)) });
|
|
11475
11681
|
}
|
|
@@ -11537,7 +11743,7 @@ function exportPsd(input) {
|
|
|
11537
11743
|
{ id: 1005, name: "", data: rw.result() },
|
|
11538
11744
|
{ id: 1057, name: "", data: version.result() }
|
|
11539
11745
|
];
|
|
11540
|
-
if (_optionalChain([input, 'access',
|
|
11746
|
+
if (_optionalChain([input, 'access', _298 => _298.iccProfile, 'optionalAccess', _299 => _299.length])) resources.push({ id: 1039, name: "", data: input.iccProfile });
|
|
11541
11747
|
resources.push(...alphaChannelResources(_nullishCoalesce(input.alphaChannels, () => ( []))));
|
|
11542
11748
|
if (input.globalLight) {
|
|
11543
11749
|
const i32 = (v) => {
|
|
@@ -11954,4 +12160,7 @@ function exportPsd(input) {
|
|
|
11954
12160
|
|
|
11955
12161
|
|
|
11956
12162
|
|
|
11957
|
-
exports.LEGACY_PROCESS_VERSION = LEGACY_PROCESS_VERSION; exports.LATEST_PROCESS_VERSION = LATEST_PROCESS_VERSION; exports.normalizeProcessVersion = normalizeProcessVersion; exports.srgbToLinear = srgbToLinear; exports.linearToSrgb = linearToSrgb; exports.LUMA_709 = LUMA_709; exports.IDENTITY_MATRIX3 = IDENTITY_MATRIX3; exports.mulMatrix3 = mulMatrix3; exports.applyMatrix3 = applyMatrix3; exports.invertMatrix3 = invertMatrix3; exports.D65 = D65; exports.bradfordAdaptation = bradfordAdaptation; exports.wbMatrix = wbMatrix; exports.linearSrgbToXy = linearSrgbToXy; exports.TINT_SCALE = TINT_SCALE; exports.MIN_KELVIN = MIN_KELVIN; exports.MAX_KELVIN = MAX_KELVIN; exports.xyToUv = xyToUv; exports.uvToXy = uvToXy; exports.tempTintToXy = tempTintToXy; exports.xyToTempTint = xyToTempTint; exports.AS_SHOT_KELVIN = AS_SHOT_KELVIN; exports.MIRED_PER_TEMPERATURE_UNIT = MIRED_PER_TEMPERATURE_UNIT; exports.temperatureToKelvin = temperatureToKelvin; exports.kelvinToTemperature = kelvinToTemperature; exports.whiteBalanceMatrix = whiteBalanceMatrix; exports.whiteBalanceFromSample = whiteBalanceFromSample; exports.TONE_LUT_SIZE = TONE_LUT_SIZE; exports.toneCurve = toneCurve; exports.buildToneLut = buildToneLut; exports.sampleToneLut = sampleToneLut; exports.normalizeAngle = normalizeAngle; exports.isQuarterTurnSwapped = isQuarterTurnSwapped; exports.getRotatedSize = getRotatedSize; exports.projectImagePoint = projectImagePoint; exports.unprojectCanvasPoint = unprojectCanvasPoint; exports.applyImageProjectionToContext = applyImageProjectionToContext; exports.projectImageRect = projectImageRect; exports.clampCropToImage = clampCropToImage; exports.getViewportProjection = getViewportProjection; exports.getViewportMetrics = getViewportMetrics; exports.canvasToImagePoint = canvasToImagePoint; exports.imageToCanvasPoint = imageToCanvasPoint; exports.mapCropHandle = mapCropHandle; exports.hitTestCrop = hitTestCrop; exports.getCropCursor = getCropCursor; exports.calculateCropDrag = calculateCropDrag; exports.getAnnotationBounds = getAnnotationBounds; exports.hitTestAnnotation = hitTestAnnotation; exports.SELECTION_MODES = SELECTION_MODES; exports.isSelectionMode = isSelectionMode; exports.parseSelectionMode = parseSelectionMode; exports.computeSelectionBounds = computeSelectionBounds; exports.createSelectionMask = createSelectionMask; exports.fullSelection = fullSelection; exports.isSelectionEmpty = isSelectionEmpty; exports.selectionValueAt = selectionValueAt; exports.coverageToByte = coverageToByte; exports.selectionFromCoverage = selectionFromCoverage; exports.selectionToCoverage = selectionToCoverage; exports.selectionArea = selectionArea; exports.combineSelections = combineSelections; exports.invertSelection = invertSelection; exports.resizeSelection = resizeSelection; exports.selectionFromPixels = selectionFromPixels; exports.selectionToPixels = selectionToPixels; exports.encodeSelectionRle = encodeSelectionRle; exports.decodeSelectionRle = decodeSelectionRle; exports.serializeSelection = serializeSelection; exports.deserializeSelection = deserializeSelection; exports.hashMaskContent = hashMaskContent; exports.EMPTY_DISTANCE = EMPTY_DISTANCE; exports.distanceTransform = distanceTransform; exports.expandCoverage = expandCoverage; exports.contractCoverage = contractCoverage; exports.borderCoverage = borderCoverage; exports.smoothCoverage = smoothCoverage; exports.featherCoverage = featherCoverage; exports.greyMorphology = greyMorphology; exports.shiftCoverage = shiftCoverage; exports.SELECTION_MODIFY_OPS = SELECTION_MODIFY_OPS; exports.modifySelection = modifySelection; exports.normalizeLayerMask = normalizeLayerMask; exports.layerMaskFromSelection = layerMaskFromSelection; exports.updateLayerMaskProps = updateLayerMaskProps; exports.decodeLayerMask = decodeLayerMask; exports.layerMaskKey = layerMaskKey; exports.layerMaskCoverage = layerMaskCoverage; exports.projectMaskCoverage = projectMaskCoverage; exports.buildLayerMaskPlanes = buildLayerMaskPlanes; exports.ADJUSTMENT_LUT_SIZE = ADJUSTMENT_LUT_SIZE; exports.sampleLut = sampleLut; exports.ADJUSTMENT_KINDS = ADJUSTMENT_KINDS; exports.isAdjustmentKind = isAdjustmentKind; exports.adjustmentKindLabel = adjustmentKindLabel; exports.HUE_RANGE_LABELS = HUE_RANGE_LABELS; exports.neutralHueRange = neutralHueRange; exports.identityCurve = identityCurve; exports.identityLevels = identityLevels; exports.defaultAdjustmentParams = defaultAdjustmentParams; exports.createAdjustmentLayer = createAdjustmentLayer; exports.normalizeAdjustmentLayer = normalizeAdjustmentLayer; exports.normalizeAdjustmentLayers = normalizeAdjustmentLayers; exports.curveLutFromLevels = curveLutFromLevels; exports.levelsValue = levelsValue; exports.rgbToHsl = rgbToHsl; exports.hslToRgb = hslToRgb; exports.hueRangeWeight = hueRangeWeight; exports.hueRangeTables = hueRangeTables; exports.hueSaturation = hueSaturation; exports.rangeLightness = rangeLightness; exports.VIBRANCE_GREY = VIBRANCE_GREY; exports.vibranceLinear = vibranceLinear; exports.vibrancePixel = vibrancePixel; exports.colorBalanceChannel = colorBalanceChannel; exports.blackWhiteGray = blackWhiteGray; exports.D50 = D50; exports.XYZ_D50_TO_SRGB = XYZ_D50_TO_SRGB; exports.photoFilterMatrix = photoFilterMatrix; exports.posterizeValue = posterizeValue; exports.rgbToGray = rgbToGray; exports.hexToRgb = hexToRgb; exports.toneLuts = toneLuts; exports.compileAdjustmentLayer = compileAdjustmentLayer; exports.activeAdjustmentLayers = activeAdjustmentLayers; exports.evaluateAdjustmentLayers = evaluateAdjustmentLayers; exports.applyAdjustmentLayers = applyAdjustmentLayers; exports.applyAdjustmentLayersFloat = applyAdjustmentLayersFloat; exports.adjustmentLayersKey = adjustmentLayersKey; exports.applyAdjustments = applyAdjustments; exports.applyLegacyAdjustments = applyLegacyAdjustments; exports.applyLegacyFloat = applyLegacyFloat; exports.applyProcess2Adjustments = applyProcess2Adjustments; exports.applyProcess2Float = applyProcess2Float; exports.applyBoxBlurFloat = applyBoxBlurFloat; exports.applyBoxBlur = applyBoxBlur; exports.applyDepthMask = applyDepthMask; exports.removeAlpha = removeAlpha; exports.TEXT_ALIGNS = TEXT_ALIGNS; exports.MAX_EFFECT_ANIMATION_MS = MAX_EFFECT_ANIMATION_MS; exports.SHAPE_OPERATIONS = SHAPE_OPERATIONS; exports.LIVE_SHAPE_KINDS = LIVE_SHAPE_KINDS; exports.newLayerId = newLayerId; exports.pixelLayers = pixelLayers; exports.developFilter = developFilter; exports.blurFilter = blurFilter; exports.isActiveFilter = isActiveFilter; exports.isSpatialFilter = isSpatialFilter; exports.pixelLayerBounds = pixelLayerBounds; exports.layerTypeLabel = layerTypeLabel; exports.hasSurface = hasSurface; exports.isRenderedLayer = isRenderedLayer; exports.shapeLayers = shapeLayers; exports.smartObjectLayers = smartObjectLayers; exports.adjustmentNodeAsLayer = adjustmentNodeAsLayer; exports.depthMaskAlpha = depthMaskAlpha; exports.runLayerFilters = runLayerFilters; exports.runLayerFiltersFloat = runLayerFiltersFloat; exports.LayerCompositor = LayerCompositor; exports.compositeDeep = compositeDeep; exports.DEFAULT_ADJUSTMENTS_VALUES = DEFAULT_ADJUSTMENTS_VALUES; exports.DEFAULT_TRANSFORM_VALUES = DEFAULT_TRANSFORM_VALUES; exports.DEFAULT_DEPTH_MASK_VALUES = DEFAULT_DEPTH_MASK_VALUES; exports.flattenPath = flattenPath; exports.rasterizeCoverage = rasterizeCoverage; exports.LayerOperationError = LayerOperationError; exports.userErrorMessage = userErrorMessage; exports.isPaintableLayer = isPaintableLayer; exports.defaultActiveLayerId = defaultActiveLayerId; exports.activeLayerAfterRemoval = activeLayerAfterRemoval; 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.ANCHOR_FRACTION = ANCHOR_FRACTION; exports.isTransformAnchor = isTransformAnchor; exports.identityTransform = identityTransform; exports.cornersFromMatrix = cornersFromMatrix; exports.matrixFromCorners = matrixFromCorners; exports.transformHomography = transformHomography; exports.hasWarp = hasWarp; exports.isIdentityTransform = isIdentityTransform; exports.transformMap = transformMap; exports.transformedPoint = transformedPoint; exports.anchorPoint = anchorPoint; exports.transformedBox = transformedBox; exports.referencePoint = referencePoint; exports.matrixFromParams = matrixFromParams; exports.describeTransform = describeTransform; exports.applyParams = applyParams; exports.flipCorners = flipCorners; exports.boxPointOf = boxPointOf; exports.presetWarp = presetWarp; exports.isValidWarp = isValidWarp; exports.geometryHomography = geometryHomography; exports.SMART_RENDER_MARGIN = SMART_RENDER_MARGIN; exports.isSmartSurfaceIncomplete = isSmartSurfaceIncomplete; exports.newContentsId = newContentsId; exports.contentsBox = contentsBox; exports.placementGeometry = placementGeometry; exports.placementAt = placementAt; exports.isContentsDecoded = isContentsDecoded; exports.requireSmartObject = requireSmartObject; exports.contentsSurface = contentsSurface; exports.rasterContents = rasterContents; exports.documentContents = documentContents; exports.placeContents = placeContents; exports.activeSmartFilters = activeSmartFilters; exports.activeEffectSmartFilters = activeEffectSmartFilters; exports.filterMaskCoverage = filterMaskCoverage; exports.applySmartFilters = applySmartFilters; exports.renderSmartObject = renderSmartObject; exports.rerender = rerender; exports.normalizePlacement = normalizePlacement; exports.setSmartPlacement = setSmartPlacement; exports.offsetSmartObject = offsetSmartObject; exports.translateLayer = translateLayer; 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.decodePlanes = decodePlanes; exports.encodeRle = encodeRle; 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.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;
|
|
12163
|
+
|
|
12164
|
+
|
|
12165
|
+
|
|
12166
|
+
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.selectionFromTiles = selectionFromTiles; exports.createSelectionMask = createSelectionMask; exports.selectionFromRegion = selectionFromRegion; 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.layerMaskSelection = layerMaskSelection; exports.normalizeLayerMask = normalizeLayerMask; exports.layerMaskFromSelection = layerMaskFromSelection; exports.updateLayerMaskProps = updateLayerMaskProps; exports.decodeLayerMask = decodeLayerMask; exports.layerMaskKey = layerMaskKey; exports.layerMaskCoverage = layerMaskCoverage; exports.projectMaskCoverage = projectMaskCoverage; exports.buildLayerMaskPlanes = buildLayerMaskPlanes; exports.ADJUSTMENT_LUT_SIZE = ADJUSTMENT_LUT_SIZE; exports.sampleLut = sampleLut; exports.ADJUSTMENT_KINDS = ADJUSTMENT_KINDS; exports.isAdjustmentKind = isAdjustmentKind; exports.adjustmentKindLabel = adjustmentKindLabel; exports.HUE_RANGE_LABELS = HUE_RANGE_LABELS; exports.neutralHueRange = neutralHueRange; exports.identityCurve = identityCurve; exports.identityLevels = identityLevels; exports.defaultAdjustmentParams = defaultAdjustmentParams; exports.createAdjustmentLayer = createAdjustmentLayer; exports.normalizeAdjustmentLayer = normalizeAdjustmentLayer; exports.normalizeAdjustmentLayers = normalizeAdjustmentLayers; exports.curveLutFromLevels = curveLutFromLevels; exports.levelsValue = levelsValue; exports.rgbToHsl = rgbToHsl; exports.hslToRgb = hslToRgb; exports.hueRangeWeight = hueRangeWeight; exports.hueRangeTables = hueRangeTables; exports.hueSaturation = hueSaturation; exports.rangeLightness = rangeLightness; exports.VIBRANCE_GREY = VIBRANCE_GREY; exports.vibranceLinear = vibranceLinear; exports.vibrancePixel = vibrancePixel; exports.colorBalanceChannel = colorBalanceChannel; exports.blackWhiteGray = blackWhiteGray; exports.D50 = D50; exports.XYZ_D50_TO_SRGB = XYZ_D50_TO_SRGB; exports.photoFilterMatrix = photoFilterMatrix; exports.posterizeValue = posterizeValue; exports.rgbToGray = rgbToGray; exports.hexToRgb = hexToRgb; exports.toneLuts = toneLuts; exports.compileAdjustmentLayer = compileAdjustmentLayer; exports.activeAdjustmentLayers = activeAdjustmentLayers; exports.evaluateAdjustmentLayers = evaluateAdjustmentLayers; exports.applyAdjustmentLayers = applyAdjustmentLayers; exports.applyAdjustmentLayersFloat = applyAdjustmentLayersFloat; exports.adjustmentLayersKey = adjustmentLayersKey; exports.applyAdjustments = applyAdjustments; exports.applyLegacyAdjustments = applyLegacyAdjustments; exports.applyLegacyFloat = applyLegacyFloat; exports.applyProcess2Adjustments = applyProcess2Adjustments; exports.applyProcess2Float = applyProcess2Float; exports.applyBoxBlurFloat = applyBoxBlurFloat; exports.applyBoxBlur = applyBoxBlur; exports.applyDepthMask = applyDepthMask; exports.removeAlpha = removeAlpha; exports.TEXT_ALIGNS = TEXT_ALIGNS; exports.MAX_EFFECT_ANIMATION_MS = MAX_EFFECT_ANIMATION_MS; exports.SHAPE_OPERATIONS = SHAPE_OPERATIONS; exports.LIVE_SHAPE_KINDS = LIVE_SHAPE_KINDS; exports.newLayerId = newLayerId; exports.pixelLayers = pixelLayers; exports.developFilter = developFilter; exports.blurFilter = blurFilter; exports.isActiveFilter = isActiveFilter; exports.isSpatialFilter = isSpatialFilter; exports.pixelLayerBounds = pixelLayerBounds; exports.layerTypeLabel = layerTypeLabel; exports.hasSurface = hasSurface; exports.isRenderedLayer = isRenderedLayer; exports.shapeLayers = shapeLayers; exports.smartObjectLayers = smartObjectLayers; exports.adjustmentNodeAsLayer = adjustmentNodeAsLayer; exports.depthMaskAlpha = depthMaskAlpha; exports.runLayerFilters = runLayerFilters; exports.runLayerFiltersFloat = runLayerFiltersFloat; exports.LayerCompositor = LayerCompositor; exports.compositeDeep = compositeDeep; exports.DEFAULT_ADJUSTMENTS_VALUES = DEFAULT_ADJUSTMENTS_VALUES; exports.DEFAULT_TRANSFORM_VALUES = DEFAULT_TRANSFORM_VALUES; exports.DEFAULT_DEPTH_MASK_VALUES = DEFAULT_DEPTH_MASK_VALUES; exports.flattenPath = flattenPath; exports.rasterizeCoverage = rasterizeCoverage; exports.LayerOperationError = LayerOperationError; exports.userErrorMessage = userErrorMessage; exports.isPaintableLayer = isPaintableLayer; exports.defaultActiveLayerId = defaultActiveLayerId; exports.activeLayerAfterRemoval = activeLayerAfterRemoval; 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.ANCHOR_FRACTION = ANCHOR_FRACTION; exports.isTransformAnchor = isTransformAnchor; exports.identityTransform = identityTransform; exports.cornersFromMatrix = cornersFromMatrix; exports.matrixFromCorners = matrixFromCorners; exports.transformHomography = transformHomography; exports.hasWarp = hasWarp; exports.isIdentityTransform = isIdentityTransform; exports.transformMap = transformMap; exports.transformedPoint = transformedPoint; exports.anchorPoint = anchorPoint; exports.transformedBox = transformedBox; exports.referencePoint = referencePoint; exports.matrixFromParams = matrixFromParams; exports.describeTransform = describeTransform; exports.applyParams = applyParams; exports.flipCorners = flipCorners; exports.boxPointOf = boxPointOf; exports.presetWarp = presetWarp; exports.isValidWarp = isValidWarp; exports.geometryHomography = geometryHomography; exports.SMART_RENDER_MARGIN = SMART_RENDER_MARGIN; exports.isSmartSurfaceIncomplete = isSmartSurfaceIncomplete; exports.newContentsId = newContentsId; exports.contentsBox = contentsBox; exports.placementGeometry = placementGeometry; exports.placementAt = placementAt; exports.isContentsDecoded = isContentsDecoded; exports.requireSmartObject = requireSmartObject; exports.contentsSurface = contentsSurface; exports.rasterContents = rasterContents; exports.documentContents = documentContents; exports.placeContents = placeContents; exports.activeSmartFilters = activeSmartFilters; exports.activeEffectSmartFilters = activeEffectSmartFilters; exports.filterMaskCoverage = filterMaskCoverage; exports.applySmartFilters = applySmartFilters; exports.renderSmartObject = renderSmartObject; exports.rerender = rerender; exports.normalizePlacement = normalizePlacement; exports.setSmartPlacement = setSmartPlacement; exports.offsetSmartObject = offsetSmartObject; exports.translateLayer = translateLayer; 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.decodePlanes = decodePlanes; exports.encodeRle = encodeRle; 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.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;
|