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