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:
Vanessae7b04229c595
diff --git a/app/src/protyle/gutter/index.ts b/app/src/protyle/gutter/index.tsindex 4d29223365..5db14daf16 100644--- a/app/src/protyle/gutter/index.ts+++ b/app/src/protyle/gutter/index.ts@@ -2302,7 +2302,7 @@ export class Gutter {data: e.outerHTML});if (e.getAttribute("data-subtype") === "echarts") {- const chartInstance = window.echarts.getInstanceById(e.querySelector('[_echarts_instance_]').getAttribute("_echarts_instance_"));+ const chartInstance = window.echarts.getInstanceById(e.querySelector("[_echarts_instance_]").getAttribute("_echarts_instance_"));if (chartInstance) {chartInstance.resize();}@@ -2346,7 +2346,7 @@ export class Gutter {e.style.width = item;e.style.flex = "none";if (e.getAttribute("data-subtype") === "echarts") {- const chartInstance = window.echarts.getInstanceById(e.querySelector('[_echarts_instance_]').getAttribute("_echarts_instance_"));+ const chartInstance = window.echarts.getInstanceById(e.querySelector("[_echarts_instance_]").getAttribute("_echarts_instance_"));if (chartInstance) {chartInstance.resize();}@@ -2392,7 +2392,7 @@ export class Gutter {e.style.width = "";e.style.flex = "";if (e.getAttribute("data-subtype") === "echarts") {- const chartInstance = window.echarts.getInstanceById(e.querySelector('[_echarts_instance_]').getAttribute("_echarts_instance_"));+ const chartInstance = window.echarts.getInstanceById(e.querySelector("[_echarts_instance_]").getAttribute("_echarts_instance_"));if (chartInstance) {chartInstance.resize();}diff --git a/app/src/protyle/ui/initUI.ts b/app/src/protyle/ui/initUI.tsindex 6cbe241161..bb92ae7a7f 100644--- a/app/src/protyle/ui/initUI.ts+++ b/app/src/protyle/ui/initUI.ts@@ -1,6 +1,6 @@import {setEditMode} from "../util/setEditMode";import {scrollEvent} from "../scroll/event";-import {isMobile, isTouchDevice} from "../../util/functions";+import {isMobile} from "../../util/functions";import {Constants} from "../../constants";import {isMac} from "../util/compatibility";import {setInlineStyle} from "../../util/assets";diff --git a/app/src/protyle/util/resize.ts b/app/src/protyle/util/resize.tsindex e2b1c0bb90..5f2f4fe925 100644--- a/app/src/protyle/util/resize.ts+++ b/app/src/protyle/util/resize.ts@@ -67,7 +67,7 @@ export const resize = (protyle: IProtyle) => {if (abs.width > MIN_ABS || isNaN(abs.width)) {if (typeof window.echarts !== "undefined") {protyle.wysiwyg.element.querySelectorAll('[data-subtype="echarts"], [data-subtype="mindmap"]').forEach((chartItem: HTMLElement) => {- const chartInstance = window.echarts.getInstanceById(chartItem.querySelector('[_echarts_instance_]').getAttribute("_echarts_instance_"));+ const chartInstance = window.echarts.getInstanceById(chartItem.querySelector("[_echarts_instance_]").getAttribute("_echarts_instance_"));if (chartInstance) {chartInstance.resize();}diff --git a/app/src/protyle/util/table.ts b/app/src/protyle/util/table.tsindex 9dd58bf47a..4e106b9fa2 100644--- a/app/src/protyle/util/table.ts+++ b/app/src/protyle/util/table.ts@@ -100,25 +100,25 @@ export const insertRow = (protyle: IProtyle, range: Range, cellElement: HTMLElemfor (let m = 0; m < cellElement.parentElement.childElementCount; m++) {rowHTML += `<td align="${cellElement.parentElement.children[m].getAttribute("align") || ""}"></td>`;}- let newRowElememt: HTMLTableRowElement;+ let newRowElement: HTMLTableRowElement;if (cellElement.tagName === "TH") {const tbodyElement = nodeElement.querySelector("tbody");if (tbodyElement) {tbodyElement.insertAdjacentHTML("afterbegin", `<tr>${rowHTML}</tr>`);- newRowElememt = tbodyElement.firstElementChild as HTMLTableRowElement;+ newRowElement = tbodyElement.firstElementChild as HTMLTableRowElement;} else {cellElement.parentElement.parentElement.insertAdjacentHTML("afterend", `<tbody><tr>${rowHTML}</tr></tbody>`);- newRowElememt = cellElement.parentElement.parentElement.nextElementSibling.firstElementChild as HTMLTableRowElement;+ newRowElement = cellElement.parentElement.parentElement.nextElementSibling.firstElementChild as HTMLTableRowElement;}} else {cellElement.parentElement.insertAdjacentHTML("afterend", `<tr>${rowHTML}</tr>`);- newRowElememt = cellElement.parentElement.nextElementSibling as HTMLTableRowElement;+ newRowElement = cellElement.parentElement.nextElementSibling as HTMLTableRowElement;}- range.selectNodeContents(newRowElememt.cells[getColIndex(cellElement)]);+ range.selectNodeContents(newRowElement.cells[getColIndex(cellElement)]);range.collapse(true);focusByRange(range);updateTransaction(protyle, nodeElement.getAttribute("data-node-id"), nodeElement.outerHTML, html);- scrollToView(nodeElement, newRowElememt, protyle);+ scrollToView(nodeElement, newRowElement, protyle);};export const insertRowAbove = (protyle: IProtyle, range: Range, cellElement: HTMLElement, nodeElement: Element, count = 1) => {@@ -156,10 +156,10 @@ export const insertRowAbove = (protyle: IProtyle, range: Range, cellElement: HTMpreviousTrElement = previousTrElement.previousElementSibling;}}- let newRowElememt: HTMLTableRowElement;+ let newRowElement: 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");+ newRowElement = nodeElement.querySelector("thead tr");if (count > 1) {cellElement.parentElement.parentElement.nextElementSibling.insertAdjacentHTML("afterbegin", `<tr>${rowHTML.replace(/<th/g, "<td").replace(/<\/th>/g, "</td>")}</tr>`.repeat(count - 1));}@@ -167,13 +167,13 @@ export const insertRowAbove = (protyle: IProtyle, range: Range, cellElement: HTMcellElement.parentElement.parentElement.remove();} else {cellElement.parentElement.insertAdjacentHTML("beforebegin", `<tr>${rowHTML}</tr>`.repeat(count));- newRowElememt = cellElement.parentElement.previousElementSibling as HTMLTableRowElement;+ newRowElement = cellElement.parentElement.previousElementSibling as HTMLTableRowElement;}- range.selectNodeContents(newRowElememt.cells[getColIndex(cellElement)]);+ range.selectNodeContents(newRowElement.cells[getColIndex(cellElement)]);range.collapse(true);focusByRange(range);updateTransaction(protyle, nodeElement.getAttribute("data-node-id"), nodeElement.outerHTML, html);- scrollToView(nodeElement, newRowElememt, protyle);+ scrollToView(nodeElement, newRowElement, protyle);};export const insertColumn = (protyle: IProtyle, nodeElement: Element, cellElement: HTMLElement, type: InsertPosition, range: Range) => {