labellife-design-tool 2.5.1 → 2.5.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.
@@ -418,9 +418,14 @@ function t(key, defaultValue) {
418
418
  }
419
419
 
420
420
  // ── Backend API base URL (used by background-panel.js's Unsplash proxy calls) ─
421
- var _apiBaseUrl = '';
421
+ // Window-level singleton, same reasoning as translations/input-fields config above:
422
+ // each Rollup output bundle (index, side-panel, toolbar, canvas...) gets its own copy
423
+ // of this module, so a plain closure variable set from one bundle (e.g. via the host
424
+ // app's top-level `labellife-design-tool/config` import) would never be seen by another
425
+ // bundle (e.g. background-panel.js, built into the side-panel bundle).
426
+ var API_BASE_URL_KEY = '__labellife_api_base_url__';
422
427
  function getApiBaseUrl() {
423
- return _apiBaseUrl;
428
+ return typeof window !== 'undefined' && window[API_BASE_URL_KEY] || '';
424
429
  }
425
430
 
426
431
  // ── Input Fields Dialog Config ───────────────────────────────────────