Whenever an update happens, I have the transaction object which is supposed to hold all the information about the update IMO. However it’s still difficult to interpret the details as not much is written in the doc, ie. I want to know if it’s just a text change/drag/delete/create etc., on which nodes this is occurring, so I can send minimal data update to backend, not the whole editor state itself. Here’s the logged transform when I just add a character a
to a node:
{
"doc": {
"type": "doc",
"content": [
{
"type": "blockGroup",
"content": [
{
"type": "blockContainer",
"attrs": {
"id": "29",
"textColor": "default",
"backgroundColor": "red",
"customProps": {
"properties": {
"category": "specification"
}
}
},
"content": [
{
"type": "paragraph",
"attrs": {
"textAlignment": "left"
},
"content": [
{
"type": "text",
"marks": [
{
"type": "textColor",
"attrs": {
"color": "yellow"
}
},
{
"type": "customContentProps",
"attrs": {
"customContentProps": {
"mention": "abc"
}
}
}
],
"text": "yellow"
},
{
"type": "text",
"marks": [
{
"type": "textColor",
"attrs": {
"color": "red"
}
},
{
"type": "customContentProps",
"attrs": {
"customContentProps": {
"linkToPage": "pageAbc"
}
}
}
],
"text": "red"
}
]
}
]
},
{
"type": "blockContainer",
"attrs": {
"id": "28",
"textColor": "default",
"backgroundColor": "red",
"customProps": {
"properties": {
"parent_id": "29"
}
}
},
"content": [
{
"type": "paragraph",
"attrs": {
"textAlignment": "left"
},
"content": [
{
"type": "text",
"marks": [
{
"type": "customContentProps",
"attrs": {
"customContentProps": {
"anything": "abc"
}
}
}
],
"text": "whitea"
}
]
}
]
},
{
"type": "blockContainer",
"attrs": {
"id": "9c744069-f8de-4f6e-96c1-5244a8c12192",
"textColor": "default",
"backgroundColor": "default",
"customProps": {
"test": ""
}
},
"content": [
{
"type": "paragraph",
"attrs": {
"textAlignment": "left"
}
}
]
}
]
}
]
},
"steps": [
{
"stepType": "replace",
"from": 21,
"to": 21,
"slice": {
"content": [
{
"type": "text",
"marks": [
{
"type": "customContentProps",
"attrs": {
"customContentProps": {
"anything": "abc"
}
}
}
],
"text": "a"
}
]
}
}
],
"docs": [
{
"type": "doc",
"content": [
{
"type": "blockGroup",
"content": [
{
"type": "blockContainer",
"attrs": {
"id": "29",
"textColor": "default",
"backgroundColor": "red",
"customProps": {
"properties": {
"category": "specification"
}
}
},
"content": [
{
"type": "paragraph",
"attrs": {
"textAlignment": "left"
},
"content": [
{
"type": "text",
"marks": [
{
"type": "textColor",
"attrs": {
"color": "yellow"
}
},
{
"type": "customContentProps",
"attrs": {
"customContentProps": {
"mention": "abc"
}
}
}
],
"text": "yellow"
},
{
"type": "text",
"marks": [
{
"type": "textColor",
"attrs": {
"color": "red"
}
},
{
"type": "customContentProps",
"attrs": {
"customContentProps": {
"linkToPage": "pageAbc"
}
}
}
],
"text": "red"
}
]
}
]
},
{
"type": "blockContainer",
"attrs": {
"id": "28",
"textColor": "default",
"backgroundColor": "red",
"customProps": {
"properties": {
"parent_id": "29"
}
}
},
"content": [
{
"type": "paragraph",
"attrs": {
"textAlignment": "left"
},
"content": [
{
"type": "text",
"marks": [
{
"type": "customContentProps",
"attrs": {
"customContentProps": {
"anything": "abc"
}
}
}
],
"text": "white"
}
]
}
]
},
{
"type": "blockContainer",
"attrs": {
"id": "9c744069-f8de-4f6e-96c1-5244a8c12192",
"textColor": "default",
"backgroundColor": "default",
"customProps": {
"test": ""
}
},
"content": [
{
"type": "paragraph",
"attrs": {
"textAlignment": "left"
}
}
]
}
]
}
]
}
],
"mapping": {
"maps": [
{
"ranges": [
21,
0,
1
],
"inverted": false
}
],
"from": 0,
"to": 1
},
"curSelectionFor": 1,
"updated": 5,
"meta": {},
"time": 1694394594037,
"curSelection": {
"type": "text",
"anchor": 22,
"head": 22
},
"storedMarks": null
}
Appreciate if anyone can help