@codemirror/view 6.15.1 → 6.15.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/index.cjs +12 -9
- package/dist/index.js +12 -9
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## 6.15.3 (2023-07-18)
|
|
2
|
+
|
|
3
|
+
### Bug fixes
|
|
4
|
+
|
|
5
|
+
Fix another crash regression for compositions before line breaks.
|
|
6
|
+
|
|
7
|
+
## 6.15.2 (2023-07-18)
|
|
8
|
+
|
|
9
|
+
### Bug fixes
|
|
10
|
+
|
|
11
|
+
Fix the check that made sure compositions are dropped when the selection is moved.
|
|
12
|
+
|
|
1
13
|
## 6.15.1 (2023-07-18)
|
|
2
14
|
|
|
3
15
|
### Bug fixes
|
package/dist/index.cjs
CHANGED
|
@@ -2617,14 +2617,17 @@ class DocView extends ContentView {
|
|
|
2617
2617
|
openStart = before.openStart;
|
|
2618
2618
|
openEnd = after.openEnd;
|
|
2619
2619
|
let compLine = this.compositionView(composition);
|
|
2620
|
-
if (after.
|
|
2620
|
+
if (after.breakAtStart) {
|
|
2621
|
+
compLine.breakAfter = 1;
|
|
2622
|
+
}
|
|
2623
|
+
else if (after.content.length &&
|
|
2624
|
+
compLine.merge(compLine.length, compLine.length, after.content[0], false, after.openStart, 0)) {
|
|
2621
2625
|
compLine.breakAfter = after.content[0].breakAfter;
|
|
2622
|
-
|
|
2623
|
-
after.content.shift();
|
|
2626
|
+
after.content.shift();
|
|
2624
2627
|
}
|
|
2625
|
-
if (before.content.length
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
+
if (before.content.length &&
|
|
2629
|
+
compLine.merge(0, 0, before.content[before.content.length - 1], true, 0, before.openEnd)) {
|
|
2630
|
+
before.content.pop();
|
|
2628
2631
|
}
|
|
2629
2632
|
content = before.content.concat(compLine).concat(after.content);
|
|
2630
2633
|
}
|
|
@@ -2993,8 +2996,7 @@ function findCompositionNode(view) {
|
|
|
2993
2996
|
}
|
|
2994
2997
|
}
|
|
2995
2998
|
}
|
|
2996
|
-
|
|
2997
|
-
return from > main.head || to < main.head ? null : { from, to, node: textNode };
|
|
2999
|
+
return { from, to, node: textNode };
|
|
2998
3000
|
}
|
|
2999
3001
|
function findCompositionRange(view, changes) {
|
|
3000
3002
|
let found = findCompositionNode(view);
|
|
@@ -3020,7 +3022,8 @@ function findCompositionRange(view, changes) {
|
|
|
3020
3022
|
else
|
|
3021
3023
|
return null;
|
|
3022
3024
|
}
|
|
3023
|
-
|
|
3025
|
+
let { main } = view.state.selection;
|
|
3026
|
+
if (view.state.doc.sliceString(fromB, toB) != text || fromB > main.head || toB < main.head)
|
|
3024
3027
|
return null;
|
|
3025
3028
|
let marks = [];
|
|
3026
3029
|
let range = new ChangedRange(fromA, toA, fromB, toB);
|
package/dist/index.js
CHANGED
|
@@ -2611,14 +2611,17 @@ class DocView extends ContentView {
|
|
|
2611
2611
|
openStart = before.openStart;
|
|
2612
2612
|
openEnd = after.openEnd;
|
|
2613
2613
|
let compLine = this.compositionView(composition);
|
|
2614
|
-
if (after.
|
|
2614
|
+
if (after.breakAtStart) {
|
|
2615
|
+
compLine.breakAfter = 1;
|
|
2616
|
+
}
|
|
2617
|
+
else if (after.content.length &&
|
|
2618
|
+
compLine.merge(compLine.length, compLine.length, after.content[0], false, after.openStart, 0)) {
|
|
2615
2619
|
compLine.breakAfter = after.content[0].breakAfter;
|
|
2616
|
-
|
|
2617
|
-
after.content.shift();
|
|
2620
|
+
after.content.shift();
|
|
2618
2621
|
}
|
|
2619
|
-
if (before.content.length
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
+
if (before.content.length &&
|
|
2623
|
+
compLine.merge(0, 0, before.content[before.content.length - 1], true, 0, before.openEnd)) {
|
|
2624
|
+
before.content.pop();
|
|
2622
2625
|
}
|
|
2623
2626
|
content = before.content.concat(compLine).concat(after.content);
|
|
2624
2627
|
}
|
|
@@ -2987,8 +2990,7 @@ function findCompositionNode(view) {
|
|
|
2987
2990
|
}
|
|
2988
2991
|
}
|
|
2989
2992
|
}
|
|
2990
|
-
|
|
2991
|
-
return from > main.head || to < main.head ? null : { from, to, node: textNode };
|
|
2993
|
+
return { from, to, node: textNode };
|
|
2992
2994
|
}
|
|
2993
2995
|
function findCompositionRange(view, changes) {
|
|
2994
2996
|
let found = findCompositionNode(view);
|
|
@@ -3014,7 +3016,8 @@ function findCompositionRange(view, changes) {
|
|
|
3014
3016
|
else
|
|
3015
3017
|
return null;
|
|
3016
3018
|
}
|
|
3017
|
-
|
|
3019
|
+
let { main } = view.state.selection;
|
|
3020
|
+
if (view.state.doc.sliceString(fromB, toB) != text || fromB > main.head || toB < main.head)
|
|
3018
3021
|
return null;
|
|
3019
3022
|
let marks = [];
|
|
3020
3023
|
let range = new ChangedRange(fromA, toA, fromB, toB);
|