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