@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.
@@ -12,7 +12,8 @@
12
12
  "Bash(mv:*)",
13
13
  "WebFetch(domain:www.compassfacilities.com)",
14
14
  "mcp__webflow__pages_list",
15
- "Bash(npm publish:*)"
15
+ "Bash(npm publish:*)",
16
+ "Bash(npm version:*)"
16
17
  ],
17
18
  "deny": []
18
19
  }
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
- // Extract directory path from script URL
32
- return currentScript.src.substring(0, currentScript.src.lastIndexOf('/') + 1);
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
- // Fallback to current origin + path for relative imports
35
- return new URL('./', import.meta.url).href;
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 : [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hortonstudio/main",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "scripts": {