Compare commits

...

1 Commits

Author SHA1 Message Date
zsviczian
5a66c78428 2.11.2-beta, 0.18.0-15
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
2025-05-11 18:23:24 +02:00
9 changed files with 34 additions and 8 deletions

View File

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

8
package-lock.json generated
View File

@@ -11,7 +11,7 @@
"dependencies": {
"@popperjs/core": "^2.11.8",
"@zsviczian/colormaster": "^1.2.2",
"@zsviczian/excalidraw": "0.18.0-12",
"@zsviczian/excalidraw": "0.18.0-14",
"chroma-js": "^2.4.2",
"clsx": "^2.0.0",
"es6-promise-pool": "2.5.0",
@@ -3198,9 +3198,9 @@
"license": "MIT"
},
"node_modules/@zsviczian/excalidraw": {
"version": "0.18.0-12",
"resolved": "https://registry.npmjs.org/@zsviczian/excalidraw/-/excalidraw-0.18.0-12.tgz",
"integrity": "sha512-/jAR1aGtnkYO4fT4wBUhItrWAnu1otF4UksOxO96r2za51kB5vc9z5lPdVDGctuchaPU4MuyeC8cVk3K2iNKzw==",
"version": "0.18.0-14",
"resolved": "https://registry.npmjs.org/@zsviczian/excalidraw/-/excalidraw-0.18.0-14.tgz",
"integrity": "sha512-LXmlImnsYxXzObnO0YxPNl4+TeLyM5BhIwUUGxdL/GY+Ru4tTzbwGf7l5GaVsWejrCYvVWM6j/wDwJuL6V1s9Q==",
"dependencies": {
"@braintree/sanitize-url": "6.0.2",
"@excalidraw/random-username": "1.1.0",

View File

@@ -23,7 +23,7 @@
"license": "MIT",
"dependencies": {
"@popperjs/core": "^2.11.8",
"@zsviczian/excalidraw": "0.18.0-14",
"@zsviczian/excalidraw": "0.18.0-15",
"chroma-js": "^2.4.2",
"clsx": "^2.0.0",
"@zsviczian/colormaster": "^1.2.2",

View File

@@ -1078,6 +1078,10 @@ export default class ExcalidrawPlugin extends Plugin {
this.eventManager.onActiveLeafChangeHandler(leaf);
}
public setDebounceActiveLeafChangeHandler() {
this.eventManager.setDebounceActiveLeafChangeHandler();
}
public registerHotkeyOverrides() {
//this is repeated here because the same function is called when settings is closed after hotkeys have changed
if (this.popScope) {

View File

@@ -21,6 +21,7 @@ export class EventManager {
private removeEventLisnters:(()=>void)[] = []; //only used if I register an event directly, not via Obsidian's registerEvent
private previouslyActiveLeaf: WorkspaceLeaf;
private splitViewLeafSwitchTimestamp: number = 0;
private debunceActiveLeafChangeHandlerTimer: number|null = null;
get settings() {
return this.plugin.settings;
@@ -103,6 +104,15 @@ export class EventManager {
this.plugin.registerEvent(this.plugin.app.workspace.on("editor-menu", this.onEditorMenuHandler.bind(this)));
}
public setDebounceActiveLeafChangeHandler() {
if(this.debunceActiveLeafChangeHandlerTimer) {
window.clearTimeout(this.debunceActiveLeafChangeHandlerTimer);
}
this.debunceActiveLeafChangeHandlerTimer = window.setTimeout(() => {
this.debunceActiveLeafChangeHandlerTimer = null;
}, 50);
}
private onLayoutChangeHandler() {
getExcalidrawViews(this.app).forEach(excalidrawView=>excalidrawView.refresh());
}
@@ -164,6 +174,10 @@ export class EventManager {
(process.env.NODE_ENV === 'development') && DEBUGGING && debug(this.onActiveLeafChangeHandler,`onActiveLeafChangeEventHandler`, leaf);
//https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/723
if(this.debunceActiveLeafChangeHandlerTimer) {
return;
}
//In Obsidian 1.8.x the active excalidraw leaf is obscured by an empty leaf without a parent
//This hack resolves it
if(this.app.workspace.activeLeaf === leaf && isUnwantedLeaf(leaf)) {

View File

@@ -16,6 +16,13 @@ export const RELEASE_NOTES: { [k: string]: string } = {
I build this plugin in my free time, as a labor of love. Curious about the philosophy behind it? Check out [📕 Sketch Your Mind](https://sketch-your-mind.com). If you find it valuable, say THANK YOU or…
<div class="ex-coffee-div"><a href="https://ko-fi.com/zsolt"><img src="https://storage.ko-fi.com/cdn/kofi6.png?v=6" border="0" alt="Buy Me a Coffee at ko-fi.com" height=45></a></div>
`,
"2.11.2": `
## Fixed
- Dynamic styling was not working when there were frames in the scene.
- Minor fix for the screenshot feature. This fix also solves the long-standing issue of the window control buttons (close, minimize, maximize) being visible in full-screen mode.
- When ALT/OPT + dragging an Embeddable object, the object dragging was not working properly at times, resulting in an empty embeddable object (instead of dragging the element).
`,
"2.11.1": `
## Fixed:

View File

@@ -6,7 +6,6 @@ import { DynamicStyle } from "src/types/types";
import { cloneElement } from "./excalidrawAutomateUtils";
import { ExcalidrawFrameElement } from "@zsviczian/excalidraw/types/element/src/types";
import { addAppendUpdateCustomData } from "./utils";
import { mutateElement } from "src/constants/constants";
import { CaptureUpdateAction } from "src/constants/constants";
export const setDynamicStyle = (
@@ -176,7 +175,7 @@ export const setDynamicStyle = (
) {
return;
}
mutateElement(e,{customData: f.customData});
(view.excalidrawAPI as ExcalidrawImperativeAPI).mutateElement(e,{customData: f.customData});
});
view.updateScene({

View File

@@ -1158,6 +1158,7 @@ export default class ExcalidrawView extends TextFileView implements HoverParent{
doc.body.querySelectorAll(`div.workspace-ribbon`).forEach(node=>node.addClass(HIDE));
doc.body.querySelectorAll(`div.mobile-navbar`).forEach(node=>node.addClass(HIDE));
doc.body.querySelectorAll(`div.status-bar`).forEach(node=>node.addClass(HIDE));
doc.body.querySelectorAll(`div.titlebar`).forEach(node=>node.addClass(HIDE));
}
hide(this.contentEl);

View File

@@ -185,6 +185,7 @@ function RenderObsidianView(
rootSplit.containerEl.style.width = '100%';
rootSplit.containerEl.style.height = '100%';
rootSplit.containerEl.style.borderRadius = "var(--embeddable-radius)";
view.plugin.setDebounceActiveLeafChangeHandler();
leafRef.current = {
leaf: view.app.workspace.createLeafInParent(rootSplit, 0),
node: null,