labellife-design-tool 2.2.0 → 2.2.2

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.
@@ -1368,15 +1368,22 @@ var _excluded = ["mimeType", "quality", "dpi", "dpiMetadata"],
1368
1368
  _excluded4 = ["fileName"];
1369
1369
 
1370
1370
  // Detect embedded base64 data URLs (data:...;base64,...).
1371
- // These bloat exported JSON significantly (a single image can be 1MB+).
1372
1371
  // Regular http/https/blob URLs are preserved.
1373
1372
  var isBase64DataUrl = function isBase64DataUrl(v) {
1374
1373
  return typeof v === 'string' && v.startsWith('data:') && v.includes(';base64,');
1375
1374
  };
1375
+
1376
+ // Only strip base64 from variable input-field images (inputField: true).
1377
+ // Static design images ARE the template content — stripping them clears the design.
1378
+ // Variable input-field placeholders are replaced at runtime anyway, so stripping
1379
+ // their (usually tiny SVG) placeholder base64 is safe and keeps exports clean.
1376
1380
  var _stripBase64FromElement = function stripBase64FromElement(el) {
1377
1381
  var out = _objectSpread2({}, el);
1378
- if (isBase64DataUrl(out.src)) out.src = '';
1379
- if (isBase64DataUrl(out.clipSrc)) out.clipSrc = '';
1382
+ var isInputField = out.custom && out.custom.inputField;
1383
+ if (isInputField) {
1384
+ if (isBase64DataUrl(out.src)) out.src = '';
1385
+ if (isBase64DataUrl(out.clipSrc)) out.clipSrc = '';
1386
+ }
1380
1387
  if (Array.isArray(out.children)) {
1381
1388
  out.children = out.children.map(_stripBase64FromElement);
1382
1389
  }
@@ -1610,6 +1617,15 @@ var Store = types.model('Store', {
1610
1617
  return el.id !== id;
1611
1618
  });
1612
1619
  },
1620
+ _unresolveInputField: function _unresolveInputField(el) {
1621
+ // Re-insert at the front so it becomes the next field shown (back navigation)
1622
+ var alreadyPending = self._pendingInputFields.some(function (f) {
1623
+ return f.id === el.id;
1624
+ });
1625
+ if (!alreadyPending) {
1626
+ self._pendingInputFields.unshift(el);
1627
+ }
1628
+ },
1613
1629
  clearPendingInputFields: function clearPendingInputFields() {
1614
1630
  self._pendingInputFields = [];
1615
1631
  }
@@ -2097,7 +2113,7 @@ var Store = types.model('Store', {
2097
2113
  _ref0$fileName = _ref0.fileName,
2098
2114
  fileName = _ref0$fileName === void 0 ? 'design.json' : _ref0$fileName,
2099
2115
  _ref0$stripBase = _ref0.stripBase64,
2100
- stripBase64 = _ref0$stripBase === void 0 ? true : _ref0$stripBase;
2116
+ stripBase64 = _ref0$stripBase === void 0 ? false : _ref0$stripBase;
2101
2117
  var data = stripBase64 ? stripBase64FromExport(self.toJSON()) : self.toJSON();
2102
2118
  var json = JSON.stringify(data, null, 2);
2103
2119
  var blob = new Blob([json], {