@hortonstudio/main 1.2.19 → 1.2.20

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,9 @@ 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
+ if (api._persistentConfigs?.heroAnimations) {
180
180
  // Merge persistent config into current config
181
- updateConfig(api.heroAnimations.config);
181
+ updateConfig(api._persistentConfigs.heroAnimations);
182
182
  }
183
183
 
184
184
  if (prefersReducedMotion()) {
@@ -186,13 +186,13 @@ export async function init() {
186
186
  showHeroElementsWithoutAnimation();
187
187
 
188
188
  // Still expose the API for consistency
189
- window[API_NAME] = window[API_NAME] || {};
190
- window[API_NAME].heroAnimations = {
189
+ api.heroAnimations = {
191
190
  config: config,
192
191
  updateConfig: (newConfig) => {
193
192
  updateConfig(newConfig);
194
- // Store config reference for persistence across restarts
195
- api.heroAnimations.config = config;
193
+ // Store config in persistent storage for restart persistence
194
+ api._persistentConfigs = api._persistentConfigs || {};
195
+ api._persistentConfigs.heroAnimations = { ...config };
196
196
  },
197
197
  start: startHeroAnimations,
198
198
  kill: killHeroAnimations,
@@ -598,8 +598,9 @@ export async function init() {
598
598
  config: config,
599
599
  updateConfig: (newConfig) => {
600
600
  updateConfig(newConfig);
601
- // Store config reference for persistence across restarts
602
- api.heroAnimations.config = config;
601
+ // Store config in persistent storage for restart persistence
602
+ api._persistentConfigs = api._persistentConfigs || {};
603
+ api._persistentConfigs.heroAnimations = { ...config };
603
604
  },
604
605
  start: startHeroAnimations,
605
606
  kill: killHeroAnimations,
@@ -345,9 +345,9 @@ 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
+ if (api._persistentConfigs?.textAnimations) {
349
349
  // Merge persistent config into current config
350
- updateConfig(api.textAnimations.config);
350
+ updateConfig(api._persistentConfigs.textAnimations);
351
351
  }
352
352
 
353
353
  if (prefersReducedMotion()) {
@@ -364,8 +364,9 @@ export async function init() {
364
364
  config: config,
365
365
  updateConfig: (newConfig) => {
366
366
  updateConfig(newConfig);
367
- // Store config reference for persistence across restarts
368
- api.textAnimations.config = config;
367
+ // Store config in persistent storage for restart persistence
368
+ api._persistentConfigs = api._persistentConfigs || {};
369
+ api._persistentConfigs.textAnimations = { ...config };
369
370
  },
370
371
  start: startTextAnimations,
371
372
  kill: killTextAnimations,
package/index.js CHANGED
@@ -113,6 +113,8 @@ const initializeHsMain = async () => {
113
113
  process: new Set(),
114
114
  load: loadModule,
115
115
  loaded: false,
116
+ // Persistent config storage
117
+ _persistentConfigs: {},
116
118
  push(...items) {
117
119
  for (const [moduleName, callback] of items) {
118
120
  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.20",
4
4
  "description": "Animation and utility library for client websites",
5
5
  "main": "index.js",
6
6
  "type": "module",