@hortonstudio/main 1.1.1 → 1.1.3
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/.claude/settings.local.json +2 -1
- package/index.js +17 -4
- package/package.json +1 -1
package/index.js
CHANGED
@@ -27,12 +27,18 @@ const postWebflowCallbacks = [];
|
|
27
27
|
// Get the base URL from the current script's location
|
28
28
|
const getBaseUrl = () => {
|
29
29
|
const currentScript = document.querySelector('script[data-hs-main]');
|
30
|
+
console.log('🔍 Script tag found:', currentScript);
|
31
|
+
console.log('🔍 Script src:', currentScript?.src);
|
32
|
+
|
30
33
|
if (currentScript && currentScript.src) {
|
31
|
-
|
32
|
-
|
34
|
+
const result = currentScript.src.substring(0, currentScript.src.lastIndexOf('/') + 1);
|
35
|
+
console.log('🔍 Base URL from script:', result);
|
36
|
+
return result;
|
33
37
|
}
|
34
|
-
|
35
|
-
|
38
|
+
|
39
|
+
const fallback = new URL('./', import.meta.url).href;
|
40
|
+
console.log('🔍 Base URL from import.meta:', fallback);
|
41
|
+
return fallback;
|
36
42
|
};
|
37
43
|
|
38
44
|
const loadModule = (moduleName) => {
|
@@ -52,6 +58,12 @@ const loadModule = (moduleName) => {
|
|
52
58
|
const baseUrl = getBaseUrl();
|
53
59
|
const absoluteUrl = new URL(modulePath, baseUrl).href;
|
54
60
|
|
61
|
+
// DEBUG: Log what URLs we're creating
|
62
|
+
console.log('🔍 Debug info for module:', moduleName);
|
63
|
+
console.log(' - Base URL:', baseUrl);
|
64
|
+
console.log(' - Module path:', modulePath);
|
65
|
+
console.log(' - Final URL:', absoluteUrl);
|
66
|
+
|
55
67
|
return import(absoluteUrl);
|
56
68
|
};
|
57
69
|
|
@@ -144,6 +156,7 @@ const loadHsModule = async (moduleName) => {
|
|
144
156
|
};
|
145
157
|
|
146
158
|
const initializeAPI = () => {
|
159
|
+
console.log('🔍 Initializing HortonStudio API...');
|
147
160
|
const apiInstance = window[API_NAME];
|
148
161
|
|
149
162
|
const existingRequests = Array.isArray(apiInstance) ? apiInstance : [];
|