An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
feat: change database click action (#8937)
zxhd8639434277f21a05d848c
diff --git a/app/src/block/popover.ts b/app/src/block/popover.tsindex a8355f5ee3..5429e513c1 100644--- a/app/src/block/popover.ts+++ b/app/src/block/popover.ts@@ -15,6 +15,7 @@ export const initBlockPopover = (app: App) => {return;}const aElement = hasClosestByAttribute(event.target, "data-type", "a", true) ||+ hasClosestByAttribute(event.target, "data-type", "url") ||hasClosestByAttribute(event.target, "data-type", "tab-header") ||hasClosestByClassName(event.target, "ariaLabel") ||hasClosestByAttribute(event.target, "data-type", "inline-memo");@@ -207,7 +208,9 @@ export const showPopover = async (app: App, showRef = false) => {});ids = postResponse.data;}- } else if (popoverTargetElement.getAttribute("data-type")?.split(" ").includes("a")) {+ } else if (+ popoverTargetElement.getAttribute("data-type")?.split(" ").includes("a") ||+ popoverTargetElement.getAttribute("data-type")?.split(" ").includes("url")) {// 以思源协议开头的链接ids = [getIdFromSYProtocol(popoverTargetElement.getAttribute("data-href"))];} else {diff --git a/app/src/protyle/render/av/action.ts b/app/src/protyle/render/av/action.tsindex 5c85a57080..1f4a9e3171 100644--- a/app/src/protyle/render/av/action.ts+++ b/app/src/protyle/render/av/action.ts@@ -116,13 +116,16 @@ export const avClick = (protyle: IProtyle, event: MouseEvent & { target: HTMLEleconst linkElement = hasClosestByClassName(event.target, "av__celltext--url");if (linkElement) {- let prefix = "";- if (linkElement.dataset.type === "phone") {- prefix = "tel:";- } else if (linkElement.dataset.type === "email") {- prefix = "mailto:";- }- window.open(prefix + linkElement.textContent.trim());+ // let prefix = "";+ // if (linkElement.dataset.type === "phone") {+ // prefix = "tel:";+ // } else if (linkElement.dataset.type === "email") {+ // prefix = "mailto:";+ // }+ // window.open(prefix + linkElement.textContent.trim());++ let linkUrl = linkElement.getAttribute("data-href")+ window.open(linkUrl.trim());event.preventDefault();event.stopPropagation();return true;diff --git a/app/src/protyle/render/av/render.ts b/app/src/protyle/render/av/render.tsindex 941eeece35..f0b2041d24 100644--- a/app/src/protyle/render/av/render.ts+++ b/app/src/protyle/render/av/render.ts@@ -68,8 +68,18 @@ style="width: ${column.width || "200px"}">${getCalcValue(column) || '<svg><use xlet text = "";if (cell.valueType === "text") {text = `<span class="av__celltext">${cell.value?.text.content || ""}</span>`;- } else if (["url", "email", "phone"].includes(cell.valueType)) {- text = `<span class="av__celltext av__celltext--url" data-type="${cell.valueType}">${cell.value ? cell.value[cell.valueType as "url"].content : ""}</span>`;+ } else if (cell.valueType === "url") {+ text = `<span class="av__celltext av__celltext--url" data-type="url" data-href="${cell.value ? cell.value[cell.valueType as "url"].content : ""}">${cell.value ? cell.value[cell.valueType as "url"].content : ""}</span>`;+ if (cell.value && cell.value[cell.valueType as "url"].content) {+ text += `<span data-type="copy" class="b3-tooltips b3-tooltips__n block__icon" aria-label="${window.siyuan.languages.copy}"><svg><use xlink:href="#iconCopy"></use></svg></span>`;+ }+ } else if (cell.valueType === "email") {+ text = `<span class="av__celltext av__celltext--url" data-type="email" data-href="${cell.value ? "mailto:" + cell.value[cell.valueType as "url"].content : ""}">${cell.value ? cell.value[cell.valueType as "url"].content : ""}</span>`;+ if (cell.value && cell.value[cell.valueType as "url"].content) {+ text += `<span data-type="copy" class="b3-tooltips b3-tooltips__n block__icon" aria-label="${window.siyuan.languages.copy}"><svg><use xlink:href="#iconCopy"></use></svg></span>`;+ }+ } else if (cell.valueType === "phone") {+ text = `<span class="av__celltext av__celltext--url" data-type="phone" data-href="${cell.value ? "tel:" + cell.value[cell.valueType as "url"].content : ""}">${cell.value ? cell.value[cell.valueType as "url"].content : ""}</span>`;if (cell.value && cell.value[cell.valueType as "url"].content) {text += `<span data-type="copy" class="b3-tooltips b3-tooltips__n block__icon" aria-label="${window.siyuan.languages.copy}"><svg><use xlink:href="#iconCopy"></use></svg></span>`;}diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.tsindex 7fec60f7fd..754536a9fb 100644--- a/app/src/protyle/wysiwyg/index.ts+++ b/app/src/protyle/wysiwyg/index.ts@@ -1640,7 +1640,8 @@ export class WYSIWYG {const range = getEditorRange(this.element);// 需放在嵌入块之前,否则嵌入块内的引用、链接、pdf 双链无法点击打开 https://ld246.com/article/1630479789513const blockRefElement = hasClosestByAttribute(event.target, "data-type", "block-ref");- const aElement = hasClosestByAttribute(event.target, "data-type", "a");+ let ifaElement = hasClosestByAttribute(event.target, "data-type", "a");+ const aElement = ifaElement ? ifaElement : hasClosestByAttribute(event.target, "data-type", "url")if (blockRefElement ||(aElement && aElement.getAttribute("data-href").startsWith("siyuan://blocks/"))) {