An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:rotating_light:
Vanessae4dade95b701
diff --git a/app/src/protyle/export/index.ts b/app/src/protyle/export/index.tsindex 2c8053e4b1..8b524963d5 100644--- a/app/src/protyle/export/index.ts+++ b/app/src/protyle/export/index.ts@@ -381,7 +381,7 @@ const renderPDF = (id: string) => {webSecurity: false,},});- window.siyuan.printWin.webContents.userAgent = `SiYuan/${app.getVersion()} https://b3log.org/siyuan Electron`+ window.siyuan.printWin.webContents.userAgent = `SiYuan/${app.getVersion()} https://b3log.org/siyuan Electron`;fetchPost("/api/export/exportTempContent", {content: html}, (response) => {window.siyuan.printWin.loadURL(response.data.url);});diff --git a/app/src/protyle/gutter/index.ts b/app/src/protyle/gutter/index.tsindex 92d667f3f9..ccd953d17f 100644--- a/app/src/protyle/gutter/index.ts+++ b/app/src/protyle/gutter/index.ts@@ -1176,22 +1176,22 @@ export class Gutter {window.siyuan.menus.menu.append(new MenuItem({type: "separator"}).element);const headingSubMenu = [];if (subType !== "h1") {- headingSubMenu.push(this.genHeadingTransform(protyle, id, 1))+ headingSubMenu.push(this.genHeadingTransform(protyle, id, 1));}if (subType !== "h2") {- headingSubMenu.push(this.genHeadingTransform(protyle, id, 2))+ headingSubMenu.push(this.genHeadingTransform(protyle, id, 2));}if (subType !== "h3") {- headingSubMenu.push(this.genHeadingTransform(protyle, id, 3))+ headingSubMenu.push(this.genHeadingTransform(protyle, id, 3));}if (subType !== "h4") {- headingSubMenu.push(this.genHeadingTransform(protyle, id, 4))+ headingSubMenu.push(this.genHeadingTransform(protyle, id, 4));}if (subType !== "h5") {- headingSubMenu.push(this.genHeadingTransform(protyle, id, 5))+ headingSubMenu.push(this.genHeadingTransform(protyle, id, 5));}if (subType !== "h6") {- headingSubMenu.push(this.genHeadingTransform(protyle, id, 6))+ headingSubMenu.push(this.genHeadingTransform(protyle, id, 6));}window.siyuan.menus.menu.append(new MenuItem({type: "submenu",@@ -1205,7 +1205,7 @@ export class Gutter {click() {fetchPost("/api/block/getHeadingChildrenDOM", {id}, (response) => {writeText(response.data + Constants.ZWSP);- })+ });}}).element);}@@ -1338,10 +1338,10 @@ export class Gutter {mathRender(itemElement);});});- transaction(protyle, response.data.doOperations, response.data.undoOperations)+ transaction(protyle, response.data.doOperations, response.data.undoOperations);});}- }+ };}private genClick(nodeElements: Element[], protyle: IProtyle, cb: (e: HTMLElement) => void) {diff --git a/app/src/protyle/util/editorCommonEvent.ts b/app/src/protyle/util/editorCommonEvent.tsindex e3325765f1..3bf51624d3 100644--- a/app/src/protyle/util/editorCommonEvent.ts+++ b/app/src/protyle/util/editorCommonEvent.ts@@ -16,7 +16,6 @@ import {Tab} from "../../layout/Tab";import {getAllModels} from "../../layout/getAll";import {updatePanelByEditor} from "../../editor/util";/// #endif-import * as path from "path";import {Editor} from "../../editor";import {blockRender} from "../markdown/blockRender";import {processRender} from "./processCode";diff --git a/app/src/protyle/util/paste.ts b/app/src/protyle/util/paste.tsindex b37b3eb542..673e279ce5 100644--- a/app/src/protyle/util/paste.ts+++ b/app/src/protyle/util/paste.ts@@ -4,7 +4,6 @@ import {processPasteCode, processRender} from "./processCode";import {writeText} from "./compatibility";/// #if !BROWSERimport {clipboard} from "electron";-import * as path from "path";/// #endifimport {hasClosestBlock} from "./hasClosest";import {focusByWbr, getEditorRange} from "./selection";@@ -111,7 +110,7 @@ export const paste = async (protyle: IProtyle, event: (ClipboardEvent | DragEven}// 复制标题及其下方块使用 writeText,需将 textPLain 转换为 textHTMLif (textPlain.endsWith(Constants.ZWSP) && !textHTML) {- textHTML = textPlain+ textHTML = textPlain;}/// #if !MOBILEif (!textHTML && !textPlain && ("clipboardData" in event)) {diff --git a/app/src/protyle/util/selection.ts b/app/src/protyle/util/selection.tsindex 6a3660c453..96ab269908 100644--- a/app/src/protyle/util/selection.ts+++ b/app/src/protyle/util/selection.ts@@ -525,7 +525,7 @@ export const focusBlock = (element: Element, parentElement?: HTMLElement, toStarcursorElement = cellElements[cellElements.length - 1];}}- let range+ let range;if (toStart) {// 需要定位到第一个 child https://github.com/siyuan-note/siyuan/issues/5930range = setFirstNodeRange(cursorElement, getEditorRange(cursorElement));diff --git a/app/src/protyle/util/table.ts b/app/src/protyle/util/table.tsindex 13a7387756..addd134ba2 100644--- a/app/src/protyle/util/table.ts+++ b/app/src/protyle/util/table.ts@@ -69,7 +69,7 @@ export const setTableAlign = (protyle: IProtyle, cellElements: HTMLElement[], no};export const insertRow = (protyle: IProtyle, range: Range, cellElement: HTMLElement, nodeElement: Element) => {- const wbrElement = document.createElement("wbr")+ const wbrElement = document.createElement("wbr");range.insertNode(wbrElement);const html = nodeElement.outerHTML;wbrElement.remove();@@ -98,7 +98,7 @@ export const insertRow = (protyle: IProtyle, range: Range, cellElement: HTMLElem};export const insertRowAbove = (protyle: IProtyle, range: Range, cellElement: HTMLElement, nodeElement: Element) => {- const wbrElement = document.createElement("wbr")+ const wbrElement = document.createElement("wbr");range.insertNode(wbrElement);const html = nodeElement.outerHTML;wbrElement.remove();@@ -131,10 +131,10 @@ export const insertRowAbove = (protyle: IProtyle, range: Range, cellElement: HTMpreviousTrElement = previousTrElement.previousElementSibling;}}- let newRowElememt: HTMLTableRowElement+ let newRowElememt: HTMLTableRowElement;if (cellElement.parentElement.parentElement.tagName === "THEAD" && !cellElement.parentElement.previousElementSibling) {cellElement.parentElement.parentElement.insertAdjacentHTML("beforebegin", `<thead><tr>${rowHTML}</tr></thead>`);- newRowElememt = nodeElement.querySelector("thead tr")+ newRowElememt = nodeElement.querySelector("thead tr");cellElement.parentElement.parentElement.nextElementSibling.insertAdjacentHTML("afterbegin", cellElement.parentElement.parentElement.innerHTML);cellElement.parentElement.parentElement.remove();} else {@@ -147,15 +147,15 @@ export const insertRowAbove = (protyle: IProtyle, range: Range, cellElement: HTM};export const insertColumn = (protyle: IProtyle, nodeElement: Element, cellElement: HTMLElement, type: InsertPosition, range: Range) => {- const wbrElement = document.createElement("wbr")+ const wbrElement = document.createElement("wbr");range.insertNode(wbrElement);const html = nodeElement.outerHTML;wbrElement.remove();const index = getColIndex(cellElement);const tableElement = nodeElement.querySelector("table");for (let i = 0; i < tableElement.rows.length; i++) {- const colCellElement = tableElement.rows[i].cells[index]- const newCellElement = document.createElement(colCellElement.tagName)+ const colCellElement = tableElement.rows[i].cells[index];+ const newCellElement = document.createElement(colCellElement.tagName);if (colCellElement.isSameNode(cellElement)) {newCellElement.innerHTML = "<wbr> ";} else {diff --git a/app/src/protyle/wysiwyg/enter.ts b/app/src/protyle/wysiwyg/enter.tsindex e643486906..82fa2c3e04 100644--- a/app/src/protyle/wysiwyg/enter.ts+++ b/app/src/protyle/wysiwyg/enter.ts@@ -9,7 +9,6 @@ import {} from "./getBlock";import {transaction, updateTransaction} from "./transaction";import {breakList, genListItemElement, listOutdent, updateListOrder} from "./list";-import {hasClosestByMatchTag} from "../util/hasClosest";import {highlightRender} from "../markdown/highlightRender";import {Constants} from "../../constants";import {scrollCenter} from "../../util/highlightById";diff --git a/app/src/util/pathName.ts b/app/src/util/pathName.tsindex 7587447289..a1437f3e89 100644--- a/app/src/util/pathName.ts+++ b/app/src/util/pathName.ts@@ -38,18 +38,18 @@ export const isLocalPath = (link: string) => {return false;}- link = link.trim()+ link = link.trim();if (1 > link.length) {return false;}- link = link.toLowerCase()+ link = link.toLowerCase();if (link.startsWith("assets/") || link.startsWith("file://") || link.startsWith("\\\\") /* Windows 网络共享路径 */) {- return true+ return true;}- const colonIdx = link.indexOf(":")- return 1 === colonIdx // 冒号前面只有一个字符认为是 Windows 盘符而不是网络协议+ const colonIdx = link.indexOf(":");+ return 1 === colonIdx; // 冒号前面只有一个字符认为是 Windows 盘符而不是网络协议};export const pathPosix = () => {