From 0e1ee0dde2011faea4d00fa214529daa849616a8 Mon Sep 17 00:00:00 2001 From: Zsolt Viczian Date: Wed, 24 Aug 2022 23:21:04 +0200 Subject: [PATCH] 1.7.16 --- manifest.json | 2 +- package.json | 2 +- src/ExcalidrawView.ts | 8 ++++++++ src/dialogs/Messages.ts | 7 +++++++ yarn.lock | 8 ++++---- 5 files changed, 21 insertions(+), 6 deletions(-) diff --git a/manifest.json b/manifest.json index 4a640a5..65beabe 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "obsidian-excalidraw-plugin", "name": "Excalidraw", - "version": "1.7.15", + "version": "1.7.16", "minAppVersion": "0.15.6", "description": "An Obsidian plugin to edit and view Excalidraw drawings", "author": "Zsolt Viczian", diff --git a/package.json b/package.json index 2c778bf..8e2590d 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "license": "MIT", "dependencies": { "@types/lz-string": "^1.3.34", - "@zsviczian/excalidraw": "0.12.0-obsidian-5", + "@zsviczian/excalidraw": "0.12.0-obsidian-7", "clsx": "^1.1.1", "lz-string": "^1.4.4", "monkey-around": "^2.3.0", diff --git a/src/ExcalidrawView.ts b/src/ExcalidrawView.ts index 8c377bb..59867a0 100644 --- a/src/ExcalidrawView.ts +++ b/src/ExcalidrawView.ts @@ -3012,6 +3012,14 @@ export default class ExcalidrawView extends TextFileView { originalText: string, isDeleted: boolean, ): [string, string, string] => { + const FORBIDDEN_TEXT = `{"type":"excalidraw/clipboard","elements":[{"`; + if(text.startsWith(FORBIDDEN_TEXT)) { + return [ + "PASTING EXCALIDRAW ELEMENTS AS A TEXT ELEMENT IS NOT ALLOWED", + "PASTING EXCALIDRAW ELEMENTS AS A TEXT ELEMENT IS NOT ALLOWED", + null + ]; + } const api = this.excalidrawAPI; if (!api) { return [null, null, null]; diff --git a/src/dialogs/Messages.ts b/src/dialogs/Messages.ts index 0f3861f..4d371f4 100644 --- a/src/dialogs/Messages.ts +++ b/src/dialogs/Messages.ts @@ -17,6 +17,13 @@ I develop this plugin as a hobby, spending most of my free time doing this. If y
`, +"1.7.16":` +# Fixed +- Excalidraw canvas is empty after saving the drawing and re-opening it at a later time. If you accidentally paste Excalidraw elements from the clipboard as the contents of a text element, in certain situations this can corrupt the Excalidraw file and as a result, Excalidraw will load an empty-looking drawing the next time. Changing to markdown view, these files can be repaired, however, to avoid accidental data loss, I have prevented pasting of excalidraw clipboard contents as text elements. [#768](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/768) + +# New +- Add zoom % display in tray-mode [737](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/737) +`, "1.7.15":` # Fixed - Canvas turns white when adding point for curved line [#760](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/760), [#738](https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/738), [#5602](https://github.com/excalidraw/excalidraw/issues/5602) diff --git a/yarn.lock b/yarn.lock index 59ff79e..3f62c7b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2216,10 +2216,10 @@ dependencies: "@zerollup/ts-helpers" "^1.7.18" -"@zsviczian/excalidraw@0.12.0-obsidian-5": - "integrity" "sha512-AZQzqlxNbwk+BoKn3R10Xo/V+JoYwJ1mJ9+khUTSsavS7s41xRmA+6k+tKAPa+ce4PSEzZnXg8ZrxTUuNQBxxA==" - "resolved" "https://registry.npmjs.org/@zsviczian/excalidraw/-/excalidraw-0.12.0-obsidian-5.tgz" - "version" "0.12.0-obsidian-5" +"@zsviczian/excalidraw@0.12.0-obsidian-7": + "integrity" "sha512-U/2FvzZdzSJp5Aurs3wMYp4dSC5BZpa6Yv0L6pXlEfaMVuLMFPp+mrJBt+d7xhGHRREd/o/tjxHdt3vIjHmAXA==" + "resolved" "https://registry.npmjs.org/@zsviczian/excalidraw/-/excalidraw-0.12.0-obsidian-7.tgz" + "version" "0.12.0-obsidian-7" "abab@^2.0.3", "abab@^2.0.5": "integrity" "sha512-9IK9EadsbHo6jLWIpxpR6pL0sazTXV6+SQv25ZB+F7Bj9mJNaOc4nCRabwd5M/JwmUa8idz6Eci6eKfJryPs6Q=="