Add context menu and pan with middle click

This commit is contained in:
Konstantinos Kaloutas
2022-08-26 17:20:32 +03:00
parent c447a9abea
commit f7fd54203f
13 changed files with 247 additions and 6 deletions

View File

@@ -33,6 +33,7 @@ export const AppCanvas = observer(function InnerApp<S extends TLReactShape>(
showRotateHandles={app.showRotateHandles}
showSelectionDetail={app.showSelectionDetail}
showContextBar={app.showContextBar}
showContextMenu={app.showContextMenu}
cursor={app.cursors.cursor}
cursorRotation={app.cursors.rotation}
selectionRotation={app.selectionRotation}

View File

@@ -22,6 +22,7 @@ describe('Canvas', () => {
showRotateHandles={app.showRotateHandles}
showSelectionDetail={app.showSelectionDetail}
showContextBar={app.showContextBar}
showContextMenu={app.showContextMenu}
/>
)
}

View File

@@ -54,6 +54,7 @@ export interface TLCanvasProps<S extends TLReactShape> {
showResizeHandles: boolean
showRotateHandles: boolean
showContextBar: boolean
showContextMenu: boolean
showSelectionDetail: boolean
showSelectionRotation: boolean
children: React.ReactNode
@@ -82,6 +83,7 @@ export const Canvas = observer(function Renderer<S extends TLReactShape>({
showRotateHandles = true,
showSelectionDetail = true,
showContextBar = true,
showContextMenu = true,
showGrid = true,
gridSize = 8,
onEditingEnd = NOOP,

View File

@@ -25,6 +25,7 @@ describe('HTMLLayer', () => {
showRotateHandles={app.showRotateHandles}
showSelectionDetail={app.showSelectionDetail}
showContextBar={app.showContextBar}
showContextMenu={app.showContextBar}
/>
)
}