Skip to content

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

:rotating_light:

Vanessab186398052ed
diff --git a/app/src/block/util.ts b/app/src/block/util.ts
index a2db15249e..d55a82eb1a 100644
--- a/app/src/block/util.ts
+++ b/app/src/block/util.ts
@@ -46,7 +46,7 @@ export const cancelSB = async (protyle: IProtyle, nodeElement: Element, range?:
id,
});
if (range) {
- getContenteditableElement(nodeElement).insertAdjacentHTML("afterbegin", "<wbr>")
+ getContenteditableElement(nodeElement).insertAdjacentHTML("afterbegin", "<wbr>");
}
nodeElement.lastElementChild.remove();
// 超级块中的 html 块需要反转义再赋值 https://github.com/siyuan-note/siyuan/issues/13155
diff --git a/app/src/config/search.ts b/app/src/config/search.ts
index 65f4d05fc9..1796c218ef 100644
--- a/app/src/config/search.ts
+++ b/app/src/config/search.ts
@@ -146,18 +146,18 @@ export const initConfigSearch = (element: HTMLElement, app: App) => {
keymap.search(searchElement.value, searchKeymapElement.value);
} else if (type === "search") {
panelElement.querySelectorAll(`.config__tab-container[data-name="${type}"] .b3-label`).forEach((itemElement: HTMLElement) => {
- let showItemElement = false
+ let showItemElement = false;
itemElement.querySelectorAll("label > .fn__flex-1").forEach(labelItem => {
if (!labelItem.parentElement.classList.contains("fn__none")) {
const text = labelItem.textContent.toLowerCase();
if (text.indexOf(inputValue.toLowerCase()) > -1 || inputValue.toLowerCase().indexOf(text) > -1) {
labelItem.parentElement.style.display = "";
- showItemElement = true
+ showItemElement = true;
} else {
labelItem.parentElement.style.display = "none";
}
}
- })
+ });
if (!itemElement.classList.contains("fn__none")) {
if (showItemElement) {
itemElement.style.display = "";
diff --git a/app/src/layout/Tab.ts b/app/src/layout/Tab.ts
index d0160473c6..977d961357 100644
--- a/app/src/layout/Tab.ts
+++ b/app/src/layout/Tab.ts
@@ -8,7 +8,7 @@ import {escapeGreat, escapeHtml} from "../util/escape";
import {unicode2Emoji} from "../emoji";
import {fetchPost} from "../util/fetch";
import {hideTooltip, showTooltip} from "../dialog/tooltip";
-import {isTouchDevice, isWindow} from "../util/functions";
+import {isTouchDevice} from "../util/functions";
/// #if !BROWSER
import {openNewWindow} from "../window/openNewWindow";
import {ipcRenderer} from "electron";
diff --git a/app/src/protyle/util/editorCommonEvent.ts b/app/src/protyle/util/editorCommonEvent.ts
index 4a4ac35481..f422f27b7b 100644
--- a/app/src/protyle/util/editorCommonEvent.ts
+++ b/app/src/protyle/util/editorCommonEvent.ts
@@ -535,7 +535,7 @@ const dragSb = async (protyle: IProtyle, sourceElements: Element[], targetElemen
/// #if !MOBILE
const otherProtyleElement = hasClosestByClassName(oldSourceParentElement, "protyle", true);
if (otherProtyleElement) {
- const allEditor = getAllEditor()
+ const allEditor = getAllEditor();
for (let i = 0; i < allEditor.length; i++) {
if (allEditor[i].protyle.element.isSameNode(otherProtyleElement)) {
const otherSbData = await cancelSB(allEditor[i].protyle, oldSourceParentElement);
@@ -738,7 +738,7 @@ const dragSame = async (protyle: IProtyle, sourceElements: Element[], targetElem
/// #if !MOBILE
const otherProtyleElement = hasClosestByClassName(oldSourceParentElement, "protyle", true);
if (otherProtyleElement) {
- const allEditor = getAllEditor()
+ const allEditor = getAllEditor();
for (let i = 0; i < allEditor.length; i++) {
if (allEditor[i].protyle.element.isSameNode(otherProtyleElement)) {
const otherSbData = await cancelSB(allEditor[i].protyle, oldSourceParentElement);
diff --git a/app/src/protyle/wysiwyg/enter.ts b/app/src/protyle/wysiwyg/enter.ts
index 9f25fb4324..5659a64c63 100644
--- a/app/src/protyle/wysiwyg/enter.ts
+++ b/app/src/protyle/wysiwyg/enter.ts
@@ -1,5 +1,5 @@
import {genEmptyElement, insertEmptyBlock} from "../../block/util";
-import {focusBlock, focusByRange, focusByWbr, getSelectionOffset, setLastNodeRange} from "../util/selection";
+import {focusByRange, focusByWbr, getSelectionOffset, setLastNodeRange} from "../util/selection";
import {
getContenteditableElement,
getTopEmptyElement,
diff --git a/app/src/protyle/wysiwyg/transaction.ts b/app/src/protyle/wysiwyg/transaction.ts
index 78503bd001..7fadf2f189 100644
--- a/app/src/protyle/wysiwyg/transaction.ts
+++ b/app/src/protyle/wysiwyg/transaction.ts
@@ -274,14 +274,14 @@ const updateEmbed = (protyle: IProtyle, operation: IOperation) => {
});
tempElement.content.querySelectorAll(".protyle-wysiwyg--select").forEach(selectItem => {
selectItem.classList.remove("protyle-wysiwyg--select");
- })
+ });
const wbrElement = tempElement.querySelector("wbr");
if (wbrElement) {
wbrElement.remove();
}
item.outerHTML = tempElement.innerHTML;
updatedEmbed = true;
- }
+ };
const allTempElement = document.createElement("template");
allTempElement.innerHTML = operation.data;
@@ -290,7 +290,7 @@ const updateEmbed = (protyle: IProtyle, operation: IOperation) => {
if (matchElement.length > 0) {
matchElement.forEach(embedItem => {
updateHTML(embedItem, operation.data);
- })
+ });
} else {
item.querySelectorAll(".protyle-wysiwyg__embed").forEach(embedBlockItem => {
const newTempElement = allTempElement.content.querySelector(`[data-node-id="${embedBlockItem.getAttribute("data-id")}"]`);
@@ -667,10 +667,10 @@ export const onTransaction = (protyle: IProtyle, operation: IOperation, isUndo:
}
let hasFind = false;
if (operation.previousID && updateElements.length > 0) {
- const previousElement = protyle.wysiwyg.element.querySelectorAll(`[data-node-id="${operation.previousID}"]`)
+ const previousElement = protyle.wysiwyg.element.querySelectorAll(`[data-node-id="${operation.previousID}"]`);
if (previousElement.length === 0 && protyle.options.backlinkData && isUndo && getSelection().rangeCount > 0) {
// 反链面板删除超级块中的最后一个段落块后撤销重做
- const blockElement = hasTopClosestByAttribute(range.startContainer, "data-node-id", null)
+ const blockElement = hasTopClosestByAttribute(range.startContainer, "data-node-id", null);
if (blockElement) {
blockElement.before(processClonePHElement(updateElements[0].cloneNode(true) as Element));
hasFind = true;
@@ -684,13 +684,13 @@ export const onTransaction = (protyle: IProtyle, operation: IOperation, isUndo:
});
}
} else if (updateElements.length > 0) {
- const parentElement = protyle.wysiwyg.element.querySelectorAll(`[data-node-id="${operation.parentID}"]`)
+ const parentElement = protyle.wysiwyg.element.querySelectorAll(`[data-node-id="${operation.parentID}"]`);
if (!protyle.options.backlinkData && operation.parentID === protyle.block.parentID) {
protyle.wysiwyg.element.prepend(processClonePHElement(updateElements[0].cloneNode(true) as Element));
hasFind = true;
} else if (parentElement.length === 0 && protyle.options.backlinkData && isUndo && getSelection().rangeCount > 0) {
// 反链面板删除超级块中的段落块后撤销再重做 https://github.com/siyuan-note/siyuan/issues/14496#issuecomment-2771372486
- const topBlockElement = hasTopClosestByAttribute(getSelection().getRangeAt(0).startContainer, "data-node-id", null)
+ const topBlockElement = hasTopClosestByAttribute(getSelection().getRangeAt(0).startContainer, "data-node-id", null);
if (topBlockElement) {
topBlockElement.before(processClonePHElement(updateElements[0].cloneNode(true) as Element));
hasFind = true;
@@ -749,7 +749,7 @@ export const onTransaction = (protyle: IProtyle, operation: IOperation, isUndo:
const previousElement = protyle.wysiwyg.element.querySelectorAll(`[data-node-id="${operation.previousID}"]`);
if (previousElement.length === 0 && protyle.options.backlinkData && isUndo && getSelection().rangeCount > 0) {
// 反链面板删除超级块中的最后一个段落块后撤销
- const blockElement = hasClosestBlock(getSelection().getRangeAt(0).startContainer)
+ const blockElement = hasClosestBlock(getSelection().getRangeAt(0).startContainer);
if (blockElement) {
blockElement.insertAdjacentHTML("beforebegin", operation.data);
cursorElements.push(blockElement.previousElementSibling);
@@ -786,7 +786,7 @@ export const onTransaction = (protyle: IProtyle, operation: IOperation, isUndo:
cursorElements.push(protyle.wysiwyg.element.firstElementChild);
} else if (parentElement.length === 0 && protyle.options.backlinkData && isUndo && getSelection().rangeCount > 0) {
// 反链面板删除超级块中的段落块后撤销
- const blockElement = hasClosestBlock(getSelection().getRangeAt(0).startContainer)
+ const blockElement = hasClosestBlock(getSelection().getRangeAt(0).startContainer);
if (blockElement) {
blockElement.insertAdjacentHTML("beforebegin", operation.data);
cursorElements.push(blockElement.previousElementSibling);