prosemirror-view 1.41.1 → 1.41.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 +3 -2
- package/dist/index.js +4 -4
- package/package.json +1 -1
- package/src/domchange.ts +3 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## 1.41.3 (2025-10-09)
|
|
2
|
+
|
|
3
|
+
### Bug fixes
|
|
4
|
+
|
|
5
|
+
Fix a bug where typing when the selection crosses inline node boundaries was ignored in some situations.
|
|
6
|
+
|
|
7
|
+
## 1.41.2 (2025-09-29)
|
|
8
|
+
|
|
9
|
+
### Bug fixes
|
|
10
|
+
|
|
11
|
+
Fix an issue where some Backspace presses with SwiftKey on Android would get interpreted as Enter.
|
|
12
|
+
|
|
1
13
|
## 1.41.1 (2025-09-19)
|
|
2
14
|
|
|
3
15
|
### Bug fixes
|
package/dist/index.cjs
CHANGED
|
@@ -4690,10 +4690,9 @@ function readDOMChange(view, from, to, typeOver, addedNodes) {
|
|
|
4690
4690
|
var $to = parse.doc.resolveNoCache(change.endB - parse.from);
|
|
4691
4691
|
var $fromA = doc.resolve(change.start);
|
|
4692
4692
|
var inlineChange = $from.sameParent($to) && $from.parent.inlineContent && $fromA.end() >= change.endA;
|
|
4693
|
-
var nextSel;
|
|
4694
4693
|
if ((ios && view.input.lastIOSEnter > Date.now() - 225 && (!inlineChange || addedNodes.some(function (n) {
|
|
4695
4694
|
return n.nodeName == "DIV" || n.nodeName == "P";
|
|
4696
|
-
})) || !inlineChange && $from.pos < parse.doc.content.size && (!$from.sameParent($to) || !$from.parent.inlineContent) && !/\S/.test(parse.doc.textBetween($from.pos, $to.pos, "", ""))
|
|
4695
|
+
})) || !inlineChange && $from.pos < parse.doc.content.size && (!$from.sameParent($to) || !$from.parent.inlineContent) && $from.pos < $to.pos && !/\S/.test(parse.doc.textBetween($from.pos, $to.pos, "", ""))) && view.someProp("handleKeyDown", function (f) {
|
|
4697
4696
|
return f(view, keyEvent(13, "Enter"));
|
|
4698
4697
|
})) {
|
|
4699
4698
|
view.input.lastIOSEnter = 0;
|
|
@@ -4751,6 +4750,8 @@ function readDOMChange(view, from, to, typeOver, addedNodes) {
|
|
|
4751
4750
|
if (!view.someProp("handleTextInput", function (f) {
|
|
4752
4751
|
return f(view, chFrom, chTo, text, deflt);
|
|
4753
4752
|
})) view.dispatch(deflt());
|
|
4753
|
+
} else {
|
|
4754
|
+
view.dispatch(mkTr());
|
|
4754
4755
|
}
|
|
4755
4756
|
} else {
|
|
4756
4757
|
view.dispatch(mkTr());
|
package/dist/index.js
CHANGED
|
@@ -5029,16 +5029,13 @@ function readDOMChange(view, from, to, typeOver, addedNodes) {
|
|
|
5029
5029
|
let $to = parse.doc.resolveNoCache(change.endB - parse.from);
|
|
5030
5030
|
let $fromA = doc.resolve(change.start);
|
|
5031
5031
|
let inlineChange = $from.sameParent($to) && $from.parent.inlineContent && $fromA.end() >= change.endA;
|
|
5032
|
-
let nextSel;
|
|
5033
5032
|
// If this looks like the effect of pressing Enter (or was recorded
|
|
5034
5033
|
// as being an iOS enter press), just dispatch an Enter key instead.
|
|
5035
5034
|
if (((ios && view.input.lastIOSEnter > Date.now() - 225 &&
|
|
5036
5035
|
(!inlineChange || addedNodes.some(n => n.nodeName == "DIV" || n.nodeName == "P"))) ||
|
|
5037
5036
|
(!inlineChange && $from.pos < parse.doc.content.size &&
|
|
5038
5037
|
(!$from.sameParent($to) || !$from.parent.inlineContent) &&
|
|
5039
|
-
!/\S/.test(parse.doc.textBetween($from.pos, $to.pos, "", "")) &&
|
|
5040
|
-
(nextSel = Selection.findFrom(parse.doc.resolve($from.pos + 1), 1, true)) &&
|
|
5041
|
-
nextSel.head > $from.pos)) &&
|
|
5038
|
+
$from.pos < $to.pos && !/\S/.test(parse.doc.textBetween($from.pos, $to.pos, "", "")))) &&
|
|
5042
5039
|
view.someProp("handleKeyDown", f => f(view, keyEvent(13, "Enter")))) {
|
|
5043
5040
|
view.input.lastIOSEnter = 0;
|
|
5044
5041
|
return;
|
|
@@ -5124,6 +5121,9 @@ function readDOMChange(view, from, to, typeOver, addedNodes) {
|
|
|
5124
5121
|
if (!view.someProp("handleTextInput", f => f(view, chFrom, chTo, text, deflt)))
|
|
5125
5122
|
view.dispatch(deflt());
|
|
5126
5123
|
}
|
|
5124
|
+
else {
|
|
5125
|
+
view.dispatch(mkTr());
|
|
5126
|
+
}
|
|
5127
5127
|
}
|
|
5128
5128
|
else {
|
|
5129
5129
|
view.dispatch(mkTr());
|
package/package.json
CHANGED
package/src/domchange.ts
CHANGED
|
@@ -176,16 +176,13 @@ export function readDOMChange(view: EditorView, from: number, to: number, typeOv
|
|
|
176
176
|
let $to = parse.doc.resolveNoCache(change.endB - parse.from)
|
|
177
177
|
let $fromA = doc.resolve(change.start)
|
|
178
178
|
let inlineChange = $from.sameParent($to) && $from.parent.inlineContent && $fromA.end() >= change.endA
|
|
179
|
-
let nextSel
|
|
180
179
|
// If this looks like the effect of pressing Enter (or was recorded
|
|
181
180
|
// as being an iOS enter press), just dispatch an Enter key instead.
|
|
182
181
|
if (((browser.ios && view.input.lastIOSEnter > Date.now() - 225 &&
|
|
183
182
|
(!inlineChange || addedNodes.some(n => n.nodeName == "DIV" || n.nodeName == "P"))) ||
|
|
184
183
|
(!inlineChange && $from.pos < parse.doc.content.size &&
|
|
185
184
|
(!$from.sameParent($to) || !$from.parent.inlineContent) &&
|
|
186
|
-
!/\S/.test(parse.doc.textBetween($from.pos, $to.pos, "", "")) &&
|
|
187
|
-
(nextSel = Selection.findFrom(parse.doc.resolve($from.pos + 1), 1, true)) &&
|
|
188
|
-
nextSel.head > $from.pos)) &&
|
|
185
|
+
$from.pos < $to.pos && !/\S/.test(parse.doc.textBetween($from.pos, $to.pos, "", "")))) &&
|
|
189
186
|
view.someProp("handleKeyDown", f => f(view, keyEvent(13, "Enter")))) {
|
|
190
187
|
view.input.lastIOSEnter = 0
|
|
191
188
|
return
|
|
@@ -271,6 +268,8 @@ export function readDOMChange(view: EditorView, from: number, to: number, typeOv
|
|
|
271
268
|
let deflt = () => mkTr(view.state.tr.insertText(text, chFrom, chTo))
|
|
272
269
|
if (!view.someProp("handleTextInput", f => f(view, chFrom, chTo, text, deflt)))
|
|
273
270
|
view.dispatch(deflt())
|
|
271
|
+
} else {
|
|
272
|
+
view.dispatch(mkTr())
|
|
274
273
|
}
|
|
275
274
|
} else {
|
|
276
275
|
view.dispatch(mkTr())
|