diff --git a/images/excalidraw-modifiers.png b/images/excalidraw-modifiers.png index 4797ddf..c43364f 100644 Binary files a/images/excalidraw-modifiers.png and b/images/excalidraw-modifiers.png differ diff --git a/manifest.json b/manifest.json index 61e5599..ace9ae8 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "obsidian-excalidraw-plugin", "name": "Excalidraw", - "version": "1.8.14", + "version": "1.8.16", "minAppVersion": "1.0.0", "description": "An Obsidian plugin to edit and view Excalidraw drawings", "author": "Zsolt Viczian", diff --git a/src/ExcalidrawView.ts b/src/ExcalidrawView.ts index 8e4f002..54ab5d5 100644 --- a/src/ExcalidrawView.ts +++ b/src/ExcalidrawView.ts @@ -107,7 +107,7 @@ import { ICONS, saveIcon } from "./menu/ActionIcons"; //import {WelcomeScreen} from "@zsviczian/excalidraw"; import { ExportDialog } from "./dialogs/ExportDialog"; import { getEA } from "src"; -import { externalDragModifierType, internalDragModifierType, isALT, isCTRL, isMETA, isSHIFT, linkClickModifierType, mdPropModifier, ModifierKeys } from "./utils/ModifierkeyHelper"; +import { emulateCTRLClickForLinks, externalDragModifierType, internalDragModifierType, isALT, isCTRL, isMETA, isSHIFT, linkClickModifierType, mdPropModifier, ModifierKeys } from "./utils/ModifierkeyHelper"; type SelectedElementWithLink = { id: string; text: string }; type SelectedImage = { id: string; fileId: FileId }; @@ -2866,7 +2866,7 @@ export default class ExcalidrawView extends TextFileView { case "image-fullsize": msg = "Embed image @100%"; break; case "link": msg = "Insert link"; break; } - } else if(e.dataTransfer.types.includes("Files")) { + } else if(e.dataTransfer.types.length === 1 && e.dataTransfer.types.includes("Files")) { //drag from OS file manager msg = "External file" } else { @@ -2878,7 +2878,7 @@ export default class ExcalidrawView extends TextFileView { } } if(this.draginfoDiv.innerText !== msg) this.draginfoDiv.innerText = msg; - const top = `${e.clientY-parseFloat(getComputedStyle(this.draginfoDiv).fontSize)*3}px`; + const top = `${e.clientY-parseFloat(getComputedStyle(this.draginfoDiv).fontSize)*8}px`; const left = `${e.clientX-this.draginfoDiv.clientWidth/2}px`; if(this.draginfoDiv.style.top !== top) this.draginfoDiv.style.top = top; if(this.draginfoDiv.style.left !== left) this.draginfoDiv.style.left = left; @@ -3448,12 +3448,7 @@ export default class ExcalidrawView extends TextFileView { null, null, {id: element.id, text: element.link}, - { - shiftKey: event.shitKey, - ctrlKey: event.ctrlKey || !(DEVICE.isIOS || DEVICE.isMacOS), - metaKey: event.metaKey || (DEVICE.isIOS || DEVICE.isMacOS), - altKey: event.altKey - } + emulateCTRLClickForLinks(event) ); return; }, diff --git a/src/dialogs/Messages.ts b/src/dialogs/Messages.ts index 70684c7..6e2f513 100644 --- a/src/dialogs/Messages.ts +++ b/src/dialogs/Messages.ts @@ -17,6 +17,20 @@ I develop this plugin as a hobby, spending my free time doing this. If you find
`, +"1.8.16": ` +**!!! Modifier keys have changed, please review the table below !!!** +[Click this to see the new shortcuts overview image](https://raw.githubusercontent.com/zsviczian/obsidian-excalidraw-plugin/master/images/excalidraw-modifiers.png) + +## Fixed +- This version was extensively tested and developed on MacOS to remove usability issues. +- New command palette action to create a new drawing in a new tab +- Modifier keys to open links in the active window, splitting the current view to the right, in a new tab, or in a popout window now behave consistently both in Excalidraw and when clicking a drawing that is embedded in a markdown note. +- Drag & Drop properly works from within Obsidian, from a web browser, and from the OS file explorer + +