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.
@@ -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
  }
@@ -1614,6 +1621,15 @@ var Store = mobxStateTree.types.model('Store', {
1614
1621
  return el.id !== id;
1615
1622
  });
1616
1623
  },
1624
+ _unresolveInputField: function _unresolveInputField(el) {
1625
+ // Re-insert at the front so it becomes the next field shown (back navigation)
1626
+ var alreadyPending = self._pendingInputFields.some(function (f) {
1627
+ return f.id === el.id;
1628
+ });
1629
+ if (!alreadyPending) {
1630
+ self._pendingInputFields.unshift(el);
1631
+ }
1632
+ },
1617
1633
  clearPendingInputFields: function clearPendingInputFields() {
1618
1634
  self._pendingInputFields = [];
1619
1635
  }
@@ -2101,7 +2117,7 @@ var Store = mobxStateTree.types.model('Store', {
2101
2117
  _ref0$fileName = _ref0.fileName,
2102
2118
  fileName = _ref0$fileName === void 0 ? 'design.json' : _ref0$fileName,
2103
2119
  _ref0$stripBase = _ref0.stripBase64,
2104
- stripBase64 = _ref0$stripBase === void 0 ? true : _ref0$stripBase;
2120
+ stripBase64 = _ref0$stripBase === void 0 ? false : _ref0$stripBase;
2105
2121
  var data = stripBase64 ? stripBase64FromExport(self.toJSON()) : self.toJSON();
2106
2122
  var json = JSON.stringify(data, null, 2);
2107
2123
  var blob = new Blob([json], {