@xenterprises/nuxt-x-marketing 1.4.14 → 1.4.15

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/CHANGELOG.md CHANGED
@@ -30,6 +30,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
30
30
  section and its sample product data were dropped with them. Every other section of the
31
31
  demo page is unchanged.
32
32
 
33
+ ## [1.4.15] - 2026-10-12
34
+
35
+ ### Fixed
36
+
37
+ - Scroll reveal never initialized from the global `marketing.client.ts` plugin. `useScrollReveal()` returned a no-op stub outside a component instance, so `.xFadeUp` / `.xFadeIn` / `[data-reveal]` content (including hero text) stayed at opacity 0. The composable now returns working `initScrollReveal` / `cleanup` outside components (lifecycle hooks are still only registered inside one), and the plugin runs it on `page:finish`, re-scanning on every client navigation. Consumers who added an `app.vue` workaround can remove it.
38
+
33
39
  ## [1.4.14] - 2026-09-06
34
40
 
35
41
  ### Added
@@ -9,9 +9,9 @@
9
9
  * - .xFadeUp-stagger for staggered child animations
10
10
  */
11
11
  export const useScrollReveal = (options = {}) => {
12
- // Only register lifecycle hooks when inside a component instance
12
+ // Lifecycle hooks are only registered inside a component instance.
13
+ // Outside one (e.g. a plugin) the caller drives initScrollReveal/cleanup itself.
13
14
  const instance = getCurrentInstance();
14
- if (!instance) return { initScrollReveal: () => {}, cleanup: () => {} };
15
15
 
16
16
  const defaultOptions = {
17
17
  threshold: 0.15,
@@ -33,7 +33,8 @@ export const useScrollReveal = (options = {}) => {
33
33
  ].join(', ');
34
34
 
35
35
  const initScrollReveal = () => {
36
- if (import.meta.client) {
36
+ if (import.meta.client && typeof IntersectionObserver !== 'undefined') {
37
+ if (observer.value) observer.value.disconnect();
37
38
  observer.value = new IntersectionObserver((entries) => {
38
39
  entries.forEach((entry) => {
39
40
  if (entry.isIntersecting) {
@@ -62,7 +63,7 @@ export const useScrollReveal = (options = {}) => {
62
63
  }
63
64
  };
64
65
 
65
- if (import.meta.client) {
66
+ if (import.meta.client && instance) {
66
67
  onMounted(() => {
67
68
  // Small delay to ensure DOM is ready
68
69
  setTimeout(initScrollReveal, 100);
@@ -4,9 +4,15 @@
4
4
  *
5
5
  * From spec-prompt.md specification
6
6
  */
7
- export default defineNuxtPlugin(() => {
8
- // Initialize scroll reveal globally
9
- useScrollReveal();
7
+ export default defineNuxtPlugin((nuxtApp) => {
8
+ // Initialize scroll reveal globally. A plugin has no component instance,
9
+ // so drive the observer from page lifecycle hooks: initial hydration and
10
+ // every client-side navigation re-scan the DOM for reveal elements.
11
+ const { initScrollReveal, cleanup } = useScrollReveal();
12
+ nuxtApp.hook('page:finish', () => {
13
+ cleanup();
14
+ nextTick(() => setTimeout(initScrollReveal, 100));
15
+ });
10
16
 
11
17
  // Initialize parallax globally
12
18
  useParallax();
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@xenterprises/nuxt-x-marketing",
3
3
  "license": "SEE LICENSE IN LICENSE",
4
4
  "type": "module",
5
- "version": "1.4.14",
5
+ "version": "1.4.15",
6
6
  "main": "./nuxt.config.ts",
7
7
  "scripts": {
8
8
  "dev": "nuxi dev .playground",