labellife-design-tool 2.2.0 → 2.2.1

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.
@@ -1372,15 +1372,22 @@ var _excluded = ["mimeType", "quality", "dpi", "dpiMetadata"],
1372
1372
  _excluded4 = ["fileName"];
1373
1373
 
1374
1374
  // Detect embedded base64 data URLs (data:...;base64,...).
1375
- // These bloat exported JSON significantly (a single image can be 1MB+).
1376
1375
  // Regular http/https/blob URLs are preserved.
1377
1376
  var isBase64DataUrl = function isBase64DataUrl(v) {
1378
1377
  return typeof v === 'string' && v.startsWith('data:') && v.includes(';base64,');
1379
1378
  };
1379
+
1380
+ // Only strip base64 from variable input-field images (inputField: true).
1381
+ // Static design images ARE the template content — stripping them clears the design.
1382
+ // Variable input-field placeholders are replaced at runtime anyway, so stripping
1383
+ // their (usually tiny SVG) placeholder base64 is safe and keeps exports clean.
1380
1384
  var _stripBase64FromElement = function stripBase64FromElement(el) {
1381
1385
  var out = _objectSpread2({}, el);
1382
- if (isBase64DataUrl(out.src)) out.src = '';
1383
- if (isBase64DataUrl(out.clipSrc)) out.clipSrc = '';
1386
+ var isInputField = out.custom && out.custom.inputField;
1387
+ if (isInputField) {
1388
+ if (isBase64DataUrl(out.src)) out.src = '';
1389
+ if (isBase64DataUrl(out.clipSrc)) out.clipSrc = '';
1390
+ }
1384
1391
  if (Array.isArray(out.children)) {
1385
1392
  out.children = out.children.map(_stripBase64FromElement);
1386
1393
  }
@@ -2101,7 +2108,7 @@ var Store = mobxStateTree.types.model('Store', {
2101
2108
  _ref0$fileName = _ref0.fileName,
2102
2109
  fileName = _ref0$fileName === void 0 ? 'design.json' : _ref0$fileName,
2103
2110
  _ref0$stripBase = _ref0.stripBase64,
2104
- stripBase64 = _ref0$stripBase === void 0 ? true : _ref0$stripBase;
2111
+ stripBase64 = _ref0$stripBase === void 0 ? false : _ref0$stripBase;
2105
2112
  var data = stripBase64 ? stripBase64FromExport(self.toJSON()) : self.toJSON();
2106
2113
  var json = JSON.stringify(data, null, 2);
2107
2114
  var blob = new Blob([json], {