Skip to content

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

:recycle: menu

Vanessa82f9b9c60c75
diff --git a/app/src/layout/Wnd.ts b/app/src/layout/Wnd.ts
index 68527112c0..626a9edb91 100644
--- a/app/src/layout/Wnd.ts
+++ b/app/src/layout/Wnd.ts
@@ -628,7 +628,8 @@ export class Wnd {
window.siyuan.menus.menu.popup({
x: rect.left + rect.width,
y: rect.top + rect.height,
- }, true);
+ isLeft: true
+ });
}
private removeOverCounter(oldFocusIndex?: number) {
diff --git a/app/src/layout/status.ts b/app/src/layout/status.ts
index b00e709b06..629193a087 100644
--- a/app/src/layout/status.ts
+++ b/app/src/layout/status.ts
@@ -53,7 +53,7 @@ export const initStatus = (isWindow = false) => {
}).element);
});
const rect = target.getBoundingClientRect();
- window.siyuan.menus.menu.popup({x: rect.right, y: rect.top}, true);
+ window.siyuan.menus.menu.popup({x: rect.right, y: rect.top, isLeft: true});
event.stopPropagation();
break;
} else if (target.id === "statusHelp") {
@@ -106,7 +106,7 @@ export const initStatus = (isWindow = false) => {
}
}).element);
const rect = target.getBoundingClientRect();
- window.siyuan.menus.menu.popup({x: rect.right, y: rect.top}, true);
+ window.siyuan.menus.menu.popup({x: rect.right, y: rect.top, isLeft: true});
event.stopPropagation();
break;
} else if (target.classList.contains("b3-menu__item")) {
diff --git a/app/src/layout/topBar.ts b/app/src/layout/topBar.ts
index 626eef3708..28bb62041e 100644
--- a/app/src/layout/topBar.ts
+++ b/app/src/layout/topBar.ts
@@ -100,7 +100,7 @@ export const initBar = (app: App) => {
window.siyuan.menus.menu.append(new MenuItem(menuOptions).element);
});
const rect = target.getBoundingClientRect();
- window.siyuan.menus.menu.popup({x: rect.right, y: rect.bottom}, true);
+ window.siyuan.menus.menu.popup({x: rect.right, y: rect.bottom, isLeft: true});
event.stopPropagation();
break;
} else if (targetId === "barForward") {
@@ -160,7 +160,7 @@ export const initBar = (app: App) => {
if (rect.width === 0) {
rect = toolbarElement.querySelector("#barMore").getBoundingClientRect();
}
- window.siyuan.menus.menu.popup({x: rect.right, y: rect.bottom}, true);
+ window.siyuan.menus.menu.popup({x: rect.right, y: rect.bottom, isLeft: true});
event.stopPropagation();
break;
} else if (targetId === "toolbarVIP") {
@@ -216,7 +216,7 @@ export const initBar = (app: App) => {
if (rect.width === 0) {
rect = toolbarElement.querySelector("#barMore").getBoundingClientRect();
}
- window.siyuan.menus.menu.popup({x: rect.right, y: rect.bottom}, true);
+ window.siyuan.menus.menu.popup({x: rect.right, y: rect.bottom, isLeft: true});
event.stopPropagation();
break;
}
diff --git a/app/src/menus/Menu.ts b/app/src/menus/Menu.ts
index 4c1f5fa39a..36f6c4d8a7 100644
--- a/app/src/menus/Menu.ts
+++ b/app/src/menus/Menu.ts
@@ -125,7 +125,7 @@ export class Menu {
this.element.lastElementChild.append(element);
}
- public popup(options: IPosition, isLeft = false) {
+ public popup(options: IPosition) {
if (this.element.lastElementChild.innerHTML === "") {
return;
}
@@ -136,7 +136,7 @@ export class Menu {
}
this.element.style.zIndex = (++window.siyuan.zIndex).toString();
this.element.classList.remove("fn__none");
- setPosition(this.element, options.x - (isLeft ? window.siyuan.menus.menu.element.clientWidth : 0), options.y, options.h, options.w);
+ setPosition(this.element, options.x - (options.isLeft ? window.siyuan.menus.menu.element.clientWidth : 0), options.y, options.h, options.w);
}
public fullscreen(position: "bottom" | "all" = "all") {
diff --git a/app/src/mobile/util/keyboardToolbar.ts b/app/src/mobile/util/keyboardToolbar.ts
index 707af3a908..8987566ac0 100644
--- a/app/src/mobile/util/keyboardToolbar.ts
+++ b/app/src/mobile/util/keyboardToolbar.ts
@@ -635,7 +635,8 @@ export const initKeyboardToolbar = () => {
} else if (type === "more") {
protyle.breadcrumb.showMenu(protyle, {
x: 0,
- y: 0
+ y: 0,
+ isLeft: true
});
activeBlur();
hideKeyboardToolbar();
diff --git a/app/src/plugin/Menu.ts b/app/src/plugin/Menu.ts
index 83a74bd82c..e6744ad694 100644
--- a/app/src/plugin/Menu.ts
+++ b/app/src/plugin/Menu.ts
@@ -45,7 +45,7 @@ export class Menu {
if (this.isOpen) {
return;
}
- this.menu.popup(options, options.isLeft);
+ this.menu.popup(options);
}
fullscreen(position: "bottom" | "all" = "all") {
diff --git a/app/src/protyle/breadcrumb/index.ts b/app/src/protyle/breadcrumb/index.ts
index 3280cc0103..64f1a43535 100644
--- a/app/src/protyle/breadcrumb/index.ts
+++ b/app/src/protyle/breadcrumb/index.ts
@@ -101,6 +101,7 @@ export class Breadcrumb {
this.showMenu(protyle, {
x: targetRect.right,
y: targetRect.bottom,
+ isLeft: true,
});
event.stopPropagation();
event.preventDefault();
@@ -541,7 +542,7 @@ export class Breadcrumb {
/// #if MOBILE
window.siyuan.menus.menu.fullscreen();
/// #else
- window.siyuan.menus.menu.popup(position, true);
+ window.siyuan.menus.menu.popup(position);
/// #endif
});
}
diff --git a/app/src/protyle/gutter/index.ts b/app/src/protyle/gutter/index.ts
index 92d7bbf559..286d1d3593 100644
--- a/app/src/protyle/gutter/index.ts
+++ b/app/src/protyle/gutter/index.ts
@@ -221,7 +221,7 @@ export class Gutter {
if (isMobile()) {
window.siyuan.menus.menu.fullscreen();
} else {
- window.siyuan.menus.menu.popup({x: event.clientX - 16, y: event.clientY - 16}, true);
+ window.siyuan.menus.menu.popup({x: event.clientX - 16, y: event.clientY - 16, isLeft: true});
focusByRange(protyle.toolbar.range);
}
}
@@ -233,7 +233,7 @@ export class Gutter {
}
if (!window.siyuan.ctrlIsPressed && !window.siyuan.altIsPressed && !window.siyuan.shiftIsPressed) {
this.renderMenu(protyle, buttonElement);
- window.siyuan.menus.menu.popup({x: event.clientX - 16, y: event.clientY - 16}, true);
+ window.siyuan.menus.menu.popup({x: event.clientX - 16, y: event.clientY - 16, isLeft: true});
}
event.preventDefault();
event.stopPropagation();
diff --git a/app/src/protyle/header/openTitleMenu.ts b/app/src/protyle/header/openTitleMenu.ts
index 5d4a1242d4..a212a7e838 100644
--- a/app/src/protyle/header/openTitleMenu.ts
+++ b/app/src/protyle/header/openTitleMenu.ts
@@ -235,7 +235,7 @@ ${window.siyuan.languages.createdAt} ${dayjs(response.data.ial.id.substr(0, 14))
/// #if MOBILE
window.siyuan.menus.menu.fullscreen();
/// #else
- window.siyuan.menus.menu.popup(position, position.isLeft);
+ window.siyuan.menus.menu.popup(position);
/// #endif
});
};
diff --git a/app/src/protyle/hint/index.ts b/app/src/protyle/hint/index.ts
index d846a2dc4f..ef76b4ad8b 100644
--- a/app/src/protyle/hint/index.ts
+++ b/app/src/protyle/hint/index.ts
@@ -767,8 +767,9 @@ ${genHintItemHTML(item)}
const rect = nodeElement.getBoundingClientRect();
window.siyuan.menus.menu.popup({
x: rect.left,
- y: rect.top
- }, true);
+ y: rect.top,
+ isLeft: true
+ });
const itemElement = window.siyuan.menus.menu.element.querySelector('[data-id="assetSubMenu"]');
itemElement.classList.add("b3-menu__item--show");
window.siyuan.menus.menu.showSubMenu(itemElement.querySelector(".b3-menu__submenu"));
diff --git a/app/src/protyle/render/av/action.ts b/app/src/protyle/render/av/action.ts
index f0662cfc0b..72662e23ca 100644
--- a/app/src/protyle/render/av/action.ts
+++ b/app/src/protyle/render/av/action.ts
@@ -339,7 +339,7 @@ export const removeAttrViewColAnimation = (blockElement: Element, id: string) =>
});
};
-export const insertAttrViewBlockAnimation = (blockElement: Element, size: number, previousId: string, avId?:string) => {
+export const insertAttrViewBlockAnimation = (blockElement: Element, size: number, previousId: string, avId?: string) => {
const previousElement = blockElement.querySelector(`.av__row[data-id="${previousId}"]`) || blockElement.querySelector(".av__row--header");
let colHTML = "";
previousElement.querySelectorAll(".av__cell").forEach((item: HTMLElement) => {
diff --git a/app/src/protyle/render/av/cell.ts b/app/src/protyle/render/av/cell.ts
index 7e8c4cb9b9..2ea9909066 100644
--- a/app/src/protyle/render/av/cell.ts
+++ b/app/src/protyle/render/av/cell.ts
@@ -164,6 +164,7 @@ const calcItem = (options: {
}
});
};
+
export const openCalcMenu = (protyle: IProtyle, calcElement: HTMLElement) => {
const blockElement = hasClosestBlock(calcElement);
if (!blockElement) {
diff --git a/app/src/protyle/render/av/col.ts b/app/src/protyle/render/av/col.ts
index 632326f46e..d99ba2562d 100644
--- a/app/src/protyle/render/av/col.ts
+++ b/app/src/protyle/render/av/col.ts
@@ -7,6 +7,7 @@ import {genCellValue} from "./cell";
import {openMenuPanel} from "./openMenuPanel";
import {getLabelByNumberFormat} from "./number";
import {removeAttrViewColAnimation} from "./action";
+import {openEmojiPanel} from "../../../emoji";
export const duplicateCol = (options: {
protyle: IProtyle,
diff --git a/app/src/protyle/wysiwyg/keydown.ts b/app/src/protyle/wysiwyg/keydown.ts
index fde17c8a5a..674b0aa39a 100644
--- a/app/src/protyle/wysiwyg/keydown.ts
+++ b/app/src/protyle/wysiwyg/keydown.ts
@@ -601,7 +601,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
protyle.gutter.renderMultipleMenu(protyle, selectElements);
}
const rect = nodeElement.getBoundingClientRect();
- window.siyuan.menus.menu.popup({x: rect.left, y: rect.top}, true);
+ window.siyuan.menus.menu.popup({x: rect.left, y: rect.top, isLeft: true});
return;
}
diff --git a/app/src/search/assets.ts b/app/src/search/assets.ts
index 468b71cbb1..daaf7749cd 100644
--- a/app/src/search/assets.ts
+++ b/app/src/search/assets.ts
@@ -409,7 +409,7 @@ export const assetMethodMenu = (target: HTMLElement, cb: () => void) => {
window.siyuan.menus.menu.fullscreen();
/// #else
const rect = target.getBoundingClientRect();
- window.siyuan.menus.menu.popup({x: rect.right, y: rect.bottom}, true);
+ window.siyuan.menus.menu.popup({x: rect.right, y: rect.bottom, isLeft: true});
/// #endif
};
@@ -559,6 +559,6 @@ export const assetMoreMenu = (target: Element, element: Element, cb: () => void)
window.siyuan.menus.menu.fullscreen();
/// #else
const rect = target.getBoundingClientRect();
- window.siyuan.menus.menu.popup({x: rect.right, y: rect.bottom}, true);
+ window.siyuan.menus.menu.popup({x: rect.right, y: rect.bottom, isLeft: true});
/// #endif
};
diff --git a/app/src/search/util.ts b/app/src/search/util.ts
index 95434c2c91..ea03248a9c 100644
--- a/app/src/search/util.ts
+++ b/app/src/search/util.ts
@@ -634,7 +634,7 @@ export const genSearch = (app: App, config: ISearchOption, element: Element, clo
}).element);
});
const rect = target.getBoundingClientRect();
- window.siyuan.menus.menu.popup({x: rect.right, y: rect.bottom}, true);
+ window.siyuan.menus.menu.popup({x: rect.right, y: rect.bottom, isLeft: true});
event.stopPropagation();
event.preventDefault();
break;
@@ -698,7 +698,7 @@ export const genSearch = (app: App, config: ISearchOption, element: Element, clo
inputEvent(element, config, undefined, edit, true);
});
const rect = target.getBoundingClientRect();
- window.siyuan.menus.menu.popup({x: rect.right, y: rect.bottom}, true);
+ window.siyuan.menus.menu.popup({x: rect.right, y: rect.bottom, isLeft: true});
event.stopPropagation();
event.preventDefault();
break;