Skip to content

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

:bug: Convert list items into standalone headings and paragraphs https://github.com/siyuan-note/siyuan/issues/19827

Danielfe0039e721aa
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.sy
index 7986608361..0676c109d4 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
@@ -7,7 +7,7 @@
"id": "20200924100950-9op5xi1",
"title": "Shortcuts",
"type": "doc",
- "updated": "20260925094732"
+ "updated": "20260925172309"
},
"Children": [
{
@@ -11972,7 +11972,7 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20260924173802-6zzgsf2",
- "updated": "20260924173802"
+ "updated": "20260925172309"
},
"Children": [
{
@@ -12004,7 +12004,34 @@
},
{
"Type": "NodeText",
- "Data": " (or another heading level) to convert the first paragraph of each item. Existing headings are set to the chosen level. Selecting an entire list affects only its immediate items; other paragraphs, nested lists, numbering, and task states are preserved. Items whose first block is neither a paragraph nor a heading are skipped. On mobile, select the list items and use the same block menu. When only the caret is inside a paragraph, the shortcut converts that paragraph."
+ "Data": " (or another heading level) to remove the selected items’ bullets or checkboxes and turn their first blocks into independent headings. Later paragraphs and nested lists stay in order, and unselected items remain lists. Selecting a whole list affects its immediate items only. To turn the first blocks into ordinary paragraphs, use the paragraph shortcut or choose "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "Block menu"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " - "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "Turn into"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " - "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "Paragraph block"
+ },
+ {
+ "Type": "NodeText",
+ "Data": ". This also removes existing heading formatting. Block IDs, database bindings, and field values are preserved. Items whose first block is neither a paragraph nor a heading are skipped. Mobile uses the same block menu. With only a caret inside a paragraph or heading, the shortcut changes that block without removing its surrounding list."
}
]
},
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.sy
index c2c957382b..547a0a7468 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
@@ -7,7 +7,7 @@
"id": "20200813004551-gm0pbn1",
"title": "快捷键",
"type": "doc",
- "updated": "20260925094732"
+ "updated": "20260925172309"
},
"Children": [
{
@@ -11960,7 +11960,7 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20260924173802-r3fq7uc",
- "updated": "20260924173802"
+ "updated": "20260925172309"
},
"Children": [
{
@@ -11992,7 +11992,34 @@
},
{
"Type": "NodeText",
- "Data": "(或其他标题级别)转换各项的首个段落。已有标题会调整到目标级别。选中整个列表时仅处理当前层的列表项,保留其他段落、子列表、编号和任务状态。首块不是段落或标题的列表项会被跳过。移动端可选中列表项后使用相同的块菜单。仅将光标放在段落内时,快捷键转换当前段落。"
+ "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、数据库关联和字段值均会保留。首块既非段落也非标题的列表项会跳过。移动端使用同一块菜单。仅将光标放在段落或标题内时,快捷键只转换该块,不取消外围列表。"
}
]
},
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.sy
index 6d16da08df..b60a8a9ab9 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
@@ -7,7 +7,7 @@
"id": "20211226122549-jktxego",
"title": "快捷鍵",
"type": "doc",
- "updated": "20260925094732"
+ "updated": "20260925172309"
},
"Children": [
{
@@ -11972,7 +11972,7 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20260924173802-11vvysw",
- "updated": "20260924173802"
+ "updated": "20260925172309"
},
"Children": [
{
@@ -12004,7 +12004,34 @@
},
{
"Type": "NodeText",
- "Data": "(或其他標題層級)轉換各項目的第一個段落。已有標題會調整至目標層級。選取整個列表時僅處理目前層級的列表項目,保留其他段落、子列表、編號和任務狀態。第一個區塊不是段落或標題的列表項目會被略過。行動端可選取列表項目後使用相同的區塊選單。僅將游標放在段落內時,快捷鍵轉換目前段落。"
+ "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、資料庫關聯和欄位值均會保留。首個區塊既非段落也非標題的列表項會略過。行動端使用相同的區塊選單。僅將游標放在段落或標題內時,快捷鍵只轉換該區塊,不取消外圍列表。"
}
]
},
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.sy
index 6dc01cda94..bade4d9e09 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
@@ -9,7 +9,7 @@
"id": "20240530101000-xsbxokr",
"title": "ショートカット",
"type": "doc",
- "updated": "20260925094732"
+ "updated": "20260925172309"
},
"Children": [
{
@@ -11915,7 +11915,7 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20260924173802-3l46zgy",
- "updated": "20260924173802"
+ "updated": "20260925172309"
},
"Children": [
{
@@ -11947,7 +11947,34 @@
},
{
"Type": "NodeText",
- "Data": "(または別の見出しレベル)を選ぶと、各項目の最初の段落を変換できます。既存の見出しは選択したレベルに変更されます。リスト全体を選択した場合は、その直下の項目だけが対象となり、他の段落、子リスト、番号、タスクの状態は保持されます。最初のブロックが段落でも見出しでもない項目はスキップされます。モバイルでもリスト項目を選択し、同じブロックメニューを利用できます。段落内にカーソルを置くだけの場合、ショートカットはその段落を変換します。"
+ "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、データベースとの関連付け、フィールド値は保持されます。最初のブロックが段落でも見出しでもない項目はスキップされます。モバイルでも同じブロックメニューを利用できます。段落や見出し内にカーソルを置くだけの場合、ショートカットはそのブロックだけを変換し、外側のリストは解除しません。"
}
]
},
diff --git a/app/src/command/contextCommands.ts b/app/src/command/contextCommands.ts
index 2d627f6a4e..c6b3175441 100644
--- a/app/src/command/contextCommands.ts
+++ b/app/src/command/contextCommands.ts
@@ -9,6 +9,7 @@ import {getNextBlockSibling} from "../protyle/wysiwyg/getBlock";
import {turnsIntoGroupsTransaction, turnsIntoTransaction, turnsOneInto} from "../protyle/wysiwyg/transaction";
import {turnParagraphIntoCode} from "../protyle/wysiwyg/turnIntoCode";
import {getListConversionType, type TListSubtype} from "../protyle/wysiwyg/listContext";
+import {getHeadingConversionElements} from "../protyle/wysiwyg/headingConversion";
import {removeBlockPreservingSelectionMode} from "../protyle/wysiwyg/remove";
import {foldBlocksRecursively, foldHeadingGroup, getFoldBlock, setFold} from "../protyle/util/blockFold";
import {pasteAsPlainText, pasteEscaped} from "../protyle/util/paste";
@@ -169,14 +170,12 @@ export const ensureContextCommands = (app: App) => {
});
return turnsIntoGroupsTransaction({protyle: context.protyle, selectsElementGroups: groups, type});
}, ["editor", "insert", key]));
+ const textConvertible = (context: ICommandContextSnapshot) => editable(context) &&
+ blocks(context).every(element => ["NodeParagraph", "NodeHeading", "NodeList", "NodeListItem"].includes(element.dataset.type)) &&
+ getHeadingConversionElements(blocks(context)).length > 0;
["paragraph", "heading1", "heading2", "heading3", "heading4", "heading5", "heading6"].forEach(key =>
- add(`block.${key}`, ["turnInto", key], context => convertible(context) || key === "paragraph" &&
- editable(context) && (Boolean(selectedList(context)) || blocks(context).length === 1 &&
- blocks(context)[0].dataset.type === "NodeBlockquote"), context => {
- const list = key === "paragraph" && selectedList(context);
- if (list) {
- return turnsOneInto({protyle: context.protyle, nodeElement: list, id: list.dataset.nodeId, type: "CancelList"});
- }
+ add(`block.${key}`, ["turnInto", key], context => textConvertible(context) || key === "paragraph" &&
+ editable(context) && blocks(context).length === 1 && blocks(context)[0].dataset.type === "NodeBlockquote", context => {
const blockquote = blocks(context)[0];
if (key === "paragraph" && blockquote.dataset.type === "NodeBlockquote") {
return turnsOneInto({protyle: context.protyle, nodeElement: blockquote,
diff --git a/app/src/config/entryVisibility/catalog.test.ts b/app/src/config/entryVisibility/catalog.test.ts
index 3821c6bc5c..5f061c0387 100644
--- a/app/src/config/entryVisibility/catalog.test.ts
+++ b/app/src/config/entryVisibility/catalog.test.ts
@@ -671,6 +671,8 @@ test("heading conversions follow list conversions across block menu scopes", ()
const headingKeys = ["heading1", "heading2", "heading3", "heading4", "heading5", "heading6"];
["gutter.single.turnInto", "gutter.multi.turnInto"].forEach((path) => {
const keys = getEntryCatalogChildren(path).map(item => item.key);
+ assert.equal(keys[0], "paragraph");
+ assert.equal(getEntryCatalogNode(`${path}.paragraph`)?.simple, true);
const headingIndex = keys.indexOf("heading1");
assert.equal(headingIndex, keys.indexOf(path === "gutter.single.turnInto" ? "listMindmap" : "check") + 1);
assert.deepEqual(keys.slice(headingIndex, headingIndex + headingKeys.length), headingKeys);
diff --git a/app/src/config/entryVisibility/catalog.ts b/app/src/config/entryVisibility/catalog.ts
index ae7340824a..57b064211a 100644
--- a/app/src/config/entryVisibility/catalog.ts
+++ b/app/src/config/entryVisibility/catalog.ts
@@ -226,7 +226,7 @@ const gutterTurnInto = (multi: boolean) => node("turnInto", lang("turnInto"), tr
node("orderedList", lang("ordered-list")),
node("check", lang("check")),
...(!multi ? [node("listMindmap", lang("mindmap"))] : []),
- // 列表及列表项的首块转换复用标题入口,保持单选、多选的配置标识和默认顺序一致。
+ // 列表及列表项复用段落和标题入口,保持单选、多选的配置标识和默认顺序一致。
node("heading1", lang("heading1")),
node("heading2", lang("heading2")),
node("heading3", lang("heading3")),
diff --git a/app/src/protyle/gutter/index.ts b/app/src/protyle/gutter/index.ts
index e35b07d5e0..e68862373f 100644
--- a/app/src/protyle/gutter/index.ts
+++ b/app/src/protyle/gutter/index.ts
@@ -1015,16 +1015,16 @@ export class Gutter {
label: options.label,
accelerator: options.accelerator,
click() {
- turnsIntoTransaction(options);
+ return turnsIntoTransaction(options);
}
};
}
- private headingTurnIntoMenu(protyle: IProtyle, selectsElement: Element[]): IMenu[] {
+ private headingTurnIntoMenu(protyle: IProtyle, selectsElement: Element[], includeParagraph = false): IMenu[] {
if (getHeadingConversionElements(selectsElement).length === 0) {
return [];
}
- return [1, 2, 3, 4, 5, 6].map(level => this.turnsInto({
+ const items = [1, 2, 3, 4, 5, 6].map(level => this.turnsInto({
menuId: `heading${level}`,
icon: `iconH${level}`,
label: window.siyuan.languages[`heading${level}`],
@@ -1034,6 +1034,13 @@ export class Gutter {
level,
type: "Blocks2Hs",
}));
+ if (includeParagraph) {
+ items.unshift(this.turnsInto({menuId: "paragraph", icon: "iconParagraph",
+ label: window.siyuan.languages.paragraph,
+ accelerator: window.siyuan.config.keymap.editor.heading.paragraph.custom,
+ protyle, selectsElement, type: "Blocks2Ps"}));
+ }
+ return items;
}
private emptyParagraphTurnIntoMenu(protyle: IProtyle, nodeElements: Element[]): IMenu[] {
@@ -1234,7 +1241,7 @@ export class Gutter {
}
}
if (isList && !protyle.disabled) {
- const submenu = this.headingTurnIntoMenu(protyle, selectsElement);
+ const submenu = this.headingTurnIntoMenu(protyle, selectsElement, true);
if (submenu.length > 0) {
window.siyuan.menus.menu.append(new MenuItem({
id: "turnInto",
@@ -1763,7 +1770,11 @@ export class Gutter {
}));
}
} else if ((type === "NodeList" || type === "NodeMindmap") && allowStructuralMutation) {
- turnIntoSubmenu.push(this.turnsOneInto({
+ turnIntoSubmenu.push(type === "NodeList" ? this.turnsInto({
+ menuId: "paragraph", icon: "iconParagraph", label: window.siyuan.languages.paragraph,
+ accelerator: window.siyuan.config.keymap.editor.heading.paragraph.custom,
+ protyle, selectsElement: [nodeElement], type: "Blocks2Ps",
+ }) : this.turnsOneInto({
menuId: "paragraph",
id,
icon: "iconParagraph",
@@ -1892,7 +1903,7 @@ export class Gutter {
turnIntoSubmenu.push(this.recursiveListMenu(protyle, [nodeElement]));
}
} else if (type === "NodeListItem" && allowStructuralMutation) {
- turnIntoSubmenu.push(...this.headingTurnIntoMenu(protyle, [nodeElement]));
+ turnIntoSubmenu.push(...this.headingTurnIntoMenu(protyle, [nodeElement], true));
} else if (type === "NodeTabs" && allowStructuralMutation) {
[
{menuId: "list", icon: "iconList", label: "list", type: "Tabs2UL"},
diff --git a/app/src/protyle/wysiwyg/headingConversion.test.ts b/app/src/protyle/wysiwyg/headingConversion.test.ts
deleted file mode 100644
index d70849e418..0000000000
--- a/app/src/protyle/wysiwyg/headingConversion.test.ts
+++ /dev/null
@@ -1,365 +0,0 @@
-import * as assert from "node:assert/strict";
-import {execFile} from "node:child_process";
-import {mkdtempSync, readFileSync, rmSync, writeFileSync} from "node:fs";
-import {tmpdir} from "node:os";
-import * as path from "node:path";
-import {test} from "node:test";
-import {promisify} from "node:util";
-import {createSourceFile, isClassDeclaration, isMethodDeclaration, isVariableStatement, ScriptTarget, transpileModule} from "typescript";
-import type {Node} from "typescript";
-
-const browserCases = async (source: string, menuSource: string, rangeSource: string) => {
- const check: typeof assert = require("node:assert/strict");
- const lute = Lute.New();
- lute.SetKramdownIAL(true);
- lute.SetProtyleWYSIWYG(true);
- lute.SetDataTask(true);
- const editor = document.createElement("div");
- document.body.append(editor);
- const batches: Array<{doOperations: IOperation[], undoOperations: IOperation[]}> = [];
- let disconnects = 0;
- const noop = (): void => undefined;
- const dependencies = {
- Constants: {ATTRIBUTE_EDITING: "data-editing", ZWSP: "\u200b"},
- transaction: (_protyle: IProtyle, doOperations: IOperation[], undoOperations: IOperation[]) => {
- batches.push({doOperations, undoOperations});
- },
- hideElements: (panels: string[]) => {
- if (panels.includes("select")) {
- editor.querySelectorAll(".protyle-wysiwyg--select, .protyle-wysiwyg--select-mode").forEach(item => {
- item.classList.remove("protyle-wysiwyg--select", "protyle-wysiwyg--select-mode");
- item.removeAttribute("select-start");
- item.removeAttribute("select-end");
- });
- }
- },
- processRender: noop,
- highlightRender: noop,
- avRender: noop,
- blockRender: noop,
- disposeCustomBlocksInElement: noop,
- focusBlock: noop,
- focusByRange: (range: Range) => {
- getSelection().removeAllRanges();
- getSelection().addRange(range);
- },
- getSemanticMarkerPrefixLengthForNode: () => 0,
- hasPreviousSibling: (element: Element) => element.previousSibling,
- setFold: () => check.fail("List folding must not unfold unrelated content"),
- unfoldListHeadings: async (): Promise<IOperation[]> => [],
- cleanHeadingNumberHTML: (html: string) => html,
- cleanListMindmapHTML: (html: string) => html,
- convertListMindmapToList: (): undefined => undefined,
- isTabsListConversion: () => false,
- getPreviousBlockSibling: (element: Element) => element.previousElementSibling,
- getParentBlock: (element: Element) => element.parentElement,
- getEmbedChildOperationParentID: (): undefined => undefined,
- getContenteditableElement: (element: Element) => element.querySelector('[contenteditable="true"]'),
- getEditorRange: () => document.createRange(),
- hasViewFoldContext: () => false,
- onTransaction: noop,
- };
- const api = new Function(...Object.keys(dependencies), source +
- "\nreturn {turnsIntoTransaction, turnsOneInto, turnListsRecursively, getHeadingConversionElements, isListHeadingContainer, buildCancelListOperations};")(...Object.values(dependencies)) as
- typeof import("./transaction") & typeof import("./headingConversion") & typeof import("./cancelList");
- const protyle = {wysiwyg: {element: editor}, lute, block: {rootID: "document", parentID: "document"},
- observerLoad: {disconnect: () => disconnects++}} as unknown as IProtyle;
- const Gutter = new Function("turnsIntoTransaction", "getHeadingConversionElements", menuSource + "\nreturn Gutter;")(
- api.turnsIntoTransaction, api.getHeadingConversionElements);
- const gutter = new Gutter() as {
- headingTurnIntoMenu: (protyle: IProtyle, elements: Element[]) => Array<{id: string, click: () => void}>,
- };
- window.siyuan = {languages: {}, config: {keymap: {editor: {heading: {}}}}} as typeof window.siyuan;
- for (let level = 1; level <= 6; level++) {
- window.siyuan.languages[`heading${level}`] = `Heading ${level}`;
- window.siyuan.config.keymap.editor.heading[`heading${level}`] = {custom: `Alt+Ctrl+${level}`};
- }
- const reset = (subtype = "u") => {
- const marker = {u: "-", o: "1.", t: "- [x]"}[subtype];
- editor.innerHTML = lute.Md2BlockDOM(`${marker} **one**\n\n tail\n\n - nested\n\n${marker} two\n\n${marker} three`);
- batches.length = 0;
- return editor.querySelector('[data-type="NodeList"]');
- };
- const items = (list: Element) => Array.from(list.querySelectorAll(':scope > [data-type="NodeListItem"]'));
- const first = (item: Element) => item.querySelector(":scope > [data-node-id]");
- const id = (element: Element) => element.getAttribute("data-node-id");
- const cleanHTML = () => {
- const clone = editor.cloneNode(true) as Element;
- clone.querySelectorAll("[data-editing]").forEach(item => item.removeAttribute("data-editing"));
- clone.querySelectorAll("wbr").forEach(item => item.remove());
- return clone.innerHTML;
- };
- const replay = (operations: IOperation[]) => {
- operations.forEach(operation => {
- check.equal(operation.action, "update");
- editor.querySelector(`[data-node-id="${operation.id}"]`).outerHTML = operation.data as string;
- });
- };
- const setCaret = (element: Element) => {
- const range = document.createRange();
- range.selectNodeContents(element.querySelector('[contenteditable="true"]'));
- range.collapse(true);
- dependencies.focusByRange(range);
- };
-
- for (const subtype of ["u", "o", "t"]) {
- for (let level = 1; level <= 6; level++) {
- const list = reset(subtype);
- const listItems = items(list);
- listItems[0].setAttribute("fold", "1");
- listItems[0].setAttribute("data-task", "x");
- const targets = listItems.map(first);
- targets[0].setAttribute("custom-test", "retained");
- const targetIDs = targets.map(id);
- const before = cleanHTML();
- const nested = listItems[0].querySelector('[data-type="NodeList"]').outerHTML;
- const tail = listItems[0].querySelectorAll(':scope > [data-type="NodeParagraph"]')[1].outerHTML;
- const menu = gutter.headingTurnIntoMenu(protyle, [list]);
- check.deepEqual(menu.map(item => item.id), [1, 2, 3, 4, 5, 6].map(value => `heading${value}`));
- menu[level - 1].click();
- check.equal(batches.length, 1);
- check.deepEqual(batches[0].doOperations.map(operation => operation.id), targetIDs);
- listItems.forEach(item => check.equal(first(item).getAttribute("data-subtype"), `h${level}`));
- check.equal(first(listItems[0]).getAttribute("custom-test"), "retained");
- check.ok(first(listItems[0]).querySelector('[data-type="strong"]'));
- check.equal(listItems[0].getAttribute("fold"), "1");
- check.equal(listItems[0].getAttribute("data-task"), "x");
- check.equal(listItems[0].querySelector('[data-type="NodeList"]').outerHTML, nested);
- check.equal(listItems[0].querySelector(':scope > [data-type="NodeParagraph"]').outerHTML, tail);
- const after = cleanHTML();
- replay(batches[0].undoOperations);
- check.equal(cleanHTML(), before);
- replay(batches[0].doOperations);
- check.equal(cleanHTML(), after);
- }
- }
-
- for (const selectList of [false, true]) {
- const list = reset();
- const selected = selectList ? [list] : items(list).slice(0, 2);
- const event = new KeyboardEvent("keydown", {cancelable: true});
- const rangeDependencies = {
- isCrossBlock: true,
- selectText: "one two",
- range: document.createRange(),
- getBlockElementsByRange: () => selected,
- getUndoFocusContext: noop,
- turnsIntoTransaction: api.turnsIntoTransaction,
- isListHeadingContainer: api.isListHeadingContainer,
- protyle,
- event,
- };
- const convertRange = new Function(...Object.keys(rangeDependencies), rangeSource +
- "\nreturn turnCrossBlockRangeInto;")(...Object.values(rangeDependencies)) as (type: TTurnInto, level?: number) => boolean;
- check.equal(convertRange("Blocks2Ps"), false);
- check.equal(convertRange("Blocks2Hs", 5), true);
- check.equal(batches.length, 1);
- check.equal(batches[0].doOperations.length, selectList ? 3 : 2);
- check.equal(event.defaultPrevented, true);
- }
-
- for (const selectList of [false, true]) {
- const list = reset();
- const listItems = items(list);
- const selected = selectList ? [list] : [listItems[0], listItems[2]];
- selected.forEach(item => item.classList.add("protyle-wysiwyg--select"));
- setCaret(first(listItems[0]));
- api.turnsIntoTransaction({protyle, nodeElement: first(listItems[0]), type: "Blocks2Hs", level: 2});
- check.equal(first(listItems[0]).getAttribute("data-type"), "NodeHeading");
- check.equal(first(listItems[1]).getAttribute("data-type"), selectList ? "NodeHeading" : "NodeParagraph");
- check.equal(first(listItems[2]).getAttribute("data-type"), "NodeHeading");
- check.equal(editor.querySelector("wbr, .protyle-wysiwyg--select"), null);
- check.ok(first(listItems[0]).contains(getSelection().anchorNode));
- }
-
- let list = reset();
- let listItems = items(list);
- let targets = listItems.map(first);
- check.deepEqual(api.getHeadingConversionElements([list, listItems[0], targets[0]]), targets);
- api.turnsIntoTransaction({protyle, selectsElement: [listItems[0], listItems[2]], type: "Blocks2Hs", level: 3});
- check.equal(first(listItems[1]).getAttribute("data-type"), "NodeParagraph");
- listItems[0].classList.add("protyle-wysiwyg--select");
- setCaret(first(listItems[0]));
- api.turnsIntoTransaction({protyle, nodeElement: first(listItems[0]), type: "Blocks2Hs", level: 3});
- check.equal(first(listItems[0]).getAttribute("data-type"), "NodeHeading");
- api.turnsIntoTransaction({protyle, nodeElement: first(listItems[0]), type: "Blocks2Hs", level: 3});
- check.equal(first(listItems[0]).getAttribute("data-type"), "NodeParagraph");
-
- list = reset();
- listItems = items(list);
- targets = listItems.map(first);
- targets[0].setAttribute("data-type", "NodeCodeBlock");
- check.equal(gutter.headingTurnIntoMenu(protyle, [listItems[0]]).length, 0);
- listItems[0].classList.add("protyle-wysiwyg--select");
- setCaret(targets[0]);
- const unchanged = editor.innerHTML;
- const previousDisconnects = disconnects;
- api.turnsIntoTransaction({protyle, nodeElement: targets[0], type: "Blocks2Hs", level: 1});
- check.equal(editor.innerHTML, unchanged);
- check.equal(batches.length, 0);
- check.equal(disconnects, previousDisconnects);
-
- list = reset();
- editor.insertAdjacentHTML("beforeend", lute.Md2BlockDOM("outside"));
- const outside = editor.lastElementChild;
- api.turnsIntoTransaction({protyle, selectsElement: [list, outside], type: "Blocks2Hs", level: 4});
- check.equal(batches[0].doOperations.length, 4);
- check.equal(editor.lastElementChild.getAttribute("data-type"), "NodeHeading");
- check.equal(editor.querySelectorAll('[data-type="NodeList"]').length, 2);
- // 使用真实块 DOM 比较取消列表与 Lute 的结果,并往返重放结构操作。
- editor.innerHTML = lute.Md2BlockDOM("# First\n\n## Second");
- Array.from(editor.children).forEach(block => block.setAttribute("custom-avs", "database"));
- batches.length = 0;
- api.turnsIntoTransaction({protyle, selectsElement: Array.from(editor.children), type: "Blocks2Ps", isContinue: true});
- check.deepEqual(batches[0].doOperations.map(operation => operation.action), ["update", "update"]);
- check.deepEqual(batches[0].undoOperations.map(operation => operation.action), ["update", "update"]);
- check.equal(editor.querySelectorAll('[data-type="NodeParagraph"][custom-avs="database"]').length, 2);
- for (const marker of ["-", "1.", "- [x]"]) {
- for (const recursively of [false, true]) {
- editor.innerHTML = lute.Md2BlockDOM(`${marker} # Heading\n\n tail\n\n ${marker} nested\n\n > ${marker} quoted\n\n${marker} second`);
- const sourceList = editor.firstElementChild;
- sourceList.querySelectorAll('[data-type="NodeHeading"], [data-type="NodeParagraph"]').forEach(block => {
- block.setAttribute("custom-avs", "database");
- block.setAttribute("custom-av-database-field", "value");
- });
- const originalWithAttributes = editor.innerHTML;
- // @ts-expect-error Lute 声明尚未包含 CancelList。
- const expected = recursively ? lute.CancelListRecursively(sourceList.outerHTML) : lute.CancelList(sourceList.outerHTML);
- const shape = (html: string) => {
- const template = document.createElement("template");
- template.innerHTML = html;
- return Array.from(template.content.querySelectorAll("[data-node-id]")).map(block => ({
- id: id(block), type: block.getAttribute("data-type"), parent: block.parentElement?.getAttribute("data-node-id"),
- avs: block.getAttribute("custom-avs"), field: block.getAttribute("custom-av-database-field"),
- text: block.querySelector(':scope > [contenteditable="true"]')?.textContent,
- }));
- };
- const operations = api.buildCancelListOperations(sourceList, {parentID: "document", recursively});
- check.equal(editor.innerHTML, originalWithAttributes, "building operations must not mutate the editor");
- const boundNodes = Array.from(editor.querySelectorAll("[custom-avs]"));
- const replayStructure = (batch: IOperation[]) => batch.forEach(operation => {
- const node = editor.querySelector(`[data-node-id="${operation.id}"]`);
- if (operation.action === "delete") {
- check.equal(node.querySelectorAll("[custom-avs]").length, 0, "delete only empty list shells");
- node.remove();
- return;
- }
- let moved = node;
- if (operation.action === "insert") {
- const template = document.createElement("template");
- template.innerHTML = operation.data as string;
- moved = template.content.firstElementChild;
- check.equal(moved.querySelectorAll("[custom-avs]").length, 0, "never reinsert bound content");
- } else {
- check.equal(operation.action, "move");
- }
- if (operation.previousID) {
- editor.querySelector(`[data-node-id="${operation.previousID}"]`).after(moved);
- } else {
- const parent = operation.parentID === "document" ? editor :
- editor.querySelector(`[data-node-id="${operation.parentID}"]`);
- const firstBlock = Array.from(parent.children).find(child => child.hasAttribute("data-node-id"));
- if (firstBlock) {
- firstBlock.before(moved);
- } else if (parent.lastElementChild?.classList.contains("protyle-attr")) {
- parent.lastElementChild.before(moved);
- } else {
- parent.append(moved);
- }
- }
- });
- for (let cycle = 0; cycle < 3; cycle++) {
- replayStructure(operations.doOperations);
- check.deepEqual(shape(editor.innerHTML), shape(expected));
- boundNodes.forEach(node => check.equal(editor.querySelector(`[data-node-id="${id(node)}"]`), node));
- replayStructure(operations.undoOperations);
- check.equal(editor.innerHTML, originalWithAttributes);
- }
- }
- }
- for (const recursively of [false, true]) {
- editor.innerHTML = lute.Md2BlockDOM("- # Bound\n\n - nested");
- batches.length = 0;
- const sourceList = editor.firstElementChild;
- if (recursively) {
- await api.turnListsRecursively({protyle, nodeElements: [sourceList], type: "CancelListRecursively"});
- } else {
- await api.turnsOneInto({protyle, nodeElement: sourceList, id: id(sourceList), type: "CancelList"});
- }
- check.equal(batches.length, 1);
- check.ok(batches[0].doOperations.some(operation => operation.action === "move"));
- check.ok(batches[0].doOperations.every(operation => operation.action !== "insert"));
- check.equal(editor.querySelectorAll('[data-type="NodeList"]').length, recursively ? 0 : 1);
- }
- editor.remove();
- return "List heading conversion cases passed";
-};
-
-test("list heading conversion and cancellation preserve content, IDs, database bindings and undo operations", {
- skip: process.platform === "linux" && !process.env.DISPLAY && !process.env.WAYLAND_DISPLAY,
- timeout: 45000,
-}, async () => {
- const read = (file: string) => readFileSync(path.join(__dirname, file), "utf8");
- const compile = (source: string) => transpileModule(source.replace(/^export /gm, ""), {
- compilerOptions: {target: ScriptTarget.ES2021},
- }).outputText;
- const extract = (file: string, name: string) => {
- const parsed = createSourceFile(file, read(file), ScriptTarget.Latest, true);
- let result: string;
- const visit = (node: Node) => {
- if (isVariableStatement(node) && node.declarationList.declarations.some(item => item.name.getText(parsed) === name)) {
- result = node.getText(parsed);
- return;
- }
- node.forEachChild(visit);
- };
- visit(parsed);
- assert.ok(result, name);
- return result;
- };
- const source = compile(read("headingConversion.ts") + "\n" + read("cancelList.ts") + "\n" + extract("transaction.ts", "turnsIntoTransaction") +
- "\n" + extract("transaction.ts", "turnsOneInto") + "\n" + extract("transaction.ts", "turnListsRecursively") +
- "\n" + extract("getBlock.ts", "getNextBlockSibling") + "\n" + extract("../util/selection.ts", "focusByWbr"));
- const rangeSource = compile(extract("keydown.ts", "turnCrossBlockRangeInto"));
- const parsed = createSourceFile("gutter.ts", read("../gutter/index.ts"), ScriptTarget.Latest, true);
- const gutter = parsed.statements.find(isClassDeclaration);
- const methods = gutter.members.filter(member => isMethodDeclaration(member) &&
- ["headingTurnIntoMenu", "turnsInto"].includes(member.name.getText(parsed)));
- const menuSource = compile("class Gutter {\n" + methods.map(member => member.getText(parsed)).join("\n") + "\n}");
- const temporary = mkdtempSync(path.join(tmpdir(), "siyuan-list-heading-test-"));
- const script = path.join(temporary, "run.cjs");
- const lutePath = path.resolve(__dirname, "../../../stage/protyle/js/lute/lute.min.js");
- writeFileSync(script, `const {app, BrowserWindow} = require("electron");
-app.setPath("userData", ${JSON.stringify(path.join(temporary, "profile"))});
-app.commandLine.appendSwitch("disable-gpu");
-app.whenReady().then(async () => {
- const win = new BrowserWindow({show: false, webPreferences: {nodeIntegration: true, contextIsolation: false, offscreen: true}});
- try {
- await win.loadURL("data:text/html,<html><body></body></html>");
- await win.webContents.executeJavaScript(require("node:fs").readFileSync(${JSON.stringify(lutePath)}, "utf8"));
- const result = await win.webContents.executeJavaScript(${JSON.stringify("(async () => { try { const __name = value => value; return {value: await (" +
- browserCases.toString() + ")(" + [source, menuSource, rangeSource].map(value => JSON.stringify(value)).join(",") +
- ")}; } catch (error) { return {error: error.stack}; } })()")} );
- if (result.error) { throw new Error(result.error); }
- console.log(result.value);
- win.destroy();
- app.exit(0);
- } catch (error) {
- console.error(error);
- win.destroy();
- app.exit(1);
- }
-});`, "utf8");
- const env = {...process.env};
- delete env.ELECTRON_RUN_AS_NODE;
- try {
- const result = await promisify(execFile)(require("electron") as unknown as string, [script],
- {env, timeout: 40000, windowsHide: true});
- assert.match(result.stdout, /List heading conversion cases passed/);
- } finally {
- if (path.dirname(path.resolve(temporary)) === path.resolve(tmpdir()) &&
- path.basename(temporary).startsWith("siyuan-list-heading-test-")) {
- rmSync(temporary, {recursive: true, force: true});
- }
- }
-});
diff --git a/app/src/protyle/wysiwyg/keydown.ts b/app/src/protyle/wysiwyg/keydown.ts
index e6237cab72..66d0cc665d 100644
--- a/app/src/protyle/wysiwyg/keydown.ts
+++ b/app/src/protyle/wysiwyg/keydown.ts
@@ -1249,20 +1249,27 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
return false;
}
const selectsElement = getBlockElementsByRange(range);
- const listHeading = type === "Blocks2Hs" && selectsElement.some(isListHeadingContainer);
+ const listHeading = ["Blocks2Hs", "Blocks2Ps"].includes(type) && selectsElement.some(isListHeadingContainer);
if (!listHeading && (selectsElement.length < 2 || selectsElement.some(item => item.classList.contains("li")))) {
return false;
}
const focusContext = getUndoFocusContext(protyle.wysiwyg.element, range, true);
- turnsIntoTransaction({
+ const pending = turnsIntoTransaction({
protyle,
selectsElement,
type,
level,
unfocus: true,
});
- if (focusContext) {
- restoreFocusContext(protyle, focusContext);
+ const restore = () => {
+ if (focusContext) {
+ restoreFocusContext(protyle, focusContext);
+ }
+ };
+ if (pending) {
+ void pending.then(restore);
+ } else {
+ restore();
}
event.preventDefault();
event.stopPropagation();
@@ -1949,19 +1956,12 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
});
} else {
const type = selectsElement[0].getAttribute("data-type");
- if (type === "NodeHeading") {
+ if (type === "NodeHeading" || isListHeadingContainer(selectsElement[0])) {
turnsIntoTransaction({
protyle,
nodeElement: selectsElement[0],
type: "Blocks2Ps",
});
- } else if (type === "NodeList") {
- turnsOneInto({
- protyle,
- nodeElement: selectsElement[0],
- id: selectsElement[0].getAttribute("data-node-id"),
- type: "CancelList",
- });
} else if (type === "NodeBlockquote") {
turnsOneInto({
protyle,
diff --git a/app/src/protyle/wysiwyg/listConversion.test.ts b/app/src/protyle/wysiwyg/listConversion.test.ts
new file mode 100644
index 0000000000..9905e752ab
--- /dev/null
+++ b/app/src/protyle/wysiwyg/listConversion.test.ts
@@ -0,0 +1,281 @@
+import * as assert from "node:assert/strict";
+import {execFile} from "node:child_process";
+import {mkdtempSync, readFileSync, rmSync, writeFileSync} from "node:fs";
+import {tmpdir} from "node:os";
+import * as path from "node:path";
+import {test} from "node:test";
+import {promisify} from "node:util";
+import {createSourceFile, isClassDeclaration, isMethodDeclaration, isVariableStatement, ScriptTarget, transpileModule} from "typescript";
+import type {Node} from "typescript";
+
+const browserCases = async (source: string, menuSource: string, rangeSource: string) => {
+ const check: typeof assert = require("node:assert/strict");
+ const lute = Lute.New();
+ lute.SetKramdownIAL(true);
+ lute.SetProtyleWYSIWYG(true);
+ lute.SetDataTask(true);
+ const editor = document.createElement("div");
+ document.body.append(editor);
+ const batches: Array<{doOperations: IOperation[], undoOperations: IOperation[]}> = [];
+ const noop = (): void => undefined;
+ const dependencies = {
+ Constants: {ATTRIBUTE_EDITING: "data-editing", ZWSP: "\u200b"},
+ transaction: (_protyle: IProtyle, doOperations: IOperation[], undoOperations: IOperation[]) => batches.push({doOperations, undoOperations}),
+ hideElements: () => editor.querySelectorAll(".protyle-wysiwyg--select").forEach(item => item.classList.remove("protyle-wysiwyg--select")),
+ processRender: noop, highlightRender: noop, avRender: noop, blockRender: noop,
+ disposeCustomBlocksInElement: noop, focusBlock: noop, focusByWbr: noop, onTransaction: noop,
+ unfoldListHeadings: async (): Promise<IOperation[]> => [],
+ getPreviousBlockSibling: (element: Element) => element.previousElementSibling,
+ getParentBlock: (element: Element) => element.parentElement,
+ getEmbedChildOperationParentID: (): undefined => undefined,
+ getContenteditableElement: (element: Element) => element.querySelector('[contenteditable="true"]'),
+ getEditorRange: () => document.createRange(),
+ hasViewFoldContext: () => false,
+ };
+ const api = new Function(...Object.keys(dependencies), source +
+ "\nreturn {turnsIntoTransaction, turnListsRecursively, getHeadingConversionElements, isListHeadingContainer};")(...Object.values(dependencies)) as
+ typeof import("./transaction") & typeof import("./headingConversion");
+ const protyle = {wysiwyg: {element: editor}, lute, block: {rootID: "document", parentID: "document"},
+ observerLoad: {disconnect: noop}} as unknown as IProtyle;
+ const Gutter = new Function("turnsIntoTransaction", "getHeadingConversionElements", menuSource + "\nreturn Gutter;")(
+ api.turnsIntoTransaction, api.getHeadingConversionElements);
+ const gutter = new Gutter() as {
+ headingTurnIntoMenu: (protyle: IProtyle, elements: Element[], includeParagraph?: boolean) => Array<{id: string, click: () => Promise<void>}>,
+ };
+ window.siyuan = {languages: {}, config: {keymap: {editor: {heading: {paragraph: {custom: "Alt+Ctrl+0"}}}}}} as typeof window.siyuan;
+ for (let level = 1; level <= 6; level++) {
+ window.siyuan.languages[`heading${level}`] = `Heading ${level}`;
+ window.siyuan.config.keymap.editor.heading[`heading${level}`] = {custom: `Alt+Ctrl+${level}`};
+ }
+ const id = (element: Element) => element.getAttribute("data-node-id");
+ const items = (list: Element) => Array.from(list.children).filter(child => child.getAttribute("data-type") === "NodeListItem");
+ const first = (item: Element) => Array.from(item.children).find(child => child.hasAttribute("data-node-id"));
+ const clean = (html: string) => html.replace(/<wbr>/g, "");
+ const shape = (html: string) => {
+ const template = document.createElement("template");
+ template.innerHTML = html;
+ return Array.from(template.content.querySelectorAll("[data-node-id]")).map(block => ({
+ id: id(block), type: block.getAttribute("data-type"), subtype: block.getAttribute("data-subtype"),
+ parent: block.parentElement?.getAttribute("data-node-id"), marker: block.getAttribute("data-marker"),
+ task: block.getAttribute("data-task"),
+ avs: block.getAttribute("custom-avs"), field: block.getAttribute("custom-av-database-field"),
+ text: block.querySelector(':scope > [contenteditable="true"]')?.textContent,
+ }));
+ };
+ const replay = (operations: IOperation[]) => operations.forEach(operation => {
+ let node = editor.querySelector(`[data-node-id="${operation.id}"]`);
+ if (operation.action === "delete") {
+ check.equal(node.querySelectorAll("[custom-avs]").length, 0, "only delete empty wrappers");
+ node.remove();
+ return;
+ }
+ if (operation.action === "update") {
+ check.ok(node);
+ node.outerHTML = operation.data as string;
+ return;
+ }
+ const oldParent = node?.parentElement;
+ if (operation.action === "insert") {
+ const template = document.createElement("template");
+ template.innerHTML = operation.data as string;
+ node = template.content.firstElementChild;
+ check.equal(node.querySelectorAll("[custom-avs]").length, 0, "never insert bound content");
+ } else {
+ check.equal(operation.action, "move");
+ }
+ if (operation.previousID) {
+ const previous = editor.querySelector(`[data-node-id="${operation.previousID}"]`);
+ check.ok(previous, operation.previousID);
+ previous.after(node);
+ } else {
+ const parent = operation.parentID === "document" ? editor : editor.querySelector(`[data-node-id="${operation.parentID}"]`);
+ check.ok(parent, operation.parentID);
+ const firstBlock = Array.from(parent.children).find(child => child.hasAttribute("data-node-id"));
+ if (firstBlock) {
+ firstBlock.before(node);
+ } else if (parent.lastElementChild?.classList.contains("protyle-attr")) {
+ parent.lastElementChild.before(node);
+ } else {
+ parent.append(node);
+ }
+ }
+ if (oldParent?.getAttribute("data-type") === "NodeList" && items(oldParent).length === 0) {
+ oldParent.remove();
+ }
+ });
+ const fixtures: unknown[] = [];
+ for (const marker of ["-", "3.", "- [x]"]) {
+ for (const mask of [1, 2, 4, 3, 5, 6, 7]) {
+ for (let level = 0; level <= 6; level++) {
+ editor.innerHTML = lute.Md2BlockDOM(`${marker} **one**\n\n tail\n\n - nested\n\n${marker} two\n\n${marker} three`);
+ const list = editor.firstElementChild;
+ const listItems = items(list);
+ const targets = listItems.map(first);
+ targets.forEach(target => {
+ target.setAttribute("custom-avs", "database");
+ target.setAttribute("custom-av-database-field", "retained");
+ if (level === 0) {
+ // 段落转换必须移除已有标题格式。
+ // @ts-expect-error Lute 声明尚未包含 Blocks2Hs。
+ const html = lute.Blocks2Hs(target.outerHTML, "2");
+ target.outerHTML = html;
+ }
+ });
+ const targetIDs = listItems.map(item => id(first(item)));
+ const selection = mask === 7 ? [list] : listItems.filter((_item, index) => mask & (1 << index));
+ const before = editor.innerHTML;
+ batches.length = 0;
+ const menu = gutter.headingTurnIntoMenu(protyle, selection, true);
+ check.deepEqual(menu.map(item => item.id), ["paragraph", "heading1", "heading2", "heading3", "heading4", "heading5", "heading6"]);
+ await menu[level].click();
+ check.equal(batches.length, 1);
+ const after = editor.innerHTML;
+ targetIDs.forEach((targetID, index) => {
+ const block = editor.querySelector(`[data-node-id="${targetID}"]`);
+ check.equal(block.getAttribute("custom-avs"), "database");
+ check.equal(block.getAttribute("custom-av-database-field"), "retained");
+ if (mask & (1 << index)) {
+ check.equal(block.parentElement, editor);
+ check.equal(block.getAttribute("data-type"), level ? "NodeHeading" : "NodeParagraph");
+ if (level) {
+ check.equal(block.getAttribute("data-subtype"), `h${level}`);
+ }
+ } else {
+ check.equal(id(block.parentElement), id(listItems[index]));
+ }
+ });
+ const order = Array.from(editor.querySelectorAll("[data-node-id]")).map(id).filter(value => targetIDs.includes(value));
+ check.deepEqual(order, targetIDs);
+ for (let cycle = 0; cycle < 2; cycle++) {
+ replay(batches[0].undoOperations);
+ check.deepEqual(shape(clean(editor.innerHTML)), shape(before));
+ replay(batches[0].doOperations);
+ check.deepEqual(shape(clean(editor.innerHTML)), shape(clean(after)));
+ }
+ if (mask === ({"-": 7, "3.": 2, "- [x]": 5}[marker]) && [0, 3].includes(level)) {
+ fixtures.push({before, after: clean(after), targetIDs, ...batches[0]});
+ }
+ }
+ }
+ }
+ // 快捷键的块选择与跨块文本选择都使用相同的转换入口。
+ for (const type of ["Blocks2Hs", "Blocks2Ps"] as TTurnInto[]) {
+ editor.innerHTML = lute.Md2BlockDOM("- # one\n- # two");
+ const selected = [editor.firstElementChild];
+ const event = new KeyboardEvent("keydown", {cancelable: true});
+ const rangeDependencies = {
+ isCrossBlock: true, selectText: "one two", range: document.createRange(), getBlockElementsByRange: () => selected,
+ getUndoFocusContext: noop, restoreFocusContext: noop, turnsIntoTransaction: api.turnsIntoTransaction,
+ isListHeadingContainer: api.isListHeadingContainer, protyle, event,
+ };
+ const convertRange = new Function(...Object.keys(rangeDependencies), rangeSource + "\nreturn turnCrossBlockRangeInto;")(...Object.values(rangeDependencies));
+ check.equal(convertRange(type, 4), true);
+ await new Promise(resolve => setTimeout(resolve, 0));
+ check.equal(editor.querySelector('[data-type="NodeList"]'), null);
+ check.equal(event.defaultPrevented, true);
+ }
+ editor.innerHTML = lute.Md2BlockDOM("- one\n- two");
+ const selectedList = editor.firstElementChild;
+ selectedList.classList.add("protyle-wysiwyg--select");
+ await api.turnsIntoTransaction({protyle, nodeElement: first(items(selectedList)[0]), type: "Blocks2Hs", level: 1});
+ check.equal(editor.querySelector('[data-type="NodeList"]'), null);
+ check.equal(editor.querySelectorAll('[data-type="NodeHeading"]').length, 2);
+ for (const scenario of ["nested", "multiple", "recursive", "invalid", "mixed"]) {
+ editor.innerHTML = lute.Md2BlockDOM("- # outer\n\n - ## inner\n\n 1. different\n\n- # last");
+ if (scenario === "multiple" || scenario === "mixed") {
+ editor.insertAdjacentHTML("beforeend", lute.Md2BlockDOM(scenario === "mixed" ? "# Outside" : "1. # Another"));
+ }
+ let selection = [editor.firstElementChild];
+ if (scenario === "nested") {
+ selection = [editor.querySelector('[data-type="NodeList"] [data-type="NodeList"]')];
+ } else if (scenario === "multiple" || scenario === "mixed") {
+ selection = Array.from(editor.children);
+ } else if (scenario === "invalid") {
+ first(items(selection[0])[0]).setAttribute("data-type", "NodeCodeBlock");
+ }
+ const boundTargets = Array.from(editor.querySelectorAll('[data-type="NodeHeading"], [data-type="NodeParagraph"]')).slice(0, 3);
+ boundTargets.forEach(target => target.setAttribute("custom-avs", "database"));
+ const before = editor.innerHTML;
+ batches.length = 0;
+ if (scenario === "recursive") {
+ await api.turnListsRecursively({protyle, nodeElements: selection, type: "CancelListRecursively"});
+ check.equal(editor.querySelector('[data-type="NodeHeading"]'), null);
+ check.equal(editor.querySelectorAll('[data-type="NodeList"]').length, 1);
+ } else {
+ await api.turnsIntoTransaction({protyle, selectsElement: selection, type: "Blocks2Ps"});
+ }
+ const after = editor.innerHTML;
+ check.equal(batches.length, 1);
+ replay(batches[0].undoOperations);
+ check.deepEqual(shape(clean(editor.innerHTML)), shape(before), scenario);
+ replay(batches[0].doOperations);
+ check.deepEqual(shape(clean(editor.innerHTML)), shape(clean(after)), scenario);
+ if (scenario === "recursive" || scenario === "nested") {
+ fixtures.push({before, after: clean(after), targetIDs: boundTargets.map(id), ...batches[0]});
+ }
+ }
+ editor.remove();
+ return {message: "List conversion cases passed", fixtures};
+};
+
+test("list conversion removes selected wrappers and preserves content, database attributes and undo", {
+ skip: process.platform === "linux" && !process.env.DISPLAY && !process.env.WAYLAND_DISPLAY,
+ timeout: 60000,
+}, async () => {
+ const read = (file: string) => readFileSync(path.join(__dirname, file), "utf8");
+ const compile = (source: string) => transpileModule(source.replace(/^export /gm, ""), {compilerOptions: {target: ScriptTarget.ES2021}}).outputText;
+ const extract = (file: string, name: string) => {
+ const parsed = createSourceFile(file, read(file), ScriptTarget.Latest, true);
+ let result: string;
+ const visit = (node: Node) => {
+ if (isVariableStatement(node) && node.declarationList.declarations.some(item => item.name.getText(parsed) === name)) {
+ result = node.getText(parsed);
+ return;
+ }
+ node.forEachChild(visit);
+ };
+ visit(parsed);
+ assert.ok(result, name);
+ return result;
+ };
+ const source = compile(read("headingConversion.ts") + "\n" + read("listConversion.ts") + "\n" +
+ extract("transaction.ts", "turnsIntoTransaction") + "\n" + extract("transaction.ts", "turnListBlocksInto") +
+ "\n" + extract("transaction.ts", "turnListsRecursively"));
+ const rangeSource = compile(extract("keydown.ts", "turnCrossBlockRangeInto"));
+ const parsed = createSourceFile("gutter.ts", read("../gutter/index.ts"), ScriptTarget.Latest, true);
+ const gutter = parsed.statements.find(isClassDeclaration);
+ const methods = gutter.members.filter(member => isMethodDeclaration(member) && ["headingTurnIntoMenu", "turnsInto"].includes(member.name.getText(parsed)));
+ const menuSource = compile("class Gutter {\n" + methods.map(member => member.getText(parsed)).join("\n") + "\n}");
+ const temporary = mkdtempSync(path.join(tmpdir(), "siyuan-list-conversion-"));
+ const script = path.join(temporary, "run.cjs");
+ const resultPath = path.join(temporary, "result.json");
+ const lutePath = path.resolve(__dirname, "../../../stage/protyle/js/lute/lute.min.js");
+ writeFileSync(script, `const {app, BrowserWindow} = require("electron");
+app.setPath("userData", ${JSON.stringify(path.join(temporary, "profile"))});
+app.commandLine.appendSwitch("disable-gpu");
+app.whenReady().then(async () => {
+ const win = new BrowserWindow({show: false, webPreferences: {nodeIntegration: true, contextIsolation: false, offscreen: true}});
+ try {
+ await win.loadURL("data:text/html,<html><body></body></html>");
+ await win.webContents.executeJavaScript(require("node:fs").readFileSync(${JSON.stringify(lutePath)}, "utf8"));
+ const result = await win.webContents.executeJavaScript(${JSON.stringify("(async () => { try { const __name = value => value; return {value: await (" + browserCases.toString() + ")(" + [source, menuSource, rangeSource].map(value => JSON.stringify(value)).join(",") + ")}; } catch (error) { return {error: error.stack}; } })()")} );
+ if (result.error) { throw new Error(result.error); }
+ require("node:fs").writeFileSync(${JSON.stringify(resultPath)}, JSON.stringify(result.value));
+ win.destroy(); app.exit(0);
+ } catch (error) { console.error(error); win.destroy(); app.exit(1); }
+});`, "utf8");
+ const env = {...process.env};
+ delete env.ELECTRON_RUN_AS_NODE;
+ try {
+ await promisify(execFile)(require("electron") as unknown as string, [script], {env, timeout: 55000, windowsHide: true});
+ const result = JSON.parse(readFileSync(resultPath, "utf8"));
+ assert.equal(result.message, "List conversion cases passed");
+ if (process.env.SIYUAN_UPDATE_LIST_CONVERSION_FIXTURE === "1") {
+ writeFileSync(path.resolve(__dirname, "../../../../kernel/model/testdata/list_conversion.json"), JSON.stringify(result.fixtures, null, 2) + "\n");
+ }
+ } finally {
+ if (path.dirname(path.resolve(temporary)) === path.resolve(tmpdir()) && path.basename(temporary).startsWith("siyuan-list-conversion-")) {
+ rmSync(temporary, {recursive: true, force: true});
+ }
+ }
+});
diff --git a/app/src/protyle/wysiwyg/listConversion.ts b/app/src/protyle/wysiwyg/listConversion.ts
new file mode 100644
index 0000000000..e2f2cbb915
--- /dev/null
+++ b/app/src/protyle/wysiwyg/listConversion.ts
@@ -0,0 +1,121 @@
+export const buildListConversionOperations = (source: Element, options: {
+ itemIDs: Set<string>,
+ parentID: string,
+ previousID?: string,
+ convert: (html: string) => string,
+ newID: () => string,
+}) => {
+ const list = source.cloneNode(true) as Element;
+ const container = document.createElement("div");
+ container.append(list);
+ const id = list.getAttribute("data-node-id");
+ const items = Array.from(list.children).filter(item => item.getAttribute("data-type") === "NodeListItem");
+ const selected = items.filter(item => options.itemIDs.has(item.getAttribute("data-node-id")));
+ const doOperations: IOperation[] = [];
+ const undoOperations: IOperation[] = [];
+ const undoUpdates: IOperation[] = [];
+ const restoreChildren = new Map<string, IOperation[]>();
+ const shells = new Map<string, string>();
+ const splitLists: Element[] = [];
+ let anchor = list;
+ let keptList: Element;
+ let hasKeptList = false;
+ let listMoved = false;
+ items.forEach(item => {
+ const itemID = item.getAttribute("data-node-id");
+ if (!options.itemIDs.has(itemID)) {
+ if (!keptList) {
+ if (!hasKeptList) {
+ keptList = list;
+ hasKeptList = true;
+ if (anchor !== list) {
+ doOperations.push({action: "move", id, previousID: anchor.getAttribute("data-node-id"),
+ parentID: options.parentID});
+ anchor.after(list);
+ listMoved = true;
+ }
+ } else {
+ // 拆分出的列表仅继承外观,不复制原列表的数据库或其他绑定属性。
+ keptList = document.createElement("div");
+ keptList.className = "list";
+ keptList.setAttribute("data-type", "NodeList");
+ keptList.setAttribute("data-subtype", list.getAttribute("data-subtype"));
+ keptList.setAttribute("data-node-id", options.newID());
+ if (list.hasAttribute("style")) {
+ keptList.setAttribute("style", list.getAttribute("style"));
+ }
+ const attr = document.createElement("div");
+ attr.className = "protyle-attr";
+ attr.setAttribute("contenteditable", "false");
+ keptList.append(attr);
+ doOperations.push({action: "insert", id: keptList.getAttribute("data-node-id"),
+ data: keptList.outerHTML, previousID: anchor.getAttribute("data-node-id"), parentID: options.parentID});
+ anchor.after(keptList);
+ splitLists.push(keptList);
+ }
+ anchor = keptList;
+ }
+ if (keptList !== list) {
+ const previous = Array.from(keptList.children).filter(child => child.hasAttribute("data-node-id")).pop();
+ doOperations.push({action: "move", id: itemID, parentID: keptList.getAttribute("data-node-id"),
+ previousID: previous?.getAttribute("data-node-id")});
+ keptList.lastElementChild.before(item);
+ }
+ return;
+ }
+ keptList = undefined;
+ const children = Array.from(item.children).filter(child => child.hasAttribute("data-node-id"));
+ let previousID: string;
+ const restore: IOperation[] = [];
+ children.forEach((child, index) => {
+ const childID = child.getAttribute("data-node-id");
+ doOperations.push({action: "move", id: childID, previousID: anchor.getAttribute("data-node-id"),
+ parentID: options.parentID});
+ restore.push({action: "move", id: childID, parentID: itemID, previousID});
+ previousID = childID;
+ anchor.after(child);
+ anchor = child;
+ if (index === 0) {
+ const oldHTML = child.outerHTML;
+ const html = options.convert(oldHTML);
+ undoUpdates.push({action: "update", id: childID, data: oldHTML});
+ doOperations.push({action: "update", id: childID, data: html});
+ const template = document.createElement("template");
+ template.innerHTML = html;
+ child.replaceWith(template.content);
+ anchor = container.querySelector(`[data-node-id="${childID}"]`);
+ }
+ });
+ restoreChildren.set(itemID, restore);
+ shells.set(itemID, item.outerHTML);
+ });
+ if (selected.length === items.length) {
+ doOperations.push({action: "delete", id});
+ undoOperations.push({action: "insert", id, data: list.outerHTML,
+ parentID: options.parentID, previousID: options.previousID});
+ items.forEach(item => undoOperations.push(...restoreChildren.get(item.getAttribute("data-node-id"))));
+ list.remove();
+ } else {
+ if (listMoved) {
+ undoOperations.push({action: "move", id, parentID: options.parentID, previousID: options.previousID});
+ }
+ let previousID: string;
+ items.forEach(item => {
+ const itemID = item.getAttribute("data-node-id");
+ if (options.itemIDs.has(itemID)) {
+ doOperations.push({action: "delete", id: itemID});
+ undoOperations.push({action: "insert", id: itemID, data: shells.get(itemID), parentID: id, previousID},
+ ...restoreChildren.get(itemID));
+ item.remove();
+ } else if (item.parentElement !== list) {
+ undoOperations.push({action: "move", id: itemID, parentID: id, previousID});
+ }
+ previousID = itemID;
+ });
+ // 内容已移动到位,更新列表起始编号;撤销时先归位列表项,再恢复原编号。
+ [list, ...splitLists].forEach(element => doOperations.push({action: "update",
+ id: element.getAttribute("data-node-id"), data: element.outerHTML}));
+ undoOperations.push({action: "update", id, data: source.outerHTML});
+ }
+ return {html: container.innerHTML, doOperations, undoOperations: undoOperations.concat(undoUpdates)};
+};
diff --git a/app/src/protyle/wysiwyg/transaction.ts b/app/src/protyle/wysiwyg/transaction.ts
index 25a4f864f7..0428ffffeb 100644
--- a/app/src/protyle/wysiwyg/transaction.ts
+++ b/app/src/protyle/wysiwyg/transaction.ts
@@ -78,6 +78,7 @@ import {getHeadingConversionElements, isListHeadingContainer} from "./headingCon
import {cleanTableCellRichHTML, retainTableCellRichMetadata} from "../util/tableCellRich";
import {cleanListMindmapHTML, convertListMindmapToList, listMindmapConversionSource} from "../render/listMindmap/model";
import {buildCancelListOperations} from "./cancelList";
+import {buildListConversionOperations} from "./listConversion";
import {getProtyleTransactionOwner} from "../runtimeCapabilities";
import {completeTabsListSource, convertTabsList, isTabsListConversion} from "./tabsList";
import {waitForPendingTransactions} from "../util/transactionQueue";
@@ -1845,9 +1846,8 @@ export const turnsIntoTransaction = (options: {
selectsElement = [options.nodeElement];
}
}
- const hasListHeadingTargets = options.type === "Blocks2Hs" && selectsElement.some(isListHeadingContainer);
- if (hasListHeadingTargets) {
- selectsElement = getHeadingConversionElements(selectsElement);
+ if (selectsElement.some(isListHeadingContainer)) {
+ return turnListBlocksInto(options, selectsElement);
}
if (selectsElement.length === 0 || options.nodeElement && selectsElement.some(item => item.classList.contains("li"))) {
return;
@@ -1862,7 +1862,7 @@ export const turnsIntoTransaction = (options: {
return true;
}
});
- if (!hasListHeadingTargets && selectsElement.length === 1 && options.type === "Blocks2Hs" &&
+ if (selectsElement.length === 1 && options.type === "Blocks2Hs" &&
selectsElement[0].getAttribute("data-type") === "NodeHeading" &&
options.level === parseInt(selectsElement[0].getAttribute("data-subtype").substr(1))) {
// 快捷键同级转换,消除标题
@@ -1874,9 +1874,6 @@ export const turnsIntoTransaction = (options: {
}
// https://github.com/siyuan-note/siyuan/issues/14505
options.protyle.observerLoad?.disconnect();
- if (hasListHeadingTargets) {
- hideElements(["select"], options.protyle);
- }
let html = "";
const doOperations: IOperation[] = [];
@@ -2077,10 +2074,108 @@ const unfoldListHeadings = async (protyle: IProtyle, nodeElements: Element[]) =>
return foldOperations.reverse();
};
+const turnListBlocksInto = async (options: {
+ protyle: IProtyle,
+ type: TTurnInto,
+ level?: number,
+ range?: Range,
+ unfocus?: boolean,
+ recursively?: boolean,
+}, elements: Element[]) => {
+ const protyle = options.protyle;
+ const selected = elements.filter(element => !elements.some(parent => parent !== element && parent.contains(element)));
+ const conversionElements = options.recursively ? selected.flatMap(element => [element,
+ ...Array.from(element.querySelectorAll('[data-type="NodeList"]')).filter(list =>
+ list.getAttribute("data-subtype") === element.getAttribute("data-subtype"))]).reverse() : selected;
+ const targets = getHeadingConversionElements(conversionElements);
+ if (targets.length === 0) {
+ return;
+ }
+ const lists = new Map<Element, Set<string>>();
+ conversionElements.filter(isListHeadingContainer).forEach(element => {
+ const list = element.getAttribute("data-type") === "NodeList" ? element : element.parentElement;
+ const itemIDs = lists.get(list) || new Set<string>();
+ const items = element === list ? Array.from(list.children) : [element];
+ items.forEach(item => {
+ const first = Array.from(item.children).find(child => child.hasAttribute("data-node-id"));
+ if (targets.includes(first)) {
+ itemIDs.add(item.getAttribute("data-node-id"));
+ }
+ });
+ if (itemIDs.size > 0) {
+ lists.set(list, itemIDs);
+ }
+ });
+ if (!options.unfocus && !targets[0].querySelector("wbr")) {
+ getContenteditableElement(targets[0])?.insertAdjacentHTML("afterbegin", "<wbr>");
+ }
+ const foldOperations = await unfoldListHeadings(protyle, Array.from(lists.keys()));
+ protyle.observerLoad?.disconnect();
+ hideElements(["select"], protyle);
+ const doOperations: IOperation[] = [];
+ const undoOperations: IOperation[] = [];
+ const convert = (html: string): string => {
+ // @ts-ignore Lute 声明尚未包含块类型转换方法。
+ return protyle.lute[options.type](html, options.level);
+ };
+ for (const [list, itemIDs] of lists) {
+ let previousID = getPreviousBlockSibling(list)?.getAttribute("data-node-id");
+ let parentID = getEmbedChildOperationParentID(list) || getParentBlock(list)?.getAttribute("data-node-id") ||
+ protyle.block.parentID || protyle.block.rootID;
+ if (!previousID && protyle.block.showAll) {
+ const response = await fetchSyncPost("/api/block/getBlockRelevantIDs", {
+ id: list.getAttribute("data-node-id"), notebook: protyle.notebookId,
+ });
+ if (response.code !== 0) {
+ throw new Error(response.msg);
+ }
+ previousID = response.data.previousID;
+ parentID = response.data.parentID || parentID;
+ }
+ const operations = buildListConversionOperations(list, {itemIDs, previousID, parentID, convert,
+ newID: () => Lute.NewNodeID()});
+ doOperations.push(...operations.doOperations);
+ undoOperations.unshift(...operations.undoOperations);
+ disposeCustomBlocksInElement(list);
+ list.insertAdjacentHTML("afterend", operations.html);
+ list.remove();
+ }
+ selected.filter(element => ["NodeHeading", "NodeParagraph"].includes(element.getAttribute("data-type"))).forEach(element => {
+ const id = element.getAttribute("data-node-id");
+ let html = convert(element.outerHTML);
+ let foldData;
+ if (element.getAttribute("data-type") === "NodeHeading" && element.getAttribute("fold") === "1" &&
+ (options.type === "Blocks2Ps" || element.getAttribute("data-subtype") !== `h${options.level}`)) {
+ foldData = setFold(protyle, element as HTMLElement, undefined, undefined, true);
+ html = html.replace(' fold="1"', "");
+ doOperations.push(...(foldData?.doOperations || []));
+ }
+ doOperations.push({action: "update", id, data: html});
+ undoOperations.push({action: "update", id, data: element.outerHTML});
+ undoOperations.push(...(foldData?.undoOperations || []));
+ disposeCustomBlocksInElement(element);
+ element.outerHTML = html;
+ });
+ transaction(protyle, doOperations.concat(foldOperations), undoOperations.concat(foldOperations.map(operation => ({...operation}))));
+ if (!hasViewFoldContext(protyle)) {
+ onTransaction(protyle, foldOperations, false, true);
+ }
+ blockRender(protyle, protyle.wysiwyg.element);
+ processRender(protyle.wysiwyg.element);
+ highlightRender(protyle.wysiwyg.element);
+ avRender(protyle.wysiwyg.element, protyle);
+ if (!options.unfocus) {
+ focusByWbr(protyle.wysiwyg.element, options.range || getEditorRange(protyle.wysiwyg.element));
+ }
+};
+
export const turnListsRecursively = async (options: {
protyle: IProtyle,
nodeElements: Element[],
} & TRecursiveListConversion) => {
+ if (options.type === "CancelListRecursively") {
+ return turnListBlocksInto({protyle: options.protyle, type: "Blocks2Ps", recursively: true}, options.nodeElements);
+ }
const listElements = options.nodeElements.filter((item, index, elements) => {
return item.getAttribute("data-type") === "NodeList" &&
!elements.some((parent, parentIndex) => parentIndex !== index &&
@@ -2097,71 +2192,30 @@ export const turnListsRecursively = async (options: {
nodeElement.removeAttribute("select-start");
nodeElement.removeAttribute("select-end");
});
- const contexts = await Promise.all(listElements.map(async (nodeElement) => {
- const previousBlockElement = getPreviousBlockSibling(nodeElement);
- let previousId = previousBlockElement?.getAttribute("data-node-id");
- if (!previousBlockElement && options.type === "CancelListRecursively" && options.protyle.block.showAll) {
- const response = await fetchSyncPost("/api/block/getBlockRelevantIDs", {
- id: nodeElement.getAttribute("data-node-id"),
- notebook: options.protyle.notebookId,
- });
- if (response.code !== 0) {
- throw new Error(response.msg);
- }
- previousId = response.data.previousID;
- }
- return {
- id: nodeElement.getAttribute("data-node-id"),
- nodeElement,
- parentId: getEmbedChildOperationParentID(nodeElement) ||
- getParentBlock(nodeElement).getAttribute("data-node-id") ||
- options.protyle.block.parentID ||
- options.protyle.block.rootID,
- previousId,
- };
- }));
const foldOperations = await unfoldListHeadings(options.protyle, listElements);
const doOperations: IOperation[] = [];
const undoOperations: IOperation[] = [];
- contexts.forEach((context) => {
- const nodeElement = context.nodeElement;
+ listElements.forEach((nodeElement) => {
const oldHTML = cleanHeadingNumberHTML(nodeElement.outerHTML);
- const newHTML = cleanHeadingNumberHTML(options.type === "ConvertListType" ?
- options.protyle.lute.ConvertListType(nodeElement.outerHTML, options.targetListType) :
- options.protyle.lute.CancelListRecursively(nodeElement.outerHTML));
- if (options.type === "ConvertListType") {
- if (newHTML === oldHTML) {
- return;
- }
- doOperations.push({
- action: "update",
- id: context.id,
- data: newHTML
- });
- undoOperations.push({
- action: "update",
- id: context.id,
- data: oldHTML
- });
- disposeCustomBlocksInElement(nodeElement);
- nodeElement.insertAdjacentHTML("afterend", newHTML);
- const newElement = nodeElement.nextElementSibling as HTMLElement;
- nodeElement.remove();
- newElement.setAttribute(Constants.ATTRIBUTE_EDITING, "true");
+ const newHTML = cleanHeadingNumberHTML(options.protyle.lute.ConvertListType(nodeElement.outerHTML, options.targetListType));
+ if (newHTML === oldHTML) {
return;
}
-
- const doPreviousId = getPreviousBlockSibling(nodeElement)?.getAttribute("data-node-id") || context.previousId;
- const operations = buildCancelListOperations(nodeElement, {
- previousID: doPreviousId,
- parentID: context.parentId,
- recursively: true,
+ doOperations.push({
+ action: "update",
+ id: nodeElement.getAttribute("data-node-id"),
+ data: newHTML
+ });
+ undoOperations.push({
+ action: "update",
+ id: nodeElement.getAttribute("data-node-id"),
+ data: oldHTML
});
- doOperations.push(...operations.doOperations);
- undoOperations.unshift(...operations.undoOperations);
disposeCustomBlocksInElement(nodeElement);
nodeElement.insertAdjacentHTML("afterend", newHTML);
+ const newElement = nodeElement.nextElementSibling as HTMLElement;
nodeElement.remove();
+ newElement.setAttribute(Constants.ATTRIBUTE_EDITING, "true");
});
const doFoldOperations = foldOperations.map((operation) => ({...operation}));
const undoFoldOperations = foldOperations.map((operation) => ({...operation}));
diff --git a/kernel/model/testdata/list_conversion.json b/kernel/model/testdata/list_conversion.json
new file mode 100644
index 0000000000..16d61b7abe
--- /dev/null
+++ b/kernel/model/testdata/list_conversion.json
@@ -0,0 +1,810 @@
+[
+ {
+ "before": "<div data-subtype=\"u\" data-node-id=\"20260925172757-a4mgsus\" data-node-index=\"1\" data-type=\"NodeList\" class=\"list\" updated=\"20260925172757\"><div data-marker=\"*\" data-subtype=\"u\" data-node-id=\"20260925172757-twvkeo8\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action\" draggable=\"true\"><svg><use xlink:href=\"#iconDot\"></use></svg></div><div data-subtype=\"h2\" data-node-id=\"20260925172757-w75hpfu\" data-node-index=\"1\" data-type=\"NodeHeading\" class=\"h2\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\"><span data-type=\"strong\">one</span></div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div><div data-node-id=\"20260925172757-ydb17er\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\"><div contenteditable=\"true\" spellcheck=\"false\">tail</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-subtype=\"u\" data-node-id=\"20260925172757-zz3a8wq\" data-type=\"NodeList\" class=\"list\" updated=\"20260925172757\"><div data-marker=\"*\" data-subtype=\"u\" data-node-id=\"20260925172757-zylozog\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action\" draggable=\"true\"><svg><use xlink:href=\"#iconDot\"></use></svg></div><div data-node-id=\"20260925172757-golm52v\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\"><div contenteditable=\"true\" spellcheck=\"false\">nested</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-marker=\"*\" data-subtype=\"u\" data-node-id=\"20260925172757-4bjb9ce\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action\" draggable=\"true\"><svg><use xlink:href=\"#iconDot\"></use></svg></div><div data-subtype=\"h2\" data-node-id=\"20260925172757-7aqxhrh\" data-node-index=\"1\" data-type=\"NodeHeading\" class=\"h2\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\">two</div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-marker=\"*\" data-subtype=\"u\" data-node-id=\"20260925172757-baa6hko\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action\" draggable=\"true\"><svg><use xlink:href=\"#iconDot\"></use></svg></div><div data-subtype=\"h2\" data-node-id=\"20260925172757-y12tkqk\" data-node-index=\"1\" data-type=\"NodeHeading\" class=\"h2\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\">three</div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div>",
+ "after": "<div data-node-id=\"20260925172757-w75hpfu\" data-node-index=\"1\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\"><span data-type=\"strong\">one</span></div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div><div data-node-id=\"20260925172757-ydb17er\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\"><div contenteditable=\"true\" spellcheck=\"false\">tail</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-subtype=\"u\" data-node-id=\"20260925172757-zz3a8wq\" data-type=\"NodeList\" class=\"list\" updated=\"20260925172757\"><div data-marker=\"*\" data-subtype=\"u\" data-node-id=\"20260925172757-zylozog\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action\" draggable=\"true\"><svg><use xlink:href=\"#iconDot\"></use></svg></div><div data-node-id=\"20260925172757-golm52v\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\"><div contenteditable=\"true\" spellcheck=\"false\">nested</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-node-id=\"20260925172757-7aqxhrh\" data-node-index=\"1\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\">two</div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div><div data-node-id=\"20260925172757-y12tkqk\" data-node-index=\"1\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\">three</div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div>",
+ "targetIDs": [
+ "20260925172757-w75hpfu",
+ "20260925172757-7aqxhrh",
+ "20260925172757-y12tkqk"
+ ],
+ "doOperations": [
+ {
+ "action": "move",
+ "id": "20260925172757-w75hpfu",
+ "previousID": "20260925172757-a4mgsus",
+ "parentID": "document"
+ },
+ {
+ "action": "update",
+ "id": "20260925172757-w75hpfu",
+ "data": "<div data-node-id=\"20260925172757-w75hpfu\" data-node-index=\"1\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\"><wbr><span data-type=\"strong\">one</span></div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div>"
+ },
+ {
+ "action": "move",
+ "id": "20260925172757-ydb17er",
+ "previousID": "20260925172757-w75hpfu",
+ "parentID": "document"
+ },
+ {
+ "action": "move",
+ "id": "20260925172757-zz3a8wq",
+ "previousID": "20260925172757-ydb17er",
+ "parentID": "document"
+ },
+ {
+ "action": "move",
+ "id": "20260925172757-7aqxhrh",
+ "previousID": "20260925172757-zz3a8wq",
+ "parentID": "document"
+ },
+ {
+ "action": "update",
+ "id": "20260925172757-7aqxhrh",
+ "data": "<div data-node-id=\"20260925172757-7aqxhrh\" data-node-index=\"1\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\">two</div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div>"
+ },
+ {
+ "action": "move",
+ "id": "20260925172757-y12tkqk",
+ "previousID": "20260925172757-7aqxhrh",
+ "parentID": "document"
+ },
+ {
+ "action": "update",
+ "id": "20260925172757-y12tkqk",
+ "data": "<div data-node-id=\"20260925172757-y12tkqk\" data-node-index=\"1\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\">three</div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div>"
+ },
+ {
+ "action": "delete",
+ "id": "20260925172757-a4mgsus"
+ }
+ ],
+ "undoOperations": [
+ {
+ "action": "insert",
+ "id": "20260925172757-a4mgsus",
+ "data": "<div data-subtype=\"u\" data-node-id=\"20260925172757-a4mgsus\" data-node-index=\"1\" data-type=\"NodeList\" class=\"list\" updated=\"20260925172757\"><div data-marker=\"*\" data-subtype=\"u\" data-node-id=\"20260925172757-twvkeo8\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action\" draggable=\"true\"><svg><use xlink:href=\"#iconDot\"></use></svg></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-marker=\"*\" data-subtype=\"u\" data-node-id=\"20260925172757-4bjb9ce\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action\" draggable=\"true\"><svg><use xlink:href=\"#iconDot\"></use></svg></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-marker=\"*\" data-subtype=\"u\" data-node-id=\"20260925172757-baa6hko\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action\" draggable=\"true\"><svg><use xlink:href=\"#iconDot\"></use></svg></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div>",
+ "parentID": "document"
+ },
+ {
+ "action": "move",
+ "id": "20260925172757-w75hpfu",
+ "parentID": "20260925172757-twvkeo8"
+ },
+ {
+ "action": "move",
+ "id": "20260925172757-ydb17er",
+ "parentID": "20260925172757-twvkeo8",
+ "previousID": "20260925172757-w75hpfu"
+ },
+ {
+ "action": "move",
+ "id": "20260925172757-zz3a8wq",
+ "parentID": "20260925172757-twvkeo8",
+ "previousID": "20260925172757-ydb17er"
+ },
+ {
+ "action": "move",
+ "id": "20260925172757-7aqxhrh",
+ "parentID": "20260925172757-4bjb9ce"
+ },
+ {
+ "action": "move",
+ "id": "20260925172757-y12tkqk",
+ "parentID": "20260925172757-baa6hko"
+ },
+ {
+ "action": "update",
+ "id": "20260925172757-w75hpfu",
+ "data": "<div data-subtype=\"h2\" data-node-id=\"20260925172757-w75hpfu\" data-node-index=\"1\" data-type=\"NodeHeading\" class=\"h2\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\"><wbr><span data-type=\"strong\">one</span></div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div>"
+ },
+ {
+ "action": "update",
+ "id": "20260925172757-7aqxhrh",
+ "data": "<div data-subtype=\"h2\" data-node-id=\"20260925172757-7aqxhrh\" data-node-index=\"1\" data-type=\"NodeHeading\" class=\"h2\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\">two</div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div>"
+ },
+ {
+ "action": "update",
+ "id": "20260925172757-y12tkqk",
+ "data": "<div data-subtype=\"h2\" data-node-id=\"20260925172757-y12tkqk\" data-node-index=\"1\" data-type=\"NodeHeading\" class=\"h2\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\">three</div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div>"
+ }
+ ]
+ },
+ {
+ "before": "<div data-subtype=\"u\" data-node-id=\"20260925172757-0p3uew6\" data-node-index=\"1\" data-type=\"NodeList\" class=\"list\" updated=\"20260925172757\"><div data-marker=\"*\" data-subtype=\"u\" data-node-id=\"20260925172757-ida3ghz\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action\" draggable=\"true\"><svg><use xlink:href=\"#iconDot\"></use></svg></div><div data-node-id=\"20260925172757-yv0xk35\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\"><span data-type=\"strong\">one</span></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-node-id=\"20260925172757-orciip2\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\"><div contenteditable=\"true\" spellcheck=\"false\">tail</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-subtype=\"u\" data-node-id=\"20260925172757-lz3hsbm\" data-type=\"NodeList\" class=\"list\" updated=\"20260925172757\"><div data-marker=\"*\" data-subtype=\"u\" data-node-id=\"20260925172757-4jgq9lr\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action\" draggable=\"true\"><svg><use xlink:href=\"#iconDot\"></use></svg></div><div data-node-id=\"20260925172757-gu7zwkw\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\"><div contenteditable=\"true\" spellcheck=\"false\">nested</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-marker=\"*\" data-subtype=\"u\" data-node-id=\"20260925172757-bae98fl\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action\" draggable=\"true\"><svg><use xlink:href=\"#iconDot\"></use></svg></div><div data-node-id=\"20260925172757-ei4topo\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\">two</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-marker=\"*\" data-subtype=\"u\" data-node-id=\"20260925172757-horiboh\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action\" draggable=\"true\"><svg><use xlink:href=\"#iconDot\"></use></svg></div><div data-node-id=\"20260925172757-33bk3ke\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\">three</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div>",
+ "after": "<div data-subtype=\"h3\" data-node-id=\"20260925172757-yv0xk35\" data-node-index=\"1\" data-type=\"NodeHeading\" class=\"h3\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\"><span data-type=\"strong\">one</span></div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div><div data-node-id=\"20260925172757-orciip2\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\"><div contenteditable=\"true\" spellcheck=\"false\">tail</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-subtype=\"u\" data-node-id=\"20260925172757-lz3hsbm\" data-type=\"NodeList\" class=\"list\" updated=\"20260925172757\"><div data-marker=\"*\" data-subtype=\"u\" data-node-id=\"20260925172757-4jgq9lr\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action\" draggable=\"true\"><svg><use xlink:href=\"#iconDot\"></use></svg></div><div data-node-id=\"20260925172757-gu7zwkw\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\"><div contenteditable=\"true\" spellcheck=\"false\">nested</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-subtype=\"h3\" data-node-id=\"20260925172757-ei4topo\" data-node-index=\"1\" data-type=\"NodeHeading\" class=\"h3\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\">two</div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div><div data-subtype=\"h3\" data-node-id=\"20260925172757-33bk3ke\" data-node-index=\"1\" data-type=\"NodeHeading\" class=\"h3\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\">three</div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div>",
+ "targetIDs": [
+ "20260925172757-yv0xk35",
+ "20260925172757-ei4topo",
+ "20260925172757-33bk3ke"
+ ],
+ "doOperations": [
+ {
+ "action": "move",
+ "id": "20260925172757-yv0xk35",
+ "previousID": "20260925172757-0p3uew6",
+ "parentID": "document"
+ },
+ {
+ "action": "update",
+ "id": "20260925172757-yv0xk35",
+ "data": "<div data-subtype=\"h3\" data-node-id=\"20260925172757-yv0xk35\" data-node-index=\"1\" data-type=\"NodeHeading\" class=\"h3\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\"><wbr><span data-type=\"strong\">one</span></div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div>"
+ },
+ {
+ "action": "move",
+ "id": "20260925172757-orciip2",
+ "previousID": "20260925172757-yv0xk35",
+ "parentID": "document"
+ },
+ {
+ "action": "move",
+ "id": "20260925172757-lz3hsbm",
+ "previousID": "20260925172757-orciip2",
+ "parentID": "document"
+ },
+ {
+ "action": "move",
+ "id": "20260925172757-ei4topo",
+ "previousID": "20260925172757-lz3hsbm",
+ "parentID": "document"
+ },
+ {
+ "action": "update",
+ "id": "20260925172757-ei4topo",
+ "data": "<div data-subtype=\"h3\" data-node-id=\"20260925172757-ei4topo\" data-node-index=\"1\" data-type=\"NodeHeading\" class=\"h3\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\">two</div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div>"
+ },
+ {
+ "action": "move",
+ "id": "20260925172757-33bk3ke",
+ "previousID": "20260925172757-ei4topo",
+ "parentID": "document"
+ },
+ {
+ "action": "update",
+ "id": "20260925172757-33bk3ke",
+ "data": "<div data-subtype=\"h3\" data-node-id=\"20260925172757-33bk3ke\" data-node-index=\"1\" data-type=\"NodeHeading\" class=\"h3\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\">three</div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div>"
+ },
+ {
+ "action": "delete",
+ "id": "20260925172757-0p3uew6"
+ }
+ ],
+ "undoOperations": [
+ {
+ "action": "insert",
+ "id": "20260925172757-0p3uew6",
+ "data": "<div data-subtype=\"u\" data-node-id=\"20260925172757-0p3uew6\" data-node-index=\"1\" data-type=\"NodeList\" class=\"list\" updated=\"20260925172757\"><div data-marker=\"*\" data-subtype=\"u\" data-node-id=\"20260925172757-ida3ghz\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action\" draggable=\"true\"><svg><use xlink:href=\"#iconDot\"></use></svg></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-marker=\"*\" data-subtype=\"u\" data-node-id=\"20260925172757-bae98fl\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action\" draggable=\"true\"><svg><use xlink:href=\"#iconDot\"></use></svg></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-marker=\"*\" data-subtype=\"u\" data-node-id=\"20260925172757-horiboh\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action\" draggable=\"true\"><svg><use xlink:href=\"#iconDot\"></use></svg></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div>",
+ "parentID": "document"
+ },
+ {
+ "action": "move",
+ "id": "20260925172757-yv0xk35",
+ "parentID": "20260925172757-ida3ghz"
+ },
+ {
+ "action": "move",
+ "id": "20260925172757-orciip2",
+ "parentID": "20260925172757-ida3ghz",
+ "previousID": "20260925172757-yv0xk35"
+ },
+ {
+ "action": "move",
+ "id": "20260925172757-lz3hsbm",
+ "parentID": "20260925172757-ida3ghz",
+ "previousID": "20260925172757-orciip2"
+ },
+ {
+ "action": "move",
+ "id": "20260925172757-ei4topo",
+ "parentID": "20260925172757-bae98fl"
+ },
+ {
+ "action": "move",
+ "id": "20260925172757-33bk3ke",
+ "parentID": "20260925172757-horiboh"
+ },
+ {
+ "action": "update",
+ "id": "20260925172757-yv0xk35",
+ "data": "<div data-node-id=\"20260925172757-yv0xk35\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\"><wbr><span data-type=\"strong\">one</span></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div>"
+ },
+ {
+ "action": "update",
+ "id": "20260925172757-ei4topo",
+ "data": "<div data-node-id=\"20260925172757-ei4topo\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\">two</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div>"
+ },
+ {
+ "action": "update",
+ "id": "20260925172757-33bk3ke",
+ "data": "<div data-node-id=\"20260925172757-33bk3ke\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\">three</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div>"
+ }
+ ]
+ },
+ {
+ "before": "<div data-subtype=\"o\" data-node-id=\"20260925172757-xx79gw3\" data-node-index=\"1\" data-type=\"NodeList\" class=\"list\" updated=\"20260925172757\"><div data-marker=\"3.\" data-subtype=\"o\" data-node-id=\"20260925172757-pzbzakb\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action protyle-action--order\" contenteditable=\"false\" draggable=\"true\">3.</div><div data-subtype=\"h2\" data-node-id=\"20260925172757-v74wprz\" data-node-index=\"1\" data-type=\"NodeHeading\" class=\"h2\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\"><span data-type=\"strong\">one</span></div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div><div data-node-id=\"20260925172757-3vti36t\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\"><div contenteditable=\"true\" spellcheck=\"false\">tail</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-subtype=\"u\" data-node-id=\"20260925172757-p43ju3d\" data-type=\"NodeList\" class=\"list\" updated=\"20260925172757\"><div data-marker=\"*\" data-subtype=\"u\" data-node-id=\"20260925172757-bxc1gnc\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action\" draggable=\"true\"><svg><use xlink:href=\"#iconDot\"></use></svg></div><div data-node-id=\"20260925172757-flr83ft\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\"><div contenteditable=\"true\" spellcheck=\"false\">nested</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-marker=\"4.\" data-subtype=\"o\" data-node-id=\"20260925172757-3erxfbp\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action protyle-action--order\" contenteditable=\"false\" draggable=\"true\">4.</div><div data-subtype=\"h2\" data-node-id=\"20260925172757-rep6r0n\" data-node-index=\"1\" data-type=\"NodeHeading\" class=\"h2\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\">two</div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-marker=\"5.\" data-subtype=\"o\" data-node-id=\"20260925172757-llbayom\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action protyle-action--order\" contenteditable=\"false\" draggable=\"true\">5.</div><div data-subtype=\"h2\" data-node-id=\"20260925172757-2201bn4\" data-node-index=\"1\" data-type=\"NodeHeading\" class=\"h2\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\">three</div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div>",
+ "after": "<div data-subtype=\"o\" data-node-id=\"20260925172757-xx79gw3\" data-node-index=\"1\" data-type=\"NodeList\" class=\"list\" updated=\"20260925172757\"><div data-marker=\"3.\" data-subtype=\"o\" data-node-id=\"20260925172757-pzbzakb\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action protyle-action--order\" contenteditable=\"false\" draggable=\"true\">3.</div><div data-subtype=\"h2\" data-node-id=\"20260925172757-v74wprz\" data-node-index=\"1\" data-type=\"NodeHeading\" class=\"h2\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\"><span data-type=\"strong\">one</span></div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div><div data-node-id=\"20260925172757-3vti36t\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\"><div contenteditable=\"true\" spellcheck=\"false\">tail</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-subtype=\"u\" data-node-id=\"20260925172757-p43ju3d\" data-type=\"NodeList\" class=\"list\" updated=\"20260925172757\"><div data-marker=\"*\" data-subtype=\"u\" data-node-id=\"20260925172757-bxc1gnc\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action\" draggable=\"true\"><svg><use xlink:href=\"#iconDot\"></use></svg></div><div data-node-id=\"20260925172757-flr83ft\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\"><div contenteditable=\"true\" spellcheck=\"false\">nested</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-node-id=\"20260925172757-rep6r0n\" data-node-index=\"1\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\">two</div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div><div class=\"list\" data-type=\"NodeList\" data-subtype=\"o\" data-node-id=\"20260925172757-ae1qzpg\"><div data-marker=\"5.\" data-subtype=\"o\" data-node-id=\"20260925172757-llbayom\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action protyle-action--order\" contenteditable=\"false\" draggable=\"true\">5.</div><div data-subtype=\"h2\" data-node-id=\"20260925172757-2201bn4\" data-node-index=\"1\" data-type=\"NodeHeading\" class=\"h2\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\">three</div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\"></div></div>",
+ "targetIDs": [
+ "20260925172757-v74wprz",
+ "20260925172757-rep6r0n",
+ "20260925172757-2201bn4"
+ ],
+ "doOperations": [
+ {
+ "action": "move",
+ "id": "20260925172757-rep6r0n",
+ "previousID": "20260925172757-xx79gw3",
+ "parentID": "document"
+ },
+ {
+ "action": "update",
+ "id": "20260925172757-rep6r0n",
+ "data": "<div data-node-id=\"20260925172757-rep6r0n\" data-node-index=\"1\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\"><wbr>two</div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div>"
+ },
+ {
+ "action": "insert",
+ "id": "20260925172757-ae1qzpg",
+ "data": "<div class=\"list\" data-type=\"NodeList\" data-subtype=\"o\" data-node-id=\"20260925172757-ae1qzpg\"><div class=\"protyle-attr\" contenteditable=\"false\"></div></div>",
+ "previousID": "20260925172757-rep6r0n",
+ "parentID": "document"
+ },
+ {
+ "action": "move",
+ "id": "20260925172757-llbayom",
+ "parentID": "20260925172757-ae1qzpg"
+ },
+ {
+ "action": "delete",
+ "id": "20260925172757-3erxfbp"
+ },
+ {
+ "action": "update",
+ "id": "20260925172757-xx79gw3",
+ "data": "<div data-subtype=\"o\" data-node-id=\"20260925172757-xx79gw3\" data-node-index=\"1\" data-type=\"NodeList\" class=\"list\" updated=\"20260925172757\"><div data-marker=\"3.\" data-subtype=\"o\" data-node-id=\"20260925172757-pzbzakb\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action protyle-action--order\" contenteditable=\"false\" draggable=\"true\">3.</div><div data-subtype=\"h2\" data-node-id=\"20260925172757-v74wprz\" data-node-index=\"1\" data-type=\"NodeHeading\" class=\"h2\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\"><span data-type=\"strong\">one</span></div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div><div data-node-id=\"20260925172757-3vti36t\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\"><div contenteditable=\"true\" spellcheck=\"false\">tail</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-subtype=\"u\" data-node-id=\"20260925172757-p43ju3d\" data-type=\"NodeList\" class=\"list\" updated=\"20260925172757\"><div data-marker=\"*\" data-subtype=\"u\" data-node-id=\"20260925172757-bxc1gnc\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action\" draggable=\"true\"><svg><use xlink:href=\"#iconDot\"></use></svg></div><div data-node-id=\"20260925172757-flr83ft\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\"><div contenteditable=\"true\" spellcheck=\"false\">nested</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div>"
+ },
+ {
+ "action": "update",
+ "id": "20260925172757-ae1qzpg",
+ "data": "<div class=\"list\" data-type=\"NodeList\" data-subtype=\"o\" data-node-id=\"20260925172757-ae1qzpg\"><div data-marker=\"5.\" data-subtype=\"o\" data-node-id=\"20260925172757-llbayom\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action protyle-action--order\" contenteditable=\"false\" draggable=\"true\">5.</div><div data-subtype=\"h2\" data-node-id=\"20260925172757-2201bn4\" data-node-index=\"1\" data-type=\"NodeHeading\" class=\"h2\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\">three</div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\"></div></div>"
+ }
+ ],
+ "undoOperations": [
+ {
+ "action": "insert",
+ "id": "20260925172757-3erxfbp",
+ "data": "<div data-marker=\"4.\" data-subtype=\"o\" data-node-id=\"20260925172757-3erxfbp\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action protyle-action--order\" contenteditable=\"false\" draggable=\"true\">4.</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div>",
+ "parentID": "20260925172757-xx79gw3",
+ "previousID": "20260925172757-pzbzakb"
+ },
+ {
+ "action": "move",
+ "id": "20260925172757-rep6r0n",
+ "parentID": "20260925172757-3erxfbp"
+ },
+ {
+ "action": "move",
+ "id": "20260925172757-llbayom",
+ "parentID": "20260925172757-xx79gw3",
+ "previousID": "20260925172757-3erxfbp"
+ },
+ {
+ "action": "update",
+ "id": "20260925172757-xx79gw3",
+ "data": "<div data-subtype=\"o\" data-node-id=\"20260925172757-xx79gw3\" data-node-index=\"1\" data-type=\"NodeList\" class=\"list\" updated=\"20260925172757\"><div data-marker=\"3.\" data-subtype=\"o\" data-node-id=\"20260925172757-pzbzakb\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action protyle-action--order\" contenteditable=\"false\" draggable=\"true\">3.</div><div data-subtype=\"h2\" data-node-id=\"20260925172757-v74wprz\" data-node-index=\"1\" data-type=\"NodeHeading\" class=\"h2\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\"><span data-type=\"strong\">one</span></div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div><div data-node-id=\"20260925172757-3vti36t\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\"><div contenteditable=\"true\" spellcheck=\"false\">tail</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-subtype=\"u\" data-node-id=\"20260925172757-p43ju3d\" data-type=\"NodeList\" class=\"list\" updated=\"20260925172757\"><div data-marker=\"*\" data-subtype=\"u\" data-node-id=\"20260925172757-bxc1gnc\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action\" draggable=\"true\"><svg><use xlink:href=\"#iconDot\"></use></svg></div><div data-node-id=\"20260925172757-flr83ft\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\"><div contenteditable=\"true\" spellcheck=\"false\">nested</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-marker=\"4.\" data-subtype=\"o\" data-node-id=\"20260925172757-3erxfbp\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action protyle-action--order\" contenteditable=\"false\" draggable=\"true\">4.</div><div data-subtype=\"h2\" data-node-id=\"20260925172757-rep6r0n\" data-node-index=\"1\" data-type=\"NodeHeading\" class=\"h2\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\"><wbr>two</div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-marker=\"5.\" data-subtype=\"o\" data-node-id=\"20260925172757-llbayom\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action protyle-action--order\" contenteditable=\"false\" draggable=\"true\">5.</div><div data-subtype=\"h2\" data-node-id=\"20260925172757-2201bn4\" data-node-index=\"1\" data-type=\"NodeHeading\" class=\"h2\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\">three</div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div>"
+ },
+ {
+ "action": "update",
+ "id": "20260925172757-rep6r0n",
+ "data": "<div data-subtype=\"h2\" data-node-id=\"20260925172757-rep6r0n\" data-node-index=\"1\" data-type=\"NodeHeading\" class=\"h2\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\"><wbr>two</div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div>"
+ }
+ ]
+ },
+ {
+ "before": "<div data-subtype=\"o\" data-node-id=\"20260925172757-0n2tjkz\" data-node-index=\"1\" data-type=\"NodeList\" class=\"list\" updated=\"20260925172757\"><div data-marker=\"3.\" data-subtype=\"o\" data-node-id=\"20260925172757-pu8jvvl\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action protyle-action--order\" contenteditable=\"false\" draggable=\"true\">3.</div><div data-node-id=\"20260925172757-hkusgvs\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\"><span data-type=\"strong\">one</span></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-node-id=\"20260925172757-tcb5ogj\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\"><div contenteditable=\"true\" spellcheck=\"false\">tail</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-subtype=\"u\" data-node-id=\"20260925172757-ikshd59\" data-type=\"NodeList\" class=\"list\" updated=\"20260925172757\"><div data-marker=\"*\" data-subtype=\"u\" data-node-id=\"20260925172757-ni0o6xo\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action\" draggable=\"true\"><svg><use xlink:href=\"#iconDot\"></use></svg></div><div data-node-id=\"20260925172757-po2xqpd\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\"><div contenteditable=\"true\" spellcheck=\"false\">nested</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-marker=\"4.\" data-subtype=\"o\" data-node-id=\"20260925172757-gwc8wf0\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action protyle-action--order\" contenteditable=\"false\" draggable=\"true\">4.</div><div data-node-id=\"20260925172757-eex1mc6\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\">two</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-marker=\"5.\" data-subtype=\"o\" data-node-id=\"20260925172757-3m2xp8o\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action protyle-action--order\" contenteditable=\"false\" draggable=\"true\">5.</div><div data-node-id=\"20260925172757-p6kigs5\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\">three</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div>",
+ "after": "<div data-subtype=\"o\" data-node-id=\"20260925172757-0n2tjkz\" data-node-index=\"1\" data-type=\"NodeList\" class=\"list\" updated=\"20260925172757\"><div data-marker=\"3.\" data-subtype=\"o\" data-node-id=\"20260925172757-pu8jvvl\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action protyle-action--order\" contenteditable=\"false\" draggable=\"true\">3.</div><div data-node-id=\"20260925172757-hkusgvs\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\"><span data-type=\"strong\">one</span></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-node-id=\"20260925172757-tcb5ogj\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\"><div contenteditable=\"true\" spellcheck=\"false\">tail</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-subtype=\"u\" data-node-id=\"20260925172757-ikshd59\" data-type=\"NodeList\" class=\"list\" updated=\"20260925172757\"><div data-marker=\"*\" data-subtype=\"u\" data-node-id=\"20260925172757-ni0o6xo\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action\" draggable=\"true\"><svg><use xlink:href=\"#iconDot\"></use></svg></div><div data-node-id=\"20260925172757-po2xqpd\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\"><div contenteditable=\"true\" spellcheck=\"false\">nested</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-subtype=\"h3\" data-node-id=\"20260925172757-eex1mc6\" data-node-index=\"1\" data-type=\"NodeHeading\" class=\"h3\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\">two</div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div><div class=\"list\" data-type=\"NodeList\" data-subtype=\"o\" data-node-id=\"20260925172757-fof4jba\"><div data-marker=\"5.\" data-subtype=\"o\" data-node-id=\"20260925172757-3m2xp8o\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action protyle-action--order\" contenteditable=\"false\" draggable=\"true\">5.</div><div data-node-id=\"20260925172757-p6kigs5\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\">three</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\"></div></div>",
+ "targetIDs": [
+ "20260925172757-hkusgvs",
+ "20260925172757-eex1mc6",
+ "20260925172757-p6kigs5"
+ ],
+ "doOperations": [
+ {
+ "action": "move",
+ "id": "20260925172757-eex1mc6",
+ "previousID": "20260925172757-0n2tjkz",
+ "parentID": "document"
+ },
+ {
+ "action": "update",
+ "id": "20260925172757-eex1mc6",
+ "data": "<div data-subtype=\"h3\" data-node-id=\"20260925172757-eex1mc6\" data-node-index=\"1\" data-type=\"NodeHeading\" class=\"h3\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\"><wbr>two</div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div>"
+ },
+ {
+ "action": "insert",
+ "id": "20260925172757-fof4jba",
+ "data": "<div class=\"list\" data-type=\"NodeList\" data-subtype=\"o\" data-node-id=\"20260925172757-fof4jba\"><div class=\"protyle-attr\" contenteditable=\"false\"></div></div>",
+ "previousID": "20260925172757-eex1mc6",
+ "parentID": "document"
+ },
+ {
+ "action": "move",
+ "id": "20260925172757-3m2xp8o",
+ "parentID": "20260925172757-fof4jba"
+ },
+ {
+ "action": "delete",
+ "id": "20260925172757-gwc8wf0"
+ },
+ {
+ "action": "update",
+ "id": "20260925172757-0n2tjkz",
+ "data": "<div data-subtype=\"o\" data-node-id=\"20260925172757-0n2tjkz\" data-node-index=\"1\" data-type=\"NodeList\" class=\"list\" updated=\"20260925172757\"><div data-marker=\"3.\" data-subtype=\"o\" data-node-id=\"20260925172757-pu8jvvl\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action protyle-action--order\" contenteditable=\"false\" draggable=\"true\">3.</div><div data-node-id=\"20260925172757-hkusgvs\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\"><span data-type=\"strong\">one</span></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-node-id=\"20260925172757-tcb5ogj\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\"><div contenteditable=\"true\" spellcheck=\"false\">tail</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-subtype=\"u\" data-node-id=\"20260925172757-ikshd59\" data-type=\"NodeList\" class=\"list\" updated=\"20260925172757\"><div data-marker=\"*\" data-subtype=\"u\" data-node-id=\"20260925172757-ni0o6xo\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action\" draggable=\"true\"><svg><use xlink:href=\"#iconDot\"></use></svg></div><div data-node-id=\"20260925172757-po2xqpd\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\"><div contenteditable=\"true\" spellcheck=\"false\">nested</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div>"
+ },
+ {
+ "action": "update",
+ "id": "20260925172757-fof4jba",
+ "data": "<div class=\"list\" data-type=\"NodeList\" data-subtype=\"o\" data-node-id=\"20260925172757-fof4jba\"><div data-marker=\"5.\" data-subtype=\"o\" data-node-id=\"20260925172757-3m2xp8o\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action protyle-action--order\" contenteditable=\"false\" draggable=\"true\">5.</div><div data-node-id=\"20260925172757-p6kigs5\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\">three</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\"></div></div>"
+ }
+ ],
+ "undoOperations": [
+ {
+ "action": "insert",
+ "id": "20260925172757-gwc8wf0",
+ "data": "<div data-marker=\"4.\" data-subtype=\"o\" data-node-id=\"20260925172757-gwc8wf0\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action protyle-action--order\" contenteditable=\"false\" draggable=\"true\">4.</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div>",
+ "parentID": "20260925172757-0n2tjkz",
+ "previousID": "20260925172757-pu8jvvl"
+ },
+ {
+ "action": "move",
+ "id": "20260925172757-eex1mc6",
+ "parentID": "20260925172757-gwc8wf0"
+ },
+ {
+ "action": "move",
+ "id": "20260925172757-3m2xp8o",
+ "parentID": "20260925172757-0n2tjkz",
+ "previousID": "20260925172757-gwc8wf0"
+ },
+ {
+ "action": "update",
+ "id": "20260925172757-0n2tjkz",
+ "data": "<div data-subtype=\"o\" data-node-id=\"20260925172757-0n2tjkz\" data-node-index=\"1\" data-type=\"NodeList\" class=\"list\" updated=\"20260925172757\"><div data-marker=\"3.\" data-subtype=\"o\" data-node-id=\"20260925172757-pu8jvvl\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action protyle-action--order\" contenteditable=\"false\" draggable=\"true\">3.</div><div data-node-id=\"20260925172757-hkusgvs\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\"><span data-type=\"strong\">one</span></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-node-id=\"20260925172757-tcb5ogj\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\"><div contenteditable=\"true\" spellcheck=\"false\">tail</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-subtype=\"u\" data-node-id=\"20260925172757-ikshd59\" data-type=\"NodeList\" class=\"list\" updated=\"20260925172757\"><div data-marker=\"*\" data-subtype=\"u\" data-node-id=\"20260925172757-ni0o6xo\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action\" draggable=\"true\"><svg><use xlink:href=\"#iconDot\"></use></svg></div><div data-node-id=\"20260925172757-po2xqpd\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\"><div contenteditable=\"true\" spellcheck=\"false\">nested</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-marker=\"4.\" data-subtype=\"o\" data-node-id=\"20260925172757-gwc8wf0\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action protyle-action--order\" contenteditable=\"false\" draggable=\"true\">4.</div><div data-node-id=\"20260925172757-eex1mc6\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\"><wbr>two</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-marker=\"5.\" data-subtype=\"o\" data-node-id=\"20260925172757-3m2xp8o\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action protyle-action--order\" contenteditable=\"false\" draggable=\"true\">5.</div><div data-node-id=\"20260925172757-p6kigs5\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\">three</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div>"
+ },
+ {
+ "action": "update",
+ "id": "20260925172757-eex1mc6",
+ "data": "<div data-node-id=\"20260925172757-eex1mc6\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\"><wbr>two</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div>"
+ }
+ ]
+ },
+ {
+ "before": "<div data-subtype=\"t\" data-node-id=\"20260925172757-k5w6a1x\" data-node-index=\"1\" data-type=\"NodeList\" class=\"list\" updated=\"20260925172757\"><div data-marker=\"*\" data-subtype=\"t\" data-task=\"X\" data-node-id=\"20260925172757-h4irlle\" data-type=\"NodeListItem\" class=\"li protyle-task--done\" updated=\"20260925172757\"><div class=\"protyle-action protyle-action--task\" draggable=\"true\"><svg><use xlink:href=\"#iconCheck\"></use></svg></div><div data-subtype=\"h2\" data-node-id=\"20260925172757-t5orf3q\" data-node-index=\"1\" data-type=\"NodeHeading\" class=\"h2\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\"><span data-type=\"strong\">one</span></div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div><div data-node-id=\"20260925172757-h4xn92d\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\"><div contenteditable=\"true\" spellcheck=\"false\">tail</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-subtype=\"u\" data-node-id=\"20260925172757-2l2jdgf\" data-type=\"NodeList\" class=\"list\" updated=\"20260925172757\"><div data-marker=\"*\" data-subtype=\"u\" data-node-id=\"20260925172757-ca4hoxo\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action\" draggable=\"true\"><svg><use xlink:href=\"#iconDot\"></use></svg></div><div data-node-id=\"20260925172757-rkb2iv5\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\"><div contenteditable=\"true\" spellcheck=\"false\">nested</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-marker=\"*\" data-subtype=\"t\" data-task=\"X\" data-node-id=\"20260925172757-o6p79dk\" data-type=\"NodeListItem\" class=\"li protyle-task--done\" updated=\"20260925172757\"><div class=\"protyle-action protyle-action--task\" draggable=\"true\"><svg><use xlink:href=\"#iconCheck\"></use></svg></div><div data-subtype=\"h2\" data-node-id=\"20260925172757-tlr3jg4\" data-node-index=\"1\" data-type=\"NodeHeading\" class=\"h2\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\">two</div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-marker=\"*\" data-subtype=\"t\" data-task=\"X\" data-node-id=\"20260925172757-n23xpjs\" data-type=\"NodeListItem\" class=\"li protyle-task--done\" updated=\"20260925172757\"><div class=\"protyle-action protyle-action--task\" draggable=\"true\"><svg><use xlink:href=\"#iconCheck\"></use></svg></div><div data-subtype=\"h2\" data-node-id=\"20260925172757-6q49tg5\" data-node-index=\"1\" data-type=\"NodeHeading\" class=\"h2\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\">three</div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div>",
+ "after": "<div data-node-id=\"20260925172757-t5orf3q\" data-node-index=\"1\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\"><span data-type=\"strong\">one</span></div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div><div data-node-id=\"20260925172757-h4xn92d\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\"><div contenteditable=\"true\" spellcheck=\"false\">tail</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-subtype=\"u\" data-node-id=\"20260925172757-2l2jdgf\" data-type=\"NodeList\" class=\"list\" updated=\"20260925172757\"><div data-marker=\"*\" data-subtype=\"u\" data-node-id=\"20260925172757-ca4hoxo\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action\" draggable=\"true\"><svg><use xlink:href=\"#iconDot\"></use></svg></div><div data-node-id=\"20260925172757-rkb2iv5\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\"><div contenteditable=\"true\" spellcheck=\"false\">nested</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-subtype=\"t\" data-node-id=\"20260925172757-k5w6a1x\" data-node-index=\"1\" data-type=\"NodeList\" class=\"list\" updated=\"20260925172757\"><div data-marker=\"*\" data-subtype=\"t\" data-task=\"X\" data-node-id=\"20260925172757-o6p79dk\" data-type=\"NodeListItem\" class=\"li protyle-task--done\" updated=\"20260925172757\"><div class=\"protyle-action protyle-action--task\" draggable=\"true\"><svg><use xlink:href=\"#iconCheck\"></use></svg></div><div data-subtype=\"h2\" data-node-id=\"20260925172757-tlr3jg4\" data-node-index=\"1\" data-type=\"NodeHeading\" class=\"h2\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\">two</div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-node-id=\"20260925172757-6q49tg5\" data-node-index=\"1\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\">three</div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div>",
+ "targetIDs": [
+ "20260925172757-t5orf3q",
+ "20260925172757-tlr3jg4",
+ "20260925172757-6q49tg5"
+ ],
+ "doOperations": [
+ {
+ "action": "move",
+ "id": "20260925172757-t5orf3q",
+ "previousID": "20260925172757-k5w6a1x",
+ "parentID": "document"
+ },
+ {
+ "action": "update",
+ "id": "20260925172757-t5orf3q",
+ "data": "<div data-node-id=\"20260925172757-t5orf3q\" data-node-index=\"1\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\"><wbr><span data-type=\"strong\">one</span></div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div>"
+ },
+ {
+ "action": "move",
+ "id": "20260925172757-h4xn92d",
+ "previousID": "20260925172757-t5orf3q",
+ "parentID": "document"
+ },
+ {
+ "action": "move",
+ "id": "20260925172757-2l2jdgf",
+ "previousID": "20260925172757-h4xn92d",
+ "parentID": "document"
+ },
+ {
+ "action": "move",
+ "id": "20260925172757-k5w6a1x",
+ "previousID": "20260925172757-2l2jdgf",
+ "parentID": "document"
+ },
+ {
+ "action": "move",
+ "id": "20260925172757-6q49tg5",
+ "previousID": "20260925172757-k5w6a1x",
+ "parentID": "document"
+ },
+ {
+ "action": "update",
+ "id": "20260925172757-6q49tg5",
+ "data": "<div data-node-id=\"20260925172757-6q49tg5\" data-node-index=\"1\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\">three</div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div>"
+ },
+ {
+ "action": "delete",
+ "id": "20260925172757-h4irlle"
+ },
+ {
+ "action": "delete",
+ "id": "20260925172757-n23xpjs"
+ },
+ {
+ "action": "update",
+ "id": "20260925172757-k5w6a1x",
+ "data": "<div data-subtype=\"t\" data-node-id=\"20260925172757-k5w6a1x\" data-node-index=\"1\" data-type=\"NodeList\" class=\"list\" updated=\"20260925172757\"><div data-marker=\"*\" data-subtype=\"t\" data-task=\"X\" data-node-id=\"20260925172757-o6p79dk\" data-type=\"NodeListItem\" class=\"li protyle-task--done\" updated=\"20260925172757\"><div class=\"protyle-action protyle-action--task\" draggable=\"true\"><svg><use xlink:href=\"#iconCheck\"></use></svg></div><div data-subtype=\"h2\" data-node-id=\"20260925172757-tlr3jg4\" data-node-index=\"1\" data-type=\"NodeHeading\" class=\"h2\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\">two</div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div>"
+ }
+ ],
+ "undoOperations": [
+ {
+ "action": "move",
+ "id": "20260925172757-k5w6a1x",
+ "parentID": "document"
+ },
+ {
+ "action": "insert",
+ "id": "20260925172757-h4irlle",
+ "data": "<div data-marker=\"*\" data-subtype=\"t\" data-task=\"X\" data-node-id=\"20260925172757-h4irlle\" data-type=\"NodeListItem\" class=\"li protyle-task--done\" updated=\"20260925172757\"><div class=\"protyle-action protyle-action--task\" draggable=\"true\"><svg><use xlink:href=\"#iconCheck\"></use></svg></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div>",
+ "parentID": "20260925172757-k5w6a1x"
+ },
+ {
+ "action": "move",
+ "id": "20260925172757-t5orf3q",
+ "parentID": "20260925172757-h4irlle"
+ },
+ {
+ "action": "move",
+ "id": "20260925172757-h4xn92d",
+ "parentID": "20260925172757-h4irlle",
+ "previousID": "20260925172757-t5orf3q"
+ },
+ {
+ "action": "move",
+ "id": "20260925172757-2l2jdgf",
+ "parentID": "20260925172757-h4irlle",
+ "previousID": "20260925172757-h4xn92d"
+ },
+ {
+ "action": "insert",
+ "id": "20260925172757-n23xpjs",
+ "data": "<div data-marker=\"*\" data-subtype=\"t\" data-task=\"X\" data-node-id=\"20260925172757-n23xpjs\" data-type=\"NodeListItem\" class=\"li protyle-task--done\" updated=\"20260925172757\"><div class=\"protyle-action protyle-action--task\" draggable=\"true\"><svg><use xlink:href=\"#iconCheck\"></use></svg></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div>",
+ "parentID": "20260925172757-k5w6a1x",
+ "previousID": "20260925172757-o6p79dk"
+ },
+ {
+ "action": "move",
+ "id": "20260925172757-6q49tg5",
+ "parentID": "20260925172757-n23xpjs"
+ },
+ {
+ "action": "update",
+ "id": "20260925172757-k5w6a1x",
+ "data": "<div data-subtype=\"t\" data-node-id=\"20260925172757-k5w6a1x\" data-node-index=\"1\" data-type=\"NodeList\" class=\"list\" updated=\"20260925172757\"><div data-marker=\"*\" data-subtype=\"t\" data-task=\"X\" data-node-id=\"20260925172757-h4irlle\" data-type=\"NodeListItem\" class=\"li protyle-task--done\" updated=\"20260925172757\"><div class=\"protyle-action protyle-action--task\" draggable=\"true\"><svg><use xlink:href=\"#iconCheck\"></use></svg></div><div data-subtype=\"h2\" data-node-id=\"20260925172757-t5orf3q\" data-node-index=\"1\" data-type=\"NodeHeading\" class=\"h2\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\"><wbr><span data-type=\"strong\">one</span></div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div><div data-node-id=\"20260925172757-h4xn92d\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\"><div contenteditable=\"true\" spellcheck=\"false\">tail</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-subtype=\"u\" data-node-id=\"20260925172757-2l2jdgf\" data-type=\"NodeList\" class=\"list\" updated=\"20260925172757\"><div data-marker=\"*\" data-subtype=\"u\" data-node-id=\"20260925172757-ca4hoxo\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action\" draggable=\"true\"><svg><use xlink:href=\"#iconDot\"></use></svg></div><div data-node-id=\"20260925172757-rkb2iv5\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\"><div contenteditable=\"true\" spellcheck=\"false\">nested</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-marker=\"*\" data-subtype=\"t\" data-task=\"X\" data-node-id=\"20260925172757-o6p79dk\" data-type=\"NodeListItem\" class=\"li protyle-task--done\" updated=\"20260925172757\"><div class=\"protyle-action protyle-action--task\" draggable=\"true\"><svg><use xlink:href=\"#iconCheck\"></use></svg></div><div data-subtype=\"h2\" data-node-id=\"20260925172757-tlr3jg4\" data-node-index=\"1\" data-type=\"NodeHeading\" class=\"h2\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\">two</div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-marker=\"*\" data-subtype=\"t\" data-task=\"X\" data-node-id=\"20260925172757-n23xpjs\" data-type=\"NodeListItem\" class=\"li protyle-task--done\" updated=\"20260925172757\"><div class=\"protyle-action protyle-action--task\" draggable=\"true\"><svg><use xlink:href=\"#iconCheck\"></use></svg></div><div data-subtype=\"h2\" data-node-id=\"20260925172757-6q49tg5\" data-node-index=\"1\" data-type=\"NodeHeading\" class=\"h2\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\">three</div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div>"
+ },
+ {
+ "action": "update",
+ "id": "20260925172757-t5orf3q",
+ "data": "<div data-subtype=\"h2\" data-node-id=\"20260925172757-t5orf3q\" data-node-index=\"1\" data-type=\"NodeHeading\" class=\"h2\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\"><wbr><span data-type=\"strong\">one</span></div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div>"
+ },
+ {
+ "action": "update",
+ "id": "20260925172757-6q49tg5",
+ "data": "<div data-subtype=\"h2\" data-node-id=\"20260925172757-6q49tg5\" data-node-index=\"1\" data-type=\"NodeHeading\" class=\"h2\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\">three</div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div>"
+ }
+ ]
+ },
+ {
+ "before": "<div data-subtype=\"t\" data-node-id=\"20260925172757-h37zusd\" data-node-index=\"1\" data-type=\"NodeList\" class=\"list\" updated=\"20260925172757\"><div data-marker=\"*\" data-subtype=\"t\" data-task=\"X\" data-node-id=\"20260925172757-vyabirq\" data-type=\"NodeListItem\" class=\"li protyle-task--done\" updated=\"20260925172757\"><div class=\"protyle-action protyle-action--task\" draggable=\"true\"><svg><use xlink:href=\"#iconCheck\"></use></svg></div><div data-node-id=\"20260925172757-l00b4e2\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\"><span data-type=\"strong\">one</span></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-node-id=\"20260925172757-8hu5z56\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\"><div contenteditable=\"true\" spellcheck=\"false\">tail</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-subtype=\"u\" data-node-id=\"20260925172757-46sd2oe\" data-type=\"NodeList\" class=\"list\" updated=\"20260925172757\"><div data-marker=\"*\" data-subtype=\"u\" data-node-id=\"20260925172757-eg1wzyn\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action\" draggable=\"true\"><svg><use xlink:href=\"#iconDot\"></use></svg></div><div data-node-id=\"20260925172757-rj9btof\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\"><div contenteditable=\"true\" spellcheck=\"false\">nested</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-marker=\"*\" data-subtype=\"t\" data-task=\"X\" data-node-id=\"20260925172757-6rmelzi\" data-type=\"NodeListItem\" class=\"li protyle-task--done\" updated=\"20260925172757\"><div class=\"protyle-action protyle-action--task\" draggable=\"true\"><svg><use xlink:href=\"#iconCheck\"></use></svg></div><div data-node-id=\"20260925172757-gkqwv8p\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\">two</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-marker=\"*\" data-subtype=\"t\" data-task=\"X\" data-node-id=\"20260925172757-uktzvt2\" data-type=\"NodeListItem\" class=\"li protyle-task--done\" updated=\"20260925172757\"><div class=\"protyle-action protyle-action--task\" draggable=\"true\"><svg><use xlink:href=\"#iconCheck\"></use></svg></div><div data-node-id=\"20260925172757-mducuz8\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\">three</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div>",
+ "after": "<div data-subtype=\"h3\" data-node-id=\"20260925172757-l00b4e2\" data-node-index=\"1\" data-type=\"NodeHeading\" class=\"h3\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\"><span data-type=\"strong\">one</span></div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div><div data-node-id=\"20260925172757-8hu5z56\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\"><div contenteditable=\"true\" spellcheck=\"false\">tail</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-subtype=\"u\" data-node-id=\"20260925172757-46sd2oe\" data-type=\"NodeList\" class=\"list\" updated=\"20260925172757\"><div data-marker=\"*\" data-subtype=\"u\" data-node-id=\"20260925172757-eg1wzyn\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action\" draggable=\"true\"><svg><use xlink:href=\"#iconDot\"></use></svg></div><div data-node-id=\"20260925172757-rj9btof\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\"><div contenteditable=\"true\" spellcheck=\"false\">nested</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-subtype=\"t\" data-node-id=\"20260925172757-h37zusd\" data-node-index=\"1\" data-type=\"NodeList\" class=\"list\" updated=\"20260925172757\"><div data-marker=\"*\" data-subtype=\"t\" data-task=\"X\" data-node-id=\"20260925172757-6rmelzi\" data-type=\"NodeListItem\" class=\"li protyle-task--done\" updated=\"20260925172757\"><div class=\"protyle-action protyle-action--task\" draggable=\"true\"><svg><use xlink:href=\"#iconCheck\"></use></svg></div><div data-node-id=\"20260925172757-gkqwv8p\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\">two</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-subtype=\"h3\" data-node-id=\"20260925172757-mducuz8\" data-node-index=\"1\" data-type=\"NodeHeading\" class=\"h3\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\">three</div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div>",
+ "targetIDs": [
+ "20260925172757-l00b4e2",
+ "20260925172757-gkqwv8p",
+ "20260925172757-mducuz8"
+ ],
+ "doOperations": [
+ {
+ "action": "move",
+ "id": "20260925172757-l00b4e2",
+ "previousID": "20260925172757-h37zusd",
+ "parentID": "document"
+ },
+ {
+ "action": "update",
+ "id": "20260925172757-l00b4e2",
+ "data": "<div data-subtype=\"h3\" data-node-id=\"20260925172757-l00b4e2\" data-node-index=\"1\" data-type=\"NodeHeading\" class=\"h3\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\"><wbr><span data-type=\"strong\">one</span></div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div>"
+ },
+ {
+ "action": "move",
+ "id": "20260925172757-8hu5z56",
+ "previousID": "20260925172757-l00b4e2",
+ "parentID": "document"
+ },
+ {
+ "action": "move",
+ "id": "20260925172757-46sd2oe",
+ "previousID": "20260925172757-8hu5z56",
+ "parentID": "document"
+ },
+ {
+ "action": "move",
+ "id": "20260925172757-h37zusd",
+ "previousID": "20260925172757-46sd2oe",
+ "parentID": "document"
+ },
+ {
+ "action": "move",
+ "id": "20260925172757-mducuz8",
+ "previousID": "20260925172757-h37zusd",
+ "parentID": "document"
+ },
+ {
+ "action": "update",
+ "id": "20260925172757-mducuz8",
+ "data": "<div data-subtype=\"h3\" data-node-id=\"20260925172757-mducuz8\" data-node-index=\"1\" data-type=\"NodeHeading\" class=\"h3\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\">three</div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div>"
+ },
+ {
+ "action": "delete",
+ "id": "20260925172757-vyabirq"
+ },
+ {
+ "action": "delete",
+ "id": "20260925172757-uktzvt2"
+ },
+ {
+ "action": "update",
+ "id": "20260925172757-h37zusd",
+ "data": "<div data-subtype=\"t\" data-node-id=\"20260925172757-h37zusd\" data-node-index=\"1\" data-type=\"NodeList\" class=\"list\" updated=\"20260925172757\"><div data-marker=\"*\" data-subtype=\"t\" data-task=\"X\" data-node-id=\"20260925172757-6rmelzi\" data-type=\"NodeListItem\" class=\"li protyle-task--done\" updated=\"20260925172757\"><div class=\"protyle-action protyle-action--task\" draggable=\"true\"><svg><use xlink:href=\"#iconCheck\"></use></svg></div><div data-node-id=\"20260925172757-gkqwv8p\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\">two</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div>"
+ }
+ ],
+ "undoOperations": [
+ {
+ "action": "move",
+ "id": "20260925172757-h37zusd",
+ "parentID": "document"
+ },
+ {
+ "action": "insert",
+ "id": "20260925172757-vyabirq",
+ "data": "<div data-marker=\"*\" data-subtype=\"t\" data-task=\"X\" data-node-id=\"20260925172757-vyabirq\" data-type=\"NodeListItem\" class=\"li protyle-task--done\" updated=\"20260925172757\"><div class=\"protyle-action protyle-action--task\" draggable=\"true\"><svg><use xlink:href=\"#iconCheck\"></use></svg></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div>",
+ "parentID": "20260925172757-h37zusd"
+ },
+ {
+ "action": "move",
+ "id": "20260925172757-l00b4e2",
+ "parentID": "20260925172757-vyabirq"
+ },
+ {
+ "action": "move",
+ "id": "20260925172757-8hu5z56",
+ "parentID": "20260925172757-vyabirq",
+ "previousID": "20260925172757-l00b4e2"
+ },
+ {
+ "action": "move",
+ "id": "20260925172757-46sd2oe",
+ "parentID": "20260925172757-vyabirq",
+ "previousID": "20260925172757-8hu5z56"
+ },
+ {
+ "action": "insert",
+ "id": "20260925172757-uktzvt2",
+ "data": "<div data-marker=\"*\" data-subtype=\"t\" data-task=\"X\" data-node-id=\"20260925172757-uktzvt2\" data-type=\"NodeListItem\" class=\"li protyle-task--done\" updated=\"20260925172757\"><div class=\"protyle-action protyle-action--task\" draggable=\"true\"><svg><use xlink:href=\"#iconCheck\"></use></svg></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div>",
+ "parentID": "20260925172757-h37zusd",
+ "previousID": "20260925172757-6rmelzi"
+ },
+ {
+ "action": "move",
+ "id": "20260925172757-mducuz8",
+ "parentID": "20260925172757-uktzvt2"
+ },
+ {
+ "action": "update",
+ "id": "20260925172757-h37zusd",
+ "data": "<div data-subtype=\"t\" data-node-id=\"20260925172757-h37zusd\" data-node-index=\"1\" data-type=\"NodeList\" class=\"list\" updated=\"20260925172757\"><div data-marker=\"*\" data-subtype=\"t\" data-task=\"X\" data-node-id=\"20260925172757-vyabirq\" data-type=\"NodeListItem\" class=\"li protyle-task--done\" updated=\"20260925172757\"><div class=\"protyle-action protyle-action--task\" draggable=\"true\"><svg><use xlink:href=\"#iconCheck\"></use></svg></div><div data-node-id=\"20260925172757-l00b4e2\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\"><wbr><span data-type=\"strong\">one</span></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-node-id=\"20260925172757-8hu5z56\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\"><div contenteditable=\"true\" spellcheck=\"false\">tail</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-subtype=\"u\" data-node-id=\"20260925172757-46sd2oe\" data-type=\"NodeList\" class=\"list\" updated=\"20260925172757\"><div data-marker=\"*\" data-subtype=\"u\" data-node-id=\"20260925172757-eg1wzyn\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action\" draggable=\"true\"><svg><use xlink:href=\"#iconDot\"></use></svg></div><div data-node-id=\"20260925172757-rj9btof\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\"><div contenteditable=\"true\" spellcheck=\"false\">nested</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-marker=\"*\" data-subtype=\"t\" data-task=\"X\" data-node-id=\"20260925172757-6rmelzi\" data-type=\"NodeListItem\" class=\"li protyle-task--done\" updated=\"20260925172757\"><div class=\"protyle-action protyle-action--task\" draggable=\"true\"><svg><use xlink:href=\"#iconCheck\"></use></svg></div><div data-node-id=\"20260925172757-gkqwv8p\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\">two</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-marker=\"*\" data-subtype=\"t\" data-task=\"X\" data-node-id=\"20260925172757-uktzvt2\" data-type=\"NodeListItem\" class=\"li protyle-task--done\" updated=\"20260925172757\"><div class=\"protyle-action protyle-action--task\" draggable=\"true\"><svg><use xlink:href=\"#iconCheck\"></use></svg></div><div data-node-id=\"20260925172757-mducuz8\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\">three</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div>"
+ },
+ {
+ "action": "update",
+ "id": "20260925172757-l00b4e2",
+ "data": "<div data-node-id=\"20260925172757-l00b4e2\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\"><wbr><span data-type=\"strong\">one</span></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div>"
+ },
+ {
+ "action": "update",
+ "id": "20260925172757-mducuz8",
+ "data": "<div data-node-id=\"20260925172757-mducuz8\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\" custom-avs=\"database\" custom-av-database-field=\"retained\"><div contenteditable=\"true\" spellcheck=\"false\">three</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div>"
+ }
+ ]
+ },
+ {
+ "before": "<div data-subtype=\"u\" data-node-id=\"20260925172757-21n6oxz\" data-node-index=\"1\" data-type=\"NodeList\" class=\"list\" updated=\"20260925172757\"><div data-marker=\"*\" data-subtype=\"u\" data-node-id=\"20260925172757-ouac4jg\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action\" draggable=\"true\"><svg><use xlink:href=\"#iconDot\"></use></svg></div><div data-subtype=\"h1\" data-node-id=\"20260925172757-n78h7y2\" data-type=\"NodeHeading\" class=\"h1\" updated=\"20260925172757\" custom-avs=\"database\"><div contenteditable=\"true\" spellcheck=\"false\">outer</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-subtype=\"u\" data-node-id=\"20260925172757-7ivghs9\" data-type=\"NodeList\" class=\"list\" updated=\"20260925172757\"><div data-marker=\"*\" data-subtype=\"u\" data-node-id=\"20260925172757-3p2gtwz\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action\" draggable=\"true\"><svg><use xlink:href=\"#iconDot\"></use></svg></div><div data-subtype=\"h2\" data-node-id=\"20260925172757-bz44q1w\" data-type=\"NodeHeading\" class=\"h2\" updated=\"20260925172757\" custom-avs=\"database\"><div contenteditable=\"true\" spellcheck=\"false\">inner</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-subtype=\"o\" data-node-id=\"20260925172757-t55ikvm\" data-type=\"NodeList\" class=\"list\" updated=\"20260925172757\"><div data-marker=\"1.\" data-subtype=\"o\" data-node-id=\"20260925172757-fftsyc2\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action protyle-action--order\" contenteditable=\"false\" draggable=\"true\">1.</div><div data-node-id=\"20260925172757-voua530\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\" custom-avs=\"database\"><div contenteditable=\"true\" spellcheck=\"false\">different</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-marker=\"*\" data-subtype=\"u\" data-node-id=\"20260925172757-13w6gng\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action\" draggable=\"true\"><svg><use xlink:href=\"#iconDot\"></use></svg></div><div data-subtype=\"h1\" data-node-id=\"20260925172757-0g04fj7\" data-type=\"NodeHeading\" class=\"h1\" updated=\"20260925172757\"><div contenteditable=\"true\" spellcheck=\"false\">last</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div>",
+ "after": "<div data-subtype=\"u\" data-node-id=\"20260925172757-21n6oxz\" data-node-index=\"1\" data-type=\"NodeList\" class=\"list\" updated=\"20260925172757\"><div data-marker=\"*\" data-subtype=\"u\" data-node-id=\"20260925172757-ouac4jg\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action\" draggable=\"true\"><svg><use xlink:href=\"#iconDot\"></use></svg></div><div data-subtype=\"h1\" data-node-id=\"20260925172757-n78h7y2\" data-type=\"NodeHeading\" class=\"h1\" updated=\"20260925172757\" custom-avs=\"database\"><div contenteditable=\"true\" spellcheck=\"false\">outer</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-node-id=\"20260925172757-bz44q1w\" data-node-index=\"1\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\" custom-avs=\"database\"><div contenteditable=\"true\" spellcheck=\"false\">inner</div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div><div data-subtype=\"o\" data-node-id=\"20260925172757-t55ikvm\" data-type=\"NodeList\" class=\"list\" updated=\"20260925172757\"><div data-marker=\"1.\" data-subtype=\"o\" data-node-id=\"20260925172757-fftsyc2\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action protyle-action--order\" contenteditable=\"false\" draggable=\"true\">1.</div><div data-node-id=\"20260925172757-voua530\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\" custom-avs=\"database\"><div contenteditable=\"true\" spellcheck=\"false\">different</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-marker=\"*\" data-subtype=\"u\" data-node-id=\"20260925172757-13w6gng\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action\" draggable=\"true\"><svg><use xlink:href=\"#iconDot\"></use></svg></div><div data-subtype=\"h1\" data-node-id=\"20260925172757-0g04fj7\" data-type=\"NodeHeading\" class=\"h1\" updated=\"20260925172757\"><div contenteditable=\"true\" spellcheck=\"false\">last</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div>",
+ "targetIDs": [
+ "20260925172757-n78h7y2",
+ "20260925172757-bz44q1w",
+ "20260925172757-voua530"
+ ],
+ "doOperations": [
+ {
+ "action": "move",
+ "id": "20260925172757-bz44q1w",
+ "previousID": "20260925172757-7ivghs9",
+ "parentID": "20260925172757-ouac4jg"
+ },
+ {
+ "action": "update",
+ "id": "20260925172757-bz44q1w",
+ "data": "<div data-node-id=\"20260925172757-bz44q1w\" data-node-index=\"1\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\" custom-avs=\"database\"><div contenteditable=\"true\" spellcheck=\"false\"><wbr>inner</div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div>"
+ },
+ {
+ "action": "move",
+ "id": "20260925172757-t55ikvm",
+ "previousID": "20260925172757-bz44q1w",
+ "parentID": "20260925172757-ouac4jg"
+ },
+ {
+ "action": "delete",
+ "id": "20260925172757-7ivghs9"
+ }
+ ],
+ "undoOperations": [
+ {
+ "action": "insert",
+ "id": "20260925172757-7ivghs9",
+ "data": "<div data-subtype=\"u\" data-node-id=\"20260925172757-7ivghs9\" data-type=\"NodeList\" class=\"list\" updated=\"20260925172757\"><div data-marker=\"*\" data-subtype=\"u\" data-node-id=\"20260925172757-3p2gtwz\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action\" draggable=\"true\"><svg><use xlink:href=\"#iconDot\"></use></svg></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div>",
+ "parentID": "20260925172757-ouac4jg",
+ "previousID": "20260925172757-n78h7y2"
+ },
+ {
+ "action": "move",
+ "id": "20260925172757-bz44q1w",
+ "parentID": "20260925172757-3p2gtwz"
+ },
+ {
+ "action": "move",
+ "id": "20260925172757-t55ikvm",
+ "parentID": "20260925172757-3p2gtwz",
+ "previousID": "20260925172757-bz44q1w"
+ },
+ {
+ "action": "update",
+ "id": "20260925172757-bz44q1w",
+ "data": "<div data-subtype=\"h2\" data-node-id=\"20260925172757-bz44q1w\" data-type=\"NodeHeading\" class=\"h2\" updated=\"20260925172757\" custom-avs=\"database\"><div contenteditable=\"true\" spellcheck=\"false\"><wbr>inner</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div>"
+ }
+ ]
+ },
+ {
+ "before": "<div data-subtype=\"u\" data-node-id=\"20260925172757-nfwjedm\" data-node-index=\"1\" data-type=\"NodeList\" class=\"list\" updated=\"20260925172757\"><div data-marker=\"*\" data-subtype=\"u\" data-node-id=\"20260925172757-vr1ud33\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action\" draggable=\"true\"><svg><use xlink:href=\"#iconDot\"></use></svg></div><div data-subtype=\"h1\" data-node-id=\"20260925172757-vnh58m6\" data-type=\"NodeHeading\" class=\"h1\" updated=\"20260925172757\" custom-avs=\"database\"><div contenteditable=\"true\" spellcheck=\"false\">outer</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-subtype=\"u\" data-node-id=\"20260925172757-jccxyu0\" data-type=\"NodeList\" class=\"list\" updated=\"20260925172757\"><div data-marker=\"*\" data-subtype=\"u\" data-node-id=\"20260925172757-l70e952\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action\" draggable=\"true\"><svg><use xlink:href=\"#iconDot\"></use></svg></div><div data-subtype=\"h2\" data-node-id=\"20260925172757-j98deju\" data-type=\"NodeHeading\" class=\"h2\" updated=\"20260925172757\" custom-avs=\"database\"><div contenteditable=\"true\" spellcheck=\"false\">inner</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-subtype=\"o\" data-node-id=\"20260925172757-i098ib6\" data-type=\"NodeList\" class=\"list\" updated=\"20260925172757\"><div data-marker=\"1.\" data-subtype=\"o\" data-node-id=\"20260925172757-b0gljoc\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action protyle-action--order\" contenteditable=\"false\" draggable=\"true\">1.</div><div data-node-id=\"20260925172757-svjg7ar\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\" custom-avs=\"database\"><div contenteditable=\"true\" spellcheck=\"false\">different</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-marker=\"*\" data-subtype=\"u\" data-node-id=\"20260925172757-mwkdor4\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action\" draggable=\"true\"><svg><use xlink:href=\"#iconDot\"></use></svg></div><div data-subtype=\"h1\" data-node-id=\"20260925172757-55pzb39\" data-type=\"NodeHeading\" class=\"h1\" updated=\"20260925172757\"><div contenteditable=\"true\" spellcheck=\"false\">last</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div>",
+ "after": "<div data-node-id=\"20260925172757-vnh58m6\" data-node-index=\"1\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\" custom-avs=\"database\"><div contenteditable=\"true\" spellcheck=\"false\">outer</div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div><div data-node-id=\"20260925172757-j98deju\" data-node-index=\"1\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\" custom-avs=\"database\"><div contenteditable=\"true\" spellcheck=\"false\">inner</div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div><div data-subtype=\"o\" data-node-id=\"20260925172757-i098ib6\" data-type=\"NodeList\" class=\"list\" updated=\"20260925172757\"><div data-marker=\"1.\" data-subtype=\"o\" data-node-id=\"20260925172757-b0gljoc\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action protyle-action--order\" contenteditable=\"false\" draggable=\"true\">1.</div><div data-node-id=\"20260925172757-svjg7ar\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\" custom-avs=\"database\"><div contenteditable=\"true\" spellcheck=\"false\">different</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-node-id=\"20260925172757-55pzb39\" data-node-index=\"1\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\"><div contenteditable=\"true\" spellcheck=\"false\">last</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div>",
+ "targetIDs": [
+ "20260925172757-vnh58m6",
+ "20260925172757-j98deju",
+ "20260925172757-svjg7ar"
+ ],
+ "doOperations": [
+ {
+ "action": "move",
+ "id": "20260925172757-j98deju",
+ "previousID": "20260925172757-jccxyu0",
+ "parentID": "20260925172757-vr1ud33"
+ },
+ {
+ "action": "update",
+ "id": "20260925172757-j98deju",
+ "data": "<div data-node-id=\"20260925172757-j98deju\" data-node-index=\"1\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\" custom-avs=\"database\"><div contenteditable=\"true\" spellcheck=\"false\"><wbr>inner</div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div>"
+ },
+ {
+ "action": "move",
+ "id": "20260925172757-i098ib6",
+ "previousID": "20260925172757-j98deju",
+ "parentID": "20260925172757-vr1ud33"
+ },
+ {
+ "action": "delete",
+ "id": "20260925172757-jccxyu0"
+ },
+ {
+ "action": "move",
+ "id": "20260925172757-vnh58m6",
+ "previousID": "20260925172757-nfwjedm",
+ "parentID": "document"
+ },
+ {
+ "action": "update",
+ "id": "20260925172757-vnh58m6",
+ "data": "<div data-node-id=\"20260925172757-vnh58m6\" data-node-index=\"1\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\" custom-avs=\"database\"><div contenteditable=\"true\" spellcheck=\"false\">outer</div><div class=\"protyle-attr\" contenteditable=\"false\"><div class=\"protyle-attr--av\"><svg><use xlink:href=\"#iconDatabase\"></use></svg></div>​</div></div>"
+ },
+ {
+ "action": "move",
+ "id": "20260925172757-j98deju",
+ "previousID": "20260925172757-vnh58m6",
+ "parentID": "document"
+ },
+ {
+ "action": "move",
+ "id": "20260925172757-i098ib6",
+ "previousID": "20260925172757-j98deju",
+ "parentID": "document"
+ },
+ {
+ "action": "move",
+ "id": "20260925172757-55pzb39",
+ "previousID": "20260925172757-i098ib6",
+ "parentID": "document"
+ },
+ {
+ "action": "update",
+ "id": "20260925172757-55pzb39",
+ "data": "<div data-node-id=\"20260925172757-55pzb39\" data-node-index=\"1\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20260925172757\"><div contenteditable=\"true\" spellcheck=\"false\">last</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div>"
+ },
+ {
+ "action": "delete",
+ "id": "20260925172757-nfwjedm"
+ }
+ ],
+ "undoOperations": [
+ {
+ "action": "insert",
+ "id": "20260925172757-nfwjedm",
+ "data": "<div data-subtype=\"u\" data-node-id=\"20260925172757-nfwjedm\" data-node-index=\"1\" data-type=\"NodeList\" class=\"list\" updated=\"20260925172757\"><div data-marker=\"*\" data-subtype=\"u\" data-node-id=\"20260925172757-vr1ud33\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action\" draggable=\"true\"><svg><use xlink:href=\"#iconDot\"></use></svg></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div data-marker=\"*\" data-subtype=\"u\" data-node-id=\"20260925172757-mwkdor4\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action\" draggable=\"true\"><svg><use xlink:href=\"#iconDot\"></use></svg></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div>",
+ "parentID": "document"
+ },
+ {
+ "action": "move",
+ "id": "20260925172757-vnh58m6",
+ "parentID": "20260925172757-vr1ud33"
+ },
+ {
+ "action": "move",
+ "id": "20260925172757-j98deju",
+ "parentID": "20260925172757-vr1ud33",
+ "previousID": "20260925172757-vnh58m6"
+ },
+ {
+ "action": "move",
+ "id": "20260925172757-i098ib6",
+ "parentID": "20260925172757-vr1ud33",
+ "previousID": "20260925172757-j98deju"
+ },
+ {
+ "action": "move",
+ "id": "20260925172757-55pzb39",
+ "parentID": "20260925172757-mwkdor4"
+ },
+ {
+ "action": "update",
+ "id": "20260925172757-vnh58m6",
+ "data": "<div data-subtype=\"h1\" data-node-id=\"20260925172757-vnh58m6\" data-type=\"NodeHeading\" class=\"h1\" updated=\"20260925172757\" custom-avs=\"database\"><div contenteditable=\"true\" spellcheck=\"false\">outer</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div>"
+ },
+ {
+ "action": "update",
+ "id": "20260925172757-55pzb39",
+ "data": "<div data-subtype=\"h1\" data-node-id=\"20260925172757-55pzb39\" data-type=\"NodeHeading\" class=\"h1\" updated=\"20260925172757\"><div contenteditable=\"true\" spellcheck=\"false\">last</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div>"
+ },
+ {
+ "action": "insert",
+ "id": "20260925172757-jccxyu0",
+ "data": "<div data-subtype=\"u\" data-node-id=\"20260925172757-jccxyu0\" data-type=\"NodeList\" class=\"list\" updated=\"20260925172757\"><div data-marker=\"*\" data-subtype=\"u\" data-node-id=\"20260925172757-l70e952\" data-type=\"NodeListItem\" class=\"li\" updated=\"20260925172757\"><div class=\"protyle-action\" draggable=\"true\"><svg><use xlink:href=\"#iconDot\"></use></svg></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div>",
+ "parentID": "20260925172757-vr1ud33",
+ "previousID": "20260925172757-vnh58m6"
+ },
+ {
+ "action": "move",
+ "id": "20260925172757-j98deju",
+ "parentID": "20260925172757-l70e952"
+ },
+ {
+ "action": "move",
+ "id": "20260925172757-i098ib6",
+ "parentID": "20260925172757-l70e952",
+ "previousID": "20260925172757-j98deju"
+ },
+ {
+ "action": "update",
+ "id": "20260925172757-j98deju",
+ "data": "<div data-subtype=\"h2\" data-node-id=\"20260925172757-j98deju\" data-type=\"NodeHeading\" class=\"h2\" updated=\"20260925172757\" custom-avs=\"database\"><div contenteditable=\"true\" spellcheck=\"false\"><wbr>inner</div><div class=\"protyle-attr\" contenteditable=\"false\">​</div></div>"
+ }
+ ]
+ }
+]
diff --git a/kernel/model/transaction_cancel_list_fts5_test.go b/kernel/model/transaction_cancel_list_fts5_test.go
index f7049645d4..7206908aff 100644
--- a/kernel/model/transaction_cancel_list_fts5_test.go
+++ b/kernel/model/transaction_cancel_list_fts5_test.go
@@ -3,6 +3,10 @@
package model
import (
+ "encoding/json"
+ "fmt"
+ "os"
+ "strings"
"testing"
"github.com/88250/lute/ast"
@@ -12,6 +16,124 @@ import (
"github.com/siyuan-note/siyuan/kernel/treenode"
)
+func TestListConversionFrontendTransactions(t *testing.T) {
+ data, err := os.ReadFile("testdata/list_conversion.json")
+ if err != nil {
+ t.Fatal(err)
+ }
+ var cases []struct {
+ Before, After string
+ TargetIDs []string
+ DoOperations, UndoOperations []*Operation
+ }
+ if err = json.Unmarshal(data, &cases); err != nil {
+ t.Fatal(err)
+ }
+ for index, testCase := range cases {
+ t.Run(fmt.Sprint(index), func(t *testing.T) {
+ fixture, view, _, _ := setupAttributeViewItemsTest(t, false)
+ tree, loadErr := LoadTreeByBlockID(fixture.sourceID)
+ if loadErr != nil {
+ t.Fatal(loadErr)
+ }
+ lute := NewLute()
+ originalIDs := map[string]bool{}
+ ast.Walk(tree.Root, func(node *ast.Node, entering bool) ast.WalkStatus {
+ if entering && node.ID != "" {
+ originalIDs[node.ID] = true
+ }
+ return ast.WalkContinue
+ })
+ before := strings.ReplaceAll(testCase.Before, "database", view.ID)
+ parsed := lute.BlockDOM2Tree(before)
+ for child := parsed.Root.FirstChild; child != nil; {
+ next := child.Next
+ tree.Root.AppendChild(child)
+ child = next
+ }
+ for i, id := range testCase.TargetIDs {
+ value := view.GetBlockKeyValues().Values[i]
+ value.IsDetached, value.Block.ID = false, id
+ value.Block.RefSubtype = "d"
+ value.Block.Content = treenode.GetNodeInTree(tree, id).Text()
+ }
+ if _, err = filesys.WriteTree(tree); err != nil {
+ t.Fatal(err)
+ }
+ treenode.UpsertBlockTree(tree)
+ sql.IndexTreeQueue(tree)
+ sql.FlushQueue()
+ if err = av.SaveAttributeView(view); err != nil {
+ t.Fatal(err)
+ }
+ for _, operations := range [][]*Operation{testCase.DoOperations, testCase.UndoOperations} {
+ for _, operation := range operations {
+ if operation.ParentID == "document" {
+ operation.ParentID = tree.ID
+ }
+ if html, ok := operation.Data.(string); ok {
+ operation.Data = strings.ReplaceAll(html, "database", view.ID)
+ }
+ }
+ }
+ tx := &Transaction{fromAPI: true, DoOperations: testCase.DoOperations, UndoOperations: testCase.UndoOperations}
+ if err = PerformTxSync(tx); err != nil {
+ t.Fatal(err)
+ }
+ entry := GlobalUndoLog.Peek(tree.ID)
+ if entry == nil {
+ t.Fatal("missing undo entry")
+ }
+ check := func(expectedDOM string) {
+ t.Helper()
+ current, readErr := LoadTreeByBlockID(tree.ID)
+ if readErr != nil {
+ t.Fatal(readErr)
+ }
+ expected := lute.BlockDOM2Tree(strings.ReplaceAll(expectedDOM, "database", view.ID))
+ var expectedIDs, actualIDs []string
+ ast.Walk(expected.Root, func(node *ast.Node, entering bool) ast.WalkStatus {
+ if !entering || node.ID == "" || node.Type == ast.NodeDocument {
+ return ast.WalkContinue
+ }
+ actual := treenode.GetNodeInTree(current, node.ID)
+ expectedIDs = append(expectedIDs, node.ID)
+ if actual == nil || actual.Type != node.Type || actual.HeadingLevel != node.HeadingLevel {
+ t.Fatalf("block %s changed identity or type", node.ID)
+ }
+ parentID := tree.ID
+ if node.Parent != expected.Root {
+ parentID = node.Parent.ID
+ }
+ if actual.Parent.ID != parentID || actual.IALAttr(av.NodeAttrNameAvs) != node.IALAttr(av.NodeAttrNameAvs) {
+ t.Fatalf("block %s changed parent or database binding", node.ID)
+ }
+ if actual.Text() != node.Text() || node.Type == ast.NodeList && actual.ListData.Start != node.ListData.Start {
+ t.Fatalf("block %s changed content or list numbering", node.ID)
+ }
+ return ast.WalkContinue
+ })
+ ast.Walk(current.Root, func(node *ast.Node, entering bool) ast.WalkStatus {
+ if entering && node.ID != "" && !originalIDs[node.ID] {
+ actualIDs = append(actualIDs, node.ID)
+ }
+ return ast.WalkContinue
+ })
+ if strings.Join(actualIDs, ",") != strings.Join(expectedIDs, ",") {
+ t.Fatalf("block order or contents changed: got %v, want %v", actualIDs, expectedIDs)
+ }
+ assertAttributeViewFieldsTest(t, view, readAttributeViewItemsTest(t, view.ID))
+ }
+ for cycle := 0; cycle < 2; cycle++ {
+ check(testCase.After)
+ replayAttributeViewFieldsTest(t, entry.UndoOperationsForReplay())
+ check(testCase.Before)
+ replayAttributeViewFieldsTest(t, entry.DoOperationsForReplay())
+ }
+ })
+ }
+}
+
func TestCancelListPreservesDatabaseFields(t *testing.T) {
for _, subtype := range []int{0, 1, 3} {
t.Run(string(rune('0'+subtype)), func(t *testing.T) {