@pascal-app/editor 1.1.0 → 1.1.1
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/package.json +9 -15
- package/src/components/editor/action-menu-button.tsx +1 -1
- package/src/components/editor/alignment-3d-guide-layer.tsx +1 -1
- package/src/components/editor/custom-camera-controls.tsx +11 -11
- package/src/components/editor/editor-layout-v2.tsx +1 -1
- package/src/components/editor/elevation-3d-guide-layer.tsx +1 -1
- package/src/components/editor/first-person-controls.tsx +20 -1981
- package/src/components/editor/floating-action-menu.tsx +1 -1
- package/src/components/editor/floating-building-action-menu.tsx +1 -1
- package/src/components/editor/floor-region-controls.tsx +6 -2
- package/src/components/editor/floorplan-navigation-presentation.test.ts +0 -40
- package/src/components/editor/floorplan-navigation-presentation.ts +0 -66
- package/src/components/editor/floorplan-panel.tsx +26 -22
- package/src/components/editor/floorplan-wall-typing-keys.ts +1 -1
- package/src/components/editor/follow-pascal.test.tsx +1 -2
- package/src/components/editor/follow-pascal.tsx +1 -1
- package/src/components/editor/footprint-height-handle.tsx +1 -1
- package/src/components/editor/group-actions.ts +1 -2
- package/src/components/editor/group-floating-action-menu.tsx +1 -1
- package/src/components/editor/group-move-3d.ts +1 -2
- package/src/components/editor/group-rotate-handle.tsx +1 -2
- package/src/components/editor/handles/use-handle-drag.ts +1 -2
- package/src/components/editor/index.tsx +24 -14
- package/src/components/editor/inspector-extension-actions.tsx +1 -1
- package/src/components/editor/node-arrow-handles.tsx +1 -1
- package/src/components/editor/open-wall-ends-3d-layer.tsx +1 -1
- package/src/components/editor/opening-guides-3d-layer.tsx +1 -1
- package/src/components/editor/room-controls.tsx +7 -4
- package/src/components/editor/room-handles-2d.tsx +2 -3
- package/src/components/editor/room-handles.tsx +1 -2
- package/src/components/editor/room-highlight.tsx +6 -105
- package/src/components/editor/room-labels.test.ts +8 -822
- package/src/components/editor/room-labels.tsx +40 -1671
- package/src/components/editor/room-webgpu-materials.test.ts +1 -1
- package/src/components/editor/selection-manager.tsx +5 -3
- package/src/components/editor/site-edge-labels.tsx +1 -1
- package/src/components/editor/snapshot-capture-overlay.tsx +2 -5
- package/src/components/editor/use-floorplan-background-placement.ts +2 -1
- package/src/components/editor/views/plugins-view.tsx +1 -1
- package/src/components/editor/views/view-bar.tsx +9 -9
- package/src/components/editor/wall-measurement-label.tsx +1 -1
- package/src/components/editor/wall-move-side-handles.tsx +1 -1
- package/src/components/editor/wall-pull-grip.tsx +2 -2
- package/src/components/editor-2d/floorplan-group-move.tsx +2 -3
- package/src/components/editor-2d/floorplan-measurement-tool-layer.tsx +1 -1
- package/src/components/editor-2d/floorplan-open-wall-ends-layer.tsx +1 -1
- package/src/components/editor-2d/floorplan-registry-move-overlay.tsx +1 -2
- package/src/components/editor-2d/renderers/floorplan-annotation-layout.test.ts +0 -37
- package/src/components/editor-2d/renderers/floorplan-annotation-layout.ts +0 -30
- package/src/components/editor-2d/renderers/floorplan-dimension-edit-overlay.tsx +13 -3
- package/src/components/editor-2d/renderers/floorplan-placement-preview-layer.tsx +1 -2
- package/src/components/editor-2d/renderers/floorplan-registry-layer.test.ts +8 -10
- package/src/components/editor-2d/renderers/floorplan-registry-layer.tsx +25 -33
- package/src/components/systems/roof/roof-edit-system.tsx +4 -3
- package/src/components/tools/distribution/distribution-run-tool.tsx +1 -1
- package/src/components/tools/item/placement-history.test.tsx +1 -1
- package/src/components/tools/item/use-placement-coordinator.tsx +2 -3
- package/src/components/tools/paint-region/wall-paint-region-tool.tsx +6 -2
- package/src/components/tools/registry/move-registry-node-tool.tsx +1 -2
- package/src/components/tools/shared/cursor-sphere.tsx +1 -1
- package/src/components/tools/shared/draft-measurement-label.tsx +1 -1
- package/src/components/tools/shared/placement-box.tsx +1 -1
- package/src/components/tools/shared/placement-dimension-guides.tsx +1 -1
- package/src/components/tools/site/terrain-brush-cursor.tsx +1 -1
- package/src/components/ui/action-menu/camera-actions.tsx +2 -2
- package/src/components/ui/action-menu/control-modes.tsx +1 -1
- package/src/components/ui/action-menu/follow-pascal-pill.tsx +1 -1
- package/src/components/ui/action-menu/index.tsx +3 -3
- package/src/components/ui/action-menu/measurement-control.tsx +3 -3
- package/src/components/ui/action-menu/placement.ts +0 -18
- package/src/components/ui/action-menu/point-ask-button.tsx +1 -1
- package/src/components/ui/action-menu/view-toggles.tsx +5 -5
- package/src/components/ui/controls/finish-swatch.tsx +1 -1
- package/src/components/ui/controls/material-paint-panel.tsx +2 -2
- package/src/components/ui/controls/scene-material-list.tsx +2 -2
- package/src/components/ui/controls/select-control.tsx +1 -1
- package/src/components/ui/controls/terrain-sculpt-panel.tsx +1 -1
- package/src/components/ui/floating-level-selector.tsx +3 -3
- package/src/components/ui/helpers/contextual-helper-panel.tsx +1 -1
- package/src/components/ui/helpers/helper-manager.test.tsx +1 -1
- package/src/components/ui/helpers/helper-manager.tsx +1 -1
- package/src/components/ui/level-duplicate-dialog.tsx +1 -1
- package/src/components/ui/panels/collections/collections-popover.tsx +2 -2
- package/src/components/ui/panels/floor-foundation-panel.tsx +2 -2
- package/src/components/ui/panels/floor-opening-panel.tsx +4 -4
- package/src/components/ui/panels/node-display.ts +1 -1
- package/src/components/ui/panels/panel-manager.tsx +1 -1
- package/src/components/ui/panels/panel-wrapper.tsx +1 -1
- package/src/components/ui/panels/parametric-inspector.tsx +1 -1
- package/src/components/ui/panels/room-construction-rows.tsx +6 -6
- package/src/components/ui/panels/room-name-options.ts +1 -5
- package/src/components/ui/panels/room-panel.tsx +6 -8
- package/src/components/ui/primitives/color-dot.tsx +2 -2
- package/src/components/ui/primitives/opacity-control.tsx +2 -2
- package/src/components/ui/primitives/sidebar.tsx +3 -3
- package/src/components/ui/right-stack.tsx +1 -1
- package/src/components/ui/sidebar/icon-rail.tsx +1 -1
- package/src/components/ui/sidebar/panels/items-panel/function-tree-panel.tsx +1 -1
- package/src/components/ui/sidebar/panels/settings-panel/audio-settings-dialog.tsx +2 -2
- package/src/components/ui/sidebar/panels/settings-panel/construction-animation-setting.tsx +1 -1
- package/src/components/ui/sidebar/panels/settings-panel/index.tsx +2 -2
- package/src/components/ui/sidebar/panels/settings-panel/keyboard-shortcuts-dialog.tsx +1 -1
- package/src/components/ui/sidebar/panels/settings-panel/load-build-dialog.tsx +1 -1
- package/src/components/ui/sidebar/panels/settings-panel/print-export-button.tsx +1 -1
- package/src/components/ui/sidebar/panels/site-panel/building-tree-node.tsx +1 -1
- package/src/components/ui/sidebar/panels/site-panel/index.tsx +2 -2
- package/src/components/ui/sidebar/panels/site-panel/inline-rename-input.tsx +1 -1
- package/src/components/ui/sidebar/panels/site-panel/level-tree-node.tsx +1 -1
- package/src/components/ui/sidebar/panels/site-panel/roof-tree-node.tsx +46 -7
- package/src/components/ui/sidebar/panels/site-panel/tree-node-actions.tsx +1 -1
- package/src/components/ui/sidebar/panels/site-panel/tree-node-drag.tsx +14 -5
- package/src/components/ui/sidebar/panels/site-panel/unit-tree-node.tsx +2 -2
- package/src/components/ui/sidebar/panels/zone-panel/index.tsx +3 -3
- package/src/components/ui/sidebar/tab-bar.tsx +1 -1
- package/src/components/ui/wall-type/wall-type-editor-dialog.tsx +1 -1
- package/src/components/ui/wall-type/wall-type-menu.tsx +1 -1
- package/src/components/viewer-overlay.tsx +1 -2
- package/src/hooks/use-auto-frame.ts +1 -2
- package/src/hooks/use-keyboard.ts +1 -2
- package/src/hooks/use-selected-room.ts +5 -7
- package/src/i18n/floor-footprint-name.ts +1 -1
- package/src/i18n/locales/en/messages.po +180 -182
- package/src/i18n/locales/es/messages.po +180 -182
- package/src/i18n/locales/fr/messages.po +180 -182
- package/src/i18n/locales/ja/messages.po +180 -182
- package/src/i18n/locales/zh-CN/messages.po +180 -182
- package/src/i18n/locales.test.ts +1 -1
- package/src/index.tsx +109 -131
- package/src/lib/below-grade.test.tsx +4 -4
- package/src/lib/camera-facing.test.ts +1 -1
- package/src/lib/camera-facing.ts +2 -3
- package/src/lib/editor-level-display.ts +1 -1
- package/src/lib/floor-footprints.test.ts +2 -2
- package/src/lib/floor-opening-draft.ts +1 -1
- package/src/lib/floorplan/annotation-visibility.test.ts +1 -1
- package/src/lib/floorplan/annotation-visibility.ts +1 -1
- package/src/lib/floorplan/floorplan-export.test.ts +1 -1
- package/src/lib/floorplan/floorplan-export.tsx +8 -11
- package/src/lib/floorplan/floorplan-extension.ts +4 -157
- package/src/lib/floorplan/floorplan-mode.ts +2 -1
- package/src/lib/floorplan/floorplan-pdfkit-renderer.test.ts +1 -1
- package/src/lib/floorplan/floorplan-pdfkit-renderer.ts +8 -6
- package/src/lib/floorplan/floorplan-plugin-install.test.tsx +3 -4
- package/src/lib/floorplan/geometry.ts +2 -112
- package/src/lib/floorplan/index.ts +0 -9
- package/src/lib/floorplan/items.ts +2 -1
- package/src/lib/floorplan/schedules.ts +6 -3
- package/src/lib/floorplan/sheet-export.ts +7 -3
- package/src/lib/floorplan/site-plan/site-parts.ts +7 -1
- package/src/lib/floorplan/site-plan/site-plan-layer.tsx +1 -1
- package/src/lib/follow-pascal-presentation.ts +1 -1
- package/src/lib/glb-export.ts +1 -1
- package/src/lib/material-paint.ts +1 -1
- package/src/lib/measurements.test.ts +2 -1
- package/src/lib/mezzanine-selection.test.ts +1 -1
- package/src/lib/paint-region-mode.ts +1 -1
- package/src/lib/point-ask/session.ts +1 -2
- package/src/lib/roof-duplication.test.ts +100 -0
- package/src/lib/roof-duplication.ts +30 -5
- package/src/lib/room-handle-drag.ts +2 -12
- package/src/lib/room-name-catalog.test.ts +2 -1
- package/src/lib/room-name-messages.test.ts +2 -1
- package/src/lib/room-name-messages.ts +1 -118
- package/src/lib/room-name-storage.test.ts +2 -1
- package/src/lib/room-selection-commands.ts +2 -2
- package/src/lib/room-selection.test.ts +6 -6
- package/src/lib/room-transform-session.ts +1 -2
- package/src/lib/room-zone-routing.ts +2 -2
- package/src/lib/selection-routing.test.ts +0 -28
- package/src/lib/selection-routing.ts +1 -40
- package/src/lib/sfx-bus.ts +8 -32
- package/src/lib/sfx-player.test.ts +72 -1
- package/src/lib/sfx-player.ts +49 -337
- package/src/lib/viewer-selection.test.ts +38 -10
- package/src/lib/wall-pull.test.ts +1 -1
- package/src/lib/wall-pull.ts +1 -27
- package/src/store/use-editor.tsx +17 -26
- package/src/store/use-floorplan-annotation-visibility.ts +5 -5
- package/src/store/use-wall-region-handles-selection.ts +1 -2
- package/src/components/editor/__bench__/room-label-placement.bench.ts +0 -108
- package/src/components/editor/first-person/build-collider-world.test.ts +0 -596
- package/src/components/editor/first-person/build-collider-world.ts +0 -549
- package/src/components/editor/first-person/ground-holes.test.ts +0 -128
- package/src/components/editor/first-person/ground-holes.ts +0 -130
- package/src/components/editor/first-person/mechanism-targets.test.ts +0 -162
- package/src/components/editor/first-person/mechanism-targets.ts +0 -88
- package/src/components/editor/first-person/terrain-collider.test.ts +0 -132
- package/src/components/editor/first-person/terrain-collider.ts +0 -212
- package/src/components/editor/floorplan-camera-sync.test.ts +0 -249
- package/src/components/editor/floorplan-camera-sync.ts +0 -213
- package/src/components/editor/localized-html.tsx +0 -22
- package/src/components/editor-2d/renderers/floorplan-dimension-renderer.test.tsx +0 -236
- package/src/components/editor-2d/renderers/floorplan-dimension-renderer.tsx +0 -708
- package/src/components/editor-2d/renderers/floorplan-geometry-renderer.test.tsx +0 -385
- package/src/components/editor-2d/renderers/floorplan-geometry-renderer.tsx +0 -670
- package/src/components/editor-2d/renderers/floorplan-label-angle.test.ts +0 -89
- package/src/components/editor-2d/renderers/floorplan-label-angle.ts +0 -106
- package/src/components/editor-2d/svg-paths.ts +0 -124
- package/src/components/ui/action-menu/action-button.tsx +0 -89
- package/src/components/ui/action-menu/follow-pascal-toggle.tsx +0 -42
- package/src/components/ui/primitives/button.tsx +0 -69
- package/src/components/ui/primitives/dropdown-menu.tsx +0 -232
- package/src/components/ui/primitives/popover.tsx +0 -42
- package/src/components/ui/primitives/switch.tsx +0 -29
- package/src/components/ui/primitives/tooltip.tsx +0 -57
- package/src/components/ui/scene-loader.tsx +0 -73
- package/src/components/viewer/floorplan-compass-button.tsx +0 -67
- package/src/components/viewer/floorplan-preview-geometry.test.ts +0 -107
- package/src/components/viewer/floorplan-preview-geometry.ts +0 -281
- package/src/components/viewer/floorplan-preview-navigation.test.ts +0 -43
- package/src/components/viewer/floorplan-preview-navigation.ts +0 -62
- package/src/components/viewer/floorplan-preview-visibility.test.ts +0 -35
- package/src/components/viewer/floorplan-preview-visibility.ts +0 -19
- package/src/components/viewer/floorplan-preview.tsx +0 -1065
- package/src/components/viewer/render-settings-menu.tsx +0 -294
- package/src/components/viewer/sky-control.tsx +0 -710
- package/src/components/viewer/use-viewer-camera-navigation-sync.ts +0 -140
- package/src/components/viewer/use-viewer-ui-sounds.test.ts +0 -15
- package/src/components/viewer/use-viewer-ui-sounds.ts +0 -46
- package/src/components/viewer/viewer-controls-bar.tsx +0 -496
- package/src/components/viewer/viewer-hover-label.tsx +0 -42
- package/src/components/viewer/viewer-rooms.tsx +0 -248
- package/src/components/viewer/viewer-scene-header.tsx +0 -286
- package/src/components/viewer/viewer-selection-manager.tsx +0 -124
- package/src/components/viewer/viewer-stage-modes.test.ts +0 -38
- package/src/components/viewer/viewer-stage-modes.ts +0 -49
- package/src/components/viewer/viewer-stage-switcher.tsx +0 -97
- package/src/components/viewer/viewer-stage.test.tsx +0 -47
- package/src/components/viewer/viewer-stage.tsx +0 -221
- package/src/components/walkthrough-hud.tsx +0 -193
- package/src/hooks/use-mobile.ts +0 -19
- package/src/i18n/level-name.ts +0 -39
- package/src/i18n/scene-theme-name.ts +0 -16
- package/src/lib/below-grade.ts +0 -133
- package/src/lib/camera-pose.test.ts +0 -237
- package/src/lib/camera-pose.ts +0 -172
- package/src/lib/floorplan/floorplan-extension.test.ts +0 -42
- package/src/lib/floorplan/floorplan-readonly.test.ts +0 -47
- package/src/lib/floorplan/floorplan-readonly.ts +0 -95
- package/src/lib/floorplan/marks.test.ts +0 -213
- package/src/lib/floorplan/marks.ts +0 -238
- package/src/lib/measurements.ts +0 -8
- package/src/lib/node-display-label.ts +0 -37
- package/src/lib/room-assembly-overlay.test.ts +0 -275
- package/src/lib/room-assembly-overlay.ts +0 -265
- package/src/lib/room-selection.ts +0 -417
- package/src/lib/scene-bounds.test.ts +0 -327
- package/src/lib/scene-bounds.ts +0 -233
- package/src/lib/typing-target.ts +0 -9
- package/src/lib/viewer-selection.ts +0 -595
- package/src/lib/zone-content.ts +0 -133
- package/src/store/camera-pose-store.test.ts +0 -29
- package/src/store/camera-pose-store.ts +0 -27
- package/src/store/navigation-sync-pose-store.test.ts +0 -34
- package/src/store/navigation-sync-pose-store.ts +0 -27
- package/src/store/use-audio.test.ts +0 -146
- package/src/store/use-audio.tsx +0 -169
- package/src/store/use-first-person-hud.ts +0 -40
- package/src/store/use-follow-pascal.test.ts +0 -62
- package/src/store/use-follow-pascal.ts +0 -53
|
@@ -30,6 +30,7 @@ import {
|
|
|
30
30
|
type WallNode,
|
|
31
31
|
} from '@pascal-app/core'
|
|
32
32
|
import { useViewer } from '@pascal-app/viewer'
|
|
33
|
+
import { LocalizedHtml as Html } from '@pascal-app/viewer/ui'
|
|
33
34
|
import { useFrame } from '@react-three/fiber'
|
|
34
35
|
import { useCallback, useMemo, useRef } from 'react'
|
|
35
36
|
import * as THREE from 'three'
|
|
@@ -54,7 +55,6 @@ import useInteractionScope, {
|
|
|
54
55
|
} from '../../store/use-interaction-scope'
|
|
55
56
|
import { IconRefGlyph } from '../ui/icon-ref'
|
|
56
57
|
import { duplicateNodeAndPickUp } from './duplicate-node'
|
|
57
|
-
import { Html } from './localized-html'
|
|
58
58
|
import { formatMeasurement, MeasurementPill } from './measurement-pill'
|
|
59
59
|
import { NodeActionMenu } from './node-action-menu'
|
|
60
60
|
import { startZoneRoomTransform } from './room-controls'
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
import { type BuildingNode, sceneRegistry, useScene } from '@pascal-app/core'
|
|
4
4
|
import { useViewer } from '@pascal-app/viewer'
|
|
5
|
+
import { LocalizedHtml as Html } from '@pascal-app/viewer/ui'
|
|
5
6
|
import { useFrame } from '@react-three/fiber'
|
|
6
7
|
import { useCallback, useRef } from 'react'
|
|
7
8
|
import * as THREE from 'three'
|
|
8
9
|
import { sfxEmitter } from '../../lib/sfx-bus'
|
|
9
10
|
import useEditor from '../../store/use-editor'
|
|
10
|
-
import { Html } from './localized-html'
|
|
11
11
|
import { NodeActionMenu } from './node-action-menu'
|
|
12
12
|
|
|
13
13
|
export function FloatingBuildingActionMenu() {
|
|
@@ -10,7 +10,12 @@ import {
|
|
|
10
10
|
sceneRegistry,
|
|
11
11
|
useScene,
|
|
12
12
|
} from '@pascal-app/core'
|
|
13
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
getSceneTheme,
|
|
15
|
+
isTypingTarget,
|
|
16
|
+
setSurfaceRaycastLayers,
|
|
17
|
+
useViewer,
|
|
18
|
+
} from '@pascal-app/viewer'
|
|
14
19
|
import { useFrame, useThree } from '@react-three/fiber'
|
|
15
20
|
import { Pentagon, Square } from 'lucide-react'
|
|
16
21
|
import { useEffect, useMemo, useRef } from 'react'
|
|
@@ -74,7 +79,6 @@ import {
|
|
|
74
79
|
toggleTerraceShape,
|
|
75
80
|
useTerraceDraft,
|
|
76
81
|
} from '../../lib/terrace-draft'
|
|
77
|
-
import { isTypingTarget } from '../../lib/typing-target'
|
|
78
82
|
import useEditor from '../../store/use-editor'
|
|
79
83
|
import { useFloorplanRender } from '../editor-2d/floorplan-render-context'
|
|
80
84
|
import { usePaintTint } from '../tools/paint-region/use-paint-tint'
|
|
@@ -2,13 +2,11 @@ import { describe, expect, test } from 'bun:test'
|
|
|
2
2
|
import {
|
|
3
3
|
canApplyFloorplanNavigationSync,
|
|
4
4
|
canZoomFloorplanDuringNavigation,
|
|
5
|
-
createFloorplanNavigationSyncScheduler,
|
|
6
5
|
finalizeFloorplanNavigation,
|
|
7
6
|
flushFloorplanRotationPresentationRestore,
|
|
8
7
|
getFloorplanRotationOverscanViewBox,
|
|
9
8
|
queueFloorplanRotationPresentationRestore,
|
|
10
9
|
resolveFloorplanPresentationViewBox,
|
|
11
|
-
setFloorplanCompassRotation,
|
|
12
10
|
} from './floorplan-navigation-presentation'
|
|
13
11
|
|
|
14
12
|
describe('floorplan navigation presentation', () => {
|
|
@@ -60,16 +58,6 @@ describe('floorplan navigation presentation', () => {
|
|
|
60
58
|
expect(canApplyFloorplanNavigationSync(false)).toBe(true)
|
|
61
59
|
})
|
|
62
60
|
|
|
63
|
-
test('updates the compass presentation on every live rotation frame', () => {
|
|
64
|
-
const compass = { style: { transform: '' } }
|
|
65
|
-
|
|
66
|
-
setFloorplanCompassRotation(compass, 0.25)
|
|
67
|
-
expect(compass.style.transform).toBe('rotate(0.25deg)')
|
|
68
|
-
|
|
69
|
-
setFloorplanCompassRotation(compass, 0.5)
|
|
70
|
-
expect(compass.style.transform).toBe('rotate(0.5deg)')
|
|
71
|
-
})
|
|
72
|
-
|
|
73
61
|
test('keeps the rotation preview in place until the committed state is ready to paint', () => {
|
|
74
62
|
const pending = { current: null }
|
|
75
63
|
const svg = {
|
|
@@ -111,32 +99,4 @@ describe('floorplan navigation presentation', () => {
|
|
|
111
99
|
|
|
112
100
|
expect(calls).toEqual(['zoom', 'pan', 'rotation:42'])
|
|
113
101
|
})
|
|
114
|
-
|
|
115
|
-
test('coalesces a camera pose stream into one settled React commit', () => {
|
|
116
|
-
const presented: number[] = []
|
|
117
|
-
const committed: number[] = []
|
|
118
|
-
let scheduled: (() => void) | null = null
|
|
119
|
-
const scheduler = createFloorplanNavigationSyncScheduler<number>({
|
|
120
|
-
applyPresentation: (pose) => presented.push(pose),
|
|
121
|
-
commit: (pose) => committed.push(pose),
|
|
122
|
-
schedule: (callback) => {
|
|
123
|
-
scheduled = callback
|
|
124
|
-
return 1 as unknown as ReturnType<typeof globalThis.setTimeout>
|
|
125
|
-
},
|
|
126
|
-
cancel: () => {
|
|
127
|
-
scheduled = null
|
|
128
|
-
},
|
|
129
|
-
})
|
|
130
|
-
|
|
131
|
-
for (let pose = 1; pose <= 30; pose += 1) {
|
|
132
|
-
scheduler.update(pose)
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
expect(presented).toHaveLength(30)
|
|
136
|
-
expect(committed).toEqual([])
|
|
137
|
-
|
|
138
|
-
const settle = scheduled as (() => void) | null
|
|
139
|
-
settle?.()
|
|
140
|
-
expect(committed).toEqual([30])
|
|
141
|
-
})
|
|
142
102
|
})
|
|
@@ -5,15 +5,6 @@ export type FloorplanPresentationViewBox = {
|
|
|
5
5
|
height: number
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
export function setFloorplanCompassRotation(
|
|
9
|
-
compass: { style: { transform: string } } | null,
|
|
10
|
-
rotationDeg: number,
|
|
11
|
-
): void {
|
|
12
|
-
if (compass) {
|
|
13
|
-
compass.style.transform = `rotate(${rotationDeg}deg)`
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
8
|
type FloorplanRotationPresentation = {
|
|
18
9
|
svg: {
|
|
19
10
|
style: {
|
|
@@ -78,63 +69,6 @@ export function canApplyFloorplanNavigationSync(interactionInProgress: boolean):
|
|
|
78
69
|
return !interactionInProgress
|
|
79
70
|
}
|
|
80
71
|
|
|
81
|
-
export type FloorplanNavigationSyncScheduler<Pose> = {
|
|
82
|
-
update: (pose: Pose) => void
|
|
83
|
-
flush: () => void
|
|
84
|
-
discard: () => void
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export function createFloorplanNavigationSyncScheduler<Pose>({
|
|
88
|
-
applyPresentation,
|
|
89
|
-
commit,
|
|
90
|
-
settleMs = 120,
|
|
91
|
-
schedule = globalThis.setTimeout,
|
|
92
|
-
cancel = globalThis.clearTimeout,
|
|
93
|
-
}: {
|
|
94
|
-
applyPresentation: (pose: Pose) => void
|
|
95
|
-
commit: (pose: Pose) => void
|
|
96
|
-
settleMs?: number
|
|
97
|
-
schedule?: (callback: () => void, delay: number) => ReturnType<typeof globalThis.setTimeout>
|
|
98
|
-
cancel?: (timer: ReturnType<typeof globalThis.setTimeout>) => void
|
|
99
|
-
}): FloorplanNavigationSyncScheduler<Pose> {
|
|
100
|
-
let latestPose: Pose | null = null
|
|
101
|
-
let settleTimer: ReturnType<typeof globalThis.setTimeout> | null = null
|
|
102
|
-
|
|
103
|
-
const clearSettleTimer = () => {
|
|
104
|
-
if (settleTimer === null) return
|
|
105
|
-
cancel(settleTimer)
|
|
106
|
-
settleTimer = null
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
const flush = () => {
|
|
110
|
-
clearSettleTimer()
|
|
111
|
-
if (latestPose === null) return
|
|
112
|
-
const pose = latestPose
|
|
113
|
-
latestPose = null
|
|
114
|
-
commit(pose)
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
const update = (pose: Pose) => {
|
|
118
|
-
latestPose = pose
|
|
119
|
-
applyPresentation(pose)
|
|
120
|
-
clearSettleTimer()
|
|
121
|
-
settleTimer = schedule(() => {
|
|
122
|
-
settleTimer = null
|
|
123
|
-
if (latestPose === null) return
|
|
124
|
-
const settledPose = latestPose
|
|
125
|
-
latestPose = null
|
|
126
|
-
commit(settledPose)
|
|
127
|
-
}, settleMs)
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
const discard = () => {
|
|
131
|
-
clearSettleTimer()
|
|
132
|
-
latestPose = null
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
return { update, flush, discard }
|
|
136
|
-
}
|
|
137
|
-
|
|
138
72
|
export function finalizeFloorplanNavigation<RotationState>({
|
|
139
73
|
zoomPending,
|
|
140
74
|
panActive,
|
|
@@ -5,6 +5,8 @@ import {
|
|
|
5
5
|
type AnyNode,
|
|
6
6
|
type AnyNodeId,
|
|
7
7
|
type BuildingNode,
|
|
8
|
+
buildFloorplanContext,
|
|
9
|
+
buildSvgPolylinePath,
|
|
8
10
|
type CameraControlFrameEvent,
|
|
9
11
|
type CeilingNode,
|
|
10
12
|
CeilingNode as CeilingNodeSchema,
|
|
@@ -18,10 +20,13 @@ import {
|
|
|
18
20
|
type ElevatorNode,
|
|
19
21
|
emitter,
|
|
20
22
|
type FenceNode,
|
|
23
|
+
FLOORPLAN_VIEW_ROTATION_DEG,
|
|
21
24
|
type FloorplanGeometry,
|
|
25
|
+
floorplanLocalToWorldPoint,
|
|
22
26
|
formatAngleRadians,
|
|
23
27
|
formatLinearMeasurement,
|
|
24
28
|
formatNumber as formatLocalizedNumber,
|
|
29
|
+
formatPolygonPath,
|
|
25
30
|
type GeometryContext,
|
|
26
31
|
type GuideNode,
|
|
27
32
|
getRenderableSlabPolygon,
|
|
@@ -41,6 +46,7 @@ import {
|
|
|
41
46
|
type RoofSegmentNode,
|
|
42
47
|
resolveSlabPlacementElevation,
|
|
43
48
|
resolveTerrainWallConstructionOptions,
|
|
49
|
+
rotatePlanVector as rotateSharedPlanVector,
|
|
44
50
|
runAsSingleSceneHistoryStep,
|
|
45
51
|
type SeparatorNode,
|
|
46
52
|
type SiteNode,
|
|
@@ -64,9 +70,24 @@ import {
|
|
|
64
70
|
WindowNode as WindowNodeSchema,
|
|
65
71
|
wallClosesRoom,
|
|
66
72
|
wallRectangleCorners,
|
|
73
|
+
worldToFloorplanLocalPoint,
|
|
67
74
|
} from '@pascal-app/core'
|
|
68
75
|
import { useSegmentDraftChain, useWallSnapIndicator } from '@pascal-app/editor'
|
|
69
76
|
import { getSceneTheme, useViewer } from '@pascal-app/viewer'
|
|
77
|
+
import {
|
|
78
|
+
createFloorplanNavigationSyncScheduler,
|
|
79
|
+
FloorplanCompassButton,
|
|
80
|
+
FloorplanGeometryRenderer,
|
|
81
|
+
type FloorplanNavigationSyncScheduler,
|
|
82
|
+
framingAnimates,
|
|
83
|
+
type NavigationSyncPose,
|
|
84
|
+
navigationSyncPoseStore,
|
|
85
|
+
publishNavigationSyncPose,
|
|
86
|
+
setFloorplanCompassRotation,
|
|
87
|
+
subscribeFloorplanCameraNavigation,
|
|
88
|
+
subscribeNavigationSyncPose,
|
|
89
|
+
useFloorplanCameraSyncBridge,
|
|
90
|
+
} from '@pascal-app/viewer/ui'
|
|
70
91
|
import { Command, Ruler } from 'lucide-react'
|
|
71
92
|
import {
|
|
72
93
|
type ComponentProps,
|
|
@@ -95,14 +116,9 @@ import {
|
|
|
95
116
|
alignFloorplanDraftPoint,
|
|
96
117
|
buildFloorplanItemEntry,
|
|
97
118
|
collectLevelDescendants,
|
|
98
|
-
FLOORPLAN_VIEW_ROTATION_DEG,
|
|
99
|
-
floorplanLocalToWorldPoint,
|
|
100
119
|
getFloorplanWall as getSharedFloorplanWall,
|
|
101
|
-
rotatePlanVector as rotateSharedPlanVector,
|
|
102
120
|
type FloorplanNodeTransform as SharedFloorplanNodeTransform,
|
|
103
|
-
worldToFloorplanLocalPoint,
|
|
104
121
|
} from '../../lib/floorplan'
|
|
105
|
-
import { buildFloorplanContext } from '../../lib/floorplan/floorplan-readonly'
|
|
106
122
|
// Site-plan view. Owned under `lib/floorplan/site-plan/**`; this panel
|
|
107
123
|
// only chooses between it and the registry layer, and mounts the switch.
|
|
108
124
|
import {
|
|
@@ -147,7 +163,6 @@ import {
|
|
|
147
163
|
zoneAtLevelPoint,
|
|
148
164
|
} from '../../lib/units'
|
|
149
165
|
import { cn } from '../../lib/utils'
|
|
150
|
-
import { framingAnimates } from '../../lib/viewer-selection'
|
|
151
166
|
import {
|
|
152
167
|
getWallDrawVariant,
|
|
153
168
|
getWallLineKind,
|
|
@@ -176,10 +191,9 @@ import {
|
|
|
176
191
|
} from '../../lib/wall-run-snap'
|
|
177
192
|
import { snapBuildingLocalToWorldGrid } from '../../lib/world-grid-snap'
|
|
178
193
|
import { nextZoneName } from '../../lib/zone-name'
|
|
179
|
-
import { subscribeNavigationSyncPose } from '../../store/navigation-sync-pose-store'
|
|
180
194
|
import useAlignmentGuides from '../../store/use-alignment-guides'
|
|
181
195
|
import useDrawingView from '../../store/use-drawing-view'
|
|
182
|
-
import type { GuideUiState
|
|
196
|
+
import type { GuideUiState } from '../../store/use-editor'
|
|
183
197
|
import useEditor, {
|
|
184
198
|
isAngleSnapActive,
|
|
185
199
|
isMagneticSnapActive,
|
|
@@ -223,7 +237,6 @@ import { FloorplanSnapBeaconLayer } from '../editor-2d/floorplan-snap-beacon-lay
|
|
|
223
237
|
import { FloorplanWallMoveGhostLayer } from '../editor-2d/floorplan-wall-move-ghost-layer'
|
|
224
238
|
import { FloorplanDraftLayer } from '../editor-2d/renderers/floorplan-draft-layer'
|
|
225
239
|
import { FloorplanDraftMeasurement } from '../editor-2d/renderers/floorplan-draft-measurement'
|
|
226
|
-
import { FloorplanGeometryRenderer } from '../editor-2d/renderers/floorplan-geometry-renderer'
|
|
227
240
|
import { FloorplanMarqueeLayer } from '../editor-2d/renderers/floorplan-marquee-layer'
|
|
228
241
|
import { FloorplanPlacementPreviewLayer } from '../editor-2d/renderers/floorplan-placement-preview-layer'
|
|
229
242
|
import { FloorplanPlacementTypingHud } from '../editor-2d/renderers/floorplan-placement-typing-hud'
|
|
@@ -232,7 +245,6 @@ import {
|
|
|
232
245
|
RotationAngleOverlay,
|
|
233
246
|
} from '../editor-2d/renderers/floorplan-registry-layer'
|
|
234
247
|
import { FloorplanVoronoiLayer } from '../editor-2d/renderers/floorplan-voronoi-layer'
|
|
235
|
-
import { buildSvgPolylinePath, formatPolygonPath } from '../editor-2d/svg-paths'
|
|
236
248
|
import { snapToHalf } from '../tools/item/placement-math'
|
|
237
249
|
import {
|
|
238
250
|
isBoxSelectPointerSuppressed,
|
|
@@ -275,24 +287,16 @@ import {
|
|
|
275
287
|
type WallPlanPoint,
|
|
276
288
|
} from '../tools/wall/wall-drafting'
|
|
277
289
|
import { formatWallDraftHeading, resolveTypedWallEnd } from '../tools/wall/wall-typed-entry'
|
|
278
|
-
import { FloorplanCompassButton } from '../viewer/floorplan-compass-button'
|
|
279
290
|
import { resolveFloorplanBackgroundSelection } from './floorplan-background-selection'
|
|
280
|
-
import {
|
|
281
|
-
subscribeFloorplanCameraNavigation,
|
|
282
|
-
useFloorplanCameraSyncBridge,
|
|
283
|
-
} from './floorplan-camera-sync'
|
|
284
291
|
import {
|
|
285
292
|
canApplyFloorplanNavigationSync,
|
|
286
293
|
canZoomFloorplanDuringNavigation,
|
|
287
|
-
createFloorplanNavigationSyncScheduler,
|
|
288
|
-
type FloorplanNavigationSyncScheduler,
|
|
289
294
|
type FloorplanPresentationViewBox,
|
|
290
295
|
finalizeFloorplanNavigation,
|
|
291
296
|
flushFloorplanRotationPresentationRestore,
|
|
292
297
|
getFloorplanRotationOverscanViewBox,
|
|
293
298
|
queueFloorplanRotationPresentationRestore,
|
|
294
299
|
resolveFloorplanPresentationViewBox,
|
|
295
|
-
setFloorplanCompassRotation,
|
|
296
300
|
} from './floorplan-navigation-presentation'
|
|
297
301
|
import {
|
|
298
302
|
endFloorplanWallTypingOnCancel,
|
|
@@ -4913,7 +4917,7 @@ const DRAFT_AXIS_GUIDE_EXTENT = 1000
|
|
|
4913
4917
|
export function FloorplanPanel({
|
|
4914
4918
|
/**
|
|
4915
4919
|
* Element to portal the compass button into. The 2D/3D navigation poses stay
|
|
4916
|
-
* in sync (`
|
|
4920
|
+
* in sync (`navigationSyncPoseStore`), so hosting the compass on the always-visible
|
|
4917
4921
|
* viewer-area container keeps it correct — needle and align-to-north alike —
|
|
4918
4922
|
* in 2d, 3d, and split modes, while this panel itself may be display:none.
|
|
4919
4923
|
*/
|
|
@@ -4985,7 +4989,7 @@ export function FloorplanPanel({
|
|
|
4985
4989
|
viewWidth: number
|
|
4986
4990
|
} | null>(null)
|
|
4987
4991
|
const latestNavigationSyncPoseRef = useRef<NavigationSyncPose | null>(
|
|
4988
|
-
|
|
4992
|
+
navigationSyncPoseStore.getState().pose,
|
|
4989
4993
|
)
|
|
4990
4994
|
const compassNeedleRef = useRef<SVGSVGElement | null>(null)
|
|
4991
4995
|
const hiddenCompassAnimationRef = useRef<number | null>(null)
|
|
@@ -7406,7 +7410,7 @@ export function FloorplanPanel({
|
|
|
7406
7410
|
)
|
|
7407
7411
|
const targetY = latestNavigationSyncPoseRef.current?.target[1] ?? floorplanGridWorldY
|
|
7408
7412
|
|
|
7409
|
-
|
|
7413
|
+
publishNavigationSyncPose({
|
|
7410
7414
|
source: '2d',
|
|
7411
7415
|
target: [worldCenter.x, targetY, worldCenter.z],
|
|
7412
7416
|
azimuth: cameraAzimuthFromFloorplanRotation(userRotationDeg),
|
|
@@ -7427,7 +7431,7 @@ export function FloorplanPanel({
|
|
|
7427
7431
|
const northAzimuth = cameraAzimuthFromFloorplanRotation(
|
|
7428
7432
|
nearestEquivalentDegrees(0, currentRotation),
|
|
7429
7433
|
)
|
|
7430
|
-
|
|
7434
|
+
publishNavigationSyncPose({
|
|
7431
7435
|
source: '2d',
|
|
7432
7436
|
target: [...pose.target],
|
|
7433
7437
|
azimuth: northAzimuth,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { isTypingTarget } from '@pascal-app/viewer'
|
|
1
2
|
import { markToolCancelConsumed } from '../../hooks/use-keyboard'
|
|
2
3
|
import type { ParseMeasurementOptions } from '../../lib/measurement-parser'
|
|
3
|
-
import { isTypingTarget } from '../../lib/typing-target'
|
|
4
4
|
import useEditor from '../../store/use-editor'
|
|
5
5
|
import {
|
|
6
6
|
PLACEMENT_TYPING_LENGTH_ANGLE,
|
|
@@ -18,12 +18,11 @@ import {
|
|
|
18
18
|
WindowNode,
|
|
19
19
|
} from '@pascal-app/core'
|
|
20
20
|
import { isNodeRevealing, startConstructionReveal, useViewer } from '@pascal-app/viewer'
|
|
21
|
+
import { followBelowGrade, useFollowPascal } from '@pascal-app/viewer/ui'
|
|
21
22
|
import { act, create } from '@react-three/test-renderer'
|
|
22
23
|
import { BoxGeometry, DoubleSide, Group, Mesh, MeshBasicMaterial, Raycaster, Vector3 } from 'three'
|
|
23
|
-
import { followBelowGrade } from '../../lib/below-grade'
|
|
24
24
|
import { openingExterior, wallExterior } from '../../lib/follow-pascal-exterior.test-fixture'
|
|
25
25
|
import useEditor from '../../store/use-editor'
|
|
26
|
-
import useFollowPascal from '../../store/use-follow-pascal'
|
|
27
26
|
import { usePointAsk } from '../../store/use-point-ask'
|
|
28
27
|
import { FollowPascal } from './follow-pascal'
|
|
29
28
|
|
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
subscribeRevealEvents,
|
|
19
19
|
useViewer,
|
|
20
20
|
} from '@pascal-app/viewer'
|
|
21
|
+
import { useFollowPascal } from '@pascal-app/viewer/ui'
|
|
21
22
|
import { useFrame, useThree } from '@react-three/fiber'
|
|
22
23
|
import { useEffect, useMemo, useRef } from 'react'
|
|
23
24
|
import { Vector3 } from 'three'
|
|
@@ -34,7 +35,6 @@ import { FollowPresentation, type PresentationPort } from '../../lib/follow-pasc
|
|
|
34
35
|
import { FollowSight } from '../../lib/follow-pascal-sight'
|
|
35
36
|
import { stayOnLevel, wantFromEvent } from '../../lib/follow-pascal-targets'
|
|
36
37
|
import useEditor from '../../store/use-editor'
|
|
37
|
-
import useFollowPascal from '../../store/use-follow-pascal'
|
|
38
38
|
import { usePointAsk } from '../../store/use-point-ask'
|
|
39
39
|
|
|
40
40
|
/**
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
useScene,
|
|
12
12
|
} from '@pascal-app/core'
|
|
13
13
|
import { useViewer } from '@pascal-app/viewer'
|
|
14
|
+
import { LocalizedHtml as Html } from '@pascal-app/viewer/ui'
|
|
14
15
|
import { type ThreeEvent, useFrame, useThree } from '@react-three/fiber'
|
|
15
16
|
import { useRef, useState } from 'react'
|
|
16
17
|
import { type Group, Plane, Vector2, Vector3 } from 'three'
|
|
@@ -25,7 +26,6 @@ import { runRoomHandleDrag } from '../../lib/room-handle-drag'
|
|
|
25
26
|
import useEditor, { isGridSnapActive } from '../../store/use-editor'
|
|
26
27
|
import useInteractionScope from '../../store/use-interaction-scope'
|
|
27
28
|
import { suppressBoxSelectForPointer } from '../tools/select/box-select-state'
|
|
28
|
-
import { Html } from './localized-html'
|
|
29
29
|
import { ElevationArrows, outlineCentroid, useHandleScale } from './room-handles'
|
|
30
30
|
|
|
31
31
|
export const FOOTPRINT_HEIGHT_DRAG_LABEL = 'footprint-height'
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
useLiveTransforms,
|
|
15
15
|
useScene,
|
|
16
16
|
} from '@pascal-app/core'
|
|
17
|
-
import { markPerfAction, useViewer } from '@pascal-app/viewer'
|
|
17
|
+
import { isTypingTarget, markPerfAction, useViewer } from '@pascal-app/viewer'
|
|
18
18
|
import { Plane, Vector2, Vector3 } from 'three'
|
|
19
19
|
import { GROUP_MOVE_DRAG_LABEL } from '../../lib/contextual-help'
|
|
20
20
|
import { clientToPlan } from '../../lib/floorplan/plan-coords'
|
|
@@ -28,7 +28,6 @@ import {
|
|
|
28
28
|
pasteSystemEditorClipboardToLevel,
|
|
29
29
|
} from '../../lib/scene-clipboard'
|
|
30
30
|
import { emitDeleteSFX, sfxEmitter } from '../../lib/sfx-bus'
|
|
31
|
-
import { isTypingTarget } from '../../lib/typing-target'
|
|
32
31
|
import useAlignmentGuides from '../../store/use-alignment-guides'
|
|
33
32
|
import useDeleteConfirmation from '../../store/use-delete-confirmation'
|
|
34
33
|
import useEditor, {
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { type AnyNodeId, useScene } from '@pascal-app/core'
|
|
4
4
|
import { useViewer } from '@pascal-app/viewer'
|
|
5
|
+
import { LocalizedHtml as Html } from '@pascal-app/viewer/ui'
|
|
5
6
|
import { useFrame } from '@react-three/fiber'
|
|
6
7
|
import { useCallback, useMemo, useRef } from 'react'
|
|
7
8
|
import * as THREE from 'three'
|
|
@@ -20,7 +21,6 @@ import {
|
|
|
20
21
|
computeGroupPlanBox,
|
|
21
22
|
levelFrame,
|
|
22
23
|
} from './group-transform-shared'
|
|
23
|
-
import { Html } from './localized-html'
|
|
24
24
|
import { NodeActionMenu } from './node-action-menu'
|
|
25
25
|
import { useMeshSettleEpoch } from './use-mesh-settle-epoch'
|
|
26
26
|
|
|
@@ -12,13 +12,12 @@ import {
|
|
|
12
12
|
useLiveTransforms,
|
|
13
13
|
useScene,
|
|
14
14
|
} from '@pascal-app/core'
|
|
15
|
-
import { useViewer } from '@pascal-app/viewer'
|
|
15
|
+
import { isTypingTarget, useViewer } from '@pascal-app/viewer'
|
|
16
16
|
import { type Camera, Plane, type Raycaster, Vector2, Vector3 } from 'three'
|
|
17
17
|
import { GROUP_MOVE_DRAG_LABEL } from '../../lib/contextual-help'
|
|
18
18
|
import { isHistoryShortcut } from '../../lib/history'
|
|
19
19
|
import type { WallGroupPush } from '../../lib/room-handle-drag'
|
|
20
20
|
import { sfxEmitter } from '../../lib/sfx-bus'
|
|
21
|
-
import { isTypingTarget } from '../../lib/typing-target'
|
|
22
21
|
import useAlignmentGuides from '../../store/use-alignment-guides'
|
|
23
22
|
import useEditor, {
|
|
24
23
|
isAlignmentGuideActive,
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
useLiveTransforms,
|
|
11
11
|
useScene,
|
|
12
12
|
} from '@pascal-app/core'
|
|
13
|
-
import { useViewer } from '@pascal-app/viewer'
|
|
13
|
+
import { isTypingTarget, useViewer } from '@pascal-app/viewer'
|
|
14
14
|
import { createPortal, type ThreeEvent, useThree } from '@react-three/fiber'
|
|
15
15
|
import { useEffect, useMemo, useRef, useState } from 'react'
|
|
16
16
|
import { OrthographicCamera, Plane, type Ray, Vector2, Vector3 } from 'three'
|
|
@@ -19,7 +19,6 @@ import { isHistoryShortcut } from '../../lib/history'
|
|
|
19
19
|
import { sfxEmitter } from '../../lib/sfx-bus'
|
|
20
20
|
import { intersectSpatialDragPlane } from '../../lib/spatial-drag-plane'
|
|
21
21
|
import { getSpatialPointerId, spatialPointerInput } from '../../lib/spatial-pointer-input'
|
|
22
|
-
import { isTypingTarget } from '../../lib/typing-target'
|
|
23
22
|
import useEditor, { isAngleSnapActive } from '../../store/use-editor'
|
|
24
23
|
import useInteractionScope, {
|
|
25
24
|
useActiveHandleDrag,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
useLiveNodeOverrides,
|
|
12
12
|
useScene,
|
|
13
13
|
} from '@pascal-app/core'
|
|
14
|
-
import { useViewer } from '@pascal-app/viewer'
|
|
14
|
+
import { isTypingTarget, useViewer } from '@pascal-app/viewer'
|
|
15
15
|
import { type ThreeEvent, useThree } from '@react-three/fiber'
|
|
16
16
|
import { useEffect, useRef } from 'react'
|
|
17
17
|
import {
|
|
@@ -28,7 +28,6 @@ import { isHistoryShortcut } from '../../../lib/history'
|
|
|
28
28
|
import { sfxEmitter } from '../../../lib/sfx-bus'
|
|
29
29
|
import { intersectSpatialDragPlane } from '../../../lib/spatial-drag-plane'
|
|
30
30
|
import { getSpatialPointerId, spatialPointerInput } from '../../../lib/spatial-pointer-input'
|
|
31
|
-
import { isTypingTarget } from '../../../lib/typing-target'
|
|
32
31
|
import useInteractionScope from '../../../store/use-interaction-scope'
|
|
33
32
|
import { suppressBoxSelectForPointer } from '../../tools/select/box-select-state'
|
|
34
33
|
import { commitHandleDragPatch } from './handle-drag-history'
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { Icon } from '@iconify/react'
|
|
4
4
|
import {
|
|
5
5
|
acquireSceneReadOnlyLease,
|
|
6
|
+
computeSceneBoundsXZ,
|
|
6
7
|
createI18n,
|
|
7
8
|
emitter,
|
|
8
9
|
getCatalogMaterialById,
|
|
@@ -29,6 +30,24 @@ import {
|
|
|
29
30
|
type ViewerImmersiveSession,
|
|
30
31
|
ViewerPresentations,
|
|
31
32
|
} from '@pascal-app/viewer'
|
|
33
|
+
import { useViewerUiSounds } from '@pascal-app/viewer/sfx'
|
|
34
|
+
import {
|
|
35
|
+
type ActionMenuPlacement,
|
|
36
|
+
ParametricViewerRooms,
|
|
37
|
+
SceneLoader,
|
|
38
|
+
SceneLoadFailed,
|
|
39
|
+
SKY_DOCK_HEIGHT,
|
|
40
|
+
SkyControl,
|
|
41
|
+
Tooltip,
|
|
42
|
+
TooltipContent,
|
|
43
|
+
TooltipTrigger,
|
|
44
|
+
useIsMobile,
|
|
45
|
+
useViewerFloorDisplay,
|
|
46
|
+
ViewerHoverLabel,
|
|
47
|
+
ViewerSelectionManager,
|
|
48
|
+
ViewerStage,
|
|
49
|
+
type ViewerStageMode,
|
|
50
|
+
} from '@pascal-app/viewer/ui'
|
|
32
51
|
import {
|
|
33
52
|
type CSSProperties,
|
|
34
53
|
memo,
|
|
@@ -47,7 +66,6 @@ import { ViewerZoneSystem } from '../../components/viewer-zone-system'
|
|
|
47
66
|
import { useAutoFrame } from '../../hooks/use-auto-frame'
|
|
48
67
|
import { type SaveStatus, useAutoSave } from '../../hooks/use-auto-save'
|
|
49
68
|
import { useKeyboard } from '../../hooks/use-keyboard'
|
|
50
|
-
import { useIsMobile } from '../../hooks/use-mobile'
|
|
51
69
|
import { useSaveShortcut } from '../../hooks/use-save-shortcut'
|
|
52
70
|
import { type HINT_KEY_NAMES, toolHintKey, toolHintKeyDescriptor } from '../../i18n/node-messages'
|
|
53
71
|
import { useCeilingEditSessionOwner } from '../../lib/ceiling-edit-session'
|
|
@@ -69,16 +87,15 @@ import {
|
|
|
69
87
|
type SceneGraph,
|
|
70
88
|
writePersistedSelection,
|
|
71
89
|
} from '../../lib/scene'
|
|
72
|
-
import { computeSceneBoundsXZ } from '../../lib/scene-bounds'
|
|
73
90
|
import { disposeSFXBus, initSFXBus } from '../../lib/sfx-bus'
|
|
74
91
|
import { useUnitFocusRules } from '../../lib/units'
|
|
75
92
|
import { cn } from '../../lib/utils'
|
|
76
|
-
import { useViewerFloorDisplay } from '../../lib/viewer-selection'
|
|
77
93
|
import { type CameraHintAction, useCameraHintFocus } from '../../store/use-camera-hint-focus'
|
|
78
94
|
import useEditor from '../../store/use-editor'
|
|
79
95
|
import useFloorplanMode from '../../store/use-floorplan-mode'
|
|
80
96
|
import useSessionGroups from '../../store/use-session-groups'
|
|
81
97
|
import { paneOfView, VIEW_2D, VIEW_3D, type ViewPaneIndex } from '../../store/view-layout'
|
|
98
|
+
import { FloorplanDimensionHitsGate } from '../editor-2d/renderers/floorplan-dimension-edit-overlay'
|
|
82
99
|
import { PointAskLayer } from '../point-ask/point-ask-layer'
|
|
83
100
|
import { CeilingSelectionAffordanceSystem } from '../systems/ceiling/ceiling-selection-affordance-system'
|
|
84
101
|
import { CeilingSystem, CeilingTopsSync } from '../systems/ceiling/ceiling-system'
|
|
@@ -89,7 +106,7 @@ import { ZoneSystem } from '../systems/zone/zone-system'
|
|
|
89
106
|
import { BoxSelectTool } from '../tools/select/box-select-tool'
|
|
90
107
|
import { ToolManager } from '../tools/tool-manager'
|
|
91
108
|
import { ActionMenu } from '../ui/action-menu'
|
|
92
|
-
import {
|
|
109
|
+
import { TOP_MENU_CLEARANCE } from '../ui/action-menu/placement'
|
|
93
110
|
import { CommandPalette, type CommandPaletteEmptyAction } from '../ui/command-palette'
|
|
94
111
|
import { EditorCommands } from '../ui/command-palette/editor-commands'
|
|
95
112
|
import { FloatingLevelSelector } from '../ui/floating-level-selector'
|
|
@@ -97,22 +114,13 @@ import { HelperManager } from '../ui/helpers/helper-manager'
|
|
|
97
114
|
import { PanelManager } from '../ui/panels/panel-manager'
|
|
98
115
|
import { ErrorBoundary } from '../ui/primitives/error-boundary'
|
|
99
116
|
import { useSidebarStore } from '../ui/primitives/sidebar'
|
|
100
|
-
import { Tooltip, TooltipContent, TooltipTrigger } from '../ui/primitives/tooltip'
|
|
101
117
|
import { RightStack } from '../ui/right-stack'
|
|
102
|
-
import { SceneLoader, SceneLoadFailed } from '../ui/scene-loader'
|
|
103
118
|
import { AppSidebar } from '../ui/sidebar/app-sidebar'
|
|
104
119
|
import type { ExtraPanel } from '../ui/sidebar/icon-rail'
|
|
105
120
|
import { SettingsPanel, type SettingsPanelProps } from '../ui/sidebar/panels/settings-panel'
|
|
106
121
|
import { SitePanel, type SitePanelProps } from '../ui/sidebar/panels/site-panel'
|
|
107
122
|
import type { SidebarTab } from '../ui/sidebar/tab-bar'
|
|
108
123
|
import { useHostPanels } from '../ui/sidebar/use-plugin-panels'
|
|
109
|
-
import { SKY_DOCK_HEIGHT, SkyControl } from '../viewer/sky-control'
|
|
110
|
-
import { useViewerUiSounds } from '../viewer/use-viewer-ui-sounds'
|
|
111
|
-
import { ViewerHoverLabel } from '../viewer/viewer-hover-label'
|
|
112
|
-
import { ParametricViewerRooms } from '../viewer/viewer-rooms'
|
|
113
|
-
import { ViewerSelectionManager } from '../viewer/viewer-selection-manager'
|
|
114
|
-
import { ViewerStage } from '../viewer/viewer-stage'
|
|
115
|
-
import type { ViewerStageMode } from '../viewer/viewer-stage-modes'
|
|
116
124
|
import { CaptureCameraRig } from './capture-camera-rig'
|
|
117
125
|
import { CustomCameraControls } from './custom-camera-controls'
|
|
118
126
|
import { DeleteConfirmationDialog } from './delete-confirmation-dialog'
|
|
@@ -2075,7 +2083,9 @@ function EditorContent({
|
|
|
2075
2083
|
function EditorFrame(props: EditorProps) {
|
|
2076
2084
|
return (
|
|
2077
2085
|
<Profiler id="editor" onRender={recordEditorRender}>
|
|
2078
|
-
<
|
|
2086
|
+
<FloorplanDimensionHitsGate>
|
|
2087
|
+
<EditorContent {...props} />
|
|
2088
|
+
</FloorplanDimensionHitsGate>
|
|
2079
2089
|
</Profiler>
|
|
2080
2090
|
)
|
|
2081
2091
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
-
import { useIsMobile } from '
|
|
3
|
+
import { useIsMobile } from '@pascal-app/viewer/ui'
|
|
4
4
|
import { openExtension } from '../../lib/inspector-card-mode'
|
|
5
5
|
import { useInspectorExpanded } from '../../lib/inspector-expanded'
|
|
6
6
|
import { renderExtensionIcon, useInspectorExtensions } from '../ui/panels/inspector-extensions'
|
|
@@ -22,6 +22,7 @@ import {
|
|
|
22
22
|
useScene,
|
|
23
23
|
} from '@pascal-app/core'
|
|
24
24
|
import { useViewer } from '@pascal-app/viewer'
|
|
25
|
+
import { LocalizedHtml as Html } from '@pascal-app/viewer/ui'
|
|
25
26
|
import { createPortal, type ThreeEvent, useFrame, useThree } from '@react-three/fiber'
|
|
26
27
|
import { useEffect, useMemo, useRef, useState } from 'react'
|
|
27
28
|
import {
|
|
@@ -76,7 +77,6 @@ import {
|
|
|
76
77
|
import { createLinearResizeDragBinding, linearResizeFactor } from './handles/linear-resize-drag'
|
|
77
78
|
import { resolveResizeSnapValue } from './handles/resize-snap'
|
|
78
79
|
import { type HandleDragControls, useHandleDrag } from './handles/use-handle-drag'
|
|
79
|
-
import { Html } from './localized-html'
|
|
80
80
|
|
|
81
81
|
// Pooled scratch for the handle rig's world-relative pose mapping.
|
|
82
82
|
const _rigRelative = new Matrix4()
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { type OpenWallEnd, sceneRegistry } from '@pascal-app/core'
|
|
4
4
|
import { MEASUREMENT_DANGLING_COLOR, useViewer } from '@pascal-app/viewer'
|
|
5
|
+
import { LocalizedHtml as Html } from '@pascal-app/viewer/ui'
|
|
5
6
|
import { useFrame } from '@react-three/fiber'
|
|
6
7
|
import { memo, useEffect, useMemo, useRef } from 'react'
|
|
7
8
|
import { BoxGeometry, CircleGeometry, type Group, RingGeometry } from 'three'
|
|
@@ -17,7 +18,6 @@ import { cn } from '../../lib/utils'
|
|
|
17
18
|
import useEditor from '../../store/use-editor'
|
|
18
19
|
import { isViewVisible, VIEW_3D, visibleScene } from '../../store/view-layout'
|
|
19
20
|
import { JoinWallsPill } from './join-walls-pill'
|
|
20
|
-
import { Html } from './localized-html'
|
|
21
21
|
import { OpenWallEndsHint } from './open-wall-ends-hint'
|
|
22
22
|
|
|
23
23
|
/**
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
3
|
import { useViewer } from '@pascal-app/viewer'
|
|
4
|
+
import { LocalizedHtml as Html } from '@pascal-app/viewer/ui'
|
|
4
5
|
import { memo, useEffect, useLayoutEffect, useMemo } from 'react'
|
|
5
6
|
import { BufferGeometry, Float32BufferAttribute, Line as ThreeLine } from 'three'
|
|
6
7
|
import { LineBasicNodeMaterial } from 'three/webgpu'
|
|
@@ -9,7 +10,6 @@ import useOpeningGuides, {
|
|
|
9
10
|
type OpeningGuide3D,
|
|
10
11
|
type OpeningGuideVec3,
|
|
11
12
|
} from '../../store/use-opening-guides'
|
|
12
|
-
import { Html } from './localized-html'
|
|
13
13
|
import { formatMeasurement } from './measurement-pill'
|
|
14
14
|
|
|
15
15
|
const DIMENSION_COLOR = 0x81_8c_f8 // indigo — a neutral measurement
|