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