Skip to content

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

:art: Expand mind map palettes and improve color readability https://github.com/siyuan-note/siyuan/issues/20800

Danielc38fafb59f99
diff --git a/app/appearance/langs/ar.json b/app/appearance/langs/ar.json
index ef0afe75ce..f6cfc66795 100644
--- a/app/appearance/langs/ar.json
+++ b/app/appearance/langs/ar.json
@@ -1,4 +1,8 @@
{
+ "listMindmapPaletteOcean": "محيط",
+ "listMindmapPaletteSunset": "غروب",
+ "listMindmapPaletteLavender": "لافندر",
+ "listMindmapPaletteMonochrome": "أبيض وأسود",
"listMindmapPaletteColorful": "متعدد الألوان",
"listMindmapPaletteSoft": "ناعم",
"listMindmapPaletteForest": "غابة",
diff --git a/app/appearance/langs/de.json b/app/appearance/langs/de.json
index 01fa0d1d3b..2084f76dc9 100644
--- a/app/appearance/langs/de.json
+++ b/app/appearance/langs/de.json
@@ -1,4 +1,8 @@
{
+ "listMindmapPaletteOcean": "Ozean",
+ "listMindmapPaletteSunset": "Sonnenuntergang",
+ "listMindmapPaletteLavender": "Lavendel",
+ "listMindmapPaletteMonochrome": "Schwarzweiß",
"listMindmapPaletteColorful": "Bunt",
"listMindmapPaletteSoft": "Sanft",
"listMindmapPaletteForest": "Wald",
diff --git a/app/appearance/langs/en.json b/app/appearance/langs/en.json
index e653fae997..d741a976d5 100644
--- a/app/appearance/langs/en.json
+++ b/app/appearance/langs/en.json
@@ -1,4 +1,8 @@
{
+ "listMindmapPaletteOcean": "Ocean",
+ "listMindmapPaletteSunset": "Sunset",
+ "listMindmapPaletteLavender": "Lavender",
+ "listMindmapPaletteMonochrome": "Monochrome",
"listMindmapPaletteColorful": "Colorful",
"listMindmapPaletteSoft": "Soft",
"listMindmapPaletteForest": "Forest",
diff --git a/app/appearance/langs/es.json b/app/appearance/langs/es.json
index 707cc7a873..2059dc7612 100644
--- a/app/appearance/langs/es.json
+++ b/app/appearance/langs/es.json
@@ -1,4 +1,8 @@
{
+ "listMindmapPaletteOcean": "Océano",
+ "listMindmapPaletteSunset": "Atardecer",
+ "listMindmapPaletteLavender": "Lavanda",
+ "listMindmapPaletteMonochrome": "Blanco y negro",
"listMindmapPaletteColorful": "Multicolor",
"listMindmapPaletteSoft": "Suave",
"listMindmapPaletteForest": "Bosque",
diff --git a/app/appearance/langs/fr.json b/app/appearance/langs/fr.json
index 79df9c5725..c5be57b1f6 100644
--- a/app/appearance/langs/fr.json
+++ b/app/appearance/langs/fr.json
@@ -1,4 +1,8 @@
{
+ "listMindmapPaletteOcean": "Océan",
+ "listMindmapPaletteSunset": "Coucher de soleil",
+ "listMindmapPaletteLavender": "Lavande",
+ "listMindmapPaletteMonochrome": "Noir et blanc",
"listMindmapPaletteColorful": "Multicolore",
"listMindmapPaletteSoft": "Doux",
"listMindmapPaletteForest": "Forêt",
diff --git a/app/appearance/langs/he.json b/app/appearance/langs/he.json
index 18784a3e96..253816c2fc 100644
--- a/app/appearance/langs/he.json
+++ b/app/appearance/langs/he.json
@@ -1,4 +1,8 @@
{
+ "listMindmapPaletteOcean": "אוקיינוס",
+ "listMindmapPaletteSunset": "שקיעה",
+ "listMindmapPaletteLavender": "לבנדר",
+ "listMindmapPaletteMonochrome": "שחור לבן",
"listMindmapPaletteColorful": "צבעוני",
"listMindmapPaletteSoft": "רך",
"listMindmapPaletteForest": "יער",
diff --git a/app/appearance/langs/hi.json b/app/appearance/langs/hi.json
index eaa5ddf3d3..71c8d97465 100644
--- a/app/appearance/langs/hi.json
+++ b/app/appearance/langs/hi.json
@@ -1,4 +1,8 @@
{
+ "listMindmapPaletteOcean": "महासागर",
+ "listMindmapPaletteSunset": "सूर्यास्त",
+ "listMindmapPaletteLavender": "लैवेंडर",
+ "listMindmapPaletteMonochrome": "श्वेत-श्याम",
"listMindmapPaletteColorful": "रंगीन",
"listMindmapPaletteSoft": "सौम्य",
"listMindmapPaletteForest": "वन",
diff --git a/app/appearance/langs/id.json b/app/appearance/langs/id.json
index 74116f5c53..b60543e37e 100644
--- a/app/appearance/langs/id.json
+++ b/app/appearance/langs/id.json
@@ -1,4 +1,8 @@
{
+ "listMindmapPaletteOcean": "Samudra",
+ "listMindmapPaletteSunset": "Senja",
+ "listMindmapPaletteLavender": "Lavendel",
+ "listMindmapPaletteMonochrome": "Hitam putih",
"listMindmapPaletteColorful": "Warna-warni",
"listMindmapPaletteSoft": "Lembut",
"listMindmapPaletteForest": "Hutan",
diff --git a/app/appearance/langs/it.json b/app/appearance/langs/it.json
index b3701f675f..ba4ac4ee87 100644
--- a/app/appearance/langs/it.json
+++ b/app/appearance/langs/it.json
@@ -1,4 +1,8 @@
{
+ "listMindmapPaletteOcean": "Oceano",
+ "listMindmapPaletteSunset": "Tramonto",
+ "listMindmapPaletteLavender": "Lavanda",
+ "listMindmapPaletteMonochrome": "Bianco e nero",
"listMindmapPaletteColorful": "Multicolore",
"listMindmapPaletteSoft": "Tenue",
"listMindmapPaletteForest": "Foresta",
diff --git a/app/appearance/langs/ja.json b/app/appearance/langs/ja.json
index 562f408222..cfc1bdea99 100644
--- a/app/appearance/langs/ja.json
+++ b/app/appearance/langs/ja.json
@@ -1,4 +1,8 @@
{
+ "listMindmapPaletteOcean": "海",
+ "listMindmapPaletteSunset": "夕日",
+ "listMindmapPaletteLavender": "ラベンダー",
+ "listMindmapPaletteMonochrome": "モノクロ",
"listMindmapPaletteColorful": "カラフル",
"listMindmapPaletteSoft": "ソフト",
"listMindmapPaletteForest": "フォレスト",
diff --git a/app/appearance/langs/ko.json b/app/appearance/langs/ko.json
index c22a895501..98659c95e2 100644
--- a/app/appearance/langs/ko.json
+++ b/app/appearance/langs/ko.json
@@ -1,4 +1,8 @@
{
+ "listMindmapPaletteOcean": "바다",
+ "listMindmapPaletteSunset": "일몰",
+ "listMindmapPaletteLavender": "라벤더",
+ "listMindmapPaletteMonochrome": "흑백",
"listMindmapPaletteColorful": "다채로운 색상",
"listMindmapPaletteSoft": "부드러운 색상",
"listMindmapPaletteForest": "숲",
diff --git a/app/appearance/langs/nl.json b/app/appearance/langs/nl.json
index ae2ed1fe93..9ac572652d 100644
--- a/app/appearance/langs/nl.json
+++ b/app/appearance/langs/nl.json
@@ -1,4 +1,8 @@
{
+ "listMindmapPaletteOcean": "Oceaan",
+ "listMindmapPaletteSunset": "Zonsondergang",
+ "listMindmapPaletteLavender": "Lavendel",
+ "listMindmapPaletteMonochrome": "Zwart-wit",
"listMindmapPaletteColorful": "Kleurrijk",
"listMindmapPaletteSoft": "Zacht",
"listMindmapPaletteForest": "Bos",
diff --git a/app/appearance/langs/pl.json b/app/appearance/langs/pl.json
index d3904d5ed7..a9bb3c62c4 100644
--- a/app/appearance/langs/pl.json
+++ b/app/appearance/langs/pl.json
@@ -1,4 +1,8 @@
{
+ "listMindmapPaletteOcean": "Ocean",
+ "listMindmapPaletteSunset": "Zachód słońca",
+ "listMindmapPaletteLavender": "Lawenda",
+ "listMindmapPaletteMonochrome": "Czarno-biały",
"listMindmapPaletteColorful": "Kolorowy",
"listMindmapPaletteSoft": "Łagodny",
"listMindmapPaletteForest": "Las",
diff --git a/app/appearance/langs/pt-BR.json b/app/appearance/langs/pt-BR.json
index 949a29722d..c3a53ed8e2 100644
--- a/app/appearance/langs/pt-BR.json
+++ b/app/appearance/langs/pt-BR.json
@@ -1,4 +1,8 @@
{
+ "listMindmapPaletteOcean": "Oceano",
+ "listMindmapPaletteSunset": "Pôr do sol",
+ "listMindmapPaletteLavender": "Lavanda",
+ "listMindmapPaletteMonochrome": "Preto e branco",
"listMindmapPaletteColorful": "Colorido",
"listMindmapPaletteSoft": "Suave",
"listMindmapPaletteForest": "Floresta",
diff --git a/app/appearance/langs/ru.json b/app/appearance/langs/ru.json
index d8a7c96180..56ed331bdb 100644
--- a/app/appearance/langs/ru.json
+++ b/app/appearance/langs/ru.json
@@ -1,4 +1,8 @@
{
+ "listMindmapPaletteOcean": "Океан",
+ "listMindmapPaletteSunset": "Закат",
+ "listMindmapPaletteLavender": "Лавандовая",
+ "listMindmapPaletteMonochrome": "Чёрно-белая",
"listMindmapPaletteColorful": "Разноцветная",
"listMindmapPaletteSoft": "Мягкая",
"listMindmapPaletteForest": "Лесная",
diff --git a/app/appearance/langs/sk.json b/app/appearance/langs/sk.json
index 9507ca3bd5..e588bf7536 100644
--- a/app/appearance/langs/sk.json
+++ b/app/appearance/langs/sk.json
@@ -1,4 +1,8 @@
{
+ "listMindmapPaletteOcean": "Oceán",
+ "listMindmapPaletteSunset": "Západ slnka",
+ "listMindmapPaletteLavender": "Levanduľa",
+ "listMindmapPaletteMonochrome": "Čiernobiela",
"listMindmapPaletteColorful": "Pestrá",
"listMindmapPaletteSoft": "Jemná",
"listMindmapPaletteForest": "Lesná",
diff --git a/app/appearance/langs/sr.json b/app/appearance/langs/sr.json
index 3569fcef0e..d2fddce0b7 100644
--- a/app/appearance/langs/sr.json
+++ b/app/appearance/langs/sr.json
@@ -1,4 +1,8 @@
{
+ "listMindmapPaletteOcean": "Океан",
+ "listMindmapPaletteSunset": "Залазак сунца",
+ "listMindmapPaletteLavender": "Лаванда",
+ "listMindmapPaletteMonochrome": "Црно-бело",
"listMindmapPaletteColorful": "Шарено",
"listMindmapPaletteSoft": "Нежно",
"listMindmapPaletteForest": "Шума",
diff --git a/app/appearance/langs/th.json b/app/appearance/langs/th.json
index c90e5bc9c6..106cbcfd55 100644
--- a/app/appearance/langs/th.json
+++ b/app/appearance/langs/th.json
@@ -1,4 +1,8 @@
{
+ "listMindmapPaletteOcean": "มหาสมุทร",
+ "listMindmapPaletteSunset": "พระอาทิตย์ตก",
+ "listMindmapPaletteLavender": "ลาเวนเดอร์",
+ "listMindmapPaletteMonochrome": "ขาวดำ",
"listMindmapPaletteColorful": "หลากสี",
"listMindmapPaletteSoft": "นุ่มนวล",
"listMindmapPaletteForest": "ป่า",
diff --git a/app/appearance/langs/tr.json b/app/appearance/langs/tr.json
index 1e3ee98779..2e6cd962b4 100644
--- a/app/appearance/langs/tr.json
+++ b/app/appearance/langs/tr.json
@@ -1,4 +1,8 @@
{
+ "listMindmapPaletteOcean": "Okyanus",
+ "listMindmapPaletteSunset": "Gün batımı",
+ "listMindmapPaletteLavender": "Lavanta",
+ "listMindmapPaletteMonochrome": "Siyah beyaz",
"listMindmapPaletteColorful": "Renkli",
"listMindmapPaletteSoft": "Yumuşak",
"listMindmapPaletteForest": "Orman",
diff --git a/app/appearance/langs/uk.json b/app/appearance/langs/uk.json
index 6e1d18cbd7..1b974bb353 100644
--- a/app/appearance/langs/uk.json
+++ b/app/appearance/langs/uk.json
@@ -1,4 +1,8 @@
{
+ "listMindmapPaletteOcean": "Океан",
+ "listMindmapPaletteSunset": "Захід сонця",
+ "listMindmapPaletteLavender": "Лавандова",
+ "listMindmapPaletteMonochrome": "Чорно-біла",
"listMindmapPaletteColorful": "Барвиста",
"listMindmapPaletteSoft": "М’яка",
"listMindmapPaletteForest": "Лісова",
diff --git a/app/appearance/langs/zh-CN.json b/app/appearance/langs/zh-CN.json
index 2828fae7d5..19f9f932ef 100644
--- a/app/appearance/langs/zh-CN.json
+++ b/app/appearance/langs/zh-CN.json
@@ -1,4 +1,8 @@
{
+ "listMindmapPaletteOcean": "海洋",
+ "listMindmapPaletteSunset": "日落",
+ "listMindmapPaletteLavender": "薰衣草",
+ "listMindmapPaletteMonochrome": "黑白",
"listMindmapPaletteColorful": "缤纷",
"listMindmapPaletteSoft": "柔和",
"listMindmapPaletteForest": "森林",
diff --git a/app/appearance/langs/zh-TW.json b/app/appearance/langs/zh-TW.json
index d2ff395cc0..a822bc10f9 100644
--- a/app/appearance/langs/zh-TW.json
+++ b/app/appearance/langs/zh-TW.json
@@ -1,4 +1,8 @@
{
+ "listMindmapPaletteOcean": "海洋",
+ "listMindmapPaletteSunset": "日落",
+ "listMindmapPaletteLavender": "薰衣草",
+ "listMindmapPaletteMonochrome": "黑白",
"listMindmapPaletteColorful": "繽紛",
"listMindmapPaletteSoft": "柔和",
"listMindmapPaletteForest": "森林",
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 4f68b58937..f0367be8be 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": "20261022102848"
+ "updated": "20261022122318"
},
"Children": [
{
@@ -2161,7 +2161,7 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20261022102848-11epv5y",
- "updated": "20261022102848"
+ "updated": "20261022122318"
},
"Children": [
{
@@ -2193,7 +2193,7 @@
},
{
"Type": "NodeText",
- "Data": " to choose Colorful, Soft, or Forest for the current map. First-level branches receive colors from the palette, and descendants inherit their branch color. Reordering branches preserves their assigned colors. New nodes follow the map's palette automatically. Manual node and line colors are retained. Choosing Default removes the palette while preserving manual colors and the canvas background. The theme does not change node content, structure, or folding states."
+ "Data": " to choose Colorful, Soft, Forest, Ocean, Sunset, Lavender, or Monochrome for the current map. First-level branches receive colors from the palette, and descendants inherit their branch color. Reordering branches preserves their assigned colors. New nodes follow the map's palette automatically. Manual node and line colors are retained. Choosing Default removes the palette while preserving manual colors and the canvas background. The theme does not change node content, structure, or folding states."
}
]
},
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 05edaf64d5..548085dcef 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": "20261022102848"
+ "updated": "20261022122318"
},
"Children": [
{
@@ -2164,7 +2164,7 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20261022102848-idam1p2",
- "updated": "20261022102848"
+ "updated": "20261022122318"
},
"Children": [
{
@@ -2196,7 +2196,7 @@
},
{
"Type": "NodeText",
- "Data": " 中为当前导图选择缤纷、柔和或森林配色。一级分支按色卡分配颜色,后代节点继承所属分支的颜色;调整分支顺序会保留原有配色,新增节点自动跟随导图配色。已有的节点和线条手工配色会保留。选择默认可移除色卡,并保留手工配色和画布背景。主题不会改变节点内容、结构或折叠状态。"
+ "Data": " 中为当前导图选择缤纷、柔和、森林、海洋、日落、薰衣草或黑白配色。一级分支按色卡分配颜色,后代节点继承所属分支的颜色;调整分支顺序会保留原有配色,新增节点自动跟随导图配色。已有的节点和线条手工配色会保留。选择默认可移除色卡,并保留手工配色和画布背景。主题不会改变节点内容、结构或折叠状态。"
}
]
},
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 d4ebe3a8e7..4e3ce8ce5b 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": "20261022102848"
+ "updated": "20261022122318"
},
"Children": [
{
@@ -2162,7 +2162,7 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20261022102848-dz75ii8",
- "updated": "20261022102848"
+ "updated": "20261022122318"
},
"Children": [
{
@@ -2194,7 +2194,7 @@
},
{
"Type": "NodeText",
- "Data": " 中為目前心智圖選擇繽紛、柔和或森林配色。一級分支依色卡分配顏色,後代節點繼承所屬分支的顏色;調整分支順序會保留原有配色,新增節點自動跟隨心智圖配色。既有的節點和線條手動配色會保留。選擇預設可移除色卡,並保留手動配色和畫布背景。主題不會改變節點內容、結構或摺疊狀態。"
+ "Data": " 中為目前心智圖選擇繽紛、柔和、森林、海洋、日落、薰衣草或黑白配色。一級分支依色卡分配顏色,後代節點繼承所屬分支的顏色;調整分支順序會保留原有配色,新增節點自動跟隨心智圖配色。既有的節點和線條手動配色會保留。選擇預設可移除色卡,並保留手動配色和畫布背景。主題不會改變節點內容、結構或摺疊狀態。"
}
]
},
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 3c9741e16a..a3e86bd920 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": "20261022102848"
+ "updated": "20261022122318"
},
"Children": [
{
@@ -2304,7 +2304,7 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20261022102848-sbqeaum",
- "updated": "20261022102848"
+ "updated": "20261022122318"
},
"Children": [
{
@@ -2332,7 +2332,7 @@
},
{
"Type": "NodeText",
- "Data": " で、現在のマップにカラフル、ソフト、フォレストの配色を選択できます。第 1 階層のブランチにパレットの色を割り当て、子孫ノードは所属するブランチの色を継承します。並べ替えても割り当てた色は保持され、新しいノードも配色に従います。手動で設定したノードや線の色は保持されます。デフォルトを選ぶとパレットを解除し、手動の色と背景は保持します。テーマはノードの内容、構造、折りたたみ状態を変更しません。"
+ "Data": " で、現在のマップにカラフル、ソフト、フォレスト、海、夕日、ラベンダー、モノクロの配色を選択できます。第 1 階層のブランチにパレットの色を割り当て、子孫ノードは所属するブランチの色を継承します。並べ替えても割り当てた色は保持され、新しいノードも配色に従います。手動で設定したノードや線の色は保持されます。デフォルトを選ぶとパレットを解除し、手動の色と背景は保持します。テーマはノードの内容、構造、折りたたみ状態を変更しません。"
}
]
},
diff --git a/app/src/assets/scss/component/_menu.scss b/app/src/assets/scss/component/_menu.scss
index 4d19a758ee..8a0186df0b 100644
--- a/app/src/assets/scss/component/_menu.scss
+++ b/app/src/assets/scss/component/_menu.scss
@@ -570,6 +570,11 @@
color: var(--b3-menu-icon-color);
font-variant-emoji: emoji;
+ &--color {
+ border-radius: var(--b3-border-radius);
+ box-shadow: 0 0 0 1px var(--b3-list-hover) inset;
+ }
+
&--custom {
align-items: center;
display: flex;
diff --git a/app/src/assets/scss/protyle/_mindmap-view.scss b/app/src/assets/scss/protyle/_mindmap-view.scss
index 700302afc0..da3aea40c6 100644
--- a/app/src/assets/scss/protyle/_mindmap-view.scss
+++ b/app/src/assets/scss/protyle/_mindmap-view.scss
@@ -26,6 +26,7 @@
}
.mindmap-view {
+ --mindmap-node-text-color: initial;
position: relative;
display: flex;
flex-direction: column;
@@ -437,7 +438,7 @@
&::before {
content: attr(data-placeholder);
- color: var(--b3-theme-on-surface-light);
+ color: var(--mindmap-node-text-color, var(--b3-theme-on-surface-light));
}
}
@@ -493,6 +494,17 @@
}
}
+ &__node--colored > .mindmap-view__content {
+ .bq,
+ .callout {
+ color: var(--mindmap-node-text-color, var(--b3-theme-on-surface));
+ }
+
+ .protyle-wysiwyg--empty:empty::before {
+ color: var(--mindmap-node-text-color, var(--b3-empty-color));
+ }
+ }
+
&__node[data-task] {
display: grid;
// 空任务正文也保留输入宽度,确保光标能落入编辑器。
@@ -519,7 +531,7 @@
border: 0;
border-radius: var(--b3-border-radius);
background: transparent;
- color: var(--b3-theme-on-surface);
+ color: var(--mindmap-node-text-color, var(--b3-theme-on-surface));
font: inherit;
cursor: pointer;
transition: var(--b3-transition);
diff --git a/app/src/protyle/render/listMindmap/appearance.test.ts b/app/src/protyle/render/listMindmap/appearance.test.ts
index 00048a0bb0..2369d45fcb 100644
--- a/app/src/protyle/render/listMindmap/appearance.test.ts
+++ b/app/src/protyle/render/listMindmap/appearance.test.ts
@@ -3,6 +3,12 @@ import test from "node:test";
import {assignListMindmapBranchColors, clearListMindmapManualColors, getListMindmapAppearanceMenu,
getMindmapTextColor, isListMindmapAppearance, LIST_MINDMAP_PALETTES, resolveListMindmapColors} from "./appearance";
import type {ListMindmapModel, ListMindmapNode} from "./model";
+import {execFile} from "node:child_process";
+import {mkdtempSync, readFileSync, rmSync, writeFileSync} from "node:fs";
+import {tmpdir} from "node:os";
+import * as path from "node:path";
+import {promisify} from "node:util";
+import {ScriptTarget, transpileModule} from "typescript";
const makeModel = (): ListMindmapModel => {
const node = (id: string, children: ListMindmapNode[] = []): ListMindmapNode =>
@@ -29,6 +35,39 @@ test("appearance validates optional colors and rejects unsupported formats", ()
}
});
+test("all seven built-in palettes remain selectable after reload and provide readable foregrounds", () => {
+ assert.equal(LIST_MINDMAP_PALETTES.length, 7);
+ assert.equal(new Set(LIST_MINDMAP_PALETTES.map(preset => preset.id)).size, 7);
+ assert.equal(new Set(LIST_MINDMAP_PALETTES.map(preset => JSON.stringify(preset.colors))).size, 7);
+ const model = makeModel();
+ model.metadata.appearance = {version: 1, palette: [], backgroundColor: "#ffffff"};
+ model.metadata.nodes.a = {textColor: "red"};
+ const luminance = (color: string) => {
+ const rgb = color.match(/[a-f\d]{2}/gi).map(channel => parseInt(channel, 16) / 255);
+ const linear = rgb.map(channel => channel <= .04045 ? channel / 12.92 : ((channel + .055) / 1.055) ** 2.4);
+ return linear.reduce((sum, channel, index) => sum + channel * [.2126, .7152, .0722][index], 0);
+ };
+ 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[];
+ };
+ for (const preset of LIST_MINDMAP_PALETTES) {
+ themes().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(model.metadata.appearance.palette, preset.colors);
+ assert.equal(model.metadata.appearance.backgroundColor, "#ffffff");
+ assert.equal(model.metadata.nodes.a.textColor, "red");
+ for (const color of preset.colors) {
+ const foreground = luminance(getMindmapTextColor(color));
+ const background = luminance(color);
+ const contrast = (Math.max(foreground, background) + .05) / (Math.min(foreground, background) + .05);
+ assert.ok(contrast >= 4.5, `${preset.id} ${color} must retain readable text contrast`);
+ }
+ }
+});
+
test("branch identity survives reordering, theme changes, insertion, reparenting and serialized reload", () => {
const model = makeModel();
const before = JSON.stringify(model.metadata);
@@ -92,3 +131,128 @@ test("appearance menu preserves manual colors and non-color metadata until expli
assert.equal(model.metadata.summaries[0].color, undefined);
assert.equal(model.metadata.appearance.backgroundColor, "#1e1e1e");
});
+
+const contrastCases = (source: string, css: string) => {
+ const check = require("node:assert/strict");
+ const api = new Function("Constants", "mathRender", "tabsRender", "destroyTabsRender", source +
+ "; return {ListMindmapView, readListMindmap, retagMindmapBranch};")({
+ CUSTOM_SY_LIST_MINDMAP: "custom-sy-list-mindmap", CUSTOM_SY_LIST_MINDMAP_DATA: "custom-sy-list-mindmap-data",
+ }, async () => {}, () => {}, () => {});
+ const sheet = document.createElement("style");
+ sheet.textContent = css;
+ document.head.append(sheet);
+ const lute = Lute.New();
+ lute.SetKramdownIAL(true);
+ lute.SetProtyleWYSIWYG(true);
+ const holder = document.createElement("div");
+ holder.innerHTML = lute.Md2BlockDOM("- Root\n - Empty\n - Quote\n");
+ const list = holder.firstElementChild as HTMLElement;
+ api.retagMindmapBranch(list, true);
+ const model = api.readListMindmap(list);
+ const [emptyNode, quoteNode] = model.root.children;
+ emptyNode.contentBlocks[0].querySelector("[contenteditable]").textContent = "";
+ const quoteHolder = document.createElement("div");
+ quoteHolder.innerHTML = lute.Md2BlockDOM("> Quoted text\n\n> Second paragraph\n");
+ const quote = quoteHolder.firstElementChild as HTMLElement;
+ const manualText = document.createElement("span");
+ manualText.style.color = "#c2410c";
+ manualText.textContent = "Manual color";
+ quote.querySelector("[contenteditable]").append(manualText);
+ quoteNode.contentBlocks.push(quote);
+ const host = document.createElement("div");
+ host.className = "mindmap-view";
+ host.style.cssText = "width:760px;height:460px";
+ document.body.append(host);
+ const view = new api.ListMindmapView({host, model, onExit() {}});
+ const computedColor = (value: string) => {
+ const probe = document.createElement("span");
+ probe.style.color = value;
+ document.body.append(probe);
+ const result = getComputedStyle(probe).color;
+ probe.remove();
+ return result;
+ };
+ for (const surface of ["#5f6368", "#9aa0a6"]) {
+ document.documentElement.style.setProperty("--b3-theme-on-surface", surface);
+ document.documentElement.style.setProperty("--b3-theme-on-surface-light", surface);
+ document.documentElement.style.setProperty("--b3-empty-color", surface);
+ for (const palette of [["#2563eb"], ["#bfdbfe"]]) {
+ model.metadata.appearance = {version: 1, palette};
+ for (const readOnly of [false, true]) {
+ view.readOnly = readOnly;
+ view.update(model);
+ const rendered = view.nodeElements.get(quoteNode.id) as HTMLElement;
+ const empty = view.nodeElements.get(emptyNode.id) as HTMLElement;
+ const expected = getComputedStyle(rendered).color;
+ check.equal(getComputedStyle(rendered.querySelector(".bq")).color, expected,
+ "quoted text follows the node foreground on dark and light palettes");
+ check.equal(getComputedStyle(rendered.querySelector(".bq .p")).color, expected);
+ check.equal(getComputedStyle(rendered.querySelector(".bq span")).color, "rgb(194, 65, 12)",
+ "explicit inline colors survive the contrast correction");
+ const content = empty.querySelector(".mindmap-view__content");
+ check.equal(getComputedStyle(content, "::before").color, getComputedStyle(empty).color,
+ "empty node hints retain readable contrast");
+ if (!readOnly) {
+ content.classList.add("mindmap-view__editor");
+ const editor = document.createElement("div");
+ editor.className = "protyle-wysiwyg protyle-wysiwyg--empty";
+ editor.setAttribute("placeholder", "Enter text");
+ content.replaceChildren(editor);
+ check.equal(getComputedStyle(editor, "::before").color, getComputedStyle(empty).color,
+ "the inline editor uses the same readable placeholder color");
+ content.classList.remove("mindmap-view__editor");
+ }
+ }
+ model.metadata.nodes[quoteNode.id] = {textColor: "#ff00ff"};
+ view.update(model);
+ check.equal(getComputedStyle(view.nodeElements.get(quoteNode.id).querySelector(".bq")).color,
+ "rgb(255, 0, 255)", "manual node foregrounds remain authoritative");
+ delete model.metadata.nodes[quoteNode.id];
+ }
+ delete model.metadata.appearance;
+ view.update(model);
+ check.equal(getComputedStyle(view.nodeElements.get(quoteNode.id).querySelector(".bq")).color,
+ computedColor(surface), "removing a palette restores the application quote color");
+ }
+ view.destroy();
+ return "mindmap-contrast-ok";
+};
+
+test("palette quote text and placeholders stay readable while manual colors and legacy styles survive", {
+ timeout: 20000,
+ skip: process.platform === "linux" && !process.env.DISPLAY && !process.env.WAYLAND_DISPLAY,
+}, async () => {
+ const compile = (file: string) => transpileModule(readFileSync(path.join(__dirname, file), "utf8")
+ .replace(/^import [\s\S]*?;\r?\n/gm, "").replace(/^export /gm, ""), {
+ compilerOptions: {target: ScriptTarget.ES2021},
+ }).outputText;
+ const source = ["../../wysiwyg/listContext.ts", "summary.ts", "connectors.ts", "appearance.ts", "model.ts",
+ "fold.ts", "routing.ts", "pan.ts", "../av/richTextValue.ts", "view.ts"].map(compile).join("\n");
+ const css = require("sass").compile(path.resolve(__dirname, "../../../assets/scss/base.scss"), {
+ logger: require("sass").Logger.silent,
+ }).css;
+ const dir = mkdtempSync(path.join(tmpdir(), "siyuan-mindmap-contrast-"));
+ const script = path.join(dir, "run.cjs");
+ writeFileSync(script, `const {app, BrowserWindow} = require("electron");
+app.setPath("userData", ${JSON.stringify(path.join(dir, "profile"))});
+app.commandLine.appendSwitch("disable-gpu");
+app.whenReady().then(async () => {
+ const win = new BrowserWindow({show: false, webPreferences: {nodeIntegration: true, contextIsolation: false}});
+ try {
+ await win.loadURL("data:text/html,<html><body></body></html>");
+ await win.webContents.executeJavaScript(require("fs").readFileSync(${JSON.stringify(path.resolve("stage/protyle/js/lute/lute.min.js"))}, "utf8"));
+ console.log(await win.webContents.executeJavaScript(${JSON.stringify(
+ `const __name = value => value; (${contrastCases.toString()})(${JSON.stringify(source)}, ${JSON.stringify(css)})`)}));
+ win.destroy(); app.exit(0);
+ } catch (error) { console.error(error); win.destroy(); app.exit(1); }
+});`, "utf8");
+ const env = {...process.env};
+ delete env.ELECTRON_RUN_AS_NODE;
+ try {
+ const result = await promisify(execFile)(require("electron") as string, [script],
+ {env, windowsHide: true, timeout: 18000});
+ 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 cd43bcdeb1..c721c9b075 100644
--- a/app/src/protyle/render/listMindmap/appearance.ts
+++ b/app/src/protyle/render/listMindmap/appearance.ts
@@ -10,6 +10,10 @@ export const LIST_MINDMAP_PALETTES = [
{id: "colorful", label: "listMindmapPaletteColorful", colors: ["#2563eb", "#dc2626", "#15803d", "#9333ea", "#c2410c", "#0e7490"]},
{id: "soft", label: "listMindmapPaletteSoft", colors: ["#bfdbfe", "#fecaca", "#bbf7d0", "#e9d5ff", "#fed7aa", "#a5f3fc"]},
{id: "forest", label: "listMindmapPaletteForest", colors: ["#166534", "#047857", "#4d7c0f", "#0f766e", "#3f6212", "#15803d"]},
+ {id: "ocean", label: "listMindmapPaletteOcean", colors: ["#0c4a6e", "#0369a1", "#0284c7", "#0891b2", "#0d9488", "#0f766e"]},
+ {id: "sunset", label: "listMindmapPaletteSunset", colors: ["#9a3412", "#c2410c", "#ea580c", "#be123c", "#9f1239", "#7e22ce"]},
+ {id: "lavender", label: "listMindmapPaletteLavender", colors: ["#4c1d95", "#6d28d9", "#7c3aed", "#a855f7", "#c084fc", "#e9d5ff"]},
+ {id: "monochrome", label: "listMindmapPaletteMonochrome", colors: ["#1f2937", "#374151", "#4b5563", "#6b7280", "#9ca3af", "#d1d5db"]},
];
export const isMindmapColor = (value: unknown): value is string =>
@@ -97,7 +101,7 @@ export const getListMindmapAppearanceMenu = (metadata: ListMindmapMetadata,
data.appearance = {...data.appearance, version: 1, palette: []};
})},
...LIST_MINDMAP_PALETTES.map(preset => ({
- id: preset.id, iconHTML: `<span class="color__square" style="background-color:${preset.colors[0]}"></span>`,
+ id: preset.id, iconHTML: `<span class="b3-menu__icon b3-menu__icon--color" style="background-color:${preset.colors[0]}"></span>`,
label: labels[preset.label],
checked: JSON.stringify(palette) === JSON.stringify(preset.colors),
click: () => change(data => {
@@ -111,7 +115,7 @@ export const getListMindmapAppearanceMenu = (metadata: ListMindmapMetadata,
{id: "dark", color: "#1e1e1e", label: labels.themeDark},
...LIST_MINDMAP_PALETTES[1].colors.map(color => ({id: color, color, label: color})),
].map(item => ({id: item.id,
- iconHTML: item.color ? `<span class="color__square" style="background-color:${item.color}"></span>` : "",
+ 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 || [],
diff --git a/app/src/protyle/render/listMindmap/view.ts b/app/src/protyle/render/listMindmap/view.ts
index 1f5c81afa8..0e0e980f04 100644
--- a/app/src/protyle/render/listMindmap/view.ts
+++ b/app/src/protyle/render/listMindmap/view.ts
@@ -814,11 +814,17 @@ export class ListMindmapView {
element.classList.toggle("mindmap-view__node--root", id === model.root.id);
this.renderTask(element, id);
element.classList.toggle("mindmap-view__node--branch", node.children.length > 0);
+ element.classList.toggle("mindmap-view__node--colored", this.themeColors.has(id));
const style = model.metadata.nodes[id];
const background = style?.backgroundColor || this.themeColors.get(id)?.backgroundColor || "";
element.style.backgroundColor = background;
element.style.color = style?.textColor || (this.themeColors.has(id) && isMindmapColor(background) ?
getMindmapTextColor(background) : this.themeColors.get(id)?.textColor) || "";
+ if (this.themeColors.has(id)) {
+ element.style.setProperty("--mindmap-node-text-color", element.style.color);
+ } else {
+ element.style.removeProperty("--mindmap-node-text-color");
+ }
const collapsed = this.folded.get(id) ?? node.collapsed;
element.setAttribute("aria-expanded", String(!collapsed));
const fold = element.querySelector<HTMLButtonElement>(".mindmap-view__fold");