@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.
- package/animations/hero.js +9 -8
- package/animations/text.js +5 -4
- package/index.js +2 -0
- package/package.json +1 -1
package/animations/hero.js
CHANGED
@@ -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.
|
179
|
+
if (api._persistentConfigs?.heroAnimations) {
|
180
180
|
// Merge persistent config into current config
|
181
|
-
updateConfig(api.heroAnimations
|
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
|
-
|
190
|
-
window[API_NAME].heroAnimations = {
|
189
|
+
api.heroAnimations = {
|
191
190
|
config: config,
|
192
191
|
updateConfig: (newConfig) => {
|
193
192
|
updateConfig(newConfig);
|
194
|
-
// Store config
|
195
|
-
api.
|
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
|
602
|
-
api.
|
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,
|
package/animations/text.js
CHANGED
@@ -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.
|
348
|
+
if (api._persistentConfigs?.textAnimations) {
|
349
349
|
// Merge persistent config into current config
|
350
|
-
updateConfig(api.textAnimations
|
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
|
368
|
-
api.
|
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') {
|