Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"react-dom": "^19.2.4",
"tailwind-merge": "^3.5.0",
"tailwindcss": "^4.2.1",
"three": "^0.183.1"
"three": "^0.184.0"
},
"devDependencies": {
"@pascal/typescript-config": "*",
Expand Down
39 changes: 19 additions & 20 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@react-three/drei": "^10",
"@react-three/fiber": "^9",
"react": "^18 || ^19",
"three": "^0.182"
"three": "^0.184"
},
"dependencies": {
"dedent": "^1.7.1",
Expand All @@ -47,7 +47,7 @@
"@pascal/typescript-config": "*",
"@types/react": "^19.2.2",
"typescript": "5.9.3",
"@types/three": "^0.183.0"
"@types/three": "^0.184.0"
},
"keywords": [
"3d",
Expand Down
31 changes: 27 additions & 4 deletions packages/core/src/events/bus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ export interface GridEvent {
/** World-space intersection point on the grid plane. */
position: [number, number, number]
/**
* Building-local intersection point relative to the currently selected building.
* Building-local intersection point, relative to the currently selected building.
* Equals `position` when no building is selected.
* Use this for placing/committing anything that lives inside a building (walls, slabs, items, etc.).
* Use this for placing or committing anything that lives inside a building
* (walls, slabs, items, etc.).
*/
localPosition: [number, number, number]
nativeEvent: ThreeEvent<PointerEvent>
Expand Down Expand Up @@ -57,7 +58,7 @@ export type StairSegmentEvent = NodeEvent<StairSegmentNode>
export type WindowEvent = NodeEvent<WindowNode>
export type DoorEvent = NodeEvent<DoorNode>

// Event suffixes - exported for use in hooks
// Event suffixes, exported for use in hooks
export const eventSuffixes = [
'click',
'move',
Expand Down Expand Up @@ -85,6 +86,15 @@ export interface CameraControlEvent {

export interface ThumbnailGenerateEvent {
projectId: string
captureMode?: 'standard' | 'viewport' | 'area'
cropRegion?: { x: number; y: number; width: number; height: number }
/**
* When true, snap levels to their true positions before capturing (for a
* consistent auto-thumbnail angle) and defer the capture if the tab is
* hidden, the background auto-save path. Omit for user-driven captures
* that should fire immediately from the current camera pose.
*/
snapLevels?: boolean
}

type CameraControlEvents = {
Expand All @@ -111,6 +121,17 @@ type ThumbnailEvents = {
'thumbnail:after-capture': undefined
}

type SnapshotEvents = {
'snapshot:saved': undefined
'camera:go-to-position': { position: [number, number, number]; target: [number, number, number] }
}

type AIChatEvents = {
'ai-chat:attach-images': {
images: { url: string; name: string; kind: 'snapshot' | 'render' }[]
}
}

type EditorEvents = GridEvents &
NodeEvents<'wall', WallEvent> &
NodeEvents<'fence', FenceEvent> &
Expand All @@ -130,6 +151,8 @@ type EditorEvents = GridEvents &
CameraControlEvents &
ToolEvents &
PresetEvents &
ThumbnailEvents
ThumbnailEvents &
SnapshotEvents &
AIChatEvents

export const emitter = mitt<EditorEvents>()
Loading