An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:bug: fix https://github.com/siyuan-note/insider/issues/1075
Vanessa9ea365276eee
diff --git a/app/appearance/icons/ant/icon.js b/app/appearance/icons/ant/icon.jsindex f51328db68..7efa2e5471 100644--- a/app/appearance/icons/ant/icon.js+++ b/app/appearance/icons/ant/icon.js@@ -1,7 +1,7 @@document.body.insertAdjacentHTML('afterBegin', `<svg style="position: absolute; width: 0; height: 0; overflow: hidden;" xmlns="http://www.w3.org/2000/svg"><defs><symbol id="iconClear" viewBox="0 0 32 32">- <path d="M9.92 2.88h-0.32c0.176 0 0.32-0.144 0.32-0.32v0.32h12.16v-0.32c0 0.176 0.144 0.32 0.32 0.32h-0.32v2.88h2.88v-3.2c0-1.412-1.148-2.56-2.56-2.56h-12.8c-1.412 0-2.56 1.148-2.56 2.56v3.2h2.88v-2.88zM30.080 5.76h-28.16c-0.708 0-1.28 0.572-1.28 1.28v1.28c0 0.176 0.144 0.32 0.32 0.32h2.416l0.988 20.92c0.064 1.364 1.192 2.44 2.556 2.44h18.16c1.368 0 2.492-1.072 2.556-2.44l0.988-20.92h2.416c0.176 0 0.32-0.144 0.32-0.32v-1.28c0-0.708-0.572-1.28-1.28-1.28zM24.772 29.12h-17.544l-0.968-20.48h19.48l-0.968 20.48z"></path>+ <path d="M31.72 30.522l-2.152-12.41h0.727c0.585 0 1.056-0.471 1.056-1.056v-7.797c0-0.585-0.471-1.056-1.056-1.056h-9.99v-7.391c0-0.585-0.471-1.056-1.056-1.056h-6.497c-0.585 0-1.056 0.471-1.056 1.056v7.391h-9.99c-0.585 0-1.056 0.471-1.056 1.056v7.797c0 0.585 0.471 1.056 1.056 1.056h0.727l-2.152 12.41c-0.010 0.054-0.016 0.117-0.016 0.181 0 0.582 0.472 1.054 1.054 1.054 0 0 0.001 0 0.001 0h29.36c0.061 0 0.122-0.004 0.179-0.016 0.501-0.086 0.877-0.518 0.877-1.036 0-0.064-0.006-0.127-0.017-0.188l0.001 0.006zM3.492 11.046h11.046v-8.447h2.924v8.447h11.046v4.223h-25.015v-4.223zM22.497 28.914v-6.335c0-0.179-0.146-0.325-0.325-0.325h-1.949c-0.179 0-0.325 0.146-0.325 0.325v6.335h-7.797v-6.335c0-0.179-0.146-0.325-0.325-0.325h-1.949c-0.179 0-0.325 0.146-0.325 0.325v6.335h-6.059l1.831-10.558h21.446l1.831 10.558h-6.055z"></path></symbol><symbol id="iconTransform" viewBox="0 0 32 32"><path d="M0.333 17.666h2.649c0.183 0 0.333-0.15 0.333-0.333v-10.635h22.019v3.024c0 0.079 0.025 0.154 0.075 0.217 0.064 0.081 0.162 0.133 0.273 0.133 0.081 0 0.156-0.028 0.215-0.075l-0.001 0.001 5.969-4.686c0.179-0.208 0.15-0.429 0-0.55l-5.969-4.682c-0.058-0.047-0.133-0.075-0.214-0.075-0.001 0-0.002 0-0.003 0h0c-0.192 0-0.35 0.158-0.35 0.35v3.024h-22.344c-1.645 0-2.987 1.341-2.987 2.991v10.964c0 0.183 0.15 0.333 0.333 0.333zM31.658 14.334h-2.649c-0.183 0-0.333 0.15-0.333 0.333v10.635h-22.019v-3.024c0-0.079-0.025-0.154-0.075-0.217-0.064-0.081-0.162-0.133-0.273-0.133-0.081 0-0.156 0.028-0.215 0.075l0.001-0.001-5.969 4.686c-0.179 0.208-0.15 0.429 0 0.55l5.969 4.682c0.062 0.050 0.137 0.075 0.217 0.075 0.192 0 0.35-0.158 0.35-0.35v-3.024h22.352c1.645 0 2.987-1.341 2.987-2.991v-10.964c-0.008-0.183-0.158-0.333-0.342-0.333z"></path>diff --git a/app/appearance/icons/ant/icon.json b/app/appearance/icons/ant/icon.jsonindex 7309d639bf..acfb694a30 100644--- a/app/appearance/icons/ant/icon.json+++ b/app/appearance/icons/ant/icon.json@@ -2,5 +2,5 @@"name": "ant","author": "Vanessa","url": "https://github.com/Vanessa219",- "version": "1.0.7"+ "version": "1.0.8"}diff --git a/app/src/protyle/util/Options.ts b/app/src/protyle/util/Options.tsindex 1cba7bb27e..7bc1ca47d7 100644--- a/app/src/protyle/util/Options.ts+++ b/app/src/protyle/util/Options.ts@@ -80,22 +80,22 @@ export class Options {toolbar: isMobile() ? ["block-ref","a",- "text","|",+ "text","strong","em","u",+ "clear",+ "|","code","tag","inline-memo","inline-math",- "|",- "clear",] : ["block-ref","a",- "text","|",+ "text","strong","em","u",@@ -103,14 +103,13 @@ export class Options {"mark","sup","sub",+ "clear","|","code","kbd","tag","inline-memo","inline-math",- "|",- "clear"],typewriterMode: false,upload: {diff --git a/app/src/protyle/wysiwyg/keydown.ts b/app/src/protyle/wysiwyg/keydown.tsindex 4250f79c2e..6a419feb17 100644--- a/app/src/protyle/wysiwyg/keydown.ts+++ b/app/src/protyle/wysiwyg/keydown.ts@@ -514,47 +514,49 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {if (matchHotKey("⌘/", event)) {event.stopPropagation();event.preventDefault();- const selectElements = protyle.wysiwyg.element.querySelectorAll(".protyle-wysiwyg--select");- if (selectElements.length > 0) {- if (selectElements.length === 1) {- protyle.gutter.renderMenu(protyle, selectElements[0]);- } else {- protyle.gutter.renderMultipleMenu(protyle, Array.from(selectElements));+ const selectElements = Array.from(protyle.wysiwyg.element.querySelectorAll(".protyle-wysiwyg--select"));+ if (selectElements.length === 0) {+ const inlineElement = hasClosestByAttribute(range.startContainer, "data-type", null);+ if (inlineElement) {+ const types = inlineElement.getAttribute("data-type").split(" ");+ if (types.includes("block-ref")) {+ refMenu(protyle, inlineElement);+ return;+ } else if (types.includes("inline-memo")) {+ protyle.toolbar.showRender(protyle, inlineElement);+ return;+ } else if (types.includes("file-annotation-ref")) {+ protyle.toolbar.showFileAnnotationRef(protyle, inlineElement);+ return;+ } else if (types.includes("a")) {+ linkMenu(protyle, inlineElement);+ return;+ }}- const rect = nodeElement.getBoundingClientRect();- window.siyuan.menus.menu.popup({x: rect.left, y: rect.top}, true);- return;- }- const inlineElement = hasClosestByAttribute(range.startContainer, "data-type", null);- if (inlineElement) {- const types = inlineElement.getAttribute("data-type").split(" ");- if (types.includes("block-ref")) {- refMenu(protyle, inlineElement);- return;- } else if (types.includes("inline-memo")) {- protyle.toolbar.showRender(protyle, inlineElement);- return;- } else if (types.includes("file-annotation-ref")) {- protyle.toolbar.showFileAnnotationRef(protyle, inlineElement);- return;- } else if (types.includes("a")) {- linkMenu(protyle, inlineElement);- return;++ // https://github.com/siyuan-note/siyuan/issues/5185+ if (range.startOffset === 0 && range.startContainer.nodeType === 3) {+ const previousSibling = hasPreviousSibling(range.startContainer) as HTMLElement;+ if (previousSibling && previousSibling.nodeType !== 3 && previousSibling.getAttribute("data-type").indexOf("inline-math") > -1) {+ protyle.toolbar.showRender(protyle, previousSibling);+ return;+ } else if (!previousSibling &&+ range.startContainer.parentElement.previousSibling && range.startContainer.parentElement.previousSibling.isSameNode(range.startContainer.parentElement.previousElementSibling) &&+ range.startContainer.parentElement.previousElementSibling.getAttribute("data-type").indexOf("inline-math") > -1) {+ protyle.toolbar.showRender(protyle, range.startContainer.parentElement.previousElementSibling);+ return;+ }}++ selectElements.push(nodeElement);}- // https://github.com/siyuan-note/siyuan/issues/5185- if (range.startOffset === 0 && range.startContainer.nodeType === 3) {- const previousSibling = hasPreviousSibling(range.startContainer) as HTMLElement;- if (previousSibling && previousSibling.nodeType !== 3 && previousSibling.getAttribute("data-type").indexOf("inline-math") > -1) {- protyle.toolbar.showRender(protyle, previousSibling);- return;- } else if (!previousSibling &&- range.startContainer.parentElement.previousSibling && range.startContainer.parentElement.previousSibling.isSameNode(range.startContainer.parentElement.previousElementSibling) &&- range.startContainer.parentElement.previousElementSibling.getAttribute("data-type").indexOf("inline-math") > -1) {- protyle.toolbar.showRender(protyle, range.startContainer.parentElement.previousElementSibling);- return;- }+ if (selectElements.length === 1) {+ protyle.gutter.renderMenu(protyle, selectElements[0]);+ } else {+ protyle.gutter.renderMultipleMenu(protyle, selectElements);}+ const rect = nodeElement.getBoundingClientRect();+ window.siyuan.menus.menu.popup({x: rect.left, y: rect.top}, true);return;}