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.
package/dist/esm/index.js CHANGED
@@ -1429,15 +1429,22 @@ var _excluded$5 = ["mimeType", "quality", "dpi", "dpiMetadata"],
1429
1429
  _excluded4 = ["fileName"];
1430
1430
 
1431
1431
  // Detect embedded base64 data URLs (data:...;base64,...).
1432
- // These bloat exported JSON significantly (a single image can be 1MB+).
1433
1432
  // Regular http/https/blob URLs are preserved.
1434
1433
  var isBase64DataUrl = function isBase64DataUrl(v) {
1435
1434
  return typeof v === 'string' && v.startsWith('data:') && v.includes(';base64,');
1436
1435
  };
1436
+
1437
+ // Only strip base64 from variable input-field images (inputField: true).
1438
+ // Static design images ARE the template content — stripping them clears the design.
1439
+ // Variable input-field placeholders are replaced at runtime anyway, so stripping
1440
+ // their (usually tiny SVG) placeholder base64 is safe and keeps exports clean.
1437
1441
  var _stripBase64FromElement = function stripBase64FromElement(el) {
1438
1442
  var out = _objectSpread2({}, el);
1439
- if (isBase64DataUrl(out.src)) out.src = '';
1440
- if (isBase64DataUrl(out.clipSrc)) out.clipSrc = '';
1443
+ var isInputField = out.custom && out.custom.inputField;
1444
+ if (isInputField) {
1445
+ if (isBase64DataUrl(out.src)) out.src = '';
1446
+ if (isBase64DataUrl(out.clipSrc)) out.clipSrc = '';
1447
+ }
1441
1448
  if (Array.isArray(out.children)) {
1442
1449
  out.children = out.children.map(_stripBase64FromElement);
1443
1450
  }
@@ -2158,7 +2165,7 @@ var Store = types.model('Store', {
2158
2165
  _ref0$fileName = _ref0.fileName,
2159
2166
  fileName = _ref0$fileName === void 0 ? 'design.json' : _ref0$fileName,
2160
2167
  _ref0$stripBase = _ref0.stripBase64,
2161
- stripBase64 = _ref0$stripBase === void 0 ? true : _ref0$stripBase;
2168
+ stripBase64 = _ref0$stripBase === void 0 ? false : _ref0$stripBase;
2162
2169
  var data = stripBase64 ? stripBase64FromExport(self.toJSON()) : self.toJSON();
2163
2170
  var json = JSON.stringify(data, null, 2);
2164
2171
  var blob = new Blob([json], {