prosemirror-view 1.40.0 → 1.40.1
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 +8 -0
- package/dist/index.cjs +2 -2
- package/dist/index.js +2 -2
- package/package.json +1 -1
- package/src/domchange.ts +1 -1
- package/src/domcoords.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## 1.40.1 (2025-07-18)
|
|
2
|
+
|
|
3
|
+
### Bug fixes
|
|
4
|
+
|
|
5
|
+
Fix an issue where, for some Android virtual keyboards, joining textblocks that contain an image with Backspace would run the handler for Enter instead.
|
|
6
|
+
|
|
7
|
+
Fix an issue causing `posAtCoords` to get confused by table cells sticking out of their parent row elements.
|
|
8
|
+
|
|
1
9
|
## 1.40.0 (2025-06-02)
|
|
2
10
|
|
|
3
11
|
### Bug fixes
|
package/dist/index.cjs
CHANGED
|
@@ -403,7 +403,7 @@ function posFromCaret(view, node, offset, coords) {
|
|
|
403
403
|
rect = void 0;
|
|
404
404
|
if (!desc) return null;
|
|
405
405
|
if (desc.dom.nodeType == 1 && (desc.node.isBlock && desc.parent || !desc.contentDOM) && ((rect = desc.dom.getBoundingClientRect()).width || rect.height)) {
|
|
406
|
-
if (desc.node.isBlock && desc.parent) {
|
|
406
|
+
if (desc.node.isBlock && desc.parent && !/^T(R|BODY|HEAD|FOOT)$/.test(desc.dom.nodeName)) {
|
|
407
407
|
if (!sawBlock && rect.left > coords.left || rect.top > coords.top) outsideBlock = desc.posBefore;else if (!sawBlock && rect.right < coords.left || rect.bottom < coords.top) outsideBlock = desc.posAfter;
|
|
408
408
|
sawBlock = true;
|
|
409
409
|
}
|
|
@@ -4605,7 +4605,7 @@ function ruleFromNode(dom) {
|
|
|
4605
4605
|
}
|
|
4606
4606
|
return null;
|
|
4607
4607
|
}
|
|
4608
|
-
var isInline = /^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;
|
|
4608
|
+
var isInline = /^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;
|
|
4609
4609
|
function readDOMChange(view, from, to, typeOver, addedNodes) {
|
|
4610
4610
|
var compositionID = view.input.compositionPendingChanges || (view.composing ? view.input.compositionID : 0);
|
|
4611
4611
|
view.input.compositionPendingChanges = 0;
|
package/dist/index.js
CHANGED
|
@@ -414,7 +414,7 @@ function posFromCaret(view, node, offset, coords) {
|
|
|
414
414
|
if (desc.dom.nodeType == 1 && (desc.node.isBlock && desc.parent || !desc.contentDOM) &&
|
|
415
415
|
// Ignore elements with zero-size bounding rectangles
|
|
416
416
|
((rect = desc.dom.getBoundingClientRect()).width || rect.height)) {
|
|
417
|
-
if (desc.node.isBlock && desc.parent) {
|
|
417
|
+
if (desc.node.isBlock && desc.parent && !/^T(R|BODY|HEAD|FOOT)$/.test(desc.dom.nodeName)) {
|
|
418
418
|
// Only apply the horizontal test to the innermost block. Vertical for any parent.
|
|
419
419
|
if (!sawBlock && rect.left > coords.left || rect.top > coords.top)
|
|
420
420
|
outsideBlock = desc.posBefore;
|
|
@@ -4929,7 +4929,7 @@ function ruleFromNode(dom) {
|
|
|
4929
4929
|
}
|
|
4930
4930
|
return null;
|
|
4931
4931
|
}
|
|
4932
|
-
const isInline = /^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;
|
|
4932
|
+
const isInline = /^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;
|
|
4933
4933
|
function readDOMChange(view, from, to, typeOver, addedNodes) {
|
|
4934
4934
|
let compositionID = view.input.compositionPendingChanges || (view.composing ? view.input.compositionID : 0);
|
|
4935
4935
|
view.input.compositionPendingChanges = 0;
|
package/package.json
CHANGED
package/src/domchange.ts
CHANGED
|
@@ -76,7 +76,7 @@ function ruleFromNode(dom: DOMNode): Omit<TagParseRule, "tag"> | null {
|
|
|
76
76
|
return null
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
const isInline = /^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i
|
|
79
|
+
const isInline = /^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i
|
|
80
80
|
|
|
81
81
|
export function readDOMChange(view: EditorView, from: number, to: number, typeOver: boolean, addedNodes: readonly DOMNode[]) {
|
|
82
82
|
let compositionID = view.input.compositionPendingChanges || (view.composing ? view.input.compositionID : 0)
|
package/src/domcoords.ts
CHANGED
|
@@ -232,7 +232,7 @@ function posFromCaret(view: EditorView, node: Node, offset: number, coords: {top
|
|
|
232
232
|
if (desc.dom.nodeType == 1 && (desc.node.isBlock && desc.parent || !desc.contentDOM) &&
|
|
233
233
|
// Ignore elements with zero-size bounding rectangles
|
|
234
234
|
((rect = (desc.dom as HTMLElement).getBoundingClientRect()).width || rect.height)) {
|
|
235
|
-
if (desc.node.isBlock && desc.parent) {
|
|
235
|
+
if (desc.node.isBlock && desc.parent && !/^T(R|BODY|HEAD|FOOT)$/.test(desc.dom!.nodeName)) {
|
|
236
236
|
// Only apply the horizontal test to the innermost block. Vertical for any parent.
|
|
237
237
|
if (!sawBlock && rect.left > coords.left || rect.top > coords.top) outsideBlock = desc.posBefore
|
|
238
238
|
else if (!sawBlock && rect.right < coords.left || rect.bottom < coords.top) outsideBlock = desc.posAfter
|