Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

600 B
Raw Blame
const getDockPanel = (position: TDockPosition) => {
    const layout = window.siyuan?.layout;
    if (!layout) {
        return undefined;
    }
    if (position === "Left") {
        return layout.leftDock;
    }
    if (position === "Right") {
        return layout.rightDock;
    }
    return layout.bottomDock;
};

export const toggleDockPanel = (position: TDockPosition, visible?: boolean) => {
    return getDockPanel(position)?.togglePanel(visible) ?? false;
};

export const isDockPanelVisible = (position: TDockPosition) => {
    return getDockPanel(position)?.isPanelVisible() ?? false;
};