Skip to content

Commit c43b119

Browse files
committed
feat: preliminary support for tiptap v3
1 parent 37f0765 commit c43b119

File tree

22 files changed

+81
-169
lines changed

22 files changed

+81
-169
lines changed

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
"@tiptap/extension-collaboration-cursor": "^2.11.5",
7171
"@tiptap/extension-gapcursor": "^2.11.5",
7272
"@tiptap/extension-hard-break": "^2.11.5",
73-
"@tiptap/extension-history": "^2.11.5",
73+
"@tiptap/extension-undo-redo": "^2.11.5",
7474
"@tiptap/extension-horizontal-rule": "^2.11.5",
7575
"@tiptap/extension-italic": "^2.11.5",
7676
"@tiptap/extension-link": "^2.11.5",

packages/core/src/api/blockManipulation/setupTestEnv.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ export function setupTestEnv() {
1313
});
1414

1515
afterAll(() => {
16-
editor.mount(undefined);
1716
editor._tiptapEditor.destroy();
1817
editor = undefined as any;
1918
});

packages/core/src/api/clipboard/clipboardExternal.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ describe("Test external clipboard HTML", () => {
6969
});
7070

7171
afterAll(() => {
72-
editor.mount(undefined);
7372
editor._tiptapEditor.destroy();
7473
editor = undefined as any;
7574

packages/core/src/api/clipboard/clipboardInternal.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,6 @@ describe("Test ProseMirror selection clipboard HTML", () => {
283283
});
284284

285285
afterAll(() => {
286-
editor.mount(undefined);
287286
editor._tiptapEditor.destroy();
288287
editor = undefined as any;
289288

packages/core/src/api/exporters/html/htmlConversion.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ describe("Test HTML conversion", () => {
8686
});
8787

8888
afterEach(() => {
89-
editor.mount(undefined);
9089
editor._tiptapEditor.destroy();
9190
editor = undefined as any;
9291

packages/core/src/api/exporters/markdown/markdownExporter.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ describe("markdownExporter", () => {
6262
});
6363

6464
afterEach(() => {
65-
editor.mount(undefined);
6665
editor._tiptapEditor.destroy();
6766
editor = undefined as any;
6867

packages/core/src/api/nodeConversions/nodeConversions.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ describe("Test BlockNote-Prosemirror conversion", () => {
6464
});
6565

6666
afterEach(() => {
67-
editor.mount(undefined);
6867
editor._tiptapEditor.destroy();
6968
editor = undefined as any;
7069

packages/core/src/api/parsers/html/parseHTML.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ async function parseHTMLAndCompareSnapshots(
5555
pastedBlocks.pop(); // trailing paragraph
5656
expect(pastedBlocks).toStrictEqual(blocks);
5757

58-
editor.mount(undefined);
58+
editor.unmount();
5959
}
6060

6161
describe("Parse HTML", () => {

packages/core/src/api/parsers/markdown/parseMarkdown.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ async function parseMarkdownAndCompareSnapshots(
2727
pastedSnapshotPath
2828
);
2929

30-
editor.mount(undefined);
30+
editor.unmount();
3131
}
3232

3333
describe("Parse Markdown", () => {

packages/core/src/blocks/CodeBlockContent/CodeBlockContent.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,11 @@ const CodeBlockContent = createStronglyTypedTiptapNode({
163163
const language = (event.target as HTMLSelectElement).value;
164164

165165
editor.commands.command(({ tr }) => {
166-
tr.setNodeAttribute(getPos(), "language", language);
166+
const pos = getPos();
167+
if (!pos) {
168+
return false;
169+
}
170+
tr.setNodeAttribute(pos, "language", language);
167171

168172
return true;
169173
});

0 commit comments

Comments
 (0)