From fd4460be3787088a5a46daecedc52aabb00cc9b9 Mon Sep 17 00:00:00 2001 From: David Luzar Date: Sat, 12 Jun 2021 22:58:34 +0200 Subject: [PATCH] feat: add hint around text editing (#3708) --- src/components/HelpDialog.tsx | 7 +++++++ src/components/HintViewer.tsx | 10 +++++++++- src/locales/en.json | 8 ++++++-- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/components/HelpDialog.tsx b/src/components/HelpDialog.tsx index 45f54d17..6a702f96 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"]} /> + { 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.json index 891456a0..382bc5a1 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",