Skip to content

Commit 5354347

Browse files
authored
fix(core): report block moves in getBlocksChangedByTransaction #1924 (#1960)
1 parent fb37d13 commit 5354347

13 files changed

+887
-254
lines changed

packages/core/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
"@tiptap/extension-underline": "^2.26.1",
9393
"@tiptap/pm": "^2.26.1",
9494
"emoji-mart": "^5.6.0",
95+
"fast-deep-equal": "^3",
9596
"hast-util-from-dom": "^5.0.1",
9697
"prosemirror-dropcursor": "^1.8.2",
9798
"prosemirror-highlight": "^0.13.0",
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
[
2+
{
3+
"block": {
4+
"children": [],
5+
"content": [
6+
{
7+
"styles": {},
8+
"text": "A",
9+
"type": "text",
10+
},
11+
],
12+
"id": "a",
13+
"props": {
14+
"backgroundColor": "default",
15+
"textAlignment": "left",
16+
"textColor": "default",
17+
},
18+
"type": "paragraph",
19+
},
20+
"currentParent": undefined,
21+
"prevBlock": {
22+
"children": [],
23+
"content": [
24+
{
25+
"styles": {},
26+
"text": "A",
27+
"type": "text",
28+
},
29+
],
30+
"id": "a",
31+
"props": {
32+
"backgroundColor": "default",
33+
"textAlignment": "left",
34+
"textColor": "default",
35+
},
36+
"type": "paragraph",
37+
},
38+
"prevParent": undefined,
39+
"source": {
40+
"type": "local",
41+
},
42+
"type": "move",
43+
},
44+
]
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
[
2+
{
3+
"block": {
4+
"children": [],
5+
"content": [
6+
{
7+
"styles": {},
8+
"text": "X",
9+
"type": "text",
10+
},
11+
],
12+
"id": "x",
13+
"props": {
14+
"backgroundColor": "default",
15+
"textAlignment": "left",
16+
"textColor": "default",
17+
},
18+
"type": "paragraph",
19+
},
20+
"prevBlock": undefined,
21+
"source": {
22+
"type": "local",
23+
},
24+
"type": "insert",
25+
},
26+
]
Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
[
2+
{
3+
"block": {
4+
"children": [],
5+
"content": [
6+
{
7+
"styles": {},
8+
"text": "B",
9+
"type": "text",
10+
},
11+
],
12+
"id": "child-b",
13+
"props": {
14+
"backgroundColor": "default",
15+
"textAlignment": "left",
16+
"textColor": "default",
17+
},
18+
"type": "paragraph",
19+
},
20+
"currentParent": {
21+
"children": [
22+
{
23+
"children": [],
24+
"content": [
25+
{
26+
"styles": {},
27+
"text": "B",
28+
"type": "text",
29+
},
30+
],
31+
"id": "child-b",
32+
"props": {
33+
"backgroundColor": "default",
34+
"textAlignment": "left",
35+
"textColor": "default",
36+
},
37+
"type": "paragraph",
38+
},
39+
{
40+
"children": [],
41+
"content": [
42+
{
43+
"styles": {},
44+
"text": "A",
45+
"type": "text",
46+
},
47+
],
48+
"id": "child-a",
49+
"props": {
50+
"backgroundColor": "default",
51+
"textAlignment": "left",
52+
"textColor": "default",
53+
},
54+
"type": "paragraph",
55+
},
56+
{
57+
"children": [],
58+
"content": [
59+
{
60+
"styles": {},
61+
"text": "C",
62+
"type": "text",
63+
},
64+
],
65+
"id": "child-c",
66+
"props": {
67+
"backgroundColor": "default",
68+
"textAlignment": "left",
69+
"textColor": "default",
70+
},
71+
"type": "paragraph",
72+
},
73+
],
74+
"content": [
75+
{
76+
"styles": {},
77+
"text": "Parent",
78+
"type": "text",
79+
},
80+
],
81+
"id": "parent",
82+
"props": {
83+
"backgroundColor": "default",
84+
"textAlignment": "left",
85+
"textColor": "default",
86+
},
87+
"type": "paragraph",
88+
},
89+
"prevBlock": {
90+
"children": [],
91+
"content": [
92+
{
93+
"styles": {},
94+
"text": "B",
95+
"type": "text",
96+
},
97+
],
98+
"id": "child-b",
99+
"props": {
100+
"backgroundColor": "default",
101+
"textAlignment": "left",
102+
"textColor": "default",
103+
},
104+
"type": "paragraph",
105+
},
106+
"prevParent": {
107+
"children": [
108+
{
109+
"children": [],
110+
"content": [
111+
{
112+
"styles": {},
113+
"text": "A",
114+
"type": "text",
115+
},
116+
],
117+
"id": "child-a",
118+
"props": {
119+
"backgroundColor": "default",
120+
"textAlignment": "left",
121+
"textColor": "default",
122+
},
123+
"type": "paragraph",
124+
},
125+
{
126+
"children": [],
127+
"content": [
128+
{
129+
"styles": {},
130+
"text": "B",
131+
"type": "text",
132+
},
133+
],
134+
"id": "child-b",
135+
"props": {
136+
"backgroundColor": "default",
137+
"textAlignment": "left",
138+
"textColor": "default",
139+
},
140+
"type": "paragraph",
141+
},
142+
{
143+
"children": [],
144+
"content": [
145+
{
146+
"styles": {},
147+
"text": "C",
148+
"type": "text",
149+
},
150+
],
151+
"id": "child-c",
152+
"props": {
153+
"backgroundColor": "default",
154+
"textAlignment": "left",
155+
"textColor": "default",
156+
},
157+
"type": "paragraph",
158+
},
159+
],
160+
"content": [
161+
{
162+
"styles": {},
163+
"text": "Parent",
164+
"type": "text",
165+
},
166+
],
167+
"id": "parent",
168+
"props": {
169+
"backgroundColor": "default",
170+
"textAlignment": "left",
171+
"textColor": "default",
172+
},
173+
"type": "paragraph",
174+
},
175+
"source": {
176+
"type": "local",
177+
},
178+
"type": "move",
179+
},
180+
]
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
[
2+
{
3+
"block": {
4+
"children": [],
5+
"content": [
6+
{
7+
"styles": {},
8+
"text": "Bottom",
9+
"type": "text",
10+
},
11+
],
12+
"id": "bottom",
13+
"props": {
14+
"backgroundColor": "default",
15+
"textAlignment": "left",
16+
"textColor": "default",
17+
},
18+
"type": "paragraph",
19+
},
20+
"currentParent": undefined,
21+
"prevBlock": {
22+
"children": [],
23+
"content": [
24+
{
25+
"styles": {},
26+
"text": "Bottom",
27+
"type": "text",
28+
},
29+
],
30+
"id": "bottom",
31+
"props": {
32+
"backgroundColor": "default",
33+
"textAlignment": "left",
34+
"textColor": "default",
35+
},
36+
"type": "paragraph",
37+
},
38+
"prevParent": undefined,
39+
"source": {
40+
"type": "local",
41+
},
42+
"type": "move",
43+
},
44+
]
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
[
2+
{
3+
"block": {
4+
"children": [],
5+
"content": [
6+
{
7+
"styles": {},
8+
"text": "Middle",
9+
"type": "text",
10+
},
11+
],
12+
"id": "middle",
13+
"props": {
14+
"backgroundColor": "default",
15+
"textAlignment": "left",
16+
"textColor": "default",
17+
},
18+
"type": "paragraph",
19+
},
20+
"currentParent": undefined,
21+
"prevBlock": {
22+
"children": [],
23+
"content": [
24+
{
25+
"styles": {},
26+
"text": "Middle",
27+
"type": "text",
28+
},
29+
],
30+
"id": "middle",
31+
"props": {
32+
"backgroundColor": "default",
33+
"textAlignment": "left",
34+
"textColor": "default",
35+
},
36+
"type": "paragraph",
37+
},
38+
"prevParent": undefined,
39+
"source": {
40+
"type": "local",
41+
},
42+
"type": "move",
43+
},
44+
]

0 commit comments

Comments
 (0)