gclass-anims 1.0.0-beta.22.1 → 1.0.0-beta.22.2

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
@@ -2,6 +2,9 @@
2
2
 
3
3
  All notable changes to `gclass-anims` will be documented in this file.
4
4
 
5
+ ## [1.0.0-beta.22.2] - 2026-09-06
6
+ - Fixed `m:order` (and any `bp:order` / `bp:priority-*` / `bp:ease-*` / `bp:time-*`) disabling the entire `scroll` animation on smaller screens — `Listeners.js:1200,1232,1262` previously wrapped `setupScroll` / `playText` scroll variants in generic `runWithBreakpoint(el, ...)` which gated on *any* `bp:*` class on the element (so `m:order` gated `scroll`). Now uses per-animation `qAllAllVariants` + `runWithBreakpointForSel` (`".scroll"`, `".scroll-progress"`, `tSel`) so only a true `m:scroll` / `m:spawn-*` gates its own animation; unrelated modifiers like `m:order` only affect `hasGClass("order")` / `readTiming` (stagger) and `spawn-*` + `scroll` still play on all sizes (without stagger on <m). Keeps live `gsap.matchMedia` handling for true breakpoint-gated scroll. Reverts `HowWorkSection.jsx` workaround from `m:order` back to plain `order` for the default staggered landing.
7
+
5
8
  ## [1.0.0-beta.22.1] - 2026-09-06
6
9
  - Fixed `.order` stagger grouping bug — `Listeners.js:76` `wrapQAll` now preserves DOM order via `body *` filter + `elementMatchesSel` (was `Set([...spawn-up], [...spawn-down])` grouping by type, now top-to-bottom as `qAll` does). Fixes `doc` `spawn` and landing `order` appearing all over.
7
10
  - No API change from `beta.22`.
package/Listeners.js CHANGED
@@ -1197,7 +1197,18 @@ export default function initListeners(root = document, throttlePerFrame) {
1197
1197
  })
1198
1198
  scrollTriggers.push(st)
1199
1199
  }
1200
- qAll("body *").filter(el => hasGClass(el, "scroll") || hasGClass(el, "scroll-progress")).forEach(el => runWithBreakpoint(el, () => setupScroll(el)))
1200
+ // scroll / scroll-progress are breakpoint-gated per-animation, not per-element generic
1201
+ // (m:order must not disable a plain `scroll` + `spawn-*` on <m)
1202
+ const scrollSel = ".scroll"
1203
+ const progressSel = ".scroll-progress"
1204
+ qAllAllVariants(scrollSel).forEach(el => runWithBreakpointForSel(el, scrollSel, () => {
1205
+ if (!hasGClass(el, "scroll")) return
1206
+ setupScroll(el)
1207
+ }))
1208
+ qAllAllVariants(progressSel).forEach(el => runWithBreakpointForSel(el, progressSel, () => {
1209
+ if (!hasGClass(el, "scroll-progress")) return
1210
+ setupScroll(el)
1211
+ }))
1201
1212
 
1202
1213
  // SplitText scroll variants: `.spawn-text-<spawn>.scroll` plays the per-part
1203
1214
  // tween when the element enters the viewport and reverses on exit.
@@ -1205,8 +1216,9 @@ export default function initListeners(root = document, throttlePerFrame) {
1205
1216
  if (isTypewriter || text === false) return
1206
1217
  const tSel = "." + TEXT_PREFIX + sel.slice(1)
1207
1218
 
1208
- qAll("body *").filter(el => elementMatchesSel(el, tSel) && hasGClass(el, "scroll") && !hasGClass(el, "scroll-progress")).forEach((el) => {
1219
+ qAllAllVariants(tSel).filter(el => hasGClass(el, "scroll") && !hasGClass(el, "scroll-progress")).forEach((el) => {
1209
1220
  const run = () => {
1221
+ if (!elementMatchesSel(el, tSel)) return
1210
1222
  if (isReduced(el)) return
1211
1223
  const { delay, duration } = readTiming(el)
1212
1224
  const ease = getEase(el)
@@ -1229,10 +1241,10 @@ export default function initListeners(root = document, throttlePerFrame) {
1229
1241
  onLeave: reverseToStart,
1230
1242
  onLeaveBack: reverseToStart,
1231
1243
  }))
1232
- }; runWithBreakpoint(el, run)
1244
+ }; runWithBreakpointForSel(el, tSel, run)
1233
1245
  })
1234
1246
 
1235
- qAll("body *").filter(el => elementMatchesSel(el, tSel) && hasGClass(el, "scroll-progress")).forEach((el) => {
1247
+ qAllAllVariants(tSel).filter(el => hasGClass(el, "scroll-progress")).forEach((el) => {
1236
1248
  const run = () => {
1237
1249
  if (isReduced(el)) return
1238
1250
  const ease = getEase(el)
@@ -1259,7 +1271,7 @@ export default function initListeners(root = document, throttlePerFrame) {
1259
1271
  tl.fromTo(parts, { ...(reverse ? to : from), ...rnd },
1260
1272
  { ...(rnd ? randomEnds(Object.keys(rnd)) : null), ...(reverse ? from : to), ease })
1261
1273
  scrollTriggers.push(tl.scrollTrigger)
1262
- }; runWithBreakpoint(el, run)
1274
+ }; runWithBreakpointForSel(el, tSel, run)
1263
1275
  })
1264
1276
  })
1265
1277
  ScrollTrigger.refresh()
package/dist/gclass.cjs CHANGED
@@ -1402,23 +1402,6 @@ function initListeners(root = document, throttlePerFrame) {
1402
1402
  for (const bp of bpNames) if (el.classList.contains(`${bp}:${base}`)) return bp;
1403
1403
  return null;
1404
1404
  };
1405
- const getElGateBp = (el) => {
1406
- for (const c of el.classList) {
1407
- const m = c.match(bpPrefixRE);
1408
- if (m) return m[1];
1409
- }
1410
- return null;
1411
- };
1412
- const runWithBreakpoint = (el, fn) => {
1413
- const bp = getElGateBp(el);
1414
- if (!bp) {
1415
- fn();
1416
- return;
1417
- }
1418
- const mq = mqForBp(bp);
1419
- const ret = mm.add(mq, fn);
1420
- breakpointContexts.push(ret);
1421
- };
1422
1405
  const runWithBreakpointForSel = (el, sel, fn) => {
1423
1406
  const bp = getGateBpForSel(el, sel);
1424
1407
  if (!bp) {
@@ -2196,12 +2179,22 @@ function initListeners(root = document, throttlePerFrame) {
2196
2179
  });
2197
2180
  scrollTriggers.push(st);
2198
2181
  };
2199
- qAll("body *").filter((el) => hasGClass(el, "scroll") || hasGClass(el, "scroll-progress")).forEach((el) => runWithBreakpoint(el, () => setupScroll(el)));
2182
+ const scrollSel = ".scroll";
2183
+ const progressSel = ".scroll-progress";
2184
+ qAllAllVariants(scrollSel).forEach((el) => runWithBreakpointForSel(el, scrollSel, () => {
2185
+ if (!hasGClass(el, "scroll")) return;
2186
+ setupScroll(el);
2187
+ }));
2188
+ qAllAllVariants(progressSel).forEach((el) => runWithBreakpointForSel(el, progressSel, () => {
2189
+ if (!hasGClass(el, "scroll-progress")) return;
2190
+ setupScroll(el);
2191
+ }));
2200
2192
  spawnConfigs.forEach(({ sel, from, typewriter: isTypewriter, text }) => {
2201
2193
  if (isTypewriter || text === false) return;
2202
2194
  const tSel = ".spawn-text-" + sel.slice(1);
2203
- qAll("body *").filter((el) => elementMatchesSel(el, tSel) && hasGClass(el, "scroll") && !hasGClass(el, "scroll-progress")).forEach((el) => {
2195
+ qAllAllVariants(tSel).filter((el) => hasGClass(el, "scroll") && !hasGClass(el, "scroll-progress")).forEach((el) => {
2204
2196
  const run = () => {
2197
+ if (!elementMatchesSel(el, tSel)) return;
2205
2198
  if (isReduced(el)) return;
2206
2199
  const { delay, duration } = readTiming(el);
2207
2200
  const ease = getEase(el);
@@ -2229,9 +2222,9 @@ function initListeners(root = document, throttlePerFrame) {
2229
2222
  onLeaveBack: reverseToStart
2230
2223
  }));
2231
2224
  };
2232
- runWithBreakpoint(el, run);
2225
+ runWithBreakpointForSel(el, tSel, run);
2233
2226
  });
2234
- qAll("body *").filter((el) => elementMatchesSel(el, tSel) && hasGClass(el, "scroll-progress")).forEach((el) => {
2227
+ qAllAllVariants(tSel).filter((el) => hasGClass(el, "scroll-progress")).forEach((el) => {
2235
2228
  const run = () => {
2236
2229
  if (isReduced(el)) return;
2237
2230
  const ease = getEase(el);
@@ -2260,7 +2253,7 @@ function initListeners(root = document, throttlePerFrame) {
2260
2253
  });
2261
2254
  scrollTriggers.push(tl.scrollTrigger);
2262
2255
  };
2263
- runWithBreakpoint(el, run);
2256
+ runWithBreakpointForSel(el, tSel, run);
2264
2257
  });
2265
2258
  });
2266
2259
  gsap_all.ScrollTrigger.refresh();
@@ -1401,23 +1401,6 @@ function initListeners(root = document, throttlePerFrame) {
1401
1401
  for (const bp of bpNames) if (el.classList.contains(`${bp}:${base}`)) return bp;
1402
1402
  return null;
1403
1403
  };
1404
- const getElGateBp = (el) => {
1405
- for (const c of el.classList) {
1406
- const m = c.match(bpPrefixRE);
1407
- if (m) return m[1];
1408
- }
1409
- return null;
1410
- };
1411
- const runWithBreakpoint = (el, fn) => {
1412
- const bp = getElGateBp(el);
1413
- if (!bp) {
1414
- fn();
1415
- return;
1416
- }
1417
- const mq = mqForBp(bp);
1418
- const ret = mm.add(mq, fn);
1419
- breakpointContexts.push(ret);
1420
- };
1421
1404
  const runWithBreakpointForSel = (el, sel, fn) => {
1422
1405
  const bp = getGateBpForSel(el, sel);
1423
1406
  if (!bp) {
@@ -2195,12 +2178,22 @@ function initListeners(root = document, throttlePerFrame) {
2195
2178
  });
2196
2179
  scrollTriggers.push(st);
2197
2180
  };
2198
- qAll("body *").filter((el) => hasGClass(el, "scroll") || hasGClass(el, "scroll-progress")).forEach((el) => runWithBreakpoint(el, () => setupScroll(el)));
2181
+ const scrollSel = ".scroll";
2182
+ const progressSel = ".scroll-progress";
2183
+ qAllAllVariants(scrollSel).forEach((el) => runWithBreakpointForSel(el, scrollSel, () => {
2184
+ if (!hasGClass(el, "scroll")) return;
2185
+ setupScroll(el);
2186
+ }));
2187
+ qAllAllVariants(progressSel).forEach((el) => runWithBreakpointForSel(el, progressSel, () => {
2188
+ if (!hasGClass(el, "scroll-progress")) return;
2189
+ setupScroll(el);
2190
+ }));
2199
2191
  spawnConfigs.forEach(({ sel, from, typewriter: isTypewriter, text }) => {
2200
2192
  if (isTypewriter || text === false) return;
2201
2193
  const tSel = ".spawn-text-" + sel.slice(1);
2202
- qAll("body *").filter((el) => elementMatchesSel(el, tSel) && hasGClass(el, "scroll") && !hasGClass(el, "scroll-progress")).forEach((el) => {
2194
+ qAllAllVariants(tSel).filter((el) => hasGClass(el, "scroll") && !hasGClass(el, "scroll-progress")).forEach((el) => {
2203
2195
  const run = () => {
2196
+ if (!elementMatchesSel(el, tSel)) return;
2204
2197
  if (isReduced(el)) return;
2205
2198
  const { delay, duration } = readTiming(el);
2206
2199
  const ease = getEase(el);
@@ -2228,9 +2221,9 @@ function initListeners(root = document, throttlePerFrame) {
2228
2221
  onLeaveBack: reverseToStart
2229
2222
  }));
2230
2223
  };
2231
- runWithBreakpoint(el, run);
2224
+ runWithBreakpointForSel(el, tSel, run);
2232
2225
  });
2233
- qAll("body *").filter((el) => elementMatchesSel(el, tSel) && hasGClass(el, "scroll-progress")).forEach((el) => {
2226
+ qAllAllVariants(tSel).filter((el) => hasGClass(el, "scroll-progress")).forEach((el) => {
2234
2227
  const run = () => {
2235
2228
  if (isReduced(el)) return;
2236
2229
  const ease = getEase(el);
@@ -2259,7 +2252,7 @@ function initListeners(root = document, throttlePerFrame) {
2259
2252
  });
2260
2253
  scrollTriggers.push(tl.scrollTrigger);
2261
2254
  };
2262
- runWithBreakpoint(el, run);
2255
+ runWithBreakpointForSel(el, tSel, run);
2263
2256
  });
2264
2257
  });
2265
2258
  ScrollTrigger.refresh();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gclass-anims",
3
- "version": "1.0.0-beta.22.1",
3
+ "version": "1.0.0-beta.22.2",
4
4
  "description": "A Tailwind-style utility layer on top of GSAP. Framework-agnostic - works in vanilla JS, React, Vue, Svelte, or any bundler.",
5
5
  "type": "module",
6
6
  "main": "./dist/gclass.cjs",