Skip to content

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

:art: https://github.com/siyuan-note/siyuan/pull/13284

Vanessa4e3341985c54
diff --git a/app/src/assets/scss/business/_av.scss b/app/src/assets/scss/business/_av.scss
index dda0205140..892cc24f19 100644
--- a/app/src/assets/scss/business/_av.scss
+++ b/app/src/assets/scss/business/_av.scss
@@ -142,11 +142,11 @@
}
&.dragover__top::after {
- top: -3px;
+ top: -2.5px;
}
&.dragover__bottom::after {
- bottom: -2px;
+ bottom: -2.5px;
}
&:hover [data-type="block-more"] {
diff --git a/app/src/assets/scss/business/_custom.scss b/app/src/assets/scss/business/_custom.scss
index 813c2478ad..a7aa41e669 100644
--- a/app/src/assets/scss/business/_custom.scss
+++ b/app/src/assets/scss/business/_custom.scss
@@ -78,6 +78,7 @@
.b3-button[data-type="addColumn"] {
margin-left: 28px;
+
svg {
width: 16px;
height: 16px;
@@ -105,6 +106,6 @@
}
.av__row.dragover__top::after {
- top: -2px
+ top: -1.5px;
}
}
diff --git a/app/src/config/keymap.ts b/app/src/config/keymap.ts
index b2f14f9044..bce4d0ce79 100644
--- a/app/src/config/keymap.ts
+++ b/app/src/config/keymap.ts
@@ -56,7 +56,7 @@ export const keymap = {
});
item.updateProtyleToolbar([]).forEach(toolbarItem => {
if (typeof toolbarItem === "string" || Constants.INLINE_TYPE.concat("|").includes(toolbarItem.name) || !toolbarItem.hotkey) {
- return
+ return;
}
const dockKeymap = window.siyuan.config.keymap.plugin[item.name][toolbarItem.name];
const keyValue = updateHotkeyTip(dockKeymap.custom);
@@ -71,7 +71,7 @@ export const keymap = {
<span data-type="update" class="config-keymap__key">${keyValue}</span>
<input data-key="plugin${Constants.ZWSP}${item.name}${Constants.ZWSP}${toolbarItem.name}" data-value="${dockKeymap.custom}" data-default="${dockKeymap.default}" class="b3-text-field fn__none" value="${keyValue}" spellcheck="false">
</label>`;
- })
+ });
Object.keys(item.docks).forEach(key => {
const dockConfig = item.docks[key].config;
if (!dockConfig.hotkey) {
diff --git a/app/src/history/doc.ts b/app/src/history/doc.ts
index b439cd5326..e9442f2deb 100644
--- a/app/src/history/doc.ts
+++ b/app/src/history/doc.ts
@@ -22,7 +22,7 @@ const renderDoc = (element: HTMLElement, currentPage: number, id: string) => {
}
const opElement = element.querySelector('.b3-select[data-type="opselect"]') as HTMLSelectElement;
const listElement = element.querySelector(".b3-list--background");
- element.querySelector('.protyle-title__input').classList.add("fn__none");
+ element.querySelector(".protyle-title__input").classList.add("fn__none");
element.querySelector('.history__text[data-type="docPanel"]').classList.add("fn__none");
element.querySelector('.history__text[data-type="mdPanel"]').classList.add("fn__none");
fetchPost("/api/history/searchHistory", {
@@ -36,7 +36,7 @@ const renderDoc = (element: HTMLElement, currentPage: number, id: string) => {
} else {
nextElement.setAttribute("disabled", "disabled");
}
- const pageNumElement = element.querySelector('[data-type="jumpRepoPage"]')
+ const pageNumElement = element.querySelector('[data-type="jumpRepoPage"]');
if (response.data.pageCount > 1) {
pageNumElement.removeAttribute("disabled");
} else {
@@ -134,8 +134,8 @@ export const openDocHistory = (options: {
typewriterMode: false,
});
disabledProtyle(historyEditor.protyle);
- const pageNumElement = dialog.element.querySelector('[data-type="jumpRepoPage"]')
- const titleElement = dialog.element.querySelector(".protyle-title__input")
+ const pageNumElement = dialog.element.querySelector('[data-type="jumpRepoPage"]');
+ const titleElement = dialog.element.querySelector(".protyle-title__input");
dialog.element.addEventListener("click", (event) => {
let target = event.target as HTMLElement;
while (target && !target.isEqualNode(dialog.element)) {
@@ -176,7 +176,7 @@ export const openDocHistory = (options: {
});
}
titleElement.textContent = item.title;
- titleElement.classList.remove("fn__none")
+ titleElement.classList.remove("fn__none");
isLoading = false;
});
target.parentElement.querySelector(".b3-list-item--focus")?.classList.remove("b3-list-item--focus");
diff --git a/app/src/history/history.ts b/app/src/history/history.ts
index 983d3b5529..d6398f844f 100644
--- a/app/src/history/history.ts
+++ b/app/src/history/history.ts
@@ -445,7 +445,7 @@ export const openHistory = (app: App) => {
icon: "iconHistory",
title: window.siyuan.languages.dataHistory,
bindEvent(element) {
- element.firstElementChild.setAttribute("style", "background-color:var(--b3-theme-background);height:100%")
+ element.firstElementChild.setAttribute("style", "background-color:var(--b3-theme-background);height:100%");
bindEvent(app, element.firstElementChild);
}
});
diff --git a/app/src/plugin/index.ts b/app/src/plugin/index.ts
index 54214d5f84..fbe0440a9e 100644
--- a/app/src/plugin/index.ts
+++ b/app/src/plugin/index.ts
@@ -79,7 +79,7 @@ export class Plugin {
this.updateProtyleToolbar([]).forEach(toolbarItem => {
if (typeof toolbarItem === "string" || Constants.INLINE_TYPE.concat("|").includes(toolbarItem.name) || !toolbarItem.hotkey) {
- return
+ return;
}
if (!window.siyuan.config.keymap.plugin) {
window.siyuan.config.keymap.plugin = {};
@@ -96,9 +96,9 @@ export class Plugin {
window.siyuan.config.keymap.plugin[options.name][toolbarItem.name] = {
default: toolbarItem.hotkey,
custom: toolbarItem.hotkey,
- }
+ };
}
- })
+ });
}
public onload() {
diff --git a/app/src/protyle/render/av/relation.ts b/app/src/protyle/render/av/relation.ts
index 540c104bb8..12ebb2768a 100644
--- a/app/src/protyle/render/av/relation.ts
+++ b/app/src/protyle/render/av/relation.ts
@@ -216,7 +216,7 @@ const genSelectItemHTML = (type: "selected" | "empty" | "unselect", id?: string,
if (type === "empty") {
if (id) {
return `<button class="b3-menu__item" data-type="setRelationCell">
- <span class="b3-menu__label">${window.siyuan.languages.newRowInRelation.replace('${x}', text).replace('${y}', id)}</span>
+ <span class="b3-menu__label">${window.siyuan.languages.newRowInRelation.replace("${x}", text).replace("${y}", id)}</span>
</button>`;
}
return `<button class="b3-menu__item">
@@ -407,7 +407,7 @@ export const setRelationCell = (protyle: IProtyle, nodeElement: HTMLElement, tar
}
} else {
const blockID = target.querySelector(".popover__block").getAttribute("data-id");
- const content = target.querySelector("b").textContent
+ const content = target.querySelector("b").textContent;
const rowId = Lute.NewNodeID();
transaction(protyle, [{
action: "insertAttrViewBlock",
diff --git a/app/src/protyle/toolbar/index.ts b/app/src/protyle/toolbar/index.ts
index 4260d1db1b..bf28a21b99 100644
--- a/app/src/protyle/toolbar/index.ts
+++ b/app/src/protyle/toolbar/index.ts
@@ -69,15 +69,15 @@ export class Toolbar {
/// #endif
this.toolbarHeight = 29;
protyle.app.plugins.forEach(item => {
- const pluginToolbar = item.updateProtyleToolbar(options.toolbar)
+ const pluginToolbar = item.updateProtyleToolbar(options.toolbar);
pluginToolbar.forEach(toolbarItem => {
if (typeof toolbarItem === "string" || Constants.INLINE_TYPE.concat("|").includes(toolbarItem.name) || !toolbarItem.hotkey) {
- return
+ return;
}
if (window.siyuan.config.keymap.plugin && window.siyuan.config.keymap.plugin[item.name] && window.siyuan.config.keymap.plugin[item.name][toolbarItem.name]) {
toolbarItem.hotkey = window.siyuan.config.keymap.plugin[item.name][toolbarItem.name].custom;
}
- })
+ });
options.toolbar = toolbarKeyToMenu(pluginToolbar);
});
options.toolbar.forEach((menuItem: IMenuItem) => {
@@ -90,15 +90,15 @@ export class Toolbar {
this.element.innerHTML = "";
protyle.options.toolbar = toolbarKeyToMenu(Constants.PROTYLE_TOOLBAR);
protyle.app.plugins.forEach(item => {
- const pluginToolbar = item.updateProtyleToolbar(protyle.options.toolbar)
+ const pluginToolbar = item.updateProtyleToolbar(protyle.options.toolbar);
pluginToolbar.forEach(toolbarItem => {
if (typeof toolbarItem === "string" || Constants.INLINE_TYPE.concat("|").includes(toolbarItem.name) || !toolbarItem.hotkey) {
- return
+ return;
}
if (window.siyuan.config.keymap.plugin && window.siyuan.config.keymap.plugin[item.name] && window.siyuan.config.keymap.plugin[item.name][toolbarItem.name]) {
toolbarItem.hotkey = window.siyuan.config.keymap.plugin[item.name][toolbarItem.name].custom;
}
- })
+ });
protyle.options.toolbar = toolbarKeyToMenu(pluginToolbar);
});
protyle.options.toolbar.forEach((menuItem: IMenuItem) => {
diff --git a/app/src/protyle/util/editorCommonEvent.ts b/app/src/protyle/util/editorCommonEvent.ts
index f989db5797..1e5dc14944 100644
--- a/app/src/protyle/util/editorCommonEvent.ts
+++ b/app/src/protyle/util/editorCommonEvent.ts
@@ -1332,7 +1332,8 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {
addDragover(targetElement);
return;
}
- if (targetElement.getAttribute("data-type") === "NodeListItem" || fileTreeIds.indexOf("-") > -1) {
+ // 忘记为什么要限定文档树的拖拽了,先放开 https://github.com/siyuan-note/siyuan/pull/13284#issuecomment-2503853135
+ if (targetElement.getAttribute("data-type") === "NodeListItem") {
if (event.clientY > nodeRect.top + nodeRect.height / 2) {
targetElement.classList.add("dragover__bottom");
addDragover(targetElement);