before npm audit fix

This commit is contained in:
zsviczian
2023-08-06 08:21:26 +02:00
parent ddcfddd698
commit 88094c056c
2 changed files with 22 additions and 8 deletions

View File

@@ -23,16 +23,16 @@
"clsx": "^1.2.1",
"colormaster": "^1.2.1",
"gl-matrix": "^3.4.3",
"lz-string": "^1.4.4",
"lz-string": "^1.5.0",
"monkey-around": "^2.3.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "^5.0.1",
"roughjs": "^4.5.2",
"html2canvas": "^1.4.1",
"@popperjs/core": "^2.11.6",
"nanoid": "^4.0.0",
"lucide-react": "0.259.0"
"@popperjs/core": "^2.11.8",
"nanoid": "^4.0.2",
"lucide-react": "^0.263.1"
},
"devDependencies": {
"@babel/core": "^7.20.12",
@@ -66,9 +66,6 @@
"ttypescript": "^1.5.15",
"typescript": "^4.9.4"
},
"engines": {
"node": "16.10.0"
},
"resolutions": {
"@typescript-eslint/typescript-estree": "5.3.0"
},

View File

@@ -11,7 +11,7 @@ import {
StrokeRoundness,
RoundnessType,
} from "@zsviczian/excalidraw/types/element/types";
import { normalizePath, Notice, OpenViewState, TFile, WorkspaceLeaf } from "obsidian";
import { Editor, normalizePath, Notice, OpenViewState, TFile, WorkspaceLeaf } from "obsidian";
import * as obsidian_module from "obsidian";
import ExcalidrawView, { ExportSettings, TextMode } from "src/ExcalidrawView";
import { ExcalidrawData, getMarkdownDrawingSection, REGEX_LINK } from "src/ExcalidrawData";
@@ -171,6 +171,23 @@ export class ExcalidrawAutomate {
return getLeaf(this.plugin,origo,modifierKeys);
}
public getActiveEmbeddableViewOrEditor (view?:ExcalidrawView): {view:any}|{file:TFile, editor:Editor}|null {
if (!this.targetView && !view) {
return null;
}
view = view ?? this.targetView;
const leafOrNode = view.getActiveEmbeddable();
if(leafOrNode) {
if(leafOrNode.node && leafOrNode.node.isEditing) {
return {file: leafOrNode.node.file, editor: leafOrNode.node.child.editor};
}
if(leafOrNode.leaf && leafOrNode.leaf.view) {
return {view: leafOrNode.leaf.view};
}
}
return null;
}
plugin: ExcalidrawPlugin;
elementsDict: {[key:string]:any}; //contains the ExcalidrawElements currently edited in Automate indexed by el.id
imagesDict: {[key: FileId]: any}; //the images files including DataURL, indexed by fileId