An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:sparkles: Support default connector styles for new mind maps https://github.com/siyuan-note/siyuan/issues/20631
Daniel24cad5bc1fbd
diff --git a/app/appearance/langs/ar.json b/app/appearance/langs/ar.jsonindex 9ec2a7ac05..d324dfa014 100644--- a/app/appearance/langs/ar.json+++ b/app/appearance/langs/ar.json@@ -1,4 +1,6 @@{+ "listMindmapConnectors": "خطوط التوصيل",+ "listMindmapDefaultConnectorStyle": "نمط التوصيل الافتراضي للخرائط الجديدة","listMindmapConnectorStyle": "نمط خطوط الربط","listMindmapConnectorSpline": "تفرع منحني","listMindmapConnectorOrthogonal": "زوايا قائمة",diff --git a/app/appearance/langs/de.json b/app/appearance/langs/de.jsonindex a7b5ac6eef..a0ff45c79d 100644--- a/app/appearance/langs/de.json+++ b/app/appearance/langs/de.json@@ -1,4 +1,6 @@{+ "listMindmapConnectors": "Verbindungslinien",+ "listMindmapDefaultConnectorStyle": "Standard-Verbindungsstil für neue Mindmaps","listMindmapConnectorStyle": "Linienstil","listMindmapConnectorSpline": "Verzweigte Kurve","listMindmapConnectorOrthogonal": "Rechtwinklig",diff --git a/app/appearance/langs/en.json b/app/appearance/langs/en.jsonindex 99d83488e1..fe36a6a17c 100644--- a/app/appearance/langs/en.json+++ b/app/appearance/langs/en.json@@ -1,4 +1,6 @@{+ "listMindmapConnectors": "Connectors",+ "listMindmapDefaultConnectorStyle": "Default connector style for new maps","listMindmapConnectorStyle": "Connector style","listMindmapConnectorSpline": "Curved fork","listMindmapConnectorOrthogonal": "Orthogonal",diff --git a/app/appearance/langs/es.json b/app/appearance/langs/es.jsonindex e8bfac00c7..e433463677 100644--- a/app/appearance/langs/es.json+++ b/app/appearance/langs/es.json@@ -1,4 +1,6 @@{+ "listMindmapConnectors": "Conectores",+ "listMindmapDefaultConnectorStyle": "Estilo de conexión predeterminado para mapas nuevos","listMindmapConnectorStyle": "Estilo de conexión","listMindmapConnectorSpline": "Bifurcación curva","listMindmapConnectorOrthogonal": "Ortogonal",diff --git a/app/appearance/langs/fr.json b/app/appearance/langs/fr.jsonindex dd32542faf..9bd398d4bf 100644--- a/app/appearance/langs/fr.json+++ b/app/appearance/langs/fr.json@@ -1,4 +1,6 @@{+ "listMindmapConnectors": "Connecteurs",+ "listMindmapDefaultConnectorStyle": "Style de connexion par défaut des nouvelles cartes","listMindmapConnectorStyle": "Style des connexions","listMindmapConnectorSpline": "Bifurcation courbe","listMindmapConnectorOrthogonal": "Orthogonal",diff --git a/app/appearance/langs/he.json b/app/appearance/langs/he.jsonindex 2575b54607..0f04be1ff7 100644--- a/app/appearance/langs/he.json+++ b/app/appearance/langs/he.json@@ -1,4 +1,6 @@{+ "listMindmapConnectors": "קווי חיבור",+ "listMindmapDefaultConnectorStyle": "סגנון חיבור ברירת מחדל למפות חדשות","listMindmapConnectorStyle": "סגנון קווי חיבור","listMindmapConnectorSpline": "הסתעפות מעוקלת","listMindmapConnectorOrthogonal": "זוויות ישרות",diff --git a/app/appearance/langs/hi.json b/app/appearance/langs/hi.jsonindex 01e6dcf1d7..72b3c67c46 100644--- a/app/appearance/langs/hi.json+++ b/app/appearance/langs/hi.json@@ -1,4 +1,6 @@{+ "listMindmapConnectors": "कनेक्टर",+ "listMindmapDefaultConnectorStyle": "नए मानचित्रों के लिए डिफ़ॉल्ट कनेक्टर शैली","listMindmapConnectorStyle": "जोड़ने वाली रेखा की शैली","listMindmapConnectorSpline": "वक्र शाखाएँ","listMindmapConnectorOrthogonal": "समकोण",diff --git a/app/appearance/langs/id.json b/app/appearance/langs/id.jsonindex a2aaae09ea..549b9c12b2 100644--- a/app/appearance/langs/id.json+++ b/app/appearance/langs/id.json@@ -1,4 +1,6 @@{+ "listMindmapConnectors": "Penghubung",+ "listMindmapDefaultConnectorStyle": "Gaya penghubung bawaan untuk peta baru","listMindmapConnectorStyle": "Gaya garis penghubung","listMindmapConnectorSpline": "Cabang melengkung","listMindmapConnectorOrthogonal": "Siku-siku",diff --git a/app/appearance/langs/it.json b/app/appearance/langs/it.jsonindex 8780affb30..46c4dbceca 100644--- a/app/appearance/langs/it.json+++ b/app/appearance/langs/it.json@@ -1,4 +1,6 @@{+ "listMindmapConnectors": "Collegamenti",+ "listMindmapDefaultConnectorStyle": "Stile dei collegamenti predefinito per le nuove mappe","listMindmapConnectorStyle": "Stile dei collegamenti","listMindmapConnectorSpline": "Diramazione curva","listMindmapConnectorOrthogonal": "Ortogonale",diff --git a/app/appearance/langs/ja.json b/app/appearance/langs/ja.jsonindex 3d3ed5a478..eb8947ae6b 100644--- a/app/appearance/langs/ja.json+++ b/app/appearance/langs/ja.json@@ -1,4 +1,6 @@{+ "listMindmapConnectors": "接続線",+ "listMindmapDefaultConnectorStyle": "新規マップの既定の接続線スタイル","listMindmapConnectorStyle": "接続線のスタイル","listMindmapConnectorSpline": "分岐曲線","listMindmapConnectorOrthogonal": "直角線",diff --git a/app/appearance/langs/ko.json b/app/appearance/langs/ko.jsonindex eb0ba69b6d..6f47111a2e 100644--- a/app/appearance/langs/ko.json+++ b/app/appearance/langs/ko.json@@ -1,4 +1,6 @@{+ "listMindmapConnectors": "연결선",+ "listMindmapDefaultConnectorStyle": "새 지도의 기본 연결선 스타일","listMindmapConnectorStyle": "연결선 스타일","listMindmapConnectorSpline": "곡선 분기","listMindmapConnectorOrthogonal": "직각선",diff --git a/app/appearance/langs/nl.json b/app/appearance/langs/nl.jsonindex 5dd36c3acc..ac4f5c79f8 100644--- a/app/appearance/langs/nl.json+++ b/app/appearance/langs/nl.json@@ -1,4 +1,6 @@{+ "listMindmapConnectors": "Verbindingslijnen",+ "listMindmapDefaultConnectorStyle": "Standaard verbindingsstijl voor nieuwe mindmaps","listMindmapConnectorStyle": "Verbindingsstijl","listMindmapConnectorSpline": "Gebogen vertakking","listMindmapConnectorOrthogonal": "Rechthoekig",diff --git a/app/appearance/langs/pl.json b/app/appearance/langs/pl.jsonindex c9e900b162..0f98320550 100644--- a/app/appearance/langs/pl.json+++ b/app/appearance/langs/pl.json@@ -1,4 +1,6 @@{+ "listMindmapConnectors": "Łączniki",+ "listMindmapDefaultConnectorStyle": "Domyślny styl połączeń nowych map","listMindmapConnectorStyle": "Styl połączeń","listMindmapConnectorSpline": "Zakrzywione rozwidlenie","listMindmapConnectorOrthogonal": "Prostokątny",diff --git a/app/appearance/langs/pt-BR.json b/app/appearance/langs/pt-BR.jsonindex 97b2bc27a5..5f76462683 100644--- a/app/appearance/langs/pt-BR.json+++ b/app/appearance/langs/pt-BR.json@@ -1,4 +1,6 @@{+ "listMindmapConnectors": "Conectores",+ "listMindmapDefaultConnectorStyle": "Estilo de conexão padrão para novos mapas","listMindmapConnectorStyle": "Estilo das conexões","listMindmapConnectorSpline": "Ramificação curva","listMindmapConnectorOrthogonal": "Ortogonal",diff --git a/app/appearance/langs/ru.json b/app/appearance/langs/ru.jsonindex fc742f02f3..2930d3be3e 100644--- a/app/appearance/langs/ru.json+++ b/app/appearance/langs/ru.json@@ -1,4 +1,6 @@{+ "listMindmapConnectors": "Соединительные линии",+ "listMindmapDefaultConnectorStyle": "Стиль соединений по умолчанию для новых карт","listMindmapConnectorStyle": "Стиль соединительных линий","listMindmapConnectorSpline": "Изогнутая развилка","listMindmapConnectorOrthogonal": "Прямоугольный",diff --git a/app/appearance/langs/sk.json b/app/appearance/langs/sk.jsonindex c011b4b6df..678620caa4 100644--- a/app/appearance/langs/sk.json+++ b/app/appearance/langs/sk.json@@ -1,4 +1,6 @@{+ "listMindmapConnectors": "Spojnice",+ "listMindmapDefaultConnectorStyle": "Predvolený štýl spojníc pre nové mapy","listMindmapConnectorStyle": "Štýl spojníc","listMindmapConnectorSpline": "Zakrivené vetvenie","listMindmapConnectorOrthogonal": "Pravouhlý",diff --git a/app/appearance/langs/sr.json b/app/appearance/langs/sr.jsonindex 289effe222..1387d1fd00 100644--- a/app/appearance/langs/sr.json+++ b/app/appearance/langs/sr.json@@ -1,4 +1,6 @@{+ "listMindmapConnectors": "Линије повезивања",+ "listMindmapDefaultConnectorStyle": "Подразумевани стил веза за нове мапе","listMindmapConnectorStyle": "Стил спојних линија","listMindmapConnectorSpline": "Закривљено гранање","listMindmapConnectorOrthogonal": "Правоугаони",diff --git a/app/appearance/langs/th.json b/app/appearance/langs/th.jsonindex c39dc55a85..489b61b3ed 100644--- a/app/appearance/langs/th.json+++ b/app/appearance/langs/th.json@@ -1,4 +1,6 @@{+ "listMindmapConnectors": "เส้นเชื่อม",+ "listMindmapDefaultConnectorStyle": "รูปแบบเส้นเชื่อมเริ่มต้นสำหรับแผนผังใหม่","listMindmapConnectorStyle": "รูปแบบเส้นเชื่อม","listMindmapConnectorSpline": "เส้นโค้งแตกแขนง","listMindmapConnectorOrthogonal": "เส้นหักมุมฉาก",diff --git a/app/appearance/langs/tr.json b/app/appearance/langs/tr.jsonindex 836b483088..7bd9cd1f31 100644--- a/app/appearance/langs/tr.json+++ b/app/appearance/langs/tr.json@@ -1,4 +1,6 @@{+ "listMindmapConnectors": "Bağlantı çizgileri",+ "listMindmapDefaultConnectorStyle": "Yeni haritalar için varsayılan bağlantı stili","listMindmapConnectorStyle": "Bağlantı çizgisi stili","listMindmapConnectorSpline": "Eğri dallanma","listMindmapConnectorOrthogonal": "Dik açılı",diff --git a/app/appearance/langs/uk.json b/app/appearance/langs/uk.jsonindex 8f63126836..feb0346eba 100644--- a/app/appearance/langs/uk.json+++ b/app/appearance/langs/uk.json@@ -1,4 +1,6 @@{+ "listMindmapConnectors": "З’єднувальні лінії",+ "listMindmapDefaultConnectorStyle": "Типовий стиль з’єднань для нових карт","listMindmapConnectorStyle": "Стиль сполучних ліній","listMindmapConnectorSpline": "Вигнуте розгалуження","listMindmapConnectorOrthogonal": "Прямокутний",diff --git a/app/appearance/langs/zh-CN.json b/app/appearance/langs/zh-CN.jsonindex cf76cccacc..5927d344a8 100644--- a/app/appearance/langs/zh-CN.json+++ b/app/appearance/langs/zh-CN.json@@ -1,4 +1,6 @@{+ "listMindmapConnectors": "连线",+ "listMindmapDefaultConnectorStyle": "新建默认连线样式","listMindmapConnectorStyle": "连线样式","listMindmapConnectorSpline": "曲线分叉","listMindmapConnectorOrthogonal": "正交折线",diff --git a/app/appearance/langs/zh-TW.json b/app/appearance/langs/zh-TW.jsonindex 3959eadd2c..3c2dacbe3c 100644--- a/app/appearance/langs/zh-TW.json+++ b/app/appearance/langs/zh-TW.json@@ -1,4 +1,6 @@{+ "listMindmapConnectors": "連線",+ "listMindmapDefaultConnectorStyle": "新建預設連線樣式","listMindmapConnectorStyle": "連線樣式","listMindmapConnectorSpline": "曲線分岔","listMindmapConnectorOrthogonal": "直角折線",diff --git a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-h361q1i/20200924093441-ft2rhps.sy b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-h361q1i/20200924093441-ft2rhps.syindex 16763c9ecd..61aa834d5d 100644--- a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-h361q1i/20200924093441-ft2rhps.sy+++ b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-h361q1i/20200924093441-ft2rhps.sy@@ -8,7 +8,7 @@"title": "Formatting elements","title-img": "background-color:#269;background-image: linear-gradient(white 2px, transparent 2px),linear-gradient(90deg, white 2px, transparent 2px),linear-gradient(rgba(255,255,255,.3) 1px, transparent 1px),linear-gradient(90deg, rgba(255,255,255,.3) 1px, transparent 1px);background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px;background-position:-2px -2px, -2px -2px, -1px -1px, -1px -1px;","type": "doc",- "updated": "20261017110432"+ "updated": "20261017113835"},"Children": [{@@ -1961,7 +1961,7 @@"HeadingLevel": 2,"Properties": {"id": "20210104091509-v1x69oc",- "updated": "20261017110432"+ "updated": "20261017113835"},"Children": [{@@ -2014,7 +2014,7 @@"Type": "NodeParagraph","Properties": {"id": "20261017110432-mq248cg",- "updated": "20261017110432"+ "updated": "20261017113835"},"Children": [{@@ -2024,7 +2024,7 @@{"Type": "NodeTextMark","TextMarkType": "kbd",- "TextMarkTextContent": "Settings"+ "TextMarkTextContent": "Connectors"},{"Type": "NodeText",@@ -2041,6 +2041,38 @@}]},+ {+ "ID": "20261017113512-rxzvh9f",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20261017113512-rxzvh9f",+ "updated": "20261017113835"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "In "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "kbd",+ "TextMarkTextContent": "Connectors"+ },+ {+ "Type": "NodeText",+ "Data": " - "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "kbd",+ "TextMarkTextContent": "Default connector style for new maps"+ },+ {+ "Type": "NodeText",+ "Data": " you can choose the style used when creating a map or converting a list or tabs to a map for the first time. This preference is saved locally in the current workspace and is not included in cloud sync. Changing it does not affect existing maps. Copies, imports, and maps converted to lists or tabs and back retain their original style."+ }+ ]+ },{"ID": "20261003225941-mxlfdrn","Type": "NodeParagraph",diff --git a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180320-abz7w6k/20200825162036-4dx365o.sy b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180320-abz7w6k/20200825162036-4dx365o.syindex fbc485db88..59fa18bcfa 100644--- a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180320-abz7w6k/20200825162036-4dx365o.sy+++ b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180320-abz7w6k/20200825162036-4dx365o.sy@@ -8,7 +8,7 @@"title": "排版元素","title-img": "background-color: hsl(2, 57%, 40%);background-image: repeating-linear-gradient(transparent, transparent 50px, rgba(0,0,0,.4) 50px, rgba(0,0,0,.4) 53px, transparent 53px, transparent 63px, rgba(0,0,0,.4) 63px, rgba(0,0,0,.4) 66px, transparent 66px, transparent 116px, rgba(0,0,0,.5) 116px, rgba(0,0,0,.5) 166px, rgba(255,255,255,.2) 166px, rgba(255,255,255,.2) 169px, rgba(0,0,0,.5) 169px, rgba(0,0,0,.5) 179px, rgba(255,255,255,.2) 179px, rgba(255,255,255,.2) 182px, rgba(0,0,0,.5) 182px, rgba(0,0,0,.5) 232px, transparent 232px),repeating-linear-gradient(270deg, transparent, transparent 50px, rgba(0,0,0,.4) 50px, rgba(0,0,0,.4) 53px, transparent 53px, transparent 63px, rgba(0,0,0,.4) 63px, rgba(0,0,0,.4) 66px, transparent 66px, transparent 116px, rgba(0,0,0,.5) 116px, rgba(0,0,0,.5) 166px, rgba(255,255,255,.2) 166px, rgba(255,255,255,.2) 169px, rgba(0,0,0,.5) 169px, rgba(0,0,0,.5) 179px, rgba(255,255,255,.2) 179px, rgba(255,255,255,.2) 182px, rgba(0,0,0,.5) 182px, rgba(0,0,0,.5) 232px, transparent 232px),repeating-linear-gradient(125deg, transparent, transparent 2px, rgba(0,0,0,.2) 2px, rgba(0,0,0,.2) 3px, transparent 3px, transparent 5px, rgba(0,0,0,.2) 5px);","type": "doc",- "updated": "20261017110432"+ "updated": "20261017113835"},"Children": [{@@ -1964,7 +1964,7 @@"HeadingLevel": 2,"Properties": {"id": "20210104091228-wdpx6ev",- "updated": "20261017110432"+ "updated": "20261017113835"},"Children": [{@@ -2017,7 +2017,7 @@"Type": "NodeParagraph","Properties": {"id": "20261017110432-6mghas7",- "updated": "20261017110432"+ "updated": "20261017113835"},"Children": [{@@ -2027,7 +2027,7 @@{"Type": "NodeTextMark","TextMarkType": "kbd",- "TextMarkTextContent": "设置"+ "TextMarkTextContent": "连线"},{"Type": "NodeText",@@ -2044,6 +2044,38 @@}]},+ {+ "ID": "20261017113512-kojg0bw",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20261017113512-kojg0bw",+ "updated": "20261017113835"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "在 "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "kbd",+ "TextMarkTextContent": "连线"+ },+ {+ "Type": "NodeText",+ "Data": " - "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "kbd",+ "TextMarkTextContent": "新建默认连线样式"+ },+ {+ "Type": "NodeText",+ "Data": " 中选择新建导图的连线样式,也适用于首次将列表或页签转换为导图。此偏好保存在当前工作空间的本地配置中,不参与云同步。修改它不会改变已有导图;复制、导入及列表或页签往返转换保留原样式。"+ }+ ]+ },{"ID": "20261003225941-hge6x3e","Type": "NodeParagraph",diff --git a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226120854-dr1jfx2/20211226121319-emrk2yy.sy b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226120854-dr1jfx2/20211226121319-emrk2yy.syindex 6341502688..18117ccdd7 100644--- a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226120854-dr1jfx2/20211226121319-emrk2yy.sy+++ b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226120854-dr1jfx2/20211226121319-emrk2yy.sy@@ -8,7 +8,7 @@"title": "排版元素","title-img": "background-color: hsl(2, 57%, 40%);background-image: repeating-linear-gradient(transparent, transparent 50px, rgba(0,0,0,.4) 50px, rgba(0,0,0,.4) 53px, transparent 53px, transparent 63px, rgba(0,0,0,.4) 63px, rgba(0,0,0,.4) 66px, transparent 66px, transparent 116px, rgba(0,0,0,.5) 116px, rgba(0,0,0,.5) 166px, rgba(255,255,255,.2) 166px, rgba(255,255,255,.2) 169px, rgba(0,0,0,.5) 169px, rgba(0,0,0,.5) 179px, rgba(255,255,255,.2) 179px, rgba(255,255,255,.2) 182px, rgba(0,0,0,.5) 182px, rgba(0,0,0,.5) 232px, transparent 232px),repeating-linear-gradient(270deg, transparent, transparent 50px, rgba(0,0,0,.4) 50px, rgba(0,0,0,.4) 53px, transparent 53px, transparent 63px, rgba(0,0,0,.4) 63px, rgba(0,0,0,.4) 66px, transparent 66px, transparent 116px, rgba(0,0,0,.5) 116px, rgba(0,0,0,.5) 166px, rgba(255,255,255,.2) 166px, rgba(255,255,255,.2) 169px, rgba(0,0,0,.5) 169px, rgba(0,0,0,.5) 179px, rgba(255,255,255,.2) 179px, rgba(255,255,255,.2) 182px, rgba(0,0,0,.5) 182px, rgba(0,0,0,.5) 232px, transparent 232px),repeating-linear-gradient(125deg, transparent, transparent 2px, rgba(0,0,0,.2) 2px, rgba(0,0,0,.2) 3px, transparent 3px, transparent 5px, rgba(0,0,0,.2) 5px);","type": "doc",- "updated": "20261017110432"+ "updated": "20261017113835"},"Children": [{@@ -1962,7 +1962,7 @@"HeadingLevel": 2,"Properties": {"id": "20211226122008-731sqd6",- "updated": "20261017110432"+ "updated": "20261017113835"},"Children": [{@@ -2015,7 +2015,7 @@"Type": "NodeParagraph","Properties": {"id": "20261017110432-qnsdugf",- "updated": "20261017110432"+ "updated": "20261017113835"},"Children": [{@@ -2025,7 +2025,7 @@{"Type": "NodeTextMark","TextMarkType": "kbd",- "TextMarkTextContent": "設定"+ "TextMarkTextContent": "連線"},{"Type": "NodeText",@@ -2042,6 +2042,38 @@}]},+ {+ "ID": "20261017113512-z8j1a4z",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20261017113512-z8j1a4z",+ "updated": "20261017113835"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "在 "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "kbd",+ "TextMarkTextContent": "連線"+ },+ {+ "Type": "NodeText",+ "Data": " - "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "kbd",+ "TextMarkTextContent": "新建預設連線樣式"+ },+ {+ "Type": "NodeText",+ "Data": " 中選擇新建心智圖的連線樣式,也適用於首次將清單或頁籤轉換為心智圖。此偏好儲存在目前工作空間的本機設定中,不參與雲端同步。修改它不會改變既有心智圖;複製、匯入及清單或頁籤往返轉換保留原樣式。"+ }+ ]+ },{"ID": "20261003225941-6yr63oi","Type": "NodeParagraph",diff --git a/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-hnu6o79/20240530101000-3qhz7br.sy b/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-hnu6o79/20240530101000-3qhz7br.syindex c097a38449..109e3da927 100644--- a/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-hnu6o79/20240530101000-3qhz7br.sy+++ b/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-hnu6o79/20240530101000-3qhz7br.sy@@ -9,7 +9,7 @@"title": "書式要素","title-img": "background-color:#269;background-image: linear-gradient(white 2px, transparent 2px),linear-gradient(90deg, white 2px, transparent 2px),linear-gradient(rgba(255,255,255,.3) 1px, transparent 1px),linear-gradient(90deg, rgba(255,255,255,.3) 1px, transparent 1px);background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px;background-position:-2px -2px, -2px -2px, -1px -1px, -1px -1px;","type": "doc",- "updated": "20261017110432"+ "updated": "20261017113835"},"Children": [{@@ -2090,7 +2090,7 @@"Properties": {"ID": "20240530101000-ch5e4vh","id": "20240530101000-1ev7xub",- "updated": "20261017110432"+ "updated": "20261017113835"},"Children": [{@@ -2143,7 +2143,7 @@"Type": "NodeParagraph","Properties": {"id": "20261017110432-562ro9u",- "updated": "20261017110432"+ "updated": "20261017113835"},"Children": [{@@ -2153,7 +2153,7 @@{"Type": "NodeTextMark","TextMarkType": "kbd",- "TextMarkTextContent": "設定"+ "TextMarkTextContent": "接続線"},{"Type": "NodeText",@@ -2170,6 +2170,34 @@}]},+ {+ "ID": "20261017113512-geqkoea",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20261017113512-geqkoea",+ "updated": "20261017113835"+ },+ "Children": [+ {+ "Type": "NodeTextMark",+ "TextMarkType": "kbd",+ "TextMarkTextContent": "接続線"+ },+ {+ "Type": "NodeText",+ "Data": " - "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "kbd",+ "TextMarkTextContent": "新規マップの既定の接続線スタイル"+ },+ {+ "Type": "NodeText",+ "Data": " で、新規マップやリスト・タブから初めて変換するマップの接続線スタイルを選択できます。この設定は現在のワークスペースのローカル設定に保存され、クラウド同期には含まれません。変更しても既存のマップには影響しません。コピー、インポート、リストやタブとの往復変換では元のスタイルが保持されます。"+ }+ ]+ },{"ID": "20261003225941-37evcb1","Type": "NodeParagraph",diff --git a/app/src/protyle/render/listMindmap/connectorMenu.test.ts b/app/src/protyle/render/listMindmap/connectorMenu.test.tsindex 7d4cee6428..675da9c06b 100644--- a/app/src/protyle/render/listMindmap/connectorMenu.test.ts+++ b/app/src/protyle/render/listMindmap/connectorMenu.test.ts@@ -33,12 +33,17 @@ test("desktop and mobile connector menus persist one undoable change and preservconst transactions: {before: string, after: string}[] = [];let editable = true;let item: IMenu;+ let defaultItem: IMenu;+ let defaultStyle = "bezier";+ const defaults: string[] = [];const placements: unknown[] = [];const anchor = {getBoundingClientRect: () => ({left: 20, bottom: 100, height: 24})};const context: any = {owner: {}, list,canEdit: () => editable,getListMindmapConnectorMenuItem,+ getDefaultListMindmapConnectorStyle: () => defaultStyle,+ setDefaultListMindmapConnectorStyle: (style: string) => { defaultStyle = style; defaults.push(style); },getListMindmapSiblingIDs: () => new Map(),normalizeListMindmapSummaryMetadata: () => {},readListMindmap: () => ({root: {id: "root"}, metadata: JSON.parse(JSON.stringify(data)),@@ -54,7 +59,10 @@ test("desktop and mobile connector menus persist one undoable change and preservbuild(undefined, {show: (open: () => void) => open()});},Menu: class {- addItem(value: IMenu) { item = value; }+ addItem(value: IMenu) {+ if (value.id === "defaultConnectorStyle") { defaultItem = value; }+ else { item = value; }+ }open(position: unknown) { placements.push(position); }fullscreen(position: unknown) { placements.push(position); }},@@ -67,6 +75,13 @@ test("desktop and mobile connector menus persist one undoable change and preservtarget.onSettingsMenu(anchor);assert.equal((item.submenu as IMenu[]).find(entry => entry.checked).id, "bezier");assert.deepEqual(JSON.parse(JSON.stringify(placements)), [mobile ? "bottom" : {x: 20, y: 100, h: 24}]);+ (defaultItem.submenu as IMenu[]).find(entry => entry.id === "rounded").click(undefined, undefined);+ assert.deepEqual(defaults, ["rounded"]);+ assert.equal(transactions.length, 0, "changing the preference must not enter document undo history");+ assert.equal(JSON.stringify(data), original, "changing the preference must not restyle the current map");+ target.onSettingsMenu(anchor);+ assert.equal((defaultItem.submenu as IMenu[]).find(entry => entry.checked).id, "rounded");+ assert.equal((item.submenu as IMenu[]).find(entry => entry.checked).id, "bezier");choose("orthogonal");assert.equal(transactions.length, 1);assert.equal(transactions[0].before, original);@@ -93,6 +108,8 @@ test("desktop and mobile connector menus persist one undoable change and preservconst count = transactions.length;editable = false;choose("spline");+ (defaultItem.submenu as IMenu[]).find(entry => entry.id === "spline").click(undefined, undefined);+ assert.deepEqual(defaults, ["rounded"], "a stale menu cannot change preferences after editing is disabled");assert.equal(transactions.length, count, "an already open menu cannot edit a newly read-only map");}});diff --git a/app/src/protyle/render/listMindmap/connectorMenu.ts b/app/src/protyle/render/listMindmap/connectorMenu.tsindex 7c8d5bd49a..b2cce18306 100644--- a/app/src/protyle/render/listMindmap/connectorMenu.ts+++ b/app/src/protyle/render/listMindmap/connectorMenu.ts@@ -3,7 +3,7 @@ import type {ListMindmapConnectorStyle} from "./connectors";export const getListMindmapConnectorMenuItem = (current: ListMindmapConnectorStyle,select: (style: ListMindmapConnectorStyle) => void,- labels: Record<string, string>): IMenu => {+ labels: Record<string, string>, scope: "current" | "default" = "current"): IMenu => {const names = {spline: labels.listMindmapConnectorSpline,orthogonal: labels.listMindmapConnectorOrthogonal,@@ -11,7 +11,8 @@ export const getListMindmapConnectorMenuItem = (current: ListMindmapConnectorStyrounded: labels.listMindmapConnectorRounded,};return {- id: "connectorStyle", icon: "iconLine", label: labels.listMindmapConnectorStyle,+ id: scope === "default" ? "defaultConnectorStyle" : "connectorStyle", iconHTML: "",+ label: scope === "default" ? labels.listMindmapDefaultConnectorStyle : labels.listMindmapConnectorStyle,submenu: LIST_MINDMAP_CONNECTOR_STYLES.map(style => ({id: style, iconHTML: "", label: names[style], checked: current === style,click: () => select(style),diff --git a/app/src/protyle/render/listMindmap/create.ts b/app/src/protyle/render/listMindmap/create.tsindex 05e2dc5481..b3f1cd0656 100644--- a/app/src/protyle/render/listMindmap/create.ts+++ b/app/src/protyle/render/listMindmap/create.ts@@ -1,3 +1,6 @@+import {initializeListMindmapConnectorStyle, retagMindmapBranch} from "./model";+import {getDefaultListMindmapConnectorStyle} from "./preferences";+// 隐藏列表正文前交接选区,后续按键交由脑图处理。export const focusListMindmap = (list: HTMLElement, host: HTMLElement): Range | undefined => {const selection = window.getSelection();@@ -21,8 +24,8 @@ export const spinListMindmapDOM = (lute: Lute, html: string) => {template.innerHTML = lute.SpinBlockDOM(html);const list = template.content.firstElementChild;if (list?.getAttribute("data-type") === "NodeList") {+ initializeListMindmapConnectorStyle(list, getDefaultListMindmapConnectorStyle());retagMindmapBranch(list, true);}return template.innerHTML;};-import {retagMindmapBranch} from "./model";diff --git a/app/src/protyle/render/listMindmap/index.ts b/app/src/protyle/render/listMindmap/index.tsindex 545a2a05d9..859c258034 100644--- a/app/src/protyle/render/listMindmap/index.ts+++ b/app/src/protyle/render/listMindmap/index.ts@@ -32,7 +32,7 @@ import {addListMindmapNode, cleanListMindmapHTML, deleteListMindmapNode,moveListMindmapNode, readListMindmap, replaceListMindmapContent,writeListMindmapMetadata, getListMindmapTabItem, retagMindmapBranch, normalizeListMindmapSummaryMetadata,- convertListMindmapToList, hasListMindmapRootTitle, clearListMindmapHeight,+ convertListMindmapToList, hasListMindmapRootTitle, clearListMindmapHeight, initializeListMindmapConnectorStyle,} from "./model";import {prepareListMindmapConversion} from "./conversion";import type {ListMindmapMetadata, ListMindmapModel} from "./model";@@ -55,6 +55,7 @@ import {highlightRender} from "../highlightRender";import {avRender} from "../av/render";import {blockRender} from "../blockRender";import {getListMindmapConnectorMenuItem} from "./connectorMenu";+import {getDefaultListMindmapConnectorStyle, setDefaultListMindmapConnectorStyle} from "./preferences";const roots = new WeakMap<IProtyle, {refresh: () => void, mountNew: (list: HTMLElement) => void,restoreFocus: (listID: string, candidateIDs: string[], selection?: Record<string, string>, source?: HTMLElement) => void, focusRevision: number,@@ -108,6 +109,9 @@ export const toggleListMindmap = async (owner: IProtyle, list: HTMLElement) => {if (list.dataset.type === "NodeMindmap" || list.getAttribute(Constants.CUSTOM_SY_LIST_MINDMAP) == null) {const before = cleanListMindmapHTML(list.outerHTML);const toMindmap = list.dataset.type === "NodeList";+ if (toMindmap) {+ initializeListMindmapConnectorStyle(list, getDefaultListMindmapConnectorStyle());+ }retagMindmapBranch(list, toMindmap);if (!toMindmap) {list.removeAttribute(Constants.CUSTOM_SY_LIST_MINDMAP);@@ -130,12 +134,19 @@ export const toggleListMindmap = async (owner: IProtyle, list: HTMLElement) => {}hideElements(["gutter", "toolbar", "hint"], owner);const previousStyle = list.getAttribute("style") || "";+ const previousMetadata = list.getAttribute(Constants.CUSTOM_SY_LIST_MINDMAP_DATA) || "";if (!next) {+ initializeListMindmapConnectorStyle(list, "bezier");clearListMindmapHeight(list);}const nextStyle = list.getAttribute("style") || "";const doAttrs: Record<string, string> = {[Constants.CUSTOM_SY_LIST_MINDMAP]: next};const undoAttrs: Record<string, string> = {[Constants.CUSTOM_SY_LIST_MINDMAP]: previous};+ const nextMetadata = list.getAttribute(Constants.CUSTOM_SY_LIST_MINDMAP_DATA) || "";+ if (nextMetadata !== previousMetadata) {+ doAttrs[Constants.CUSTOM_SY_LIST_MINDMAP_DATA] = nextMetadata;+ undoAttrs[Constants.CUSTOM_SY_LIST_MINDMAP_DATA] = previousMetadata;+ }if (nextStyle !== previousStyle) {doAttrs.style = nextStyle;undoAttrs.style = previousStyle;@@ -249,6 +260,11 @@ class ListMindmapController {}});}, window.siyuan.languages));+ menu.addItem(getListMindmapConnectorMenuItem(getDefaultListMindmapConnectorStyle(), style => {+ if (canEdit(owner, list)) {+ setDefaultListMindmapConnectorStyle(style);+ }+ }, window.siyuan.languages, "default"));if (isMobile()) {session.show(() => menu.fullscreen("bottom"));} else {diff --git a/app/src/protyle/render/listMindmap/model.test.ts b/app/src/protyle/render/listMindmap/model.test.tsindex ccd53dd77f..aef7f4e811 100644--- a/app/src/protyle/render/listMindmap/model.test.ts+++ b/app/src/protyle/render/listMindmap/model.test.ts@@ -220,6 +220,7 @@ const browserCases = async (sourceCode: string, css: string, taskSource: string,"getListMindmapSiblingIDs, normalizeListMindmapSummaryMetadata, getListMindmapSummaryRange, getListMindmapSiblingFoldStates, " +"addListMindmapSummaryRanges, getListMindmapSummarySnapshot, " +"normalizeLegacyMindmapCodes, replaceLegacyMindmapHTML, spinListMindmapDOM, focusListMindmap, " ++ "initializeListMindmapConnectorStyle, LIST_MINDMAP_DEFAULT_CONNECTOR_STYLE_KEY, " +"tabsRender, destroyTabsRender, getTabTask, getListMindmapTabItem, convertTabsList, ListMindmapView, registerListMindmapView, resolveVisibleListMindmapBlock, getListMindmapElements, registerListMindmapRoot, restoreListMindmapFocus};")(async (element: Element) => {const formulas = element.querySelectorAll('[data-subtype="math"]:not([data-render="true"])');@@ -462,6 +463,40 @@ const browserCases = async (sourceCode: string, css: string, taskSource: string,check.equal(newMindmap.dataset.type, "NodeList");check.equal(newMindmap.getAttribute("custom-sy-list-mindmap"), "1");const creationSource = `- ${Lute.Caret}`;+ const preferenceKey = api.LIST_MINDMAP_DEFAULT_CONNECTOR_STYLE_KEY;+ lute.SetTabs(true);+ for (const style of ["spline", "orthogonal", "bezier", "rounded"]) {+ window.siyuan.storage[preferenceKey] = style;+ holder.innerHTML = api.spinListMindmapDOM(lute, creationSource);+ const created = holder.firstElementChild as HTMLElement;+ check.equal(api.readListMindmap(created).metadata.connectorStyle, style);+ const saved = lute.SpinBlockDOM(created.outerHTML);+ window.siyuan.storage[preferenceKey] = "orthogonal";+ holder.innerHTML = saved;+ check.equal(api.readListMindmap(holder.firstElementChild).metadata.connectorStyle, style,+ "saved maps keep their creation snapshot after the preference changes");+ const tabs = api.convertTabsList(reset("* First\n* Second\n"), "List2Tabs", lute);+ window.siyuan.storage[preferenceKey] = style;+ const converted = api.convertTabsList(tabs, "Tabs2Mindmap", lute);+ check.equal(api.readListMindmap(converted).metadata.connectorStyle, style, "first tab conversion uses the preference");+ window.siyuan.storage[preferenceKey] = "rounded";+ const tabRoundTrip = api.convertTabsList(api.listMindmapConversionSource(converted), "List2Tabs", lute);+ check.equal(api.readListMindmap(api.convertTabsList(tabRoundTrip, "Tabs2Mindmap", lute)).metadata.connectorStyle,+ style, "tab round trips retain the stored style");+ }+ window.siyuan.storage[preferenceKey] = "rounded";+ for (const legacy of [false, true]) {+ const old = reset("* Old\n");+ if (legacy) { old.setAttribute("custom-sy-list-mindmap", "1"); }+ else { api.retagMindmapBranch(old, true); }+ check.equal(api.readListMindmap(old).metadata.connectorStyle, undefined,+ "opening legacy maps cannot apply the local default");+ const listAgain = api.listMindmapConversionSource(old);+ api.initializeListMindmapConnectorStyle(listAgain, "rounded");+ check.equal(api.readListMindmap(listAgain).metadata.connectorStyle, "bezier",+ "old maps without metadata retain the fixed legacy style after leaving and returning");+ }+ delete window.siyuan.storage[preferenceKey];const paragraph = reset("Empty\n");const paragraphID = paragraph.dataset.nodeId;paragraph.querySelector('[contenteditable="true"]').textContent = creationSource;@@ -1027,7 +1062,7 @@ const browserCases = async (sourceCode: string, css: string, taskSource: string,const view = new api.ListMindmapView(options);await settle();const viewport = host.querySelector<HTMLElement>(".mindmap-view__viewport");- const settings = host.querySelector<HTMLButtonElement>('[aria-label="config"]');+ const settings = host.querySelector<HTMLButtonElement>('[aria-label="listMindmapConnectors"]');check.equal(settings.getAttribute("aria-haspopup"), "menu");settings.click();check.equal(settingsOpened, 1, "the editable toolbar opens the shared settings menu");@@ -1059,7 +1094,7 @@ const browserCases = async (sourceCode: string, css: string, taskSource: string,check.equal(view.findLine(branch).id, child.id, "the real canvas hit test selects each horizontal branch");}view.setReadOnly(true);- check.equal(host.querySelector('[aria-label="config"]'), null, "read-only views render saved styles without an edit menu");+ check.equal(host.querySelector('[aria-label="listMindmapConnectors"]'), null, "read-only views render saved styles without an edit menu");check.equal(view.linePaths.filter((line: {relation: boolean}) => !line.relation).length, view.edges.length);view.setReadOnly(false);}@@ -3962,7 +3997,7 @@ test("list mindmap mutations preserve block data in the real DOM and Lute", {const source = tabsSource + compile(path.join(__dirname, "../../wysiwyg/tabsList.ts")) +compile(path.join(__dirname, "../av/richTextValue.ts")) + compile(path.join(__dirname, "../../wysiwyg/listContext.ts")) +compile(path.join(__dirname, "summary.ts")) + compile(path.join(__dirname, "connectors.ts")) +- compile(path.join(__dirname, "model.ts")) + compile(path.join(__dirname, "fold.ts")) ++ compile(path.join(__dirname, "model.ts")) + compile(path.join(__dirname, "preferences.ts")) + compile(path.join(__dirname, "fold.ts")) +compile(path.join(__dirname, "routing.ts")) + compile(path.join(__dirname, "pan.ts")) +compile(path.join(__dirname, "view.ts")) +compile(path.join(__dirname, "legacy.ts")) + compile(path.join(__dirname, "migrate.ts")) +diff --git a/app/src/protyle/render/listMindmap/model.ts b/app/src/protyle/render/listMindmap/model.tsindex 167fbefab4..ce7ef515f9 100644--- a/app/src/protyle/render/listMindmap/model.ts+++ b/app/src/protyle/render/listMindmap/model.ts@@ -197,6 +197,13 @@ export const writeListMindmapMetadata = (list: HTMLElement, metadata: ListMindmalist.setAttribute(Constants.CUSTOM_SY_LIST_MINDMAP_DATA, value);};+// 仅首次创建配置时写入样式,已有脑图配置继续按自身的样式或固定缺省值显示。+export const initializeListMindmapConnectorStyle = (list: Element, style: ListMindmapConnectorStyle) => {+ if (!list.hasAttribute(Constants.CUSTOM_SY_LIST_MINDMAP_DATA)) {+ writeListMindmapMetadata(list as HTMLElement, {...parseListMindmapMetadata(null), connectorStyle: style});+ }+};+// 退出脑图时移除画布高度,让列表按正文撑开,同时保留其他块样式。export const clearListMindmapHeight = (element: Element) => {const style = (element as HTMLElement).style;@@ -211,6 +218,9 @@ export const clearListMindmapHeight = (element: Element) => {export const retagMindmapBranch = (root: Element, toMindmap: boolean) => {if (!toMindmap) {+ if (root.getAttribute("data-type") === "NodeMindmap") {+ initializeListMindmapConnectorStyle(root, "bezier");+ }clearListMindmapHeight(root);}const sourceBranch = toMindmap ? "NodeList" : "NodeMindmap";@@ -381,6 +391,9 @@ export const listMindmapConversionSource = (element: Element): Element => {const template = document.createElement("template");template.innerHTML = cleanListMindmapHTML(element.outerHTML);const source = template.content.firstElementChild;+ if (source.getAttribute(Constants.CUSTOM_SY_LIST_MINDMAP) === "1") {+ initializeListMindmapConnectorStyle(source, "bezier");+ }if (source.getAttribute("data-type") === "NodeMindmap") {retagMindmapBranch(source, false);}diff --git a/app/src/protyle/render/listMindmap/preferences.test.ts b/app/src/protyle/render/listMindmap/preferences.test.tsnew file mode 100644index 0000000000..903e3ebdd4--- /dev/null+++ b/app/src/protyle/render/listMindmap/preferences.test.ts@@ -0,0 +1,50 @@+import * as assert from "node:assert/strict";+import {readFileSync} from "node:fs";+import test from "node:test";+import {runInNewContext} from "node:vm";+import {ScriptTarget, transpileModule} from "typescript";+import {LIST_MINDMAP_CONNECTOR_STYLES} from "./connectors";++const compiled = transpileModule(readFileSync("src/protyle/render/listMindmap/preferences.ts", "utf8")+ .replace(/^import [\s\S]*?;\r?\n/gm, "").replace(/^export /gm, "") ++ "\nglobalThis.api = {getDefaultListMindmapConnectorStyle, setDefaultListMindmapConnectorStyle, LIST_MINDMAP_DEFAULT_CONNECTOR_STYLE_KEY};",+{compilerOptions: {target: ScriptTarget.ES2021}}).outputText;++test("connector preferences validate stored values and persist through the shared local storage API", () => {+ const storage: Record<string, unknown> = {};+ const saved: Record<string, unknown> = {};+ const writes: unknown[] = [];+ const context: any = {LIST_MINDMAP_CONNECTOR_STYLES, window: {siyuan: {storage, config: {}}},+ setStorageVal: (key: string, value: unknown) => { saved[key] = value; writes.push(value); }};+ runInNewContext(compiled, context);+ const {api} = context;+ const key = api.LIST_MINDMAP_DEFAULT_CONNECTOR_STYLE_KEY;+ for (const invalid of [undefined, null, "future", "", false, 1, {}, []]) {+ storage[key] = invalid;+ assert.equal(api.getDefaultListMindmapConnectorStyle(), "bezier");+ assert.equal(storage[key], invalid, "reading cannot overwrite an unknown preference");+ }+ for (const style of LIST_MINDMAP_CONNECTOR_STYLES) {+ api.setDefaultListMindmapConnectorStyle(style);+ assert.equal(storage[key], style);+ assert.equal(saved[key], style);+ assert.equal(api.getDefaultListMindmapConnectorStyle(), style);+ }+ assert.equal(writes.length, 4);+ api.setDefaultListMindmapConnectorStyle("rounded");+ api.setDefaultListMindmapConnectorStyle("future");+ assert.equal(writes.length, 4);+ context.window.siyuan.storage = JSON.parse(JSON.stringify(saved));+ const reloaded = {...context};+ runInNewContext(compiled, reloaded);+ assert.equal(reloaded.api.getDefaultListMindmapConnectorStyle(), "rounded", "reloaded local preferences retain the default");+ context.window.siyuan.storage[key] = "orthogonal";+ assert.equal(api.getDefaultListMindmapConnectorStyle(), "orthogonal", "storage updates from another window are read afresh");+ for (const mode of ["readonly", "publish"]) {+ context.window.siyuan.config.readonly = mode === "readonly";+ context.window.siyuan.isPublish = mode === "publish";+ api.setDefaultListMindmapConnectorStyle("spline");+ assert.equal(api.getDefaultListMindmapConnectorStyle(), "orthogonal");+ assert.equal(writes.length, 4);+ }+});diff --git a/app/src/protyle/render/listMindmap/preferences.ts b/app/src/protyle/render/listMindmap/preferences.tsnew file mode 100644index 0000000000..136fb39e9c--- /dev/null+++ b/app/src/protyle/render/listMindmap/preferences.ts@@ -0,0 +1,19 @@+import {setStorageVal} from "../../util/compatibility";+import {LIST_MINDMAP_CONNECTOR_STYLES} from "./connectors";+import type {ListMindmapConnectorStyle} from "./connectors";++export const LIST_MINDMAP_DEFAULT_CONNECTOR_STYLE_KEY = "siyuan-list-mindmap-default-connector-style";++export const getDefaultListMindmapConnectorStyle = (): ListMindmapConnectorStyle => {+ const value = window.siyuan?.storage?.[LIST_MINDMAP_DEFAULT_CONNECTOR_STYLE_KEY];+ return LIST_MINDMAP_CONNECTOR_STYLES.includes(value) ? value : "bezier";+};++export const setDefaultListMindmapConnectorStyle = (style: ListMindmapConnectorStyle) => {+ if (window.siyuan.config.readonly || window.siyuan.isPublish ||+ !LIST_MINDMAP_CONNECTOR_STYLES.includes(style) || getDefaultListMindmapConnectorStyle() === style) {+ return;+ }+ window.siyuan.storage[LIST_MINDMAP_DEFAULT_CONNECTOR_STYLE_KEY] = style;+ setStorageVal(LIST_MINDMAP_DEFAULT_CONNECTOR_STYLE_KEY, style);+};diff --git a/app/src/protyle/render/listMindmap/toggle.test.ts b/app/src/protyle/render/listMindmap/toggle.test.tsindex 5387be0c62..2382c8e06a 100644--- a/app/src/protyle/render/listMindmap/toggle.test.ts+++ b/app/src/protyle/render/listMindmap/toggle.test.ts@@ -6,6 +6,9 @@ import {createSourceFile, isVariableStatement, ScriptTarget, transpileModule} frimport {isProtyleListItemFragment, registerProtyleRuntimeCapabilities} from "../../runtimeCapabilities";import {getListConversionType} from "../../wysiwyg/listContext";+const metadataAttribute = "custom-sy-list-mindmap-data";+const legacyStyle = JSON.stringify({version: 1, nodes: {}, relations: [], connectorStyle: "bezier"});+const source = createSourceFile("index.ts", readFileSync("src/protyle/render/listMindmap/index.ts", "utf8"),ScriptTarget.ES2021, true);const declarations = source.statements.filter(statement => isVariableStatement(statement) &&@@ -41,10 +44,17 @@ const setup = (embedded = true) => {const operations: {doOperations: any[], undoOperations: any[]}[] = [];const updates: string[] = [];const context: any = {- Constants: {CB_GET_HISTORY: "history", CUSTOM_SY_LIST_MINDMAP: attribute},+ Constants: {CB_GET_HISTORY: "history", CUSTOM_SY_LIST_MINDMAP: attribute, CUSTOM_SY_LIST_MINDMAP_DATA: metadataAttribute},isProtyleListItemFragment,getListConversionType,roots: new WeakMap(), hideElements: () => {}, readListMindmap: () => {},+ getDefaultListMindmapConnectorStyle: () => "rounded",+ initializeListMindmapConnectorStyle: (element: unknown, style: string) => {+ assert.equal(element, list);+ if (!attrs.has("custom-sy-list-mindmap-data")) {+ attrs.set("custom-sy-list-mindmap-data", JSON.stringify({version: 1, nodes: {}, relations: [], connectorStyle: style}));+ }+ },hasListMindmapRootTitle: () => false,cleanListMindmapHTML: (html: string) => html,clearListMindmapHeight: () => {@@ -75,6 +85,19 @@ test("a regular list becomes a dedicated mind map block", () => {assert.equal(list.dataset.type, "NodeMindmap");assert.deepEqual(updates, ['<div data-type="NodeList"></div>']);assert.equal(operations.length, 0);+ assert.equal(JSON.parse(attrs.get("custom-sy-list-mindmap-data")).connectorStyle, "rounded");+});++test("returning lists retain existing connector metadata instead of applying the new default", async () => {+ for (const data of [{version: 1, nodes: {}, relations: [] as unknown[]},+ {version: 2, nodes: {}, relations: [] as unknown[], connectorStyle: "spline", extension: "keep"}]) {+ const {owner, list, attrs, attribute, api} = setup(false);+ attrs.delete(attribute);+ const original = JSON.stringify(data);+ attrs.set("custom-sy-list-mindmap-data", original);+ await api.toggleListMindmap(owner, list);+ assert.equal(attrs.get("custom-sy-list-mindmap-data"), original);+ }});test("a dedicated mind map becomes a list block", () => {@@ -97,8 +120,10 @@ test("embedded mind maps persist view changes against the source list with undo"const operation = operations[operations.length - 1];assert.equal(operation.doOperations[0].action, "setAttrs");assert.equal(operation.doOperations[0].id, "source-list");- assert.deepEqual(JSON.parse(operation.doOperations[0].data), {[attribute]: next});- assert.deepEqual(JSON.parse(operation.undoOperations[0].data), {[attribute]: previous});+ assert.deepEqual(JSON.parse(operation.doOperations[0].data), {[attribute]: next,+ ...(!next ? {[metadataAttribute]: legacyStyle} : {})});+ assert.deepEqual(JSON.parse(operation.undoOperations[0].data), {[attribute]: previous,+ ...(!next ? {[metadataAttribute]: ""} : {})});assert.equal(attrs.get(attribute), next);}assert.equal(operations.length, 2);@@ -123,14 +148,15 @@ test("legacy mindmap exit includes height cleanup and exact style restoration inattrs.set("style", style);await api.toggleListMindmap(owner, list);const expected = style.includes("color") ? "color:red" : "";- assert.deepEqual(JSON.parse(operations[0].doOperations[0].data), {[attribute]: "", style: expected});- assert.deepEqual(JSON.parse(operations[0].undoOperations[0].data), {[attribute]: "1", style});+ assert.deepEqual(JSON.parse(operations[0].doOperations[0].data), {[attribute]: "", style: expected, [metadataAttribute]: legacyStyle});+ assert.deepEqual(JSON.parse(operations[0].undoOperations[0].data), {[attribute]: "1", style, [metadataAttribute]: ""});assert.equal(attrs.get("style") || "", expected);for (const [name, value] of Object.entries(JSON.parse(operations[0].undoOperations[0].data))) {- attrs.set(name, value as string);+ if (value) { attrs.set(name, value as string); }+ else { attrs.delete(name); }}await api.toggleListMindmap(owner, list);- assert.deepEqual(JSON.parse(operations[1].doOperations[0].data), {[attribute]: "", style: expected});+ assert.deepEqual(JSON.parse(operations[1].doOperations[0].data), {[attribute]: "", style: expected, [metadataAttribute]: legacyStyle});}});diff --git a/app/src/protyle/render/listMindmap/view.ts b/app/src/protyle/render/listMindmap/view.tsindex 2188ad9e9a..498423bc92 100644--- a/app/src/protyle/render/listMindmap/view.ts+++ b/app/src/protyle/render/listMindmap/view.ts@@ -513,7 +513,7 @@ export class ListMindmapView {}if (!this.readOnly) {if (this.options.onSettingsMenu) {- add("settings", "config", "iconSettings", () => this.options.onSettingsMenu(this.buttons.get("settings")));+ add("settings", "listMindmapConnectors", "iconLine", () => this.options.onSettingsMenu(this.buttons.get("settings")));this.buttons.get("settings").setAttribute("aria-haspopup", "menu");}add("summary", "listMindmapSummary", "iconGroups", () => {diff --git a/app/src/protyle/wysiwyg/tabsList.ts b/app/src/protyle/wysiwyg/tabsList.tsindex 09e14ffdb4..83acf2f8b7 100644--- a/app/src/protyle/wysiwyg/tabsList.ts+++ b/app/src/protyle/wysiwyg/tabsList.ts@@ -1,5 +1,6 @@import {getTabTitle, getTabTitleBlock} from "../render/tabsRender";-import {retagMindmapBranch} from "../render/listMindmap/model";+import {initializeListMindmapConnectorStyle, retagMindmapBranch} from "../render/listMindmap/model";+import {getDefaultListMindmapConnectorStyle} from "../render/listMindmap/preferences";export type TTabsListConversion = "List2Tabs" | "Tabs2UL" | "Tabs2OL" | "Tabs2TL" | "Tabs2Mindmap";@@ -172,6 +173,7 @@ export const convertTabsList = (source: Element, type: TTabsListConversion, lute}}if (type === "Tabs2Mindmap") {+ initializeListMindmapConnectorStyle(result, getDefaultListMindmapConnectorStyle());retagMindmapBranch(result, true);}return result;diff --git a/docs/LIST-MINDMAP.md b/docs/LIST-MINDMAP.mdindex 9703cc3a2c..698133ca5a 100644--- a/docs/LIST-MINDMAP.md+++ b/docs/LIST-MINDMAP.md@@ -35,7 +35,9 @@- 概要包围成员的完整可见子树及内层概要的括号和标签,单节点也保留括号高度,折叠后由内到外重新布局;概要文字和括号参与关系线避让、适应画布以及 HTML/PDF 预览的边界计算- 本次不包含自由摆放节点-脑图工具栏的设置菜单提供“连线样式”子菜单,可选择曲线分叉、正交折线、曲线汇聚和圆角折线,缺省沿用曲线汇聚。选择作用于整张脑图,只改变父子节点的连线,不调整节点布局或关系线。两种正交样式按父节点绘制共享主干,主干使用脑图默认线色,不进入单条分支的选中和悬停命中;各横向分支仍保留独立配色与选中。桌面端使用悬停子菜单,移动端沿用底部菜单的点击子菜单。+脑图工具栏的“连线”菜单提供“连线样式”子菜单,可选择曲线分叉、正交折线、曲线汇聚和圆角折线,缺省沿用曲线汇聚。选择作用于整张脑图,只改变父子节点的连线,不调整节点布局或关系线。两种正交样式按父节点绘制共享主干,主干使用脑图默认线色,不进入单条分支的选中和悬停命中;各横向分支仍保留独立配色与选中。桌面端使用悬停子菜单,移动端沿用底部菜单的点击子菜单。++同一菜单中的“新建默认连线样式”只设置后续新建导图以及首次从列表或页签转换时采用的样式,不改变当前导图,也不进入文档撤销记录。偏好通过现有本地存储接口保存为 `siyuan-list-mindmap-default-connector-style`,位于当前工作空间的 `data/storage/local.json`,不参与云同步;未配置或值不可识别时沿用曲线汇聚。桌面端和移动端共用该偏好与创建逻辑。## 数据与兼容性@@ -47,6 +49,8 @@元数据的可选 `connectorStyle` 字段保存整张脑图的树连线样式,支持 `spline`、`orthogonal`、`bezier`、`rounded`,缺省为 `bezier`。选择缺省样式时移除该字段,不升级已有配置版本;切换通过文档事务保存,支持撤销和重做,复制与列表转换保留选择。未知样式或损坏值保留原始配置,不参与清理。此字段不改变 `.sy` 节点类型或加密格式;只读、发布及思源格式 HTML/PDF 预览共用绘制路径,Markdown 和 Word 继续保留列表形式。+新建导图或首次转换时,在同一次创建或转换事务内将本地默认值写入 `connectorStyle`,此后读取和绘制只使用文档自身的配置。已有配置即使没有该字段也保持固定的 `bezier`,不会套用本地偏好;完全没有配置的旧导图退出为列表或页签时补存 `bezier`,再次转换时仍保留原样式。复制、导入和转换不覆盖已有配置,未知或损坏的配置保持原值。+关系线可选的 `route` 字段使用独立的 `version: 1`,`points` 保存不超过 64 个控制点。每个控制点的 `x`、`y` 是相对两个节点中心插值位置的偏移,`t` 是沿路径长度计算的插值比例(0 到 1),坐标偏移的绝对值不超过 1000000。缺少 `route` 表示自动中间路径;双击线段手柄恢复时只删除该字段,保留文字、样式和端点连接点。关系线的可选 `fromAnchor`、`toAnchor` 分别保存起点和终点的手动连接位置,每项包含 `side`(`left`、`right`、`top` 或 `bottom`)和 `ratio`(0 到 1);缺少相应字段表示该端自动选择,元数据版本仍为 `1`,旧配置无需迁移。比例跟随节点尺寸,位置跟随节点布局;“恢复自动接入”只删除这两个字段,不删除 `route`。未知版本及损坏配置保留原值。布局变化时优先重新使用手动路径;若手动路径无法避障,则保留指定连接点并暂时显示自动中间路径;指定连接点也无法使用时,才暂时显示自动连接点。两类回退分别显示明确提示,保存的路径和连接点均保留,恢复可用布局后重新使用;只读交互视图也显示提示,打印可隐藏提示但采用相同的几何规则。拖动期间的外部刷新取消预览,提交前核对关系线快照,避免覆盖较新的配置。关系线的可选 `arrowDirection` 字段支持 `forward`、`reverse`、`both` 和 `none`,分别表示正向、反向、双向和无箭头;缺少该字段时沿用 `forward`,旧配置无需迁移。箭头方向与 `from`、`to` 端点及 `route` 路径独立,反向显示不交换端点或重置手动路径,端点手柄始终表示连接的起点和终点。只读、发布及思源格式的 HTML/PDF 预览按保存的方向显示箭头。