mirror of
https://github.com/zsviczian/obsidian-excalidraw-plugin.git
synced 2025-08-06 05:46:28 +00:00
1.3.5
This commit is contained in:
@@ -53,7 +53,7 @@ setView(view:ExcalidrawView|"first"|"active"):ExcalidrawView;
|
||||
getExcalidrawAPI():any;
|
||||
getViewSelectedElement():ExcalidrawElement;
|
||||
getViewSelectedElements():ExcalidrawElement[];
|
||||
viewToggleFullScreen():void;
|
||||
viewToggleFullScreen(forceViewMode?:boolean):void;
|
||||
connectObjectWithViewSelectedElement(objectA:string,connectionA: ConnectionPoint, connectionB: ConnectionPoint, formatting?:{numberOfPoints?: number,startArrowHead?:string,endArrowHead?:string, padding?: number}):boolean;
|
||||
addElementsToView(repositionToCursor:boolean, save:boolean):Promise<boolean>;
|
||||
};
|
||||
|
||||
@@ -117,10 +117,12 @@ Note: you can call `getExcalidrawAPI().getSceneElements()` to retreive all the e
|
||||
|
||||
#### viewToggleFullScreen()
|
||||
```typescript
|
||||
viewToggleFullScreen():void
|
||||
viewToggleFullScreen(forceViewMode?:boolean):void;
|
||||
```
|
||||
|
||||
Toggles targetView between fullscreen mode and normal mode.
|
||||
Toggles targetView between fullscreen mode and normal mode. By setting forceViewMode to `true` will change Excalidraw mode to View mode. Default is `false`.
|
||||
|
||||
The function will do nothing on Obsidian Mobile.
|
||||
|
||||
#### connectObjectWithViewSelectedElement()
|
||||
```typescript
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"id": "obsidian-excalidraw-plugin",
|
||||
"name": "Excalidraw",
|
||||
"version": "1.3.4",
|
||||
"version": "1.3.5",
|
||||
"minAppVersion": "0.12.0",
|
||||
"description": "An Obsidian plugin to edit and view Excalidraw drawings",
|
||||
"author": "Zsolt Viczian",
|
||||
|
||||
@@ -72,7 +72,7 @@ export interface ExcalidrawAutomate extends Window {
|
||||
getExcalidrawAPI():any;
|
||||
getViewSelectedElement():ExcalidrawElement;
|
||||
getViewSelectedElements():ExcalidrawElement[];
|
||||
viewToggleFullScreen():void;
|
||||
viewToggleFullScreen(forceViewMode?:boolean):void;
|
||||
connectObjectWithViewSelectedElement(objectA:string,connectionA: ConnectionPoint, connectionB: ConnectionPoint, formatting?:{numberOfPoints?: number,startArrowHead?:string,endArrowHead?:string, padding?: number}):boolean;
|
||||
addElementsToView(repositionToCursor:boolean, save:boolean):Promise<boolean>;
|
||||
};
|
||||
@@ -448,15 +448,26 @@ export async function initExcalidrawAutomate(plugin: ExcalidrawPlugin) {
|
||||
if(!selectedElementsKeys) return [];
|
||||
return current.getSceneElements().filter((e:any)=>selectedElementsKeys.includes(e.id));
|
||||
},
|
||||
viewToggleFullScreen():void {
|
||||
viewToggleFullScreen(forceViewMode:boolean = false):void {
|
||||
if (this.plugin.app.isMobile) {
|
||||
errorMessage("mobile not supported", "viewToggleFullScreen()");
|
||||
return;
|
||||
}
|
||||
if (!this.targetView || !this.targetView?._loaded) {
|
||||
errorMessage("targetView not set");
|
||||
errorMessage("targetView not set", "viewToggleFullScreen()");
|
||||
return;
|
||||
}
|
||||
}
|
||||
if(forceViewMode){
|
||||
const ref = this.getExcalidrawAPI();
|
||||
ref.updateScene({
|
||||
elements: ref.getSceneElements(),
|
||||
appState: {
|
||||
viewModeEnabled: true,
|
||||
... ref.appState,
|
||||
},
|
||||
commitToHistory: false,
|
||||
});
|
||||
}
|
||||
if(document.fullscreenElement === (this.targetView as ExcalidrawView).contentEl) {
|
||||
document.exitFullscreen();
|
||||
} else {
|
||||
|
||||
@@ -111,7 +111,10 @@ export default class ExcalidrawPlugin extends Plugin {
|
||||
//https://github.com/mgmeyers/obsidian-kanban/blob/44118e25661bff9ebfe54f71ae33805dc88ffa53/src/main.ts#L267
|
||||
this.registerMonkeyPatches();
|
||||
if(this.settings.loadCount<1) this.migrationNotice();
|
||||
|
||||
const electron:string = process.versions.electron;
|
||||
if(electron.startsWith("8.")) {
|
||||
new Notice(`You are running an older version of the electron Browser (${electron}). If Excalidraw does not start up, please reinstall Obsidian with the latest installer and try again.`,10000);
|
||||
}
|
||||
}
|
||||
|
||||
private migrationNotice(){
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"1.3.4": "0.11.13"
|
||||
"1.3.5": "0.11.13"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user