gclass-anims 1.0.0-beta.10 → 1.0.0-beta.12

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.js CHANGED
@@ -257,11 +257,30 @@ export function splitPaths (paths){
257
257
  newPaths = rawPath.map(segment => {
258
258
  const newPath = document.createElementNS("http://www.w3.org/2000/svg" , "path")
259
259
  let i = attributes.length
260
- while (i--) newPath.setAttributeNS(null , attributes[i].nodeName , attributes[i].nodeValue)
260
+ while (i--) {
261
+ const attr = attributes[i]
262
+ // Don't copy GSAP wiring or appear/scroll triggers — children are
263
+ // animated via the returned timeline, not as independent spawns.
264
+ // Copying "appear" caused appearObserver → split → appear loop.
265
+ if (attr.nodeName === "class") {
266
+ const filtered = attr.nodeValue
267
+ .split(/\s+/)
268
+ .filter(c => c && c !== "appear" && c !== "scroll" && c !== "scroll-progress" && c !== "draw" && c !== "draw-split")
269
+ .join(" ")
270
+ if (filtered) newPath.setAttributeNS(null, "class", filtered)
271
+ continue
272
+ }
273
+ if (attr.nodeName.startsWith("data-gsap")) continue
274
+ newPath.setAttributeNS(null , attr.nodeName , attr.nodeValue)
275
+ }
261
276
  newPath.setAttributeNS(null , "d" ,
262
277
  "M" + segment[0] + "," + segment[1] +
263
278
  "C" + segment.slice(2).join(",") +
264
279
  (segment.closed ? "z" : ""))
280
+ // Isolate paint and mark as split child so future inits skip it
281
+ newPath.dataset.gsapSplit = "1"
282
+ newPath.style.contain = "paint"
283
+ newPath.style.willChange = "transform"
265
284
  parent.insertBefore(newPath , path)
266
285
  return newPath
267
286
  })
package/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  All notable changes to `gclass-anims` will be documented in this file.
4
4
 
5
+ ## [1.0.0-beta.12] - 2026-08-26
6
+
7
+ - Fixed `scramble` with `scroll-progress` throwing `can't convert undefined to object` — `computeTo` (`Listeners.js:424`) and scrub `to` builder (`Listeners.js:867`) now guard `from` (`scramble` has no `from`).
8
+
9
+ ## [1.0.0-beta.11] - 2026-08-26
10
+
11
+ - Fixed `.draw-split` infinite loop when paired with `.appear` — `splitPaths` (`Animations.js:244`) now strips `appear`/`scroll`/`scroll-progress`/`draw`/`draw-split`/`data-gsap-*` from cloned segments, marks children with `data-gsap-split` + `contain:paint`/`will-change:transform` isolation, and prevents `appearObserver` (`Listeners.js:1559`) re-triggering. Also isolated `draw-split` demos in docs.
12
+
5
13
  ## [1.0.0-beta.10] - 2026-08-26
6
14
 
7
15
  - Added `.randomize-<prop>-[min]-[max]` — randomize spawn start values per element (e.g. `randomize-rotation-[-90]-[90]`, `randomize-x-[-40]-[40]`). Re-rolls on every replay (`.scroll` re-enter, `.appear`).
package/Listeners.js CHANGED
@@ -423,7 +423,7 @@ export default function initListeners() {
423
423
  // the drawn end state is the full stroke.
424
424
  const computeTo = (from) => {
425
425
  const to = {}
426
- for (const [key] of Object.entries(from)) {
426
+ for (const [key] of Object.entries(from || {})) {
427
427
  if (key === "opacity") to[key] = 1
428
428
  else if (key === "filter") to[key] = "blur(0px)"
429
429
  else if (key === "clipPath") to[key] = "inset(0% 0% 0% 0%)"
@@ -864,7 +864,7 @@ export default function initListeners() {
864
864
  : getEase(el)
865
865
 
866
866
  const to = {}
867
- for (const [key] of Object.entries(from)) {
867
+ for (const [key] of Object.entries(from || {})) {
868
868
  if (key === "opacity") to[key] = 1
869
869
  else if (key === "filter") to[key] = "blur(0px)"
870
870
  else if (key === "text") to[key] = stashText(el)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gclass-anims",
3
- "version": "1.0.0-beta.10",
3
+ "version": "1.0.0-beta.12",
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": "index.js",