Skip to content

Commit d86b418

Browse files
committed
Merge branch 'main' into new-release
2 parents 934299b + 99385e0 commit d86b418

File tree

93 files changed

+3661
-1436
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+3661
-1436
lines changed

docs/next.config.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,11 @@ const nextConfig = withAnalyzer(
118118
destination: "/docs/advanced/vanilla-js",
119119
permanent: true,
120120
},
121+
{
122+
source: "/examples/basic/all-blocks",
123+
destination: "/examples/basic/default-blocks",
124+
permanent: true,
125+
},
121126
],
122127
experimental: {
123128
externalDir: true,

docs/pages/docs/advanced/real-time-collaboration.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ const editor = useCreateBlockNote({
3838
name: "My Username",
3939
color: "#ff0000",
4040
},
41+
// When to show user labels on the collaboration cursor. Set by default to
42+
// "activity" (show when the cursor moves), but can also be set to "always".
43+
showCursorLabels: "activity"
4144
},
4245
// ...
4346
});

docs/pages/docs/editor-basics/default-schema.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ BlockNote supports a number of built-in blocks, inline content types, and styles
1414

1515
The demo below showcases each of BlockNote's built-in block and inline content types:
1616

17-
<Example name="basic/all-blocks" />
17+
<Example name="basic/default-blocks" />
1818

1919
## Default Blocks
2020

examples/01-basic/04-all-blocks/.bnexample.json

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"playground": true,
3+
"docs": true,
4+
"author": "yousefed",
5+
"tags": ["Basic", "Blocks", "Inline Content"]
6+
}

examples/01-basic/04-all-blocks/App.tsx renamed to examples/01-basic/04-default-blocks/App.tsx

Lines changed: 3 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,11 @@
1-
import {
2-
BlockNoteSchema,
3-
combineByGroup,
4-
filterSuggestionItems,
5-
locales,
6-
} from "@blocknote/core";
71
import "@blocknote/core/fonts/inter.css";
82
import { BlockNoteView } from "@blocknote/mantine";
93
import "@blocknote/mantine/style.css";
10-
import {
11-
SuggestionMenuController,
12-
getDefaultReactSlashMenuItems,
13-
useCreateBlockNote,
14-
} from "@blocknote/react";
15-
import {
16-
getMultiColumnSlashMenuItems,
17-
multiColumnDropCursor,
18-
locales as multiColumnLocales,
19-
withMultiColumn,
20-
} from "@blocknote/xl-multi-column";
21-
import { useMemo } from "react";
4+
import { useCreateBlockNote } from "@blocknote/react";
5+
226
export default function App() {
237
// Creates a new editor instance.
248
const editor = useCreateBlockNote({
25-
schema: withMultiColumn(BlockNoteSchema.create()),
26-
dropCursor: multiColumnDropCursor,
27-
dictionary: {
28-
...locales.en,
29-
multi_column: multiColumnLocales.en,
30-
},
319
initialContent: [
3210
{
3311
type: "paragraph",
@@ -50,35 +28,6 @@ export default function App() {
5028
type: "paragraph",
5129
content: "Paragraph",
5230
},
53-
{
54-
type: "columnList",
55-
children: [
56-
{
57-
type: "column",
58-
props: {
59-
width: 0.8,
60-
},
61-
children: [
62-
{
63-
type: "paragraph",
64-
content: "Hello to the left!",
65-
},
66-
],
67-
},
68-
{
69-
type: "column",
70-
props: {
71-
width: 1.2,
72-
},
73-
children: [
74-
{
75-
type: "paragraph",
76-
content: "Hello to the right!",
77-
},
78-
],
79-
},
80-
],
81-
},
8231
{
8332
type: "heading",
8433
content: "Heading",
@@ -188,20 +137,6 @@ export default function App() {
188137
],
189138
});
190139

191-
const slashMenuItems = useMemo(() => {
192-
return combineByGroup(
193-
getDefaultReactSlashMenuItems(editor),
194-
getMultiColumnSlashMenuItems(editor)
195-
);
196-
}, [editor]);
197-
198140
// Renders the editor instance using a React component.
199-
return (
200-
<BlockNoteView editor={editor} slashMenu={false}>
201-
<SuggestionMenuController
202-
triggerCharacter={"/"}
203-
getItems={async (query) => filterSuggestionItems(slashMenuItems, query)}
204-
/>
205-
</BlockNoteView>
206-
);
141+
return <BlockNoteView editor={editor} />;
207142
}

examples/01-basic/04-all-blocks/package.json renamed to examples/01-basic/04-default-blocks/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@blocknote/example-all-blocks",
2+
"name": "@blocknote/example-default-blocks",
33
"description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
44
"private": true,
55
"version": "0.12.4",
@@ -17,8 +17,7 @@
1717
"@blocknote/mantine": "latest",
1818
"@blocknote/shadcn": "latest",
1919
"react": "^18.3.1",
20-
"react-dom": "^18.3.1",
21-
"@blocknote/xl-multi-column": "latest"
20+
"react-dom": "^18.3.1"
2221
},
2322
"devDependencies": {
2423
"@types/react": "^18.0.25",

0 commit comments

Comments
 (0)