labellife-design-tool 2.0.9 → 2.1.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/canvas/workspace.js +22 -7
- package/dist/cjs/canvas/workspace.js.map +1 -1
- package/dist/cjs/config.js +15 -4
- package/dist/cjs/config.js.map +1 -1
- package/dist/cjs/index.js +66 -19
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/model/store.js +40 -10
- package/dist/cjs/model/store.js.map +1 -1
- package/dist/cjs/side-panel/index.js +11 -2
- package/dist/cjs/side-panel/index.js.map +1 -1
- package/dist/cjs/side-panel/side-panel.js +11 -2
- package/dist/cjs/side-panel/side-panel.js.map +1 -1
- package/dist/cjs/toolbar/toolbar.js +11 -2
- package/dist/cjs/toolbar/toolbar.js.map +1 -1
- package/dist/esm/canvas/workspace.js +22 -7
- package/dist/esm/canvas/workspace.js.map +1 -1
- package/dist/esm/config.js +15 -4
- package/dist/esm/config.js.map +1 -1
- package/dist/esm/index.js +66 -19
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/model/store.js +40 -10
- package/dist/esm/model/store.js.map +1 -1
- package/dist/esm/side-panel/index.js +11 -2
- package/dist/esm/side-panel/index.js.map +1 -1
- package/dist/esm/side-panel/side-panel.js +11 -2
- package/dist/esm/side-panel/side-panel.js.map +1 -1
- package/dist/esm/toolbar/toolbar.js +11 -2
- package/dist/esm/toolbar/toolbar.js.map +1 -1
- package/package.json +1 -1
|
@@ -168,11 +168,20 @@ function _unsupportedIterableToArray(r, a) {
|
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
|
|
171
|
-
|
|
171
|
+
// Use a window-level singleton so that all Rollup bundles (config, toolbar,
|
|
172
|
+
// side-panel, canvas) share the same translations object. Without this each
|
|
173
|
+
// bundle gets its own copy of this module with a separate local variable.
|
|
174
|
+
var GLOBAL_KEY = '__labellife_translations__';
|
|
175
|
+
if (typeof window !== 'undefined' && !window[GLOBAL_KEY]) {
|
|
176
|
+
window[GLOBAL_KEY] = {};
|
|
177
|
+
}
|
|
178
|
+
function _get() {
|
|
179
|
+
return typeof window !== 'undefined' && window[GLOBAL_KEY] || {};
|
|
180
|
+
}
|
|
172
181
|
function t(key, defaultValue) {
|
|
173
182
|
// Support dot-notation paths like 'toolbar.duration'
|
|
174
183
|
var parts = key.split('.');
|
|
175
|
-
var current =
|
|
184
|
+
var current = _get();
|
|
176
185
|
var _iterator = _createForOfIteratorHelper(parts),
|
|
177
186
|
_step;
|
|
178
187
|
try {
|
|
@@ -1993,15 +2002,21 @@ var Workspace = mobxReactLite.observer(function (_ref6) {
|
|
|
1993
2002
|
height: height
|
|
1994
2003
|
});
|
|
1995
2004
|
|
|
1996
|
-
// Auto-fit the canvas
|
|
1997
|
-
if
|
|
2005
|
+
// Auto-fit the canvas.
|
|
2006
|
+
// Guard: if the container hasn't been laid out yet (width/height === 0)
|
|
2007
|
+
// the arithmetic produces a negative scale which mirrors the entire canvas.
|
|
2008
|
+
// Skip the update in that case — the ResizeObserver will fire again once
|
|
2009
|
+
// the container has real dimensions.
|
|
2010
|
+
if (store.width > 0 && store.height > 0 && width > 0 && height > 0) {
|
|
1998
2011
|
var padding = 40;
|
|
1999
2012
|
var scaleX = (width - padding * 2) / store.width;
|
|
2000
2013
|
var scaleY = (height - padding * 2) / store.height;
|
|
2001
2014
|
var _scale = Math.min(scaleX, scaleY, 1);
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
store.
|
|
2015
|
+
if (_scale > 0) {
|
|
2016
|
+
store._setScaleToFit(_scale);
|
|
2017
|
+
if (store.scale === 1) {
|
|
2018
|
+
store.setScale(_scale);
|
|
2019
|
+
}
|
|
2005
2020
|
}
|
|
2006
2021
|
}
|
|
2007
2022
|
};
|