diff --git a/app/src/protyle/render/av/blockAttr.ts b/app/src/protyle/render/av/blockAttr.ts index 833fea2b4d4..021655e23ed 100644 --- a/app/src/protyle/render/av/blockAttr.ts +++ b/app/src/protyle/render/av/blockAttr.ts @@ -48,7 +48,7 @@ export const genAVValueHTML = (value: IAVCellValue) => { `; break; case "template": - html = ``; + html = `
${value.template.content}
`; break; case "email": html = ` @@ -120,7 +120,7 @@ class="fn__flex-1 fn__flex${["url", "text", "number", "email", "phone", "templat element.querySelectorAll(".b3-text-field--text").forEach((item: HTMLInputElement) => { item.addEventListener("change", () => { let value; - if (["url", "text", "email", "phone", "template"].includes(item.parentElement.dataset.type)) { + if (["url", "text", "email", "phone"].includes(item.parentElement.dataset.type)) { value = { [item.parentElement.dataset.type]: { content: item.value diff --git a/app/src/protyle/render/av/cell.ts b/app/src/protyle/render/av/cell.ts index 10b6ccddf1f..7e8c4cb9b92 100644 --- a/app/src/protyle/render/av/cell.ts +++ b/app/src/protyle/render/av/cell.ts @@ -85,7 +85,7 @@ export const genCellValue = (colType: TAVCol, value: string | any) => { } }; } - } else if (["text", "block", "url", "phone", "email", "template"].includes(colType)) { + } else if (["text", "block", "url", "phone", "email"].includes(colType)) { cellValue = { type: colType, [colType]: { @@ -344,6 +344,9 @@ export const popTextCell = (protyle: IProtyle, cellElements: HTMLElement[], type if (!type) { type = cellElements[0].parentElement.parentElement.firstElementChild.querySelector(`[data-col-id="${cellElements[0].getAttribute("data-col-id")}"]`).getAttribute("data-dtype") as TAVCol; } + if (type === "template") { + return; + } if (type === "block" && (cellElements.length > 1 || !cellElements[0].getAttribute("data-detached"))) { return; } @@ -353,9 +356,7 @@ export const popTextCell = (protyle: IProtyle, cellElements: HTMLElement[], type const blockElement = hasClosestBlock(cellElements[0]); if (["text", "url", "email", "phone", "block"].includes(type)) { html = ``; - } else if (type === "template") { - html = ``; - }else if (type === "number") { + } else if (type === "number") { html = ``; } else if (["select", "mSelect"].includes(type) && blockElement) { openMenuPanel({protyle, blockElement, type: "select", cellElements}); diff --git a/app/src/protyle/render/av/render.ts b/app/src/protyle/render/av/render.ts index 4e4725e12ce..8dd42d65d78 100644 --- a/app/src/protyle/render/av/render.ts +++ b/app/src/protyle/render/av/render.ts @@ -62,10 +62,8 @@ style="width: ${column.width || "200px"}">${getCalcValue(column) || '${cell.value?.text.content || ""}`; - } else if (cell.valueType === "template") { - text = `${cell.value?.template.renderedContent || ""}`; + if (["text", "template"].includes(cell.valueType)) { + text = `${cell.value ? cell.value[cell.valueType as "text"].content : ""}`; } else if (["url", "email", "phone"].includes(cell.valueType)) { const urlContent = cell.value ? cell.value[cell.valueType as "url"].content : ""; // https://github.com/siyuan-note/siyuan/issues/9291 diff --git a/app/src/types/index.d.ts b/app/src/types/index.d.ts index 1d5b5098b33..8abc910f5ff 100644 --- a/app/src/types/index.d.ts +++ b/app/src/types/index.d.ts @@ -1075,7 +1075,6 @@ interface IAVCellValue { } template?: { content: string - renderedContent?:string } date?: IAVCellDateValue }