@pixerate/editor 0.140.2 → 0.140.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-QKREDTPW.js → chunk-6UZCFD7Y.js} +6 -1
- package/dist/{chunk-V4GUQCDZ.cjs → chunk-O3ZU6QIZ.cjs} +6 -1
- package/dist/image-editor/index.cjs +579 -579
- package/dist/image-editor/index.js +1 -1
- package/dist/image-editor/layers/text.d.cts +1 -1
- package/dist/image-editor/layers/text.d.ts +1 -1
- package/dist/paint-editor/index.cjs +6 -6
- package/dist/paint-editor/index.js +1 -1
- package/package.json +1 -1
|
@@ -48,7 +48,7 @@ export declare function renderText(layer: TypeLayer, env: TextEnv): {
|
|
|
48
48
|
/** The layer drawn again (`rendering` and `missingFonts` updated); refuses when nothing can draw it. */
|
|
49
49
|
export declare function rerenderText(layer: TypeLayer, env: TextEnv): TypeLayer;
|
|
50
50
|
/** Fields of `TextStyle` an edit can set (`null` clears an optional one). */
|
|
51
|
-
export declare const TEXT_STYLE_FIELDS: readonly ["fontFamily", "fontWeight", "italic", "fontSize", "color", "opacity", "tracking", "leading", "baselineShift", "underline", "strikethrough"];
|
|
51
|
+
export declare const TEXT_STYLE_FIELDS: readonly ["fontFamily", "fontWeight", "italic", "fontSize", "color", "opacity", "tracking", "leading", "baselineShift", "underline", "strikethrough", "postScriptName"];
|
|
52
52
|
/** `base` with the given style fields changed, validated (`null` clears leading, tracking, …). */
|
|
53
53
|
export declare function patchTextStyle(base: TextStyle, patch: Record<string, unknown>, path?: string): TextStyle;
|
|
54
54
|
export declare const PARAGRAPH_STYLE_FIELDS: readonly ["align", "autoLeading", "firstLineIndent", "startIndent", "endIndent", "spaceBefore", "spaceAfter"];
|
|
@@ -48,7 +48,7 @@ export declare function renderText(layer: TypeLayer, env: TextEnv): {
|
|
|
48
48
|
/** The layer drawn again (`rendering` and `missingFonts` updated); refuses when nothing can draw it. */
|
|
49
49
|
export declare function rerenderText(layer: TypeLayer, env: TextEnv): TypeLayer;
|
|
50
50
|
/** Fields of `TextStyle` an edit can set (`null` clears an optional one). */
|
|
51
|
-
export declare const TEXT_STYLE_FIELDS: readonly ["fontFamily", "fontWeight", "italic", "fontSize", "color", "opacity", "tracking", "leading", "baselineShift", "underline", "strikethrough"];
|
|
51
|
+
export declare const TEXT_STYLE_FIELDS: readonly ["fontFamily", "fontWeight", "italic", "fontSize", "color", "opacity", "tracking", "leading", "baselineShift", "underline", "strikethrough", "postScriptName"];
|
|
52
52
|
/** `base` with the given style fields changed, validated (`null` clears leading, tracking, …). */
|
|
53
53
|
export declare function patchTextStyle(base: TextStyle, patch: Record<string, unknown>, path?: string): TextStyle;
|
|
54
54
|
export declare const PARAGRAPH_STYLE_FIELDS: readonly ["align", "autoLeading", "firstLineIndent", "startIndent", "endIndent", "spaceBefore", "spaceAfter"];
|
|
@@ -7,7 +7,7 @@ var _chunkVKF3PWKRcjs = require('../chunk-VKF3PWKR.cjs');
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkO3ZU6QIZcjs = require('../chunk-O3ZU6QIZ.cjs');
|
|
11
11
|
require('../chunk-A2IS7EHE.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
@@ -1627,11 +1627,11 @@ function header(state, options) {
|
|
|
1627
1627
|
return out;
|
|
1628
1628
|
}
|
|
1629
1629
|
function serializePaintDocument(state, options = {}) {
|
|
1630
|
-
const { layers, assets } =
|
|
1630
|
+
const { layers, assets } = _chunkO3ZU6QIZcjs.serializeLayers.call(void 0, state.layers);
|
|
1631
1631
|
return { ...header(state, options), layers, assets };
|
|
1632
1632
|
}
|
|
1633
1633
|
async function serializePaintDocumentExternal(state, store, options = {}) {
|
|
1634
|
-
const { layers, assets } = await
|
|
1634
|
+
const { layers, assets } = await _chunkO3ZU6QIZcjs.serializeLayersExternal.call(void 0, state.layers, store);
|
|
1635
1635
|
return { ...header(state, options), layers, assets };
|
|
1636
1636
|
}
|
|
1637
1637
|
function paintLayersOnly(layers, problems) {
|
|
@@ -1668,7 +1668,7 @@ function deserializePaintDocument(raw) {
|
|
|
1668
1668
|
const canvas = normalizeCanvas({ width: r.width, height: r.height, dpi: _nullishCoalesce(r.dpi, () => ( void 0)) });
|
|
1669
1669
|
const paper = _chunkBXMIBMVGcjs.normalizePaper.call(void 0, _nullishCoalesce(r.paper, () => ( {})));
|
|
1670
1670
|
const assets = r.assets && typeof r.assets === "object" ? r.assets : {};
|
|
1671
|
-
const layers = paintLayersOnly(
|
|
1671
|
+
const layers = paintLayersOnly(_chunkO3ZU6QIZcjs.deserializeLayers.call(void 0, r.layers, { assets, problems }), problems);
|
|
1672
1672
|
const wanted = typeof r.activeLayerId === "string" ? r.activeLayerId : null;
|
|
1673
1673
|
const activeLayerId = wanted && _chunkHGTDMKNEcjs.findLayer.call(void 0, layers, wanted) ? wanted : _nullishCoalesce(_optionalChain([_chunkHGTDMKNEcjs.flattenLayers.call(void 0, layers), 'access', _70 => _70.filter, 'call', _71 => _71((l) => l.type === "pixel"), 'access', _72 => _72.pop, 'call', _73 => _73(), 'optionalAccess', _74 => _74.id]), () => ( null));
|
|
1674
1674
|
const wetEvents = Array.isArray(r.wetEvents) ? r.wetEvents.filter((e) => e && typeof e === "object" && Number.isInteger(e.clock) && typeof e.kind === "string") : [];
|
|
@@ -1682,7 +1682,7 @@ async function deserializePaintDocumentAsync(raw, store) {
|
|
|
1682
1682
|
if (!raw || typeof raw !== "object") throw new Error("Not a paint document: expected a JSON object.");
|
|
1683
1683
|
const r = raw;
|
|
1684
1684
|
const problems = [];
|
|
1685
|
-
const assets = await
|
|
1685
|
+
const assets = await _chunkO3ZU6QIZcjs.resolveExternalAssets.call(void 0, _nullishCoalesce(r.assets, () => ( {})), store, problems);
|
|
1686
1686
|
const loaded = deserializePaintDocument({ ...r, assets });
|
|
1687
1687
|
return { ...loaded, problems: [...problems, ...loaded.problems] };
|
|
1688
1688
|
}
|
|
@@ -5346,7 +5346,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
5346
5346
|
return next.type === "group" ? { ...next, children: toStandard(next.children) } : next;
|
|
5347
5347
|
});
|
|
5348
5348
|
const layers = toStandard(dried);
|
|
5349
|
-
const result =
|
|
5349
|
+
const result = _chunkO3ZU6QIZcjs.exportPsd.call(void 0, { width, height, layers: [paperLayer, ...layers], merged, resolution: dpi });
|
|
5350
5350
|
for (const [mode, names] of changed) {
|
|
5351
5351
|
const label = _nullishCoalesce(_optionalChain([_chunkCWM3CUUXcjs.BLEND_MODES, 'access', _268 => _268.find, 'call', _269 => _269((m) => m.id === mode), 'optionalAccess', _270 => _270.label]), () => ( mode));
|
|
5352
5352
|
const std = _nullishCoalesce(_optionalChain([_chunkCWM3CUUXcjs.BLEND_MODES, 'access', _271 => _271.find, 'call', _272 => _272((m) => m.id === _chunkCWM3CUUXcjs.standardBlendMode.call(void 0, mode)), 'optionalAccess', _273 => _273.label]), () => ( _chunkCWM3CUUXcjs.standardBlendMode.call(void 0, mode)));
|