An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: https://github.com/siyuan-note/siyuan/issues/8873
Vanessa5c57054eba4a
diff --git a/app/src/protyle/render/av/action.ts b/app/src/protyle/render/av/action.tsindex 097db9e6e5..e2d352c3bc 100644--- a/app/src/protyle/render/av/action.ts+++ b/app/src/protyle/render/av/action.ts@@ -162,12 +162,7 @@ export const avClick = (protyle: IProtyle, event: MouseEvent & { target: HTMLElereturn;}const cellType = getTypeByCellElement(target);- if (viewType === "gallery") {- const itemElement = hasClosestByClassName(target, "av__gallery-item");- if (itemElement && cellType !== "updated" && cellType !== "created" && cellType !== "lineNumber") {- popTextCell(protyle, [target]);- }- } else {+ if (viewType === "table") {const scrollElement = hasClosestByClassName(target, "av__scroll");if (!scrollElement) {return;@@ -176,7 +171,6 @@ export const avClick = (protyle: IProtyle, event: MouseEvent & { target: HTMLEleif (!rowElement) {return;}- // TODO 点击单元格的时候, lineNumber 选中整行if (cellType === "updated" || cellType === "created" || cellType === "lineNumber") {selectRow(rowElement.querySelector(".av__firstcol"), "toggle");} else {@@ -187,6 +181,11 @@ export const avClick = (protyle: IProtyle, event: MouseEvent & { target: HTMLEleupdateHeader(rowElement);popTextCell(protyle, [target]);}+ } else {+ const itemElement = hasClosestByClassName(target, "av__gallery-item");+ if (itemElement && cellType !== "updated" && cellType !== "created" && cellType !== "lineNumber") {+ popTextCell(protyle, [target]);+ }}}event.preventDefault();@@ -834,7 +833,7 @@ export const updateAttrViewCellAnimation = (cellElement: HTMLElement, value: IAV}const viewType = blockElement.getAttribute("data-av-type") as TAVView;const iconElement = cellElement.querySelector(".b3-menu__avemoji");- if (viewType === "gallery") {+ if (["gallery", "kanban"].includes(viewType)) {if (value.type === "checkbox") {value.checkbox = {checked: value.checkbox?.checked || false,diff --git a/app/src/protyle/render/av/cell.ts b/app/src/protyle/render/av/cell.tsindex ec90c751b7..9d77ab25f3 100644--- a/app/src/protyle/render/av/cell.ts+++ b/app/src/protyle/render/av/cell.ts@@ -996,7 +996,7 @@ export const renderCell = (cellValue: IAVCellValue, rowIndex = 0, showIcon = tru});} else if (cellValue.type === "checkbox") {text += `<div class="fn__flex"><svg class="av__checkbox"><use xlink:href="#icon${cellValue?.checkbox?.checked ? "Check" : "Uncheck"}"></use></svg>`;- if (type === "gallery" && cellValue?.checkbox?.content) {+ if (["gallery", "kanban"].includes(type) && cellValue?.checkbox?.content) {text += `<span class="fn__space"></span>${cellValue?.checkbox?.content}`;}text += "</div>";@@ -1223,7 +1223,7 @@ export const cellValueIsEmpty = (value: IAVCellValue) => {return !value[value.type as "text"]?.content;}if (value.type === "number") {- return !value.number?.isNotEmpty;+ return value.number ? !value.number.isNotEmpty : true;}if (["mSelect", "mAsset", "select"].includes(value.type)) {if (value[(value.type === "select" ? "mSelect" : value.type) as "mSelect"]?.length > 0) {diff --git a/app/src/protyle/render/av/col.ts b/app/src/protyle/render/av/col.tsindex 60b03820ac..ae3560247e 100644--- a/app/src/protyle/render/av/col.ts+++ b/app/src/protyle/render/av/col.ts@@ -22,7 +22,7 @@ import {hasClosestByClassName} from "../../util/hasClosest";export const getColId = (element: Element, viewType: TAVView) => {if (viewType === "table" || hasClosestByClassName(element, "custom-attr")) {return element.getAttribute("data-col-id");- } else if (viewType === "gallery") {+ } else if (["gallery", "kanban"].includes(viewType)) {return element.getAttribute("data-field-id");}};diff --git a/app/src/protyle/render/av/layout.ts b/app/src/protyle/render/av/layout.tsindex 8e729579c7..cdbfab6582 100644--- a/app/src/protyle/render/av/layout.ts+++ b/app/src/protyle/render/av/layout.ts@@ -178,24 +178,6 @@ export const bindLayoutEvent = (options: {if (options.data.viewType === "table") {return;}- const toggleBgElement = options.menuElement.querySelector('.b3-switch[data-type="toggle-kanban-bg"]') as HTMLInputElement;- toggleBgElement.addEventListener("change", () => {- const avID = options.blockElement.getAttribute("data-av-id");- const blockID = options.blockElement.getAttribute("data-node-id");- const checked = toggleBgElement.checked;- transaction(options.protyle, [{- action: "setAttrViewFillColBackgroundColor",- avID,- blockID,- data: checked- }], [{- action: "setAttrViewFillColBackgroundColor",- avID,- blockID,- data: !checked- }]);- (options.data.view as IAVKanban).fillColBackgroundColor = checked;- })const toggleFitElement = options.menuElement.querySelector('.b3-switch[data-type="toggle-gallery-fit"]') as HTMLInputElement;toggleFitElement.addEventListener("change", () => {const avID = options.blockElement.getAttribute("data-av-id");@@ -232,6 +214,27 @@ export const bindLayoutEvent = (options: {}]);(options.data.view as IAVGallery).displayFieldName = checked;});+ if (options.data.viewType === "gallery") {+ return;+ }+ const toggleBgElement = options.menuElement.querySelector('.b3-switch[data-type="toggle-kanban-bg"]') as HTMLInputElement;+ toggleBgElement.addEventListener("change", () => {+ const avID = options.blockElement.getAttribute("data-av-id");+ const blockID = options.blockElement.getAttribute("data-node-id");+ const checked = toggleBgElement.checked;+ transaction(options.protyle, [{+ action: "setAttrViewFillColBackgroundColor",+ avID,+ blockID,+ data: checked+ }], [{+ action: "setAttrViewFillColBackgroundColor",+ avID,+ blockID,+ data: !checked+ }]);+ (options.data.view as IAVKanban).fillColBackgroundColor = checked;+ });};export const updateLayout = async (options: {diff --git a/app/src/protyle/render/av/openMenuPanel.ts b/app/src/protyle/render/av/openMenuPanel.tsindex 103c6594ad..f3e8dfa233 100644--- a/app/src/protyle/render/av/openMenuPanel.ts+++ b/app/src/protyle/render/av/openMenuPanel.ts@@ -600,11 +600,12 @@ export const openMenuPanel = (options: {hideElements(["util"], options.protyle);} else if (!window.siyuan.menus.menu.element.classList.contains("fn__none")) {// 过滤面板先关闭过滤条件- window.siyuan.menus.menu.remove();} else {closeCB?.();avPanelElement.remove();- focusBlock(options.blockElement);+ setTimeout(() => {+ focusBlock(options.blockElement);+ }, Constants.TIMEOUT_TRANSITION); // 单选使用 enter 修改选项后会滚动}window.siyuan.menus.menu.remove();event.preventDefault();