This commit is contained in:
Vanessa 2023-05-19 20:27:14 +08:00
parent 768555ca4b
commit 66e2371164
6 changed files with 50 additions and 18 deletions

View file

@ -8,6 +8,7 @@ import {Custom} from "../layout/dock/Custom";
import {Tab} from "../layout/Tab";
import {getDockByType, setPanelFocus} from "../layout/util";
import {hasClosestByAttribute} from "../protyle/util/hasClosest";
import {BlockPanel} from "../block/Panel";
export class Plugin {
private app: App;
@ -198,4 +199,23 @@ export class Plugin {
return this.docks[type2];
/// #endif
}
public addFloatLayer = (options: {
ids: string[],
defIds?: string[],
x?: number,
y?: number,
targetElement?: HTMLElement,
isBacklink: boolean,
}) => {
window.siyuan.blockPanels.push(new BlockPanel({
app: this.app,
targetElement: options.targetElement,
isBacklink: options.isBacklink,
x: options.x,
y: options.y,
nodeIds: options.ids,
defIds: options.defIds,
}));
}
}