@pixerate/editor 0.114.0 → 0.115.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.
@@ -4,7 +4,7 @@
4
4
 
5
5
 
6
6
 
7
- var _chunk5OVJHMZQcjs = require('../chunk-5OVJHMZQ.cjs');
7
+ var _chunkI7FQBWMQcjs = require('../chunk-I7FQBWMQ.cjs');
8
8
 
9
9
 
10
10
 
@@ -69,6 +69,7 @@ var _chunkTCKIXI46cjs = require('../chunk-TCKIXI46.cjs');
69
69
 
70
70
 
71
71
  var _chunkTFOPHZ3Ucjs = require('../chunk-TFOPHZ3U.cjs');
72
+ require('../chunk-G5NMLUVF.cjs');
72
73
  require('../chunk-643B2HKC.cjs');
73
74
 
74
75
 
@@ -1698,11 +1699,11 @@ function header(state, options) {
1698
1699
  return out;
1699
1700
  }
1700
1701
  function serializePaintDocument(state, options = {}) {
1701
- const { layers, assets } = _chunk5OVJHMZQcjs.serializeLayers.call(void 0, state.layers);
1702
+ const { layers, assets } = _chunkI7FQBWMQcjs.serializeLayers.call(void 0, state.layers);
1702
1703
  return { ...header(state, options), layers, assets };
1703
1704
  }
1704
1705
  async function serializePaintDocumentExternal(state, store, options = {}) {
1705
- const { layers, assets } = await _chunk5OVJHMZQcjs.serializeLayersExternal.call(void 0, state.layers, store);
1706
+ const { layers, assets } = await _chunkI7FQBWMQcjs.serializeLayersExternal.call(void 0, state.layers, store);
1706
1707
  return { ...header(state, options), layers, assets };
1707
1708
  }
1708
1709
  function paintLayersOnly(layers, problems) {
@@ -1739,7 +1740,7 @@ function deserializePaintDocument(raw) {
1739
1740
  const canvas = normalizeCanvas({ width: r.width, height: r.height, dpi: _nullishCoalesce(r.dpi, () => ( void 0)) });
1740
1741
  const paper = normalizePaper(_nullishCoalesce(r.paper, () => ( {})));
1741
1742
  const assets = r.assets && typeof r.assets === "object" ? r.assets : {};
1742
- const layers = paintLayersOnly(_chunk5OVJHMZQcjs.deserializeLayers.call(void 0, r.layers, { assets, problems }), problems);
1743
+ const layers = paintLayersOnly(_chunkI7FQBWMQcjs.deserializeLayers.call(void 0, r.layers, { assets, problems }), problems);
1743
1744
  const wanted = typeof r.activeLayerId === "string" ? r.activeLayerId : null;
1744
1745
  const activeLayerId = wanted && _chunkST7E3NEEcjs.findLayer.call(void 0, layers, wanted) ? wanted : _nullishCoalesce(_optionalChain([_chunkST7E3NEEcjs.flattenLayers.call(void 0, layers), 'access', _33 => _33.filter, 'call', _34 => _34((l) => l.type === "pixel"), 'access', _35 => _35.pop, 'call', _36 => _36(), 'optionalAccess', _37 => _37.id]), () => ( null));
1745
1746
  return { state: { canvas, paper, layers, activeLayerId, strokes: readStrokes(r.strokes, problems) }, extensions: documentExtensions(r), guides: r.guides, swatches: r.swatches, mixingPad: r.mixingPad, problems };
@@ -1748,7 +1749,7 @@ async function deserializePaintDocumentAsync(raw, store) {
1748
1749
  if (!raw || typeof raw !== "object") throw new Error("Not a paint document: expected a JSON object.");
1749
1750
  const r = raw;
1750
1751
  const problems = [];
1751
- const assets = await _chunk5OVJHMZQcjs.resolveExternalAssets.call(void 0, _nullishCoalesce(r.assets, () => ( {})), store, problems);
1752
+ const assets = await _chunkI7FQBWMQcjs.resolveExternalAssets.call(void 0, _nullishCoalesce(r.assets, () => ( {})), store, problems);
1752
1753
  const loaded = deserializePaintDocument({ ...r, assets });
1753
1754
  return { ...loaded, problems: [...problems, ...loaded.problems] };
1754
1755
  }
@@ -3421,7 +3422,7 @@ var PaintEditorController = (_class10 = class {
3421
3422
  return next.type === "group" ? { ...next, children: toStandard(next.children) } : next;
3422
3423
  });
3423
3424
  const layers = toStandard(this.doc.layers);
3424
- const result = _chunk5OVJHMZQcjs.exportPsd.call(void 0, { width, height, layers: [paperLayer, ...layers], merged, resolution: dpi });
3425
+ const result = _chunkI7FQBWMQcjs.exportPsd.call(void 0, { width, height, layers: [paperLayer, ...layers], merged, resolution: dpi });
3425
3426
  for (const [mode, names] of changed) {
3426
3427
  const label = _nullishCoalesce(_optionalChain([_chunkTFOPHZ3Ucjs.BLEND_MODES, 'access', _81 => _81.find, 'call', _82 => _82((m) => m.id === mode), 'optionalAccess', _83 => _83.label]), () => ( mode));
3427
3428
  const std = _nullishCoalesce(_optionalChain([_chunkTFOPHZ3Ucjs.BLEND_MODES, 'access', _84 => _84.find, 'call', _85 => _85((m) => m.id === _chunkTFOPHZ3Ucjs.standardBlendMode.call(void 0, mode)), 'optionalAccess', _86 => _86.label]), () => ( _chunkTFOPHZ3Ucjs.standardBlendMode.call(void 0, mode)));