Virtual whiteboard for sketching hand-drawn like diagrams
feat: add hint around text editing (#3708)
David Luzarfd4460be3787
diff --git a/src/components/HelpDialog.tsx b/src/components/HelpDialog.tsxindex 45f54d179a..6a702f964a 100644--- a/src/components/HelpDialog.tsx+++ b/src/components/HelpDialog.tsx@@ -157,6 +157,13 @@ export const HelpDialog = ({ onClose }: { onClose?: () => void }) => {shortcuts={["Shift+P", "7"]}/><Shortcut label={t("toolBar.text")} shortcuts={["T", "8"]} />+ <Shortcut+ label={t("helpDialog.editSelectedShape")}+ shortcuts={[+ getShortcutKey("Enter"),+ t("helpDialog.doubleClick"),+ ]}+ /><Shortcutlabel={t("helpDialog.textNewLine")}shortcuts={[diff --git a/src/components/HintViewer.tsx b/src/components/HintViewer.tsxindex 4b1e84bf5a..2afa7201eb 100644--- a/src/components/HintViewer.tsx+++ b/src/components/HintViewer.tsx@@ -5,7 +5,7 @@ import { getSelectedElements } from "../scene";import "./HintViewer.scss";import { AppState } from "../types";-import { isLinearElement } from "../element/typeChecks";+import { isLinearElement, isTextElement } from "../element/typeChecks";import { getShortcutKey } from "../utils";interface Hint {@@ -57,6 +57,14 @@ const getHints = ({ appState, elements }: Hint) => {return t("hints.lineEditor_info");}+ if (selectedElements.length === 1 && isTextElement(selectedElements[0])) {+ return t("hints.text_selected");+ }++ if (appState.editingElement && isTextElement(appState.editingElement)) {+ return t("hints.text_editing");+ }+return null;};diff --git a/src/locales/en.json b/src/locales/en.jsonindex 891456a000..382bc5a1db 100644--- a/src/locales/en.json+++ b/src/locales/en.json@@ -180,6 +180,8 @@"linearElement": "Click to start multiple points, drag for single line","freeDraw": "Click and drag, release when you're finished","text": "Tip: you can also add text by double-clicking anywhere with the selection tool",+ "text_selected": "Double-click or press ENTER to edit text",+ "text_editing": "Press Escape or CtrlOrCmd+ENTER to finish editing","linearElementMulti": "Click on last point or press Escape or Enter to finish","lockAngle": "You can constrain angle by holding SHIFT","resize": "You can constrain proportions by holding SHIFT while resizing,\nhold ALT to resize from the center",@@ -236,16 +238,18 @@"curvedArrow": "Curved arrow","curvedLine": "Curved line","documentation": "Documentation",+ "doubleClick": "double-click","drag": "drag","editor": "Editor",+ "editSelectedShape": "Edit selected shape (text/arrow/line)","github": "Found an issue? Submit","howto": "Follow our guides","or": "or","preventBinding": "Prevent arrow binding","shapes": "Shapes","shortcuts": "Keyboard shortcuts",- "textFinish": "Finish editing (text)",- "textNewLine": "Add new line (text)",+ "textFinish": "Finish editing (text editor)",+ "textNewLine": "Add new line (text editor)","title": "Help","view": "View","zoomToFit": "Zoom to fit all elements",