@pixerate/editor 0.219.2 → 0.220.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-S55JFWDA.cjs → chunk-R35YOUP2.cjs} +407 -161
- package/dist/{chunk-F7Z2MKY2.js → chunk-S6KKLFZO.js} +261 -15
- package/dist/image-editor/controller.d.cts +25 -1
- package/dist/image-editor/controller.d.ts +25 -1
- package/dist/image-editor/index.cjs +1239 -1107
- package/dist/image-editor/index.d.cts +1 -0
- package/dist/image-editor/index.d.ts +1 -0
- package/dist/image-editor/index.js +147 -15
- package/dist/image-editor/layers/hybrid-mask.d.cts +31 -0
- package/dist/image-editor/layers/hybrid-mask.d.ts +31 -0
- package/dist/image-editor/layers/model.d.cts +17 -0
- package/dist/image-editor/layers/model.d.ts +17 -0
- package/dist/image-editor/layers/serialize.d.cts +2 -0
- package/dist/image-editor/layers/serialize.d.ts +2 -0
- package/dist/image-editor/layers/vector-mask.d.cts +10 -5
- package/dist/image-editor/layers/vector-mask.d.ts +10 -5
- package/dist/image-editor/path-edit.d.cts +4 -0
- package/dist/image-editor/path-edit.d.ts +4 -0
- package/dist/paint-editor/index.cjs +6 -6
- package/dist/paint-editor/index.js +1 -1
- package/package.json +1 -1
|
@@ -7,7 +7,7 @@ var _chunkZ64NRDEHcjs = require('../chunk-Z64NRDEH.cjs');
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkR35YOUP2cjs = require('../chunk-R35YOUP2.cjs');
|
|
11
11
|
require('../chunk-A2IS7EHE.cjs');
|
|
12
12
|
require('../chunk-SS53NNZO.cjs');
|
|
13
13
|
|
|
@@ -1659,11 +1659,11 @@ function header(state, options) {
|
|
|
1659
1659
|
return out;
|
|
1660
1660
|
}
|
|
1661
1661
|
function serializePaintDocument(state, options = {}) {
|
|
1662
|
-
const { layers, assets } =
|
|
1662
|
+
const { layers, assets } = _chunkR35YOUP2cjs.serializeLayers.call(void 0, state.layers);
|
|
1663
1663
|
return { ...header(state, options), layers, assets };
|
|
1664
1664
|
}
|
|
1665
1665
|
async function serializePaintDocumentExternal(state, store, options = {}) {
|
|
1666
|
-
const { layers, assets } = await
|
|
1666
|
+
const { layers, assets } = await _chunkR35YOUP2cjs.serializeLayersExternal.call(void 0, state.layers, store);
|
|
1667
1667
|
return { ...header(state, options), layers, assets };
|
|
1668
1668
|
}
|
|
1669
1669
|
function paintLayersOnly(layers, problems) {
|
|
@@ -1700,7 +1700,7 @@ function deserializePaintDocument(raw) {
|
|
|
1700
1700
|
const canvas = normalizeCanvas({ width: r.width, height: r.height, dpi: _nullishCoalesce(r.dpi, () => ( void 0)) });
|
|
1701
1701
|
const paper = _chunkROVK6AXXcjs.normalizePaper.call(void 0, _nullishCoalesce(r.paper, () => ( {})));
|
|
1702
1702
|
const assets = r.assets && typeof r.assets === "object" ? r.assets : {};
|
|
1703
|
-
const layers = paintLayersOnly(
|
|
1703
|
+
const layers = paintLayersOnly(_chunkR35YOUP2cjs.deserializeLayers.call(void 0, r.layers, { assets, problems }), problems);
|
|
1704
1704
|
const wanted = typeof r.activeLayerId === "string" ? r.activeLayerId : null;
|
|
1705
1705
|
const activeLayerId = wanted && _chunkB46UQUDCcjs.findLayer.call(void 0, layers, wanted) ? wanted : _nullishCoalesce(_optionalChain([_chunkB46UQUDCcjs.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));
|
|
1706
1706
|
const wetEvents = Array.isArray(r.wetEvents) ? r.wetEvents.filter((e) => e && typeof e === "object" && Number.isInteger(e.clock) && typeof e.kind === "string") : [];
|
|
@@ -1716,7 +1716,7 @@ async function deserializePaintDocumentAsync(raw, store) {
|
|
|
1716
1716
|
if (!raw || typeof raw !== "object") throw new Error("Not a paint document: expected a JSON object.");
|
|
1717
1717
|
const r = raw;
|
|
1718
1718
|
const problems = [];
|
|
1719
|
-
const assets = await
|
|
1719
|
+
const assets = await _chunkR35YOUP2cjs.resolveExternalAssets.call(void 0, _nullishCoalesce(r.assets, () => ( {})), store, problems);
|
|
1720
1720
|
const loaded = deserializePaintDocument({ ...r, assets });
|
|
1721
1721
|
return { ...loaded, problems: [...problems, ...loaded.problems] };
|
|
1722
1722
|
}
|
|
@@ -5468,7 +5468,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
5468
5468
|
return next.type === "group" ? { ...next, children: toStandard(next.children) } : next;
|
|
5469
5469
|
});
|
|
5470
5470
|
const layers = toStandard(dried);
|
|
5471
|
-
const result =
|
|
5471
|
+
const result = _chunkR35YOUP2cjs.exportPsd.call(void 0, { width, height, layers: [paperLayer, ...layers], merged, resolution: dpi });
|
|
5472
5472
|
for (const [mode, names] of changed) {
|
|
5473
5473
|
const label = _nullishCoalesce(_optionalChain([_chunkOLNIPTB3cjs.BLEND_MODES, 'access', _279 => _279.find, 'call', _280 => _280((m) => m.id === mode), 'optionalAccess', _281 => _281.label]), () => ( mode));
|
|
5474
5474
|
const std = _nullishCoalesce(_optionalChain([_chunkOLNIPTB3cjs.BLEND_MODES, 'access', _282 => _282.find, 'call', _283 => _283((m) => m.id === _chunkOLNIPTB3cjs.standardBlendMode.call(void 0, mode)), 'optionalAccess', _284 => _284.label]), () => ( _chunkOLNIPTB3cjs.standardBlendMode.call(void 0, mode)));
|