@hortonstudio/main 1.2.19 → 1.2.21

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
- if (api.heroAnimations?.config && api.heroAnimations.config !== config) {
179
+ console.log('🔄 Hero animations init - checking persistent config:', api._persistentConfigs?.heroAnimations);
180
+
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
- updateConfig(api.heroAnimations.config);
184
+ updateConfig(api._persistentConfigs.heroAnimations);
185
+ console.log('✅ Hero animations - config after merge:', config);
182
186
  }
183
187
 
184
188
  if (prefersReducedMotion()) {
@@ -186,17 +190,20 @@ export async function init() {
186
190
  showHeroElementsWithoutAnimation();
187
191
 
188
192
  // Still expose the API for consistency
189
- window[API_NAME] = window[API_NAME] || {};
190
- window[API_NAME].heroAnimations = {
193
+ api.heroAnimations = {
191
194
  config: config,
192
195
  updateConfig: (newConfig) => {
196
+ console.log('🔧 Hero animations - updateConfig called with:', newConfig);
193
197
  updateConfig(newConfig);
194
- // Store config reference for persistence across restarts
195
- api.heroAnimations.config = config;
198
+ // Store config in persistent storage for restart persistence
199
+ api._persistentConfigs = api._persistentConfigs || {};
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,13 +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
- // Store config reference for persistence across restarts
602
- api.heroAnimations.config = config;
609
+ // Store config in persistent storage for restart persistence
610
+ api._persistentConfigs = api._persistentConfigs || {};
611
+ api._persistentConfigs.heroAnimations = { ...config };
612
+ console.log('💾 Hero animations - stored persistent config:', api._persistentConfigs.heroAnimations);
603
613
  },
604
614
  start: startHeroAnimations,
605
615
  kill: killHeroAnimations,
606
616
  restart: () => {
617
+ console.log('🔄 Hero animations - restart called');
607
618
  killHeroAnimations();
608
619
  startHeroAnimations();
609
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
- if (api.textAnimations?.config && api.textAnimations.config !== config) {
348
+ console.log('🔄 Text animations init - checking persistent config:', api._persistentConfigs?.textAnimations);
349
+
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
- updateConfig(api.textAnimations.config);
353
+ updateConfig(api._persistentConfigs.textAnimations);
354
+ console.log('✅ Text animations - config after merge:', config);
351
355
  }
352
356
 
353
357
  if (prefersReducedMotion()) {
@@ -363,13 +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
- // Store config reference for persistence across restarts
368
- api.textAnimations.config = config;
372
+ // Store config in persistent storage for restart persistence
373
+ api._persistentConfigs = api._persistentConfigs || {};
374
+ api._persistentConfigs.textAnimations = { ...config };
375
+ console.log('💾 Text animations - stored persistent config:', api._persistentConfigs.textAnimations);
369
376
  },
370
377
  start: startTextAnimations,
371
378
  kill: killTextAnimations,
372
379
  restart: () => {
380
+ console.log('🔄 Text animations - restart called');
373
381
  killTextAnimations();
374
382
  startTextAnimations();
375
383
  }
package/index.js CHANGED
@@ -1,3 +1,5 @@
1
+ // Version: 1.2.21
2
+
1
3
  const API_NAME = 'hsmain';
2
4
 
3
5
  const initializeHsMain = async () => {
@@ -113,6 +115,8 @@ const initializeHsMain = async () => {
113
115
  process: new Set(),
114
116
  load: loadModule,
115
117
  loaded: false,
118
+ // Persistent config storage
119
+ _persistentConfigs: {},
116
120
  push(...items) {
117
121
  for (const [moduleName, callback] of items) {
118
122
  if (typeof callback === 'function') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hortonstudio/main",
3
- "version": "1.2.19",
3
+ "version": "1.2.21",
4
4
  "description": "Animation and utility library for client websites",
5
5
  "main": "index.js",
6
6
  "type": "module",