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

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,10 @@
2
2
 
3
3
  All notable changes to `gclass-anims` will be documented in this file.
4
4
 
5
+ ## [1.0.0-beta.11] - 2026-08-26
6
+
7
+ - 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.
8
+
5
9
  ## [1.0.0-beta.10] - 2026-08-26
6
10
 
7
11
  - 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/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.11",
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",