This commit is contained in:
Zsolt Viczian
2021-10-26 23:06:00 +02:00
parent 6e3cf60eab
commit f02425dcac
8 changed files with 28 additions and 9 deletions

View File

@@ -1,7 +1,7 @@
{
"id": "obsidian-excalidraw-plugin",
"name": "Excalidraw",
"version": "1.4.0",
"version": "1.4.1",
"minAppVersion": "0.12.0",
"description": "An Obsidian plugin to edit and view Excalidraw drawings",
"author": "Zsolt Viczian",

View File

@@ -11,7 +11,7 @@
"author": "",
"license": "MIT",
"dependencies": {
"@zsviczian/excalidraw": "0.10.0-obsidian-3",
"@zsviczian/excalidraw": "0.10.0-obsidian-6",
"monkey-around": "^2.2.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",

View File

@@ -137,9 +137,10 @@ class ImageElementNotice extends Modal {
this.createForm();
}
onClose(): void {
async onClose() {
this.contentEl.empty();
if(!this.saveChanges) return;
await this.plugin.loadSettings();
this.plugin.settings.imageElementNotice = false;
this.plugin.saveSettings();
}

View File

@@ -71,6 +71,11 @@ export default {
FILENAME_PREFIX_DESC: "The first part of the filename",
FILENAME_DATE_NAME: "Filename date",
FILENAME_DATE_DESC: "The second part of the filename",
/*SVG_IN_MD_NAME: "SVG Snapshot to markdown file",
SVG_IN_MD_DESC: "If the switch is 'on' Excalidraw will include an SVG snapshot in the markdown file. "+
"When SVG snapshots are saved to the Excalidraw.md file, drawings that include large png, jpg, gif images may take extreme long time to open in markdown view. " +
"On the other hand, SVG snapshots provide some level of platform independence and longevity to your drawings. Even if Excalidraw will no longer exist, the snapshot " +
"can be opened with an app that reads SVGs. In addition hover previews will be less resource intensive if SVG snapshots are enabled.",*/
DISPLAY_HEAD: "Display",
MATCH_THEME_NAME: "New drawing to match Obsidian theme",
MATCH_THEME_DESC: "If theme is dark, new drawing will be created in dark mode. This does not apply when you use a template for new drawings. " +

View File

@@ -1073,7 +1073,7 @@ export default class ExcalidrawPlugin extends Plugin {
+ String.fromCharCode(96)+String.fromCharCode(96)+String.fromCharCode(96)+'json\n'
+ jsonString + '\n'
+ String.fromCharCode(96)+String.fromCharCode(96)+String.fromCharCode(96)
+ (svgString ?
+ (svgString ? //&& this.settings.saveSVGSnapshots
'\n\n# SVG snapshot\n'
+ String.fromCharCode(96)+String.fromCharCode(96)+String.fromCharCode(96)+'html\n'
+ svgString + '\n'

View File

@@ -15,6 +15,7 @@ export interface ExcalidrawSettings {
templateFilePath: string,
drawingFilenamePrefix: string,
drawingFilenameDateTime: string,
// saveSVGSnapshots: boolean,
//displaySVGInPreview: boolean,
width: string,
matchTheme: boolean,
@@ -52,6 +53,7 @@ export const DEFAULT_SETTINGS: ExcalidrawSettings = {
templateFilePath: 'Excalidraw/Template.excalidraw',
drawingFilenamePrefix: 'Drawing ',
drawingFilenameDateTime: 'YYYY-MM-DD HH.mm.ss',
// saveSVGSnapshots: true,
//displaySVGInPreview: true,
width: '400',
matchTheme: false,
@@ -198,6 +200,17 @@ export class ExcalidrawSettingTab extends PluginSettingTab {
this.applySettingsUpdate();
}));
/* new Setting(containerEl)
.setName(t("SVG_IN_MD_NAME"))
.setDesc(t("SVG_IN_MD_DESC"))
.addToggle(toggle => toggle
.setValue(this.plugin.settings.saveSVGSnapshots)
.onChange(async (value) => {
this.plugin.settings.saveSVGSnapshots = value;
this.applySettingsUpdate();
}));*/
this.containerEl.createEl('h1', {text: t("DISPLAY_HEAD")});
new Setting(containerEl)

View File

@@ -1,3 +1,3 @@
{
"1.4.0": "0.11.13"
"1.4.1": "0.11.13"
}

View File

@@ -1067,10 +1067,10 @@
dependencies:
"@types/estree" "*"
"@zsviczian/excalidraw@0.10.0-obsidian-3":
"integrity" "sha512-mLpWNJ9whVpsREqbg4D9Kt6ftlgSzoxHdukFbbMlhLwtQ2pRh+pgmkssX2hmeWkGDvkAtPW30+qh4LqZBA3oFQ=="
"resolved" "https://registry.npmjs.org/@zsviczian/excalidraw/-/excalidraw-0.10.0-obsidian-3.tgz"
"version" "0.10.0-obsidian-3"
"@zsviczian/excalidraw@0.10.0-obsidian-6":
"integrity" "sha512-AI3LWrTf+1h5NPEwj0vykgmGDmSUTBm0xasYlQOKXPUsGMqNLI3dn1fVvQzGWbvDUrFCstS/idFMk+pz+Lkn+g=="
"resolved" "https://registry.npmjs.org/@zsviczian/excalidraw/-/excalidraw-0.10.0-obsidian-6.tgz"
"version" "0.10.0-obsidian-6"
"abab@^1.0.3":
"integrity" "sha1-X6rZwsB/YN12dw9xzwJbYqY8/U4="