gatsby-core-theme 44.21.0 → 44.21.1

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
@@ -1,3 +1,12 @@
1
+ ## [44.21.1](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.21.0...v44.21.1) (2026-04-08)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * null event on gatsby browser ([6378dfe](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/6378dfe56a3d3bcd737c125d9af6d53dbbabf37d))
7
+ * null event on gatsby browser ([2dd27b3](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/2dd27b3069acd122feeba0338922b87e3d92648d))
8
+ * null event on gatsby browser ([3ea9a1e](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/3ea9a1ea0ef5d338dcc7833cb84aec57df044867))
9
+
1
10
  # [44.21.0](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.20.0...v44.21.0) (2026-04-07)
2
11
 
3
12
 
package/gatsby-browser.js CHANGED
@@ -21,12 +21,13 @@ async function yieldToMain() {
21
21
  return scheduler.yield();
22
22
  }
23
23
 
24
- // Fall back to yielding with setTimeout.
25
24
  return new Promise((resolve) => {
26
- setTimeout(resolve, 0);
25
+ (globalThis.requestIdleCallback || setTimeout)(resolve);
27
26
  });
28
27
  }
29
28
 
29
+ let didInit = false;
30
+
30
31
  function initGTM() {
31
32
  if (
32
33
  window.loadGTM === false ||
@@ -140,7 +141,9 @@ const piguard = () => {
140
141
  document.head.appendChild(script);
141
142
  };
142
143
 
143
- async function scrollEvent(event) {
144
+ async function scrollEvent() {
145
+ if (didInit) return;
146
+ didInit = true;
144
147
  await yieldToMain();
145
148
  initGTM();
146
149
 
@@ -178,26 +181,29 @@ async function scrollEvent(event) {
178
181
  fbq("track", "PageView");
179
182
  }
180
183
  }
181
-
182
- if (event) {
183
- event.currentTarget.removeEventListener(event.type, scrollEvent); // remove the event listener that got triggered
184
- }
185
184
  }
186
185
 
187
186
  exports.onClientEntry = () => {
188
187
  if (
188
+ process.env.PPC === "true" ||
189
189
  /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
190
190
  navigator.userAgent
191
191
  )
192
192
  ) {
193
- scrollEvent(null);
194
- }
195
- if (process.env.PPC === "true") {
196
- scrollEvent(null);
193
+ scrollEvent();
197
194
  } else {
198
- document.addEventListener("scroll", scrollEvent, { passive: true });
199
- document.addEventListener("mousemove", scrollEvent, { passive: true });
200
- document.addEventListener("touchstart", scrollEvent, { passive: true });
195
+ document.addEventListener("scroll", scrollEvent, {
196
+ passive: true,
197
+ once: true,
198
+ });
199
+ document.addEventListener("mousemove", scrollEvent, {
200
+ passive: true,
201
+ once: true,
202
+ });
203
+ document.addEventListener("touchstart", scrollEvent, {
204
+ passive: true,
205
+ once: true,
206
+ });
201
207
  }
202
208
  // Capture external referrer on first entry
203
209
  if (
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "44.21.0",
3
+ "version": "44.21.1",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "author": "",
6
6
  "license": "ISC",