mirror of
https://github.com/logseq/logseq.git
synced 2026-02-01 22:47:36 +00:00
chore: rearrange tools
This commit is contained in:
@@ -81,7 +81,7 @@ test('set whiteboard title', async ({ page }) => {
|
||||
})
|
||||
|
||||
test('select rectangle tool', async ({ page }) => {
|
||||
await page.keyboard.press('7')
|
||||
await page.keyboard.press('r')
|
||||
await expect(
|
||||
page.locator('.tl-geometry-tools-pane-anchor [title*="Rectangle"]')
|
||||
).toHaveAttribute('data-selected', 'true')
|
||||
@@ -91,7 +91,7 @@ test('draw a rectangle', async ({ page }) => {
|
||||
const canvas = await page.waitForSelector('.logseq-tldraw')
|
||||
const bounds = (await canvas.boundingBox())!
|
||||
|
||||
await page.keyboard.press('7')
|
||||
await page.keyboard.press('r')
|
||||
|
||||
await page.mouse.move(bounds.x + 5, bounds.y + 5)
|
||||
await page.mouse.down()
|
||||
|
||||
@@ -31,13 +31,6 @@ export const ActionBar = observer(function ActionBar(): JSX.Element {
|
||||
return (
|
||||
<div className="tl-action-bar">
|
||||
<div className="tl-toolbar tl-history-bar">
|
||||
<ToolButton title="Select" id="select" icon="select-cursor" />
|
||||
<ToolButton
|
||||
title="Move"
|
||||
id="move"
|
||||
icon={app.isIn('move.panning') ? 'hand-grab' : 'hand-stop'}
|
||||
/>
|
||||
<Separator.Root className="tl-toolbar-separator" orientation="vertical" />
|
||||
<Button title="Undo" onClick={undo}>
|
||||
<TablerIcon name="arrow-back-up" />
|
||||
</Button>
|
||||
|
||||
@@ -16,8 +16,14 @@ export const PrimaryTools = observer(function PrimaryTools() {
|
||||
return (
|
||||
<div className="tl-primary-tools">
|
||||
<div className="tl-toolbar tl-tools-floating-panel">
|
||||
<ToolButton title="Add block or page" id="logseq-portal" icon="circle-plus" />
|
||||
<ToolButton title="Select" id="select" icon="select-cursor" />
|
||||
<ToolButton
|
||||
title="Move"
|
||||
id="move"
|
||||
icon={app.isIn('move.panning') ? 'hand-grab' : 'hand-stop'}
|
||||
/>
|
||||
<Separator.Root className="tl-toolbar-separator" orientation="horizontal" />
|
||||
<ToolButton title="Add block or page" id="logseq-portal" icon="circle-plus" />
|
||||
<ToolButton title="Draw" id="pencil" icon="ballpen" />
|
||||
<ToolButton title="Highlight" id="highlighter" icon="highlight" />
|
||||
<ToolButton title="Eraser" id="erase" icon="eraser" />
|
||||
|
||||
@@ -4,6 +4,6 @@ import { BoxShape, type Shape } from '../shapes'
|
||||
|
||||
export class BoxTool extends TLBoxTool<BoxShape, Shape, TLReactEventMap> {
|
||||
static id = 'box'
|
||||
static shortcut = ['7', 'r']
|
||||
static shortcut = ['9', 'r']
|
||||
Shape = BoxShape
|
||||
}
|
||||
|
||||
@@ -4,5 +4,5 @@ import type { Shape } from '../shapes'
|
||||
|
||||
export class NuEraseTool extends TLEraseTool<Shape, TLReactEventMap> {
|
||||
static id = 'erase'
|
||||
static shortcut = ['4', 'e']
|
||||
static shortcut = ['6', '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', 'h']
|
||||
static shortcut = ['5', 'h']
|
||||
Shape = HighlighterShape
|
||||
simplify = true
|
||||
simplifyTolerance = 0.618
|
||||
|
||||
@@ -5,6 +5,6 @@ import { LineShape, type Shape } from '../shapes'
|
||||
// @ts-expect-error maybe later
|
||||
export class LineTool extends TLLineTool<LineShape, Shape, TLReactEventMap> {
|
||||
static id = 'line'
|
||||
static shortcut = ['5', 'c']
|
||||
static shortcut = ['7', 'c']
|
||||
Shape = LineShape
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ export class LogseqPortalTool extends TLTool<
|
||||
TLApp<Shape, TLReactEventMap>
|
||||
> {
|
||||
static id = 'logseq-portal'
|
||||
static shortcut = ['1']
|
||||
static shortcut = ['3']
|
||||
static states = [IdleState, CreatingState]
|
||||
static initial = 'idle'
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import { PencilShape, type Shape } from '../shapes'
|
||||
|
||||
export class PencilTool extends TLDrawTool<PencilShape, Shape, TLReactEventMap> {
|
||||
static id = 'pencil'
|
||||
static shortcut = ['2', 'd']
|
||||
static shortcut = ['4', 'd']
|
||||
Shape = PencilShape
|
||||
simplify = false
|
||||
}
|
||||
|
||||
@@ -4,6 +4,6 @@ import { TextShape, type Shape } from '../shapes'
|
||||
|
||||
export class TextTool extends TLTextTool<TextShape, Shape, TLReactEventMap> {
|
||||
static id = 'text'
|
||||
static shortcut = ['6', 't']
|
||||
static shortcut = ['8', '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 = ['m', '9']
|
||||
static shortcut = ['m', '2']
|
||||
|
||||
static states = [IdleState, IdleHoldState, PanningState, PinchingState]
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ export class TLSelectTool<
|
||||
|
||||
static initial = 'idle'
|
||||
|
||||
static shortcut = ['s', '8']
|
||||
static shortcut = ['s', '1']
|
||||
|
||||
static states = [
|
||||
IdleState,
|
||||
|
||||
Reference in New Issue
Block a user