gclass-anims 1.0.0-beta.22 → 1.0.0-beta.22.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 +5 -0
- package/Listeners.js +9 -24
- package/dist/gclass.cjs +7 -16
- package/dist/gclass.esm.js +7 -16
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `gclass-anims` will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [1.0.0-beta.22.1] - 2026-09-06
|
|
6
|
+
- 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
|
+
- No API change from `beta.22`.
|
|
8
|
+
|
|
5
9
|
## [1.0.0-beta.22] - 2026-09-06
|
|
6
10
|
- Added responsive breakpoints — `Config.js:75` `defaults.breakpoints {xs:475,s:640,m:768,l:1024,xl:1280}` (single-letter `s/m/l` avoids Tailwind `sm/md/lg` collision). Usage `m:spawn-up`, `l:float`, `xs:spawn-up`. Gating is live via `gsap.matchMedia` (`Listeners.js:26,202`).
|
|
7
11
|
- Added breakpoint-aware modifiers — `m:amount-20`, `m:time-2`, `m:ease-bounce`, `m:priority-3`, `m:chars-[...]`, `m:spawn-num-10` etc. Mobile-first largest active wins (`Listeners.js:237` `getActivePrefixedClass`, `Animations.js:13` lazy helpers). Covers `amount-`, `time-`, `priority-`, `edelay-`, `etime-`, `stagger-`, `fill-time-`, `reveal-delay-`, `spawn-num-`, `progress-start-`, etc.
|
|
@@ -9,6 +13,7 @@ All notable changes to `gclass-anims` will be documented in this file.
|
|
|
9
13
|
- Added ESM + CJS dual build — `vite.lib.config.js` (Vite lib) builds `dist/gclass.esm.js` + `dist/gclass.cjs` (`gsap` external); `package.json:4` bumped to `beta.22`, `main/module` point to `dist/`, `exports: {import, require}`, `sideEffects:false`, `prepublishOnly: build`.
|
|
10
14
|
- Fixed CJS `gsap` interop — `Animations.js:2`/`Listeners.js:1`/`AnimToggle.js:3`/`CustomAnims.js:1` now `import {gsap} from 'gsap'` (named import) for correct `require('gsap').gsap` interop.
|
|
11
15
|
- Added `dev-react-strict` test harness — `vitest` + `jsdom` + `src/__tests__/breakpoints.test.jsx` (14 tests: gating, modifiers, Tailwind coexistence, StrictMode) + `BreakpointHarness.jsx` visual; `vite.config.js` test config.
|
|
16
|
+
- Documented breakpoints — `doc/src/app/documentation/responsive-design/page.js` (was duplicate `optimization`).
|
|
12
17
|
|
|
13
18
|
## [1.0.0-beta.21] - 2026-9-3
|
|
14
19
|
- Added a `gclassOpts()` function that controls the animation fps and observer throttling
|
package/Listeners.js
CHANGED
|
@@ -73,32 +73,17 @@ const qAllBp = (sel, qAll) => {
|
|
|
73
73
|
})())
|
|
74
74
|
}
|
|
75
75
|
// For generic qAll(sel) calls that should be breakpoint-aware, use this wrapper.
|
|
76
|
+
// Preserves DOM order (critical for .order stagger) and respects root scoping (boot screen).
|
|
76
77
|
const wrapQAll = (qAll) => (sel) => {
|
|
77
|
-
// if sel is a comma list (orderSelector), split and union
|
|
78
|
-
if (sel.includes(',')) {
|
|
79
|
-
const parts = sel.split(',').map(s => s.trim()).filter(Boolean)
|
|
80
|
-
const set = new Set()
|
|
81
|
-
parts.forEach(p => wrapQAll(qAll)(p).forEach(e => set.add(e)))
|
|
82
|
-
return [...set]
|
|
83
|
-
}
|
|
84
|
-
// "body *" passthrough
|
|
85
78
|
if (sel === "body *") return qAll(sel)
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
// also scan for active variants that wouldn't be found by qAll(sel)
|
|
95
|
-
const variantEls = qAll("body *").filter(el => {
|
|
96
|
-
for (const bp of bpNames) if (el.classList.contains(`${bp}:${sel.slice(1)}`) && isBreakpointActive(bp)) return true
|
|
97
|
-
return false
|
|
98
|
-
})
|
|
99
|
-
const set = new Set([...baseEls, ...variantEls])
|
|
100
|
-
return [...set]
|
|
101
|
-
} catch { return qAll(sel) }
|
|
79
|
+
const parts = sel.split(',').map(s => s.trim()).filter(Boolean)
|
|
80
|
+
// Filter all candidates in DOM order, matching base or active bp: variant via elementMatchesSel
|
|
81
|
+
// This keeps .order sequence top-to-bottom instead of grouping by sel type.
|
|
82
|
+
return qAll("body *").filter(el => parts.some(p => {
|
|
83
|
+
// p is like ".spawn-up" or ".spawn-text-spawn-up"
|
|
84
|
+
// elementMatchesSel handles both base and bp:base when active
|
|
85
|
+
try { return elementMatchesSel(el, p) } catch { return false }
|
|
86
|
+
}))
|
|
102
87
|
}
|
|
103
88
|
|
|
104
89
|
// --- Named onComplete handler registry -------------------------------------
|
package/dist/gclass.cjs
CHANGED
|
@@ -1325,24 +1325,15 @@ var hasGClass = (el, name) => {
|
|
|
1325
1325
|
return false;
|
|
1326
1326
|
};
|
|
1327
1327
|
var wrapQAll = (qAll) => (sel) => {
|
|
1328
|
-
if (sel.includes(",")) {
|
|
1329
|
-
const parts = sel.split(",").map((s) => s.trim()).filter(Boolean);
|
|
1330
|
-
const set = /* @__PURE__ */ new Set();
|
|
1331
|
-
parts.forEach((p) => wrapQAll(qAll)(p).forEach((e) => set.add(e)));
|
|
1332
|
-
return [...set];
|
|
1333
|
-
}
|
|
1334
1328
|
if (sel === "body *") return qAll(sel);
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1329
|
+
const parts = sel.split(",").map((s) => s.trim()).filter(Boolean);
|
|
1330
|
+
return qAll("body *").filter((el) => parts.some((p) => {
|
|
1331
|
+
try {
|
|
1332
|
+
return elementMatchesSel(el, p);
|
|
1333
|
+
} catch {
|
|
1340
1334
|
return false;
|
|
1341
|
-
}
|
|
1342
|
-
|
|
1343
|
-
} catch {
|
|
1344
|
-
return qAll(sel);
|
|
1345
|
-
}
|
|
1335
|
+
}
|
|
1336
|
+
}));
|
|
1346
1337
|
};
|
|
1347
1338
|
var completeHandlers = /* @__PURE__ */ new Map();
|
|
1348
1339
|
function registerComplete(name, fn) {
|
package/dist/gclass.esm.js
CHANGED
|
@@ -1324,24 +1324,15 @@ var hasGClass = (el, name) => {
|
|
|
1324
1324
|
return false;
|
|
1325
1325
|
};
|
|
1326
1326
|
var wrapQAll = (qAll) => (sel) => {
|
|
1327
|
-
if (sel.includes(",")) {
|
|
1328
|
-
const parts = sel.split(",").map((s) => s.trim()).filter(Boolean);
|
|
1329
|
-
const set = /* @__PURE__ */ new Set();
|
|
1330
|
-
parts.forEach((p) => wrapQAll(qAll)(p).forEach((e) => set.add(e)));
|
|
1331
|
-
return [...set];
|
|
1332
|
-
}
|
|
1333
1327
|
if (sel === "body *") return qAll(sel);
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1328
|
+
const parts = sel.split(",").map((s) => s.trim()).filter(Boolean);
|
|
1329
|
+
return qAll("body *").filter((el) => parts.some((p) => {
|
|
1330
|
+
try {
|
|
1331
|
+
return elementMatchesSel(el, p);
|
|
1332
|
+
} catch {
|
|
1339
1333
|
return false;
|
|
1340
|
-
}
|
|
1341
|
-
|
|
1342
|
-
} catch {
|
|
1343
|
-
return qAll(sel);
|
|
1344
|
-
}
|
|
1334
|
+
}
|
|
1335
|
+
}));
|
|
1345
1336
|
};
|
|
1346
1337
|
var completeHandlers = /* @__PURE__ */ new Map();
|
|
1347
1338
|
function registerComplete(name, fn) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gclass-anims",
|
|
3
|
-
"version": "1.0.0-beta.22",
|
|
3
|
+
"version": "1.0.0-beta.22.1",
|
|
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",
|