Skip to content

Commit b6c56b1

Browse files
committed
Merge remote-tracking branch 'origin/main' into releases
2 parents 0e77014 + c9a53bb commit b6c56b1

File tree

27 files changed

+1260
-1259
lines changed

27 files changed

+1260
-1259
lines changed

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ module.exports = {
2626
},
2727
ignorePatterns: ["**/ui/*"],
2828
rules: {
29+
"no-console": "error",
2930
curly: 1,
3031
"import/no-extraneous-dependencies": [
3132
"error",

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"react-github-btn": "^1.4.0",
3434
"react-icons": "^5.2.1",
3535
"y-partykit": "^0.0.25",
36-
"yjs": "^13.6.1"
36+
"yjs": "^13.6.15"
3737
},
3838
"devDependencies": {
3939
"@types/node": "^20",

examples/01-basic/03-all-blocks/App.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ export default function App() {
4040
type: "numberedListItem",
4141
content: "Numbered List Item",
4242
},
43+
{
44+
type: "checkListItem",
45+
content: "Check List Item",
46+
},
4347
{
4448
type: "table",
4549
content: {

examples/06-collaboration/01-partykit/.bnexample.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
"tags": ["Advanced", "Saving/Loading", "Collaboration"],
66
"dependencies": {
77
"y-partykit": "^0.0.25",
8-
"yjs": "^13.6.1"
8+
"yjs": "^13.6.15"
99
}
1010
}

examples/06-collaboration/01-partykit/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"react": "^18.2.0",
2020
"react-dom": "^18.2.0",
2121
"y-partykit": "^0.0.25",
22-
"yjs": "^13.6.1"
22+
"yjs": "^13.6.15"
2323
},
2424
"devDependencies": {
2525
"@types/react": "^18.0.25",

examples/06-collaboration/02-liveblocks/.bnexample.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
"@liveblocks/client": "^1.10.0",
88
"@liveblocks/react": "^1.10.0",
99
"@liveblocks/yjs": "^1.10.0",
10-
"yjs": "^13.6.1"
10+
"yjs": "^13.6.15"
1111
}
1212
}

examples/06-collaboration/02-liveblocks/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"@liveblocks/client": "^1.10.0",
2222
"@liveblocks/react": "^1.10.0",
2323
"@liveblocks/yjs": "^1.10.0",
24-
"yjs": "^13.6.1"
24+
"yjs": "^13.6.15"
2525
},
2626
"devDependencies": {
2727
"@types/react": "^18.0.25",

package-lock.json

Lines changed: 1166 additions & 1178 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,5 @@
3333
"prepublishOnly": "npm run build && cp README.md packages/core/README.md && cp README.md packages/react/README.md",
3434
"postpublish": "rm -rf packages/core/README.md && rm -rf packages/react/README.md",
3535
"clean": "lerna run --stream clean"
36-
},
37-
"overrides": {
38-
"react": "18.2.0",
39-
"react-dom": "18.2.0",
40-
"prosemirror-model": "1.18.3"
4136
}
4237
}

packages/core/package.json

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -54,32 +54,32 @@
5454
"clean": "rimraf dist && rimraf types"
5555
},
5656
"dependencies": {
57-
"@tiptap/core": "^2.0.3",
58-
"@tiptap/extension-bold": "^2.0.3",
59-
"@tiptap/extension-code": "^2.0.3",
60-
"@tiptap/extension-collaboration": "^2.0.3",
61-
"@tiptap/extension-collaboration-cursor": "^2.0.3",
62-
"@tiptap/extension-dropcursor": "^2.0.3",
63-
"@tiptap/extension-gapcursor": "^2.0.3",
64-
"@tiptap/extension-hard-break": "^2.0.3",
65-
"@tiptap/extension-history": "^2.0.3",
66-
"@tiptap/extension-horizontal-rule": "^2.0.3",
67-
"@tiptap/extension-italic": "^2.0.3",
68-
"@tiptap/extension-link": "^2.0.3",
69-
"@tiptap/extension-paragraph": "^2.0.3",
70-
"@tiptap/extension-strike": "^2.0.3",
71-
"@tiptap/extension-table-cell": "^2.0.3",
72-
"@tiptap/extension-table-header": "^2.0.3",
73-
"@tiptap/extension-table-row": "^2.0.3",
74-
"@tiptap/extension-text": "^2.0.3",
75-
"@tiptap/extension-underline": "^2.0.3",
76-
"@tiptap/pm": "^2.0.3",
57+
"@tiptap/core": "^2.4.0",
58+
"@tiptap/extension-bold": "^2.4.0",
59+
"@tiptap/extension-code": "^2.4.0",
60+
"@tiptap/extension-collaboration": "^2.4.0",
61+
"@tiptap/extension-collaboration-cursor": "^2.4.0",
62+
"@tiptap/extension-dropcursor": "^2.4.0",
63+
"@tiptap/extension-gapcursor": "^2.4.0",
64+
"@tiptap/extension-hard-break": "^2.4.0",
65+
"@tiptap/extension-history": "^2.4.0",
66+
"@tiptap/extension-horizontal-rule": "^2.4.0",
67+
"@tiptap/extension-italic": "^2.4.0",
68+
"@tiptap/extension-link": "^2.4.0",
69+
"@tiptap/extension-paragraph": "^2.4.0",
70+
"@tiptap/extension-strike": "^2.4.0",
71+
"@tiptap/extension-table-cell": "^2.4.0",
72+
"@tiptap/extension-table-header": "^2.4.0",
73+
"@tiptap/extension-table-row": "^2.4.0",
74+
"@tiptap/extension-text": "^2.4.0",
75+
"@tiptap/extension-underline": "^2.4.0",
76+
"@tiptap/pm": "^2.4.0",
7777
"hast-util-from-dom": "^4.2.0",
78-
"prosemirror-model": "^1.18.3",
78+
"prosemirror-model": "^1.21.0",
7979
"prosemirror-state": "^1.4.3",
80-
"prosemirror-tables": "^1.3.4",
81-
"prosemirror-transform": "^1.7.2",
82-
"prosemirror-view": "^1.31.4",
80+
"prosemirror-tables": "^1.3.7",
81+
"prosemirror-transform": "^1.9.0",
82+
"prosemirror-view": "^1.33.7",
8383
"rehype-format": "^5.0.0",
8484
"rehype-parse": "^8.0.4",
8585
"rehype-remark": "^9.1.2",
@@ -90,9 +90,9 @@
9090
"remark-stringify": "^10.0.2",
9191
"unified": "^10.1.2",
9292
"uuid": "^8.3.2",
93-
"y-prosemirror": "1.2.1",
94-
"y-protocols": "^1.0.5",
95-
"yjs": "^13.6.1"
93+
"y-prosemirror": "1.2.5",
94+
"y-protocols": "^1.0.6",
95+
"yjs": "^13.6.15"
9696
},
9797
"devDependencies": {
9898
"@types/hast": "^2.3.4",

packages/core/src/editor/BlockNoteEditor.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,7 @@ export class BlockNoteEditor<
307307
this.resolveFileUrl = newOptions.resolveFileUrl || (async (url) => url);
308308

309309
if (newOptions.collaboration && newOptions.initialContent) {
310+
// eslint-disable-next-line no-console
310311
console.warn(
311312
"When using Collaboration, initialContent might cause conflicts, because changes should come from the collaboration provider"
312313
);
@@ -777,6 +778,7 @@ export class BlockNoteEditor<
777778
for (const mark of marks) {
778779
const config = this.schema.styleSchema[mark.type.name];
779780
if (!config) {
781+
// eslint-disable-next-line no-console
780782
console.warn("mark not found in styleschema", mark.type.name);
781783
continue;
782784
}

packages/core/src/editor/BlockNoteTipTapEditor.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ export class BlockNoteTipTapEditor extends TiptapEditor {
8787
this.options.parseOptions
8888
);
8989
} catch (e) {
90+
// eslint-disable-next-line no-console
9091
console.error(
9192
"Error creating document from blocks passed as `initialContent`. Caused by exception: ",
9293
e

packages/core/src/i18n/locales/zh.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export const zh: Dictionary = {
6161
"勾选列表",
6262
"复选框",
6363
],
64-
group: "基本块",
64+
group: "基础",
6565
},
6666
paragraph: {
6767
title: "段落",

packages/core/src/schema/blocks/createSpec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ParseRule } from "@tiptap/pm/model";
1+
import { TagParseRule } from "@tiptap/pm/model";
22
import type { BlockNoteEditor } from "../../editor/BlockNoteEditor";
33
import { InlineContentSchema } from "../inlineContent/types";
44
import { StyleSchema } from "../styles/types";
@@ -68,7 +68,7 @@ export function getParseRules(
6868
config: BlockConfig,
6969
customParseFunction: CustomBlockImplementation<any, any, any>["parse"]
7070
) {
71-
const rules: ParseRule[] = [
71+
const rules: TagParseRule[] = [
7272
{
7373
tag: "[data-content-type=" + config.type + "]",
7474
contentElement: "[data-editable]",

packages/core/src/schema/inlineContent/createSpec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Node } from "@tiptap/core";
2-
import { ParseRule } from "@tiptap/pm/model";
2+
import { TagParseRule } from "@tiptap/pm/model";
33
import { nodeToCustomInlineContent } from "../../api/nodeConversions/nodeConversions";
44
import { propsToAttributes } from "../blocks/internal";
55
import { Props } from "../propTypes";
@@ -46,7 +46,7 @@ export type CustomInlineContentImplementation<
4646

4747
export function getInlineContentParseRules(
4848
config: CustomInlineContentConfig
49-
): ParseRule[] {
49+
): TagParseRule[] {
5050
return [
5151
{
5252
tag: `[data-inline-content-type="${config.type}"]`,

packages/dev-scripts/examples/gen.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ async function writeTemplate(project: Project, templateFile: string) {
5151
// try {
5252
// // fs.unlinkSync(targetFilePath);
5353
// } catch (e) {}
54+
// eslint-disable-next-line no-console
5455
console.log("written", targetFilePath);
5556
}
5657

@@ -79,6 +80,7 @@ async function generateExamplesData(projects: Project[]) {
7980
const projects = getExampleProjects();
8081

8182
for (const project of projects) {
83+
// eslint-disable-next-line no-console
8284
console.log("generating code for example", project);
8385
await generateCodeForExample(project);
8486
}

packages/react/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@
5252
"dependencies": {
5353
"@blocknote/core": "^0.13.4",
5454
"@floating-ui/react": "^0.26.4",
55-
"@tiptap/core": "^2.0.3",
56-
"@tiptap/react": "^2.0.3",
55+
"@tiptap/core": "^2.4.0",
56+
"@tiptap/react": "^2.4.0",
5757
"lodash.merge": "^4.6.2",
5858
"react": "^18",
5959
"react-dom": "^18",

packages/react/src/components/FormattingToolbar/FormattingToolbarController.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ export const FormattingToolbarController = (props: {
8080
{
8181
placement,
8282
middleware: [offset(10), flip()],
83-
onOpenChange: (open, event) => {
84-
console.log("change", event);
83+
onOpenChange: (open, _event) => {
84+
// console.log("change", event);
8585
if (!open) {
8686
editor.formattingToolbar.closeMenu();
8787
editor.focus();

packages/react/src/components/SuggestionMenu/SuggestionMenu.test.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,14 @@ it("has good typing", () => {
3333
suggestionMenuComponent={undefined as any}
3434
getItems={async () => [{ hello: "hello" }]}
3535
onItemClick={(item) => {
36+
// eslint-disable-next-line no-console
3637
console.log(item.hello);
3738
}}
3839
triggerCharacter="/"
3940
/>
4041
);
4142

4243
// prevent typescript unused error
44+
// eslint-disable-next-line no-console
4345
console.log("menu", menu);
4446
});

packages/react/src/editor/BlockNoteView.tsx

Lines changed: 33 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -30,38 +30,44 @@ const emptyFn = () => {
3030
// noop
3131
};
3232

33+
export type BlockNoteViewProps<
34+
BSchema extends BlockSchema,
35+
ISchema extends InlineContentSchema,
36+
SSchema extends StyleSchema
37+
> = {
38+
editor: BlockNoteEditor<BSchema, ISchema, SSchema>;
39+
40+
theme?: "light" | "dark";
41+
42+
/**
43+
* Locks the editor from being editable by the user if set to `false`.
44+
*/
45+
editable?: boolean;
46+
/**
47+
* A callback function that runs whenever the text cursor position or selection changes.
48+
*/
49+
onSelectionChange?: () => void;
50+
51+
/**
52+
* A callback function that runs whenever the editor's contents change.
53+
*/
54+
onChange?: () => void;
55+
56+
children?: ReactNode;
57+
58+
ref?: Ref<HTMLDivElement> | undefined; // only here to get types working with the generics. Regular form doesn't work
59+
} & Omit<
60+
HTMLAttributes<HTMLDivElement>,
61+
"onChange" | "onSelectionChange" | "children"
62+
> &
63+
BlockNoteDefaultUIProps;
64+
3365
function BlockNoteViewComponent<
3466
BSchema extends BlockSchema,
3567
ISchema extends InlineContentSchema,
3668
SSchema extends StyleSchema
3769
>(
38-
props: {
39-
editor: BlockNoteEditor<BSchema, ISchema, SSchema>;
40-
41-
theme?: "light" | "dark";
42-
43-
/**
44-
* Locks the editor from being editable by the user if set to `false`.
45-
*/
46-
editable?: boolean;
47-
/**
48-
* A callback function that runs whenever the text cursor position or selection changes.
49-
*/
50-
onSelectionChange?: () => void;
51-
52-
/**
53-
* A callback function that runs whenever the editor's contents change.
54-
*/
55-
onChange?: () => void;
56-
57-
children?: ReactNode;
58-
59-
ref?: Ref<HTMLDivElement> | undefined; // only here to get types working with the generics. Regular form doesn't work
60-
} & Omit<
61-
HTMLAttributes<HTMLDivElement>,
62-
"onChange" | "onSelectionChange" | "children"
63-
> &
64-
BlockNoteDefaultUIProps,
70+
props: BlockNoteViewProps<BSchema, ISchema, SSchema>,
6571
ref: React.Ref<HTMLDivElement>
6672
) {
6773
const {

packages/react/src/schema/@util/ReactRenderUtil.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export function renderToDOMSpec(
2828

2929
if (!div.childElementCount) {
3030
// TODO
31+
// eslint-disable-next-line no-console
3132
console.warn("ReactInlineContentSpec: renderHTML() failed");
3233
return {
3334
dom: document.createElement("span"),

playground/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"react-icons": "^5.2.1",
2424
"react-router-dom": "^6.20.0",
2525
"y-partykit": "^0.0.25",
26-
"yjs": "^13.6.10"
26+
"yjs": "^13.6.15"
2727
},
2828
"devDependencies": {
2929
"@types/react": "^18.0.25",

playground/src/examples.gen.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@
759759
],
760760
"dependencies": {
761761
"y-partykit": "^0.0.25",
762-
"yjs": "^13.6.1"
762+
"yjs": "^13.6.15"
763763
}
764764
},
765765
"title": "Collaborative Editing with PartyKit",
@@ -785,7 +785,7 @@
785785
"@liveblocks/client": "^1.10.0",
786786
"@liveblocks/react": "^1.10.0",
787787
"@liveblocks/yjs": "^1.10.0",
788-
"yjs": "^13.6.1"
788+
"yjs": "^13.6.15"
789789
}
790790
},
791791
"title": "Collaborative Editing with Liveblocks",

playground/src/main.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ const App = (props: { project: (typeof examples.basic)["projects"][0] }) => {
9696
React.useEffect(() => {
9797
(async () => {
9898
// load app async
99-
console.log("../../" + props.project.pathFromRoot + "/App.tsx");
10099
const c: any = await modules[
101100
"../../" + props.project.pathFromRoot + "/App.tsx"
102101
]();

tests/src/utils/components/Editor.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { BlockNoteSchema, filterSuggestionItems } from "@blocknote/core";
22
import "@blocknote/core/style.css";
3+
import { BlockNoteView } from "@blocknote/mantine";
4+
import "@blocknote/mantine/style.css";
35
import {
46
BlockNoteDefaultUI,
57
SuggestionMenuController,
68
getDefaultReactSlashMenuItems,
79
useCreateBlockNote,
810
} from "@blocknote/react";
9-
import { BlockNoteView } from "@blocknote/mantine";
10-
import "@blocknote/mantine/style.css";
1111

1212
import { Alert, insertAlert } from "../customblocks/Alert";
1313
import { Button } from "../customblocks/Button";
@@ -24,8 +24,6 @@ const schema = BlockNoteSchema.create({
2424
export default function Editor() {
2525
const editor = useCreateBlockNote({ schema });
2626

27-
console.log(editor);
28-
2927
// Give tests a way to get prosemirror instance
3028
(window as WindowWithProseMirror).ProseMirror = editor?._tiptapEditor;
3129
// editor.insertBlocks([{

0 commit comments

Comments
 (0)