Skip to content

Commit f4e7732

Browse files
fix: Minor collaboration cursor & docs changes (#1381)
* Small collaboration cursor fixes * Slight edit to dot and label height offsets * Small fix * - Updated collaboration docs with `showCursorLabels` option - Changed `all-blocks` example to `default-blocks`
1 parent 800a1f0 commit f4e7732

File tree

15 files changed

+24
-23
lines changed

15 files changed

+24
-23
lines changed

docs/next.config.mjs

+5
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

+3
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

+1-1
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

-9
This file was deleted.
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/package.json renamed to examples/01-basic/04-default-blocks/package.json

+2-3
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",

packages/core/src/editor/BlockNoteExtensions.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ const getTipTapExtensions = <
298298

299299
cursorElement.classList.add("collaboration-cursor__caret");
300300
cursorElement.setAttribute("style", `border-color: ${color}`);
301-
if (opts.collaboration?.showCursorLabels !== "always") {
301+
if (opts.collaboration?.showCursorLabels === "always") {
302302
cursorElement.setAttribute("data-active", "");
303303
}
304304

packages/core/src/editor/editor.css

+2-2
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ Tippy popups that are appended to document.body directly
104104
max-height: 4px;
105105
max-width: 4px;
106106
padding: 0;
107-
transform: translateY(3px);
107+
top: 0;
108108

109109
transition: all 0.2s;
110110

@@ -115,7 +115,7 @@ Tippy popups that are appended to document.body directly
115115
max-height: 1.1rem;
116116
max-width: 20rem;
117117
padding: 0.1rem 0.3rem;
118-
transform: translateY(-14px);
118+
top: -14px;
119119

120120
transition: all 0.2s;
121121
}

playground/src/examples.gen.tsx

+4-7
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@
6565
}
6666
},
6767
{
68-
"projectSlug": "all-blocks",
69-
"fullSlug": "basic/all-blocks",
70-
"pathFromRoot": "examples/01-basic/04-all-blocks",
68+
"projectSlug": "default-blocks",
69+
"fullSlug": "basic/default-blocks",
70+
"pathFromRoot": "examples/01-basic/04-default-blocks",
7171
"config": {
7272
"playground": true,
7373
"docs": true,
@@ -76,10 +76,7 @@
7676
"Basic",
7777
"Blocks",
7878
"Inline Content"
79-
],
80-
"dependencies": {
81-
"@blocknote/xl-multi-column": "latest"
82-
} as any
79+
]
8380
},
8481
"title": "Default Schema Showcase",
8582
"group": {

0 commit comments

Comments
 (0)