style: apply biome lint fixes after portforward
This commit is contained in:
@@ -358,7 +358,7 @@ export function FloorplanRegistryMoveOverlay() {
|
||||
// plan scene; otherwise we'd react to 3D-canvas moves with garbage
|
||||
// plan coords.
|
||||
const target = event.target as Element | null
|
||||
if (!target || !target.closest('[data-floorplan-scene]')) return
|
||||
if (!target?.closest('[data-floorplan-scene]')) return
|
||||
const m = toMeters(event.clientX, event.clientY)
|
||||
if (!m) return
|
||||
const [sx, sz] = snapPointToGrid([m[0], m[1]], GRID_STEP)
|
||||
@@ -371,7 +371,7 @@ export function FloorplanRegistryMoveOverlay() {
|
||||
const onPointerUp = (event: PointerEvent) => {
|
||||
if (event.button !== 0) return
|
||||
const target = event.target as Element | null
|
||||
if (!target || !target.closest('[data-floorplan-scene]')) return
|
||||
if (!target?.closest('[data-floorplan-scene]')) return
|
||||
|
||||
const snapped = lastSnapped
|
||||
if (snapped) {
|
||||
|
||||
@@ -269,8 +269,6 @@ export const FloorplanRegistryLayer = memo(function FloorplanRegistryLayer() {
|
||||
levelId,
|
||||
nodes,
|
||||
liveTransforms,
|
||||
liveOverrides,
|
||||
interactiveElevators,
|
||||
selectedIdSet,
|
||||
highlightedIdSet,
|
||||
hoveredId,
|
||||
@@ -518,9 +516,7 @@ export const FloorplanRegistryLayer = memo(function FloorplanRegistryLayer() {
|
||||
higher-rank kinds (slabs, then walls / items / shelves) layer
|
||||
on top in the expected document-order z-stack. */}
|
||||
<g className="floorplan-registry-base">
|
||||
{entries.map(({ id, base }) =>
|
||||
base ? renderEntry(id, base, `base-${id}`) : null,
|
||||
)}
|
||||
{entries.map(({ id, base }) => (base ? renderEntry(id, base, `base-${id}`) : null))}
|
||||
</g>
|
||||
{/* Overlay pass — interactive handles (vertex / midpoint / edge /
|
||||
move) and labels (text / dimensions). Painted after every base
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
sceneRegistry,
|
||||
useScene,
|
||||
} from '@pascal-app/core'
|
||||
import { useViewer, WalkthroughControls, ZONE_LAYER } from '@pascal-app/viewer'
|
||||
import { useViewer, ZONE_LAYER } from '@pascal-app/viewer'
|
||||
import { CameraControls, CameraControlsImpl } from '@react-three/drei'
|
||||
import { useThree } from '@react-three/fiber'
|
||||
import { useCallback, useEffect, useMemo, useRef } from 'react'
|
||||
|
||||
@@ -673,7 +673,7 @@ const BVHEcctrl = forwardRef<BVHEcctrlApi, EcctrlProps>(
|
||||
rotationDeltaPos.current.copy(totalPlatformDeltaPos.current)
|
||||
characterGroupRef.current.position.add(rotationDeltaPos.current)
|
||||
yawQuaternion.current.setFromUnitVectors(upAxis.current, floatHitNormal.current)
|
||||
}, [upAxis])
|
||||
}, [])
|
||||
|
||||
const updateCharacterAnimation = useCallback(
|
||||
(run: boolean, jump: boolean): CharacterAnimationStatus => {
|
||||
@@ -756,7 +756,7 @@ const BVHEcctrl = forwardRef<BVHEcctrlApi, EcctrlProps>(
|
||||
moveDirRef.current?.position.copy(characterSegment.current.end)
|
||||
moveDirRef.current?.setDirection(currentLinVel.current)
|
||||
moveDirRef.current?.setLength(currentLinVel.current.length() / maxWalkSpeed)
|
||||
}, [characterSegment, maxWalkSpeed])
|
||||
}, [maxWalkSpeed])
|
||||
|
||||
useFrame((_, delta) => {
|
||||
elapsedRef.current += delta
|
||||
|
||||
@@ -3475,7 +3475,7 @@ function FloorplanZoneLabel({
|
||||
if (textRef.current) {
|
||||
setTextWidth(textRef.current.getComputedTextLength())
|
||||
}
|
||||
}, [zone.name])
|
||||
}, [])
|
||||
|
||||
const isDeleteMode = mode === 'delete'
|
||||
|
||||
@@ -5136,7 +5136,7 @@ export function FloorplanPanel() {
|
||||
|
||||
useEffect(() => {
|
||||
setHoveredGuideCorner(null)
|
||||
}, [selectedGuide?.id])
|
||||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
if (!(selectedGuide && showGuides && canInteractWithGuides)) {
|
||||
@@ -6087,7 +6087,7 @@ export function FloorplanPanel() {
|
||||
}
|
||||
|
||||
scheduleMovingFloorplanNodeRefresh()
|
||||
}, [hasPendingItemMeshFootprints, scheduleMovingFloorplanNodeRefresh])
|
||||
}, [scheduleMovingFloorplanNodeRefresh])
|
||||
|
||||
// Subscribe to the live-transforms store so rotation/position changes that
|
||||
// *don't* go through pointer events still refresh the floorplan — e.g. R/T
|
||||
@@ -6631,7 +6631,7 @@ export function FloorplanPanel() {
|
||||
pendingFenceDragRef.current = null
|
||||
clearWallEndpointDrag()
|
||||
clearWallCurveDrag()
|
||||
}, [clearWallCurveDrag, clearWallEndpointDrag, levelId])
|
||||
}, [clearWallCurveDrag, clearWallEndpointDrag])
|
||||
|
||||
useEffect(() => {
|
||||
if (shouldShowSiteBoundaryHandles) {
|
||||
|
||||
@@ -840,7 +840,7 @@ const ViewerCanvas = memo(function ViewerCanvas({
|
||||
window.removeEventListener('pointermove', handlePointerMove)
|
||||
window.removeEventListener('pointerup', handlePointerUp)
|
||||
}
|
||||
}, [])
|
||||
}, [setFloorplanPaneRatio])
|
||||
|
||||
useEffect(() => {
|
||||
setIsCameraControlsHintVisible(!readCameraControlsHintDismissed())
|
||||
|
||||
@@ -85,7 +85,7 @@ export const StairEditSystem = () => {
|
||||
}
|
||||
|
||||
prevActiveStairIds.current = activeStairIds
|
||||
}, [selectedIds, selectedStairSignature])
|
||||
}, [selectedIds])
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
@@ -1496,7 +1496,16 @@ export function usePlacementCoordinator(config: PlacementCoordinatorConfig): Rea
|
||||
window.removeEventListener('keyup', onKeyUp)
|
||||
window.removeEventListener('contextmenu', onContextMenu)
|
||||
}
|
||||
}, [asset, canPlaceOnFloor, canPlaceOnWall, canPlaceOnCeiling, draftNode])
|
||||
}, [
|
||||
asset,
|
||||
canPlaceOnFloor,
|
||||
canPlaceOnWall,
|
||||
canPlaceOnCeiling,
|
||||
draftNode,
|
||||
gridSnapStep,
|
||||
updateDimensionGuides,
|
||||
updatePreviewGeometry,
|
||||
])
|
||||
|
||||
// Refresh wireframe when the grid step changes mid-placement so the green/red
|
||||
// box snaps to the new cell size right away.
|
||||
@@ -1510,7 +1519,7 @@ export function usePlacementCoordinator(config: PlacementCoordinatorConfig): Rea
|
||||
)
|
||||
updatePreviewGeometry(previewBounds)
|
||||
updateDimensionGuides(previewBounds)
|
||||
}, [gridSnapStep, asset, draftNode])
|
||||
}, [gridSnapStep, asset, draftNode, updateDimensionGuides, updatePreviewGeometry])
|
||||
// Wall/ceiling items are managed by their own surface entry events (ensureDraft / reparent).
|
||||
const viewerLevelId = useViewer((s) => s.selection.levelId)
|
||||
useEffect(() => {
|
||||
@@ -1588,6 +1597,7 @@ export function usePlacementCoordinator(config: PlacementCoordinatorConfig): Rea
|
||||
initialDimensionBounds.dimensions[0],
|
||||
initialDimensionBounds.dimensions[1],
|
||||
initialDimensionBounds.dimensions[2],
|
||||
initialDimensionBounds,
|
||||
],
|
||||
)
|
||||
const basePlaneGeometry = useMemo(() => {
|
||||
|
||||
@@ -546,7 +546,7 @@ const BoxSelectToolInner: React.FC = () => {
|
||||
canvas.removeEventListener('pointerdown', onCanvasPointerDown)
|
||||
canvas.removeEventListener('pointerup', onCanvasPointerUp)
|
||||
}
|
||||
}, [camera, gl])
|
||||
}, [gl, raycastToGround, syncPreviewSelectedIds])
|
||||
|
||||
// grid:move for cursor tracking + rectangle update during drag
|
||||
useEffect(() => {
|
||||
@@ -603,7 +603,7 @@ const BoxSelectToolInner: React.FC = () => {
|
||||
return () => {
|
||||
emitter.off('grid:move', onMove)
|
||||
}
|
||||
}, [])
|
||||
}, [syncPreviewSelectedIds])
|
||||
|
||||
return (
|
||||
<group>
|
||||
|
||||
Reference in New Issue
Block a user