Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions examples/07-collaboration/10-versioning/src/style.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
.mantine-AppShell-main {
padding-inline-start: 0 !important;
padding-inline-end: 0 !important;
padding: 0 !important;
height: 100%;
}
.wrapper {
height: calc(100vh - 20px);
height: 100%;
}

.wrapper > .bn-container {
Expand All @@ -11,14 +17,14 @@
.layout {
display: flex;
gap: 8px;
height: calc(100vh - 20px);
height: 100vh;
margin-left: 8px;
}

.editor-panel {
display: flex;
flex: 1;
flex-direction: column;
height: calc(100vh - 20px);
min-width: 0;
overflow: auto;
}
Expand All @@ -39,7 +45,7 @@
background-color: var(--bn-colors-disabled-background);
display: flex;
flex-direction: column;
height: calc(100vh - 20px);
height: 100vh;
overflow: auto;
width: 350px;
}
Expand Down Expand Up @@ -164,7 +170,7 @@ ins {
}

ins:hover::after {
content: attr(data-user);
content: attr(data-description);
position: absolute;
top: 100%;
left: 50%;
Expand Down Expand Up @@ -198,7 +204,7 @@ del {
}

del:hover::after {
content: attr(data-user);
content: attr(data-description);
position: absolute;
top: 100%;
left: 50%;
Expand Down
4 changes: 2 additions & 2 deletions examples/07-collaboration/11-yhub/src/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ins {
}

ins:hover::after {
content: attr(data-user);
content: attr(data-description);
position: absolute;
top: 100%;
left: 50%;
Expand Down Expand Up @@ -39,7 +39,7 @@ del {
}

del:hover::after {
content: attr(data-user);
content: attr(data-description);
position: absolute;
top: 100%;
left: 50%;
Expand Down
12 changes: 12 additions & 0 deletions examples/07-collaboration/14-multi-doc-versioning/.bnexample.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"playground": true,
"docs": false,
"author": "nperez0111",
"tags": ["Advanced", "Collaboration"],
"dependencies": {
"@y/protocols": "^1.0.6-rc.1",
"@y/websocket": "^4.0.0-3",
"@y/y": "^14.0.0-rc.16",
"lib0": "1.0.0-rc.13"
}
}
17 changes: 17 additions & 0 deletions examples/07-collaboration/14-multi-doc-versioning/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Multi-Document Collaboration with Version History

This example shows a multi-document collaborative editor with per-document version history, using BlockNote's `VersioningExtension` and Y.js v14.

**Features:**

- User picker (per-tab identity via `sessionStorage`)
- Left sidebar with document list (create, rename, delete)
- Collaborative editing with Y.js (including suggestion mode)
- Right sidebar with version history powered by `VersioningSidebar`
- Per-document versioning backed by `localStorage`
- Open multiple tabs with different users via the `?as=` URL param

**Relevant Docs:**

- [Versioning](https://www.blocknotejs.org/docs/collaboration/versioning)
- [Y.js Collaboration](https://www.blocknotejs.org/docs/collaboration)
14 changes: 14 additions & 0 deletions examples/07-collaboration/14-multi-doc-versioning/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Multi-Document Collaboration with Version History</title>
<script>
<!-- AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY -->
</script>
</head>
<body>
<div id="root"></div>
<script type="module" src="./main.tsx"></script>
</body>
</html>
11 changes: 11 additions & 0 deletions examples/07-collaboration/14-multi-doc-versioning/main.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY
import React from "react";
import { createRoot } from "react-dom/client";
import App from "./src/App.jsx";

const root = createRoot(document.getElementById("root")!);
root.render(
<React.StrictMode>
<App />
</React.StrictMode>,
);
34 changes: 34 additions & 0 deletions examples/07-collaboration/14-multi-doc-versioning/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "@blocknote/example-collaboration-multi-doc-versioning",
"description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
"type": "module",
"private": true,
"version": "0.12.4",
"scripts": {
"start": "vp dev",
"dev": "vp dev",
"build:prod": "tsc && vp build",
"preview": "vp preview"
},
"dependencies": {
"@blocknote/ariakit": "latest",
"@blocknote/core": "latest",
"@blocknote/mantine": "latest",
"@blocknote/react": "latest",
"@blocknote/shadcn": "latest",
"@mantine/core": "^9.0.2",
"@mantine/hooks": "^9.0.2",
"react": "^19.2.3",
"react-dom": "^19.2.3",
"@y/protocols": "^1.0.6-rc.1",
"@y/websocket": "^4.0.0-3",
"@y/y": "^14.0.0-rc.16",
"lib0": "1.0.0-rc.13"
},
"devDependencies": {
"@types/react": "^19.2.3",
"@types/react-dom": "^19.2.3",
"@vitejs/plugin-react": "^6.0.1",
"vite-plus": "catalog:"
}
}
Loading
Loading