gclass-anims 1.0.0-beta.17 → 1.0.0-beta.18

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/AnimToggle.js CHANGED
@@ -147,18 +147,29 @@ export function initAnimations() {
147
147
  if (bootCleanup) { bootCleanup(); bootCleanup = null }
148
148
  if (bootStyle) { bootStyle.remove(); bootStyle = null; document.documentElement.classList.remove('gclass-booting') }
149
149
 
150
- const bootEls = typeof document !== 'undefined' ? document.querySelectorAll(".boot-up") : []
150
+ const hideBootEls = (els) => {
151
+ // React-safe: don't el.remove() - React owns the nodes and will throw
152
+ // insertBefore/removeChild on next commit if we mutate outside React.
153
+ // Hiding keeps React's tree intact but visually removes boot screen.
154
+ els.forEach(el => {
155
+ el.style.display = 'none'
156
+ el.setAttribute('hidden', '')
157
+ el.setAttribute('data-gclass-boot-hidden', '1')
158
+ })
159
+ }
160
+
161
+ const bootEls = typeof document !== 'undefined' ? [...document.querySelectorAll(".boot-up")].filter(el => !el.hasAttribute('data-gclass-boot-hidden')) : []
151
162
  if (!bootEls.length) {
152
163
  // no .boot-up -> completely skip boot
153
164
  } else if (bootEls.length > 1) {
154
165
  console.error(`[initAnimations] Multiple .boot-up elements detected (${bootEls.length}) - skipping all boot animations`, bootEls)
155
- bootEls.forEach(el => el.remove())
166
+ hideBootEls(bootEls)
156
167
  hasBooted = true
157
168
  // fall through to normal initListeners without pausing DOM
158
169
  } else if (hasBooted && !bootTimeout) {
159
170
  // path change after already booted (SPA navigation) - skip boot, hard reload resets hasBooted
160
171
  console.log(`[initAnimations] skipping boot on path change (already booted)`, bootEls)
161
- bootEls.forEach(el => el.remove())
172
+ hideBootEls(bootEls)
162
173
  hasBooted = true
163
174
  // fall through
164
175
  } else {
@@ -188,11 +199,11 @@ export function initAnimations() {
188
199
  bootTimeout = setTimeout(() => {
189
200
  const bootEndCls = [...bootEl.classList].find(c => c.startsWith('boot-end-'))
190
201
  if (!bootEndCls) {
191
- // no boot-end -> skip exit animation, just remove
202
+ // no boot-end -> skip exit animation, just hide
192
203
  bootCleanup?.(); bootCleanup = null
193
204
  document.documentElement.classList.remove('gclass-booting')
194
205
  bootStyle?.remove(); bootStyle = null
195
- bootEls.forEach(el => el.remove())
206
+ hideBootEls(bootEls)
196
207
  bootTimeout = null
197
208
  cleanup = initListeners()
198
209
  return
@@ -211,7 +222,7 @@ export function initAnimations() {
211
222
  bootCleanup?.(); bootCleanup = null
212
223
  document.documentElement.classList.remove('gclass-booting')
213
224
  bootStyle?.remove(); bootStyle = null
214
- bootEls.forEach(el => el.remove())
225
+ hideBootEls(bootEls)
215
226
  bootTimeout = null
216
227
  cleanup = initListeners()
217
228
  }
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.18] - 2026-9-1
6
+ - Hopefully finally fixed `.boot-up` properly skipping on path changes
7
+
5
8
  ## [1.0.0-beta.17] - 2026-9-1
6
9
  - Fixed the `.boot-up` class firing on every path change
7
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gclass-anims",
3
- "version": "1.0.0-beta.17",
3
+ "version": "1.0.0-beta.18",
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",