Skip to content

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

:sparkles: Improve super block creation and local column insertion https://github.com/siyuan-note/siyuan/issues/19919

Danielac74c18118c5
diff --git a/app/appearance/langs/ar.json b/app/appearance/langs/ar.json
index 33e26b1f9d..e37fb34301 100644
--- a/app/appearance/langs/ar.json
+++ b/app/appearance/langs/ar.json
@@ -1,6 +1,14 @@
{
"bindDocument": "ربط مستند",
"selectOneDocument": "يرجى تحديد مستند واحد",
+ "horizontalSuperBlock": "كتلة خارقة أفقية",
+ "verticalSuperBlock": "كتلة خارقة عمودية",
+ "prependSuperBlockColumn": "إضافة عمود إلى بداية الكتلة الخارقة الحالية",
+ "appendSuperBlockColumn": "إضافة عمود إلى نهاية الكتلة الخارقة الحالية",
+ "prependSuperBlockChild": "إضافة كتلة إلى بداية الكتلة الخارقة الحالية",
+ "appendSuperBlockChild": "إضافة كتلة إلى نهاية الكتلة الخارقة الحالية",
+ "createSuperBlockLeft": "إنشاء أعمدة محلية إلى اليسار",
+ "createSuperBlockRight": "إنشاء أعمدة محلية إلى اليمين",
"listMindmapLock": "قفل العرض",
"listMindmapUnlock": "إلغاء قفل العرض",
"historySnapshots": "اللقطات الموسومة المرتبطة",
diff --git a/app/appearance/langs/de.json b/app/appearance/langs/de.json
index 2c1f070ed2..7a346f25d9 100644
--- a/app/appearance/langs/de.json
+++ b/app/appearance/langs/de.json
@@ -1,6 +1,14 @@
{
"bindDocument": "Dokument verknüpfen",
"selectOneDocument": "Bitte genau ein Dokument auswählen",
+ "horizontalSuperBlock": "Horizontaler Superblock",
+ "verticalSuperBlock": "Vertikaler Superblock",
+ "prependSuperBlockColumn": "Spalte am Anfang des aktuellen Superblocks hinzufügen",
+ "appendSuperBlockColumn": "Spalte am Ende des aktuellen Superblocks hinzufügen",
+ "prependSuperBlockChild": "Block am Anfang des aktuellen Superblocks hinzufügen",
+ "appendSuperBlockChild": "Block am Ende des aktuellen Superblocks hinzufügen",
+ "createSuperBlockLeft": "Lokale Spalten links erstellen",
+ "createSuperBlockRight": "Lokale Spalten rechts erstellen",
"listMindmapLock": "Ansicht sperren",
"listMindmapUnlock": "Ansicht entsperren",
"historySnapshots": "Zugehörige markierte Schnappschüsse",
diff --git a/app/appearance/langs/en.json b/app/appearance/langs/en.json
index d2c8d3aeb3..95e710d228 100644
--- a/app/appearance/langs/en.json
+++ b/app/appearance/langs/en.json
@@ -1,6 +1,14 @@
{
"bindDocument": "Bind document",
"selectOneDocument": "Please select one document",
+ "horizontalSuperBlock": "Horizontal super block",
+ "verticalSuperBlock": "Vertical super block",
+ "prependSuperBlockColumn": "Add a column to the beginning of the current super block",
+ "appendSuperBlockColumn": "Add a column to the end of the current super block",
+ "prependSuperBlockChild": "Add a block to the beginning of the current super block",
+ "appendSuperBlockChild": "Add a block to the end of the current super block",
+ "createSuperBlockLeft": "Create local columns to the left",
+ "createSuperBlockRight": "Create local columns to the right",
"listMindmapLock": "Lock view",
"listMindmapUnlock": "Unlock view",
"historySnapshots": "Related tagged snapshots",
diff --git a/app/appearance/langs/es.json b/app/appearance/langs/es.json
index 9c78b7521e..24e704f941 100644
--- a/app/appearance/langs/es.json
+++ b/app/appearance/langs/es.json
@@ -1,6 +1,14 @@
{
"bindDocument": "Vincular documento",
"selectOneDocument": "Selecciona un solo documento",
+ "horizontalSuperBlock": "Superbloque horizontal",
+ "verticalSuperBlock": "Superbloque vertical",
+ "prependSuperBlockColumn": "Añadir una columna al principio del superbloque actual",
+ "appendSuperBlockColumn": "Añadir una columna al final del superbloque actual",
+ "prependSuperBlockChild": "Añadir un bloque al principio del superbloque actual",
+ "appendSuperBlockChild": "Añadir un bloque al final del superbloque actual",
+ "createSuperBlockLeft": "Crear columnas locales a la izquierda",
+ "createSuperBlockRight": "Crear columnas locales a la derecha",
"listMindmapLock": "Bloquear vista",
"listMindmapUnlock": "Desbloquear vista",
"historySnapshots": "Instantáneas etiquetadas relacionadas",
diff --git a/app/appearance/langs/fr.json b/app/appearance/langs/fr.json
index da078432a7..267f7fb675 100644
--- a/app/appearance/langs/fr.json
+++ b/app/appearance/langs/fr.json
@@ -1,6 +1,14 @@
{
"bindDocument": "Lier un document",
"selectOneDocument": "Veuillez sélectionner un seul document",
+ "horizontalSuperBlock": "Superblock horizontal",
+ "verticalSuperBlock": "Superblock vertical",
+ "prependSuperBlockColumn": "Ajouter une colonne au début du superblock actuel",
+ "appendSuperBlockColumn": "Ajouter une colonne à la fin du superblock actuel",
+ "prependSuperBlockChild": "Ajouter un bloc au début du superblock actuel",
+ "appendSuperBlockChild": "Ajouter un bloc à la fin du superblock actuel",
+ "createSuperBlockLeft": "Créer des colonnes locales à gauche",
+ "createSuperBlockRight": "Créer des colonnes locales à droite",
"listMindmapLock": "Verrouiller la vue",
"listMindmapUnlock": "Déverrouiller la vue",
"historySnapshots": "Instantanés étiquetés associés",
diff --git a/app/appearance/langs/he.json b/app/appearance/langs/he.json
index c9c8cbeeec..b15dd94095 100644
--- a/app/appearance/langs/he.json
+++ b/app/appearance/langs/he.json
@@ -1,6 +1,14 @@
{
"bindDocument": "קישור מסמך",
"selectOneDocument": "נא לבחור מסמך אחד",
+ "horizontalSuperBlock": "בלוק עליון אופקי",
+ "verticalSuperBlock": "בלוק עליון אנכי",
+ "prependSuperBlockColumn": "הוספת עמודה לתחילת הבלוק העליון הנוכחי",
+ "appendSuperBlockColumn": "הוספת עמודה לסוף הבלוק העליון הנוכחי",
+ "prependSuperBlockChild": "הוספת בלוק לתחילת הבלוק העליון הנוכחי",
+ "appendSuperBlockChild": "הוספת בלוק לסוף הבלוק העליון הנוכחי",
+ "createSuperBlockLeft": "יצירת עמודות מקומיות משמאל",
+ "createSuperBlockRight": "יצירת עמודות מקומיות מימין",
"listMindmapLock": "נעילת התצוגה",
"listMindmapUnlock": "ביטול נעילת התצוגה",
"historySnapshots": "תמונות מצב מתויגות קשורות",
diff --git a/app/appearance/langs/hi.json b/app/appearance/langs/hi.json
index 519be3496a..f3be82daa7 100644
--- a/app/appearance/langs/hi.json
+++ b/app/appearance/langs/hi.json
@@ -1,6 +1,14 @@
{
"bindDocument": "दस्तावेज़ जोड़ें",
"selectOneDocument": "कृपया एक दस्तावेज़ चुनें",
+ "horizontalSuperBlock": "क्षैतिज सुपर ब्लॉक",
+ "verticalSuperBlock": "लंबवत सुपर ब्लॉक",
+ "prependSuperBlockColumn": "वर्तमान सुपर ब्लॉक की शुरुआत में कॉलम जोड़ें",
+ "appendSuperBlockColumn": "वर्तमान सुपर ब्लॉक के अंत में कॉलम जोड़ें",
+ "prependSuperBlockChild": "वर्तमान सुपर ब्लॉक की शुरुआत में ब्लॉक जोड़ें",
+ "appendSuperBlockChild": "वर्तमान सुपर ब्लॉक के अंत में ब्लॉक जोड़ें",
+ "createSuperBlockLeft": "बाईं ओर स्थानीय कॉलम बनाएँ",
+ "createSuperBlockRight": "दाईं ओर स्थानीय कॉलम बनाएँ",
"listMindmapLock": "दृश्य लॉक करें",
"listMindmapUnlock": "दृश्य अनलॉक करें",
"historySnapshots": "संबंधित टैग किए गए स्नैपशॉट",
diff --git a/app/appearance/langs/id.json b/app/appearance/langs/id.json
index 508c976861..033c77b33b 100644
--- a/app/appearance/langs/id.json
+++ b/app/appearance/langs/id.json
@@ -1,6 +1,14 @@
{
"bindDocument": "Tautkan dokumen",
"selectOneDocument": "Silakan pilih satu dokumen",
+ "horizontalSuperBlock": "Super blok horizontal",
+ "verticalSuperBlock": "Super blok vertikal",
+ "prependSuperBlockColumn": "Tambahkan kolom ke awal super blok saat ini",
+ "appendSuperBlockColumn": "Tambahkan kolom ke akhir super blok saat ini",
+ "prependSuperBlockChild": "Tambahkan blok ke awal super blok saat ini",
+ "appendSuperBlockChild": "Tambahkan blok ke akhir super blok saat ini",
+ "createSuperBlockLeft": "Buat kolom lokal di sebelah kiri",
+ "createSuperBlockRight": "Buat kolom lokal di sebelah kanan",
"listMindmapLock": "Kunci tampilan",
"listMindmapUnlock": "Buka kunci tampilan",
"historySnapshots": "Snapshot bertanda terkait",
diff --git a/app/appearance/langs/it.json b/app/appearance/langs/it.json
index 2982c2adcb..e087aa4918 100644
--- a/app/appearance/langs/it.json
+++ b/app/appearance/langs/it.json
@@ -1,6 +1,14 @@
{
"bindDocument": "Collega documento",
"selectOneDocument": "Seleziona un solo documento",
+ "horizontalSuperBlock": "Super blocco orizzontale",
+ "verticalSuperBlock": "Super blocco verticale",
+ "prependSuperBlockColumn": "Aggiungi una colonna all'inizio del super blocco corrente",
+ "appendSuperBlockColumn": "Aggiungi una colonna alla fine del super blocco corrente",
+ "prependSuperBlockChild": "Aggiungi un blocco all'inizio del super blocco corrente",
+ "appendSuperBlockChild": "Aggiungi un blocco alla fine del super blocco corrente",
+ "createSuperBlockLeft": "Crea colonne locali a sinistra",
+ "createSuperBlockRight": "Crea colonne locali a destra",
"listMindmapLock": "Blocca vista",
"listMindmapUnlock": "Sblocca vista",
"historySnapshots": "Istantanee contrassegnate correlate",
diff --git a/app/appearance/langs/ja.json b/app/appearance/langs/ja.json
index 87a6382f2f..0b1c535644 100644
--- a/app/appearance/langs/ja.json
+++ b/app/appearance/langs/ja.json
@@ -1,6 +1,14 @@
{
"bindDocument": "ドキュメントを関連付ける",
"selectOneDocument": "ドキュメントを1つ選択してください",
+ "horizontalSuperBlock": "横向きスーパーブロック",
+ "verticalSuperBlock": "縦向きスーパーブロック",
+ "prependSuperBlockColumn": "現在のスーパーブロックの先頭に列を追加",
+ "appendSuperBlockColumn": "現在のスーパーブロックの末尾に列を追加",
+ "prependSuperBlockChild": "現在のスーパーブロックの先頭にブロックを追加",
+ "appendSuperBlockChild": "現在のスーパーブロックの末尾にブロックを追加",
+ "createSuperBlockLeft": "左側に局所的な段組みを作成",
+ "createSuperBlockRight": "右側に局所的な段組みを作成",
"listMindmapLock": "表示をロック",
"listMindmapUnlock": "表示のロックを解除",
"historySnapshots": "関連するタグ付きスナップショット",
diff --git a/app/appearance/langs/ko.json b/app/appearance/langs/ko.json
index 445cd4dcca..2c28affb03 100644
--- a/app/appearance/langs/ko.json
+++ b/app/appearance/langs/ko.json
@@ -1,6 +1,14 @@
{
"bindDocument": "문서 연결",
"selectOneDocument": "문서를 하나 선택하세요",
+ "horizontalSuperBlock": "가로 슈퍼 블록",
+ "verticalSuperBlock": "세로 슈퍼 블록",
+ "prependSuperBlockColumn": "현재 슈퍼 블록 시작 부분에 열 추가",
+ "appendSuperBlockColumn": "현재 슈퍼 블록 끝에 열 추가",
+ "prependSuperBlockChild": "현재 슈퍼 블록 시작 부분에 블록 추가",
+ "appendSuperBlockChild": "현재 슈퍼 블록 끝에 블록 추가",
+ "createSuperBlockLeft": "왼쪽에 부분 열 레이아웃 만들기",
+ "createSuperBlockRight": "오른쪽에 부분 열 레이아웃 만들기",
"listMindmapLock": "보기 잠금",
"listMindmapUnlock": "보기 잠금 해제",
"historySnapshots": "관련 태그 스냅샷",
diff --git a/app/appearance/langs/nl.json b/app/appearance/langs/nl.json
index 111d80b51b..922a71535c 100644
--- a/app/appearance/langs/nl.json
+++ b/app/appearance/langs/nl.json
@@ -1,6 +1,14 @@
{
"bindDocument": "Document koppelen",
"selectOneDocument": "Selecteer één document",
+ "horizontalSuperBlock": "Horizontaal superblok",
+ "verticalSuperBlock": "Verticaal superblok",
+ "prependSuperBlockColumn": "Kolom toevoegen aan het begin van het huidige superblok",
+ "appendSuperBlockColumn": "Kolom toevoegen aan het einde van het huidige superblok",
+ "prependSuperBlockChild": "Blok toevoegen aan het begin van het huidige superblok",
+ "appendSuperBlockChild": "Blok toevoegen aan het einde van het huidige superblok",
+ "createSuperBlockLeft": "Lokale kolommen links maken",
+ "createSuperBlockRight": "Lokale kolommen rechts maken",
"listMindmapLock": "Weergave vergrendelen",
"listMindmapUnlock": "Weergave ontgrendelen",
"historySnapshots": "Gerelateerde gemarkeerde momentopnamen",
diff --git a/app/appearance/langs/pl.json b/app/appearance/langs/pl.json
index e98aab37dc..10ad159421 100644
--- a/app/appearance/langs/pl.json
+++ b/app/appearance/langs/pl.json
@@ -1,6 +1,14 @@
{
"bindDocument": "Powiąż dokument",
"selectOneDocument": "Wybierz jeden dokument",
+ "horizontalSuperBlock": "Poziomy super blok",
+ "verticalSuperBlock": "Pionowy super blok",
+ "prependSuperBlockColumn": "Dodaj kolumnę na początku bieżącego super bloku",
+ "appendSuperBlockColumn": "Dodaj kolumnę na końcu bieżącego super bloku",
+ "prependSuperBlockChild": "Dodaj blok na początku bieżącego super bloku",
+ "appendSuperBlockChild": "Dodaj blok na końcu bieżącego super bloku",
+ "createSuperBlockLeft": "Utwórz lokalne kolumny po lewej",
+ "createSuperBlockRight": "Utwórz lokalne kolumny po prawej",
"listMindmapLock": "Zablokuj widok",
"listMindmapUnlock": "Odblokuj widok",
"historySnapshots": "Powiązane oznaczone migawki",
diff --git a/app/appearance/langs/pt-BR.json b/app/appearance/langs/pt-BR.json
index e310e8b4d3..77f96dc872 100644
--- a/app/appearance/langs/pt-BR.json
+++ b/app/appearance/langs/pt-BR.json
@@ -1,6 +1,14 @@
{
"bindDocument": "Vincular documento",
"selectOneDocument": "Selecione um documento",
+ "horizontalSuperBlock": "Super bloco horizontal",
+ "verticalSuperBlock": "Super bloco vertical",
+ "prependSuperBlockColumn": "Adicionar uma coluna ao início do super bloco atual",
+ "appendSuperBlockColumn": "Adicionar uma coluna ao fim do super bloco atual",
+ "prependSuperBlockChild": "Adicionar um bloco ao início do super bloco atual",
+ "appendSuperBlockChild": "Adicionar um bloco ao fim do super bloco atual",
+ "createSuperBlockLeft": "Criar colunas locais à esquerda",
+ "createSuperBlockRight": "Criar colunas locais à direita",
"listMindmapLock": "Bloquear visualização",
"listMindmapUnlock": "Desbloquear visualização",
"historySnapshots": "Snapshots marcados relacionados",
diff --git a/app/appearance/langs/ru.json b/app/appearance/langs/ru.json
index f1b05ac17a..537a516ad1 100644
--- a/app/appearance/langs/ru.json
+++ b/app/appearance/langs/ru.json
@@ -1,6 +1,14 @@
{
"bindDocument": "Привязать документ",
"selectOneDocument": "Выберите один документ",
+ "horizontalSuperBlock": "Горизонтальный супер блок",
+ "verticalSuperBlock": "Вертикальный супер блок",
+ "prependSuperBlockColumn": "Добавить столбец в начало текущего супер блока",
+ "appendSuperBlockColumn": "Добавить столбец в конец текущего супер блока",
+ "prependSuperBlockChild": "Добавить блок в начало текущего супер блока",
+ "appendSuperBlockChild": "Добавить блок в конец текущего супер блока",
+ "createSuperBlockLeft": "Создать локальные столбцы слева",
+ "createSuperBlockRight": "Создать локальные столбцы справа",
"listMindmapLock": "Заблокировать вид",
"listMindmapUnlock": "Разблокировать вид",
"historySnapshots": "Связанные помеченные снимки",
diff --git a/app/appearance/langs/sk.json b/app/appearance/langs/sk.json
index b55c29d32e..870c95d04c 100644
--- a/app/appearance/langs/sk.json
+++ b/app/appearance/langs/sk.json
@@ -1,6 +1,14 @@
{
"bindDocument": "Prepojiť dokument",
"selectOneDocument": "Vyberte jeden dokument",
+ "horizontalSuperBlock": "Horizontálny super blok",
+ "verticalSuperBlock": "Vertikálny super blok",
+ "prependSuperBlockColumn": "Pridať stĺpec na začiatok aktuálneho super bloku",
+ "appendSuperBlockColumn": "Pridať stĺpec na koniec aktuálneho super bloku",
+ "prependSuperBlockChild": "Pridať blok na začiatok aktuálneho super bloku",
+ "appendSuperBlockChild": "Pridať blok na koniec aktuálneho super bloku",
+ "createSuperBlockLeft": "Vytvoriť lokálne stĺpce vľavo",
+ "createSuperBlockRight": "Vytvoriť lokálne stĺpce vpravo",
"listMindmapLock": "Zamknúť zobrazenie",
"listMindmapUnlock": "Odomknúť zobrazenie",
"historySnapshots": "Súvisiace označené snímky",
diff --git a/app/appearance/langs/sr.json b/app/appearance/langs/sr.json
index 53e13472b9..fbe8de5779 100644
--- a/app/appearance/langs/sr.json
+++ b/app/appearance/langs/sr.json
@@ -1,6 +1,14 @@
{
"bindDocument": "Повежи документ",
"selectOneDocument": "Изаберите један документ",
+ "horizontalSuperBlock": "Horizontalni superblok",
+ "verticalSuperBlock": "Vertikalni superblok",
+ "prependSuperBlockColumn": "Dodaj kolonu na početak trenutnog superbloka",
+ "appendSuperBlockColumn": "Dodaj kolonu na kraj trenutnog superbloka",
+ "prependSuperBlockChild": "Dodaj blok na početak trenutnog superbloka",
+ "appendSuperBlockChild": "Dodaj blok na kraj trenutnog superbloka",
+ "createSuperBlockLeft": "Napravi lokalne kolone levo",
+ "createSuperBlockRight": "Napravi lokalne kolone desno",
"listMindmapLock": "Закључај приказ",
"listMindmapUnlock": "Откључај приказ",
"historySnapshots": "Повезани означени снимци",
diff --git a/app/appearance/langs/th.json b/app/appearance/langs/th.json
index ee0a70977c..6e141baed8 100644
--- a/app/appearance/langs/th.json
+++ b/app/appearance/langs/th.json
@@ -1,6 +1,14 @@
{
"bindDocument": "เชื่อมโยงเอกสาร",
"selectOneDocument": "โปรดเลือกเอกสารหนึ่งรายการ",
+ "horizontalSuperBlock": "ซูเปอร์บล็อกแนวนอน",
+ "verticalSuperBlock": "ซูเปอร์บล็อกแนวตั้ง",
+ "prependSuperBlockColumn": "เพิ่มคอลัมน์ที่จุดเริ่มต้นของซูเปอร์บล็อกปัจจุบัน",
+ "appendSuperBlockColumn": "เพิ่มคอลัมน์ที่จุดสิ้นสุดของซูเปอร์บล็อกปัจจุบัน",
+ "prependSuperBlockChild": "เพิ่มบล็อกที่จุดเริ่มต้นของซูเปอร์บล็อกปัจจุบัน",
+ "appendSuperBlockChild": "เพิ่มบล็อกที่จุดสิ้นสุดของซูเปอร์บล็อกปัจจุบัน",
+ "createSuperBlockLeft": "สร้างคอลัมน์เฉพาะส่วนทางซ้าย",
+ "createSuperBlockRight": "สร้างคอลัมน์เฉพาะส่วนทางขวา",
"listMindmapLock": "ล็อกมุมมอง",
"listMindmapUnlock": "ปลดล็อกมุมมอง",
"historySnapshots": "สแนปช็อตที่ติดแท็กที่เกี่ยวข้อง",
diff --git a/app/appearance/langs/tr.json b/app/appearance/langs/tr.json
index 700369f889..5304c12637 100644
--- a/app/appearance/langs/tr.json
+++ b/app/appearance/langs/tr.json
@@ -1,6 +1,14 @@
{
"bindDocument": "Belge bağla",
"selectOneDocument": "Lütfen bir belge seçin",
+ "horizontalSuperBlock": "Yatay süper blok",
+ "verticalSuperBlock": "Dikey süper blok",
+ "prependSuperBlockColumn": "Geçerli süper bloğun başına sütun ekle",
+ "appendSuperBlockColumn": "Geçerli süper bloğun sonuna sütun ekle",
+ "prependSuperBlockChild": "Geçerli süper bloğun başına blok ekle",
+ "appendSuperBlockChild": "Geçerli süper bloğun sonuna blok ekle",
+ "createSuperBlockLeft": "Solda yerel sütunlar oluştur",
+ "createSuperBlockRight": "Sağda yerel sütunlar oluştur",
"listMindmapLock": "Görünümü kilitle",
"listMindmapUnlock": "Görünümün kilidini aç",
"historySnapshots": "İlgili etiketli anlık görüntüler",
diff --git a/app/appearance/langs/uk.json b/app/appearance/langs/uk.json
index 94834df830..b52f16beaf 100644
--- a/app/appearance/langs/uk.json
+++ b/app/appearance/langs/uk.json
@@ -1,6 +1,14 @@
{
"bindDocument": "Прив’язати документ",
"selectOneDocument": "Виберіть один документ",
+ "horizontalSuperBlock": "Горизонтальний суперблок",
+ "verticalSuperBlock": "Вертикальний суперблок",
+ "prependSuperBlockColumn": "Додати стовпець на початок поточного суперблока",
+ "appendSuperBlockColumn": "Додати стовпець у кінець поточного суперблока",
+ "prependSuperBlockChild": "Додати блок на початок поточного суперблока",
+ "appendSuperBlockChild": "Додати блок у кінець поточного суперблока",
+ "createSuperBlockLeft": "Створити локальні стовпці ліворуч",
+ "createSuperBlockRight": "Створити локальні стовпці праворуч",
"listMindmapLock": "Заблокувати вигляд",
"listMindmapUnlock": "Розблокувати вигляд",
"historySnapshots": "Пов’язані позначені знімки",
diff --git a/app/appearance/langs/zh-CN.json b/app/appearance/langs/zh-CN.json
index 6ab2168194..73dd4f63e1 100644
--- a/app/appearance/langs/zh-CN.json
+++ b/app/appearance/langs/zh-CN.json
@@ -1,6 +1,14 @@
{
"bindDocument": "绑定文档",
"selectOneDocument": "请选择一个文档",
+ "horizontalSuperBlock": "横向超级块",
+ "verticalSuperBlock": "纵向超级块",
+ "prependSuperBlockColumn": "在当前超级块开头添加分栏",
+ "appendSuperBlockColumn": "在当前超级块末尾添加分栏",
+ "prependSuperBlockChild": "在当前超级块开头添加块",
+ "appendSuperBlockChild": "在当前超级块末尾添加块",
+ "createSuperBlockLeft": "在左侧创建局部分栏",
+ "createSuperBlockRight": "在右侧创建局部分栏",
"listMindmapLock": "锁定视图",
"listMindmapUnlock": "解锁视图",
"historySnapshots": "关联标记快照",
diff --git a/app/appearance/langs/zh-TW.json b/app/appearance/langs/zh-TW.json
index c34ac1bb3e..2caf1ce84b 100644
--- a/app/appearance/langs/zh-TW.json
+++ b/app/appearance/langs/zh-TW.json
@@ -1,6 +1,14 @@
{
"bindDocument": "綁定文件",
"selectOneDocument": "請選擇一個文件",
+ "horizontalSuperBlock": "橫向超級區塊",
+ "verticalSuperBlock": "縱向超級區塊",
+ "prependSuperBlockColumn": "在目前超級區塊開頭新增分欄",
+ "appendSuperBlockColumn": "在目前超級區塊末尾新增分欄",
+ "prependSuperBlockChild": "在目前超級區塊開頭新增區塊",
+ "appendSuperBlockChild": "在目前超級區塊末尾新增區塊",
+ "createSuperBlockLeft": "在左側建立局部分欄",
+ "createSuperBlockRight": "在右側建立局部分欄",
"listMindmapLock": "鎖定視圖",
"listMindmapUnlock": "解鎖視圖",
"historySnapshots": "關聯標記快照",
diff --git a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-6yi0dv5/20200924101225-k254i8g.sy b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-6yi0dv5/20200924101225-k254i8g.sy
index c3935f8be9..4abcff0283 100644
--- a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-6yi0dv5/20200924101225-k254i8g.sy
+++ b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-6yi0dv5/20200924101225-k254i8g.sy
@@ -6,7 +6,7 @@
"id": "20200924101225-k254i8g",
"title": "Content Block Type",
"type": "doc",
- "updated": "20260926152549"
+ "updated": "20260928225427"
},
"Children": [
{
@@ -1405,7 +1405,7 @@
"HeadingLevel": 2,
"Properties": {
"id": "20210104091538-a55chyw",
- "updated": "20260921215916"
+ "updated": "20260928225427"
},
"Children": [
{
@@ -2983,7 +2983,7 @@
"HeadingLevel": 3,
"Properties": {
"id": "20210104091538-lubwy1k",
- "updated": "20250330192603"
+ "updated": "20260928225427"
},
"Children": [
{
@@ -3017,6 +3017,182 @@
}
]
},
+ {
+ "ID": "20260928225427-pmkcfru",
+ "Type": "NodeList",
+ "ListData": {},
+ "Properties": {
+ "id": "20260928225427-pmkcfru",
+ "updated": "20260928225427"
+ },
+ "Children": [
+ {
+ "ID": "20260928225427-4wel37x",
+ "Type": "NodeListItem",
+ "ListData": {
+ "BulletChar": 42,
+ "Marker": "Kg=="
+ },
+ "Properties": {
+ "id": "20260928225427-4wel37x",
+ "updated": "20260928225427"
+ },
+ "Children": [
+ {
+ "ID": "20260928225427-yrq8l73",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260928225427-yrq8l73",
+ "updated": "20260928225427"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Type "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "/"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " and select "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "Horizontal super block"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " or "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "Vertical super block"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " to create two empty paragraphs arranged side by side or vertically, with the cursor in the first paragraph. Search for “columns” to find these options. On mobile, they are also available in the keyboard toolbar's insert panel"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260928225427-ldrjy5i",
+ "Type": "NodeListItem",
+ "ListData": {
+ "BulletChar": 42,
+ "Marker": "Kg=="
+ },
+ "Properties": {
+ "id": "20260928225427-ldrjy5i",
+ "updated": "20260928225427"
+ },
+ "Children": [
+ {
+ "ID": "20260928225427-6yzyax0",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260928225427-6yzyax0",
+ "updated": "20260928225427"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "In the super block's block icon menu, select "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "Super block"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " - "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "Add a column to the beginning of the current super block"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " or "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "Super block"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " - "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "Add a column to the end of the current super block"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " to add an empty paragraph at either end of a horizontal layout. For a vertical layout, the corresponding actions add a block. The new block does not copy the type or content of existing children"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260928225427-29pl5zd",
+ "Type": "NodeListItem",
+ "ListData": {
+ "BulletChar": 42,
+ "Marker": "Kg=="
+ },
+ "Properties": {
+ "id": "20260928225427-29pl5zd",
+ "updated": "20260928225427"
+ },
+ "Children": [
+ {
+ "ID": "20260928225427-9sn0h7t",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260928225427-9sn0h7t",
+ "updated": "20260928225427"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "In the menu of a direct child of a vertical super block, select "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "Create local columns to the left"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " or "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "Create local columns to the right"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " to group that block and a new empty paragraph into a nested horizontal super block. Other blocks keep their layout. These actions do not change the scope of existing left/right column insertion shortcuts"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
{
"ID": "20210104091538-clx67q4",
"Type": "NodeHeading",
diff --git a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180320-fqgskfj/20200905090211-2vixtlf.sy b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180320-fqgskfj/20200905090211-2vixtlf.sy
index c43640507b..2333c38b5f 100644
--- a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180320-fqgskfj/20200905090211-2vixtlf.sy
+++ b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180320-fqgskfj/20200905090211-2vixtlf.sy
@@ -6,7 +6,7 @@
"id": "20200905090211-2vixtlf",
"title": "内容块类型",
"type": "doc",
- "updated": "20260926152549"
+ "updated": "20260928225427"
},
"Children": [
{
@@ -1438,7 +1438,7 @@
"HeadingLevel": 2,
"Properties": {
"id": "20210104090624-9qgquxh",
- "updated": "20260921215916"
+ "updated": "20260928225427"
},
"Children": [
{
@@ -3065,7 +3065,7 @@
"HeadingLevel": 3,
"Properties": {
"id": "20210104090624-jtebaer",
- "updated": "20260425180520"
+ "updated": "20260928225427"
},
"Children": [
{
@@ -3099,6 +3099,182 @@
}
]
},
+ {
+ "ID": "20260928225427-nm9hbe6",
+ "Type": "NodeList",
+ "ListData": {},
+ "Properties": {
+ "id": "20260928225427-nm9hbe6",
+ "updated": "20260928225427"
+ },
+ "Children": [
+ {
+ "ID": "20260928225427-k1dee87",
+ "Type": "NodeListItem",
+ "ListData": {
+ "BulletChar": 42,
+ "Marker": "Kg=="
+ },
+ "Properties": {
+ "id": "20260928225427-k1dee87",
+ "updated": "20260928225427"
+ },
+ "Children": [
+ {
+ "ID": "20260928225427-04zhlj8",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260928225427-04zhlj8",
+ "updated": "20260928225427"
+ },
+ "Children": [
+ {
+ "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": ",即可创建包含两个空段落的左右或上下布局,并在第一个段落开始输入。可以搜索“分栏”找到这两个选项,移动端也可从键盘工具栏的插入面板选择"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260928225427-duan8en",
+ "Type": "NodeListItem",
+ "ListData": {
+ "BulletChar": 42,
+ "Marker": "Kg=="
+ },
+ "Properties": {
+ "id": "20260928225427-duan8en",
+ "updated": "20260928225427"
+ },
+ "Children": [
+ {
+ "ID": "20260928225427-5hnfex1",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260928225427-5hnfex1",
+ "updated": "20260928225427"
+ },
+ "Children": [
+ {
+ "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",
+ "TextMarkTextContent": "在当前超级块末尾添加分栏"
+ },
+ {
+ "Type": "NodeText",
+ "Data": ",可在横向布局的两端添加空段落;纵向布局对应添加块。新块不会复制现有子块的类型或内容"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260928225427-eu2cjgj",
+ "Type": "NodeListItem",
+ "ListData": {
+ "BulletChar": 42,
+ "Marker": "Kg=="
+ },
+ "Properties": {
+ "id": "20260928225427-eu2cjgj",
+ "updated": "20260928225427"
+ },
+ "Children": [
+ {
+ "ID": "20260928225427-f7s9zeg",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260928225427-f7s9zeg",
+ "updated": "20260928225427"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "在纵向超级块的直接子块菜单中,选择 "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "在左侧创建局部分栏"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " 或 "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "在右侧创建局部分栏"
+ },
+ {
+ "Type": "NodeText",
+ "Data": ",会将当前块和一个新空段落组合成内层横向超级块,其他块保持原布局。局部分栏不改变已有左右插栏快捷键的作用范围"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
{
"ID": "20210104090624-5abfwla",
"Type": "NodeHeading",
diff --git a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226115825-mhcslw2/20211226120147-ib6yy3i.sy b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226115825-mhcslw2/20211226120147-ib6yy3i.sy
index 7efd12a293..ea14beb2d1 100644
--- a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226115825-mhcslw2/20211226120147-ib6yy3i.sy
+++ b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226115825-mhcslw2/20211226120147-ib6yy3i.sy
@@ -6,7 +6,7 @@
"id": "20211226120147-ib6yy3i",
"title": "內容區塊類型",
"type": "doc",
- "updated": "20260926152549"
+ "updated": "20260928225427"
},
"Children": [
{
@@ -1434,7 +1434,7 @@
"HeadingLevel": 2,
"Properties": {
"id": "20211226120227-esm6f20",
- "updated": "20260921215916"
+ "updated": "20260928225427"
},
"Children": [
{
@@ -2983,7 +2983,7 @@
"HeadingLevel": 3,
"Properties": {
"id": "20211226120227-hqosjsi",
- "updated": "20260730184353"
+ "updated": "20260928225427"
},
"Children": [
{
@@ -3017,6 +3017,182 @@
}
]
},
+ {
+ "ID": "20260928225427-ml4x782",
+ "Type": "NodeList",
+ "ListData": {},
+ "Properties": {
+ "id": "20260928225427-ml4x782",
+ "updated": "20260928225427"
+ },
+ "Children": [
+ {
+ "ID": "20260928225427-1mg1auw",
+ "Type": "NodeListItem",
+ "ListData": {
+ "BulletChar": 42,
+ "Marker": "Kg=="
+ },
+ "Properties": {
+ "id": "20260928225427-1mg1auw",
+ "updated": "20260928225427"
+ },
+ "Children": [
+ {
+ "ID": "20260928225427-a2itmpm",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260928225427-a2itmpm",
+ "updated": "20260928225427"
+ },
+ "Children": [
+ {
+ "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": ",即可建立包含兩個空段落的左右或上下佈局,並在第一個段落開始輸入。可以搜尋「分欄」找到這兩個選項,行動端也可從鍵盤工具列的插入面板選擇"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260928225427-8e5t3i8",
+ "Type": "NodeListItem",
+ "ListData": {
+ "BulletChar": 42,
+ "Marker": "Kg=="
+ },
+ "Properties": {
+ "id": "20260928225427-8e5t3i8",
+ "updated": "20260928225427"
+ },
+ "Children": [
+ {
+ "ID": "20260928225427-0zdub0o",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260928225427-0zdub0o",
+ "updated": "20260928225427"
+ },
+ "Children": [
+ {
+ "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",
+ "TextMarkTextContent": "在目前超級區塊末尾新增分欄"
+ },
+ {
+ "Type": "NodeText",
+ "Data": ",可在橫向佈局的兩端新增空段落;縱向佈局對應新增區塊。新區塊不會複製現有子區塊的類型或內容"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260928225427-qqtimqi",
+ "Type": "NodeListItem",
+ "ListData": {
+ "BulletChar": 42,
+ "Marker": "Kg=="
+ },
+ "Properties": {
+ "id": "20260928225427-qqtimqi",
+ "updated": "20260928225427"
+ },
+ "Children": [
+ {
+ "ID": "20260928225427-9iuexxt",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260928225427-9iuexxt",
+ "updated": "20260928225427"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "在縱向超級區塊的直接子區塊選單中,選擇 "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "在左側建立局部分欄"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " 或 "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "在右側建立局部分欄"
+ },
+ {
+ "Type": "NodeText",
+ "Data": ",會將目前區塊和一個新空段落組合成內層橫向超級區塊,其他區塊保持原佈局。局部分欄不會改變既有左右插欄快捷鍵的作用範圍"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
{
"ID": "20211226120227-ub34qwj",
"Type": "NodeHeading",
diff --git a/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-gvtksyj/20240530101000-35bbvcx.sy b/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-gvtksyj/20240530101000-35bbvcx.sy
index 8fecdf78fa..e8b97bc99b 100644
--- a/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-gvtksyj/20240530101000-35bbvcx.sy
+++ b/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-gvtksyj/20240530101000-35bbvcx.sy
@@ -7,7 +7,7 @@
"id": "20240530101000-35bbvcx",
"title": "コンテンツブロックの種類",
"type": "doc",
- "updated": "20260926152549"
+ "updated": "20260928225427"
},
"Children": [
{
@@ -1491,7 +1491,7 @@
"Properties": {
"ID": "20240530101000-rjjxxn8",
"id": "20240530101000-p035stn",
- "updated": "20260921215916"
+ "updated": "20260928225427"
},
"Children": [
{
@@ -3177,7 +3177,7 @@
"HeadingLevel": 3,
"Properties": {
"id": "20240530101000-cb0jgj8",
- "updated": "20250330192732"
+ "updated": "20260928225427"
},
"Children": [
{
@@ -3236,6 +3236,178 @@
}
]
},
+ {
+ "ID": "20260928225427-067f59x",
+ "Type": "NodeList",
+ "ListData": {},
+ "Properties": {
+ "id": "20260928225427-067f59x",
+ "updated": "20260928225427"
+ },
+ "Children": [
+ {
+ "ID": "20260928225427-hbgeetu",
+ "Type": "NodeListItem",
+ "ListData": {
+ "BulletChar": 42,
+ "Marker": "Kg=="
+ },
+ "Properties": {
+ "id": "20260928225427-hbgeetu",
+ "updated": "20260928225427"
+ },
+ "Children": [
+ {
+ "ID": "20260928225427-e9kqvn5",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260928225427-e9kqvn5",
+ "updated": "20260928225427"
+ },
+ "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": " を選ぶと、空の段落を左右または上下に2つ配置し、最初の段落から入力できます。「columns」で検索しても見つかります。モバイルではキーボードツールバーの挿入パネルからも選べます"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260928225427-yj8hs5v",
+ "Type": "NodeListItem",
+ "ListData": {
+ "BulletChar": 42,
+ "Marker": "Kg=="
+ },
+ "Properties": {
+ "id": "20260928225427-yj8hs5v",
+ "updated": "20260928225427"
+ },
+ "Children": [
+ {
+ "ID": "20260928225427-o90dbbh",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260928225427-o90dbbh",
+ "updated": "20260928225427"
+ },
+ "Children": [
+ {
+ "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",
+ "TextMarkTextContent": "現在のスーパーブロックの末尾に列を追加"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " を選ぶと、横向きレイアウトの先頭または末尾に空の段落を追加できます。縦向きレイアウトでは対応する操作でブロックを追加します。既存の子ブロックの種類や内容は複製しません"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260928225427-szdbffm",
+ "Type": "NodeListItem",
+ "ListData": {
+ "BulletChar": 42,
+ "Marker": "Kg=="
+ },
+ "Properties": {
+ "id": "20260928225427-szdbffm",
+ "updated": "20260928225427"
+ },
+ "Children": [
+ {
+ "ID": "20260928225427-ddjfwhu",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260928225427-ddjfwhu",
+ "updated": "20260928225427"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "縦向きスーパーブロックの直下の子ブロックのメニューで "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "左側に局所的な段組みを作成"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " または "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "右側に局所的な段組みを作成"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " を選ぶと、そのブロックと新しい空の段落を内側の横向きスーパーブロックにまとめます。他のブロックの配置は維持され、既存の左右への列挿入ショートカットの対象範囲も変わりません"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
{
"ID": "20240530101000-gtx9sbs",
"Type": "NodeHeading",
diff --git a/app/src/block/insertSuperBlock.ts b/app/src/block/insertSuperBlock.ts
new file mode 100644
index 0000000000..f5759335bb
--- /dev/null
+++ b/app/src/block/insertSuperBlock.ts
@@ -0,0 +1,146 @@
+import {genEmptyElement, genSBElement, refreshSbAndPersistWidth, refreshSbResize} from "./util";
+import {transaction, turnsIntoOneTransaction} from "../protyle/wysiwyg/transaction";
+import {focusByWbr, getEditorRange, getUndoFocusContext} from "../protyle/util/selection";
+import {hideElements} from "../protyle/ui/hideElements";
+import {scrollCenter} from "../util/highlightById";
+import {isMobile} from "../util/functions";
+import {restoreEditorFocusRange} from "../protyle/util/editorFocus";
+import {callMobileAppShowKeyboard} from "../mobile/util/mobileAppUtil";
+import {setFold} from "../protyle/util/blockFold";
+import {getSuperBlockTailHeadings} from "./superBlock";
+import {fetchSyncPost} from "../util/fetch";
+import {normalizeHTMLAssetIFrameBlockDOM} from "../asset/html";
+
+export const genEmptySuperBlock = (layout: "col" | "row", source?: Element) => {
+ const element = genSBElement(layout, source?.getAttribute("data-node-id"), source?.lastElementChild.outerHTML);
+ if (source) {
+ // 空段落转换后保留块标识、自定义属性和外层布局宽度。
+ Array.from(source.attributes).forEach(attribute => {
+ if (!["class", "data-type", "data-node-id", "data-node-index", "data-subtype"].includes(attribute.name)) {
+ element.setAttribute(attribute.name, attribute.value);
+ }
+ });
+ }
+ element.prepend(genEmptyElement(false, true), genEmptyElement(false, false));
+ refreshSbResize(element);
+ return element;
+};
+
+const focusInsertedBlock = (protyle: IProtyle, range: Range) => {
+ const insertedRange = focusByWbr(protyle.wysiwyg.element, range);
+ scrollCenter(protyle);
+ if (isMobile() && insertedRange && restoreEditorFocusRange(protyle.wysiwyg.element, insertedRange)) {
+ callMobileAppShowKeyboard();
+ }
+};
+
+export const insertSuperBlockChild = async (protyle: IProtyle, target: Element, position: "start" | "end") => {
+ if (protyle.disabled || !protyle.wysiwyg.element.contains(target) ||
+ target.getAttribute("data-type") !== "NodeSuperBlock") {
+ return;
+ }
+ const range = getEditorRange(protyle.wysiwyg.element);
+ const context = getUndoFocusContext(protyle.wysiwyg.element, range);
+ const doOperations: IOperation[] = [];
+ const undoOperations: IOperation[] = [];
+ if (position === "end" && target.querySelector(':scope > [data-type="NodeHeading"][fold="1"]')) {
+ // 完整内容用于识别被折叠父标题隐藏的末尾标题,不用局部 DOM 覆盖文档。
+ const response = await fetchSyncPost("/api/block/getBlockDOM", {
+ id: target.getAttribute("data-node-id"), notebook: protyle.notebookId,
+ });
+ if (response.code !== 0) {
+ throw new Error(response.msg);
+ }
+ const template = document.createElement("template");
+ template.innerHTML = normalizeHTMLAssetIFrameBlockDOM(response.data.dom);
+ const fullElement = template.content.querySelector(`[data-node-id="${target.getAttribute("data-node-id")}"]`);
+ if (!fullElement || protyle.disabled || !protyle.wysiwyg.element.contains(target)) {
+ return;
+ }
+ for (const heading of getSuperBlockTailHeadings(fullElement)) {
+ const id = heading.getAttribute("data-node-id");
+ const visibleHeading = target.querySelector(`[data-node-id="${id}"]`);
+ if (visibleHeading) {
+ const operations = setFold(protyle, visibleHeading, true, false, true);
+ await operations.ready;
+ doOperations.push(...operations.doOperations);
+ undoOperations.unshift(...operations.undoOperations);
+ } else {
+ doOperations.push({action: "unfoldHeading", id});
+ undoOperations.unshift({action: "foldHeading", id});
+ }
+ }
+ }
+ const foldData = target.getAttribute("fold") === "1" ? setFold(protyle, target, true, false, true) : undefined;
+ if (foldData) {
+ await foldData.ready;
+ doOperations.push(...foldData.doOperations);
+ undoOperations.unshift(...foldData.undoOperations);
+ }
+ hideElements(["select", "gutter"], protyle);
+ protyle.observerLoad?.disconnect();
+ const newElement = genEmptyElement(false, true);
+ const id = newElement.getAttribute("data-node-id");
+ // 由容器定位首尾,末尾存在折叠标题时也不会插入到隐藏子块之前。
+ doOperations.push({
+ action: position === "start" ? "prependInsert" : "appendInsert",
+ id,
+ parentID: target.getAttribute("data-node-id"),
+ data: newElement.outerHTML,
+ });
+ undoOperations.unshift({action: "delete", id, context});
+ if (position === "start") {
+ target.prepend(newElement);
+ } else {
+ target.lastElementChild.before(newElement);
+ }
+ refreshSbAndPersistWidth(target, doOperations, undoOperations);
+ transaction(protyle, doOperations, undoOperations);
+ focusInsertedBlock(protyle, range);
+};
+
+export const createSuperBlockColumn = async (protyle: IProtyle, target: Element, position: "left" | "right") => {
+ if (protyle.disabled || !protyle.wysiwyg.element.contains(target) ||
+ target.parentElement?.getAttribute("data-type") !== "NodeSuperBlock" ||
+ target.parentElement.getAttribute("data-sb-layout") !== "row") {
+ return;
+ }
+ const range = getEditorRange(protyle.wysiwyg.element);
+ const context = getUndoFocusContext(protyle.wysiwyg.element, range);
+ hideElements(["select", "gutter"], protyle);
+ protyle.observerLoad?.disconnect();
+ const doOperations: IOperation[] = [];
+ const undoOperations: IOperation[] = [];
+ let column = target;
+ // 折叠标题及其隐藏子块属于同一栏,先用纵向容器承接内核随标题移动的内容。
+ if (target.getAttribute("data-type") === "NodeHeading" && target.getAttribute("fold") === "1") {
+ const operations = await turnsIntoOneTransaction({
+ protyle, selectsElement: [target], type: "BlocksMergeSuperBlock", level: "row",
+ getOperations: true, unfocus: true,
+ });
+ doOperations.push(...operations.doOperations);
+ undoOperations.push(...operations.undoOperations);
+ column = target.parentElement;
+ }
+ const operations = await turnsIntoOneTransaction({
+ protyle, selectsElement: [column], type: "BlocksMergeSuperBlock", level: "col",
+ getOperations: true, unfocus: true,
+ });
+ doOperations.push(...operations.doOperations);
+ undoOperations.unshift(...operations.undoOperations);
+ const newElement = genEmptyElement(false, true);
+ const id = newElement.getAttribute("data-node-id");
+ doOperations.push({
+ action: "insert",
+ id,
+ data: newElement.outerHTML,
+ parentID: column.parentElement.getAttribute("data-node-id"),
+ nextID: position === "left" ? column.getAttribute("data-node-id") : undefined,
+ previousID: position === "right" ? column.getAttribute("data-node-id") : undefined,
+ });
+ undoOperations.unshift({action: "delete", id, context});
+ column.insertAdjacentElement(position === "left" ? "beforebegin" : "afterend", newElement);
+ refreshSbAndPersistWidth(column.parentElement, doOperations, undoOperations);
+ transaction(protyle, doOperations, undoOperations);
+ focusInsertedBlock(protyle, range);
+};
diff --git a/app/src/block/superBlock.ts b/app/src/block/superBlock.ts
index 4e933af515..8b9f70f76d 100644
--- a/app/src/block/superBlock.ts
+++ b/app/src/block/superBlock.ts
@@ -1,3 +1,30 @@
+export const getSuperBlockCommand = (layout: "col" | "row") => `superblock:${layout}`;
+
+export const getSuperBlockCommandLayout = (value: string): "col" | "row" | undefined => {
+ if (value === getSuperBlockCommand("col")) {
+ return "col";
+ }
+ if (value === getSuperBlockCommand("row")) {
+ return "row";
+ }
+};
+
+// 末尾新段落位于这些标题的范围内,展开其中折叠的标题后才能持续显示。
+export const getSuperBlockTailHeadings = (element: Element) => {
+ const headings: Element[] = [];
+ Array.from(element.children).forEach(child => {
+ if (child.getAttribute("data-type") !== "NodeHeading") {
+ return;
+ }
+ const level = Number(child.getAttribute("data-subtype")?.substring(1));
+ while (headings.length > 0 && Number(headings[headings.length - 1].getAttribute("data-subtype")?.substring(1)) >= level) {
+ headings.pop();
+ }
+ headings.push(child);
+ });
+ return headings.filter(heading => heading.getAttribute("fold") === "1");
+};
+
export const getHorizontalSuperBlockChild = (blockElement?: Element | null, boundaryElement?: Element) => {
let currentElement = blockElement;
while (currentElement?.parentElement && currentElement !== boundaryElement) {
diff --git a/app/src/config/entryVisibility/catalog.test.ts b/app/src/config/entryVisibility/catalog.test.ts
index f5bd614df9..0263522cfd 100644
--- a/app/src/config/entryVisibility/catalog.test.ts
+++ b/app/src/config/entryVisibility/catalog.test.ts
@@ -95,6 +95,8 @@ const slashMenuBuiltinOrder = [
"orderedList",
"check",
"quote",
+ "horizontalSuperBlock",
+ "verticalSuperBlock",
"tabs",
"mindmap",
"calloutNote",
@@ -508,7 +510,7 @@ test("slash menu catalog follows the built-in hint order", () => {
assert.deepEqual(section?.children.map((item) => item.key), ["menu"]);
const children = getEntryCatalogChildren(SLASH_MENU_ROOT_PATH);
assert.deepEqual(children.map((item) => item.key), slashMenuBuiltinOrder);
- assert.equal(children.filter((item) => item.type === "entry").length, 66);
+ assert.equal(children.filter((item) => item.type === "entry").length, 68);
assert.equal(children.filter((item) => item.type === "separator").length, 5);
assert.equal(children.every((item) => item.simple), true);
});
@@ -819,6 +821,10 @@ test("super block actions and vertical alignment use their respective menu group
"cancelSuperBlock",
"turnIntoVLayout",
"turnIntoHLayout",
+ "prependSuperBlockColumn",
+ "prependSuperBlockChild",
+ "appendSuperBlockColumn",
+ "appendSuperBlockChild",
]);
const singleLayoutKeys = getEntryCatalogChildren("gutter.single.layout").map((item) => item.key);
@@ -871,11 +877,13 @@ test("gutter height menus follow width and stay aligned across selection scopes"
test("super block column insertion actions follow block insertion actions", () => {
const keys = getEntryCatalogChildren("gutter.single").map((item) => item.key);
const insertBeforeIndex = keys.indexOf("insertBefore");
- assert.deepEqual(keys.slice(insertBeforeIndex, insertBeforeIndex + 4), [
+ assert.deepEqual(keys.slice(insertBeforeIndex, insertBeforeIndex + 6), [
"insertBefore",
"insertAfter",
"insertSuperBlockLeft",
"insertSuperBlockRight",
+ "createSuperBlockLeft",
+ "createSuperBlockRight",
]);
});
diff --git a/app/src/config/entryVisibility/catalog.ts b/app/src/config/entryVisibility/catalog.ts
index 9414f7865d..83c73742b1 100644
--- a/app/src/config/entryVisibility/catalog.ts
+++ b/app/src/config/entryVisibility/catalog.ts
@@ -398,6 +398,10 @@ const gutterSingle = () => [
node("cancelSuperBlock", () => `${window.siyuan.languages.cancel} ${window.siyuan.languages.superBlock}`),
node("turnIntoVLayout", () => `${window.siyuan.languages.turnInto} ${window.siyuan.languages.vLayout}`),
node("turnIntoHLayout", () => `${window.siyuan.languages.turnInto} ${window.siyuan.languages.hLayout}`),
+ node("prependSuperBlockColumn", lang("prependSuperBlockColumn")),
+ node("prependSuperBlockChild", lang("prependSuperBlockChild")),
+ node("appendSuperBlockColumn", lang("appendSuperBlockColumn")),
+ node("appendSuperBlockChild", lang("appendSuperBlockChild")),
]),
separator("separator_code"),
node("code", lang("code"), true, [
@@ -468,6 +472,8 @@ const gutterSingle = () => [
node("insertAfter", lang("insertAfter")),
node("insertSuperBlockLeft", lang("insertSuperBlockLeft")),
node("insertSuperBlockRight", lang("insertSuperBlockRight")),
+ node("createSuperBlockLeft", lang("createSuperBlockLeft")),
+ node("createSuperBlockRight", lang("createSuperBlockRight")),
node("jumpTo", lang("jumpTo"), false, [
node("jumpToParentPrev", lang("jumpToParentPrev"), false),
node("jumpToParentNext", lang("jumpToParentNext"), false),
@@ -529,6 +535,8 @@ const slashMenuBuiltinChildren = [
node("orderedList", lang("ordered-list")),
node("check", lang("check")),
node("quote", lang("quote")),
+ node("horizontalSuperBlock", lang("horizontalSuperBlock")),
+ node("verticalSuperBlock", lang("verticalSuperBlock")),
node("tabs", lang("tabs")),
node("mindmap", lang("mindmap")),
node("calloutNote", location(lang("callout"), literal("Note"))),
diff --git a/app/src/config/entryVisibility/order.test.ts b/app/src/config/entryVisibility/order.test.ts
index 1a61508093..c08e5b477b 100644
--- a/app/src/config/entryVisibility/order.test.ts
+++ b/app/src/config/entryVisibility/order.test.ts
@@ -10,6 +10,34 @@ import {
resolveEntryOrderWithBoundaryDefaults,
} from "./order";
+test("super block creation merges into saved menu orders and preserves plugin slots", () => {
+ const groups: Array<[string, string[]]> = [
+ ["gutter.single.superBlock", ["prependSuperBlockColumn", "prependSuperBlockChild", "appendSuperBlockColumn", "appendSuperBlockChild"]],
+ ["gutter.single", ["createSuperBlockLeft", "createSuperBlockRight"]],
+ ["editor.slash.menu", ["horizontalSuperBlock", "verticalSuperBlock"]],
+ ];
+ groups.forEach(([path, added]) => {
+ const entries = getEntryCatalogChildren(path);
+ const defaults = entries.map(item => item.key);
+ const saved = defaults.filter(key => !added.includes(key)).reverse();
+ saved.splice(1, 0, "plugin:example:item");
+ const merged = mergeEntryOrderPreservingUnknown(defaults, saved);
+ assert.deepEqual(merged.filter(key => !added.includes(key)), saved);
+ added.forEach(key => {
+ assert.equal(merged.filter(item => item === key).length, 1);
+ assert.equal(entries.find(item => item.key === key).simple, true);
+ });
+ const separators = new Set(entries.filter(item => item.type === "separator").map(item => item.key));
+ const resolved = resolveEntryOrder([...defaults, "plugin:example:item"], merged, separators);
+ assert.equal(resolved.includes("plugin:example:item"), true);
+ assert.equal(separators.has(resolved[0]), false);
+ assert.equal(separators.has(resolved[resolved.length - 1]), false);
+ resolved.forEach((key, index) => {
+ assert.equal(separators.has(key) && separators.has(resolved[index + 1]), false);
+ });
+ });
+});
+
test("document tree duplication merges into saved orders and retains plugin slots", () => {
const entries = getEntryCatalogChildren("docTree.document.copy");
const defaults = entries.map(item => item.key);
diff --git a/app/src/mobile/util/keyboardToolbar.ts b/app/src/mobile/util/keyboardToolbar.ts
index 1e5014ddf6..2e0a06a8f0 100644
--- a/app/src/mobile/util/keyboardToolbar.ts
+++ b/app/src/mobile/util/keyboardToolbar.ts
@@ -7,6 +7,7 @@ import {
} from "../../protyle/util/hasClosest";
import {moveToDown, moveToUp} from "../../protyle/wysiwyg/move";
import {Constants} from "../../constants";
+import {getSuperBlockCommand} from "../../block/superBlock";
import {focusBlock, focusByRange, getSelectionPosition} from "../../protyle/util/selection";
import {getCurrentEditor as getDocumentEditor} from "../editor";
import {getMobileToolbarPaddingElement, getMobileToolbarProtyle, getMobileToolbarUndo} from "../../protyle/lite/mobileToolbar";
@@ -751,6 +752,8 @@ const renderSlashMenu = (protyle: IProtyle, toolbarElement: Element) => {
${getSlashItem("1. " + Lute.Caret, "iconOrderedList", window.siyuan.languages["ordered-list"], "true")}
${getSlashItem("- [ ] " + Lute.Caret, "iconCheck", window.siyuan.languages.check, "true")}
${getSlashItem("> " + Lute.Caret, "iconQuote", window.siyuan.languages.quote, "true")}
+ ${getSlashItem(getSuperBlockCommand("col"), "iconSuper", window.siyuan.languages.horizontalSuperBlock, "true")}
+ ${getSlashItem(getSuperBlockCommand("row"), "iconSuper", window.siyuan.languages.verticalSuperBlock, "true")}
${getSlashItem(`::: tabs\n@tab\n\n${Lute.Caret}\n\n@tab\n\n:::\n`, "iconTabs", window.siyuan.languages.tabs, "true")}
${getSlashItem(`- ${Lute.Caret}\n{: ${Constants.CUSTOM_SY_LIST_MINDMAP}="1"}`, "iconMindmap", window.siyuan.languages.mindmap, "true")}
${getSlashItem(`> [!NOTE]\n> ${Lute.Caret}`, '<span class="keyboard__slash-icon">✏️</span>', `${window.siyuan.languages.callout} - <span style="color: var(--b3-callout-note)">Note</span>`, "true")}
diff --git a/app/src/protyle/gutter/index.ts b/app/src/protyle/gutter/index.ts
index 03553b2ce8..ff3c456d77 100644
--- a/app/src/protyle/gutter/index.ts
+++ b/app/src/protyle/gutter/index.ts
@@ -71,6 +71,7 @@ import {setDragTipGhost} from "../util/dragTip";
import {stringifyBlockDragData} from "../util/dragDocument";
import {countBlockWord} from "../../layout/status";
import {Constants} from "../../constants";
+import {createSuperBlockColumn, insertSuperBlockChild} from "../../block/insertSuperBlock";
import {mathRender} from "../render/mathRender";
import {duplicateBlock} from "../wysiwyg/commonHotkey";
import {isEncryptedBox, movePathTo, useShell} from "../../util/pathName";
@@ -2218,6 +2219,25 @@ export class Gutter {
hideElements(["gutter"], protyle);
}
});
+ if (allowStructuralMutation) {
+ superBlockSubmenu.push({
+ id: isCol ? "prependSuperBlockColumn" : "prependSuperBlockChild",
+ icon: isCol ? "iconInsertLeft" : "iconBefore",
+ label: window.siyuan.languages[isCol ? "prependSuperBlockColumn" : "prependSuperBlockChild"],
+ click() {
+ countBlockWord([], protyle);
+ void insertSuperBlockChild(protyle, nodeElement, "start");
+ }
+ }, {
+ id: isCol ? "appendSuperBlockColumn" : "appendSuperBlockChild",
+ icon: isCol ? "iconInsertRight" : "iconAfter",
+ label: window.siyuan.languages[isCol ? "appendSuperBlockColumn" : "appendSuperBlockChild"],
+ click() {
+ countBlockWord([], protyle);
+ void insertSuperBlockChild(protyle, nodeElement, "end");
+ }
+ });
+ }
window.siyuan.menus.menu.append(new MenuItem({
id: "superBlock",
icon: "iconSuper",
@@ -2815,6 +2835,26 @@ export class Gutter {
insertEmptySuperBlockColumn(protyle, "right", nodeElement);
}
}).element);
+ } else if (nodeElement.parentElement?.getAttribute("data-type") === "NodeSuperBlock" &&
+ nodeElement.parentElement.getAttribute("data-sb-layout") === "row") {
+ window.siyuan.menus.menu.append(new MenuItem({
+ id: "createSuperBlockLeft",
+ icon: "iconInsertLeft",
+ label: window.siyuan.languages.createSuperBlockLeft,
+ click() {
+ countBlockWord([], protyle);
+ void createSuperBlockColumn(protyle, nodeElement, "left");
+ }
+ }).element);
+ window.siyuan.menus.menu.append(new MenuItem({
+ id: "createSuperBlockRight",
+ icon: "iconInsertRight",
+ label: window.siyuan.languages.createSuperBlockRight,
+ click() {
+ countBlockWord([], protyle);
+ void createSuperBlockColumn(protyle, nodeElement, "right");
+ }
+ }).element);
}
}
if (!protyle.disabled) {
diff --git a/app/src/protyle/hint/extend.ts b/app/src/protyle/hint/extend.ts
index c8d5c6d871..daaa552671 100644
--- a/app/src/protyle/hint/extend.ts
+++ b/app/src/protyle/hint/extend.ts
@@ -1,5 +1,6 @@
import {fetchPost} from "../../util/fetch";
import {registerBuiltinSlashHint} from "./builtinSlash";
+import {getSuperBlockCommand} from "../../block/superBlock";
import {insertHTML} from "../util/insertHTML";
import {TABLE_CELL_SLASH_IDS} from "../util/tableCellRichMenu";
import {getIconByType} from "../../editor/getIcon";
@@ -180,6 +181,16 @@ export const getBuiltinSlashMenuItems = (protyle: IProtyle): IHintData[] => {
id: "quote",
value: "> " + Lute.Caret,
html: `<div class="b3-list-item__first"><svg class="b3-list-item__graphic"><use xlink:href="#iconQuote"></use></svg><span class="b3-list-item__text">${window.siyuan.languages.quote}</span>${getHotkeyOrMarker(window.siyuan.config.keymap.editor.insert.quote.custom, ">")}</div>`,
+ }, {
+ filter: [window.siyuan.languages.horizontalSuperBlock, window.siyuan.languages.superBlock, "horizontal super block", "columns", "layout", "横向超级块", "hengxiangchaojikuai", "hx", "超级块", "chaojikuai", "cjk", "分栏", "fenlan", "fl"],
+ id: "horizontalSuperBlock",
+ value: getSuperBlockCommand("col"),
+ html: `<div class="b3-list-item__first"><svg class="b3-list-item__graphic"><use xlink:href="#iconSuper"></use></svg><span class="b3-list-item__text">${window.siyuan.languages.horizontalSuperBlock}</span></div>`,
+ }, {
+ filter: [window.siyuan.languages.verticalSuperBlock, window.siyuan.languages.superBlock, "vertical super block", "columns", "layout", "纵向超级块", "zongxiangchaojikuai", "zx", "超级块", "chaojikuai", "cjk", "分栏", "fenlan", "fl"],
+ id: "verticalSuperBlock",
+ value: getSuperBlockCommand("row"),
+ html: `<div class="b3-list-item__first"><svg class="b3-list-item__graphic"><use xlink:href="#iconSuper"></use></svg><span class="b3-list-item__text">${window.siyuan.languages.verticalSuperBlock}</span></div>`,
}, {
filter: [window.siyuan.languages.tabs, "tabs", "页签", "yeqian", "yq"],
id: "tabs",
diff --git a/app/src/protyle/hint/index.ts b/app/src/protyle/hint/index.ts
index 1311a65f23..c46d069d55 100644
--- a/app/src/protyle/hint/index.ts
+++ b/app/src/protyle/hint/index.ts
@@ -1,6 +1,8 @@
import {isTableLikeView} from "../render/av/viewType";
import {Constants} from "../../constants";
import {isBuiltinSlashHint} from "./builtinSlash";
+import {getSuperBlockCommandLayout} from "../../block/superBlock";
+import {genEmptySuperBlock} from "../../block/insertSuperBlock";
import {
hasClosestBlock,
hasClosestByAttribute,
@@ -1121,6 +1123,7 @@ ${genHintItemHTML(item)}
this.fixImageCursor(range);
}
const isMindmap = value === `- ${Lute.Caret}\n{: ${Constants.CUSTOM_SY_LIST_MINDMAP}="1"}`;
+ const superBlockLayout = getSuperBlockCommandLayout(value);
let textContent = isMindmap ? `- ${Lute.Caret}` : value;
if (value === "```") {
textContent = value + (Constants.SIYUAN_RENDER_CODE_LANGUAGES.includes(window.siyuan.storage[Constants.LOCAL_CODELANG]) ? "" : window.siyuan.storage[Constants.LOCAL_CODELANG]) + Lute.Caret + "\n```";
@@ -1154,9 +1157,13 @@ ${genHintItemHTML(item)}
clientY: rect.top
});
return;
- } else if (editableElement.textContent === "" && nodeElement.getAttribute("data-type") === "NodeParagraph") {
+ } else if ((editableElement.textContent === "" ||
+ superBlockLayout && editableElement.textContent.split(Constants.ZWSP).join("") === "") &&
+ nodeElement.getAttribute("data-type") === "NodeParagraph") {
let newHTML = "";
- if (value === "<div>") {
+ if (superBlockLayout) {
+ newHTML = genEmptySuperBlock(superBlockLayout, nodeElement).outerHTML;
+ } else if (value === "<div>") {
newHTML = `<div data-node-id="${id}" data-type="NodeHTMLBlock" class="render-node" data-subtype="block">${genIconHTML()}<div><protyle-html data-content=""></protyle-html><span style="position: absolute">${Constants.ZWSP}</span></div><div class="protyle-attr" contenteditable="false"></div></div>`;
} else {
editableElement.textContent = textContent;
@@ -1207,7 +1214,8 @@ ${genHintItemHTML(item)}
}]);
}
} else {
- let newHTML = isMindmap ? spinListMindmapDOM(protyle.lute, textContent) :
+ let newHTML = superBlockLayout ? genEmptySuperBlock(superBlockLayout).outerHTML :
+ isMindmap ? spinListMindmapDOM(protyle.lute, textContent) :
protyle.lute.SpinBlockDOM(textContent);
if (value === "<div>") {
newHTML = `<div data-node-id="${Lute.NewNodeID()}" data-type="NodeHTMLBlock" class="render-node" data-subtype="block">${genIconHTML()}<div><protyle-html data-content=""></protyle-html><span style="position: absolute">${Constants.ZWSP}</span></div><div class="protyle-attr" contenteditable="false"></div></div>`;
diff --git a/app/src/protyle/hint/slashMenu.test.ts b/app/src/protyle/hint/slashMenu.test.ts
index e91690a08b..26acf90b5b 100644
--- a/app/src/protyle/hint/slashMenu.test.ts
+++ b/app/src/protyle/hint/slashMenu.test.ts
@@ -86,7 +86,7 @@ test("slash menu separator normalization removes leading, trailing, and consecut
test("lite slash menu hides document-dependent entries and keeps local editing entries", () => {
const unavailable = ["database", "databaseTableView", "databaseListView", "databaseCalendarView", "databaseKanbanView", "databaseGalleryView",
"newFileRef", "newSubDocRef", "template", "blockEmbed", "aiWriting", "widget", "unknown"];
- const available = ["ref", "assets", "heading1", "table", "bold", "mermaid"];
+ const available = ["ref", "assets", "heading1", "table", "bold", "mermaid", "horizontalSuperBlock", "verticalSuperBlock"];
const items = [...unavailable, ...available].map((id) => entry(id));
assert.deepEqual(resolve(items, {lite: true}).map((item) => item.id), available);
assert.deepEqual(resolve(items), items);
diff --git a/app/src/protyle/hint/slashMenu.ts b/app/src/protyle/hint/slashMenu.ts
index ea273251fc..527c2f0945 100644
--- a/app/src/protyle/hint/slashMenu.ts
+++ b/app/src/protyle/hint/slashMenu.ts
@@ -20,7 +20,7 @@ const isSeparator = (item?: TSlashMenuItem) => item?.html === "separator";
// 精简模式仅保留不依赖持久化文档上下文的内置项。
const LITE_SLASH_IDS = new Set([
"assets", "ref", "heading1", "heading2", "heading3", "heading4", "heading5", "heading6",
- "list", "orderedList", "check", "quote", "tabs", "calloutNote", "calloutTip", "calloutImportant",
+ "list", "orderedList", "check", "quote", "horizontalSuperBlock", "verticalSuperBlock", "tabs", "calloutNote", "calloutTip", "calloutImportant",
"calloutWarning", "calloutCaution", "code", "table", "line", "math", "html",
"emoji", "link", "bold", "italic", "underline", "strike", "mark", "sup", "sub", "inlineCode",
"kbd", "tag", "inlineMath", "insertIframeURL", "insertImgURL", "insertVideoURL", "insertAudioURL",
diff --git a/app/tests/superBlockCreation.test.js b/app/tests/superBlockCreation.test.js
new file mode 100644
index 0000000000..3e495eeca1
--- /dev/null
+++ b/app/tests/superBlockCreation.test.js
@@ -0,0 +1,409 @@
+const assert = require("node:assert/strict");
+const {readFileSync, mkdtempSync, rmSync} = require("node:fs");
+const path = require("node:path");
+const os = require("node:os");
+
+const sources = () => {
+ const ts = require("typescript");
+ const compile = source => ts.transpileModule(source, {
+ compilerOptions: {module: ts.ModuleKind.CommonJS, target: ts.ScriptTarget.ES2021},
+ }).outputText;
+ const extract = (file, names) => {
+ const source = ts.createSourceFile(file, readFileSync(path.join(__dirname, "../src", file), "utf8"),
+ ts.ScriptTarget.Latest, true);
+ const statements = source.statements.filter(statement => ts.isVariableStatement(statement) &&
+ statement.declarationList.declarations.some(declaration => names.includes(declaration.name.getText(source))));
+ assert.equal(statements.length, names.length);
+ return compile(statements.map(statement => statement.getText(source)).join("\n").replace(/export const /g, "const "));
+ };
+ return {
+ functions: [
+ extract("block/util.ts", ["genEmptyElement", "genSBElement", "refreshSbResize", "rebalanceSbWidth", "refreshSbAndPersistWidth"]),
+ extract("block/superBlock.ts", ["getSuperBlockCommand", "getSuperBlockCommandLayout", "getSuperBlockTailHeadings"]),
+ extract("block/insertSuperBlock.ts", ["genEmptySuperBlock", "focusInsertedBlock", "insertSuperBlockChild", "createSuperBlockColumn"]),
+ extract("protyle/wysiwyg/transaction.ts", ["turnsIntoOneTransaction"]),
+ extract("protyle/util/selection.ts", ["focusByWbr", "focusByRange"]),
+ extract("protyle/wysiwyg/getBlock.ts", ["getContenteditableElement", "getParentBlock"]),
+ extract("mobile/util/keyboardToolbar.ts", ["getSlashItem", "renderSlashMenu"]),
+ ].join("\n"),
+ hint: compile(readFileSync(path.join(__dirname, "../src/protyle/hint/index.ts"), "utf8")),
+ };
+};
+
+const cases = async source => {
+ const check = require("node:assert/strict");
+ const lute = window.Lute.New();
+ lute.SetSuperBlock(true);
+ lute.SetKramdownIAL(true);
+ lute.SetProtyleWYSIWYG(true);
+ const Constants = {ZWSP: "\u200b", BLOCK_HINT_KEYS: ["(("], INLINE_TYPE: [],
+ SIYUAN_RENDER_CODE_LANGUAGES: [], ATTRIBUTE_EDITING: "data-editing"};
+ window.siyuan = {config: {editor: {spellcheck: false}}, storage: {},
+ languages: {horizontalSuperBlock: "Horizontal super block", verticalSuperBlock: "Vertical super block"}};
+ const root = document.createElement("div");
+ root.className = "protyle-wysiwyg";
+ root.dataset.nodeId = "doc";
+ document.body.append(root);
+ const style = document.createElement("style");
+ style.textContent = '.sb[data-sb-layout="col"]{display:flex}.sb__resize{width:10px;margin:0 5px;flex:none}';
+ document.head.append(style);
+ const stored = document.createElement("div");
+ stored.dataset.nodeId = "doc";
+ const protyle = {lute, wysiwyg: {element: root}, block: {rootID: "doc"}, toolbar: {},
+ options: {hint: {extend: [{key: "/", hint: () => []}]}, upload: {}}, app: {plugins: []}};
+ let submitted = [];
+ let keyboardRequests = 0;
+ let mobile = false;
+ const transaction = (_protyle, forward, backward) => submitted.push({forward, backward});
+ const getEditorRange = () => protyle.toolbar.range;
+ const deps = {
+ Constants,
+ transaction,
+ getEditorRange,
+ getUndoFocusContext: () => ({undoFocusId: "original"}),
+ hideElements: () => root.querySelectorAll(".protyle-wysiwyg--select").forEach(node => node.classList.remove("protyle-wysiwyg--select")),
+ scrollCenter: () => {},
+ isMobile: () => mobile,
+ restoreEditorFocusRange: (_element, range) => {
+ check.ok(root.contains(range.startContainer));
+ protyle.toolbar.range = range;
+ return true;
+ },
+ callMobileAppShowKeyboard: () => keyboardRequests++,
+ getEmbedChildOperationParentID: () => undefined,
+ revealTabsForTarget: () => {},
+ getSemanticMarkerPrefixLengthForNode: () => 0,
+ hasPreviousSibling: node => node.previousSibling,
+ hasClosestBlock: node => (node.nodeType === 1 ? node : node.parentElement).closest("[data-node-id]"),
+ hasClosestByClassName: (node, name) => (node.nodeType === 1 ? node : node.parentElement).closest(`.${name}`),
+ isProtyleListItemFragment: () => false,
+ shouldCaptureHintUndoFocus: () => false,
+ isBuiltinSlashHint: () => true,
+ areProtylePluginExtensionsEnabled: () => false,
+ getHostCapabilities: () => ({widgets: false, remoteKernel: true}),
+ isDisabledFeature: () => true,
+ isInAndroid: () => false,
+ isBuiltinInlineStyleVisible: () => false,
+ normalizeHTMLAssetIFrameBlockDOM: value => value,
+ fetchSyncPost: async (url, data) => {
+ check.equal(url, "/api/block/getBlockDOM");
+ return {code: 0, data: {dom: stored.querySelector(`[data-node-id="${data.id}"]`).outerHTML}};
+ },
+ setFold: (_protyle, target) => {
+ target.removeAttribute("fold");
+ return {
+ doOperations: [{action: "setAttrs", id: target.dataset.nodeId, data: '{"fold":""}'}],
+ undoOperations: [{action: "setAttrs", id: target.dataset.nodeId, data: '{"fold":"1"}'}],
+ ready: Promise.resolve(),
+ };
+ },
+ };
+ const api = new Function(...Object.keys(deps), source.functions + `
+ const refreshSbs = element => {
+ refreshSbResize(element);
+ element.querySelectorAll('.sb').forEach(refreshSbResize);
+ };
+ return {insertSuperBlockChild, createSuperBlockColumn, getSuperBlockCommand, getSuperBlockCommandLayout,
+ genEmptySuperBlock, renderSlashMenu, focusByWbr, focusByRange,
+ getContenteditableElement};`)(...Object.values(deps));
+ Object.assign(deps, api);
+ deps.updateTransaction = (_protyle, element, previous) => transaction(protyle,
+ [{action: "update", id: element.dataset.nodeId, data: element.outerHTML}],
+ [{action: "update", id: element.dataset.nodeId, data: previous}]);
+ const hintExports = {};
+ new Function("require", "exports", source.hint)(() => deps, hintExports);
+ const hint = Object.create(hintExports.Hint.prototype);
+ const children = node => Array.from(node.children).filter(child => child.dataset.nodeId);
+ const shape = node => children(node).map(child => ({
+ id: child.dataset.nodeId, type: child.dataset.type, layout: child.dataset.sbLayout,
+ style: child.getAttribute("style") || "", fold: child.getAttribute("fold") || "",
+ text: child.querySelector(":scope > [contenteditable]")?.textContent.replace(/\u200b/g, ""),
+ children: shape(child),
+ }));
+ const find = id => id === "doc" ? stored : stored.querySelector(`[data-node-id="${id}"]`);
+ const headingGroups = new Map();
+ const replay = operations => operations.forEach(operation => {
+ const node = find(operation.id);
+ if (operation.action === "delete") {
+ check.ok(node, `Missing deletion target ${operation.id}`);
+ node.remove();
+ } else if (operation.action === "foldHeading" || operation.action === "unfoldHeading") {
+ if (operation.action === "foldHeading") {
+ node.setAttribute("fold", "1");
+ } else {
+ node.removeAttribute("fold");
+ }
+ } else if (operation.action === "setAttrs") {
+ Object.entries(JSON.parse(operation.data)).forEach(([name, value]) => value ?
+ node.setAttribute(name, value) : node.removeAttribute(name));
+ } else if (operation.action === "update") {
+ node.outerHTML = lute.SpinBlockDOM(operation.data);
+ } else {
+ let moving = node;
+ if (operation.action !== "move") {
+ const template = document.createElement("template");
+ template.innerHTML = lute.SpinBlockDOM(operation.data);
+ moving = template.content.firstElementChild;
+ }
+ // 重放内核记录的折叠标题移动集合,验证隐藏内容不会成为独立分栏或丢失。
+ let group = [];
+ if (operation.action === "move" && moving.dataset.type === "NodeHeading" && moving.getAttribute("fold") === "1") {
+ if (!headingGroups.has(operation.id)) {
+ let next = moving.nextElementSibling;
+ const ids = [];
+ while (next?.dataset.nodeId && next.dataset.type !== "NodeHeading") {
+ ids.push(next.dataset.nodeId);
+ next = next.nextElementSibling;
+ }
+ headingGroups.set(operation.id, ids);
+ }
+ group = headingGroups.get(operation.id).map(find);
+ }
+ if (operation.action === "appendInsert") {
+ find(operation.parentID).lastElementChild.before(moving);
+ } else if (operation.action === "prependInsert") {
+ find(operation.parentID).prepend(moving);
+ } else if (operation.nextID) {
+ find(operation.nextID).before(moving);
+ } else if (operation.previousID) {
+ find(operation.previousID).after(moving);
+ } else {
+ find(operation.parentID).prepend(moving);
+ }
+ let previous = moving;
+ group.forEach(child => { previous.after(child); previous = child; });
+ }
+ });
+ const select = node => {
+ const range = document.createRange();
+ range.selectNodeContents(node.querySelector("[contenteditable=true]") || node);
+ range.collapse(true);
+ protyle.toolbar.range = range;
+ api.focusByRange(range);
+ };
+ const reset = markdown => {
+ root.innerHTML = lute.Md2BlockDOM(markdown);
+ submitted = [];
+ headingGroups.clear();
+ select(root.firstElementChild);
+ };
+ const capture = () => {
+ stored.innerHTML = root.innerHTML;
+ return shape(stored);
+ };
+ const verifyReplay = (before, hasHiddenContent = false) => {
+ check.equal(submitted.length, 1, "one action must use one undo step");
+ const {forward, backward} = submitted[0];
+ replay(forward);
+ const after = shape(stored);
+ if (!hasHiddenContent) {
+ check.deepEqual(after, shape(root), "persisted structure matches the displayed blocks");
+ }
+ replay(backward);
+ check.deepEqual(shape(stored), before, "undo restores IDs, order, content, and widths");
+ replay(forward);
+ check.deepEqual(shape(stored), after, "redo restores the same layout");
+ return after;
+ };
+ for (const layout of ["col", "row"]) {
+ for (const position of ["start", "end"]) {
+ for (mobile of [false, true]) {
+ reset(`{{{${layout}\nA\n\n{{{row\nB\n\nC\n}}}\n\n> Quote\n}}}`);
+ const target = root.firstElementChild;
+ children(target)[0].style.cssText = "width:calc(60% - 10px);flex:none;color:red";
+ children(target)[1].style.cssText = "width:calc(30% - 10px);flex:none";
+ const ids = children(target).map(node => node.dataset.nodeId);
+ const before = capture();
+ const keyboardsBefore = keyboardRequests;
+ await api.insertSuperBlockChild(protyle, target, position);
+ check.equal(children(target).length, 4);
+ const added = children(target)[position === "start" ? 0 : 3];
+ check.equal(added.dataset.type, "NodeParagraph");
+ check.deepEqual(children(target).filter(node => node !== added).map(node => node.dataset.nodeId), ids);
+ check.ok(added.contains(getSelection().focusNode));
+ check.equal(keyboardRequests - keyboardsBefore, Number(mobile));
+ verifyReplay(before);
+ }
+ }
+ }
+ for (const position of ["left", "right"]) {
+ for (const content of ["B", "> Quote", "{{{row\nInner A\n\nInner B\n}}}", "{{{col\nInner A\n\nInner B\n}}}", "## Heading"]) {
+ reset(`{{{col\n{{{row\nA\n\n${content}\n\nC\n}}}\n\nOutside\n}}}`);
+ const outer = root.firstElementChild;
+ const vertical = children(outer)[0];
+ const target = children(vertical)[1];
+ const originalID = target.dataset.nodeId;
+ const originalParentID = vertical.dataset.nodeId;
+ select(target);
+ const before = capture();
+ await api.createSuperBlockColumn(protyle, target, position);
+ check.equal(children(outer).length, 2, "outer columns remain unchanged");
+ check.equal(children(vertical).length, 3);
+ const horizontal = children(vertical)[1];
+ check.equal(horizontal.dataset.sbLayout, "col");
+ check.equal(children(horizontal).length, 2);
+ check.equal(children(horizontal)[position === "left" ? 1 : 0].dataset.nodeId, originalID);
+ check.equal(horizontal.parentElement.dataset.nodeId, originalParentID);
+ const added = children(horizontal)[position === "left" ? 0 : 1];
+ check.ok(added.contains(getSelection().focusNode));
+ verifyReplay(before);
+ }
+ reset("{{{row\nA\n\n## Folded\n\nHidden\n\n## Boundary\n}}}");
+ const target = children(root.firstElementChild)[1];
+ target.setAttribute("fold", "1");
+ const hidden = children(root.firstElementChild)[2];
+ const before = capture();
+ hidden.remove();
+ select(target);
+ await api.createSuperBlockColumn(protyle, target, position);
+ verifyReplay(before, true);
+ const persistedHeading = find(target.dataset.nodeId);
+ check.equal(persistedHeading.parentElement.dataset.sbLayout, "row");
+ check.equal(find(hidden.dataset.nodeId).parentElement, persistedHeading.parentElement);
+ check.equal(children(persistedHeading.parentElement.parentElement).length, 2);
+ }
+ reset("{{{row\n## Folded\n\n### Nested folded\n\nHidden\n}}}");
+ const target = root.firstElementChild;
+ children(target)[0].setAttribute("fold", "1");
+ const nestedHeading = children(target)[1];
+ nestedHeading.setAttribute("fold", "1");
+ const beforeHiddenAppend = capture();
+ children(target).slice(1).forEach(child => child.remove());
+ await api.insertSuperBlockChild(protyle, target, "end");
+ verifyReplay(beforeHiddenAppend, true);
+ check.equal(children(find(target.dataset.nodeId)).at(-1).dataset.type, "NodeParagraph");
+ check.equal(children(find(target.dataset.nodeId))[2].textContent.replace(/\u200b/g, ""), "Hidden");
+ check.notEqual(children(find(target.dataset.nodeId))[0].getAttribute("fold"), "1");
+ check.notEqual(find(nestedHeading.dataset.nodeId).getAttribute("fold"), "1");
+ reset("{{{row\n## Folded\n\nHidden\n\n## Boundary\n\nVisible\n}}}");
+ const bounded = root.firstElementChild;
+ const earlierHeading = children(bounded)[0];
+ earlierHeading.setAttribute("fold", "1");
+ const beforeBoundary = capture();
+ children(bounded)[1].remove();
+ await api.insertSuperBlockChild(protyle, bounded, "end");
+ verifyReplay(beforeBoundary, true);
+ check.equal(find(earlierHeading.dataset.nodeId).getAttribute("fold"), "1", "unrelated folded sections stay folded");
+ reset("{{{row\nA\n\nB\n}}}");
+ const folded = root.firstElementChild;
+ folded.setAttribute("fold", "1");
+ const beforeUnfold = capture();
+ await api.insertSuperBlockChild(protyle, folded, "end");
+ check.notEqual(folded.getAttribute("fold"), "1");
+ check.ok(children(folded).at(-1).contains(getSelection().focusNode));
+ verifyReplay(beforeUnfold);
+ for (const layout of ["col", "row"]) {
+ for (const text of ["/", "before / after"]) {
+ for (const container of ["document", "list", "quote", "super", "lite"]) {
+ protyle.lite = container === "lite";
+ const markdown = container === "list" ? `- ${text}` : container === "quote" ? `> ${text}` :
+ container === "super" ? `{{{row\n${text}\n\nOther\n}}}` : text;
+ reset(markdown);
+ const paragraph = root.querySelector('[data-type="NodeParagraph"]');
+ paragraph.setAttribute("custom-test", "preserved");
+ paragraph.style.color = "red";
+ const editable = paragraph.querySelector("[contenteditable=true]");
+ const range = document.createRange();
+ range.setStart(editable.firstChild, text.indexOf("/") + 1);
+ range.collapse(true);
+ protyle.toolbar.range = range;
+ api.focusByRange(range);
+ hint.splitChar = "/";
+ hint.lastIndex = text.indexOf("/");
+ const before = capture();
+ hint.fill(api.getSuperBlockCommand(layout), protyle, false);
+ const created = Array.from(root.querySelectorAll(".sb")).find(node =>
+ children(node).length === 2 && children(node).every(child => child.dataset.type === "NodeParagraph" &&
+ child.textContent.replace(/\u200b/g, "") === ""));
+ check.ok(created, `two empty paragraphs: ${layout}, ${text}, ${container}: ${root.innerHTML}`);
+ check.equal(created.dataset.sbLayout, layout);
+ if (text === "/") {
+ check.equal(created.getAttribute("custom-test"), "preserved");
+ check.equal(created.style.color, "red");
+ }
+ check.ok(children(created)[0].contains(getSelection().focusNode));
+ if (text !== "/") {
+ check.ok(root.textContent.includes("before after"));
+ }
+ verifyReplay(before);
+ check.equal(new Set(Array.from(root.querySelectorAll("[data-node-id]")).map(node => node.dataset.nodeId)).size,
+ root.querySelectorAll("[data-node-id]").length);
+ }
+ }
+ }
+ protyle.lite = false;
+ hint.bindUploadEvent = () => {};
+ protyle.hint = hint;
+ const toolbar = document.createElement("div");
+ toolbar.innerHTML = '<div class="keyboard__util"></div>';
+ api.renderSlashMenu(protyle, toolbar);
+ for (const layout of ["col", "row"]) {
+ const button = Array.from(toolbar.querySelectorAll("button")).find(item =>
+ decodeURIComponent(item.dataset.value) === api.getSuperBlockCommand(layout));
+ check.ok(button);
+ check.equal(button.dataset.focus, "true", "mobile insertion restores keyboard focus");
+ reset("\u200b");
+ const before = capture();
+ hint.fill(decodeURIComponent(button.dataset.value), protyle, false);
+ check.equal(root.firstElementChild.dataset.sbLayout, layout);
+ check.equal(children(root.firstElementChild).length, 2);
+ check.ok(children(root.firstElementChild)[0].contains(getSelection().focusNode));
+ verifyReplay(before);
+ }
+ const unchanged = root.innerHTML;
+ submitted = [];
+ protyle.disabled = true;
+ await api.insertSuperBlockChild(protyle, root.querySelector(".sb"), "start");
+ await api.createSuperBlockColumn(protyle, root.querySelector(".sb [data-node-id]"), "left");
+ check.equal(root.innerHTML, unchanged);
+ check.equal(submitted.length, 0);
+ return "Super block creation cases passed";
+};
+
+const run = async () => {
+ const {app, BrowserWindow} = require("electron");
+ app.setPath("userData", process.argv[2]);
+ app.commandLine.appendSwitch("disable-gpu");
+ await app.whenReady();
+ const win = new BrowserWindow({show: false, webPreferences: {
+ nodeIntegration: true, contextIsolation: false, offscreen: true,
+ }});
+ let code = 0;
+ try {
+ await win.loadURL("data:text/html,<html><body></body></html>");
+ await win.webContents.executeJavaScript(readFileSync(path.join(__dirname,
+ "../stage/protyle/js/lute/lute.min.js"), "utf8"));
+ const result = await win.webContents.executeJavaScript(`(async () => { try {
+ return await (${cases.toString()})(${JSON.stringify(sources())});
+ } catch (error) { return error.stack; } })()`);
+ assert.equal(result, "Super block creation cases passed");
+ console.log(result);
+ } catch (error) {
+ console.error(error);
+ code = 1;
+ } finally {
+ win.destroy();
+ app.exit(code);
+ }
+};
+
+if (process.versions.electron && process.type === "browser") {
+ run().catch(error => { console.error(error); require("electron").app.exit(1); });
+} else {
+ require("node:test").test("super block insertion and slash creation preserve nested content, focus, undo and redo", {
+ skip: process.platform === "linux" && !process.env.DISPLAY && !process.env.WAYLAND_DISPLAY,
+ timeout: 45000,
+ }, async () => {
+ const profile = mkdtempSync(path.join(os.tmpdir(), "siyuan-super-block-test-"));
+ const env = {...process.env};
+ delete env.ELECTRON_RUN_AS_NODE;
+ try {
+ const {stdout} = await require("node:util").promisify(require("node:child_process").execFile)(
+ require("electron"), [__filename, profile], {env, windowsHide: true, timeout: 40000});
+ assert.match(stdout, /Super block creation cases passed/);
+ } finally {
+ assert.ok(path.resolve(profile).startsWith(path.resolve(os.tmpdir()) + path.sep));
+ rmSync(profile, {recursive: true, force: true});
+ }
+ });
+}