labellife-design-tool 2.1.9 → 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 +16 -8
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/model/store.js +11 -4
- package/dist/cjs/model/store.js.map +1 -1
- package/dist/cjs/toolbar/toolbar.js +5 -4
- package/dist/cjs/toolbar/toolbar.js.map +1 -1
- package/dist/esm/index.js +16 -8
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/model/store.js +11 -4
- package/dist/esm/model/store.js.map +1 -1
- package/dist/esm/toolbar/toolbar.js +5 -4
- package/dist/esm/toolbar/toolbar.js.map +1 -1
- package/package.json +1 -1
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
|
-
|
|
1442
|
-
if (
|
|
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 ?
|
|
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], {
|
|
@@ -8870,7 +8877,7 @@ var Toolbar = mobxReactLite.observer(function (_ref11) {
|
|
|
8870
8877
|
children: [/*#__PURE__*/jsxRuntime.jsxs(material.Box, {
|
|
8871
8878
|
sx: _objectSpread2(_objectSpread2({}, rowSx), {}, {
|
|
8872
8879
|
minHeight: 52,
|
|
8873
|
-
borderBottom:
|
|
8880
|
+
borderBottom: '1px solid #f0f0f0'
|
|
8874
8881
|
}),
|
|
8875
8882
|
children: [/*#__PURE__*/jsxRuntime.jsx(material.Tooltip, {
|
|
8876
8883
|
title: t('toolbar.undo', 'Undo'),
|
|
@@ -8983,12 +8990,13 @@ var Toolbar = mobxReactLite.observer(function (_ref11) {
|
|
|
8983
8990
|
}), DownloadButton && /*#__PURE__*/jsxRuntime.jsx(DownloadButton, {
|
|
8984
8991
|
store: store
|
|
8985
8992
|
})]
|
|
8986
|
-
}),
|
|
8993
|
+
}), /*#__PURE__*/jsxRuntime.jsx(material.Box, {
|
|
8987
8994
|
sx: _objectSpread2(_objectSpread2({}, rowSx), {}, {
|
|
8988
8995
|
minHeight: 44,
|
|
8989
|
-
backgroundColor: '#fafafa'
|
|
8996
|
+
backgroundColor: '#fafafa',
|
|
8997
|
+
visibility: element ? 'visible' : 'hidden'
|
|
8990
8998
|
}),
|
|
8991
|
-
children: /*#__PURE__*/jsxRuntime.jsx(CommonControls, {
|
|
8999
|
+
children: element && /*#__PURE__*/jsxRuntime.jsx(CommonControls, {
|
|
8992
9000
|
element: element,
|
|
8993
9001
|
store: store
|
|
8994
9002
|
})
|