diff --git a/manifest-beta.json b/manifest-beta.json index cf3044ec..8fa937fe 100644 --- a/manifest-beta.json +++ b/manifest-beta.json @@ -1,7 +1,7 @@ { "id": "obsidian-excalidraw-plugin", "name": "Excalidraw", - "version": "2.5.1", + "version": "2.5.2", "minAppVersion": "1.1.6", "description": "An Obsidian plugin to edit and view Excalidraw drawings", "author": "Zsolt Viczian", diff --git a/manifest.json b/manifest.json index b9a8e889..a596fcfe 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "obsidian-excalidraw-plugin", "name": "Excalidraw", - "version": "2.5.1", + "version": "2.5.2", "minAppVersion": "1.1.6", "description": "An Obsidian plugin to edit and view Excalidraw drawings", "author": "Zsolt Viczian", diff --git a/package.json b/package.json index 9cc6453f..1357e3f9 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "license": "MIT", "dependencies": { "@popperjs/core": "^2.11.8", - "@zsviczian/excalidraw": "0.17.1-obsidian-56", + "@zsviczian/excalidraw": "0.17.1-obsidian-57", "chroma-js": "^2.4.2", "clsx": "^2.0.0", "@zsviczian/colormaster": "^1.2.2", diff --git a/src/ExcalidrawView.ts b/src/ExcalidrawView.ts index 6fbc4224..ffa5502f 100644 --- a/src/ExcalidrawView.ts +++ b/src/ExcalidrawView.ts @@ -3444,7 +3444,7 @@ export default class ExcalidrawView extends TextFileView implements HoverParent{ toDelete.forEach((k) => delete files[k]); } - const activeTool = st.activeTool; + const activeTool = {...st.activeTool}; if(!["freedraw","hand"].includes(activeTool.type)) { activeTool.type = "selection"; } diff --git a/src/MarkdownPostProcessor.ts b/src/MarkdownPostProcessor.ts index 36e307b6..ab64d8d1 100644 --- a/src/MarkdownPostProcessor.ts +++ b/src/MarkdownPostProcessor.ts @@ -29,6 +29,7 @@ import { FILENAMEPARTS, PreviewImageType } from "./utils/UtilTypes"; import { CustomMutationObserver, debug, DEBUGGING } from "./utils/DebugHelper"; import { getExcalidrawFileForwardLinks } from "./utils/ExcalidrawViewUtils"; import { linkPrompt } from "./dialogs/Prompt"; +import { isHTMLElement } from "./utils/typechecks"; interface imgElementAttributes { file?: TFile; @@ -405,12 +406,13 @@ const createImgElement = async ( let timer:number; const clickEvent = (ev:PointerEvent) => { - if(!(ev.target instanceof Element)) { + if (!isHTMLElement(ev.target)) { return; } - const containerElement = ev.target.hasClass("excalidraw-embedded-img") + const targetElement = ev.target as HTMLElement; + const containerElement = targetElement.hasClass("excalidraw-embedded-img") ? ev.target - : getParentOfClass(ev.target, "excalidraw-embedded-img"); + : getParentOfClass(targetElement, "excalidraw-embedded-img"); if (!containerElement) { return; } diff --git a/src/dialogs/Messages.ts b/src/dialogs/Messages.ts index 74825901..2b0834f7 100644 --- a/src/dialogs/Messages.ts +++ b/src/dialogs/Messages.ts @@ -17,6 +17,18 @@ I develop this plugin as a hobby, spending my free time doing this. If you find
`, +"2.5.2": ` +## Fixed +- Text became disconnected from sticky notes (rectangle/ellipse/diamond + text) if the sticky note contained a link (e.g., URL or wiki link), and in some cases, triggered a save error warning. [#2054](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/2054) +- Long-clicking to open an Excalidraw drawing from a markdown note did not work when the note was in an Obsidian pop-out window. +- Active tool was deactivated after autosave, requiring the user to reselect the tool. + +## Minor changes to default settings +- I adjusted some of the default settings. This change only affects new installs of Excalidraw; existing installs and settings remain unchanged: + - **Reuse Adjacent Pane** is now the default for opening new drawings. Excalidraw will try to open the drawing in the most recently used adjacent pane, if available. + - **Focus on Existing Tab** is the default for reopening an already open drawing. Excalidraw will switch to the existing tab where the drawing is open, instead of creating a new one. + - **Autosave Interval** is now set to a default value of 1 minute on Desktop and 30 seconds on mobile platforms. +`, "2.5.1": ` ## New - Excalidraw will now save images using the filename from the file system when adding an image via the image tool (in the top toolbar). diff --git a/src/settings.ts b/src/settings.ts index d5cad921..77a88f5a 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -225,8 +225,8 @@ export const DEFAULT_SETTINGS: ExcalidrawSettings = { onceOffCompressFlagReset: false, onceOffGPTVersionReset: false, autosave: true, - autosaveIntervalDesktop: 30000, - autosaveIntervalMobile: 20000, + autosaveIntervalDesktop: 60000, + autosaveIntervalMobile: 30000, drawingFilenamePrefix: "Drawing ", drawingEmbedPrefixWithFilename: true, drawingFilnameEmbedPostfix: " ", @@ -268,9 +268,9 @@ export const DEFAULT_SETTINGS: ExcalidrawSettings = { done: "🗹", hoverPreviewWithoutCTRL: false, linkOpacity: 1, - openInAdjacentPane: false, + openInAdjacentPane: true, showSecondOrderLinks: true, - focusOnFileTab: false, + focusOnFileTab: true, openInMainWorkspace: true, showLinkBrackets: true, allowCtrlClick: true, diff --git a/src/utils/ExcalidrawSceneUtils.ts b/src/utils/ExcalidrawSceneUtils.ts index d61d5d16..b3c86c0a 100644 --- a/src/utils/ExcalidrawSceneUtils.ts +++ b/src/utils/ExcalidrawSceneUtils.ts @@ -23,6 +23,9 @@ export function updateElementIdsInScene( boundEl.boundElements?.filter(x=>x.id === elementToChange.id).forEach( x => { (x.id as Mutable