Phase 5 Stage D fence: port FenceTool placement to def.tool

Fourth and final Stage D fence affordance — the placement tool itself.

Unlike the drag affordances (curve / move / endpoint), placement is a
two-click flow with state across grid events, not a single drag-down →
drag-up lifecycle. `DragAction` doesn't fit; the component owns its
own emitter subscriptions directly. The kind exposes it via
`def.tool: () => import('./tool')` and ToolManager's existing
`getRegistryTool()` lookup mounts it (legacy `tools.structure.fence =
FenceTool` falls through when the registry entry is missing).

Adds transitional exports from `@pascal-app/editor` for the helpers
the kind-owned tool needs at module scope: `createFenceOnCurrentLevel`,
`markToolCancelConsumed`, `EDITOR_LAYER`. Stage F cleanup moves these
into `@pascal-app/nodes` once every consumer is registry-driven.

Fence Stage D is now complete. Per-kind progress: A  B  C  D 
(four affordances ported — curve, move-endpoint, move, placement).
E (drop legacy panel) and F (cleanup) pending across all kinds.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Wassim SAMAD
2026-05-15 18:22:57 -04:00
co-authored by Claude Opus 4.7
parent c16878c876
commit 7b5a1c607a
3 changed files with 343 additions and 1 deletions
+8 -1
View File
@@ -8,7 +8,11 @@ export {
// consumed by kind-owned drag actions in @pascal-app/nodes. Stage F
// cleanup moves these into @pascal-app/nodes (fence/drafting.ts +
// shared/segment-angle.ts) once every Stage D port is in.
export { type FencePlanPoint, snapFenceDraftPoint } from './components/tools/fence/fence-drafting'
export {
createFenceOnCurrentLevel,
type FencePlanPoint,
snapFenceDraftPoint,
} from './components/tools/fence/fence-drafting'
export { CursorSphere } from './components/tools/shared/cursor-sphere'
export {
formatAngleRadians,
@@ -42,6 +46,9 @@ export type { SaveStatus } from './hooks/use-auto-save'
// primitive. Public so registry-driven kinds (Phase 5+ Stage D ports)
// can express their affordances declaratively in their own folder.
export { type UseDragActionArgs, useDragAction } from './hooks/use-drag-action'
// Phase 5 Stage D — extras for kind-owned placement tools (FenceTool etc.).
export { markToolCancelConsumed } from './hooks/use-keyboard'
export { EDITOR_LAYER } from './lib/constants'
export type { SceneGraph } from './lib/scene'
export { applySceneGraphToEditor } from './lib/scene'
export { triggerSFX } from './lib/sfx-bus'