From 0efda1d6a653669c7ffd3305271f28bc0f1b39d8 Mon Sep 17 00:00:00 2001 From: zsviczian Date: Sun, 3 Nov 2024 00:54:38 +0100 Subject: [PATCH] 2.6.3-beta-5 --- manifest-beta.json | 2 +- src/main.ts | 92 ++++++++++++++++++++++++++++++++++++---------- styles.css | 2 +- 3 files changed, 75 insertions(+), 21 deletions(-) diff --git a/manifest-beta.json b/manifest-beta.json index 6244e2f..92fcf10 100644 --- a/manifest-beta.json +++ b/manifest-beta.json @@ -1,7 +1,7 @@ { "id": "obsidian-excalidraw-plugin", "name": "Excalidraw", - "version": "2.6.3-beta-4", + "version": "2.6.3-beta-5", "minAppVersion": "1.1.6", "description": "An Obsidian plugin to edit and view Excalidraw drawings", "author": "Zsolt Viczian", diff --git a/src/main.ts b/src/main.ts index 77f97de..398ef4f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -145,6 +145,7 @@ import { WeakArray } from "./utils/WeakArray"; import { getCJKDataURLs } from "./utils/CJKLoader"; import { ExcalidrawLoading, switchToExcalidraw } from "./dialogs/ExcalidrawLoading"; import { insertImageToView } from "./utils/ExcalidrawViewUtils"; +import tr from "./lang/locale/tr"; declare let EXCALIDRAW_PACKAGE:string; declare let REACT_PACKAGES:string; @@ -412,33 +413,86 @@ export default class ExcalidrawPlugin extends Plugin { switchToExcalidraw(this.app); this.switchToExcalidarwAfterLoad(); - if (this.settings.showReleaseNotes) { - //I am repurposing imageElementNotice, if the value is true, this means the plugin was just newly installed to Obsidian. - const obsidianJustInstalled = this.settings.previousRelease === "0.0.0" + try { + if (this.settings.showReleaseNotes) { + //I am repurposing imageElementNotice, if the value is true, this means the plugin was just newly installed to Obsidian. + const obsidianJustInstalled = this.settings.previousRelease === "0.0.0" - if (isVersionNewerThanOther(PLUGIN_VERSION, this.settings.previousRelease)) { - new ReleaseNotes( - this.app, - this, - obsidianJustInstalled ? null : PLUGIN_VERSION, - ).open(); + if (isVersionNewerThanOther(PLUGIN_VERSION, this.settings.previousRelease)) { + new ReleaseNotes( + this.app, + this, + obsidianJustInstalled ? null : PLUGIN_VERSION, + ).open(); + } } + } catch (e) { + new Notice("Error opening release notes", 6000); + console.log("Error opening release notes", e); } //initialization that can happen after Excalidraw views are initialized - this.registerEventListeners(); - this.runStartupScript(); - this.editorHandler = new EditorHandler(this); - this.editorHandler.setup(); - this.registerInstallCodeblockProcessor(); - this.experimentalFileTypeDisplayToggle(this.settings.experimentalFileType); - this.registerCommands(); - this.registerEditorSuggest(new FieldSuggester(this)); - this.setPropertyTypes(); - this.taskbone = new Taskbone(this); + + try { + this.registerEventListeners(); + } catch (e) { + new Notice("Error registering event listeners", 6000); + console.log("Error registering event listeners", e); + } + try { + this.runStartupScript(); + } catch (e) { + new Notice("Error running startup script", 6000); + console.log("Error running startup script", e); + } + try { + this.editorHandler = new EditorHandler(this); + this.editorHandler.setup(); + } catch (e) { + new Notice("Error setting up editor handler", 6000); + console.log("Error setting up editor handler", e); + } + try { + this.registerInstallCodeblockProcessor(); + } catch (e) { + new Notice("Error registering script install-codeblock processor", 6000); + console.log("Error registering script install-codeblock processor", e); + } + + try { + this.experimentalFileTypeDisplayToggle(this.settings.experimentalFileType); + } catch (e) { + new Notice("Error setting up experimental file type display", 6000); + console.log("Error setting up experimental file type display", e); + } + try { + this.registerCommands(); + } catch (e) { + new Notice("Error registering commands", 6000); + console.log("Error registering commands", e); + } + try { + this.registerEditorSuggest(new FieldSuggester(this)); + } catch (e) { + new Notice("Error registering editor suggester", 6000); + console.log("Error registering editor suggester", e); + } + try { + this.setPropertyTypes(); + } catch (e) { + new Notice("Error setting up property types", 6000); + console.log("Error setting up property types", e); + } + try { + this.taskbone = new Taskbone(this); + } catch (e) { + new Notice("Error setting up taskbone", 6000); + console.log("Error setting up taskbone", e); + } }); } + public async awaitInit() { let counter = 0; while(!this.isReady && counter < 150) { diff --git a/styles.css b/styles.css index 10f436a..1d84ccd 100644 --- a/styles.css +++ b/styles.css @@ -346,7 +346,7 @@ label.color-input-container > input { padding: 0; } -.excalidraw-settings input:not([type="color"]) { +.excalidraw-settings input[type="text"] { min-width: 10em; }