ag-psd 23.0.0 → 23.1.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/CHANGELOG.md +3 -0
- package/dist/additionalInfo.js +23 -5
- package/dist/additionalInfo.js.map +1 -1
- package/dist/bundle.js +24 -6
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/psd.d.ts +13 -0
- package/dist/psd.js.map +1 -1
- package/dist-es/additionalInfo.js +23 -5
- package/dist-es/additionalInfo.js.map +1 -1
- package/dist-es/index.d.ts +2 -2
- package/dist-es/index.js +1 -1
- package/dist-es/index.js.map +1 -1
- package/dist-es/psd.d.ts +13 -0
- package/dist-es/psd.js.map +1 -1
- package/package.json +1 -1
- package/src/additionalInfo.ts +32 -1
- package/src/index.ts +3 -2
- package/src/psd.ts +7 -0
package/dist/bundle.js
CHANGED
|
@@ -1601,11 +1601,22 @@ function parseFilterFXItem(f, options) {
|
|
|
1601
1601
|
lightDirection: f.Fltr.LghD,
|
|
1602
1602
|
specularity: f.Fltr.specularity,
|
|
1603
1603
|
} });
|
|
1604
|
-
case 'LqFy':
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1604
|
+
case 'LqFy':
|
|
1605
|
+
{
|
|
1606
|
+
return __assign(__assign({}, base), { type: 'liquify', filter: {
|
|
1607
|
+
liquifyMesh: f.Fltr.LqMe,
|
|
1608
|
+
} });
|
|
1609
|
+
}
|
|
1610
|
+
;
|
|
1611
|
+
case 'perspectiveWarpTransform':
|
|
1612
|
+
{
|
|
1613
|
+
return __assign(__assign({}, base), { type: 'perspective warp', filter: {
|
|
1614
|
+
vertices: f.Fltr.vertices.map(hrznVrtcToPoint),
|
|
1615
|
+
warpedVertices: f.Fltr.warpedVertices.map(hrznVrtcToPoint),
|
|
1616
|
+
quads: f.Fltr.quads.map(function (q) { return q.indices; }),
|
|
1617
|
+
} });
|
|
1618
|
+
}
|
|
1619
|
+
;
|
|
1609
1620
|
default:
|
|
1610
1621
|
if (options.throwForMissingFeatures) {
|
|
1611
1622
|
throw new Error("Unknown filter classId: ".concat(f.Fltr._classID));
|
|
@@ -2078,6 +2089,13 @@ function serializeFilterFXItem(f) {
|
|
|
2078
2089
|
_classID: 'LqFy',
|
|
2079
2090
|
LqMe: f.filter.liquifyMesh,
|
|
2080
2091
|
}, filterID: 1282492025 });
|
|
2092
|
+
case 'perspective warp': return __assign(__assign({}, base), { Fltr: {
|
|
2093
|
+
_name: 'Perspective Warp',
|
|
2094
|
+
_classID: 'perspectiveWarpTransform',
|
|
2095
|
+
vertices: f.filter.vertices.map(pointToHrznVrtc),
|
|
2096
|
+
warpedVertices: f.filter.warpedVertices.map(pointToHrznVrtc),
|
|
2097
|
+
quads: f.filter.quads.map(function (indices) { return ({ indices: indices }); }),
|
|
2098
|
+
}, filterID: 442 });
|
|
2081
2099
|
default: throw new Error("Unknow filter type: ".concat(f.type));
|
|
2082
2100
|
}
|
|
2083
2101
|
}
|
|
@@ -7644,12 +7662,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7644
7662
|
exports.writePsdBuffer = exports.writePsdUint8Array = exports.writePsd = exports.readPsd = exports.byteArrayToBase64 = exports.initializeCanvas = void 0;
|
|
7645
7663
|
var psdWriter_1 = require("./psdWriter");
|
|
7646
7664
|
var psdReader_1 = require("./psdReader");
|
|
7665
|
+
var base64_js_1 = require("base64-js");
|
|
7647
7666
|
__exportStar(require("./abr"), exports);
|
|
7648
7667
|
__exportStar(require("./csh"), exports);
|
|
7649
7668
|
var helpers_1 = require("./helpers");
|
|
7650
7669
|
Object.defineProperty(exports, "initializeCanvas", { enumerable: true, get: function () { return helpers_1.initializeCanvas; } });
|
|
7651
7670
|
__exportStar(require("./psd"), exports);
|
|
7652
|
-
var base64_js_1 = require("base64-js");
|
|
7653
7671
|
exports.byteArrayToBase64 = base64_js_1.fromByteArray;
|
|
7654
7672
|
function readPsd(buffer, options) {
|
|
7655
7673
|
var reader = 'buffer' in buffer ?
|
package/dist/index.d.ts
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
import { Psd, ReadOptions, WriteOptions } from './psd';
|
|
3
3
|
import { PsdWriter } from './psdWriter';
|
|
4
4
|
import { PsdReader } from './psdReader';
|
|
5
|
+
import { fromByteArray } from 'base64-js';
|
|
5
6
|
export * from './abr';
|
|
6
7
|
export * from './csh';
|
|
7
8
|
export { initializeCanvas } from './helpers';
|
|
8
9
|
export * from './psd';
|
|
9
|
-
|
|
10
|
-
export { PsdReader, PsdWriter };
|
|
10
|
+
export type { PsdReader, PsdWriter };
|
|
11
11
|
interface BufferLike {
|
|
12
12
|
buffer: ArrayBuffer;
|
|
13
13
|
byteOffset: number;
|
package/dist/index.js
CHANGED
|
@@ -17,12 +17,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
exports.writePsdBuffer = exports.writePsdUint8Array = exports.writePsd = exports.readPsd = exports.byteArrayToBase64 = exports.initializeCanvas = void 0;
|
|
18
18
|
var psdWriter_1 = require("./psdWriter");
|
|
19
19
|
var psdReader_1 = require("./psdReader");
|
|
20
|
+
var base64_js_1 = require("base64-js");
|
|
20
21
|
__exportStar(require("./abr"), exports);
|
|
21
22
|
__exportStar(require("./csh"), exports);
|
|
22
23
|
var helpers_1 = require("./helpers");
|
|
23
24
|
Object.defineProperty(exports, "initializeCanvas", { enumerable: true, get: function () { return helpers_1.initializeCanvas; } });
|
|
24
25
|
__exportStar(require("./psd"), exports);
|
|
25
|
-
var base64_js_1 = require("base64-js");
|
|
26
26
|
exports.byteArrayToBase64 = base64_js_1.fromByteArray;
|
|
27
27
|
function readPsd(buffer, options) {
|
|
28
28
|
var reader = 'buffer' in buffer ?
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAC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AsB;IAC9D,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;QAClC,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;KACzD;IAED,OAAO,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC;AACtD,CAAC;AAND,wCAMC"}
|
package/dist/psd.d.ts
CHANGED
|
@@ -1103,6 +1103,19 @@ type FilterVariant = {
|
|
|
1103
1103
|
filter: {
|
|
1104
1104
|
liquifyMesh: Uint8Array;
|
|
1105
1105
|
};
|
|
1106
|
+
} | {
|
|
1107
|
+
type: 'perspective warp';
|
|
1108
|
+
filter: {
|
|
1109
|
+
quads: number[][];
|
|
1110
|
+
vertices: {
|
|
1111
|
+
x: UnitsValue;
|
|
1112
|
+
y: UnitsValue;
|
|
1113
|
+
}[];
|
|
1114
|
+
warpedVertices: {
|
|
1115
|
+
x: UnitsValue;
|
|
1116
|
+
y: UnitsValue;
|
|
1117
|
+
}[];
|
|
1118
|
+
};
|
|
1106
1119
|
};
|
|
1107
1120
|
export type Filter = FilterVariant & {
|
|
1108
1121
|
name: string;
|
package/dist/psd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"psd.js","sourceRoot":"../src/","sources":["psd.ts"],"names":[],"mappings":";;;AAMA,IAAkB,SASjB;AATD,WAAkB,SAAS;IAC1B,6CAAU,CAAA;IACV,mDAAa,CAAA;IACb,+CAAW,CAAA;IACX,uCAAO,CAAA;IACP,yCAAQ,CAAA;IACR,yDAAgB,CAAA;IAChB,+CAAW,CAAA;IACX,uCAAO,CAAA;AACR,CAAC,EATiB,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAS1B;AAED,IAAkB,kBAKjB;AALD,WAAkB,kBAAkB;IACnC,6DAAS,CAAA;IACT,uEAAc,CAAA;IACd,2EAAgB,CAAA;IAChB,+FAA0B,CAAA;AAC3B,CAAC,EALiB,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAKnC;
|
|
1
|
+
{"version":3,"file":"psd.js","sourceRoot":"../src/","sources":["psd.ts"],"names":[],"mappings":";;;AAMA,IAAkB,SASjB;AATD,WAAkB,SAAS;IAC1B,6CAAU,CAAA;IACV,mDAAa,CAAA;IACb,+CAAW,CAAA;IACX,uCAAO,CAAA;IACP,yCAAQ,CAAA;IACR,yDAAgB,CAAA;IAChB,+CAAW,CAAA;IACX,uCAAO,CAAA;AACR,CAAC,EATiB,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAS1B;AAED,IAAkB,kBAKjB;AALD,WAAkB,kBAAkB;IACnC,6DAAS,CAAA;IACT,uEAAc,CAAA;IACd,2EAAgB,CAAA;IAChB,+FAA0B,CAAA;AAC3B,CAAC,EALiB,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAKnC;AAg4CD,IAAY,qBAKX;AALD,WAAY,qBAAqB;IAChC,iEAAQ,CAAA;IACR,6EAAc,CAAA;IACd,yEAAY,CAAA;IACZ,6EAAc,CAAA;AACf,CAAC,EALW,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAKhC"}
|
|
@@ -1295,11 +1295,22 @@ function parseFilterFXItem(f, options) {
|
|
|
1295
1295
|
lightDirection: f.Fltr.LghD,
|
|
1296
1296
|
specularity: f.Fltr.specularity,
|
|
1297
1297
|
} });
|
|
1298
|
-
case 'LqFy':
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1298
|
+
case 'LqFy':
|
|
1299
|
+
{
|
|
1300
|
+
return __assign(__assign({}, base), { type: 'liquify', filter: {
|
|
1301
|
+
liquifyMesh: f.Fltr.LqMe,
|
|
1302
|
+
} });
|
|
1303
|
+
}
|
|
1304
|
+
;
|
|
1305
|
+
case 'perspectiveWarpTransform':
|
|
1306
|
+
{
|
|
1307
|
+
return __assign(__assign({}, base), { type: 'perspective warp', filter: {
|
|
1308
|
+
vertices: f.Fltr.vertices.map(hrznVrtcToPoint),
|
|
1309
|
+
warpedVertices: f.Fltr.warpedVertices.map(hrznVrtcToPoint),
|
|
1310
|
+
quads: f.Fltr.quads.map(function (q) { return q.indices; }),
|
|
1311
|
+
} });
|
|
1312
|
+
}
|
|
1313
|
+
;
|
|
1303
1314
|
default:
|
|
1304
1315
|
if (options.throwForMissingFeatures) {
|
|
1305
1316
|
throw new Error("Unknown filter classId: ".concat(f.Fltr._classID));
|
|
@@ -1772,6 +1783,13 @@ function serializeFilterFXItem(f) {
|
|
|
1772
1783
|
_classID: 'LqFy',
|
|
1773
1784
|
LqMe: f.filter.liquifyMesh,
|
|
1774
1785
|
}, filterID: 1282492025 });
|
|
1786
|
+
case 'perspective warp': return __assign(__assign({}, base), { Fltr: {
|
|
1787
|
+
_name: 'Perspective Warp',
|
|
1788
|
+
_classID: 'perspectiveWarpTransform',
|
|
1789
|
+
vertices: f.filter.vertices.map(pointToHrznVrtc),
|
|
1790
|
+
warpedVertices: f.filter.warpedVertices.map(pointToHrznVrtc),
|
|
1791
|
+
quads: f.filter.quads.map(function (indices) { return ({ indices: indices }); }),
|
|
1792
|
+
}, filterID: 442 });
|
|
1775
1793
|
default: throw new Error("Unknow filter type: ".concat(f.type));
|
|
1776
1794
|
}
|
|
1777
1795
|
}
|