mirror of
https://github.com/zsviczian/obsidian-excalidraw-plugin.git
synced 2025-08-06 05:46:28 +00:00
1.3.11
This commit is contained in:
@@ -59,9 +59,5 @@ function buildMindmap(subtasks, depth, offset, parentObjectID) {
|
||||
tasks["objectID"] = ea.addText(width*1.5,width,tasks.text,{box:true, textAlign:"center"});
|
||||
buildMindmap(tasks.subtasks, 2, 0, tasks.objectID);
|
||||
|
||||
(async ()=> {
|
||||
const svg = await ea.createSVG();
|
||||
const el=document.querySelector("div.block-language-dataviewjs");
|
||||
el.appendChild(svg);
|
||||
})();
|
||||
ea.createSVG().then((svg)=>dv.span(svg.outerHTML));
|
||||
```
|
||||
@@ -52,9 +52,5 @@ function buildMindmap(subtasks, depth, offset, parentObjectID) {
|
||||
tasks["objectID"] = ea.addText(0,(tasks.size/2)*height,tasks.text,{box:true});
|
||||
buildMindmap(tasks.subtasks, 1, 0, tasks.objectID);
|
||||
|
||||
(async ()=> {
|
||||
const svg = await ea.createSVG();
|
||||
const el=document.querySelector("div.block-language-dataviewjs");
|
||||
el.appendChild(svg);
|
||||
})();
|
||||
ea.createSVG().then((svg)=>dv.span(svg.outerHTML));
|
||||
```
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"id": "obsidian-excalidraw-plugin",
|
||||
"name": "Excalidraw",
|
||||
"version": "1.3.10",
|
||||
"version": "1.3.11",
|
||||
"minAppVersion": "0.12.0",
|
||||
"description": "An Obsidian plugin to edit and view Excalidraw drawings",
|
||||
"author": "Zsolt Viczian",
|
||||
|
||||
@@ -316,7 +316,7 @@ export async function initExcalidrawAutomate(plugin: ExcalidrawPlugin) {
|
||||
async createSVG(templatePath?:string):Promise<SVGSVGElement> {
|
||||
const template = templatePath ? (await getTemplate(templatePath)) : null;
|
||||
let elements = template ? template.elements : [];
|
||||
elements.concat(this.getElements());
|
||||
elements = elements.concat(this.getElements());
|
||||
return await ExcalidrawView.getSVG(
|
||||
{//createDrawing
|
||||
"type": "excalidraw",
|
||||
|
||||
@@ -112,7 +112,8 @@ export default class ExcalidrawView extends TextFileView {
|
||||
}
|
||||
const svg = await ExcalidrawView.getSVG(scene,exportSettings);
|
||||
if(!svg) return;
|
||||
const svgString = ExcalidrawView.embedFontsInSVG(svg).outerHTML;
|
||||
let serializer =new XMLSerializer();
|
||||
const svgString = serializer.serializeToString(ExcalidrawView.embedFontsInSVG(svg));
|
||||
if(file && file instanceof TFile) await this.app.vault.modify(file,svgString);
|
||||
else await this.app.vault.create(filepath,svgString);
|
||||
}
|
||||
@@ -168,7 +169,7 @@ export default class ExcalidrawView extends TextFileView {
|
||||
if(!this.getScene) return this.data;
|
||||
if(!this.compatibilityMode) {
|
||||
let trimLocation = this.data.search("# Text Elements\n");
|
||||
if(trimLocation == -1) trimLocation = this.data.search("# Drawing\n");
|
||||
if(trimLocation == -1) trimLocation = this.data.search(/(%%\n)?# Drawing\n/);
|
||||
if(trimLocation == -1) return this.data;
|
||||
|
||||
const scene = this.excalidrawData.scene;
|
||||
@@ -732,11 +733,11 @@ export default class ExcalidrawView extends TextFileView {
|
||||
document.exitFullscreen();
|
||||
this.zoomToFit();
|
||||
}
|
||||
this.ctrlKeyDown = e.ctrlKey;
|
||||
this.ctrlKeyDown = e.ctrlKey || e.metaKey;
|
||||
this.shiftKeyDown = e.shiftKey;
|
||||
this.altKeyDown = e.altKey;
|
||||
|
||||
if(e.ctrlKey && !e.shiftKey && !e.altKey && !e.metaKey) {
|
||||
|
||||
if(e.ctrlKey && !e.shiftKey && !e.altKey) { // && !e.metaKey) {
|
||||
const selectedElement = getTextElementAtPointer(currentPosition);
|
||||
if(!selectedElement) return;
|
||||
|
||||
@@ -775,7 +776,7 @@ export default class ExcalidrawView extends TextFileView {
|
||||
}
|
||||
},
|
||||
onKeyUp: (e:any) => {
|
||||
this.ctrlKeyDown = e.ctrlKey;
|
||||
this.ctrlKeyDown = e.ctrlKey || e.metaKey;
|
||||
this.shiftKeyDown = e.shiftKey;
|
||||
this.altKeyDown = e.altKey;
|
||||
},
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"1.3.10": "0.11.13"
|
||||
"1.3.11": "0.11.13"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user