sparkecode-devtools 0.1.43 → 0.1.44

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sparkecode-devtools",
3
- "version": "0.1.43",
3
+ "version": "0.1.44",
4
4
  "description": "Sparkecode Dev Tools for selecting and sharing components.",
5
5
  "type": "module",
6
6
  "main": "sparkecode-select.js",
@@ -1160,6 +1160,7 @@
1160
1160
 
1161
1161
  const iframe = document.getElementById('sparkecode-webframe-iframe');
1162
1162
  const loading = document.getElementById('sparkecode-webframe-loading');
1163
+ if (!webFrame || !iframe) return;
1163
1164
 
1164
1165
  // Build embed URL with session ID
1165
1166
  let url = getWebUiUrl();
@@ -1168,6 +1169,13 @@
1168
1169
  } else {
1169
1170
  url += '/embed';
1170
1171
  }
1172
+
1173
+ // Pass API base via query param so embed can reach the server
1174
+ const apiUrl = config.sparkecoder?.apiBase || sparkecoderState.apiBase;
1175
+ if (apiUrl) {
1176
+ const joiner = url.includes('?') ? '&' : '?';
1177
+ url += `${joiner}apiUrl=${encodeURIComponent(apiUrl)}`;
1178
+ }
1171
1179
 
1172
1180
  if (iframe && iframe.src !== url) {
1173
1181
  if (loading) loading.style.display = 'flex';