diff --git a/manifest.json b/manifest.json index 1bc61d0..e61102f 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "obsidian-excalidraw-plugin", "name": "Excalidraw", - "version": "1.2.6", + "version": "1.2.7", "minAppVersion": "0.11.13", "description": "An Obsidian plugin to edit and view Excalidraw drawings", "author": "Zsolt Viczian", diff --git a/src/ExcalidrawAutomate.ts b/src/ExcalidrawAutomate.ts index 0b9ee18..b247bd5 100644 --- a/src/ExcalidrawAutomate.ts +++ b/src/ExcalidrawAutomate.ts @@ -6,6 +6,7 @@ import { } from "@excalidraw/excalidraw/types/element/types"; import { normalizePath, + Notice, TFile } from "obsidian" import ExcalidrawView from "./ExcalidrawView"; diff --git a/src/ExcalidrawView.ts b/src/ExcalidrawView.ts index 445433c..34f75d6 100644 --- a/src/ExcalidrawView.ts +++ b/src/ExcalidrawView.ts @@ -135,6 +135,7 @@ export default class ExcalidrawView extends TextFileView { async save(preventReload:boolean=true) { this.preventReload = preventReload; + this.dirty = false; await super.save(); } diff --git a/src/constants.ts b/src/constants.ts index 6af7f1a..1bd6882 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -1,5 +1,4 @@ -//This is to avoid brackets littering graph view with links -//export function JSON_stringify(x:any):string {return JSON.stringify(x).replaceAll("[","[");} +//This is only for backward compatibility because an early version of obsidian included an encoding to avoid fantom links from littering Obsidian graph view export function JSON_parse(x:string):any {return JSON.parse(x.replaceAll("[","["));} import {customAlphabet} from "nanoid"; @@ -13,7 +12,7 @@ export const MAX_COLORS = 5; export const COLOR_FREQ = 6; export const RERENDER_EVENT = "excalidraw-embed-rerender"; export const BLANK_DRAWING = '{"type":"excalidraw","version":2,"source":"https://excalidraw.com","elements":[],"appState":{"gridSize":null,"viewBackgroundColor":"#ffffff"}}'; -export const FRONTMATTER = ["---","",`${FRONTMATTER_KEY}: unlocked`,"","---", "", ""].join("\n"); +export const FRONTMATTER = ["---","",`${FRONTMATTER_KEY}: unlocked`,"","---", "==⚠ Switch to EXCALIDRAW VIEW in the MORE OPTIONS menu of this document. ⚠==", "",""].join("\n"); export const EMPTY_MESSAGE = "Hit enter to create a new drawing"; export const LOCK_ICON_NAME = "lock"; export const LOCK_ICON = ``