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/issues/7536

Vanessa5acd3aae08b7
diff --git a/app/src/protyle/hint/extend.ts b/app/src/protyle/hint/extend.ts
index b05b69d1fe..f5ac113274 100644
--- a/app/src/protyle/hint/extend.ts
+++ b/app/src/protyle/hint/extend.ts
@@ -47,11 +47,11 @@ export const hintSlash = (key: string, protyle: IProtyle) => {
value: Constants.ZWSP + 5,
html: '<div class="b3-list-item__first"><svg class="b3-list-item__graphic"><use xlink:href="#iconSparkles"></use></svg><span class="b3-list-item__text">AI Chat</span></div>',
},
- // {
- // filter: ["属性视图", "shuxingshitu", "sxst", "attribute view"],
- // value: '<div data-type="NodeAttributeView" data-av-type="table"></div>',
- // html: `<div class="b3-list-item__first"><svg class="b3-list-item__graphic"><use xlink:href="#iconDatabase"></use></svg><span class="b3-list-item__text">${window.siyuan.languages.attributeView}</span></div>`,
- // },
+ {
+ filter: ["属性视图", "shuxingshitu", "sxst", "attribute view"],
+ value: '<div data-type="NodeAttributeView" data-av-type="table"></div>',
+ html: `<div class="b3-list-item__first"><svg class="b3-list-item__graphic"><use xlink:href="#iconDatabase"></use></svg><span class="b3-list-item__text">${window.siyuan.languages.attributeView}</span></div>`,
+ },
{
filter: ["文档", "子文档", "wendang", "wd", "ziwendang", "zwd", "xjwd"],
value: Constants.ZWSP + 4,
diff --git a/app/src/protyle/render/av/action.ts b/app/src/protyle/render/av/action.ts
index cea1054408..1358da6319 100644
--- a/app/src/protyle/render/av/action.ts
+++ b/app/src/protyle/render/av/action.ts
@@ -222,3 +222,20 @@ export const avContextmenu = (protyle: IProtyle, event: MouseEvent & { detail: a
const addRow = () => {
}
+
+const addCol = () => {
+
+}
+
+const removeRow = () => {
+
+}
+
+const removeCol = () => {
+
+}
+
+
+const updateCel = () => {
+
+}
diff --git a/app/src/protyle/render/av/cell.ts b/app/src/protyle/render/av/cell.ts
index ea4c6b4345..83153d09a6 100644
--- a/app/src/protyle/render/av/cell.ts
+++ b/app/src/protyle/render/av/cell.ts
@@ -2,10 +2,7 @@ import {transaction} from "../../wysiwyg/transaction";
import {hasClosestBlock} from "../../util/hasClosest";
export const popTextCell = (protyle: IProtyle, cellElement: HTMLElement) => {
- const index = parseInt(cellElement.getAttribute("data-index"))
- const tableElement = cellElement.parentElement.parentElement
- const colCellElement = tableElement.firstElementChild.children[index + 1];
- const type = colCellElement.getAttribute("data-dtype") as TAVCol;
+ const type = cellElement.parentElement.parentElement.firstElementChild.children[parseInt(cellElement.getAttribute("data-index")) + 1].getAttribute("data-dtype") as TAVCol;
const cellRect = cellElement.getBoundingClientRect()
let html = ""
if (type === "block") {
diff --git a/app/src/protyle/render/av/render.ts b/app/src/protyle/render/av/render.ts
index c5fd8919b5..6aa1973e77 100644
--- a/app/src/protyle/render/av/render.ts
+++ b/app/src/protyle/render/av/render.ts
@@ -29,14 +29,16 @@ export const avRender = (element: Element) => {
const data = response.data.av;
// header
let tableHTML = '<div class="av__row av__row--header"><div class="av__firstcol"><svg style="height: 42px"><use xlink:href="#iconUncheck"></use></svg></div>';
+ let index = 0
data.columns.forEach((column: IAVColumn) => {
if (column.hidden) {
return;
}
- tableHTML += `<div class="av__cell" data-id="${column.id}" data-dtype="${column.type}" data-wrap="${column.wrap}" style="width: ${column.width || 200}px;">
+ tableHTML += `<div class="av__cell" data-index="${index}" data-id="${column.id}" data-dtype="${column.type}" data-wrap="${column.wrap}" style="width: ${column.width || 200}px;">
<svg><use xlink:href="#${column.icon || getIconByType(column.type)}"></use></svg>
<span>${column.name}</span>
</div>`;
+ index++;
});
tableHTML += `<div class="block__icons">
<div class="block__icon block__icon--show" data-type="av-header-add"><svg><use xlink:href="#iconAdd"></use></svg></div>