-
Notifications
You must be signed in to change notification settings - Fork 2.3k
editor: export the headless-composition surface (ToolManager, keyboard, camera, edit systems)#396
Open
buildaloyd wants to merge 1 commit into
Open
Conversation
...d, camera, edit systems)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Exports the thin editor-side glue that lets embedders compose
<Viewer>+ the interaction layer directly, without mounting the full<Editor>chrome — the registry already owns the per-kind tools (def.tool/def.affordanceTools/def.floorplanAffordances); these exports are the router and hosts around it:ToolManager— the tool router (registry-driven + legacy fallbacks)useKeyboard— the global shortcut hook (alongside the already-publicmarkToolCancelConsumed)CustomCameraControls— orbit/pan/first-person camera gluegetRegistryAffordanceTool— thedef.affordanceToolsdispatcherBoxSelectTool— screen-space marquee selectionCeilingSystem,CeilingSelectionAffordanceSystem,RoofEditSystem,StairEditSystem,ZoneSystem— edit-affordance systemsPhasetype (joins the already-exportedTooltype fromstore/use-editor)Additive only — no behavior change, no signature change, no file moves. Follows the same embedder story as
layoutVersion, the v2 slot props, and the recent Phase 5 Stage D/E export waves: we build a custom shell on@pascal-app/editorand currently must choose between mounting all of<Editor>'s chrome or forking these files; with these exports we can composeViewer + ToolManager + CustomCameraControls + useKeyboard (+ systems)and own the chrome while every kind-owned tool keeps working untouched.How to test
bun install && bun run build(orturbo run build --filter='@pascal-app/*') — builds green.cd packages/editor && bun run check-types— clean (verified locally).bunx biome check packages/editor/src/index.tsx— clean (verified locally).@pascal-app/editor,import { ToolManager, useKeyboard, CustomCameraControls, Phase } from '@pascal-app/editor'resolves and<Viewer><ToolManager/><CustomCameraControls/></Viewer>mounts the registry tools.Screenshots / screen recording
N/A — non-visual change (barrel exports only).
Checklist
bun dev(verified via package typecheck + workspace build instead; no app run)bun checkto verify)mainbranch