Skip to content

Commit ac61814

Browse files
committed
Merge remote-tracking branch 'origin/main' into feature/ai-autocomplete
2 parents 656d9eb + ec19b21 commit ac61814

File tree

35 files changed

+337
-326
lines changed

35 files changed

+337
-326
lines changed

CHANGELOG.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,34 @@
1+
## 0.42.3 (2025-11-19)
2+
3+
### 🩹 Fixes
4+
5+
- disallow access to the `domElement` or `isFocused` if the editor is unmounted ([#2187](https://github.com/TypeCellOS/BlockNote/pull/2187))
6+
7+
### ❤️ Thank You
8+
9+
- Nick Perez
10+
11+
## 0.42.2 (2025-11-19)
12+
13+
### 🩹 Fixes
14+
15+
- put back mounting system ([#2183](https://github.com/TypeCellOS/BlockNote/pull/2183))
16+
17+
### ❤️ Thank You
18+
19+
- Nick Perez
20+
21+
## 0.42.1 (2025-11-18)
22+
23+
### 🩹 Fixes
24+
25+
- do not error on invalid `backgroundColor` or `textColor` #2176 ([#2179](https://github.com/TypeCellOS/BlockNote/pull/2179), [#2176](https://github.com/TypeCellOS/BlockNote/issues/2176))
26+
- remove dependency array from comments re-rendering ([#2177](https://github.com/TypeCellOS/BlockNote/pull/2177))
27+
28+
### ❤️ Thank You
29+
30+
- Nick Perez
31+
132
## 0.42.0 (2025-11-11)
233

334
### 🚀 Features

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"@shikijs/langs-precompiled": "^3.2.1",
5757
"@shikijs/themes": "^3.2.1",
5858
"@shikijs/types": "^3.2.1",
59-
"@tiptap/core": "^3.10.2",
59+
"@tiptap/core": "^3.11.0",
6060
"@uppy/core": "^3.13.1",
6161
"@uppy/dashboard": "^3.9.1",
6262
"@uppy/drag-drop": "^3.1.1",

examples/08-extensions/01-tiptap-arrow-conversion/.bnexample.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
"tags": ["Extension"],
66
"pro": true,
77
"dependencies": {
8-
"@tiptap/core": "^3.10.2"
8+
"@tiptap/core": "^3.11.0"
99
}
1010
}

examples/08-extensions/01-tiptap-arrow-conversion/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"@mantine/utils": "^6.0.22",
2222
"react": "^19.2.0",
2323
"react-dom": "^19.2.0",
24-
"@tiptap/core": "^3.10.2"
24+
"@tiptap/core": "^3.11.0"
2525
},
2626
"devDependencies": {
2727
"@types/react": "^19.2.2",

packages/ariakit/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"directory": "packages/ariakit"
1212
},
1313
"license": "MPL-2.0",
14-
"version": "0.42.0",
14+
"version": "0.42.3",
1515
"files": [
1616
"dist",
1717
"types",
@@ -57,8 +57,8 @@
5757
},
5858
"dependencies": {
5959
"@ariakit/react": "^0.4.19",
60-
"@blocknote/core": "0.42.0",
61-
"@blocknote/react": "0.42.0"
60+
"@blocknote/core": "0.42.3",
61+
"@blocknote/react": "0.42.3"
6262
},
6363
"devDependencies": {
6464
"@types/react": "^19.2.2",

packages/code-block/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"directory": "packages/code-block"
1010
},
1111
"license": "MPL-2.0",
12-
"version": "0.42.0",
12+
"version": "0.42.3",
1313
"files": [
1414
"dist",
1515
"types",
@@ -49,7 +49,7 @@
4949
"test-watch": "vitest watch"
5050
},
5151
"dependencies": {
52-
"@blocknote/core": "0.42.0",
52+
"@blocknote/core": "0.42.3",
5353
"@shikijs/core": "^3.13.0",
5454
"@shikijs/engine-javascript": "^3.13.0",
5555
"@shikijs/langs": "^3.13.0",

packages/core/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"directory": "packages/core"
1212
},
1313
"license": "MPL-2.0",
14-
"version": "0.42.0",
14+
"version": "0.42.3",
1515
"files": [
1616
"dist",
1717
"types",
@@ -86,7 +86,7 @@
8686
"dependencies": {
8787
"@emoji-mart/data": "^1.2.1",
8888
"@shikijs/types": "3.13.0",
89-
"@tiptap/core": "^3.10.2",
89+
"@tiptap/core": "^3.11.0",
9090
"@tiptap/extension-bold": "^3.7.2",
9191
"@tiptap/extension-code": "^3.7.2",
9292
"@tiptap/extension-gapcursor": "^3.7.2",
@@ -98,7 +98,7 @@
9898
"@tiptap/extension-strike": "^3.7.2",
9999
"@tiptap/extension-text": "^3.7.2",
100100
"@tiptap/extension-underline": "^3.7.2",
101-
"@tiptap/pm": "^3.10.2",
101+
"@tiptap/pm": "^3.11.0",
102102
"emoji-mart": "^5.6.0",
103103
"fast-deep-equal": "^3.1.3",
104104
"hast-util-from-dom": "^5.0.1",
@@ -107,7 +107,7 @@
107107
"prosemirror-model": "^1.25.4",
108108
"prosemirror-state": "^1.4.4",
109109
"prosemirror-tables": "^1.8.1",
110-
"prosemirror-transform": "^1.10.4",
110+
"prosemirror-transform": "^1.10.5",
111111
"prosemirror-view": "^1.41.3",
112112
"rehype-format": "^5.0.1",
113113
"rehype-parse": "^9.0.1",

packages/core/src/editor/BlockNoteEditor.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ it("onMount and onUnmount", async () => {
120120
expect(unmounted).toBe(false);
121121
editor.unmount();
122122
// expect the unmount event to not have been triggered yet, since it waits 2 ticks
123-
expect(unmounted).toBe(false);
123+
// expect(unmounted).toBe(false);
124124
// wait 3 ticks to ensure the unmount event is triggered
125125
await new Promise((resolve) => setTimeout(resolve, 3));
126126
expect(mounted).toBe(true);

packages/core/src/editor/BlockNoteEditor.ts

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,40 +1054,14 @@ export class BlockNoteEditor<
10541054
* @warning Not needed to call manually when using React, use BlockNoteView to take care of mounting
10551055
*/
10561056
public mount = (element: HTMLElement) => {
1057-
if (
1058-
// If the editor is scheduled for destruction, and
1059-
this.scheduledDestructionTimeout &&
1060-
// If the editor is being remounted to the same element as the one which is scheduled for destruction,
1061-
// then just cancel the destruction timeout
1062-
this.prosemirrorView.dom === element
1063-
) {
1064-
clearTimeout(this.scheduledDestructionTimeout);
1065-
this.scheduledDestructionTimeout = undefined;
1066-
return;
1067-
}
1068-
10691057
this._tiptapEditor.mount({ mount: element });
10701058
};
10711059

1072-
/**
1073-
* Timeout to schedule the {@link unmount}ing of the editor.
1074-
*/
1075-
private scheduledDestructionTimeout:
1076-
| ReturnType<typeof setTimeout>
1077-
| undefined = undefined;
1078-
10791060
/**
10801061
* Unmount the editor from the DOM element it is bound to
10811062
*/
10821063
public unmount = () => {
1083-
// Due to how React's StrictMode works, it will `unmount` & `mount` the component twice in development mode.
1084-
// This can result in the editor being unmounted mid-rendering the content of node views.
1085-
// To avoid this, we only ever schedule the `unmount`ing of the editor when we've seen whether React "meant" to actually unmount the editor (i.e. not calling mount one tick later).
1086-
// So, we wait two ticks to see if the component is still meant to be unmounted, and if not, we actually unmount the editor.
1087-
this.scheduledDestructionTimeout = setTimeout(() => {
1088-
this._tiptapEditor.unmount();
1089-
this.scheduledDestructionTimeout = undefined;
1090-
}, 1);
1064+
this._tiptapEditor.unmount();
10911065
};
10921066

10931067
/**
@@ -1108,10 +1082,16 @@ export class BlockNoteEditor<
11081082
}
11091083

11101084
public get domElement() {
1085+
if (this.headless) {
1086+
return undefined;
1087+
}
11111088
return this.prosemirrorView?.dom as HTMLDivElement | undefined;
11121089
}
11131090

11141091
public isFocused() {
1092+
if (this.headless) {
1093+
return false;
1094+
}
11151095
return this.prosemirrorView?.hasFocus() || false;
11161096
}
11171097

@@ -1699,7 +1679,7 @@ export class BlockNoteEditor<
16991679
ignoreQueryLength?: boolean;
17001680
},
17011681
) {
1702-
if (!this.prosemirrorView) {
1682+
if (!this.prosemirrorView || this.headless) {
17031683
return;
17041684
}
17051685

packages/dev-scripts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"directory": "packages/dev-scripts"
99
},
1010
"license": "MPL-2.0",
11-
"version": "0.42.0",
11+
"version": "0.42.3",
1212
"description": "",
1313
"type": "module",
1414
"scripts": {

0 commit comments

Comments
 (0)