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 multiple mind map connector styles https://github.com/siyuan-note/siyuan/issues/20631
Daniel8bb4cc6e5233
diff --git a/app/appearance/langs/ar.json b/app/appearance/langs/ar.jsonindex 14adccb1d9..9ec2a7ac05 100644--- a/app/appearance/langs/ar.json+++ b/app/appearance/langs/ar.json@@ -1,4 +1,9 @@{+ "listMindmapConnectorStyle": "نمط خطوط الربط",+ "listMindmapConnectorSpline": "تفرع منحني",+ "listMindmapConnectorOrthogonal": "زوايا قائمة",+ "listMindmapConnectorBezier": "منحنى مروحي",+ "listMindmapConnectorRounded": "زوايا قائمة مستديرة","transactionSaveUnconfirmed": "تعذر التأكد من نجاح الحفظ الأخير. أبقِ هذا المحرر مفتوحًا وانسخ تغييراتك قبل إعادة التحميل للتحقق مما تم حفظه.","automationTemplateTip": "يُحسب وفق المنطقة الزمنية للقاعدة؛ النتيجة الفارغة تمسح الحقل والأخطاء تتراجع عن التغيير","automationTemplatePreview": "نتيجة المعاينة",diff --git a/app/appearance/langs/de.json b/app/appearance/langs/de.jsonindex 16b0430e90..a7b5ac6eef 100644--- a/app/appearance/langs/de.json+++ b/app/appearance/langs/de.json@@ -1,4 +1,9 @@{+ "listMindmapConnectorStyle": "Linienstil",+ "listMindmapConnectorSpline": "Verzweigte Kurve",+ "listMindmapConnectorOrthogonal": "Rechtwinklig",+ "listMindmapConnectorBezier": "Fächerkurve",+ "listMindmapConnectorRounded": "Abgerundet rechtwinklig","transactionSaveUnconfirmed": "Der letzte Speichervorgang konnte nicht bestätigt werden. Lassen Sie diesen Editor geöffnet und kopieren Sie Ihre Änderungen, bevor Sie die Seite neu laden, um den gespeicherten Stand zu prüfen.","automationTemplateTip": "Berechnung in der Zeitzone der Regel; leere Ergebnisse löschen das Feld, Fehler machen die Änderung rückgängig","automationTemplatePreview": "Vorschauergebnis",diff --git a/app/appearance/langs/en.json b/app/appearance/langs/en.jsonindex 2d2e071d0d..99d83488e1 100644--- a/app/appearance/langs/en.json+++ b/app/appearance/langs/en.json@@ -1,4 +1,9 @@{+ "listMindmapConnectorStyle": "Connector style",+ "listMindmapConnectorSpline": "Curved fork",+ "listMindmapConnectorOrthogonal": "Orthogonal",+ "listMindmapConnectorBezier": "Curved fan",+ "listMindmapConnectorRounded": "Rounded orthogonal","transactionSaveUnconfirmed": "Unable to confirm the latest save. Keep this editor open and copy your changes before reloading to check the saved result.","automationTemplateTip": "Calculated in the rule's time zone; empty output clears the field, and errors roll back the change","automationTemplatePreview": "Preview result",diff --git a/app/appearance/langs/es.json b/app/appearance/langs/es.jsonindex 365dd79583..e8bfac00c7 100644--- a/app/appearance/langs/es.json+++ b/app/appearance/langs/es.json@@ -1,4 +1,9 @@{+ "listMindmapConnectorStyle": "Estilo de conexión",+ "listMindmapConnectorSpline": "Bifurcación curva",+ "listMindmapConnectorOrthogonal": "Ortogonal",+ "listMindmapConnectorBezier": "Abanico curvo",+ "listMindmapConnectorRounded": "Ortogonal redondeada","transactionSaveUnconfirmed": "No se puede confirmar el último guardado. Mantén este editor abierto y copia tus cambios antes de recargar para comprobar lo que se ha guardado.","automationTemplateTip": "Se calcula en la zona horaria de la regla; un resultado vacío borra el campo y los errores revierten el cambio","automationTemplatePreview": "Resultado de la vista previa",diff --git a/app/appearance/langs/fr.json b/app/appearance/langs/fr.jsonindex 2e2b68ac74..dd32542faf 100644--- a/app/appearance/langs/fr.json+++ b/app/appearance/langs/fr.json@@ -1,4 +1,9 @@{+ "listMindmapConnectorStyle": "Style des connexions",+ "listMindmapConnectorSpline": "Bifurcation courbe",+ "listMindmapConnectorOrthogonal": "Orthogonal",+ "listMindmapConnectorBezier": "Éventail courbe",+ "listMindmapConnectorRounded": "Orthogonal arrondi","transactionSaveUnconfirmed": "Impossible de confirmer le dernier enregistrement. Gardez cet éditeur ouvert et copiez vos modifications avant de recharger pour vérifier le contenu enregistré.","automationTemplateTip": "Calcul dans le fuseau de la règle ; un résultat vide efface le champ et une erreur annule la modification","automationTemplatePreview": "Résultat de l’aperçu",diff --git a/app/appearance/langs/he.json b/app/appearance/langs/he.jsonindex 1143894d81..2575b54607 100644--- a/app/appearance/langs/he.json+++ b/app/appearance/langs/he.json@@ -1,4 +1,9 @@{+ "listMindmapConnectorStyle": "סגנון קווי חיבור",+ "listMindmapConnectorSpline": "הסתעפות מעוקלת",+ "listMindmapConnectorOrthogonal": "זוויות ישרות",+ "listMindmapConnectorBezier": "מניפה מעוקלת",+ "listMindmapConnectorRounded": "זוויות ישרות מעוגלות","transactionSaveUnconfirmed": "לא ניתן לאשר שהשמירה האחרונה הצליחה. יש להשאיר את העורך הזה פתוח ולהעתיק את השינויים לפני טעינה מחדש כדי לבדוק מה נשמר.","automationTemplateTip": "החישוב לפי אזור הזמן של הכלל; תוצאה ריקה מנקה את השדה ושגיאות מבטלות את השינוי","automationTemplatePreview": "תוצאת התצוגה המקדימה",diff --git a/app/appearance/langs/hi.json b/app/appearance/langs/hi.jsonindex 99afc56e03..01e6dcf1d7 100644--- a/app/appearance/langs/hi.json+++ b/app/appearance/langs/hi.json@@ -1,4 +1,9 @@{+ "listMindmapConnectorStyle": "जोड़ने वाली रेखा की शैली",+ "listMindmapConnectorSpline": "वक्र शाखाएँ",+ "listMindmapConnectorOrthogonal": "समकोण",+ "listMindmapConnectorBezier": "पंखे जैसा वक्र",+ "listMindmapConnectorRounded": "गोल समकोण","transactionSaveUnconfirmed": "पिछली बार सहेजना सफल हुआ या नहीं, इसकी पुष्टि नहीं हो सकी। इस संपादक को खुला रखें और सहेजी गई सामग्री जाँचने के लिए दोबारा लोड करने से पहले अपने बदलाव कॉपी कर लें।","automationTemplateTip": "नियम के समय क्षेत्र में गणना होती है; खाली परिणाम फ़ील्ड साफ़ करता है और त्रुटि होने पर बदलाव वापस होता है","automationTemplatePreview": "पूर्वावलोकन परिणाम",diff --git a/app/appearance/langs/id.json b/app/appearance/langs/id.jsonindex 92c0522206..a2aaae09ea 100644--- a/app/appearance/langs/id.json+++ b/app/appearance/langs/id.json@@ -1,4 +1,9 @@{+ "listMindmapConnectorStyle": "Gaya garis penghubung",+ "listMindmapConnectorSpline": "Cabang melengkung",+ "listMindmapConnectorOrthogonal": "Siku-siku",+ "listMindmapConnectorBezier": "Kipas melengkung",+ "listMindmapConnectorRounded": "Siku-siku membulat","transactionSaveUnconfirmed": "Penyimpanan terakhir belum dapat dipastikan berhasil. Biarkan editor ini terbuka dan salin perubahan Anda sebelum memuat ulang untuk memeriksa hasil yang tersimpan.","automationTemplateTip": "Dihitung dalam zona waktu aturan; hasil kosong mengosongkan kolom dan kesalahan membatalkan perubahan","automationTemplatePreview": "Hasil pratinjau",diff --git a/app/appearance/langs/it.json b/app/appearance/langs/it.jsonindex 4093099e1f..8780affb30 100644--- a/app/appearance/langs/it.json+++ b/app/appearance/langs/it.json@@ -1,4 +1,9 @@{+ "listMindmapConnectorStyle": "Stile dei collegamenti",+ "listMindmapConnectorSpline": "Diramazione curva",+ "listMindmapConnectorOrthogonal": "Ortogonale",+ "listMindmapConnectorBezier": "Ventaglio curvo",+ "listMindmapConnectorRounded": "Ortogonale arrotondato","transactionSaveUnconfirmed": "Impossibile confermare l'ultimo salvataggio. Mantieni aperto questo editor e copia le modifiche prima di ricaricare per verificare il contenuto salvato.","automationTemplateTip": "Calcolo nel fuso orario della regola; un risultato vuoto cancella il campo e gli errori annullano la modifica","automationTemplatePreview": "Risultato dell’anteprima",diff --git a/app/appearance/langs/ja.json b/app/appearance/langs/ja.jsonindex b619428b36..3d3ed5a478 100644--- a/app/appearance/langs/ja.json+++ b/app/appearance/langs/ja.json@@ -1,4 +1,9 @@{+ "listMindmapConnectorStyle": "接続線のスタイル",+ "listMindmapConnectorSpline": "分岐曲線",+ "listMindmapConnectorOrthogonal": "直角線",+ "listMindmapConnectorBezier": "扇形曲線",+ "listMindmapConnectorRounded": "角丸直角線","transactionSaveUnconfirmed": "直前の保存が成功したか確認できません。このエディターを開いたままにし、再読み込みして保存結果を確認する前に、変更内容をコピーしてください。","automationTemplateTip": "ルールのタイムゾーンで計算し、空の結果はフィールドを消去、エラー時は変更を取り消します","automationTemplatePreview": "プレビュー結果",diff --git a/app/appearance/langs/ko.json b/app/appearance/langs/ko.jsonindex 4a10aad4f9..eb0ba69b6d 100644--- a/app/appearance/langs/ko.json+++ b/app/appearance/langs/ko.json@@ -1,4 +1,9 @@{+ "listMindmapConnectorStyle": "연결선 스타일",+ "listMindmapConnectorSpline": "곡선 분기",+ "listMindmapConnectorOrthogonal": "직각선",+ "listMindmapConnectorBezier": "부채꼴 곡선",+ "listMindmapConnectorRounded": "둥근 직각선","transactionSaveUnconfirmed": "마지막 저장이 성공했는지 확인할 수 없습니다. 이 편집기를 열어 둔 채로 변경 내용을 복사한 후 새로고침하여 저장 결과를 확인하세요.","automationTemplateTip": "규칙의 시간대로 계산하며, 빈 결과는 필드를 지우고 오류가 발생하면 변경을 되돌립니다","automationTemplatePreview": "미리보기 결과",diff --git a/app/appearance/langs/nl.json b/app/appearance/langs/nl.jsonindex 947714674c..5dd36c3acc 100644--- a/app/appearance/langs/nl.json+++ b/app/appearance/langs/nl.json@@ -1,4 +1,9 @@{+ "listMindmapConnectorStyle": "Verbindingsstijl",+ "listMindmapConnectorSpline": "Gebogen vertakking",+ "listMindmapConnectorOrthogonal": "Rechthoekig",+ "listMindmapConnectorBezier": "Gebogen waaier",+ "listMindmapConnectorRounded": "Afgerond rechthoekig","transactionSaveUnconfirmed": "De laatste opslag kon niet worden bevestigd. Houd deze editor open en kopieer je wijzigingen voordat je opnieuw laadt om te controleren wat is opgeslagen.","automationTemplateTip": "Berekend in de tijdzone van de regel; lege uitvoer wist het veld en fouten draaien de wijziging terug","automationTemplatePreview": "Voorbeeldresultaat",diff --git a/app/appearance/langs/pl.json b/app/appearance/langs/pl.jsonindex a0779ec7f4..c9e900b162 100644--- a/app/appearance/langs/pl.json+++ b/app/appearance/langs/pl.json@@ -1,4 +1,9 @@{+ "listMindmapConnectorStyle": "Styl połączeń",+ "listMindmapConnectorSpline": "Zakrzywione rozwidlenie",+ "listMindmapConnectorOrthogonal": "Prostokątny",+ "listMindmapConnectorBezier": "Zakrzywiony wachlarz",+ "listMindmapConnectorRounded": "Zaokrąglony prostokątny","transactionSaveUnconfirmed": "Nie można potwierdzić ostatniego zapisu. Pozostaw ten edytor otwarty i skopiuj zmiany przed ponownym wczytaniem, aby sprawdzić zapisaną zawartość.","automationTemplateTip": "Obliczanie w strefie czasowej reguły; pusty wynik czyści pole, a błędy cofają zmianę","automationTemplatePreview": "Wynik podglądu",diff --git a/app/appearance/langs/pt-BR.json b/app/appearance/langs/pt-BR.jsonindex c7ff2de296..97b2bc27a5 100644--- a/app/appearance/langs/pt-BR.json+++ b/app/appearance/langs/pt-BR.json@@ -1,4 +1,9 @@{+ "listMindmapConnectorStyle": "Estilo das conexões",+ "listMindmapConnectorSpline": "Ramificação curva",+ "listMindmapConnectorOrthogonal": "Ortogonal",+ "listMindmapConnectorBezier": "Leque curvo",+ "listMindmapConnectorRounded": "Ortogonal arredondado","transactionSaveUnconfirmed": "Não foi possível confirmar o último salvamento. Mantenha este editor aberto e copie suas alterações antes de recarregar para conferir o conteúdo salvo.","automationTemplateTip": "Calculado no fuso horário da regra; resultados vazios limpam o campo e erros revertem a alteração","automationTemplatePreview": "Resultado da prévia",diff --git a/app/appearance/langs/ru.json b/app/appearance/langs/ru.jsonindex 07f8fb87eb..fc742f02f3 100644--- a/app/appearance/langs/ru.json+++ b/app/appearance/langs/ru.json@@ -1,4 +1,9 @@{+ "listMindmapConnectorStyle": "Стиль соединительных линий",+ "listMindmapConnectorSpline": "Изогнутая развилка",+ "listMindmapConnectorOrthogonal": "Прямоугольный",+ "listMindmapConnectorBezier": "Изогнутый веер",+ "listMindmapConnectorRounded": "Скруглённый прямоугольный","transactionSaveUnconfirmed": "Не удалось подтвердить последнее сохранение. Оставьте этот редактор открытым и скопируйте изменения перед перезагрузкой, чтобы проверить сохранённое содержимое.","automationTemplateTip": "Расчёт в часовом поясе правила; пустой результат очищает поле, ошибки отменяют изменение","automationTemplatePreview": "Результат предпросмотра",diff --git a/app/appearance/langs/sk.json b/app/appearance/langs/sk.jsonindex 4b937f9a4d..c011b4b6df 100644--- a/app/appearance/langs/sk.json+++ b/app/appearance/langs/sk.json@@ -1,4 +1,9 @@{+ "listMindmapConnectorStyle": "Štýl spojníc",+ "listMindmapConnectorSpline": "Zakrivené vetvenie",+ "listMindmapConnectorOrthogonal": "Pravouhlý",+ "listMindmapConnectorBezier": "Zakrivený vejár",+ "listMindmapConnectorRounded": "Zaoblený pravouhlý","transactionSaveUnconfirmed": "Posledné uloženie sa nepodarilo potvrdiť. Nechajte tento editor otvorený a pred opätovným načítaním na kontrolu uloženého obsahu skopírujte svoje zmeny.","automationTemplateTip": "Výpočet v časovom pásme pravidla; prázdny výsledok vymaže pole a chyby vrátia zmenu späť","automationTemplatePreview": "Výsledok náhľadu",diff --git a/app/appearance/langs/sr.json b/app/appearance/langs/sr.jsonindex 7ec64848e7..289effe222 100644--- a/app/appearance/langs/sr.json+++ b/app/appearance/langs/sr.json@@ -1,4 +1,9 @@{+ "listMindmapConnectorStyle": "Стил спојних линија",+ "listMindmapConnectorSpline": "Закривљено гранање",+ "listMindmapConnectorOrthogonal": "Правоугаони",+ "listMindmapConnectorBezier": "Закривљена лепеза",+ "listMindmapConnectorRounded": "Заобљени правоугаони","transactionSaveUnconfirmed": "Није могуће потврдити последње чување. Оставите овај уређивач отворен и копирајте измене пре поновног учитавања да бисте проверили сачувани садржај.","automationTemplateTip": "Израчунавање у временској зони правила; празан резултат брише поље, а грешке поништавају измену","automationTemplatePreview": "Резултат прегледа",diff --git a/app/appearance/langs/th.json b/app/appearance/langs/th.jsonindex 92d8eab0ee..c39dc55a85 100644--- a/app/appearance/langs/th.json+++ b/app/appearance/langs/th.json@@ -1,4 +1,9 @@{+ "listMindmapConnectorStyle": "รูปแบบเส้นเชื่อม",+ "listMindmapConnectorSpline": "เส้นโค้งแตกแขนง",+ "listMindmapConnectorOrthogonal": "เส้นหักมุมฉาก",+ "listMindmapConnectorBezier": "เส้นโค้งแผ่พัด",+ "listMindmapConnectorRounded": "เส้นมุมฉากโค้งมน","transactionSaveUnconfirmed": "ไม่สามารถยืนยันได้ว่าการบันทึกล่าสุดสำเร็จ โปรดเปิดตัวแก้ไขนี้ค้างไว้และคัดลอกการเปลี่ยนแปลงก่อนโหลดใหม่เพื่อตรวจสอบเนื้อหาที่บันทึกไว้","automationTemplateTip": "คำนวณตามเขตเวลาของกฎ ผลลัพธ์ว่างจะล้างช่อง และข้อผิดพลาดจะย้อนการเปลี่ยนแปลง","automationTemplatePreview": "ผลการแสดงตัวอย่าง",diff --git a/app/appearance/langs/tr.json b/app/appearance/langs/tr.jsonindex 3cb43e9fb5..836b483088 100644--- a/app/appearance/langs/tr.json+++ b/app/appearance/langs/tr.json@@ -1,4 +1,9 @@{+ "listMindmapConnectorStyle": "Bağlantı çizgisi stili",+ "listMindmapConnectorSpline": "Eğri dallanma",+ "listMindmapConnectorOrthogonal": "Dik açılı",+ "listMindmapConnectorBezier": "Yelpaze eğrisi",+ "listMindmapConnectorRounded": "Yuvarlatılmış dik açılı","transactionSaveUnconfirmed": "Son kaydetme işlemi doğrulanamadı. Kaydedilen içeriği kontrol etmek için yeniden yüklemeden önce bu düzenleyiciyi açık tutun ve değişikliklerinizi kopyalayın.","automationTemplateTip": "Kuralın saat diliminde hesaplanır; boş sonuç alanı temizler ve hatalar değişikliği geri alır","automationTemplatePreview": "Önizleme sonucu",diff --git a/app/appearance/langs/uk.json b/app/appearance/langs/uk.jsonindex 6bb896d839..8f63126836 100644--- a/app/appearance/langs/uk.json+++ b/app/appearance/langs/uk.json@@ -1,4 +1,9 @@{+ "listMindmapConnectorStyle": "Стиль сполучних ліній",+ "listMindmapConnectorSpline": "Вигнуте розгалуження",+ "listMindmapConnectorOrthogonal": "Прямокутний",+ "listMindmapConnectorBezier": "Вигнуте віяло",+ "listMindmapConnectorRounded": "Заокруглений прямокутний","transactionSaveUnconfirmed": "Не вдалося підтвердити останнє збереження. Залиште цей редактор відкритим і скопіюйте зміни перед перезавантаженням, щоб перевірити збережений вміст.","automationTemplateTip": "Обчислення в часовому поясі правила; порожній результат очищає поле, помилки скасовують зміну","automationTemplatePreview": "Результат попереднього перегляду",diff --git a/app/appearance/langs/zh-CN.json b/app/appearance/langs/zh-CN.jsonindex 9096a04994..cf76cccacc 100644--- a/app/appearance/langs/zh-CN.json+++ b/app/appearance/langs/zh-CN.json@@ -1,4 +1,9 @@{+ "listMindmapConnectorStyle": "连线样式",+ "listMindmapConnectorSpline": "曲线分叉",+ "listMindmapConnectorOrthogonal": "正交折线",+ "listMindmapConnectorBezier": "曲线汇聚",+ "listMindmapConnectorRounded": "圆角折线","transactionSaveUnconfirmed": "无法确认最近一次保存是否成功。请保留当前编辑器,刷新核对保存结果前先复制修改内容。","automationTemplateTip": "按规则时区计算;空结果清空字段,错误会回滚本次修改","automationTemplatePreview": "预览结果",diff --git a/app/appearance/langs/zh-TW.json b/app/appearance/langs/zh-TW.jsonindex 38a756c132..3959eadd2c 100644--- a/app/appearance/langs/zh-TW.json+++ b/app/appearance/langs/zh-TW.json@@ -1,4 +1,9 @@{+ "listMindmapConnectorStyle": "連線樣式",+ "listMindmapConnectorSpline": "曲線分岔",+ "listMindmapConnectorOrthogonal": "直角折線",+ "listMindmapConnectorBezier": "曲線匯聚",+ "listMindmapConnectorRounded": "圓角折線","transactionSaveUnconfirmed": "無法確認最近一次儲存是否成功。請保留目前的編輯器,重新載入以核對儲存結果前,先複製修改內容。","automationTemplateTip": "依規則時區計算;空結果清空欄位,錯誤會復原本次修改","automationTemplatePreview": "預覽結果",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 ff850a46e5..16763c9ecd 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": "20261017003253"+ "updated": "20261017110432"},"Children": [{@@ -1961,7 +1961,7 @@"HeadingLevel": 2,"Properties": {"id": "20210104091509-v1x69oc",- "updated": "20261017003253"+ "updated": "20261017110432"},"Children": [{@@ -2009,6 +2009,38 @@}]},+ {+ "ID": "20261017110432-mq248cg",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20261017110432-mq248cg",+ "updated": "20261017110432"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "In the mind map toolbar, use "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "kbd",+ "TextMarkTextContent": "Settings"+ },+ {+ "Type": "NodeText",+ "Data": " - "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "kbd",+ "TextMarkTextContent": "Connector style"+ },+ {+ "Type": "NodeText",+ "Data": " to select Curved fork, Orthogonal, Curved fan, or Rounded orthogonal. The choice applies to the whole map, is saved with the document, and supports undo and redo. It changes parent-child connectors without moving nodes or changing relationship lines. Orthogonal styles use a shared vertical trunk in the default line color; the trunk cannot be selected separately, while horizontal branches can still be selected and colored individually. SiYuan-format HTML and PDF previews use the saved 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 57144aaf05..fbc485db88 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": "20261017003253"+ "updated": "20261017110432"},"Children": [{@@ -1964,7 +1964,7 @@"HeadingLevel": 2,"Properties": {"id": "20210104091228-wdpx6ev",- "updated": "20261017003253"+ "updated": "20261017110432"},"Children": [{@@ -2012,6 +2012,38 @@}]},+ {+ "ID": "20261017110432-6mghas7",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20261017110432-6mghas7",+ "updated": "20261017110432"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "在脑图工具栏的 "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "kbd",+ "TextMarkTextContent": "设置"+ },+ {+ "Type": "NodeText",+ "Data": " - "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "kbd",+ "TextMarkTextContent": "连线样式"+ },+ {+ "Type": "NodeText",+ "Data": " 中选择曲线分叉、正交折线、曲线汇聚或圆角折线。选择应用于整张脑图,随文档保存,并支持撤销和重做。切换只改变父子节点间的连线,不改变节点位置或关系线。正交样式共用的竖线沿用默认线色,不单独选中;横向分支仍可单独选中和配色。思源格式的 HTML 和 PDF 预览使用保存的样式。"+ }+ ]+ },{"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 bbc6cc1600..6341502688 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": "20261017003253"+ "updated": "20261017110432"},"Children": [{@@ -1962,7 +1962,7 @@"HeadingLevel": 2,"Properties": {"id": "20211226122008-731sqd6",- "updated": "20261017003253"+ "updated": "20261017110432"},"Children": [{@@ -2010,6 +2010,38 @@}]},+ {+ "ID": "20261017110432-qnsdugf",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20261017110432-qnsdugf",+ "updated": "20261017110432"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "在心智圖工具列的 "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "kbd",+ "TextMarkTextContent": "設定"+ },+ {+ "Type": "NodeText",+ "Data": " - "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "kbd",+ "TextMarkTextContent": "連線樣式"+ },+ {+ "Type": "NodeText",+ "Data": " 中選擇曲線分岔、直角折線、曲線匯聚或圓角折線。選擇套用至整張心智圖,隨文件儲存,並支援復原和重做。切換只改變父子節點間的連線,不改變節點位置或關係線。直角樣式共用的垂直線沿用預設線色,不能單獨選取;水平分支仍可單獨選取和配色。思源格式的 HTML 與 PDF 預覽使用儲存的樣式。"+ }+ ]+ },{"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 b930250d03..c097a38449 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": "20261017003253"+ "updated": "20261017110432"},"Children": [{@@ -2090,7 +2090,7 @@"Properties": {"ID": "20240530101000-ch5e4vh","id": "20240530101000-1ev7xub",- "updated": "20261017003253"+ "updated": "20261017110432"},"Children": [{@@ -2138,6 +2138,38 @@}]},+ {+ "ID": "20261017110432-562ro9u",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20261017110432-562ro9u",+ "updated": "20261017110432"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "マインドマップのツールバーで "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "kbd",+ "TextMarkTextContent": "設定"+ },+ {+ "Type": "NodeText",+ "Data": " - "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "kbd",+ "TextMarkTextContent": "接続線のスタイル"+ },+ {+ "Type": "NodeText",+ "Data": " を開き、分岐曲線、直角線、扇形曲線、角丸直角線から選択できます。選択はマップ全体に適用され、文書とともに保存され、取り消しとやり直しに対応します。親子ノード間の接続線のみを変更し、ノードの位置や関連線は変更しません。直角のスタイルでは共通の縦線に既定の線色を使用し、縦線を個別に選択することはできません。横方向の分岐は個別に選択して色を変更できます。SiYuan 形式の HTML と PDF プレビューには保存したスタイルが反映されます。"+ }+ ]+ },{"ID": "20261003225941-37evcb1","Type": "NodeParagraph",diff --git a/app/src/protyle/render/listMindmap/arrows.test.ts b/app/src/protyle/render/listMindmap/arrows.test.tsindex 32a28542f7..c84ee52340 100644--- a/app/src/protyle/render/listMindmap/arrows.test.ts+++ b/app/src/protyle/render/listMindmap/arrows.test.ts@@ -4,6 +4,7 @@ import test from "node:test";import {runInNewContext} from "node:vm";import {createSourceFile, isClassDeclaration, ScriptTarget, transpileModule} from "typescript";import type {ListMindmapRelation} from "./model";+import {buildListMindmapConnectors} from "./connectors";// 执行实际绘制和命中方法,画布替身仅记录路径与箭头,避免依赖图形显示环境。const source = createSourceFile("view.ts", readFileSync("src/protyle/render/listMindmap/view.ts", "utf8"),@@ -30,7 +31,9 @@ const setup = (arrowDirection?: ListMindmapRelation["arrowDirection"]) => {let polygon: Point[] = [];const polygons: Point[][] = [];const strokes: TestPath[] = [];+ const strokeStyles: string[] = [];const context = {+ strokeStyle: "",strokeHit: false,setTransform: () => {}, clearRect: () => {}, translate: () => {}, scale: () => {},setLineDash: () => {}, closePath: () => {}, save: () => {}, restore: () => {}, resetTransform: () => {},@@ -38,10 +41,14 @@ const setup = (arrowDirection?: ListMindmapRelation["arrowDirection"]) => {moveTo: (x: number, y: number) => polygon.push({x, y}),lineTo: (x: number, y: number) => polygon.push({x, y}),fill: () => polygons.push(polygon),- stroke: (path: TestPath) => strokes.push(path),+ stroke: (path: TestPath) => {+ strokes.push(path);+ strokeStyles.push(context.strokeStyle);+ },isPointInStroke: () => context.strokeHit,};const sandbox: any = {+ buildListMindmapConnectors,Path2D: TestPath, window: {devicePixelRatio: 1},getComputedStyle: (element: {style?: {color?: string}}) => ({getPropertyValue: () => "", color: element.style?.color || "black",@@ -66,9 +73,35 @@ const setup = (arrowDirection?: ListMindmapRelation["arrowDirection"]) => {relationRoutes: new Map([["r", [{x: 100, y: 10}, {x: 0, y: 10}]]]),routingObstacles: (): unknown[] => [], drawRelationPreview: () => {}, drawSummaries: () => {}, renderRouteControls: () => {},});- return {target, context, polygons, strokes, element};+ return {target, context, polygons, strokes, strokeStyles, element};};+test("shared orthogonal trunks keep the default color and stay outside branch selection in every renderer", () => {+ for (const connectorStyle of ["orthogonal", "rounded"]) {+ for (const printLayout of [false, true]) {+ const {target, strokes, strokeStyles} = setup();+ Object.assign(target.model.metadata, {connectorStyle, relations: [], nodes: {+ root: {lineColor: "#112233"}, a: {lineColor: "#ff0000"}, b: {lineColor: "#0000ff"},+ }});+ target.model.root.id = "root";+ target.readOnly = printLayout;+ target.options.printLayout = printLayout;+ target.positions = new Map([+ ["root", {id: "root", x: 20, y: 100, width: 100, height: 40}],+ ["a", {id: "a", x: 160, y: 0, width: 100, height: 40}],+ ["b", {id: "b", x: 160, y: 200, width: 100, height: 40}],+ ]);+ target.edges = [{from: "root", to: "a"}, {from: "root", to: "b"}];+ target.selectedEdge = "b";+ target.draw();+ assert.deepEqual(strokeStyles, ["#112233", "#ff0000", "#0000ff"]);+ assert.equal(target.linePaths.length, 2);+ assert.equal(target.linePaths.some((line: {path: TestPath}) => line.path === strokes[0]), false,+ "the shared trunk is drawn once without becoming a selectable child line");+ }+ }+});+test("all arrow modes use endpoint identity rather than canonical path drawing order", () => {for (const mode of [undefined, "forward", "reverse", "both", "none"] as const) {for (const scale of [.5, 1, 2]) {diff --git a/app/src/protyle/render/listMindmap/connectorMenu.test.ts b/app/src/protyle/render/listMindmap/connectorMenu.test.tsnew file mode 100644index 0000000000..7d4cee6428--- /dev/null+++ b/app/src/protyle/render/listMindmap/connectorMenu.test.ts@@ -0,0 +1,98 @@+import * as assert from "node:assert/strict";+import {readFileSync} from "node:fs";+import test from "node:test";+import {runInNewContext} from "node:vm";+import {createSourceFile, isClassDeclaration, isPropertyAssignment, ScriptTarget, transpileModule} from "typescript";+import {getListMindmapConnectorMenuItem} from "./connectorMenu";++const source = createSourceFile("index.ts", readFileSync("src/protyle/render/listMindmap/index.ts", "utf8"),+ ScriptTarget.ES2021, true);+const controller = source.statements.find(item => isClassDeclaration(item) && item.name?.text === "ListMindmapController");+assert.ok(controller && isClassDeclaration(controller));+let callback = "";+const visit = (node: import("typescript").Node) => {+ if (isPropertyAssignment(node) && node.name.getText(source) === "onSettingsMenu") {+ callback = node.initializer.getText(source);+ }+ node.forEachChild(visit);+};+visit(controller);+assert.ok(callback);+const methods = controller.members.filter(item => item.name && ["metadata", "change"].includes(item.name.getText(source)));+const compiled = transpileModule(`class Controller {+ ${methods.map(item => item.getText(source)).join("\n")}+ onSettingsMenu = ${callback};+}+globalThis.Controller = Controller;`, {compilerOptions: {target: ScriptTarget.ES2021}}).outputText;++test("desktop and mobile connector menus persist one undoable change and preserve existing metadata", async () => {+ for (const mobile of [false, true]) {+ let data = {version: 2, nodes: {child: {lineColor: "red"}}, relations: [] as unknown[], extension: "keep"};+ const original = JSON.stringify(data);+ const list = {isConnected: true, dataset: {nodeId: "map"}, get outerHTML() { return JSON.stringify(data); }};+ const transactions: {before: string, after: string}[] = [];+ let editable = true;+ let item: IMenu;+ const placements: unknown[] = [];+ const anchor = {getBoundingClientRect: () => ({left: 20, bottom: 100, height: 24})};+ const context: any = {+ owner: {}, list,+ canEdit: () => editable,+ getListMindmapConnectorMenuItem,+ getListMindmapSiblingIDs: () => new Map(),+ normalizeListMindmapSummaryMetadata: () => {},+ readListMindmap: () => ({root: {id: "root"}, metadata: JSON.parse(JSON.stringify(data)),+ nodes: new Map([["root", {children: []}]])}),+ writeListMindmapMetadata: (_list: unknown, value: typeof data) => data = value,+ cleanListMindmapHTML: (html: string) => html,+ updateTransaction: (_owner: unknown, _list: unknown, before: string) =>+ transactions.push({before, after: list.outerHTML}),+ showMessage: () => assert.fail("valid connector changes must not report an error"),+ isMobile: () => mobile,+ toggleMenu: ({target, build}: {target: unknown, build: (menu: unknown, session: unknown) => void}) => {+ assert.equal(target, anchor);+ build(undefined, {show: (open: () => void) => open()});+ },+ Menu: class {+ addItem(value: IMenu) { item = value; }+ open(position: unknown) { placements.push(position); }+ fullscreen(position: unknown) { placements.push(position); }+ },+ window: {siyuan: {languages: {}}}, console,+ };+ runInNewContext(compiled, context);+ const target = new context.Controller();+ Object.assign(target, {list, owner: {}, view: {getSelectedId: () => "root"}, refresh: () => {}});+ const choose = (style: string) => (item.submenu as IMenu[]).find(entry => entry.id === style).click(undefined, undefined);+ target.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}]);+ choose("orthogonal");+ assert.equal(transactions.length, 1);+ assert.equal(transactions[0].before, original);+ assert.deepEqual(JSON.parse(transactions[0].after), {...JSON.parse(original), connectorStyle: "orthogonal"});+ const saved = transactions[0].after;+ data = JSON.parse(transactions[0].before);+ target.onSettingsMenu(anchor);+ assert.equal((item.submenu as IMenu[]).find(entry => entry.checked).id, "bezier", "undo restores the missing default");+ data = JSON.parse(saved);+ target.onSettingsMenu(anchor);+ assert.equal((item.submenu as IMenu[]).find(entry => entry.checked).id, "orthogonal", "redo restores the saved preset");+ choose("orthogonal");+ assert.equal(transactions.length, 1, "choosing the current style is a no-op");+ let finish: (value: boolean) => void;+ target.activeEditor = {finish: () => new Promise<boolean>(resolve => finish = resolve)};+ choose("rounded");+ data.extension = "remote edit";+ finish(true);+ await new Promise(resolve => setImmediate(resolve));+ assert.equal(JSON.parse(transactions[1].after).extension, "remote edit", "pending text edits cannot overwrite newer metadata");+ target.activeEditor = undefined;+ choose("bezier");+ assert.equal(Object.hasOwn(data, "connectorStyle"), false, "restoring the default removes the optional field");+ const count = transactions.length;+ editable = false;+ choose("spline");+ 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.tsnew file mode 100644index 0000000000..7c8d5bd49a--- /dev/null+++ b/app/src/protyle/render/listMindmap/connectorMenu.ts@@ -0,0 +1,20 @@+import {LIST_MINDMAP_CONNECTOR_STYLES} from "./connectors";+import type {ListMindmapConnectorStyle} from "./connectors";++export const getListMindmapConnectorMenuItem = (current: ListMindmapConnectorStyle,+ select: (style: ListMindmapConnectorStyle) => void,+ labels: Record<string, string>): IMenu => {+ const names = {+ spline: labels.listMindmapConnectorSpline,+ orthogonal: labels.listMindmapConnectorOrthogonal,+ bezier: labels.listMindmapConnectorBezier,+ rounded: labels.listMindmapConnectorRounded,+ };+ return {+ id: "connectorStyle", icon: "iconLine", label: 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/connectors.test.ts b/app/src/protyle/render/listMindmap/connectors.test.tsnew file mode 100644index 0000000000..3415e96ccc--- /dev/null+++ b/app/src/protyle/render/listMindmap/connectors.test.ts@@ -0,0 +1,87 @@+import * as assert from "node:assert/strict";+import test from "node:test";+import {buildListMindmapConnectors, LIST_MINDMAP_CONNECTOR_STYLES} from "./connectors";+import {getListMindmapConnectorMenuItem} from "./connectorMenu";+import type {ListMindmapPosition} from "./model";++class PathFixture {+ commands: (string | number)[][] = [];+ moveTo(...values: number[]) { this.commands.push(["move", ...values]); }+ lineTo(...values: number[]) { this.commands.push(["line", ...values]); }+ bezierCurveTo(...values: number[]) { this.commands.push(["bezier", ...values]); }+ quadraticCurveTo(...values: number[]) { this.commands.push(["quadratic", ...values]); }+}+const positions = new Map<string, ListMindmapPosition>([+ ["root", {id: "root", x: 20, y: 100, width: 100, height: 40}],+ ["a", {id: "a", parentId: "root", x: 160, y: 0, width: 100, height: 40}],+ ["b", {id: "b", parentId: "root", x: 230, y: 200, width: 70, height: 40}],+ ["c", {id: "c", parentId: "b", x: 340, y: 200, width: 80, height: 40}],+]);+const edges = [{from: "root", to: "a"}, {from: "root", to: "b"}, {from: "b", to: "c"}];+const build = (style: typeof LIST_MINDMAP_CONNECTOR_STYLES[number]) =>+ buildListMindmapConnectors("root", positions, edges, style, () => new PathFixture());++test("curved connector presets retain the legacy endpoints and use distinct tangents", () => {+ const before = structuredClone(positions);+ const legacy = build("bezier");+ assert.equal(legacy.trunks.length, 0);+ assert.deepEqual(legacy.branches[0].path.commands, [+ ["move", 120, 120], ["bezier", 140, 120, 140, 40, 160, 40], ["line", 260, 40],+ ]);+ assert.deepEqual(legacy.branches[2].path.commands, [+ ["move", 300, 240], ["bezier", 320, 240, 320, 240, 340, 240], ["line", 420, 240],+ ]);+ const fork = build("spline");+ assert.deepEqual(fork.branches[0].path.commands, [+ ["move", 120, 120], ["bezier", 120, 120, 140, 40, 160, 40], ["line", 260, 40],+ ]);+ assert.deepEqual(positions, before, "changing connector shapes cannot change node positions");+});++test("orthogonal siblings share a trunk while each selectable branch stays horizontal", () => {+ const result = build("orthogonal");+ assert.equal(result.trunks.length, 2, "one trunk per visible parent, including single-child parents");+ assert.deepEqual(result.trunks[0].commands, [+ ["move", 120, 120], ["line", 140, 120], ["move", 140, 40], ["line", 140, 240],+ ]);+ assert.deepEqual(result.branches.map(branch => [branch.id, branch.path.commands]), [+ ["a", [["move", 140, 40], ["line", 260, 40]]],+ ["b", [["move", 140, 240], ["line", 300, 240]]],+ ["c", [["move", 320, 240], ["line", 420, 240]]],+ ]);+ const hidden = new Map(positions);+ hidden.delete("b");+ const folded = buildListMindmapConnectors("root", hidden, edges, "orthogonal", () => new PathFixture());+ assert.deepEqual(folded.branches.map(branch => branch.id), ["a"], "missing folded endpoints cannot leave orphan paths");+});++test("rounded orthogonal corners stop the shared trunk at each outer tangent", () => {+ const result = build("rounded");+ assert.deepEqual(result.trunks[0].commands, [+ ["move", 120, 120], ["line", 140, 120], ["move", 140, 48], ["line", 140, 232],+ ]);+ assert.deepEqual(result.branches[0].path.commands, [+ ["move", 140, 48], ["quadratic", 140, 40, 148, 40], ["line", 260, 40],+ ]);+ assert.deepEqual(result.branches[1].path.commands, [+ ["move", 140, 232], ["quadratic", 140, 240, 148, 240], ["line", 300, 240],+ ]);+ assert.deepEqual(result.branches[2].path.commands, [["move", 320, 240], ["line", 420, 240]],+ "aligned nodes need no corner and retain a continuous horizontal connection");+});++test("the connector submenu checks the saved preset and selects exactly one whole-map style", () => {+ const labels = {listMindmapConnectorStyle: "Connectors", listMindmapConnectorSpline: "Fork",+ listMindmapConnectorOrthogonal: "Elbow", listMindmapConnectorBezier: "Fan", listMindmapConnectorRounded: "Rounded"};+ for (const current of LIST_MINDMAP_CONNECTOR_STYLES) {+ const selected: string[] = [];+ const item = getListMindmapConnectorMenuItem(current, style => selected.push(style), labels);+ assert.equal(item.label, "Connectors");+ assert.ok(Array.isArray(item.submenu));+ const entries = item.submenu as IMenu[];+ assert.deepEqual(entries.map(entry => entry.label), ["Fork", "Elbow", "Fan", "Rounded"]);+ assert.deepEqual(entries.filter(entry => entry.checked).map(entry => entry.id), [current]);+ entries.forEach(entry => entry.click(undefined, undefined));+ assert.deepEqual(selected, [...LIST_MINDMAP_CONNECTOR_STYLES]);+ }+});diff --git a/app/src/protyle/render/listMindmap/connectors.ts b/app/src/protyle/render/listMindmap/connectors.tsnew file mode 100644index 0000000000..8ee6c6cba9--- /dev/null+++ b/app/src/protyle/render/listMindmap/connectors.ts@@ -0,0 +1,72 @@+import type {ListMindmapPosition} from "./model";++export const LIST_MINDMAP_CONNECTOR_STYLES = ["spline", "orthogonal", "bezier", "rounded"] as const;+export type ListMindmapConnectorStyle = typeof LIST_MINDMAP_CONNECTOR_STYLES[number];++type ConnectorPath = Pick<CanvasPath, "moveTo" | "lineTo" | "bezierCurveTo" | "quadraticCurveTo">;++// 连线路径只使用已完成的节点布局,共享主干不进入分支的命中路径。+export const buildListMindmapConnectors = <T extends ConnectorPath>(+ rootID: string, positions: Map<string, ListMindmapPosition>, edges: {from: string, to: string}[],+ style: ListMindmapConnectorStyle, makePath: () => T,+) => {+ const trunks: T[] = [];+ const branches: {id: string, path: T}[] = [];+ const groups = new Map<string, ListMindmapPosition[]>();+ edges.forEach(edge => {+ const from = positions.get(edge.from);+ const to = positions.get(edge.to);+ if (!from || !to) {+ return;+ }+ if (style === "orthogonal" || style === "rounded") {+ if (!groups.has(edge.from)) {+ groups.set(edge.from, []);+ }+ groups.get(edge.from).push(to);+ return;+ }+ const startX = from.x + from.width;+ const startY = from.y + (edge.from === rootID ? from.height / 2 : from.height);+ const endY = to.y + to.height;+ const center = (startX + to.x) / 2;+ const path = makePath();+ path.moveTo(startX, startY);+ path.bezierCurveTo(style === "spline" ? startX : center, startY, center, endY, to.x, endY);+ path.lineTo(to.x + to.width, endY);+ branches.push({id: edge.to, path});+ });+ groups.forEach((children, parentID) => {+ const from = positions.get(parentID);+ const startX = from.x + from.width;+ const startY = from.y + (parentID === rootID ? from.height / 2 : from.height);+ const endX = children.reduce((left, node) => Math.min(left, node.x), Infinity);+ const trunkX = (startX + endX) / 2;+ const radius = style === "rounded" ? Math.min(8, Math.max(0, endX - startX) / 4) : 0;+ let top = startY;+ let bottom = startY;+ children.forEach(to => {+ const endY = to.y + to.height;+ const corner = Math.min(radius, Math.abs(endY - startY) / 2);+ const branchY = endY - Math.sign(endY - startY) * corner;+ top = Math.min(top, branchY);+ bottom = Math.max(bottom, branchY);+ const path = makePath();+ path.moveTo(trunkX, branchY);+ if (corner) {+ path.quadraticCurveTo(trunkX, endY, trunkX + corner, endY);+ }+ path.lineTo(to.x + to.width, endY);+ branches.push({id: to.id, path});+ });+ const trunk = makePath();+ trunk.moveTo(startX, startY);+ trunk.lineTo(trunkX, startY);+ if (bottom > top) {+ trunk.moveTo(trunkX, top);+ trunk.lineTo(trunkX, bottom);+ }+ trunks.push(trunk);+ });+ return {trunks, branches};+};diff --git a/app/src/protyle/render/listMindmap/index.ts b/app/src/protyle/render/listMindmap/index.tsindex 39d3bfc384..545a2a05d9 100644--- a/app/src/protyle/render/listMindmap/index.ts+++ b/app/src/protyle/render/listMindmap/index.ts@@ -54,6 +54,7 @@ import {processRender} from "../../util/processCode";import {highlightRender} from "../highlightRender";import {avRender} from "../av/render";import {blockRender} from "../blockRender";+import {getListMindmapConnectorMenuItem} from "./connectorMenu";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,@@ -227,6 +228,36 @@ class ListMindmapController {onLockChange: locked => canEdit(owner, list) ? this.metadata(metadata => {metadata.viewLocked = locked;}) : Promise.resolve(true),+ onSettingsMenu: anchor => {+ toggleMenu({+ target: anchor,+ build: (_menu, session) => {+ if (!canEdit(owner, list)) {+ return;+ }+ const menu = new Menu();+ menu.addItem(getListMindmapConnectorMenuItem(readListMindmap(list).metadata.connectorStyle || "bezier",+ style => {+ void this.metadata(metadata => {+ if ((metadata.connectorStyle || "bezier") === style) {+ return false;+ }+ if (style === "bezier") {+ delete metadata.connectorStyle;+ } else {+ metadata.connectorStyle = style;+ }+ });+ }, window.siyuan.languages));+ if (isMobile()) {+ session.show(() => menu.fullscreen("bottom"));+ } else {+ const rect = anchor.getBoundingClientRect();+ session.show(() => menu.open({x: rect.left, y: rect.bottom, h: rect.height}));+ }+ },+ });+ },onExpandLevelMenu: (anchor, select) => {toggleMenu({target: anchor,diff --git a/app/src/protyle/render/listMindmap/model.test.ts b/app/src/protyle/render/listMindmap/model.test.tsindex f27cee9888..ccd53dd77f 100644--- a/app/src/protyle/render/listMindmap/model.test.ts+++ b/app/src/protyle/render/listMindmap/model.test.ts@@ -73,6 +73,22 @@ test("mindmap metadata rejects unknown formats and invalid values without replac}});+test("connector presets extend both metadata versions without migrating legacy configurations", () => {+ for (const version of [1, 2]) {+ const legacy = JSON.stringify({version, nodes: {a: {lineColor: "red"}}, relations: [], extension: "keep"});+ assert.equal(JSON.stringify(parseListMindmapMetadata(legacy)), legacy);+ assert.equal(parseListMindmapMetadata(legacy).connectorStyle, undefined);+ for (const connectorStyle of ["spline", "orthogonal", "bezier", "rounded"]) {+ const value = JSON.stringify({...JSON.parse(legacy), connectorStyle});+ assert.equal(JSON.stringify(parseListMindmapMetadata(value)), value);+ }+ for (const connectorStyle of [null, "", "future-style", 0, false, {}, []]) {+ const value = JSON.stringify({...JSON.parse(legacy), connectorStyle});+ assert.throws(() => parseListMindmapMetadata(value), /Invalid list mindmap metadata/);+ }+ }+});+test("manual relation routes are optional, versioned and validated without dropping extension fields", () => {const route = {version: 1, points: [{x: -40, y: 25.5, t: .4, extension: "keep"}], extension: "keep"};const metadata = {version: 1, nodes: {}, relations: [{id: "r", from: "a", to: "b", label: "", route}]};@@ -921,6 +937,7 @@ const browserCases = async (sourceCode: string, css: string, taskSource: string,let interactions = 0;let undo = 0;let redo = 0;+ let settingsOpened = 0;let finishAllowed: boolean | Promise<boolean> = true;const options = {host, model,@@ -948,6 +965,7 @@ const browserCases = async (sourceCode: string, css: string, taskSource: string,onFold: (id: string) => folds.push(id),onUndo: () => undo++,onRedo: () => redo++,+ onSettingsMenu: () => settingsOpened++,onNodeStyle: (...args: unknown[]) => nodeStyles.push(args),onRelationAdd: (...args: unknown[]) => relationAdditions.push(args),onRelationChange: (...args: unknown[]) => relationChanges.push(args),@@ -1009,6 +1027,50 @@ 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"]');+ check.equal(settings.getAttribute("aria-haspopup"), "menu");+ settings.click();+ check.equal(settingsOpened, 1, "the editable toolbar opens the shared settings menu");+ const originalConnectorPositions = JSON.stringify([...view.positions]);+ const connectorSource = list.getAttribute("custom-sy-list-mindmap-data");+ for (const connectorStyle of ["spline", "orthogonal", "bezier", "rounded"]) {+ model.metadata.connectorStyle = connectorStyle;+ api.writeListMindmapMetadata(list, model.metadata);+ const reloaded = api.readListMindmap(list);+ check.equal(reloaded.metadata.connectorStyle, connectorStyle);+ view.update(reloaded);+ await settle();+ check.equal(JSON.stringify([...view.positions]), originalConnectorPositions, "connector changes preserve node layout");+ check.equal(view.linePaths.filter((line: {relation: boolean}) => !line.relation).length, view.edges.length);+ if (connectorStyle === "orthogonal" || connectorStyle === "rounded") {+ const from = view.positions.get(model.root.id);+ const children = model.root.children.map((child: {id: string}) => view.positions.get(child.id));+ const trunkX = (from.x + from.width + Math.min(...children.map((child: {x: number}) => child.x))) / 2;+ const branchYs = children.map((child: {y: number, height: number}) => child.y + child.height);+ const rect = viewport.getBoundingClientRect();+ const eventAt = (x: number, y: number) => new MouseEvent("click", {+ clientX: rect.left + view.offsetX + x * view.scale,+ clientY: rect.top + view.offsetY + y * view.scale,+ });+ check.equal(view.findLine(eventAt(trunkX, (Math.min(...branchYs) + Math.max(...branchYs)) / 2)), undefined,+ "the shared vertical trunk cannot be selected as an individual branch");+ const child = children[children.length - 1];+ const branch = eventAt((trunkX + child.x + child.width) / 2, child.y + child.height);+ 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(view.linePaths.filter((line: {relation: boolean}) => !line.relation).length, view.edges.length);+ view.setReadOnly(false);+ }+ if (connectorSource === null) {+ list.removeAttribute("custom-sy-list-mindmap-data");+ } else {+ list.setAttribute("custom-sy-list-mindmap-data", connectorSource);+ }+ delete model.metadata.connectorStyle;+ view.update(model);+ await settle();check.equal(viewport.getAttribute("data-prevent-swipe"), "true");const originalCapture = HTMLElement.prototype.setPointerCapture;const originalHasCapture = HTMLElement.prototype.hasPointerCapture;@@ -3899,7 +3961,8 @@ test("list mindmap mutations preserve block data in the real DOM and Lute", {"return {tabsRender, destroyTabsRender, getTabTask, getTabTitle, getTabTitleBlock, revealTabsForTarget};})();\n";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, "model.ts")) + compile(path.join(__dirname, "fold.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, "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 866ca668d8..167fbefab4 100644--- a/app/src/protyle/render/listMindmap/model.ts+++ b/app/src/protyle/render/listMindmap/model.ts@@ -3,6 +3,8 @@ import {getOrderedListMarkerUpdates, isListConversionType} from "../../wysiwyg/limport type {MindmapManualRoute, MindmapRelationAnchor} from "./routing";import {getListMindmapSiblingIDs, isListMindmapSummaryCrossing, normalizeListMindmapSummaries} from "./summary";import type {ListMindmapSummary} from "./summary";+import {LIST_MINDMAP_CONNECTOR_STYLES} from "./connectors";+import type {ListMindmapConnectorStyle} from "./connectors";export interface ListMindmapNodeStyle {textColor?: string;@@ -36,6 +38,7 @@ export interface ListMindmapMetadata {version: 1 | 2;rootTitle?: string;viewLocked?: boolean;+ connectorStyle?: ListMindmapConnectorStyle;nodes: Record<string, ListMindmapNodeStyle>;relations: ListMindmapRelation[];summaries?: ListMindmapSummary[];@@ -105,6 +108,9 @@ export const parseListMindmapMetadata = (value: string | null): ListMindmapMetadif (data.viewLocked !== undefined && typeof data.viewLocked !== "boolean") {throw invalidMetadata();}+ if ("connectorStyle" in data && !LIST_MINDMAP_CONNECTOR_STYLES.some(style => style === data.connectorStyle)) {+ throw invalidMetadata();+ }const numberKeys = ["fontSize", "borderWidth", "borderRadius", "lineWidth"];const booleanKeys = ["bold", "italic", "lineDash"];for (const [id, style] of Object.entries(data.nodes)) {diff --git a/app/src/protyle/render/listMindmap/rootConversion.test.ts b/app/src/protyle/render/listMindmap/rootConversion.test.tsindex dca2831a3d..69627a0da2 100644--- a/app/src/protyle/render/listMindmap/rootConversion.test.ts+++ b/app/src/protyle/render/listMindmap/rootConversion.test.ts@@ -5,6 +5,7 @@ import * as path from "node:path";import test from "node:test";import {createSourceFile, isVariableStatement, ScriptTarget, transpileModule} from "typescript";import {isListConversionType} from "../../wysiwyg/listContext";+import {LIST_MINDMAP_CONNECTOR_STYLES} from "./connectors";// 使用项目已有的 HTML 解析器承载节点操作,Lute 负责真实块 DOM 的生成和转换。const parse5 = createRequire(require.resolve("html-loader"))("parse5");@@ -115,11 +116,11 @@ lute.SetKramdownIAL(true);lute.SetProtyleWYSIWYG(true);const source = readFileSync(path.join(__dirname, "model.ts"), "utf8").replace(/^import [\s\S]*?;\r?\n/gm, "").replace(/^export /gm, "");-const api = new Function("Constants", "Lute", "document", "NodeFilter", "isListConversionType", transpileModule(source, {+const api = new Function("Constants", "Lute", "document", "NodeFilter", "isListConversionType", "LIST_MINDMAP_CONNECTOR_STYLES", transpileModule(source, {compilerOptions: {target: ScriptTarget.ES2021},}).outputText + "; return {convertListMindmapToList, readListMindmap, retagMindmapBranch, listMindmapConversionSource, cleanListMindmapHTML};")({CUSTOM_SY_LIST_MINDMAP: "custom-sy-list-mindmap", CUSTOM_SY_LIST_MINDMAP_DATA: "custom-sy-list-mindmap-data",-}, Lute, documentFixture, {SHOW_COMMENT: 8}, isListConversionType);+}, Lute, documentFixture, {SHOW_COMMENT: 8}, isListConversionType, LIST_MINDMAP_CONNECTOR_STYLES);const parse = (html: string) => wrap(parse5.parseFragment(html)).firstElementChild;const ids = (element: ElementFixture) => [element, ...element.querySelectorAll<ElementFixture>("[data-node-id]")].map(item => item.dataset.nodeId);@@ -220,7 +221,7 @@ test("titled virtual roots preserve content, identities and associations acrossoriginal.setAttribute("custom-container", "keep");original.setAttribute("style", "height:750px;color:red");const rootID = original.dataset.nodeId;- const metadata = {version: 1, rootTitle: "<Root> & **literal**", extension: "keep",+ const metadata = {version: 1, connectorStyle: "rounded", rootTitle: "<Root> & **literal**", extension: "keep",nodes: {[rootID]: {bold: true, extension: "keep"}, [children[0].dataset.nodeId]: {italic: true}},relations: [{id: "r", from: rootID, to: children[0].dataset.nodeId, label: "link"}],summaries: [{id: "s", parentId: rootID, nodeIds: children.map(child => child.dataset.nodeId), label: "both"}]};@@ -245,6 +246,7 @@ test("titled virtual roots preserve content, identities and associations acrossassert.equal(new Set(ids(result)).size, ids(result).length);assert.equal(model.metadata.rootTitle, undefined);assert.equal(model.metadata.extension, "keep");+ assert.equal(model.metadata.connectorStyle, "rounded");assert.deepEqual(model.metadata.nodes[model.root.id], metadata.nodes[rootID]);assert.equal(model.metadata.relations[0].from, model.root.id);assert.equal(model.metadata.relations[0].to, children[0].dataset.nodeId);diff --git a/app/src/protyle/render/listMindmap/view.ts b/app/src/protyle/render/listMindmap/view.tsindex 516c39a5d2..2188ad9e9a 100644--- a/app/src/protyle/render/listMindmap/view.ts+++ b/app/src/protyle/render/listMindmap/view.ts@@ -21,6 +21,7 @@ import {clampMindmapPanOffset} from "./pan";import {getListMindmapSummaryParentID, getListMindmapSummaryRange, getListMindmapSummarySelection, getListMindmapSummarySnapshot,layoutListMindmapSummaries} from "./summary";import type {ListMindmapSummary, ListMindmapSummaryPosition, ListMindmapSummaryRange} from "./summary";+import {buildListMindmapConnectors} from "./connectors";export interface ListMindmapViewOptions {host: HTMLElement;@@ -54,6 +55,7 @@ export interface ListMindmapViewOptions {onFoldSiblings?: (id: string) => Promise<boolean>;onFoldLevel?: (level: ListMindmapFoldTarget) => Promise<boolean>;onExpandLevelMenu?: (anchor: HTMLElement, select: (level: ListMindmapFoldTarget) => void) => void;+ onSettingsMenu?: (anchor: HTMLElement) => void;onTaskToggle?: (id: string, cycle?: boolean) => void;onTaskMenu?: (id: string, anchor: HTMLElement) => void;onTabTaskToggle?: (id: string, itemId: string) => void;@@ -510,6 +512,10 @@ export class ListMindmapView {return;}if (!this.readOnly) {+ if (this.options.onSettingsMenu) {+ add("settings", "config", "iconSettings", () => this.options.onSettingsMenu(this.buttons.get("settings")));+ this.buttons.get("settings").setAttribute("aria-haspopup", "menu");+ }add("summary", "listMindmapSummary", "iconGroups", () => {this.finishThen(() => {const selecting = !this.summarySelecting;@@ -1690,26 +1696,20 @@ export class ListMindmapView {baseWidth,};};- this.edges.forEach((edge) => {- const from = this.positions.get(edge.from);- const to = this.positions.get(edge.to);- if (!from || !to) {- return;- }- const style = {...this.model.metadata.nodes[this.model.root.id], ...this.model.metadata.nodes[edge.to]};- const startX = from.x + from.width;- const startY = from.y + (edge.from === this.model.root.id ? from.height / 2 : from.height);- const endX = to.x;- const endY = to.y + to.height;- const center = (startX + endX) / 2;- const path = new Path2D();- path.moveTo(startX, startY);- path.bezierCurveTo(center, startY, center, endY, endX, endY);- path.lineTo(to.x + to.width, endY);- this.linePaths.push({id: edge.to, relation: false, path});+ const connectors = buildListMindmapConnectors(this.model.root.id, this.positions, this.edges,+ this.model.metadata.connectorStyle || "bezier", () => new Path2D());+ const rootStyle = this.model.metadata.nodes[this.model.root.id] || {};+ const trunkStyle = resolveLineStyle(lineStyles, rootStyle.lineColor, rootStyle.lineWidth, defaultLine, false, false);+ context.strokeStyle = trunkStyle.color;+ context.lineWidth = trunkStyle.width;+ context.setLineDash(rootStyle.lineDash ? [6, 4] : []);+ connectors.trunks.forEach(path => context.stroke(path));+ connectors.branches.forEach(({id, path}) => {+ const style = {...rootStyle, ...this.model.metadata.nodes[id]};+ this.linePaths.push({id, relation: false, path});context.beginPath();- const selected = this.selectedEdge === edge.to;- const hovered = this.hoveredLine === `edge:${edge.to}`;+ const selected = this.selectedEdge === id;+ const hovered = this.hoveredLine === `edge:${id}`;const lineStyle = resolveLineStyle(lineStyles, style.lineColor, style.lineWidth, defaultLine, selected, hovered);context.strokeStyle = lineStyle.color;context.lineWidth = lineStyle.width;diff --git a/docs/LIST-MINDMAP.md b/docs/LIST-MINDMAP.mdindex 3bb38fd4a2..9703cc3a2c 100644--- a/docs/LIST-MINDMAP.md+++ b/docs/LIST-MINDMAP.md@@ -35,6 +35,8 @@- 概要包围成员的完整可见子树及内层概要的括号和标签,单节点也保留括号高度,折叠后由内到外重新布局;概要文字和括号参与关系线避让、适应画布以及 HTML/PDF 预览的边界计算- 本次不包含自由摆放节点+脑图工具栏的设置菜单提供“连线样式”子菜单,可选择曲线分叉、正交折线、曲线汇聚和圆角折线,缺省沿用曲线汇聚。选择作用于整张脑图,只改变父子节点的连线,不调整节点布局或关系线。两种正交样式按父节点绘制共享主干,主干使用脑图默认线色,不进入单条分支的选中和悬停命中;各横向分支仍保留独立配色与选中。桌面端使用悬停子菜单,移动端沿用底部菜单的点击子菜单。+## 数据与兼容性列表与脑图转换保留已有容器、节点和正文块的 ID,搜索、块引用和反链继续使用原块 ID。单个顶层项直接作为根节点;多个顶层项使用可自定义标题的虚拟中心节点,脑图显示时不新增实际块,标题存放在脑图属性的可选 `rootTitle` 字段中。@@ -43,6 +45,8 @@旧列表上的 `custom-sy-list-mindmap="1"` 标记仍受兼容处理,新脑图以专用块类型保存。`custom-sy-list-mindmap-data` 保存版本为 `1` 或 `2` 的节点样式、关系线和概要配置。转换为列表保留该配置;折叠沿用节点的 `fold` 属性。未知版本或损坏的配置不会被自动覆盖,原正文仍可查看。+元数据的可选 `connectorStyle` 字段保存整张脑图的树连线样式,支持 `spline`、`orthogonal`、`bezier`、`rounded`,缺省为 `bezier`。选择缺省样式时移除该字段,不升级已有配置版本;切换通过文档事务保存,支持撤销和重做,复制与列表转换保留选择。未知样式或损坏值保留原始配置,不参与清理。此字段不改变 `.sy` 节点类型或加密格式;只读、发布及思源格式 HTML/PDF 预览共用绘制路径,Markdown 和 Word 继续保留列表形式。+关系线可选的 `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 预览按保存的方向显示箭头。diff --git a/kernel/model/transaction_list_mindmap.go b/kernel/model/transaction_list_mindmap.goindex d467cb4524..d569f4e6c0 100644--- a/kernel/model/transaction_list_mindmap.go+++ b/kernel/model/transaction_list_mindmap.go@@ -30,6 +30,12 @@ func validListMindmapMetadata(data map[string]any) bool {return false}}+ if value, exists := data["connectorStyle"]; exists {+ style, ok := value.(string)+ if !ok || !slices.Contains([]string{"spline", "orthogonal", "bezier", "rounded"}, style) {+ return false+ }+ }if summaries, exists := data["summaries"]; exists && !validListMindmapSummaries(summaries, data["version"] == float64(2)) {return false}diff --git a/kernel/model/transaction_list_mindmap_test.go b/kernel/model/transaction_list_mindmap_test.goindex 66a5af07cf..ecd118d3b7 100644--- a/kernel/model/transaction_list_mindmap_test.go+++ b/kernel/model/transaction_list_mindmap_test.go@@ -72,6 +72,30 @@ func TestNormalizeTypedMindmapMetadata(t *testing.T) {}}+func TestPruneListMindmapConnectorStyles(t *testing.T) {+ for _, version := range []string{"1", "2"} {+ for _, style := range []string{"spline", "orthogonal", "bezier", "rounded"} {+ _, list, _ := mindmapTestTree()+ original := `{"version":` + version + `,"connectorStyle":"` + style ++ `","extension":9007199254740993,"nodes":{"child":{"lineColor":"red"},"deleted":{}},"relations":[]}`+ list.SetIALAttr(listMindmapMetadataAttr, original)+ next, changed := pruneListMindmapMetadata(list)+ if !changed || strings.Contains(next, "deleted") || !strings.Contains(next, `"connectorStyle":"`+style+`"`) ||+ !strings.Contains(next, `"lineColor":"red"`) || !strings.Contains(next, "9007199254740993") {+ t.Fatalf("connector metadata was lost during pruning: %s", next)+ }+ }+ for _, style := range []string{`null`, `""`, `"future-style"`, `0`, `false`, `{}`, `[]`} {+ _, list, _ := mindmapTestTree()+ original := `{"version":` + version + `,"connectorStyle":` + style + `,"nodes":{"deleted":{}},"relations":[]}`+ list.SetIALAttr(listMindmapMetadataAttr, original)+ if next, changed := pruneListMindmapMetadata(list); changed || next != original {+ t.Fatalf("unsupported connector style was changed: %s", next)+ }+ }+ }+}+func TestPruneListMindmapPreservesInvalidRoutes(t *testing.T) {for _, route := range []string{`null`, `{}`, `{"version":2,"points":[{"x":0,"y":0,"t":0.5}]}`,