mirror of
https://gitee.com/onvia/ccc-tnt-psd2ui
synced 2025-10-13 18:46:27 +00:00
两个版本的插件
This commit is contained in:
267
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/CHANGELOG.md
generated
vendored
Normal file
267
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,267 @@
|
||||
# Changelog
|
||||
|
||||
## v15.0.0
|
||||
- Added support for frame and timeline animations
|
||||
|
||||
## v14.5.0
|
||||
- Added support for zip compression without prediction of image data
|
||||
- Added support for `compress` option when writing
|
||||
|
||||
## v14.4.0
|
||||
- Added support for `layerMaskAsGlobalMask` flag
|
||||
- Added support for `interpolationMethod` for gradient overlay layer blending mode
|
||||
|
||||
## v14.3.13
|
||||
- Fixed handling files with incorrect channel image data length
|
||||
|
||||
## v14.3.11
|
||||
- Fixed corrupted file when passing non-integer values to `layer.left`, `.top`, `.right`, `.bottom`
|
||||
|
||||
## v14.3.9
|
||||
- Fixed reading some corrupted files
|
||||
|
||||
## v14.3.8
|
||||
- Fixed handling files with incorrect section sizes
|
||||
|
||||
## v14.3.6
|
||||
- Fixed incorrect writing of `vogk` section in some cases resulting in a broken file
|
||||
|
||||
## v14.3.6
|
||||
- Fixed incorrect writing of `vogk` section in some cases resulting in a broken file
|
||||
|
||||
## v14.3.2
|
||||
- Added `nonAffineTransform` field to smart object transform when nonAffineTransform is diferent than regular transform
|
||||
|
||||
## v14.3.1
|
||||
- Fixed writing paragraphStyle autoLeading property (previous it was writing incorrectly for whole values, like 1.0 or 2.0)
|
||||
|
||||
## v14.3.0
|
||||
- Added support for `fillOpacity` and `transparencyShapesLayer`
|
||||
- Fixed error in some cases when reading files with deeply nested layers
|
||||
|
||||
## v14.2.0
|
||||
- Added `readCsh` function for reading photoshop custom shape files
|
||||
|
||||
## v14.1.0
|
||||
- Added support for `imageReadyVariables` and `imageReadyDataSets` image resources
|
||||
- Fix missing support for alternative image resource block signatures
|
||||
|
||||
## v14.0.1
|
||||
- Added missing handling for new platform and platformLCD text anti-aliasing modes
|
||||
|
||||
## v14.0.0
|
||||
- Added handling for annotations
|
||||
- **BREAKING CHANGE:** Fixed reading and writing non-RGB colors and documented value ranges (value ranger for HSB, CMYK, Lab and Grayscale colors different from previous versions)
|
||||
```ts
|
||||
export type RGBA = { r: number; g: number; b: number; a: number; }; // values from 0 to 255
|
||||
export type RGB = { r: number; g: number; b: number; }; // values from 0 to 255
|
||||
export type HSB = { h: number; s: number; b: number; }; // values from 0 to 1
|
||||
export type CMYK = { c: number; m: number; y: number; k: number; }; // values from 0 to 255
|
||||
export type LAB = { l: number; a: number; b: number; }; // values `l` from 0 to 1; `a` and `b` from -1 to 1
|
||||
export type Grayscale = { k: number }; // values from 0 to 255
|
||||
export type Color = RGBA | RGB | HSB | CMYK | LAB | Grayscale;
|
||||
```
|
||||
- Fixed not handling correct value for text gridding
|
||||
|
||||
## v13.0.2
|
||||
- Fixed error when opening PSB file with smart objects
|
||||
|
||||
## v13.0.1
|
||||
- Fixed reading layer groups with missing section divider info
|
||||
|
||||
## v13.0.0
|
||||
- **BREAKING CHANGE:** Changed how `meshPoints` are represented in warps
|
||||
```ts
|
||||
// old representation
|
||||
interface Warp {
|
||||
meshPoints: { type: 'horizontal' | 'vertical'; values: number[]; }[];
|
||||
}
|
||||
|
||||
// new representation
|
||||
interface Warp {
|
||||
meshPoints: { x: number; y: number; }[];
|
||||
}
|
||||
```
|
||||
- Fixed handling for complex warps
|
||||
|
||||
## v12.2.0
|
||||
- Fixed incorrect length of style and paragraph style runs when reading or writing
|
||||
- Added handling for `pathSelectionState`
|
||||
|
||||
## v12.1.0
|
||||
- Added support for reading and writing PSB files (Large Document Format)
|
||||
|
||||
Use `psb: true` in write options to write file in PSB format)
|
||||
|
||||
The sizes are still limited by 32bit integer number range and will throw an error if you attempt to read any file larger than 2GB.
|
||||
- Fixed some fields not handled in `vectorOrigination`
|
||||
|
||||
## v12.0.0
|
||||
- **BREAKING CHANGE:** Added support for multiples of the same layer blending effect, these `layer.effects` keys are now arrays:
|
||||
- `dropShadow`
|
||||
- `innerShadow`
|
||||
- `solidFill`
|
||||
- `stroke`
|
||||
- `gradientOverlay`
|
||||
|
||||
WARNING: adding more than one of effect in these arrays will result in file being saved with new version of effects section that is not readable on older versions of Photoshop.
|
||||
|
||||
## v11.6.2
|
||||
- Fixed smart layer block info not parsing correctly in some cases
|
||||
- Added automatic deduplication of layer IDs
|
||||
|
||||
## v11.6.1
|
||||
- Fixed group blending modes not writing correctly
|
||||
|
||||
## v11.6.0
|
||||
- Added `fromVectorData` field to `mask` object that indicates if mask image data comes from vector data attached to the layer
|
||||
- Added handling `globalLayerMaskInfo` field
|
||||
- Fixed vector and bitmap masks not writing correctly when used at the same time on one layer
|
||||
|
||||
## v11.5.1
|
||||
- Added missing field `operation` to paths in vector layers
|
||||
|
||||
## v11.5.0
|
||||
- Added `noBackground` write option to force treating bottom layer as layer instead of background when it doesn't have any transparent pixels
|
||||
|
||||
## v11.4.0
|
||||
- Added handling for artboards
|
||||
- Fixed issues with handling smart objects
|
||||
- Fixed issues with handling vector layers
|
||||
|
||||
## v11.3.0
|
||||
- Added handling for *Vector Origination Data* and *Compositor Used*
|
||||
- Added handling for *ICC Untagged Profile*
|
||||
- Added handling for *Lock Artbords* layer option
|
||||
|
||||
## v11.2.0
|
||||
- Added handling for smart objects
|
||||
- Changed types for text warp
|
||||
|
||||
## v11.1.0
|
||||
- Added handling for text shape (point, box)
|
||||
- Fixed incorrect parsing of utf-16 strings
|
||||
|
||||
## v11.0.0
|
||||
- **BREAKING CHANGE:** Changed all color fields from r, g, b, a array to color mode specific objects
|
||||
```js
|
||||
// old
|
||||
var color = [red, green, blue, alpha];
|
||||
|
||||
// new
|
||||
var rgbColor = { r: red, g: green, b: blue };
|
||||
var hsbColor = { h: hue, s: saturation, b: brightness };
|
||||
var labColor = { l: L, a: A, b: B };
|
||||
var cmykColor = { c: cyan, m: magenta, y: yellow, k: black };
|
||||
var grayscaleColor = { k: grayscaleValue };
|
||||
|
||||
// reading new colors
|
||||
if ('r' in color) {
|
||||
// read RGB color
|
||||
} else if ('h' in color) {
|
||||
// read HSB color
|
||||
} else if ('l' in color) {
|
||||
// read Lab color
|
||||
} else if ('c' in color) {
|
||||
// read CMYK color
|
||||
} else {
|
||||
// read grayscale color
|
||||
}
|
||||
|
||||
// almost all color in PSD document follow main document color mode, so you can use this shortcut in your code
|
||||
if ('r' in color) {
|
||||
// read RGB color
|
||||
} else {
|
||||
// error or use default
|
||||
}
|
||||
```
|
||||
|
||||
## v10.0.0
|
||||
- **BREAKING CHANGE:** Removed `unicodeAlphaNames` image resource (use `alphaChannelNames` instead)
|
||||
- **BREAKING CHANGE:** Replaced `sheetColors` layer field with `layerColor` field
|
||||
- **BREAKING CHANGE:** Changed mask density fields to be in 0-1 range (instead of 0-255)
|
||||
- Removed `metadata` field from layers
|
||||
- Fixed incorrectly writing layer masks information in some cases
|
||||
- Added handling for adjustment layers
|
||||
- Added `timestamp` field to layers
|
||||
- Added `printInformation` image resource
|
||||
|
||||
## v9.1.1
|
||||
- Fixed saved PSD files broken in some cases
|
||||
|
||||
## v9.1.0
|
||||
- Added missing support for "stroke" blending option
|
||||
|
||||
## v9.0.0
|
||||
- **BREAKING CHANGE:** Changed some numerical fields in effects objects to value+units fields
|
||||
- Added handling for vector layers
|
||||
- Added option for reading and writing raw image data using `imageData` fields corresponding to `canvas` fields on layer objects. (use `useImageData` option for reading raw data instead of using canvas objects, for writing initialize `imageData` fields instead of `canvas` fields)
|
||||
- Added option for reading and writing raw, compressed thumbnail image data using `thumbnailRaw` field. (use `useRawThumbnail` option for reading raw data instead of using canvas object)
|
||||
- Added `backgroundColor` image resource
|
||||
- Added `xmpMetadata` image resource
|
||||
- Added `printFlags` image resource
|
||||
- Added `idsSeedNumber` image resource
|
||||
- Added typescript type for blendModes
|
||||
- Fixed writing incorrect binary data in some cases
|
||||
- Fixed field name for `sectionDivider.subType`
|
||||
- Fixed reading mask parameters
|
||||
|
||||
## v8.0.0
|
||||
- Added handling for reading and writing text layer data (with some limitations)
|
||||
- Added `invalidateTextLayers` write options for forcing Photoshop to redraw updated text layer.
|
||||
- Removed unnecessary `version` fields from `pixelAspectRatio` and `versionInfo` image resources.
|
||||
|
||||
## v7.0.0
|
||||
- **BREAKING CHANGE:** Normalized handling of opacity (now all opacity fields are in 0-1 range, instead of 0-255)
|
||||
- **BREAKING CHANGE:** Fixed handling for colors (colors are now represented by an array of 4 values in 0-255 range as [R, G, B, A], for example: `[255, 0, 0, 255]` for opaque red color)
|
||||
- Added handling for layer effects (blending options) (supports all effects except "Pattern Overlay")
|
||||
- Added `writePsdUint8Array` function for saving to `Uint8Array` (this avoids double memory allocation)
|
||||
- Removed unnecessary `version` field from `gridAndGuidesInformation` field
|
||||
|
||||
## v6.3.0
|
||||
- Added exported byteArrayToBase64 function
|
||||
- Updated readme with exampla of usage in web worker
|
||||
|
||||
## v6.2.0
|
||||
- Added print scale image resource handling
|
||||
- Added caption digest image resource handling
|
||||
|
||||
## v6.1.0
|
||||
- Added loading and saving layer masks
|
||||
|
||||
## v6.0.0
|
||||
- Changed reading to ignore not implemented features by default instead of throwing
|
||||
- Removed logging missing handling for layer info
|
||||
- Added `throwForMissingFeatures` and `logMissingFeatures` read options for previous behavior
|
||||
|
||||
## v5.0.0
|
||||
- Simplified canvas initialization on NodeJS
|
||||
|
||||
before:
|
||||
```typescript
|
||||
import { createCanvas } from 'canvas';
|
||||
import { readPsd, initializeCanvas } from 'ag-psd';
|
||||
|
||||
initializeCanvas(createCanvas);
|
||||
```
|
||||
after:
|
||||
```typescript
|
||||
import 'ag-psd/initialize-canvas';
|
||||
import { readPsd } from 'ag-psd';
|
||||
```
|
||||
- Changed `writePsd()` method to always return `ArrayBuffer`. If you need `Buffer` as a result use `writePsdBuffer()` method instead.
|
||||
- Simplified script import on browser, now import is the same on both platforms.
|
||||
|
||||
before:
|
||||
```typescript
|
||||
// node
|
||||
import { readPsd } from 'ag-psd';
|
||||
|
||||
// browser
|
||||
import { readPsd } from 'ag-psd/dist/browser';
|
||||
```
|
||||
after:
|
||||
```typescript
|
||||
// node or browser
|
||||
import { readPsd } from 'ag-psd';
|
||||
```
|
26
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/LICENSE
generated
vendored
Normal file
26
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016 Agamnentzar
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
|
||||
|
||||
Any image or brush files included in this repository are not covered by this
|
||||
license and belong to their copyright holders.
|
518
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/README.md
generated
vendored
Normal file
518
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/README.md
generated
vendored
Normal file
@@ -0,0 +1,518 @@
|
||||
# ag-psd
|
||||
|
||||
[](https://travis-ci.org/Agamnentzar/ag-psd)
|
||||
[](https://www.npmjs.com/package/ag-psd)
|
||||
|
||||
JavaScript library for reading and writing PSD files (Photoshop Document files)
|
||||
|
||||
Implemented according to [official documentation](https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/)
|
||||
, [fileformat.info](http://www.fileformat.info/format/psd/egff.htm) and a lot of trial and error.
|
||||
|
||||
## Limitations
|
||||
|
||||
* Does not support reading Indexed, CMYK, Multichannel, Duotone and LAB color modes (all supported color modes are converted to RGB mode when reading)
|
||||
* Does not support writing any color modes other than RGB
|
||||
* Does not support 16 bits per channel
|
||||
* Does not support The Large Document Format (8BPB/PSB)
|
||||
* Does not support color palettes
|
||||
* Does not support animations
|
||||
* Does not support patterns (or "Pattern Overlay" layer effect)
|
||||
* Does not support some metadata fields
|
||||
* Does not support 3d effects
|
||||
* Does not support some new features from latest versions of Photoshop
|
||||
* Text layers implementation is incomplete
|
||||
* Writing text layer with "vertical" orientation may result in broken PSD file
|
||||
* Does not support writing or reading predefined "Paragraph Styles" or "Character Styles"
|
||||
* The library does not redraw bitmap data for the text layer, so files with updated/written text layers will result in a warning prompt when opening the file in Photoshop. [see more below](#updating-text-layers)
|
||||
* This library does not handle redrawing layer and composite image data by itself when blending options, vector data or text options are changed. Any updates to image data have to be done by the user or updated by opening and re-saving the file in Photoshop.
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
npm install ag-psd
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Description of the structure of Psd object used by `readPsd` and `writePsd` functions can be found in our [PSD Readme document](/README_PSD.md)
|
||||
|
||||
### Functions
|
||||
|
||||
```ts
|
||||
// read PSD from ArrayBuffer, typed array or Node.js Buffer object
|
||||
export function readPsd(buffer: Buffer | ArrayBuffer | BufferLike, options?: ReadOptions): Psd;
|
||||
|
||||
// write PSD to ArrayBuffer
|
||||
export function writePsd(psd: Psd, options?: WriteOptions): ArrayBuffer;
|
||||
|
||||
// write PSD to Uint8Array (avoids some memory allocation)
|
||||
export function writePsdUint8Array(psd: Psd, options?: WriteOptions): Uint8Array;
|
||||
|
||||
// write PSD to Node.js Buffer object
|
||||
export function writePsdBuffer(psd: Psd, options?: WriteOptions): Buffer;
|
||||
```
|
||||
|
||||
### Node.js
|
||||
|
||||
#### Reading
|
||||
|
||||
Needs [node-canvas](https://github.com/Automattic/node-canvas) to read image data and thumbnails.
|
||||
|
||||
```javascript
|
||||
import * as fs from 'fs';
|
||||
import 'ag-psd/initialize-canvas'; // only needed for reading image data and thumbnails
|
||||
import { readPsd } from 'ag-psd';
|
||||
|
||||
const buffer = fs.readFileSync('my-file.psd');
|
||||
|
||||
// read only document structure
|
||||
const psd1 = readPsd(buffer, { skipLayerImageData: true, skipCompositeImageData: true, skipThumbnail: true });
|
||||
console.log(psd1);
|
||||
|
||||
// read document structure and image data
|
||||
const psd2 = readPsd(buffer);
|
||||
console.log(psd2);
|
||||
// by defaults `canvas` field type is HTMLCanvasElement, so it needs to be cast to `any`
|
||||
// or node-canvas `Canvas` type, in order to call `toBuffer` method
|
||||
fs.writeFileSync('layer-1.png', (psd2.children[0].canvas as any).toBuffer());
|
||||
```
|
||||
|
||||
#### Writing
|
||||
|
||||
```javascript
|
||||
import * as fs from 'fs';
|
||||
import 'ag-psd/initialize-canvas'; // only needed for writing image data and thumbnails
|
||||
import { writePsdBuffer } from 'ag-psd';
|
||||
|
||||
const psd = {
|
||||
width: 300,
|
||||
height: 200,
|
||||
children: [
|
||||
{
|
||||
name: 'Layer #1',
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
const buffer = writePsdBuffer(psd);
|
||||
fs.writeFileSync('my-file.psd', buffer);
|
||||
```
|
||||
|
||||
### Browser
|
||||
|
||||
#### Reading
|
||||
|
||||
```javascript
|
||||
import { readPsd } from 'ag-psd';
|
||||
|
||||
const xhr = new XMLHttpRequest();
|
||||
xhr.open('GET', 'my-file.psd', true);
|
||||
xhr.responseType = 'arraybuffer';
|
||||
xhr.addEventListener('load', function () {
|
||||
const buffer = xhr.response;
|
||||
const psd = readPsd(buffer);
|
||||
|
||||
console.log(psd);
|
||||
|
||||
document.body.appendChild(psd.children[0].canvas);
|
||||
}, false);
|
||||
xhr.send();
|
||||
```
|
||||
|
||||
#### Writing
|
||||
|
||||
`saveAs` function from [FileSaver.js](https://github.com/eligrey/FileSaver.js/)
|
||||
|
||||
```javascript
|
||||
import { writePsd } from 'ag-psd';
|
||||
|
||||
const psd = {
|
||||
width: 300,
|
||||
height: 200,
|
||||
children: [
|
||||
{
|
||||
name: 'Layer #1',
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
const buffer = writePsd(psd);
|
||||
const blob = new Blob([buffer], { type: 'application/octet-stream' });
|
||||
saveAs(blob, 'my-file.psd');
|
||||
```
|
||||
|
||||
### Browser (bundle)
|
||||
|
||||
```html
|
||||
<script src="node_modules/ag-psd/dist/bundle.js"></script>
|
||||
<script>
|
||||
var readPsd = agPsd.readPsd;
|
||||
// rest the same as above
|
||||
</script>
|
||||
```
|
||||
|
||||
### Browser in Web Worker
|
||||
|
||||
#### Reading
|
||||
|
||||
Browser has to support `OffscreenCanvas` and `bitmaprenderer` context.
|
||||
|
||||
```js
|
||||
// worker.js
|
||||
|
||||
importScripts('bundle.js');
|
||||
|
||||
const createCanvas = (width, height) => {
|
||||
const canvas = new OffscreenCanvas(width, height);
|
||||
canvas.width = width;
|
||||
canvas.height = height;
|
||||
return canvas;
|
||||
};
|
||||
|
||||
const createCanvasFromData = (data) => {
|
||||
const image = new Image();
|
||||
image.src = 'data:image/jpeg;base64,' + agPsd.byteArrayToBase64(data);
|
||||
const canvas = new OffscreenCanvas(image.width, image.height);
|
||||
canvas.width = image.width;
|
||||
canvas.height = image.height;
|
||||
canvas.getContext('2d').drawImage(image, 0, 0);
|
||||
return canvas;
|
||||
};
|
||||
|
||||
agPsd.initializeCanvas(createCanvas, createCanvasFromData);
|
||||
|
||||
onmessage = message => {
|
||||
// skipping thumbnail and layer images here so we don't have to clear and convert them all
|
||||
// before posting data back
|
||||
const psd = agPsd.readPsd(message.data, { skipLayerImageData: true, skipThumbnail: true });
|
||||
const bmp = psd.canvas.transferToImageBitmap();
|
||||
delete psd.canvas; // can't post canvases back from workers
|
||||
postMessage({ psd: psd, image: bmp }, [bmp]); // need to mark bitmap for transfer
|
||||
};
|
||||
|
||||
|
||||
// main script (assumes using bundle)
|
||||
|
||||
const worker = new Worker('worker.js');
|
||||
worker.onmessage = message => {
|
||||
const psd = message.data.psd;
|
||||
const image = message.data.image;
|
||||
|
||||
// convert image back to canvas
|
||||
const canvas = document.createElement('canvas');
|
||||
canvas.width = image.width;
|
||||
canvas.height = image.height;
|
||||
canvas.getContext('bitmaprenderer').transferFromImageBitmap(image);
|
||||
|
||||
document.body.appendChild(canvas);
|
||||
console.log('psd:', psd);
|
||||
};
|
||||
|
||||
const xhr = new XMLHttpRequest();
|
||||
xhr.open('GET', 'src.psd', true);
|
||||
xhr.responseType = 'arraybuffer';
|
||||
xhr.addEventListener('load', function () {
|
||||
// read using worker
|
||||
worker.postMessage(buffer, [buffer]);
|
||||
}, false);
|
||||
xhr.send();
|
||||
```
|
||||
|
||||
#### Writing
|
||||
|
||||
```js
|
||||
// worker.js
|
||||
|
||||
importScripts('bundle.js');
|
||||
|
||||
const createCanvas = (width, height) => {
|
||||
const canvas = new OffscreenCanvas(width, height);
|
||||
canvas.width = width;
|
||||
canvas.height = height;
|
||||
return canvas;
|
||||
};
|
||||
|
||||
const createCanvasFromData = (data) => {
|
||||
const image = new Image();
|
||||
image.src = 'data:image/jpeg;base64,' + agPsd.byteArrayToBase64(data);
|
||||
const canvas = new OffscreenCanvas(image.width, image.height);
|
||||
canvas.width = image.width;
|
||||
canvas.height = image.height;
|
||||
canvas.getContext('2d').drawImage(image, 0, 0);
|
||||
return canvas;
|
||||
};
|
||||
|
||||
agPsd.initializeCanvas(createCanvas, createCanvasFromData);
|
||||
|
||||
onmessage = message => {
|
||||
const psd = message.data.psd;
|
||||
const image = message.data.image;
|
||||
|
||||
// convert bitmap back to canvas
|
||||
const canvas = new OffscreenCanvas(image.width, image.height);
|
||||
canvas.getContext('bitmaprenderer').transferFromImageBitmap(image);
|
||||
// need to draw onto new canvas because single canvas can't use both '2d' and 'bitmaprenderer' contexts
|
||||
const canvas2 = new OffscreenCanvas(canvas.width, canvas.height);
|
||||
canvas2.getContext('2d').drawImage(canvas, 0, 0);
|
||||
|
||||
console.log(psd, canvas2);
|
||||
psd.children[0].canvas = canvas2;
|
||||
psd.canvas = canvas2;
|
||||
const data = agPsd.writePsd(psd);
|
||||
postMessage(data, [data]); // mark data as transferable
|
||||
};
|
||||
|
||||
|
||||
// main script (assumes using bundle)
|
||||
|
||||
const worker = new Worker('/test/worker-write.js');
|
||||
worker.onmessage = message => {
|
||||
const blob = new Blob([message.data]);
|
||||
const a = document.createElement('a');
|
||||
a.href = URL.createObjectURL(blob);
|
||||
a.textContent = 'Download generated PSD';
|
||||
a.download = 'example_psd.psd';
|
||||
document.body.appendChild(a);
|
||||
};
|
||||
|
||||
const canvas = new OffscreenCanvas(200, 200);
|
||||
const context = canvas.getContext('2d');
|
||||
context.fillStyle = 'white';
|
||||
context.fillRect(0, 0, 200, 200);
|
||||
context.fillStyle = 'red';
|
||||
context.fillRect(50, 50, 120, 110);
|
||||
const bmp = canvas.transferToImageBitmap(); // convert canvas to image bitmap for transfering to worker
|
||||
const psd = {
|
||||
width: 200,
|
||||
height: 200,
|
||||
children: [
|
||||
{
|
||||
name: 'Layer 1',
|
||||
}
|
||||
]
|
||||
};
|
||||
worker.postMessage({ psd: psd, image: bmp }, [bmp]);
|
||||
```
|
||||
|
||||
You can see working example in `test/index.html`, `test/worker-read.js` and `test/worker-write.js`.
|
||||
|
||||
### Options
|
||||
|
||||
```typescript
|
||||
interface ReadOptions {
|
||||
/** Does not load layer image data. */
|
||||
skipLayerImageData?: boolean;
|
||||
/** Does not load composite image data. */
|
||||
skipCompositeImageData?: boolean;
|
||||
/** Does not load thumbnail. */
|
||||
skipThumbnail?: boolean;
|
||||
/** Does not load linked files (used in smart-objects). */
|
||||
skipLinkedFilesData?: boolean;
|
||||
/** Throws exception if features are missing. */
|
||||
throwForMissingFeatures?: boolean;
|
||||
/** Logs if features are missing. */
|
||||
logMissingFeatures?: boolean;
|
||||
/** Keep image data as byte array instead of canvas.
|
||||
* (image data will appear in `imageData` fields instead of `canvas` fields)
|
||||
* This avoids issues with canvas premultiplied alpha corrupting image data. */
|
||||
useImageData?: boolean;
|
||||
/** Loads thumbnail raw data instead of decoding it's content into canvas.
|
||||
* `thumnailRaw` field is used instead of `thumbnail` field. */
|
||||
useRawThumbnail?: boolean;
|
||||
/** Usend only for development */
|
||||
logDevFeatures?: boolean;
|
||||
}
|
||||
|
||||
interface WriteOptions {
|
||||
/** Automatically generates thumbnail from composite image. */
|
||||
generateThumbnail?: boolean;
|
||||
/** Trims transparent pixels from layer image data. */
|
||||
trimImageData?: boolean;
|
||||
/** Invalidates text layer data, forcing Photoshop to redraw them on load.
|
||||
* Use this option if you're updating loaded text layer properties. */
|
||||
invalidateTextLayers?: boolean;
|
||||
/** Logs if features are missing. */
|
||||
logMissingFeatures?: boolean;
|
||||
/** Forces bottom layer to be treated as layer and not background even when it's missing any transparency
|
||||
* (by default Photoshop treats bottom layer as background if it doesn't have any transparent pixels) */
|
||||
noBackground?: boolean;
|
||||
}
|
||||
```
|
||||
|
||||
### Sample PSD document
|
||||
|
||||
Below is a simple example of document structure returned from `readPsd`. You can see full document structure in [psd.ts file](https://github.com/Agamnentzar/ag-psd/blob/master/src/psd.ts)
|
||||
|
||||
```json
|
||||
{
|
||||
"width": 300,
|
||||
"height": 200,
|
||||
"channels": 3,
|
||||
"bitsPerChannel": 8,
|
||||
"colorMode": 3,
|
||||
"children": [
|
||||
{
|
||||
"top": 0,
|
||||
"left": 0,
|
||||
"bottom": 200,
|
||||
"right": 300,
|
||||
"blendMode": "normal",
|
||||
"opacity": 1,
|
||||
"transparencyProtected": false,
|
||||
"hidden": true,
|
||||
"clipping": false,
|
||||
"name": "Layer 0",
|
||||
"canvas": [Canvas]
|
||||
},
|
||||
{
|
||||
"top": 0,
|
||||
"left": 0,
|
||||
"bottom": 0,
|
||||
"right": 0,
|
||||
"blendMode": "multiply",
|
||||
"opacity": 1,
|
||||
"transparencyProtected": true,
|
||||
"hidden": false,
|
||||
"clipping": false,
|
||||
"name": "Layer 3",
|
||||
"canvas": [Canvas]
|
||||
}
|
||||
],
|
||||
"canvas": [Canvas]
|
||||
}
|
||||
```
|
||||
|
||||
## Modifying documents
|
||||
|
||||
General approach with `ag-psd` to modifying documents is to read the document, apply the updates and write the document back.
|
||||
|
||||
If you read and write the same document, image data can get corrupted by automatic alpha channel pre-multiplication that happens when you load data into the canvas element. To avoid that, use raw image data, set `useImageData` option to `true` in `ReadOptions`. You can also use `useRawThumbnail` option to avoid any changes to thumbnail image.
|
||||
|
||||
```js
|
||||
const psd = readPsd(inputBuffer, { useImageData: true });
|
||||
|
||||
// TODO: update psd document here
|
||||
|
||||
const outuptBuffer = writePsd(psd);
|
||||
```
|
||||
|
||||
Updating general properties that don't have visual impact on the canvas, like printing info or layer name will work correctly without any extra work.
|
||||
|
||||
This library does NOT generate new composite canvas based on the layer data, so changing layer order, adding or removing layers or changing layer canvas data, or blending mode, or any other property that has visual impact on the canvas will cause the composite image and thumbnail to not be valid anymore. If you need composite image or thumbnail to be correct you need to update them yourself by updating `psd.canvas` or `psd.imageData` and `psd.imageResources.thumbnail` or `psd.imageResources.thumbnailRaw` fields. Composite image data is not required for PSD file to be readble in Photoshop so leaving old version or removing it completely may be good option. Thumbnail is only necessary for file preview in programs like Adobe Bridge or File Explorer, if you don't need to support that you can skip thumbnail as well.
|
||||
|
||||
This library also does NOT generate new layer canvas based on layer settings, so if you're changing any layer properties, that impact layer bitmap, you also need to update `layer.canvas` or `layer.imageData`. This includes: text layer properties, vector layer properties, smart object, etc. (this does not include layer blending options)
|
||||
|
||||
### Writing text layers
|
||||
|
||||
```js
|
||||
// simple example
|
||||
const psd = {
|
||||
width: 200,
|
||||
height: 200,
|
||||
children: [
|
||||
{
|
||||
name: 'text layer',
|
||||
text: {
|
||||
text: 'Hello world', // text you want to draw
|
||||
transform: [1, 0, 0, 1, 50, 50], // move text 50px horizontally and 50px vertically
|
||||
style: {
|
||||
font: { name: 'ArialMT' }, // need to provide full name here
|
||||
fontSize: 30,
|
||||
fillColor: { r: 255, g: 0, b: 0 }, // opaque red
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const buffer = writePsd(psd);
|
||||
```
|
||||
|
||||
```js
|
||||
// advanced example
|
||||
const psd = {
|
||||
width: 200,
|
||||
height: 200,
|
||||
children: [
|
||||
{
|
||||
name: 'text layer',
|
||||
text: {
|
||||
text: 'Hello world\nanother line', // text you want to draw
|
||||
transform: [1, 0, 0, 1, 50, 50], // move text 50px horizontally and 50px vertically
|
||||
style: {
|
||||
font: { name: 'ArialMT' }, // need to provide full name here
|
||||
fontSize: 30,
|
||||
},
|
||||
styleRuns: [
|
||||
{
|
||||
length: 5, // length of 'Hello'
|
||||
style: { fillColor: { r: 255, g: 0, b: 0 } }, // make 'Hello' red
|
||||
},
|
||||
{
|
||||
length: 7, // length of ' world\n'
|
||||
style: { fillColor: { r: 0, g: 0, b: 255 } }, // make 'world' blue
|
||||
},
|
||||
{
|
||||
length: 12, // length of 'another line'
|
||||
style: { fillColor: { r: 0, g: 255, b: 0 }, underline: true }, // make 'another line' green and underlined
|
||||
},
|
||||
],
|
||||
paragraphStyle: {
|
||||
justification: 'center', // center justify whole block of text
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const buffer = writePsd(psd);
|
||||
```
|
||||
|
||||
### Updating text layers
|
||||
|
||||
```js
|
||||
const psd = readPsd(inputBuffer);
|
||||
|
||||
// assuming first layer is the one you want to update and has text already present
|
||||
psd.children[0].text.text = 'New text here';
|
||||
|
||||
// optionally remove outdated image data
|
||||
psd.children[0].canvas = undefined;
|
||||
|
||||
// needs `invalidateTextLayers` option to force Photoshop to redraw text layer on load,
|
||||
// otherwise it will keep the old image data
|
||||
const outuptBuffer = writePsd(psd, { invalidateTextLayers: true });
|
||||
```
|
||||
|
||||
When you add text layer to PSD file it is missing image data and additional text engine information. When you open file created this way in Photoshop it will display this error message, prompting you to update layer image data. You should choose "Update" which will force Photoshop to redraw text layers from text data. Clicking "No" will result in text layers being left in broken state.
|
||||
|
||||

|
||||
|
||||
### Text layer issues
|
||||
|
||||
Writing or updating layer orientation to vertical can end up creating broken PSD file that will crash Photoshop on opening. This is result of incomplete text layer implementation.
|
||||
|
||||
## Development
|
||||
|
||||
### Building
|
||||
|
||||
```bash
|
||||
gulp build
|
||||
```
|
||||
|
||||
### Testing
|
||||
|
||||
```bash
|
||||
gulp test # run tests
|
||||
gulp cov # run tests & coverage
|
||||
```
|
||||
|
||||
### Coding
|
||||
|
||||
Watch task with building, testing and code coverage
|
||||
|
||||
```bash
|
||||
gulp dev # run with build watch task
|
||||
gulp dev --coverage # run with build & tests & coverage watch tasks
|
||||
npm run lint # run tslint
|
||||
```
|
729
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/README_PSD.md
generated
vendored
Normal file
729
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/README_PSD.md
generated
vendored
Normal file
@@ -0,0 +1,729 @@
|
||||
# PSD document format
|
||||
|
||||
This document describes structure of the Psd object used in `readPsd` and `writePsd` functions, you can see instructions on how to use these functions in our [main README document](/README.md#functions)
|
||||
|
||||
You can see examples of different PSD documents and their corresponding JSON data in our [test folder](/test/read). Each subfolder contains `src.psd` document and corresponding `data.json` file with object generated by our library. Additionally there is `canvas.png` file represending composite image data, `thumb.png` file representing thumbnail image data and `layer-#.png` files with image data of each layer.
|
||||
|
||||
## Basic document structure
|
||||
|
||||
```ts
|
||||
// example psd document structure
|
||||
const psd: Psd = {
|
||||
"width": 300,
|
||||
"height": 200,
|
||||
"channels": 3,
|
||||
"bitsPerChannel": 8,
|
||||
"colorMode": 3,
|
||||
"canvas": <Canvas>,
|
||||
"children": [],
|
||||
};
|
||||
```
|
||||
|
||||
- The `width` and `height` properties specify PSD document size in pixels. These values are required when writing a document.
|
||||
|
||||

|
||||
|
||||
- `channels` property specifies number of color channels in the document, it's usually 3 channels (red, green, and blue, when document is in typical RGB color mode) Other color modes will have different channel count (grayscale - 1 channel, CMYK - 4 channels). This property can be ommited when writing, this library only supports RGB color mode with 3 channels at the moment.
|
||||
|
||||
- `bitsPerChannel` property specifies number of bits per each color channel, this value will ba 1 for one bit bitmap color mode and 8 in all other cases as this library is not supporting 16 or 32 bit color channels at the moment. It can also be ommited when writing a document and default value of 8 will be assumed.
|
||||
|
||||
- `colorMode` specifies color mode of the PSD document.
|
||||
|
||||

|
||||
|
||||
Value is one of the numbers that can be matched to this enumerable:
|
||||
|
||||
```ts
|
||||
enum ColorMode {
|
||||
Bitmap = 0,
|
||||
Grayscale = 1,
|
||||
Indexed = 2,
|
||||
RGB = 3,
|
||||
CMYK = 4,
|
||||
Multichannel = 7,
|
||||
Duotone = 8,
|
||||
Lab = 9,
|
||||
}
|
||||
```
|
||||
The library supports "Bitmap", "Grayscale" and "RGB" color modes at the moment. "Bitmap" and "Grayscale" colors will be converted to "RGB" colors when reading PSD file. Writing is only supported for "RGB" mode. The value can be ommited for writing and "RGB" color mode will be assumed.
|
||||
|
||||
- `canvas` (or `imageData`) is a property containing bitmap with composite image data for the entire document. PSD file contains this extra bitmap additionally to bitmaps of each layer. `canvas` field will be an instance of `HTMLCanvasElement` (in browser environment) or `Canvas` object of `node-canvas` library (in nodejs environment).
|
||||
|
||||
You can choose to instead use `imageData` field by choosing `useImageData: true` option when reading PSD file. In that can `imageData` will be an instance of `ImageData` object, containing `width`, `height` and `data` properties. This is useful if you want to use bitmap data directly, and not use it for drawing using canvas. Additionally this will preserve accurate color information as canvas element will premultiply image alpha which will change color values slightly.
|
||||
|
||||
If you don't need to use this field you can specify `skipCompositeImageData: true` option, while reading PSD file, to skip reading this field and save on processing time and memory usage.
|
||||
|
||||
This image data is optional in PSD file so it may be missing in some PSD files that opted to skip it.
|
||||
|
||||
When writing you can provide either `canvas` or `imageData` property and the library will use the one you provide. You can also skip the field entirely and not write this data at all as it's not needed by Photohop to read the file. It might be used in some other application, for thumbnails or by some old versions of Adobe software, so you may want to still provide it to remain compatible with those programs.
|
||||
|
||||
If you're generating your own PSD file and want to provide this composite image data you will have to generate one yourself by composing all layer image data and effects yourself, this library does not provide any utilities to generate this image data for you.
|
||||
|
||||
- `children` list of layers and groups at the root of the document. [see Layers and Groups](#layers-and-groups)
|
||||
|
||||
- `imageResources` contains all document-wide parameters [see Image Resouces](#image-resources)
|
||||
|
||||
- `linkedFiles` contains list of files linked in smart objects [see Smart Objects](#smart-objects)
|
||||
|
||||
- `artboards` contains global options for artboards. Artboards is a feature in new versions of Photoshop that lets you have multiple canvases in a single PSD document. The information about positioning, name and color of each artboard is stored inside each layer, in `artboard` property. This property will be absent if the document does not have any artboards specified. It can be ommited when writing.
|
||||
|
||||
```ts
|
||||
type Artboards = {
|
||||
count: number; // number of artboards in the document
|
||||
autoExpandOffset?: { horizontal: number; vertical: number; };
|
||||
origin?: { horizontal: number; vertical: number; };
|
||||
autoExpandEnabled?: boolean;
|
||||
autoNestEnabled?: boolean;
|
||||
autoPositionEnabled?: boolean;
|
||||
shrinkwrapOnSaveEnabled?: boolean;
|
||||
docDefaultNewArtboardBackgroundColor?: Color;
|
||||
docDefaultNewArtboardBackgroundType?: number;
|
||||
}
|
||||
```
|
||||
|
||||
- `annotations` contains array of annotations, this field will be absent if the document does not have any annotations. It can be ommited when writing. Sound annotations are not supported by this library right at the moment.
|
||||
|
||||

|
||||
|
||||
Each annotation object has a following structure:
|
||||
|
||||
```ts
|
||||
interface Annotation {
|
||||
type: 'text' | 'sound';
|
||||
open: boolean;
|
||||
iconLocation: { left: number; top: number; right: number; bottom: number };
|
||||
popupLocation: { left: number; top: number; right: number; bottom: number };
|
||||
color: Color;
|
||||
author: string;
|
||||
name: string;
|
||||
date: string;
|
||||
data: string | Uint8Array; // annotation text or sound buffer
|
||||
}
|
||||
```
|
||||
|
||||
- `globalLayerMaskInfo` don't really know what this is, it can be ommited when writing.
|
||||
|
||||
- `filterMask` don't really know what this is, it can be ommited when writing.
|
||||
|
||||
## Layers and Groups
|
||||
|
||||
Psd document object has `children` property that contains all root level layers and groups in order from top to bottom as they appear in Photoshop (take note that if you want to draw the layer images to generate document image then you need to draw them in reverse order). The `children` property will contain both regular layers and groups. Each group will have `children` property, containing all the layers and groups that are inside that group. So the document will have a tree structure like this:
|
||||
|
||||
```js
|
||||
var psd = {
|
||||
// ... other fields
|
||||
children: [
|
||||
{
|
||||
name: "layer 1",
|
||||
// ... other fields
|
||||
}
|
||||
{
|
||||
name: "group 1",
|
||||
// ... other fields
|
||||
children: [
|
||||
{
|
||||
name: "layer 2, inside group 1",
|
||||
// ... other fields
|
||||
},
|
||||
{
|
||||
name: "group 2, inside group 1",
|
||||
// ... other fields
|
||||
children: []
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### Layer types
|
||||
|
||||
You can distinguish between different layer types by checking which properties thay have set on them. If a layer has `children` property set it meas the it's a group, if it has `text` property it's a text layer and so on. If you're only interested in the basic parsing of layers and want to just extract image data or layer parameter a simple parsing like this can be enough:
|
||||
|
||||
```js
|
||||
// simple parsing
|
||||
function parseLayer(layer) {
|
||||
if ('children' in layer) {
|
||||
// group
|
||||
layer.children.forEach(parseLayer);
|
||||
} else if (layer.canvas) {
|
||||
// regular layer with canvas
|
||||
} else {
|
||||
// empty or special layer
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
If you need to know type of each layer, something like this could be a good approach:
|
||||
|
||||
```ts
|
||||
// complex parsing
|
||||
function parseLayer(layer) {
|
||||
if ('children' in layer) {
|
||||
// group
|
||||
layer.children.forEach(parseLayer);
|
||||
} else if ('text' in layer) {
|
||||
// text layer
|
||||
} else if ('adjustment' in layer) {
|
||||
// adjustment layer
|
||||
} else if ('placedLayer' in layer) {
|
||||
// smart object layer
|
||||
} else if ('vectorMask' in layer) {
|
||||
// vector layer
|
||||
} else {
|
||||
// bitmap layer
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
But thake into account that a lot of properties are shared for different types of layers. Any layer can have a `mask` property for example.
|
||||
|
||||
### Layer
|
||||
|
||||
Example layer structure:
|
||||
|
||||
```js
|
||||
{
|
||||
"top": 0,
|
||||
"left": 0,
|
||||
"bottom": 200,
|
||||
"right": 300,
|
||||
"blendMode": "normal",
|
||||
"opacity": 1,
|
||||
"clipping": false,
|
||||
"timestamp": 1448235572.7235785,
|
||||
"transparencyProtected": true,
|
||||
"protected": {
|
||||
"transparency": true,
|
||||
"composite": false,
|
||||
"position": true
|
||||
},
|
||||
"hidden": false,
|
||||
"name": "Background",
|
||||
"nameSource": "bgnd",
|
||||
"id": 1,
|
||||
"layerColor": "none",
|
||||
"blendClippendElements": true,
|
||||
"blendInteriorElements": false,
|
||||
"knockout": false,
|
||||
"referencePoint": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"canvas": <Canvas>
|
||||
},
|
||||
```
|
||||
|
||||
- `top`, `left`, `bottom`, `right` properties specify location of layer image data withing the document. `top` specifies offset in pixel of the top of layer image data from the top edge of the document, `bottom` specifies offset of the bottom of the layer image data from the top adge of the document and similar for `left` and `right`.
|
||||
|
||||
This is necessary as layer image data can be smaller or large than the document size. This can cause in some cases the values of these fields to be negative. A value of `left: -100` means that the layer image data starts 100 pixels outside the left document edge. This can happen if you move the layer left beyond document edge in Photoshop.
|
||||
|
||||
`top` and `left` values can be ommited when writing and will be assumed to be 0. `bottom` and `right` values can be ommited and will always be ignored when writing and will instead be calculated from `canvas` (or `imageData`) width and height.
|
||||
|
||||
- `blendMode` is a layer blending mode and will be one of the following values:
|
||||
|
||||
```ts
|
||||
type BlendMode = 'pass through' | 'normal' | 'dissolve' | 'darken' |
|
||||
'multiply' | 'color burn' | 'linear burn' | 'darker color' | 'lighten'|
|
||||
'screen' | 'color dodge' | 'linear dodge' | 'lighter color' | 'overlay' |
|
||||
'soft light' | 'hard light' | 'vivid light' | 'linear light' | 'pin light' |
|
||||
'hard mix' | 'difference' | 'exclusion' | 'subtract' | 'divide' | 'hue' |
|
||||
'saturation' | 'color' | 'luminosity'
|
||||
```
|
||||
|
||||
These values correspond to naming in layer blend mode dropdown. If ommited a value of `normal` will be assumed.
|
||||
|
||||
[](/files/blend-modes.png)
|
||||
|
||||
- `canvas` (or `imageData`) see `canvas` property description in [Basic document structure](#basic-socument-structure)
|
||||
|
||||
Vector, text and smart object layers still have image data with pregenerated bitmap. You also need to provide that image data when writing PSD files.
|
||||
|
||||
Reading this property can be skipped if `skipLayerImageData: true` option is passed to `readPsd` function. This can be done to save on memory usage and processing time if layer image data is not needed.
|
||||
|
||||
- `opacity` specifies level of layer transparency (the value range is from 0 to 1). Can be ommited when writing, a default value of 1 will be assumed.
|
||||
|
||||

|
||||
|
||||
- `clipping` indicates if layer clipping is enabled (if enabled the layer is clipped to the layer below it). Can be ommited when writing, a default value of `false` will be assumed.
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
- `timestamp` timestamp of last time layer was modified (in unix time). Can be ommited when writing.
|
||||
|
||||
- `transparencyProtected` and `protected` properties specify status of various locks that you can set for each layer.
|
||||
|
||||

|
||||
|
||||
- `protected.position` indicates if moving layer is locked
|
||||
- `protected.composite` indicates if drawing on the layer is locked
|
||||
- `protected.transparency` indicates if drawing transparent pixels are locked
|
||||
|
||||
If the `transparencyProtected` is `true` but `protected.transparency` is `false` it means that the layer has "lock all" enabled. Both this fields can be ommited when writing, a values of `false` will be assumed for all of the ommited fields.
|
||||
|
||||
- `hidden` indicates if the layer is hidden. Can be ommited when writing, a value of `false` will be assumed.
|
||||
|
||||

|
||||
|
||||
- `name` name of the layer, can be any unicode string, can be empty. Can be ommited when writing, a value of `''` will be assumed.
|
||||
|
||||
- `nameSource` internal Photoshop information, can be ignored and ommited when writing.
|
||||
|
||||
- `id` unique ID number for layer, it may be missing in some PSD files. Can be ommited when writing, but if provided it has to be a unique number, if duplicate IDs are found they will be changed to a unique ones when writing the file.
|
||||
|
||||
- `layerColor` color of the layer in layer list, property will be missing or will be one of the following values:
|
||||
|
||||
```ts
|
||||
type LayerColor = 'none' | 'red' | 'orange' | 'yellow' | 'green' | 'blue' | 'violet' | 'gray'
|
||||
```
|
||||
|
||||

|
||||
|
||||
- `version` _unknown functionality_
|
||||
|
||||
- `referencePoint` _unknown functionality_
|
||||
|
||||
- `mask` Layer mask, property has the following structure.
|
||||
|
||||
```ts
|
||||
interface LayerMaskData {
|
||||
top?: number;
|
||||
left?: number;
|
||||
bottom?: number;
|
||||
right?: number;
|
||||
defaultColor?: number;
|
||||
disabled?: boolean;
|
||||
positionRelativeToLayer?: boolean;
|
||||
fromVectorData?: boolean; // set to true if the mask is generated from vector data, false if it's a bitmap provided by user
|
||||
userMaskDensity?: number;
|
||||
userMaskFeather?: number; // px
|
||||
vectorMaskDensity?: number;
|
||||
vectorMaskFeather?: number;
|
||||
canvas?: HTMLCanvasElement;
|
||||
imageData?: ImageData;
|
||||
}
|
||||
```
|
||||
|
||||

|
||||
|
||||
Similar to layer image data this data has `top`, `left`, `bottom` and `right` offsets specified.
|
||||
|
||||
`fromVectorData` Specifies if the mask image data was generated from `vectorMask`, if `fromVectorData` is set to false and both `vectorMask` and `mask` properties are present it means that the layer has 2 active masks, bitmap mask and a vector mask.
|
||||
|
||||
`mask` property will be missing when layer has no mask, it can be ommited when writing.
|
||||
|
||||
- `effects` Object describing layer "Blending Options"
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
Effects property follows the following structure:
|
||||
|
||||
```ts
|
||||
interface LayerEffectsInfo {
|
||||
disabled?: boolean; // indicates if all effects are disabled
|
||||
scale?: number;
|
||||
dropShadow?: LayerEffectShadow[];
|
||||
innerShadow?: LayerEffectShadow[];
|
||||
outerGlow?: LayerEffectsOuterGlow;
|
||||
innerGlow?: LayerEffectInnerGlow;
|
||||
bevel?: LayerEffectBevel;
|
||||
solidFill?: LayerEffectSolidFill[];
|
||||
satin?: LayerEffectSatin;
|
||||
stroke?: LayerEffectStroke[];
|
||||
gradientOverlay?: LayerEffectGradientOverlay[];
|
||||
patternOverlay?: LayerEffectPatternOverlay; // not supported yet
|
||||
}
|
||||
```
|
||||
|
||||
Some of the effects (specified here as arrays) can be specified multiple times. This is new feature, only supported in more recent versions of Photoshop.
|
||||
|
||||
This property is not present if there are not blending options set for the layer. This property can be ommited when writing.
|
||||
|
||||
- `text` text properties of text layer
|
||||
|
||||
_TODO_
|
||||
|
||||
- `patterns` _not supported yet_
|
||||
|
||||
- `vectorFill` Fill color, gradient or pattern for the vector mask. Use `type` field to distinguish between different vector fill types, like this:
|
||||
|
||||
```ts
|
||||
switch (vectorFill.type) {
|
||||
case 'color':
|
||||
// solid color fill ({ color: Color } type)
|
||||
break;
|
||||
case 'solid':
|
||||
// solid gradient fill (EffectSolidGradient type)
|
||||
break;
|
||||
case 'noise':
|
||||
// noise gradient fill (EffectNoiseGradient type)
|
||||
break;
|
||||
case 'pattern':
|
||||
// pattern fill (EffectPattern type)
|
||||
break;
|
||||
}
|
||||
```
|
||||
|
||||
- `vectorStroke` Vector stroke parameters for the vector mask. This field also contains parameters related to `vectorFill`. This property has following structure:
|
||||
|
||||
```ts
|
||||
type VectorStroke = {
|
||||
strokeEnabled?: boolean; // vector drawing has stroke
|
||||
fillEnabled?: boolean; // vector drawing has fill (specified by vectorFill property)
|
||||
lineWidth?: UnitsValue;
|
||||
lineDashOffset?: UnitsValue;
|
||||
miterLimit?: number;
|
||||
lineCapType?: LineCapType;
|
||||
lineJoinType?: LineJoinType;
|
||||
lineAlignment?: LineAlignment;
|
||||
scaleLock?: boolean;
|
||||
strokeAdjust?: boolean;
|
||||
lineDashSet?: UnitsValue[];
|
||||
blendMode?: BlendMode;
|
||||
opacity?: number;
|
||||
content?: VectorContent; // stroke color, gradient or pattern (see `vectorFill` field for more information)
|
||||
resolution?: number;
|
||||
}
|
||||
```
|
||||
|
||||
- `vectorMask` Specifies vector mask used by `vectorFill` and `vectorStroke` to draw vector images.
|
||||
|
||||
_TODO: expand this description_
|
||||
|
||||
- `usingAlignedRendering` _unknown functionality_
|
||||
|
||||
- `pathList` _not supported yet_
|
||||
|
||||
- `adjustment` indicates that the layer is an adjustment layer. Adjustment layer do not have image data. This property is not present on non-adjustment layers.
|
||||
|
||||

|
||||
|
||||
Use `type` field of the adjustment object to distinguish between different adjustment layer types.
|
||||
|
||||
```ts
|
||||
switch (adjustment.type) {
|
||||
case 'brightness/contrast':
|
||||
// handle BrightnessAdjustment layer
|
||||
break;
|
||||
case 'levels':
|
||||
// handle LevelsAdjustment layer
|
||||
break;
|
||||
// ... other cases ...
|
||||
}
|
||||
```
|
||||
|
||||
see all Adjustment layer types in [psd.ts file](/src/psd.ts)
|
||||
|
||||
- `placedLayer` indicates that this is smart object layer, see [Smart Objects section](#smart-objects) for more information. This property is only present on smart object layers.
|
||||
|
||||
- `vectorOrigination` _TODO_
|
||||
|
||||
- `compositorUsed` _internal photoshop information_
|
||||
|
||||
- `artboard` Artboard location and parameters, this property is only present when using artboards. Artbord is object is following this structure:
|
||||
|
||||
```ts
|
||||
type Artboard = {
|
||||
rect: { top: number; left: number; bottom: number; right: number; };
|
||||
guideIndices?: any[];
|
||||
presetName?: string;
|
||||
color?: Color;
|
||||
backgroundType?: number;
|
||||
}
|
||||
```
|
||||
|
||||

|
||||
|
||||
- **Advanced blending options**
|
||||
|
||||

|
||||
|
||||
- `fillOpacity`"Fill Opacity" level (value ranges from 0 to 1)
|
||||
|
||||

|
||||
- `knockout` "Knockout" value
|
||||
- `blendClippendElements` "Blend Clipped Layers as Group" value
|
||||
- `blendInteriorElements` "Blend Interior Effects as Group" value
|
||||
- `transparencyShapesLayer` "Transparency Shapes Layer" value
|
||||
|
||||
- `engineData` internal text information
|
||||
|
||||
### Group
|
||||
|
||||
Example group structure:
|
||||
|
||||
```js
|
||||
{
|
||||
"top": 0,
|
||||
"left": 0,
|
||||
"bottom": 0,
|
||||
"right": 0,
|
||||
"blendMode": "normal",
|
||||
"opacity": 1,
|
||||
"clipping": false,
|
||||
"timestamp": 1450198418.5245173,
|
||||
"transparencyProtected": false,
|
||||
"hidden": false,
|
||||
"name": "Group 1",
|
||||
"nameSource": "lset",
|
||||
"id": 5,
|
||||
"sectionDivider": {
|
||||
"type": 1,
|
||||
"key": "pass",
|
||||
"subType": 0
|
||||
},
|
||||
"protected": {
|
||||
"transparency": false,
|
||||
"composite": false,
|
||||
"position": false
|
||||
},
|
||||
"layerColor": "none",
|
||||
"referencePoint": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"opened": true,
|
||||
"children": [
|
||||
// layers here
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
Groups don't have `canvas` / `imageData` property, as you can't draw directly on a group. Groups don't have any other special layer property like `text`, `vectorFill`, `adjustment` or `placedLayer`.
|
||||
|
||||
**Group-only fields:**
|
||||
|
||||
- `children` contains list of all layers in this group. **Cannot** be ommited when writing, without this field a group will be assumed to be a regular layer. Use empty `children` array when writing empty group.
|
||||
|
||||
- `opened` indicates if the group is expanded or collapsed in the layer list. If ommited a default values of `true` will be assumed.
|
||||
|
||||

|
||||
|
||||
- `sectionDivider` internal Photoshop property, can be ignored and ommited when writing.
|
||||
|
||||
## Image Resources
|
||||
|
||||
Image resources are global document settings. Any of these settings can be ommited when writing. PSD file can have following global options:
|
||||
|
||||
- `versionInfo` Version information of Program that generated the PSD file, example value:
|
||||
|
||||
```js
|
||||
versionInfo = {
|
||||
"hasRealMergedData": true,
|
||||
"writerName": "Adobe Photoshop",
|
||||
"readerName": "Adobe Photoshop CS6",
|
||||
"fileVersion": 1
|
||||
}
|
||||
```
|
||||
|
||||
- `layerSelectionIds` list of layer IDs of selected layers, these layers will be selected when you open PSD document in Photoshop.
|
||||
|
||||
- `pixelAspectRatio` Specifies aspect ratio of the PSD document pixels, almost always 1
|
||||
|
||||
```js
|
||||
pixelAspectRatio = {
|
||||
"aspect": 1
|
||||
}
|
||||
```
|
||||
|
||||
- `gridAndGuidesInformation` Information about document guides
|
||||
|
||||

|
||||
|
||||
Example value:
|
||||
|
||||
```js
|
||||
gridAndGuidesInformation = {
|
||||
"grid": {
|
||||
"horizontal": 576,
|
||||
"vertical": 576
|
||||
},
|
||||
"guides": [
|
||||
{
|
||||
"location": 531.4375,
|
||||
"direction": "vertical" // "horizontal" or "vertical"
|
||||
},
|
||||
// ... more guides here ...
|
||||
]
|
||||
};
|
||||
```
|
||||
|
||||
- `resolutionInfo` Image resolution info, specifies physical size of the image pixels. Example value:
|
||||
|
||||
```js
|
||||
resolutionInfo: {
|
||||
"horizontalResolution": 72,
|
||||
"horizontalResolutionUnit": "PPI", // 'PPI' (pixels per inch) or 'PPCM' (pixels per centimeter)
|
||||
"widthUnit": "Inches",
|
||||
"verticalResolution": 72,
|
||||
"verticalResolutionUnit": "PPI",
|
||||
"heightUnit": "Inches" // 'Inches', 'Centimeters', 'Points', 'Picas' or 'Columns'
|
||||
},
|
||||
```
|
||||
|
||||
- `thumbnail` Canvas element with thumbnail image for the document, this property can be missing in some PSD files. This property can be ommited when writing if there's no need to support tumbnails, this field can be automatically generated from composite image data if `generateThumbnail: true` option is passed to `writePsd` function.
|
||||
|
||||
- `thumbnailRaw` This property will be used instead if `useRawThumbnail` option is specitied when reading PSD file.
|
||||
|
||||
- `xmpMetadata` XMP metadata. File info as XML description. See http://www.adobe.com/devnet/xmp/
|
||||
|
||||
- `iccUntaggedProfile` ICC Untagged Profile
|
||||
|
||||
- `printInformation`, `printScale` and `printFlags` Specifies options for printing the document.
|
||||
|
||||
- `layerState` _TODO_
|
||||
- `layersGroup` _TODO_
|
||||
- `layerGroupsEnabledId` _TODO_
|
||||
- `alphaIdentifiers` _TODO_
|
||||
- `alphaChannelNames` _TODO_
|
||||
- `globalAngle` _TODO_
|
||||
- `globalAltitude` _TODO_
|
||||
- `urlsList` _TODO_
|
||||
- `captionDigest` _TODO_
|
||||
- `backgroundColor` _TODO_
|
||||
- `idsSeedNumber` _TODO_
|
||||
- `pathSelectionState` _TODO_
|
||||
- `imageReadyVariables` _TODO_
|
||||
- `imageReadyDataSets` _TODO_
|
||||
|
||||
## Smart Objects
|
||||
|
||||
Layers with `placedLayer` property are smart object layers. `placedLayer` property has the following structure:
|
||||
|
||||
```ts
|
||||
interface PlacedLayer {
|
||||
id: string; // id of linked image file (psd.linkedFiles)
|
||||
placed?: string; // unique id
|
||||
type: PlacedLayerType;
|
||||
transform: number[]; // x, y of 4 corners of the transform
|
||||
nonAffineTransform?: number[]; // x, y of 4 corners of the transform
|
||||
width?: number;
|
||||
height?: number;
|
||||
resolution?: UnitsValue;
|
||||
warp?: Warp;
|
||||
crop?: number;
|
||||
}
|
||||
```
|
||||
|
||||
The Psd object has `linkedFiles` property, that specifies list of all files linked in smart objects. Each linked file has following structure:
|
||||
|
||||
```ts
|
||||
interface LinkedFile {
|
||||
id: string;
|
||||
name: string;
|
||||
type?: string;
|
||||
creator?: string;
|
||||
data?: Uint8Array;
|
||||
time?: Date; // for external files
|
||||
childDocumentID?: string;
|
||||
assetModTime?: number;
|
||||
assetLockedState?: number;
|
||||
}
|
||||
```
|
||||
|
||||
`id` field in `PlacedLayer` refers to the `id` in `LinkedFile`. Example values:
|
||||
|
||||
```js
|
||||
layer.placedLayer = {
|
||||
"id": "20953ddb-9391-11ec-b4f1-c15674f50bc4", // id that matches linkedFiles ID
|
||||
"placed": "20953dda-9391-11ec-b4f1-c15674f50bc4", // unique id for this object
|
||||
"type": "raster", // one of the 'unknown', 'vector', 'raster' or 'image stack'
|
||||
"transform": [ // x, y of 4 corners of the transform box
|
||||
29,
|
||||
28,
|
||||
83,
|
||||
28,
|
||||
83,
|
||||
82,
|
||||
29,
|
||||
82
|
||||
],
|
||||
"width": 32, // width and height of the target image
|
||||
"height": 32,
|
||||
"resolution": {
|
||||
"value": 299.99940490722656,
|
||||
"units": "Density"
|
||||
}
|
||||
};
|
||||
|
||||
psd.linkedFiles = [
|
||||
{
|
||||
"id": "20953ddb-9391-11ec-b4f1-c15674f50bc4",
|
||||
"name": "cat.png"
|
||||
"data": fileContentsAsUint8Array,
|
||||
}
|
||||
];
|
||||
```
|
||||
|
||||
## Units value
|
||||
|
||||
Some fields in the PSD document specity a value with units, those fields use `UnitsValue` type:
|
||||
|
||||
```ts
|
||||
interface UnitsValue {
|
||||
units: Units;
|
||||
value: number;
|
||||
}
|
||||
```
|
||||
|
||||
`value` fields can be any number value, `units` fields has to be one of the supported units: "Pixels", "Points", "Picas", "Millimeters", "Centimeters", "Inches", "None", "Density". Some fields only support some of the units, check with Photoshop for supported units.
|
||||
|
||||
Example values:
|
||||
|
||||
```ts
|
||||
var distance = { value: 5, units: "Pixels" };
|
||||
var lineWidth = { value: 3, units: "Points" };
|
||||
```
|
||||
|
||||
## Colors
|
||||
|
||||
Many fields in PSD file support passing color in different color formats (RGBA, RGB, HSB, CMYK, LAB, Grayscale) Those fields will use `Color` type which is a union of all of these color formats. The color types have following structure:
|
||||
|
||||
```ts
|
||||
type RGBA = { r: number; g: number; b: number; a: number; }; // values from 0 to 255
|
||||
type RGB = { r: number; g: number; b: number; }; // values from 0 to 255
|
||||
type HSB = { h: number; s: number; b: number; }; // values from 0 to 1
|
||||
type CMYK = { c: number; m: number; y: number; k: number; }; // values from 0 to 255
|
||||
type LAB = { l: number; a: number; b: number; }; // values `l` from 0 to 1; `a` and `b` from -1 to 1
|
||||
type Grayscale = { k: number }; // values from 0 to 255
|
||||
type Color = RGBA | RGB | HSB | CMYK | LAB | Grayscale;
|
||||
```
|
||||
|
||||
When you want to set field with a `Color` type, it's pretty straightforward, you can just choose any of the formats you like and set it on the field:
|
||||
|
||||
```ts
|
||||
strokeEffect.color = { h: 0.79, s: 0.54, b: 0.93 };
|
||||
```
|
||||
|
||||
Reading a color field is more complicated, you need to check what color format the field is in and then run correct code to handle it, here's how to do it for all color types:
|
||||
|
||||
```ts
|
||||
if ('l' in color) {
|
||||
// color is LAB
|
||||
} else if ('c' in color) {
|
||||
// color is CMYK
|
||||
} else if ('h' in color) {
|
||||
// color is HSB
|
||||
} else if ('k' in color) {
|
||||
// color is Grayscale
|
||||
} else if ('a' in color) {
|
||||
// color is RGBA
|
||||
} else {
|
||||
// color is RGB
|
||||
}
|
||||
```
|
||||
|
||||
If you expect the fields to be in one specific format you can just verity that it's correct and throw an error if it's a format that you didn't expect:
|
||||
|
||||
```ts
|
||||
// handle only RGB colors
|
||||
if ('r' in color && !('a' in color)) {
|
||||
// color is RGB
|
||||
} else {
|
||||
throw new Error('Invalid color');
|
||||
}
|
||||
```
|
11
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/TODO
generated
vendored
Normal file
11
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/TODO
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
- remove gulp
|
||||
|
||||
- can we remove sectionDivider property ?
|
||||
- can we remove nameSource property ?
|
||||
|
||||
- improve vector fill / stroke help sections
|
||||
|
||||
check: https://github.com/TheNicker/libpsd
|
||||
|
||||
- zip with prediction: https://github.com/TheNicker/libpsd/blob/master/src/psd_zip.c
|
||||
- also support saving with zip compression ?
|
132
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/abr.d.ts
generated
vendored
Normal file
132
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/abr.d.ts
generated
vendored
Normal file
@@ -0,0 +1,132 @@
|
||||
import { BlendMode, PatternInfo } from './psd';
|
||||
export interface Abr {
|
||||
brushes: Brush[];
|
||||
samples: SampleInfo[];
|
||||
patterns: PatternInfo[];
|
||||
}
|
||||
export interface SampleInfo {
|
||||
id: string;
|
||||
bounds: {
|
||||
x: number;
|
||||
y: number;
|
||||
w: number;
|
||||
h: number;
|
||||
};
|
||||
alpha: Uint8Array;
|
||||
}
|
||||
export interface BrushDynamics {
|
||||
control: 'off' | 'fade' | 'pen pressure' | 'pen tilt' | 'stylus wheel' | 'initial direction' | 'direction' | 'initial rotation' | 'rotation';
|
||||
steps: number;
|
||||
jitter: number;
|
||||
minimum: number;
|
||||
}
|
||||
export interface BrushShape {
|
||||
name?: string;
|
||||
size: number;
|
||||
angle: number;
|
||||
roundness: number;
|
||||
hardness?: number;
|
||||
spacingOn: boolean;
|
||||
spacing: number;
|
||||
flipX: boolean;
|
||||
flipY: boolean;
|
||||
sampledData?: string;
|
||||
}
|
||||
export interface Brush {
|
||||
name: string;
|
||||
shape: BrushShape;
|
||||
shapeDynamics?: {
|
||||
sizeDynamics: BrushDynamics;
|
||||
minimumDiameter: number;
|
||||
tiltScale: number;
|
||||
angleDynamics: BrushDynamics;
|
||||
roundnessDynamics: BrushDynamics;
|
||||
minimumRoundness: number;
|
||||
flipX: boolean;
|
||||
flipY: boolean;
|
||||
brushProjection: boolean;
|
||||
};
|
||||
scatter?: {
|
||||
bothAxes: boolean;
|
||||
scatterDynamics: BrushDynamics;
|
||||
countDynamics: BrushDynamics;
|
||||
count: number;
|
||||
};
|
||||
texture?: {
|
||||
id: string;
|
||||
name: string;
|
||||
invert: boolean;
|
||||
scale: number;
|
||||
brightness: number;
|
||||
contrast: number;
|
||||
blendMode: BlendMode;
|
||||
depth: number;
|
||||
depthMinimum: number;
|
||||
depthDynamics: BrushDynamics;
|
||||
};
|
||||
dualBrush?: {
|
||||
flip: boolean;
|
||||
shape: BrushShape;
|
||||
blendMode: BlendMode;
|
||||
useScatter: boolean;
|
||||
spacing: number;
|
||||
count: number;
|
||||
bothAxes: boolean;
|
||||
countDynamics: BrushDynamics;
|
||||
scatterDynamics: BrushDynamics;
|
||||
};
|
||||
colorDynamics?: {
|
||||
foregroundBackground: BrushDynamics;
|
||||
hue: number;
|
||||
saturation: number;
|
||||
brightness: number;
|
||||
purity: number;
|
||||
perTip: boolean;
|
||||
};
|
||||
transfer?: {
|
||||
flowDynamics: BrushDynamics;
|
||||
opacityDynamics: BrushDynamics;
|
||||
wetnessDynamics: BrushDynamics;
|
||||
mixDynamics: BrushDynamics;
|
||||
};
|
||||
brushPose?: {
|
||||
overrideAngle: boolean;
|
||||
overrideTiltX: boolean;
|
||||
overrideTiltY: boolean;
|
||||
overridePressure: boolean;
|
||||
pressure: number;
|
||||
tiltX: number;
|
||||
tiltY: number;
|
||||
angle: number;
|
||||
};
|
||||
noise: boolean;
|
||||
wetEdges: boolean;
|
||||
protectTexture?: boolean;
|
||||
spacing: number;
|
||||
brushGroup?: undefined;
|
||||
interpretation?: boolean;
|
||||
useBrushSize: boolean;
|
||||
toolOptions?: {
|
||||
brushPreset: boolean;
|
||||
flow: number;
|
||||
smooth: number;
|
||||
mode: BlendMode;
|
||||
opacity: number;
|
||||
smoothing: boolean;
|
||||
smoothingValue: number;
|
||||
smoothingRadiusMode: boolean;
|
||||
smoothingCatchup: boolean;
|
||||
smoothingCatchupAtEnd: boolean;
|
||||
smoothingZoomCompensation: boolean;
|
||||
pressureSmoothing: boolean;
|
||||
usePressureOverridesSize: boolean;
|
||||
usePressureOverridesOpacity: boolean;
|
||||
useLegacy: boolean;
|
||||
flowDynamics?: BrushDynamics;
|
||||
opacityDynamics?: BrushDynamics;
|
||||
sizeDynamics?: BrushDynamics;
|
||||
};
|
||||
}
|
||||
export declare function readAbr(buffer: ArrayBufferView, options?: {
|
||||
logMissingFeatures?: boolean;
|
||||
}): Abr;
|
267
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/abr.js
generated
vendored
Normal file
267
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/abr.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
25
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/additionalInfo.d.ts
generated
vendored
Normal file
25
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/additionalInfo.d.ts
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
import { LayerAdditionalInfo, BezierPath, Psd, ReadOptions, WriteOptions, BooleanOperation, LayerEffectsInfo, LayerVectorMask } from './psd';
|
||||
import { PsdReader } from './psdReader';
|
||||
import { PsdWriter } from './psdWriter';
|
||||
export interface ExtendedWriteOptions extends WriteOptions {
|
||||
layerIds: Set<number>;
|
||||
layerToId: Map<any, number>;
|
||||
}
|
||||
declare type HasMethod = (target: LayerAdditionalInfo) => boolean;
|
||||
declare type ReadMethod = (reader: PsdReader, target: LayerAdditionalInfo, left: () => number, psd: Psd, options: ReadOptions) => void;
|
||||
declare type WriteMethod = (writer: PsdWriter, target: LayerAdditionalInfo, psd: Psd, options: ExtendedWriteOptions) => void;
|
||||
export interface InfoHandler {
|
||||
key: string;
|
||||
has: HasMethod;
|
||||
read: ReadMethod;
|
||||
write: WriteMethod;
|
||||
}
|
||||
export declare const infoHandlers: InfoHandler[];
|
||||
export declare const infoHandlersMap: {
|
||||
[key: string]: InfoHandler;
|
||||
};
|
||||
export declare function readBezierKnot(reader: PsdReader, width: number, height: number): number[];
|
||||
export declare const booleanOperations: BooleanOperation[];
|
||||
export declare function readVectorMask(reader: PsdReader, vectorMask: LayerVectorMask, width: number, height: number, size: number): BezierPath[];
|
||||
export declare function hasMultiEffects(effects: LayerEffectsInfo): boolean;
|
||||
export {};
|
2039
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/additionalInfo.js
generated
vendored
Normal file
2039
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/additionalInfo.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
10
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/csh.d.ts
generated
vendored
Normal file
10
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/csh.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { LayerVectorMask } from './psd';
|
||||
export interface Csh {
|
||||
shapes: (LayerVectorMask & {
|
||||
name: string;
|
||||
id: string;
|
||||
width: number;
|
||||
height: number;
|
||||
})[];
|
||||
}
|
||||
export declare function readCsh(buffer: ArrayBufferView): Csh;
|
45
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/csh.js
generated
vendored
Normal file
45
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/csh.js
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
var __assign = (this && this.__assign) || function () {
|
||||
__assign = Object.assign || function(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
||||
t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
return __assign.apply(this, arguments);
|
||||
};
|
||||
import { readVectorMask } from './additionalInfo';
|
||||
import { readUint32, checkSignature, createReader, readPascalString, readUnicodeString } from './psdReader';
|
||||
export function readCsh(buffer) {
|
||||
var reader = createReader(buffer.buffer, buffer.byteOffset, buffer.byteLength);
|
||||
var csh = { shapes: [] };
|
||||
checkSignature(reader, 'cush');
|
||||
if (readUint32(reader) !== 2)
|
||||
throw new Error('Invalid version');
|
||||
var count = readUint32(reader);
|
||||
for (var i = 0; i < count; i++) {
|
||||
var name_1 = readUnicodeString(reader);
|
||||
while (reader.offset % 4)
|
||||
reader.offset++; // pad to 4byte bounds
|
||||
if (readUint32(reader) !== 1)
|
||||
throw new Error('Invalid shape version');
|
||||
var size = readUint32(reader);
|
||||
var end = reader.offset + size;
|
||||
var id = readPascalString(reader, 1);
|
||||
// this might not be correct ???
|
||||
var y1 = readUint32(reader);
|
||||
var x1 = readUint32(reader);
|
||||
var y2 = readUint32(reader);
|
||||
var x2 = readUint32(reader);
|
||||
var width = x2 - x1;
|
||||
var height = y2 - y1;
|
||||
var mask = { paths: [] };
|
||||
readVectorMask(reader, mask, width, height, end - reader.offset);
|
||||
csh.shapes.push(__assign({ name: name_1, id: id, width: width, height: height }, mask));
|
||||
reader.offset = end;
|
||||
}
|
||||
return csh;
|
||||
}
|
||||
|
||||
//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zmc2V0ID0gZW5kO1xyXG5cdH1cclxuXHJcblx0cmV0dXJuIGNzaDtcclxufVxyXG4iXSwic291cmNlUm9vdCI6IkM6XFxQcm9qZWN0c1xcZ2l0aHViXFxhZy1wc2RcXHNyYyJ9
|
390
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/descriptor.d.ts
generated
vendored
Normal file
390
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/descriptor.d.ts
generated
vendored
Normal file
@@ -0,0 +1,390 @@
|
||||
import { AntiAlias, BevelDirection, BevelStyle, BevelTechnique, BlendMode, Color, GlowSource, GlowTechnique, GradientStyle, InterpolationMethod, LayerEffectsInfo, LineAlignment, LineCapType, LineJoinType, Orientation, TextGridding, TimelineKeyInterpolation, TimelineTrack, TimelineTrackType, Units, UnitsValue, VectorContent, WarpStyle } from './psd';
|
||||
import { PsdReader } from './psdReader';
|
||||
import { PsdWriter } from './psdWriter';
|
||||
export declare function setLogErrors(value: boolean): void;
|
||||
export declare function readAsciiStringOrClassId(reader: PsdReader): string;
|
||||
export declare function readDescriptorStructure(reader: PsdReader): any;
|
||||
export declare function writeDescriptorStructure(writer: PsdWriter, name: string, classId: string, value: any, root: string): void;
|
||||
export declare function readVersionAndDescriptor(reader: PsdReader): any;
|
||||
export declare function writeVersionAndDescriptor(writer: PsdWriter, name: string, classID: string, descriptor: any, root?: string): void;
|
||||
export declare type DescriptorUnits = 'Angle' | 'Density' | 'Distance' | 'None' | 'Percent' | 'Pixels' | 'Millimeters' | 'Points' | 'Picas' | 'Inches' | 'Centimeters';
|
||||
export interface DescriptorUnitsValue {
|
||||
units: DescriptorUnits;
|
||||
value: number;
|
||||
}
|
||||
export declare type DescriptorColor = {
|
||||
'Rd ': number;
|
||||
'Grn ': number;
|
||||
'Bl ': number;
|
||||
} | {
|
||||
'H ': DescriptorUnitsValue;
|
||||
Strt: number;
|
||||
Brgh: number;
|
||||
} | {
|
||||
'Cyn ': number;
|
||||
Mgnt: number;
|
||||
'Ylw ': number;
|
||||
Blck: number;
|
||||
} | {
|
||||
'Gry ': number;
|
||||
} | {
|
||||
Lmnc: number;
|
||||
'A ': number;
|
||||
'B ': number;
|
||||
};
|
||||
export interface DesciptorPattern {
|
||||
'Nm ': string;
|
||||
Idnt: string;
|
||||
}
|
||||
export declare type DesciptorGradient = {
|
||||
'Nm ': string;
|
||||
GrdF: 'GrdF.CstS';
|
||||
Intr: number;
|
||||
Clrs: {
|
||||
'Clr ': DescriptorColor;
|
||||
Type: 'Clry.UsrS';
|
||||
Lctn: number;
|
||||
Mdpn: number;
|
||||
}[];
|
||||
Trns: {
|
||||
Opct: DescriptorUnitsValue;
|
||||
Lctn: number;
|
||||
Mdpn: number;
|
||||
}[];
|
||||
} | {
|
||||
GrdF: 'GrdF.ClNs';
|
||||
Smth: number;
|
||||
'Nm ': string;
|
||||
ClrS: string;
|
||||
RndS: number;
|
||||
VctC?: boolean;
|
||||
ShTr?: boolean;
|
||||
'Mnm ': number[];
|
||||
'Mxm ': number[];
|
||||
};
|
||||
export interface DescriptorColorContent {
|
||||
'Clr ': DescriptorColor;
|
||||
}
|
||||
export interface DescriptorGradientContent {
|
||||
Grad: DesciptorGradient;
|
||||
Type: string;
|
||||
Dthr?: boolean;
|
||||
Rvrs?: boolean;
|
||||
Angl?: DescriptorUnitsValue;
|
||||
'Scl '?: DescriptorUnitsValue;
|
||||
Algn?: boolean;
|
||||
Ofst?: {
|
||||
Hrzn: DescriptorUnitsValue;
|
||||
Vrtc: DescriptorUnitsValue;
|
||||
};
|
||||
}
|
||||
export interface DescriptorPatternContent {
|
||||
Ptrn: DesciptorPattern;
|
||||
Lnkd?: boolean;
|
||||
phase?: {
|
||||
Hrzn: number;
|
||||
Vrtc: number;
|
||||
};
|
||||
}
|
||||
export declare type DescriptorVectorContent = DescriptorColorContent | DescriptorGradientContent | DescriptorPatternContent;
|
||||
export interface StrokeDescriptor {
|
||||
strokeStyleVersion: number;
|
||||
strokeEnabled: boolean;
|
||||
fillEnabled: boolean;
|
||||
strokeStyleLineWidth: DescriptorUnitsValue;
|
||||
strokeStyleLineDashOffset: DescriptorUnitsValue;
|
||||
strokeStyleMiterLimit: number;
|
||||
strokeStyleLineCapType: string;
|
||||
strokeStyleLineJoinType: string;
|
||||
strokeStyleLineAlignment: string;
|
||||
strokeStyleScaleLock: boolean;
|
||||
strokeStyleStrokeAdjust: boolean;
|
||||
strokeStyleLineDashSet: DescriptorUnitsValue[];
|
||||
strokeStyleBlendMode: string;
|
||||
strokeStyleOpacity: DescriptorUnitsValue;
|
||||
strokeStyleContent: DescriptorVectorContent;
|
||||
strokeStyleResolution: number;
|
||||
}
|
||||
export interface TextDescriptor {
|
||||
'Txt ': string;
|
||||
textGridding: string;
|
||||
Ornt: string;
|
||||
AntA: string;
|
||||
TextIndex: number;
|
||||
EngineData?: Uint8Array;
|
||||
}
|
||||
export interface WarpDescriptor {
|
||||
warpStyle: string;
|
||||
warpValue: number;
|
||||
warpPerspective: number;
|
||||
warpPerspectiveOther: number;
|
||||
warpRotate: string;
|
||||
bounds?: {
|
||||
'Top ': DescriptorUnitsValue;
|
||||
Left: DescriptorUnitsValue;
|
||||
Btom: DescriptorUnitsValue;
|
||||
Rght: DescriptorUnitsValue;
|
||||
};
|
||||
uOrder: number;
|
||||
vOrder: number;
|
||||
customEnvelopeWarp?: {
|
||||
meshPoints: {
|
||||
type: 'Hrzn' | 'Vrtc';
|
||||
values: number[];
|
||||
}[];
|
||||
};
|
||||
}
|
||||
export interface QuiltWarpDescriptor extends WarpDescriptor {
|
||||
deformNumRows: number;
|
||||
deformNumCols: number;
|
||||
customEnvelopeWarp: {
|
||||
quiltSliceX: {
|
||||
type: 'quiltSliceX';
|
||||
values: number[];
|
||||
}[];
|
||||
quiltSliceY: {
|
||||
type: 'quiltSliceY';
|
||||
values: number[];
|
||||
}[];
|
||||
meshPoints: {
|
||||
type: 'Hrzn' | 'Vrtc';
|
||||
values: number[];
|
||||
}[];
|
||||
};
|
||||
}
|
||||
export interface FractionDescriptor {
|
||||
numerator: number;
|
||||
denominator: number;
|
||||
}
|
||||
export interface HrznVrtcDescriptor {
|
||||
Hrzn: number;
|
||||
Vrtc: number;
|
||||
}
|
||||
export interface FrameDescriptor {
|
||||
FrLs: number[];
|
||||
enab?: boolean;
|
||||
IMsk?: {
|
||||
Ofst: HrznVrtcDescriptor;
|
||||
};
|
||||
VMsk?: {
|
||||
Ofst: HrznVrtcDescriptor;
|
||||
};
|
||||
Ofst?: HrznVrtcDescriptor;
|
||||
FXRf?: HrznVrtcDescriptor;
|
||||
Lefx?: Lfx2Descriptor;
|
||||
blendOptions?: {
|
||||
Opct: DescriptorUnitsValue;
|
||||
};
|
||||
}
|
||||
export interface FrameListDescriptor {
|
||||
LaID: number;
|
||||
LaSt: FrameDescriptor[];
|
||||
}
|
||||
export declare function horzVrtcToXY(hv: HrznVrtcDescriptor): {
|
||||
x: number;
|
||||
y: number;
|
||||
};
|
||||
export declare function xyToHorzVrtc(xy: {
|
||||
x: number;
|
||||
y: number;
|
||||
}): HrznVrtcDescriptor;
|
||||
export declare type TimelineAnimKeyDescriptor = {
|
||||
Type: 'keyType.Opct';
|
||||
Opct: DescriptorUnitsValue;
|
||||
} | {
|
||||
Type: 'keyType.Trnf';
|
||||
'Scl ': HrznVrtcDescriptor;
|
||||
Skew: HrznVrtcDescriptor;
|
||||
rotation: number;
|
||||
translation: HrznVrtcDescriptor;
|
||||
} | {
|
||||
Type: 'keyType.Pstn';
|
||||
Hrzn: number;
|
||||
Vrtc: number;
|
||||
} | {
|
||||
Type: 'keyType.sheetStyle';
|
||||
sheetStyle: {
|
||||
Vrsn: number;
|
||||
Lefx?: Lfx2Descriptor;
|
||||
blendOptions: {};
|
||||
};
|
||||
} | {
|
||||
Type: 'keyType.globalLighting';
|
||||
gblA: number;
|
||||
globalAltitude: number;
|
||||
};
|
||||
export interface TimelineKeyDescriptor {
|
||||
Vrsn: 1;
|
||||
animInterpStyle: 'animInterpStyle.Lnr ' | 'animInterpStyle.hold';
|
||||
time: FractionDescriptor;
|
||||
animKey: TimelineAnimKeyDescriptor;
|
||||
selected: boolean;
|
||||
}
|
||||
export interface TimelineTrackDescriptor {
|
||||
trackID: 'stdTrackID.globalLightingTrack' | 'stdTrackID.opacityTrack' | 'stdTrackID.styleTrack' | 'stdTrackID.sheetTransformTrack' | 'stdTrackID.sheetPositionTrack';
|
||||
Vrsn: 1;
|
||||
enab: boolean;
|
||||
Effc: boolean;
|
||||
effectParams?: {
|
||||
keyList: TimelineKeyDescriptor[];
|
||||
fillCanvas: boolean;
|
||||
zoomOrigin: number;
|
||||
};
|
||||
keyList: TimelineKeyDescriptor[];
|
||||
}
|
||||
export interface TimeScopeDescriptor {
|
||||
Vrsn: 1;
|
||||
Strt: FractionDescriptor;
|
||||
duration: FractionDescriptor;
|
||||
inTime: FractionDescriptor;
|
||||
outTime: FractionDescriptor;
|
||||
}
|
||||
export interface TimelineDescriptor {
|
||||
Vrsn: 1;
|
||||
timeScope: TimeScopeDescriptor;
|
||||
autoScope: boolean;
|
||||
audioLevel: number;
|
||||
LyrI: number;
|
||||
trackList?: TimelineTrackDescriptor[];
|
||||
}
|
||||
export interface EffectDescriptor extends Partial<DescriptorGradientContent>, Partial<DescriptorPatternContent> {
|
||||
enab?: boolean;
|
||||
Styl: string;
|
||||
PntT?: string;
|
||||
'Md '?: string;
|
||||
Opct?: DescriptorUnitsValue;
|
||||
'Sz '?: DescriptorUnitsValue;
|
||||
'Clr '?: DescriptorColor;
|
||||
present?: boolean;
|
||||
showInDialog?: boolean;
|
||||
overprint?: boolean;
|
||||
}
|
||||
export interface Lfx2Descriptor {
|
||||
'Scl '?: DescriptorUnitsValue;
|
||||
masterFXSwitch?: boolean;
|
||||
DrSh?: EffectDescriptor;
|
||||
IrSh?: EffectDescriptor;
|
||||
OrGl?: EffectDescriptor;
|
||||
IrGl?: EffectDescriptor;
|
||||
ebbl?: EffectDescriptor;
|
||||
SoFi?: EffectDescriptor;
|
||||
patternFill?: EffectDescriptor;
|
||||
GrFl?: EffectDescriptor;
|
||||
ChFX?: EffectDescriptor;
|
||||
FrFX?: EffectDescriptor;
|
||||
}
|
||||
export interface LmfxDescriptor {
|
||||
'Scl '?: DescriptorUnitsValue;
|
||||
masterFXSwitch?: boolean;
|
||||
numModifyingFX?: number;
|
||||
OrGl?: EffectDescriptor;
|
||||
IrGl?: EffectDescriptor;
|
||||
ebbl?: EffectDescriptor;
|
||||
ChFX?: EffectDescriptor;
|
||||
dropShadowMulti?: EffectDescriptor[];
|
||||
innerShadowMulti?: EffectDescriptor[];
|
||||
solidFillMulti?: EffectDescriptor[];
|
||||
gradientFillMulti?: EffectDescriptor[];
|
||||
frameFXMulti?: EffectDescriptor[];
|
||||
patternFill?: EffectDescriptor;
|
||||
}
|
||||
export declare function serializeEffects(e: LayerEffectsInfo, log: boolean, multi: boolean): Lfx2Descriptor & LmfxDescriptor;
|
||||
export declare function parseEffects(info: Lfx2Descriptor & LmfxDescriptor, log: boolean): LayerEffectsInfo;
|
||||
export declare function parseTrackList(trackList: TimelineTrackDescriptor[], logMissingFeatures: boolean): TimelineTrack[];
|
||||
export declare function serializeTrackList(tracks: TimelineTrack[]): TimelineTrackDescriptor[];
|
||||
export declare function parseVectorContent(descriptor: DescriptorVectorContent): VectorContent;
|
||||
export declare function serializeVectorContent(content: VectorContent): {
|
||||
descriptor: DescriptorVectorContent;
|
||||
key: string;
|
||||
};
|
||||
export declare function parseColor(color: DescriptorColor): Color;
|
||||
export declare function serializeColor(color: Color | undefined): DescriptorColor;
|
||||
export declare function parseAngle(x: DescriptorUnitsValue): number;
|
||||
export declare function parsePercent(x: DescriptorUnitsValue | undefined): number;
|
||||
export declare function parsePercentOrAngle(x: DescriptorUnitsValue | undefined): number;
|
||||
export declare function parseUnits({ units, value }: DescriptorUnitsValue): UnitsValue;
|
||||
export declare function parseUnitsOrNumber(value: DescriptorUnitsValue | number, units?: Units): UnitsValue;
|
||||
export declare function parseUnitsToNumber({ units, value }: DescriptorUnitsValue, expectedUnits: string): number;
|
||||
export declare function unitsAngle(value: number | undefined): DescriptorUnitsValue;
|
||||
export declare function unitsPercent(value: number | undefined): DescriptorUnitsValue;
|
||||
export declare function unitsValue(x: UnitsValue | undefined, key: string): DescriptorUnitsValue;
|
||||
export declare const textGridding: {
|
||||
decode: (val: string) => TextGridding;
|
||||
encode: (val: TextGridding | undefined) => string;
|
||||
};
|
||||
export declare const Ornt: {
|
||||
decode: (val: string) => Orientation;
|
||||
encode: (val: Orientation | undefined) => string;
|
||||
};
|
||||
export declare const Annt: {
|
||||
decode: (val: string) => AntiAlias;
|
||||
encode: (val: AntiAlias | undefined) => string;
|
||||
};
|
||||
export declare const warpStyle: {
|
||||
decode: (val: string) => WarpStyle;
|
||||
encode: (val: WarpStyle | undefined) => string;
|
||||
};
|
||||
export declare const BlnM: {
|
||||
decode: (val: string) => BlendMode;
|
||||
encode: (val: BlendMode | undefined) => string;
|
||||
};
|
||||
export declare const BESl: {
|
||||
decode: (val: string) => BevelStyle;
|
||||
encode: (val: BevelStyle | undefined) => string;
|
||||
};
|
||||
export declare const bvlT: {
|
||||
decode: (val: string) => BevelTechnique;
|
||||
encode: (val: BevelTechnique | undefined) => string;
|
||||
};
|
||||
export declare const BESs: {
|
||||
decode: (val: string) => BevelDirection;
|
||||
encode: (val: BevelDirection | undefined) => string;
|
||||
};
|
||||
export declare const BETE: {
|
||||
decode: (val: string) => GlowTechnique;
|
||||
encode: (val: GlowTechnique | undefined) => string;
|
||||
};
|
||||
export declare const IGSr: {
|
||||
decode: (val: string) => GlowSource;
|
||||
encode: (val: GlowSource | undefined) => string;
|
||||
};
|
||||
export declare const GrdT: {
|
||||
decode: (val: string) => GradientStyle;
|
||||
encode: (val: GradientStyle | undefined) => string;
|
||||
};
|
||||
export declare const animInterpStyleEnum: {
|
||||
decode: (val: string) => TimelineKeyInterpolation;
|
||||
encode: (val: TimelineKeyInterpolation | undefined) => string;
|
||||
};
|
||||
export declare const stdTrackID: {
|
||||
decode: (val: string) => TimelineTrackType;
|
||||
encode: (val: TimelineTrackType | undefined) => string;
|
||||
};
|
||||
export declare const gradientInterpolationMethodType: {
|
||||
decode: (val: string) => InterpolationMethod;
|
||||
encode: (val: InterpolationMethod | undefined) => string;
|
||||
};
|
||||
export declare const ClrS: {
|
||||
decode: (val: string) => "rgb" | "hsb" | "lab";
|
||||
encode: (val: "rgb" | "hsb" | "lab" | undefined) => string;
|
||||
};
|
||||
export declare const FStl: {
|
||||
decode: (val: string) => "center" | "inside" | "outside";
|
||||
encode: (val: "center" | "inside" | "outside" | undefined) => string;
|
||||
};
|
||||
export declare const FrFl: {
|
||||
decode: (val: string) => "color" | "pattern" | "gradient";
|
||||
encode: (val: "color" | "pattern" | "gradient" | undefined) => string;
|
||||
};
|
||||
export declare const strokeStyleLineCapType: {
|
||||
decode: (val: string) => LineCapType;
|
||||
encode: (val: LineCapType | undefined) => string;
|
||||
};
|
||||
export declare const strokeStyleLineJoinType: {
|
||||
decode: (val: string) => LineJoinType;
|
||||
encode: (val: LineJoinType | undefined) => string;
|
||||
};
|
||||
export declare const strokeStyleLineAlignment: {
|
||||
decode: (val: string) => LineAlignment;
|
||||
encode: (val: LineAlignment | undefined) => string;
|
||||
};
|
1616
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/descriptor.js
generated
vendored
Normal file
1616
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/descriptor.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
5
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/effectsHelpers.d.ts
generated
vendored
Normal file
5
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/effectsHelpers.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import { LayerEffectsInfo } from './psd';
|
||||
import { PsdReader } from './psdReader';
|
||||
import { PsdWriter } from './psdWriter';
|
||||
export declare function readEffects(reader: PsdReader): LayerEffectsInfo;
|
||||
export declare function writeEffects(writer: PsdWriter, effects: LayerEffectsInfo): void;
|
305
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/effectsHelpers.js
generated
vendored
Normal file
305
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/effectsHelpers.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
2
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/engineData.d.ts
generated
vendored
Normal file
2
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/engineData.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export declare function parseEngineData(data: number[] | Uint8Array): any;
|
||||
export declare function serializeEngineData(data: any, condensed?: boolean): Uint8Array;
|
333
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/engineData.js
generated
vendored
Normal file
333
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/engineData.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
93
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/helpers.d.ts
generated
vendored
Normal file
93
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/helpers.d.ts
generated
vendored
Normal file
@@ -0,0 +1,93 @@
|
||||
import { Layer, BlendMode, LayerColor } from './psd';
|
||||
export declare const MOCK_HANDLERS = false;
|
||||
export declare const RAW_IMAGE_DATA = false;
|
||||
export declare const fromBlendMode: {
|
||||
[key: string]: string;
|
||||
};
|
||||
export declare const toBlendMode: {
|
||||
[key: string]: BlendMode;
|
||||
};
|
||||
export declare const layerColors: LayerColor[];
|
||||
export declare const largeAdditionalInfoKeys: string[];
|
||||
export interface Dict {
|
||||
[key: string]: string;
|
||||
}
|
||||
export declare function revMap(map: Dict): Dict;
|
||||
export declare function createEnum<T>(prefix: string, def: string, map: Dict): {
|
||||
decode: (val: string) => T;
|
||||
encode: (val: T | undefined) => string;
|
||||
};
|
||||
export declare const enum ColorSpace {
|
||||
RGB = 0,
|
||||
HSB = 1,
|
||||
CMYK = 2,
|
||||
Lab = 7,
|
||||
Grayscale = 8
|
||||
}
|
||||
export declare const enum LayerMaskFlags {
|
||||
PositionRelativeToLayer = 1,
|
||||
LayerMaskDisabled = 2,
|
||||
InvertLayerMaskWhenBlending = 4,
|
||||
LayerMaskFromRenderingOtherData = 8,
|
||||
MaskHasParametersAppliedToIt = 16
|
||||
}
|
||||
export declare const enum MaskParams {
|
||||
UserMaskDensity = 1,
|
||||
UserMaskFeather = 2,
|
||||
VectorMaskDensity = 4,
|
||||
VectorMaskFeather = 8
|
||||
}
|
||||
export declare const enum ChannelID {
|
||||
Color0 = 0,
|
||||
Color1 = 1,
|
||||
Color2 = 2,
|
||||
Color3 = 3,
|
||||
Transparency = -1,
|
||||
UserMask = -2,
|
||||
RealUserMask = -3
|
||||
}
|
||||
export declare const enum Compression {
|
||||
RawData = 0,
|
||||
RleCompressed = 1,
|
||||
ZipWithoutPrediction = 2,
|
||||
ZipWithPrediction = 3
|
||||
}
|
||||
export interface ChannelData {
|
||||
channelId: ChannelID;
|
||||
compression: Compression;
|
||||
buffer: Uint8Array | undefined;
|
||||
length: number;
|
||||
}
|
||||
export interface Bounds {
|
||||
top: number;
|
||||
left: number;
|
||||
right: number;
|
||||
bottom: number;
|
||||
}
|
||||
export interface LayerChannelData {
|
||||
layer: Layer;
|
||||
channels: ChannelData[];
|
||||
top: number;
|
||||
left: number;
|
||||
right: number;
|
||||
bottom: number;
|
||||
mask?: Bounds;
|
||||
}
|
||||
export declare type PixelArray = Uint8ClampedArray | Uint8Array;
|
||||
export interface PixelData {
|
||||
data: PixelArray;
|
||||
width: number;
|
||||
height: number;
|
||||
}
|
||||
export declare function offsetForChannel(channelId: ChannelID, cmyk: boolean): number;
|
||||
export declare function clamp(value: number, min: number, max: number): number;
|
||||
export declare function hasAlpha(data: PixelData): boolean;
|
||||
export declare function resetImageData({ data }: PixelData): void;
|
||||
export declare function decodeBitmap(input: PixelArray, output: PixelArray, width: number, height: number): void;
|
||||
export declare function writeDataRaw(data: PixelData, offset: number, width: number, height: number): Uint8Array | undefined;
|
||||
export declare function writeDataRLE(buffer: Uint8Array, { data, width, height }: PixelData, offsets: number[], large: boolean): Uint8Array | undefined;
|
||||
export declare function writeDataZipWithoutPrediction({ data, width, height }: PixelData, offsets: number[]): Uint8Array;
|
||||
export declare let createCanvas: (width: number, height: number) => HTMLCanvasElement;
|
||||
export declare let createCanvasFromData: (data: Uint8Array) => HTMLCanvasElement;
|
||||
export declare let createImageData: (width: number, height: number) => ImageData;
|
||||
export declare function initializeCanvas(createCanvasMethod: (width: number, height: number) => HTMLCanvasElement, createCanvasFromDataMethod?: (data: Uint8Array) => HTMLCanvasElement, createImageDataMethod?: (width: number, height: number) => ImageData): void;
|
316
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/helpers.js
generated
vendored
Normal file
316
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/helpers.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
13
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/imageResources.d.ts
generated
vendored
Normal file
13
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/imageResources.d.ts
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
import { ImageResources, ReadOptions } from './psd';
|
||||
import { PsdReader } from './psdReader';
|
||||
import { PsdWriter } from './psdWriter';
|
||||
export interface ResourceHandler {
|
||||
key: number;
|
||||
has: (target: ImageResources) => boolean;
|
||||
read: (reader: PsdReader, target: ImageResources, left: () => number, options: ReadOptions) => void;
|
||||
write: (writer: PsdWriter, target: ImageResources) => void;
|
||||
}
|
||||
export declare const resourceHandlers: ResourceHandler[];
|
||||
export declare const resourceHandlersMap: {
|
||||
[key: number]: ResourceHandler;
|
||||
};
|
785
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/imageResources.js
generated
vendored
Normal file
785
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/imageResources.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
20
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/index.d.ts
generated
vendored
Normal file
20
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
/// <reference types="node" />
|
||||
import { Psd, ReadOptions, WriteOptions } from './psd';
|
||||
import { PsdWriter } from './psdWriter';
|
||||
import { PsdReader } from './psdReader';
|
||||
export * from './abr';
|
||||
export * from './csh';
|
||||
export { initializeCanvas } from './helpers';
|
||||
export * from './psd';
|
||||
import { fromByteArray } from 'base64-js';
|
||||
export { PsdReader, PsdWriter };
|
||||
interface BufferLike {
|
||||
buffer: ArrayBuffer;
|
||||
byteOffset: number;
|
||||
byteLength: number;
|
||||
}
|
||||
export declare const byteArrayToBase64: typeof fromByteArray;
|
||||
export declare function readPsd(buffer: ArrayBuffer | BufferLike, options?: ReadOptions): Psd;
|
||||
export declare function writePsd(psd: Psd, options?: WriteOptions): ArrayBuffer;
|
||||
export declare function writePsdUint8Array(psd: Psd, options?: WriteOptions): Uint8Array;
|
||||
export declare function writePsdBuffer(psd: Psd, options?: WriteOptions): Buffer;
|
32
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/index.js
generated
vendored
Normal file
32
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/index.js
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
import { writePsd as writePsdInternal, getWriterBuffer, createWriter, getWriterBufferNoCopy } from './psdWriter';
|
||||
import { readPsd as readPsdInternal, createReader } from './psdReader';
|
||||
export * from './abr';
|
||||
export * from './csh';
|
||||
export { initializeCanvas } from './helpers';
|
||||
export * from './psd';
|
||||
import { fromByteArray } from 'base64-js';
|
||||
export var byteArrayToBase64 = fromByteArray;
|
||||
export function readPsd(buffer, options) {
|
||||
var reader = 'buffer' in buffer ?
|
||||
createReader(buffer.buffer, buffer.byteOffset, buffer.byteLength) :
|
||||
createReader(buffer);
|
||||
return readPsdInternal(reader, options);
|
||||
}
|
||||
export function writePsd(psd, options) {
|
||||
var writer = createWriter();
|
||||
writePsdInternal(writer, psd, options);
|
||||
return getWriterBuffer(writer);
|
||||
}
|
||||
export function writePsdUint8Array(psd, options) {
|
||||
var writer = createWriter();
|
||||
writePsdInternal(writer, psd, options);
|
||||
return getWriterBufferNoCopy(writer);
|
||||
}
|
||||
export function writePsdBuffer(psd, options) {
|
||||
if (typeof Buffer === 'undefined') {
|
||||
throw new Error('Buffer not supported on this platform');
|
||||
}
|
||||
return Buffer.from(writePsdUint8Array(psd, options));
|
||||
}
|
||||
|
||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sRUFBYSxRQUFRLElBQUksZ0JBQWdCLEVBQUUsZUFBZSxFQUFFLFlBQVksRUFBRSxxQkFBcUIsRUFBRSxNQUFNLGFBQWEsQ0FBQztBQUM1SCxPQUFPLEVBQWEsT0FBTyxJQUFJLGVBQWUsRUFBRSxZQUFZLEVBQUUsTUFBTSxhQUFhLENBQUM7QUFDbEYsY0FBYyxPQUFPLENBQUM7QUFDdEIsY0FBYyxPQUFPLENBQUM7QUFDdEIsT0FBTyxFQUFFLGdCQUFnQixFQUFFLE1BQU0sV0FBVyxDQUFDO0FBQzdDLGNBQWMsT0FBTyxDQUFDO0FBQ3RCLE9BQU8sRUFBRSxhQUFhLEVBQUUsTUFBTSxXQUFXLENBQUM7QUFTMUMsTUFBTSxDQUFDLElBQU0saUJBQWlCLEdBQUcsYUFBYSxDQUFDO0FBRS9DLE1BQU0sVUFBVSxPQUFPLENBQUMsTUFBZ0MsRUFBRSxPQUFxQjtJQUM5RSxJQUFNLE1BQU0sR0FBRyxRQUFRLElBQUksTUFBTSxDQUFDLENBQ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RodWJcXGFnLXBzZFxcc3JjIn0=
|
1
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/initializeCanvas.d.ts
generated
vendored
Normal file
1
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/initializeCanvas.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare function initialize(): void;
|
23
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/initializeCanvas.js
generated
vendored
Normal file
23
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/initializeCanvas.js
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
import { createCanvas } from 'canvas';
|
||||
import { initializeCanvas } from './index';
|
||||
import { decodeJpeg } from './jpeg';
|
||||
function createCanvasFromData(data) {
|
||||
var canvas = createCanvas(100, 100);
|
||||
try {
|
||||
var context_1 = canvas.getContext('2d');
|
||||
var imageData = decodeJpeg(data, function (w, h) { return context_1.createImageData(w, h); });
|
||||
canvas.width = imageData.width;
|
||||
canvas.height = imageData.height;
|
||||
context_1.putImageData(imageData, 0, 0);
|
||||
}
|
||||
catch (e) {
|
||||
console.error('JPEG decompression error', e.message);
|
||||
}
|
||||
return canvas;
|
||||
}
|
||||
initializeCanvas(createCanvas, createCanvasFromData);
|
||||
export function initialize() {
|
||||
initializeCanvas(createCanvas, createCanvasFromData);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluaXRpYWxpemVDYW52YXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFlBQVksRUFBRSxNQUFNLFFBQVEsQ0FBQztBQUN0QyxPQUFPLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxTQUFTLENBQUM7QUFDM0MsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLFFBQVEsQ0FBQztBQUVwQyxTQUFTLG9CQUFvQix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ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/jpeg.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare function decodeJpeg(encoded: Uint8Array, createImageData: (width: number, height: number) => ImageData): ImageData;
|
1019
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/jpeg.js
generated
vendored
Normal file
1019
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/jpeg.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1147
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/psd.d.ts
generated
vendored
Normal file
1147
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/psd.d.ts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
20
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/psd.js
generated
vendored
Normal file
20
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/psd.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
36
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/psdReader.d.ts
generated
vendored
Normal file
36
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/psdReader.d.ts
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
import { Psd, ColorMode, ReadOptions, Color, PatternInfo } from './psd';
|
||||
import { PixelData } from './helpers';
|
||||
export declare const supportedColorModes: ColorMode[];
|
||||
export interface PsdReader {
|
||||
offset: number;
|
||||
view: DataView;
|
||||
strict: boolean;
|
||||
debug: boolean;
|
||||
}
|
||||
export declare function createReader(buffer: ArrayBuffer, offset?: number, length?: number): PsdReader;
|
||||
export declare function warnOrThrow(reader: PsdReader, message: string): void;
|
||||
export declare function readUint8(reader: PsdReader): number;
|
||||
export declare function peekUint8(reader: PsdReader): number;
|
||||
export declare function readInt16(reader: PsdReader): number;
|
||||
export declare function readUint16(reader: PsdReader): number;
|
||||
export declare function readInt32(reader: PsdReader): number;
|
||||
export declare function readInt32LE(reader: PsdReader): number;
|
||||
export declare function readUint32(reader: PsdReader): number;
|
||||
export declare function readFloat32(reader: PsdReader): number;
|
||||
export declare function readFloat64(reader: PsdReader): number;
|
||||
export declare function readFixedPoint32(reader: PsdReader): number;
|
||||
export declare function readFixedPointPath32(reader: PsdReader): number;
|
||||
export declare function readBytes(reader: PsdReader, length: number): Uint8Array;
|
||||
export declare function readSignature(reader: PsdReader): string;
|
||||
export declare function readPascalString(reader: PsdReader, padTo: number): string;
|
||||
export declare function readUnicodeString(reader: PsdReader): string;
|
||||
export declare function readUnicodeStringWithLength(reader: PsdReader, length: number): string;
|
||||
export declare function readAsciiString(reader: PsdReader, length: number): string;
|
||||
export declare function skipBytes(reader: PsdReader, count: number): void;
|
||||
export declare function checkSignature(reader: PsdReader, a: string, b?: string): void;
|
||||
export declare function readPsd(reader: PsdReader, options?: ReadOptions): Psd;
|
||||
export declare function readDataZipWithoutPrediction(reader: PsdReader, length: number, pixelData: PixelData | undefined, width: number, height: number, step: number, offset: number): void;
|
||||
export declare function readDataRLE(reader: PsdReader, pixelData: PixelData | undefined, _width: number, height: number, step: number, offsets: number[], large: boolean): void;
|
||||
export declare function readSection<T>(reader: PsdReader, round: number, func: (left: () => number) => T, skipEmpty?: boolean, eightBytes?: boolean): T | undefined;
|
||||
export declare function readColor(reader: PsdReader): Color;
|
||||
export declare function readPattern(reader: PsdReader): PatternInfo;
|
929
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/psdReader.js
generated
vendored
Normal file
929
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/psdReader.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
27
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/psdWriter.d.ts
generated
vendored
Normal file
27
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/psdWriter.d.ts
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
import { Psd, WriteOptions, Color } from './psd';
|
||||
export interface PsdWriter {
|
||||
offset: number;
|
||||
buffer: ArrayBuffer;
|
||||
view: DataView;
|
||||
}
|
||||
export declare function createWriter(size?: number): PsdWriter;
|
||||
export declare function getWriterBuffer(writer: PsdWriter): ArrayBuffer;
|
||||
export declare function getWriterBufferNoCopy(writer: PsdWriter): Uint8Array;
|
||||
export declare function writeUint8(writer: PsdWriter, value: number): void;
|
||||
export declare function writeInt16(writer: PsdWriter, value: number): void;
|
||||
export declare function writeUint16(writer: PsdWriter, value: number): void;
|
||||
export declare function writeInt32(writer: PsdWriter, value: number): void;
|
||||
export declare function writeUint32(writer: PsdWriter, value: number): void;
|
||||
export declare function writeFloat32(writer: PsdWriter, value: number): void;
|
||||
export declare function writeFloat64(writer: PsdWriter, value: number): void;
|
||||
export declare function writeFixedPoint32(writer: PsdWriter, value: number): void;
|
||||
export declare function writeFixedPointPath32(writer: PsdWriter, value: number): void;
|
||||
export declare function writeBytes(writer: PsdWriter, buffer: Uint8Array | undefined): void;
|
||||
export declare function writeZeros(writer: PsdWriter, count: number): void;
|
||||
export declare function writeSignature(writer: PsdWriter, signature: string): void;
|
||||
export declare function writePascalString(writer: PsdWriter, text: string, padTo: number): void;
|
||||
export declare function writeUnicodeString(writer: PsdWriter, text: string): void;
|
||||
export declare function writeUnicodeStringWithPadding(writer: PsdWriter, text: string): void;
|
||||
export declare function writeSection(writer: PsdWriter, round: number, func: () => void, writeTotalLength?: boolean, large?: boolean): void;
|
||||
export declare function writePsd(writer: PsdWriter, psd: Psd, options?: WriteOptions): void;
|
||||
export declare function writeColor(writer: PsdWriter, color: Color | undefined): void;
|
666
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/psdWriter.js
generated
vendored
Normal file
666
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/psdWriter.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
168
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/text.d.ts
generated
vendored
Normal file
168
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/text.d.ts
generated
vendored
Normal file
@@ -0,0 +1,168 @@
|
||||
import { LayerTextData } from './psd';
|
||||
interface Adjustments {
|
||||
Axis: number[];
|
||||
XY: number[];
|
||||
}
|
||||
interface TypeValues {
|
||||
Type: number;
|
||||
Values: number[];
|
||||
}
|
||||
interface ParagraphProperties {
|
||||
Justification?: number;
|
||||
FirstLineIndent?: number;
|
||||
StartIndent?: number;
|
||||
EndIndent?: number;
|
||||
SpaceBefore?: number;
|
||||
SpaceAfter?: number;
|
||||
AutoHyphenate?: boolean;
|
||||
HyphenatedWordSize?: number;
|
||||
PreHyphen?: number;
|
||||
PostHyphen?: number;
|
||||
ConsecutiveHyphens?: number;
|
||||
Zone?: number;
|
||||
WordSpacing?: number[];
|
||||
LetterSpacing?: number[];
|
||||
GlyphSpacing?: number[];
|
||||
AutoLeading?: number;
|
||||
LeadingType?: number;
|
||||
Hanging?: boolean;
|
||||
Burasagari?: boolean;
|
||||
KinsokuOrder?: number;
|
||||
EveryLineComposer?: boolean;
|
||||
}
|
||||
interface ParagraphSheet {
|
||||
Name?: string;
|
||||
DefaultStyleSheet: number;
|
||||
Properties: ParagraphProperties;
|
||||
}
|
||||
interface StyleSheetData {
|
||||
Font?: number;
|
||||
FontSize?: number;
|
||||
FauxBold?: boolean;
|
||||
FauxItalic?: boolean;
|
||||
AutoLeading?: boolean;
|
||||
Leading?: number;
|
||||
HorizontalScale?: number;
|
||||
VerticalScale?: number;
|
||||
Tracking?: number;
|
||||
AutoKerning?: boolean;
|
||||
Kerning?: number;
|
||||
BaselineShift?: number;
|
||||
FontCaps?: number;
|
||||
FontBaseline?: number;
|
||||
Underline?: boolean;
|
||||
Strikethrough?: boolean;
|
||||
Ligatures?: boolean;
|
||||
DLigatures?: boolean;
|
||||
BaselineDirection?: number;
|
||||
Tsume?: number;
|
||||
StyleRunAlignment?: number;
|
||||
Language?: number;
|
||||
NoBreak?: boolean;
|
||||
FillColor?: TypeValues;
|
||||
StrokeColor?: TypeValues;
|
||||
FillFlag?: boolean;
|
||||
StrokeFlag?: boolean;
|
||||
FillFirst?: boolean;
|
||||
YUnderline?: number;
|
||||
OutlineWidth?: number;
|
||||
CharacterDirection?: number;
|
||||
HindiNumbers?: boolean;
|
||||
Kashida?: number;
|
||||
DiacriticPos?: number;
|
||||
}
|
||||
interface FontSet {
|
||||
Name: string;
|
||||
Script: number;
|
||||
FontType: number;
|
||||
Synthetic: number;
|
||||
}
|
||||
interface ResourceDict {
|
||||
KinsokuSet: any[];
|
||||
MojiKumiSet: any[];
|
||||
TheNormalStyleSheet: number;
|
||||
TheNormalParagraphSheet: number;
|
||||
ParagraphSheetSet: ParagraphSheet[];
|
||||
StyleSheetSet: {
|
||||
Name: string;
|
||||
StyleSheetData: StyleSheetData;
|
||||
}[];
|
||||
FontSet: FontSet[];
|
||||
SuperscriptSize: number;
|
||||
SuperscriptPosition: number;
|
||||
SubscriptSize: number;
|
||||
SubscriptPosition: number;
|
||||
SmallCapSize: number;
|
||||
}
|
||||
interface ParagraphRun {
|
||||
ParagraphSheet: ParagraphSheet;
|
||||
Adjustments: Adjustments;
|
||||
}
|
||||
interface StyleRun {
|
||||
StyleSheet: {
|
||||
StyleSheetData: StyleSheetData;
|
||||
};
|
||||
}
|
||||
interface PhotoshopNode {
|
||||
ShapeType?: number;
|
||||
PointBase?: number[];
|
||||
BoxBounds?: number[];
|
||||
Base?: {
|
||||
ShapeType: number;
|
||||
TransformPoint0: number[];
|
||||
TransformPoint1: number[];
|
||||
TransformPoint2: number[];
|
||||
};
|
||||
}
|
||||
interface EngineData {
|
||||
EngineDict: {
|
||||
Editor: {
|
||||
Text: string;
|
||||
};
|
||||
ParagraphRun: {
|
||||
DefaultRunData: ParagraphRun;
|
||||
RunArray: ParagraphRun[];
|
||||
RunLengthArray: number[];
|
||||
IsJoinable: number;
|
||||
};
|
||||
StyleRun: {
|
||||
DefaultRunData: StyleRun;
|
||||
RunArray: StyleRun[];
|
||||
RunLengthArray: number[];
|
||||
IsJoinable: number;
|
||||
};
|
||||
GridInfo: {
|
||||
GridIsOn: boolean;
|
||||
ShowGrid: boolean;
|
||||
GridSize: number;
|
||||
GridLeading: number;
|
||||
GridColor: TypeValues;
|
||||
GridLeadingFillColor: TypeValues;
|
||||
AlignLineHeightToGridFlags: boolean;
|
||||
};
|
||||
AntiAlias: number;
|
||||
UseFractionalGlyphWidths: boolean;
|
||||
Rendered?: {
|
||||
Version: number;
|
||||
Shapes?: {
|
||||
WritingDirection: number;
|
||||
Children?: {
|
||||
ShapeType?: number;
|
||||
Procession: number;
|
||||
Lines: {
|
||||
WritingDirection: number;
|
||||
Children: any[];
|
||||
};
|
||||
Cookie?: {
|
||||
Photoshop?: PhotoshopNode;
|
||||
};
|
||||
}[];
|
||||
};
|
||||
};
|
||||
};
|
||||
ResourceDict: ResourceDict;
|
||||
DocumentResources: ResourceDict;
|
||||
}
|
||||
export declare function decodeEngineData(engineData: EngineData): LayerTextData;
|
||||
export declare function encodeEngineData(data: LayerTextData): EngineData;
|
||||
export {};
|
553
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/text.js
generated
vendored
Normal file
553
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/text.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
5
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/utf8.d.ts
generated
vendored
Normal file
5
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/utf8.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
/// <reference types="node" />
|
||||
export declare function stringLengthInBytes(value: string): number;
|
||||
export declare function encodeStringTo(buffer: Uint8Array | Buffer, offset: number, value: string): number;
|
||||
export declare function encodeString(value: string): Uint8Array;
|
||||
export declare function decodeString(value: Uint8Array): string;
|
146
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/utf8.js
generated
vendored
Normal file
146
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist-es/utf8.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
132
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/abr.d.ts
generated
vendored
Normal file
132
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/abr.d.ts
generated
vendored
Normal file
@@ -0,0 +1,132 @@
|
||||
import { BlendMode, PatternInfo } from './psd';
|
||||
export interface Abr {
|
||||
brushes: Brush[];
|
||||
samples: SampleInfo[];
|
||||
patterns: PatternInfo[];
|
||||
}
|
||||
export interface SampleInfo {
|
||||
id: string;
|
||||
bounds: {
|
||||
x: number;
|
||||
y: number;
|
||||
w: number;
|
||||
h: number;
|
||||
};
|
||||
alpha: Uint8Array;
|
||||
}
|
||||
export interface BrushDynamics {
|
||||
control: 'off' | 'fade' | 'pen pressure' | 'pen tilt' | 'stylus wheel' | 'initial direction' | 'direction' | 'initial rotation' | 'rotation';
|
||||
steps: number;
|
||||
jitter: number;
|
||||
minimum: number;
|
||||
}
|
||||
export interface BrushShape {
|
||||
name?: string;
|
||||
size: number;
|
||||
angle: number;
|
||||
roundness: number;
|
||||
hardness?: number;
|
||||
spacingOn: boolean;
|
||||
spacing: number;
|
||||
flipX: boolean;
|
||||
flipY: boolean;
|
||||
sampledData?: string;
|
||||
}
|
||||
export interface Brush {
|
||||
name: string;
|
||||
shape: BrushShape;
|
||||
shapeDynamics?: {
|
||||
sizeDynamics: BrushDynamics;
|
||||
minimumDiameter: number;
|
||||
tiltScale: number;
|
||||
angleDynamics: BrushDynamics;
|
||||
roundnessDynamics: BrushDynamics;
|
||||
minimumRoundness: number;
|
||||
flipX: boolean;
|
||||
flipY: boolean;
|
||||
brushProjection: boolean;
|
||||
};
|
||||
scatter?: {
|
||||
bothAxes: boolean;
|
||||
scatterDynamics: BrushDynamics;
|
||||
countDynamics: BrushDynamics;
|
||||
count: number;
|
||||
};
|
||||
texture?: {
|
||||
id: string;
|
||||
name: string;
|
||||
invert: boolean;
|
||||
scale: number;
|
||||
brightness: number;
|
||||
contrast: number;
|
||||
blendMode: BlendMode;
|
||||
depth: number;
|
||||
depthMinimum: number;
|
||||
depthDynamics: BrushDynamics;
|
||||
};
|
||||
dualBrush?: {
|
||||
flip: boolean;
|
||||
shape: BrushShape;
|
||||
blendMode: BlendMode;
|
||||
useScatter: boolean;
|
||||
spacing: number;
|
||||
count: number;
|
||||
bothAxes: boolean;
|
||||
countDynamics: BrushDynamics;
|
||||
scatterDynamics: BrushDynamics;
|
||||
};
|
||||
colorDynamics?: {
|
||||
foregroundBackground: BrushDynamics;
|
||||
hue: number;
|
||||
saturation: number;
|
||||
brightness: number;
|
||||
purity: number;
|
||||
perTip: boolean;
|
||||
};
|
||||
transfer?: {
|
||||
flowDynamics: BrushDynamics;
|
||||
opacityDynamics: BrushDynamics;
|
||||
wetnessDynamics: BrushDynamics;
|
||||
mixDynamics: BrushDynamics;
|
||||
};
|
||||
brushPose?: {
|
||||
overrideAngle: boolean;
|
||||
overrideTiltX: boolean;
|
||||
overrideTiltY: boolean;
|
||||
overridePressure: boolean;
|
||||
pressure: number;
|
||||
tiltX: number;
|
||||
tiltY: number;
|
||||
angle: number;
|
||||
};
|
||||
noise: boolean;
|
||||
wetEdges: boolean;
|
||||
protectTexture?: boolean;
|
||||
spacing: number;
|
||||
brushGroup?: undefined;
|
||||
interpretation?: boolean;
|
||||
useBrushSize: boolean;
|
||||
toolOptions?: {
|
||||
brushPreset: boolean;
|
||||
flow: number;
|
||||
smooth: number;
|
||||
mode: BlendMode;
|
||||
opacity: number;
|
||||
smoothing: boolean;
|
||||
smoothingValue: number;
|
||||
smoothingRadiusMode: boolean;
|
||||
smoothingCatchup: boolean;
|
||||
smoothingCatchupAtEnd: boolean;
|
||||
smoothingZoomCompensation: boolean;
|
||||
pressureSmoothing: boolean;
|
||||
usePressureOverridesSize: boolean;
|
||||
usePressureOverridesOpacity: boolean;
|
||||
useLegacy: boolean;
|
||||
flowDynamics?: BrushDynamics;
|
||||
opacityDynamics?: BrushDynamics;
|
||||
sizeDynamics?: BrushDynamics;
|
||||
};
|
||||
}
|
||||
export declare function readAbr(buffer: ArrayBufferView, options?: {
|
||||
logMissingFeatures?: boolean;
|
||||
}): Abr;
|
271
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/abr.js
generated
vendored
Normal file
271
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/abr.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
25
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/additionalInfo.d.ts
generated
vendored
Normal file
25
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/additionalInfo.d.ts
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
import { LayerAdditionalInfo, BezierPath, Psd, ReadOptions, WriteOptions, BooleanOperation, LayerEffectsInfo, LayerVectorMask } from './psd';
|
||||
import { PsdReader } from './psdReader';
|
||||
import { PsdWriter } from './psdWriter';
|
||||
export interface ExtendedWriteOptions extends WriteOptions {
|
||||
layerIds: Set<number>;
|
||||
layerToId: Map<any, number>;
|
||||
}
|
||||
declare type HasMethod = (target: LayerAdditionalInfo) => boolean;
|
||||
declare type ReadMethod = (reader: PsdReader, target: LayerAdditionalInfo, left: () => number, psd: Psd, options: ReadOptions) => void;
|
||||
declare type WriteMethod = (writer: PsdWriter, target: LayerAdditionalInfo, psd: Psd, options: ExtendedWriteOptions) => void;
|
||||
export interface InfoHandler {
|
||||
key: string;
|
||||
has: HasMethod;
|
||||
read: ReadMethod;
|
||||
write: WriteMethod;
|
||||
}
|
||||
export declare const infoHandlers: InfoHandler[];
|
||||
export declare const infoHandlersMap: {
|
||||
[key: string]: InfoHandler;
|
||||
};
|
||||
export declare function readBezierKnot(reader: PsdReader, width: number, height: number): number[];
|
||||
export declare const booleanOperations: BooleanOperation[];
|
||||
export declare function readVectorMask(reader: PsdReader, vectorMask: LayerVectorMask, width: number, height: number, size: number): BezierPath[];
|
||||
export declare function hasMultiEffects(effects: LayerEffectsInfo): boolean;
|
||||
export {};
|
2045
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/additionalInfo.js
generated
vendored
Normal file
2045
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/additionalInfo.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
16953
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/bundle.js
generated
vendored
Normal file
16953
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/bundle.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
10
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/csh.d.ts
generated
vendored
Normal file
10
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/csh.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { LayerVectorMask } from './psd';
|
||||
export interface Csh {
|
||||
shapes: (LayerVectorMask & {
|
||||
name: string;
|
||||
id: string;
|
||||
width: number;
|
||||
height: number;
|
||||
})[];
|
||||
}
|
||||
export declare function readCsh(buffer: ArrayBufferView): Csh;
|
49
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/csh.js
generated
vendored
Normal file
49
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/csh.js
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
"use strict";
|
||||
var __assign = (this && this.__assign) || function () {
|
||||
__assign = Object.assign || function(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
||||
t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
return __assign.apply(this, arguments);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.readCsh = void 0;
|
||||
var additionalInfo_1 = require("./additionalInfo");
|
||||
var psdReader_1 = require("./psdReader");
|
||||
function readCsh(buffer) {
|
||||
var reader = (0, psdReader_1.createReader)(buffer.buffer, buffer.byteOffset, buffer.byteLength);
|
||||
var csh = { shapes: [] };
|
||||
(0, psdReader_1.checkSignature)(reader, 'cush');
|
||||
if ((0, psdReader_1.readUint32)(reader) !== 2)
|
||||
throw new Error('Invalid version');
|
||||
var count = (0, psdReader_1.readUint32)(reader);
|
||||
for (var i = 0; i < count; i++) {
|
||||
var name_1 = (0, psdReader_1.readUnicodeString)(reader);
|
||||
while (reader.offset % 4)
|
||||
reader.offset++; // pad to 4byte bounds
|
||||
if ((0, psdReader_1.readUint32)(reader) !== 1)
|
||||
throw new Error('Invalid shape version');
|
||||
var size = (0, psdReader_1.readUint32)(reader);
|
||||
var end = reader.offset + size;
|
||||
var id = (0, psdReader_1.readPascalString)(reader, 1);
|
||||
// this might not be correct ???
|
||||
var y1 = (0, psdReader_1.readUint32)(reader);
|
||||
var x1 = (0, psdReader_1.readUint32)(reader);
|
||||
var y2 = (0, psdReader_1.readUint32)(reader);
|
||||
var x2 = (0, psdReader_1.readUint32)(reader);
|
||||
var width = x2 - x1;
|
||||
var height = y2 - y1;
|
||||
var mask = { paths: [] };
|
||||
(0, additionalInfo_1.readVectorMask)(reader, mask, width, height, end - reader.offset);
|
||||
csh.shapes.push(__assign({ name: name_1, id: id, width: width, height: height }, mask));
|
||||
reader.offset = end;
|
||||
}
|
||||
return csh;
|
||||
}
|
||||
exports.readCsh = readCsh;
|
||||
|
||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNzaC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7OztBQUFBLG1EQUFrRDtBQUVsRCx5Q0FBNEc7QUFXNUcsU0FBZ0IsT0FBTyxDQUFDLE1BQXVCO0lBQzlDLElBQU0sTUFBTSxHQUFHLElBQUEsd0JBQVksRUFBQyxNQUFNLENBQUM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Npb24nKTtcclxuXHRcdGNvbnN0IHNpemUgPSByZWFkVWludDMyKHJlYWRlcik7XHJcblx0XHRjb25zdCBlbmQgPSByZWFkZXIub2Zmc2V0ICsgc2l6ZTtcclxuXHRcdGNvbnN0IGlkID0gcmVhZFBhc2NhbFN0cmluZyhyZWFkZXIsIDEpO1xyXG5cdFx0Ly8gdGhpcyBtaWdodCBub3QgYmUgY29ycmVjdCA/Pz9cclxuXHRcdGNvbnN0IHkxID0gcmVhZFVpbnQzMihyZWFkZXIpO1xyXG5cdFx0Y29uc3QgeDEgPSByZWFkVWludDMyKHJlYWRlcik7XHJcblx0XHRjb25zdCB5MiA9IHJlYWRVaW50MzIocmVhZGVyKTtcclxuXHRcdGNvbnN0IHgyID0gcmVhZFVpbnQzMihyZWFkZXIpO1xyXG5cdFx0Y29uc3Qgd2lkdGggPSB4MiAtIHgxO1xyXG5cdFx0Y29uc3QgaGVpZ2h0ID0geTIgLSB5MTtcclxuXHRcdGNvbnN0IG1hc2s6IExheWVyVmVjdG9yTWFzayA9IHsgcGF0aHM6IFtdIH07XHJcblx0XHRyZWFkVmVjdG9yTWFzayhyZWFkZXIsIG1hc2ssIHdpZHRoLCBoZWlnaHQsIGVuZCAtIHJlYWRlci5vZmZzZXQpO1xyXG5cdFx0Y3NoLnNoYXBlcy5wdXNoKHsgbmFtZSwgaWQsIHdpZHRoLCBoZWlnaHQsIC4uLm1hc2sgfSk7XHJcblxyXG5cdFx0cmVhZGVyLm9mZnNldCA9IGVuZDtcclxuXHR9XHJcblxyXG5cdHJldHVybiBjc2g7XHJcbn1cclxuIl0sInNvdXJjZVJvb3QiOiJDOlxcUHJvamVjdHNcXGdpdGh1YlxcYWctcHNkXFxzcmMifQ==
|
390
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/descriptor.d.ts
generated
vendored
Normal file
390
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/descriptor.d.ts
generated
vendored
Normal file
@@ -0,0 +1,390 @@
|
||||
import { AntiAlias, BevelDirection, BevelStyle, BevelTechnique, BlendMode, Color, GlowSource, GlowTechnique, GradientStyle, InterpolationMethod, LayerEffectsInfo, LineAlignment, LineCapType, LineJoinType, Orientation, TextGridding, TimelineKeyInterpolation, TimelineTrack, TimelineTrackType, Units, UnitsValue, VectorContent, WarpStyle } from './psd';
|
||||
import { PsdReader } from './psdReader';
|
||||
import { PsdWriter } from './psdWriter';
|
||||
export declare function setLogErrors(value: boolean): void;
|
||||
export declare function readAsciiStringOrClassId(reader: PsdReader): string;
|
||||
export declare function readDescriptorStructure(reader: PsdReader): any;
|
||||
export declare function writeDescriptorStructure(writer: PsdWriter, name: string, classId: string, value: any, root: string): void;
|
||||
export declare function readVersionAndDescriptor(reader: PsdReader): any;
|
||||
export declare function writeVersionAndDescriptor(writer: PsdWriter, name: string, classID: string, descriptor: any, root?: string): void;
|
||||
export declare type DescriptorUnits = 'Angle' | 'Density' | 'Distance' | 'None' | 'Percent' | 'Pixels' | 'Millimeters' | 'Points' | 'Picas' | 'Inches' | 'Centimeters';
|
||||
export interface DescriptorUnitsValue {
|
||||
units: DescriptorUnits;
|
||||
value: number;
|
||||
}
|
||||
export declare type DescriptorColor = {
|
||||
'Rd ': number;
|
||||
'Grn ': number;
|
||||
'Bl ': number;
|
||||
} | {
|
||||
'H ': DescriptorUnitsValue;
|
||||
Strt: number;
|
||||
Brgh: number;
|
||||
} | {
|
||||
'Cyn ': number;
|
||||
Mgnt: number;
|
||||
'Ylw ': number;
|
||||
Blck: number;
|
||||
} | {
|
||||
'Gry ': number;
|
||||
} | {
|
||||
Lmnc: number;
|
||||
'A ': number;
|
||||
'B ': number;
|
||||
};
|
||||
export interface DesciptorPattern {
|
||||
'Nm ': string;
|
||||
Idnt: string;
|
||||
}
|
||||
export declare type DesciptorGradient = {
|
||||
'Nm ': string;
|
||||
GrdF: 'GrdF.CstS';
|
||||
Intr: number;
|
||||
Clrs: {
|
||||
'Clr ': DescriptorColor;
|
||||
Type: 'Clry.UsrS';
|
||||
Lctn: number;
|
||||
Mdpn: number;
|
||||
}[];
|
||||
Trns: {
|
||||
Opct: DescriptorUnitsValue;
|
||||
Lctn: number;
|
||||
Mdpn: number;
|
||||
}[];
|
||||
} | {
|
||||
GrdF: 'GrdF.ClNs';
|
||||
Smth: number;
|
||||
'Nm ': string;
|
||||
ClrS: string;
|
||||
RndS: number;
|
||||
VctC?: boolean;
|
||||
ShTr?: boolean;
|
||||
'Mnm ': number[];
|
||||
'Mxm ': number[];
|
||||
};
|
||||
export interface DescriptorColorContent {
|
||||
'Clr ': DescriptorColor;
|
||||
}
|
||||
export interface DescriptorGradientContent {
|
||||
Grad: DesciptorGradient;
|
||||
Type: string;
|
||||
Dthr?: boolean;
|
||||
Rvrs?: boolean;
|
||||
Angl?: DescriptorUnitsValue;
|
||||
'Scl '?: DescriptorUnitsValue;
|
||||
Algn?: boolean;
|
||||
Ofst?: {
|
||||
Hrzn: DescriptorUnitsValue;
|
||||
Vrtc: DescriptorUnitsValue;
|
||||
};
|
||||
}
|
||||
export interface DescriptorPatternContent {
|
||||
Ptrn: DesciptorPattern;
|
||||
Lnkd?: boolean;
|
||||
phase?: {
|
||||
Hrzn: number;
|
||||
Vrtc: number;
|
||||
};
|
||||
}
|
||||
export declare type DescriptorVectorContent = DescriptorColorContent | DescriptorGradientContent | DescriptorPatternContent;
|
||||
export interface StrokeDescriptor {
|
||||
strokeStyleVersion: number;
|
||||
strokeEnabled: boolean;
|
||||
fillEnabled: boolean;
|
||||
strokeStyleLineWidth: DescriptorUnitsValue;
|
||||
strokeStyleLineDashOffset: DescriptorUnitsValue;
|
||||
strokeStyleMiterLimit: number;
|
||||
strokeStyleLineCapType: string;
|
||||
strokeStyleLineJoinType: string;
|
||||
strokeStyleLineAlignment: string;
|
||||
strokeStyleScaleLock: boolean;
|
||||
strokeStyleStrokeAdjust: boolean;
|
||||
strokeStyleLineDashSet: DescriptorUnitsValue[];
|
||||
strokeStyleBlendMode: string;
|
||||
strokeStyleOpacity: DescriptorUnitsValue;
|
||||
strokeStyleContent: DescriptorVectorContent;
|
||||
strokeStyleResolution: number;
|
||||
}
|
||||
export interface TextDescriptor {
|
||||
'Txt ': string;
|
||||
textGridding: string;
|
||||
Ornt: string;
|
||||
AntA: string;
|
||||
TextIndex: number;
|
||||
EngineData?: Uint8Array;
|
||||
}
|
||||
export interface WarpDescriptor {
|
||||
warpStyle: string;
|
||||
warpValue: number;
|
||||
warpPerspective: number;
|
||||
warpPerspectiveOther: number;
|
||||
warpRotate: string;
|
||||
bounds?: {
|
||||
'Top ': DescriptorUnitsValue;
|
||||
Left: DescriptorUnitsValue;
|
||||
Btom: DescriptorUnitsValue;
|
||||
Rght: DescriptorUnitsValue;
|
||||
};
|
||||
uOrder: number;
|
||||
vOrder: number;
|
||||
customEnvelopeWarp?: {
|
||||
meshPoints: {
|
||||
type: 'Hrzn' | 'Vrtc';
|
||||
values: number[];
|
||||
}[];
|
||||
};
|
||||
}
|
||||
export interface QuiltWarpDescriptor extends WarpDescriptor {
|
||||
deformNumRows: number;
|
||||
deformNumCols: number;
|
||||
customEnvelopeWarp: {
|
||||
quiltSliceX: {
|
||||
type: 'quiltSliceX';
|
||||
values: number[];
|
||||
}[];
|
||||
quiltSliceY: {
|
||||
type: 'quiltSliceY';
|
||||
values: number[];
|
||||
}[];
|
||||
meshPoints: {
|
||||
type: 'Hrzn' | 'Vrtc';
|
||||
values: number[];
|
||||
}[];
|
||||
};
|
||||
}
|
||||
export interface FractionDescriptor {
|
||||
numerator: number;
|
||||
denominator: number;
|
||||
}
|
||||
export interface HrznVrtcDescriptor {
|
||||
Hrzn: number;
|
||||
Vrtc: number;
|
||||
}
|
||||
export interface FrameDescriptor {
|
||||
FrLs: number[];
|
||||
enab?: boolean;
|
||||
IMsk?: {
|
||||
Ofst: HrznVrtcDescriptor;
|
||||
};
|
||||
VMsk?: {
|
||||
Ofst: HrznVrtcDescriptor;
|
||||
};
|
||||
Ofst?: HrznVrtcDescriptor;
|
||||
FXRf?: HrznVrtcDescriptor;
|
||||
Lefx?: Lfx2Descriptor;
|
||||
blendOptions?: {
|
||||
Opct: DescriptorUnitsValue;
|
||||
};
|
||||
}
|
||||
export interface FrameListDescriptor {
|
||||
LaID: number;
|
||||
LaSt: FrameDescriptor[];
|
||||
}
|
||||
export declare function horzVrtcToXY(hv: HrznVrtcDescriptor): {
|
||||
x: number;
|
||||
y: number;
|
||||
};
|
||||
export declare function xyToHorzVrtc(xy: {
|
||||
x: number;
|
||||
y: number;
|
||||
}): HrznVrtcDescriptor;
|
||||
export declare type TimelineAnimKeyDescriptor = {
|
||||
Type: 'keyType.Opct';
|
||||
Opct: DescriptorUnitsValue;
|
||||
} | {
|
||||
Type: 'keyType.Trnf';
|
||||
'Scl ': HrznVrtcDescriptor;
|
||||
Skew: HrznVrtcDescriptor;
|
||||
rotation: number;
|
||||
translation: HrznVrtcDescriptor;
|
||||
} | {
|
||||
Type: 'keyType.Pstn';
|
||||
Hrzn: number;
|
||||
Vrtc: number;
|
||||
} | {
|
||||
Type: 'keyType.sheetStyle';
|
||||
sheetStyle: {
|
||||
Vrsn: number;
|
||||
Lefx?: Lfx2Descriptor;
|
||||
blendOptions: {};
|
||||
};
|
||||
} | {
|
||||
Type: 'keyType.globalLighting';
|
||||
gblA: number;
|
||||
globalAltitude: number;
|
||||
};
|
||||
export interface TimelineKeyDescriptor {
|
||||
Vrsn: 1;
|
||||
animInterpStyle: 'animInterpStyle.Lnr ' | 'animInterpStyle.hold';
|
||||
time: FractionDescriptor;
|
||||
animKey: TimelineAnimKeyDescriptor;
|
||||
selected: boolean;
|
||||
}
|
||||
export interface TimelineTrackDescriptor {
|
||||
trackID: 'stdTrackID.globalLightingTrack' | 'stdTrackID.opacityTrack' | 'stdTrackID.styleTrack' | 'stdTrackID.sheetTransformTrack' | 'stdTrackID.sheetPositionTrack';
|
||||
Vrsn: 1;
|
||||
enab: boolean;
|
||||
Effc: boolean;
|
||||
effectParams?: {
|
||||
keyList: TimelineKeyDescriptor[];
|
||||
fillCanvas: boolean;
|
||||
zoomOrigin: number;
|
||||
};
|
||||
keyList: TimelineKeyDescriptor[];
|
||||
}
|
||||
export interface TimeScopeDescriptor {
|
||||
Vrsn: 1;
|
||||
Strt: FractionDescriptor;
|
||||
duration: FractionDescriptor;
|
||||
inTime: FractionDescriptor;
|
||||
outTime: FractionDescriptor;
|
||||
}
|
||||
export interface TimelineDescriptor {
|
||||
Vrsn: 1;
|
||||
timeScope: TimeScopeDescriptor;
|
||||
autoScope: boolean;
|
||||
audioLevel: number;
|
||||
LyrI: number;
|
||||
trackList?: TimelineTrackDescriptor[];
|
||||
}
|
||||
export interface EffectDescriptor extends Partial<DescriptorGradientContent>, Partial<DescriptorPatternContent> {
|
||||
enab?: boolean;
|
||||
Styl: string;
|
||||
PntT?: string;
|
||||
'Md '?: string;
|
||||
Opct?: DescriptorUnitsValue;
|
||||
'Sz '?: DescriptorUnitsValue;
|
||||
'Clr '?: DescriptorColor;
|
||||
present?: boolean;
|
||||
showInDialog?: boolean;
|
||||
overprint?: boolean;
|
||||
}
|
||||
export interface Lfx2Descriptor {
|
||||
'Scl '?: DescriptorUnitsValue;
|
||||
masterFXSwitch?: boolean;
|
||||
DrSh?: EffectDescriptor;
|
||||
IrSh?: EffectDescriptor;
|
||||
OrGl?: EffectDescriptor;
|
||||
IrGl?: EffectDescriptor;
|
||||
ebbl?: EffectDescriptor;
|
||||
SoFi?: EffectDescriptor;
|
||||
patternFill?: EffectDescriptor;
|
||||
GrFl?: EffectDescriptor;
|
||||
ChFX?: EffectDescriptor;
|
||||
FrFX?: EffectDescriptor;
|
||||
}
|
||||
export interface LmfxDescriptor {
|
||||
'Scl '?: DescriptorUnitsValue;
|
||||
masterFXSwitch?: boolean;
|
||||
numModifyingFX?: number;
|
||||
OrGl?: EffectDescriptor;
|
||||
IrGl?: EffectDescriptor;
|
||||
ebbl?: EffectDescriptor;
|
||||
ChFX?: EffectDescriptor;
|
||||
dropShadowMulti?: EffectDescriptor[];
|
||||
innerShadowMulti?: EffectDescriptor[];
|
||||
solidFillMulti?: EffectDescriptor[];
|
||||
gradientFillMulti?: EffectDescriptor[];
|
||||
frameFXMulti?: EffectDescriptor[];
|
||||
patternFill?: EffectDescriptor;
|
||||
}
|
||||
export declare function serializeEffects(e: LayerEffectsInfo, log: boolean, multi: boolean): Lfx2Descriptor & LmfxDescriptor;
|
||||
export declare function parseEffects(info: Lfx2Descriptor & LmfxDescriptor, log: boolean): LayerEffectsInfo;
|
||||
export declare function parseTrackList(trackList: TimelineTrackDescriptor[], logMissingFeatures: boolean): TimelineTrack[];
|
||||
export declare function serializeTrackList(tracks: TimelineTrack[]): TimelineTrackDescriptor[];
|
||||
export declare function parseVectorContent(descriptor: DescriptorVectorContent): VectorContent;
|
||||
export declare function serializeVectorContent(content: VectorContent): {
|
||||
descriptor: DescriptorVectorContent;
|
||||
key: string;
|
||||
};
|
||||
export declare function parseColor(color: DescriptorColor): Color;
|
||||
export declare function serializeColor(color: Color | undefined): DescriptorColor;
|
||||
export declare function parseAngle(x: DescriptorUnitsValue): number;
|
||||
export declare function parsePercent(x: DescriptorUnitsValue | undefined): number;
|
||||
export declare function parsePercentOrAngle(x: DescriptorUnitsValue | undefined): number;
|
||||
export declare function parseUnits({ units, value }: DescriptorUnitsValue): UnitsValue;
|
||||
export declare function parseUnitsOrNumber(value: DescriptorUnitsValue | number, units?: Units): UnitsValue;
|
||||
export declare function parseUnitsToNumber({ units, value }: DescriptorUnitsValue, expectedUnits: string): number;
|
||||
export declare function unitsAngle(value: number | undefined): DescriptorUnitsValue;
|
||||
export declare function unitsPercent(value: number | undefined): DescriptorUnitsValue;
|
||||
export declare function unitsValue(x: UnitsValue | undefined, key: string): DescriptorUnitsValue;
|
||||
export declare const textGridding: {
|
||||
decode: (val: string) => TextGridding;
|
||||
encode: (val: TextGridding | undefined) => string;
|
||||
};
|
||||
export declare const Ornt: {
|
||||
decode: (val: string) => Orientation;
|
||||
encode: (val: Orientation | undefined) => string;
|
||||
};
|
||||
export declare const Annt: {
|
||||
decode: (val: string) => AntiAlias;
|
||||
encode: (val: AntiAlias | undefined) => string;
|
||||
};
|
||||
export declare const warpStyle: {
|
||||
decode: (val: string) => WarpStyle;
|
||||
encode: (val: WarpStyle | undefined) => string;
|
||||
};
|
||||
export declare const BlnM: {
|
||||
decode: (val: string) => BlendMode;
|
||||
encode: (val: BlendMode | undefined) => string;
|
||||
};
|
||||
export declare const BESl: {
|
||||
decode: (val: string) => BevelStyle;
|
||||
encode: (val: BevelStyle | undefined) => string;
|
||||
};
|
||||
export declare const bvlT: {
|
||||
decode: (val: string) => BevelTechnique;
|
||||
encode: (val: BevelTechnique | undefined) => string;
|
||||
};
|
||||
export declare const BESs: {
|
||||
decode: (val: string) => BevelDirection;
|
||||
encode: (val: BevelDirection | undefined) => string;
|
||||
};
|
||||
export declare const BETE: {
|
||||
decode: (val: string) => GlowTechnique;
|
||||
encode: (val: GlowTechnique | undefined) => string;
|
||||
};
|
||||
export declare const IGSr: {
|
||||
decode: (val: string) => GlowSource;
|
||||
encode: (val: GlowSource | undefined) => string;
|
||||
};
|
||||
export declare const GrdT: {
|
||||
decode: (val: string) => GradientStyle;
|
||||
encode: (val: GradientStyle | undefined) => string;
|
||||
};
|
||||
export declare const animInterpStyleEnum: {
|
||||
decode: (val: string) => TimelineKeyInterpolation;
|
||||
encode: (val: TimelineKeyInterpolation | undefined) => string;
|
||||
};
|
||||
export declare const stdTrackID: {
|
||||
decode: (val: string) => TimelineTrackType;
|
||||
encode: (val: TimelineTrackType | undefined) => string;
|
||||
};
|
||||
export declare const gradientInterpolationMethodType: {
|
||||
decode: (val: string) => InterpolationMethod;
|
||||
encode: (val: InterpolationMethod | undefined) => string;
|
||||
};
|
||||
export declare const ClrS: {
|
||||
decode: (val: string) => "rgb" | "hsb" | "lab";
|
||||
encode: (val: "rgb" | "hsb" | "lab" | undefined) => string;
|
||||
};
|
||||
export declare const FStl: {
|
||||
decode: (val: string) => "center" | "inside" | "outside";
|
||||
encode: (val: "center" | "inside" | "outside" | undefined) => string;
|
||||
};
|
||||
export declare const FrFl: {
|
||||
decode: (val: string) => "color" | "pattern" | "gradient";
|
||||
encode: (val: "color" | "pattern" | "gradient" | undefined) => string;
|
||||
};
|
||||
export declare const strokeStyleLineCapType: {
|
||||
decode: (val: string) => LineCapType;
|
||||
encode: (val: LineCapType | undefined) => string;
|
||||
};
|
||||
export declare const strokeStyleLineJoinType: {
|
||||
decode: (val: string) => LineJoinType;
|
||||
encode: (val: LineJoinType | undefined) => string;
|
||||
};
|
||||
export declare const strokeStyleLineAlignment: {
|
||||
decode: (val: string) => LineAlignment;
|
||||
encode: (val: LineAlignment | undefined) => string;
|
||||
};
|
1644
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/descriptor.js
generated
vendored
Normal file
1644
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/descriptor.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
5
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/effectsHelpers.d.ts
generated
vendored
Normal file
5
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/effectsHelpers.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import { LayerEffectsInfo } from './psd';
|
||||
import { PsdReader } from './psdReader';
|
||||
import { PsdWriter } from './psdWriter';
|
||||
export declare function readEffects(reader: PsdReader): LayerEffectsInfo;
|
||||
export declare function writeEffects(writer: PsdWriter, effects: LayerEffectsInfo): void;
|
310
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/effectsHelpers.js
generated
vendored
Normal file
310
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/effectsHelpers.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
2
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/engineData.d.ts
generated
vendored
Normal file
2
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/engineData.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export declare function parseEngineData(data: number[] | Uint8Array): any;
|
||||
export declare function serializeEngineData(data: any, condensed?: boolean): Uint8Array;
|
338
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/engineData.js
generated
vendored
Normal file
338
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/engineData.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
93
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/helpers.d.ts
generated
vendored
Normal file
93
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/helpers.d.ts
generated
vendored
Normal file
@@ -0,0 +1,93 @@
|
||||
import { Layer, BlendMode, LayerColor } from './psd';
|
||||
export declare const MOCK_HANDLERS = false;
|
||||
export declare const RAW_IMAGE_DATA = false;
|
||||
export declare const fromBlendMode: {
|
||||
[key: string]: string;
|
||||
};
|
||||
export declare const toBlendMode: {
|
||||
[key: string]: BlendMode;
|
||||
};
|
||||
export declare const layerColors: LayerColor[];
|
||||
export declare const largeAdditionalInfoKeys: string[];
|
||||
export interface Dict {
|
||||
[key: string]: string;
|
||||
}
|
||||
export declare function revMap(map: Dict): Dict;
|
||||
export declare function createEnum<T>(prefix: string, def: string, map: Dict): {
|
||||
decode: (val: string) => T;
|
||||
encode: (val: T | undefined) => string;
|
||||
};
|
||||
export declare const enum ColorSpace {
|
||||
RGB = 0,
|
||||
HSB = 1,
|
||||
CMYK = 2,
|
||||
Lab = 7,
|
||||
Grayscale = 8
|
||||
}
|
||||
export declare const enum LayerMaskFlags {
|
||||
PositionRelativeToLayer = 1,
|
||||
LayerMaskDisabled = 2,
|
||||
InvertLayerMaskWhenBlending = 4,
|
||||
LayerMaskFromRenderingOtherData = 8,
|
||||
MaskHasParametersAppliedToIt = 16
|
||||
}
|
||||
export declare const enum MaskParams {
|
||||
UserMaskDensity = 1,
|
||||
UserMaskFeather = 2,
|
||||
VectorMaskDensity = 4,
|
||||
VectorMaskFeather = 8
|
||||
}
|
||||
export declare const enum ChannelID {
|
||||
Color0 = 0,
|
||||
Color1 = 1,
|
||||
Color2 = 2,
|
||||
Color3 = 3,
|
||||
Transparency = -1,
|
||||
UserMask = -2,
|
||||
RealUserMask = -3
|
||||
}
|
||||
export declare const enum Compression {
|
||||
RawData = 0,
|
||||
RleCompressed = 1,
|
||||
ZipWithoutPrediction = 2,
|
||||
ZipWithPrediction = 3
|
||||
}
|
||||
export interface ChannelData {
|
||||
channelId: ChannelID;
|
||||
compression: Compression;
|
||||
buffer: Uint8Array | undefined;
|
||||
length: number;
|
||||
}
|
||||
export interface Bounds {
|
||||
top: number;
|
||||
left: number;
|
||||
right: number;
|
||||
bottom: number;
|
||||
}
|
||||
export interface LayerChannelData {
|
||||
layer: Layer;
|
||||
channels: ChannelData[];
|
||||
top: number;
|
||||
left: number;
|
||||
right: number;
|
||||
bottom: number;
|
||||
mask?: Bounds;
|
||||
}
|
||||
export declare type PixelArray = Uint8ClampedArray | Uint8Array;
|
||||
export interface PixelData {
|
||||
data: PixelArray;
|
||||
width: number;
|
||||
height: number;
|
||||
}
|
||||
export declare function offsetForChannel(channelId: ChannelID, cmyk: boolean): number;
|
||||
export declare function clamp(value: number, min: number, max: number): number;
|
||||
export declare function hasAlpha(data: PixelData): boolean;
|
||||
export declare function resetImageData({ data }: PixelData): void;
|
||||
export declare function decodeBitmap(input: PixelArray, output: PixelArray, width: number, height: number): void;
|
||||
export declare function writeDataRaw(data: PixelData, offset: number, width: number, height: number): Uint8Array | undefined;
|
||||
export declare function writeDataRLE(buffer: Uint8Array, { data, width, height }: PixelData, offsets: number[], large: boolean): Uint8Array | undefined;
|
||||
export declare function writeDataZipWithoutPrediction({ data, width, height }: PixelData, offsets: number[]): Uint8Array;
|
||||
export declare let createCanvas: (width: number, height: number) => HTMLCanvasElement;
|
||||
export declare let createCanvasFromData: (data: Uint8Array) => HTMLCanvasElement;
|
||||
export declare let createImageData: (width: number, height: number) => ImageData;
|
||||
export declare function initializeCanvas(createCanvasMethod: (width: number, height: number) => HTMLCanvasElement, createCanvasFromDataMethod?: (data: Uint8Array) => HTMLCanvasElement, createImageDataMethod?: (width: number, height: number) => ImageData): void;
|
333
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/helpers.js
generated
vendored
Normal file
333
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/helpers.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
13
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/imageResources.d.ts
generated
vendored
Normal file
13
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/imageResources.d.ts
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
import { ImageResources, ReadOptions } from './psd';
|
||||
import { PsdReader } from './psdReader';
|
||||
import { PsdWriter } from './psdWriter';
|
||||
export interface ResourceHandler {
|
||||
key: number;
|
||||
has: (target: ImageResources) => boolean;
|
||||
read: (reader: PsdReader, target: ImageResources, left: () => number, options: ReadOptions) => void;
|
||||
write: (writer: PsdWriter, target: ImageResources) => void;
|
||||
}
|
||||
export declare const resourceHandlers: ResourceHandler[];
|
||||
export declare const resourceHandlersMap: {
|
||||
[key: number]: ResourceHandler;
|
||||
};
|
788
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/imageResources.js
generated
vendored
Normal file
788
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/imageResources.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
20
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/index.d.ts
generated
vendored
Normal file
20
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
/// <reference types="node" />
|
||||
import { Psd, ReadOptions, WriteOptions } from './psd';
|
||||
import { PsdWriter } from './psdWriter';
|
||||
import { PsdReader } from './psdReader';
|
||||
export * from './abr';
|
||||
export * from './csh';
|
||||
export { initializeCanvas } from './helpers';
|
||||
export * from './psd';
|
||||
import { fromByteArray } from 'base64-js';
|
||||
export { PsdReader, PsdWriter };
|
||||
interface BufferLike {
|
||||
buffer: ArrayBuffer;
|
||||
byteOffset: number;
|
||||
byteLength: number;
|
||||
}
|
||||
export declare const byteArrayToBase64: typeof fromByteArray;
|
||||
export declare function readPsd(buffer: ArrayBuffer | BufferLike, options?: ReadOptions): Psd;
|
||||
export declare function writePsd(psd: Psd, options?: WriteOptions): ArrayBuffer;
|
||||
export declare function writePsdUint8Array(psd: Psd, options?: WriteOptions): Uint8Array;
|
||||
export declare function writePsdBuffer(psd: Psd, options?: WriteOptions): Buffer;
|
54
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/index.js
generated
vendored
Normal file
54
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/index.js
generated
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.writePsdBuffer = exports.writePsdUint8Array = exports.writePsd = exports.readPsd = exports.byteArrayToBase64 = exports.initializeCanvas = void 0;
|
||||
var psdWriter_1 = require("./psdWriter");
|
||||
var psdReader_1 = require("./psdReader");
|
||||
__exportStar(require("./abr"), exports);
|
||||
__exportStar(require("./csh"), exports);
|
||||
var helpers_1 = require("./helpers");
|
||||
Object.defineProperty(exports, "initializeCanvas", { enumerable: true, get: function () { return helpers_1.initializeCanvas; } });
|
||||
__exportStar(require("./psd"), exports);
|
||||
var base64_js_1 = require("base64-js");
|
||||
exports.byteArrayToBase64 = base64_js_1.fromByteArray;
|
||||
function readPsd(buffer, options) {
|
||||
var reader = 'buffer' in buffer ?
|
||||
(0, psdReader_1.createReader)(buffer.buffer, buffer.byteOffset, buffer.byteLength) :
|
||||
(0, psdReader_1.createReader)(buffer);
|
||||
return (0, psdReader_1.readPsd)(reader, options);
|
||||
}
|
||||
exports.readPsd = readPsd;
|
||||
function writePsd(psd, options) {
|
||||
var writer = (0, psdWriter_1.createWriter)();
|
||||
(0, psdWriter_1.writePsd)(writer, psd, options);
|
||||
return (0, psdWriter_1.getWriterBuffer)(writer);
|
||||
}
|
||||
exports.writePsd = writePsd;
|
||||
function writePsdUint8Array(psd, options) {
|
||||
var writer = (0, psdWriter_1.createWriter)();
|
||||
(0, psdWriter_1.writePsd)(writer, psd, options);
|
||||
return (0, psdWriter_1.getWriterBufferNoCopy)(writer);
|
||||
}
|
||||
exports.writePsdUint8Array = writePsdUint8Array;
|
||||
function writePsdBuffer(psd, options) {
|
||||
if (typeof Buffer === 'undefined') {
|
||||
throw new Error('Buffer not supported on this platform');
|
||||
}
|
||||
return Buffer.from(writePsdUint8Array(psd, options));
|
||||
}
|
||||
exports.writePsdBuffer = writePsdBuffer;
|
||||
|
||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQ0EseUNBQTRIO0FBQzVILHlDQUFrRjtBQUNsRix3Q0FBc0I7QUFDdEIsd0NBQXNCO0FBQ3RCLHFDQUE2QztBQUFwQywyR0FBQSxnQkFBZ0IsT0FBQTt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pb25zKTogQnVmZmVyIHtcblx0aWYgKHR5cGVvZiBCdWZmZXIgPT09ICd1bmRlZmluZWQnKSB7XG5cdFx0dGhyb3cgbmV3IEVycm9yKCdCdWZmZXIgbm90IHN1cHBvcnRlZCBvbiB0aGlzIHBsYXRmb3JtJyk7XG5cdH1cblxuXHRyZXR1cm4gQnVmZmVyLmZyb20od3JpdGVQc2RVaW50OEFycmF5KHBzZCwgb3B0aW9ucykpO1xufVxuIl0sInNvdXJjZVJvb3QiOiJDOlxcUHJvamVjdHNcXGdpdGh1YlxcYWctcHNkXFxzcmMifQ==
|
1
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/initializeCanvas.d.ts
generated
vendored
Normal file
1
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/initializeCanvas.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare function initialize(): void;
|
27
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/initializeCanvas.js
generated
vendored
Normal file
27
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/initializeCanvas.js
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.initialize = void 0;
|
||||
var canvas_1 = require("canvas");
|
||||
var index_1 = require("./index");
|
||||
var jpeg_1 = require("./jpeg");
|
||||
function createCanvasFromData(data) {
|
||||
var canvas = (0, canvas_1.createCanvas)(100, 100);
|
||||
try {
|
||||
var context_1 = canvas.getContext('2d');
|
||||
var imageData = (0, jpeg_1.decodeJpeg)(data, function (w, h) { return context_1.createImageData(w, h); });
|
||||
canvas.width = imageData.width;
|
||||
canvas.height = imageData.height;
|
||||
context_1.putImageData(imageData, 0, 0);
|
||||
}
|
||||
catch (e) {
|
||||
console.error('JPEG decompression error', e.message);
|
||||
}
|
||||
return canvas;
|
||||
}
|
||||
(0, index_1.initializeCanvas)(canvas_1.createCanvas, createCanvasFromData);
|
||||
function initialize() {
|
||||
(0, index_1.initializeCanvas)(canvas_1.createCanvas, createCanvasFromData);
|
||||
}
|
||||
exports.initialize = initialize;
|
||||
|
||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluaXRpYWxpemVDYW52YXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsaUNBQXNDO0FBQ3RDLGlDQUEyQztBQUMzQywrQkFBb0M7QUFFcEMsU0FBUyxvQkFBb0IsQ0FBQyxJQUFnQjtJQUM3QyxJQUFNLE1BQU0sR0FBRyxJQUFBLHFCQUFZLEVBQUMsR0FBRyxFQUFFLEdBQUcsQ0FBQyxDQUFDO0lBRXRDLElBQUk7UUFDSCxJQUFNLFNBQU8sR0FBRyxNQUFNLENBQUMsVUFBVSxDQUFDLElBQUksQ0FBRSxDQUFDO1FBQ3pDLElBQU0sU0FBUyxHQUFHLElBQUEsaUJBQVUsRUFBQyxJQUFJLEVBQUUsVUFBQyxDQUFDLEVBQUUsQ0FBQyxJQUFLLE9BQUEsU0FBTyxDQUFDLGVBQWUsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxDQUFDLEVBQTdCLENBQTZCLENBQUMsQ0FBQztRQUM1RSxNQUFNLENBQUMsS0FBSyxHQUFHLFNBQVMsQ0FBQyxLQUFLLENBQUM7UUFDL0IsTUFBTSxDQUFDLE1BQU0sR0FBRyxTQUFTLENBQUMsTUFBTSxDQUFDO1FBQ2pDLFNBQU8sQ0FBQyxZQUFZLENBQUMsU0FBUyxFQUFFLENBQUMsRUFBRSxDQUFDLENBQUMsQ0FBQztLQUN0QztJQUFDLE9BQU8sQ0FBTSxFQUFFO1FBQ2hCLE9BQU8sQ0FBQyxLQUFLLENBQUMsMEJBQTBCLEVBQUUsQ0FBQyxDQUFDLE9BQU8sQ0FBQyxDQUFDO0tBQ3JEO0lBRUQsT0FBTyxNQUFNLENBQUM7QUFDZixDQUFDO0FBRUQ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cclxuaW5pdGlhbGl6ZUNhbnZhcyhjcmVhdGVDYW52YXMsIGNyZWF0ZUNhbnZhc0Zyb21EYXRhKTtcclxuXHJcbmV4cG9ydCBmdW5jdGlvbiBpbml0aWFsaXplKCkge1xyXG5cdGluaXRpYWxpemVDYW52YXMoY3JlYXRlQ2FudmFzLCBjcmVhdGVDYW52YXNGcm9tRGF0YSk7XHJcbn1cclxuIl0sInNvdXJjZVJvb3QiOiJDOlxcUHJvamVjdHNcXGdpdGh1YlxcYWctcHNkXFxzcmMifQ==
|
1
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/jpeg.d.ts
generated
vendored
Normal file
1
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/jpeg.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare function decodeJpeg(encoded: Uint8Array, createImageData: (width: number, height: number) => ImageData): ImageData;
|
1023
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/jpeg.js
generated
vendored
Normal file
1023
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/jpeg.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1147
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/psd.d.ts
generated
vendored
Normal file
1147
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/psd.d.ts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
23
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/psd.js
generated
vendored
Normal file
23
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/psd.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
36
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/psdReader.d.ts
generated
vendored
Normal file
36
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/psdReader.d.ts
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
import { Psd, ColorMode, ReadOptions, Color, PatternInfo } from './psd';
|
||||
import { PixelData } from './helpers';
|
||||
export declare const supportedColorModes: ColorMode[];
|
||||
export interface PsdReader {
|
||||
offset: number;
|
||||
view: DataView;
|
||||
strict: boolean;
|
||||
debug: boolean;
|
||||
}
|
||||
export declare function createReader(buffer: ArrayBuffer, offset?: number, length?: number): PsdReader;
|
||||
export declare function warnOrThrow(reader: PsdReader, message: string): void;
|
||||
export declare function readUint8(reader: PsdReader): number;
|
||||
export declare function peekUint8(reader: PsdReader): number;
|
||||
export declare function readInt16(reader: PsdReader): number;
|
||||
export declare function readUint16(reader: PsdReader): number;
|
||||
export declare function readInt32(reader: PsdReader): number;
|
||||
export declare function readInt32LE(reader: PsdReader): number;
|
||||
export declare function readUint32(reader: PsdReader): number;
|
||||
export declare function readFloat32(reader: PsdReader): number;
|
||||
export declare function readFloat64(reader: PsdReader): number;
|
||||
export declare function readFixedPoint32(reader: PsdReader): number;
|
||||
export declare function readFixedPointPath32(reader: PsdReader): number;
|
||||
export declare function readBytes(reader: PsdReader, length: number): Uint8Array;
|
||||
export declare function readSignature(reader: PsdReader): string;
|
||||
export declare function readPascalString(reader: PsdReader, padTo: number): string;
|
||||
export declare function readUnicodeString(reader: PsdReader): string;
|
||||
export declare function readUnicodeStringWithLength(reader: PsdReader, length: number): string;
|
||||
export declare function readAsciiString(reader: PsdReader, length: number): string;
|
||||
export declare function skipBytes(reader: PsdReader, count: number): void;
|
||||
export declare function checkSignature(reader: PsdReader, a: string, b?: string): void;
|
||||
export declare function readPsd(reader: PsdReader, options?: ReadOptions): Psd;
|
||||
export declare function readDataZipWithoutPrediction(reader: PsdReader, length: number, pixelData: PixelData | undefined, width: number, height: number, step: number, offset: number): void;
|
||||
export declare function readDataRLE(reader: PsdReader, pixelData: PixelData | undefined, _width: number, height: number, step: number, offsets: number[], large: boolean): void;
|
||||
export declare function readSection<T>(reader: PsdReader, round: number, func: (left: () => number) => T, skipEmpty?: boolean, eightBytes?: boolean): T | undefined;
|
||||
export declare function readColor(reader: PsdReader): Color;
|
||||
export declare function readPattern(reader: PsdReader): PatternInfo;
|
959
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/psdReader.js
generated
vendored
Normal file
959
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/psdReader.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
27
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/psdWriter.d.ts
generated
vendored
Normal file
27
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/psdWriter.d.ts
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
import { Psd, WriteOptions, Color } from './psd';
|
||||
export interface PsdWriter {
|
||||
offset: number;
|
||||
buffer: ArrayBuffer;
|
||||
view: DataView;
|
||||
}
|
||||
export declare function createWriter(size?: number): PsdWriter;
|
||||
export declare function getWriterBuffer(writer: PsdWriter): ArrayBuffer;
|
||||
export declare function getWriterBufferNoCopy(writer: PsdWriter): Uint8Array;
|
||||
export declare function writeUint8(writer: PsdWriter, value: number): void;
|
||||
export declare function writeInt16(writer: PsdWriter, value: number): void;
|
||||
export declare function writeUint16(writer: PsdWriter, value: number): void;
|
||||
export declare function writeInt32(writer: PsdWriter, value: number): void;
|
||||
export declare function writeUint32(writer: PsdWriter, value: number): void;
|
||||
export declare function writeFloat32(writer: PsdWriter, value: number): void;
|
||||
export declare function writeFloat64(writer: PsdWriter, value: number): void;
|
||||
export declare function writeFixedPoint32(writer: PsdWriter, value: number): void;
|
||||
export declare function writeFixedPointPath32(writer: PsdWriter, value: number): void;
|
||||
export declare function writeBytes(writer: PsdWriter, buffer: Uint8Array | undefined): void;
|
||||
export declare function writeZeros(writer: PsdWriter, count: number): void;
|
||||
export declare function writeSignature(writer: PsdWriter, signature: string): void;
|
||||
export declare function writePascalString(writer: PsdWriter, text: string, padTo: number): void;
|
||||
export declare function writeUnicodeString(writer: PsdWriter, text: string): void;
|
||||
export declare function writeUnicodeStringWithPadding(writer: PsdWriter, text: string): void;
|
||||
export declare function writeSection(writer: PsdWriter, round: number, func: () => void, writeTotalLength?: boolean, large?: boolean): void;
|
||||
export declare function writePsd(writer: PsdWriter, psd: Psd, options?: WriteOptions): void;
|
||||
export declare function writeColor(writer: PsdWriter, color: Color | undefined): void;
|
690
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/psdWriter.js
generated
vendored
Normal file
690
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/psdWriter.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
168
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/text.d.ts
generated
vendored
Normal file
168
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/text.d.ts
generated
vendored
Normal file
@@ -0,0 +1,168 @@
|
||||
import { LayerTextData } from './psd';
|
||||
interface Adjustments {
|
||||
Axis: number[];
|
||||
XY: number[];
|
||||
}
|
||||
interface TypeValues {
|
||||
Type: number;
|
||||
Values: number[];
|
||||
}
|
||||
interface ParagraphProperties {
|
||||
Justification?: number;
|
||||
FirstLineIndent?: number;
|
||||
StartIndent?: number;
|
||||
EndIndent?: number;
|
||||
SpaceBefore?: number;
|
||||
SpaceAfter?: number;
|
||||
AutoHyphenate?: boolean;
|
||||
HyphenatedWordSize?: number;
|
||||
PreHyphen?: number;
|
||||
PostHyphen?: number;
|
||||
ConsecutiveHyphens?: number;
|
||||
Zone?: number;
|
||||
WordSpacing?: number[];
|
||||
LetterSpacing?: number[];
|
||||
GlyphSpacing?: number[];
|
||||
AutoLeading?: number;
|
||||
LeadingType?: number;
|
||||
Hanging?: boolean;
|
||||
Burasagari?: boolean;
|
||||
KinsokuOrder?: number;
|
||||
EveryLineComposer?: boolean;
|
||||
}
|
||||
interface ParagraphSheet {
|
||||
Name?: string;
|
||||
DefaultStyleSheet: number;
|
||||
Properties: ParagraphProperties;
|
||||
}
|
||||
interface StyleSheetData {
|
||||
Font?: number;
|
||||
FontSize?: number;
|
||||
FauxBold?: boolean;
|
||||
FauxItalic?: boolean;
|
||||
AutoLeading?: boolean;
|
||||
Leading?: number;
|
||||
HorizontalScale?: number;
|
||||
VerticalScale?: number;
|
||||
Tracking?: number;
|
||||
AutoKerning?: boolean;
|
||||
Kerning?: number;
|
||||
BaselineShift?: number;
|
||||
FontCaps?: number;
|
||||
FontBaseline?: number;
|
||||
Underline?: boolean;
|
||||
Strikethrough?: boolean;
|
||||
Ligatures?: boolean;
|
||||
DLigatures?: boolean;
|
||||
BaselineDirection?: number;
|
||||
Tsume?: number;
|
||||
StyleRunAlignment?: number;
|
||||
Language?: number;
|
||||
NoBreak?: boolean;
|
||||
FillColor?: TypeValues;
|
||||
StrokeColor?: TypeValues;
|
||||
FillFlag?: boolean;
|
||||
StrokeFlag?: boolean;
|
||||
FillFirst?: boolean;
|
||||
YUnderline?: number;
|
||||
OutlineWidth?: number;
|
||||
CharacterDirection?: number;
|
||||
HindiNumbers?: boolean;
|
||||
Kashida?: number;
|
||||
DiacriticPos?: number;
|
||||
}
|
||||
interface FontSet {
|
||||
Name: string;
|
||||
Script: number;
|
||||
FontType: number;
|
||||
Synthetic: number;
|
||||
}
|
||||
interface ResourceDict {
|
||||
KinsokuSet: any[];
|
||||
MojiKumiSet: any[];
|
||||
TheNormalStyleSheet: number;
|
||||
TheNormalParagraphSheet: number;
|
||||
ParagraphSheetSet: ParagraphSheet[];
|
||||
StyleSheetSet: {
|
||||
Name: string;
|
||||
StyleSheetData: StyleSheetData;
|
||||
}[];
|
||||
FontSet: FontSet[];
|
||||
SuperscriptSize: number;
|
||||
SuperscriptPosition: number;
|
||||
SubscriptSize: number;
|
||||
SubscriptPosition: number;
|
||||
SmallCapSize: number;
|
||||
}
|
||||
interface ParagraphRun {
|
||||
ParagraphSheet: ParagraphSheet;
|
||||
Adjustments: Adjustments;
|
||||
}
|
||||
interface StyleRun {
|
||||
StyleSheet: {
|
||||
StyleSheetData: StyleSheetData;
|
||||
};
|
||||
}
|
||||
interface PhotoshopNode {
|
||||
ShapeType?: number;
|
||||
PointBase?: number[];
|
||||
BoxBounds?: number[];
|
||||
Base?: {
|
||||
ShapeType: number;
|
||||
TransformPoint0: number[];
|
||||
TransformPoint1: number[];
|
||||
TransformPoint2: number[];
|
||||
};
|
||||
}
|
||||
interface EngineData {
|
||||
EngineDict: {
|
||||
Editor: {
|
||||
Text: string;
|
||||
};
|
||||
ParagraphRun: {
|
||||
DefaultRunData: ParagraphRun;
|
||||
RunArray: ParagraphRun[];
|
||||
RunLengthArray: number[];
|
||||
IsJoinable: number;
|
||||
};
|
||||
StyleRun: {
|
||||
DefaultRunData: StyleRun;
|
||||
RunArray: StyleRun[];
|
||||
RunLengthArray: number[];
|
||||
IsJoinable: number;
|
||||
};
|
||||
GridInfo: {
|
||||
GridIsOn: boolean;
|
||||
ShowGrid: boolean;
|
||||
GridSize: number;
|
||||
GridLeading: number;
|
||||
GridColor: TypeValues;
|
||||
GridLeadingFillColor: TypeValues;
|
||||
AlignLineHeightToGridFlags: boolean;
|
||||
};
|
||||
AntiAlias: number;
|
||||
UseFractionalGlyphWidths: boolean;
|
||||
Rendered?: {
|
||||
Version: number;
|
||||
Shapes?: {
|
||||
WritingDirection: number;
|
||||
Children?: {
|
||||
ShapeType?: number;
|
||||
Procession: number;
|
||||
Lines: {
|
||||
WritingDirection: number;
|
||||
Children: any[];
|
||||
};
|
||||
Cookie?: {
|
||||
Photoshop?: PhotoshopNode;
|
||||
};
|
||||
}[];
|
||||
};
|
||||
};
|
||||
};
|
||||
ResourceDict: ResourceDict;
|
||||
DocumentResources: ResourceDict;
|
||||
}
|
||||
export declare function decodeEngineData(engineData: EngineData): LayerTextData;
|
||||
export declare function encodeEngineData(data: LayerTextData): EngineData;
|
||||
export {};
|
558
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/text.js
generated
vendored
Normal file
558
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/text.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
5
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/utf8.d.ts
generated
vendored
Normal file
5
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/utf8.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
/// <reference types="node" />
|
||||
export declare function stringLengthInBytes(value: string): number;
|
||||
export declare function encodeStringTo(buffer: Uint8Array | Buffer, offset: number, value: string): number;
|
||||
export declare function encodeString(value: string): Uint8Array;
|
||||
export declare function decodeString(value: Uint8Array): string;
|
153
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/utf8.js
generated
vendored
Normal file
153
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/dist/utf8.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/index.d.ts
generated
vendored
Normal file
1
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export * from './dist/index';
|
1
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/index.js
generated
vendored
Normal file
1
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/index.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
module.exports = require('./dist/index.js');
|
1
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/initialize-canvas.js
generated
vendored
Normal file
1
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/initialize-canvas.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
require('./dist/initializeCanvas.js');
|
59
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/package.json
generated
vendored
Normal file
59
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/package.json
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
{
|
||||
"name": "ag-psd",
|
||||
"version": "15.0.1",
|
||||
"description": "Library for reading and writing PSD files",
|
||||
"main": "dist/index.js",
|
||||
"module": "dist-es/index.js",
|
||||
"es2015": "dist-es/index.js",
|
||||
"browser": "dist/index.js",
|
||||
"sideEffects": true,
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Agamnentzar/ag-psd"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "gulp test",
|
||||
"test2": "mocha -R dot dist/test",
|
||||
"dev": "gulp dev --tests",
|
||||
"lint": "tslint -c tslint.json src/ts/**/*.ts",
|
||||
"build": "gulp build && browserify dist/index.js --standalone agPsd -o dist/bundle.js",
|
||||
"rollup": "rollup --format=cjs --external base64-js --file=dist-es/bundle.js --sourcemap --sourcemapFile dist-es/bundle.js.map dist-es/index.js",
|
||||
"prepublishOnly": "npm run build"
|
||||
},
|
||||
"jspm": {
|
||||
"main": "dist/index.js",
|
||||
"jspmNodeConversion": false,
|
||||
"dependencies": {
|
||||
"base64-js": "^1.3.1"
|
||||
}
|
||||
},
|
||||
"keywords": [
|
||||
"psd",
|
||||
"photoshop"
|
||||
],
|
||||
"author": "Agamnentzar",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@types/mocha": "^9.1.1",
|
||||
"@types/node": "^17.0.42",
|
||||
"browserify": "^17.0.0",
|
||||
"canvas": "^2.8.0",
|
||||
"chai": "^4.3.4",
|
||||
"del": "^6.0.0",
|
||||
"gulp": "^4.0.2",
|
||||
"gulp-sourcemaps": "^3.0.0",
|
||||
"gulp-spawn-mocha": "^6.0.0",
|
||||
"gulp-typescript": "^5.0.1",
|
||||
"merge2": "^1.4.1",
|
||||
"mocha": "^6.2.0",
|
||||
"source-map-support": "^0.5.19",
|
||||
"tslint": "^6.1.3",
|
||||
"typescript": "^4.2.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/base64-js": "^1.3.0",
|
||||
"@types/pako": "^2.0.0",
|
||||
"base64-js": "^1.5.1",
|
||||
"pako": "^2.0.4"
|
||||
}
|
||||
}
|
17
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/tsconfig.json
generated
vendored
Normal file
17
ccc-tnt-psd2ui-v2.4.x/node_modules/ag-psd/tsconfig.json
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es5",
|
||||
"module": "commonjs",
|
||||
"lib": ["es2016", "dom"],
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"preserveConstEnums": true,
|
||||
"declaration": true,
|
||||
"useUnknownInCatchVariables": false,
|
||||
"strict": true
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"dist"
|
||||
]
|
||||
}
|
Reference in New Issue
Block a user