sync: backport monorepo PRs #240 #251 #253 (#225)

This commit is contained in:
Pascal
2026-04-13 11:24:13 -04:00
committed by GitHub
parent b25be8227a
commit 682e2a1a12
30 changed files with 1246 additions and 755 deletions
@@ -1,4 +1,4 @@
import { sceneRegistry } from '@pascal-app/core'
import { emitter, sceneRegistry } from '@pascal-app/core'
import { useEffect } from 'react'
import useViewer from '../../store/use-viewer'
@@ -14,5 +14,30 @@ export const GuideSystem = () => {
}
})
}, [showGuides])
useEffect(() => {
const hideForCapture = () => {
const guides = sceneRegistry.byType.guide || new Set()
guides.forEach((guideId) => {
const node = sceneRegistry.nodes.get(guideId)
if (node) node.visible = false
})
}
const restoreAfterCapture = () => {
const showGuidesNow = useViewer.getState().showGuides
const guides = sceneRegistry.byType.guide || new Set()
guides.forEach((guideId) => {
const node = sceneRegistry.nodes.get(guideId)
if (node) node.visible = showGuidesNow
})
}
emitter.on('thumbnail:before-capture', hideForCapture)
emitter.on('thumbnail:after-capture', restoreAfterCapture)
return () => {
emitter.off('thumbnail:before-capture', hideForCapture)
emitter.off('thumbnail:after-capture', restoreAfterCapture)
}
}, [])
return null
}