@tiptap/core 3.17.0 → 3.18.0
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/dist/index.cjs +12 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +12 -6
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/NodePos.ts +8 -3
- package/src/commands/focus.ts +8 -2
- package/src/lib/ResizableNodeView.ts +2 -2
package/dist/index.cjs
CHANGED
|
@@ -681,8 +681,12 @@ var focus = (position = null, options = {}) => ({ editor, view, tr, dispatch })
|
|
|
681
681
|
}
|
|
682
682
|
});
|
|
683
683
|
};
|
|
684
|
-
|
|
685
|
-
|
|
684
|
+
try {
|
|
685
|
+
if (view.hasFocus() && position === null || position === false) {
|
|
686
|
+
return true;
|
|
687
|
+
}
|
|
688
|
+
} catch {
|
|
689
|
+
return false;
|
|
686
690
|
}
|
|
687
691
|
if (dispatch && position === null && !isTextSelection(editor.state.selection)) {
|
|
688
692
|
delayedFocus();
|
|
@@ -4454,19 +4458,20 @@ var NodePos = class _NodePos {
|
|
|
4454
4458
|
this.node.content.forEach((node, offset) => {
|
|
4455
4459
|
const isBlock = node.isBlock && !node.isTextblock;
|
|
4456
4460
|
const isNonTextAtom = node.isAtom && !node.isText;
|
|
4461
|
+
const isInline = node.isInline;
|
|
4457
4462
|
const targetPos = this.pos + offset + (isNonTextAtom ? 0 : 1);
|
|
4458
4463
|
if (targetPos < 0 || targetPos > this.resolvedPos.doc.nodeSize - 2) {
|
|
4459
4464
|
return;
|
|
4460
4465
|
}
|
|
4461
4466
|
const $pos = this.resolvedPos.doc.resolve(targetPos);
|
|
4462
|
-
if (!isBlock && $pos.depth <= this.depth) {
|
|
4467
|
+
if (!isBlock && !isInline && $pos.depth <= this.depth) {
|
|
4463
4468
|
return;
|
|
4464
4469
|
}
|
|
4465
|
-
const childNodePos = new _NodePos($pos, this.editor, isBlock, isBlock ? node : null);
|
|
4470
|
+
const childNodePos = new _NodePos($pos, this.editor, isBlock, isBlock || isInline ? node : null);
|
|
4466
4471
|
if (isBlock) {
|
|
4467
4472
|
childNodePos.actualDepth = this.depth + 1;
|
|
4468
4473
|
}
|
|
4469
|
-
children.push(
|
|
4474
|
+
children.push(childNodePos);
|
|
4470
4475
|
});
|
|
4471
4476
|
return children;
|
|
4472
4477
|
}
|
|
@@ -5542,7 +5547,8 @@ var ResizableNodeView = class {
|
|
|
5542
5547
|
return this.container;
|
|
5543
5548
|
}
|
|
5544
5549
|
get contentDOM() {
|
|
5545
|
-
|
|
5550
|
+
var _a;
|
|
5551
|
+
return (_a = this.contentElement) != null ? _a : null;
|
|
5546
5552
|
}
|
|
5547
5553
|
handleEditorUpdate() {
|
|
5548
5554
|
const isEditable = this.editor.isEditable;
|