mirror of
https://github.com/logseq/logseq.git
synced 2026-05-25 13:14:39 +00:00
fix: add letter shortcuts to some shapes
This commit is contained in:
@@ -24,9 +24,9 @@ export const ToolButton = observer(({ id, icon, title, ...props }: ToolButtonPro
|
||||
// Tool must exist
|
||||
const Tool = [...app.Tools, TLSelectTool, TLMoveTool]?.find(T => T.id === id)
|
||||
|
||||
const shortcut = ((Tool as any)['shortcut'] as string[])?.[0]
|
||||
const shortcut = ((Tool as any)['shortcut'] as string[])?.join(', ').toUpperCase()
|
||||
|
||||
const titleWithShortcut = shortcut ? `${title} (${shortcut})` : title
|
||||
const titleWithShortcut = shortcut ? `${title} - ${shortcut}` : title
|
||||
return (
|
||||
<Button
|
||||
{...props}
|
||||
|
||||
@@ -4,6 +4,6 @@ import { BoxShape, type Shape } from '../shapes'
|
||||
|
||||
export class BoxTool extends TLBoxTool<BoxShape, Shape, TLReactEventMap> {
|
||||
static id = 'box'
|
||||
static shortcut = ['7']
|
||||
static shortcut = ['7', 'r']
|
||||
Shape = BoxShape
|
||||
}
|
||||
|
||||
@@ -4,5 +4,6 @@ import { EllipseShape, type Shape } from '../shapes'
|
||||
|
||||
export class EllipseTool extends TLBoxTool<EllipseShape, Shape, TLReactEventMap> {
|
||||
static id = 'ellipse'
|
||||
static shortcut = ['o']
|
||||
Shape = EllipseShape
|
||||
}
|
||||
|
||||
@@ -4,5 +4,5 @@ import type { Shape } from '../shapes'
|
||||
|
||||
export class NuEraseTool extends TLEraseTool<Shape, TLReactEventMap> {
|
||||
static id = 'erase'
|
||||
static shortcut = ['4']
|
||||
static shortcut = ['4', 'e']
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import { HighlighterShape, type Shape } from '../shapes'
|
||||
|
||||
export class HighlighterTool extends TLDrawTool<HighlighterShape, Shape, TLReactEventMap> {
|
||||
static id = 'highlighter'
|
||||
static shortcut = ['3']
|
||||
static shortcut = ['3', 'h']
|
||||
Shape = HighlighterShape
|
||||
simplify = true
|
||||
simplifyTolerance = 0.618
|
||||
|
||||
@@ -4,6 +4,6 @@ import { TextShape, type Shape } from '../shapes'
|
||||
|
||||
export class TextTool extends TLTextTool<TextShape, Shape, TLReactEventMap> {
|
||||
static id = 'text'
|
||||
static shortcut = ['6']
|
||||
static shortcut = ['6', 't']
|
||||
Shape = TextShape
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ export class TLMoveTool<
|
||||
R extends TLApp<S, K> = TLApp<S, K>
|
||||
> extends TLTool<S, K, R> {
|
||||
static id = 'move'
|
||||
static shortcut = ['9']
|
||||
static shortcut = ['m', '9']
|
||||
|
||||
static states = [IdleState, IdleHoldState, PanningState, PinchingState]
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ export class TLSelectTool<
|
||||
|
||||
static initial = 'idle'
|
||||
|
||||
static shortcut = ['8']
|
||||
static shortcut = ['s', '8']
|
||||
|
||||
static states = [
|
||||
IdleState,
|
||||
|
||||
Reference in New Issue
Block a user