@hortonstudio/main 1.2.20 → 1.2.22

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.
@@ -176,9 +176,13 @@ export async function init() {
176
176
 
177
177
  // Check if there's a persistent config stored globally
178
178
  const api = window[API_NAME] || {};
179
+ console.log('🔄 Hero animations init - checking persistent config:', api._persistentConfigs?.heroAnimations);
180
+
179
181
  if (api._persistentConfigs?.heroAnimations) {
182
+ console.log('📝 Hero animations - applying persistent config:', api._persistentConfigs.heroAnimations);
180
183
  // Merge persistent config into current config
181
184
  updateConfig(api._persistentConfigs.heroAnimations);
185
+ console.log('✅ Hero animations - config after merge:', config);
182
186
  }
183
187
 
184
188
  if (prefersReducedMotion()) {
@@ -189,14 +193,17 @@ export async function init() {
189
193
  api.heroAnimations = {
190
194
  config: config,
191
195
  updateConfig: (newConfig) => {
196
+ console.log('🔧 Hero animations - updateConfig called with:', newConfig);
192
197
  updateConfig(newConfig);
193
198
  // Store config in persistent storage for restart persistence
194
199
  api._persistentConfigs = api._persistentConfigs || {};
195
200
  api._persistentConfigs.heroAnimations = { ...config };
201
+ console.log('💾 Hero animations - stored persistent config:', api._persistentConfigs.heroAnimations);
196
202
  },
197
203
  start: startHeroAnimations,
198
204
  kill: killHeroAnimations,
199
205
  restart: () => {
206
+ console.log('🔄 Hero animations - restart called');
200
207
  killHeroAnimations();
201
208
  startHeroAnimations();
202
209
  }
@@ -597,14 +604,17 @@ export async function init() {
597
604
  api.heroAnimations = {
598
605
  config: config,
599
606
  updateConfig: (newConfig) => {
607
+ console.log('🔧 Hero animations - updateConfig called with:', newConfig);
600
608
  updateConfig(newConfig);
601
609
  // Store config in persistent storage for restart persistence
602
610
  api._persistentConfigs = api._persistentConfigs || {};
603
611
  api._persistentConfigs.heroAnimations = { ...config };
612
+ console.log('💾 Hero animations - stored persistent config:', api._persistentConfigs.heroAnimations);
604
613
  },
605
614
  start: startHeroAnimations,
606
615
  kill: killHeroAnimations,
607
616
  restart: () => {
617
+ console.log('🔄 Hero animations - restart called');
608
618
  killHeroAnimations();
609
619
  startHeroAnimations();
610
620
  }
@@ -345,9 +345,13 @@ async function initAnimations() {
345
345
  export async function init() {
346
346
  // Check if there's a persistent config stored globally
347
347
  const api = window[API_NAME] || {};
348
+ console.log('🔄 Text animations init - checking persistent config:', api._persistentConfigs?.textAnimations);
349
+
348
350
  if (api._persistentConfigs?.textAnimations) {
351
+ console.log('📝 Text animations - applying persistent config:', api._persistentConfigs.textAnimations);
349
352
  // Merge persistent config into current config
350
353
  updateConfig(api._persistentConfigs.textAnimations);
354
+ console.log('✅ Text animations - config after merge:', config);
351
355
  }
352
356
 
353
357
  if (prefersReducedMotion()) {
@@ -363,14 +367,17 @@ export async function init() {
363
367
  api.textAnimations = {
364
368
  config: config,
365
369
  updateConfig: (newConfig) => {
370
+ console.log('🔧 Text animations - updateConfig called with:', newConfig);
366
371
  updateConfig(newConfig);
367
372
  // Store config in persistent storage for restart persistence
368
373
  api._persistentConfigs = api._persistentConfigs || {};
369
374
  api._persistentConfigs.textAnimations = { ...config };
375
+ console.log('💾 Text animations - stored persistent config:', api._persistentConfigs.textAnimations);
370
376
  },
371
377
  start: startTextAnimations,
372
378
  kill: killTextAnimations,
373
379
  restart: () => {
380
+ console.log('🔄 Text animations - restart called');
374
381
  killTextAnimations();
375
382
  startTextAnimations();
376
383
  }
package/index.js CHANGED
@@ -1,3 +1,5 @@
1
+ // Version: 1.2.22
2
+
1
3
  const API_NAME = 'hsmain';
2
4
 
3
5
  const initializeHsMain = async () => {
@@ -107,6 +109,10 @@ const initializeHsMain = async () => {
107
109
 
108
110
  const readyCallbacks = [];
109
111
 
112
+ // Initialize persistent config storage first, preserving any existing configs
113
+ const existingConfigs = window[API_NAME]?._persistentConfigs || {};
114
+ console.log('🏗️ Initializing main API - existing persistent configs:', existingConfigs);
115
+
110
116
  window[API_NAME] = {
111
117
  scripts,
112
118
  modules: {},
@@ -114,7 +120,7 @@ const initializeHsMain = async () => {
114
120
  load: loadModule,
115
121
  loaded: false,
116
122
  // Persistent config storage
117
- _persistentConfigs: {},
123
+ _persistentConfigs: existingConfigs,
118
124
  push(...items) {
119
125
  for (const [moduleName, callback] of items) {
120
126
  if (typeof callback === 'function') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hortonstudio/main",
3
- "version": "1.2.20",
3
+ "version": "1.2.22",
4
4
  "description": "Animation and utility library for client websites",
5
5
  "main": "index.js",
6
6
  "type": "module",