An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:sparkles: Improve mind map scrolling with explicit canvas activation https://github.com/siyuan-note/siyuan/issues/20670
Daniel66691a5fa10a
diff --git a/app/appearance/langs/ar.json b/app/appearance/langs/ar.jsonindex 6e8ebf8a17..6e279bf13f 100644--- a/app/appearance/langs/ar.json+++ b/app/appearance/langs/ar.json@@ -1,4 +1,6 @@{+ "listMindmapActivate": "تفعيل اللوحة",+ "listMindmapDeactivate": "إنهاء التفاعل مع اللوحة","automationCollectionManage": "إدارة التجميع","automationCollectionRules": "مطابقات القواعد","automationCollectionEntries": "إدخالات قاعدة البيانات",diff --git a/app/appearance/langs/de.json b/app/appearance/langs/de.jsonindex 08fc935431..e4946640cc 100644--- a/app/appearance/langs/de.json+++ b/app/appearance/langs/de.json@@ -1,4 +1,6 @@{+ "listMindmapActivate": "Zeichenfläche aktivieren",+ "listMindmapDeactivate": "Zeichenfläche deaktivieren","automationCollectionManage": "Sammlungsverwaltung","automationCollectionRules": "Regeltreffer","automationCollectionEntries": "Datenbankeinträge",diff --git a/app/appearance/langs/en.json b/app/appearance/langs/en.jsonindex dbe39f3cea..065107b5b8 100644--- a/app/appearance/langs/en.json+++ b/app/appearance/langs/en.json@@ -1,4 +1,6 @@{+ "listMindmapActivate": "Activate canvas",+ "listMindmapDeactivate": "Deactivate canvas","automationCollectionManage": "Collection management","automationCollectionRules": "Rule matches","automationCollectionEntries": "Database entries",diff --git a/app/appearance/langs/es.json b/app/appearance/langs/es.jsonindex ca63031724..40ac2ec80b 100644--- a/app/appearance/langs/es.json+++ b/app/appearance/langs/es.json@@ -1,4 +1,6 @@{+ "listMindmapActivate": "Activar lienzo",+ "listMindmapDeactivate": "Desactivar lienzo","automationCollectionManage": "Gestión de recopilación","automationCollectionRules": "Coincidencias de reglas","automationCollectionEntries": "Entradas de la base de datos",diff --git a/app/appearance/langs/fr.json b/app/appearance/langs/fr.jsonindex 140965086b..4de3360c51 100644--- a/app/appearance/langs/fr.json+++ b/app/appearance/langs/fr.json@@ -1,4 +1,6 @@{+ "listMindmapActivate": "Activer le canevas",+ "listMindmapDeactivate": "Désactiver le canevas","automationCollectionManage": "Gestion de la collecte","automationCollectionRules": "Correspondances des règles","automationCollectionEntries": "Entrées de la base",diff --git a/app/appearance/langs/he.json b/app/appearance/langs/he.jsonindex 1ef599999c..03a03e6784 100644--- a/app/appearance/langs/he.json+++ b/app/appearance/langs/he.json@@ -1,4 +1,6 @@{+ "listMindmapActivate": "הפעלת הקנבס",+ "listMindmapDeactivate": "סיום העבודה עם הקנבס","automationCollectionManage": "ניהול איסוף","automationCollectionRules": "התאמות לכללים","automationCollectionEntries": "רשומות מסד הנתונים",diff --git a/app/appearance/langs/hi.json b/app/appearance/langs/hi.jsonindex 834d14f5d6..2be1f68583 100644--- a/app/appearance/langs/hi.json+++ b/app/appearance/langs/hi.json@@ -1,4 +1,6 @@{+ "listMindmapActivate": "कैनवास सक्रिय करें",+ "listMindmapDeactivate": "कैनवास निष्क्रिय करें","automationCollectionManage": "संग्रह प्रबंधन","automationCollectionRules": "नियम से मेल","automationCollectionEntries": "डेटाबेस प्रविष्टियाँ",diff --git a/app/appearance/langs/id.json b/app/appearance/langs/id.jsonindex 027be015d0..29f58932f6 100644--- a/app/appearance/langs/id.json+++ b/app/appearance/langs/id.json@@ -1,4 +1,6 @@{+ "listMindmapActivate": "Aktifkan kanvas",+ "listMindmapDeactivate": "Nonaktifkan kanvas","automationCollectionManage": "Pengelolaan pengumpulan","automationCollectionRules": "Kecocokan aturan","automationCollectionEntries": "Entri basis data",diff --git a/app/appearance/langs/it.json b/app/appearance/langs/it.jsonindex a452dfb1e2..ea799d035e 100644--- a/app/appearance/langs/it.json+++ b/app/appearance/langs/it.json@@ -1,4 +1,6 @@{+ "listMindmapActivate": "Attiva area di disegno",+ "listMindmapDeactivate": "Disattiva area di disegno","automationCollectionManage": "Gestione raccolta","automationCollectionRules": "Corrispondenze delle regole","automationCollectionEntries": "Voci del database",diff --git a/app/appearance/langs/ja.json b/app/appearance/langs/ja.jsonindex cb7f663683..8783dea33a 100644--- a/app/appearance/langs/ja.json+++ b/app/appearance/langs/ja.json@@ -1,4 +1,6 @@{+ "listMindmapActivate": "キャンバスを操作",+ "listMindmapDeactivate": "キャンバス操作を終了","automationCollectionManage": "収集管理","automationCollectionRules": "ルールの一致","automationCollectionEntries": "データベース項目",diff --git a/app/appearance/langs/ko.json b/app/appearance/langs/ko.jsonindex cc7422ef20..fa438b7047 100644--- a/app/appearance/langs/ko.json+++ b/app/appearance/langs/ko.json@@ -1,4 +1,6 @@{+ "listMindmapActivate": "캔버스 활성화",+ "listMindmapDeactivate": "캔버스 비활성화","automationCollectionManage": "수집 관리","automationCollectionRules": "규칙 일치","automationCollectionEntries": "데이터베이스 항목",diff --git a/app/appearance/langs/nl.json b/app/appearance/langs/nl.jsonindex 42a841aa00..fa22217177 100644--- a/app/appearance/langs/nl.json+++ b/app/appearance/langs/nl.json@@ -1,4 +1,6 @@{+ "listMindmapActivate": "Canvas activeren",+ "listMindmapDeactivate": "Canvas deactiveren","automationCollectionManage": "Verzamelbeheer","automationCollectionRules": "Regelovereenkomsten","automationCollectionEntries": "Database-items",diff --git a/app/appearance/langs/pl.json b/app/appearance/langs/pl.jsonindex 6a88107fb2..2c3d976f05 100644--- a/app/appearance/langs/pl.json+++ b/app/appearance/langs/pl.json@@ -1,4 +1,6 @@{+ "listMindmapActivate": "Aktywuj płótno",+ "listMindmapDeactivate": "Dezaktywuj płótno","automationCollectionManage": "Zarządzanie zbieraniem","automationCollectionRules": "Dopasowania reguł","automationCollectionEntries": "Wpisy bazy danych",diff --git a/app/appearance/langs/pt-BR.json b/app/appearance/langs/pt-BR.jsonindex 8444b55d65..b89c3fd841 100644--- a/app/appearance/langs/pt-BR.json+++ b/app/appearance/langs/pt-BR.json@@ -1,4 +1,6 @@{+ "listMindmapActivate": "Ativar tela",+ "listMindmapDeactivate": "Desativar tela","automationCollectionManage": "Gerenciamento de coleta","automationCollectionRules": "Correspondências das regras","automationCollectionEntries": "Entradas do banco de dados",diff --git a/app/appearance/langs/ru.json b/app/appearance/langs/ru.jsonindex 947988d6d2..e38856c0a5 100644--- a/app/appearance/langs/ru.json+++ b/app/appearance/langs/ru.json@@ -1,4 +1,6 @@{+ "listMindmapActivate": "Включить управление холстом",+ "listMindmapDeactivate": "Завершить управление холстом","automationCollectionManage": "Управление сбором","automationCollectionRules": "Совпадения по правилам","automationCollectionEntries": "Записи базы данных",diff --git a/app/appearance/langs/sk.json b/app/appearance/langs/sk.jsonindex 99cdc5c410..8ea4d49035 100644--- a/app/appearance/langs/sk.json+++ b/app/appearance/langs/sk.json@@ -1,4 +1,6 @@{+ "listMindmapActivate": "Aktivovať plátno",+ "listMindmapDeactivate": "Deaktivovať plátno","automationCollectionManage": "Správa zhromažďovania","automationCollectionRules": "Zhody pravidiel","automationCollectionEntries": "Položky databázy",diff --git a/app/appearance/langs/sr.json b/app/appearance/langs/sr.jsonindex 9ce1a75146..eac90a6d10 100644--- a/app/appearance/langs/sr.json+++ b/app/appearance/langs/sr.json@@ -1,4 +1,6 @@{+ "listMindmapActivate": "Активирај платно",+ "listMindmapDeactivate": "Деактивирај платно","automationCollectionManage": "Управљање прикупљањем","automationCollectionRules": "Подударања правила","automationCollectionEntries": "Ставке базе података",diff --git a/app/appearance/langs/th.json b/app/appearance/langs/th.jsonindex 5e5b5b75b6..6a217fb2ef 100644--- a/app/appearance/langs/th.json+++ b/app/appearance/langs/th.json@@ -1,4 +1,6 @@{+ "listMindmapActivate": "เปิดใช้งานผืนผ้าใบ",+ "listMindmapDeactivate": "ปิดใช้งานผืนผ้าใบ","automationCollectionManage": "จัดการการรวบรวม","automationCollectionRules": "ผลที่ตรงกับกฎ","automationCollectionEntries": "รายการฐานข้อมูล",diff --git a/app/appearance/langs/tr.json b/app/appearance/langs/tr.jsonindex 33b221ae68..d0fbc50eb7 100644--- a/app/appearance/langs/tr.json+++ b/app/appearance/langs/tr.json@@ -1,4 +1,6 @@{+ "listMindmapActivate": "Tuvali etkinleştir",+ "listMindmapDeactivate": "Tuvali devre dışı bırak","automationCollectionManage": "Toplama yönetimi","automationCollectionRules": "Kural eşleşmeleri","automationCollectionEntries": "Veritabanı girdileri",diff --git a/app/appearance/langs/uk.json b/app/appearance/langs/uk.jsonindex e98a6b1cbc..30d61ff43f 100644--- a/app/appearance/langs/uk.json+++ b/app/appearance/langs/uk.json@@ -1,4 +1,6 @@{+ "listMindmapActivate": "Увімкнути керування полотном",+ "listMindmapDeactivate": "Завершити керування полотном","automationCollectionManage": "Керування збиранням","automationCollectionRules": "Збіги за правилами","automationCollectionEntries": "Записи бази даних",diff --git a/app/appearance/langs/zh-CN.json b/app/appearance/langs/zh-CN.jsonindex 462e9383fd..fea3546e5c 100644--- a/app/appearance/langs/zh-CN.json+++ b/app/appearance/langs/zh-CN.json@@ -1,4 +1,6 @@{+ "listMindmapActivate": "操作画布",+ "listMindmapDeactivate": "退出画布操作","automationCollectionManage": "收集管理","automationCollectionRules": "规则匹配","automationCollectionEntries": "数据库条目",diff --git a/app/appearance/langs/zh-TW.json b/app/appearance/langs/zh-TW.jsonindex 24359e6aaf..fc9005376a 100644--- a/app/appearance/langs/zh-TW.json+++ b/app/appearance/langs/zh-TW.json@@ -1,4 +1,6 @@{+ "listMindmapActivate": "操作畫布",+ "listMindmapDeactivate": "結束畫布操作","automationCollectionManage": "收集管理","automationCollectionRules": "規則匹配","automationCollectionEntries": "資料庫條目",diff --git a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-h361q1i/20200924093441-ft2rhps.sy b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-h361q1i/20200924093441-ft2rhps.syindex e331914540..2f0424febc 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@@ -1995,6 +1995,32 @@}]},+ {+ "ID": "20261018163000-gjcy3xw",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20261018163000-gjcy3xw"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "Mind maps initially leave the mouse wheel and one-finger swipes to document scrolling. On desktop, click the map to activate canvas interaction; on mobile, use Activate canvas in the toolbar. An active canvas has a highlighted border and handles wheel panning and one-finger dragging, including at the pan boundary. Click outside the map, move keyboard focus outside it, press Esc on the canvas, or use Deactivate canvas to return to reading. Full-screen maps stay active until you exit full screen."+ }+ ]+ },+ {+ "ID": "20261018163000-cvdncjc",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20261018163000-cvdncjc"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "Without activating the canvas, hold Ctrl (Command on macOS) while using the mouse wheel to zoom around the pointer, or use two fingers to zoom and pan on a touch screen. These gestures do not keep the canvas active. A saved view lock still disables editing, zooming, and panning; activate the canvas after unlocking when needed."+ }+ ]+ },{"ID": "20260928143000-4j2cxng","Type": "NodeParagraph",@@ -2005,7 +2031,7 @@"Children": [{"Type": "NodeText",- "Data": "Use Lock view in the mind map toolbar to prevent editing, zooming and panning. Swiping or using the mouse wheel over the map then scrolls the document. Use Unlock view to resume interaction. The lock state is saved with the block. When directly embedding a complete mind map block or a document containing it, unlock the map to edit its nodes and styles. Changes update the source block and other embedded copies. Read-only and history previews remain non-editable."+ "Data": "Use Lock view in the mind map toolbar to prevent editing, zooming and panning. Swiping or using the mouse wheel over the map then scrolls the document. Use Unlock view to resume interaction. The lock state is saved with the block. When directly embedding a complete mind map block or a document containing it, unlock the map to edit its nodes and styles. Changes update the source block and other embedded copies. Read-only and history previews remain non-editable."}]},diff --git a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20200924100950-9op5xi1.sy b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20200924100950-9op5xi1.syindex f9a5d69d7a..42fd57813e 100644--- a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20200924100950-9op5xi1.sy+++ b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20200924100950-9op5xi1.sy@@ -13125,6 +13125,19 @@}]},+ {+ "ID": "20261018163000-tgvsr1a",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20261018163000-tgvsr1a"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "Press Esc on the canvas to return to reading and let the document receive wheel input. If a node editor, summary selection, or relationship-line drag is active, Esc first finishes or cancels that operation. In full screen, Esc exits full screen."+ }+ ]+ },{"ID": "20260921105011-3srqnh0","Type": "NodeTable",diff --git a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180320-abz7w6k/20200825162036-4dx365o.sy b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180320-abz7w6k/20200825162036-4dx365o.syindex aef436d104..302e269810 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@@ -1998,6 +1998,32 @@}]},+ {+ "ID": "20261018163000-vnuug6c",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20261018163000-vnuug6c"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "思维导图默认将鼠标滚轮和单指滑动交给文档滚动。桌面端点击导图即可操作画布;移动端可点击工具栏中的“操作画布”。操作中的画布显示高亮边框,滚轮和单指拖动用于平移画布,到达平移边界后也不会滚动文档。点击导图外部、将键盘焦点移到外部、在画布上按 Esc,或点击“退出画布操作”即可恢复阅读。全屏时保持画布操作,退出全屏后恢复阅读。"+ }+ ]+ },+ {+ "ID": "20261018163000-rtw5v99",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20261018163000-rtw5v99"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "无需进入画布操作,也可以按住 Ctrl(macOS 为 Command)滚动鼠标滚轮,以指针为中心缩放,或在触屏上用双指缩放、平移。这些手势不会持续接管后续滚动。已保存的视图锁定仍禁止编辑、缩放和平移,解锁后可按需进入画布操作。"+ }+ ]+ },{"ID": "20260928143000-4bg2v0y","Type": "NodeParagraph",@@ -2008,7 +2034,7 @@"Children": [{"Type": "NodeText",- "Data": "点击思维导图工具栏中的“锁定视图”后,禁止编辑、缩放和平移,在导图上滑动或滚动鼠标滚轮将滚动文档。点击“解锁视图”可恢复操作。锁定状态随块保存。直接嵌入完整思维导图块或包含它的文档时,解锁后可编辑节点和样式,修改会同步到源块及其他嵌入位置;只读和历史预览中仍不能编辑。"+ "Data": "点击思维导图工具栏中的“锁定视图”后,禁止编辑、缩放和平移,在导图上滑动或滚动鼠标滚轮将滚动文档。点击“解锁视图”可恢复操作。锁定状态随块保存。直接嵌入完整思维导图块或包含它的文档时,解锁后可编辑节点和样式,修改会同步到源块及其他嵌入位置;只读和历史预览中仍不能编辑。"}]},diff --git a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20200813004551-gm0pbn1.sy b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20200813004551-gm0pbn1.syindex 2752fd806e..0384b04efe 100644--- a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20200813004551-gm0pbn1.sy+++ b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20200813004551-gm0pbn1.sy@@ -13107,6 +13107,19 @@}]},+ {+ "ID": "20261018163000-7w2zbxu",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20261018163000-7w2zbxu"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "在画布上按 Esc 可恢复阅读,让滚轮滚动文档。如果正在编辑节点、选择概括范围或拖动关系线,Esc 会先结束或取消当前操作;全屏时按 Esc 退出全屏。"+ }+ ]+ },{"ID": "20260921105011-fr0uxw6","Type": "NodeTable",diff --git a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226120854-dr1jfx2/20211226121319-emrk2yy.sy b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226120854-dr1jfx2/20211226121319-emrk2yy.syindex 45af58e6d0..087bdb3c49 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@@ -1996,6 +1996,32 @@}]},+ {+ "ID": "20261018163000-b7er7oa",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20261018163000-b7er7oa"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "心智圖預設將滑鼠滾輪和單指滑動交給文件捲動。桌面版點擊心智圖即可操作畫布;行動版可點擊工具列中的「操作畫布」。操作中的畫布顯示醒目邊框,滾輪和單指拖曳用於平移畫布,到達平移邊界後也不會捲動文件。點擊心智圖外部、將鍵盤焦點移到外部、在畫布上按 Esc,或點擊「結束畫布操作」即可恢復閱讀。全螢幕時保持畫布操作,離開全螢幕後恢復閱讀。"+ }+ ]+ },+ {+ "ID": "20261018163000-byam24i",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20261018163000-byam24i"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "無須進入畫布操作,也可以按住 Ctrl(macOS 為 Command)捲動滑鼠滾輪,以指標為中心縮放,或在觸控螢幕上用雙指縮放、平移。這些手勢不會持續接管後續捲動。已儲存的檢視鎖定仍禁止編輯、縮放和平移,解鎖後可視需要進入畫布操作。"+ }+ ]+ },{"ID": "20260928143000-t2iv0ys","Type": "NodeParagraph",@@ -2006,7 +2032,7 @@"Children": [{"Type": "NodeText",- "Data": "點擊思維導圖工具列中的「鎖定視圖」後,禁止編輯、縮放和平移,在導圖上滑動或滾動滑鼠滾輪將捲動文件。點擊「解鎖視圖」可恢復操作。鎖定狀態隨區塊儲存。直接嵌入完整心智圖區塊或包含它的文件時,解鎖後可編輯節點和樣式,修改會同步至來源區塊及其他嵌入位置;唯讀和歷史預覽中仍不能編輯。"+ "Data": "點擊思維導圖工具列中的「鎖定視圖」後,禁止編輯、縮放和平移,在導圖上滑動或滾動滑鼠滾輪將捲動文件。點擊「解鎖視圖」可恢復操作。鎖定狀態隨區塊儲存。直接嵌入完整心智圖區塊或包含它的文件時,解鎖後可編輯節點和樣式,修改會同步至來源區塊及其他嵌入位置;唯讀和歷史預覽中仍不能編輯。"}]},diff --git a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20211226122549-jktxego.sy b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20211226122549-jktxego.syindex 66524d942a..7bbb1c49c6 100644--- a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20211226122549-jktxego.sy+++ b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20211226122549-jktxego.sy@@ -13113,6 +13113,19 @@}]},+ {+ "ID": "20261018163000-e1khci4",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20261018163000-e1khci4"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "在畫布上按 Esc 可恢復閱讀,讓滾輪捲動文件。如果正在編輯節點、選取摘要範圍或拖曳關係線,Esc 會先結束或取消目前操作;全螢幕時按 Esc 離開全螢幕。"+ }+ ]+ },{"ID": "20260921105011-f8y6pxv","Type": "NodeTable",diff --git a/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20240530101000-xsbxokr.sy b/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20240530101000-xsbxokr.syindex 576d32e077..4e88321537 100644--- a/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20240530101000-xsbxokr.sy+++ b/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20240530101000-xsbxokr.sy@@ -13063,6 +13063,19 @@}]},+ {+ "ID": "20261018163000-3gwfc4c",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20261018163000-3gwfc4c"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "キャンバス上で Esc を押すと閲覧に戻り、ホイールで文書をスクロールできます。ノード編集中、要約範囲の選択中、関連線のドラッグ中は、まず現在の操作を終了またはキャンセルします。全画面表示では Esc で全画面表示を終了します。"+ }+ ]+ },{"ID": "20260921105011-01k7syf","Type": "NodeTable",diff --git a/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-hnu6o79/20240530101000-3qhz7br.sy b/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-hnu6o79/20240530101000-3qhz7br.syindex 64c92907e0..6d83cd26b6 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@@ -2124,6 +2124,32 @@}]},+ {+ "ID": "20261018163000-bic9sbi",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20261018163000-bic9sbi"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "マインドマップ上のマウスホイールと 1 本指のスワイプは、初期状態では文書をスクロールします。デスクトップではマップをクリックし、モバイルではツールバーの「キャンバスを操作」を押すと、キャンバスを操作できます。操作中は枠が強調表示され、ホイールと 1 本指のドラッグでキャンバスを移動します。移動範囲の端でも文書はスクロールしません。マップの外をクリックする、キーボードフォーカスを外に移す、キャンバス上で Esc を押す、または「キャンバス操作を終了」を押すと閲覧に戻ります。全画面表示ではキャンバス操作を維持し、全画面表示を終了すると閲覧に戻ります。"+ }+ ]+ },+ {+ "ID": "20261018163000-qe8wgtd",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20261018163000-qe8wgtd"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "キャンバス操作を開始しなくても、Ctrl(macOS では Command)を押しながらホイールを回すとポインターを中心に拡大・縮小でき、タッチ画面では 2 本指で拡大・縮小と移動ができます。これらのジェスチャーの後は、通常のスクロールをそのまま続けられます。保存された表示ロックは、引き続き編集、拡大・縮小、移動を無効にします。ロック解除後、必要に応じてキャンバス操作を開始してください。"+ }+ ]+ },{"ID": "20260928143000-unwwtu3","Type": "NodeParagraph",@@ -2134,7 +2160,7 @@"Children": [{"Type": "NodeText",- "Data": "マインドマップのツールバーで「表示をロック」を押すと、編集、拡大・縮小、移動が無効になります。マップ上でのスワイプやマウスホイール操作は文書をスクロールします。「表示のロックを解除」で操作を再開できます。ロック状態はブロックとともに保存されます。マインドマップブロック全体、またはそれを含む文書を直接埋め込んだ場合、ロックを解除するとノードやスタイルを編集できます。変更は元のブロックと他の埋め込み先にも反映されます。読み取り専用や履歴のプレビューでは編集できません。"+ "Data": "マインドマップのツールバーで「表示をロック」を押すと、編集、拡大・縮小、移動が無効になります。マップ上でのスワイプやマウスホイール操作は文書をスクロールします。「表示のロックを解除」で操作を再開できます。ロック状態はブロックとともに保存されます。マインドマップブロック全体、またはそれを含む文書を直接埋め込んだ場合、ロックを解除するとノードやスタイルを編集できます。変更は元のブロックと他の埋め込み先にも反映されます。読み取り専用や履歴のプレビューでは編集できません。"}]},diff --git a/app/src/assets/scss/protyle/_mindmap-view.scss b/app/src/assets/scss/protyle/_mindmap-view.scssindex f9f4c6ca25..13e660078c 100644--- a/app/src/assets/scss/protyle/_mindmap-view.scss+++ b/app/src/assets/scss/protyle/_mindmap-view.scss@@ -42,6 +42,10 @@line-height: 1.5;outline: none;+ &--active {+ outline: 1px solid var(--b3-theme-primary);+ }+&--nested {width: 260px;--mindmap-view-height: 260px;@@ -87,12 +91,14 @@}&.fullscreen &__toolbar,+ &--active &__toolbar,&:hover &__toolbar,&__toolbar:focus-within {opacity: 1;}&.fullscreen &__toolbar .block__icon,+ &--active &__toolbar .block__icon,&:hover &__toolbar .block__icon,&__toolbar:focus-within .block__icon {pointer-events: auto;@@ -192,7 +198,7 @@overflow: hidden;border-radius: inherit;cursor: default;- touch-action: none;+ touch-action: pan-y;user-select: none;&--dragging {@@ -204,6 +210,12 @@}}+ &--active &__viewport,+ &.fullscreen:not(.mindmap-view--locked) &__viewport {+ touch-action: none;+ cursor: grab;+ }+&__canvas {position: absolute;inset: 0;@@ -888,6 +900,7 @@@media print {.mindmap-view {break-inside: avoid;+ outline: none;height: var(--mindmap-view-print-height, 420px);min-height: 0;diff --git a/app/src/protyle/render/listMindmap/model.test.ts b/app/src/protyle/render/listMindmap/model.test.tsindex 636ed4c75a..15d2df5578 100644--- a/app/src/protyle/render/listMindmap/model.test.ts+++ b/app/src/protyle/render/listMindmap/model.test.ts@@ -1288,6 +1288,7 @@ const browserCases = async (sourceCode: string, css: string, taskSource: string,check.ok(addedNode.getBoundingClientRect().top >= zoomActions.getBoundingClientRect().bottom + 15,"the visible zoom popup also leaves clearance for the node");navigationHost.focus();+ navigationHost.dispatchEvent(new KeyboardEvent("keydown", {key: "Escape", bubbles: true}));await moveNavigationPointer(false);check.equal(getComputedStyle(navigationToolbar).opacity, "0");placeAtToolbar();@@ -1297,7 +1298,7 @@ const browserCases = async (sourceCode: string, css: string, taskSource: string,check.ok(hiddenToolbarNode.left >= hiddenToolbarViewport.left + 15 &&hiddenToolbarNode.right <= hiddenToolbarViewport.right - 15 &&hiddenToolbarNode.top >= hiddenToolbarViewport.top + 15, "hidden-toolbar target starts within the viewport margins");- navigationView.focusNode(addedItem.dataset.nodeId);+ navigationView.revealNode(addedItem.dataset.nodeId);await settle();check.deepEqual([navigationView.offsetX, navigationView.offsetY], hiddenToolbarTransform,"a hidden toolbar does not move a visible node");@@ -1363,6 +1364,7 @@ const browserCases = async (sourceCode: string, css: string, taskSource: string,navigationHost.style.transform = "";navigationToolbar.style.paddingTop = "";navigationHost.focus();+ navigationHost.dispatchEvent(new KeyboardEvent("keydown", {key: "Escape", bubbles: true}));navigationView.refreshLayout();await moveNavigationPointer(false);check.equal(getComputedStyle(navigationToolbar).opacity, "0");@@ -2636,7 +2638,7 @@ const browserCases = async (sourceCode: string, css: string, taskSource: string,host.querySelector<HTMLButtonElement>('[aria-label="listMindmapUnlock"]').click();await settle();check.equal(view.isLocked(), false);- check.equal(getComputedStyle(viewport).touchAction, "none");+ check.equal(getComputedStyle(viewport).touchAction, "pan-y");nodeElement(beta).dispatchEvent(new MouseEvent("dblclick", {bubbles: true}));check.equal(edits.length, editsBeforeLock, "unlocking a read-only document does not enable editing");view.setReadOnly(false);@@ -2984,7 +2986,7 @@ const browserCases = async (sourceCode: string, css: string, taskSource: string,check.equal(host.querySelector(".mindmap-view__ghost"), null);panButton.click();check.equal(panButton.getAttribute("aria-pressed"), "false");- check.equal(getComputedStyle(panViewport).cursor, "default");+ check.equal(getComputedStyle(panViewport).cursor, "grab");check.ok(getComputedStyle(panNode).pointerEvents !== "none");single.zoomAt(2.5);check.equal(single.scale, 2.5, "manual zoom can still enlarge a small map");@@ -3004,7 +3006,7 @@ const browserCases = async (sourceCode: string, css: string, taskSource: string,fitInspector.getBoundingClientRect().top, "fit keeps content above the visible inspector");fitInspector.hidden = true;- // 横向裁切不规则脑图后,滚轮和触摸平移仍保留实际节点,并在边界继续滚动文档。+ // 阅读时保留文档滚动,激活后平移受裁切的画布,边界处也维持滚动归属。{let markdown = "* Root\n";for (let depth = 1; depth <= 7; depth++) {@@ -3031,6 +3033,66 @@ const browserCases = async (sourceCode: string, css: string, taskSource: string,panView.offsetY = 120 - rootPosition.y;panView.draw();const viewport = panHost.querySelector<HTMLElement>(".mindmap-view__viewport");+ const sourceHTML = panModel.list.outerHTML;+ const readingTransform = [panView.scale, panView.offsetX, panView.offsetY];+ check.equal(panView.interactionActive, false);+ check.equal(getComputedStyle(viewport).touchAction, "pan-y");+ const readingWheel = new WheelEvent("wheel", {deltaY: 120, bubbles: true, cancelable: true});+ viewport.dispatchEvent(readingWheel);+ check.equal(readingWheel.defaultPrevented, false);+ check.deepEqual([panView.scale, panView.offsetX, panView.offsetY], readingTransform);+ const touch = {pointerId: 601, pointerType: "touch", isPrimary: true, button: 0,+ clientX: 100, clientY: 100, bubbles: true, cancelable: true};+ const readingTouch = new PointerEvent("pointerdown", touch);+ viewport.dispatchEvent(readingTouch);+ check.equal(readingTouch.defaultPrevented, false);+ check.equal(panView.pointer, undefined);+ check.equal(panView.interactionActive, false);+ scrollHost.scrollIntoView({block: "start"});+ await settle();+ const readingBounds = viewport.getBoundingClientRect();+ const readingPoint = {x: Math.round(readingBounds.left + 100), y: Math.round(readingBounds.top + 220)};+ check.equal(document.elementFromPoint(readingPoint.x, readingPoint.y)?.closest(".mindmap-view"), panHost,+ JSON.stringify({readingPoint, readingBounds: readingBounds.toJSON(), height: window.innerHeight}));+ await nativeInput([+ {type: "mouseMove", ...readingPoint},+ {type: "mouseWheel", ...readingPoint, deltaX: 0, deltaY: -100, canScroll: true},+ ]);+ await new Promise(resolve => setTimeout(resolve, 100));+ check.ok(scrollHost.scrollTop > 0, "native reading wheel scrolls the document over a clipped map");+ scrollHost.scrollTop = 0;+ const nativeTouch = (events: Record<string, unknown>[]) =>+ require("electron").ipcRenderer.invoke("mindmap-view-native-touch", events);+ const fingerAt = (id: number, dx = 0, dy = 0) => ({id, x: readingPoint.x + dx, y: readingPoint.y + dy});+ await nativeTouch([+ {type: "touchStart", touchPoints: [fingerAt(1)]},+ ...[-20, -40, -60, -80, -100].map(dy => ({type: "touchMove", touchPoints: [fingerAt(1, 0, dy)]})),+ {type: "touchEnd", touchPoints: []},+ ]);+ await new Promise(resolve => setTimeout(resolve, 200));+ check.ok(scrollHost.scrollTop > 0, "native one-finger reading swipe scrolls the document");+ check.deepEqual([panView.scale, panView.offsetX, panView.offsetY], readingTransform);+ check.equal(panView.interactionActive, false);+ scrollHost.scrollTop = 0;+ await nativeTouch([+ {type: "touchStart", touchPoints: [fingerAt(1), fingerAt(2, 100)]},+ {type: "touchMove", touchPoints: [fingerAt(1, 30, -20), fingerAt(2, 130, -20)]},+ {type: "touchMove", touchPoints: [fingerAt(1, 10, -20), fingerAt(2, 150, -20)]},+ {type: "touchEnd", touchPoints: []},+ ]);+ await settle();+ check.ok(panView.scale > readingTransform[0], "native two-finger input zooms the reading canvas");+ check.notEqual(panView.offsetX, readingTransform[1], "native two-finger input pans the reading canvas");+ check.equal(panView.interactionActive, false);+ check.equal(scrollHost.scrollTop, 0, "explicit two-finger input does not scroll the document");+ panView.scale = readingTransform[0];+ panView.offsetX = readingTransform[1];+ panView.offsetY = readingTransform[2];+ panView.draw();+ panHost.querySelector<HTMLButtonElement>('[aria-label="listMindmapActivate"]').click();+ check.equal(panView.interactionActive, true);+ check.equal(getComputedStyle(viewport).touchAction, "none");+ check.equal(panHost.querySelector('[aria-label="listMindmapDeactivate"]').getAttribute("aria-pressed"), "true");const fixedX = panView.offsetX;const checkVisibleNode = () => {const bounds = viewport.getBoundingClientRect();@@ -3048,18 +3110,28 @@ const browserCases = async (sourceCode: string, css: string, taskSource: string,checkVisibleNode();const next = new WheelEvent("wheel", {deltaY, bubbles: true, cancelable: true});viewport.dispatchEvent(next);- check.equal(next.defaultPrevented, false, "the next wheel event is handed back to document scrolling");+ check.equal(next.defaultPrevented, true, "active canvas keeps wheel input at the pan boundary");}panView.offsetY = 120 - rootPosition.y;panView.draw();panHost.querySelector<HTMLButtonElement>('[aria-label="cursorHand"]').click();- const touch = {pointerId: 601, pointerType: "touch", isPrimary: true, button: 0,- clientX: 100, clientY: 100, bubbles: true, cancelable: true};viewport.dispatchEvent(new PointerEvent("pointerdown", touch));viewport.dispatchEvent(new PointerEvent("pointermove", {...touch, clientY: -1900}));checkVisibleNode();- check.ok(scrollHost.scrollTop > 0, "touch overflow scrolls the real document container");+ check.equal(scrollHost.scrollTop, 0, "active canvas does not hand touch overflow to the document");viewport.dispatchEvent(new PointerEvent("pointerup", {...touch, clientY: -1900}));+ panHost.dispatchEvent(new KeyboardEvent("keydown", {key: "Escape", bubbles: true}));+ check.equal(panView.interactionActive, false);+ check.equal(getComputedStyle(viewport).touchAction, "pan-y");+ sendPointer(viewport, "pointerdown", 100, 100);+ sendPointer(viewport, "pointerup", 100, 100);+ check.equal(panView.interactionActive, true, "desktop pointer input activates the canvas");+ document.body.dispatchEvent(new PointerEvent("pointerdown", {bubbles: true}));+ check.equal(panView.interactionActive, false, "outside pointer input returns to reading");+ panHost.querySelector<HTMLButtonElement>('[aria-label="listMindmapActivate"]').click();+ panHost.dispatchEvent(new FocusEvent("focusout", {relatedTarget: followingContent}));+ check.equal(panView.interactionActive, false, "moving focus outside returns to reading");+ check.equal(panModel.list.outerHTML, sourceHTML, "interaction activation and panning do not change saved data");panView.destroy();scrollHost.remove();}@@ -4496,6 +4568,17 @@ app.whenReady().then(async () => {await new Promise(resolve => setTimeout(resolve, 20));}});+ ipcMain.handle("mindmap-view-native-touch", async (_event, events) => {+ await win.webContents.debugger.sendCommand("Emulation.setTouchEmulationEnabled", {enabled: true, maxTouchPoints: 2});+ try {+ for (const event of events) {+ await win.webContents.debugger.sendCommand("Input.dispatchTouchEvent", event);+ await new Promise(resolve => setTimeout(resolve, 30));+ }+ } finally {+ await win.webContents.debugger.sendCommand("Emulation.setTouchEmulationEnabled", {enabled: false});+ }+ });try {await win.loadURL("data:text/html,<html><body></body></html>");await win.webContents.executeJavaScript(require("node:fs").readFileSync(${JSON.stringify(lutePath)}, "utf8"));diff --git a/app/src/protyle/render/listMindmap/pinch.test.ts b/app/src/protyle/render/listMindmap/pinch.test.tsindex 3bb00584c8..b6d002108a 100644--- a/app/src/protyle/render/listMindmap/pinch.test.ts+++ b/app/src/protyle/render/listMindmap/pinch.test.ts@@ -22,7 +22,7 @@ const setup = () => {const target = new context.View();let cancelled = 0;Object.assign(target, {- scale: 1, offsetX: 0, offsetY: 0, pinching: false,+ scale: 1, offsetX: 0, offsetY: 0, pinching: false, interactionActive: false,viewport: {contains: (element: {outside?: boolean} | null) => !!element && !element.outside,getBoundingClientRect: () => ({left: 10, top: 20})},cancelPointer: () => { cancelled++; target.pendingPointerId = undefined; },@@ -53,6 +53,33 @@ test("pinch cancels dragging and zooms around the finger midpoint within existinassert.equal(target.scale, .15);});+test("two fingers pan and zoom a reading canvas without activating single-finger dragging", () => {+ const {target} = setup();+ target.pinchStart(event(touch(60), touch(160)));+ target.pinchMove(event(touch(90, 140), touch(190, 140)));+ assert.equal(target.scale, 1);+ assert.equal(target.offsetX, 30);+ assert.equal(target.offsetY, 20);+ target.pinchMove(event(touch(50, 160), touch(250, 160)));+ assert.equal(target.scale, 2);+ assert.equal(target.offsetX, -60);+ assert.equal(target.offsetY, -60);+ target.pinchEnd(event());+ target.pointerDown({pointerType: "touch", isPrimary: true});+ assert.equal(target.pointer, undefined);+ assert.equal(target.interactionActive, false);+});++test("saved view locks prohibit two-finger gestures", () => {+ const {target, cancelled} = setup();+ target.locked = true;+ target.pinchStart(event(touch(60), touch(160)));+ target.pinchMove(event(touch(10), touch(210)));+ assert.equal(target.scale, 1);+ assert.equal(target.pinching, false);+ assert.equal(cancelled(), 0);+});+test("remaining fingers cannot start a drag and a new gesture starts at the current scale", () => {const {target} = setup();target.pinchStart(event(touch(60), touch(160)));diff --git a/app/src/protyle/render/listMindmap/view.ts b/app/src/protyle/render/listMindmap/view.tsindex 044531c3b4..9ad8c533e2 100644--- a/app/src/protyle/render/listMindmap/view.ts+++ b/app/src/protyle/render/listMindmap/view.ts@@ -166,7 +166,7 @@ export class ListMindmapView {private pointer?: PointerState;private pointerCapture?: HTMLElement;private pinching = false;- private pinch?: {distance: number, scale: number};+ private pinch?: {distance: number, scale: number, x: number, y: number};private pendingPointerId?: number;private endInteraction?: () => void;private linkTimer = 0;@@ -174,6 +174,7 @@ export class ListMindmapView {private ghost?: HTMLDivElement;private scale = 1;private panning = false;+ private interactionActive = false;private locked = false;private persistedLocked = false;private offsetX = 0;@@ -193,6 +194,7 @@ export class ListMindmapView {this.locked = this.persistedLocked = !!options.model.metadata.viewLocked;this.selectedId = options.model.root.id;options.host.classList.add("mindmap-view");+ options.host.classList.remove("mindmap-view--active");options.host.contentEditable = "false";options.host.setAttribute("role", "group");options.host.setAttribute("aria-label", this.label("mindmap"));@@ -240,6 +242,12 @@ export class ListMindmapView {this.viewport.append(this.summaryBox);this.createToolbar();this.listen(document, "pointerdown", this.dismissControls, {capture: true});+ this.listen(options.host, "pointerdown", this.activatePointer, {capture: true});+ this.listen(options.host, "focusout", (event: FocusEvent) => {+ if (event.relatedTarget instanceof Node && !options.host.contains(event.relatedTarget)) {+ this.setInteractionActive(false);+ }+ });this.listen(options.host, "pointerover", this.showButtonTooltip);this.listen(options.host, "focusin", this.showButtonTooltip);["pointerout", "focusout"].forEach(type => this.listen(options.host, type, this.hideButtonTooltip));@@ -260,6 +268,7 @@ export class ListMindmapView {this.listen(window, "blur", () => {this.pinching = false;this.pinch = undefined;+ this.setInteractionActive(false);});this.listen(this.viewport, "contextmenu", (event: MouseEvent) => {if (this.suppressPanContextMenu) {@@ -397,6 +406,9 @@ export class ListMindmapView {private dismissControls = (event: PointerEvent) => {const target = event.target as Node;this.tooltip.hidden = true;+ if (!this.options.host.contains(target)) {+ this.setInteractionActive(false);+ }if (this.editingId && this.isPanTarget(event)) {return;}@@ -446,12 +458,48 @@ export class ListMindmapView {return this.locked;}+ private activatePointer = (event: PointerEvent) => {+ const target = event.target as Element;+ if (target.closest(".mindmap-view") !== this.options.host ||+ this.buttons.get("interaction")?.contains(target) || this.buttons.get("lock")?.contains(target)) {+ return;+ }+ if (event.pointerType !== "touch" || target.closest("button, input, select")) {+ this.setInteractionActive(true);+ }+ };++ private setInteractionActive(value: boolean) {+ value = (value || !!this.fullscreenMarker) && !this.locked;+ this.interactionActive = value;+ this.options.host.classList.toggle("mindmap-view--active", value);+ const button = this.buttons.get("interaction");+ button?.classList.toggle("block__icon--active", value);+ button?.setAttribute("aria-pressed", String(value));+ button?.setAttribute("aria-label", this.label(value ? "listMindmapDeactivate" : "listMindmapActivate"));+ if (!value) {+ const selecting = !!this.relationFrom || this.summarySelecting;+ this.pinching = false;+ this.pinch = undefined;+ this.cancelPointer();+ this.setPanning(false);+ this.relationFrom = undefined;+ this.relationPreview = undefined;+ this.cancelSummarySelection();+ this.inspector.hidden = true;+ if (selecting) {+ this.updateSelection();+ }+ }+ }+private get readOnly() {return this.locked || this.options.readOnly;}private setLocked(value: boolean) {this.locked = value;+ this.setInteractionActive(false);this.pinching = false;this.pinch = undefined;this.setPanning(false);@@ -511,6 +559,15 @@ export class ListMindmapView {add("fullscreen", "fullscreen", "iconFullscreen", () => this.toggleFullscreen());return;}+ add("interaction", this.interactionActive ? "listMindmapDeactivate" : "listMindmapActivate", "iconEdit", () => {+ this.setInteractionActive(!this.interactionActive);+ if (this.interactionActive) {+ this.options.host.focus({preventScroll: true});+ }+ });+ this.buttons.get("interaction").setAttribute("aria-pressed", String(this.interactionActive));+ this.buttons.get("interaction").classList.toggle("block__icon--active", this.interactionActive);+ this.buttons.get("interaction").hidden = !!this.fullscreenMarker;if (!this.readOnly) {if (this.options.onSettingsMenu) {add("settings", "listMindmapConnectors", "iconLine", () => this.options.onSettingsMenu(this.buttons.get("settings")));@@ -518,6 +575,7 @@ export class ListMindmapView {}add("summary", "listMindmapSummary", "iconGroups", () => {this.finishThen(() => {+ this.setInteractionActive(true);const selecting = !this.summarySelecting;this.cancelPointer();this.cancelSummarySelection();@@ -534,6 +592,7 @@ export class ListMindmapView {});});add("relation", "connect", "iconRoute", () => {+ this.setInteractionActive(true);this.cancelSummarySelection();this.setPanning(false);this.inspector.hidden = true;@@ -569,6 +628,7 @@ export class ListMindmapView {}add("pan", "cursorHand", "iconPan", () => {this.finishThen(() => {+ this.setInteractionActive(true);this.finishRelationEdit?.(true);this.cancelPointer();this.setPanning(!this.panning);@@ -940,6 +1000,7 @@ export class ListMindmapView {if (this.destroyed || !this.model.nodes.has(id)) {return;}+ this.setInteractionActive(true);this.selectNode(id);this.options.host.focus({preventScroll: true});this.revealNode(id);@@ -951,6 +1012,7 @@ export class ListMindmapView {}this.editingId = id;if (id) {+ this.setInteractionActive(true);this.destroyContentViews(id);this.selectNode(id);this.nodeElements.get(id)?.classList.add("mindmap-view__node--editing");@@ -2081,7 +2143,9 @@ export class ListMindmapView {this.suppressLinkClick = true;this.pinching = true;const [first, second] = Array.from(event.touches);- this.pinch = {distance: Math.hypot(first.clientX - second.clientX, first.clientY - second.clientY), scale: this.scale};+ const bounds = this.viewport.getBoundingClientRect();+ this.pinch = {distance: Math.hypot(first.clientX - second.clientX, first.clientY - second.clientY), scale: this.scale,+ x: (first.clientX + second.clientX) / 2 - bounds.left, y: (first.clientY + second.clientY) / 2 - bounds.top};};private pinchMove = (event: TouchEvent) => {@@ -2094,9 +2158,14 @@ export class ListMindmapView {}const [first, second] = Array.from(event.touches);const bounds = this.viewport.getBoundingClientRect();+ const x = (first.clientX + second.clientX) / 2 - bounds.left;+ const y = (first.clientY + second.clientY) / 2 - bounds.top;+ this.offsetX += x - this.pinch.x;+ this.offsetY += y - this.pinch.y;+ this.pinch.x = x;+ this.pinch.y = y;this.zoomAt(this.pinch.scale * Math.hypot(first.clientX - second.clientX, first.clientY - second.clientY) /- this.pinch.distance, (first.clientX + second.clientX) / 2 - bounds.left,- (first.clientY + second.clientY) / 2 - bounds.top);+ this.pinch.distance, x, y);};private pinchEnd = (event: TouchEvent) => {@@ -2116,6 +2185,7 @@ export class ListMindmapView {public isPanTarget(event: PointerEvent) {const target = event.target as HTMLElement;return !this.locked && !this.pinching && !this.summarySelecting && !this.relationFrom &&+ (event.pointerType !== "touch" || this.interactionActive || !!this.fullscreenMarker) &&(event.pointerType !== "touch" || event.isPrimary) && [0, 2].includes(event.button) &&this.viewport.contains(target) && target.closest(".mindmap-view") === this.options.host &&!target.closest("button, input, select, textarea, audio, video, iframe, .mindmap-view__node--editing") &&@@ -2124,7 +2194,8 @@ export class ListMindmapView {}private pointerDown = (event: PointerEvent) => {- if (this.locked || this.pinching || event.pointerType === "touch" && !event.isPrimary) {+ if (this.locked || this.pinching || event.pointerType === "touch" &&+ (!event.isPrimary || !this.interactionActive && !this.fullscreenMarker)) {return;}clearTimeout(this.linkTimer);@@ -2355,16 +2426,9 @@ export class ListMindmapView {this.viewport.classList.add("mindmap-view__viewport--dragging");if (!pointer.id) {const bounded = this.boundedPan(pointer.x + dx, pointer.y + dy);- const remainingY = pointer.y + dy - bounded.y;this.offsetX = bounded.x;this.offsetY = bounded.y;this.draw();- if (event.pointerType === "touch" && remainingY && !this.fullscreenMarker) {- const scrollHost = this.options.host.closest<HTMLElement>(".protyle-content");- if (scrollHost) {- scrollHost.scrollTop -= remainingY;- }- }pointer.x = this.offsetX;pointer.y = this.offsetY;pointer.startX = event.clientX;@@ -2648,6 +2712,7 @@ export class ListMindmapView {if (this.readOnly) {return;}+ this.setInteractionActive(true);const summary = target.closest<HTMLElement>(".mindmap-view__summary");if (summary) {this.editSummaryLabel(summary.dataset.summaryId);@@ -2804,7 +2869,7 @@ export class ListMindmapView {const unitY = mode === WheelEvent.DOM_DELTA_LINE ? 16 :mode === WheelEvent.DOM_DELTA_PAGE ? this.viewport.clientHeight : 1;// 浏览器将触控板捏合转换为带 Ctrl 的滚轮事件,和鼠标组合滚轮共用光标锚点缩放。- if (event.ctrlKey) {+ if (event.ctrlKey || event.metaKey) {event.preventDefault();event.stopPropagation();const bounds = this.viewport.getBoundingClientRect();@@ -2813,18 +2878,12 @@ export class ListMindmapView {event.clientX - bounds.left, event.clientY - bounds.top);return;}- if (!this.fullscreenMarker && !event.shiftKey && !event.deltaX && event.deltaY) {- const {top, bottom} = this.contentBounds();- if (top * this.scale + this.offsetY >= 0 && bottom * this.scale + this.offsetY <= this.viewport.clientHeight) {- return;- }+ if (!this.interactionActive && !this.fullscreenMarker) {+ return;}const next = this.boundedPan(this.offsetX - (event.shiftKey ?(event.deltaX ? event.deltaX : event.deltaY) * unitX : event.deltaX * unitX),this.offsetY - (event.shiftKey ? 0 : event.deltaY * unitY));- if (!this.fullscreenMarker && !event.shiftKey && event.deltaY && next.y === this.offsetY) {- return;- }event.preventDefault();event.stopPropagation();this.offsetX = next.x;@@ -3148,11 +3207,16 @@ export class ListMindmapView {this.inspector.hidden = true;if (this.fullscreenMarker && !selectingSummary) {this.exitFullscreen();+ } else if (!selectingSummary) {+ this.setInteractionActive(false);}this.updateSelection();} else {return;}+ if (event.key !== "Escape") {+ this.setInteractionActive(true);+ }event.preventDefault();event.stopPropagation();};@@ -3317,6 +3381,11 @@ export class ListMindmapView {private fullscreenChange = () => {const active = !!this.fullscreenMarker;+ this.setInteractionActive(active);+ const interaction = this.buttons.get("interaction");+ if (interaction) {+ interaction.hidden = active;+ }this.tooltip.hidden = true;const button = this.buttons.get("fullscreen");button.setAttribute("aria-label", this.label(active ? "exitFullscreen" : "fullscreen"));@@ -3340,6 +3409,7 @@ export class ListMindmapView {this.resizeObserver.disconnect();this.disposers.forEach(dispose => dispose());this.exitFullscreen();+ this.options.host.classList.remove("mindmap-view--active");this.nodeElements.forEach((_element, id) => this.destroyContentViews(id));this.nodeElements.clear();this.relationElements.clear();diff --git a/app/src/protyle/render/listMindmap/viewportFocus.test.ts b/app/src/protyle/render/listMindmap/viewportFocus.test.tsindex 199a6d354f..31fd754373 100644--- a/app/src/protyle/render/listMindmap/viewportFocus.test.ts+++ b/app/src/protyle/render/listMindmap/viewportFocus.test.ts@@ -22,12 +22,13 @@ const setup = () => {let focus = "editor";let finished = 0;let drawn = 0;- const host = {focus: () => focus = "canvas"};+ const host = {focus: () => focus = "canvas", contains: () => true};const target = Object.assign(new context.View(), {options: {host}, editingId: "new", model: {nodes: new Map([["new", {}]])},selectedId: "new", tooltip: {}, inspector: {hidden: true}, summaryControls: {hidden: true},toolbar: {hidden: false, querySelectorAll: (): unknown[] => []},nodeElements: new Map(), offsetX: 0, offsetY: 0,+ interactionActive: true, setInteractionActive: () => {},viewport: {contains: (element: unknown) => !!element, setPointerCapture: () => {},offsetWidth: 400, offsetHeight: 300,getBoundingClientRect: () => ({left: 0, top: 0, right: 400, bottom: 300, width: 400, height: 300})},diff --git a/app/src/protyle/render/listMindmap/wheel.test.ts b/app/src/protyle/render/listMindmap/wheel.test.tsindex b5c07f123a..f35c31a30d 100644--- a/app/src/protyle/render/listMindmap/wheel.test.ts+++ b/app/src/protyle/render/listMindmap/wheel.test.ts@@ -24,7 +24,7 @@ const setup = () => {let draws = 0;const zooms: number[][] = [];Object.assign(target, {- scale: 1, offsetX: 0, offsetY: 0,+ scale: 1, offsetX: 0, offsetY: 0, interactionActive: true,viewport: {clientWidth: 400, clientHeight: 300, contains: (element: unknown) => !!element,getBoundingClientRect: () => ({left: 10, top: 20}),@@ -49,10 +49,11 @@ const wheel = (overrides: Record<string, unknown> = {}) => {};};-test("vertical wheel scrolls the document when the embedded mind map is fully visible", () => {+test("inactive maps leave vertical wheel input to the document", () => {for (const deltaY of [-1, 1]) {for (const deltaMode of [0, 1, 2]) {const {target, draws} = setup();+ target.interactionActive = false;const event = wheel({deltaY, deltaMode});target.wheel(event.event);assert.equal(event.prevented(), 0);@@ -64,24 +65,25 @@ test("vertical wheel scrolls the document when the embedded mind map is fully vi}});-test("visibility uses scaled content bounds and current offsets, including exact viewport edges", () => {+test("inactive maps leave scrolling to the document regardless of scale and content clipping", () => {const {target, draws} = setup();target.positions = new Map([["root", {x: 100, y: 51, width: 800, height: 599}]]);- Object.assign(target, {scale: .5, offsetX: -50, offsetY: -25});+ Object.assign(target, {scale: .5, offsetX: -50, offsetY: -100, interactionActive: false});const event = wheel();target.wheel(event.event);assert.equal(event.prevented(), 0);assert.equal(draws(), 0);assert.equal(target.offsetX, -50);- assert.equal(target.offsetY, -25);+ assert.equal(target.offsetY, -100);});-test("horizontal clipping does not change pure vertical wheel handling", () => {+test("inactive maps do not capture horizontal, diagonal or Shift wheel input", () => {for (const x of [-101, 201]) {const {target, draws} = setup();+ target.interactionActive = false;target.offsetX = x;for (const deltaY of [-20, 20]) {- const event = wheel({deltaY});+ const event = wheel({deltaX: 20, deltaY, shiftKey: deltaY < 0});target.wheel(event.event);assert.equal(event.prevented(), 0);assert.equal(event.stopped(), 0);@@ -92,8 +94,9 @@ test("horizontal clipping does not change pure vertical wheel handling", () => {}});-test("vertically clipped content keeps the original canvas scrolling range", () => {+test("active maps pan visible and clipped content within the existing bounds", () => {for (const bounds of [+ {left: 100, top: 100, right: 300, bottom: 200},{left: 100, top: -1, right: 300, bottom: 200},{left: 100, top: 100, right: 300, bottom: 301},]) {@@ -123,7 +126,7 @@ test("wheel retains actual visible content when extreme nodes are horizontally cassert.equal(target.positions.get("visible").y + 79 + target.offsetY, 64);const next = wheel();target.wheel(next.event);- assert.equal(next.prevented(), 0, "further vertical input scrolls the document");+ assert.equal(next.prevented(), 1, "active canvas retains wheel ownership at the pan boundary");assert.equal(target.offsetY, -116);});@@ -139,7 +142,7 @@ test("vertical wheel still pans beyond the content edge until only a small portiassert.equal(target.offsetY, -636);const next = wheel();target.wheel(next.event);- assert.equal(next.prevented(), 0);+ assert.equal(next.prevented(), 1);});test("visible relation and summary labels remain reachable as pan references", () => {@@ -155,7 +158,7 @@ test("visible relation and summary labels remain reachable as pan references", ("hidden annotations cannot keep an otherwise empty viewport within range");});-test("mobile touch panning retains visible content and chains overflow to the document", () => {+test("active mobile touch panning retains visible content without scrolling the document", () => {const {target} = setup();target.positions = new Map([["visible", {x: 100, y: 101, width: 100, height: 79}],@@ -170,10 +173,10 @@ test("mobile touch panning retains visible content and chains overflow to the dotarget.pointerMove(event);assert.equal(target.offsetX, 0);assert.equal(target.offsetY, -116);- assert.equal(document.scrollTop, 1884);+ assert.equal(document.scrollTop, 0);target.pointerMove({...event, clientY: -1920});assert.equal(target.offsetY, -116);- assert.equal(document.scrollTop, 1904, "further touch movement scrolls the document at the same content boundary");+ assert.equal(document.scrollTop, 0, "active canvas retains touch ownership at the pan boundary");});test("fullscreen, horizontal, diagonal and Shift wheel keep canvas panning", () => {@@ -185,6 +188,7 @@ test("fullscreen, horizontal, diagonal and Shift wheel keep canvas panning", ()]) {const {target, draws} = setup();target.fullscreenMarker = options.fullscreenMarker;+ target.interactionActive = !options.fullscreenMarker;const event = wheel(options.event);target.wheel(event.event);assert.equal(event.prevented(), 1);@@ -195,14 +199,18 @@ test("fullscreen, horizontal, diagonal and Shift wheel keep canvas panning", ()}});-test("Ctrl wheel keeps anchored zoom even when all content is visible", () => {- const {target, draws, zooms} = setup();- const event = wheel({ctrlKey: true});- target.wheel(event.event);- assert.equal(event.prevented(), 1);- assert.equal(event.stopped(), 1);- assert.equal(draws(), 0);- assert.deepEqual(zooms, [[Math.exp(-.2), 100, 100]]);+test("Ctrl and Meta wheel zoom an inactive canvas without activating ordinary wheel capture", () => {+ for (const key of ["ctrlKey", "metaKey"]) {+ const {target, draws, zooms} = setup();+ target.interactionActive = false;+ const event = wheel({[key]: true});+ target.wheel(event.event);+ assert.equal(event.prevented(), 1);+ assert.equal(event.stopped(), 1);+ assert.equal(draws(), 0);+ assert.deepEqual(zooms, [[Math.exp(-.2), 100, 100]]);+ assert.equal(target.interactionActive, false);+ }});test("locked maps, node editing and relation dragging retain their existing wheel handling", () => {