From 9974ca1e2eef1e7f9962ceb98878dac8df5f24ab Mon Sep 17 00:00:00 2001 From: zsviczian Date: Wed, 21 Feb 2024 18:49:19 +0100 Subject: [PATCH] 2.0.22 --- manifest.json | 2 +- package.json | 2 +- src/ExcalidrawAutomate.ts | 11 ++++++++--- src/ExcalidrawData.ts | 5 ++++- src/dialogs/Messages.ts | 5 +++++ src/lang/locale/en.ts | 2 +- src/settings.ts | 4 ++-- 7 files changed, 22 insertions(+), 9 deletions(-) diff --git a/manifest.json b/manifest.json index 0809c84..89188d0 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "obsidian-excalidraw-plugin", "name": "Excalidraw", - "version": "2.0.21", + "version": "2.0.22", "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 e15d96a..d0c8a7f 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-14", + "@zsviczian/excalidraw": "0.17.1-obsidian-15", "chroma-js": "^2.4.2", "clsx": "^2.0.0", "colormaster": "^1.2.1", diff --git a/src/ExcalidrawAutomate.ts b/src/ExcalidrawAutomate.ts index c53f581..f032354 100644 --- a/src/ExcalidrawAutomate.ts +++ b/src/ExcalidrawAutomate.ts @@ -154,7 +154,13 @@ export class ExcalidrawAutomate { return; } + let isMissing = true; + if (funcInfo.code) { + isMissing = false; + console.log(`Declaration: ${funcInfo.code}`); + } if (funcInfo.desc) { + isMissing = false; const formattedDesc = funcInfo.desc .replaceAll("
", "\n") .replace(/(.*?)<\/code>/g, '%c\u200b$1%c') // Zero-width space @@ -162,10 +168,9 @@ export class ExcalidrawAutomate { .replace(/(.*?)<\/a>/g, (_, href, text) => `%c\u200b${text}%c\u200b (link: ${href})`); // Zero-width non-joiner const styles = Array.from({ length: (formattedDesc.match(/%c/g) || []).length }, (_, i) => i % 2 === 0 ? 'color: #007bff;' : ''); - - console.log(`Declaration: ${funcInfo.code}`); console.log(`Description: ${formattedDesc}`, ...styles); - } else { + } + if (isMissing) { console.log("Description not available for this function."); } } diff --git a/src/ExcalidrawData.ts b/src/ExcalidrawData.ts index 6d4f18c..3046084 100644 --- a/src/ExcalidrawData.ts +++ b/src/ExcalidrawData.ts @@ -314,7 +314,10 @@ export class ExcalidrawData { map.set(item.id, item.type); alreadyHasText = true; } else { - elements.find((el:ExcalidrawElement)=>el.id===item.id).containerId = null; + const elementToClean = elements.find((el:ExcalidrawElement)=>el.id===item.id); + if(elementToClean) { //https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/1600 + elementToClean.containerId = null; + } } } else { map.set(item.id, item.type); diff --git a/src/dialogs/Messages.ts b/src/dialogs/Messages.ts index 08dea8a..b037cb2 100644 --- a/src/dialogs/Messages.ts +++ b/src/dialogs/Messages.ts @@ -17,6 +17,11 @@ I develop this plugin as a hobby, spending my free time doing this. If you find
`, +"2.0.22":` +## Fixed +- BUG: Unable to load obsidian excalidraw plugin on ipad 15.x or older [#1525](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/1525) +- BUG: ea.help does not display help if only function signature is available [#1601](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/1601) +`, "2.0.21":` ## New/changed **"Focus on Existing Tab"** diff --git a/src/lang/locale/en.ts b/src/lang/locale/en.ts index dbb1bf1..7dacbc4 100644 --- a/src/lang/locale/en.ts +++ b/src/lang/locale/en.ts @@ -310,7 +310,7 @@ FILENAME_HEAD: "Filename", "These settings are different for Apple and non-Apple. If you use Obsidian on multiple platforms, you'll need to make the settings separately. "+ "The toggles follow the order of " + (DEVICE.isIOS || DEVICE.isMacOS ? "SHIFT, CMD, OPT, CONTROL." : "SHIFT, CTRL, ALT, META (Windows key)."), - FOCUS_ON_EXISTING_TAB: "Focus on Existing Tab", + FOCUS_ON_EXISTING_TAB_NAME: "Focus on Existing Tab", FOCUS_ON_EXISTING_TAB_DESC: "When opening a link, Excalidraw will focus on the existing tab if the file is already open. " + "Enabling this setting overrides 'Reuse Adjacent Pane' when the file is already open.", ADJACENT_PANE_NAME: "Reuse adjacent pane", diff --git a/src/settings.ts b/src/settings.ts index 9282ffd..4300819 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -1183,8 +1183,8 @@ export class ExcalidrawSettingTab extends PluginSettingTab { ); new Setting(detailsEl) - .setName(t("FOCUS_ON_OPEN_TAB_NAME")) - .setDesc(fragWithHTML(t("FOCUS_ON_OPEN_TAB_DESC"))) + .setName(t("FOCUS_ON_EXISTING_TAB_NAME")) + .setDesc(fragWithHTML(t("FOCUS_ON_EXISTING_TAB_DESC"))) .addToggle((toggle) => toggle .setValue(this.plugin.settings.focusOnFileTab)