Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix edgeless edit bar tooltip (#243)

Horusbd59871c22a7
diff --git a/libs/components/board-draw/src/components/tools-panel/ToolsPanel.tsx b/libs/components/board-draw/src/components/tools-panel/ToolsPanel.tsx
index cd28a0a756..f659fdff1c 100644
--- a/libs/components/board-draw/src/components/tools-panel/ToolsPanel.tsx
+++ b/libs/components/board-draw/src/components/tools-panel/ToolsPanel.tsx
@@ -52,8 +52,8 @@ const tools: Array<{
{ type: 'frame', label: 'Frame', tooltip: 'Frame', icon: FrameIcon },
{
type: TDShapeType.Editor,
- label: 'Text',
- tooltip: 'Text',
+ label: 'Text Block',
+ tooltip: 'Text Block',
icon: TextIcon,
},
{ type: 'shapes', component: ShapeTools },
@@ -61,9 +61,9 @@ const tools: Array<{
{ type: 'Connector', component: LineTools },
// { type: 'erase', label: 'Erase', tooltip: 'Erase', icon: EraseIcon },
{
- type: TDShapeType.HandDraw,
- label: 'HandDraw',
- tooltip: 'HandDraw',
+ type: TDShapeType.HandDrag,
+ label: 'Hand Drag',
+ tooltip: 'Hand Drag',
icon: HandToolIcon,
},
{
diff --git a/libs/components/board-state/src/tldraw-app.ts b/libs/components/board-state/src/tldraw-app.ts
index 16d6edc1eb..366b7c67f5 100644
--- a/libs/components/board-state/src/tldraw-app.ts
+++ b/libs/components/board-state/src/tldraw-app.ts
@@ -3981,7 +3981,7 @@ export class TldrawApp extends StateManager<TDSnapshot> {
this.patchState({
settings: {
forcePanning:
- this.currentTool.type === TDShapeType.HandDraw,
+ this.currentTool.type === TDShapeType.HandDrag,
},
});
this.spaceKey = false;
diff --git a/libs/components/board-tools/src/hand-draw/hand-draw-tool.ts b/libs/components/board-tools/src/hand-drag/hand-drag-tool.ts
similarity index 87%
rename from libs/components/board-tools/src/hand-draw/hand-draw-tool.ts
rename to libs/components/board-tools/src/hand-drag/hand-drag-tool.ts
index df0d80e1be..3730447935 100644
--- a/libs/components/board-tools/src/hand-draw/hand-draw-tool.ts
+++ b/libs/components/board-tools/src/hand-drag/hand-drag-tool.ts
@@ -9,8 +9,8 @@ enum Status {
Draw = 'draw',
}
-export class HandDrawTool extends BaseTool {
- override type = TDShapeType.HandDraw as const;
+export class HandDragTool extends BaseTool {
+ override type = TDShapeType.HandDrag as const;
override status: Status = Status.Idle;
diff --git a/libs/components/board-tools/src/hand-drag/index.ts b/libs/components/board-tools/src/hand-drag/index.ts
new file mode 100644
index 0000000000..5c11fb0d69
--- /dev/null
+++ b/libs/components/board-tools/src/hand-drag/index.ts
@@ -0,0 +1 @@
+export * from './hand-drag-tool';
diff --git a/libs/components/board-tools/src/hand-draw/index.ts b/libs/components/board-tools/src/hand-draw/index.ts
deleted file mode 100644
index cc6c154d06..0000000000
--- a/libs/components/board-tools/src/hand-draw/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './hand-draw-tool';
diff --git a/libs/components/board-tools/src/index.ts b/libs/components/board-tools/src/index.ts
index caf7e80d1f..f55558c94c 100644
--- a/libs/components/board-tools/src/index.ts
+++ b/libs/components/board-tools/src/index.ts
@@ -5,7 +5,7 @@ import { EditorTool } from './editor-tool';
import { EllipseTool } from './ellipse-tool';
import { EraseTool } from './erase-tool';
import { FrameTool } from './frame-tool/frame-tool';
-import { HandDrawTool } from './hand-draw';
+import { HandDragTool } from './hand-drag';
import { HexagonTool } from './hexagon-tool';
import { HighlightTool } from './highlight-tool';
import { LaserTool } from './laser-tool';
@@ -32,7 +32,7 @@ export interface ToolsMap {
[TDShapeType.Highlight]: typeof HighlightTool;
[TDShapeType.Editor]: typeof EditorTool;
[TDShapeType.WhiteArrow]: typeof WhiteArrowTool;
- [TDShapeType.HandDraw]: typeof HandDrawTool;
+ [TDShapeType.HandDrag]: typeof HandDragTool;
[TDShapeType.Laser]: typeof LaserTool;
[TDShapeType.Frame]: typeof FrameTool;
}
@@ -59,6 +59,6 @@ export const tools: { [K in TDToolType]: ToolsMap[K] } = {
[TDShapeType.Hexagon]: HexagonTool,
[TDShapeType.WhiteArrow]: WhiteArrowTool,
[TDShapeType.Laser]: LaserTool,
- [TDShapeType.HandDraw]: HandDrawTool,
+ [TDShapeType.HandDrag]: HandDragTool,
[TDShapeType.Frame]: FrameTool,
};
diff --git a/libs/components/board-types/src/types.ts b/libs/components/board-types/src/types.ts
index 71326a504c..78d0cfca8a 100644
--- a/libs/components/board-types/src/types.ts
+++ b/libs/components/board-types/src/types.ts
@@ -212,7 +212,7 @@ export type TDToolType =
| TDShapeType.WhiteArrow
| TDShapeType.Editor
| TDShapeType.Frame
- | TDShapeType.HandDraw;
+ | TDShapeType.HandDrag;
export type Easing =
| 'linear'
@@ -287,7 +287,7 @@ export enum TDShapeType {
Video = 'video',
Editor = 'editor',
WhiteArrow = 'white-arrow',
- HandDraw = 'hand-draw',
+ HandDrag = 'hand-drag',
Frame = 'frame',
}