Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:lipstick: Focus mind map appearance on line colors https://github.com/siyuan-note/siyuan/issues/20800

Daniel00dc787069cc
diff --git a/app/appearance/langs/ar.json b/app/appearance/langs/ar.json
index 69cf2e928f..e50de25f53 100644
--- a/app/appearance/langs/ar.json
+++ b/app/appearance/langs/ar.json
@@ -1,4 +1,6 @@
{
+ "listMindmapLineColors": "ألوان الخطوط",
+ "listMindmapFontHierarchy": "تدرج أحجام الخط حسب المستوى",
"listMindmapDocumentLayout": "تخطيط المستند",
"fullCheckSnapshot": "فحص المحتوى بالكامل",
"fullCheckSnapshotTip": "قراءة جميع الملفات المحلية لاكتشاف تغييرات المحتوى حتى مع ثبات الحجم ووقت التعديل، وإنشاء لقطة عند الحاجة؛ لن تُنزّل الموارد لهذا الفحص، وقد تستغرق مساحات العمل الكبيرة وقتًا أطول",
@@ -58,7 +60,6 @@
"loadAllAndSelectAll": "تحميل المستند بالكامل وتحديد الكل",
"autoFitRowHeight": "ملاءمة ارتفاع الصف تلقائيًا",
"backlinkDatabaseFields": "حقول قاعدة البيانات",
- "listMindmapCanvasBackground": "خلفية اللوحة",
"listMindmapClearManualColors": "مسح الألوان اليدوية",
"listMindmapLineColor": "لون خطوط الفروع",
"lockScreenWallpaper": "خلفية شاشة القفل",
diff --git a/app/appearance/langs/de.json b/app/appearance/langs/de.json
index e3d1d7ff00..4da8155e3d 100644
--- a/app/appearance/langs/de.json
+++ b/app/appearance/langs/de.json
@@ -1,4 +1,6 @@
{
+ "listMindmapLineColors": "Linienfarben",
+ "listMindmapFontHierarchy": "Schriftgröße nach Ebene",
"listMindmapDocumentLayout": "Dokumentlayout",
"fullCheckSnapshot": "Vollständige Inhaltsprüfung",
"fullCheckSnapshotTip": "Alle lokalen Dateien lesen, um Inhaltsänderungen auch bei unveränderter Größe und Änderungszeit zu erkennen und bei Bedarf einen Schnappschuss zu erstellen; Ressourcen werden dafür nicht heruntergeladen, große Arbeitsbereiche können mehr Zeit benötigen",
@@ -58,7 +60,6 @@
"loadAllAndSelectAll": "Gesamtes Dokument laden und alles auswählen",
"autoFitRowHeight": "Zeilenhöhe automatisch anpassen",
"backlinkDatabaseFields": "Datenbankfelder",
- "listMindmapCanvasBackground": "Hintergrund der Zeichenfläche",
"listMindmapClearManualColors": "Manuelle Farben löschen",
"listMindmapLineColor": "Farbe der Zweiglinien",
"lockScreenWallpaper": "Sperrbildschirm-Hintergrund",
diff --git a/app/appearance/langs/en.json b/app/appearance/langs/en.json
index 4066980482..a833669d32 100644
--- a/app/appearance/langs/en.json
+++ b/app/appearance/langs/en.json
@@ -1,4 +1,6 @@
{
+ "listMindmapLineColors": "Line colors",
+ "listMindmapFontHierarchy": "Font hierarchy",
"listMindmapDocumentLayout": "Document layout",
"fullCheckSnapshot": "Full content check",
"fullCheckSnapshotTip": "Read all local files to detect content changes even when size and modification time are unchanged, and create a snapshot if needed; resources are not downloaded for this check, and large workspaces may take longer",
@@ -58,7 +60,6 @@
"loadAllAndSelectAll": "Load full document and select all",
"autoFitRowHeight": "Auto-fit row height",
"backlinkDatabaseFields": "Database fields",
- "listMindmapCanvasBackground": "Canvas background",
"listMindmapClearManualColors": "Clear manual colors",
"listMindmapLineColor": "Branch line color",
"lockScreenWallpaper": "Lock screen wallpaper",
diff --git a/app/appearance/langs/es.json b/app/appearance/langs/es.json
index 1aa8c13aff..ba051c538e 100644
--- a/app/appearance/langs/es.json
+++ b/app/appearance/langs/es.json
@@ -1,4 +1,6 @@
{
+ "listMindmapLineColors": "Colores de línea",
+ "listMindmapFontHierarchy": "Jerarquía tipográfica",
"listMindmapDocumentLayout": "Diseño del documento",
"fullCheckSnapshot": "Comprobación completa del contenido",
"fullCheckSnapshotTip": "Leer todos los archivos locales para detectar cambios de contenido aunque no cambien el tamaño ni la fecha de modificación, y crear una instantánea si es necesario; no se descargan recursos para esta comprobación y los espacios de trabajo grandes pueden tardar más",
@@ -58,7 +60,6 @@
"loadAllAndSelectAll": "Cargar el documento completo y seleccionar todo",
"autoFitRowHeight": "Ajustar automáticamente la altura de fila",
"backlinkDatabaseFields": "Campos de la base de datos",
- "listMindmapCanvasBackground": "Fondo del lienzo",
"listMindmapClearManualColors": "Borrar colores manuales",
"listMindmapLineColor": "Color de las líneas de rama",
"lockScreenWallpaper": "Fondo de la pantalla de bloqueo",
diff --git a/app/appearance/langs/fr.json b/app/appearance/langs/fr.json
index a3cff138ed..0f8504dfa9 100644
--- a/app/appearance/langs/fr.json
+++ b/app/appearance/langs/fr.json
@@ -1,4 +1,6 @@
{
+ "listMindmapLineColors": "Couleurs des lignes",
+ "listMindmapFontHierarchy": "Hiérarchie typographique",
"listMindmapDocumentLayout": "Disposition du document",
"fullCheckSnapshot": "Vérification complète du contenu",
"fullCheckSnapshotTip": "Lire tous les fichiers locaux pour détecter les changements de contenu même si leur taille et leur date de modification restent identiques, puis créer un instantané si nécessaire ; aucune ressource n’est téléchargée pour cette vérification et les grands espaces de travail peuvent demander plus de temps",
@@ -58,7 +60,6 @@
"loadAllAndSelectAll": "Charger le document entier et tout sélectionner",
"autoFitRowHeight": "Ajuster automatiquement la hauteur de ligne",
"backlinkDatabaseFields": "Champs de la base de données",
- "listMindmapCanvasBackground": "Arrière-plan du canevas",
"listMindmapClearManualColors": "Effacer les couleurs manuelles",
"listMindmapLineColor": "Couleur des lignes de branche",
"lockScreenWallpaper": "Fond d’écran de verrouillage",
diff --git a/app/appearance/langs/he.json b/app/appearance/langs/he.json
index 1c21a08e2d..b08e4cde4c 100644
--- a/app/appearance/langs/he.json
+++ b/app/appearance/langs/he.json
@@ -1,4 +1,6 @@
{
+ "listMindmapLineColors": "צבעי קווים",
+ "listMindmapFontHierarchy": "גודל גופן לפי רמה",
"listMindmapDocumentLayout": "פריסת המסמך",
"fullCheckSnapshot": "בדיקת תוכן מלאה",
"fullCheckSnapshotTip": "קריאת כל הקבצים המקומיים לזיהוי שינויי תוכן גם כשהגודל וזמן השינוי נשארו זהים, ויצירת תמונת מצב לפי הצורך; משאבים לא יורדו לצורך הבדיקה, וסביבות עבודה גדולות עשויות לדרוש זמן רב יותר",
@@ -58,7 +60,6 @@
"loadAllAndSelectAll": "טעינת המסמך המלא ובחירת הכול",
"autoFitRowHeight": "התאמה אוטומטית של גובה השורה",
"backlinkDatabaseFields": "שדות מסד נתונים",
- "listMindmapCanvasBackground": "רקע הקנבס",
"listMindmapClearManualColors": "ניקוי צבעים ידניים",
"listMindmapLineColor": "צבע קווי הענפים",
"lockScreenWallpaper": "טפט מסך הנעילה",
diff --git a/app/appearance/langs/hi.json b/app/appearance/langs/hi.json
index fddd1e7064..a133e0779d 100644
--- a/app/appearance/langs/hi.json
+++ b/app/appearance/langs/hi.json
@@ -1,4 +1,6 @@
{
+ "listMindmapLineColors": "रेखाओं के रंग",
+ "listMindmapFontHierarchy": "स्तर के अनुसार फ़ॉन्ट आकार",
"listMindmapDocumentLayout": "दस्तावेज़ का लेआउट",
"fullCheckSnapshot": "सामग्री की पूरी जाँच",
"fullCheckSnapshotTip": "आकार और संशोधन समय समान रहने पर भी सामग्री में बदलाव खोजने के लिए सभी स्थानीय फ़ाइलें पढ़ें और ज़रूरत होने पर स्नैपशॉट बनाएँ; इस जाँच के लिए संसाधन डाउनलोड नहीं होंगे और बड़े कार्यक्षेत्रों में अधिक समय लग सकता है",
@@ -58,7 +60,6 @@
"loadAllAndSelectAll": "पूरा दस्तावेज़ लोड करें और सभी चुनें",
"autoFitRowHeight": "पंक्ति की ऊँचाई अपने आप समायोजित करें",
"backlinkDatabaseFields": "डेटाबेस फ़ील्ड",
- "listMindmapCanvasBackground": "कैनवास की पृष्ठभूमि",
"listMindmapClearManualColors": "मैन्युअल रंग साफ़ करें",
"listMindmapLineColor": "शाखा रेखा का रंग",
"lockScreenWallpaper": "लॉक स्क्रीन वॉलपेपर",
diff --git a/app/appearance/langs/id.json b/app/appearance/langs/id.json
index 73e4b55657..4fd89cf6a0 100644
--- a/app/appearance/langs/id.json
+++ b/app/appearance/langs/id.json
@@ -1,4 +1,6 @@
{
+ "listMindmapLineColors": "Warna garis",
+ "listMindmapFontHierarchy": "Hierarki ukuran huruf",
"listMindmapDocumentLayout": "Tata letak dokumen",
"fullCheckSnapshot": "Pemeriksaan isi menyeluruh",
"fullCheckSnapshotTip": "Baca semua berkas lokal untuk mendeteksi perubahan isi meskipun ukuran dan waktu modifikasi tetap sama, lalu buat snapshot jika diperlukan; sumber daya tidak diunduh untuk pemeriksaan ini dan ruang kerja besar dapat memerlukan waktu lebih lama",
@@ -58,7 +60,6 @@
"loadAllAndSelectAll": "Muat seluruh dokumen dan pilih semua",
"autoFitRowHeight": "Sesuaikan tinggi baris secara otomatis",
"backlinkDatabaseFields": "Bidang basis data",
- "listMindmapCanvasBackground": "Latar belakang kanvas",
"listMindmapClearManualColors": "Hapus warna manual",
"listMindmapLineColor": "Warna garis cabang",
"lockScreenWallpaper": "Wallpaper layar kunci",
diff --git a/app/appearance/langs/it.json b/app/appearance/langs/it.json
index 624bcb03c1..0098d5da50 100644
--- a/app/appearance/langs/it.json
+++ b/app/appearance/langs/it.json
@@ -1,4 +1,6 @@
{
+ "listMindmapLineColors": "Colori delle linee",
+ "listMindmapFontHierarchy": "Gerarchia tipografica",
"listMindmapDocumentLayout": "Layout del documento",
"fullCheckSnapshot": "Verifica completa del contenuto",
"fullCheckSnapshotTip": "Legge tutti i file locali per rilevare modifiche al contenuto anche se dimensioni e data di modifica restano invariate, creando un’istantanea se necessario; non vengono scaricate risorse per questa verifica e gli spazi di lavoro grandi possono richiedere più tempo",
@@ -58,7 +60,6 @@
"loadAllAndSelectAll": "Carica l'intero documento e seleziona tutto",
"autoFitRowHeight": "Adatta automaticamente l’altezza della riga",
"backlinkDatabaseFields": "Campi del database",
- "listMindmapCanvasBackground": "Sfondo della tela",
"listMindmapClearManualColors": "Cancella colori manuali",
"listMindmapLineColor": "Colore delle linee dei rami",
"lockScreenWallpaper": "Sfondo della schermata di blocco",
diff --git a/app/appearance/langs/ja.json b/app/appearance/langs/ja.json
index 37787165ac..196d9a3cd3 100644
--- a/app/appearance/langs/ja.json
+++ b/app/appearance/langs/ja.json
@@ -1,4 +1,6 @@
{
+ "listMindmapLineColors": "接続線の色",
+ "listMindmapFontHierarchy": "階層に応じた文字サイズ",
"listMindmapDocumentLayout": "ドキュメントのレイアウト",
"fullCheckSnapshot": "内容の完全チェック",
"fullCheckSnapshotTip": "ローカルの全ファイルを読み取り、サイズと更新日時が変わらない内容の変更も検出し、必要ならスナップショットを作成します。チェックのためのリソースのダウンロードは行わず、大きなワークスペースでは時間がかかる場合があります",
@@ -58,7 +60,6 @@
"loadAllAndSelectAll": "全文を読み込んですべて選択",
"autoFitRowHeight": "行の高さを自動調整",
"backlinkDatabaseFields": "データベースのフィールド",
- "listMindmapCanvasBackground": "キャンバスの背景",
"listMindmapClearManualColors": "手動の配色をクリア",
"listMindmapLineColor": "枝線の色",
"lockScreenWallpaper": "ロック画面の壁紙",
diff --git a/app/appearance/langs/ko.json b/app/appearance/langs/ko.json
index 5930a94319..cbb0b78ea5 100644
--- a/app/appearance/langs/ko.json
+++ b/app/appearance/langs/ko.json
@@ -1,4 +1,6 @@
{
+ "listMindmapLineColors": "연결선 색상",
+ "listMindmapFontHierarchy": "계층별 글꼴 크기",
"listMindmapDocumentLayout": "문서 레이아웃",
"fullCheckSnapshot": "전체 내용 검사",
"fullCheckSnapshotTip": "모든 로컬 파일을 읽어 크기와 수정 시간이 같아도 내용 변경을 감지하고 필요하면 스냅샷을 만듭니다. 검사를 위해 리소스를 다운로드하지 않으며 큰 작업 공간에서는 시간이 더 걸릴 수 있습니다",
@@ -58,7 +60,6 @@
"loadAllAndSelectAll": "전체 문서를 불러오고 모두 선택",
"autoFitRowHeight": "행 높이 자동 맞춤",
"backlinkDatabaseFields": "데이터베이스 필드",
- "listMindmapCanvasBackground": "캔버스 배경",
"listMindmapClearManualColors": "수동 색상 지우기",
"listMindmapLineColor": "분기 연결선 색상",
"lockScreenWallpaper": "잠금 화면 배경화면",
diff --git a/app/appearance/langs/nl.json b/app/appearance/langs/nl.json
index d4d956cfef..086bfbdf5d 100644
--- a/app/appearance/langs/nl.json
+++ b/app/appearance/langs/nl.json
@@ -1,4 +1,6 @@
{
+ "listMindmapLineColors": "Lijnkleuren",
+ "listMindmapFontHierarchy": "Lettergrootte per niveau",
"listMindmapDocumentLayout": "Documentindeling",
"fullCheckSnapshot": "Volledige inhoudscontrole",
"fullCheckSnapshotTip": "Lees alle lokale bestanden om inhoudswijzigingen te vinden, ook als grootte en wijzigingstijd gelijk blijven, en maak zo nodig een momentopname; bronnen worden hiervoor niet gedownload en grote werkruimten kunnen meer tijd kosten",
@@ -58,7 +60,6 @@
"loadAllAndSelectAll": "Volledig document laden en alles selecteren",
"autoFitRowHeight": "Rijhoogte automatisch aanpassen",
"backlinkDatabaseFields": "Databasevelden",
- "listMindmapCanvasBackground": "Canvasachtergrond",
"listMindmapClearManualColors": "Handmatige kleuren wissen",
"listMindmapLineColor": "Kleur van taklijnen",
"lockScreenWallpaper": "Achtergrond van het vergrendelscherm",
diff --git a/app/appearance/langs/pl.json b/app/appearance/langs/pl.json
index 3894f2201d..7830fc730b 100644
--- a/app/appearance/langs/pl.json
+++ b/app/appearance/langs/pl.json
@@ -1,4 +1,6 @@
{
+ "listMindmapLineColors": "Kolory linii",
+ "listMindmapFontHierarchy": "Rozmiar czcionki według poziomu",
"listMindmapDocumentLayout": "Układ dokumentu",
"fullCheckSnapshot": "Pełna kontrola zawartości",
"fullCheckSnapshotTip": "Odczytaj wszystkie pliki lokalne, aby wykryć zmiany zawartości mimo niezmienionego rozmiaru i czasu modyfikacji, i w razie potrzeby utwórz migawkę; zasoby nie są pobierane na potrzeby tej kontroli, a duże obszary robocze mogą wymagać więcej czasu",
@@ -58,7 +60,6 @@
"loadAllAndSelectAll": "Wczytaj cały dokument i zaznacz wszystko",
"autoFitRowHeight": "Automatycznie dopasuj wysokość wiersza",
"backlinkDatabaseFields": "Pola bazy danych",
- "listMindmapCanvasBackground": "Tło płótna",
"listMindmapClearManualColors": "Wyczyść ręczne kolory",
"listMindmapLineColor": "Kolor linii gałęzi",
"lockScreenWallpaper": "Tapeta ekranu blokady",
diff --git a/app/appearance/langs/pt-BR.json b/app/appearance/langs/pt-BR.json
index 7f56b29a33..33e160db7b 100644
--- a/app/appearance/langs/pt-BR.json
+++ b/app/appearance/langs/pt-BR.json
@@ -1,4 +1,6 @@
{
+ "listMindmapLineColors": "Cores das linhas",
+ "listMindmapFontHierarchy": "Hierarquia tipográfica",
"listMindmapDocumentLayout": "Layout do documento",
"fullCheckSnapshot": "Verificação completa do conteúdo",
"fullCheckSnapshotTip": "Ler todos os arquivos locais para detectar alterações no conteúdo mesmo com tamanho e data de modificação inalterados, e criar um instantâneo se necessário; recursos não são baixados para esta verificação e espaços de trabalho grandes podem demorar mais",
@@ -58,7 +60,6 @@
"loadAllAndSelectAll": "Carregar o documento completo e selecionar tudo",
"autoFitRowHeight": "Ajustar automaticamente a altura da linha",
"backlinkDatabaseFields": "Campos do banco de dados",
- "listMindmapCanvasBackground": "Fundo da tela",
"listMindmapClearManualColors": "Limpar cores manuais",
"listMindmapLineColor": "Cor das linhas dos ramos",
"lockScreenWallpaper": "Papel de parede da tela de bloqueio",
diff --git a/app/appearance/langs/ru.json b/app/appearance/langs/ru.json
index 3c5b1aa6ba..c453761e08 100644
--- a/app/appearance/langs/ru.json
+++ b/app/appearance/langs/ru.json
@@ -1,4 +1,6 @@
{
+ "listMindmapLineColors": "Цвета линий",
+ "listMindmapFontHierarchy": "Размер шрифта по уровням",
"listMindmapDocumentLayout": "Макет документа",
"fullCheckSnapshot": "Полная проверка содержимого",
"fullCheckSnapshotTip": "Прочитать все локальные файлы, чтобы найти изменения содержимого даже при неизменных размере и времени изменения, и при необходимости создать снимок; ресурсы для проверки не загружаются, а большие рабочие пространства могут потребовать больше времени",
@@ -58,7 +60,6 @@
"loadAllAndSelectAll": "Загрузить весь документ и выделить всё",
"autoFitRowHeight": "Автоподбор высоты строки",
"backlinkDatabaseFields": "Поля базы данных",
- "listMindmapCanvasBackground": "Фон холста",
"listMindmapClearManualColors": "Сбросить ручные цвета",
"listMindmapLineColor": "Цвет линий ветвей",
"lockScreenWallpaper": "Обои экрана блокировки",
diff --git a/app/appearance/langs/sk.json b/app/appearance/langs/sk.json
index fd8d5703cd..c10b4804ac 100644
--- a/app/appearance/langs/sk.json
+++ b/app/appearance/langs/sk.json
@@ -1,4 +1,6 @@
{
+ "listMindmapLineColors": "Farby čiar",
+ "listMindmapFontHierarchy": "Veľkosť písma podľa úrovne",
"listMindmapDocumentLayout": "Rozloženie dokumentu",
"fullCheckSnapshot": "Úplná kontrola obsahu",
"fullCheckSnapshotTip": "Prečítať všetky lokálne súbory na zistenie zmien obsahu aj pri nezmenenej veľkosti a čase úpravy a podľa potreby vytvoriť snímku; zdroje sa na túto kontrolu nesťahujú a veľké pracovné priestory môžu vyžadovať viac času",
@@ -58,7 +60,6 @@
"loadAllAndSelectAll": "Načítať celý dokument a vybrať všetko",
"autoFitRowHeight": "Automaticky prispôsobiť výšku riadka",
"backlinkDatabaseFields": "Polia databázy",
- "listMindmapCanvasBackground": "Pozadie plátna",
"listMindmapClearManualColors": "Vymazať ručné farby",
"listMindmapLineColor": "Farba čiar vetiev",
"lockScreenWallpaper": "Tapeta zamknutej obrazovky",
diff --git a/app/appearance/langs/sr.json b/app/appearance/langs/sr.json
index 01bed930d1..a8990656e0 100644
--- a/app/appearance/langs/sr.json
+++ b/app/appearance/langs/sr.json
@@ -1,4 +1,6 @@
{
+ "listMindmapLineColors": "Boje linija",
+ "listMindmapFontHierarchy": "Veličina fonta po nivoima",
"listMindmapDocumentLayout": "Распоред документа",
"fullCheckSnapshot": "Потпуна провера садржаја",
"fullCheckSnapshotTip": "Прочитајте све локалне датотеке да бисте открили промене садржаја и када су величина и време измене исти и по потреби направите снимак; ресурси се не преузимају ради ове провере, а велики радни простори могу захтевати више времена",
@@ -58,7 +60,6 @@
"loadAllAndSelectAll": "Учитај цео документ и изабери све",
"autoFitRowHeight": "Аутоматски прилагоди висину реда",
"backlinkDatabaseFields": "Поља базе података",
- "listMindmapCanvasBackground": "Позадина платна",
"listMindmapClearManualColors": "Обриши ручно подешене боје",
"listMindmapLineColor": "Боја линија грана",
"lockScreenWallpaper": "Позадина закључаног екрана",
diff --git a/app/appearance/langs/th.json b/app/appearance/langs/th.json
index 8d4731c38d..f123af372c 100644
--- a/app/appearance/langs/th.json
+++ b/app/appearance/langs/th.json
@@ -1,4 +1,6 @@
{
+ "listMindmapLineColors": "สีเส้น",
+ "listMindmapFontHierarchy": "ขนาดตัวอักษรตามลำดับชั้น",
"listMindmapDocumentLayout": "เค้าโครงเอกสาร",
"fullCheckSnapshot": "ตรวจสอบเนื้อหาทั้งหมด",
"fullCheckSnapshotTip": "อ่านไฟล์ภายในเครื่องทั้งหมดเพื่อตรวจหาการเปลี่ยนแปลงของเนื้อหา แม้ขนาดและเวลาแก้ไขจะเท่าเดิม และสร้างสแนปช็อตเมื่อจำเป็น โดยจะไม่ดาวน์โหลดทรัพยากรเพื่อการตรวจสอบนี้ และพื้นที่ทำงานขนาดใหญ่อาจใช้เวลานานขึ้น",
@@ -58,7 +60,6 @@
"loadAllAndSelectAll": "โหลดเอกสารทั้งหมดและเลือกทั้งหมด",
"autoFitRowHeight": "ปรับความสูงของแถวโดยอัตโนมัติ",
"backlinkDatabaseFields": "ฟิลด์ฐานข้อมูล",
- "listMindmapCanvasBackground": "พื้นหลังผืนผ้าใบ",
"listMindmapClearManualColors": "ล้างสีที่กำหนดเอง",
"listMindmapLineColor": "สีเส้นกิ่ง",
"lockScreenWallpaper": "ภาพพื้นหลังหน้าจอล็อก",
diff --git a/app/appearance/langs/tr.json b/app/appearance/langs/tr.json
index ec9b86967b..63f4b2b803 100644
--- a/app/appearance/langs/tr.json
+++ b/app/appearance/langs/tr.json
@@ -1,4 +1,6 @@
{
+ "listMindmapLineColors": "Çizgi renkleri",
+ "listMindmapFontHierarchy": "Düzeye göre yazı tipi boyutu",
"listMindmapDocumentLayout": "Belge düzeni",
"fullCheckSnapshot": "Tam içerik denetimi",
"fullCheckSnapshotTip": "Boyut ve değiştirilme zamanı aynı kalsa bile içerik değişikliklerini bulmak için tüm yerel dosyaları okuyun ve gerekirse anlık görüntü oluşturun; bu denetim için kaynaklar indirilmez ve büyük çalışma alanlarında daha uzun sürebilir",
@@ -58,7 +60,6 @@
"loadAllAndSelectAll": "Belgenin tamamını yükle ve tümünü seç",
"autoFitRowHeight": "Satır yüksekliğini otomatik sığdır",
"backlinkDatabaseFields": "Veritabanı alanları",
- "listMindmapCanvasBackground": "Tuval arka planı",
"listMindmapClearManualColors": "Elle ayarlanan renkleri temizle",
"listMindmapLineColor": "Dal çizgisi rengi",
"lockScreenWallpaper": "Kilit ekranı duvar kâğıdı",
diff --git a/app/appearance/langs/uk.json b/app/appearance/langs/uk.json
index fc2f9d0963..aa8258568a 100644
--- a/app/appearance/langs/uk.json
+++ b/app/appearance/langs/uk.json
@@ -1,4 +1,6 @@
{
+ "listMindmapLineColors": "Кольори ліній",
+ "listMindmapFontHierarchy": "Розмір шрифту за рівнями",
"listMindmapDocumentLayout": "Макет документа",
"fullCheckSnapshot": "Повна перевірка вмісту",
"fullCheckSnapshotTip": "Прочитати всі локальні файли, щоб виявити зміни вмісту навіть за незмінних розміру та часу зміни, і за потреби створити знімок; ресурси для перевірки не завантажуються, а великі робочі простори можуть потребувати більше часу",
@@ -58,7 +60,6 @@
"loadAllAndSelectAll": "Завантажити весь документ і виділити все",
"autoFitRowHeight": "Автоматично підібрати висоту рядка",
"backlinkDatabaseFields": "Поля бази даних",
- "listMindmapCanvasBackground": "Тло полотна",
"listMindmapClearManualColors": "Скинути ручні кольори",
"listMindmapLineColor": "Колір ліній гілок",
"lockScreenWallpaper": "Шпалери екрана блокування",
diff --git a/app/appearance/langs/zh-CN.json b/app/appearance/langs/zh-CN.json
index b2c575997e..efc0fe7adf 100644
--- a/app/appearance/langs/zh-CN.json
+++ b/app/appearance/langs/zh-CN.json
@@ -1,4 +1,6 @@
{
+ "listMindmapLineColors": "连线配色",
+ "listMindmapFontHierarchy": "字体层级",
"listMindmapDocumentLayout": "文档布局",
"fullCheckSnapshot": "完整校验",
"fullCheckSnapshotTip": "读取所有本地文件,检查大小和修改时间未变的内容变化,必要时创建快照;不会为校验主动下载资源,大型工作空间可能耗时较长",
@@ -58,7 +60,6 @@
"loadAllAndSelectAll": "加载全文并全选",
"autoFitRowHeight": "自适应行高",
"backlinkDatabaseFields": "数据库字段",
- "listMindmapCanvasBackground": "画布背景",
"listMindmapClearManualColors": "清除手工配色",
"listMindmapLineColor": "分支连线颜色",
"lockScreenWallpaper": "锁屏壁纸",
diff --git a/app/appearance/langs/zh-TW.json b/app/appearance/langs/zh-TW.json
index 07f369016f..8c802f6614 100644
--- a/app/appearance/langs/zh-TW.json
+++ b/app/appearance/langs/zh-TW.json
@@ -1,4 +1,6 @@
{
+ "listMindmapLineColors": "連線配色",
+ "listMindmapFontHierarchy": "字型層級",
"listMindmapDocumentLayout": "文件版面配置",
"fullCheckSnapshot": "完整校驗",
"fullCheckSnapshotTip": "讀取所有本機檔案,檢查大小與修改時間未變的內容變更,必要時建立快照;不會為校驗主動下載資源,大型工作空間可能耗時較長",
@@ -58,7 +60,6 @@
"loadAllAndSelectAll": "載入全文並全選",
"autoFitRowHeight": "自動調整列高",
"backlinkDatabaseFields": "資料庫欄位",
- "listMindmapCanvasBackground": "畫布背景",
"listMindmapClearManualColors": "清除手動配色",
"listMindmapLineColor": "分支連線顏色",
"lockScreenWallpaper": "鎖定畫面桌布",
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.sy
index a7f6dec062..3731aa4275 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": "20261024212002"
+ "updated": "20261025004433"
},
"Children": [
{
@@ -2052,7 +2052,7 @@
"HeadingLevel": 2,
"Properties": {
"id": "20210104091509-v1x69oc",
- "updated": "20261024212002"
+ "updated": "20261025004433"
},
"Children": [
{
@@ -2503,7 +2503,7 @@
"Type": "NodeHeading",
"Properties": {
"id": "20261024161816-kuq9j6z",
- "updated": "20261024195223"
+ "updated": "20261025004433"
},
"Children": [
{
@@ -2605,7 +2605,7 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20261022102848-11epv5y",
- "updated": "20261024195223"
+ "updated": "20261025004433"
},
"Children": [
{
@@ -2633,11 +2633,11 @@
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
- "TextMarkTextContent": "Theme"
+ "TextMarkTextContent": "Line colors"
},
{
"Type": "NodeText",
- "Data": " to choose from 47 color themes for the current map. Root and first-level nodes use colored backgrounds with white text; deeper nodes use transparent backgrounds, with black or white text chosen automatically for the canvas color. Branch lines inherit their first-level color and use a consistent width. In orthogonal and rounded styles, overlapping root trunk segments are painted in node order, with later branches covering earlier ones."
+ "Data": " to choose from 47 line palettes for the current map. Line coloring does not change node text or backgrounds; the canvas follows the application theme. Descendants inherit their first-level branch color and all levels use the same line width. In orthogonal and rounded styles, overlapping root trunk segments are painted in node order, with later branches covering earlier ones."
}
]
},
@@ -2646,12 +2646,12 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20261024161816-gukhw19",
- "updated": "20261024161816"
+ "updated": "20261025004433"
},
"Children": [
{
"Type": "NodeText",
- "Data": "Theme text and lines adapt to the canvas brightness. Reordering branches preserves their assigned colors. New nodes follow the map's palette automatically. Manual colors, font sizes, and font weights take precedence. Choosing Default removes the palette while preserving manual colors and the canvas background."
+ "Data": "Line colors adapt to the canvas brightness. Reordering branches preserves their assigned colors, and new nodes follow their branch palette. Manual colors and formatting take precedence. Choosing Default removes the line palette while preserving manual formatting and the font hierarchy setting."
}
]
},
@@ -2660,12 +2660,12 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20261024161816-89rv8gd",
- "updated": "20261024161816"
+ "updated": "20261025004433"
},
"Children": [
{
"Type": "NodeText",
- "Data": "Existing maps keep their saved colors; select the theme again to apply the new layered style. The theme does not change node content, structure, or folding states."
+ "Data": "Font hierarchy is off by default and can be enabled independently in Appearance to vary font sizes and emphasis by level. Existing maps keep their saved appearance until you choose a line palette or change Font hierarchy. That action switches to the new appearance, removes the previous automatic node and canvas colors, and preserves manual formatting. Node content, structure, and folding states remain unchanged."
}
]
},
@@ -2674,7 +2674,7 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20261022102848-3decujr",
- "updated": "20261024164212"
+ "updated": "20261025004433"
},
"Children": [
{
@@ -2699,33 +2699,6 @@
"Type": "NodeText",
"Data": " - "
},
- {
- "Type": "NodeTextMark",
- "TextMarkType": "kbd",
- "TextMarkTextContent": "Canvas background"
- },
- {
- "Type": "NodeText",
- "Data": " to choose a solid canvas background, or Default to follow the application theme. Use "
- },
- {
- "Type": "NodeTextMark",
- "TextMarkType": "kbd",
- "TextMarkTextContent": "More"
- },
- {
- "Type": "NodeText",
- "Data": " - "
- },
- {
- "Type": "NodeTextMark",
- "TextMarkType": "kbd",
- "TextMarkTextContent": "Appearance"
- },
- {
- "Type": "NodeText",
- "Data": " - "
- },
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
@@ -2742,12 +2715,12 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20261024164212-colf627",
- "updated": "20261024164212"
+ "updated": "20261025004433"
},
"Children": [
{
"Type": "NodeText",
- "Data": "This does not reset the canvas background or other formatting. Appearance changes are saved with the document, support undo and redo, and are included in SiYuan-format HTML and PDF previews."
+ "Data": "Clearing manual colors keeps other formatting and the font hierarchy setting. Appearance is saved with the document, supports undo and redo, and is included in SiYuan-format HTML and PDF previews."
}
]
},
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.sy
index 7ef417c56c..a6082d058b 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": "20261024212002"
+ "updated": "20261025004433"
},
"Children": [
{
@@ -2055,7 +2055,7 @@
"HeadingLevel": 2,
"Properties": {
"id": "20210104091228-wdpx6ev",
- "updated": "20261024212002"
+ "updated": "20261025004433"
},
"Children": [
{
@@ -2403,7 +2403,7 @@
"Type": "NodeHeading",
"Properties": {
"id": "20261024161816-ucbq2tw",
- "updated": "20261024195223"
+ "updated": "20261025004433"
},
"Children": [
{
@@ -2491,7 +2491,7 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20261022102848-idam1p2",
- "updated": "20261024195223"
+ "updated": "20261025004433"
},
"Children": [
{
@@ -2519,11 +2519,11 @@
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
- "TextMarkTextContent": "主题"
+ "TextMarkTextContent": "连线配色"
},
{
"Type": "NodeText",
- "Data": " 中为当前导图选择 47 种配色主题。根节点和一级节点使用色卡背景及白色文字,二级及后续节点使用透明背景,并根据画布颜色自动选择黑色或白色文字。后代连线继承所属一级分支的颜色,各层级连线粗细一致。折线和圆角折线的根节点主干按节点顺序叠加绘制,后绘制的分支颜色覆盖重叠部分。"
+ "Data": " 中为当前导图选择 47 种连线配色。连线配色不修改节点文字和背景,画布跟随应用主题。后代连线继承所属一级分支的颜色,各层级连线粗细一致。折线和圆角折线的根节点主干按节点顺序叠加绘制,后绘制的分支颜色覆盖重叠部分。"
}
]
},
@@ -2532,12 +2532,12 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20261024164212-wzhmiwn",
- "updated": "20261024164212"
+ "updated": "20261025004433"
},
"Children": [
{
"Type": "NodeText",
- "Data": "主题文字和连线会适配画布明暗。调整分支顺序会保留原有配色,新增节点自动跟随导图配色。手工设置的颜色、字号和字重优先于主题。选择默认可移除色卡,并保留手工配色和画布背景。旧导图保留原有配色,重新选择主题后应用新的分层样式。主题不会改变节点内容、结构或折叠状态。"
+ "Data": "连线颜色会适配画布明暗。调整分支顺序会保留原有配色,新增节点自动跟随分支配色。字体层级默认关闭,可在外观中独立开启,按层级调整字号和字重;手工颜色和格式优先。连线配色选择默认可移除色卡,并保留手工格式和字体层级设置。旧导图保留已保存的外观;主动选择连线配色或调整字体层级后,才切换到新外观,移除旧的自动节点和画布配色,保留手工格式。节点内容、结构和折叠状态保持不变。"
}
]
},
@@ -2546,7 +2546,7 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20261022102848-m1dh0tw",
- "updated": "20261022102848"
+ "updated": "20261025004433"
},
"Children": [
{
@@ -2571,33 +2571,6 @@
"Type": "NodeText",
"Data": " - "
},
- {
- "Type": "NodeTextMark",
- "TextMarkType": "kbd",
- "TextMarkTextContent": "画布背景"
- },
- {
- "Type": "NodeText",
- "Data": " 中选择纯色背景,选择默认则跟随应用主题。在 "
- },
- {
- "Type": "NodeTextMark",
- "TextMarkType": "kbd",
- "TextMarkTextContent": "更多"
- },
- {
- "Type": "NodeText",
- "Data": " - "
- },
- {
- "Type": "NodeTextMark",
- "TextMarkType": "kbd",
- "TextMarkTextContent": "外观"
- },
- {
- "Type": "NodeText",
- "Data": " - "
- },
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
@@ -2605,7 +2578,7 @@
},
{
"Type": "NodeText",
- "Data": " 中清除节点、层级连线、关系线和概要的手工配色,恢复使用色卡或默认颜色;画布背景和其他格式保持不变。外观随文档保存,支持撤销和重做,并用于思源格式的 HTML 和 PDF 预览。"
+ "Data": " 中清除节点、层级连线、关系线和概要的手工配色,恢复使用色卡或默认颜色,其他格式和字体层级设置保持不变。外观随文档保存,支持撤销和重做,并用于思源格式的 HTML 和 PDF 预览。"
}
]
},
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.sy
index 821f605810..fb5dbc2f55 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": "20261024212002"
+ "updated": "20261025004433"
},
"Children": [
{
@@ -2053,7 +2053,7 @@
"HeadingLevel": 2,
"Properties": {
"id": "20211226122008-731sqd6",
- "updated": "20261024212002"
+ "updated": "20261025004433"
},
"Children": [
{
@@ -2401,7 +2401,7 @@
"Type": "NodeHeading",
"Properties": {
"id": "20261024161816-ia87ag4",
- "updated": "20261024195223"
+ "updated": "20261025004433"
},
"Children": [
{
@@ -2489,7 +2489,7 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20261022102848-dz75ii8",
- "updated": "20261024195223"
+ "updated": "20261025004433"
},
"Children": [
{
@@ -2517,11 +2517,11 @@
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
- "TextMarkTextContent": "主題"
+ "TextMarkTextContent": "連線配色"
},
{
"Type": "NodeText",
- "Data": " 中為目前心智圖選擇 47 種配色主題。根節點和一級節點使用色卡背景及白色文字,二級及後續節點使用透明背景,並依畫布顏色自動選擇黑色或白色文字。後代連線繼承所屬一級分支的顏色,各層級連線粗細一致。折線和圓角折線的根節點主幹依節點順序疊加繪製,後繪製的分支顏色覆蓋重疊部分。"
+ "Data": " 中為目前心智圖選擇 47 種連線配色。連線配色不修改節點文字和背景,畫布跟隨應用程式主題。後代連線繼承所屬一級分支的顏色,各層級連線粗細一致。折線和圓角折線的根節點主幹依節點順序疊加繪製,後繪製的分支顏色覆蓋重疊部分。"
}
]
},
@@ -2530,12 +2530,12 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20261024164212-b6c6nnw",
- "updated": "20261024164212"
+ "updated": "20261025004433"
},
"Children": [
{
"Type": "NodeText",
- "Data": "主題文字與連線會配合畫布明暗調整。調整分支順序會保留原有配色,新增節點自動跟隨心智圖配色。手動設定的顏色、字級和字重優先於主題。選擇預設可移除色卡,並保留手動配色和畫布背景。既有心智圖保留原有配色,重新選擇主題後套用新的分層樣式。主題不會改變節點內容、結構或摺疊狀態。"
+ "Data": "連線顏色會配合畫布明暗調整。調整分支順序會保留原有配色,新增節點自動跟隨分支配色。字型層級預設關閉,可在外觀中獨立開啟,依層級調整字級和字重;手動顏色和格式優先。連線配色選擇預設可移除色卡,並保留手動格式和字型層級設定。既有心智圖保留已儲存的外觀;主動選擇連線配色或調整字型層級後,才切換到新外觀,移除舊的自動節點和畫布配色,保留手動格式。節點內容、結構和摺疊狀態保持不變。"
}
]
},
@@ -2544,7 +2544,7 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20261022102848-z2ij065",
- "updated": "20261022102848"
+ "updated": "20261025004433"
},
"Children": [
{
@@ -2569,33 +2569,6 @@
"Type": "NodeText",
"Data": " - "
},
- {
- "Type": "NodeTextMark",
- "TextMarkType": "kbd",
- "TextMarkTextContent": "畫布背景"
- },
- {
- "Type": "NodeText",
- "Data": " 中選擇純色背景,選擇預設則跟隨應用程式主題。在 "
- },
- {
- "Type": "NodeTextMark",
- "TextMarkType": "kbd",
- "TextMarkTextContent": "更多"
- },
- {
- "Type": "NodeText",
- "Data": " - "
- },
- {
- "Type": "NodeTextMark",
- "TextMarkType": "kbd",
- "TextMarkTextContent": "外觀"
- },
- {
- "Type": "NodeText",
- "Data": " - "
- },
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
@@ -2603,7 +2576,7 @@
},
{
"Type": "NodeText",
- "Data": " 中清除節點、階層連線、關係線和概要的手動配色,恢復使用色卡或預設顏色;畫布背景和其他格式保持不變。外觀隨文件儲存,支援復原和重做,並用於思源格式的 HTML 與 PDF 預覽。"
+ "Data": " 中清除節點、階層連線、關係線和概要的手動配色,恢復使用色卡或預設顏色,其他格式和字型層級設定保持不變。外觀隨文件儲存,支援復原和重做,並用於思源格式的 HTML 與 PDF 預覽。"
}
]
},
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.sy
index bc3d29b336..231c79f772 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": "20261024212002"
+ "updated": "20261025004433"
},
"Children": [
{
@@ -2177,7 +2177,7 @@
"Properties": {
"ID": "20240530101000-ch5e4vh",
"id": "20240530101000-1ev7xub",
- "updated": "20261024212002"
+ "updated": "20261025004433"
},
"Children": [
{
@@ -2604,7 +2604,7 @@
"Type": "NodeHeading",
"Properties": {
"id": "20261024161816-fjkvky7",
- "updated": "20261024195223"
+ "updated": "20261025004433"
},
"Children": [
{
@@ -2702,7 +2702,7 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20261022102848-sbqeaum",
- "updated": "20261024195223"
+ "updated": "20261025004433"
},
"Children": [
{
@@ -2726,11 +2726,11 @@
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
- "TextMarkTextContent": "テーマ"
+ "TextMarkTextContent": "接続線の色"
},
{
"Type": "NodeText",
- "Data": " で、現在のマップに 47 種類の配色テーマを選択できます。ルートと第 1 階層のノードは色付きの背景に白い文字を使い、第 2 階層以降は透明な背景を使い、キャンバスの色に応じて黒または白の文字を自動で選びます。子孫の接続線は所属する第 1 階層の色を継承し、すべての階層で同じ太さを使います。直角と角丸の接続線では、ルートの幹線をノード順に重ねて描画し、後のブランチの色で重なる部分を上書きします。"
+ "Data": " で、現在のマップに 47 種類の接続線の配色を選択できます。接続線の配色はノードの文字色や背景色を変更せず、キャンバスはアプリのテーマに従います。子孫の接続線は所属する第 1 階層の色を継承し、すべての階層で同じ太さを使います。直角と角丸の接続線では、ルートの幹線をノード順に重ねて描画し、後のブランチの色で重なる部分を上書きします。"
}
]
},
@@ -2739,12 +2739,12 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20261024161816-tbwn1pt",
- "updated": "20261024161816"
+ "updated": "20261025004433"
},
"Children": [
{
"Type": "NodeText",
- "Data": "ブランチの接続線はパレットで色分けし、幹の線を太く、深い階層の線を細くします。テーマの文字色と接続線はキャンバスの明暗に合わせて調整されます。並べ替えても割り当てた色は保持され、新しいノードも配色に従います。手動で設定した色、文字サイズ、文字の太さはテーマより優先されます。デフォルトを選ぶとパレットを解除し、手動の色と背景は保持します。"
+ "Data": "接続線の色はキャンバスの明暗に合わせて調整されます。並べ替えても割り当てた色は保持され、新しいノードも所属するブランチの配色に従います。手動で設定した色や書式が優先されます。デフォルトを選ぶと接続線のパレットを解除し、手動の書式と階層別文字サイズの設定を保持します。"
}
]
},
@@ -2753,12 +2753,12 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20261024161816-1utc3wo",
- "updated": "20261024161816"
+ "updated": "20261025004433"
},
"Children": [
{
"Type": "NodeText",
- "Data": "既存のマップは保存済みの配色を保持します。新しい階層別スタイルを適用するには、テーマを選び直してください。テーマはノードの内容、構造、折りたたみ状態を変更しません。"
+ "Data": "階層に応じた文字サイズは既定で無効です。スタイルで独立して有効にすると、階層に応じて文字の大きさと太さを変えられます。既存のマップは保存済みの外観を保持します。接続線の配色を選ぶか階層別文字サイズを切り替えると、新しい外観に移行し、以前の自動的なノード色とキャンバス色を解除します。手動の書式、ノードの内容、構造、折りたたみ状態は保持されます。"
}
]
},
@@ -2767,36 +2767,9 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20261022102848-lteviyd",
- "updated": "20261022102848"
+ "updated": "20261025004433"
},
"Children": [
- {
- "Type": "NodeTextMark",
- "TextMarkType": "kbd",
- "TextMarkTextContent": "詳細"
- },
- {
- "Type": "NodeText",
- "Data": " - "
- },
- {
- "Type": "NodeTextMark",
- "TextMarkType": "kbd",
- "TextMarkTextContent": "スタイル"
- },
- {
- "Type": "NodeText",
- "Data": " - "
- },
- {
- "Type": "NodeTextMark",
- "TextMarkType": "kbd",
- "TextMarkTextContent": "キャンバスの背景"
- },
- {
- "Type": "NodeText",
- "Data": " で単色の背景を選択できます。デフォルトではアプリのテーマに従います。"
- },
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
@@ -2822,7 +2795,7 @@
},
{
"Type": "NodeText",
- "Data": " で、ノード、階層の接続線、関連線、要約の手動配色を解除し、パレットまたは既定の色に戻せます。背景とその他の書式は保持されます。外観は文書とともに保存され、取り消しとやり直しに対応し、SiYuan 形式の HTML と PDF プレビューにも反映されます。"
+ "Data": " で、ノード、階層の接続線、関連線、要約の手動配色を解除し、パレットまたは既定の色に戻せます。その他の書式と階層別文字サイズの設定は保持されます。外観は文書とともに保存され、取り消しとやり直しに対応し、SiYuan 形式の HTML と PDF プレビューにも反映されます。"
}
]
},
diff --git a/app/src/menus/menuLayout.dom.test.ts b/app/src/menus/menuLayout.dom.test.ts
index 8435d256db..d1d40f83c1 100644
--- a/app/src/menus/menuLayout.dom.test.ts
+++ b/app/src/menus/menuLayout.dom.test.ts
@@ -291,7 +291,7 @@ const browserCases = async (sources: Record<string, string>, css: string) => {
dispose(submenus);
const appearance: typeof import("../protyle/render/listMindmap/appearance") = load("protyle/render/listMindmap/appearance");
- const labels: Record<string, string> = {theme: "Theme", default: "Default", ...Object.fromEntries(appearance.LIST_MINDMAP_PALETTES
+ const labels: Record<string, string> = {listMindmapLineColors: "Line colors", default: "Default", ...Object.fromEntries(appearance.LIST_MINDMAP_PALETTES
.map(preset => [preset.label, preset.id]))};
for (const touch of [false, true]) {
mobile = touch;
@@ -305,13 +305,13 @@ const browserCases = async (sources: Record<string, string>, css: string) => {
let changes = 0;
const menu = appearance.getListMindmapAppearanceMenu(metadata, update => { update(metadata); changes++; },
labels, {id: "connectorStyle"});
- instance.addItem((menu.submenu as IMenu[]).find(item => item.id === "theme"));
+ instance.addItem((menu.submenu as IMenu[]).find(item => item.id === "lineColors"));
if (touch) {
instance.fullscreen("bottom");
} else {
instance.popup({x: 280, y: 90});
}
- const parent = instance.element.querySelector<HTMLElement>('[data-id="theme"]');
+ const parent = instance.element.querySelector<HTMLElement>('[data-id="lineColors"]');
parent.dispatchEvent(new MouseEvent(touch ? "click" : "mouseover", {bubbles: true}));
await settle();
if (touch) {
diff --git a/app/src/protyle/render/listMindmap/appearance.test.ts b/app/src/protyle/render/listMindmap/appearance.test.ts
index 5e6633225b..69d69cb4e3 100644
--- a/app/src/protyle/render/listMindmap/appearance.test.ts
+++ b/app/src/protyle/render/listMindmap/appearance.test.ts
@@ -1,7 +1,7 @@
import * as assert from "node:assert/strict";
import test from "node:test";
import {assignListMindmapBranchColors, clearListMindmapManualColors, getListMindmapAppearanceMenu,
- getMindmapLineColor, getMindmapTextColor, isListMindmapAppearance, LIST_MINDMAP_CANVAS_COLORS,
+ getMindmapLineColor, getMindmapTextColor, isListMindmapAppearance,
LIST_MINDMAP_PALETTES, resolveListMindmapColors} from "./appearance";
import type {ListMindmapModel, ListMindmapNode} from "./model";
import {execFile} from "node:child_process";
@@ -11,6 +11,8 @@ import * as path from "node:path";
import {promisify} from "node:util";
import {ScriptTarget, transpileModule} from "typescript";
+const legacyCanvasColors = ["#bfdbfe", "#fecaca", "#bbf7d0", "#e9d5ff", "#fed7aa", "#a5f3fc"];
+
const legacyPalettes: {id: string, rootColor: string, colors: string[]}[] = JSON.parse(readFileSync(
path.join(__dirname, "../../../../tests/fixtures/list-mindmap-appearance-palettes.json"), "utf8"));
@@ -29,76 +31,90 @@ const makeModel = (): ListMindmapModel => {
test("appearance validates optional colors and rejects unsupported formats", () => {
assert.ok(isListMindmapAppearance({version: 1, palette: [], extension: "retained"}));
+ for (const fontHierarchy of [undefined, false, true]) {
+ assert.ok(isListMindmapAppearance({version: 1, palette: [], nodeStyle: "lines", fontHierarchy}));
+ }
for (const preset of LIST_MINDMAP_PALETTES) {
assert.ok(isListMindmapAppearance({version: 1, palette: preset.colors, rootColor: preset.rootColor, backgroundColor: "#AABBCC"}));
}
for (const value of [null, [], {}, {version: 2, palette: []}, {version: 1, palette: "red"},
{version: 1, palette: ["red"]}, {version: 1, palette: Array(25).fill("#123456")},
{version: 1, palette: [], backgroundColor: null}, {version: 1, palette: [], backgroundColor: "url(x)"},
+ ...[null, "true", 0, [], {}].map(fontHierarchy => ({version: 1, palette: [] as string[], fontHierarchy})),
...[null, "", "red", "url(x)", 123, []].map(rootColor => ({version: 1, palette: [] as string[], rootColor})),
...[null, "", "flat", "unknown", 123, []].map(nodeStyle => ({version: 1, palette: [] as string[], nodeStyle}))]) {
assert.equal(isListMindmapAppearance(value), false);
}
});
-test("all 47 reference palettes adapt filled and transparent node text without rewriting saved colors", () => {
- const luminance = (color: string) => color.match(/[a-f\d]{2}/gi).map(channel => parseInt(channel, 16) / 255)
- .map(channel => channel <= .04045 ? channel / 12.92 : ((channel + .055) / 1.055) ** 2.4)
- .reduce((sum, channel, index) => sum + channel * [.2126, .7152, .0722][index], 0);
- const contrast = (a: string, b: string) => (Math.max(luminance(a), luminance(b)) + .05) /
- (Math.min(luminance(a), luminance(b)) + .05);
+test("all 47 line palettes remain selectable without styling node text or backgrounds", () => {
assert.equal(LIST_MINDMAP_PALETTES.length, 47);
assert.equal(new Set(LIST_MINDMAP_PALETTES.map(preset => preset.id)).size, 47);
assert.equal(new Set(LIST_MINDMAP_PALETTES.map(preset => JSON.stringify(preset.colors))).size, 47);
const model = makeModel();
model.metadata.appearance = {version: 1, palette: [], backgroundColor: "#ffffff"};
model.metadata.nodes.a = {textColor: "red"};
- const themes = () => {
- const menu = getListMindmapAppearanceMenu(model.metadata, update => update(model.metadata), {},
- {id: "connectorStyle", label: "Connectors"});
- return (menu.submenu as IMenu[]).find(item => item.id === "theme").submenu as IMenu[];
- };
+ const menu = () => getListMindmapAppearanceMenu(model.metadata, update => update(model.metadata), {},
+ {id: "connectorStyle", label: "Connectors"}).submenu as IMenu[];
+ const palettes = () => menu().find(item => item.id === "lineColors").submenu as IMenu[];
+ assert.deepEqual(menu().map(item => item.id), ["lineColors", "connectorStyle", "fontHierarchy", "clearManualColors"]);
for (const preset of LIST_MINDMAP_PALETTES) {
- themes().find(item => item.id === preset.id).click(undefined, undefined);
+ palettes().find(item => item.id === preset.id).click(undefined, undefined);
model.metadata = JSON.parse(JSON.stringify(model.metadata));
- assert.deepEqual(themes().filter(item => item.checked).map(item => item.id), [preset.id]);
+ assert.deepEqual(palettes().filter(item => item.checked).map(item => item.id), [preset.id]);
assert.deepEqual(model.metadata.appearance.palette, preset.colors);
- assert.equal(model.metadata.appearance.rootColor, preset.rootColor);
- assert.equal(model.metadata.appearance.nodeStyle, "branch");
- assert.equal(preset.colors.length, 9, "the first reference swatch belongs to the root and the next nine to branches");
- assert.equal(model.metadata.appearance.backgroundColor, "#ffffff");
+ assert.equal(model.metadata.appearance.rootColor, undefined);
+ assert.equal(model.metadata.appearance.nodeStyle, "lines");
+ assert.equal(preset.colors.length, 9);
+ assert.equal(model.metadata.appearance.backgroundColor, undefined);
+ assert.equal(model.metadata.appearance.fontHierarchy, undefined);
assert.equal(model.metadata.nodes.a.textColor, "red");
- for (const canvas of ["#ffffff", "#1e1e1e", ...LIST_MINDMAP_CANVAS_COLORS]) {
- delete model.metadata.appearance.backgroundColor;
+ for (const canvas of ["#ffffff", "#1e1e1e", ...legacyCanvasColors]) {
const before = JSON.stringify(model.metadata);
const styles = resolveListMindmapColors(model, canvas);
- assert.deepEqual(["root", "a", "a1"].map(id => styles.get(id).textColor),
- [getMindmapTextColor(preset.rootColor), getMindmapTextColor(preset.colors[0]), getMindmapTextColor(canvas)]);
- for (const [id, style] of styles) {
- assert.ok(contrast(style.textColor, style.backgroundColor === "transparent" ? canvas : style.backgroundColor) >= 4.5,
- `${preset.id} ${id} has readable automatic text on its actual background`);
+ for (const style of styles.values()) {
+ assert.deepEqual(Object.keys(style).sort(), ["lineColor", "lineWidth"]);
+ assert.equal(style.lineWidth, 1.5);
}
- assert.deepEqual(["root", "a", "a1"].map(id => styles.get(id).backgroundColor),
- [preset.rootColor, preset.colors[0], "transparent"]);
- assert.deepEqual(["root", "a", "a1"].map(id => styles.get(id).lineWidth), [1.5, 1.5, 1.5]);
assert.equal(styles.get("a1").lineColor, preset.colors[0]);
- assert.equal(JSON.stringify(model.metadata), before, "canvas adaptation never rewrites saved colors");
- model.metadata.appearance.backgroundColor = "";
- assert.deepEqual(resolveListMindmapColors(model, canvas), styles, "default canvas follows the application");
- model.metadata.appearance.backgroundColor = canvas;
- assert.deepEqual(resolveListMindmapColors(model, canvas === "#1e1e1e" ? "#ffffff" : "#1e1e1e"), styles,
- "explicit canvas colors take precedence over the application theme");
+ assert.equal(styles.get("b1").lineColor, preset.colors[1]);
+ assert.equal(JSON.stringify(model.metadata), before, "reading new appearance never rewrites saved data");
}
- model.metadata.appearance.backgroundColor = "#ffffff";
}
});
-test("all reference theme names are translated in every bundled language and old presets leave the menu", () => {
+test("font hierarchy defaults off and toggles independently of line colors", () => {
+ const model = makeModel();
+ const menu = () => getListMindmapAppearanceMenu(model.metadata, update => update(model.metadata), {}, {}).submenu as IMenu[];
+ const toggle = () => menu().find(item => item.id === "fontHierarchy").click(undefined, undefined);
+ assert.equal(menu().find(item => item.id === "fontHierarchy").checked, false);
+ assert.equal(resolveListMindmapColors(model).size, 0);
+ toggle();
+ assert.equal(menu().find(item => item.id === "fontHierarchy").checked, true);
+ assert.deepEqual(model.metadata.appearance.palette, []);
+ const styles = resolveListMindmapColors(model);
+ assert.deepEqual(["root", "a", "a1"].map(id => styles.get(id).fontSize), [20, 16, 14]);
+ assert.deepEqual(["root", "a", "a1"].map(id => styles.get(id).bold), [true, true, false]);
+ assert.ok([...styles.values()].every(style => style.textColor === undefined && style.backgroundColor === undefined));
+ const palette = (menu().find(item => item.id === "lineColors").submenu as IMenu[]).find(item => item.id === "waves");
+ palette.click(undefined, undefined);
+ assert.equal(model.metadata.appearance.fontHierarchy, true, "changing line colors preserves the independent switch");
+ toggle();
+ assert.equal(menu().find(item => item.id === "fontHierarchy").checked, false);
+ assert.ok([...resolveListMindmapColors(model).values()].every(style => style.fontSize === undefined && style.bold === undefined));
+ assert.deepEqual(model.metadata.appearance.palette, LIST_MINDMAP_PALETTES[0].colors);
+ model.metadata = JSON.parse(JSON.stringify(model.metadata));
+ assert.equal(menu().find(item => item.id === "fontHierarchy").checked, false);
+});
+
+test("all line color names and the independent hierarchy control are translated in every language", () => {
const directory = path.join(__dirname, "../../../../appearance/langs");
for (const file of readdirSync(directory).filter(file => file.endsWith(".json"))) {
const labels = JSON.parse(readFileSync(path.join(directory, file), "utf8"));
const menu = getListMindmapAppearanceMenu(makeModel().metadata, () => {}, labels, {id: "connectorStyle"});
- const themes = (menu.submenu as IMenu[]).find(item => item.id === "theme").submenu as IMenu[];
+ const themes = (menu.submenu as IMenu[]).find(item => item.id === "lineColors").submenu as IMenu[];
+ assert.ok(labels.listMindmapLineColors?.trim());
+ assert.ok(labels.listMindmapFontHierarchy?.trim());
for (const preset of LIST_MINDMAP_PALETTES) {
assert.ok(labels[preset.label]?.trim(), `${file} translates ${preset.id}`);
assert.equal(themes.find(item => item.id === preset.id).label, labels[preset.label]);
@@ -122,19 +138,20 @@ for (const fixture of [
const before = JSON.stringify(model.metadata);
const menu = getListMindmapAppearanceMenu(model.metadata, update => update(model.metadata), {},
{id: "connectorStyle", label: "Connectors"});
- const themes = (menu.submenu as IMenu[]).find(item => item.id === "theme").submenu as IMenu[];
+ const themes = (menu.submenu as IMenu[]).find(item => item.id === "lineColors").submenu as IMenu[];
assert.deepEqual(themes.filter(item => item.checked).map(item => item.id), []);
assert.equal(resolveListMindmapColors(model).get("a").backgroundColor, previous[2]);
assert.equal(JSON.stringify(model.metadata), before, "opening the menu never migrates document colors");
themes.find(item => item.id === preset.id).click(undefined, undefined);
assert.deepEqual(model.metadata.appearance.palette, preset.colors);
- assert.equal(model.metadata.appearance.rootColor, preset.rootColor);
- assert.equal(model.metadata.appearance.backgroundColor, "#ffffff");
+ assert.equal(model.metadata.appearance.rootColor, undefined);
+ assert.equal(model.metadata.appearance.backgroundColor, undefined);
+ assert.equal(model.metadata.appearance.nodeStyle, "lines");
assert.deepEqual(model.metadata.nodes.a, {branchColor: 2, textColor: "#ff0000"});
});
}
-test("root colors are opt-in for every existing palette and preserve branch slots, manual styles and undo snapshots", () => {
+test("switching old palettes to line colors is explicit, undoable and preserves manual styles and branch slots", () => {
for (const preset of LIST_MINDMAP_PALETTES) {
const model = makeModel();
model.metadata.appearance = {version: 1, palette: [...preset.colors], backgroundColor: "#ffffff"};
@@ -145,17 +162,16 @@ test("root colors are opt-in for every existing palette and preserve branch slot
assert.equal(legacy.get("root").backgroundColor, legacy.get("a").backgroundColor);
const themes = () => getListMindmapAppearanceMenu(model.metadata, update => update(model.metadata), {},
{id: "connectorStyle", label: "Connectors"}).submenu as IMenu[];
- const paletteMenu = () => themes().find(item => item.id === "theme").submenu as IMenu[];
+ const paletteMenu = () => themes().find(item => item.id === "lineColors").submenu as IMenu[];
assert.equal(paletteMenu().find(item => item.id === preset.id).checked, false);
assert.equal(JSON.stringify(model.metadata), before, "reading and opening a menu never migrate old colors");
paletteMenu().find(item => item.id === preset.id).click(undefined, undefined);
const after = JSON.stringify(model.metadata);
const styled = resolveListMindmapColors(model);
- assert.equal(styled.get("root").backgroundColor, preset.rootColor);
- assert.equal(styled.get("root").lineColor, preset.rootColor);
- assert.equal(styled.get("a").backgroundColor, legacy.get("a").backgroundColor,
- "the first level retains the branch fill while deeper nodes become transparent");
- assert.equal(styled.get("a1").backgroundColor, "transparent");
+ assert.equal(styled.get("root").backgroundColor, undefined);
+ assert.equal(styled.get("root").lineColor, preset.colors[0]);
+ assert.equal(styled.get("a").backgroundColor, undefined);
+ assert.equal(styled.get("a1").backgroundColor, undefined);
assert.deepEqual(model.metadata.appearance.palette, preset.colors, "branch styling retains the saved branch palette");
assert.deepEqual(model.metadata.nodes.root, {backgroundColor: "#fed7aa", bold: true});
model.metadata = JSON.parse(before);
@@ -164,14 +180,12 @@ test("root colors are opt-in for every existing palette and preserve branch slot
assert.deepEqual(resolveListMindmapColors(model), styled, "redo and reload retain the independent root color");
clearListMindmapManualColors(model.metadata);
assert.deepEqual(model.metadata.nodes.root, {bold: true});
- assert.equal(model.metadata.appearance.rootColor, preset.rootColor, "clearing manual colors retains the root theme");
+ assert.equal(model.metadata.appearance.rootColor, undefined, "clearing manual colors does not create a root fill");
assert.equal(model.metadata.nodes.a.branchColor, 0);
assert.equal(model.metadata.nodes.b.branchColor, 1);
- model.metadata.appearance.rootColor = "#010203";
- assert.equal(paletteMenu().some(item => item.checked), false, "a different root color is not the built-in preset");
paletteMenu().find(item => item.id === "default").click(undefined, undefined);
assert.equal(model.metadata.appearance.rootColor, undefined);
- assert.equal(model.metadata.appearance.nodeStyle, undefined);
+ assert.equal(model.metadata.appearance.nodeStyle, "lines");
assert.equal(resolveListMindmapColors(model).size, 0);
}
});
@@ -183,7 +197,7 @@ test("layered palettes combine transparent nodes, neutral text, hierarchical typ
const contrast = (a: string, b: string) => (Math.max(luminance(a), luminance(b)) + .05) /
(Math.min(luminance(a), luminance(b)) + .05);
for (const preset of legacyPalettes) {
- for (const canvas of ["#ffffff", "#1e1e1e", ...LIST_MINDMAP_CANVAS_COLORS]) {
+ for (const canvas of ["#ffffff", "#1e1e1e", ...legacyCanvasColors]) {
const model = makeModel();
model.metadata.appearance = {version: 1, palette: [...preset.colors], rootColor: preset.rootColor, nodeStyle: "layered"};
assignListMindmapBranchColors(model);
@@ -281,7 +295,7 @@ test("theme lines contrast with every canvas preset while retaining sufficiently
const values = [luminance(line), luminance(background)];
return (Math.max(...values) + .05) / (Math.min(...values) + .05);
};
- for (const background of ["#ffffff", "#1e1e1e", ...LIST_MINDMAP_CANVAS_COLORS]) {
+ for (const background of ["#ffffff", "#1e1e1e", ...legacyCanvasColors]) {
for (const preset of LIST_MINDMAP_PALETTES) {
for (const color of [...preset.colors, preset.rootColor]) {
const adjusted = getMindmapLineColor(color, background);
@@ -310,14 +324,14 @@ test("appearance menu preserves manual colors and non-color metadata until expli
const entries = (build().submenu as IMenu[]).find(item => item.id === group).submenu as IMenu[];
entries.find(item => item.id === id).click(undefined, undefined);
};
- choose("theme", "waves");
+ choose("lineColors", "waves");
assert.equal(JSON.stringify(model.metadata.nodes), old);
- choose("canvasBackground", "dark");
- assert.equal(model.metadata.appearance.backgroundColor, "#1e1e1e");
- choose("theme", "dream");
- assert.equal(model.metadata.appearance.backgroundColor, "#1e1e1e");
- assert.equal(model.metadata.appearance.rootColor, LIST_MINDMAP_PALETTES[1].rootColor);
- choose("theme", "default");
+ assert.equal((build().submenu as IMenu[]).some(item => item.id === "canvasBackground" || item.id === "theme"), false);
+ model.metadata.appearance.backgroundColor = "#1e1e1e";
+ choose("lineColors", "dream");
+ assert.equal(model.metadata.appearance.backgroundColor, undefined);
+ assert.equal(model.metadata.appearance.rootColor, undefined);
+ choose("lineColors", "default");
assert.equal(model.metadata.appearance.rootColor, undefined);
assert.equal(resolveListMindmapColors(model).size, 0);
clearListMindmapManualColors(model.metadata);
@@ -325,7 +339,7 @@ test("appearance menu preserves manual colors and non-color metadata until expli
assert.deepEqual(model.metadata.relations[0], {id: "r", from: "a", to: "b", label: "Keep", width: 3});
assert.equal(model.metadata.summaries[0].label, "Keep");
assert.equal(model.metadata.summaries[0].color, undefined);
- assert.equal(model.metadata.appearance.backgroundColor, "#1e1e1e");
+ assert.equal(model.metadata.appearance.backgroundColor, undefined);
});
const contrastCases = async (source: string, css: string, legacyPresets: typeof legacyPalettes) => {
@@ -662,7 +676,59 @@ const contrastCases = async (source: string, css: string, legacyPresets: typeof
}
}
[quoteNode.taskMarker, deepNode.taskMarker] = originalTaskMarkers;
- model.metadata.appearance.palette = [];
+ const textSnapshot = () => [...view.nodeElements.values()].map((element: HTMLElement) => ({
+ color: getComputedStyle(element).color, background: getComputedStyle(element).backgroundColor,
+ fontSize: getComputedStyle(element).fontSize, weight: getComputedStyle(element).fontWeight,
+ content: [...element.querySelectorAll(".mindmap-view__content, .mindmap-view__content *")].map(child => {
+ const style = getComputedStyle(child);
+ return [style.color, style.backgroundColor, style.fontSize, style.fontWeight, style.textDecorationLine];
+ }),
+ }));
+ for (const printLayout of [false, true]) {
+ view.options.printLayout = view.readOnly = printLayout;
+ for (const background of ["#ffffff", "#1e1e1e"]) {
+ document.documentElement.style.setProperty("--b3-theme-background", background);
+ document.documentElement.style.setProperty("--b3-theme-on-background", background === "#ffffff" ? "#222222" : "#eeeeee");
+ delete model.metadata.appearance;
+ view.update(model);
+ const originalText = textSnapshot();
+ for (const preset of api.LIST_MINDMAP_PALETTES) {
+ model.metadata.appearance = {version: 1, palette: preset.colors, nodeStyle: "lines"};
+ const before = JSON.stringify(model.metadata);
+ view.update(model);
+ check.deepEqual(textSnapshot(), originalText,
+ `${preset.id} only changes lines, including rich text, tasks, quotes and inline colors`);
+ check.equal(view.viewport.style.backgroundColor, "", "the canvas follows the application theme");
+ for (const element of view.nodeElements.values()) {
+ check.equal(element.style.getPropertyValue("--mindmap-node-text-color"), "");
+ check.equal(element.classList.contains("mindmap-view__node--colored"), false);
+ }
+ widths.length = lines.length = 0;
+ view.draw();
+ check.ok(widths.length && widths.every(width => width === 1.5));
+ check.ok(lines.includes(computedColor(api.getMindmapLineColor(preset.colors[0], background))),
+ "line colors adapt to the real application canvas without modifying saved values");
+ check.equal(JSON.stringify(model.metadata), before);
+ }
+ for (const palette of [[], api.LIST_MINDMAP_PALETTES[0].colors]) {
+ model.metadata.appearance = {version: 1, palette, nodeStyle: "lines", fontHierarchy: true};
+ view.update(model);
+ check.deepEqual([model.root, emptyNode, deepNode].map(node => getComputedStyle(view.nodeElements.get(node.id)).fontSize),
+ ["20px", "16px", "14px"], "font hierarchy works independently of line coloring");
+ model.metadata.nodes[deepNode.id] = {fontSize: 23, bold: false, italic: true, textColor: "#c2410c", backgroundColor: "#a5f3fc"};
+ model.metadata.appearance.fontHierarchy = false;
+ view.update(model);
+ const deep = view.nodeElements.get(deepNode.id);
+ check.equal(deep.style.fontSize, "23px");
+ check.equal(deep.style.fontWeight, "400");
+ check.equal(deep.style.fontStyle, "italic");
+ check.equal(deep.style.color, "rgb(194, 65, 12)");
+ check.equal(deep.style.backgroundColor, "rgb(165, 243, 252)");
+ delete model.metadata.nodes[deepNode.id];
+ }
+ }
+ }
+ model.metadata.appearance = {version: 1, palette: [], nodeStyle: "lines"};
view.update(model);
view.nodeElements.forEach((element: HTMLElement) => {
check.equal(element.style.fontSize, "", "removing the theme restores legacy font sizing");
@@ -674,8 +740,8 @@ const contrastCases = async (source: string, css: string, legacyPresets: typeof
return "mindmap-contrast-ok";
};
-test("reference and legacy palettes keep readable foregrounds, hierarchy paths and manual overrides", {
- timeout: 20000,
+test("line palettes preserve editor styling while legacy themes, typography and manual overrides remain compatible", {
+ timeout: 30000,
skip: process.platform === "linux" && !process.env.DISPLAY && !process.env.WAYLAND_DISPLAY,
}, async () => {
const compile = (file: string) => transpileModule(readFileSync(path.join(__dirname, file), "utf8")
@@ -708,7 +774,7 @@ app.whenReady().then(async () => {
delete env.ELECTRON_RUN_AS_NODE;
try {
const result = await promisify(execFile)(require("electron") as string, [script],
- {env, windowsHide: true, timeout: 18000});
+ {env, windowsHide: true, timeout: 28000});
assert.match(result.stdout, /mindmap-contrast-ok/);
} finally {
rmSync(dir, {recursive: true, force: true});
diff --git a/app/src/protyle/render/listMindmap/appearance.ts b/app/src/protyle/render/listMindmap/appearance.ts
index b54d07f7f9..56817d7766 100644
--- a/app/src/protyle/render/listMindmap/appearance.ts
+++ b/app/src/protyle/render/listMindmap/appearance.ts
@@ -4,7 +4,8 @@ export interface ListMindmapAppearance {
version: 1;
palette: string[];
rootColor?: string;
- nodeStyle?: "layered" | "branch";
+ nodeStyle?: "layered" | "branch" | "lines";
+ fontHierarchy?: boolean;
backgroundColor?: string;
}
@@ -105,8 +106,6 @@ export const LIST_MINDMAP_PALETTES: {id: string, label: string, rootColor: strin
colors: ["#5100dc", "#33daca", "#0a5aff", "#fdb311", "#fc1c17", "#fc364f", "#f44f1f", "#2d39f5", "#67deff"]},
];
-export const LIST_MINDMAP_CANVAS_COLORS = ["#bfdbfe", "#fecaca", "#bbf7d0", "#e9d5ff", "#fed7aa", "#a5f3fc"];
-
export const isMindmapColor = (value: unknown): value is string =>
typeof value === "string" && /^#[0-9a-f]{6}$/i.test(value);
@@ -118,7 +117,8 @@ export const isListMindmapAppearance = (value: unknown): value is ListMindmapApp
return data.version === 1 && Array.isArray(data.palette) && data.palette.length <= 24 &&
data.palette.every(isMindmapColor) &&
(data.rootColor === undefined || isMindmapColor(data.rootColor)) &&
- (data.nodeStyle === undefined || data.nodeStyle === "layered" || data.nodeStyle === "branch") &&
+ (data.nodeStyle === undefined || data.nodeStyle === "layered" || data.nodeStyle === "branch" || data.nodeStyle === "lines") &&
+ (data.fontHierarchy === undefined || typeof data.fontHierarchy === "boolean") &&
(data.backgroundColor === undefined || data.backgroundColor === "" || isMindmapColor(data.backgroundColor));
};
@@ -199,18 +199,21 @@ export const getMindmapLineColor = (color: string, background: string) => getMin
export const resolveListMindmapColors = (model: ListMindmapModel, canvasColor?: string) => {
const result = new Map<string, ListMindmapNodeStyle>();
- const palette = model.metadata.appearance?.palette;
- if (!palette?.length) {
+ const appearance = model.metadata.appearance;
+ const palette = appearance?.palette;
+ if (!palette?.length && !(appearance?.nodeStyle === "lines" && appearance.fontHierarchy)) {
return result;
}
// 缺少独立根节点色的导图沿用色卡首色,读取时不改写已有外观。
- const appearance = model.metadata.appearance;
const background = getMindmapHexColor(appearance.backgroundColor || canvasColor || "#ffffff") || "#ffffff";
const foreground = getMindmapContrastColor(getMindmapLuminance(background) > .179 ? "#334155" : "#e2e8f0", background, 4.5);
const pending = [{node: model.root, color: appearance.rootColor || palette[0], level: 0}];
while (pending.length) {
const {node, color, level} = pending.pop();
- if (appearance.nodeStyle === "branch") {
+ if (appearance.nodeStyle === "lines") {
+ result.set(node.id, {lineColor: color, lineWidth: 1.5,
+ ...(appearance.fontHierarchy ? {fontSize: level === 0 ? 20 : level === 1 ? 16 : 14, bold: level < 2} : {})});
+ } else if (appearance.nodeStyle === "branch") {
result.set(node.id, {backgroundColor: level < 2 ? color : "transparent",
textColor: getMindmapTextColor(level < 2 ? color : background), lineColor: color,
fontSize: level === 0 ? 20 : level === 1 ? 16 : 14, bold: level < 2, lineWidth: 1.5});
@@ -228,6 +231,16 @@ export const resolveListMindmapColors = (model: ListMindmapModel, canvasColor?:
return result;
};
+// 新外观只影响连线和可选字号;仅在用户操作时退出旧主题,不改写读取到的旧配置。
+const useListMindmapLineAppearance = (metadata: ListMindmapMetadata) => {
+ const appearance = {...metadata.appearance, version: 1 as const, palette: metadata.appearance?.palette || [],
+ nodeStyle: "lines" as const};
+ delete appearance.rootColor;
+ delete appearance.backgroundColor;
+ metadata.appearance = appearance;
+ return appearance;
+};
+
export const clearListMindmapManualColors = (metadata: ListMindmapMetadata) => {
Object.values(metadata.nodes).forEach(style => {
delete style.textColor;
@@ -242,51 +255,40 @@ export const getListMindmapAppearanceMenu = (metadata: ListMindmapMetadata,
change: (update: (data: ListMindmapMetadata) => void) => void,
labels: Record<string, string>, connector: IMenu): IMenu => {
const palette = metadata.appearance?.palette || [];
- const background = metadata.appearance?.backgroundColor || "";
+ const fontHierarchy = metadata.appearance?.nodeStyle === "lines" ? !!metadata.appearance.fontHierarchy :
+ !!palette.length && !!metadata.appearance?.nodeStyle;
return {
id: "appearance", icon: "iconTheme", label: labels.appearance,
submenu: [
- {id: "theme", iconHTML: "", label: labels.theme,
+ {id: "lineColors", iconHTML: "", label: labels.listMindmapLineColors,
bind: element => element.style.setProperty("--b3-menu-items-max-height", "min(480px, 60vh)"),
submenu: [
{id: "default", iconHTML: '<span class="b3-menu__icon mindmap-view__theme-preview" aria-hidden="true"></span>',
label: labels.default, checked: !palette.length,
click: () => change(data => {
- data.appearance = {...data.appearance, version: 1, palette: []};
- delete data.appearance.rootColor;
- delete data.appearance.nodeStyle;
+ useListMindmapLineAppearance(data).palette = [];
})},
...LIST_MINDMAP_PALETTES.map(preset => {
- const colors = [preset.rootColor, ...preset.colors.filter((_color, index) => index % 2 === 0)];
+ const colors = preset.colors.filter((_color, index) => index % 2 === 0);
const gradient = colors.map((color, index) =>
`${color} ${index * 100 / colors.length}% ${(index + 1) * 100 / colors.length}%`).join(",");
return {
id: preset.id,
iconHTML: `<span class="b3-menu__icon b3-menu__icon--color mindmap-view__theme-preview" aria-hidden="true" style="background:linear-gradient(90deg,${gradient})"></span>`,
label: labels[preset.label],
- checked: metadata.appearance?.nodeStyle === "branch" &&
- metadata.appearance.rootColor === preset.rootColor &&
+ checked: metadata.appearance?.nodeStyle === "lines" &&
JSON.stringify(palette) === JSON.stringify(preset.colors),
click: () => change(data => {
- data.appearance = {...data.appearance, version: 1, palette: [...preset.colors],
- rootColor: preset.rootColor, nodeStyle: "branch"};
+ useListMindmapLineAppearance(data).palette = [...preset.colors];
}),
};
}),
]},
- {id: "canvasBackground", iconHTML: "", label: labels.listMindmapCanvasBackground, submenu: [
- {id: "default", color: "", label: labels.default},
- {id: "light", color: "#ffffff", label: labels.themeLight},
- {id: "dark", color: "#1e1e1e", label: labels.themeDark},
- ...LIST_MINDMAP_CANVAS_COLORS.map(color => ({id: color, color, label: color})),
- ].map(item => ({id: item.id,
- iconHTML: item.color ? `<span class="b3-menu__icon b3-menu__icon--color" style="background-color:${item.color}"></span>` : "",
- label: item.label, checked: background === item.color,
- click: () => change(data => {
- data.appearance = {...data.appearance, version: 1, palette: data.appearance?.palette || [],
- backgroundColor: item.color};
- })}))},
connector,
+ {id: "fontHierarchy", iconHTML: "", label: labels.listMindmapFontHierarchy, checked: fontHierarchy,
+ click: () => change(data => {
+ useListMindmapLineAppearance(data).fontHierarchy = !fontHierarchy;
+ })},
{id: "clearManualColors", iconHTML: "", label: labels.listMindmapClearManualColors,
click: () => change(clearListMindmapManualColors)},
],
diff --git a/app/src/protyle/render/listMindmap/arrows.test.ts b/app/src/protyle/render/listMindmap/arrows.test.ts
index 9089b83f8f..d641c97a88 100644
--- a/app/src/protyle/render/listMindmap/arrows.test.ts
+++ b/app/src/protyle/render/listMindmap/arrows.test.ts
@@ -163,15 +163,16 @@ test("palette colors reach hierarchy paths and parent trunks while manual line c
}
});
-test("reference themes paint root overlaps with branch colors in display order at one width in editing and print", () => {
- for (const connectorStyle of ["orthogonal", "rounded"]) {
+test("reference and line-only palettes paint root overlaps in display order at one width in editing and print", () => {
+ for (const {connectorStyle, nodeStyle} of ["orthogonal", "rounded"].flatMap(connectorStyle =>
+ ["branch", "lines"].map(nodeStyle => ({connectorStyle, nodeStyle})))) {
for (const printLayout of [false, true]) {
const {target, strokes, strokeStyles, strokeAlphas, strokeWidths} = setup();
target.model.root = {id: "root", children: [{id: "a", children: []},
{id: "b", children: [{id: "c", children: []}]}]};
Object.assign(target.model.metadata, {connectorStyle, relations: [],
nodes: {a: {branchColor: 0, lineColor: "#abcdef"}, b: {branchColor: 1}},
- appearance: {version: 1, palette: ["#ff0000", "#0000ff"], rootColor: "#111111", nodeStyle: "branch"}});
+ appearance: {version: 1, palette: ["#ff0000", "#0000ff"], rootColor: "#111111", nodeStyle}});
target.themeColors = resolveListMindmapColors(target.model);
target.options.printLayout = printLayout;
target.readOnly = printLayout;
diff --git a/app/src/protyle/render/listMindmap/clipboard.test.ts b/app/src/protyle/render/listMindmap/clipboard.test.ts
index d3dde3f12b..cb501a5985 100644
--- a/app/src/protyle/render/listMindmap/clipboard.test.ts
+++ b/app/src/protyle/render/listMindmap/clipboard.test.ts
@@ -48,12 +48,13 @@ const browserCases = async (source: string, css: string) => {
return list;
};
for (const {native, nodeStyle} of [true, false].flatMap(native =>
- ["layered", "branch"].map(nodeStyle => ({native, nodeStyle})))) {
+ ["layered", "branch", "lines"].map(nodeStyle => ({native, nodeStyle})))) {
const list = makeList(native);
const model = api.readListMindmap(list);
const [a, b, c] = model.root.children;
model.metadata.nodes[a.id] = {backgroundColor: "red"};
- model.metadata.appearance = {version: 1, palette: ["#2563eb", "#15803d"], rootColor: "#1e293b", nodeStyle, backgroundColor: "#1e1e1e"};
+ model.metadata.appearance = {version: 1, palette: ["#2563eb", "#15803d"], rootColor: "#1e293b", nodeStyle, backgroundColor: "#1e1e1e",
+ ...(nodeStyle === "lines" ? {fontHierarchy: true} : {})};
api.assignListMindmapBranchColors(model);
model.metadata.relations = [
{id: Lute.NewNodeID(), from: a.id, to: b.id, label: "Inside"},
@@ -74,10 +75,11 @@ const browserCases = async (source: string, css: string) => {
check.equal(selected.metadata.relations.length, 1);
check.equal(selected.metadata.summaries[0].parentId, payload.dataset.nodeId);
for (const {placement, destinationStyle} of ["child", "after"].flatMap(placement =>
- ["layered", "branch"].map(destinationStyle => ({placement, destinationStyle})))) {
+ ["layered", "branch", "lines"].map(destinationStyle => ({placement, destinationStyle})))) {
const destination = list.cloneNode(true) as HTMLElement;
const destinationModel = api.readListMindmap(destination);
- destinationModel.metadata.appearance = {version: 1, palette: ["#166534", "#047857"], rootColor: "#14532d", nodeStyle: destinationStyle, backgroundColor: "#ffffff"};
+ destinationModel.metadata.appearance = {version: 1, palette: ["#166534", "#047857"], rootColor: "#14532d", nodeStyle: destinationStyle, backgroundColor: "#ffffff",
+ ...(destinationStyle === "lines" ? {fontHierarchy: false} : {})};
api.writeListMindmapMetadata(destination, destinationModel.metadata);
const pasted = api.pasteMindmapBranches(destination, payload, c.id, placement, lute);
check.ok(pasted);
diff --git a/app/src/protyle/render/listMindmap/connectorMenu.test.ts b/app/src/protyle/render/listMindmap/connectorMenu.test.ts
index 96560dce4f..7210479859 100644
--- a/app/src/protyle/render/listMindmap/connectorMenu.test.ts
+++ b/app/src/protyle/render/listMindmap/connectorMenu.test.ts
@@ -136,7 +136,7 @@ test("desktop and mobile connector menus persist one undoable change and preserv
choose("bezier");
assert.equal(Object.hasOwn(data, "connectorStyle"), false, "restoring the default removes the optional field");
target.onSettingsMenu(anchor);
- const theme = (appearanceItem.submenu as IMenu[]).find(entry => entry.id === "theme");
+ const theme = (appearanceItem.submenu as IMenu[]).find(entry => entry.id === "lineColors");
const beforeTheme = list.outerHTML;
const beforeCount = transactions.length;
(theme.submenu as IMenu[]).find(entry => entry.id === "waves").click(undefined, undefined);
@@ -144,10 +144,10 @@ test("desktop and mobile connector menus persist one undoable change and preserv
assert.equal(transactions.at(-1).before, beforeTheme);
assert.equal(JSON.parse(list.outerHTML).nodes.child.lineColor, "red", "theme changes retain manual overrides");
assert.equal(JSON.parse(list.outerHTML).nodes.child.branchColor, 0, "branch slots are saved with the same snapshot");
- assert.equal(JSON.parse(list.outerHTML).appearance.rootColor, "#849695",
- "the root theme color is saved in the same document transaction on desktop and mobile");
- assert.equal(JSON.parse(list.outerHTML).appearance.nodeStyle, "branch",
- "the reference style is saved with the root and branch palette on both platforms");
+ assert.equal(JSON.parse(list.outerHTML).appearance.rootColor, undefined, "line colors do not set a root fill");
+ assert.equal(JSON.parse(list.outerHTML).appearance.nodeStyle, "lines",
+ "the line-only style is saved with its palette on both platforms");
+ assert.equal(JSON.parse(list.outerHTML).appearance.fontHierarchy, undefined, "font hierarchy defaults to off");
const themed = list.outerHTML;
data = JSON.parse(beforeTheme);
assert.equal(JSON.parse(list.outerHTML).appearance, undefined, "undo restores the unthemed document");
@@ -159,6 +159,12 @@ test("desktop and mobile connector menus persist one undoable change and preserv
assert.equal(updated.nodes.child.backgroundColor, "#fed7aa");
assert.equal(updated.nodes.child.lineColor, "red");
assert.equal(updated.nodes.deleted, undefined, "a stale selection cannot create orphan styles");
+ target.onSettingsMenu(anchor);
+ const hierarchy = (appearanceItem.submenu as IMenu[]).find(entry => entry.id === "fontHierarchy");
+ const beforeHierarchy = list.outerHTML;
+ hierarchy.click(undefined, undefined);
+ assert.equal(transactions.at(-1).before, beforeHierarchy);
+ assert.equal(JSON.parse(list.outerHTML).appearance.fontHierarchy, true);
const count = transactions.length;
editable = false;
choose("spline");
diff --git a/app/src/protyle/render/listMindmap/connectors.test.ts b/app/src/protyle/render/listMindmap/connectors.test.ts
index e1896f3b41..b56e25c66c 100644
--- a/app/src/protyle/render/listMindmap/connectors.test.ts
+++ b/app/src/protyle/render/listMindmap/connectors.test.ts
@@ -106,6 +106,24 @@ test("reference themes overlay root trunks in branch order and keep their shared
}
});
+test("line-only palettes overlay root trunks while keeping first-level connections below the text", () => {
+ for (const style of LIST_MINDMAP_CONNECTOR_STYLES) {
+ const result = buildListMindmapConnectors("root", positions, edges, style, () => new PathFixture(), false, true);
+ assert.equal(result.branches[0].path.commands.at(-1).at(-1), 40);
+ assert.equal(result.branches[2].path.commands[0].at(-1), 240);
+ if (style === "orthogonal" || style === "rounded") {
+ assert.deepEqual(result.trunkParents, ["b"]);
+ assert.ok(result.branches[0].trunk && result.branches[1].trunk);
+ const reordered = buildListMindmapConnectors("root", positions, [edges[1], edges[0], edges[2]],
+ style, () => new PathFixture(), false, true);
+ assert.deepEqual(reordered.branches.map(branch => branch.id), ["b", "a", "c"]);
+ assert.deepEqual(reordered.branches[0].trunk.commands, result.branches[1].trunk.commands);
+ } else {
+ assert.ok(result.branches.every(branch => !branch.trunk));
+ }
+ }
+});
+
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"};
diff --git a/app/src/protyle/render/listMindmap/connectors.ts b/app/src/protyle/render/listMindmap/connectors.ts
index 6a40d5c0a7..5883623261 100644
--- a/app/src/protyle/render/listMindmap/connectors.ts
+++ b/app/src/protyle/render/listMindmap/connectors.ts
@@ -42,7 +42,7 @@ export const buildListMindmapSummaryConnector = <T extends ConnectorPath>(
// 连线路径只使用已完成的节点布局,共享主干不进入分支的命中路径。
export const buildListMindmapConnectors = <T extends ConnectorPath>(
rootID: string, positions: Map<string, ListMindmapPosition>, edges: {from: string, to: string}[],
- style: ListMindmapConnectorStyle, makePath: () => T, branchTheme = false,
+ style: ListMindmapConnectorStyle, makePath: () => T, branchTheme = false, lineAppearance = false,
) => {
const trunks: T[] = [];
const trunkParents: string[] = [];
@@ -95,7 +95,7 @@ export const buildListMindmapConnectors = <T extends ConnectorPath>(
path.quadraticCurveTo(trunkX, endY, trunkX + corner, endY);
}
path.lineTo(to.x + to.width, endY);
- if (branchTheme && parentID === rootID) {
+ if ((branchTheme || lineAppearance) && parentID === rootID) {
const trunk = makePath();
trunk.moveTo(startX, startY);
trunk.lineTo(trunkX, startY);
@@ -105,7 +105,7 @@ export const buildListMindmapConnectors = <T extends ConnectorPath>(
branches.push({id: to.id, path});
}
});
- if (branchTheme && parentID === rootID) {
+ if ((branchTheme || lineAppearance) && parentID === rootID) {
return;
}
const trunk = makePath();
diff --git a/app/src/protyle/render/listMindmap/model.test.ts b/app/src/protyle/render/listMindmap/model.test.ts
index 3395a682a4..34362a79c7 100644
--- a/app/src/protyle/render/listMindmap/model.test.ts
+++ b/app/src/protyle/render/listMindmap/model.test.ts
@@ -192,12 +192,15 @@ test("appearance metadata is additive and rejects invalid palettes and branch sl
const appearance = {version: 1, palette: ["#123456", "#abcdef"], backgroundColor: "#ffffff", extension: "keep"};
const source = JSON.stringify({...base, appearance});
assert.equal(JSON.stringify(parseListMindmapMetadata(source)), source);
- for (const nodeStyle of ["layered", "branch"]) {
- const withRootColor = JSON.stringify({...base, appearance: {...appearance, rootColor: "#112233", nodeStyle}});
- assert.equal(JSON.stringify(parseListMindmapMetadata(withRootColor)), withRootColor);
+ for (const nodeStyle of ["layered", "branch", "lines"]) {
+ for (const fontHierarchy of [undefined, false, true]) {
+ const withRootColor = JSON.stringify({...base, appearance: {...appearance, rootColor: "#112233", nodeStyle, fontHierarchy}});
+ assert.equal(JSON.stringify(parseListMindmapMetadata(withRootColor)), withRootColor);
+ }
}
for (const invalid of [null, [], {}, {...appearance, version: 2}, {...appearance, palette: ["red"]},
{...appearance, backgroundColor: "url(x)"},
+ ...[null, "true", 0, [], {}].map(fontHierarchy => ({...appearance, fontHierarchy})),
...[null, "", "red", "url(x)", 123].map(rootColor => ({...appearance, rootColor})),
...[null, "", "flat", "unknown", 123].map(nodeStyle => ({...appearance, nodeStyle}))]) {
const value = JSON.stringify({...base, appearance: invalid});
@@ -3149,6 +3152,18 @@ const browserCases = async (sourceCode: string, css: string, taskSource: string,
const persistedBeforeFold = list.outerHTML;
pressDelete();
check.deepEqual(deletions, [beta]);
+ const settleFoldFrame = async () => {
+ await settle();
+ const deadline = performance.now() + 1000;
+ // 布局回调与首个动画帧可能共享时间戳,等待真实中间帧而不是假定两帧后已开始淡出。
+ while (readonly.stopFoldAnimation && performance.now() < deadline) {
+ const opacity = Number(nodeElement(alpha).style.opacity);
+ if (opacity > 0 && opacity < 1) {
+ break;
+ }
+ await frame();
+ }
+ };
const beforeCollapse = nodeElement(model.root.id).getBoundingClientRect();
const foldContext = readonly.canvas.getContext("2d");
const originalStroke = foldContext.stroke.bind(foldContext);
@@ -3162,7 +3177,7 @@ const browserCases = async (sourceCode: string, css: string, taskSource: string,
}
};
nodeElement(model.root.id).querySelector<HTMLButtonElement>(".mindmap-view__fold").click();
- await settle();
+ await settleFoldFrame();
if (!window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
check.ok(readonly.stopFoldAnimation, "a user fold starts a visible transition");
check.equal(nodeElement(alpha).hidden, false, "outgoing children remain visible during the transition");
@@ -3181,7 +3196,7 @@ const browserCases = async (sourceCode: string, css: string, taskSource: string,
check.equal(foldedButton.querySelector("span").textContent, String(model.nodes.size - 1));
check.equal(getComputedStyle(foldedButton).visibility, "visible");
foldedButton.click();
- await settle();
+ await settleFoldFrame();
if (!window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
check.ok(readonly.stopFoldAnimation,
"showing folded children must not let size observers end the expansion early");
diff --git a/app/src/protyle/render/listMindmap/view.ts b/app/src/protyle/render/listMindmap/view.ts
index 2dc3d54b27..c4c5fa8654 100644
--- a/app/src/protyle/render/listMindmap/view.ts
+++ b/app/src/protyle/render/listMindmap/view.ts
@@ -1026,23 +1026,28 @@ export class ListMindmapView {
if (this.destroyed) {
return;
}
- this.viewport.style.backgroundColor = this.model.metadata.appearance?.backgroundColor || "";
- const canvasForeground = this.model.metadata.appearance?.backgroundColor ?
- getMindmapTextColor(this.model.metadata.appearance.backgroundColor) : undefined;
+ const appearance = this.model.metadata.appearance;
+ const lineAppearance = appearance?.nodeStyle === "lines";
+ this.viewport.style.backgroundColor = !lineAppearance && appearance?.backgroundColor || "";
+ const canvasForeground = !lineAppearance && appearance?.backgroundColor ?
+ getMindmapTextColor(appearance.backgroundColor) : undefined;
this.themeColors = resolveListMindmapColors(this.model, getComputedStyle(this.options.host).backgroundColor);
this.nodeElements.forEach((element, id) => {
const style = this.model.metadata.nodes[id];
const themed = this.themeColors.get(id);
const background = style?.backgroundColor || themed?.backgroundColor || "";
- const adaptForeground = !!themed || !!canvasForeground;
+ const adaptForeground = !!themed && !lineAppearance || !!canvasForeground ||
+ lineAppearance && !!(style?.textColor || style?.backgroundColor);
element.classList.toggle("mindmap-view__node--colored", adaptForeground);
element.style.backgroundColor = background;
- element.style.color = style?.textColor || (adaptForeground && style?.backgroundColor && isMindmapColor(background) ?
+ element.style.color = style?.textColor || ((adaptForeground || lineAppearance) && style?.backgroundColor && isMindmapColor(background) ?
getMindmapTextColor(background) : themed?.textColor || canvasForeground) || "";
- element.style.fontSize = themed?.fontSize ? `${style?.fontSize ?? themed.fontSize}px` : "";
- element.style.fontWeight = themed?.fontSize ? (style?.bold === undefined ? (themed.bold ? "600" : "400") :
- style.bold ? "700" : "400") : "";
- element.style.fontStyle = themed?.fontSize && style?.italic !== undefined ? (style.italic ? "italic" : "normal") : "";
+ const inheritFont = lineAppearance || !!themed?.fontSize;
+ const fontSize = inheritFont ? style?.fontSize ?? themed?.fontSize : undefined;
+ element.style.fontSize = fontSize ? `${fontSize}px` : "";
+ const bold = inheritFont ? style?.bold ?? themed?.bold : undefined;
+ element.style.fontWeight = bold === undefined ? "" : bold ? (style?.bold ? "700" : "600") : "400";
+ element.style.fontStyle = inheritFont && style?.italic !== undefined ? (style.italic ? "italic" : "normal") : "";
if (adaptForeground) {
element.style.setProperty("--mindmap-node-text-color", element.style.color);
} else {
@@ -2064,8 +2069,9 @@ export class ListMindmapView {
baseWidth,
};
};
- const canvasColor = this.themeColors?.size ? resolveColor(this.model.metadata.appearance?.backgroundColor ||
- theme.getPropertyValue("--b3-theme-background").trim(), "#ffffff") : "";
+ const canvasColor = this.themeColors?.size ? resolveColor(this.model.metadata.appearance?.nodeStyle === "lines" ?
+ getComputedStyle(this.options.host).backgroundColor : this.model.metadata.appearance?.backgroundColor ||
+ theme.getPropertyValue("--b3-theme-background").trim(), "#ffffff") : "";
const paletteLines = new Map<string, string>();
const themeLineColor = (id: string) => {
const color = this.themeColors?.get(id)?.lineColor;
@@ -2077,7 +2083,7 @@ export class ListMindmapView {
};
const connectors = buildListMindmapConnectors(this.model.root.id, this.positions, this.edges,
this.model.metadata.connectorStyle || "bezier", () => new Path2D(),
- this.model.metadata.appearance?.nodeStyle === "branch");
+ this.model.metadata.appearance?.nodeStyle === "branch", this.model.metadata.appearance?.nodeStyle === "lines");
const trunkOpacities = new Map<string, number>();
if (this.foldOpacities) {
this.edges.forEach(edge => {
diff --git a/kernel/model/transaction_mindmap_appearance.go b/kernel/model/transaction_mindmap_appearance.go
index 4755027b97..4b22c76fb1 100644
--- a/kernel/model/transaction_mindmap_appearance.go
+++ b/kernel/model/transaction_mindmap_appearance.go
@@ -26,9 +26,14 @@ func validListMindmapAppearance(value any) bool {
return false
}
}
- if value, exists := data["nodeStyle"]; exists && value != "layered" && value != "branch" {
+ if value, exists := data["nodeStyle"]; exists && value != "layered" && value != "branch" && value != "lines" {
return false
}
+ if value, exists := data["fontHierarchy"]; exists {
+ if _, ok := value.(bool); !ok {
+ return false
+ }
+ }
if value, exists := data["backgroundColor"]; exists {
color, ok := value.(string)
if !ok || color != "" && !listMindmapColorPattern.MatchString(color) {
diff --git a/kernel/model/transaction_mindmap_appearance_crypto_test.go b/kernel/model/transaction_mindmap_appearance_crypto_test.go
index 13f305ba9e..b7683dc9d3 100644
--- a/kernel/model/transaction_mindmap_appearance_crypto_test.go
+++ b/kernel/model/transaction_mindmap_appearance_crypto_test.go
@@ -6,6 +6,7 @@ import (
"bytes"
"context"
"encoding/json"
+ "html"
"io"
"os"
"os/exec"
@@ -91,7 +92,13 @@ func TestListMindmapAppearanceEncrypted(t *testing.T) {
styled, _ := json.Marshal(data)
appearance["nodeStyle"] = "branch"
referenceStyled, _ := json.Marshal(data)
- for _, value := range []string{string(legacyStyled), string(styled), string(referenceStyled), string(styled), original, string(referenceStyled)} {
+ appearance["nodeStyle"] = "lines"
+ appearance["fontHierarchy"] = true
+ delete(appearance, "rootColor")
+ delete(appearance, "backgroundColor")
+ lineStyled, _ := json.Marshal(data)
+ for _, value := range []string{string(legacyStyled), string(styled), string(referenceStyled), string(lineStyled),
+ string(referenceStyled), string(styled), original, string(lineStyled)} {
attrs, _ := json.Marshal(map[string]string{listMindmapMetadataAttr: value})
tx := &Transaction{DoOperations: []*Operation{{Action: "setAttrs", ID: list.ID, Data: string(attrs)}}}
if err = PerformTxSync(tx); err != nil {
@@ -126,11 +133,32 @@ func TestListMindmapAppearanceEncrypted(t *testing.T) {
}
exported, err := io.ReadAll(reader)
_ = reader.Close()
- if err != nil || !json.Valid(exported) || !bytes.Contains(exported, []byte("#2563eb")) ||
- !bytes.Contains(exported, []byte("#1e293b")) || !bytes.Contains(exported, []byte("branch")) ||
- !bytes.Contains(exported, []byte("Legacy summary")) {
+ if err != nil || !json.Valid(exported) || !bytes.Contains(exported, []byte("Legacy summary")) {
t.Fatalf("export lost the appearance or legacy content: %v", err)
}
+ type exportedBlock struct {
+ ID string `json:"ID"`
+ Properties map[string]string `json:"Properties"`
+ Children []*exportedBlock `json:"Children"`
+ }
+ var exportedRoot exportedBlock
+ if err = json.Unmarshal(exported, &exportedRoot); err != nil {
+ t.Fatal(err)
+ }
+ exportedMetadata := ""
+ var findMetadata func(*exportedBlock)
+ findMetadata = func(node *exportedBlock) {
+ if node.ID == list.ID {
+ exportedMetadata = html.UnescapeString(node.Properties[listMindmapMetadataAttr])
+ }
+ for _, child := range node.Children {
+ findMetadata(child)
+ }
+ }
+ findMetadata(&exportedRoot)
+ if exportedMetadata != string(lineStyled) {
+ t.Fatalf("export lost line colors, typography or unrelated metadata: got %q, want %q", exportedMetadata, lineStyled)
+ }
if err = RollbackDocHistory(relative); err != nil {
t.Fatal(err)
}
diff --git a/kernel/model/transaction_mindmap_appearance_test.go b/kernel/model/transaction_mindmap_appearance_test.go
index db770d6574..4369a096d4 100644
--- a/kernel/model/transaction_mindmap_appearance_test.go
+++ b/kernel/model/transaction_mindmap_appearance_test.go
@@ -9,7 +9,8 @@ import (
func TestPruneListMindmapAppearance(t *testing.T) {
for _, version := range []string{"1", "2"} {
for _, rootColor := range []string{"", `"rootColor":"#112233",`, `"rootColor":"#112233","nodeStyle":"layered",`,
- `"rootColor":"#112233","nodeStyle":"branch",`} {
+ `"rootColor":"#112233","nodeStyle":"branch",`, `"nodeStyle":"lines","fontHierarchy":false,`,
+ `"nodeStyle":"lines","fontHierarchy":true,`} {
_, list, _ := mindmapTestTree()
appearance := `{"version":1,` + rootColor + `"palette":["#123456","#abcdef"],"backgroundColor":"#ffffff","extension":9007199254740993}`
original := `{"version":` + version + `,"appearance":` + appearance +
@@ -29,7 +30,9 @@ func TestPruneListMindmapAppearance(t *testing.T) {
`{"version":1,"palette":[],"rootColor":null}`, `{"version":1,"palette":[],"rootColor":""}`,
`{"version":1,"palette":[],"rootColor":"red"}`, `{"version":1,"palette":[],"rootColor":"url(x)"}`,
`{"version":1,"palette":[],"rootColor":123}`, `{"version":1,"palette":[],"nodeStyle":null}`,
- `{"version":1,"palette":[],"nodeStyle":"unknown"}`, `{"version":1,"palette":[],"nodeStyle":[]}`} {
+ `{"version":1,"palette":[],"nodeStyle":"unknown"}`, `{"version":1,"palette":[],"nodeStyle":[]}`,
+ `{"version":1,"palette":[],"fontHierarchy":null}`, `{"version":1,"palette":[],"fontHierarchy":"true"}`,
+ `{"version":1,"palette":[],"fontHierarchy":0}`, `{"version":1,"palette":[],"fontHierarchy":[]}`} {
data := strings.Replace(original, appearance, invalid, 1)
list.SetIALAttr(listMindmapMetadataAttr, data)
if next, changed := pruneListMindmapMetadata(list); changed || next != data {
@@ -51,7 +54,9 @@ func TestValidListMindmapAppearance(t *testing.T) {
for _, source := range []string{`{"version":1,"palette":[]}`, `{"version":1,"palette":["#AbCdEf"],"backgroundColor":""}`,
`{"version":1,"palette":["#AbCdEf"],"rootColor":"#112233"}`, `{"version":1,"palette":[],"rootColor":"#AABBCC"}`,
`{"version":1,"palette":["#AbCdEf"],"rootColor":"#112233","nodeStyle":"layered"}`,
- `{"version":1,"palette":["#AbCdEf"],"rootColor":"#112233","nodeStyle":"branch"}`} {
+ `{"version":1,"palette":["#AbCdEf"],"rootColor":"#112233","nodeStyle":"branch"}`,
+ `{"version":1,"palette":["#AbCdEf"],"nodeStyle":"lines","fontHierarchy":false}`,
+ `{"version":1,"palette":[],"nodeStyle":"lines","fontHierarchy":true}`} {
var value any
_ = json.Unmarshal([]byte(source), &value)
if !validListMindmapAppearance(value) {