@hortonstudio/main 1.1.4 → 1.1.5

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.
Files changed (2) hide show
  1. package/index.js +2 -33
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,5 +1,4 @@
1
1
  // Configuration: Change this variable to rename the API
2
- console.log('🚀 SCRIPT FILE LOADED');
3
2
  const API_NAME = 'hsmain';
4
3
 
5
4
  window[API_NAME] = window[API_NAME] || {};
@@ -13,8 +12,7 @@ const animationModules = {
13
12
 
14
13
  const utilityModules = {
15
14
  "data-hs-util-toc": "./utils/toc.js",
16
- "data-hs-util-progress": "./utils/scroll-progress.js",
17
- "data-hs-util-navbar": "./utils/navbar.js"
15
+ "data-hs-util-progress": "./utils/scroll-progress.js"
18
16
  };
19
17
 
20
18
  // Modules that auto-initialize
@@ -25,23 +23,6 @@ const autoInitModules = {
25
23
  // Store callbacks to run after Webflow.ready()
26
24
  const postWebflowCallbacks = [];
27
25
 
28
- // Get the base URL from the current script's location
29
- const getBaseUrl = () => {
30
- const currentScript = document.querySelector('script[data-hs-main]');
31
- console.log('🔍 Script tag found:', currentScript);
32
- console.log('🔍 Script src:', currentScript?.src);
33
-
34
- if (currentScript && currentScript.src) {
35
- const result = currentScript.src.substring(0, currentScript.src.lastIndexOf('/') + 1);
36
- console.log('🔍 Base URL from script:', result);
37
- return result;
38
- }
39
-
40
- const fallback = new URL('./', import.meta.url).href;
41
- console.log('🔍 Base URL from import.meta:', fallback);
42
- return fallback;
43
- };
44
-
45
26
  const loadModule = (moduleName) => {
46
27
  // Check manual modules first
47
28
  let modulePath = animationModules[moduleName] || utilityModules[moduleName];
@@ -54,18 +35,7 @@ const loadModule = (moduleName) => {
54
35
  if (!modulePath) {
55
36
  throw new Error(`HortonStudio module "${moduleName}" is not supported.`);
56
37
  }
57
-
58
- // Convert relative path to absolute URL
59
- const baseUrl = getBaseUrl();
60
- const absoluteUrl = new URL(modulePath, baseUrl).href;
61
-
62
- // DEBUG: Log what URLs we're creating
63
- console.log('🔍 Debug info for module:', moduleName);
64
- console.log(' - Base URL:', baseUrl);
65
- console.log(' - Module path:', modulePath);
66
- console.log(' - Final URL:', absoluteUrl);
67
-
68
- return import(absoluteUrl);
38
+ return import(modulePath);
69
39
  };
70
40
 
71
41
  const findCurrentScriptTag = () => {
@@ -157,7 +127,6 @@ const loadHsModule = async (moduleName) => {
157
127
  };
158
128
 
159
129
  const initializeAPI = () => {
160
- console.log('🔍 Initializing HortonStudio API...');
161
130
  const apiInstance = window[API_NAME];
162
131
 
163
132
  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.4",
3
+ "version": "1.1.5",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "scripts": {