diff --git a/docs/app/(home)/hero/DemoEditor.tsx b/docs/app/(home)/hero/DemoEditor.tsx
index bc8d3d4a89..e2587414af 100644
--- a/docs/app/(home)/hero/DemoEditor.tsx
+++ b/docs/app/(home)/hero/DemoEditor.tsx
@@ -22,7 +22,7 @@ import {
import { useTheme } from "next-themes";
import { useCallback, useMemo, useState } from "react";
import YPartyKitProvider from "y-partykit/provider";
-import * as Y from "yjs";
+import * as Y from "@y/y";
const colors = [
"#958DF1",
diff --git a/docs/content/docs/features/collaboration/index.mdx b/docs/content/docs/features/collaboration/index.mdx
index 8c2557a5da..a21fe8a3fd 100644
--- a/docs/content/docs/features/collaboration/index.mdx
+++ b/docs/content/docs/features/collaboration/index.mdx
@@ -24,7 +24,7 @@ _Try the live demo on the [homepage](https://www.blocknotejs.org)_
BlockNote uses [Yjs](https://github.com/yjs/yjs) for this, and you can set it up with the `collaboration` option:
```typescript
-import * as Y from "yjs";
+import * as Y from "@y/y";
import { WebrtcProvider } from "y-webrtc";
// ...
diff --git a/docs/content/docs/reference/editor/yjs-utilities.mdx b/docs/content/docs/reference/editor/yjs-utilities.mdx
index 50ead8d1c6..7da2a9e250 100644
--- a/docs/content/docs/reference/editor/yjs-utilities.mdx
+++ b/docs/content/docs/reference/editor/yjs-utilities.mdx
@@ -75,7 +75,7 @@ function blocksToYDoc<
```typescript
import { BlockNoteEditor } from "@blocknote/core";
import { blocksToYDoc } from "@blocknote/core/yjs";
-import * as Y from "yjs";
+import * as Y from "@y/y";
const editor = BlockNoteEditor.create();
@@ -127,7 +127,7 @@ function blocksToYXmlFragment<
```typescript
import { BlockNoteEditor } from "@blocknote/core";
import { blocksToYXmlFragment } from "@blocknote/core/yjs";
-import * as Y from "yjs";
+import * as Y from "@y/y";
const editor = BlockNoteEditor.create();
const doc = new Y.Doc();
@@ -175,7 +175,7 @@ function yDocToBlocks<
```typescript
import { BlockNoteEditor } from "@blocknote/core";
import { yDocToBlocks } from "@blocknote/core/yjs";
-import * as Y from "yjs";
+import * as Y from "@y/y";
const editor = BlockNoteEditor.create();
const ydoc = new Y.Doc();
@@ -215,7 +215,7 @@ function yXmlFragmentToBlocks<
```typescript
import { BlockNoteEditor } from "@blocknote/core";
import { yXmlFragmentToBlocks } from "@blocknote/core/yjs";
-import * as Y from "yjs";
+import * as Y from "@y/y";
const editor = BlockNoteEditor.create();
const doc = new Y.Doc();
diff --git a/docs/package.json b/docs/package.json
index 51290a6cc4..dd5b8a699f 100644
--- a/docs/package.json
+++ b/docs/package.json
@@ -35,11 +35,6 @@
"@fumadocs/mdx-remote": "1.3.0",
"@headlessui/react": "^2.2.9",
"@heroicons/react": "^2.2.0",
- "@liveblocks/client": "3.7.1-tiptap3",
- "@liveblocks/react": "3.7.1-tiptap3",
- "@liveblocks/react-blocknote": "3.7.1-tiptap3",
- "@liveblocks/react-tiptap": "3.7.1-tiptap3",
- "@liveblocks/react-ui": "3.7.1-tiptap3",
"@mantine/core": "^8.3.4",
"@mantine/hooks": "^8.3.4",
"@mantine/utils": "^6.0.22",
@@ -70,7 +65,6 @@
"@uppy/xhr-upload": "^3.4.0",
"@vercel/analytics": "^1.5.0",
"@vercel/og": "^0.6.8",
- "@y-sweet/react": "^0.6.3",
"ai": "^5.0.102",
"babel-plugin-react-compiler": "19.1.0-rc.2",
"better-auth": "^1.3.27",
@@ -88,7 +82,6 @@
"import-in-the-middle": "^1.15.0",
"next": "15.5.9",
"nodemailer": "^7.0.11",
- "partykit": "^0.0.115",
"pg": "^8.16.3",
"react": "^19.2.1",
"react-dom": "^19.2.1",
@@ -101,8 +94,7 @@
"shiki": "^3.13.0",
"ts-morph": "26.0.0",
"twoslash": "^0.3.4",
- "y-partykit": "^0.0.25",
- "yjs": "^13.6.27",
+ "@y/y": "14.0.0-19",
"zod": "^3.25.76"
},
"devDependencies": {
@@ -115,9 +107,6 @@
"@blocknote/xl-docx-exporter": "workspace:*",
"@blocknote/xl-multi-column": "workspace:*",
"@blocknote/xl-pdf-exporter": "workspace:*",
- "@liveblocks/react": "^2.24.3",
- "@liveblocks/react-tiptap": "^2.24.3",
- "@liveblocks/react-ui": "^2.24.3",
"@mui/material": "^5.17.1",
"@react-email/components": "^0.0.36",
"@react-pdf/renderer": "^4.3.0",
@@ -129,7 +118,6 @@
"@types/pg": "8.11.14",
"@types/react": "^19.2.2",
"@types/react-dom": "^19.2.2",
- "@y-sweet/react": "^0.6.4",
"next-themes": "0.4.6",
"next-validate-link": "^1.6.3",
"postcss": "^8.5.6",
@@ -138,7 +126,6 @@
"tailwindcss": "^4.1.14",
"tw-animate-css": "^1.4.0",
"typescript": "^5.9.3",
- "y-partykit": "^0.0.33",
- "yjs": "^13.6.27"
+ "@y/y": "14.0.0-19"
}
-}
\ No newline at end of file
+}
diff --git a/examples/01-basic/01-minimal/package.json b/examples/01-basic/01-minimal/package.json
index e33d53239f..61a9846d32 100644
--- a/examples/01-basic/01-minimal/package.json
+++ b/examples/01-basic/01-minimal/package.json
@@ -11,6 +11,8 @@
"preview": "vite preview"
},
"dependencies": {
+ "@y/protocols": "1.0.6-3",
+ "@y/y": "14.0.0-19",
"@blocknote/ariakit": "latest",
"@blocknote/core": "latest",
"@blocknote/mantine": "latest",
@@ -28,4 +30,4 @@
"@vitejs/plugin-react": "^4.7.0",
"vite": "^5.4.20"
}
-}
\ No newline at end of file
+}
diff --git a/examples/01-basic/01-minimal/src/App.tsx b/examples/01-basic/01-minimal/src/App.tsx
index a3b92bafd2..1eabd5cdaf 100644
--- a/examples/01-basic/01-minimal/src/App.tsx
+++ b/examples/01-basic/01-minimal/src/App.tsx
@@ -2,11 +2,142 @@ import "@blocknote/core/fonts/inter.css";
import { BlockNoteView } from "@blocknote/mantine";
import "@blocknote/mantine/style.css";
import { useCreateBlockNote } from "@blocknote/react";
+import * as Y from "@y/y";
+import { Awareness } from "@y/protocols/awareness";
-export default function App() {
- // Creates a new editor instance.
- const editor = useCreateBlockNote();
+const doc = new Y.Doc();
+const provider = {
+ awareness: new Awareness(doc),
+};
+
+const doc2 = new Y.Doc();
+const provider2 = {
+ awareness: new Awareness(doc2),
+};
+
+const suggestingDoc = new Y.Doc({ isSuggestionDoc: true });
+const suggestingProvider = {
+ awareness: new Awareness(suggestingDoc),
+};
+const suggestingAttributionManager = Y.createAttributionManagerFromDiff(
+ doc,
+ suggestingDoc,
+ {
+ attrs: [Y.createAttributionItem("insert", ["nickthesick"])],
+ },
+);
+suggestingAttributionManager.suggestionMode = false;
+
+const suggestionModeDoc = new Y.Doc({ isSuggestionDoc: true });
+const suggestionModeProvider = {
+ awareness: new Awareness(suggestionModeDoc),
+};
+const suggestionModeAttributionManager = Y.createAttributionManagerFromDiff(
+ doc,
+ suggestionModeDoc,
+ { attrs: [Y.createAttributionItem("insert", ["nickthesick"])] },
+);
+suggestionModeAttributionManager.suggestionMode = true;
+
+// Function to sync two documents
+function syncDocs(sourceDoc: Y.Doc, targetDoc: Y.Doc) {
+ // Create update message from source
+ const update = Y.encodeStateAsUpdate(sourceDoc);
+
+ // Apply update to target
+ Y.applyUpdate(targetDoc, update);
+}
+
+// Set up two-way sync
+function setupTwoWaySync(doc1: Y.Doc, doc2: Y.Doc) {
+ // Sync initial states
+ syncDocs(doc1, doc2);
+ syncDocs(doc2, doc1);
+
+ // Set up observers for future changes
+ doc1.on("update", (update: Uint8Array) => {
+ Y.applyUpdate(doc2, update);
+ });
+
+ doc2.on("update", (update: Uint8Array) => {
+ Y.applyUpdate(doc1, update);
+ });
+}
+
+setupTwoWaySync(doc, doc2);
+
+setupTwoWaySync(suggestingDoc, suggestionModeDoc);
+
+function Editor({
+ fragment,
+ provider,
+ attributionManager,
+}: {
+ fragment: Y.XmlFragment;
+ provider: { awareness: Awareness };
+ attributionManager?: Y.AbstractAttributionManager;
+}) {
+ const editor = useCreateBlockNote({
+ collaboration: {
+ fragment,
+ provider,
+ user: {
+ name: "Hello",
+ color: "#FFFFFF",
+ },
+ attributionManager,
+ },
+ });
- // Renders the editor instance using a React component.
return ;
}
+
+export default function App() {
+ // Renders the editor instance using a React component.
+ return (
+
+
+
+ Client A
+
+
+
+ Client B
+
+
+
+
+
+ View Suggestions Mode
+
+
+
+ Suggestion Mode
+
+
+
+
+ );
+}
diff --git a/examples/07-collaboration/01-partykit/.bnexample.json b/examples/07-collaboration/01-partykit/.bnexample.json
deleted file mode 100644
index 87250048fe..0000000000
--- a/examples/07-collaboration/01-partykit/.bnexample.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "playground": true,
- "docs": true,
- "author": "yousefed",
- "tags": ["Advanced", "Saving/Loading", "Collaboration"],
- "dependencies": {
- "y-partykit": "^0.0.25",
- "yjs": "^13.6.27"
- }
-}
diff --git a/examples/07-collaboration/01-partykit/README.md b/examples/07-collaboration/01-partykit/README.md
deleted file mode 100644
index 600fcd0943..0000000000
--- a/examples/07-collaboration/01-partykit/README.md
+++ /dev/null
@@ -1,10 +0,0 @@
-# Collaborative Editing with PartyKit
-
-In this example, we use PartyKit to let multiple users collaborate on a single BlockNote document in real-time.
-
-**Try it out:** Open this page in a new browser tab or window to see it in action!
-
-**Relevant Docs:**
-
-- [Editor Setup](/docs/getting-started/editor-setup)
-- [PartyKit](/docs/features/collaboration#partykit)
diff --git a/examples/07-collaboration/01-partykit/index.html b/examples/07-collaboration/01-partykit/index.html
deleted file mode 100644
index 707eae21e1..0000000000
--- a/examples/07-collaboration/01-partykit/index.html
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
- Collaborative Editing with PartyKit
-
-
-
-
-
-
-
diff --git a/examples/07-collaboration/01-partykit/main.tsx b/examples/07-collaboration/01-partykit/main.tsx
deleted file mode 100644
index 677c7f7eed..0000000000
--- a/examples/07-collaboration/01-partykit/main.tsx
+++ /dev/null
@@ -1,11 +0,0 @@
-// 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(
-
-
-
-);
diff --git a/examples/07-collaboration/01-partykit/package.json b/examples/07-collaboration/01-partykit/package.json
deleted file mode 100644
index 4f77f3f17b..0000000000
--- a/examples/07-collaboration/01-partykit/package.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "name": "@blocknote/example-collaboration-partykit",
- "description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
- "type": "module",
- "private": true,
- "version": "0.12.4",
- "scripts": {
- "start": "vite",
- "dev": "vite",
- "build:prod": "tsc && vite build",
- "preview": "vite preview"
- },
- "dependencies": {
- "@blocknote/ariakit": "latest",
- "@blocknote/core": "latest",
- "@blocknote/mantine": "latest",
- "@blocknote/react": "latest",
- "@blocknote/shadcn": "latest",
- "@mantine/core": "^8.3.4",
- "@mantine/hooks": "^8.3.4",
- "@mantine/utils": "^6.0.22",
- "react": "^19.2.1",
- "react-dom": "^19.2.1",
- "y-partykit": "^0.0.25",
- "yjs": "^13.6.27"
- },
- "devDependencies": {
- "@types/react": "^19.2.2",
- "@types/react-dom": "^19.2.2",
- "@vitejs/plugin-react": "^4.7.0",
- "vite": "^5.4.20"
- }
-}
\ No newline at end of file
diff --git a/examples/07-collaboration/01-partykit/src/App.tsx b/examples/07-collaboration/01-partykit/src/App.tsx
deleted file mode 100644
index 4d317c9b3b..0000000000
--- a/examples/07-collaboration/01-partykit/src/App.tsx
+++ /dev/null
@@ -1,34 +0,0 @@
-import "@blocknote/core/fonts/inter.css";
-import { useCreateBlockNote } from "@blocknote/react";
-import { BlockNoteView } from "@blocknote/mantine";
-import "@blocknote/mantine/style.css";
-import YPartyKitProvider from "y-partykit/provider";
-import * as Y from "yjs";
-
-// Sets up Yjs document and PartyKit Yjs provider.
-const doc = new Y.Doc();
-const provider = new YPartyKitProvider(
- "blocknote-dev.yousefed.partykit.dev",
- // Use a unique name as a "room" for your application.
- "your-project-name",
- doc,
-);
-
-export default function App() {
- const editor = useCreateBlockNote({
- collaboration: {
- // The Yjs Provider responsible for transporting updates:
- provider,
- // Where to store BlockNote data in the Y.Doc:
- fragment: doc.getXmlFragment("document-store"),
- // Information (name and color) for this user:
- user: {
- name: "My Username",
- color: "#ff0000",
- },
- },
- });
-
- // Renders the editor instance.
- return ;
-}
diff --git a/examples/07-collaboration/01-partykit/tsconfig.json b/examples/07-collaboration/01-partykit/tsconfig.json
deleted file mode 100644
index dbe3e6f62d..0000000000
--- a/examples/07-collaboration/01-partykit/tsconfig.json
+++ /dev/null
@@ -1,36 +0,0 @@
-{
- "__comment": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
- "compilerOptions": {
- "target": "ESNext",
- "useDefineForClassFields": true,
- "lib": [
- "DOM",
- "DOM.Iterable",
- "ESNext"
- ],
- "allowJs": false,
- "skipLibCheck": true,
- "esModuleInterop": false,
- "allowSyntheticDefaultImports": true,
- "strict": true,
- "forceConsistentCasingInFileNames": true,
- "module": "ESNext",
- "moduleResolution": "bundler",
- "resolveJsonModule": true,
- "isolatedModules": true,
- "noEmit": true,
- "jsx": "react-jsx",
- "composite": true
- },
- "include": [
- "."
- ],
- "__ADD_FOR_LOCAL_DEV_references": [
- {
- "path": "../../../packages/core/"
- },
- {
- "path": "../../../packages/react/"
- }
- ]
-}
\ No newline at end of file
diff --git a/examples/07-collaboration/01-partykit/vite.config.ts b/examples/07-collaboration/01-partykit/vite.config.ts
deleted file mode 100644
index f62ab20bc2..0000000000
--- a/examples/07-collaboration/01-partykit/vite.config.ts
+++ /dev/null
@@ -1,32 +0,0 @@
-// AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY
-import react from "@vitejs/plugin-react";
-import * as fs from "fs";
-import * as path from "path";
-import { defineConfig } from "vite";
-// import eslintPlugin from "vite-plugin-eslint";
-// https://vitejs.dev/config/
-export default defineConfig((conf) => ({
- plugins: [react()],
- optimizeDeps: {},
- build: {
- sourcemap: true,
- },
- resolve: {
- alias:
- conf.command === "build" ||
- !fs.existsSync(path.resolve(__dirname, "../../packages/core/src"))
- ? {}
- : ({
- // Comment out the lines below to load a built version of blocknote
- // or, keep as is to load live from sources with live reload working
- "@blocknote/core": path.resolve(
- __dirname,
- "../../packages/core/src/"
- ),
- "@blocknote/react": path.resolve(
- __dirname,
- "../../packages/react/src/"
- ),
- } as any),
- },
-}));
diff --git a/examples/07-collaboration/02-liveblocks/.bnexample.json b/examples/07-collaboration/02-liveblocks/.bnexample.json
deleted file mode 100644
index b212ead624..0000000000
--- a/examples/07-collaboration/02-liveblocks/.bnexample.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "playground": true,
- "docs": true,
- "author": "yousefed",
- "tags": ["Advanced", "Saving/Loading", "Collaboration"],
- "dependencies": {
- "@liveblocks/client": "3.7.1-tiptap3",
- "@liveblocks/react": "3.7.1-tiptap3",
- "@liveblocks/react-blocknote": "3.7.1-tiptap3",
- "@liveblocks/react-tiptap": "3.7.1-tiptap3",
- "@liveblocks/react-ui": "3.7.1-tiptap3",
- "yjs": "^13.6.27"
- }
-}
diff --git a/examples/07-collaboration/02-liveblocks/README.md b/examples/07-collaboration/02-liveblocks/README.md
deleted file mode 100644
index 50292b8d42..0000000000
--- a/examples/07-collaboration/02-liveblocks/README.md
+++ /dev/null
@@ -1,25 +0,0 @@
-# Collaborative Editing with Liveblocks
-
-In this example, we use
-the [Liveblocks + BlockNote setup guide](https://liveblocks.io/docs/get-started/react-blocknote)
-to create a collaborative BlockNote editor, where multiple people can work on
-the same document in real-time.
-
-Users can also add comments to the documents to start threads, which are
-displayed next to the editor. As well as that, they can react to, reply to, and
-resolve existing comments.
-
-**Try it out:** Open this page in a new browser tab or window to see it in
-action!
-
-**Relevant Docs:**
-
-- [Editor Setup](/docs/getting-started/editor-setup)
-- [Liveblocks](/docs/features/collaboration#liveblocks)
-
-**From Liveblocks Website:**
-
-- [Get Started with BlockNote](https://liveblocks.io/docs/get-started/react-blocknote)
-- [Ready Made Features](https://liveblocks.io/docs/ready-made-features/text-editor/blocknote)
-- [API Reference](https://liveblocks.io/docs/api-reference/liveblocks-react-blocknote)
-- [Advanced Example](https://liveblocks.io/examples/collaborative-text-editor/nextjs-blocknote)
diff --git a/examples/07-collaboration/02-liveblocks/index.html b/examples/07-collaboration/02-liveblocks/index.html
deleted file mode 100644
index af8a9f53fb..0000000000
--- a/examples/07-collaboration/02-liveblocks/index.html
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
- Collaborative Editing with Liveblocks
-
-
-
-
-
-
-
diff --git a/examples/07-collaboration/02-liveblocks/liveblocks.config.ts b/examples/07-collaboration/02-liveblocks/liveblocks.config.ts
deleted file mode 100644
index 28db2e07be..0000000000
--- a/examples/07-collaboration/02-liveblocks/liveblocks.config.ts
+++ /dev/null
@@ -1,49 +0,0 @@
-// Define Liveblocks types for your application
-// https://liveblocks.io/docs/api-reference/liveblocks-react#Typing-your-data
-declare global {
- interface Liveblocks {
- // Each user's Presence, for useMyPresence, useOthers, etc.
- Presence: {
- // Example, real-time cursor coordinates
- // cursor: { x: number; y: number };
- };
-
- // The Storage tree for the room, for useMutation, useStorage, etc.
- Storage: {
- // Example, a conflict-free list
- // animals: LiveList;
- };
-
- // Custom user info set when authenticating with a secret key
- UserMeta: {
- id: string;
- info: {
- // Example properties, for useSelf, useUser, useOthers, etc.
- // name: string;
- // avatar: string;
- };
- };
-
- // Custom events, for useBroadcastEvent, useEventListener
- RoomEvent: {};
- // Example has two events, using a union
- // | { type: "PLAY" }
- // | { type: "REACTION"; emoji: "š„" };
-
- // Custom metadata set on threads, for useThreads, useCreateThread, etc.
- ThreadMetadata: {
- // Example, attaching coordinates to a thread
- // x: number;
- // y: number;
- };
-
- // Custom room info set with resolveRoomsInfo, for useRoomInfo
- RoomInfo: {
- // Example, rooms with a title and url
- // title: string;
- // url: string;
- };
- }
-}
-
-export {};
diff --git a/examples/07-collaboration/02-liveblocks/main.tsx b/examples/07-collaboration/02-liveblocks/main.tsx
deleted file mode 100644
index 677c7f7eed..0000000000
--- a/examples/07-collaboration/02-liveblocks/main.tsx
+++ /dev/null
@@ -1,11 +0,0 @@
-// 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(
-
-
-
-);
diff --git a/examples/07-collaboration/02-liveblocks/package.json b/examples/07-collaboration/02-liveblocks/package.json
deleted file mode 100644
index f200937daf..0000000000
--- a/examples/07-collaboration/02-liveblocks/package.json
+++ /dev/null
@@ -1,37 +0,0 @@
-{
- "name": "@blocknote/example-collaboration-liveblocks",
- "description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
- "type": "module",
- "private": true,
- "version": "0.12.4",
- "scripts": {
- "start": "vite",
- "dev": "vite",
- "build:prod": "tsc && vite build",
- "preview": "vite preview"
- },
- "dependencies": {
- "@blocknote/ariakit": "latest",
- "@blocknote/core": "latest",
- "@blocknote/mantine": "latest",
- "@blocknote/react": "latest",
- "@blocknote/shadcn": "latest",
- "@mantine/core": "^8.3.4",
- "@mantine/hooks": "^8.3.4",
- "@mantine/utils": "^6.0.22",
- "react": "^19.2.1",
- "react-dom": "^19.2.1",
- "@liveblocks/client": "3.7.1-tiptap3",
- "@liveblocks/react": "3.7.1-tiptap3",
- "@liveblocks/react-blocknote": "3.7.1-tiptap3",
- "@liveblocks/react-tiptap": "3.7.1-tiptap3",
- "@liveblocks/react-ui": "3.7.1-tiptap3",
- "yjs": "^13.6.27"
- },
- "devDependencies": {
- "@types/react": "^19.2.2",
- "@types/react-dom": "^19.2.2",
- "@vitejs/plugin-react": "^4.7.0",
- "vite": "^5.4.20"
- }
-}
\ No newline at end of file
diff --git a/examples/07-collaboration/02-liveblocks/src/App.tsx b/examples/07-collaboration/02-liveblocks/src/App.tsx
deleted file mode 100644
index e523e79dd2..0000000000
--- a/examples/07-collaboration/02-liveblocks/src/App.tsx
+++ /dev/null
@@ -1,30 +0,0 @@
-// See https://liveblocks.io/docs/get-started/react-blocknote to see how this
-// example was created, and an explanation for all the code.
-import {
- ClientSideSuspense,
- LiveblocksProvider,
- RoomProvider,
-} from "@liveblocks/react/suspense";
-import "@liveblocks/react-ui/styles.css";
-import "@liveblocks/react-ui/styles/dark/media-query.css";
-import "@liveblocks/react-tiptap/styles.css";
-
-import { Editor } from "./Editor";
-import "./globals.css";
-import "./styles.css";
-
-export default function App() {
- return (
-
-
- Loadingā¦}>
-
-
-
-
- );
-}
diff --git a/examples/07-collaboration/02-liveblocks/src/Editor.tsx b/examples/07-collaboration/02-liveblocks/src/Editor.tsx
deleted file mode 100644
index 2c6da47379..0000000000
--- a/examples/07-collaboration/02-liveblocks/src/Editor.tsx
+++ /dev/null
@@ -1,21 +0,0 @@
-import "@blocknote/core/fonts/inter.css";
-import { BlockNoteEditor } from "@blocknote/core";
-import { BlockNoteView } from "@blocknote/mantine";
-import "@blocknote/mantine/style.css";
-import { useCreateBlockNoteWithLiveblocks } from "@liveblocks/react-blocknote";
-
-import { Threads } from "./Threads";
-
-export function Editor() {
- const editor = useCreateBlockNoteWithLiveblocks(
- {},
- { mentions: true },
- ) as BlockNoteEditor;
-
- return (
-
-
-
-
- );
-}
diff --git a/examples/07-collaboration/02-liveblocks/src/Threads.tsx b/examples/07-collaboration/02-liveblocks/src/Threads.tsx
deleted file mode 100644
index b79c1ecd7f..0000000000
--- a/examples/07-collaboration/02-liveblocks/src/Threads.tsx
+++ /dev/null
@@ -1,29 +0,0 @@
-import { BlockNoteEditor } from "@blocknote/core";
-import { useThreads } from "@liveblocks/react/suspense";
-import {
- AnchoredThreads,
- FloatingComposer,
- FloatingThreads,
-} from "@liveblocks/react-blocknote";
-
-export function Threads({ editor }: { editor: BlockNoteEditor | null }) {
- const { threads } = useThreads({ query: { resolved: false } });
-
- if (!editor) {
- return null;
- }
-
- return (
- <>
-
-
-
- >
- );
-}
diff --git a/examples/07-collaboration/02-liveblocks/src/globals.css b/examples/07-collaboration/02-liveblocks/src/globals.css
deleted file mode 100644
index 1b40f1f4ca..0000000000
--- a/examples/07-collaboration/02-liveblocks/src/globals.css
+++ /dev/null
@@ -1,47 +0,0 @@
-html {
- font-family: Inter, sans-serif;
- background: #f9f9f9;
-}
-
-@media (prefers-color-scheme: dark) {
- html {
- background: #0c0c0c;
- }
-}
-
-.editor {
- position: absolute;
- inset: 0;
- max-width: 1024px;
- margin: 0 auto;
- padding: 48px 0;
-}
-
-.bn-editor {
- padding: 36px 52px;
- min-height: 100%;
-}
-
-/* For mobile */
-.floating-threads {
- display: none;
-}
-
-/* For desktop */
-.anchored-threads {
- display: block;
- max-width: 300px;
- width: 100%;
- position: absolute;
- right: 12px;
-}
-
-@media (max-width: 640px) {
- .floating-threads {
- display: block;
- }
-
- .anchored-threads {
- display: none;
- }
-}
diff --git a/examples/07-collaboration/02-liveblocks/src/styles.css b/examples/07-collaboration/02-liveblocks/src/styles.css
deleted file mode 100644
index 74625c7432..0000000000
--- a/examples/07-collaboration/02-liveblocks/src/styles.css
+++ /dev/null
@@ -1,8 +0,0 @@
-.editor {
- position: relative;
- height: 100%;
-}
-
-div:has(> .editor) {
- height: 100%;
-}
diff --git a/examples/07-collaboration/02-liveblocks/tsconfig.json b/examples/07-collaboration/02-liveblocks/tsconfig.json
deleted file mode 100644
index dbe3e6f62d..0000000000
--- a/examples/07-collaboration/02-liveblocks/tsconfig.json
+++ /dev/null
@@ -1,36 +0,0 @@
-{
- "__comment": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
- "compilerOptions": {
- "target": "ESNext",
- "useDefineForClassFields": true,
- "lib": [
- "DOM",
- "DOM.Iterable",
- "ESNext"
- ],
- "allowJs": false,
- "skipLibCheck": true,
- "esModuleInterop": false,
- "allowSyntheticDefaultImports": true,
- "strict": true,
- "forceConsistentCasingInFileNames": true,
- "module": "ESNext",
- "moduleResolution": "bundler",
- "resolveJsonModule": true,
- "isolatedModules": true,
- "noEmit": true,
- "jsx": "react-jsx",
- "composite": true
- },
- "include": [
- "."
- ],
- "__ADD_FOR_LOCAL_DEV_references": [
- {
- "path": "../../../packages/core/"
- },
- {
- "path": "../../../packages/react/"
- }
- ]
-}
\ No newline at end of file
diff --git a/examples/07-collaboration/02-liveblocks/vite.config.ts b/examples/07-collaboration/02-liveblocks/vite.config.ts
deleted file mode 100644
index f62ab20bc2..0000000000
--- a/examples/07-collaboration/02-liveblocks/vite.config.ts
+++ /dev/null
@@ -1,32 +0,0 @@
-// AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY
-import react from "@vitejs/plugin-react";
-import * as fs from "fs";
-import * as path from "path";
-import { defineConfig } from "vite";
-// import eslintPlugin from "vite-plugin-eslint";
-// https://vitejs.dev/config/
-export default defineConfig((conf) => ({
- plugins: [react()],
- optimizeDeps: {},
- build: {
- sourcemap: true,
- },
- resolve: {
- alias:
- conf.command === "build" ||
- !fs.existsSync(path.resolve(__dirname, "../../packages/core/src"))
- ? {}
- : ({
- // Comment out the lines below to load a built version of blocknote
- // or, keep as is to load live from sources with live reload working
- "@blocknote/core": path.resolve(
- __dirname,
- "../../packages/core/src/"
- ),
- "@blocknote/react": path.resolve(
- __dirname,
- "../../packages/react/src/"
- ),
- } as any),
- },
-}));
diff --git a/examples/07-collaboration/03-y-sweet/.bnexample.json b/examples/07-collaboration/03-y-sweet/.bnexample.json
deleted file mode 100644
index ec9d562b0e..0000000000
--- a/examples/07-collaboration/03-y-sweet/.bnexample.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "playground": true,
- "docs": true,
- "author": "jakelazaroff",
- "tags": ["Advanced", "Saving/Loading", "Collaboration"],
- "dependencies": {
- "@y-sweet/react": "^0.6.3"
- }
-}
diff --git a/examples/07-collaboration/03-y-sweet/README.md b/examples/07-collaboration/03-y-sweet/README.md
deleted file mode 100644
index aa897aab16..0000000000
--- a/examples/07-collaboration/03-y-sweet/README.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# Collaborative Editing with Y-Sweet
-
-In this example, we use Y-Sweet to let multiple users collaborate on a single BlockNote document in real-time.
-
-**Try it out:** Open the [Y-Sweet BlockNote demo](https://demos.y-sweet.dev/blocknote) in multiple browser tabs to see it in action!
-
-**Relevant Docs:**
-
-- [Editor Setup](/docs/getting-started/editor-setup)
-- [Real-time collaboration](/docs/features/collaboration)
-- [Y-Sweet on Jamsocket](https://docs.jamsocket.com/y-sweet/tutorials/blocknote)
diff --git a/examples/07-collaboration/03-y-sweet/index.html b/examples/07-collaboration/03-y-sweet/index.html
deleted file mode 100644
index 0f89a74040..0000000000
--- a/examples/07-collaboration/03-y-sweet/index.html
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
- Collaborative Editing with Y-Sweet
-
-
-
-
-
-
-
diff --git a/examples/07-collaboration/03-y-sweet/main.tsx b/examples/07-collaboration/03-y-sweet/main.tsx
deleted file mode 100644
index 677c7f7eed..0000000000
--- a/examples/07-collaboration/03-y-sweet/main.tsx
+++ /dev/null
@@ -1,11 +0,0 @@
-// 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(
-
-
-
-);
diff --git a/examples/07-collaboration/03-y-sweet/package.json b/examples/07-collaboration/03-y-sweet/package.json
deleted file mode 100644
index 8e9072a3e9..0000000000
--- a/examples/07-collaboration/03-y-sweet/package.json
+++ /dev/null
@@ -1,32 +0,0 @@
-{
- "name": "@blocknote/example-collaboration-y-sweet",
- "description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
- "type": "module",
- "private": true,
- "version": "0.12.4",
- "scripts": {
- "start": "vite",
- "dev": "vite",
- "build:prod": "tsc && vite build",
- "preview": "vite preview"
- },
- "dependencies": {
- "@blocknote/ariakit": "latest",
- "@blocknote/core": "latest",
- "@blocknote/mantine": "latest",
- "@blocknote/react": "latest",
- "@blocknote/shadcn": "latest",
- "@mantine/core": "^8.3.4",
- "@mantine/hooks": "^8.3.4",
- "@mantine/utils": "^6.0.22",
- "react": "^19.2.1",
- "react-dom": "^19.2.1",
- "@y-sweet/react": "^0.6.3"
- },
- "devDependencies": {
- "@types/react": "^19.2.2",
- "@types/react-dom": "^19.2.2",
- "@vitejs/plugin-react": "^4.7.0",
- "vite": "^5.4.20"
- }
-}
\ No newline at end of file
diff --git a/examples/07-collaboration/03-y-sweet/src/App.tsx b/examples/07-collaboration/03-y-sweet/src/App.tsx
deleted file mode 100644
index 5a238ac497..0000000000
--- a/examples/07-collaboration/03-y-sweet/src/App.tsx
+++ /dev/null
@@ -1,35 +0,0 @@
-"use client";
-
-import { useYDoc, useYjsProvider, YDocProvider } from "@y-sweet/react";
-import { useCreateBlockNote } from "@blocknote/react";
-import { BlockNoteView } from "@blocknote/mantine";
-
-import "@blocknote/mantine/style.css";
-
-export default function App() {
- const docId = "my-blocknote-document";
-
- return (
-
-
-
- );
-}
-
-function Document() {
- const provider = useYjsProvider();
- const doc = useYDoc();
-
- const editor = useCreateBlockNote({
- collaboration: {
- provider,
- fragment: doc.getXmlFragment("blocknote"),
- user: { color: "#ff0000", name: "My Username" },
- },
- });
-
- return ;
-}
diff --git a/examples/07-collaboration/03-y-sweet/tsconfig.json b/examples/07-collaboration/03-y-sweet/tsconfig.json
deleted file mode 100644
index dbe3e6f62d..0000000000
--- a/examples/07-collaboration/03-y-sweet/tsconfig.json
+++ /dev/null
@@ -1,36 +0,0 @@
-{
- "__comment": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
- "compilerOptions": {
- "target": "ESNext",
- "useDefineForClassFields": true,
- "lib": [
- "DOM",
- "DOM.Iterable",
- "ESNext"
- ],
- "allowJs": false,
- "skipLibCheck": true,
- "esModuleInterop": false,
- "allowSyntheticDefaultImports": true,
- "strict": true,
- "forceConsistentCasingInFileNames": true,
- "module": "ESNext",
- "moduleResolution": "bundler",
- "resolveJsonModule": true,
- "isolatedModules": true,
- "noEmit": true,
- "jsx": "react-jsx",
- "composite": true
- },
- "include": [
- "."
- ],
- "__ADD_FOR_LOCAL_DEV_references": [
- {
- "path": "../../../packages/core/"
- },
- {
- "path": "../../../packages/react/"
- }
- ]
-}
\ No newline at end of file
diff --git a/examples/07-collaboration/03-y-sweet/vite.config.ts b/examples/07-collaboration/03-y-sweet/vite.config.ts
deleted file mode 100644
index f62ab20bc2..0000000000
--- a/examples/07-collaboration/03-y-sweet/vite.config.ts
+++ /dev/null
@@ -1,32 +0,0 @@
-// AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY
-import react from "@vitejs/plugin-react";
-import * as fs from "fs";
-import * as path from "path";
-import { defineConfig } from "vite";
-// import eslintPlugin from "vite-plugin-eslint";
-// https://vitejs.dev/config/
-export default defineConfig((conf) => ({
- plugins: [react()],
- optimizeDeps: {},
- build: {
- sourcemap: true,
- },
- resolve: {
- alias:
- conf.command === "build" ||
- !fs.existsSync(path.resolve(__dirname, "../../packages/core/src"))
- ? {}
- : ({
- // Comment out the lines below to load a built version of blocknote
- // or, keep as is to load live from sources with live reload working
- "@blocknote/core": path.resolve(
- __dirname,
- "../../packages/core/src/"
- ),
- "@blocknote/react": path.resolve(
- __dirname,
- "../../packages/react/src/"
- ),
- } as any),
- },
-}));
diff --git a/examples/07-collaboration/04-electric-sql/.bnexample.json b/examples/07-collaboration/04-electric-sql/.bnexample.json
deleted file mode 100644
index 29a56bc991..0000000000
--- a/examples/07-collaboration/04-electric-sql/.bnexample.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "playground": true,
- "docs": true,
- "author": "matthewlipski",
- "tags": ["Advanced", "Saving/Loading", "Collaboration"]
-}
diff --git a/examples/07-collaboration/04-electric-sql/README.md b/examples/07-collaboration/04-electric-sql/README.md
deleted file mode 100644
index 58296a8e95..0000000000
--- a/examples/07-collaboration/04-electric-sql/README.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# Collaborative Editing with ElectricSQL
-
-In this example, we use ElectricSQL to let multiple users collaborate on a single BlockNote document in real-time. The setup for this demo is more involved than the other collaboration examples, as it requires a running server and has a more fully-fledged UI. Therefore, the demo just uses an iframe element to show a hosted instance of the full ElectricSQL + BlockNote setup, which you can find the code for [here](https://github.com/TypeCellOS/blocknote-electric-example).
-
-**Try it out:** Open this page (or the [iframe url](https://blocknote-electric-example.vercel.app/)) in a new browser tab or window to see it in action!
-
-**Relevant Docs:**
-
-- [Editor Setup](/docs/getting-started/editor-setup)
-- [Real-time collaboration](/docs/features/collaboration)
-- [ElectricSQL](https://electric-sql.com/)
diff --git a/examples/07-collaboration/04-electric-sql/index.html b/examples/07-collaboration/04-electric-sql/index.html
deleted file mode 100644
index a7a5977cc1..0000000000
--- a/examples/07-collaboration/04-electric-sql/index.html
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
- Collaborative Editing with ElectricSQL
-
-
-
-
-
-
-
diff --git a/examples/07-collaboration/04-electric-sql/main.tsx b/examples/07-collaboration/04-electric-sql/main.tsx
deleted file mode 100644
index 677c7f7eed..0000000000
--- a/examples/07-collaboration/04-electric-sql/main.tsx
+++ /dev/null
@@ -1,11 +0,0 @@
-// 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(
-
-
-
-);
diff --git a/examples/07-collaboration/04-electric-sql/package.json b/examples/07-collaboration/04-electric-sql/package.json
deleted file mode 100644
index 75105c29da..0000000000
--- a/examples/07-collaboration/04-electric-sql/package.json
+++ /dev/null
@@ -1,31 +0,0 @@
-{
- "name": "@blocknote/example-collaboration-electric-sql",
- "description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
- "type": "module",
- "private": true,
- "version": "0.12.4",
- "scripts": {
- "start": "vite",
- "dev": "vite",
- "build:prod": "tsc && vite build",
- "preview": "vite preview"
- },
- "dependencies": {
- "@blocknote/ariakit": "latest",
- "@blocknote/core": "latest",
- "@blocknote/mantine": "latest",
- "@blocknote/react": "latest",
- "@blocknote/shadcn": "latest",
- "@mantine/core": "^8.3.4",
- "@mantine/hooks": "^8.3.4",
- "@mantine/utils": "^6.0.22",
- "react": "^19.2.1",
- "react-dom": "^19.2.1"
- },
- "devDependencies": {
- "@types/react": "^19.2.2",
- "@types/react-dom": "^19.2.2",
- "@vitejs/plugin-react": "^4.7.0",
- "vite": "^5.4.20"
- }
-}
\ No newline at end of file
diff --git a/examples/07-collaboration/04-electric-sql/src/App.tsx b/examples/07-collaboration/04-electric-sql/src/App.tsx
deleted file mode 100644
index 10e68bfd35..0000000000
--- a/examples/07-collaboration/04-electric-sql/src/App.tsx
+++ /dev/null
@@ -1,11 +0,0 @@
-import "./style.css";
-
-export default function App() {
- return (
-
- );
-}
diff --git a/examples/07-collaboration/04-electric-sql/src/style.css b/examples/07-collaboration/04-electric-sql/src/style.css
deleted file mode 100644
index 993a28fb3e..0000000000
--- a/examples/07-collaboration/04-electric-sql/src/style.css
+++ /dev/null
@@ -1,3 +0,0 @@
-iframe {
- border: none;
-}
diff --git a/examples/07-collaboration/04-electric-sql/tsconfig.json b/examples/07-collaboration/04-electric-sql/tsconfig.json
deleted file mode 100644
index dbe3e6f62d..0000000000
--- a/examples/07-collaboration/04-electric-sql/tsconfig.json
+++ /dev/null
@@ -1,36 +0,0 @@
-{
- "__comment": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
- "compilerOptions": {
- "target": "ESNext",
- "useDefineForClassFields": true,
- "lib": [
- "DOM",
- "DOM.Iterable",
- "ESNext"
- ],
- "allowJs": false,
- "skipLibCheck": true,
- "esModuleInterop": false,
- "allowSyntheticDefaultImports": true,
- "strict": true,
- "forceConsistentCasingInFileNames": true,
- "module": "ESNext",
- "moduleResolution": "bundler",
- "resolveJsonModule": true,
- "isolatedModules": true,
- "noEmit": true,
- "jsx": "react-jsx",
- "composite": true
- },
- "include": [
- "."
- ],
- "__ADD_FOR_LOCAL_DEV_references": [
- {
- "path": "../../../packages/core/"
- },
- {
- "path": "../../../packages/react/"
- }
- ]
-}
\ No newline at end of file
diff --git a/examples/07-collaboration/04-electric-sql/vite.config.ts b/examples/07-collaboration/04-electric-sql/vite.config.ts
deleted file mode 100644
index f62ab20bc2..0000000000
--- a/examples/07-collaboration/04-electric-sql/vite.config.ts
+++ /dev/null
@@ -1,32 +0,0 @@
-// AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY
-import react from "@vitejs/plugin-react";
-import * as fs from "fs";
-import * as path from "path";
-import { defineConfig } from "vite";
-// import eslintPlugin from "vite-plugin-eslint";
-// https://vitejs.dev/config/
-export default defineConfig((conf) => ({
- plugins: [react()],
- optimizeDeps: {},
- build: {
- sourcemap: true,
- },
- resolve: {
- alias:
- conf.command === "build" ||
- !fs.existsSync(path.resolve(__dirname, "../../packages/core/src"))
- ? {}
- : ({
- // Comment out the lines below to load a built version of blocknote
- // or, keep as is to load live from sources with live reload working
- "@blocknote/core": path.resolve(
- __dirname,
- "../../packages/core/src/"
- ),
- "@blocknote/react": path.resolve(
- __dirname,
- "../../packages/react/src/"
- ),
- } as any),
- },
-}));
diff --git a/examples/07-collaboration/05-comments/.bnexample.json b/examples/07-collaboration/05-comments/.bnexample.json
deleted file mode 100644
index 76b01892ea..0000000000
--- a/examples/07-collaboration/05-comments/.bnexample.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "playground": true,
- "docs": true,
- "author": "yousefed",
- "tags": ["Advanced", "Comments", "Collaboration"],
- "dependencies": {
- "@y-sweet/react": "^0.6.3",
- "@mantine/core": "^8.3.4"
- }
-}
diff --git a/examples/07-collaboration/05-comments/README.md b/examples/07-collaboration/05-comments/README.md
deleted file mode 100644
index 89b7e26386..0000000000
--- a/examples/07-collaboration/05-comments/README.md
+++ /dev/null
@@ -1,12 +0,0 @@
-# Comments & Threads
-
-In this example, you can add comments to the document while collaborating with others. You can also pick user accounts with different permissions, as well as react to, reply to, and resolve existing comments. The comments are displayed floating next to the text they refer to, and appear when selecting said text.
-
-**Try it out:** Click the "Add comment" button in the [Formatting Toolbar](/docs/react/components/formatting-toolbar) to add a comment!
-
-**Relevant Docs:**
-
-- [Comments](/docs/features/collaboration/comments)
-- [Real-time collaboration](/docs/features/collaboration)
-- [Y-Sweet on Jamsocket](https://docs.jamsocket.com/y-sweet/tutorials/blocknote)
-- [Editor Setup](/docs/getting-started/editor-setup)
diff --git a/examples/07-collaboration/05-comments/index.html b/examples/07-collaboration/05-comments/index.html
deleted file mode 100644
index 3f664dce9a..0000000000
--- a/examples/07-collaboration/05-comments/index.html
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
- Comments & Threads
-
-
-
-
-
-
-
diff --git a/examples/07-collaboration/05-comments/main.tsx b/examples/07-collaboration/05-comments/main.tsx
deleted file mode 100644
index 677c7f7eed..0000000000
--- a/examples/07-collaboration/05-comments/main.tsx
+++ /dev/null
@@ -1,11 +0,0 @@
-// 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(
-
-
-
-);
diff --git a/examples/07-collaboration/05-comments/package.json b/examples/07-collaboration/05-comments/package.json
deleted file mode 100644
index aa5dbf3732..0000000000
--- a/examples/07-collaboration/05-comments/package.json
+++ /dev/null
@@ -1,32 +0,0 @@
-{
- "name": "@blocknote/example-collaboration-comments",
- "description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
- "type": "module",
- "private": true,
- "version": "0.12.4",
- "scripts": {
- "start": "vite",
- "dev": "vite",
- "build:prod": "tsc && vite build",
- "preview": "vite preview"
- },
- "dependencies": {
- "@blocknote/ariakit": "latest",
- "@blocknote/core": "latest",
- "@blocknote/mantine": "latest",
- "@blocknote/react": "latest",
- "@blocknote/shadcn": "latest",
- "@mantine/core": "^8.3.4",
- "@mantine/hooks": "^8.3.4",
- "@mantine/utils": "^6.0.22",
- "react": "^19.2.1",
- "react-dom": "^19.2.1",
- "@y-sweet/react": "^0.6.3"
- },
- "devDependencies": {
- "@types/react": "^19.2.2",
- "@types/react-dom": "^19.2.2",
- "@vitejs/plugin-react": "^4.7.0",
- "vite": "^5.4.20"
- }
-}
\ No newline at end of file
diff --git a/examples/07-collaboration/05-comments/src/App.tsx b/examples/07-collaboration/05-comments/src/App.tsx
deleted file mode 100644
index 7aaeac4df2..0000000000
--- a/examples/07-collaboration/05-comments/src/App.tsx
+++ /dev/null
@@ -1,111 +0,0 @@
-"use client";
-
-import {
- CommentsExtension,
- DefaultThreadStoreAuth,
- YjsThreadStore,
-} from "@blocknote/core/comments";
-import { BlockNoteView } from "@blocknote/mantine";
-import "@blocknote/mantine/style.css";
-import { useCreateBlockNote } from "@blocknote/react";
-import { YDocProvider, useYDoc, useYjsProvider } from "@y-sweet/react";
-import { useMemo, useState } from "react";
-
-import { SettingsSelect } from "./SettingsSelect";
-import { HARDCODED_USERS, MyUserType, getRandomColor } from "./userdata";
-
-import "./style.css";
-
-// The resolveUsers function fetches information about your users
-// (e.g. their name, avatar, etc.). Usually, you'd fetch this from your
-// own database or user management system.
-// Here, we just return the hardcoded users (from userdata.ts)
-async function resolveUsers(userIds: string[]) {
- // fake a (slow) network request
- await new Promise((resolve) => setTimeout(resolve, 1000));
-
- return HARDCODED_USERS.filter((user) => userIds.includes(user.id));
-}
-
-// This follows the Y-Sweet example to setup a collabotive editor
-// (but of course, you also use other collaboration providers
-// see the docs for more information)
-export default function App() {
- const docId = "my-blocknote-document-with-commenting";
-
- return (
-
-
-
- );
-}
-
-function Document() {
- const [activeUser, setActiveUser] = useState(HARDCODED_USERS[0]);
-
- const provider = useYjsProvider();
-
- // take the Y.Doc collaborative document from Y-Sweet
- const doc = useYDoc();
-
- // setup the thread store which stores / and syncs thread / comment data
- const threadStore = useMemo(() => {
- // (alternative, use TiptapCollabProvider)
- // const provider = new TiptapCollabProvider({
- // name: "test",
- // baseUrl: "https://collab.yourdomain.com",
- // appId: "test",
- // document: doc,
- // });
- // return new TiptapThreadStore(
- // activeUser.id,
- // provider,
- // new DefaultThreadStoreAuth(activeUser.id, activeUser.role)
- // );
- return new YjsThreadStore(
- activeUser.id,
- doc.getMap("threads"),
- new DefaultThreadStoreAuth(activeUser.id, activeUser.role),
- );
- }, [doc, activeUser]);
-
- // setup the editor with comments and collaboration
- const editor = useCreateBlockNote(
- {
- collaboration: {
- provider,
- fragment: doc.getXmlFragment("blocknote"),
- user: { color: getRandomColor(), name: activeUser.username },
- },
- extensions: [CommentsExtension({ threadStore, resolveUsers })],
- },
- [activeUser, threadStore],
- );
-
- return (
-
- {/* We place user settings select within `BlockNoteView` as it uses
- BlockNote UI components and needs the context for them. */}
-
- ({
- text: `${user.username} (${
- user.role === "editor" ? "Editor" : "Commenter"
- })`,
- icon: null,
- onClick: () => setActiveUser(user),
- isSelected: user.id === activeUser.id,
- }))}
- />
-
-
- );
-}
diff --git a/examples/07-collaboration/05-comments/src/SettingsSelect.tsx b/examples/07-collaboration/05-comments/src/SettingsSelect.tsx
deleted file mode 100644
index 0dfc79dc3f..0000000000
--- a/examples/07-collaboration/05-comments/src/SettingsSelect.tsx
+++ /dev/null
@@ -1,24 +0,0 @@
-import { ComponentProps, useComponentsContext } from "@blocknote/react";
-
-// This component is used to display a selection dropdown with a label. By using
-// the useComponentsContext hook, we can create it out of existing components
-// within the same UI library that `BlockNoteView` uses (Mantine, Ariakit, or
-// ShadCN), to match the design of the editor.
-export const SettingsSelect = (props: {
- label: string;
- items: ComponentProps["FormattingToolbar"]["Select"]["items"];
-}) => {
- const Components = useComponentsContext()!;
-
- return (
-
-
- {props.label + ":"}
-
-
-
- );
-};
diff --git a/examples/07-collaboration/05-comments/src/style.css b/examples/07-collaboration/05-comments/src/style.css
deleted file mode 100644
index eaf9d337e9..0000000000
--- a/examples/07-collaboration/05-comments/src/style.css
+++ /dev/null
@@ -1,47 +0,0 @@
-.comments-main-container {
- align-items: center;
- background-color: var(--bn-colors-disabled-background);
- display: flex;
- flex-direction: column-reverse;
- gap: 10px;
- height: 100%;
- max-width: none;
- padding: 10px;
- width: 100%;
-}
-
-.comments-main-container .bn-editor {
- height: 100%;
- max-width: 700px;
- overflow: auto;
- width: 100%;
-}
-
-.comments-main-container .settings {
- display: flex;
- max-width: 700px;
- width: 100%;
-}
-
-.comments-main-container .settings-select {
- display: flex;
- gap: 10px;
-}
-
-.comments-main-container .settings-select .bn-toolbar {
- align-items: center;
- box-shadow: none;
-}
-
-.comments-main-container .settings-select h2 {
- color: var(--bn-colors-menu-text);
- margin: 0;
- font-size: 12px;
- line-height: 12px;
- padding-left: 14px;
-}
-
-.bn-thread {
- max-height: 200px;
- overflow: auto !important;
-}
diff --git a/examples/07-collaboration/05-comments/src/userdata.ts b/examples/07-collaboration/05-comments/src/userdata.ts
deleted file mode 100644
index c54eaf0f9a..0000000000
--- a/examples/07-collaboration/05-comments/src/userdata.ts
+++ /dev/null
@@ -1,47 +0,0 @@
-import type { User } from "@blocknote/core/comments";
-
-const colors = [
- "#958DF1",
- "#F98181",
- "#FBBC88",
- "#FAF594",
- "#70CFF8",
- "#94FADB",
- "#B9F18D",
-];
-
-const getRandomElement = (list: any[]) =>
- list[Math.floor(Math.random() * list.length)];
-
-export const getRandomColor = () => getRandomElement(colors);
-
-export type MyUserType = User & {
- role: "editor" | "comment";
-};
-
-export const HARDCODED_USERS: MyUserType[] = [
- {
- id: "1",
- username: "John Doe",
- avatarUrl: "https://placehold.co/100x100?text=John",
- role: "editor",
- },
- {
- id: "2",
- username: "Jane Doe",
- avatarUrl: "https://placehold.co/100x100?text=Jane",
- role: "editor",
- },
- {
- id: "3",
- username: "Bob Smith",
- avatarUrl: "https://placehold.co/100x100?text=Bob",
- role: "comment",
- },
- {
- id: "4",
- username: "Betty Smith",
- avatarUrl: "https://placehold.co/100x100?text=Betty",
- role: "comment",
- },
-];
diff --git a/examples/07-collaboration/05-comments/tsconfig.json b/examples/07-collaboration/05-comments/tsconfig.json
deleted file mode 100644
index dbe3e6f62d..0000000000
--- a/examples/07-collaboration/05-comments/tsconfig.json
+++ /dev/null
@@ -1,36 +0,0 @@
-{
- "__comment": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
- "compilerOptions": {
- "target": "ESNext",
- "useDefineForClassFields": true,
- "lib": [
- "DOM",
- "DOM.Iterable",
- "ESNext"
- ],
- "allowJs": false,
- "skipLibCheck": true,
- "esModuleInterop": false,
- "allowSyntheticDefaultImports": true,
- "strict": true,
- "forceConsistentCasingInFileNames": true,
- "module": "ESNext",
- "moduleResolution": "bundler",
- "resolveJsonModule": true,
- "isolatedModules": true,
- "noEmit": true,
- "jsx": "react-jsx",
- "composite": true
- },
- "include": [
- "."
- ],
- "__ADD_FOR_LOCAL_DEV_references": [
- {
- "path": "../../../packages/core/"
- },
- {
- "path": "../../../packages/react/"
- }
- ]
-}
\ No newline at end of file
diff --git a/examples/07-collaboration/05-comments/vite.config.ts b/examples/07-collaboration/05-comments/vite.config.ts
deleted file mode 100644
index f62ab20bc2..0000000000
--- a/examples/07-collaboration/05-comments/vite.config.ts
+++ /dev/null
@@ -1,32 +0,0 @@
-// AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY
-import react from "@vitejs/plugin-react";
-import * as fs from "fs";
-import * as path from "path";
-import { defineConfig } from "vite";
-// import eslintPlugin from "vite-plugin-eslint";
-// https://vitejs.dev/config/
-export default defineConfig((conf) => ({
- plugins: [react()],
- optimizeDeps: {},
- build: {
- sourcemap: true,
- },
- resolve: {
- alias:
- conf.command === "build" ||
- !fs.existsSync(path.resolve(__dirname, "../../packages/core/src"))
- ? {}
- : ({
- // Comment out the lines below to load a built version of blocknote
- // or, keep as is to load live from sources with live reload working
- "@blocknote/core": path.resolve(
- __dirname,
- "../../packages/core/src/"
- ),
- "@blocknote/react": path.resolve(
- __dirname,
- "../../packages/react/src/"
- ),
- } as any),
- },
-}));
diff --git a/examples/07-collaboration/06-comments-with-sidebar/.bnexample.json b/examples/07-collaboration/06-comments-with-sidebar/.bnexample.json
deleted file mode 100644
index c741699750..0000000000
--- a/examples/07-collaboration/06-comments-with-sidebar/.bnexample.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "playground": true,
- "docs": true,
- "author": "matthewlipski",
- "tags": ["Advanced", "Comments", "Collaboration"],
- "dependencies": {
- "y-partykit": "^0.0.25",
- "yjs": "^13.6.27",
- "@mantine/core": "^8.3.4"
- }
-}
diff --git a/examples/07-collaboration/06-comments-with-sidebar/README.md b/examples/07-collaboration/06-comments-with-sidebar/README.md
deleted file mode 100644
index 2502620fbe..0000000000
--- a/examples/07-collaboration/06-comments-with-sidebar/README.md
+++ /dev/null
@@ -1,14 +0,0 @@
-# Threads Sidebar
-
-In this example, you can add comments to the document while collaborating with others. You can also pick user accounts with different permissions, as well as react to, reply to, and resolve existing comments. The comments are displayed floating next to the text they refer to, and appear when selecting said text. The comments are shown in a separate sidebar using the `ThreadsSidebar` component.
-
-**Try it out:** Click the "Add comment" button in
-the [Formatting Toolbar](/docs/react/components/formatting-toolbar) to add a
-comment!
-
-**Relevant Docs:**
-
-- [Comments Sidebar](/docs/features/collaboration/comments#sidebar-view)
-- [Real-time collaboration](/docs/features/collaboration)
-- [Y-Sweet on Jamsocket](https://docs.jamsocket.com/y-sweet/tutorials/blocknote)
-- [Editor Setup](/docs/getting-started/editor-setup)
diff --git a/examples/07-collaboration/06-comments-with-sidebar/index.html b/examples/07-collaboration/06-comments-with-sidebar/index.html
deleted file mode 100644
index 6af0826869..0000000000
--- a/examples/07-collaboration/06-comments-with-sidebar/index.html
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
- Threads Sidebar
-
-
-
-
-
-
-
diff --git a/examples/07-collaboration/06-comments-with-sidebar/main.tsx b/examples/07-collaboration/06-comments-with-sidebar/main.tsx
deleted file mode 100644
index 677c7f7eed..0000000000
--- a/examples/07-collaboration/06-comments-with-sidebar/main.tsx
+++ /dev/null
@@ -1,11 +0,0 @@
-// 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(
-
-
-
-);
diff --git a/examples/07-collaboration/06-comments-with-sidebar/package.json b/examples/07-collaboration/06-comments-with-sidebar/package.json
deleted file mode 100644
index 3411ea5c5e..0000000000
--- a/examples/07-collaboration/06-comments-with-sidebar/package.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "name": "@blocknote/example-collaboration-comments-with-sidebar",
- "description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
- "type": "module",
- "private": true,
- "version": "0.12.4",
- "scripts": {
- "start": "vite",
- "dev": "vite",
- "build:prod": "tsc && vite build",
- "preview": "vite preview"
- },
- "dependencies": {
- "@blocknote/ariakit": "latest",
- "@blocknote/core": "latest",
- "@blocknote/mantine": "latest",
- "@blocknote/react": "latest",
- "@blocknote/shadcn": "latest",
- "@mantine/core": "^8.3.4",
- "@mantine/hooks": "^8.3.4",
- "@mantine/utils": "^6.0.22",
- "react": "^19.2.1",
- "react-dom": "^19.2.1",
- "y-partykit": "^0.0.25",
- "yjs": "^13.6.27"
- },
- "devDependencies": {
- "@types/react": "^19.2.2",
- "@types/react-dom": "^19.2.2",
- "@vitejs/plugin-react": "^4.7.0",
- "vite": "^5.4.20"
- }
-}
\ No newline at end of file
diff --git a/examples/07-collaboration/06-comments-with-sidebar/src/App.tsx b/examples/07-collaboration/06-comments-with-sidebar/src/App.tsx
deleted file mode 100644
index 84ad0d577a..0000000000
--- a/examples/07-collaboration/06-comments-with-sidebar/src/App.tsx
+++ /dev/null
@@ -1,194 +0,0 @@
-"use client";
-
-import {
- DefaultThreadStoreAuth,
- YjsThreadStore,
- CommentsExtension,
-} from "@blocknote/core/comments";
-import { BlockNoteView } from "@blocknote/mantine";
-import "@blocknote/mantine/style.css";
-import {
- BlockNoteViewEditor,
- FloatingComposerController,
- ThreadsSidebar,
- useCreateBlockNote,
-} from "@blocknote/react";
-import { useMemo, useState } from "react";
-import YPartyKitProvider from "y-partykit/provider";
-import * as Y from "yjs";
-
-import { SettingsSelect } from "./SettingsSelect";
-import { HARDCODED_USERS, MyUserType, getRandomColor } from "./userdata";
-
-import "./style.css";
-
-// The resolveUsers function fetches information about your users
-// (e.g. their name, avatar, etc.). Usually, you'd fetch this from your
-// own database or user management system.
-// Here, we just return the hardcoded users (from userdata.ts)
-async function resolveUsers(userIds: string[]) {
- // fake a (slow) network request
- await new Promise((resolve) => setTimeout(resolve, 1000));
-
- return HARDCODED_USERS.filter((user) => userIds.includes(user.id));
-}
-
-// Sets up Yjs document and PartyKit Yjs provider.
-const doc = new Y.Doc();
-const provider = new YPartyKitProvider(
- "blocknote-dev.yousefed.partykit.dev",
- // Use a unique name as a "room" for your application.
- "comments-with-sidebar",
- doc,
-);
-
-// This follows the Y-Sweet example to setup a collabotive editor
-// (but of course, you also use other collaboration providers
-// see the docs for more information)
-export default function App() {
- const [activeUser, setActiveUser] = useState(HARDCODED_USERS[0]);
- const [commentFilter, setCommentFilter] = useState<
- "open" | "resolved" | "all"
- >("open");
- const [commentSort, setCommentSort] = useState<
- "position" | "recent-activity" | "oldest"
- >("position");
-
- // setup the thread store which stores / and syncs thread / comment data
- const threadStore = useMemo(() => {
- // (alternative, use TiptapCollabProvider)
- // const provider = new TiptapCollabProvider({
- // name: "test",
- // baseUrl: "https://collab.yourdomain.com",
- // appId: "test",
- // document: doc,
- // });
- // return new TiptapThreadStore(
- // activeUser.id,
- // provider,
- // new DefaultThreadStoreAuth(activeUser.id, activeUser.role)
- // );
- return new YjsThreadStore(
- activeUser.id,
- doc.getMap("threads"),
- new DefaultThreadStoreAuth(activeUser.id, activeUser.role),
- );
- }, [doc, activeUser]);
-
- // setup the editor with comments and collaboration
- const editor = useCreateBlockNote(
- {
- collaboration: {
- provider,
- fragment: doc.getXmlFragment("blocknote"),
- user: { color: getRandomColor(), name: activeUser.username },
- },
- extensions: [CommentsExtension({ threadStore, resolveUsers })],
- },
- [activeUser, threadStore],
- );
-
- return (
-
- {/* We place the editor, the sidebar, and any settings selects within
- `BlockNoteView` as they use BlockNote UI components and need the context
- for them. */}
-
-
-
Editor
-
- ({
- text: `${user.username} (${
- user.role === "editor" ? "Editor" : "Commenter"
- })`,
- icon: null,
- onClick: () => {
- setActiveUser(user);
- },
- isSelected: user.id === activeUser.id,
- }))}
- />
-
- {/* Because we set `renderEditor` to false, we can now manually place
- `BlockNoteViewEditor` (the actual editor component) in its own
- section below the user settings select. */}
-
- {/* Since we disabled rendering of comments with `comments={false}`,
- we need to re-add the floating composer, which is the UI element that
- appears when creating new threads. */}
-
-
-
- {/* We also place the `ThreadsSidebar` component in its own section,
- along with settings for filtering and sorting. */}
-
-
Comments
-
- setCommentFilter("all"),
- isSelected: commentFilter === "all",
- },
- {
- text: "Open",
- icon: null,
- onClick: () => setCommentFilter("open"),
- isSelected: commentFilter === "open",
- },
- {
- text: "Resolved",
- icon: null,
- onClick: () => setCommentFilter("resolved"),
- isSelected: commentFilter === "resolved",
- },
- ]}
- />
- setCommentSort("position"),
- isSelected: commentSort === "position",
- },
- {
- text: "Recent activity",
- icon: null,
- onClick: () => setCommentSort("recent-activity"),
- isSelected: commentSort === "recent-activity",
- },
- {
- text: "Oldest",
- icon: null,
- onClick: () => setCommentSort("oldest"),
- isSelected: commentSort === "oldest",
- },
- ]}
- />
-
-
-
-
- );
-}
diff --git a/examples/07-collaboration/06-comments-with-sidebar/src/SettingsSelect.tsx b/examples/07-collaboration/06-comments-with-sidebar/src/SettingsSelect.tsx
deleted file mode 100644
index 0dfc79dc3f..0000000000
--- a/examples/07-collaboration/06-comments-with-sidebar/src/SettingsSelect.tsx
+++ /dev/null
@@ -1,24 +0,0 @@
-import { ComponentProps, useComponentsContext } from "@blocknote/react";
-
-// This component is used to display a selection dropdown with a label. By using
-// the useComponentsContext hook, we can create it out of existing components
-// within the same UI library that `BlockNoteView` uses (Mantine, Ariakit, or
-// ShadCN), to match the design of the editor.
-export const SettingsSelect = (props: {
- label: string;
- items: ComponentProps["FormattingToolbar"]["Select"]["items"];
-}) => {
- const Components = useComponentsContext()!;
-
- return (
-
-
- {props.label + ":"}
-
-
-
- );
-};
diff --git a/examples/07-collaboration/06-comments-with-sidebar/src/style.css b/examples/07-collaboration/06-comments-with-sidebar/src/style.css
deleted file mode 100644
index f903d52e1b..0000000000
--- a/examples/07-collaboration/06-comments-with-sidebar/src/style.css
+++ /dev/null
@@ -1,73 +0,0 @@
-.sidebar-comments-main-container {
- background-color: var(--bn-colors-disabled-background);
- display: flex;
- gap: 10px;
- height: 100%;
- max-width: none;
- padding: 10px;
- width: 100%;
-}
-
-.sidebar-comments-main-container .editor-layout-wrapper {
- display: flex;
- flex: 2;
- justify-content: center;
- width: 0;
-}
-
-.sidebar-comments-main-container .editor-section,
-.threads-sidebar-section {
- border-radius: var(--bn-border-radius-large);
- display: flex;
- flex: 1;
- flex-direction: column;
- gap: 10px;
- max-height: 100%;
- min-width: 350px;
- width: 0;
-}
-
-.sidebar-comments-main-container .editor-section h1,
-.threads-sidebar-section h1 {
- color: var(--bn-colors-menu-text);
- margin: 0;
- font-size: 32px;
-}
-
-.sidebar-comments-main-container .bn-editor,
-.bn-threads-sidebar {
- border-radius: var(--bn-border-radius-medium);
- display: flex;
- flex-direction: column;
- gap: 10px;
- height: 100%;
- overflow: auto;
-}
-
-.sidebar-comments-main-container .editor-section {
- max-width: 700px;
-}
-
-.sidebar-comments-main-container .settings {
- display: flex;
- flex-wrap: wrap;
- gap: 10px;
-}
-
-.sidebar-comments-main-container .settings-select {
- display: flex;
- gap: 10px;
-}
-
-.sidebar-comments-main-container .settings-select .bn-toolbar {
- align-items: center;
- box-shadow: none;
-}
-
-.sidebar-comments-main-container .settings-select h2 {
- color: var(--bn-colors-menu-text);
- margin: 0;
- font-size: 12px;
- line-height: 12px;
- padding-left: 14px;
-}
diff --git a/examples/07-collaboration/06-comments-with-sidebar/src/userdata.ts b/examples/07-collaboration/06-comments-with-sidebar/src/userdata.ts
deleted file mode 100644
index c54eaf0f9a..0000000000
--- a/examples/07-collaboration/06-comments-with-sidebar/src/userdata.ts
+++ /dev/null
@@ -1,47 +0,0 @@
-import type { User } from "@blocknote/core/comments";
-
-const colors = [
- "#958DF1",
- "#F98181",
- "#FBBC88",
- "#FAF594",
- "#70CFF8",
- "#94FADB",
- "#B9F18D",
-];
-
-const getRandomElement = (list: any[]) =>
- list[Math.floor(Math.random() * list.length)];
-
-export const getRandomColor = () => getRandomElement(colors);
-
-export type MyUserType = User & {
- role: "editor" | "comment";
-};
-
-export const HARDCODED_USERS: MyUserType[] = [
- {
- id: "1",
- username: "John Doe",
- avatarUrl: "https://placehold.co/100x100?text=John",
- role: "editor",
- },
- {
- id: "2",
- username: "Jane Doe",
- avatarUrl: "https://placehold.co/100x100?text=Jane",
- role: "editor",
- },
- {
- id: "3",
- username: "Bob Smith",
- avatarUrl: "https://placehold.co/100x100?text=Bob",
- role: "comment",
- },
- {
- id: "4",
- username: "Betty Smith",
- avatarUrl: "https://placehold.co/100x100?text=Betty",
- role: "comment",
- },
-];
diff --git a/examples/07-collaboration/06-comments-with-sidebar/tsconfig.json b/examples/07-collaboration/06-comments-with-sidebar/tsconfig.json
deleted file mode 100644
index dbe3e6f62d..0000000000
--- a/examples/07-collaboration/06-comments-with-sidebar/tsconfig.json
+++ /dev/null
@@ -1,36 +0,0 @@
-{
- "__comment": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
- "compilerOptions": {
- "target": "ESNext",
- "useDefineForClassFields": true,
- "lib": [
- "DOM",
- "DOM.Iterable",
- "ESNext"
- ],
- "allowJs": false,
- "skipLibCheck": true,
- "esModuleInterop": false,
- "allowSyntheticDefaultImports": true,
- "strict": true,
- "forceConsistentCasingInFileNames": true,
- "module": "ESNext",
- "moduleResolution": "bundler",
- "resolveJsonModule": true,
- "isolatedModules": true,
- "noEmit": true,
- "jsx": "react-jsx",
- "composite": true
- },
- "include": [
- "."
- ],
- "__ADD_FOR_LOCAL_DEV_references": [
- {
- "path": "../../../packages/core/"
- },
- {
- "path": "../../../packages/react/"
- }
- ]
-}
\ No newline at end of file
diff --git a/examples/07-collaboration/06-comments-with-sidebar/vite.config.ts b/examples/07-collaboration/06-comments-with-sidebar/vite.config.ts
deleted file mode 100644
index f62ab20bc2..0000000000
--- a/examples/07-collaboration/06-comments-with-sidebar/vite.config.ts
+++ /dev/null
@@ -1,32 +0,0 @@
-// AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY
-import react from "@vitejs/plugin-react";
-import * as fs from "fs";
-import * as path from "path";
-import { defineConfig } from "vite";
-// import eslintPlugin from "vite-plugin-eslint";
-// https://vitejs.dev/config/
-export default defineConfig((conf) => ({
- plugins: [react()],
- optimizeDeps: {},
- build: {
- sourcemap: true,
- },
- resolve: {
- alias:
- conf.command === "build" ||
- !fs.existsSync(path.resolve(__dirname, "../../packages/core/src"))
- ? {}
- : ({
- // Comment out the lines below to load a built version of blocknote
- // or, keep as is to load live from sources with live reload working
- "@blocknote/core": path.resolve(
- __dirname,
- "../../packages/core/src/"
- ),
- "@blocknote/react": path.resolve(
- __dirname,
- "../../packages/react/src/"
- ),
- } as any),
- },
-}));
diff --git a/examples/07-collaboration/07-ghost-writer/.bnexample.json b/examples/07-collaboration/07-ghost-writer/.bnexample.json
deleted file mode 100644
index 2c30ef42bd..0000000000
--- a/examples/07-collaboration/07-ghost-writer/.bnexample.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "playground": true,
- "docs": false,
- "author": "nperez0111",
- "tags": ["Advanced", "Development", "Collaboration"],
- "dependencies": {
- "y-partykit": "^0.0.25",
- "yjs": "^13.6.27"
- }
-}
diff --git a/examples/07-collaboration/07-ghost-writer/README.md b/examples/07-collaboration/07-ghost-writer/README.md
deleted file mode 100644
index 608251baeb..0000000000
--- a/examples/07-collaboration/07-ghost-writer/README.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# Ghost Writer
-
-In this example, we use a local Yjs document to store the document state, and have a ghost writer that edits the document in real-time.
-
-**Try it out:** Open this page in a new browser tab or window to see it in action!
-
-**Relevant Docs:**
-
-- [Editor Setup](/docs/getting-started/editor-setup)
diff --git a/examples/07-collaboration/07-ghost-writer/index.html b/examples/07-collaboration/07-ghost-writer/index.html
deleted file mode 100644
index 784f0cc6cd..0000000000
--- a/examples/07-collaboration/07-ghost-writer/index.html
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
- Ghost Writer
-
-
-
-
-
-
-
diff --git a/examples/07-collaboration/07-ghost-writer/main.tsx b/examples/07-collaboration/07-ghost-writer/main.tsx
deleted file mode 100644
index 677c7f7eed..0000000000
--- a/examples/07-collaboration/07-ghost-writer/main.tsx
+++ /dev/null
@@ -1,11 +0,0 @@
-// 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(
-
-
-
-);
diff --git a/examples/07-collaboration/07-ghost-writer/package.json b/examples/07-collaboration/07-ghost-writer/package.json
deleted file mode 100644
index 6f0e2b022d..0000000000
--- a/examples/07-collaboration/07-ghost-writer/package.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "name": "@blocknote/example-collaboration-ghost-writer",
- "description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
- "type": "module",
- "private": true,
- "version": "0.12.4",
- "scripts": {
- "start": "vite",
- "dev": "vite",
- "build:prod": "tsc && vite build",
- "preview": "vite preview"
- },
- "dependencies": {
- "@blocknote/ariakit": "latest",
- "@blocknote/core": "latest",
- "@blocknote/mantine": "latest",
- "@blocknote/react": "latest",
- "@blocknote/shadcn": "latest",
- "@mantine/core": "^8.3.4",
- "@mantine/hooks": "^8.3.4",
- "@mantine/utils": "^6.0.22",
- "react": "^19.2.1",
- "react-dom": "^19.2.1",
- "y-partykit": "^0.0.25",
- "yjs": "^13.6.27"
- },
- "devDependencies": {
- "@types/react": "^19.2.2",
- "@types/react-dom": "^19.2.2",
- "@vitejs/plugin-react": "^4.7.0",
- "vite": "^5.4.20"
- }
-}
\ No newline at end of file
diff --git a/examples/07-collaboration/07-ghost-writer/src/App.tsx b/examples/07-collaboration/07-ghost-writer/src/App.tsx
deleted file mode 100644
index 4344c5c11a..0000000000
--- a/examples/07-collaboration/07-ghost-writer/src/App.tsx
+++ /dev/null
@@ -1,126 +0,0 @@
-import "@blocknote/core/fonts/inter.css";
-import "@blocknote/mantine/style.css";
-import { BlockNoteView } from "@blocknote/mantine";
-import { useCreateBlockNote } from "@blocknote/react";
-
-import YPartyKitProvider from "y-partykit/provider";
-import * as Y from "yjs";
-import "./styles.css";
-import { useEffect, useState } from "react";
-// eslint-disable-next-line import/no-extraneous-dependencies
-import { EditorView } from "prosemirror-view";
-
-const params = new URLSearchParams(window.location.search);
-const ghostWritingRoom = params.get("room");
-const ghostWriterIndex = parseInt(params.get("index") || "1");
-const isGhostWriting = Boolean(ghostWritingRoom);
-const roomName = ghostWritingRoom || `ghost-writer-${Date.now()}`;
-// Sets up Yjs document and PartyKit Yjs provider.
-const doc = new Y.Doc();
-const provider = new YPartyKitProvider(
- "blocknote-dev.yousefed.partykit.dev",
- // Use a unique name as a "room" for your application.
- roomName,
- doc,
-);
-
-/**
- * Y-prosemirror has an optimization, where it doesn't send awareness updates unless the editor is currently focused.
- * So, for the ghost writers, we override the hasFocus method to always return true.
- */
-if (isGhostWriting) {
- EditorView.prototype.hasFocus = () => true;
-}
-
-const ghostContent =
- "This demo shows a two-way sync of documents. It allows you to test collaboration features, and see how stable the editor is. ";
-
-export default function App() {
- const [numGhostWriters, setNumGhostWriters] = useState(1);
- const [isPaused, setIsPaused] = useState(false);
- const editor = useCreateBlockNote({
- collaboration: {
- // The Yjs Provider responsible for transporting updates:
- provider,
- // Where to store BlockNote data in the Y.Doc:
- fragment: doc.getXmlFragment("document-store"),
- // Information (name and color) for this user:
- user: {
- name: isGhostWriting
- ? `Ghost Writer #${ghostWriterIndex}`
- : "My Username",
- color: isGhostWriting ? "#CCCCCC" : "#00ff00",
- },
- },
- });
-
- useEffect(() => {
- if (!isGhostWriting || isPaused) {
- return;
- }
- let index = 0;
- let timeout: NodeJS.Timeout;
-
- const scheduleNextChar = () => {
- const jitter = Math.random() * 200; // Random delay between 0-200ms
- timeout = setTimeout(() => {
- const firstBlock = editor.document?.[0];
- if (firstBlock) {
- editor.insertInlineContent(ghostContent[index], {
- updateSelection: true,
- });
- index = (index + 1) % ghostContent.length;
- }
- scheduleNextChar();
- }, 50 + jitter);
- };
-
- scheduleNextChar();
-
- return () => clearTimeout(timeout);
- }, [editor, isPaused]);
-
- // Renders the editor instance.
- return (
- <>
- {isGhostWriting ? (
- setIsPaused((a) => !a)}>
- {isPaused ? "Resume Ghost Writer" : "Pause Ghost Writer"}
-
- ) : (
- <>
- setNumGhostWriters((a) => a + 1)}>
- Add a Ghost Writer
-
- setNumGhostWriters((a) => a - 1)}>
- Remove a Ghost Writer
-
- {
- window.open(
- `${window.location.origin}${window.location.pathname}?room=${roomName}&index=-1`,
- "_blank",
- );
- }}>
- Ghost Writer in a new window
-
- >
- )}
-
-
- {!isGhostWriting && (
-
- {Array.from({ length: numGhostWriters }).map((_, index) => (
-
- ))}
-
- )}
- >
- );
-}
diff --git a/examples/07-collaboration/07-ghost-writer/src/styles.css b/examples/07-collaboration/07-ghost-writer/src/styles.css
deleted file mode 100644
index 588b4f01fa..0000000000
--- a/examples/07-collaboration/07-ghost-writer/src/styles.css
+++ /dev/null
@@ -1,12 +0,0 @@
-.two-way-sync {
- display: flex;
- flex-direction: row;
- height: 100%;
- margin-top: 10px;
- gap: 8px;
-}
-
-.ghost-writer {
- flex: 1;
- border: 1px solid #ccc;
-}
diff --git a/examples/07-collaboration/07-ghost-writer/tsconfig.json b/examples/07-collaboration/07-ghost-writer/tsconfig.json
deleted file mode 100644
index dbe3e6f62d..0000000000
--- a/examples/07-collaboration/07-ghost-writer/tsconfig.json
+++ /dev/null
@@ -1,36 +0,0 @@
-{
- "__comment": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
- "compilerOptions": {
- "target": "ESNext",
- "useDefineForClassFields": true,
- "lib": [
- "DOM",
- "DOM.Iterable",
- "ESNext"
- ],
- "allowJs": false,
- "skipLibCheck": true,
- "esModuleInterop": false,
- "allowSyntheticDefaultImports": true,
- "strict": true,
- "forceConsistentCasingInFileNames": true,
- "module": "ESNext",
- "moduleResolution": "bundler",
- "resolveJsonModule": true,
- "isolatedModules": true,
- "noEmit": true,
- "jsx": "react-jsx",
- "composite": true
- },
- "include": [
- "."
- ],
- "__ADD_FOR_LOCAL_DEV_references": [
- {
- "path": "../../../packages/core/"
- },
- {
- "path": "../../../packages/react/"
- }
- ]
-}
\ No newline at end of file
diff --git a/examples/07-collaboration/07-ghost-writer/vite.config.ts b/examples/07-collaboration/07-ghost-writer/vite.config.ts
deleted file mode 100644
index f62ab20bc2..0000000000
--- a/examples/07-collaboration/07-ghost-writer/vite.config.ts
+++ /dev/null
@@ -1,32 +0,0 @@
-// AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY
-import react from "@vitejs/plugin-react";
-import * as fs from "fs";
-import * as path from "path";
-import { defineConfig } from "vite";
-// import eslintPlugin from "vite-plugin-eslint";
-// https://vitejs.dev/config/
-export default defineConfig((conf) => ({
- plugins: [react()],
- optimizeDeps: {},
- build: {
- sourcemap: true,
- },
- resolve: {
- alias:
- conf.command === "build" ||
- !fs.existsSync(path.resolve(__dirname, "../../packages/core/src"))
- ? {}
- : ({
- // Comment out the lines below to load a built version of blocknote
- // or, keep as is to load live from sources with live reload working
- "@blocknote/core": path.resolve(
- __dirname,
- "../../packages/core/src/"
- ),
- "@blocknote/react": path.resolve(
- __dirname,
- "../../packages/react/src/"
- ),
- } as any),
- },
-}));
diff --git a/examples/07-collaboration/08-forking/.bnexample.json b/examples/07-collaboration/08-forking/.bnexample.json
deleted file mode 100644
index 2c30ef42bd..0000000000
--- a/examples/07-collaboration/08-forking/.bnexample.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "playground": true,
- "docs": false,
- "author": "nperez0111",
- "tags": ["Advanced", "Development", "Collaboration"],
- "dependencies": {
- "y-partykit": "^0.0.25",
- "yjs": "^13.6.27"
- }
-}
diff --git a/examples/07-collaboration/08-forking/README.md b/examples/07-collaboration/08-forking/README.md
deleted file mode 100644
index 997832dc16..0000000000
--- a/examples/07-collaboration/08-forking/README.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# Collaborative Editing with Forking
-
-In this example, we can fork a document and edit it independently of other collaborators. Then, we can choose to merge the changes back into the original document, or discard the changes.
-
-**Try it out:** Open this page in a new browser tab or window to see it in action!
-
-**Relevant Docs:**
-
-- [Editor Setup](/docs/getting-started/editor-setup)
diff --git a/examples/07-collaboration/08-forking/index.html b/examples/07-collaboration/08-forking/index.html
deleted file mode 100644
index 45ad926703..0000000000
--- a/examples/07-collaboration/08-forking/index.html
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
- Collaborative Editing with Forking
-
-
-
-
-
-
-
diff --git a/examples/07-collaboration/08-forking/main.tsx b/examples/07-collaboration/08-forking/main.tsx
deleted file mode 100644
index 677c7f7eed..0000000000
--- a/examples/07-collaboration/08-forking/main.tsx
+++ /dev/null
@@ -1,11 +0,0 @@
-// 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(
-
-
-
-);
diff --git a/examples/07-collaboration/08-forking/package.json b/examples/07-collaboration/08-forking/package.json
deleted file mode 100644
index bf8c9494dd..0000000000
--- a/examples/07-collaboration/08-forking/package.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "name": "@blocknote/example-collaboration-forking",
- "description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
- "type": "module",
- "private": true,
- "version": "0.12.4",
- "scripts": {
- "start": "vite",
- "dev": "vite",
- "build:prod": "tsc && vite build",
- "preview": "vite preview"
- },
- "dependencies": {
- "@blocknote/ariakit": "latest",
- "@blocknote/core": "latest",
- "@blocknote/mantine": "latest",
- "@blocknote/react": "latest",
- "@blocknote/shadcn": "latest",
- "@mantine/core": "^8.3.4",
- "@mantine/hooks": "^8.3.4",
- "@mantine/utils": "^6.0.22",
- "react": "^19.2.1",
- "react-dom": "^19.2.1",
- "y-partykit": "^0.0.25",
- "yjs": "^13.6.27"
- },
- "devDependencies": {
- "@types/react": "^19.2.2",
- "@types/react-dom": "^19.2.2",
- "@vitejs/plugin-react": "^4.7.0",
- "vite": "^5.4.20"
- }
-}
\ No newline at end of file
diff --git a/examples/07-collaboration/08-forking/src/App.tsx b/examples/07-collaboration/08-forking/src/App.tsx
deleted file mode 100644
index d338e133d7..0000000000
--- a/examples/07-collaboration/08-forking/src/App.tsx
+++ /dev/null
@@ -1,76 +0,0 @@
-import "@blocknote/core/fonts/inter.css";
-import {} from "@blocknote/core";
-import { ForkYDocExtension } from "@blocknote/core/extensions";
-import {
- useCreateBlockNote,
- useExtension,
- useExtensionState,
-} from "@blocknote/react";
-import { BlockNoteView } from "@blocknote/mantine";
-import "@blocknote/mantine/style.css";
-import YPartyKitProvider from "y-partykit/provider";
-import * as Y from "yjs";
-
-// Sets up Yjs document and PartyKit Yjs provider.
-const doc = new Y.Doc();
-const provider = new YPartyKitProvider(
- "blocknote-dev.yousefed.partykit.dev",
- // Use a unique name as a "room" for your application.
- "your-project-name-room",
- doc,
-);
-
-export default function App() {
- const editor = useCreateBlockNote({
- collaboration: {
- // The Yjs Provider responsible for transporting updates:
- provider,
- // Where to store BlockNote data in the Y.Doc:
- fragment: doc.getXmlFragment("document-store"),
- // Information (name and color) for this user:
- user: {
- name: "My Username",
- color: "#ff0000",
- },
- },
- });
- const forkYDocPlugin = useExtension(ForkYDocExtension, { editor });
- const isForked = useExtensionState(ForkYDocExtension, {
- editor,
- selector: (state) => state.isForked,
- });
-
- // Renders the editor instance.
- return (
- <>
- {
- forkYDocPlugin.fork();
- }}
- disabled={isForked}
- >
- Pause syncing
-
- {
- forkYDocPlugin.merge({ keepChanges: true });
- }}
- disabled={!isForked}
- >
- Play (accept changes)
-
- {
- forkYDocPlugin.merge({ keepChanges: false });
- }}
- disabled={!isForked}
- >
- Play (reject changes)
-
-
-
Forked: {isForked ? "Yes" : "No"}
-
-
- >
- );
-}
diff --git a/examples/07-collaboration/08-forking/tsconfig.json b/examples/07-collaboration/08-forking/tsconfig.json
deleted file mode 100644
index dbe3e6f62d..0000000000
--- a/examples/07-collaboration/08-forking/tsconfig.json
+++ /dev/null
@@ -1,36 +0,0 @@
-{
- "__comment": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
- "compilerOptions": {
- "target": "ESNext",
- "useDefineForClassFields": true,
- "lib": [
- "DOM",
- "DOM.Iterable",
- "ESNext"
- ],
- "allowJs": false,
- "skipLibCheck": true,
- "esModuleInterop": false,
- "allowSyntheticDefaultImports": true,
- "strict": true,
- "forceConsistentCasingInFileNames": true,
- "module": "ESNext",
- "moduleResolution": "bundler",
- "resolveJsonModule": true,
- "isolatedModules": true,
- "noEmit": true,
- "jsx": "react-jsx",
- "composite": true
- },
- "include": [
- "."
- ],
- "__ADD_FOR_LOCAL_DEV_references": [
- {
- "path": "../../../packages/core/"
- },
- {
- "path": "../../../packages/react/"
- }
- ]
-}
\ No newline at end of file
diff --git a/examples/07-collaboration/08-forking/vite.config.ts b/examples/07-collaboration/08-forking/vite.config.ts
deleted file mode 100644
index f62ab20bc2..0000000000
--- a/examples/07-collaboration/08-forking/vite.config.ts
+++ /dev/null
@@ -1,32 +0,0 @@
-// AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY
-import react from "@vitejs/plugin-react";
-import * as fs from "fs";
-import * as path from "path";
-import { defineConfig } from "vite";
-// import eslintPlugin from "vite-plugin-eslint";
-// https://vitejs.dev/config/
-export default defineConfig((conf) => ({
- plugins: [react()],
- optimizeDeps: {},
- build: {
- sourcemap: true,
- },
- resolve: {
- alias:
- conf.command === "build" ||
- !fs.existsSync(path.resolve(__dirname, "../../packages/core/src"))
- ? {}
- : ({
- // Comment out the lines below to load a built version of blocknote
- // or, keep as is to load live from sources with live reload working
- "@blocknote/core": path.resolve(
- __dirname,
- "../../packages/core/src/"
- ),
- "@blocknote/react": path.resolve(
- __dirname,
- "../../packages/react/src/"
- ),
- } as any),
- },
-}));
diff --git a/examples/09-ai/04-with-collaboration/.bnexample.json b/examples/09-ai/04-with-collaboration/.bnexample.json
deleted file mode 100644
index 9a4607e609..0000000000
--- a/examples/09-ai/04-with-collaboration/.bnexample.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- "playground": true,
- "docs": false,
- "author": "nperez0111",
- "tags": ["AI", "llm"],
- "dependencies": {
- "@blocknote/xl-ai": "latest",
- "@mantine/core": "^8.3.4",
- "ai": "^5.0.102",
- "y-partykit": "^0.0.25",
- "yjs": "^13.6.27"
- }
-}
diff --git a/examples/09-ai/04-with-collaboration/README.md b/examples/09-ai/04-with-collaboration/README.md
deleted file mode 100644
index 6b46d05091..0000000000
--- a/examples/09-ai/04-with-collaboration/README.md
+++ /dev/null
@@ -1,10 +0,0 @@
-# AI + Ghost Writer
-
-This example combines the AI extension with the ghost writer example to show how to use the AI extension in a collaborative environment.
-
-**Relevant Docs:**
-
-- [Editor Setup](/docs/getting-started/editor-setup)
-- [Changing the Formatting Toolbar](/docs/react/components/formatting-toolbar#changing-the-formatting-toolbar)
-- [Changing Slash Menu Items](/docs/react/components/suggestion-menus#changing-slash-menu-items)
-- [Getting Stared with BlockNote AI](/docs/features/ai/setup)
diff --git a/examples/09-ai/04-with-collaboration/index.html b/examples/09-ai/04-with-collaboration/index.html
deleted file mode 100644
index fcd4ed14ca..0000000000
--- a/examples/09-ai/04-with-collaboration/index.html
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
- AI + Ghost Writer
-
-
-
-
-
-
-
diff --git a/examples/09-ai/04-with-collaboration/main.tsx b/examples/09-ai/04-with-collaboration/main.tsx
deleted file mode 100644
index 677c7f7eed..0000000000
--- a/examples/09-ai/04-with-collaboration/main.tsx
+++ /dev/null
@@ -1,11 +0,0 @@
-// 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(
-
-
-
-);
diff --git a/examples/09-ai/04-with-collaboration/package.json b/examples/09-ai/04-with-collaboration/package.json
deleted file mode 100644
index 5fd5df3c8a..0000000000
--- a/examples/09-ai/04-with-collaboration/package.json
+++ /dev/null
@@ -1,35 +0,0 @@
-{
- "name": "@blocknote/example-ai-with-collaboration",
- "description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
- "type": "module",
- "private": true,
- "version": "0.12.4",
- "scripts": {
- "start": "vite",
- "dev": "vite",
- "build:prod": "tsc && vite build",
- "preview": "vite preview"
- },
- "dependencies": {
- "@blocknote/ariakit": "latest",
- "@blocknote/core": "latest",
- "@blocknote/mantine": "latest",
- "@blocknote/react": "latest",
- "@blocknote/shadcn": "latest",
- "@mantine/core": "^8.3.4",
- "@mantine/hooks": "^8.3.4",
- "@mantine/utils": "^6.0.22",
- "react": "^19.2.1",
- "react-dom": "^19.2.1",
- "@blocknote/xl-ai": "latest",
- "ai": "^5.0.102",
- "y-partykit": "^0.0.25",
- "yjs": "^13.6.27"
- },
- "devDependencies": {
- "@types/react": "^19.2.2",
- "@types/react-dom": "^19.2.2",
- "@vitejs/plugin-react": "^4.7.0",
- "vite": "^5.4.20"
- }
-}
\ No newline at end of file
diff --git a/examples/09-ai/04-with-collaboration/src/App.tsx b/examples/09-ai/04-with-collaboration/src/App.tsx
deleted file mode 100644
index 3fd8076ccd..0000000000
--- a/examples/09-ai/04-with-collaboration/src/App.tsx
+++ /dev/null
@@ -1,243 +0,0 @@
-import { BlockNoteEditor } from "@blocknote/core";
-import { filterSuggestionItems } from "@blocknote/core/extensions";
-import "@blocknote/core/fonts/inter.css";
-import { en } from "@blocknote/core/locales";
-import { BlockNoteView } from "@blocknote/mantine";
-import "@blocknote/mantine/style.css";
-import {
- FormattingToolbar,
- FormattingToolbarController,
- SuggestionMenuController,
- getDefaultReactSlashMenuItems,
- getFormattingToolbarItems,
- useCreateBlockNote,
-} from "@blocknote/react";
-import {
- AIExtension,
- AIMenuController,
- AIToolbarButton,
- getAISlashMenuItems,
-} from "@blocknote/xl-ai";
-import { en as aiEn } from "@blocknote/xl-ai/locales";
-import "@blocknote/xl-ai/style.css";
-import { useEffect, useState } from "react";
-import YPartyKitProvider from "y-partykit/provider";
-import * as Y from "yjs";
-// eslint-disable-next-line import/no-extraneous-dependencies
-import { EditorView } from "prosemirror-view";
-
-import { DefaultChatTransport } from "ai";
-import { getEnv } from "./getEnv";
-import "./styles.css";
-
-const BASE_URL =
- getEnv("BLOCKNOTE_AI_SERVER_BASE_URL") || "https://localhost:3000/ai";
-
-const params = new URLSearchParams(window.location.search);
-const ghostWritingRoom = params.get("room");
-const ghostWriterIndex = parseInt(params.get("index") || "1");
-const isGhostWriting = Boolean(ghostWritingRoom);
-const roomName = ghostWritingRoom || `ghost-writer-${Date.now()}`;
-// Sets up Yjs document and PartyKit Yjs provider.
-const doc = new Y.Doc();
-const provider = new YPartyKitProvider(
- "blocknote-dev.yousefed.partykit.dev",
- // Use a unique name as a "room" for your application.
- roomName,
- doc,
-);
-
-/**
- * Y-prosemirror has an optimization, where it doesn't send awareness updates unless the editor is currently focused.
- * So, for the ghost writers, we override the hasFocus method to always return true.
- */
-if (isGhostWriting) {
- EditorView.prototype.hasFocus = () => true;
-}
-
-const ghostContent =
- "This demo shows a two-way sync of documents. It allows you to test collaboration features, and see how stable the editor is. ";
-
-export default function App() {
- const [numGhostWriters, setNumGhostWriters] = useState(1);
- const [isPaused, setIsPaused] = useState(false);
- const editor = useCreateBlockNote({
- collaboration: {
- // The Yjs Provider responsible for transporting updates:
- provider,
- // Where to store BlockNote data in the Y.Doc:
- fragment: doc.getXmlFragment("document-store"),
- // Information (name and color) for this user:
- user: {
- name: isGhostWriting
- ? `Ghost Writer #${ghostWriterIndex}`
- : "My Username",
- color: isGhostWriting ? "#CCCCCC" : "#00ff00",
- },
- },
- dictionary: {
- ...en,
- ai: aiEn, // add default translations for the AI extension
- },
- // Register the AI extension
- extensions: [
- AIExtension({
- transport: new DefaultChatTransport({
- api: `${BASE_URL}/regular/streamText`,
- }),
- }),
- ],
- // We set some initial content for demo purposes
- initialContent: [
- {
- type: "heading",
- props: {
- level: 1,
- },
- content: "Open source software",
- },
- {
- type: "paragraph",
- content:
- "Open source software refers to computer programs whose source code is made available to the public, allowing anyone to view, modify, and distribute the code. This model stands in contrast to proprietary software, where the source code is kept secret and only the original creators have the right to make changes. Open projects are developed collaboratively, often by communities of developers from around the world, and are typically distributed under licenses that promote sharing and openness.",
- },
- {
- type: "paragraph",
- content:
- "One of the primary benefits of open source is the promotion of digital autonomy. By providing access to the source code, these programs empower users to control their own technology, customize software to fit their needs, and avoid vendor lock-in. This level of transparency also allows for greater security, as anyone can inspect the code for vulnerabilities or malicious elements. As a result, users are not solely dependent on a single company for updates, bug fixes, or continued support.",
- },
- {
- type: "paragraph",
- content:
- "Additionally, open development fosters innovation and collaboration. Developers can build upon existing projects, share improvements, and learn from each other, accelerating the pace of technological advancement. The open nature of these projects often leads to higher quality software, as bugs are identified and fixed more quickly by a diverse group of contributors. Furthermore, using open source can reduce costs for individuals, businesses, and governments, as it is often available for free and can be tailored to specific requirements without expensive licensing fees.",
- },
- ],
- });
-
- useEffect(() => {
- if (!isGhostWriting || isPaused) {
- return;
- }
- let index = 0;
- let timeout: NodeJS.Timeout;
-
- const scheduleNextChar = () => {
- const jitter = Math.random() * 200; // Random delay between 0-200ms
- timeout = setTimeout(() => {
- const firstBlock = editor.document?.[0];
- if (firstBlock) {
- editor.insertInlineContent(ghostContent[index], {
- updateSelection: true,
- });
- index = (index + 1) % ghostContent.length;
- }
- scheduleNextChar();
- }, 50 + jitter);
- };
-
- scheduleNextChar();
-
- return () => clearTimeout(timeout);
- }, [editor, isPaused]);
-
- // Renders the editor instance.
- return (
- <>
- {isGhostWriting ? (
- setIsPaused((a) => !a)}>
- {isPaused ? "Resume Ghost Writer" : "Pause Ghost Writer"}
-
- ) : (
- <>
- setNumGhostWriters((a) => a + 1)}>
- Add a Ghost Writer
-
- setNumGhostWriters((a) => a - 1)}>
- Remove a Ghost Writer
-
- {
- window.open(
- `${window.location.origin}${window.location.pathname}?room=${roomName}&index=-1`,
- "_blank",
- );
- }}
- >
- Ghost Writer in a new window
-
- >
- )}
-
- {/* Add the AI Command menu to the editor */}
-
-
- {/* We disabled the default formatting toolbar with `formattingToolbar=false`
- and replace it for one with an "AI button" (defined below).
- (See "Formatting Toolbar" in docs)
- */}
-
-
- {/* We disabled the default SlashMenu with `slashMenu=false`
- and replace it for one with an AI option (defined below).
- (See "Suggestion Menus" in docs)
- */}
-
-
-
- {!isGhostWriting && (
-
- {Array.from({ length: numGhostWriters }).map((_, index) => (
-
- ))}
-
- )}
- >
- );
-}
-
-// Formatting toolbar with the `AIToolbarButton` added
-function FormattingToolbarWithAI() {
- return (
- (
-
- {...getFormattingToolbarItems()}
- {/* Add the AI button */}
-
-
- )}
- />
- );
-}
-
-// Slash menu with the AI option added
-function SuggestionMenuWithAI(props: {
- editor: BlockNoteEditor;
-}) {
- return (
-
- filterSuggestionItems(
- [
- ...getDefaultReactSlashMenuItems(props.editor),
- // add the default AI slash menu items, or define your own
- ...getAISlashMenuItems(props.editor),
- ],
- query,
- )
- }
- />
- );
-}
diff --git a/examples/09-ai/04-with-collaboration/src/getEnv.ts b/examples/09-ai/04-with-collaboration/src/getEnv.ts
deleted file mode 100644
index b225fc462e..0000000000
--- a/examples/09-ai/04-with-collaboration/src/getEnv.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-// helper function to get env variables across next / vite
-// only needed so this example works in BlockNote demos and docs
-export function getEnv(key: string) {
- const env = (import.meta as any).env
- ? {
- BLOCKNOTE_AI_SERVER_API_KEY: (import.meta as any).env
- .VITE_BLOCKNOTE_AI_SERVER_API_KEY,
- BLOCKNOTE_AI_SERVER_BASE_URL: (import.meta as any).env
- .VITE_BLOCKNOTE_AI_SERVER_BASE_URL,
- }
- : {
- BLOCKNOTE_AI_SERVER_API_KEY:
- process.env.NEXT_PUBLIC_BLOCKNOTE_AI_SERVER_API_KEY,
- BLOCKNOTE_AI_SERVER_BASE_URL:
- process.env.NEXT_PUBLIC_BLOCKNOTE_AI_SERVER_BASE_URL,
- };
-
- const value = env[key as keyof typeof env];
- return value;
-}
diff --git a/examples/09-ai/04-with-collaboration/src/styles.css b/examples/09-ai/04-with-collaboration/src/styles.css
deleted file mode 100644
index 588b4f01fa..0000000000
--- a/examples/09-ai/04-with-collaboration/src/styles.css
+++ /dev/null
@@ -1,12 +0,0 @@
-.two-way-sync {
- display: flex;
- flex-direction: row;
- height: 100%;
- margin-top: 10px;
- gap: 8px;
-}
-
-.ghost-writer {
- flex: 1;
- border: 1px solid #ccc;
-}
diff --git a/examples/09-ai/04-with-collaboration/tsconfig.json b/examples/09-ai/04-with-collaboration/tsconfig.json
deleted file mode 100644
index dbe3e6f62d..0000000000
--- a/examples/09-ai/04-with-collaboration/tsconfig.json
+++ /dev/null
@@ -1,36 +0,0 @@
-{
- "__comment": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
- "compilerOptions": {
- "target": "ESNext",
- "useDefineForClassFields": true,
- "lib": [
- "DOM",
- "DOM.Iterable",
- "ESNext"
- ],
- "allowJs": false,
- "skipLibCheck": true,
- "esModuleInterop": false,
- "allowSyntheticDefaultImports": true,
- "strict": true,
- "forceConsistentCasingInFileNames": true,
- "module": "ESNext",
- "moduleResolution": "bundler",
- "resolveJsonModule": true,
- "isolatedModules": true,
- "noEmit": true,
- "jsx": "react-jsx",
- "composite": true
- },
- "include": [
- "."
- ],
- "__ADD_FOR_LOCAL_DEV_references": [
- {
- "path": "../../../packages/core/"
- },
- {
- "path": "../../../packages/react/"
- }
- ]
-}
\ No newline at end of file
diff --git a/examples/09-ai/04-with-collaboration/vite.config.ts b/examples/09-ai/04-with-collaboration/vite.config.ts
deleted file mode 100644
index f62ab20bc2..0000000000
--- a/examples/09-ai/04-with-collaboration/vite.config.ts
+++ /dev/null
@@ -1,32 +0,0 @@
-// AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY
-import react from "@vitejs/plugin-react";
-import * as fs from "fs";
-import * as path from "path";
-import { defineConfig } from "vite";
-// import eslintPlugin from "vite-plugin-eslint";
-// https://vitejs.dev/config/
-export default defineConfig((conf) => ({
- plugins: [react()],
- optimizeDeps: {},
- build: {
- sourcemap: true,
- },
- resolve: {
- alias:
- conf.command === "build" ||
- !fs.existsSync(path.resolve(__dirname, "../../packages/core/src"))
- ? {}
- : ({
- // Comment out the lines below to load a built version of blocknote
- // or, keep as is to load live from sources with live reload working
- "@blocknote/core": path.resolve(
- __dirname,
- "../../packages/core/src/"
- ),
- "@blocknote/react": path.resolve(
- __dirname,
- "../../packages/react/src/"
- ),
- } as any),
- },
-}));
diff --git a/examples/09-ai/05-manual-execution/.bnexample.json b/examples/09-ai/05-manual-execution/.bnexample.json
deleted file mode 100644
index ae243fd926..0000000000
--- a/examples/09-ai/05-manual-execution/.bnexample.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- "playground": true,
- "docs": false,
- "author": "yousefed",
- "tags": ["AI", "llm"],
- "dependencies": {
- "@blocknote/xl-ai": "latest",
- "@mantine/core": "^8.3.4",
- "ai": "^5.0.102",
- "y-partykit": "^0.0.25",
- "yjs": "^13.6.27"
- }
-}
diff --git a/examples/09-ai/05-manual-execution/README.md b/examples/09-ai/05-manual-execution/README.md
deleted file mode 100644
index 74d066cc3e..0000000000
--- a/examples/09-ai/05-manual-execution/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# AI manual execution
-
-Instead of calling AI models directly, this example shows how you can use an existing stream of responses and apply them to the editor.
diff --git a/examples/09-ai/05-manual-execution/index.html b/examples/09-ai/05-manual-execution/index.html
deleted file mode 100644
index c63d224da9..0000000000
--- a/examples/09-ai/05-manual-execution/index.html
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
- AI manual execution
-
-
-
-
-
-
-
diff --git a/examples/09-ai/05-manual-execution/main.tsx b/examples/09-ai/05-manual-execution/main.tsx
deleted file mode 100644
index 677c7f7eed..0000000000
--- a/examples/09-ai/05-manual-execution/main.tsx
+++ /dev/null
@@ -1,11 +0,0 @@
-// 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(
-
-
-
-);
diff --git a/examples/09-ai/05-manual-execution/package.json b/examples/09-ai/05-manual-execution/package.json
deleted file mode 100644
index 016f5bb28f..0000000000
--- a/examples/09-ai/05-manual-execution/package.json
+++ /dev/null
@@ -1,35 +0,0 @@
-{
- "name": "@blocknote/example-ai-manual-execution",
- "description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
- "type": "module",
- "private": true,
- "version": "0.12.4",
- "scripts": {
- "start": "vite",
- "dev": "vite",
- "build:prod": "tsc && vite build",
- "preview": "vite preview"
- },
- "dependencies": {
- "@blocknote/ariakit": "latest",
- "@blocknote/core": "latest",
- "@blocknote/mantine": "latest",
- "@blocknote/react": "latest",
- "@blocknote/shadcn": "latest",
- "@mantine/core": "^8.3.4",
- "@mantine/hooks": "^8.3.4",
- "@mantine/utils": "^6.0.22",
- "react": "^19.2.1",
- "react-dom": "^19.2.1",
- "@blocknote/xl-ai": "latest",
- "ai": "^5.0.102",
- "y-partykit": "^0.0.25",
- "yjs": "^13.6.27"
- },
- "devDependencies": {
- "@types/react": "^19.2.2",
- "@types/react-dom": "^19.2.2",
- "@vitejs/plugin-react": "^4.7.0",
- "vite": "^5.4.20"
- }
-}
\ No newline at end of file
diff --git a/examples/09-ai/05-manual-execution/src/App.tsx b/examples/09-ai/05-manual-execution/src/App.tsx
deleted file mode 100644
index 9b10faef97..0000000000
--- a/examples/09-ai/05-manual-execution/src/App.tsx
+++ /dev/null
@@ -1,197 +0,0 @@
-import "@blocknote/core/fonts/inter.css";
-import { en } from "@blocknote/core/locales";
-import { BlockNoteView } from "@blocknote/mantine";
-import "@blocknote/mantine/style.css";
-import { useCreateBlockNote } from "@blocknote/react";
-import {
- AIExtension,
- StreamToolExecutor,
- aiDocumentFormats,
-} from "@blocknote/xl-ai";
-import { en as aiEn } from "@blocknote/xl-ai/locales";
-import "@blocknote/xl-ai/style.css";
-
-export default function App() {
- // Creates a new editor instance.
- const editor = useCreateBlockNote({
- dictionary: {
- ...en,
- ai: aiEn, // add default translations for the AI extension
- },
- // Register the AI extension
- extensions: [AIExtension()],
- // We set some initial content for demo purposes
- initialContent: [
- {
- type: "heading",
- props: {
- level: 1,
- },
- content: "Open source software",
- },
- {
- type: "paragraph",
- content:
- "Open source software refers to computer programs whose source code is made available to the public, allowing anyone to view, modify, and distribute the code. This model stands in contrast to proprietary software, where the source code is kept secret and only the original creators have the right to make changes. Open projects are developed collaboratively, often by communities of developers from around the world, and are typically distributed under licenses that promote sharing and openness.",
- },
- {
- type: "paragraph",
- content:
- "One of the primary benefits of open source is the promotion of digital autonomy. By providing access to the source code, these programs empower users to control their own technology, customize software to fit their needs, and avoid vendor lock-in. This level of transparency also allows for greater security, as anyone can inspect the code for vulnerabilities or malicious elements. As a result, users are not solely dependent on a single company for updates, bug fixes, or continued support.",
- },
- {
- type: "paragraph",
- content:
- "Additionally, open development fosters innovation and collaboration. Developers can build upon existing projects, share improvements, and learn from each other, accelerating the pace of technological advancement. The open nature of these projects often leads to higher quality software, as bugs are identified and fixed more quickly by a diverse group of contributors. Furthermore, using open source can reduce costs for individuals, businesses, and governments, as it is often available for free and can be tailored to specific requirements without expensive licensing fees.",
- },
- ],
- });
-
- // Renders the editor instance using a React component.
- return (
-
-
-
-
- {/*Inserts a new block at start of document.*/}
-
{
- const blockToChange = editor.document[1].id;
-
- // Let's get the stream tools so we can invoke them manually
- // In this case, we're using the default stream tools, which allow all operations
- const tools = aiDocumentFormats.html
- .getStreamToolsProvider()
- .getStreamTools(editor, true);
-
- // Create an executor that can execute StreamToolCalls
- const executor = new StreamToolExecutor(tools);
-
- // Use `executeOne` to invoke a single, non-streaming StreamToolCall
- await executor.executeOne({
- type: "update",
- id: blockToChange,
- block: "Open source software is cool
",
- });
- // accept the changes after 1 second
- await new Promise((resolve) => setTimeout(resolve, 1000));
- await editor.getExtension(AIExtension)?.acceptChanges();
- }}
- >
- Update first block
-
-
{
- const blockToChange = editor.document[1].id;
-
- // Let's get the stream tools so we can invoke them manually
- // In this case, we choose to only get the "update" tool
- const tools = aiDocumentFormats.html
- .getStreamToolsProvider({
- // only allow "update" operations
- defaultStreamTools: {
- update: true,
- },
- })
- .getStreamTools(editor, true);
-
- // Create an executor that can execute StreamToolCalls
- const executor = new StreamToolExecutor(tools);
-
- // We'll stream two updates: a partial update and a full update
- // to use streaming operations, we need to get a writer
- const writer = executor.writable.getWriter();
-
- // write a partial update
- writer.write({
- operation: {
- type: "update",
- id: blockToChange,
- block:
- "This Open source software like Hello World refers to computer programs, this is a longer update, let's write a first sentence that's quite long long long long here.",
- },
- // this is not an update to an earlier "update" StreamToolCall
- isUpdateToPreviousOperation: false,
- // this operation is a partial update and will be "completed" by the next update
- isPossiblyPartial: true,
- metadata: {},
- });
- await new Promise((resolve) => setTimeout(resolve, 3000));
- writer.write({
- operation: {
- type: "update",
- id: blockToChange,
- block:
- "
This Open source software like Hello World refers to computer programs, this is a longer update, let's write a first sentence that's quite long long long long here. And now let's write a second sentence.
",
- },
- // this is an update to an earlier "update" StreamToolCall
- isUpdateToPreviousOperation: true,
- // this operation is not a partial update, we've received the entire invocation
- isPossiblyPartial: false,
- metadata: {},
- });
-
- await writer.close();
- await executor.finish();
-
- // accept the changes after 1 second
- await new Promise((resolve) => setTimeout(resolve, 1000));
- await editor.getExtension(AIExtension)?.acceptChanges();
- }}
- >
- Update first block (streaming)
-
-
{
- const blockToChange = editor.document[1].id;
-
- // Let's get the stream tools so we can invoke them manually
- // In this case, we choose to only get the "update" tool
- const tools = aiDocumentFormats.html
- .getStreamToolsProvider({
- defaultStreamTools: {
- // only allow "update" operations
- update: true,
- },
- })
- .getStreamTools(editor, true);
-
- // Create an executor that can execute StreamToolCalls
- const executor = new StreamToolExecutor(tools);
-
- // We'll stream two updates: a partial update and a full update
- // to use streaming operations, we need to get a writer
- const writer = executor.writable.getWriter();
-
- // write a partial update, notice how the JSON is cut off (simulating a streaming json response)
- writer.write(
- `{
- "type": "update",
- "id": ${JSON.stringify(blockToChange + "$")},
- "block": "This Open source software like Hello World refers to computer programs, this is a longer update, let's write a first sentence that's quite long long long long here.`,
- );
- await new Promise((resolve) => setTimeout(resolve, 3000));
- writer.write(`{
- "type": "update",
- "id": ${JSON.stringify(blockToChange + "$")},
- "block":
- "
This Open source software like Hello World refers to computer programs, this is a longer update, let's write a first sentence that's quite long long long long here. And now let's write a second sentence.
"
-}`);
-
- await writer.close();
- await executor.finish();
-
- // accept the changes after 1 second
- await new Promise((resolve) => setTimeout(resolve, 1000));
- await editor.getExtension(AIExtension)?.acceptChanges();
- }}
- >
- Update first block (streaming strings)
-
-
-
- );
-}
diff --git a/examples/09-ai/05-manual-execution/src/getEnv.ts b/examples/09-ai/05-manual-execution/src/getEnv.ts
deleted file mode 100644
index b225fc462e..0000000000
--- a/examples/09-ai/05-manual-execution/src/getEnv.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-// helper function to get env variables across next / vite
-// only needed so this example works in BlockNote demos and docs
-export function getEnv(key: string) {
- const env = (import.meta as any).env
- ? {
- BLOCKNOTE_AI_SERVER_API_KEY: (import.meta as any).env
- .VITE_BLOCKNOTE_AI_SERVER_API_KEY,
- BLOCKNOTE_AI_SERVER_BASE_URL: (import.meta as any).env
- .VITE_BLOCKNOTE_AI_SERVER_BASE_URL,
- }
- : {
- BLOCKNOTE_AI_SERVER_API_KEY:
- process.env.NEXT_PUBLIC_BLOCKNOTE_AI_SERVER_API_KEY,
- BLOCKNOTE_AI_SERVER_BASE_URL:
- process.env.NEXT_PUBLIC_BLOCKNOTE_AI_SERVER_BASE_URL,
- };
-
- const value = env[key as keyof typeof env];
- return value;
-}
diff --git a/examples/09-ai/05-manual-execution/src/styles.css b/examples/09-ai/05-manual-execution/src/styles.css
deleted file mode 100644
index cc97b34a4f..0000000000
--- a/examples/09-ai/05-manual-execution/src/styles.css
+++ /dev/null
@@ -1,15 +0,0 @@
-.edit-buttons {
- display: flex;
- justify-content: space-between;
- margin-top: 8px;
-}
-
-.edit-button {
- border: 1px solid gray;
- border-radius: 4px;
- padding-inline: 4px;
-}
-
-.edit-button:hover {
- border: 1px solid lightgrey;
-}
diff --git a/examples/09-ai/05-manual-execution/tsconfig.json b/examples/09-ai/05-manual-execution/tsconfig.json
deleted file mode 100644
index dbe3e6f62d..0000000000
--- a/examples/09-ai/05-manual-execution/tsconfig.json
+++ /dev/null
@@ -1,36 +0,0 @@
-{
- "__comment": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
- "compilerOptions": {
- "target": "ESNext",
- "useDefineForClassFields": true,
- "lib": [
- "DOM",
- "DOM.Iterable",
- "ESNext"
- ],
- "allowJs": false,
- "skipLibCheck": true,
- "esModuleInterop": false,
- "allowSyntheticDefaultImports": true,
- "strict": true,
- "forceConsistentCasingInFileNames": true,
- "module": "ESNext",
- "moduleResolution": "bundler",
- "resolveJsonModule": true,
- "isolatedModules": true,
- "noEmit": true,
- "jsx": "react-jsx",
- "composite": true
- },
- "include": [
- "."
- ],
- "__ADD_FOR_LOCAL_DEV_references": [
- {
- "path": "../../../packages/core/"
- },
- {
- "path": "../../../packages/react/"
- }
- ]
-}
\ No newline at end of file
diff --git a/examples/09-ai/05-manual-execution/vite.config.ts b/examples/09-ai/05-manual-execution/vite.config.ts
deleted file mode 100644
index f62ab20bc2..0000000000
--- a/examples/09-ai/05-manual-execution/vite.config.ts
+++ /dev/null
@@ -1,32 +0,0 @@
-// AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY
-import react from "@vitejs/plugin-react";
-import * as fs from "fs";
-import * as path from "path";
-import { defineConfig } from "vite";
-// import eslintPlugin from "vite-plugin-eslint";
-// https://vitejs.dev/config/
-export default defineConfig((conf) => ({
- plugins: [react()],
- optimizeDeps: {},
- build: {
- sourcemap: true,
- },
- resolve: {
- alias:
- conf.command === "build" ||
- !fs.existsSync(path.resolve(__dirname, "../../packages/core/src"))
- ? {}
- : ({
- // Comment out the lines below to load a built version of blocknote
- // or, keep as is to load live from sources with live reload working
- "@blocknote/core": path.resolve(
- __dirname,
- "../../packages/core/src/"
- ),
- "@blocknote/react": path.resolve(
- __dirname,
- "../../packages/react/src/"
- ),
- } as any),
- },
-}));
diff --git a/package.json b/package.json
index b431e8ce3b..6f00a07bd9 100644
--- a/package.json
+++ b/package.json
@@ -33,7 +33,15 @@
"msw",
"nx",
"unrs-resolver"
- ]
+ ],
+ "overrides": {
+ "@headlessui/react": "^2.2.4",
+ "@tiptap/core": "^3.0.0",
+ "@tiptap/pm": "^3.0.0"
+ },
+ "patchedDependencies": {
+ "@y/prosemirror": "patches/@y__prosemirror.patch"
+ }
},
"packageManager": "pnpm@10.23.0+sha512.21c4e5698002ade97e4efe8b8b4a89a8de3c85a37919f957e7a0f30f38fbc5bbdd05980ffe29179b2fb6e6e691242e098d945d1601772cad0fef5fb6411e2a4b",
"private": true,
diff --git a/packages/core/package.json b/packages/core/package.json
index 2710c18bd1..e541ca7088 100644
--- a/packages/core/package.json
+++ b/packages/core/package.json
@@ -105,9 +105,13 @@
"@tiptap/extension-text": "^3.13.0",
"@tiptap/extension-underline": "^3.13.0",
"@tiptap/pm": "^3.13.0",
+ "@y/prosemirror": "2.0.0-2",
+ "@y/protocols": "1.0.6-3",
+ "@y/y": "14.0.0-19",
"emoji-mart": "^5.6.0",
"fast-deep-equal": "^3.1.3",
"hast-util-from-dom": "^5.0.1",
+ "lib0": "0.2.116",
"prosemirror-dropcursor": "^1.8.2",
"prosemirror-highlight": "^0.13.0",
"prosemirror-model": "^1.25.4",
@@ -125,10 +129,7 @@
"remark-stringify": "^11.0.0",
"unified": "^11.0.5",
"unist-util-visit": "^5.0.0",
- "uuid": "^8.3.2",
- "y-prosemirror": "^1.3.7",
- "y-protocols": "^1.0.6",
- "yjs": "^13.6.27"
+ "uuid": "^8.3.2"
},
"devDependencies": {
"@types/emoji-mart": "^3.0.14",
@@ -143,14 +144,6 @@
"vite-plugin-eslint": "^1.8.1",
"vitest": "^2.1.9"
},
- "peerDependencies": {
- "@hocuspocus/provider": "^2.15.2 || ^3.0.0"
- },
- "peerDependenciesMeta": {
- "@hocuspocus/provider": {
- "optional": true
- }
- },
"eslintConfig": {
"extends": [
"../../.eslintrc.json"
diff --git a/packages/core/src/api/positionMapping.test.ts b/packages/core/src/api/positionMapping.test.ts
index a0019932ee..15c7b3b4e8 100644
--- a/packages/core/src/api/positionMapping.test.ts
+++ b/packages/core/src/api/positionMapping.test.ts
@@ -1,5 +1,5 @@
import { describe, expect, it, vi } from "vitest";
-import * as Y from "yjs";
+import * as Y from "@y/y";
import { BlockNoteEditor } from "../editor/BlockNoteEditor.js";
import { trackPosition } from "./positionMapping.js";
diff --git a/packages/core/src/api/positionMapping.ts b/packages/core/src/api/positionMapping.ts
index 11d8ef0fa9..72f637a743 100644
--- a/packages/core/src/api/positionMapping.ts
+++ b/packages/core/src/api/positionMapping.ts
@@ -3,10 +3,8 @@ import {
absolutePositionToRelativePosition,
relativePositionToAbsolutePosition,
ySyncPluginKey,
-} from "y-prosemirror";
+} from "@y/prosemirror";
import type { BlockNoteEditor } from "../editor/BlockNoteEditor.js";
-import * as Y from "yjs";
-import type { ProsemirrorBinding } from "y-prosemirror";
/**
* This is used to track a mapping for each editor. The mapping stores the mappings for each transaction since the first transaction that was tracked.
@@ -61,10 +59,9 @@ export function trackPosition(
*/
side: "left" | "right" = "left",
): () => number {
- const ySyncPluginState = ySyncPluginKey.getState(editor.prosemirrorState) as {
- doc: Y.Doc;
- binding: ProsemirrorBinding;
- };
+ const ySyncPluginState = ySyncPluginKey.getState(
+ editor.prosemirrorState,
+ ) as any;
if (!ySyncPluginState) {
// No y-prosemirror sync plugin, so we need to track the mapping manually
@@ -94,7 +91,7 @@ export function trackPosition(
return () => {
const curYSyncPluginState = ySyncPluginKey.getState(
editor.prosemirrorState,
- ) as typeof ySyncPluginState;
+ ) as any;
const pos = relativePositionToAbsolutePosition(
curYSyncPluginState.doc,
curYSyncPluginState.binding.type,
diff --git a/packages/core/src/comments/extension.ts b/packages/core/src/comments/extension.ts
index 946e272290..9b5c9d2ace 100644
--- a/packages/core/src/comments/extension.ts
+++ b/packages/core/src/comments/extension.ts
@@ -1,7 +1,7 @@
import { Node } from "prosemirror-model";
import { Plugin, PluginKey } from "prosemirror-state";
import { Decoration, DecorationSet } from "prosemirror-view";
-import { getRelativeSelection, ySyncPluginKey } from "y-prosemirror";
+import { getRelativeSelection, ySyncPluginKey } from "@y/prosemirror";
import {
createExtension,
createStore,
@@ -331,7 +331,7 @@ export const CommentsExtension = createExtension(
anchor: pmSelection.anchor,
},
yjs: ystate
- ? getRelativeSelection(ystate.binding, view.state)
+ ? getRelativeSelection((ystate as any).binding, view.state)
: undefined,
};
await threadStore.addThreadToDocument({
diff --git a/packages/core/src/comments/threadstore/TipTapThreadStore.ts b/packages/core/src/comments/threadstore/TipTapThreadStore.ts
index b0d25ed046..d95fbc0e7a 100644
--- a/packages/core/src/comments/threadstore/TipTapThreadStore.ts
+++ b/packages/core/src/comments/threadstore/TipTapThreadStore.ts
@@ -1,8 +1,3 @@
-import type {
- TCollabComment,
- TCollabThread,
- TiptapCollabProvider,
-} from "@hocuspocus/provider";
import {
CommentBody,
CommentData,
@@ -11,6 +6,168 @@ import {
} from "../types.js";
import { ThreadStore } from "./ThreadStore.js";
import { ThreadStoreAuth } from "./ThreadStoreAuth.js";
+type TCollabComment = {
+ id: string;
+ createdAt: string;
+ updatedAt: string;
+ deletedAt?: string;
+ data: Data;
+ content: any;
+};
+type TCollabThread = {
+ id: string;
+ createdAt: number;
+ updatedAt: number;
+ deletedAt: number | null;
+ resolvedAt?: string;
+ comments: TCollabComment[];
+ deletedComments: TCollabComment[];
+ data: Data;
+};
+type TiptapCollabProvider = {
+ /**
+ * note: this will only work if your server loaded @hocuspocus-pro/extension-history, or if you are on a Tiptap business plan.
+ */
+ createVersion(name?: string): void;
+ /**
+ * note: this will only work if your server loaded @hocuspocus-pro/extension-history, or if you are on a Tiptap business plan.
+ */
+ revertToVersion(targetVersion: number): void;
+ /**
+ * note: this will only work if your server loaded @hocuspocus-pro/extension-history, or if you are on a Tiptap business plan.
+ *
+ * The server will reply with a stateless message (THistoryVersionPreviewEvent)
+ */
+ previewVersion(targetVersion: number): void;
+ isAutoVersioning(): boolean;
+ /**
+ * Finds all threads in the document and returns them as JSON objects
+ * @options Options to control the output of the threads (e.g. include deleted threads)
+ * @returns An array of threads as JSON objects
+ */
+ getThreads(): TCollabThread[];
+ /**
+ * Gets a single thread by its id
+ * @param id The thread id
+ * @returns The thread as a JSON object or null if not found
+ */
+ getThread(
+ id: string,
+ ): TCollabThread | null;
+ /**
+ * Create a new thread
+ * @param data The thread data
+ * @returns The created thread
+ */
+ createThread(
+ data: Omit<
+ TCollabThread,
+ | "id"
+ | "createdAt"
+ | "updatedAt"
+ | "deletedAt"
+ | "comments"
+ | "deletedComments"
+ >,
+ ): TCollabThread;
+ /**
+ * Update a specific thread
+ * @param id The thread id
+ * @param data New data for the thread
+ * @returns The updated thread or null if the thread is not found
+ */
+ updateThread(
+ id: TCollabThread["id"],
+ data: Partial<
+ Pick & {
+ resolvedAt: TCollabThread["resolvedAt"] | null;
+ }
+ >,
+ ): TCollabThread;
+ /**
+ * Handle the deletion of a thread. By default, the thread and it's comments are not deleted, but marked as deleted
+ * via the `deletedAt` property. Forceful deletion can be enabled by setting the `force` option to `true`.
+ *
+ * If you only want to delete the comments of a thread, you can set the `deleteComments` option to `true`.
+ * @param id The thread id
+ * @param options A set of options that control how the thread is deleted
+ * @returns The deleted thread or null if the thread is not found
+ */
+ deleteThread(id: TCollabThread["id"]): TCollabThread | null | undefined;
+ /**
+ * Tries to restore a deleted thread
+ * @param id The thread id
+ * @returns The restored thread or null if the thread is not found
+ */
+ restoreThread(id: TCollabThread["id"]): TCollabThread | null;
+ /**
+ * Returns comments from a thread, either deleted or not
+ * @param threadId The thread id
+ * @param includeDeleted If you want to include deleted comments, defaults to `false`
+ * @returns The comments or null if the thread is not found
+ */
+ getThreadComments(
+ threadId: TCollabThread["id"],
+ includeDeleted?: boolean,
+ ): TCollabComment[] | null;
+ /**
+ * Get a single comment from a specific thread
+ * @param threadId The thread id
+ * @param commentId The comment id
+ * @param includeDeleted If you want to include deleted comments in the search
+ * @returns The comment or null if not found
+ */
+ getThreadComment(
+ threadId: TCollabThread["id"],
+ commentId: TCollabComment["id"],
+ includeDeleted?: boolean,
+ ): TCollabComment | null;
+ /**
+ * Adds a comment to a thread
+ * @param threadId The thread id
+ * @param data The comment data
+ * @returns The updated thread or null if the thread is not found
+ * @example addComment('123', { content: 'Hello world', data: { author: 'Maria Doe' } })
+ */
+ addComment(
+ threadId: TCollabThread["id"],
+ data: Omit,
+ ): TCollabThread;
+ /**
+ * Update a comment in a thread
+ * @param threadId The thread id
+ * @param commentId The comment id
+ * @param data The new comment data
+ * @returns The updated thread or null if the thread or comment is not found
+ * @example updateComment('123', { content: 'The new content', data: { attachments: ['file1.jpg'] }})
+ */
+ updateComment(
+ threadId: TCollabThread["id"],
+ commentId: TCollabComment["id"],
+ data: Partial>,
+ ): TCollabThread;
+ /**
+ * Deletes a comment from a thread
+ * @param threadId The thread id
+ * @param commentId The comment id
+ * @param options A set of options that control how the comment is deleted
+ * @returns The updated thread or null if the thread or comment is not found
+ */
+ deleteComment(
+ threadId: TCollabThread["id"],
+ commentId: TCollabComment["id"],
+ ): TCollabThread | null | undefined;
+ /**
+ * Start watching threads for changes
+ * @param callback The callback function to be called when a thread changes
+ */
+ watchThreads(callback: () => void): void;
+ /**
+ * Stop watching threads for changes
+ * @param callback The callback function to be removed
+ */
+ unwatchThreads(callback: () => void): void;
+};
type ReactionAsTiptapData = {
emoji: string;
diff --git a/packages/core/src/comments/threadstore/yjs/RESTYjsThreadStore.ts b/packages/core/src/comments/threadstore/yjs/RESTYjsThreadStore.ts
index d3f81c50f5..0de375412b 100644
--- a/packages/core/src/comments/threadstore/yjs/RESTYjsThreadStore.ts
+++ b/packages/core/src/comments/threadstore/yjs/RESTYjsThreadStore.ts
@@ -1,4 +1,4 @@
-import * as Y from "yjs";
+import * as Y from "@y/y";
import { CommentBody } from "../../types.js";
import { ThreadStoreAuth } from "../ThreadStoreAuth.js";
import { YjsThreadStoreBase } from "./YjsThreadStoreBase.js";
diff --git a/packages/core/src/comments/threadstore/yjs/YjsThreadStore.test.ts b/packages/core/src/comments/threadstore/yjs/YjsThreadStore.test.ts
index 8f967eb547..a30b3ce4b1 100644
--- a/packages/core/src/comments/threadstore/yjs/YjsThreadStore.test.ts
+++ b/packages/core/src/comments/threadstore/yjs/YjsThreadStore.test.ts
@@ -1,5 +1,5 @@
import { beforeEach, describe, expect, it, vi } from "vitest";
-import * as Y from "yjs";
+import * as Y from "@y/y";
import { CommentBody } from "../../types.js";
import { DefaultThreadStoreAuth } from "../DefaultThreadStoreAuth.js";
import { YjsThreadStore } from "./YjsThreadStore.js";
diff --git a/packages/core/src/comments/threadstore/yjs/YjsThreadStore.ts b/packages/core/src/comments/threadstore/yjs/YjsThreadStore.ts
index 7504e43fb1..638c207ea2 100644
--- a/packages/core/src/comments/threadstore/yjs/YjsThreadStore.ts
+++ b/packages/core/src/comments/threadstore/yjs/YjsThreadStore.ts
@@ -1,5 +1,5 @@
import { v4 } from "uuid";
-import * as Y from "yjs";
+import * as Y from "@y/y";
import { CommentBody, CommentData, ThreadData } from "../../types.js";
import { ThreadStoreAuth } from "../ThreadStoreAuth.js";
import { YjsThreadStoreBase } from "./YjsThreadStoreBase.js";
diff --git a/packages/core/src/comments/threadstore/yjs/YjsThreadStoreBase.ts b/packages/core/src/comments/threadstore/yjs/YjsThreadStoreBase.ts
index 331fbac3ce..ac84c70fec 100644
--- a/packages/core/src/comments/threadstore/yjs/YjsThreadStoreBase.ts
+++ b/packages/core/src/comments/threadstore/yjs/YjsThreadStoreBase.ts
@@ -1,4 +1,4 @@
-import * as Y from "yjs";
+import * as Y from "@y/y";
import { ThreadData } from "../../types.js";
import { ThreadStore } from "../ThreadStore.js";
import { ThreadStoreAuth } from "../ThreadStoreAuth.js";
diff --git a/packages/core/src/comments/threadstore/yjs/yjsHelpers.ts b/packages/core/src/comments/threadstore/yjs/yjsHelpers.ts
index cd90c3e583..3df9a2cdb0 100644
--- a/packages/core/src/comments/threadstore/yjs/yjsHelpers.ts
+++ b/packages/core/src/comments/threadstore/yjs/yjsHelpers.ts
@@ -1,4 +1,4 @@
-import * as Y from "yjs";
+import * as Y from "@y/y";
import { CommentData, CommentReactionData, ThreadData } from "../../types.js";
export function commentToYMap(comment: CommentData) {
diff --git a/packages/core/src/editor/BlockNoteEditor.test.ts b/packages/core/src/editor/BlockNoteEditor.test.ts
index 120847bffa..3992fda586 100644
--- a/packages/core/src/editor/BlockNoteEditor.test.ts
+++ b/packages/core/src/editor/BlockNoteEditor.test.ts
@@ -1,5 +1,5 @@
import { expect, it } from "vitest";
-import * as Y from "yjs";
+import * as Y from "@y/y";
import {
getBlockInfo,
diff --git a/packages/core/src/extensions/Collaboration/Collaboration.ts b/packages/core/src/extensions/Collaboration/Collaboration.ts
index 719a7bdc8d..6ef1970d10 100644
--- a/packages/core/src/extensions/Collaboration/Collaboration.ts
+++ b/packages/core/src/extensions/Collaboration/Collaboration.ts
@@ -1,14 +1,14 @@
-import type * as Y from "yjs";
-import type { Awareness } from "y-protocols/awareness";
+import type * as Y from "@y/y";
+import type { Awareness } from "@y/protocols/awareness";
import {
createExtension,
ExtensionOptions,
} from "../../editor/BlockNoteExtension.js";
-import { ForkYDocExtension } from "./ForkYDoc.js";
-import { SchemaMigration } from "./schemaMigration/SchemaMigration.js";
-import { YCursorExtension } from "./YCursorPlugin.js";
+// import { ForkYDocExtension } from "./ForkYDoc.js";
+// import { SchemaMigration } from "./schemaMigration/SchemaMigration.js";
+// import { YCursorExtension } from "./YCursorPlugin.js";
import { YSyncExtension } from "./YSync.js";
-import { YUndoExtension } from "./YUndo.js";
+// import { YUndoExtension } from "./YUndo.js";
export type CollaborationOptions = {
/**
@@ -37,6 +37,10 @@ export type CollaborationOptions = {
* or types. Defaults to "activity".
*/
showCursorLabels?: "always" | "activity";
+ /**
+ * The attribution manager for the collaboration.
+ */
+ attributionManager?: Y.AbstractAttributionManager | Y.DiffAttributionManager;
};
export const CollaborationExtension = createExtension(
@@ -44,11 +48,11 @@ export const CollaborationExtension = createExtension(
return {
key: "collaboration",
blockNoteExtensions: [
- ForkYDocExtension(options),
- YCursorExtension(options),
+ // ForkYDocExtension(options),
+ // YCursorExtension(options),
YSyncExtension(options),
- YUndoExtension(),
- SchemaMigration(options),
+ // YUndoExtension(),
+ // SchemaMigration(options),
],
} as const;
},
diff --git a/packages/core/src/extensions/Collaboration/ForkYDoc.test.ts b/packages/core/src/extensions/Collaboration/ForkYDoc.test.ts
index 09ff65c591..33568a14ff 100644
--- a/packages/core/src/extensions/Collaboration/ForkYDoc.test.ts
+++ b/packages/core/src/extensions/Collaboration/ForkYDoc.test.ts
@@ -1,6 +1,6 @@
import { expect, it } from "vitest";
-import * as Y from "yjs";
-import { Awareness } from "y-protocols/awareness";
+import * as Y from "@y/y";
+import { Awareness } from "@y/protocols/awareness";
import { BlockNoteEditor } from "../../index.js";
import { ForkYDocExtension } from "./ForkYDoc.js";
diff --git a/packages/core/src/extensions/Collaboration/ForkYDoc.ts b/packages/core/src/extensions/Collaboration/ForkYDoc.ts
index 84c714f1d3..f4f61087d7 100644
--- a/packages/core/src/extensions/Collaboration/ForkYDoc.ts
+++ b/packages/core/src/extensions/Collaboration/ForkYDoc.ts
@@ -1,5 +1,5 @@
-import { yUndoPluginKey } from "y-prosemirror";
-import * as Y from "yjs";
+import { yUndoPluginKey } from "@y/prosemirror";
+import * as Y from "@y/y";
import {
createExtension,
createStore,
diff --git a/packages/core/src/extensions/Collaboration/YCursorPlugin.ts b/packages/core/src/extensions/Collaboration/YCursorPlugin.ts
index 784c4a17b7..62ac751cba 100644
--- a/packages/core/src/extensions/Collaboration/YCursorPlugin.ts
+++ b/packages/core/src/extensions/Collaboration/YCursorPlugin.ts
@@ -1,4 +1,4 @@
-import { defaultSelectionBuilder, yCursorPlugin } from "y-prosemirror";
+import { defaultSelectionBuilder, yCursorPlugin } from "@y/prosemirror";
import {
createExtension,
ExtensionOptions,
@@ -121,7 +121,7 @@ export const YCursorExtension = createExtension(
key: "yCursor",
prosemirrorPlugins: [
awareness
- ? yCursorPlugin(awareness, {
+ ? yCursorPlugin(awareness as any, {
selectionBuilder: defaultSelectionBuilder,
cursorBuilder(user: CollaborationUser, clientID: number) {
let cursorData = recentlyUpdatedCursors.get(clientID);
diff --git a/packages/core/src/extensions/Collaboration/YSync.ts b/packages/core/src/extensions/Collaboration/YSync.ts
index f4641cb41d..ce54b37f11 100644
--- a/packages/core/src/extensions/Collaboration/YSync.ts
+++ b/packages/core/src/extensions/Collaboration/YSync.ts
@@ -1,4 +1,4 @@
-import { ySyncPlugin } from "y-prosemirror";
+import { syncPlugin } from "@y/prosemirror";
import {
ExtensionOptions,
createExtension,
@@ -6,10 +6,31 @@ import {
import { CollaborationOptions } from "./Collaboration.js";
export const YSyncExtension = createExtension(
- ({ options }: ExtensionOptions>) => {
+ ({
+ options,
+ }: ExtensionOptions<
+ Pick
+ >) => {
return {
key: "ySync",
- prosemirrorPlugins: [ySyncPlugin(options.fragment)],
+ prosemirrorPlugins: [
+ syncPlugin(options.fragment, {
+ attributionManager: options.attributionManager,
+ mapAttributionToMark(format, attribution) {
+ if (attribution.delete) {
+ return Object.assign({}, format, {
+ deletion: { id: Date.now(), user: attribution.delete?.[0] },
+ });
+ }
+ if (attribution.insert) {
+ return Object.assign({}, format, {
+ insertion: { id: Date.now(), user: attribution.insert?.[0] },
+ });
+ }
+ return format;
+ },
+ }),
+ ],
runsBefore: ["default"],
} as const;
},
diff --git a/packages/core/src/extensions/Collaboration/YUndo.ts b/packages/core/src/extensions/Collaboration/YUndo.ts
index c3b65a55bd..cd4a324327 100644
--- a/packages/core/src/extensions/Collaboration/YUndo.ts
+++ b/packages/core/src/extensions/Collaboration/YUndo.ts
@@ -1,4 +1,4 @@
-import { redoCommand, undoCommand, yUndoPlugin } from "y-prosemirror";
+import { redoCommand, undoCommand, yUndoPlugin } from "@y/prosemirror";
import { createExtension } from "../../editor/BlockNoteExtension.js";
export const YUndoExtension = createExtension(() => {
diff --git a/packages/core/src/extensions/Collaboration/schemaMigration/SchemaMigration.ts b/packages/core/src/extensions/Collaboration/schemaMigration/SchemaMigration.ts
index 9d71c4b5ac..b84486b500 100644
--- a/packages/core/src/extensions/Collaboration/schemaMigration/SchemaMigration.ts
+++ b/packages/core/src/extensions/Collaboration/schemaMigration/SchemaMigration.ts
@@ -1,5 +1,5 @@
import { Plugin, PluginKey } from "@tiptap/pm/state";
-import * as Y from "yjs";
+import * as Y from "@y/y";
import {
createExtension,
diff --git a/packages/core/src/extensions/Collaboration/schemaMigration/migrationRules/migrationRule.ts b/packages/core/src/extensions/Collaboration/schemaMigration/migrationRules/migrationRule.ts
index ba0b77220f..1dd12c98b6 100644
--- a/packages/core/src/extensions/Collaboration/schemaMigration/migrationRules/migrationRule.ts
+++ b/packages/core/src/extensions/Collaboration/schemaMigration/migrationRules/migrationRule.ts
@@ -1,4 +1,4 @@
import { Transaction } from "@tiptap/pm/state";
-import * as Y from "yjs";
+import * as Y from "@y/y";
export type MigrationRule = (fragment: Y.XmlFragment, tr: Transaction) => void;
diff --git a/packages/core/src/extensions/Collaboration/schemaMigration/migrationRules/moveColorAttributes.test.ts b/packages/core/src/extensions/Collaboration/schemaMigration/migrationRules/moveColorAttributes.test.ts
index aa7ffec6d6..eb28b5cc6d 100644
--- a/packages/core/src/extensions/Collaboration/schemaMigration/migrationRules/moveColorAttributes.test.ts
+++ b/packages/core/src/extensions/Collaboration/schemaMigration/migrationRules/moveColorAttributes.test.ts
@@ -1,8 +1,8 @@
import { expect, it } from "vitest";
-import * as Y from "yjs";
+import * as Y from "@y/y";
import { BlockNoteEditor } from "../../../../editor/BlockNoteEditor.js";
import { moveColorAttributes } from "./moveColorAttributes.js";
-import { prosemirrorJSONToYXmlFragment } from "y-prosemirror";
+import { prosemirrorJSONToYXmlFragment } from "@y/prosemirror";
it("can move color attributes on older documents", async () => {
const doc = new Y.Doc();
diff --git a/packages/core/src/extensions/Collaboration/schemaMigration/migrationRules/moveColorAttributes.ts b/packages/core/src/extensions/Collaboration/schemaMigration/migrationRules/moveColorAttributes.ts
index 0866c3523c..c75a93c7b4 100644
--- a/packages/core/src/extensions/Collaboration/schemaMigration/migrationRules/moveColorAttributes.ts
+++ b/packages/core/src/extensions/Collaboration/schemaMigration/migrationRules/moveColorAttributes.ts
@@ -1,4 +1,4 @@
-import * as Y from "yjs";
+import * as Y from "@y/y";
import { MigrationRule } from "./migrationRule.js";
import { defaultProps } from "../../../../blocks/defaultProps.js";
diff --git a/packages/core/src/yjs/utils.test.ts b/packages/core/src/yjs/utils.test.ts
index d7af3eb1a6..b7e48d50cf 100644
--- a/packages/core/src/yjs/utils.test.ts
+++ b/packages/core/src/yjs/utils.test.ts
@@ -1,7 +1,7 @@
import { Block, docToBlocks } from "../index.js";
import { BlockNoteEditor } from "../editor/BlockNoteEditor.js";
import { describe, expect, it } from "vitest";
-import * as Y from "yjs";
+import * as Y from "@y/y";
import {
_blocksToProsemirrorNode,
blocksToYDoc,
diff --git a/packages/core/src/yjs/utils.ts b/packages/core/src/yjs/utils.ts
index 60930a5c9e..0fc628edd0 100644
--- a/packages/core/src/yjs/utils.ts
+++ b/packages/core/src/yjs/utils.ts
@@ -2,8 +2,8 @@ import {
prosemirrorToYDoc,
prosemirrorToYXmlFragment,
yXmlFragmentToProseMirrorRootNode,
-} from "y-prosemirror";
-import * as Y from "yjs";
+} from "@y/prosemirror";
+import * as Y from "@y/y";
import {
type Block,
diff --git a/packages/server-util/package.json b/packages/server-util/package.json
index f0a51f4362..7426084df0 100644
--- a/packages/server-util/package.json
+++ b/packages/server-util/package.json
@@ -61,9 +61,9 @@
"@tiptap/core": "^3.13.0",
"@tiptap/pm": "^3.13.0",
"jsdom": "^25.0.1",
- "y-prosemirror": "^1.3.7",
- "y-protocols": "^1.0.6",
- "yjs": "^13.6.27"
+ "@y/prosemirror": "2.0.0-2",
+ "@y/protocols": "1.0.6-3",
+ "@y/y": "14.0.0-19"
},
"devDependencies": {
"@types/jsdom": "^21.1.7",
diff --git a/packages/server-util/src/context/ServerBlockNoteEditor.ts b/packages/server-util/src/context/ServerBlockNoteEditor.ts
index 21a259f6c0..20087ddd51 100644
--- a/packages/server-util/src/context/ServerBlockNoteEditor.ts
+++ b/packages/server-util/src/context/ServerBlockNoteEditor.ts
@@ -30,7 +30,7 @@ import * as React from "react";
import { createElement } from "react";
import { flushSync } from "react-dom";
import { createRoot } from "react-dom/client";
-import type * as Y from "yjs";
+import type * as Y from "@y/y";
/**
* Use the ServerBlockNoteEditor to interact with BlockNote documents in a server (nodejs) environment.
diff --git a/packages/xl-ai/package.json b/packages/xl-ai/package.json
index c1bd7115e6..2d25dd160b 100644
--- a/packages/xl-ai/package.json
+++ b/packages/xl-ai/package.json
@@ -92,7 +92,7 @@
"remark-parse": "^11.0.0",
"remark-stringify": "^11.0.0",
"unified": "^11.0.5",
- "y-prosemirror": "^1.3.7"
+ "@y/prosemirror": "2.0.0-2"
},
"devDependencies": {
"@ai-sdk/anthropic": "^2.0.31",
diff --git a/packages/xl-ai/src/plugins/AgentCursorPlugin.ts b/packages/xl-ai/src/plugins/AgentCursorPlugin.ts
index f2492e1a08..bdecb2b71a 100644
--- a/packages/xl-ai/src/plugins/AgentCursorPlugin.ts
+++ b/packages/xl-ai/src/plugins/AgentCursorPlugin.ts
@@ -1,6 +1,6 @@
import { Plugin, PluginKey } from "prosemirror-state";
import { Decoration, DecorationSet } from "prosemirror-view";
-import { defaultSelectionBuilder } from "y-prosemirror";
+import { defaultSelectionBuilder } from "@y/prosemirror";
type AgentCursorState = {
selection: { anchor: number; head: number } | undefined;
diff --git a/patches/@y__prosemirror.patch b/patches/@y__prosemirror.patch
new file mode 100644
index 0000000000..0279a9536c
--- /dev/null
+++ b/patches/@y__prosemirror.patch
@@ -0,0 +1,1378 @@
+diff --git a/dist/src/index.d.ts b/dist/src/index.d.ts
+index fec5f1c23d3f28e250fecd7045fcebe7fc60993f..d8596ce384a95246fa9db9a4cb8aa4938b78e2bd 100644
+--- a/dist/src/index.d.ts
++++ b/dist/src/index.d.ts
+@@ -3,11 +3,13 @@
+ * @param {object} opts
+ * @param {import('@y/protocols/awareness').Awareness} [opts.awareness]
+ * @param {Y.AbstractAttributionManager} [opts.attributionManager]
++ * @param {typeof attributionToFormat} [opts.mapAttributionToMark]
+ * @returns {Plugin}
+ */
+-export function syncPlugin(ytype: Y.XmlFragment, { awareness, attributionManager }?: {
++export function syncPlugin(ytype: Y.XmlFragment, { awareness, attributionManager, mapAttributionToMark }?: {
+ awareness?: import("@y/protocols/awareness").Awareness;
+ attributionManager?: Y.AbstractAttributionManager;
++ mapAttributionToMark?: typeof attributionToFormat;
+ }): Plugin;
+ /**
+ * This function is used to find the delta offset for a given prosemirror offset in a node.
+@@ -35,38 +37,19 @@ export function pmToDeltaPath(node: Node, searchPmOffset?: number): number[];
+ * @return {number} The prosemirror offset for the delta path
+ */
+ export function deltaPathToPm(deltaPath: number[], node: Node): number;
+-export class YEditorView extends EditorView {
+- mux: mux.mutex;
+- /**
+- * @type {{ ytype: Y.XmlFragment, am: Y.AbstractAttributionManager, awareness: any }?}
+- */
+- y: {
+- ytype: Y.XmlFragment;
+- am: Y.AbstractAttributionManager;
+- awareness: any;
+- } | null;
+- /**
+- * @param {Array>} events
+- * @param {Y.Transaction} tr
+- */
+- _observer: (events: Array>, tr: Y.Transaction) => void;
+- /**
+- * @param {Y.XmlFragment} ytype
+- * @param {object} opts
+- * @param {any} [opts.awareness]
+- * @param {Y.AbstractAttributionManager} [opts.attributionManager]
+- */
+- bindYType(ytype: Y.XmlFragment, { awareness, attributionManager }?: {
+- awareness?: any;
+- attributionManager?: Y.AbstractAttributionManager;
+- }): void;
+-}
+ export function nodesToDelta(ns: Array): delta.DeltaBuilderAny;
+ export function nodeToDelta(n: Node): delta.DeltaBuilderAny;
+ export function deltaToPSteps(tr: import("prosemirror-state").Transaction, d: ProsemirrorDelta, pnode?: Node, currPos?: {
+ i: number;
+ }): import("prosemirror-state").Transaction;
+-export function trToDelta(tr: Transform): ProsemirrorDelta;
++export function docDiffToDelta(beforeDoc: Node, afterDoc: Node): delta.DeltaBuilder;
++export function trToDelta(tr: Transform): delta.DeltaBuilder;
+ export function stepToDelta(step: import("prosemirror-transform").Step, beforeDoc: import("prosemirror-model").Node): ProsemirrorDelta;
+ export function deltaModifyNodeAt(node: Node, pmOffset: number, mod: (d: delta.DeltaBuilderAny) => any): ProsemirrorDelta;
+ export type ProsemirrorDelta = s.Unwrap, string, any>>>;
+ import * as Y from '@y/y';
++/**
++ * @typedef {s.Unwrap<$prosemirrorDelta>} ProsemirrorDelta
++ */
++/**
++ * @template {import('lib0/delta').Attribution} T
++ * @param {Record | null} format
++ * @param {T} attribution
++ * @returns {Record | null}
++ */
++declare function attributionToFormat(format: Record | null, attribution: T): Record | null;
+ import { Plugin } from 'prosemirror-state';
+ import { Node } from 'prosemirror-model';
+-import { EditorView } from 'prosemirror-view';
+-import * as mux from 'lib0/mutex';
+ import * as delta from 'lib0/delta';
+ import { Transform } from 'prosemirror-transform';
+ import * as s from 'lib0/schema';
++export {};
+diff --git a/dist/src/lib.d.ts b/dist/src/lib.d.ts
+index 30ebc3bbc8eb20f96d1135b7fe8e8c8659bacf22..18f3778d998c2b8fbe3b4c26a61262f8b6efd849 100644
+--- a/dist/src/lib.d.ts
++++ b/dist/src/lib.d.ts
+@@ -101,8 +101,8 @@ export function yXmlFragmentToProseMirrorFragment(yXmlFragment: Y.XmlFragment, s
+ export function yXmlFragmentToProseMirrorRootNode(yXmlFragment: Y.XmlFragment, schema: Schema): Node;
+ export function initProseMirrorDoc(yXmlFragment: Y.XmlFragment, schema: Schema): {
+ doc: Node;
+- meta: import("./plugins/sync-plugin.js").BindingMetadata;
+- mapping: import("./plugins/sync-plugin.js").ProsemirrorMapping;
++ meta: import("./y-prosemirror.js").BindingMetadata;
++ mapping: import("./y-prosemirror.js").ProsemirrorMapping;
+ };
+ /**
+ * Either a node if type is YXmlElement or an Array of text nodes if YXmlText
+diff --git a/dist/src/plugins/keys.d.ts b/dist/src/plugins/keys.d.ts
+index adc3a2cfa3de8429977ec8d7a9df4e27291ec950..e53a5bfe1c3da80b7f95fc57c68d395154793623 100644
+--- a/dist/src/plugins/keys.d.ts
++++ b/dist/src/plugins/keys.d.ts
+@@ -2,10 +2,11 @@
+ * The unique prosemirror plugin key for syncPlugin
+ *
+ * @public
+- * @type {PluginKey<{ytype: Y.XmlFragment}>}
++ * @type {PluginKey<{ytype: Y.XmlFragment; diff?: import('../index.js').ProsemirrorDelta}>}
+ */
+ export const ySyncPluginKey: PluginKey<{
+ ytype: Y.XmlFragment;
++ diff?: import("../index.js").ProsemirrorDelta;
+ }>;
+ /**
+ * The unique prosemirror plugin key for undoPlugin
+diff --git a/dist/src/y-prosemirror.d.ts b/dist/src/y-prosemirror.d.ts
+index c1f9468c4c77434a1ad9f49227fb1274f5ae1915..8126c5645e6aa679dd0f291b0fe546916824ba09 100644
+--- a/dist/src/y-prosemirror.d.ts
++++ b/dist/src/y-prosemirror.d.ts
+@@ -1,5 +1,6 @@
+ export * from "./plugins/cursor-plugin.js";
+ export * from "./plugins/undo-plugin.js";
+ export * from "./plugins/keys.js";
+-export { ySyncPlugin, isVisible, getRelativeSelection, ProsemirrorBinding, updateYFragment } from "./plugins/sync-plugin.js";
++export * from "./index.js";
++export * from "./plugins/sync-plugin.js";
+ export { absolutePositionToRelativePosition, relativePositionToAbsolutePosition, setMeta, prosemirrorJSONToYDoc, yDocToProsemirrorJSON, yDocToProsemirror, prosemirrorToYDoc, prosemirrorJSONToYXmlFragment, yXmlFragmentToProsemirrorJSON, yXmlFragmentToProsemirror, prosemirrorToYXmlFragment, yXmlFragmentToProseMirrorRootNode, yXmlFragmentToProseMirrorFragment, initProseMirrorDoc } from "./lib.js";
+diff --git a/dist/y-prosemirror.cjs b/dist/y-prosemirror.cjs
+index 336dba34929063474acb211d065920823cfbc604..6441edf4d0c0a833cc8a5eda3901621a39398f8c 100644
+--- a/dist/y-prosemirror.cjs
++++ b/dist/y-prosemirror.cjs
+@@ -4,7 +4,7 @@ var Y = require('@y/y');
+ var prosemirrorView = require('prosemirror-view');
+ var prosemirrorState = require('prosemirror-state');
+ require('@y/protocols/awareness');
+-var mutex = require('lib0/mutex');
++var mux = require('lib0/mutex');
+ var PModel = require('prosemirror-model');
+ var math = require('lib0/math');
+ var object = require('lib0/object');
+@@ -18,6 +18,9 @@ var eventloop = require('lib0/eventloop');
+ var map = require('lib0/map');
+ var sha256 = require('lib0/hash/sha256');
+ var buf = require('lib0/buffer');
++var delta = require('lib0/delta');
++var s = require('lib0/schema');
++var prosemirrorTransform = require('prosemirror-transform');
+
+ function _interopNamespaceDefault(e) {
+ var n = Object.create(null);
+@@ -37,6 +40,7 @@ function _interopNamespaceDefault(e) {
+ }
+
+ var Y__namespace = /*#__PURE__*/_interopNamespaceDefault(Y);
++var mux__namespace = /*#__PURE__*/_interopNamespaceDefault(mux);
+ var PModel__namespace = /*#__PURE__*/_interopNamespaceDefault(PModel);
+ var math__namespace = /*#__PURE__*/_interopNamespaceDefault(math);
+ var object__namespace = /*#__PURE__*/_interopNamespaceDefault(object);
+@@ -49,12 +53,14 @@ var eventloop__namespace = /*#__PURE__*/_interopNamespaceDefault(eventloop);
+ var map__namespace = /*#__PURE__*/_interopNamespaceDefault(map);
+ var sha256__namespace = /*#__PURE__*/_interopNamespaceDefault(sha256);
+ var buf__namespace = /*#__PURE__*/_interopNamespaceDefault(buf);
++var delta__namespace = /*#__PURE__*/_interopNamespaceDefault(delta);
++var s__namespace = /*#__PURE__*/_interopNamespaceDefault(s);
+
+ /**
+ * The unique prosemirror plugin key for syncPlugin
+ *
+ * @public
+- * @type {PluginKey<{ytype: Y.XmlFragment}>}
++ * @type {PluginKey<{ytype: Y.XmlFragment; diff?: import('../index.js').ProsemirrorDelta}>}
+ */
+ const ySyncPluginKey = new prosemirrorState.PluginKey('y-sync');
+
+@@ -387,7 +393,7 @@ class ProsemirrorBinding {
+ * @type {any}
+ */
+ this.prosemirrorView = null;
+- this.mux = mutex.createMutex();
++ this.mux = mux.createMutex();
+ this.mapping = mapping;
+ /**
+ * Is overlapping mark - i.e. mark does not exclude itself.
+@@ -2185,17 +2191,660 @@ const yUndoPlugin = ({ protectedNodes = defaultProtectedNodes, trackedOrigins =
+ }
+ });
+
++const $prosemirrorDelta = delta__namespace.$delta({ name: s__namespace.$string, attrs: s__namespace.$record(s__namespace.$string, s__namespace.$any), text: true, recursive: true });
++
++/**
++ * @typedef {s.Unwrap<$prosemirrorDelta>} ProsemirrorDelta
++ */
++
++// y-attribution-deletion & y-attribution-insertion & y-attribution-format (or mod?)
++// add attributes (userId: string[], timestamp: number) (see `YAttribution` (ask Kevin))
++// define how an insertion mark works on a node
++// situations like deleted node, yet has inserted content (handle nested content)
++// insertion within a node that was inserted + another user inserted more content into that node (hovers per user likely)
++
++/**
++ * @template {import('lib0/delta').Attribution} T
++ * @param {Record | null} format
++ * @param {T} attribution
++ * @returns {Record | null}
++ */
++const attributionToFormat = (format, attribution) => {
++ /**
++ * @type {Record | null}
++ */
++ let mergeWith = null;
++ if (attribution.insert) {
++ mergeWith = {
++ 'y-attribution-insertion': {
++ userIds: attribution.insert ? attribution.insert : null,
++ timestamp: attribution.insertAt ? attribution.insertAt : null
++ }
++ };
++ } else if (attribution.delete) {
++ mergeWith = {
++ 'y-attribution-deletion': {
++ userIds: attribution.delete ? attribution.delete : null,
++ timestamp: attribution.deleteAt ? attribution.deleteAt : null
++ }
++ };
++ } else if (attribution.format) {
++ mergeWith = {
++ 'y-attribution-format': {
++ userIdsByAttr: attribution.format ? attribution.format : null,
++ timestamp: attribution.formatAt ? attribution.formatAt : null
++ }
++ };
++ }
++ return object__namespace.assign({}, format, mergeWith)
++};
++
++/**
++ * Transform delta with attributions to delta with formats (marks).
++ */
++const deltaAttributionToFormat = s__namespace.match(s__namespace.$function)
++ .if(delta__namespace.$deltaAny, (d, func) => {
++ const r = delta__namespace.create(d.name);
++ for (const attr of d.attrs) {
++ r.attrs[attr.key] = attr.clone();
++ }
++ for (const child of d.children) {
++ const format = child.attribution ? func(child.format, child.attribution) : child.format;
++ if (delta__namespace.$insertOp.check(child)) {
++ r.insert(child.insert.map(c => delta__namespace.$deltaAny.check(c) ? deltaAttributionToFormat(c, func) : c), format);
++ } else if (delta__namespace.$textOp.check(child)) {
++ r.insert(child.insert.slice(), format);
++ } else if (delta__namespace.$deleteOp.check(child)) {
++ r.delete(child.delete);
++ } else if (delta__namespace.$retainOp.check(child)) {
++ r.retain(child.retain, format);
++ } else if (delta__namespace.$modifyOp.check(child)) {
++ r.modify(deltaAttributionToFormat(child.value, func), format);
++ } else {
++ error__namespace.unexpectedCase();
++ }
++ }
++ return r
++ }).done();
++
++/**
++ * @param {Y.XmlFragment} ytype
++ * @param {object} opts
++ * @param {import('@y/protocols/awareness').Awareness} [opts.awareness]
++ * @param {Y.AbstractAttributionManager} [opts.attributionManager]
++ * @param {typeof attributionToFormat} [opts.mapAttributionToMark]
++ * @returns {Plugin}
++ */
++function syncPlugin (ytype, { awareness = null, attributionManager = Y__namespace.noAttributionsManager, mapAttributionToMark = attributionToFormat } = {}) {
++ let ignoreTr = false;
++ let initialized = false;
++ const mutex = mux__namespace.createMutex();
++
++ /**
++ * Initialize the prosemirror state with what is in the ydoc
++ * @param {import('prosemirror-view').EditorView} view
++ * @param {()=>void} onInit
++ */
++ function init (view, onInit) {
++ // TODO ydoc.on('sync') ? we could use this to indicate that the ydoc is ready or not
++ console.log('initializing prosemirror state with ydoc');
++ if (ytype.length === 0) {
++ console.log('ytype is empty, applying initial prosemirror state to ydoc');
++ // TODO likely want to compare the empty initial doc with the ydoc and apply changes the ydoc if there are any
++ // initialize the ydoc with the initial prosemirror state
++ const initialPDelta = nodeToDelta(view.state.doc);
++ console.log('initialPDelta', initialPDelta.toJSON());
++ ytype.applyDelta(initialPDelta.done());
++ } else {
++ console.log('ytype is not empty, applying initial ydoc content to prosemirror state');
++ // Initialize the prosemirror state with what is in the ydoc
++ const initialPDelta = nodeToDelta(view.state.doc);
++ const d = deltaAttributionToFormat(ytype.getContent(attributionManager, { deep: true }), mapAttributionToMark);
++ const initDelta = delta__namespace.diff(initialPDelta.done(), d);
++
++ console.log('initDelta', initDelta.toJSON());
++ const tr = deltaToPSteps(view.state.tr, initDelta.done());
++ // TODO revisit all of the meta stuff
++ tr.setMeta(ySyncPluginKey, { init: true });
++ view.dispatch(tr);
++ }
++ onInit();
++ }
++
++ /**
++ * @param {import('prosemirror-view').EditorView} view
++ * @returns {function(Array>, Y.Transaction): void}
++ */
++ function getOnChangeHandler (view) {
++ return function onChange (events, tr) {
++ if (view.isDestroyed || ignoreTr) {
++ return
++ }
++
++ mutex(() => {
++ /**
++ * @type {Y.YEvent}
++ */
++ const event = events.find(event => event.target === ytype) || new Y__namespace.YEvent(ytype, tr, new Set(null));
++ const d = attributionManager === Y__namespace.noAttributionsManager ? event.deltaDeep : deltaAttributionToFormat(event.getDelta(attributionManager, { deep: true }), mapAttributionToMark);
++ const ptr = deltaToPSteps(view.state.tr, d);
++ console.log('ytype emitted event', d.toJSON(), 'and applied changes to pm', ptr.steps);
++ ptr.setMeta(ySyncPluginKey, { ytypeEvent: true });
++ view.dispatch(ptr);
++ }, () => {
++ if (attributionManager !== Y__namespace.noAttributionsManager) {
++ const itemsToRender = Y__namespace.mergeIdSets([tr.insertSet, tr.deleteSet]);
++ /**
++ * @todo this could be automatically be calculated in getContent/getDelta when
++ * itemsToRender is provided
++ * @type {Map>}
++ */
++ const modified = new Map();
++ Y__namespace.iterateStructsByIdSet(tr, itemsToRender, item => {
++ while (item instanceof Y__namespace.Item) {
++ const parent = /** @type {Y.AbstractType} */ (item.parent);
++ const conf = map__namespace.setIfUndefined(modified, parent, set__namespace.create);
++ if (conf.has(item.parentSub)) break // has already been marked as modified
++ conf.add(item.parentSub);
++ item = parent._item;
++ }
++ });
++
++ if (modified.has(ytype)) {
++ setTimeout(() => {
++ mutex(() => {
++ const d = deltaAttributionToFormat(ytype.getContent(attributionManager, { itemsToRender, retainInserts: true, deep: true, modified }), mapAttributionToMark);
++ const ptr = deltaToPSteps(view.state.tr, d);
++ ptr.setMeta(ySyncPluginKey, { attributionFix: true });
++ console.log('attribution fix event: ', d.toJSON(), 'and applied changes to pm', ptr.steps);
++ view.dispatch(ptr);
++ });
++ }, 0);
++ }
++ }
++ });
++ }
++ }
++
++ return new prosemirrorState.Plugin({
++ key: ySyncPluginKey,
++ state: {
++ init () {
++ return {
++ ytype,
++ diff: /** @type {ReturnType | undefined} */ (undefined)
++ }
++ },
++ apply (tr, value) {
++ console.log('apply', tr, 'has-meta', tr.getMeta(ySyncPluginKey));
++ if (tr.getMeta(ySyncPluginKey)) {
++ const { transactions } = /** @type {{ transactions: Array }} */ (tr.getMeta(ySyncPluginKey));
++ if (!transactions) {
++ return value
++ }
++ // merge all transactions into a single transform
++ const transform = new prosemirrorTransform.Transform(transactions[0].before);
++
++ for (let i = 0; i < transactions.length; i++) {
++ console.log('transactions[i]', transactions[i]);
++ for (let j = 0; j < transactions[i].steps.length; j++) {
++ const success = transform.maybeStep(transactions[i].steps[j]);
++ if (success.failed) {
++ // step failed, fallback to full diff
++ console.error('[y/prosemirror]: step failed to apply, falling back to a full diff');
++
++ const nextDiff = docDiffToDelta(transactions[0].before, transactions[transactions.length - 1].after);
++ // TODO what should the right behavior here be?
++ return {
++ ytype: value.ytype,
++ diff: value.diff ? value.diff.apply(nextDiff) : nextDiff
++ }
++ }
++ }
++ }
++ const nextDiff = trToDelta(transform);
++
++ return {
++ ytype: value.ytype,
++ diff: value.diff ? value.diff.apply(nextDiff) : nextDiff
++ }
++ }
++ return value
++ }
++ },
++ view (view) {
++ const onChange = getOnChangeHandler(view);
++ // initialize the prosemirror state with what is in the ydoc
++ // we wait a tick, because in some cases, the view can be immediately destroyed
++ const timeoutId = setTimeout(() => init(view, () => {
++ console.log('initialization complete');
++ initialized = true;
++ // subscribe to the ydoc changes, after initialization is complete
++ ytype.observeDeep(onChange);
++ console.log('subscribed to ydoc changes');
++ }), 0);
++
++ return {
++ update (view, prevState) {
++ if (ignoreTr || !initialized) {
++ return
++ }
++
++ const state = ySyncPluginKey.getState(view.state);
++ console.log(state);
++ if (state.diff) {
++ mutex(() => {
++ ignoreTr = true;
++ console.log('and will apply delta to ytype', state.diff.toJSON(), ytype.toJSON());
++ ytype.applyDelta(state.diff, attributionManager);
++ ignoreTr = false;
++ });
++ // clear the diff so that we don't apply it again
++ state.diff = undefined;
++ }
++ },
++ destroy () {
++ // clear the initialization timeout
++ clearTimeout(timeoutId);
++ if (initialized) {
++ // unsubscribe from the ydoc changes
++ ytype.unobserveDeep(onChange);
++ }
++ initialized = false;
++ }
++ }
++ },
++ appendTransaction (transactions, _oldState, newState) {
++ console.log('transactions', transactions.slice(0));
++ transactions = transactions.filter(tr => tr.docChanged && !tr.getMeta(ySyncPluginKey));
++ if (transactions.length === 0 || ignoreTr) return undefined
++
++ return newState.tr.setMeta(ySyncPluginKey, { transactions })
++ }
++ // TODO to acccount for cases where appendTransaction is called on an ephemeral state, we may not want to apply the delta to the ytype
++ // unless, the editor has actually applied the transaction, perhaps we can return a transaction that has a meta with how to apply the delta? or it returns the delta, and then the state.apply can actually sync it to the ytype?
++ // that actually seems less error prone, and might actually enable us to block syncing in certain cases with just a filterTransaction? That's actually pretty nice!
++ // per transaction, we can actually choose whether we should sync the transaction to the ytype or not, this would allow much more fine-grained control over syncing.
++
++ })
++}
++
++/**
++ * @param {readonly import('prosemirror-model').Mark[]} marks
++ */
++const marksToFormattingAttributes = marks => {
++ if (marks.length === 0) return null
++ /**
++ * @type {{[key:string]:any}}
++ */
++ const formatting = {};
++ marks.forEach(mark => {
++ formatting[mark.type.name] = mark.attrs;
++ });
++ return formatting
++};
++
++/**
++ * @param {{[key:string]:any}} formatting
++ * @param {import('prosemirror-model').Schema} schema
++ */
++const formattingAttributesToMarks = (formatting, schema) => object__namespace.map(formatting, (v, k) => schema.mark(k, v));
++
++/**
++ * @param {Array} ns
++ */
++const nodesToDelta = ns => {
++ /**
++ * @type {delta.DeltaBuilderAny}
++ */
++ const d = delta__namespace.create($prosemirrorDelta);
++ ns.forEach(n => {
++ d.insert(n.isText ? n.text : [nodeToDelta(n)], marksToFormattingAttributes(n.marks));
++ });
++ return d
++};
++
++/**
++ * @param {Node} n
++ */
++const nodeToDelta = n => {
++ /**
++ * @type {delta.DeltaBuilderAny}
++ */
++ const d = delta__namespace.create(n.type.name, $prosemirrorDelta);
++ d.setMany(n.attrs);
++ n.content.content.forEach(c => {
++ d.insert(c.isText ? c.text : [nodeToDelta(c)], marksToFormattingAttributes(c.marks));
++ });
++ return d
++};
++
++/**
++ * @param {import('prosemirror-state').Transaction} tr
++ * @param {ProsemirrorDelta} d
++ * @param {Node} pnode
++ * @param {{ i: number }} currPos
++ * @return {import('prosemirror-state').Transaction}
++ */
++const deltaToPSteps = (tr, d, pnode = tr.doc, currPos = { i: 0 }) => {
++ const schema = tr.doc.type.schema;
++ let currParentIndex = 0;
++ let nOffset = 0;
++ const pchildren = pnode.children;
++ for (const attr of d.attrs) {
++ tr.setNodeAttribute(currPos.i - 1, attr.key, attr.value);
++ }
++ d.children.forEach(op => {
++ if (delta__namespace.$retainOp.check(op)) {
++ // skip over i children
++ let i = op.retain;
++ while (i > 0) {
++ const pc = pchildren[currParentIndex];
++ if (pc.isText) {
++ if (op.format != null) {
++ const from = currPos.i;
++ const to = currPos.i + math__namespace.min(pc.nodeSize - nOffset, i);
++ object__namespace.forEach(op.format, (v, k) => {
++ if (v == null) {
++ tr.removeMark(from, to, schema.marks[k]);
++ } else {
++ tr.addMark(from, to, schema.mark(k, v));
++ }
++ });
++ }
++ if (i + nOffset < pc.nodeSize) {
++ nOffset += i;
++ currPos.i += i;
++ i = 0;
++ } else {
++ currParentIndex++;
++ i -= pc.nodeSize - nOffset;
++ currPos.i += pc.nodeSize - nOffset;
++ nOffset = 0;
++ }
++ } else {
++ object__namespace.forEach(op.format, (v, k) => {
++ if (v == null) {
++ tr.removeNodeMark(currPos.i, schema.marks[k]);
++ } else {
++ tr.addNodeMark(currPos.i, schema.mark(k, v));
++ }
++ });
++ currParentIndex++;
++ currPos.i += pc.nodeSize;
++ i--;
++ }
++ }
++ } else if (delta__namespace.$modifyOp.check(op)) {
++ currPos.i++;
++ deltaToPSteps(tr, op.value, pchildren[currParentIndex++], currPos);
++ currPos.i++;
++ } else if (delta__namespace.$insertOp.check(op)) {
++ const newPChildren = op.insert.map(ins => deltaToPNode(ins, schema, op.format));
++ tr.insert(currPos.i, newPChildren);
++ currPos.i += newPChildren.reduce((s, c) => c.nodeSize + s, 0);
++ } else if (delta__namespace.$textOp.check(op)) {
++ tr.insert(currPos.i, schema.text(op.insert, formattingAttributesToMarks(op.format, schema)));
++ currPos.i += op.length;
++ } else if (delta__namespace.$deleteOp.check(op)) {
++ for (let remainingDelLen = op.delete; remainingDelLen > 0;) {
++ const pc = pchildren[currParentIndex];
++ if (pc === undefined) {
++ throw new Error('delete operation is out of bounds')
++ }
++ if (pc.isText) {
++ const delLen = math__namespace.min(pc.nodeSize - nOffset, remainingDelLen);
++ tr.delete(currPos.i, currPos.i + delLen);
++ nOffset += delLen;
++ if (nOffset === pc.nodeSize) {
++ // TODO this can't actually "jump out" of the current node
++ // jump to next node
++ nOffset = 0;
++ currParentIndex++;
++ }
++ remainingDelLen -= delLen;
++ } else {
++ tr.delete(currPos.i, currPos.i + pc.nodeSize);
++ currParentIndex++;
++ remainingDelLen--;
++ }
++ }
++ }
++ });
++ return tr
++};
++
++/**
++ * @param {ProsemirrorDelta} d
++ * @param {import('prosemirror-model').Schema} schema
++ * @param {delta.FormattingAttributes} dformat
++ * @return {Node}
++ */
++const deltaToPNode = (d, schema, dformat) => {
++ const attrs = {};
++ for (const attr of d.attrs) {
++ attrs[attr.key] = attr.value;
++ }
++ const dc = d.children.map(c => delta__namespace.$insertOp.check(c) ? c.insert.map(cn => deltaToPNode(cn, schema, c.format)) : (delta__namespace.$textOp.check(c) ? [schema.text(c.insert, formattingAttributesToMarks(c.format, schema))] : []));
++ return schema.node(d.name, attrs, dc.flat(1), formattingAttributesToMarks(dformat, schema))
++};
++
++/**
++ * @param {Node} beforeDoc
++ * @param {Node} afterDoc
++ */
++const docDiffToDelta = (beforeDoc, afterDoc) => {
++ const initialDelta = nodeToDelta(beforeDoc);
++ const finalDelta = nodeToDelta(afterDoc);
++
++ return delta__namespace.diff(initialDelta.done(), finalDelta.done())
++};
++
++/**
++ * @param {Transform} tr
++ */
++const trToDelta = (tr) => {
++ // const d = delta.create($prosemirrorDelta)
++ // tr.steps.forEach((step, i) => {
++ // const stepDelta = stepToDelta(step, tr.docs[i])
++ // console.log('stepDelta', JSON.stringify(stepDelta.toJSON(), null, 2))
++ // console.log('d', JSON.stringify(d.toJSON(), null, 2))
++ // d.apply(stepDelta)
++ // })
++ // return d.done()
++ // Calculate delta from initial and final document states to avoid composition issues with delete operations
++ // This is more reliable than composing step-by-step, which can lose delete operations and cause "Unexpected case" errors
++ // after lib0 upgrades that change delta composition behavior
++ const initialDelta = nodeToDelta(tr.before);
++ const finalDelta = nodeToDelta(tr.doc);
++ const resultDelta = delta__namespace.diff(initialDelta.done(), finalDelta.done());
++ return resultDelta
++};
++
++const _stepToDelta = s__namespace.match({ beforeDoc: PModel.Node, afterDoc: PModel.Node })
++ .if([prosemirrorTransform.ReplaceStep, prosemirrorTransform.ReplaceAroundStep], (step, { beforeDoc, afterDoc }) => {
++ const oldStart = beforeDoc.resolve(step.from);
++ const oldEnd = beforeDoc.resolve(step.to);
++ const newStart = afterDoc.resolve(step.from);
++
++ const newEnd = afterDoc.resolve(step instanceof prosemirrorTransform.ReplaceAroundStep ? step.getMap().map(step.to) : step.from + step.slice.size);
++
++ const oldBlockRange = oldStart.blockRange(oldEnd);
++ const newBlockRange = newStart.blockRange(newEnd);
++ const oldDelta = deltaForBlockRange(oldBlockRange);
++ const newDelta = deltaForBlockRange(newBlockRange);
++ const diffD = delta__namespace.diff(oldDelta, newDelta);
++ const stepDelta = deltaModifyNodeAt(beforeDoc, oldBlockRange?.start || newBlockRange?.start || 0, d => { d.append(diffD); });
++ return stepDelta
++ })
++ .if(prosemirrorTransform.AddMarkStep, (step, { beforeDoc }) =>
++ deltaModifyNodeAt(beforeDoc, step.from, d => { d.retain(step.to - step.from, marksToFormattingAttributes([step.mark])); })
++ )
++ .if(prosemirrorTransform.AddNodeMarkStep, (step, { beforeDoc }) =>
++ deltaModifyNodeAt(beforeDoc, step.pos, d => { d.retain(1, marksToFormattingAttributes([step.mark])); })
++ )
++ .if(prosemirrorTransform.RemoveMarkStep, (step, { beforeDoc }) =>
++ deltaModifyNodeAt(beforeDoc, step.from, d => { d.retain(step.to - step.from, { [step.mark.type.name]: null }); })
++ )
++ .if(prosemirrorTransform.RemoveNodeMarkStep, (step, { beforeDoc }) =>
++ deltaModifyNodeAt(beforeDoc, step.pos, d => { d.retain(1, { [step.mark.type.name]: null }); })
++ )
++ .if(prosemirrorTransform.AttrStep, (step, { beforeDoc }) =>
++ deltaModifyNodeAt(beforeDoc, step.pos, d => { d.modify(delta__namespace.create().set(step.attr, step.value)); })
++ )
++ .if(prosemirrorTransform.DocAttrStep, step =>
++ delta__namespace.create().set(step.attr, step.value)
++ )
++ .else(_step => {
++ // unknown step kind
++ error__namespace.unexpectedCase();
++ })
++ .done();
++
++/**
++ * @param {import('prosemirror-transform').Step} step
++ * @param {import('prosemirror-model').Node} beforeDoc
++ * @return {ProsemirrorDelta}
++ */
++const stepToDelta = (step, beforeDoc) => {
++ const stepResult = step.apply(beforeDoc);
++ if (stepResult.failed) {
++ throw new Error('step failed to apply')
++ }
++ return _stepToDelta(step, { beforeDoc, afterDoc: stepResult.doc })
++};
++
++/**
++ *
++ * @param {import('prosemirror-model').NodeRange | null} blockRange
++ */
++function deltaForBlockRange (blockRange) {
++ if (blockRange === null) {
++ return delta__namespace.create()
++ }
++ const { startIndex, endIndex, parent } = blockRange;
++ return nodesToDelta(parent.content.content.slice(startIndex, endIndex))
++}
++
++/**
++ * This function is used to find the delta offset for a given prosemirror offset in a node.
++ * Given the following document:
++ * Hello world
Hello world!
++ * The delta structure would look like this:
++ * 0: p
++ * - 0: text("Hello world")
++ * 1: blockquote
++ * - 0: p
++ * - 0: text("Hello world!")
++ * So the prosemirror position 10 would be within the delta offset path: 0, 0 and have an offset into the text node of 9 (since it is the 9th character in the text node).
++ *
++ * So the return value would be [0, 9], which is the path of: p, text("Hello wor")
++ *
++ * @param {Node} node
++ * @param {number} searchPmOffset The p offset to find the delta offset for
++ * @return {number[]} The delta offset path for the search pm offset
++ */
++function pmToDeltaPath (node, searchPmOffset = 0) {
++ if (searchPmOffset === 0) {
++ // base case
++ return [0]
++ }
++
++ const resolvedOffset = node.resolve(searchPmOffset);
++ const depth = resolvedOffset.depth;
++ const path = [];
++ if (depth === 0) {
++ // if the offset is at the root node, return the index of the node
++ return [resolvedOffset.index(0)]
++ }
++ // otherwise, add the index of each parent node to the path
++ for (let d = 0; d < depth; d++) {
++ path.push(resolvedOffset.index(d));
++ }
++
++ // add any offset into the parent node to the path
++ path.push(resolvedOffset.parentOffset);
++
++ return path
++}
++
++/**
++ * Inverse of {@link pmToDeltaPath}
++ * @param {number[]} deltaPath
++ * @param {Node} node
++ * @return {number} The prosemirror offset for the delta path
++ */
++function deltaPathToPm (deltaPath, node) {
++ let pmOffset = 0;
++ let curNode = node;
++
++ // Special case: if path has only one element, it's a child index at depth 0
++ if (deltaPath.length === 1) {
++ const childIndex = deltaPath[0];
++ // Add sizes of all children before the target index
++ for (let j = 0; j < childIndex; j++) {
++ pmOffset += curNode.children[j].nodeSize;
++ }
++ return pmOffset
++ }
++
++ // Handle all elements except the last (which is an offset)
++ for (let i = 0; i < deltaPath.length - 1; i++) {
++ const childIndex = deltaPath[i];
++ // Add sizes of all children before the target child
++ for (let j = 0; j < childIndex; j++) {
++ pmOffset += curNode.children[j].nodeSize;
++ }
++ // Add 1 for the opening tag of the target child, then navigate into it
++ pmOffset += 1;
++ curNode = curNode.children[childIndex];
++ }
++
++ // Last element is an offset within the current node
++ pmOffset += deltaPath[deltaPath.length - 1];
++
++ return pmOffset
++}
++
++/**
++ * @param {Node} node
++ * @param {number} pmOffset
++ * @param {(d:delta.DeltaBuilderAny)=>any} mod
++ * @return {ProsemirrorDelta}
++ */
++const deltaModifyNodeAt = (node, pmOffset, mod) => {
++ const dpath = pmToDeltaPath(node, pmOffset);
++ let currentOp = delta__namespace.create($prosemirrorDelta);
++ const lastIndex = dpath.length - 1;
++ currentOp.retain(lastIndex >= 0 ? dpath[lastIndex] : 0);
++ mod(currentOp);
++ for (let i = lastIndex - 1; i >= 0; i--) {
++ currentOp = /** @type {delta.DeltaBuilderAny} */ (delta__namespace.create($prosemirrorDelta).retain(dpath[i]).modify(currentOp));
++ }
++ return currentOp
++};
++
+ exports.ProsemirrorBinding = ProsemirrorBinding;
+ exports.absolutePositionToRelativePosition = absolutePositionToRelativePosition;
++exports.attributesToMarks = attributesToMarks;
+ exports.createDecorations = createDecorations;
++exports.createEmptyMeta = createEmptyMeta;
++exports.createNodeFromYElement = createNodeFromYElement;
+ exports.defaultAwarenessStateFilter = defaultAwarenessStateFilter;
+ exports.defaultCursorBuilder = defaultCursorBuilder;
+ exports.defaultDeleteFilter = defaultDeleteFilter;
+ exports.defaultProtectedNodes = defaultProtectedNodes;
+ exports.defaultSelectionBuilder = defaultSelectionBuilder;
++exports.deltaModifyNodeAt = deltaModifyNodeAt;
++exports.deltaPathToPm = deltaPathToPm;
++exports.deltaToPSteps = deltaToPSteps;
++exports.docDiffToDelta = docDiffToDelta;
+ exports.getRelativeSelection = getRelativeSelection;
+ exports.initProseMirrorDoc = initProseMirrorDoc;
+ exports.isVisible = isVisible;
++exports.nodeToDelta = nodeToDelta;
++exports.nodesToDelta = nodesToDelta;
++exports.pmToDeltaPath = pmToDeltaPath;
+ exports.prosemirrorJSONToYDoc = prosemirrorJSONToYDoc;
+ exports.prosemirrorJSONToYXmlFragment = prosemirrorJSONToYXmlFragment;
+ exports.prosemirrorToYDoc = prosemirrorToYDoc;
+@@ -2204,6 +2853,9 @@ exports.redo = redo;
+ exports.redoCommand = redoCommand;
+ exports.relativePositionToAbsolutePosition = relativePositionToAbsolutePosition;
+ exports.setMeta = setMeta;
++exports.stepToDelta = stepToDelta;
++exports.syncPlugin = syncPlugin;
++exports.trToDelta = trToDelta;
+ exports.undo = undo;
+ exports.undoCommand = undoCommand;
+ exports.updateYFragment = updateYFragment;
+@@ -2219,4 +2871,5 @@ exports.yXmlFragmentToProseMirrorFragment = yXmlFragmentToProseMirrorFragment;
+ exports.yXmlFragmentToProseMirrorRootNode = yXmlFragmentToProseMirrorRootNode;
+ exports.yXmlFragmentToProsemirror = yXmlFragmentToProsemirror;
+ exports.yXmlFragmentToProsemirrorJSON = yXmlFragmentToProsemirrorJSON;
++exports.yattr2markname = yattr2markname;
+ //# sourceMappingURL=y-prosemirror.cjs.map
+diff --git a/dist/y-prosemirror.cjs.map b/dist/y-prosemirror.cjs.map
+index 61b864629455150ac073bf6a9e5b7f6f7e9e5037..06953863dde535ba0cfa7cfc9292bac113fdfb57 100644
+--- a/dist/y-prosemirror.cjs.map
++++ b/dist/y-prosemirror.cjs.map
+@@ -1 +1 @@
+-{"version":3,"file":"y-prosemirror.cjs","sources":["../src/plugins/keys.js","../src/utils.js","../src/plugins/sync-plugin.js","../src/lib.js","../src/plugins/cursor-plugin.js","../src/plugins/undo-plugin.js"],"sourcesContent":["import { PluginKey } from 'prosemirror-state' // eslint-disable-line\n\n/**\n * The unique prosemirror plugin key for syncPlugin\n *\n * @public\n * @type {PluginKey<{ytype: Y.XmlFragment}>}\n */\nexport const ySyncPluginKey = new PluginKey('y-sync')\n\n/**\n * The unique prosemirror plugin key for undoPlugin\n *\n * @public\n * @type {PluginKey}\n */\nexport const yUndoPluginKey = new PluginKey('y-undo')\n\n/**\n * The unique prosemirror plugin key for cursorPlugin\n *\n * @public\n */\nexport const yCursorPluginKey = new PluginKey('yjs-cursor')\n","import * as sha256 from 'lib0/hash/sha256'\nimport * as buf from 'lib0/buffer'\n\n/**\n * Custom function to transform sha256 hash to N byte\n *\n * @param {Uint8Array} digest\n */\nconst _convolute = digest => {\n const N = 6\n for (let i = N; i < digest.length; i++) {\n digest[i % N] = digest[i % N] ^ digest[i]\n }\n return digest.slice(0, N)\n}\n\n/**\n * @param {any} json\n */\nexport const hashOfJSON = (json) => buf.toBase64(_convolute(sha256.digest(buf.encodeAny(json))))\n","/**\n * @module bindings/prosemirror\n */\n\nimport { createMutex } from 'lib0/mutex'\nimport * as PModel from 'prosemirror-model'\nimport { AllSelection, Plugin, TextSelection, NodeSelection } from \"prosemirror-state\"; // eslint-disable-line\nimport * as math from 'lib0/math'\nimport * as object from 'lib0/object'\nimport * as set from 'lib0/set'\nimport { simpleDiff } from 'lib0/diff'\nimport * as error from 'lib0/error'\nimport { ySyncPluginKey, yUndoPluginKey } from './keys.js'\nimport * as Y from '@y/y'\nimport {\n absolutePositionToRelativePosition,\n relativePositionToAbsolutePosition\n} from '../lib.js'\nimport * as random from 'lib0/random'\nimport * as environment from 'lib0/environment'\nimport * as dom from 'lib0/dom'\nimport * as eventloop from 'lib0/eventloop'\nimport * as map from 'lib0/map'\nimport * as utils from '../utils.js'\n\n/**\n * @typedef {Object} BindingMetadata\n * @property {ProsemirrorMapping} BindingMetadata.mapping\n * @property {Map} BindingMetadata.isOMark - is overlapping mark\n */\n\n/**\n * @return {BindingMetadata}\n */\nexport const createEmptyMeta = () => ({\n mapping: new Map(),\n isOMark: new Map()\n})\n\n/**\n * @param {Y.Item} item\n * @param {Y.Snapshot} [snapshot]\n */\nexport const isVisible = (item, snapshot) =>\n snapshot === undefined\n ? !item.deleted\n : (snapshot.sv.has(item.id.client) && /** @type {number} */\n (snapshot.sv.get(item.id.client)) > item.id.clock &&\n !snapshot.ds.hasId(item.id))\n\n/**\n * Either a node if type is YXmlElement or an Array of text nodes if YXmlText\n * @typedef {Map, PModel.Node | Array>} ProsemirrorMapping\n */\n\n/**\n * @typedef {Object} ColorDef\n * @property {string} ColorDef.light\n * @property {string} ColorDef.dark\n */\n\n/**\n * @typedef {Object} YSyncOpts\n * @property {Array} [YSyncOpts.colors]\n * @property {Map} [YSyncOpts.colorMapping]\n * @property {Y.PermanentUserData|null} [YSyncOpts.permanentUserData]\n * @property {ProsemirrorMapping} [YSyncOpts.mapping]\n * @property {function} [YSyncOpts.onFirstRender] Fired when the content from Yjs is initially rendered to ProseMirror\n */\n\n/**\n * @type {Array}\n */\nconst defaultColors = [{ light: '#ecd44433', dark: '#ecd444' }]\n\n/**\n * @param {Map} colorMapping\n * @param {Array} colors\n * @param {string} user\n * @return {ColorDef}\n */\nconst getUserColor = (colorMapping, colors, user) => {\n // @todo do not hit the same color twice if possible\n if (!colorMapping.has(user)) {\n if (colorMapping.size < colors.length) {\n const usedColors = set.create()\n colorMapping.forEach((color) => usedColors.add(color))\n colors = colors.filter((color) => !usedColors.has(color))\n }\n colorMapping.set(user, random.oneOf(colors))\n }\n return /** @type {ColorDef} */ (colorMapping.get(user))\n}\n\n/**\n * This plugin listens to changes in prosemirror view and keeps yXmlState and view in sync.\n *\n * This plugin also keeps references to the type and the shared document so other plugins can access it.\n * @param {Y.XmlFragment} yXmlFragment\n * @param {YSyncOpts} opts\n * @return {any} Returns a prosemirror plugin that binds to this type\n */\nexport const ySyncPlugin = (yXmlFragment, {\n colors = defaultColors,\n colorMapping = new Map(),\n permanentUserData = null,\n onFirstRender = () => {},\n mapping\n} = {}) => {\n let initialContentChanged = false\n const binding = new ProsemirrorBinding(yXmlFragment, mapping)\n const plugin = new Plugin({\n props: {\n editable: (state) => {\n const syncState = ySyncPluginKey.getState(state)\n return syncState.snapshot == null && syncState.prevSnapshot == null\n }\n },\n key: ySyncPluginKey,\n state: {\n /**\n * @returns {any}\n */\n init: (_initargs, _state) => {\n return {\n type: yXmlFragment,\n doc: yXmlFragment.doc,\n binding,\n snapshot: null,\n prevSnapshot: null,\n isChangeOrigin: false,\n isUndoRedoOperation: false,\n addToHistory: true,\n colors,\n colorMapping,\n permanentUserData\n }\n },\n apply: (tr, pluginState) => {\n const change = tr.getMeta(ySyncPluginKey)\n if (change !== undefined) {\n pluginState = Object.assign({}, pluginState)\n for (const key in change) {\n pluginState[key] = change[key]\n }\n }\n pluginState.addToHistory = tr.getMeta('addToHistory') !== false\n // always set isChangeOrigin. If undefined, this is not change origin.\n pluginState.isChangeOrigin = change !== undefined &&\n !!change.isChangeOrigin\n pluginState.isUndoRedoOperation = change !== undefined && !!change.isChangeOrigin && !!change.isUndoRedoOperation\n if (binding.prosemirrorView !== null) {\n if (\n change !== undefined &&\n (change.snapshot != null || change.prevSnapshot != null)\n ) {\n // snapshot changed, rerender next\n eventloop.timeout(0, () => {\n if (binding.prosemirrorView == null) {\n return\n }\n if (change.restore == null) {\n binding._renderSnapshot(\n change.snapshot,\n change.prevSnapshot,\n pluginState\n )\n } else {\n binding._renderSnapshot(\n change.snapshot,\n change.snapshot,\n pluginState\n )\n // reset to current prosemirror state\n delete pluginState.restore\n delete pluginState.snapshot\n delete pluginState.prevSnapshot\n binding.mux(() => {\n binding._prosemirrorChanged(\n binding.prosemirrorView.state.doc\n )\n })\n }\n })\n }\n }\n return pluginState\n }\n },\n view: (view) => {\n binding.initView(view)\n if (mapping == null) {\n // force rerender to update the bindings mapping\n binding._forceRerender()\n }\n onFirstRender()\n return {\n update: () => {\n const pluginState = plugin.getState(view.state)\n if (\n pluginState.snapshot == null && pluginState.prevSnapshot == null\n ) {\n if (\n // If the content doesn't change initially, we don't render anything to Yjs\n // If the content was cleared by a user action, we want to catch the change and\n // represent it in Yjs\n initialContentChanged ||\n view.state.doc.content.findDiffStart(\n view.state.doc.type.createAndFill().content\n ) !== null\n ) {\n initialContentChanged = true\n if (\n pluginState.addToHistory === false &&\n !pluginState.isChangeOrigin\n ) {\n const yUndoPluginState = yUndoPluginKey.getState(view.state)\n /**\n * @type {Y.UndoManager}\n */\n const um = yUndoPluginState && yUndoPluginState.undoManager\n if (um) {\n um.stopCapturing()\n }\n }\n binding.mux(() => {\n /** @type {Y.Doc} */ (pluginState.doc).transact((tr) => {\n tr.meta.set('addToHistory', pluginState.addToHistory)\n binding._prosemirrorChanged(view.state.doc)\n }, ySyncPluginKey)\n })\n }\n }\n },\n destroy: () => {\n binding.destroy()\n }\n }\n }\n })\n return plugin\n}\n\n/**\n * @param {import('prosemirror-state').Transaction} tr\n * @param {ReturnType} relSel\n * @param {ProsemirrorBinding} binding\n */\nconst restoreRelativeSelection = (tr, relSel, binding) => {\n if (relSel !== null && relSel.anchor !== null && relSel.head !== null) {\n if (relSel.type === 'all') {\n tr.setSelection(new AllSelection(tr.doc))\n } else if (relSel.type === 'node') {\n const anchor = relativePositionToAbsolutePosition(\n binding.doc,\n binding.type,\n relSel.anchor,\n binding.mapping\n )\n tr.setSelection(NodeSelection.create(tr.doc, anchor))\n } else {\n const anchor = relativePositionToAbsolutePosition(\n binding.doc,\n binding.type,\n relSel.anchor,\n binding.mapping\n )\n const head = relativePositionToAbsolutePosition(\n binding.doc,\n binding.type,\n relSel.head,\n binding.mapping\n )\n if (anchor !== null && head !== null) {\n const sel = TextSelection.between(tr.doc.resolve(anchor), tr.doc.resolve(head))\n tr.setSelection(sel)\n }\n }\n }\n}\n\n/**\n * @param {ProsemirrorBinding} pmbinding\n * @param {import('prosemirror-state').EditorState} state\n */\nexport const getRelativeSelection = (pmbinding, state) => ({\n type: /** @type {any} */ (state.selection).jsonID,\n anchor: absolutePositionToRelativePosition(\n state.selection.anchor,\n pmbinding.type,\n pmbinding.mapping\n ),\n head: absolutePositionToRelativePosition(\n state.selection.head,\n pmbinding.type,\n pmbinding.mapping\n )\n})\n\n/**\n * Binding for prosemirror.\n *\n * @protected\n */\nexport class ProsemirrorBinding {\n /**\n * @param {Y.XmlFragment} yXmlFragment The bind source\n * @param {ProsemirrorMapping} mapping\n */\n constructor (yXmlFragment, mapping = new Map()) {\n this.type = yXmlFragment\n /**\n * this will be set once the view is created\n * @type {any}\n */\n this.prosemirrorView = null\n this.mux = createMutex()\n this.mapping = mapping\n /**\n * Is overlapping mark - i.e. mark does not exclude itself.\n *\n * @type {Map}\n */\n this.isOMark = new Map()\n this._observeFunction = this._typeChanged.bind(this)\n /**\n * @type {Y.Doc}\n */\n // @ts-ignore\n this.doc = yXmlFragment.doc\n /**\n * current selection as relative positions in the Yjs model\n */\n this.beforeTransactionSelection = null\n this.beforeAllTransactions = () => {\n if (this.beforeTransactionSelection === null && this.prosemirrorView != null) {\n this.beforeTransactionSelection = getRelativeSelection(\n this,\n this.prosemirrorView.state\n )\n }\n }\n this.afterAllTransactions = () => {\n this.beforeTransactionSelection = null\n }\n this._domSelectionInView = null\n }\n\n /**\n * Create a transaction for changing the prosemirror state.\n *\n * @returns\n */\n get _tr () {\n return this.prosemirrorView.state.tr.setMeta('addToHistory', false)\n }\n\n _isLocalCursorInView () {\n if (!this.prosemirrorView.hasFocus()) return false\n if (environment.isBrowser && this._domSelectionInView === null) {\n // Calculate the domSelectionInView and clear by next tick after all events are finished\n eventloop.timeout(0, () => {\n this._domSelectionInView = null\n })\n this._domSelectionInView = this._isDomSelectionInView()\n }\n return this._domSelectionInView\n }\n\n _isDomSelectionInView () {\n const selection = this.prosemirrorView._root.getSelection()\n\n if (selection == null || selection.anchorNode == null) return false\n\n const range = this.prosemirrorView._root.createRange()\n range.setStart(selection.anchorNode, selection.anchorOffset)\n range.setEnd(selection.focusNode, selection.focusOffset)\n\n // This is a workaround for an edgecase where getBoundingClientRect will\n // return zero values if the selection is collapsed at the start of a newline\n // see reference here: https://stackoverflow.com/a/59780954\n const rects = range.getClientRects()\n if (rects.length === 0) {\n // probably buggy newline behavior, explicitly select the node contents\n if (range.startContainer && range.collapsed) {\n range.selectNodeContents(range.startContainer)\n }\n }\n\n const bounding = range.getBoundingClientRect()\n const documentElement = dom.doc.documentElement\n\n return bounding.bottom >= 0 && bounding.right >= 0 &&\n bounding.left <=\n (window.innerWidth || documentElement.clientWidth || 0) &&\n bounding.top <= (window.innerHeight || documentElement.clientHeight || 0)\n }\n\n /**\n * @param {Y.Snapshot} snapshot\n * @param {Y.Snapshot} prevSnapshot\n */\n renderSnapshot (snapshot, prevSnapshot) {\n if (!prevSnapshot) {\n prevSnapshot = Y.createSnapshot(Y.createIdSet(), new Map())\n }\n this.prosemirrorView.dispatch(\n this._tr.setMeta(ySyncPluginKey, { snapshot, prevSnapshot })\n )\n }\n\n unrenderSnapshot () {\n this.mapping.clear()\n this.mux(() => {\n const fragmentContent = this.type.toArray().map((t) =>\n createNodeFromYElement(\n /** @type {Y.XmlElement} */ (t),\n this.prosemirrorView.state.schema,\n this\n )\n ).filter((n) => n !== null)\n // @ts-ignore\n const tr = this._tr.replace(\n 0,\n this.prosemirrorView.state.doc.content.size,\n new PModel.Slice(PModel.Fragment.from(fragmentContent), 0, 0)\n )\n tr.setMeta(ySyncPluginKey, { snapshot: null, prevSnapshot: null })\n this.prosemirrorView.dispatch(tr)\n })\n }\n\n _forceRerender () {\n this.mapping.clear()\n this.mux(() => {\n // If this is a forced rerender, this might neither happen as a pm change nor within a Yjs\n // transaction. Then the \"before selection\" doesn't exist. In this case, we need to create a\n // relative position before replacing content. Fixes #126\n const sel = this.beforeTransactionSelection !== null ? null : this.prosemirrorView.state.selection\n const fragmentContent = this.type.toArray().map((t) =>\n createNodeFromYElement(\n /** @type {Y.XmlElement} */ (t),\n this.prosemirrorView.state.schema,\n this\n )\n ).filter((n) => n !== null)\n // @ts-ignore\n const tr = this._tr.replace(\n 0,\n this.prosemirrorView.state.doc.content.size,\n new PModel.Slice(PModel.Fragment.from(fragmentContent), 0, 0)\n )\n if (sel) {\n /**\n * If the Prosemirror document we just created from this.type is\n * smaller than the previous document, the selection might be\n * out of bound, which would make Prosemirror throw an error.\n */\n const clampedAnchor = math.min(math.max(sel.anchor, 0), tr.doc.content.size)\n const clampedHead = math.min(math.max(sel.head, 0), tr.doc.content.size)\n\n tr.setSelection(TextSelection.create(tr.doc, clampedAnchor, clampedHead))\n }\n this.prosemirrorView.dispatch(\n tr.setMeta(ySyncPluginKey, { isChangeOrigin: true, binding: this })\n )\n })\n }\n\n /**\n * @param {Y.Snapshot|Uint8Array} snapshot\n * @param {Y.Snapshot|Uint8Array} prevSnapshot\n * @param {Object} pluginState\n */\n _renderSnapshot (snapshot, prevSnapshot, pluginState) {\n /**\n * The document that contains the full history of this document.\n * @type {Y.Doc}\n */\n let historyDoc = this.doc\n let historyType = this.type\n if (!snapshot) {\n snapshot = Y.snapshot(this.doc)\n }\n if (snapshot instanceof Uint8Array || prevSnapshot instanceof Uint8Array) {\n if (!(snapshot instanceof Uint8Array) || !(prevSnapshot instanceof Uint8Array)) {\n // expected both snapshots to be v2 updates\n error.unexpectedCase()\n }\n historyDoc = new Y.Doc({ gc: false })\n Y.applyUpdateV2(historyDoc, prevSnapshot)\n prevSnapshot = Y.snapshot(historyDoc)\n Y.applyUpdateV2(historyDoc, snapshot)\n snapshot = Y.snapshot(historyDoc)\n if (historyType._item === null) {\n /**\n * If is a root type, we need to find the root key in the initial document\n * and use it to get the history type.\n */\n const rootKey = Array.from(this.doc.share.keys()).find(\n (key) => this.doc.share.get(key) === this.type\n )\n historyType = historyDoc.getXmlFragment(rootKey)\n } else {\n /**\n * If it is a sub type, we use the item id to find the history type.\n */\n const historyStructs =\n historyDoc.store.clients.get(historyType._item.id.client) ?? []\n const itemIndex = Y.findIndexSS(\n historyStructs,\n historyType._item.id.clock\n )\n const item = /** @type {Y.Item} */ (historyStructs[itemIndex])\n const content = /** @type {Y.ContentType} */ (item.content)\n historyType = /** @type {Y.XmlFragment} */ (content.type)\n }\n }\n // clear mapping because we are going to rerender\n this.mapping.clear()\n this.mux(() => {\n historyDoc.transact((transaction) => {\n // before rendering, we are going to sanitize ops and split deleted ops\n // if they were deleted by seperate users.\n /**\n * @type {Y.PermanentUserData}\n */\n const pud = pluginState.permanentUserData\n if (pud) {\n pud.dss.forEach((ds) => {\n Y.iterateStructsByIdSet(transaction, ds, (_item) => {})\n })\n }\n /**\n * @param {'removed'|'added'} type\n * @param {Y.ID} id\n */\n const computeYChange = (type, id) => {\n const user = type === 'added'\n ? pud.getUserByClientId(id.client)\n : pud.getUserByDeletedId(id)\n return {\n user,\n type,\n color: getUserColor(\n pluginState.colorMapping,\n pluginState.colors,\n user\n )\n }\n }\n // Create document fragment and render\n const fragmentContent = Y.typeListToArraySnapshot(\n historyType,\n new Y.Snapshot(prevSnapshot.ds, snapshot.sv)\n ).map((t) => {\n if (\n !t._item.deleted || isVisible(t._item, snapshot) ||\n isVisible(t._item, prevSnapshot)\n ) {\n return createNodeFromYElement(\n t,\n this.prosemirrorView.state.schema,\n { mapping: new Map(), isOMark: new Map() },\n snapshot,\n prevSnapshot,\n computeYChange\n )\n } else {\n // No need to render elements that are not visible by either snapshot.\n // If a client adds and deletes content in the same snapshot the element is not visible by either snapshot.\n return null\n }\n }).filter((n) => n !== null)\n // @ts-ignore\n const tr = this._tr.replace(\n 0,\n this.prosemirrorView.state.doc.content.size,\n new PModel.Slice(PModel.Fragment.from(fragmentContent), 0, 0)\n )\n this.prosemirrorView.dispatch(\n tr.setMeta(ySyncPluginKey, { isChangeOrigin: true })\n )\n }, ySyncPluginKey)\n })\n }\n\n /**\n * @param {Array>} events\n * @param {Y.Transaction} transaction\n */\n _typeChanged (events, transaction) {\n if (this.prosemirrorView == null) return\n const syncState = ySyncPluginKey.getState(this.prosemirrorView.state)\n if (\n events.length === 0 || syncState.snapshot != null ||\n syncState.prevSnapshot != null\n ) {\n // drop out if snapshot is active\n this.renderSnapshot(syncState.snapshot, syncState.prevSnapshot)\n return\n }\n this.mux(() => {\n /**\n * @param {any} _\n * @param {Y.AbstractType} type\n */\n const delType = (_, type) => this.mapping.delete(type)\n Y.iterateStructsByIdSet(\n transaction,\n transaction.deleteSet,\n (struct) => {\n if (struct.constructor === Y.Item) {\n const type = /** @type {Y.ContentType} */ (/** @type {Y.Item} */ (struct).content).type\n type && this.mapping.delete(type)\n }\n }\n )\n transaction.changed.forEach(delType)\n transaction.changedParentTypes.forEach(delType)\n const fragmentContent = this.type.toArray().map((t) =>\n createNodeIfNotExists(\n /** @type {Y.XmlElement | Y.XmlHook} */ (t),\n this.prosemirrorView.state.schema,\n this\n )\n ).filter((n) => n !== null)\n // @ts-ignore\n let tr = this._tr.replace(\n 0,\n this.prosemirrorView.state.doc.content.size,\n new PModel.Slice(PModel.Fragment.from(fragmentContent), 0, 0)\n )\n restoreRelativeSelection(tr, this.beforeTransactionSelection, this)\n tr = tr.setMeta(ySyncPluginKey, { isChangeOrigin: true, isUndoRedoOperation: transaction.origin instanceof Y.UndoManager })\n if (\n this.beforeTransactionSelection !== null && this._isLocalCursorInView()\n ) {\n tr.scrollIntoView()\n }\n this.prosemirrorView.dispatch(tr)\n })\n }\n\n /**\n * @param {import('prosemirror-model').Node} doc\n */\n _prosemirrorChanged (doc) {\n this.doc.transact(() => {\n updateYFragment(this.doc, this.type, doc, this)\n this.beforeTransactionSelection = getRelativeSelection(\n this,\n this.prosemirrorView.state\n )\n }, ySyncPluginKey)\n }\n\n /**\n * View is ready to listen to changes. Register observers.\n * @param {any} prosemirrorView\n */\n initView (prosemirrorView) {\n if (this.prosemirrorView != null) this.destroy()\n this.prosemirrorView = prosemirrorView\n this.doc.on('beforeAllTransactions', this.beforeAllTransactions)\n this.doc.on('afterAllTransactions', this.afterAllTransactions)\n this.type.observeDeep(this._observeFunction)\n }\n\n destroy () {\n if (this.prosemirrorView == null) return\n this.prosemirrorView = null\n this.type.unobserveDeep(this._observeFunction)\n this.doc.off('beforeAllTransactions', this.beforeAllTransactions)\n this.doc.off('afterAllTransactions', this.afterAllTransactions)\n }\n}\n\n/**\n * @private\n * @param {Y.XmlElement | Y.XmlHook} el\n * @param {PModel.Schema} schema\n * @param {BindingMetadata} meta\n * @param {Y.Snapshot} [snapshot]\n * @param {Y.Snapshot} [prevSnapshot]\n * @param {function('removed' | 'added', Y.ID):any} [computeYChange]\n * @return {PModel.Node | null}\n */\nconst createNodeIfNotExists = (\n el,\n schema,\n meta,\n snapshot,\n prevSnapshot,\n computeYChange\n) => {\n const node = /** @type {PModel.Node} */ (meta.mapping.get(el))\n if (node === undefined) {\n if (el instanceof Y.XmlElement) {\n return createNodeFromYElement(\n el,\n schema,\n meta,\n snapshot,\n prevSnapshot,\n computeYChange\n )\n } else {\n throw error.methodUnimplemented() // we are currently not handling hooks\n }\n }\n return node\n}\n\n/**\n * @private\n * @param {Y.XmlElement} el\n * @param {any} schema\n * @param {BindingMetadata} meta\n * @param {Y.Snapshot} [snapshot]\n * @param {Y.Snapshot} [prevSnapshot]\n * @param {function('removed' | 'added', Y.ID):any} [computeYChange]\n * @return {PModel.Node | null} Returns node if node could be created. Otherwise it deletes the yjs type and returns null\n */\nexport const createNodeFromYElement = (\n el,\n schema,\n meta,\n snapshot,\n prevSnapshot,\n computeYChange\n) => {\n const children = []\n /**\n * @param {Y.XmlElement | Y.XmlText} type\n */\n const createChildren = (type) => {\n if (type instanceof Y.XmlElement) {\n const n = createNodeIfNotExists(\n type,\n schema,\n meta,\n snapshot,\n prevSnapshot,\n computeYChange\n )\n if (n !== null) {\n children.push(n)\n }\n } else {\n // If the next ytext exists and was created by us, move the content to the current ytext.\n // This is a fix for #160 -- duplication of characters when two Y.Text exist next to each\n // other.\n const nextytext = /** @type {Y.ContentType} */ (type._item.right?.content)?.type\n if (nextytext instanceof Y.Text && !nextytext._item.deleted && nextytext._item.id.client === nextytext.doc.clientID) {\n type.applyDelta([\n { retain: type.length },\n ...nextytext.toDelta()\n ])\n nextytext.doc.transact(tr => {\n nextytext._item.delete(tr)\n })\n }\n // now create the prosemirror text nodes\n const ns = createTextNodesFromYText(\n type,\n schema,\n meta,\n snapshot,\n prevSnapshot,\n computeYChange\n )\n if (ns !== null) {\n ns.forEach((textchild) => {\n if (textchild !== null) {\n children.push(textchild)\n }\n })\n }\n }\n }\n if (snapshot === undefined || prevSnapshot === undefined) {\n el.toArray().forEach(createChildren)\n } else {\n Y.typeListToArraySnapshot(el, new Y.Snapshot(prevSnapshot.ds, snapshot.sv))\n .forEach(createChildren)\n }\n try {\n const attrs = el.getAttributes(snapshot)\n if (snapshot !== undefined) {\n if (!isVisible(/** @type {Y.Item} */ (el._item), snapshot)) {\n attrs.ychange = computeYChange\n ? computeYChange('removed', /** @type {Y.Item} */ (el._item).id)\n : { type: 'removed' }\n } else if (!isVisible(/** @type {Y.Item} */ (el._item), prevSnapshot)) {\n attrs.ychange = computeYChange\n ? computeYChange('added', /** @type {Y.Item} */ (el._item).id)\n : { type: 'added' }\n }\n }\n const node = schema.node(el.nodeName, attrs, children)\n meta.mapping.set(el, node)\n return node\n } catch (e) {\n // an error occured while creating the node. This is probably a result of a concurrent action.\n /** @type {Y.Doc} */ (el.doc).transact((transaction) => {\n /** @type {Y.Item} */ (el._item).delete(transaction)\n }, ySyncPluginKey)\n meta.mapping.delete(el)\n return null\n }\n}\n\n/**\n * @private\n * @param {Y.XmlText} text\n * @param {import('prosemirror-model').Schema} schema\n * @param {BindingMetadata} _meta\n * @param {Y.Snapshot} [snapshot]\n * @param {Y.Snapshot} [prevSnapshot]\n * @param {function('removed' | 'added', Y.ID):any} [computeYChange]\n * @return {Array|null}\n */\nconst createTextNodesFromYText = (\n text,\n schema,\n _meta,\n snapshot,\n prevSnapshot,\n computeYChange\n) => {\n const nodes = []\n const deltas = text.toDelta(snapshot, prevSnapshot, computeYChange)\n try {\n for (let i = 0; i < deltas.length; i++) {\n const delta = deltas[i]\n nodes.push(schema.text(delta.insert, attributesToMarks(delta.attributes, schema)))\n }\n } catch (e) {\n // an error occured while creating the node. This is probably a result of a concurrent action.\n /** @type {Y.Doc} */ (text.doc).transact((transaction) => {\n /** @type {Y.Item} */ (text._item).delete(transaction)\n }, ySyncPluginKey)\n return null\n }\n // @ts-ignore\n return nodes\n}\n\n/**\n * @private\n * @param {Array} nodes prosemirror node\n * @param {BindingMetadata} meta\n * @return {Y.XmlText}\n */\nconst createTypeFromTextNodes = (nodes, meta) => {\n const type = new Y.XmlText()\n const delta = nodes.map((node) => ({\n // @ts-ignore\n insert: node.text,\n attributes: marksToAttributes(node.marks, meta)\n }))\n type.applyDelta(delta)\n meta.mapping.set(type, nodes)\n return type\n}\n\n/**\n * @private\n * @param {any} node prosemirror node\n * @param {BindingMetadata} meta\n * @return {Y.XmlElement}\n */\nconst createTypeFromElementNode = (node, meta) => {\n const type = new Y.XmlElement(node.type.name)\n for (const key in node.attrs) {\n const val = node.attrs[key]\n if (val !== null && key !== 'ychange') {\n type.setAttribute(key, val)\n }\n }\n type.insert(\n 0,\n normalizePNodeContent(node).map((n) =>\n createTypeFromTextOrElementNode(n, meta)\n )\n )\n meta.mapping.set(type, node)\n return type\n}\n\n/**\n * @private\n * @param {PModel.Node|Array} node prosemirror text node\n * @param {BindingMetadata} meta\n * @return {Y.XmlElement|Y.XmlText}\n */\nconst createTypeFromTextOrElementNode = (node, meta) =>\n node instanceof Array\n ? createTypeFromTextNodes(node, meta)\n : createTypeFromElementNode(node, meta)\n\n/**\n * @param {any} val\n */\nconst isObject = (val) => typeof val === 'object' && val !== null\n\n/**\n * @param {any} pattrs\n * @param {any} yattrs\n */\nconst equalAttrs = (pattrs, yattrs) => {\n const keys = Object.keys(pattrs).filter((key) => pattrs[key] !== null)\n let eq =\n keys.length ===\n (yattrs == null ? 0 : Object.keys(yattrs).filter((key) => yattrs[key] !== null).length)\n for (let i = 0; i < keys.length && eq; i++) {\n const key = keys[i]\n const l = pattrs[key]\n const r = yattrs[key]\n eq = key === 'ychange' || l === r ||\n (isObject(l) && isObject(r) && equalAttrs(l, r))\n }\n return eq\n}\n\n/**\n * @typedef {Array|PModel.Node>} NormalizedPNodeContent\n */\n\n/**\n * @param {any} pnode\n * @return {NormalizedPNodeContent}\n */\nconst normalizePNodeContent = (pnode) => {\n const c = pnode.content.content\n const res = []\n for (let i = 0; i < c.length; i++) {\n const n = c[i]\n if (n.isText) {\n const textNodes = []\n for (let tnode = c[i]; i < c.length && tnode.isText; tnode = c[++i]) {\n textNodes.push(tnode)\n }\n i--\n res.push(textNodes)\n } else {\n res.push(n)\n }\n }\n return res\n}\n\n/**\n * @param {Y.XmlText} ytext\n * @param {Array} ptexts\n */\nconst equalYTextPText = (ytext, ptexts) => {\n const delta = ytext.toDelta()\n return delta.length === ptexts.length &&\n delta.every(/** @type {(d:any,i:number) => boolean} */ (d, i) =>\n d.insert === /** @type {any} */ (ptexts[i]).text &&\n object.keys(d.attributes || {}).length === ptexts[i].marks.length &&\n object.every(d.attributes, (attr, yattrname) => {\n const markname = yattr2markname(yattrname)\n const pmarks = ptexts[i].marks\n return equalAttrs(attr, pmarks.find(/** @param {any} mark */ mark => mark.type.name === markname)?.attrs)\n })\n )\n}\n\n/**\n * @param {Y.XmlElement|Y.XmlText|Y.XmlHook} ytype\n * @param {any|Array} pnode\n */\nconst equalYTypePNode = (ytype, pnode) => {\n if (\n ytype instanceof Y.XmlElement && !(pnode instanceof Array) &&\n matchNodeName(ytype, pnode)\n ) {\n const normalizedContent = normalizePNodeContent(pnode)\n return ytype._length === normalizedContent.length &&\n equalAttrs(ytype.getAttributes(), pnode.attrs) &&\n ytype.toArray().every((ychild, i) =>\n equalYTypePNode(ychild, normalizedContent[i])\n )\n }\n return ytype instanceof Y.XmlText && pnode instanceof Array &&\n equalYTextPText(ytype, pnode)\n}\n\n/**\n * @param {PModel.Node | Array | undefined} mapped\n * @param {PModel.Node | Array} pcontent\n */\nconst mappedIdentity = (mapped, pcontent) =>\n mapped === pcontent ||\n (mapped instanceof Array && pcontent instanceof Array &&\n mapped.length === pcontent.length && mapped.every((a, i) =>\n pcontent[i] === a\n ))\n\n/**\n * @param {Y.XmlElement} ytype\n * @param {PModel.Node} pnode\n * @param {BindingMetadata} meta\n * @return {{ foundMappedChild: boolean, equalityFactor: number }}\n */\nconst computeChildEqualityFactor = (ytype, pnode, meta) => {\n const yChildren = ytype.toArray()\n const pChildren = normalizePNodeContent(pnode)\n const pChildCnt = pChildren.length\n const yChildCnt = yChildren.length\n const minCnt = math.min(yChildCnt, pChildCnt)\n let left = 0\n let right = 0\n let foundMappedChild = false\n for (; left < minCnt; left++) {\n const leftY = yChildren[left]\n const leftP = pChildren[left]\n if (mappedIdentity(meta.mapping.get(leftY), leftP)) {\n foundMappedChild = true // definite (good) match!\n } else if (!equalYTypePNode(leftY, leftP)) {\n break\n }\n }\n for (; left + right < minCnt; right++) {\n const rightY = yChildren[yChildCnt - right - 1]\n const rightP = pChildren[pChildCnt - right - 1]\n if (mappedIdentity(meta.mapping.get(rightY), rightP)) {\n foundMappedChild = true\n } else if (!equalYTypePNode(rightY, rightP)) {\n break\n }\n }\n return {\n equalityFactor: left + right,\n foundMappedChild\n }\n}\n\n/**\n * @param {Y.Text} ytext\n */\nconst ytextTrans = (ytext) => {\n let str = ''\n /**\n * @type {Y.Item|null}\n */\n let n = ytext._start\n const nAttrs = {}\n while (n !== null) {\n if (!n.deleted) {\n if (n.countable && n.content instanceof Y.ContentString) {\n str += n.content.str\n } else if (n.content instanceof Y.ContentFormat) {\n nAttrs[n.content.key] = null\n }\n }\n n = n.right\n }\n return {\n str,\n nAttrs\n }\n}\n\n/**\n * @todo test this more\n *\n * @param {Y.Text} ytext\n * @param {Array} ptexts\n * @param {BindingMetadata} meta\n */\nconst updateYText = (ytext, ptexts, meta) => {\n meta.mapping.set(ytext, ptexts)\n const { nAttrs, str } = ytextTrans(ytext)\n const content = ptexts.map((p) => ({\n insert: /** @type {any} */ (p).text,\n attributes: Object.assign({}, nAttrs, marksToAttributes(p.marks, meta))\n }))\n const { insert, remove, index } = simpleDiff(\n str,\n content.map((c) => c.insert).join('')\n )\n ytext.delete(index, remove)\n ytext.insert(index, insert)\n ytext.applyDelta(\n content.map((c) => ({ retain: c.insert.length, attributes: c.attributes }))\n )\n}\n\nconst hashedMarkNameRegex = /(.*)(--[a-zA-Z0-9+/=]{8})$/\n/**\n * @param {string} attrName\n */\nexport const yattr2markname = attrName => hashedMarkNameRegex.exec(attrName)?.[1] ?? attrName\n\n/**\n * @todo move this to markstoattributes\n *\n * @param {Object} attrs\n * @param {import('prosemirror-model').Schema} schema\n */\nexport const attributesToMarks = (attrs, schema) => {\n /**\n * @type {Array}\n */\n const marks = []\n for (const markName in attrs) {\n // remove hashes if necessary\n marks.push(schema.mark(yattr2markname(markName), attrs[markName]))\n }\n return marks\n}\n\n/**\n * @param {Array} marks\n * @param {BindingMetadata} meta\n */\nconst marksToAttributes = (marks, meta) => {\n const pattrs = {}\n marks.forEach((mark) => {\n if (mark.type.name !== 'ychange') {\n const isOverlapping = map.setIfUndefined(meta.isOMark, mark.type, () => !mark.type.excludes(mark.type))\n pattrs[isOverlapping ? `${mark.type.name}--${utils.hashOfJSON(mark.toJSON())}` : mark.type.name] = mark.attrs\n }\n })\n return pattrs\n}\n\n/**\n * Update a yDom node by syncing the current content of the prosemirror node.\n *\n * This is a y-prosemirror internal feature that you can use at your own risk.\n *\n * @private\n * @unstable\n *\n * @param {{transact: Function}} y\n * @param {Y.XmlFragment} yDomFragment\n * @param {any} pNode\n * @param {BindingMetadata} meta\n */\nexport const updateYFragment = (y, yDomFragment, pNode, meta) => {\n if (\n yDomFragment instanceof Y.XmlElement &&\n yDomFragment.nodeName !== pNode.type.name\n ) {\n throw new Error('node name mismatch!')\n }\n meta.mapping.set(yDomFragment, pNode)\n // update attributes\n if (yDomFragment instanceof Y.XmlElement) {\n const yDomAttrs = yDomFragment.getAttributes()\n const pAttrs = pNode.attrs\n for (const key in pAttrs) {\n if (pAttrs[key] !== null) {\n if (yDomAttrs[key] !== pAttrs[key] && key !== 'ychange') {\n yDomFragment.setAttribute(key, pAttrs[key])\n }\n } else {\n yDomFragment.removeAttribute(key)\n }\n }\n // remove all keys that are no longer in pAttrs\n for (const key in yDomAttrs) {\n if (pAttrs[key] === undefined) {\n yDomFragment.removeAttribute(key)\n }\n }\n }\n // update children\n const pChildren = normalizePNodeContent(pNode)\n const pChildCnt = pChildren.length\n const yChildren = yDomFragment.toArray()\n const yChildCnt = yChildren.length\n const minCnt = math.min(pChildCnt, yChildCnt)\n let left = 0\n let right = 0\n // find number of matching elements from left\n for (; left < minCnt; left++) {\n const leftY = yChildren[left]\n const leftP = pChildren[left]\n if (!mappedIdentity(meta.mapping.get(leftY), leftP)) {\n if (equalYTypePNode(leftY, leftP)) {\n // update mapping\n meta.mapping.set(leftY, leftP)\n } else {\n break\n }\n }\n }\n // find number of matching elements from right\n for (; right + left < minCnt; right++) {\n const rightY = yChildren[yChildCnt - right - 1]\n const rightP = pChildren[pChildCnt - right - 1]\n if (!mappedIdentity(meta.mapping.get(rightY), rightP)) {\n if (equalYTypePNode(rightY, rightP)) {\n // update mapping\n meta.mapping.set(rightY, rightP)\n } else {\n break\n }\n }\n }\n y.transact(() => {\n // try to compare and update\n while (yChildCnt - left - right > 0 && pChildCnt - left - right > 0) {\n const leftY = yChildren[left]\n const leftP = pChildren[left]\n const rightY = yChildren[yChildCnt - right - 1]\n const rightP = pChildren[pChildCnt - right - 1]\n if (leftY instanceof Y.XmlText && leftP instanceof Array) {\n if (!equalYTextPText(leftY, leftP)) {\n updateYText(leftY, leftP, meta)\n }\n left += 1\n } else {\n let updateLeft = leftY instanceof Y.XmlElement &&\n matchNodeName(leftY, leftP)\n let updateRight = rightY instanceof Y.XmlElement &&\n matchNodeName(rightY, rightP)\n if (updateLeft && updateRight) {\n // decide which which element to update\n const equalityLeft = computeChildEqualityFactor(\n /** @type {Y.XmlElement} */ (leftY),\n /** @type {PModel.Node} */ (leftP),\n meta\n )\n const equalityRight = computeChildEqualityFactor(\n /** @type {Y.XmlElement} */ (rightY),\n /** @type {PModel.Node} */ (rightP),\n meta\n )\n if (\n equalityLeft.foundMappedChild && !equalityRight.foundMappedChild\n ) {\n updateRight = false\n } else if (\n !equalityLeft.foundMappedChild && equalityRight.foundMappedChild\n ) {\n updateLeft = false\n } else if (\n equalityLeft.equalityFactor < equalityRight.equalityFactor\n ) {\n updateLeft = false\n } else {\n updateRight = false\n }\n }\n if (updateLeft) {\n updateYFragment(\n y,\n /** @type {Y.XmlFragment} */ (leftY),\n /** @type {PModel.Node} */ (leftP),\n meta\n )\n left += 1\n } else if (updateRight) {\n updateYFragment(\n y,\n /** @type {Y.XmlFragment} */ (rightY),\n /** @type {PModel.Node} */ (rightP),\n meta\n )\n right += 1\n } else {\n meta.mapping.delete(yDomFragment.get(left))\n yDomFragment.delete(left, 1)\n yDomFragment.insert(left, [\n createTypeFromTextOrElementNode(leftP, meta)\n ])\n left += 1\n }\n }\n }\n const yDelLen = yChildCnt - left - right\n if (\n yChildCnt === 1 && pChildCnt === 0 && yChildren[0] instanceof Y.XmlText\n ) {\n meta.mapping.delete(yChildren[0])\n // Edge case handling https://github.com/yjs/y-prosemirror/issues/108\n // Only delete the content of the Y.Text to retain remote changes on the same Y.Text object\n yChildren[0].delete(0, yChildren[0].length)\n } else if (yDelLen > 0) {\n yDomFragment.slice(left, left + yDelLen).forEach(type => meta.mapping.delete(type))\n yDomFragment.delete(left, yDelLen)\n }\n if (left + right < pChildCnt) {\n const ins = []\n for (let i = left; i < pChildCnt - right; i++) {\n ins.push(createTypeFromTextOrElementNode(pChildren[i], meta))\n }\n yDomFragment.insert(left, ins)\n }\n }, ySyncPluginKey)\n}\n\n/**\n * @function\n * @param {Y.XmlElement} yElement\n * @param {any} pNode Prosemirror Node\n */\nconst matchNodeName = (yElement, pNode) =>\n !(pNode instanceof Array) && yElement.nodeName === pNode.type.name\n","import { updateYFragment, createNodeFromYElement, yattr2markname, createEmptyMeta } from './plugins/sync-plugin.js' // eslint-disable-line\nimport { ySyncPluginKey } from './plugins/keys.js'\nimport * as Y from '@y/y'\nimport { EditorView } from 'prosemirror-view' // eslint-disable-line\nimport { Node, Schema, Fragment } from 'prosemirror-model' // eslint-disable-line\nimport * as error from 'lib0/error'\nimport * as map from 'lib0/map'\nimport * as eventloop from 'lib0/eventloop'\n\n/**\n * Either a node if type is YXmlElement or an Array of text nodes if YXmlText\n * @typedef {Map>} ProsemirrorMapping\n */\n\n/**\n * Is null if no timeout is in progress.\n * Is defined if a timeout is in progress.\n * Maps from view\n * @type {Map>|null}\n */\nlet viewsToUpdate = null\n\nconst updateMetas = () => {\n const ups = /** @type {Map>} */ (viewsToUpdate)\n viewsToUpdate = null\n ups.forEach((metas, view) => {\n const tr = view.state.tr\n const syncState = ySyncPluginKey.getState(view.state)\n if (syncState && syncState.binding && !syncState.binding.isDestroyed) {\n metas.forEach((val, key) => {\n tr.setMeta(key, val)\n })\n view.dispatch(tr)\n }\n })\n}\n\nexport const setMeta = (view, key, value) => {\n if (!viewsToUpdate) {\n viewsToUpdate = new Map()\n eventloop.timeout(0, updateMetas)\n }\n map.setIfUndefined(viewsToUpdate, view, map.create).set(key, value)\n}\n\n/**\n * Transforms a Prosemirror based absolute position to a Yjs Cursor (relative position in the Yjs model).\n *\n * @param {number} pos\n * @param {Y.XmlFragment} type\n * @param {ProsemirrorMapping} mapping\n * @return {any} relative position\n */\nexport const absolutePositionToRelativePosition = (pos, type, mapping) => {\n if (pos === 0) {\n // if the type is later populated, we want to retain the 0 position (hence assoc=-1)\n return Y.createRelativePositionFromTypeIndex(type, 0, type.length === 0 ? -1 : 0)\n }\n /**\n * @type {any}\n */\n let n = type._first === null ? null : /** @type {Y.ContentType} */ (type._first.content).type\n while (n !== null && type !== n) {\n if (n instanceof Y.XmlText) {\n if (n._length >= pos) {\n return Y.createRelativePositionFromTypeIndex(n, pos, type.length === 0 ? -1 : 0)\n } else {\n pos -= n._length\n }\n if (n._item !== null && n._item.next !== null) {\n n = /** @type {Y.ContentType} */ (n._item.next.content).type\n } else {\n do {\n n = n._item === null ? null : n._item.parent\n pos--\n } while (n !== type && n !== null && n._item !== null && n._item.next === null)\n if (n !== null && n !== type) {\n // @ts-gnore we know that n.next !== null because of above loop conditition\n n = n._item === null ? null : /** @type {Y.ContentType} */ (/** @type Y.Item */ (n._item.next).content).type\n }\n }\n } else {\n const pNodeSize = /** @type {any} */ (mapping.get(n) || { nodeSize: 0 }).nodeSize\n if (n._first !== null && pos < pNodeSize) {\n n = /** @type {Y.ContentType} */ (n._first.content).type\n pos--\n } else {\n if (pos === 1 && n._length === 0 && pNodeSize > 1) {\n // edge case, should end in this paragraph\n return new Y.RelativePosition(n._item === null ? null : n._item.id, n._item === null ? Y.findRootTypeKey(n) : null, null)\n }\n pos -= pNodeSize\n if (n._item !== null && n._item.next !== null) {\n n = /** @type {Y.ContentType} */ (n._item.next.content).type\n } else {\n if (pos === 0) {\n // set to end of n.parent\n n = n._item === null ? n : n._item.parent\n return new Y.RelativePosition(n._item === null ? null : n._item.id, n._item === null ? Y.findRootTypeKey(n) : null, null)\n }\n do {\n n = /** @type {Y.Item} */ (n._item).parent\n pos--\n } while (n !== type && /** @type {Y.Item} */ (n._item).next === null)\n // if n is null at this point, we have an unexpected case\n if (n !== type) {\n // We know that n._item.next is defined because of above loop condition\n n = /** @type {Y.ContentType} */ (/** @type {Y.Item} */ (/** @type {Y.Item} */ (n._item).next).content).type\n }\n }\n }\n }\n if (n === null) {\n throw error.unexpectedCase()\n }\n if (pos === 0 && n.constructor !== Y.XmlText && n !== type) { // TODO: set to <= 0\n return createRelativePosition(n._item.parent, n._item)\n }\n }\n return Y.createRelativePositionFromTypeIndex(type, type._length, type.length === 0 ? -1 : 0)\n}\n\nconst createRelativePosition = (type, item) => {\n let typeid = null\n let tname = null\n if (type._item === null) {\n tname = Y.findRootTypeKey(type)\n } else {\n typeid = Y.createID(type._item.id.client, type._item.id.clock)\n }\n return new Y.RelativePosition(typeid, tname, item.id)\n}\n\n/**\n * @param {Y.Doc} y\n * @param {Y.XmlFragment} documentType Top level type that is bound to pView\n * @param {any} relPos Encoded Yjs based relative position\n * @param {ProsemirrorMapping} mapping\n * @return {null|number}\n */\nexport const relativePositionToAbsolutePosition = (y, documentType, relPos, mapping) => {\n const decodedPos = Y.createAbsolutePositionFromRelativePosition(relPos, y)\n if (decodedPos === null || (decodedPos.type !== documentType && !Y.isParentOf(documentType, decodedPos.type._item))) {\n return null\n }\n let type = decodedPos.type\n let pos = 0\n if (type.constructor === Y.XmlText) {\n pos = decodedPos.index\n } else if (type._item === null || !type._item.deleted) {\n let n = type._first\n let i = 0\n while (i < type._length && i < decodedPos.index && n !== null) {\n if (!n.deleted) {\n const t = /** @type {Y.ContentType} */ (n.content).type\n i++\n if (t instanceof Y.XmlText) {\n pos += t._length\n } else {\n pos += /** @type {any} */ (mapping.get(t)).nodeSize\n }\n }\n n = /** @type {Y.Item} */ (n.right)\n }\n pos += 1 // increase because we go out of n\n }\n while (type !== documentType && type._item !== null) {\n // @ts-ignore\n const parent = type._item.parent\n // @ts-ignore\n if (parent._item === null || !parent._item.deleted) {\n pos += 1 // the start tag\n let n = /** @type {Y.AbstractType} */ (parent)._first\n // now iterate until we found type\n while (n !== null) {\n const contentType = /** @type {Y.ContentType} */ (n.content).type\n if (contentType === type) {\n break\n }\n if (!n.deleted) {\n if (contentType instanceof Y.XmlText) {\n pos += contentType._length\n } else {\n pos += /** @type {any} */ (mapping.get(contentType)).nodeSize\n }\n }\n n = n.right\n }\n }\n type = /** @type {Y.AbstractType} */ (parent)\n }\n return pos - 1 // we don't count the most outer tag, because it is a fragment\n}\n\n/**\n * Utility function for converting an Y.Fragment to a ProseMirror fragment.\n *\n * @param {Y.XmlFragment} yXmlFragment\n * @param {Schema} schema\n */\nexport const yXmlFragmentToProseMirrorFragment = (yXmlFragment, schema) => {\n const fragmentContent = yXmlFragment.toArray().map((t) =>\n createNodeFromYElement(\n /** @type {Y.XmlElement} */ (t),\n schema,\n createEmptyMeta()\n )\n ).filter((n) => n !== null)\n return Fragment.fromArray(fragmentContent)\n}\n\n/**\n * Utility function for converting an Y.Fragment to a ProseMirror node.\n *\n * @param {Y.XmlFragment} yXmlFragment\n * @param {Schema} schema\n */\nexport const yXmlFragmentToProseMirrorRootNode = (yXmlFragment, schema) =>\n schema.topNodeType.create(null, yXmlFragmentToProseMirrorFragment(yXmlFragment, schema))\n\n/**\n * The initial ProseMirror content should be supplied by Yjs. This function transforms a Y.Fragment\n * to a ProseMirror Doc node and creates a mapping that is used by the sync plugin.\n *\n * @param {Y.XmlFragment} yXmlFragment\n * @param {Schema} schema\n *\n * @todo deprecate mapping property\n */\nexport const initProseMirrorDoc = (yXmlFragment, schema) => {\n const meta = createEmptyMeta()\n const fragmentContent = yXmlFragment.toArray().map((t) =>\n createNodeFromYElement(\n /** @type {Y.XmlElement} */ (t),\n schema,\n meta\n )\n ).filter((n) => n !== null)\n const doc = schema.topNodeType.create(null, Fragment.fromArray(fragmentContent))\n return { doc, meta, mapping: meta.mapping }\n}\n\n/**\n * Utility method to convert a Prosemirror Doc Node into a Y.Doc.\n *\n * This can be used when importing existing content to Y.Doc for the first time,\n * note that this should not be used to rehydrate a Y.Doc from a database once\n * collaboration has begun as all history will be lost\n *\n * @param {Node} doc\n * @param {string} xmlFragment\n * @return {Y.Doc}\n */\nexport function prosemirrorToYDoc (doc, xmlFragment = 'prosemirror') {\n const ydoc = new Y.Doc()\n const type = /** @type {Y.XmlFragment} */ (ydoc.get(xmlFragment, Y.XmlFragment))\n if (!type.doc) {\n return ydoc\n }\n\n prosemirrorToYXmlFragment(doc, type)\n return type.doc\n}\n\n/**\n * Utility method to update an empty Y.XmlFragment with content from a Prosemirror Doc Node.\n *\n * This can be used when importing existing content to Y.Doc for the first time,\n * note that this should not be used to rehydrate a Y.Doc from a database once\n * collaboration has begun as all history will be lost\n *\n * Note: The Y.XmlFragment does not need to be part of a Y.Doc document at the time that this\n * method is called, but it must be added before any other operations are performed on it.\n *\n * @param {Node} doc prosemirror document.\n * @param {Y.XmlFragment} [xmlFragment] If supplied, an xml fragment to be\n * populated from the prosemirror state; otherwise a new XmlFragment will be created.\n * @return {Y.XmlFragment}\n */\nexport function prosemirrorToYXmlFragment (doc, xmlFragment) {\n const type = xmlFragment || new Y.XmlFragment()\n const ydoc = type.doc ? type.doc : { transact: (transaction) => transaction(undefined) }\n updateYFragment(ydoc, type, doc, { mapping: new Map(), isOMark: new Map() })\n return type\n}\n\n/**\n * Utility method to convert Prosemirror compatible JSON into a Y.Doc.\n *\n * This can be used when importing existing content to Y.Doc for the first time,\n * note that this should not be used to rehydrate a Y.Doc from a database once\n * collaboration has begun as all history will be lost\n *\n * @param {Schema} schema\n * @param {any} state\n * @param {string} xmlFragment\n * @return {Y.Doc}\n */\nexport function prosemirrorJSONToYDoc (schema, state, xmlFragment = 'prosemirror') {\n const doc = Node.fromJSON(schema, state)\n return prosemirrorToYDoc(doc, xmlFragment)\n}\n\n/**\n * Utility method to convert Prosemirror compatible JSON to a Y.XmlFragment\n *\n * This can be used when importing existing content to Y.Doc for the first time,\n * note that this should not be used to rehydrate a Y.Doc from a database once\n * collaboration has begun as all history will be lost\n *\n * @param {Schema} schema\n * @param {any} state\n * @param {Y.XmlFragment} [xmlFragment] If supplied, an xml fragment to be\n * populated from the prosemirror state; otherwise a new XmlFragment will be created.\n * @return {Y.XmlFragment}\n */\nexport function prosemirrorJSONToYXmlFragment (schema, state, xmlFragment) {\n const doc = Node.fromJSON(schema, state)\n return prosemirrorToYXmlFragment(doc, xmlFragment)\n}\n\n/**\n * @deprecated Use `yXmlFragmentToProseMirrorRootNode` instead\n *\n * Utility method to convert a Y.Doc to a Prosemirror Doc node.\n *\n * @param {Schema} schema\n * @param {Y.Doc} ydoc\n * @return {Node}\n */\nexport function yDocToProsemirror (schema, ydoc) {\n const state = yDocToProsemirrorJSON(ydoc)\n return Node.fromJSON(schema, state)\n}\n\n/**\n *\n * @deprecated Use `yXmlFragmentToProseMirrorRootNode` instead\n *\n * Utility method to convert a Y.XmlFragment to a Prosemirror Doc node.\n *\n * @param {Schema} schema\n * @param {Y.XmlFragment} xmlFragment\n * @return {Node}\n */\nexport function yXmlFragmentToProsemirror (schema, xmlFragment) {\n const state = yXmlFragmentToProsemirrorJSON(xmlFragment)\n return Node.fromJSON(schema, state)\n}\n\n/**\n *\n * @deprecated Use `yXmlFragmentToProseMirrorRootNode` instead\n *\n * Utility method to convert a Y.Doc to Prosemirror compatible JSON.\n *\n * @param {Y.Doc} ydoc\n * @param {string} xmlFragment\n * @return {Record}\n */\nexport function yDocToProsemirrorJSON (\n ydoc,\n xmlFragment = 'prosemirror'\n) {\n return yXmlFragmentToProsemirrorJSON(ydoc.getXmlFragment(xmlFragment))\n}\n\n/**\n * @deprecated Use `yXmlFragmentToProseMirrorRootNode` instead\n *\n * Utility method to convert a Y.Doc to Prosemirror compatible JSON.\n *\n * @param {Y.XmlFragment} xmlFragment The fragment, which must be part of a Y.Doc.\n * @return {Record}\n */\nexport function yXmlFragmentToProsemirrorJSON (xmlFragment) {\n const items = xmlFragment.toArray()\n\n /**\n * @param {Y.AbstractType} item\n */\n const serialize = item => {\n /**\n * @type {Object} NodeObject\n * @property {string} NodeObject.type\n * @property {Record=} NodeObject.attrs\n * @property {Array=} NodeObject.content\n */\n let response\n\n // TODO: Must be a better way to detect text nodes than this\n if (item instanceof Y.XmlText) {\n const delta = item.toDelta()\n response = delta.map(/** @param {any} d */ (d) => {\n const text = {\n type: 'text',\n text: d.insert\n }\n if (d.attributes) {\n text.marks = Object.keys(d.attributes).map((type_) => {\n const attrs = d.attributes[type_]\n const type = yattr2markname(type_)\n const mark = {\n type\n }\n if (Object.keys(attrs)) {\n mark.attrs = attrs\n }\n return mark\n })\n }\n return text\n })\n } else if (item instanceof Y.XmlElement) {\n response = {\n type: item.nodeName\n }\n\n const attrs = item.getAttributes()\n if (Object.keys(attrs).length) {\n response.attrs = attrs\n }\n\n const children = item.toArray()\n if (children.length) {\n response.content = children.map(serialize).flat()\n }\n } else {\n // expected either Y.XmlElement or Y.XmlText\n error.unexpectedCase()\n }\n\n return response\n }\n\n return {\n type: 'doc',\n content: items.map(serialize)\n }\n}\n","import * as Y from '@y/y'\nimport { Decoration, DecorationSet } from \"prosemirror-view\"; // eslint-disable-line\nimport { Plugin } from \"prosemirror-state\"; // eslint-disable-line\nimport { Awareness } from \"@y/protocols/awareness\"; // eslint-disable-line\nimport {\n absolutePositionToRelativePosition,\n relativePositionToAbsolutePosition,\n setMeta\n} from '../lib.js'\nimport { yCursorPluginKey, ySyncPluginKey } from './keys.js'\n\nimport * as math from 'lib0/math'\n\n/**\n * Default awareness state filter\n *\n * @param {number} currentClientId current client id\n * @param {number} userClientId user client id\n * @param {any} _user user data\n * @return {boolean}\n */\nexport const defaultAwarenessStateFilter = (currentClientId, userClientId, _user) => currentClientId !== userClientId\n\n/**\n * Default generator for a cursor element\n *\n * @param {any} user user data\n * @return {HTMLElement}\n */\nexport const defaultCursorBuilder = (user) => {\n const cursor = document.createElement('span')\n cursor.classList.add('ProseMirror-yjs-cursor')\n cursor.setAttribute('style', `border-color: ${user.color}`)\n const userDiv = document.createElement('div')\n userDiv.setAttribute('style', `background-color: ${user.color}`)\n userDiv.insertBefore(document.createTextNode(user.name), null)\n const nonbreakingSpace1 = document.createTextNode('\\u2060')\n const nonbreakingSpace2 = document.createTextNode('\\u2060')\n cursor.insertBefore(nonbreakingSpace1, null)\n cursor.insertBefore(userDiv, null)\n cursor.insertBefore(nonbreakingSpace2, null)\n return cursor\n}\n\n/**\n * Default generator for the selection attributes\n *\n * @param {any} user user data\n * @return {import('prosemirror-view').DecorationAttrs}\n */\nexport const defaultSelectionBuilder = (user) => {\n return {\n style: `background-color: ${user.color}70`,\n class: 'ProseMirror-yjs-selection'\n }\n}\n\nconst rxValidColor = /^#[0-9a-fA-F]{6}$/\n\n/**\n * @param {any} state\n * @param {Awareness} awareness\n * @param {function(number, number, any):boolean} awarenessFilter\n * @param {(user: { name: string, color: string }, clientId: number) => Element} createCursor\n * @param {(user: { name: string, color: string }, clientId: number) => import('prosemirror-view').DecorationAttrs} createSelection\n * @return {any} DecorationSet\n */\nexport const createDecorations = (\n state,\n awareness,\n awarenessFilter,\n createCursor,\n createSelection\n) => {\n const ystate = ySyncPluginKey.getState(state)\n const y = ystate.doc\n const decorations = []\n if (\n ystate.snapshot != null || ystate.prevSnapshot != null ||\n ystate.binding.mapping.size === 0\n ) {\n // do not render cursors while snapshot is active\n return DecorationSet.create(state.doc, [])\n }\n awareness.getStates().forEach((aw, clientId) => {\n if (!awarenessFilter(y.clientID, clientId, aw)) {\n return\n }\n\n if (aw.cursor != null) {\n const user = aw.user || {}\n if (user.color == null) {\n user.color = '#ffa500'\n } else if (!rxValidColor.test(user.color)) {\n // We only support 6-digit RGB colors in y-prosemirror\n console.warn('A user uses an unsupported color format', user)\n }\n if (user.name == null) {\n user.name = `User: ${clientId}`\n }\n let anchor = relativePositionToAbsolutePosition(\n y,\n ystate.type,\n Y.createRelativePositionFromJSON(aw.cursor.anchor),\n ystate.binding.mapping\n )\n let head = relativePositionToAbsolutePosition(\n y,\n ystate.type,\n Y.createRelativePositionFromJSON(aw.cursor.head),\n ystate.binding.mapping\n )\n if (anchor !== null && head !== null) {\n const maxsize = math.max(state.doc.content.size - 1, 0)\n anchor = math.min(anchor, maxsize)\n head = math.min(head, maxsize)\n decorations.push(\n Decoration.widget(head, () => createCursor(user, clientId), {\n key: clientId + '',\n side: 10\n })\n )\n const from = math.min(anchor, head)\n const to = math.max(anchor, head)\n decorations.push(\n Decoration.inline(from, to, createSelection(user, clientId), {\n inclusiveEnd: true,\n inclusiveStart: false\n })\n )\n }\n }\n })\n return DecorationSet.create(state.doc, decorations)\n}\n\n/**\n * A prosemirror plugin that listens to awareness information on Yjs.\n * This requires that a `prosemirrorPlugin` is also bound to the prosemirror.\n *\n * @public\n * @param {Awareness} awareness\n * @param {object} opts\n * @param {function(any, any, any):boolean} [opts.awarenessStateFilter]\n * @param {(user: any, clientId: number) => HTMLElement} [opts.cursorBuilder]\n * @param {(user: any, clientId: number) => import('prosemirror-view').DecorationAttrs} [opts.selectionBuilder]\n * @param {function(any):any} [opts.getSelection]\n * @param {string} [cursorStateField] By default all editor bindings use the awareness 'cursor' field to propagate cursor information.\n * @return {any}\n */\nexport const yCursorPlugin = (\n awareness,\n {\n awarenessStateFilter = defaultAwarenessStateFilter,\n cursorBuilder = defaultCursorBuilder,\n selectionBuilder = defaultSelectionBuilder,\n getSelection = (state) => state.selection\n } = {},\n cursorStateField = 'cursor'\n) =>\n new Plugin({\n key: yCursorPluginKey,\n state: {\n init (_, state) {\n return createDecorations(\n state,\n awareness,\n awarenessStateFilter,\n cursorBuilder,\n selectionBuilder\n )\n },\n apply (tr, prevState, _oldState, newState) {\n const ystate = ySyncPluginKey.getState(newState)\n const yCursorState = tr.getMeta(yCursorPluginKey)\n if (\n (ystate && ystate.isChangeOrigin) ||\n (yCursorState && yCursorState.awarenessUpdated)\n ) {\n return createDecorations(\n newState,\n awareness,\n awarenessStateFilter,\n cursorBuilder,\n selectionBuilder\n )\n }\n return prevState.map(tr.mapping, tr.doc)\n }\n },\n props: {\n decorations: (state) => {\n return yCursorPluginKey.getState(state)\n }\n },\n view: (view) => {\n const awarenessListener = () => {\n // @ts-ignore\n if (view.docView) {\n setMeta(view, yCursorPluginKey, { awarenessUpdated: true })\n }\n }\n const updateCursorInfo = () => {\n const ystate = ySyncPluginKey.getState(view.state)\n // @note We make implicit checks when checking for the cursor property\n const current = awareness.getLocalState() || {}\n if (view.hasFocus()) {\n const selection = getSelection(view.state)\n /**\n * @type {Y.RelativePosition}\n */\n const anchor = absolutePositionToRelativePosition(\n selection.anchor,\n ystate.type,\n ystate.binding.mapping\n )\n /**\n * @type {Y.RelativePosition}\n */\n const head = absolutePositionToRelativePosition(\n selection.head,\n ystate.type,\n ystate.binding.mapping\n )\n if (\n current.cursor == null ||\n !Y.compareRelativePositions(\n Y.createRelativePositionFromJSON(current.cursor.anchor),\n anchor\n ) ||\n !Y.compareRelativePositions(\n Y.createRelativePositionFromJSON(current.cursor.head),\n head\n )\n ) {\n awareness.setLocalStateField(cursorStateField, {\n anchor,\n head\n })\n }\n } else if (\n current.cursor != null &&\n relativePositionToAbsolutePosition(\n ystate.doc,\n ystate.type,\n Y.createRelativePositionFromJSON(current.cursor.anchor),\n ystate.binding.mapping\n ) !== null\n ) {\n // delete cursor information if current cursor information is owned by this editor binding\n awareness.setLocalStateField(cursorStateField, null)\n }\n }\n awareness.on('change', awarenessListener)\n view.dom.addEventListener('focusin', updateCursorInfo)\n view.dom.addEventListener('focusout', updateCursorInfo)\n return {\n update: updateCursorInfo,\n destroy: () => {\n view.dom.removeEventListener('focusin', updateCursorInfo)\n view.dom.removeEventListener('focusout', updateCursorInfo)\n awareness.off('change', awarenessListener)\n awareness.setLocalStateField(cursorStateField, null)\n }\n }\n }\n })\n","import { Plugin } from 'prosemirror-state'\n\nimport { getRelativeSelection } from './sync-plugin.js'\nimport { UndoManager, Item, ContentType, XmlElement, Text } from '@y/y'\nimport { yUndoPluginKey, ySyncPluginKey } from './keys.js'\n\n/**\n * @typedef {Object} UndoPluginState\n * @property {import('@y/y').UndoManager} undoManager\n * @property {ReturnType | null} prevSel\n * @property {boolean} hasUndoOps\n * @property {boolean} hasRedoOps\n */\n\n/**\n * Undo the last user action\n *\n * @param {import('prosemirror-state').EditorState} state\n * @return {boolean} whether a change was undone\n */\nexport const undo = state => yUndoPluginKey.getState(state)?.undoManager?.undo() != null\n\n/**\n * Redo the last user action\n *\n * @param {import('prosemirror-state').EditorState} state\n * @return {boolean} whether a change was undone\n */\nexport const redo = state => yUndoPluginKey.getState(state)?.undoManager?.redo() != null\n\n/**\n * Undo the last user action if there are undo operations available\n * @type {import('prosemirror-state').Command}\n */\nexport const undoCommand = (state, dispatch) => dispatch == null ? yUndoPluginKey.getState(state)?.undoManager?.canUndo() : undo(state)\n\n/**\n * Redo the last user action if there are redo operations available\n * @type {import('prosemirror-state').Command}\n */\nexport const redoCommand = (state, dispatch) => dispatch == null ? yUndoPluginKey.getState(state)?.undoManager?.canRedo() : redo(state)\n\nexport const defaultProtectedNodes = new Set(['paragraph'])\n\n/**\n * @param {import('@y/y').Item} item\n * @param {Set} protectedNodes\n * @returns {boolean}\n */\nexport const defaultDeleteFilter = (item, protectedNodes) => !(item instanceof Item) ||\n !(item.content instanceof ContentType) ||\n !(item.content.type instanceof Text ||\n (item.content.type instanceof XmlElement && protectedNodes.has(item.content.type.nodeName))) ||\n item.content.type._length === 0\n\n/**\n * @param {object} [options]\n * @param {Set} [options.protectedNodes]\n * @param {any[]} [options.trackedOrigins]\n * @param {import('@y/y').UndoManager | null} [options.undoManager]\n */\nexport const yUndoPlugin = ({ protectedNodes = defaultProtectedNodes, trackedOrigins = [], undoManager = null } = {}) => new Plugin({\n key: yUndoPluginKey,\n state: {\n init: (initargs, state) => {\n // TODO: check if plugin order matches and fix\n const ystate = ySyncPluginKey.getState(state)\n const _undoManager = undoManager || new UndoManager(ystate.type, {\n trackedOrigins: new Set([ySyncPluginKey].concat(trackedOrigins)),\n deleteFilter: (item) => defaultDeleteFilter(item, protectedNodes),\n captureTransaction: tr => tr.meta.get('addToHistory') !== false\n })\n return {\n undoManager: _undoManager,\n prevSel: null,\n hasUndoOps: _undoManager.undoStack.length > 0,\n hasRedoOps: _undoManager.redoStack.length > 0\n }\n },\n apply: (tr, val, oldState, state) => {\n const binding = ySyncPluginKey.getState(state).binding\n const undoManager = val.undoManager\n const hasUndoOps = undoManager.undoStack.length > 0\n const hasRedoOps = undoManager.redoStack.length > 0\n if (binding) {\n return {\n undoManager,\n prevSel: getRelativeSelection(binding, oldState),\n hasUndoOps,\n hasRedoOps\n }\n } else {\n if (hasUndoOps !== val.hasUndoOps || hasRedoOps !== val.hasRedoOps) {\n return Object.assign({}, val, {\n hasUndoOps: undoManager.undoStack.length > 0,\n hasRedoOps: undoManager.redoStack.length > 0\n })\n } else { // nothing changed\n return val\n }\n }\n }\n },\n view: view => {\n const ystate = ySyncPluginKey.getState(view.state)\n const undoManager = yUndoPluginKey.getState(view.state).undoManager\n undoManager.on('stack-item-added', ({ stackItem }) => {\n const binding = ystate.binding\n if (binding) {\n stackItem.meta.set(binding, yUndoPluginKey.getState(view.state).prevSel)\n }\n })\n undoManager.on('stack-item-popped', ({ stackItem }) => {\n const binding = ystate.binding\n if (binding) {\n binding.beforeTransactionSelection = stackItem.meta.get(binding) || binding.beforeTransactionSelection\n }\n })\n return {\n destroy: () => {\n undoManager.destroy()\n }\n }\n }\n})\n"],"names":["PluginKey","buf","sha256","set","random","Plugin","eventloop","AllSelection","NodeSelection","TextSelection","createMutex","environment","dom","Y","PModel","math","error","object","simpleDiff","map","utils.hashOfJSON","Fragment","Node","DecorationSet","Decoration","Item","ContentType","Text","XmlElement","UndoManager"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,cAAc,GAAG,IAAIA,0BAAS,CAAC,QAAQ;;AAEpD;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,cAAc,GAAG,IAAIA,0BAAS,CAAC,QAAQ;;AAEpD;AACA;AACA;AACA;AACA;AACY,MAAC,gBAAgB,GAAG,IAAIA,0BAAS,CAAC,YAAY;;ACpB1D;AACA;AACA;AACA;AACA;AACA,MAAM,UAAU,GAAG,MAAM,IAAI;AAC7B,EAAE,MAAM,CAAC,GAAG;AACZ,EAAE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAC1C,IAAI,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC;AAC5C,EAAE;AACF,EAAE,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;AAC1B;;AAEA;AACA;AACA;AACO,MAAM,UAAU,GAAG,CAAC,IAAI,KAAKC,cAAG,CAAC,QAAQ,CAAC,UAAU,CAACC,iBAAM,CAAC,MAAM,CAACD,cAAG,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;;ACnB/F;AACA;AACA;;;AAuBA;AAC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AQ,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO;AAC/E,MAAM;AACN,IAAI,CAAC;AACL,IAAI,WAAW,CAAC,EAAE,CAAC,mBAAmB,EAAE,CAAC,EAAE,SAAS,EAAE,KAAK;AAC3D,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC;AAC7B,MAAM,IAAI,OAAO,EAAE;AACnB,QAAQ,OAAO,CAAC,0BAA0B,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC;AACpF,MAAM;AACN,IAAI,CAAC;AACL,IAAI,OAAO;AACX,MAAM,OAAO,EAAE,MAAM;AACrB,QAAQ,WAAW,CAAC,OAAO;AAC3B,MAAM;AACN;AACA,EAAE;AACF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
+\ No newline at end of file
++{"version":3,"file":"y-prosemirror.cjs","sources":["../src/plugins/keys.js","../src/utils.js","../src/plugins/sync-plugin.js","../src/lib.js","../src/plugins/cursor-plugin.js","../src/plugins/undo-plugin.js","../src/index.js"],"sourcesContent":["import { PluginKey } from 'prosemirror-state' // eslint-disable-line\n\n/**\n * The unique prosemirror plugin key for syncPlugin\n *\n * @public\n * @type {PluginKey<{ytype: Y.XmlFragment; diff?: import('../index.js').ProsemirrorDelta}>}\n */\nexport const ySyncPluginKey = new PluginKey('y-sync')\n\n/**\n * The unique prosemirror plugin key for undoPlugin\n *\n * @public\n * @type {PluginKey}\n */\nexport const yUndoPluginKey = new PluginKey('y-undo')\n\n/**\n * The unique prosemirror plugin key for cursorPlugin\n *\n * @public\n */\nexport const yCursorPluginKey = new PluginKey('yjs-cursor')\n","import * as sha256 from 'lib0/hash/sha256'\nimport * as buf from 'lib0/buffer'\n\n/**\n * Custom function to transform sha256 hash to N byte\n *\n * @param {Uint8Array} digest\n */\nconst _convolute = digest => {\n const N = 6\n for (let i = N; i < digest.length; i++) {\n digest[i % N] = digest[i % N] ^ digest[i]\n }\n return digest.slice(0, N)\n}\n\n/**\n * @param {any} json\n */\nexport const hashOfJSON = (json) => buf.toBase64(_convolute(sha256.digest(buf.encodeAny(json))))\n","/**\n * @module bindings/prosemirror\n */\n\nimport { createMutex } from 'lib0/mutex'\nimport * as PModel from 'prosemirror-model'\nimport { AllSelection, Plugin, TextSelection, NodeSelection } from \"prosemirror-state\"; // eslint-disable-line\nimport * as math from 'lib0/math'\nimport * as object from 'lib0/object'\nimport * as set from 'lib0/set'\nimport { simpleDiff } from 'lib0/diff'\nimport * as error from 'lib0/error'\nimport { ySyncPluginKey, yUndoPluginKey } from './keys.js'\nimport * as Y from '@y/y'\nimport {\n absolutePositionToRelativePosition,\n relativePositionToAbsolutePosition\n} from '../lib.js'\nimport * as random from 'lib0/random'\nimport * as environment from 'lib0/environment'\nimport * as dom from 'lib0/dom'\nimport * as eventloop from 'lib0/eventloop'\nimport * as map from 'lib0/map'\nimport * as utils from '../utils.js'\n\n/**\n * @typedef {Object} BindingMetadata\n * @property {ProsemirrorMapping} BindingMetadata.mapping\n * @property {Map} BindingMetadata.isOMark - is overlapping mark\n */\n\n/**\n * @return {BindingMetadata}\n */\nexport const createEmptyMeta = () => ({\n mapping: new Map(),\n isOMark: new Map()\n})\n\n/**\n * @param {Y.Item} item\n * @param {Y.Snapshot} [snapshot]\n */\nexport const isVisible = (item, snapshot) =>\n snapshot === undefined\n ? !item.deleted\n : (snapshot.sv.has(item.id.client) && /** @type {number} */\n (snapshot.sv.get(item.id.client)) > item.id.clock &&\n !snapshot.ds.hasId(item.id))\n\n/**\n * Either a node if type is YXmlElement or an Array of text nodes if YXmlText\n * @typedef {Map, PModel.Node | Array>} ProsemirrorMapping\n */\n\n/**\n * @typedef {Object} ColorDef\n * @property {string} ColorDef.light\n * @property {string} ColorDef.dark\n */\n\n/**\n * @typedef {Object} YSyncOpts\n * @property {Array} [YSyncOpts.colors]\n * @property {Map} [YSyncOpts.colorMapping]\n * @property {Y.PermanentUserData|null} [YSyncOpts.permanentUserData]\n * @property {ProsemirrorMapping} [YSyncOpts.mapping]\n * @property {function} [YSyncOpts.onFirstRender] Fired when the content from Yjs is initially rendered to ProseMirror\n */\n\n/**\n * @type {Array}\n */\nconst defaultColors = [{ light: '#ecd44433', dark: '#ecd444' }]\n\n/**\n * @param {Map} colorMapping\n * @param {Array} colors\n * @param {string} user\n * @return {ColorDef}\n */\nconst getUserColor = (colorMapping, colors, user) => {\n // @todo do not hit the same color twice if possible\n if (!colorMapping.has(user)) {\n if (colorMapping.size < colors.length) {\n const usedColors = set.create()\n colorMapping.forEach((color) => usedColors.add(color))\n colors = colors.filter((color) => !usedColors.has(color))\n }\n colorMapping.set(user, random.oneOf(colors))\n }\n return /** @type {ColorDef} */ (colorMapping.get(user))\n}\n\n/**\n * This plugin listens to changes in prosemirror view and keeps yXmlState and view in sync.\n *\n * This plugin also keeps references to the type and the shared document so other plugins can access it.\n * @param {Y.XmlFragment} yXmlFragment\n * @param {YSyncOpts} opts\n * @return {any} Returns a prosemirror plugin that binds to this type\n */\nexport const ySyncPlugin = (yXmlFragment, {\n colors = defaultColors,\n colorMapping = new Map(),\n permanentUserData = null,\n onFirstRender = () => {},\n mapping\n} = {}) => {\n let initialContentChanged = false\n const binding = new ProsemirrorBinding(yXmlFragment, mapping)\n const plugin = new Plugin({\n props: {\n editable: (state) => {\n const syncState = ySyncPluginKey.getState(state)\n return syncState.snapshot == null && syncState.prevSnapshot == null\n }\n },\n key: ySyncPluginKey,\n state: {\n /**\n * @returns {any}\n */\n init: (_initargs, _state) => {\n return {\n type: yXmlFragment,\n doc: yXmlFragment.doc,\n binding,\n snapshot: null,\n prevSnapshot: null,\n isChangeOrigin: false,\n isUndoRedoOperation: false,\n addToHistory: true,\n colors,\n colorMapping,\n permanentUserData\n }\n },\n apply: (tr, pluginState) => {\n const change = tr.getMeta(ySyncPluginKey)\n if (change !== undefined) {\n pluginState = Object.assign({}, pluginState)\n for (const key in change) {\n pluginState[key] = change[key]\n }\n }\n pluginState.addToHistory = tr.getMeta('addToHistory') !== false\n // always set isChangeOrigin. If undefined, this is not change origin.\n pluginState.isChangeOrigin = change !== undefined &&\n !!change.isChangeOrigin\n pluginState.isUndoRedoOperation = change !== undefined && !!change.isChangeOrigin && !!change.isUndoRedoOperation\n if (binding.prosemirrorView !== null) {\n if (\n change !== undefined &&\n (change.snapshot != null || change.prevSnapshot != null)\n ) {\n // snapshot changed, rerender next\n eventloop.timeout(0, () => {\n if (binding.prosemirrorView == null) {\n return\n }\n if (change.restore == null) {\n binding._renderSnapshot(\n change.snapshot,\n change.prevSnapshot,\n pluginState\n )\n } else {\n binding._renderSnapshot(\n change.snapshot,\n change.snapshot,\n pluginState\n )\n // reset to current prosemirror state\n delete pluginState.restore\n delete pluginState.snapshot\n delete pluginState.prevSnapshot\n binding.mux(() => {\n binding._prosemirrorChanged(\n binding.prosemirrorView.state.doc\n )\n })\n }\n })\n }\n }\n return pluginState\n }\n },\n view: (view) => {\n binding.initView(view)\n if (mapping == null) {\n // force rerender to update the bindings mapping\n binding._forceRerender()\n }\n onFirstRender()\n return {\n update: () => {\n const pluginState = plugin.getState(view.state)\n if (\n pluginState.snapshot == null && pluginState.prevSnapshot == null\n ) {\n if (\n // If the content doesn't change initially, we don't render anything to Yjs\n // If the content was cleared by a user action, we want to catch the change and\n // represent it in Yjs\n initialContentChanged ||\n view.state.doc.content.findDiffStart(\n view.state.doc.type.createAndFill().content\n ) !== null\n ) {\n initialContentChanged = true\n if (\n pluginState.addToHistory === false &&\n !pluginState.isChangeOrigin\n ) {\n const yUndoPluginState = yUndoPluginKey.getState(view.state)\n /**\n * @type {Y.UndoManager}\n */\n const um = yUndoPluginState && yUndoPluginState.undoManager\n if (um) {\n um.stopCapturing()\n }\n }\n binding.mux(() => {\n /** @type {Y.Doc} */ (pluginState.doc).transact((tr) => {\n tr.meta.set('addToHistory', pluginState.addToHistory)\n binding._prosemirrorChanged(view.state.doc)\n }, ySyncPluginKey)\n })\n }\n }\n },\n destroy: () => {\n binding.destroy()\n }\n }\n }\n })\n return plugin\n}\n\n/**\n * @param {import('prosemirror-state').Transaction} tr\n * @param {ReturnType} relSel\n * @param {ProsemirrorBinding} binding\n */\nconst restoreRelativeSelection = (tr, relSel, binding) => {\n if (relSel !== null && relSel.anchor !== null && relSel.head !== null) {\n if (relSel.type === 'all') {\n tr.setSelection(new AllSelection(tr.doc))\n } else if (relSel.type === 'node') {\n const anchor = relativePositionToAbsolutePosition(\n binding.doc,\n binding.type,\n relSel.anchor,\n binding.mapping\n )\n tr.setSelection(NodeSelection.create(tr.doc, anchor))\n } else {\n const anchor = relativePositionToAbsolutePosition(\n binding.doc,\n binding.type,\n relSel.anchor,\n binding.mapping\n )\n const head = relativePositionToAbsolutePosition(\n binding.doc,\n binding.type,\n relSel.head,\n binding.mapping\n )\n if (anchor !== null && head !== null) {\n const sel = TextSelection.between(tr.doc.resolve(anchor), tr.doc.resolve(head))\n tr.setSelection(sel)\n }\n }\n }\n}\n\n/**\n * @param {ProsemirrorBinding} pmbinding\n * @param {import('prosemirror-state').EditorState} state\n */\nexport const getRelativeSelection = (pmbinding, state) => ({\n type: /** @type {any} */ (state.selection).jsonID,\n anchor: absolutePositionToRelativePosition(\n state.selection.anchor,\n pmbinding.type,\n pmbinding.mapping\n ),\n head: absolutePositionToRelativePosition(\n state.selection.head,\n pmbinding.type,\n pmbinding.mapping\n )\n})\n\n/**\n * Binding for prosemirror.\n *\n * @protected\n */\nexport class ProsemirrorBinding {\n /**\n * @param {Y.XmlFragment} yXmlFragment The bind source\n * @param {ProsemirrorMapping} mapping\n */\n constructor (yXmlFragment, mapping = new Map()) {\n this.type = yXmlFragment\n /**\n * this will be set once the view is created\n * @type {any}\n */\n this.prosemirrorView = null\n this.mux = createMutex()\n this.mapping = mapping\n /**\n * Is overlapping mark - i.e. mark does not exclude itself.\n *\n * @type {Map}\n */\n this.isOMark = new Map()\n this._observeFunction = this._typeChanged.bind(this)\n /**\n * @type {Y.Doc}\n */\n // @ts-ignore\n this.doc = yXmlFragment.doc\n /**\n * current selection as relative positions in the Yjs model\n */\n this.beforeTransactionSelection = null\n this.beforeAllTransactions = () => {\n if (this.beforeTransactionSelection === null && this.prosemirrorView != null) {\n this.beforeTransactionSelection = getRelativeSelection(\n this,\n this.prosemirrorView.state\n )\n }\n }\n this.afterAllTransactions = () => {\n this.beforeTransactionSelection = null\n }\n this._domSelectionInView = null\n }\n\n /**\n * Create a transaction for changing the prosemirror state.\n *\n * @returns\n */\n get _tr () {\n return this.prosemirrorView.state.tr.setMeta('addToHistory', false)\n }\n\n _isLocalCursorInView () {\n if (!this.prosemirrorView.hasFocus()) return false\n if (environment.isBrowser && this._domSelectionInView === null) {\n // Calculate the domSelectionInView and clear by next tick after all events are finished\n eventloop.timeout(0, () => {\n this._domSelectionInView = null\n })\n this._domSelectionInView = this._isDomSelectionInView()\n }\n return this._domSelectionInView\n }\n\n _isDomSelectionInView () {\n const selection = this.prosemirrorView._root.getSelection()\n\n if (selection == null || selection.anchorNode == null) return false\n\n const range = this.prosemirrorView._root.createRange()\n range.setStart(selection.anchorNode, selection.anchorOffset)\n range.setEnd(selection.focusNode, selection.focusOffset)\n\n // This is a workaround for an edgecase where getBoundingClientRect will\n // return zero values if the selection is collapsed at the start of a newline\n // see reference here: https://stackoverflow.com/a/59780954\n const rects = range.getClientRects()\n if (rects.length === 0) {\n // probably buggy newline behavior, explicitly select the node contents\n if (range.startContainer && range.collapsed) {\n range.selectNodeContents(range.startContainer)\n }\n }\n\n const bounding = range.getBoundingClientRect()\n const documentElement = dom.doc.documentElement\n\n return bounding.bottom >= 0 && bounding.right >= 0 &&\n bounding.left <=\n (window.innerWidth || documentElement.clientWidth || 0) &&\n bounding.top <= (window.innerHeight || documentElement.clientHeight || 0)\n }\n\n /**\n * @param {Y.Snapshot} snapshot\n * @param {Y.Snapshot} prevSnapshot\n */\n renderSnapshot (snapshot, prevSnapshot) {\n if (!prevSnapshot) {\n prevSnapshot = Y.createSnapshot(Y.createIdSet(), new Map())\n }\n this.prosemirrorView.dispatch(\n this._tr.setMeta(ySyncPluginKey, { snapshot, prevSnapshot })\n )\n }\n\n unrenderSnapshot () {\n this.mapping.clear()\n this.mux(() => {\n const fragmentContent = this.type.toArray().map((t) =>\n createNodeFromYElement(\n /** @type {Y.XmlElement} */ (t),\n this.prosemirrorView.state.schema,\n this\n )\n ).filter((n) => n !== null)\n // @ts-ignore\n const tr = this._tr.replace(\n 0,\n this.prosemirrorView.state.doc.content.size,\n new PModel.Slice(PModel.Fragment.from(fragmentContent), 0, 0)\n )\n tr.setMeta(ySyncPluginKey, { snapshot: null, prevSnapshot: null })\n this.prosemirrorView.dispatch(tr)\n })\n }\n\n _forceRerender () {\n this.mapping.clear()\n this.mux(() => {\n // If this is a forced rerender, this might neither happen as a pm change nor within a Yjs\n // transaction. Then the \"before selection\" doesn't exist. In this case, we need to create a\n // relative position before replacing content. Fixes #126\n const sel = this.beforeTransactionSelection !== null ? null : this.prosemirrorView.state.selection\n const fragmentContent = this.type.toArray().map((t) =>\n createNodeFromYElement(\n /** @type {Y.XmlElement} */ (t),\n this.prosemirrorView.state.schema,\n this\n )\n ).filter((n) => n !== null)\n // @ts-ignore\n const tr = this._tr.replace(\n 0,\n this.prosemirrorView.state.doc.content.size,\n new PModel.Slice(PModel.Fragment.from(fragmentContent), 0, 0)\n )\n if (sel) {\n /**\n * If the Prosemirror document we just created from this.type is\n * smaller than the previous document, the selection might be\n * out of bound, which would make Prosemirror throw an error.\n */\n const clampedAnchor = math.min(math.max(sel.anchor, 0), tr.doc.content.size)\n const clampedHead = math.min(math.max(sel.head, 0), tr.doc.content.size)\n\n tr.setSelection(TextSelection.create(tr.doc, clampedAnchor, clampedHead))\n }\n this.prosemirrorView.dispatch(\n tr.setMeta(ySyncPluginKey, { isChangeOrigin: true, binding: this })\n )\n })\n }\n\n /**\n * @param {Y.Snapshot|Uint8Array} snapshot\n * @param {Y.Snapshot|Uint8Array} prevSnapshot\n * @param {Object} pluginState\n */\n _renderSnapshot (snapshot, prevSnapshot, pluginState) {\n /**\n * The document that contains the full history of this document.\n * @type {Y.Doc}\n */\n let historyDoc = this.doc\n let historyType = this.type\n if (!snapshot) {\n snapshot = Y.snapshot(this.doc)\n }\n if (snapshot instanceof Uint8Array || prevSnapshot instanceof Uint8Array) {\n if (!(snapshot instanceof Uint8Array) || !(prevSnapshot instanceof Uint8Array)) {\n // expected both snapshots to be v2 updates\n error.unexpectedCase()\n }\n historyDoc = new Y.Doc({ gc: false })\n Y.applyUpdateV2(historyDoc, prevSnapshot)\n prevSnapshot = Y.snapshot(historyDoc)\n Y.applyUpdateV2(historyDoc, snapshot)\n snapshot = Y.snapshot(historyDoc)\n if (historyType._item === null) {\n /**\n * If is a root type, we need to find the root key in the initial document\n * and use it to get the history type.\n */\n const rootKey = Array.from(this.doc.share.keys()).find(\n (key) => this.doc.share.get(key) === this.type\n )\n historyType = historyDoc.getXmlFragment(rootKey)\n } else {\n /**\n * If it is a sub type, we use the item id to find the history type.\n */\n const historyStructs =\n historyDoc.store.clients.get(historyType._item.id.client) ?? []\n const itemIndex = Y.findIndexSS(\n historyStructs,\n historyType._item.id.clock\n )\n const item = /** @type {Y.Item} */ (historyStructs[itemIndex])\n const content = /** @type {Y.ContentType} */ (item.content)\n historyType = /** @type {Y.XmlFragment} */ (content.type)\n }\n }\n // clear mapping because we are going to rerender\n this.mapping.clear()\n this.mux(() => {\n historyDoc.transact((transaction) => {\n // before rendering, we are going to sanitize ops and split deleted ops\n // if they were deleted by seperate users.\n /**\n * @type {Y.PermanentUserData}\n */\n const pud = pluginState.permanentUserData\n if (pud) {\n pud.dss.forEach((ds) => {\n Y.iterateStructsByIdSet(transaction, ds, (_item) => {})\n })\n }\n /**\n * @param {'removed'|'added'} type\n * @param {Y.ID} id\n */\n const computeYChange = (type, id) => {\n const user = type === 'added'\n ? pud.getUserByClientId(id.client)\n : pud.getUserByDeletedId(id)\n return {\n user,\n type,\n color: getUserColor(\n pluginState.colorMapping,\n pluginState.colors,\n user\n )\n }\n }\n // Create document fragment and render\n const fragmentContent = Y.typeListToArraySnapshot(\n historyType,\n new Y.Snapshot(prevSnapshot.ds, snapshot.sv)\n ).map((t) => {\n if (\n !t._item.deleted || isVisible(t._item, snapshot) ||\n isVisible(t._item, prevSnapshot)\n ) {\n return createNodeFromYElement(\n t,\n this.prosemirrorView.state.schema,\n { mapping: new Map(), isOMark: new Map() },\n snapshot,\n prevSnapshot,\n computeYChange\n )\n } else {\n // No need to render elements that are not visible by either snapshot.\n // If a client adds and deletes content in the same snapshot the element is not visible by either snapshot.\n return null\n }\n }).filter((n) => n !== null)\n // @ts-ignore\n const tr = this._tr.replace(\n 0,\n this.prosemirrorView.state.doc.content.size,\n new PModel.Slice(PModel.Fragment.from(fragmentContent), 0, 0)\n )\n this.prosemirrorView.dispatch(\n tr.setMeta(ySyncPluginKey, { isChangeOrigin: true })\n )\n }, ySyncPluginKey)\n })\n }\n\n /**\n * @param {Array>} events\n * @param {Y.Transaction} transaction\n */\n _typeChanged (events, transaction) {\n if (this.prosemirrorView == null) return\n const syncState = ySyncPluginKey.getState(this.prosemirrorView.state)\n if (\n events.length === 0 || syncState.snapshot != null ||\n syncState.prevSnapshot != null\n ) {\n // drop out if snapshot is active\n this.renderSnapshot(syncState.snapshot, syncState.prevSnapshot)\n return\n }\n this.mux(() => {\n /**\n * @param {any} _\n * @param {Y.AbstractType} type\n */\n const delType = (_, type) => this.mapping.delete(type)\n Y.iterateStructsByIdSet(\n transaction,\n transaction.deleteSet,\n (struct) => {\n if (struct.constructor === Y.Item) {\n const type = /** @type {Y.ContentType} */ (/** @type {Y.Item} */ (struct).content).type\n type && this.mapping.delete(type)\n }\n }\n )\n transaction.changed.forEach(delType)\n transaction.changedParentTypes.forEach(delType)\n const fragmentContent = this.type.toArray().map((t) =>\n createNodeIfNotExists(\n /** @type {Y.XmlElement | Y.XmlHook} */ (t),\n this.prosemirrorView.state.schema,\n this\n )\n ).filter((n) => n !== null)\n // @ts-ignore\n let tr = this._tr.replace(\n 0,\n this.prosemirrorView.state.doc.content.size,\n new PModel.Slice(PModel.Fragment.from(fragmentContent), 0, 0)\n )\n restoreRelativeSelection(tr, this.beforeTransactionSelection, this)\n tr = tr.setMeta(ySyncPluginKey, { isChangeOrigin: true, isUndoRedoOperation: transaction.origin instanceof Y.UndoManager })\n if (\n this.beforeTransactionSelection !== null && this._isLocalCursorInView()\n ) {\n tr.scrollIntoView()\n }\n this.prosemirrorView.dispatch(tr)\n })\n }\n\n /**\n * @param {import('prosemirror-model').Node} doc\n */\n _prosemirrorChanged (doc) {\n this.doc.transact(() => {\n updateYFragment(this.doc, this.type, doc, this)\n this.beforeTransactionSelection = getRelativeSelection(\n this,\n this.prosemirrorView.state\n )\n }, ySyncPluginKey)\n }\n\n /**\n * View is ready to listen to changes. Register observers.\n * @param {any} prosemirrorView\n */\n initView (prosemirrorView) {\n if (this.prosemirrorView != null) this.destroy()\n this.prosemirrorView = prosemirrorView\n this.doc.on('beforeAllTransactions', this.beforeAllTransactions)\n this.doc.on('afterAllTransactions', this.afterAllTransactions)\n this.type.observeDeep(this._observeFunction)\n }\n\n destroy () {\n if (this.prosemirrorView == null) return\n this.prosemirrorView = null\n this.type.unobserveDeep(this._observeFunction)\n this.doc.off('beforeAllTransactions', this.beforeAllTransactions)\n this.doc.off('afterAllTransactions', this.afterAllTransactions)\n }\n}\n\n/**\n * @private\n * @param {Y.XmlElement | Y.XmlHook} el\n * @param {PModel.Schema} schema\n * @param {BindingMetadata} meta\n * @param {Y.Snapshot} [snapshot]\n * @param {Y.Snapshot} [prevSnapshot]\n * @param {function('removed' | 'added', Y.ID):any} [computeYChange]\n * @return {PModel.Node | null}\n */\nconst createNodeIfNotExists = (\n el,\n schema,\n meta,\n snapshot,\n prevSnapshot,\n computeYChange\n) => {\n const node = /** @type {PModel.Node} */ (meta.mapping.get(el))\n if (node === undefined) {\n if (el instanceof Y.XmlElement) {\n return createNodeFromYElement(\n el,\n schema,\n meta,\n snapshot,\n prevSnapshot,\n computeYChange\n )\n } else {\n throw error.methodUnimplemented() // we are currently not handling hooks\n }\n }\n return node\n}\n\n/**\n * @private\n * @param {Y.XmlElement} el\n * @param {any} schema\n * @param {BindingMetadata} meta\n * @param {Y.Snapshot} [snapshot]\n * @param {Y.Snapshot} [prevSnapshot]\n * @param {function('removed' | 'added', Y.ID):any} [computeYChange]\n * @return {PModel.Node | null} Returns node if node could be created. Otherwise it deletes the yjs type and returns null\n */\nexport const createNodeFromYElement = (\n el,\n schema,\n meta,\n snapshot,\n prevSnapshot,\n computeYChange\n) => {\n const children = []\n /**\n * @param {Y.XmlElement | Y.XmlText} type\n */\n const createChildren = (type) => {\n if (type instanceof Y.XmlElement) {\n const n = createNodeIfNotExists(\n type,\n schema,\n meta,\n snapshot,\n prevSnapshot,\n computeYChange\n )\n if (n !== null) {\n children.push(n)\n }\n } else {\n // If the next ytext exists and was created by us, move the content to the current ytext.\n // This is a fix for #160 -- duplication of characters when two Y.Text exist next to each\n // other.\n const nextytext = /** @type {Y.ContentType} */ (type._item.right?.content)?.type\n if (nextytext instanceof Y.Text && !nextytext._item.deleted && nextytext._item.id.client === nextytext.doc.clientID) {\n type.applyDelta([\n { retain: type.length },\n ...nextytext.toDelta()\n ])\n nextytext.doc.transact(tr => {\n nextytext._item.delete(tr)\n })\n }\n // now create the prosemirror text nodes\n const ns = createTextNodesFromYText(\n type,\n schema,\n meta,\n snapshot,\n prevSnapshot,\n computeYChange\n )\n if (ns !== null) {\n ns.forEach((textchild) => {\n if (textchild !== null) {\n children.push(textchild)\n }\n })\n }\n }\n }\n if (snapshot === undefined || prevSnapshot === undefined) {\n el.toArray().forEach(createChildren)\n } else {\n Y.typeListToArraySnapshot(el, new Y.Snapshot(prevSnapshot.ds, snapshot.sv))\n .forEach(createChildren)\n }\n try {\n const attrs = el.getAttributes(snapshot)\n if (snapshot !== undefined) {\n if (!isVisible(/** @type {Y.Item} */ (el._item), snapshot)) {\n attrs.ychange = computeYChange\n ? computeYChange('removed', /** @type {Y.Item} */ (el._item).id)\n : { type: 'removed' }\n } else if (!isVisible(/** @type {Y.Item} */ (el._item), prevSnapshot)) {\n attrs.ychange = computeYChange\n ? computeYChange('added', /** @type {Y.Item} */ (el._item).id)\n : { type: 'added' }\n }\n }\n const node = schema.node(el.nodeName, attrs, children)\n meta.mapping.set(el, node)\n return node\n } catch (e) {\n // an error occured while creating the node. This is probably a result of a concurrent action.\n /** @type {Y.Doc} */ (el.doc).transact((transaction) => {\n /** @type {Y.Item} */ (el._item).delete(transaction)\n }, ySyncPluginKey)\n meta.mapping.delete(el)\n return null\n }\n}\n\n/**\n * @private\n * @param {Y.XmlText} text\n * @param {import('prosemirror-model').Schema} schema\n * @param {BindingMetadata} _meta\n * @param {Y.Snapshot} [snapshot]\n * @param {Y.Snapshot} [prevSnapshot]\n * @param {function('removed' | 'added', Y.ID):any} [computeYChange]\n * @return {Array|null}\n */\nconst createTextNodesFromYText = (\n text,\n schema,\n _meta,\n snapshot,\n prevSnapshot,\n computeYChange\n) => {\n const nodes = []\n const deltas = text.toDelta(snapshot, prevSnapshot, computeYChange)\n try {\n for (let i = 0; i < deltas.length; i++) {\n const delta = deltas[i]\n nodes.push(schema.text(delta.insert, attributesToMarks(delta.attributes, schema)))\n }\n } catch (e) {\n // an error occured while creating the node. This is probably a result of a concurrent action.\n /** @type {Y.Doc} */ (text.doc).transact((transaction) => {\n /** @type {Y.Item} */ (text._item).delete(transaction)\n }, ySyncPluginKey)\n return null\n }\n // @ts-ignore\n return nodes\n}\n\n/**\n * @private\n * @param {Array} nodes prosemirror node\n * @param {BindingMetadata} meta\n * @return {Y.XmlText}\n */\nconst createTypeFromTextNodes = (nodes, meta) => {\n const type = new Y.XmlText()\n const delta = nodes.map((node) => ({\n // @ts-ignore\n insert: node.text,\n attributes: marksToAttributes(node.marks, meta)\n }))\n type.applyDelta(delta)\n meta.mapping.set(type, nodes)\n return type\n}\n\n/**\n * @private\n * @param {any} node prosemirror node\n * @param {BindingMetadata} meta\n * @return {Y.XmlElement}\n */\nconst createTypeFromElementNode = (node, meta) => {\n const type = new Y.XmlElement(node.type.name)\n for (const key in node.attrs) {\n const val = node.attrs[key]\n if (val !== null && key !== 'ychange') {\n type.setAttribute(key, val)\n }\n }\n type.insert(\n 0,\n normalizePNodeContent(node).map((n) =>\n createTypeFromTextOrElementNode(n, meta)\n )\n )\n meta.mapping.set(type, node)\n return type\n}\n\n/**\n * @private\n * @param {PModel.Node|Array} node prosemirror text node\n * @param {BindingMetadata} meta\n * @return {Y.XmlElement|Y.XmlText}\n */\nconst createTypeFromTextOrElementNode = (node, meta) =>\n node instanceof Array\n ? createTypeFromTextNodes(node, meta)\n : createTypeFromElementNode(node, meta)\n\n/**\n * @param {any} val\n */\nconst isObject = (val) => typeof val === 'object' && val !== null\n\n/**\n * @param {any} pattrs\n * @param {any} yattrs\n */\nconst equalAttrs = (pattrs, yattrs) => {\n const keys = Object.keys(pattrs).filter((key) => pattrs[key] !== null)\n let eq =\n keys.length ===\n (yattrs == null ? 0 : Object.keys(yattrs).filter((key) => yattrs[key] !== null).length)\n for (let i = 0; i < keys.length && eq; i++) {\n const key = keys[i]\n const l = pattrs[key]\n const r = yattrs[key]\n eq = key === 'ychange' || l === r ||\n (isObject(l) && isObject(r) && equalAttrs(l, r))\n }\n return eq\n}\n\n/**\n * @typedef {Array|PModel.Node>} NormalizedPNodeContent\n */\n\n/**\n * @param {any} pnode\n * @return {NormalizedPNodeContent}\n */\nconst normalizePNodeContent = (pnode) => {\n const c = pnode.content.content\n const res = []\n for (let i = 0; i < c.length; i++) {\n const n = c[i]\n if (n.isText) {\n const textNodes = []\n for (let tnode = c[i]; i < c.length && tnode.isText; tnode = c[++i]) {\n textNodes.push(tnode)\n }\n i--\n res.push(textNodes)\n } else {\n res.push(n)\n }\n }\n return res\n}\n\n/**\n * @param {Y.XmlText} ytext\n * @param {Array} ptexts\n */\nconst equalYTextPText = (ytext, ptexts) => {\n const delta = ytext.toDelta()\n return delta.length === ptexts.length &&\n delta.every(/** @type {(d:any,i:number) => boolean} */ (d, i) =>\n d.insert === /** @type {any} */ (ptexts[i]).text &&\n object.keys(d.attributes || {}).length === ptexts[i].marks.length &&\n object.every(d.attributes, (attr, yattrname) => {\n const markname = yattr2markname(yattrname)\n const pmarks = ptexts[i].marks\n return equalAttrs(attr, pmarks.find(/** @param {any} mark */ mark => mark.type.name === markname)?.attrs)\n })\n )\n}\n\n/**\n * @param {Y.XmlElement|Y.XmlText|Y.XmlHook} ytype\n * @param {any|Array} pnode\n */\nconst equalYTypePNode = (ytype, pnode) => {\n if (\n ytype instanceof Y.XmlElement && !(pnode instanceof Array) &&\n matchNodeName(ytype, pnode)\n ) {\n const normalizedContent = normalizePNodeContent(pnode)\n return ytype._length === normalizedContent.length &&\n equalAttrs(ytype.getAttributes(), pnode.attrs) &&\n ytype.toArray().every((ychild, i) =>\n equalYTypePNode(ychild, normalizedContent[i])\n )\n }\n return ytype instanceof Y.XmlText && pnode instanceof Array &&\n equalYTextPText(ytype, pnode)\n}\n\n/**\n * @param {PModel.Node | Array | undefined} mapped\n * @param {PModel.Node | Array} pcontent\n */\nconst mappedIdentity = (mapped, pcontent) =>\n mapped === pcontent ||\n (mapped instanceof Array && pcontent instanceof Array &&\n mapped.length === pcontent.length && mapped.every((a, i) =>\n pcontent[i] === a\n ))\n\n/**\n * @param {Y.XmlElement} ytype\n * @param {PModel.Node} pnode\n * @param {BindingMetadata} meta\n * @return {{ foundMappedChild: boolean, equalityFactor: number }}\n */\nconst computeChildEqualityFactor = (ytype, pnode, meta) => {\n const yChildren = ytype.toArray()\n const pChildren = normalizePNodeContent(pnode)\n const pChildCnt = pChildren.length\n const yChildCnt = yChildren.length\n const minCnt = math.min(yChildCnt, pChildCnt)\n let left = 0\n let right = 0\n let foundMappedChild = false\n for (; left < minCnt; left++) {\n const leftY = yChildren[left]\n const leftP = pChildren[left]\n if (mappedIdentity(meta.mapping.get(leftY), leftP)) {\n foundMappedChild = true // definite (good) match!\n } else if (!equalYTypePNode(leftY, leftP)) {\n break\n }\n }\n for (; left + right < minCnt; right++) {\n const rightY = yChildren[yChildCnt - right - 1]\n const rightP = pChildren[pChildCnt - right - 1]\n if (mappedIdentity(meta.mapping.get(rightY), rightP)) {\n foundMappedChild = true\n } else if (!equalYTypePNode(rightY, rightP)) {\n break\n }\n }\n return {\n equalityFactor: left + right,\n foundMappedChild\n }\n}\n\n/**\n * @param {Y.Text} ytext\n */\nconst ytextTrans = (ytext) => {\n let str = ''\n /**\n * @type {Y.Item|null}\n */\n let n = ytext._start\n const nAttrs = {}\n while (n !== null) {\n if (!n.deleted) {\n if (n.countable && n.content instanceof Y.ContentString) {\n str += n.content.str\n } else if (n.content instanceof Y.ContentFormat) {\n nAttrs[n.content.key] = null\n }\n }\n n = n.right\n }\n return {\n str,\n nAttrs\n }\n}\n\n/**\n * @todo test this more\n *\n * @param {Y.Text} ytext\n * @param {Array} ptexts\n * @param {BindingMetadata} meta\n */\nconst updateYText = (ytext, ptexts, meta) => {\n meta.mapping.set(ytext, ptexts)\n const { nAttrs, str } = ytextTrans(ytext)\n const content = ptexts.map((p) => ({\n insert: /** @type {any} */ (p).text,\n attributes: Object.assign({}, nAttrs, marksToAttributes(p.marks, meta))\n }))\n const { insert, remove, index } = simpleDiff(\n str,\n content.map((c) => c.insert).join('')\n )\n ytext.delete(index, remove)\n ytext.insert(index, insert)\n ytext.applyDelta(\n content.map((c) => ({ retain: c.insert.length, attributes: c.attributes }))\n )\n}\n\nconst hashedMarkNameRegex = /(.*)(--[a-zA-Z0-9+/=]{8})$/\n/**\n * @param {string} attrName\n */\nexport const yattr2markname = attrName => hashedMarkNameRegex.exec(attrName)?.[1] ?? attrName\n\n/**\n * @todo move this to markstoattributes\n *\n * @param {Object} attrs\n * @param {import('prosemirror-model').Schema} schema\n */\nexport const attributesToMarks = (attrs, schema) => {\n /**\n * @type {Array}\n */\n const marks = []\n for (const markName in attrs) {\n // remove hashes if necessary\n marks.push(schema.mark(yattr2markname(markName), attrs[markName]))\n }\n return marks\n}\n\n/**\n * @param {Array} marks\n * @param {BindingMetadata} meta\n */\nconst marksToAttributes = (marks, meta) => {\n const pattrs = {}\n marks.forEach((mark) => {\n if (mark.type.name !== 'ychange') {\n const isOverlapping = map.setIfUndefined(meta.isOMark, mark.type, () => !mark.type.excludes(mark.type))\n pattrs[isOverlapping ? `${mark.type.name}--${utils.hashOfJSON(mark.toJSON())}` : mark.type.name] = mark.attrs\n }\n })\n return pattrs\n}\n\n/**\n * Update a yDom node by syncing the current content of the prosemirror node.\n *\n * This is a y-prosemirror internal feature that you can use at your own risk.\n *\n * @private\n * @unstable\n *\n * @param {{transact: Function}} y\n * @param {Y.XmlFragment} yDomFragment\n * @param {any} pNode\n * @param {BindingMetadata} meta\n */\nexport const updateYFragment = (y, yDomFragment, pNode, meta) => {\n if (\n yDomFragment instanceof Y.XmlElement &&\n yDomFragment.nodeName !== pNode.type.name\n ) {\n throw new Error('node name mismatch!')\n }\n meta.mapping.set(yDomFragment, pNode)\n // update attributes\n if (yDomFragment instanceof Y.XmlElement) {\n const yDomAttrs = yDomFragment.getAttributes()\n const pAttrs = pNode.attrs\n for (const key in pAttrs) {\n if (pAttrs[key] !== null) {\n if (yDomAttrs[key] !== pAttrs[key] && key !== 'ychange') {\n yDomFragment.setAttribute(key, pAttrs[key])\n }\n } else {\n yDomFragment.removeAttribute(key)\n }\n }\n // remove all keys that are no longer in pAttrs\n for (const key in yDomAttrs) {\n if (pAttrs[key] === undefined) {\n yDomFragment.removeAttribute(key)\n }\n }\n }\n // update children\n const pChildren = normalizePNodeContent(pNode)\n const pChildCnt = pChildren.length\n const yChildren = yDomFragment.toArray()\n const yChildCnt = yChildren.length\n const minCnt = math.min(pChildCnt, yChildCnt)\n let left = 0\n let right = 0\n // find number of matching elements from left\n for (; left < minCnt; left++) {\n const leftY = yChildren[left]\n const leftP = pChildren[left]\n if (!mappedIdentity(meta.mapping.get(leftY), leftP)) {\n if (equalYTypePNode(leftY, leftP)) {\n // update mapping\n meta.mapping.set(leftY, leftP)\n } else {\n break\n }\n }\n }\n // find number of matching elements from right\n for (; right + left < minCnt; right++) {\n const rightY = yChildren[yChildCnt - right - 1]\n const rightP = pChildren[pChildCnt - right - 1]\n if (!mappedIdentity(meta.mapping.get(rightY), rightP)) {\n if (equalYTypePNode(rightY, rightP)) {\n // update mapping\n meta.mapping.set(rightY, rightP)\n } else {\n break\n }\n }\n }\n y.transact(() => {\n // try to compare and update\n while (yChildCnt - left - right > 0 && pChildCnt - left - right > 0) {\n const leftY = yChildren[left]\n const leftP = pChildren[left]\n const rightY = yChildren[yChildCnt - right - 1]\n const rightP = pChildren[pChildCnt - right - 1]\n if (leftY instanceof Y.XmlText && leftP instanceof Array) {\n if (!equalYTextPText(leftY, leftP)) {\n updateYText(leftY, leftP, meta)\n }\n left += 1\n } else {\n let updateLeft = leftY instanceof Y.XmlElement &&\n matchNodeName(leftY, leftP)\n let updateRight = rightY instanceof Y.XmlElement &&\n matchNodeName(rightY, rightP)\n if (updateLeft && updateRight) {\n // decide which which element to update\n const equalityLeft = computeChildEqualityFactor(\n /** @type {Y.XmlElement} */ (leftY),\n /** @type {PModel.Node} */ (leftP),\n meta\n )\n const equalityRight = computeChildEqualityFactor(\n /** @type {Y.XmlElement} */ (rightY),\n /** @type {PModel.Node} */ (rightP),\n meta\n )\n if (\n equalityLeft.foundMappedChild && !equalityRight.foundMappedChild\n ) {\n updateRight = false\n } else if (\n !equalityLeft.foundMappedChild && equalityRight.foundMappedChild\n ) {\n updateLeft = false\n } else if (\n equalityLeft.equalityFactor < equalityRight.equalityFactor\n ) {\n updateLeft = false\n } else {\n updateRight = false\n }\n }\n if (updateLeft) {\n updateYFragment(\n y,\n /** @type {Y.XmlFragment} */ (leftY),\n /** @type {PModel.Node} */ (leftP),\n meta\n )\n left += 1\n } else if (updateRight) {\n updateYFragment(\n y,\n /** @type {Y.XmlFragment} */ (rightY),\n /** @type {PModel.Node} */ (rightP),\n meta\n )\n right += 1\n } else {\n meta.mapping.delete(yDomFragment.get(left))\n yDomFragment.delete(left, 1)\n yDomFragment.insert(left, [\n createTypeFromTextOrElementNode(leftP, meta)\n ])\n left += 1\n }\n }\n }\n const yDelLen = yChildCnt - left - right\n if (\n yChildCnt === 1 && pChildCnt === 0 && yChildren[0] instanceof Y.XmlText\n ) {\n meta.mapping.delete(yChildren[0])\n // Edge case handling https://github.com/yjs/y-prosemirror/issues/108\n // Only delete the content of the Y.Text to retain remote changes on the same Y.Text object\n yChildren[0].delete(0, yChildren[0].length)\n } else if (yDelLen > 0) {\n yDomFragment.slice(left, left + yDelLen).forEach(type => meta.mapping.delete(type))\n yDomFragment.delete(left, yDelLen)\n }\n if (left + right < pChildCnt) {\n const ins = []\n for (let i = left; i < pChildCnt - right; i++) {\n ins.push(createTypeFromTextOrElementNode(pChildren[i], meta))\n }\n yDomFragment.insert(left, ins)\n }\n }, ySyncPluginKey)\n}\n\n/**\n * @function\n * @param {Y.XmlElement} yElement\n * @param {any} pNode Prosemirror Node\n */\nconst matchNodeName = (yElement, pNode) =>\n !(pNode instanceof Array) && yElement.nodeName === pNode.type.name\n","import { updateYFragment, createNodeFromYElement, yattr2markname, createEmptyMeta } from './plugins/sync-plugin.js' // eslint-disable-line\nimport { ySyncPluginKey } from './plugins/keys.js'\nimport * as Y from '@y/y'\nimport { EditorView } from 'prosemirror-view' // eslint-disable-line\nimport { Node, Schema, Fragment } from 'prosemirror-model' // eslint-disable-line\nimport * as error from 'lib0/error'\nimport * as map from 'lib0/map'\nimport * as eventloop from 'lib0/eventloop'\n\n/**\n * Either a node if type is YXmlElement or an Array of text nodes if YXmlText\n * @typedef {Map>} ProsemirrorMapping\n */\n\n/**\n * Is null if no timeout is in progress.\n * Is defined if a timeout is in progress.\n * Maps from view\n * @type {Map>|null}\n */\nlet viewsToUpdate = null\n\nconst updateMetas = () => {\n const ups = /** @type {Map>} */ (viewsToUpdate)\n viewsToUpdate = null\n ups.forEach((metas, view) => {\n const tr = view.state.tr\n const syncState = ySyncPluginKey.getState(view.state)\n if (syncState && syncState.binding && !syncState.binding.isDestroyed) {\n metas.forEach((val, key) => {\n tr.setMeta(key, val)\n })\n view.dispatch(tr)\n }\n })\n}\n\nexport const setMeta = (view, key, value) => {\n if (!viewsToUpdate) {\n viewsToUpdate = new Map()\n eventloop.timeout(0, updateMetas)\n }\n map.setIfUndefined(viewsToUpdate, view, map.create).set(key, value)\n}\n\n/**\n * Transforms a Prosemirror based absolute position to a Yjs Cursor (relative position in the Yjs model).\n *\n * @param {number} pos\n * @param {Y.XmlFragment} type\n * @param {ProsemirrorMapping} mapping\n * @return {any} relative position\n */\nexport const absolutePositionToRelativePosition = (pos, type, mapping) => {\n if (pos === 0) {\n // if the type is later populated, we want to retain the 0 position (hence assoc=-1)\n return Y.createRelativePositionFromTypeIndex(type, 0, type.length === 0 ? -1 : 0)\n }\n /**\n * @type {any}\n */\n let n = type._first === null ? null : /** @type {Y.ContentType} */ (type._first.content).type\n while (n !== null && type !== n) {\n if (n instanceof Y.XmlText) {\n if (n._length >= pos) {\n return Y.createRelativePositionFromTypeIndex(n, pos, type.length === 0 ? -1 : 0)\n } else {\n pos -= n._length\n }\n if (n._item !== null && n._item.next !== null) {\n n = /** @type {Y.ContentType} */ (n._item.next.content).type\n } else {\n do {\n n = n._item === null ? null : n._item.parent\n pos--\n } while (n !== type && n !== null && n._item !== null && n._item.next === null)\n if (n !== null && n !== type) {\n // @ts-gnore we know that n.next !== null because of above loop conditition\n n = n._item === null ? null : /** @type {Y.ContentType} */ (/** @type Y.Item */ (n._item.next).content).type\n }\n }\n } else {\n const pNodeSize = /** @type {any} */ (mapping.get(n) || { nodeSize: 0 }).nodeSize\n if (n._first !== null && pos < pNodeSize) {\n n = /** @type {Y.ContentType} */ (n._first.content).type\n pos--\n } else {\n if (pos === 1 && n._length === 0 && pNodeSize > 1) {\n // edge case, should end in this paragraph\n return new Y.RelativePosition(n._item === null ? null : n._item.id, n._item === null ? Y.findRootTypeKey(n) : null, null)\n }\n pos -= pNodeSize\n if (n._item !== null && n._item.next !== null) {\n n = /** @type {Y.ContentType} */ (n._item.next.content).type\n } else {\n if (pos === 0) {\n // set to end of n.parent\n n = n._item === null ? n : n._item.parent\n return new Y.RelativePosition(n._item === null ? null : n._item.id, n._item === null ? Y.findRootTypeKey(n) : null, null)\n }\n do {\n n = /** @type {Y.Item} */ (n._item).parent\n pos--\n } while (n !== type && /** @type {Y.Item} */ (n._item).next === null)\n // if n is null at this point, we have an unexpected case\n if (n !== type) {\n // We know that n._item.next is defined because of above loop condition\n n = /** @type {Y.ContentType} */ (/** @type {Y.Item} */ (/** @type {Y.Item} */ (n._item).next).content).type\n }\n }\n }\n }\n if (n === null) {\n throw error.unexpectedCase()\n }\n if (pos === 0 && n.constructor !== Y.XmlText && n !== type) { // TODO: set to <= 0\n return createRelativePosition(n._item.parent, n._item)\n }\n }\n return Y.createRelativePositionFromTypeIndex(type, type._length, type.length === 0 ? -1 : 0)\n}\n\nconst createRelativePosition = (type, item) => {\n let typeid = null\n let tname = null\n if (type._item === null) {\n tname = Y.findRootTypeKey(type)\n } else {\n typeid = Y.createID(type._item.id.client, type._item.id.clock)\n }\n return new Y.RelativePosition(typeid, tname, item.id)\n}\n\n/**\n * @param {Y.Doc} y\n * @param {Y.XmlFragment} documentType Top level type that is bound to pView\n * @param {any} relPos Encoded Yjs based relative position\n * @param {ProsemirrorMapping} mapping\n * @return {null|number}\n */\nexport const relativePositionToAbsolutePosition = (y, documentType, relPos, mapping) => {\n const decodedPos = Y.createAbsolutePositionFromRelativePosition(relPos, y)\n if (decodedPos === null || (decodedPos.type !== documentType && !Y.isParentOf(documentType, decodedPos.type._item))) {\n return null\n }\n let type = decodedPos.type\n let pos = 0\n if (type.constructor === Y.XmlText) {\n pos = decodedPos.index\n } else if (type._item === null || !type._item.deleted) {\n let n = type._first\n let i = 0\n while (i < type._length && i < decodedPos.index && n !== null) {\n if (!n.deleted) {\n const t = /** @type {Y.ContentType} */ (n.content).type\n i++\n if (t instanceof Y.XmlText) {\n pos += t._length\n } else {\n pos += /** @type {any} */ (mapping.get(t)).nodeSize\n }\n }\n n = /** @type {Y.Item} */ (n.right)\n }\n pos += 1 // increase because we go out of n\n }\n while (type !== documentType && type._item !== null) {\n // @ts-ignore\n const parent = type._item.parent\n // @ts-ignore\n if (parent._item === null || !parent._item.deleted) {\n pos += 1 // the start tag\n let n = /** @type {Y.AbstractType} */ (parent)._first\n // now iterate until we found type\n while (n !== null) {\n const contentType = /** @type {Y.ContentType} */ (n.content).type\n if (contentType === type) {\n break\n }\n if (!n.deleted) {\n if (contentType instanceof Y.XmlText) {\n pos += contentType._length\n } else {\n pos += /** @type {any} */ (mapping.get(contentType)).nodeSize\n }\n }\n n = n.right\n }\n }\n type = /** @type {Y.AbstractType} */ (parent)\n }\n return pos - 1 // we don't count the most outer tag, because it is a fragment\n}\n\n/**\n * Utility function for converting an Y.Fragment to a ProseMirror fragment.\n *\n * @param {Y.XmlFragment} yXmlFragment\n * @param {Schema} schema\n */\nexport const yXmlFragmentToProseMirrorFragment = (yXmlFragment, schema) => {\n const fragmentContent = yXmlFragment.toArray().map((t) =>\n createNodeFromYElement(\n /** @type {Y.XmlElement} */ (t),\n schema,\n createEmptyMeta()\n )\n ).filter((n) => n !== null)\n return Fragment.fromArray(fragmentContent)\n}\n\n/**\n * Utility function for converting an Y.Fragment to a ProseMirror node.\n *\n * @param {Y.XmlFragment} yXmlFragment\n * @param {Schema} schema\n */\nexport const yXmlFragmentToProseMirrorRootNode = (yXmlFragment, schema) =>\n schema.topNodeType.create(null, yXmlFragmentToProseMirrorFragment(yXmlFragment, schema))\n\n/**\n * The initial ProseMirror content should be supplied by Yjs. This function transforms a Y.Fragment\n * to a ProseMirror Doc node and creates a mapping that is used by the sync plugin.\n *\n * @param {Y.XmlFragment} yXmlFragment\n * @param {Schema} schema\n *\n * @todo deprecate mapping property\n */\nexport const initProseMirrorDoc = (yXmlFragment, schema) => {\n const meta = createEmptyMeta()\n const fragmentContent = yXmlFragment.toArray().map((t) =>\n createNodeFromYElement(\n /** @type {Y.XmlElement} */ (t),\n schema,\n meta\n )\n ).filter((n) => n !== null)\n const doc = schema.topNodeType.create(null, Fragment.fromArray(fragmentContent))\n return { doc, meta, mapping: meta.mapping }\n}\n\n/**\n * Utility method to convert a Prosemirror Doc Node into a Y.Doc.\n *\n * This can be used when importing existing content to Y.Doc for the first time,\n * note that this should not be used to rehydrate a Y.Doc from a database once\n * collaboration has begun as all history will be lost\n *\n * @param {Node} doc\n * @param {string} xmlFragment\n * @return {Y.Doc}\n */\nexport function prosemirrorToYDoc (doc, xmlFragment = 'prosemirror') {\n const ydoc = new Y.Doc()\n const type = /** @type {Y.XmlFragment} */ (ydoc.get(xmlFragment, Y.XmlFragment))\n if (!type.doc) {\n return ydoc\n }\n\n prosemirrorToYXmlFragment(doc, type)\n return type.doc\n}\n\n/**\n * Utility method to update an empty Y.XmlFragment with content from a Prosemirror Doc Node.\n *\n * This can be used when importing existing content to Y.Doc for the first time,\n * note that this should not be used to rehydrate a Y.Doc from a database once\n * collaboration has begun as all history will be lost\n *\n * Note: The Y.XmlFragment does not need to be part of a Y.Doc document at the time that this\n * method is called, but it must be added before any other operations are performed on it.\n *\n * @param {Node} doc prosemirror document.\n * @param {Y.XmlFragment} [xmlFragment] If supplied, an xml fragment to be\n * populated from the prosemirror state; otherwise a new XmlFragment will be created.\n * @return {Y.XmlFragment}\n */\nexport function prosemirrorToYXmlFragment (doc, xmlFragment) {\n const type = xmlFragment || new Y.XmlFragment()\n const ydoc = type.doc ? type.doc : { transact: (transaction) => transaction(undefined) }\n updateYFragment(ydoc, type, doc, { mapping: new Map(), isOMark: new Map() })\n return type\n}\n\n/**\n * Utility method to convert Prosemirror compatible JSON into a Y.Doc.\n *\n * This can be used when importing existing content to Y.Doc for the first time,\n * note that this should not be used to rehydrate a Y.Doc from a database once\n * collaboration has begun as all history will be lost\n *\n * @param {Schema} schema\n * @param {any} state\n * @param {string} xmlFragment\n * @return {Y.Doc}\n */\nexport function prosemirrorJSONToYDoc (schema, state, xmlFragment = 'prosemirror') {\n const doc = Node.fromJSON(schema, state)\n return prosemirrorToYDoc(doc, xmlFragment)\n}\n\n/**\n * Utility method to convert Prosemirror compatible JSON to a Y.XmlFragment\n *\n * This can be used when importing existing content to Y.Doc for the first time,\n * note that this should not be used to rehydrate a Y.Doc from a database once\n * collaboration has begun as all history will be lost\n *\n * @param {Schema} schema\n * @param {any} state\n * @param {Y.XmlFragment} [xmlFragment] If supplied, an xml fragment to be\n * populated from the prosemirror state; otherwise a new XmlFragment will be created.\n * @return {Y.XmlFragment}\n */\nexport function prosemirrorJSONToYXmlFragment (schema, state, xmlFragment) {\n const doc = Node.fromJSON(schema, state)\n return prosemirrorToYXmlFragment(doc, xmlFragment)\n}\n\n/**\n * @deprecated Use `yXmlFragmentToProseMirrorRootNode` instead\n *\n * Utility method to convert a Y.Doc to a Prosemirror Doc node.\n *\n * @param {Schema} schema\n * @param {Y.Doc} ydoc\n * @return {Node}\n */\nexport function yDocToProsemirror (schema, ydoc) {\n const state = yDocToProsemirrorJSON(ydoc)\n return Node.fromJSON(schema, state)\n}\n\n/**\n *\n * @deprecated Use `yXmlFragmentToProseMirrorRootNode` instead\n *\n * Utility method to convert a Y.XmlFragment to a Prosemirror Doc node.\n *\n * @param {Schema} schema\n * @param {Y.XmlFragment} xmlFragment\n * @return {Node}\n */\nexport function yXmlFragmentToProsemirror (schema, xmlFragment) {\n const state = yXmlFragmentToProsemirrorJSON(xmlFragment)\n return Node.fromJSON(schema, state)\n}\n\n/**\n *\n * @deprecated Use `yXmlFragmentToProseMirrorRootNode` instead\n *\n * Utility method to convert a Y.Doc to Prosemirror compatible JSON.\n *\n * @param {Y.Doc} ydoc\n * @param {string} xmlFragment\n * @return {Record}\n */\nexport function yDocToProsemirrorJSON (\n ydoc,\n xmlFragment = 'prosemirror'\n) {\n return yXmlFragmentToProsemirrorJSON(ydoc.getXmlFragment(xmlFragment))\n}\n\n/**\n * @deprecated Use `yXmlFragmentToProseMirrorRootNode` instead\n *\n * Utility method to convert a Y.Doc to Prosemirror compatible JSON.\n *\n * @param {Y.XmlFragment} xmlFragment The fragment, which must be part of a Y.Doc.\n * @return {Record}\n */\nexport function yXmlFragmentToProsemirrorJSON (xmlFragment) {\n const items = xmlFragment.toArray()\n\n /**\n * @param {Y.AbstractType} item\n */\n const serialize = item => {\n /**\n * @type {Object} NodeObject\n * @property {string} NodeObject.type\n * @property {Record=} NodeObject.attrs\n * @property {Array=} NodeObject.content\n */\n let response\n\n // TODO: Must be a better way to detect text nodes than this\n if (item instanceof Y.XmlText) {\n const delta = item.toDelta()\n response = delta.map(/** @param {any} d */ (d) => {\n const text = {\n type: 'text',\n text: d.insert\n }\n if (d.attributes) {\n text.marks = Object.keys(d.attributes).map((type_) => {\n const attrs = d.attributes[type_]\n const type = yattr2markname(type_)\n const mark = {\n type\n }\n if (Object.keys(attrs)) {\n mark.attrs = attrs\n }\n return mark\n })\n }\n return text\n })\n } else if (item instanceof Y.XmlElement) {\n response = {\n type: item.nodeName\n }\n\n const attrs = item.getAttributes()\n if (Object.keys(attrs).length) {\n response.attrs = attrs\n }\n\n const children = item.toArray()\n if (children.length) {\n response.content = children.map(serialize).flat()\n }\n } else {\n // expected either Y.XmlElement or Y.XmlText\n error.unexpectedCase()\n }\n\n return response\n }\n\n return {\n type: 'doc',\n content: items.map(serialize)\n }\n}\n","import * as Y from '@y/y'\nimport { Decoration, DecorationSet } from \"prosemirror-view\"; // eslint-disable-line\nimport { Plugin } from \"prosemirror-state\"; // eslint-disable-line\nimport { Awareness } from \"@y/protocols/awareness\"; // eslint-disable-line\nimport {\n absolutePositionToRelativePosition,\n relativePositionToAbsolutePosition,\n setMeta\n} from '../lib.js'\nimport { yCursorPluginKey, ySyncPluginKey } from './keys.js'\n\nimport * as math from 'lib0/math'\n\n/**\n * Default awareness state filter\n *\n * @param {number} currentClientId current client id\n * @param {number} userClientId user client id\n * @param {any} _user user data\n * @return {boolean}\n */\nexport const defaultAwarenessStateFilter = (currentClientId, userClientId, _user) => currentClientId !== userClientId\n\n/**\n * Default generator for a cursor element\n *\n * @param {any} user user data\n * @return {HTMLElement}\n */\nexport const defaultCursorBuilder = (user) => {\n const cursor = document.createElement('span')\n cursor.classList.add('ProseMirror-yjs-cursor')\n cursor.setAttribute('style', `border-color: ${user.color}`)\n const userDiv = document.createElement('div')\n userDiv.setAttribute('style', `background-color: ${user.color}`)\n userDiv.insertBefore(document.createTextNode(user.name), null)\n const nonbreakingSpace1 = document.createTextNode('\\u2060')\n const nonbreakingSpace2 = document.createTextNode('\\u2060')\n cursor.insertBefore(nonbreakingSpace1, null)\n cursor.insertBefore(userDiv, null)\n cursor.insertBefore(nonbreakingSpace2, null)\n return cursor\n}\n\n/**\n * Default generator for the selection attributes\n *\n * @param {any} user user data\n * @return {import('prosemirror-view').DecorationAttrs}\n */\nexport const defaultSelectionBuilder = (user) => {\n return {\n style: `background-color: ${user.color}70`,\n class: 'ProseMirror-yjs-selection'\n }\n}\n\nconst rxValidColor = /^#[0-9a-fA-F]{6}$/\n\n/**\n * @param {any} state\n * @param {Awareness} awareness\n * @param {function(number, number, any):boolean} awarenessFilter\n * @param {(user: { name: string, color: string }, clientId: number) => Element} createCursor\n * @param {(user: { name: string, color: string }, clientId: number) => import('prosemirror-view').DecorationAttrs} createSelection\n * @return {any} DecorationSet\n */\nexport const createDecorations = (\n state,\n awareness,\n awarenessFilter,\n createCursor,\n createSelection\n) => {\n const ystate = ySyncPluginKey.getState(state)\n const y = ystate.doc\n const decorations = []\n if (\n ystate.snapshot != null || ystate.prevSnapshot != null ||\n ystate.binding.mapping.size === 0\n ) {\n // do not render cursors while snapshot is active\n return DecorationSet.create(state.doc, [])\n }\n awareness.getStates().forEach((aw, clientId) => {\n if (!awarenessFilter(y.clientID, clientId, aw)) {\n return\n }\n\n if (aw.cursor != null) {\n const user = aw.user || {}\n if (user.color == null) {\n user.color = '#ffa500'\n } else if (!rxValidColor.test(user.color)) {\n // We only support 6-digit RGB colors in y-prosemirror\n console.warn('A user uses an unsupported color format', user)\n }\n if (user.name == null) {\n user.name = `User: ${clientId}`\n }\n let anchor = relativePositionToAbsolutePosition(\n y,\n ystate.type,\n Y.createRelativePositionFromJSON(aw.cursor.anchor),\n ystate.binding.mapping\n )\n let head = relativePositionToAbsolutePosition(\n y,\n ystate.type,\n Y.createRelativePositionFromJSON(aw.cursor.head),\n ystate.binding.mapping\n )\n if (anchor !== null && head !== null) {\n const maxsize = math.max(state.doc.content.size - 1, 0)\n anchor = math.min(anchor, maxsize)\n head = math.min(head, maxsize)\n decorations.push(\n Decoration.widget(head, () => createCursor(user, clientId), {\n key: clientId + '',\n side: 10\n })\n )\n const from = math.min(anchor, head)\n const to = math.max(anchor, head)\n decorations.push(\n Decoration.inline(from, to, createSelection(user, clientId), {\n inclusiveEnd: true,\n inclusiveStart: false\n })\n )\n }\n }\n })\n return DecorationSet.create(state.doc, decorations)\n}\n\n/**\n * A prosemirror plugin that listens to awareness information on Yjs.\n * This requires that a `prosemirrorPlugin` is also bound to the prosemirror.\n *\n * @public\n * @param {Awareness} awareness\n * @param {object} opts\n * @param {function(any, any, any):boolean} [opts.awarenessStateFilter]\n * @param {(user: any, clientId: number) => HTMLElement} [opts.cursorBuilder]\n * @param {(user: any, clientId: number) => import('prosemirror-view').DecorationAttrs} [opts.selectionBuilder]\n * @param {function(any):any} [opts.getSelection]\n * @param {string} [cursorStateField] By default all editor bindings use the awareness 'cursor' field to propagate cursor information.\n * @return {any}\n */\nexport const yCursorPlugin = (\n awareness,\n {\n awarenessStateFilter = defaultAwarenessStateFilter,\n cursorBuilder = defaultCursorBuilder,\n selectionBuilder = defaultSelectionBuilder,\n getSelection = (state) => state.selection\n } = {},\n cursorStateField = 'cursor'\n) =>\n new Plugin({\n key: yCursorPluginKey,\n state: {\n init (_, state) {\n return createDecorations(\n state,\n awareness,\n awarenessStateFilter,\n cursorBuilder,\n selectionBuilder\n )\n },\n apply (tr, prevState, _oldState, newState) {\n const ystate = ySyncPluginKey.getState(newState)\n const yCursorState = tr.getMeta(yCursorPluginKey)\n if (\n (ystate && ystate.isChangeOrigin) ||\n (yCursorState && yCursorState.awarenessUpdated)\n ) {\n return createDecorations(\n newState,\n awareness,\n awarenessStateFilter,\n cursorBuilder,\n selectionBuilder\n )\n }\n return prevState.map(tr.mapping, tr.doc)\n }\n },\n props: {\n decorations: (state) => {\n return yCursorPluginKey.getState(state)\n }\n },\n view: (view) => {\n const awarenessListener = () => {\n // @ts-ignore\n if (view.docView) {\n setMeta(view, yCursorPluginKey, { awarenessUpdated: true })\n }\n }\n const updateCursorInfo = () => {\n const ystate = ySyncPluginKey.getState(view.state)\n // @note We make implicit checks when checking for the cursor property\n const current = awareness.getLocalState() || {}\n if (view.hasFocus()) {\n const selection = getSelection(view.state)\n /**\n * @type {Y.RelativePosition}\n */\n const anchor = absolutePositionToRelativePosition(\n selection.anchor,\n ystate.type,\n ystate.binding.mapping\n )\n /**\n * @type {Y.RelativePosition}\n */\n const head = absolutePositionToRelativePosition(\n selection.head,\n ystate.type,\n ystate.binding.mapping\n )\n if (\n current.cursor == null ||\n !Y.compareRelativePositions(\n Y.createRelativePositionFromJSON(current.cursor.anchor),\n anchor\n ) ||\n !Y.compareRelativePositions(\n Y.createRelativePositionFromJSON(current.cursor.head),\n head\n )\n ) {\n awareness.setLocalStateField(cursorStateField, {\n anchor,\n head\n })\n }\n } else if (\n current.cursor != null &&\n relativePositionToAbsolutePosition(\n ystate.doc,\n ystate.type,\n Y.createRelativePositionFromJSON(current.cursor.anchor),\n ystate.binding.mapping\n ) !== null\n ) {\n // delete cursor information if current cursor information is owned by this editor binding\n awareness.setLocalStateField(cursorStateField, null)\n }\n }\n awareness.on('change', awarenessListener)\n view.dom.addEventListener('focusin', updateCursorInfo)\n view.dom.addEventListener('focusout', updateCursorInfo)\n return {\n update: updateCursorInfo,\n destroy: () => {\n view.dom.removeEventListener('focusin', updateCursorInfo)\n view.dom.removeEventListener('focusout', updateCursorInfo)\n awareness.off('change', awarenessListener)\n awareness.setLocalStateField(cursorStateField, null)\n }\n }\n }\n })\n","import { Plugin } from 'prosemirror-state'\n\nimport { getRelativeSelection } from './sync-plugin.js'\nimport { UndoManager, Item, ContentType, XmlElement, Text } from '@y/y'\nimport { yUndoPluginKey, ySyncPluginKey } from './keys.js'\n\n/**\n * @typedef {Object} UndoPluginState\n * @property {import('@y/y').UndoManager} undoManager\n * @property {ReturnType | null} prevSel\n * @property {boolean} hasUndoOps\n * @property {boolean} hasRedoOps\n */\n\n/**\n * Undo the last user action\n *\n * @param {import('prosemirror-state').EditorState} state\n * @return {boolean} whether a change was undone\n */\nexport const undo = state => yUndoPluginKey.getState(state)?.undoManager?.undo() != null\n\n/**\n * Redo the last user action\n *\n * @param {import('prosemirror-state').EditorState} state\n * @return {boolean} whether a change was undone\n */\nexport const redo = state => yUndoPluginKey.getState(state)?.undoManager?.redo() != null\n\n/**\n * Undo the last user action if there are undo operations available\n * @type {import('prosemirror-state').Command}\n */\nexport const undoCommand = (state, dispatch) => dispatch == null ? yUndoPluginKey.getState(state)?.undoManager?.canUndo() : undo(state)\n\n/**\n * Redo the last user action if there are redo operations available\n * @type {import('prosemirror-state').Command}\n */\nexport const redoCommand = (state, dispatch) => dispatch == null ? yUndoPluginKey.getState(state)?.undoManager?.canRedo() : redo(state)\n\nexport const defaultProtectedNodes = new Set(['paragraph'])\n\n/**\n * @param {import('@y/y').Item} item\n * @param {Set} protectedNodes\n * @returns {boolean}\n */\nexport const defaultDeleteFilter = (item, protectedNodes) => !(item instanceof Item) ||\n !(item.content instanceof ContentType) ||\n !(item.content.type instanceof Text ||\n (item.content.type instanceof XmlElement && protectedNodes.has(item.content.type.nodeName))) ||\n item.content.type._length === 0\n\n/**\n * @param {object} [options]\n * @param {Set} [options.protectedNodes]\n * @param {any[]} [options.trackedOrigins]\n * @param {import('@y/y').UndoManager | null} [options.undoManager]\n */\nexport const yUndoPlugin = ({ protectedNodes = defaultProtectedNodes, trackedOrigins = [], undoManager = null } = {}) => new Plugin({\n key: yUndoPluginKey,\n state: {\n init: (initargs, state) => {\n // TODO: check if plugin order matches and fix\n const ystate = ySyncPluginKey.getState(state)\n const _undoManager = undoManager || new UndoManager(ystate.type, {\n trackedOrigins: new Set([ySyncPluginKey].concat(trackedOrigins)),\n deleteFilter: (item) => defaultDeleteFilter(item, protectedNodes),\n captureTransaction: tr => tr.meta.get('addToHistory') !== false\n })\n return {\n undoManager: _undoManager,\n prevSel: null,\n hasUndoOps: _undoManager.undoStack.length > 0,\n hasRedoOps: _undoManager.redoStack.length > 0\n }\n },\n apply: (tr, val, oldState, state) => {\n const binding = ySyncPluginKey.getState(state).binding\n const undoManager = val.undoManager\n const hasUndoOps = undoManager.undoStack.length > 0\n const hasRedoOps = undoManager.redoStack.length > 0\n if (binding) {\n return {\n undoManager,\n prevSel: getRelativeSelection(binding, oldState),\n hasUndoOps,\n hasRedoOps\n }\n } else {\n if (hasUndoOps !== val.hasUndoOps || hasRedoOps !== val.hasRedoOps) {\n return Object.assign({}, val, {\n hasUndoOps: undoManager.undoStack.length > 0,\n hasRedoOps: undoManager.redoStack.length > 0\n })\n } else { // nothing changed\n return val\n }\n }\n }\n },\n view: view => {\n const ystate = ySyncPluginKey.getState(view.state)\n const undoManager = yUndoPluginKey.getState(view.state).undoManager\n undoManager.on('stack-item-added', ({ stackItem }) => {\n const binding = ystate.binding\n if (binding) {\n stackItem.meta.set(binding, yUndoPluginKey.getState(view.state).prevSel)\n }\n })\n undoManager.on('stack-item-popped', ({ stackItem }) => {\n const binding = ystate.binding\n if (binding) {\n binding.beforeTransactionSelection = stackItem.meta.get(binding) || binding.beforeTransactionSelection\n }\n })\n return {\n destroy: () => {\n undoManager.destroy()\n }\n }\n }\n})\n","import * as delta from 'lib0/delta'\nimport * as math from 'lib0/math'\nimport * as mux from 'lib0/mutex'\nimport * as Y from '@y/y'\nimport * as s from 'lib0/schema'\nimport * as object from 'lib0/object'\nimport * as error from 'lib0/error'\nimport * as set from 'lib0/set'\nimport * as map from 'lib0/map'\n\nimport { Node } from 'prosemirror-model'\nimport { AddMarkStep, RemoveMarkStep, AttrStep, AddNodeMarkStep, ReplaceStep, ReplaceAroundStep, RemoveNodeMarkStep, DocAttrStep, Transform } from 'prosemirror-transform'\nimport { ySyncPluginKey } from './plugins/keys.js'\nimport { Plugin } from 'prosemirror-state'\n\nconst $prosemirrorDelta = delta.$delta({ name: s.$string, attrs: s.$record(s.$string, s.$any), text: true, recursive: true })\n\n/**\n * @typedef {s.Unwrap<$prosemirrorDelta>} ProsemirrorDelta\n */\n\n// y-attribution-deletion & y-attribution-insertion & y-attribution-format (or mod?)\n// add attributes (userId: string[], timestamp: number) (see `YAttribution` (ask Kevin))\n// define how an insertion mark works on a node\n// situations like deleted node, yet has inserted content (handle nested content)\n// insertion within a node that was inserted + another user inserted more content into that node (hovers per user likely)\n\n/**\n * @template {import('lib0/delta').Attribution} T\n * @param {Record | null} format\n * @param {T} attribution\n * @returns {Record | null}\n */\nconst attributionToFormat = (format, attribution) => {\n /**\n * @type {Record | null}\n */\n let mergeWith = null\n if (attribution.insert) {\n mergeWith = {\n 'y-attribution-insertion': {\n userIds: attribution.insert ? attribution.insert : null,\n timestamp: attribution.insertAt ? attribution.insertAt : null\n }\n }\n } else if (attribution.delete) {\n mergeWith = {\n 'y-attribution-deletion': {\n userIds: attribution.delete ? attribution.delete : null,\n timestamp: attribution.deleteAt ? attribution.deleteAt : null\n }\n }\n } else if (attribution.format) {\n mergeWith = {\n 'y-attribution-format': {\n userIdsByAttr: attribution.format ? attribution.format : null,\n timestamp: attribution.formatAt ? attribution.formatAt : null\n }\n }\n }\n return object.assign({}, format, mergeWith)\n}\n\n/**\n * Transform delta with attributions to delta with formats (marks).\n */\nconst deltaAttributionToFormat = s.match(s.$function)\n .if(delta.$deltaAny, (d, func) => {\n const r = delta.create(d.name)\n for (const attr of d.attrs) {\n r.attrs[attr.key] = attr.clone()\n }\n for (const child of d.children) {\n const format = child.attribution ? func(child.format, child.attribution) : child.format\n if (delta.$insertOp.check(child)) {\n r.insert(child.insert.map(c => delta.$deltaAny.check(c) ? deltaAttributionToFormat(c, func) : c), format)\n } else if (delta.$textOp.check(child)) {\n r.insert(child.insert.slice(), format)\n } else if (delta.$deleteOp.check(child)) {\n r.delete(child.delete)\n } else if (delta.$retainOp.check(child)) {\n r.retain(child.retain, format)\n } else if (delta.$modifyOp.check(child)) {\n r.modify(deltaAttributionToFormat(child.value, func), format)\n } else {\n error.unexpectedCase()\n }\n }\n return r\n }).done()\n\n/**\n * @param {Y.XmlFragment} ytype\n * @param {object} opts\n * @param {import('@y/protocols/awareness').Awareness} [opts.awareness]\n * @param {Y.AbstractAttributionManager} [opts.attributionManager]\n * @param {typeof attributionToFormat} [opts.mapAttributionToMark]\n * @returns {Plugin}\n */\nexport function syncPlugin (ytype, { awareness = null, attributionManager = Y.noAttributionsManager, mapAttributionToMark = attributionToFormat } = {}) {\n let ignoreTr = false\n let initialized = false\n const mutex = mux.createMutex()\n\n /**\n * Initialize the prosemirror state with what is in the ydoc\n * @param {import('prosemirror-view').EditorView} view\n * @param {()=>void} onInit\n */\n function init (view, onInit) {\n // TODO ydoc.on('sync') ? we could use this to indicate that the ydoc is ready or not\n console.log('initializing prosemirror state with ydoc')\n if (ytype.length === 0) {\n console.log('ytype is empty, applying initial prosemirror state to ydoc')\n // TODO likely want to compare the empty initial doc with the ydoc and apply changes the ydoc if there are any\n // initialize the ydoc with the initial prosemirror state\n const initialPDelta = nodeToDelta(view.state.doc)\n console.log('initialPDelta', initialPDelta.toJSON())\n ytype.applyDelta(initialPDelta.done())\n } else {\n console.log('ytype is not empty, applying initial ydoc content to prosemirror state')\n // Initialize the prosemirror state with what is in the ydoc\n const initialPDelta = nodeToDelta(view.state.doc)\n const d = deltaAttributionToFormat(ytype.getContent(attributionManager, { deep: true }), mapAttributionToMark)\n const initDelta = delta.diff(initialPDelta.done(), d)\n\n console.log('initDelta', initDelta.toJSON())\n const tr = deltaToPSteps(view.state.tr, initDelta.done())\n // TODO revisit all of the meta stuff\n tr.setMeta(ySyncPluginKey, { init: true })\n view.dispatch(tr)\n }\n onInit()\n }\n\n /**\n * @param {import('prosemirror-view').EditorView} view\n * @returns {function(Array>, Y.Transaction): void}\n */\n function getOnChangeHandler (view) {\n return function onChange (events, tr) {\n if (view.isDestroyed || ignoreTr) {\n return\n }\n\n mutex(() => {\n /**\n * @type {Y.YEvent}\n */\n const event = events.find(event => event.target === ytype) || new Y.YEvent(ytype, tr, new Set(null))\n const d = attributionManager === Y.noAttributionsManager ? event.deltaDeep : deltaAttributionToFormat(event.getDelta(attributionManager, { deep: true }), mapAttributionToMark)\n const ptr = deltaToPSteps(view.state.tr, d)\n console.log('ytype emitted event', d.toJSON(), 'and applied changes to pm', ptr.steps)\n ptr.setMeta(ySyncPluginKey, { ytypeEvent: true })\n view.dispatch(ptr)\n }, () => {\n if (attributionManager !== Y.noAttributionsManager) {\n const itemsToRender = Y.mergeIdSets([tr.insertSet, tr.deleteSet])\n /**\n * @todo this could be automatically be calculated in getContent/getDelta when\n * itemsToRender is provided\n * @type {Map>}\n */\n const modified = new Map()\n Y.iterateStructsByIdSet(tr, itemsToRender, item => {\n while (item instanceof Y.Item) {\n const parent = /** @type {Y.AbstractType} */ (item.parent)\n const conf = map.setIfUndefined(modified, parent, set.create)\n if (conf.has(item.parentSub)) break // has already been marked as modified\n conf.add(item.parentSub)\n item = parent._item\n }\n })\n\n if (modified.has(ytype)) {\n setTimeout(() => {\n mutex(() => {\n const d = deltaAttributionToFormat(ytype.getContent(attributionManager, { itemsToRender, retainInserts: true, deep: true, modified }), mapAttributionToMark)\n const ptr = deltaToPSteps(view.state.tr, d)\n ptr.setMeta(ySyncPluginKey, { attributionFix: true })\n console.log('attribution fix event: ', d.toJSON(), 'and applied changes to pm', ptr.steps)\n view.dispatch(ptr)\n })\n }, 0)\n }\n }\n })\n }\n }\n\n return new Plugin({\n key: ySyncPluginKey,\n state: {\n init () {\n return {\n ytype,\n diff: /** @type {ReturnType | undefined} */ (undefined)\n }\n },\n apply (tr, value) {\n console.log('apply', tr, 'has-meta', tr.getMeta(ySyncPluginKey))\n if (tr.getMeta(ySyncPluginKey)) {\n const { transactions } = /** @type {{ transactions: Array }} */ (tr.getMeta(ySyncPluginKey))\n if (!transactions) {\n return value\n }\n // merge all transactions into a single transform\n const transform = new Transform(transactions[0].before)\n\n for (let i = 0; i < transactions.length; i++) {\n console.log('transactions[i]', transactions[i])\n for (let j = 0; j < transactions[i].steps.length; j++) {\n const success = transform.maybeStep(transactions[i].steps[j])\n if (success.failed) {\n // step failed, fallback to full diff\n console.error('[y/prosemirror]: step failed to apply, falling back to a full diff')\n\n const nextDiff = docDiffToDelta(transactions[0].before, transactions[transactions.length - 1].after)\n // TODO what should the right behavior here be?\n return {\n ytype: value.ytype,\n diff: value.diff ? value.diff.apply(nextDiff) : nextDiff\n }\n }\n }\n }\n const nextDiff = trToDelta(transform)\n\n return {\n ytype: value.ytype,\n diff: value.diff ? value.diff.apply(nextDiff) : nextDiff\n }\n }\n return value\n }\n },\n view (view) {\n const onChange = getOnChangeHandler(view)\n // initialize the prosemirror state with what is in the ydoc\n // we wait a tick, because in some cases, the view can be immediately destroyed\n const timeoutId = setTimeout(() => init(view, () => {\n console.log('initialization complete')\n initialized = true\n // subscribe to the ydoc changes, after initialization is complete\n ytype.observeDeep(onChange)\n console.log('subscribed to ydoc changes')\n }), 0)\n\n return {\n update (view, prevState) {\n if (ignoreTr || !initialized) {\n return\n }\n\n const state = ySyncPluginKey.getState(view.state)\n console.log(state)\n if (state.diff) {\n mutex(() => {\n ignoreTr = true\n console.log('and will apply delta to ytype', state.diff.toJSON(), ytype.toJSON())\n ytype.applyDelta(state.diff, attributionManager)\n ignoreTr = false\n })\n // clear the diff so that we don't apply it again\n state.diff = undefined\n }\n },\n destroy () {\n // clear the initialization timeout\n clearTimeout(timeoutId)\n if (initialized) {\n // unsubscribe from the ydoc changes\n ytype.unobserveDeep(onChange)\n }\n initialized = false\n }\n }\n },\n appendTransaction (transactions, _oldState, newState) {\n console.log('transactions', transactions.slice(0))\n transactions = transactions.filter(tr => tr.docChanged && !tr.getMeta(ySyncPluginKey))\n if (transactions.length === 0 || ignoreTr) return undefined\n\n return newState.tr.setMeta(ySyncPluginKey, { transactions })\n }\n // TODO to acccount for cases where appendTransaction is called on an ephemeral state, we may not want to apply the delta to the ytype\n // unless, the editor has actually applied the transaction, perhaps we can return a transaction that has a meta with how to apply the delta? or it returns the delta, and then the state.apply can actually sync it to the ytype?\n // that actually seems less error prone, and might actually enable us to block syncing in certain cases with just a filterTransaction? That's actually pretty nice!\n // per transaction, we can actually choose whether we should sync the transaction to the ytype or not, this would allow much more fine-grained control over syncing.\n\n })\n}\n\n/**\n * @param {readonly import('prosemirror-model').Mark[]} marks\n */\nconst marksToFormattingAttributes = marks => {\n if (marks.length === 0) return null\n /**\n * @type {{[key:string]:any}}\n */\n const formatting = {}\n marks.forEach(mark => {\n formatting[mark.type.name] = mark.attrs\n })\n return formatting\n}\n\n/**\n * @param {{[key:string]:any}} formatting\n * @param {import('prosemirror-model').Schema} schema\n */\nconst formattingAttributesToMarks = (formatting, schema) => object.map(formatting, (v, k) => schema.mark(k, v))\n\n/**\n * @param {Array} ns\n */\nexport const nodesToDelta = ns => {\n /**\n * @type {delta.DeltaBuilderAny}\n */\n const d = delta.create($prosemirrorDelta)\n ns.forEach(n => {\n d.insert(n.isText ? n.text : [nodeToDelta(n)], marksToFormattingAttributes(n.marks))\n })\n return d\n}\n\n/**\n * @param {Node} n\n */\nexport const nodeToDelta = n => {\n /**\n * @type {delta.DeltaBuilderAny}\n */\n const d = delta.create(n.type.name, $prosemirrorDelta)\n d.setMany(n.attrs)\n n.content.content.forEach(c => {\n d.insert(c.isText ? c.text : [nodeToDelta(c)], marksToFormattingAttributes(c.marks))\n })\n return d\n}\n\n/**\n * @param {import('prosemirror-state').Transaction} tr\n * @param {ProsemirrorDelta} d\n * @param {Node} pnode\n * @param {{ i: number }} currPos\n * @return {import('prosemirror-state').Transaction}\n */\nexport const deltaToPSteps = (tr, d, pnode = tr.doc, currPos = { i: 0 }) => {\n const schema = tr.doc.type.schema\n let currParentIndex = 0\n let nOffset = 0\n const pchildren = pnode.children\n for (const attr of d.attrs) {\n tr.setNodeAttribute(currPos.i - 1, attr.key, attr.value)\n }\n d.children.forEach(op => {\n if (delta.$retainOp.check(op)) {\n // skip over i children\n let i = op.retain\n while (i > 0) {\n const pc = pchildren[currParentIndex]\n if (pc.isText) {\n if (op.format != null) {\n const from = currPos.i\n const to = currPos.i + math.min(pc.nodeSize - nOffset, i)\n object.forEach(op.format, (v, k) => {\n if (v == null) {\n tr.removeMark(from, to, schema.marks[k])\n } else {\n tr.addMark(from, to, schema.mark(k, v))\n }\n })\n }\n if (i + nOffset < pc.nodeSize) {\n nOffset += i\n currPos.i += i\n i = 0\n } else {\n currParentIndex++\n i -= pc.nodeSize - nOffset\n currPos.i += pc.nodeSize - nOffset\n nOffset = 0\n }\n } else {\n object.forEach(op.format, (v, k) => {\n if (v == null) {\n tr.removeNodeMark(currPos.i, schema.marks[k])\n } else {\n tr.addNodeMark(currPos.i, schema.mark(k, v))\n }\n })\n currParentIndex++\n currPos.i += pc.nodeSize\n i--\n }\n }\n } else if (delta.$modifyOp.check(op)) {\n currPos.i++\n deltaToPSteps(tr, op.value, pchildren[currParentIndex++], currPos)\n currPos.i++\n } else if (delta.$insertOp.check(op)) {\n const newPChildren = op.insert.map(ins => deltaToPNode(ins, schema, op.format))\n tr.insert(currPos.i, newPChildren)\n currPos.i += newPChildren.reduce((s, c) => c.nodeSize + s, 0)\n } else if (delta.$textOp.check(op)) {\n tr.insert(currPos.i, schema.text(op.insert, formattingAttributesToMarks(op.format, schema)))\n currPos.i += op.length\n } else if (delta.$deleteOp.check(op)) {\n for (let remainingDelLen = op.delete; remainingDelLen > 0;) {\n const pc = pchildren[currParentIndex]\n if (pc === undefined) {\n throw new Error('delete operation is out of bounds')\n }\n if (pc.isText) {\n const delLen = math.min(pc.nodeSize - nOffset, remainingDelLen)\n tr.delete(currPos.i, currPos.i + delLen)\n nOffset += delLen\n if (nOffset === pc.nodeSize) {\n // TODO this can't actually \"jump out\" of the current node\n // jump to next node\n nOffset = 0\n currParentIndex++\n }\n remainingDelLen -= delLen\n } else {\n tr.delete(currPos.i, currPos.i + pc.nodeSize)\n currParentIndex++\n remainingDelLen--\n }\n }\n }\n })\n return tr\n}\n\n/**\n * @param {ProsemirrorDelta} d\n * @param {import('prosemirror-model').Schema} schema\n * @param {delta.FormattingAttributes} dformat\n * @return {Node}\n */\nconst deltaToPNode = (d, schema, dformat) => {\n const attrs = {}\n for (const attr of d.attrs) {\n attrs[attr.key] = attr.value\n }\n const dc = d.children.map(c => delta.$insertOp.check(c) ? c.insert.map(cn => deltaToPNode(cn, schema, c.format)) : (delta.$textOp.check(c) ? [schema.text(c.insert, formattingAttributesToMarks(c.format, schema))] : []))\n return schema.node(d.name, attrs, dc.flat(1), formattingAttributesToMarks(dformat, schema))\n}\n\n/**\n * @param {Node} beforeDoc\n * @param {Node} afterDoc\n */\nexport const docDiffToDelta = (beforeDoc, afterDoc) => {\n const initialDelta = nodeToDelta(beforeDoc)\n const finalDelta = nodeToDelta(afterDoc)\n\n return delta.diff(initialDelta.done(), finalDelta.done())\n}\n\n/**\n * @param {Transform} tr\n */\nexport const trToDelta = (tr) => {\n // const d = delta.create($prosemirrorDelta)\n // tr.steps.forEach((step, i) => {\n // const stepDelta = stepToDelta(step, tr.docs[i])\n // console.log('stepDelta', JSON.stringify(stepDelta.toJSON(), null, 2))\n // console.log('d', JSON.stringify(d.toJSON(), null, 2))\n // d.apply(stepDelta)\n // })\n // return d.done()\n // Calculate delta from initial and final document states to avoid composition issues with delete operations\n // This is more reliable than composing step-by-step, which can lose delete operations and cause \"Unexpected case\" errors\n // after lib0 upgrades that change delta composition behavior\n const initialDelta = nodeToDelta(tr.before)\n const finalDelta = nodeToDelta(tr.doc)\n const resultDelta = delta.diff(initialDelta.done(), finalDelta.done())\n return resultDelta\n}\n\nconst _stepToDelta = s.match({ beforeDoc: Node, afterDoc: Node })\n .if([ReplaceStep, ReplaceAroundStep], (step, { beforeDoc, afterDoc }) => {\n const oldStart = beforeDoc.resolve(step.from)\n const oldEnd = beforeDoc.resolve(step.to)\n const newStart = afterDoc.resolve(step.from)\n\n const newEnd = afterDoc.resolve(step instanceof ReplaceAroundStep ? step.getMap().map(step.to) : step.from + step.slice.size)\n\n const oldBlockRange = oldStart.blockRange(oldEnd)\n const newBlockRange = newStart.blockRange(newEnd)\n const oldDelta = deltaForBlockRange(oldBlockRange)\n const newDelta = deltaForBlockRange(newBlockRange)\n const diffD = delta.diff(oldDelta, newDelta)\n const stepDelta = deltaModifyNodeAt(beforeDoc, oldBlockRange?.start || newBlockRange?.start || 0, d => { d.append(diffD) })\n return stepDelta\n })\n .if(AddMarkStep, (step, { beforeDoc }) =>\n deltaModifyNodeAt(beforeDoc, step.from, d => { d.retain(step.to - step.from, marksToFormattingAttributes([step.mark])) })\n )\n .if(AddNodeMarkStep, (step, { beforeDoc }) =>\n deltaModifyNodeAt(beforeDoc, step.pos, d => { d.retain(1, marksToFormattingAttributes([step.mark])) })\n )\n .if(RemoveMarkStep, (step, { beforeDoc }) =>\n deltaModifyNodeAt(beforeDoc, step.from, d => { d.retain(step.to - step.from, { [step.mark.type.name]: null }) })\n )\n .if(RemoveNodeMarkStep, (step, { beforeDoc }) =>\n deltaModifyNodeAt(beforeDoc, step.pos, d => { d.retain(1, { [step.mark.type.name]: null }) })\n )\n .if(AttrStep, (step, { beforeDoc }) =>\n deltaModifyNodeAt(beforeDoc, step.pos, d => { d.modify(delta.create().set(step.attr, step.value)) })\n )\n .if(DocAttrStep, step =>\n delta.create().set(step.attr, step.value)\n )\n .else(_step => {\n // unknown step kind\n error.unexpectedCase()\n })\n .done()\n\n/**\n * @param {import('prosemirror-transform').Step} step\n * @param {import('prosemirror-model').Node} beforeDoc\n * @return {ProsemirrorDelta}\n */\nexport const stepToDelta = (step, beforeDoc) => {\n const stepResult = step.apply(beforeDoc)\n if (stepResult.failed) {\n throw new Error('step failed to apply')\n }\n return _stepToDelta(step, { beforeDoc, afterDoc: stepResult.doc })\n}\n\n/**\n *\n * @param {import('prosemirror-model').NodeRange | null} blockRange\n */\nfunction deltaForBlockRange (blockRange) {\n if (blockRange === null) {\n return delta.create()\n }\n const { startIndex, endIndex, parent } = blockRange\n return nodesToDelta(parent.content.content.slice(startIndex, endIndex))\n}\n\n/**\n * This function is used to find the delta offset for a given prosemirror offset in a node.\n * Given the following document:\n * Hello world
Hello world!
\n * The delta structure would look like this:\n * 0: p\n * - 0: text(\"Hello world\")\n * 1: blockquote\n * - 0: p\n * - 0: text(\"Hello world!\")\n * So the prosemirror position 10 would be within the delta offset path: 0, 0 and have an offset into the text node of 9 (since it is the 9th character in the text node).\n *\n * So the return value would be [0, 9], which is the path of: p, text(\"Hello wor\")\n *\n * @param {Node} node\n * @param {number} searchPmOffset The p offset to find the delta offset for\n * @return {number[]} The delta offset path for the search pm offset\n */\nexport function pmToDeltaPath (node, searchPmOffset = 0) {\n if (searchPmOffset === 0) {\n // base case\n return [0]\n }\n\n const resolvedOffset = node.resolve(searchPmOffset)\n const depth = resolvedOffset.depth\n const path = []\n if (depth === 0) {\n // if the offset is at the root node, return the index of the node\n return [resolvedOffset.index(0)]\n }\n // otherwise, add the index of each parent node to the path\n for (let d = 0; d < depth; d++) {\n path.push(resolvedOffset.index(d))\n }\n\n // add any offset into the parent node to the path\n path.push(resolvedOffset.parentOffset)\n\n return path\n}\n\n/**\n * Inverse of {@link pmToDeltaPath}\n * @param {number[]} deltaPath\n * @param {Node} node\n * @return {number} The prosemirror offset for the delta path\n */\nexport function deltaPathToPm (deltaPath, node) {\n let pmOffset = 0\n let curNode = node\n\n // Special case: if path has only one element, it's a child index at depth 0\n if (deltaPath.length === 1) {\n const childIndex = deltaPath[0]\n // Add sizes of all children before the target index\n for (let j = 0; j < childIndex; j++) {\n pmOffset += curNode.children[j].nodeSize\n }\n return pmOffset\n }\n\n // Handle all elements except the last (which is an offset)\n for (let i = 0; i < deltaPath.length - 1; i++) {\n const childIndex = deltaPath[i]\n // Add sizes of all children before the target child\n for (let j = 0; j < childIndex; j++) {\n pmOffset += curNode.children[j].nodeSize\n }\n // Add 1 for the opening tag of the target child, then navigate into it\n pmOffset += 1\n curNode = curNode.children[childIndex]\n }\n\n // Last element is an offset within the current node\n pmOffset += deltaPath[deltaPath.length - 1]\n\n return pmOffset\n}\n\n/**\n * @param {Node} node\n * @param {number} pmOffset\n * @param {(d:delta.DeltaBuilderAny)=>any} mod\n * @return {ProsemirrorDelta}\n */\nexport const deltaModifyNodeAt = (node, pmOffset, mod) => {\n const dpath = pmToDeltaPath(node, pmOffset)\n let currentOp = delta.create($prosemirrorDelta)\n const lastIndex = dpath.length - 1\n currentOp.retain(lastIndex >= 0 ? dpath[lastIndex] : 0)\n mod(currentOp)\n for (let i = lastIndex - 1; i >= 0; i--) {\n currentOp = /** @type {delta.DeltaBuilderAny} */ (delta.create($prosemirrorDelta).retain(dpath[i]).modify(currentOp))\n }\n return currentOp\n}\n"],"names":["PluginKey","buf","sha256","set","random","Plugin","eventloop","AllSelection","NodeSelection","TextSelection","createMutex","environment","dom","Y","PModel","math","error","object","simpleDiff","map","utils.hashOfJSON","Fragment","Node","DecorationSet","Decoration","Item","ContentType","Text","XmlElement","UndoManager","delta","s","mux","Transform","ReplaceStep","ReplaceAroundStep","AddMarkStep","AddNodeMarkStep","RemoveMarkStep","RemoveNodeMarkStep","AttrStep","DocAttrStep"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,cAAc,GAAG,IAAIA,0BAAS,CAAC,QAAQ;;AAEpD;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,cAAc,GAAG,IAAIA,0BAAS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AI,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC;AACxD,EAAE,GAAG,CAAC,SAAS;AACf,EAAE,KAAK,IAAI,CAAC,GAAG,SAAS,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;AAC3C,IAAI,SAAS,yCAAyCA,gBAAK,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC;AACxH,EAAE;AACF,EAAE,OAAO;AACT;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
+\ No newline at end of file
+diff --git a/src/index.js b/src/index.js
+index ac407e0c363309c970f3dbcbd66db00f9cd1656a..35f22a04a360899343e5a03b9a3dffce47a6fa9d 100644
+--- a/src/index.js
++++ b/src/index.js
+@@ -9,7 +9,6 @@ import * as set from 'lib0/set'
+ import * as map from 'lib0/map'
+
+ import { Node } from 'prosemirror-model'
+-import { EditorView } from 'prosemirror-view'
+ import { AddMarkStep, RemoveMarkStep, AttrStep, AddNodeMarkStep, ReplaceStep, ReplaceAroundStep, RemoveNodeMarkStep, DocAttrStep, Transform } from 'prosemirror-transform'
+ import { ySyncPluginKey } from './plugins/keys.js'
+ import { Plugin } from 'prosemirror-state'
+@@ -20,39 +19,69 @@ const $prosemirrorDelta = delta.$delta({ name: s.$string, attrs: s.$record(s.$st
+ * @typedef {s.Unwrap<$prosemirrorDelta>} ProsemirrorDelta
+ */
+
++// y-attribution-deletion & y-attribution-insertion & y-attribution-format (or mod?)
++// add attributes (userId: string[], timestamp: number) (see `YAttribution` (ask Kevin))
++// define how an insertion mark works on a node
++// situations like deleted node, yet has inserted content (handle nested content)
++// insertion within a node that was inserted + another user inserted more content into that node (hovers per user likely)
++
+ /**
+- * @param {object|null} format
+- * @param {object|null} attribution
++ * @template {import('lib0/delta').Attribution} T
++ * @param {Record | null} format
++ * @param {T} attribution
++ * @returns {Record | null}
+ */
+-const attributionToFormat = (format, attribution) => attribution
+- ? object.assign({}, format, {
+- ychange: attribution.insert
+- ? { type: 'added', user: attribution.insert?.[0] }
+- : { type: 'removed', user: attribution.delete?.[0] }
+- })
+- : format
++const attributionToFormat = (format, attribution) => {
++ /**
++ * @type {Record | null}
++ */
++ let mergeWith = null
++ if (attribution.insert) {
++ mergeWith = {
++ 'y-attribution-insertion': {
++ userIds: attribution.insert ? attribution.insert : null,
++ timestamp: attribution.insertAt ? attribution.insertAt : null
++ }
++ }
++ } else if (attribution.delete) {
++ mergeWith = {
++ 'y-attribution-deletion': {
++ userIds: attribution.delete ? attribution.delete : null,
++ timestamp: attribution.deleteAt ? attribution.deleteAt : null
++ }
++ }
++ } else if (attribution.format) {
++ mergeWith = {
++ 'y-attribution-format': {
++ userIdsByAttr: attribution.format ? attribution.format : null,
++ timestamp: attribution.formatAt ? attribution.formatAt : null
++ }
++ }
++ }
++ return object.assign({}, format, mergeWith)
++}
+
+ /**
+ * Transform delta with attributions to delta with formats (marks).
+ */
+-const deltaAttributionToFormat = s.match()
+- .if(delta.$deltaAny, d => {
++const deltaAttributionToFormat = s.match(s.$function)
++ .if(delta.$deltaAny, (d, func) => {
+ const r = delta.create(d.name)
+ for (const attr of d.attrs) {
+ r.attrs[attr.key] = attr.clone()
+ }
+ for (const child of d.children) {
++ const format = child.attribution ? func(child.format, child.attribution) : child.format
+ if (delta.$insertOp.check(child)) {
+- const f = attributionToFormat(child.format, child.attribution)
+- r.insert(child.insert.map(c => delta.$deltaAny.check(c) ? deltaAttributionToFormat(c) : c), f)
++ r.insert(child.insert.map(c => delta.$deltaAny.check(c) ? deltaAttributionToFormat(c, func) : c), format)
+ } else if (delta.$textOp.check(child)) {
+- r.insert(child.insert.slice(), attributionToFormat(child.format, child.attribution))
++ r.insert(child.insert.slice(), format)
+ } else if (delta.$deleteOp.check(child)) {
+ r.delete(child.delete)
+ } else if (delta.$retainOp.check(child)) {
+- r.retain(child.retain, attributionToFormat(child.format, child.attribution))
++ r.retain(child.retain, format)
+ } else if (delta.$modifyOp.check(child)) {
+- r.modify(deltaAttributionToFormat(child.value), attributionToFormat(child.format, child.attribution))
++ r.modify(deltaAttributionToFormat(child.value, func), format)
+ } else {
+ error.unexpectedCase()
+ }
+@@ -65,46 +94,61 @@ const deltaAttributionToFormat = s.match()
+ * @param {object} opts
+ * @param {import('@y/protocols/awareness').Awareness} [opts.awareness]
+ * @param {Y.AbstractAttributionManager} [opts.attributionManager]
++ * @param {typeof attributionToFormat} [opts.mapAttributionToMark]
+ * @returns {Plugin}
+ */
+-export function syncPlugin (ytype, { awareness = null, attributionManager = Y.noAttributionsManager } = {}) {
++export function syncPlugin (ytype, { awareness = null, attributionManager = Y.noAttributionsManager, mapAttributionToMark = attributionToFormat } = {}) {
++ let ignoreTr = false
++ let initialized = false
+ const mutex = mux.createMutex()
+
+ /**
+ * Initialize the prosemirror state with what is in the ydoc
+- * @param {EditorView} view
++ * @param {import('prosemirror-view').EditorView} view
++ * @param {()=>void} onInit
+ */
+- function init (view) {
+- if (view.isDestroyed) {
+- return
+- }
+-
+- // Initialize the prosemirror state with what is in the ydoc
+- const initialPDelta = nodeToDelta(view.state.doc)
+- const d = deltaAttributionToFormat(ytype.getContent(attributionManager, { deep: true }))
+- const initDelta = delta.diff(initialPDelta.done(), d)
+-
+- // TODO this need a mutex?
+- mutex(() => {
++ function init (view, onInit) {
++ // TODO ydoc.on('sync') ? we could use this to indicate that the ydoc is ready or not
++ console.log('initializing prosemirror state with ydoc')
++ if (ytype.length === 0) {
++ console.log('ytype is empty, applying initial prosemirror state to ydoc')
++ // TODO likely want to compare the empty initial doc with the ydoc and apply changes the ydoc if there are any
++ // initialize the ydoc with the initial prosemirror state
++ const initialPDelta = nodeToDelta(view.state.doc)
++ console.log('initialPDelta', initialPDelta.toJSON())
++ ytype.applyDelta(initialPDelta.done())
++ } else {
++ console.log('ytype is not empty, applying initial ydoc content to prosemirror state')
++ // Initialize the prosemirror state with what is in the ydoc
++ const initialPDelta = nodeToDelta(view.state.doc)
++ const d = deltaAttributionToFormat(ytype.getContent(attributionManager, { deep: true }), mapAttributionToMark)
++ const initDelta = delta.diff(initialPDelta.done(), d)
++
++ console.log('initDelta', initDelta.toJSON())
+ const tr = deltaToPSteps(view.state.tr, initDelta.done())
+ // TODO revisit all of the meta stuff
+ tr.setMeta(ySyncPluginKey, { init: true })
+ view.dispatch(tr)
+- })
++ }
++ onInit()
+ }
+
+ /**
+- * @param {EditorView} view
++ * @param {import('prosemirror-view').EditorView} view
+ * @returns {function(Array>, Y.Transaction): void}
+ */
+ function getOnChangeHandler (view) {
+ return function onChange (events, tr) {
++ if (view.isDestroyed || ignoreTr) {
++ return
++ }
++
+ mutex(() => {
+ /**
+ * @type {Y.YEvent}
+ */
+ const event = events.find(event => event.target === ytype) || new Y.YEvent(ytype, tr, new Set(null))
+- const d = attributionManager === Y.noAttributionsManager ? event.deltaDeep : deltaAttributionToFormat(event.getDelta(attributionManager, { deep: true }))
++ const d = attributionManager === Y.noAttributionsManager ? event.deltaDeep : deltaAttributionToFormat(event.getDelta(attributionManager, { deep: true }), mapAttributionToMark)
+ const ptr = deltaToPSteps(view.state.tr, d)
+ console.log('ytype emitted event', d.toJSON(), 'and applied changes to pm', ptr.steps)
+ ptr.setMeta(ySyncPluginKey, { ytypeEvent: true })
+@@ -131,7 +175,7 @@ export function syncPlugin (ytype, { awareness = null, attributionManager = Y.no
+ if (modified.has(ytype)) {
+ setTimeout(() => {
+ mutex(() => {
+- const d = deltaAttributionToFormat(ytype.getContent(attributionManager, { itemsToRender, retainInserts: true, deep: true, modified }))
++ const d = deltaAttributionToFormat(ytype.getContent(attributionManager, { itemsToRender, retainInserts: true, deep: true, modified }), mapAttributionToMark)
+ const ptr = deltaToPSteps(view.state.tr, d)
+ ptr.setMeta(ySyncPluginKey, { attributionFix: true })
+ console.log('attribution fix event: ', d.toJSON(), 'and applied changes to pm', ptr.steps)
+@@ -147,147 +191,104 @@ export function syncPlugin (ytype, { awareness = null, attributionManager = Y.no
+ return new Plugin({
+ key: ySyncPluginKey,
+ state: {
+- init: () => {
++ init () {
+ return {
+- ytype
++ ytype,
++ diff: /** @type {ReturnType | undefined} */ (undefined)
++ }
++ },
++ apply (tr, value) {
++ console.log('apply', tr, 'has-meta', tr.getMeta(ySyncPluginKey))
++ if (tr.getMeta(ySyncPluginKey)) {
++ const { transactions } = /** @type {{ transactions: Array }} */ (tr.getMeta(ySyncPluginKey))
++ if (!transactions) {
++ return value
++ }
++ // merge all transactions into a single transform
++ const transform = new Transform(transactions[0].before)
++
++ for (let i = 0; i < transactions.length; i++) {
++ console.log('transactions[i]', transactions[i])
++ for (let j = 0; j < transactions[i].steps.length; j++) {
++ const success = transform.maybeStep(transactions[i].steps[j])
++ if (success.failed) {
++ // step failed, fallback to full diff
++ console.error('[y/prosemirror]: step failed to apply, falling back to a full diff')
++
++ const nextDiff = docDiffToDelta(transactions[0].before, transactions[transactions.length - 1].after)
++ // TODO what should the right behavior here be?
++ return {
++ ytype: value.ytype,
++ diff: value.diff ? value.diff.apply(nextDiff) : nextDiff
++ }
++ }
++ }
++ }
++ const nextDiff = trToDelta(transform)
++
++ return {
++ ytype: value.ytype,
++ diff: value.diff ? value.diff.apply(nextDiff) : nextDiff
++ }
+ }
++ return value
+ }
+ },
+- view: (view) => {
+- // initialize the prosemirror state with what is in the ydoc
+- const timeoutId = setTimeout(() => init(view), 0)
+-
++ view (view) {
+ const onChange = getOnChangeHandler(view)
+- // subscribe to the ydoc changes
+- ytype.observeDeep(onChange)
++ // initialize the prosemirror state with what is in the ydoc
++ // we wait a tick, because in some cases, the view can be immediately destroyed
++ const timeoutId = setTimeout(() => init(view, () => {
++ console.log('initialization complete')
++ initialized = true
++ // subscribe to the ydoc changes, after initialization is complete
++ ytype.observeDeep(onChange)
++ console.log('subscribed to ydoc changes')
++ }), 0)
+
+ return {
+- destroy: () => {
++ update (view, prevState) {
++ if (ignoreTr || !initialized) {
++ return
++ }
++
++ const state = ySyncPluginKey.getState(view.state)
++ console.log(state)
++ if (state.diff) {
++ mutex(() => {
++ ignoreTr = true
++ console.log('and will apply delta to ytype', state.diff.toJSON(), ytype.toJSON())
++ ytype.applyDelta(state.diff, attributionManager)
++ ignoreTr = false
++ })
++ // clear the diff so that we don't apply it again
++ state.diff = undefined
++ }
++ },
++ destroy () {
+ // clear the initialization timeout
+ clearTimeout(timeoutId)
+- // unsubscribe from the ydoc changes
+- ytype.unobserveDeep(onChange)
++ if (initialized) {
++ // unsubscribe from the ydoc changes
++ ytype.unobserveDeep(onChange)
++ }
++ initialized = false
+ }
+ }
+ },
+- appendTransaction (transactions, oldState) {
+- transactions = transactions.filter(doc => doc.docChanged)
+- if (transactions.length === 0) return undefined
+-
+- // merge all transactions into a single transform
+- const tr = new Transform(oldState.doc)
++ appendTransaction (transactions, _oldState, newState) {
++ console.log('transactions', transactions.slice(0))
++ transactions = transactions.filter(tr => tr.docChanged && !tr.getMeta(ySyncPluginKey))
++ if (transactions.length === 0 || ignoreTr) return undefined
+
+- for (let i = 0; i < transactions.length; i++) {
+- for (let j = 0; j < transactions[i].steps.length; j++) {
+- tr.step(transactions[i].steps[j])
+- }
+- }
+-
+- mutex(() => {
+- const d = trToDelta(tr)
+- console.log('editor received steps', tr.steps, 'and and applied delta to ytyp', d.toJSON())
+- ytype.applyDelta(d, attributionManager)
+- })
++ return newState.tr.setMeta(ySyncPluginKey, { transactions })
+ }
+- })
+-}
++ // TODO to acccount for cases where appendTransaction is called on an ephemeral state, we may not want to apply the delta to the ytype
++ // unless, the editor has actually applied the transaction, perhaps we can return a transaction that has a meta with how to apply the delta? or it returns the delta, and then the state.apply can actually sync it to the ytype?
++ // that actually seems less error prone, and might actually enable us to block syncing in certain cases with just a filterTransaction? That's actually pretty nice!
++ // per transaction, we can actually choose whether we should sync the transaction to the ytype or not, this would allow much more fine-grained control over syncing.
+
+-export class YEditorView extends EditorView {
+- /**
+- * @param {ConstructorParameters[0]} mnt
+- * @param {ConstructorParameters[1]} props
+- */
+- constructor (mnt, props) {
+- super(mnt, {
+- ...props,
+- dispatchTransaction: tr => {
+- // Get the new state by applying the transaction
+- const newState = this.state.apply(tr)
+- this.mux(() => {
+- if (tr.docChanged) {
+- const d = trToDelta(tr)
+- console.log('editor received steps', tr.steps, 'and and applied delta to ytyp', d.toJSON())
+- this.y?.ytype.applyDelta(d, this.y.am)
+- }
+- })
+- this.updateState(newState)
+- }
+- })
+- this.mux = mux.createMutex()
+- /**
+- * @type {{ ytype: Y.XmlFragment, am: Y.AbstractAttributionManager, awareness: any }?}
+- */
+- this.y = null
+- /**
+- * @param {Array>} events
+- * @param {Y.Transaction} tr
+- */
+- this._observer = (events, tr) => {
+- this.mux(() => {
+- /**
+- * @type {Y.YEvent}
+- */
+- const event = events.find(event => event.target === this.y.ytype) || new Y.YEvent(this.y.ytype, tr, new Set(null))
+- const d = this.y.am === Y.noAttributionsManager ? event.deltaDeep : deltaAttributionToFormat(event.getDelta(this.y.am, { deep: true }))
+- const ptr = deltaToPSteps(this.state.tr, d)
+- console.log('ytype emitted event', d.toJSON(), 'and applied changes to pm', ptr.steps)
+- this.dispatch(ptr)
+- }, () => {
+- if (this.y.am !== Y.noAttributionsManager) {
+- const itemsToRender = Y.mergeIdSets([tr.insertSet, tr.deleteSet])
+- /**
+- * @todo this could be automatically be calculated in getContent/getDelta when
+- * itemsToRender is provided
+- * @type {Map>}
+- */
+- const modified = new Map()
+- Y.iterateStructsByIdSet(tr, itemsToRender, /** @param {any} item */ item => {
+- while (item instanceof Y.Item) {
+- const parent = /** @type {Y.AbstractType} */ (item.parent)
+- const conf = map.setIfUndefined(modified, parent, set.create)
+- if (conf.has(item.parentSub)) break // has already been marked as modified
+- conf.add(item.parentSub)
+- item = parent._item
+- }
+- })
+- if (modified.has(this.y.ytype)) {
+- setTimeout(() => {
+- this.mux(() => {
+- const d = deltaAttributionToFormat(this.y.ytype.getContent(this.y.am, { itemsToRender, retainInserts: true, deep: true, modified }))
+- const ptr = deltaToPSteps(this.state.tr, d)
+- console.log('attribution fix event: ', d.toJSON(), 'and applied changes to pm', ptr.steps)
+- this.dispatch(ptr)
+- })
+- }, 0)
+- }
+- }
+- })
+- }
+- }
+-
+- /**
+- * @param {Y.XmlFragment} ytype
+- * @param {object} opts
+- * @param {any} [opts.awareness]
+- * @param {Y.AbstractAttributionManager} [opts.attributionManager]
+- */
+- bindYType (ytype, { awareness = null, attributionManager = Y.noAttributionsManager } = {}) {
+- this.y?.ytype.unobserveDeep(this._observer)
+- this.y = { ytype, awareness, am: attributionManager || Y.noAttributionsManager }
+- const initialPDelta = nodeToDelta(this.state.doc)
+- const d = deltaAttributionToFormat(ytype.getContent(this.y.am, { deep: true }))
+- const initDelta = delta.diff(initialPDelta.done(), d)
+- this.mux(() => {
+- this.dispatch(deltaToPSteps(this.state.tr, initDelta.done()))
+- })
+- ytype.observeDeep(this._observer)
+- }
+-
+- destroy () {
+- this.y?.ytype.unobserveDeep(this._observer)
+- this.y = null
+- super.destroy()
+- }
++ })
+ }
+
+ /**
+@@ -450,19 +451,36 @@ const deltaToPNode = (d, schema, dformat) => {
+ return schema.node(d.name, attrs, dc.flat(1), formattingAttributesToMarks(dformat, schema))
+ }
+
++/**
++ * @param {Node} beforeDoc
++ * @param {Node} afterDoc
++ */
++export const docDiffToDelta = (beforeDoc, afterDoc) => {
++ const initialDelta = nodeToDelta(beforeDoc)
++ const finalDelta = nodeToDelta(afterDoc)
++
++ return delta.diff(initialDelta.done(), finalDelta.done())
++}
++
+ /**
+ * @param {Transform} tr
+- * @return {ProsemirrorDelta}
+ */
+ export const trToDelta = (tr) => {
+- const d = delta.create($prosemirrorDelta)
+- tr.steps.forEach((step, i) => {
+- const stepDelta = stepToDelta(step, tr.docs[i])
+- console.log('stepDelta', JSON.stringify(stepDelta.toJSON(), null, 2))
+- console.log('d', JSON.stringify(d.toJSON(), null, 2))
+- d.apply(stepDelta)
+- })
+- return d.done()
++ // const d = delta.create($prosemirrorDelta)
++ // tr.steps.forEach((step, i) => {
++ // const stepDelta = stepToDelta(step, tr.docs[i])
++ // console.log('stepDelta', JSON.stringify(stepDelta.toJSON(), null, 2))
++ // console.log('d', JSON.stringify(d.toJSON(), null, 2))
++ // d.apply(stepDelta)
++ // })
++ // return d.done()
++ // Calculate delta from initial and final document states to avoid composition issues with delete operations
++ // This is more reliable than composing step-by-step, which can lose delete operations and cause "Unexpected case" errors
++ // after lib0 upgrades that change delta composition behavior
++ const initialDelta = nodeToDelta(tr.before)
++ const finalDelta = nodeToDelta(tr.doc)
++ const resultDelta = delta.diff(initialDelta.done(), finalDelta.done())
++ return resultDelta
+ }
+
+ const _stepToDelta = s.match({ beforeDoc: Node, afterDoc: Node })
+@@ -470,7 +488,9 @@ const _stepToDelta = s.match({ beforeDoc: Node, afterDoc: Node })
+ const oldStart = beforeDoc.resolve(step.from)
+ const oldEnd = beforeDoc.resolve(step.to)
+ const newStart = afterDoc.resolve(step.from)
+- const newEnd = afterDoc.resolve(step.from + step.slice.size)
++
++ const newEnd = afterDoc.resolve(step instanceof ReplaceAroundStep ? step.getMap().map(step.to) : step.from + step.slice.size)
++
+ const oldBlockRange = oldStart.blockRange(oldEnd)
+ const newBlockRange = newStart.blockRange(newEnd)
+ const oldDelta = deltaForBlockRange(oldBlockRange)
+diff --git a/src/plugins/keys.js b/src/plugins/keys.js
+index 1fa3d7211b4c0a4612d002c34f008ca7630ebe94..ab12ed32d29fae3fc3c08e8fb8293b0d6b117393 100644
+--- a/src/plugins/keys.js
++++ b/src/plugins/keys.js
+@@ -4,7 +4,7 @@ import { PluginKey } from 'prosemirror-state' // eslint-disable-line
+ * The unique prosemirror plugin key for syncPlugin
+ *
+ * @public
+- * @type {PluginKey<{ytype: Y.XmlFragment}>}
++ * @type {PluginKey<{ytype: Y.XmlFragment; diff?: import('../index.js').ProsemirrorDelta}>}
+ */
+ export const ySyncPluginKey = new PluginKey('y-sync')
+
+diff --git a/src/y-prosemirror.js b/src/y-prosemirror.js
+index bb072b6e31a0184a56d7873dcae647f0d5711559..e88de3b0f7e366cf1c32e8f8f7cd8b864e2cc872 100644
+--- a/src/y-prosemirror.js
++++ b/src/y-prosemirror.js
+@@ -1,5 +1,5 @@
+ export * from './plugins/cursor-plugin.js'
+-export { ySyncPlugin, isVisible, getRelativeSelection, ProsemirrorBinding, updateYFragment } from './plugins/sync-plugin.js'
++// export { ySyncPlugin, isVisible, getRelativeSelection, ProsemirrorBinding, updateYFragment } from './plugins/sync-plugin.js'
+ export * from './plugins/undo-plugin.js'
+ export * from './plugins/keys.js'
+ export {
+@@ -9,3 +9,5 @@ export {
+ prosemirrorToYXmlFragment, yXmlFragmentToProseMirrorRootNode, yXmlFragmentToProseMirrorFragment,
+ initProseMirrorDoc
+ } from './lib.js'
++export * from './index.js'
++export * from './plugins/sync-plugin.js'
diff --git a/playground/package.json b/playground/package.json
index 1b7008757c..f364382585 100644
--- a/playground/package.json
+++ b/playground/package.json
@@ -29,11 +29,6 @@
"@blocknote/xl-pdf-exporter": "workspace:^",
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.1",
- "@liveblocks/core": "3.7.1-tiptap3",
- "@liveblocks/react": "3.7.1-tiptap3",
- "@liveblocks/react-blocknote": "3.7.1-tiptap3",
- "@liveblocks/react-tiptap": "3.7.1-tiptap3",
- "@liveblocks/react-ui": "3.7.1-tiptap3",
"@mantine/core": "^8.3.4",
"@mantine/hooks": "^8.3.4",
"@mantine/utils": "^6.0.22",
@@ -50,7 +45,6 @@
"@uppy/status-bar": "^3.3.3",
"@uppy/webcam": "^3.4.2",
"@uppy/xhr-upload": "^3.6.8",
- "@y-sweet/react": "^0.6.4",
"ai": "^5.0.102",
"autoprefixer": "10.4.21",
"docx": "^9.5.1",
@@ -58,8 +52,7 @@
"react-dom": "^19.2.1",
"react-icons": "^5.5.0",
"react-router-dom": "^6.30.1",
- "y-partykit": "^0.0.25",
- "yjs": "^13.6.27"
+ "@y/y": "14.0.0-19"
},
"devDependencies": {
"@tailwindcss/vite": "^4.1.14",
diff --git a/playground/src/examples.gen.tsx b/playground/src/examples.gen.tsx
index 67236495e5..61c7134952 100644
--- a/playground/src/examples.gen.tsx
+++ b/playground/src/examples.gen.tsx
@@ -1423,7 +1423,7 @@
],
"dependencies": {
"y-partykit": "^0.0.25",
- "yjs": "^13.6.27"
+ "@y/y": "14.0.0-19"
} as any
},
"title": "Collaborative Editing with PartyKit",
@@ -1452,7 +1452,7 @@
"@liveblocks/react-blocknote": "3.7.1-tiptap3",
"@liveblocks/react-tiptap": "3.7.1-tiptap3",
"@liveblocks/react-ui": "3.7.1-tiptap3",
- "yjs": "^13.6.27"
+ "@y/y": "14.0.0-19"
} as any
},
"title": "Collaborative Editing with Liveblocks",
@@ -1547,7 +1547,7 @@
],
"dependencies": {
"y-partykit": "^0.0.25",
- "yjs": "^13.6.27",
+ "@y/y": "14.0.0-19",
"@mantine/core": "^8.3.4"
} as any
},
@@ -1573,7 +1573,7 @@
],
"dependencies": {
"y-partykit": "^0.0.25",
- "yjs": "^13.6.27"
+ "@y/y": "14.0.0-19"
} as any
},
"title": "Ghost Writer",
@@ -1598,7 +1598,7 @@
],
"dependencies": {
"y-partykit": "^0.0.25",
- "yjs": "^13.6.27"
+ "@y/y": "14.0.0-19"
} as any
},
"title": "Collaborative Editing with Forking",
@@ -1736,7 +1736,7 @@
"@mantine/core": "^8.3.4",
"ai": "^5.0.102",
"y-partykit": "^0.0.25",
- "yjs": "^13.6.27"
+ "@y/y": "14.0.0-19"
} as any
},
"title": "AI + Ghost Writer",
@@ -1763,7 +1763,7 @@
"@mantine/core": "^8.3.4",
"ai": "^5.0.102",
"y-partykit": "^0.0.25",
- "yjs": "^13.6.27"
+ "@y/y": "14.0.0-19"
} as any
},
"title": "AI manual execution",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 843becc3bd..6382e4a360 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -9,6 +9,11 @@ overrides:
'@tiptap/core': ^3.0.0
'@tiptap/pm': ^3.0.0
+patchedDependencies:
+ '@y/prosemirror':
+ hash: f9d1f345073554bd5394487b602c1813d6723c77083017611a94bc9580cac896
+ path: patches/@y__prosemirror.patch
+
importers:
.:
@@ -124,21 +129,6 @@ importers:
'@heroicons/react':
specifier: ^2.2.0
version: 2.2.0(react@19.2.1)
- '@liveblocks/client':
- specifier: 3.7.1-tiptap3
- version: 3.7.1-tiptap3(@types/json-schema@7.0.15)
- '@liveblocks/react':
- specifier: 3.7.1-tiptap3
- version: 3.7.1-tiptap3(@types/json-schema@7.0.15)(@types/react-dom@19.2.2(@types/react@19.2.2))(@types/react@19.2.2)(react@19.2.1)
- '@liveblocks/react-blocknote':
- specifier: 3.7.1-tiptap3
- version: 3.7.1-tiptap3(33c6616930f6f7c88a9e36083f9553b0)
- '@liveblocks/react-tiptap':
- specifier: 3.7.1-tiptap3
- version: 3.7.1-tiptap3(61deabd8fbfc94ee8c4893e0e616a70c)
- '@liveblocks/react-ui':
- specifier: 3.7.1-tiptap3
- version: 3.7.1-tiptap3(@types/json-schema@7.0.15)(@types/react-dom@19.2.2(@types/react@19.2.2))(@types/react@19.2.2)(react-dom@19.2.1(react@19.2.1))(react@19.2.1)
'@mantine/core':
specifier: ^8.3.4
version: 8.3.4(@mantine/hooks@8.3.4(react@19.2.1))(@types/react@19.2.2)(react-dom@19.2.1(react@19.2.1))(react@19.2.1)
@@ -229,9 +219,9 @@ importers:
'@vercel/og':
specifier: ^0.6.8
version: 0.6.8
- '@y-sweet/react':
- specifier: ^0.6.3
- version: 0.6.4(react@19.2.1)(yjs@13.6.27)
+ '@y/y':
+ specifier: 14.0.0-19
+ version: 14.0.0-19
ai:
specifier: ^5.0.102
version: 5.0.102(zod@3.25.76)
@@ -283,9 +273,6 @@ importers:
nodemailer:
specifier: ^7.0.11
version: 7.0.11
- partykit:
- specifier: ^0.0.115
- version: 0.0.115
pg:
specifier: ^8.16.3
version: 8.16.3
@@ -322,12 +309,6 @@ importers:
twoslash:
specifier: ^0.3.4
version: 0.3.4(typescript@5.9.3)
- y-partykit:
- specifier: ^0.0.25
- version: 0.0.25
- yjs:
- specifier: ^13.6.27
- version: 13.6.27
zod:
specifier: ^3.25.76
version: 3.25.76
@@ -422,6 +403,12 @@ importers:
'@mantine/utils':
specifier: ^6.0.22
version: 6.0.22(react@19.2.1)
+ '@y/protocols':
+ specifier: 1.0.6-3
+ version: 1.0.6-3(@y/y@14.0.0-19)
+ '@y/y':
+ specifier: 14.0.0-19
+ version: 14.0.0-19
react:
specifier: ^19.2.1
version: 19.2.1
@@ -2041,488 +2028,7 @@ importers:
specifier: ^5.4.20
version: 5.4.20(@types/node@24.8.1)(lightningcss@1.30.1)(terser@5.44.1)
- examples/03-ui-components/15-advanced-tables:
- dependencies:
- '@blocknote/ariakit':
- specifier: latest
- version: link:../../../packages/ariakit
- '@blocknote/core':
- specifier: latest
- version: link:../../../packages/core
- '@blocknote/mantine':
- specifier: latest
- version: link:../../../packages/mantine
- '@blocknote/react':
- specifier: latest
- version: link:../../../packages/react
- '@blocknote/shadcn':
- specifier: latest
- version: link:../../../packages/shadcn
- '@mantine/core':
- specifier: ^8.3.4
- version: 8.3.4(@mantine/hooks@8.3.4(react@19.2.1))(@types/react@19.2.2)(react-dom@19.2.1(react@19.2.1))(react@19.2.1)
- '@mantine/hooks':
- specifier: ^8.3.4
- version: 8.3.4(react@19.2.1)
- '@mantine/utils':
- specifier: ^6.0.22
- version: 6.0.22(react@19.2.1)
- react:
- specifier: ^19.2.1
- version: 19.2.1
- react-dom:
- specifier: ^19.2.1
- version: 19.2.1(react@19.2.1)
- devDependencies:
- '@types/react':
- specifier: ^19.2.2
- version: 19.2.2
- '@types/react-dom':
- specifier: ^19.2.2
- version: 19.2.2(@types/react@19.2.2)
- '@vitejs/plugin-react':
- specifier: ^4.7.0
- version: 4.7.0(vite@5.4.20(@types/node@24.8.1)(lightningcss@1.30.1)(terser@5.44.1))
- vite:
- specifier: ^5.4.20
- version: 5.4.20(@types/node@24.8.1)(lightningcss@1.30.1)(terser@5.44.1)
-
- examples/03-ui-components/16-link-toolbar-buttons:
- dependencies:
- '@blocknote/ariakit':
- specifier: latest
- version: link:../../../packages/ariakit
- '@blocknote/core':
- specifier: latest
- version: link:../../../packages/core
- '@blocknote/mantine':
- specifier: latest
- version: link:../../../packages/mantine
- '@blocknote/react':
- specifier: latest
- version: link:../../../packages/react
- '@blocknote/shadcn':
- specifier: latest
- version: link:../../../packages/shadcn
- '@mantine/core':
- specifier: ^8.3.4
- version: 8.3.4(@mantine/hooks@8.3.4(react@19.2.1))(@types/react@19.2.2)(react-dom@19.2.1(react@19.2.1))(react@19.2.1)
- '@mantine/hooks':
- specifier: ^8.3.4
- version: 8.3.4(react@19.2.1)
- '@mantine/utils':
- specifier: ^6.0.22
- version: 6.0.22(react@19.2.1)
- react:
- specifier: ^19.2.1
- version: 19.2.1
- react-dom:
- specifier: ^19.2.1
- version: 19.2.1(react@19.2.1)
- devDependencies:
- '@types/react':
- specifier: ^19.2.2
- version: 19.2.2
- '@types/react-dom':
- specifier: ^19.2.2
- version: 19.2.2(@types/react@19.2.2)
- '@vitejs/plugin-react':
- specifier: ^4.7.0
- version: 4.7.0(vite@5.4.20(@types/node@24.8.1)(lightningcss@1.30.1)(terser@5.44.1))
- vite:
- specifier: ^5.4.20
- version: 5.4.20(@types/node@24.8.1)(lightningcss@1.30.1)(terser@5.44.1)
-
- examples/03-ui-components/17-advanced-tables-2:
- dependencies:
- '@blocknote/ariakit':
- specifier: latest
- version: link:../../../packages/ariakit
- '@blocknote/core':
- specifier: latest
- version: link:../../../packages/core
- '@blocknote/mantine':
- specifier: latest
- version: link:../../../packages/mantine
- '@blocknote/react':
- specifier: latest
- version: link:../../../packages/react
- '@blocknote/shadcn':
- specifier: latest
- version: link:../../../packages/shadcn
- '@mantine/core':
- specifier: ^8.3.4
- version: 8.3.4(@mantine/hooks@8.3.4(react@19.2.1))(@types/react@19.2.2)(react-dom@19.2.1(react@19.2.1))(react@19.2.1)
- '@mantine/hooks':
- specifier: ^8.3.4
- version: 8.3.4(react@19.2.1)
- '@mantine/utils':
- specifier: ^6.0.22
- version: 6.0.22(react@19.2.1)
- react:
- specifier: ^19.2.1
- version: 19.2.1
- react-dom:
- specifier: ^19.2.1
- version: 19.2.1(react@19.2.1)
- devDependencies:
- '@types/react':
- specifier: ^19.2.2
- version: 19.2.2
- '@types/react-dom':
- specifier: ^19.2.2
- version: 19.2.2(@types/react@19.2.2)
- '@vitejs/plugin-react':
- specifier: ^4.7.0
- version: 4.7.0(vite@5.4.20(@types/node@24.8.1)(lightningcss@1.30.1)(terser@5.44.1))
- vite:
- specifier: ^5.4.20
- version: 5.4.20(@types/node@24.8.1)(lightningcss@1.30.1)(terser@5.44.1)
-
- examples/04-theming/01-theming-dom-attributes:
- dependencies:
- '@blocknote/ariakit':
- specifier: latest
- version: link:../../../packages/ariakit
- '@blocknote/core':
- specifier: latest
- version: link:../../../packages/core
- '@blocknote/mantine':
- specifier: latest
- version: link:../../../packages/mantine
- '@blocknote/react':
- specifier: latest
- version: link:../../../packages/react
- '@blocknote/shadcn':
- specifier: latest
- version: link:../../../packages/shadcn
- '@mantine/core':
- specifier: ^8.3.4
- version: 8.3.4(@mantine/hooks@8.3.4(react@19.2.1))(@types/react@19.2.2)(react-dom@19.2.1(react@19.2.1))(react@19.2.1)
- '@mantine/hooks':
- specifier: ^8.3.4
- version: 8.3.4(react@19.2.1)
- '@mantine/utils':
- specifier: ^6.0.22
- version: 6.0.22(react@19.2.1)
- react:
- specifier: ^19.2.1
- version: 19.2.1
- react-dom:
- specifier: ^19.2.1
- version: 19.2.1(react@19.2.1)
- devDependencies:
- '@types/react':
- specifier: ^19.2.2
- version: 19.2.2
- '@types/react-dom':
- specifier: ^19.2.2
- version: 19.2.2(@types/react@19.2.2)
- '@vitejs/plugin-react':
- specifier: ^4.7.0
- version: 4.7.0(vite@5.4.20(@types/node@24.8.1)(lightningcss@1.30.1)(terser@5.44.1))
- vite:
- specifier: ^5.4.20
- version: 5.4.20(@types/node@24.8.1)(lightningcss@1.30.1)(terser@5.44.1)
-
- examples/04-theming/02-changing-font:
- dependencies:
- '@blocknote/ariakit':
- specifier: latest
- version: link:../../../packages/ariakit
- '@blocknote/core':
- specifier: latest
- version: link:../../../packages/core
- '@blocknote/mantine':
- specifier: latest
- version: link:../../../packages/mantine
- '@blocknote/react':
- specifier: latest
- version: link:../../../packages/react
- '@blocknote/shadcn':
- specifier: latest
- version: link:../../../packages/shadcn
- '@mantine/core':
- specifier: ^8.3.4
- version: 8.3.4(@mantine/hooks@8.3.4(react@19.2.1))(@types/react@19.2.2)(react-dom@19.2.1(react@19.2.1))(react@19.2.1)
- '@mantine/hooks':
- specifier: ^8.3.4
- version: 8.3.4(react@19.2.1)
- '@mantine/utils':
- specifier: ^6.0.22
- version: 6.0.22(react@19.2.1)
- react:
- specifier: ^19.2.1
- version: 19.2.1
- react-dom:
- specifier: ^19.2.1
- version: 19.2.1(react@19.2.1)
- devDependencies:
- '@types/react':
- specifier: ^19.2.2
- version: 19.2.2
- '@types/react-dom':
- specifier: ^19.2.2
- version: 19.2.2(@types/react@19.2.2)
- '@vitejs/plugin-react':
- specifier: ^4.7.0
- version: 4.7.0(vite@5.4.20(@types/node@24.8.1)(lightningcss@1.30.1)(terser@5.44.1))
- vite:
- specifier: ^5.4.20
- version: 5.4.20(@types/node@24.8.1)(lightningcss@1.30.1)(terser@5.44.1)
-
- examples/04-theming/03-theming-css:
- dependencies:
- '@blocknote/ariakit':
- specifier: latest
- version: link:../../../packages/ariakit
- '@blocknote/core':
- specifier: latest
- version: link:../../../packages/core
- '@blocknote/mantine':
- specifier: latest
- version: link:../../../packages/mantine
- '@blocknote/react':
- specifier: latest
- version: link:../../../packages/react
- '@blocknote/shadcn':
- specifier: latest
- version: link:../../../packages/shadcn
- '@mantine/core':
- specifier: ^8.3.4
- version: 8.3.4(@mantine/hooks@8.3.4(react@19.2.1))(@types/react@19.2.2)(react-dom@19.2.1(react@19.2.1))(react@19.2.1)
- '@mantine/hooks':
- specifier: ^8.3.4
- version: 8.3.4(react@19.2.1)
- '@mantine/utils':
- specifier: ^6.0.22
- version: 6.0.22(react@19.2.1)
- react:
- specifier: ^19.2.1
- version: 19.2.1
- react-dom:
- specifier: ^19.2.1
- version: 19.2.1(react@19.2.1)
- devDependencies:
- '@types/react':
- specifier: ^19.2.2
- version: 19.2.2
- '@types/react-dom':
- specifier: ^19.2.2
- version: 19.2.2(@types/react@19.2.2)
- '@vitejs/plugin-react':
- specifier: ^4.7.0
- version: 4.7.0(vite@5.4.20(@types/node@24.8.1)(lightningcss@1.30.1)(terser@5.44.1))
- vite:
- specifier: ^5.4.20
- version: 5.4.20(@types/node@24.8.1)(lightningcss@1.30.1)(terser@5.44.1)
-
- examples/04-theming/04-theming-css-variables:
- dependencies:
- '@blocknote/ariakit':
- specifier: latest
- version: link:../../../packages/ariakit
- '@blocknote/core':
- specifier: latest
- version: link:../../../packages/core
- '@blocknote/mantine':
- specifier: latest
- version: link:../../../packages/mantine
- '@blocknote/react':
- specifier: latest
- version: link:../../../packages/react
- '@blocknote/shadcn':
- specifier: latest
- version: link:../../../packages/shadcn
- '@mantine/core':
- specifier: ^8.3.4
- version: 8.3.4(@mantine/hooks@8.3.4(react@19.2.1))(@types/react@19.2.2)(react-dom@19.2.1(react@19.2.1))(react@19.2.1)
- '@mantine/hooks':
- specifier: ^8.3.4
- version: 8.3.4(react@19.2.1)
- '@mantine/utils':
- specifier: ^6.0.22
- version: 6.0.22(react@19.2.1)
- react:
- specifier: ^19.2.1
- version: 19.2.1
- react-dom:
- specifier: ^19.2.1
- version: 19.2.1(react@19.2.1)
- devDependencies:
- '@types/react':
- specifier: ^19.2.2
- version: 19.2.2
- '@types/react-dom':
- specifier: ^19.2.2
- version: 19.2.2(@types/react@19.2.2)
- '@vitejs/plugin-react':
- specifier: ^4.7.0
- version: 4.7.0(vite@5.4.20(@types/node@24.8.1)(lightningcss@1.30.1)(terser@5.44.1))
- vite:
- specifier: ^5.4.20
- version: 5.4.20(@types/node@24.8.1)(lightningcss@1.30.1)(terser@5.44.1)
-
- examples/04-theming/05-theming-css-variables-code:
- dependencies:
- '@blocknote/ariakit':
- specifier: latest
- version: link:../../../packages/ariakit
- '@blocknote/core':
- specifier: latest
- version: link:../../../packages/core
- '@blocknote/mantine':
- specifier: latest
- version: link:../../../packages/mantine
- '@blocknote/react':
- specifier: latest
- version: link:../../../packages/react
- '@blocknote/shadcn':
- specifier: latest
- version: link:../../../packages/shadcn
- '@mantine/core':
- specifier: ^8.3.4
- version: 8.3.4(@mantine/hooks@8.3.4(react@19.2.1))(@types/react@19.2.2)(react-dom@19.2.1(react@19.2.1))(react@19.2.1)
- '@mantine/hooks':
- specifier: ^8.3.4
- version: 8.3.4(react@19.2.1)
- '@mantine/utils':
- specifier: ^6.0.22
- version: 6.0.22(react@19.2.1)
- react:
- specifier: ^19.2.1
- version: 19.2.1
- react-dom:
- specifier: ^19.2.1
- version: 19.2.1(react@19.2.1)
- devDependencies:
- '@types/react':
- specifier: ^19.2.2
- version: 19.2.2
- '@types/react-dom':
- specifier: ^19.2.2
- version: 19.2.2(@types/react@19.2.2)
- '@vitejs/plugin-react':
- specifier: ^4.7.0
- version: 4.7.0(vite@5.4.20(@types/node@24.8.1)(lightningcss@1.30.1)(terser@5.44.1))
- vite:
- specifier: ^5.4.20
- version: 5.4.20(@types/node@24.8.1)(lightningcss@1.30.1)(terser@5.44.1)
-
- examples/04-theming/06-code-block:
- dependencies:
- '@blocknote/ariakit':
- specifier: latest
- version: link:../../../packages/ariakit
- '@blocknote/code-block':
- specifier: latest
- version: link:../../../packages/code-block
- '@blocknote/core':
- specifier: latest
- version: link:../../../packages/core
- '@blocknote/mantine':
- specifier: latest
- version: link:../../../packages/mantine
- '@blocknote/react':
- specifier: latest
- version: link:../../../packages/react
- '@blocknote/shadcn':
- specifier: latest
- version: link:../../../packages/shadcn
- '@mantine/core':
- specifier: ^8.3.4
- version: 8.3.4(@mantine/hooks@8.3.4(react@19.2.1))(@types/react@19.2.2)(react-dom@19.2.1(react@19.2.1))(react@19.2.1)
- '@mantine/hooks':
- specifier: ^8.3.4
- version: 8.3.4(react@19.2.1)
- '@mantine/utils':
- specifier: ^6.0.22
- version: 6.0.22(react@19.2.1)
- react:
- specifier: ^19.2.1
- version: 19.2.1
- react-dom:
- specifier: ^19.2.1
- version: 19.2.1(react@19.2.1)
- devDependencies:
- '@types/react':
- specifier: ^19.2.2
- version: 19.2.2
- '@types/react-dom':
- specifier: ^19.2.2
- version: 19.2.2(@types/react@19.2.2)
- '@vitejs/plugin-react':
- specifier: ^4.7.0
- version: 4.7.0(vite@5.4.20(@types/node@24.8.1)(lightningcss@1.30.1)(terser@5.44.1))
- vite:
- specifier: ^5.4.20
- version: 5.4.20(@types/node@24.8.1)(lightningcss@1.30.1)(terser@5.44.1)
-
- examples/04-theming/07-custom-code-block:
- dependencies:
- '@blocknote/ariakit':
- specifier: latest
- version: link:../../../packages/ariakit
- '@blocknote/code-block':
- specifier: latest
- version: link:../../../packages/code-block
- '@blocknote/core':
- specifier: latest
- version: link:../../../packages/core
- '@blocknote/mantine':
- specifier: latest
- version: link:../../../packages/mantine
- '@blocknote/react':
- specifier: latest
- version: link:../../../packages/react
- '@blocknote/shadcn':
- specifier: latest
- version: link:../../../packages/shadcn
- '@mantine/core':
- specifier: ^8.3.4
- version: 8.3.4(@mantine/hooks@8.3.4(react@19.2.1))(@types/react@19.2.2)(react-dom@19.2.1(react@19.2.1))(react@19.2.1)
- '@mantine/hooks':
- specifier: ^8.3.4
- version: 8.3.4(react@19.2.1)
- '@mantine/utils':
- specifier: ^6.0.22
- version: 6.0.22(react@19.2.1)
- '@shikijs/core':
- specifier: ^3.19.0
- version: 3.19.0
- '@shikijs/engine-javascript':
- specifier: ^3.19.0
- version: 3.19.0
- '@shikijs/langs-precompiled':
- specifier: ^3.19.0
- version: 3.19.0
- '@shikijs/themes':
- specifier: ^3.19.0
- version: 3.19.0
- '@shikijs/types':
- specifier: ^3.19.0
- version: 3.19.0
- react:
- specifier: ^19.2.1
- version: 19.2.1
- react-dom:
- specifier: ^19.2.1
- version: 19.2.1(react@19.2.1)
- devDependencies:
- '@types/react':
- specifier: ^19.2.2
- version: 19.2.2
- '@types/react-dom':
- specifier: ^19.2.2
- version: 19.2.2(@types/react@19.2.2)
- '@vitejs/plugin-react':
- specifier: ^4.7.0
- version: 4.7.0(vite@5.4.20(@types/node@24.8.1)(lightningcss@1.30.1)(terser@5.44.1))
- vite:
- specifier: ^5.4.20
- version: 5.4.20(@types/node@24.8.1)(lightningcss@1.30.1)(terser@5.44.1)
-
- examples/05-interoperability/01-converting-blocks-to-html:
+ examples/03-ui-components/15-advanced-tables:
dependencies:
'@blocknote/ariakit':
specifier: latest
@@ -2568,7 +2074,7 @@ importers:
specifier: ^5.4.20
version: 5.4.20(@types/node@24.8.1)(lightningcss@1.30.1)(terser@5.44.1)
- examples/05-interoperability/02-converting-blocks-from-html:
+ examples/03-ui-components/16-link-toolbar-buttons:
dependencies:
'@blocknote/ariakit':
specifier: latest
@@ -2614,7 +2120,7 @@ importers:
specifier: ^5.4.20
version: 5.4.20(@types/node@24.8.1)(lightningcss@1.30.1)(terser@5.44.1)
- examples/05-interoperability/03-converting-blocks-to-md:
+ examples/03-ui-components/17-advanced-tables-2:
dependencies:
'@blocknote/ariakit':
specifier: latest
@@ -2660,7 +2166,7 @@ importers:
specifier: ^5.4.20
version: 5.4.20(@types/node@24.8.1)(lightningcss@1.30.1)(terser@5.44.1)
- examples/05-interoperability/04-converting-blocks-from-md:
+ examples/04-theming/01-theming-dom-attributes:
dependencies:
'@blocknote/ariakit':
specifier: latest
@@ -2706,7 +2212,7 @@ importers:
specifier: ^5.4.20
version: 5.4.20(@types/node@24.8.1)(lightningcss@1.30.1)(terser@5.44.1)
- examples/05-interoperability/05-converting-blocks-to-pdf:
+ examples/04-theming/02-changing-font:
dependencies:
'@blocknote/ariakit':
specifier: latest
@@ -2723,12 +2229,6 @@ importers:
'@blocknote/shadcn':
specifier: latest
version: link:../../../packages/shadcn
- '@blocknote/xl-multi-column':
- specifier: latest
- version: link:../../../packages/xl-multi-column
- '@blocknote/xl-pdf-exporter':
- specifier: latest
- version: link:../../../packages/xl-pdf-exporter
'@mantine/core':
specifier: ^8.3.4
version: 8.3.4(@mantine/hooks@8.3.4(react@19.2.1))(@types/react@19.2.2)(react-dom@19.2.1(react@19.2.1))(react@19.2.1)
@@ -2738,9 +2238,6 @@ importers:
'@mantine/utils':
specifier: ^6.0.22
version: 6.0.22(react@19.2.1)
- '@react-pdf/renderer':
- specifier: ^4.3.0
- version: 4.3.1(react@19.2.1)
react:
specifier: ^19.2.1
version: 19.2.1
@@ -2761,7 +2258,7 @@ importers:
specifier: ^5.4.20
version: 5.4.20(@types/node@24.8.1)(lightningcss@1.30.1)(terser@5.44.1)
- examples/05-interoperability/06-converting-blocks-to-docx:
+ examples/04-theming/03-theming-css:
dependencies:
'@blocknote/ariakit':
specifier: latest
@@ -2778,12 +2275,6 @@ importers:
'@blocknote/shadcn':
specifier: latest
version: link:../../../packages/shadcn
- '@blocknote/xl-docx-exporter':
- specifier: latest
- version: link:../../../packages/xl-docx-exporter
- '@blocknote/xl-multi-column':
- specifier: latest
- version: link:../../../packages/xl-multi-column
'@mantine/core':
specifier: ^8.3.4
version: 8.3.4(@mantine/hooks@8.3.4(react@19.2.1))(@types/react@19.2.2)(react-dom@19.2.1(react@19.2.1))(react@19.2.1)
@@ -2793,9 +2284,6 @@ importers:
'@mantine/utils':
specifier: ^6.0.22
version: 6.0.22(react@19.2.1)
- docx:
- specifier: ^9.5.1
- version: 9.5.1
react:
specifier: ^19.2.1
version: 19.2.1
@@ -2816,7 +2304,7 @@ importers:
specifier: ^5.4.20
version: 5.4.20(@types/node@24.8.1)(lightningcss@1.30.1)(terser@5.44.1)
- examples/05-interoperability/07-converting-blocks-to-odt:
+ examples/04-theming/04-theming-css-variables:
dependencies:
'@blocknote/ariakit':
specifier: latest
@@ -2833,12 +2321,6 @@ importers:
'@blocknote/shadcn':
specifier: latest
version: link:../../../packages/shadcn
- '@blocknote/xl-multi-column':
- specifier: latest
- version: link:../../../packages/xl-multi-column
- '@blocknote/xl-odt-exporter':
- specifier: latest
- version: link:../../../packages/xl-odt-exporter
'@mantine/core':
specifier: ^8.3.4
version: 8.3.4(@mantine/hooks@8.3.4(react@19.2.1))(@types/react@19.2.2)(react-dom@19.2.1(react@19.2.1))(react@19.2.1)
@@ -2868,7 +2350,7 @@ importers:
specifier: ^5.4.20
version: 5.4.20(@types/node@24.8.1)(lightningcss@1.30.1)(terser@5.44.1)
- examples/05-interoperability/08-converting-blocks-to-react-email:
+ examples/04-theming/05-theming-css-variables-code:
dependencies:
'@blocknote/ariakit':
specifier: latest
@@ -2885,9 +2367,6 @@ importers:
'@blocknote/shadcn':
specifier: latest
version: link:../../../packages/shadcn
- '@blocknote/xl-email-exporter':
- specifier: latest
- version: link:../../../packages/xl-email-exporter
'@mantine/core':
specifier: ^8.3.4
version: 8.3.4(@mantine/hooks@8.3.4(react@19.2.1))(@types/react@19.2.2)(react-dom@19.2.1(react@19.2.1))(react@19.2.1)
@@ -2897,9 +2376,6 @@ importers:
'@mantine/utils':
specifier: ^6.0.22
version: 6.0.22(react@19.2.1)
- '@react-email/render':
- specifier: ^1.1.2
- version: 1.4.0(react-dom@19.2.1(react@19.2.1))(react@19.2.1)
react:
specifier: ^19.2.1
version: 19.2.1
@@ -2920,11 +2396,14 @@ importers:
specifier: ^5.4.20
version: 5.4.20(@types/node@24.8.1)(lightningcss@1.30.1)(terser@5.44.1)
- examples/06-custom-schema/01-alert-block:
+ examples/04-theming/06-code-block:
dependencies:
'@blocknote/ariakit':
specifier: latest
version: link:../../../packages/ariakit
+ '@blocknote/code-block':
+ specifier: latest
+ version: link:../../../packages/code-block
'@blocknote/core':
specifier: latest
version: link:../../../packages/core
@@ -2952,9 +2431,6 @@ importers:
react-dom:
specifier: ^19.2.1
version: 19.2.1(react@19.2.1)
- react-icons:
- specifier: ^5.2.1
- version: 5.5.0(react@19.2.1)
devDependencies:
'@types/react':
specifier: ^19.2.2
@@ -2969,11 +2445,14 @@ importers:
specifier: ^5.4.20
version: 5.4.20(@types/node@24.8.1)(lightningcss@1.30.1)(terser@5.44.1)
- examples/06-custom-schema/02-suggestion-menus-mentions:
+ examples/04-theming/07-custom-code-block:
dependencies:
'@blocknote/ariakit':
specifier: latest
version: link:../../../packages/ariakit
+ '@blocknote/code-block':
+ specifier: latest
+ version: link:../../../packages/code-block
'@blocknote/core':
specifier: latest
version: link:../../../packages/core
@@ -2995,6 +2474,21 @@ importers:
'@mantine/utils':
specifier: ^6.0.22
version: 6.0.22(react@19.2.1)
+ '@shikijs/core':
+ specifier: ^3.19.0
+ version: 3.19.0
+ '@shikijs/engine-javascript':
+ specifier: ^3.19.0
+ version: 3.19.0
+ '@shikijs/langs-precompiled':
+ specifier: ^3.19.0
+ version: 3.19.0
+ '@shikijs/themes':
+ specifier: ^3.19.0
+ version: 3.19.0
+ '@shikijs/types':
+ specifier: ^3.19.0
+ version: 3.19.0
react:
specifier: ^19.2.1
version: 19.2.1
@@ -3015,7 +2509,7 @@ importers:
specifier: ^5.4.20
version: 5.4.20(@types/node@24.8.1)(lightningcss@1.30.1)(terser@5.44.1)
- examples/06-custom-schema/03-font-style:
+ examples/05-interoperability/01-converting-blocks-to-html:
dependencies:
'@blocknote/ariakit':
specifier: latest
@@ -3047,9 +2541,6 @@ importers:
react-dom:
specifier: ^19.2.1
version: 19.2.1(react@19.2.1)
- react-icons:
- specifier: ^5.2.1
- version: 5.5.0(react@19.2.1)
devDependencies:
'@types/react':
specifier: ^19.2.2
@@ -3064,7 +2555,7 @@ importers:
specifier: ^5.4.20
version: 5.4.20(@types/node@24.8.1)(lightningcss@1.30.1)(terser@5.44.1)
- examples/06-custom-schema/04-pdf-file-block:
+ examples/05-interoperability/02-converting-blocks-from-html:
dependencies:
'@blocknote/ariakit':
specifier: latest
@@ -3096,9 +2587,6 @@ importers:
react-dom:
specifier: ^19.2.1
version: 19.2.1(react@19.2.1)
- react-icons:
- specifier: ^5.2.1
- version: 5.5.0(react@19.2.1)
devDependencies:
'@types/react':
specifier: ^19.2.2
@@ -3113,7 +2601,7 @@ importers:
specifier: ^5.4.20
version: 5.4.20(@types/node@24.8.1)(lightningcss@1.30.1)(terser@5.44.1)
- examples/06-custom-schema/05-alert-block-full-ux:
+ examples/05-interoperability/03-converting-blocks-to-md:
dependencies:
'@blocknote/ariakit':
specifier: latest
@@ -3145,9 +2633,6 @@ importers:
react-dom:
specifier: ^19.2.1
version: 19.2.1(react@19.2.1)
- react-icons:
- specifier: ^5.2.1
- version: 5.5.0(react@19.2.1)
devDependencies:
'@types/react':
specifier: ^19.2.2
@@ -3162,7 +2647,7 @@ importers:
specifier: ^5.4.20
version: 5.4.20(@types/node@24.8.1)(lightningcss@1.30.1)(terser@5.44.1)
- examples/06-custom-schema/06-toggleable-blocks:
+ examples/05-interoperability/04-converting-blocks-from-md:
dependencies:
'@blocknote/ariakit':
specifier: latest
@@ -3208,7 +2693,7 @@ importers:
specifier: ^5.4.20
version: 5.4.20(@types/node@24.8.1)(lightningcss@1.30.1)(terser@5.44.1)
- examples/06-custom-schema/07-configuring-blocks:
+ examples/05-interoperability/05-converting-blocks-to-pdf:
dependencies:
'@blocknote/ariakit':
specifier: latest
@@ -3225,6 +2710,12 @@ importers:
'@blocknote/shadcn':
specifier: latest
version: link:../../../packages/shadcn
+ '@blocknote/xl-multi-column':
+ specifier: latest
+ version: link:../../../packages/xl-multi-column
+ '@blocknote/xl-pdf-exporter':
+ specifier: latest
+ version: link:../../../packages/xl-pdf-exporter
'@mantine/core':
specifier: ^8.3.4
version: 8.3.4(@mantine/hooks@8.3.4(react@19.2.1))(@types/react@19.2.2)(react-dom@19.2.1(react@19.2.1))(react@19.2.1)
@@ -3234,6 +2725,9 @@ importers:
'@mantine/utils':
specifier: ^6.0.22
version: 6.0.22(react@19.2.1)
+ '@react-pdf/renderer':
+ specifier: ^4.3.0
+ version: 4.3.1(react@19.2.1)
react:
specifier: ^19.2.1
version: 19.2.1
@@ -3254,7 +2748,7 @@ importers:
specifier: ^5.4.20
version: 5.4.20(@types/node@24.8.1)(lightningcss@1.30.1)(terser@5.44.1)
- examples/06-custom-schema/draggable-inline-content:
+ examples/05-interoperability/06-converting-blocks-to-docx:
dependencies:
'@blocknote/ariakit':
specifier: latest
@@ -3271,6 +2765,12 @@ importers:
'@blocknote/shadcn':
specifier: latest
version: link:../../../packages/shadcn
+ '@blocknote/xl-docx-exporter':
+ specifier: latest
+ version: link:../../../packages/xl-docx-exporter
+ '@blocknote/xl-multi-column':
+ specifier: latest
+ version: link:../../../packages/xl-multi-column
'@mantine/core':
specifier: ^8.3.4
version: 8.3.4(@mantine/hooks@8.3.4(react@19.2.1))(@types/react@19.2.2)(react-dom@19.2.1(react@19.2.1))(react@19.2.1)
@@ -3280,6 +2780,9 @@ importers:
'@mantine/utils':
specifier: ^6.0.22
version: 6.0.22(react@19.2.1)
+ docx:
+ specifier: ^9.5.1
+ version: 9.5.1
react:
specifier: ^19.2.1
version: 19.2.1
@@ -3300,7 +2803,7 @@ importers:
specifier: ^5.4.20
version: 5.4.20(@types/node@24.8.1)(lightningcss@1.30.1)(terser@5.44.1)
- examples/06-custom-schema/react-custom-blocks:
+ examples/05-interoperability/07-converting-blocks-to-odt:
dependencies:
'@blocknote/ariakit':
specifier: latest
@@ -3317,6 +2820,12 @@ importers:
'@blocknote/shadcn':
specifier: latest
version: link:../../../packages/shadcn
+ '@blocknote/xl-multi-column':
+ specifier: latest
+ version: link:../../../packages/xl-multi-column
+ '@blocknote/xl-odt-exporter':
+ specifier: latest
+ version: link:../../../packages/xl-odt-exporter
'@mantine/core':
specifier: ^8.3.4
version: 8.3.4(@mantine/hooks@8.3.4(react@19.2.1))(@types/react@19.2.2)(react-dom@19.2.1(react@19.2.1))(react@19.2.1)
@@ -3346,7 +2855,7 @@ importers:
specifier: ^5.4.20
version: 5.4.20(@types/node@24.8.1)(lightningcss@1.30.1)(terser@5.44.1)
- examples/06-custom-schema/react-custom-inline-content:
+ examples/05-interoperability/08-converting-blocks-to-react-email:
dependencies:
'@blocknote/ariakit':
specifier: latest
@@ -3363,6 +2872,9 @@ importers:
'@blocknote/shadcn':
specifier: latest
version: link:../../../packages/shadcn
+ '@blocknote/xl-email-exporter':
+ specifier: latest
+ version: link:../../../packages/xl-email-exporter
'@mantine/core':
specifier: ^8.3.4
version: 8.3.4(@mantine/hooks@8.3.4(react@19.2.1))(@types/react@19.2.2)(react-dom@19.2.1(react@19.2.1))(react@19.2.1)
@@ -3372,6 +2884,9 @@ importers:
'@mantine/utils':
specifier: ^6.0.22
version: 6.0.22(react@19.2.1)
+ '@react-email/render':
+ specifier: ^1.1.2
+ version: 1.4.0(react-dom@19.2.1(react@19.2.1))(react@19.2.1)
react:
specifier: ^19.2.1
version: 19.2.1
@@ -3392,7 +2907,7 @@ importers:
specifier: ^5.4.20
version: 5.4.20(@types/node@24.8.1)(lightningcss@1.30.1)(terser@5.44.1)
- examples/06-custom-schema/react-custom-styles:
+ examples/06-custom-schema/01-alert-block:
dependencies:
'@blocknote/ariakit':
specifier: latest
@@ -3424,6 +2939,9 @@ importers:
react-dom:
specifier: ^19.2.1
version: 19.2.1(react@19.2.1)
+ react-icons:
+ specifier: ^5.2.1
+ version: 5.5.0(react@19.2.1)
devDependencies:
'@types/react':
specifier: ^19.2.2
@@ -3438,7 +2956,7 @@ importers:
specifier: ^5.4.20
version: 5.4.20(@types/node@24.8.1)(lightningcss@1.30.1)(terser@5.44.1)
- examples/07-collaboration/01-partykit:
+ examples/06-custom-schema/02-suggestion-menus-mentions:
dependencies:
'@blocknote/ariakit':
specifier: latest
@@ -3470,12 +2988,6 @@ importers:
react-dom:
specifier: ^19.2.1
version: 19.2.1(react@19.2.1)
- y-partykit:
- specifier: ^0.0.25
- version: 0.0.25
- yjs:
- specifier: ^13.6.27
- version: 13.6.27
devDependencies:
'@types/react':
specifier: ^19.2.2
@@ -3490,7 +3002,7 @@ importers:
specifier: ^5.4.20
version: 5.4.20(@types/node@24.8.1)(lightningcss@1.30.1)(terser@5.44.1)
- examples/07-collaboration/02-liveblocks:
+ examples/06-custom-schema/03-font-style:
dependencies:
'@blocknote/ariakit':
specifier: latest
@@ -3507,21 +3019,6 @@ importers:
'@blocknote/shadcn':
specifier: latest
version: link:../../../packages/shadcn
- '@liveblocks/client':
- specifier: 3.7.1-tiptap3
- version: 3.7.1-tiptap3(@types/json-schema@7.0.15)
- '@liveblocks/react':
- specifier: 3.7.1-tiptap3
- version: 3.7.1-tiptap3(@types/json-schema@7.0.15)(@types/react-dom@19.2.2(@types/react@19.2.2))(@types/react@19.2.2)(react@19.2.1)
- '@liveblocks/react-blocknote':
- specifier: 3.7.1-tiptap3
- version: 3.7.1-tiptap3(33c6616930f6f7c88a9e36083f9553b0)
- '@liveblocks/react-tiptap':
- specifier: 3.7.1-tiptap3
- version: 3.7.1-tiptap3(61deabd8fbfc94ee8c4893e0e616a70c)
- '@liveblocks/react-ui':
- specifier: 3.7.1-tiptap3
- version: 3.7.1-tiptap3(@types/json-schema@7.0.15)(@types/react-dom@19.2.2(@types/react@19.2.2))(@types/react@19.2.2)(react-dom@19.2.1(react@19.2.1))(react@19.2.1)
'@mantine/core':
specifier: ^8.3.4
version: 8.3.4(@mantine/hooks@8.3.4(react@19.2.1))(@types/react@19.2.2)(react-dom@19.2.1(react@19.2.1))(react@19.2.1)
@@ -3537,9 +3034,9 @@ importers:
react-dom:
specifier: ^19.2.1
version: 19.2.1(react@19.2.1)
- yjs:
- specifier: ^13.6.27
- version: 13.6.27
+ react-icons:
+ specifier: ^5.2.1
+ version: 5.5.0(react@19.2.1)
devDependencies:
'@types/react':
specifier: ^19.2.2
@@ -3554,7 +3051,7 @@ importers:
specifier: ^5.4.20
version: 5.4.20(@types/node@24.8.1)(lightningcss@1.30.1)(terser@5.44.1)
- examples/07-collaboration/03-y-sweet:
+ examples/06-custom-schema/04-pdf-file-block:
dependencies:
'@blocknote/ariakit':
specifier: latest
@@ -3580,15 +3077,15 @@ importers:
'@mantine/utils':
specifier: ^6.0.22
version: 6.0.22(react@19.2.1)
- '@y-sweet/react':
- specifier: ^0.6.3
- version: 0.6.4(react@19.2.1)(yjs@13.6.27)
react:
specifier: ^19.2.1
version: 19.2.1
react-dom:
specifier: ^19.2.1
version: 19.2.1(react@19.2.1)
+ react-icons:
+ specifier: ^5.2.1
+ version: 5.5.0(react@19.2.1)
devDependencies:
'@types/react':
specifier: ^19.2.2
@@ -3603,7 +3100,7 @@ importers:
specifier: ^5.4.20
version: 5.4.20(@types/node@24.8.1)(lightningcss@1.30.1)(terser@5.44.1)
- examples/07-collaboration/04-electric-sql:
+ examples/06-custom-schema/05-alert-block-full-ux:
dependencies:
'@blocknote/ariakit':
specifier: latest
@@ -3635,6 +3132,9 @@ importers:
react-dom:
specifier: ^19.2.1
version: 19.2.1(react@19.2.1)
+ react-icons:
+ specifier: ^5.2.1
+ version: 5.5.0(react@19.2.1)
devDependencies:
'@types/react':
specifier: ^19.2.2
@@ -3649,7 +3149,7 @@ importers:
specifier: ^5.4.20
version: 5.4.20(@types/node@24.8.1)(lightningcss@1.30.1)(terser@5.44.1)
- examples/07-collaboration/05-comments:
+ examples/06-custom-schema/06-toggleable-blocks:
dependencies:
'@blocknote/ariakit':
specifier: latest
@@ -3675,9 +3175,6 @@ importers:
'@mantine/utils':
specifier: ^6.0.22
version: 6.0.22(react@19.2.1)
- '@y-sweet/react':
- specifier: ^0.6.3
- version: 0.6.4(react@19.2.1)(yjs@13.6.27)
react:
specifier: ^19.2.1
version: 19.2.1
@@ -3698,7 +3195,7 @@ importers:
specifier: ^5.4.20
version: 5.4.20(@types/node@24.8.1)(lightningcss@1.30.1)(terser@5.44.1)
- examples/07-collaboration/06-comments-with-sidebar:
+ examples/06-custom-schema/07-configuring-blocks:
dependencies:
'@blocknote/ariakit':
specifier: latest
@@ -3730,12 +3227,6 @@ importers:
react-dom:
specifier: ^19.2.1
version: 19.2.1(react@19.2.1)
- y-partykit:
- specifier: ^0.0.25
- version: 0.0.25
- yjs:
- specifier: ^13.6.27
- version: 13.6.27
devDependencies:
'@types/react':
specifier: ^19.2.2
@@ -3750,7 +3241,7 @@ importers:
specifier: ^5.4.20
version: 5.4.20(@types/node@24.8.1)(lightningcss@1.30.1)(terser@5.44.1)
- examples/07-collaboration/07-ghost-writer:
+ examples/06-custom-schema/draggable-inline-content:
dependencies:
'@blocknote/ariakit':
specifier: latest
@@ -3782,12 +3273,6 @@ importers:
react-dom:
specifier: ^19.2.1
version: 19.2.1(react@19.2.1)
- y-partykit:
- specifier: ^0.0.25
- version: 0.0.25
- yjs:
- specifier: ^13.6.27
- version: 13.6.27
devDependencies:
'@types/react':
specifier: ^19.2.2
@@ -3802,7 +3287,7 @@ importers:
specifier: ^5.4.20
version: 5.4.20(@types/node@24.8.1)(lightningcss@1.30.1)(terser@5.44.1)
- examples/07-collaboration/08-forking:
+ examples/06-custom-schema/react-custom-blocks:
dependencies:
'@blocknote/ariakit':
specifier: latest
@@ -3834,12 +3319,6 @@ importers:
react-dom:
specifier: ^19.2.1
version: 19.2.1(react@19.2.1)
- y-partykit:
- specifier: ^0.0.25
- version: 0.0.25
- yjs:
- specifier: ^13.6.27
- version: 13.6.27
devDependencies:
'@types/react':
specifier: ^19.2.2
@@ -3854,7 +3333,7 @@ importers:
specifier: ^5.4.20
version: 5.4.20(@types/node@24.8.1)(lightningcss@1.30.1)(terser@5.44.1)
- examples/08-extensions/01-tiptap-arrow-conversion:
+ examples/06-custom-schema/react-custom-inline-content:
dependencies:
'@blocknote/ariakit':
specifier: latest
@@ -3880,9 +3359,6 @@ importers:
'@mantine/utils':
specifier: ^6.0.22
version: 6.0.22(react@19.2.1)
- '@tiptap/core':
- specifier: ^3.0.0
- version: 3.13.0(@tiptap/pm@3.13.0)
react:
specifier: ^19.2.1
version: 19.2.1
@@ -3903,7 +3379,7 @@ importers:
specifier: ^5.4.20
version: 5.4.20(@types/node@24.8.1)(lightningcss@1.30.1)(terser@5.44.1)
- examples/09-ai/01-minimal:
+ examples/06-custom-schema/react-custom-styles:
dependencies:
'@blocknote/ariakit':
specifier: latest
@@ -3920,9 +3396,6 @@ importers:
'@blocknote/shadcn':
specifier: latest
version: link:../../../packages/shadcn
- '@blocknote/xl-ai':
- specifier: latest
- version: link:../../../packages/xl-ai
'@mantine/core':
specifier: ^8.3.4
version: 8.3.4(@mantine/hooks@8.3.4(react@19.2.1))(@types/react@19.2.2)(react-dom@19.2.1(react@19.2.1))(react@19.2.1)
@@ -3932,9 +3405,6 @@ importers:
'@mantine/utils':
specifier: ^6.0.22
version: 6.0.22(react@19.2.1)
- ai:
- specifier: ^5.0.102
- version: 5.0.102(zod@4.1.12)
react:
specifier: ^19.2.1
version: 19.2.1
@@ -3955,7 +3425,7 @@ importers:
specifier: ^5.4.20
version: 5.4.20(@types/node@24.8.1)(lightningcss@1.30.1)(terser@5.44.1)
- examples/09-ai/02-playground:
+ examples/08-extensions/01-tiptap-arrow-conversion:
dependencies:
'@blocknote/ariakit':
specifier: latest
@@ -3972,9 +3442,6 @@ importers:
'@blocknote/shadcn':
specifier: latest
version: link:../../../packages/shadcn
- '@blocknote/xl-ai':
- specifier: latest
- version: link:../../../packages/xl-ai
'@mantine/core':
specifier: ^8.3.4
version: 8.3.4(@mantine/hooks@8.3.4(react@19.2.1))(@types/react@19.2.2)(react-dom@19.2.1(react@19.2.1))(react@19.2.1)
@@ -3984,9 +3451,9 @@ importers:
'@mantine/utils':
specifier: ^6.0.22
version: 6.0.22(react@19.2.1)
- ai:
- specifier: ^5.0.102
- version: 5.0.102(zod@4.1.12)
+ '@tiptap/core':
+ specifier: ^3.0.0
+ version: 3.13.0(@tiptap/pm@3.13.0)
react:
specifier: ^19.2.1
version: 19.2.1
@@ -4007,7 +3474,7 @@ importers:
specifier: ^5.4.20
version: 5.4.20(@types/node@24.8.1)(lightningcss@1.30.1)(terser@5.44.1)
- examples/09-ai/03-custom-ai-menu-items:
+ examples/09-ai/01-minimal:
dependencies:
'@blocknote/ariakit':
specifier: latest
@@ -4045,9 +3512,6 @@ importers:
react-dom:
specifier: ^19.2.1
version: 19.2.1(react@19.2.1)
- react-icons:
- specifier: ^5.2.1
- version: 5.5.0(react@19.2.1)
devDependencies:
'@types/react':
specifier: ^19.2.2
@@ -4062,7 +3526,7 @@ importers:
specifier: ^5.4.20
version: 5.4.20(@types/node@24.8.1)(lightningcss@1.30.1)(terser@5.44.1)
- examples/09-ai/04-with-collaboration:
+ examples/09-ai/02-playground:
dependencies:
'@blocknote/ariakit':
specifier: latest
@@ -4100,12 +3564,6 @@ importers:
react-dom:
specifier: ^19.2.1
version: 19.2.1(react@19.2.1)
- y-partykit:
- specifier: ^0.0.25
- version: 0.0.25
- yjs:
- specifier: ^13.6.27
- version: 13.6.27
devDependencies:
'@types/react':
specifier: ^19.2.2
@@ -4120,7 +3578,7 @@ importers:
specifier: ^5.4.20
version: 5.4.20(@types/node@24.8.1)(lightningcss@1.30.1)(terser@5.44.1)
- examples/09-ai/05-manual-execution:
+ examples/09-ai/03-custom-ai-menu-items:
dependencies:
'@blocknote/ariakit':
specifier: latest
@@ -4158,12 +3616,9 @@ importers:
react-dom:
specifier: ^19.2.1
version: 19.2.1(react@19.2.1)
- y-partykit:
- specifier: ^0.0.25
- version: 0.0.25
- yjs:
- specifier: ^13.6.27
- version: 13.6.27
+ react-icons:
+ specifier: ^5.2.1
+ version: 5.5.0(react@19.2.1)
devDependencies:
'@types/react':
specifier: ^19.2.2
@@ -4523,9 +3978,6 @@ importers:
'@handlewithcare/prosemirror-inputrules':
specifier: ^0.1.3
version: 0.1.3(prosemirror-model@1.25.4)(prosemirror-state@1.4.4)(prosemirror-view@1.41.4)
- '@hocuspocus/provider':
- specifier: ^2.15.2 || ^3.0.0
- version: 2.15.3(y-protocols@1.0.6(yjs@13.6.27))(yjs@13.6.27)
'@shikijs/types':
specifier: ^3
version: 3.19.0
@@ -4568,6 +4020,15 @@ importers:
'@tiptap/pm':
specifier: ^3.0.0
version: 3.13.0
+ '@y/prosemirror':
+ specifier: 2.0.0-2
+ version: 2.0.0-2(patch_hash=f9d1f345073554bd5394487b602c1813d6723c77083017611a94bc9580cac896)(@y/protocols@1.0.6-3(@y/y@14.0.0-19))(@y/y@14.0.0-19)(prosemirror-model@1.25.4)(prosemirror-state@1.4.4)(prosemirror-view@1.41.4)
+ '@y/protocols':
+ specifier: 1.0.6-3
+ version: 1.0.6-3(@y/y@14.0.0-19)
+ '@y/y':
+ specifier: 14.0.0-19
+ version: 14.0.0-19
emoji-mart:
specifier: ^5.6.0
version: 5.6.0
@@ -4577,6 +4038,9 @@ importers:
hast-util-from-dom:
specifier: ^5.0.1
version: 5.0.1
+ lib0:
+ specifier: 0.2.116
+ version: 0.2.116
prosemirror-dropcursor:
specifier: ^1.8.2
version: 1.8.2
@@ -4631,15 +4095,6 @@ importers:
uuid:
specifier: ^8.3.2
version: 8.3.2
- y-prosemirror:
- specifier: ^1.3.7
- version: 1.3.7(prosemirror-model@1.25.4)(prosemirror-state@1.4.4)(prosemirror-view@1.41.4)(y-protocols@1.0.6(yjs@13.6.27))(yjs@13.6.27)
- y-protocols:
- specifier: ^1.0.6
- version: 1.0.6(yjs@13.6.27)
- yjs:
- specifier: ^13.6.27
- version: 13.6.27
devDependencies:
'@types/emoji-mart':
specifier: ^3.0.14
@@ -4878,18 +4333,18 @@ importers:
'@tiptap/pm':
specifier: ^3.0.0
version: 3.13.0
+ '@y/prosemirror':
+ specifier: 2.0.0-2
+ version: 2.0.0-2(patch_hash=f9d1f345073554bd5394487b602c1813d6723c77083017611a94bc9580cac896)(@y/protocols@1.0.6-3(@y/y@14.0.0-19))(@y/y@14.0.0-19)(prosemirror-model@1.25.4)(prosemirror-state@1.4.4)(prosemirror-view@1.41.4)
+ '@y/protocols':
+ specifier: 1.0.6-3
+ version: 1.0.6-3(@y/y@14.0.0-19)
+ '@y/y':
+ specifier: 14.0.0-19
+ version: 14.0.0-19
jsdom:
specifier: ^25.0.1
version: 25.0.1(canvas@2.11.2(encoding@0.1.13))
- y-prosemirror:
- specifier: ^1.3.7
- version: 1.3.7(prosemirror-model@1.25.4)(prosemirror-state@1.4.4)(prosemirror-view@1.41.4)(y-protocols@1.0.6(yjs@13.6.27))(yjs@13.6.27)
- y-protocols:
- specifier: ^1.0.6
- version: 1.0.6(yjs@13.6.27)
- yjs:
- specifier: ^13.6.27
- version: 13.6.27
devDependencies:
'@types/jsdom':
specifier: ^21.1.7
@@ -5054,6 +4509,9 @@ importers:
'@tiptap/core':
specifier: ^3.0.0
version: 3.13.0(@tiptap/pm@3.13.0)
+ '@y/prosemirror':
+ specifier: 2.0.0-2
+ version: 2.0.0-2(patch_hash=f9d1f345073554bd5394487b602c1813d6723c77083017611a94bc9580cac896)(@y/protocols@1.0.6-3(@y/y@14.0.0-19))(@y/y@14.0.0-19)(prosemirror-model@1.25.4)(prosemirror-state@1.4.4)(prosemirror-view@1.41.4)
ai:
specifier: ^5.0.102
version: 5.0.102(zod@4.1.12)
@@ -5099,9 +4557,6 @@ importers:
unified:
specifier: ^11.0.5
version: 11.0.5
- y-prosemirror:
- specifier: ^1.3.7
- version: 1.3.7(prosemirror-model@1.25.4)(prosemirror-state@1.4.4)(prosemirror-view@1.41.4)(y-protocols@1.0.6(yjs@13.6.27))(yjs@13.6.27)
devDependencies:
'@ai-sdk/anthropic':
specifier: ^2.0.31
@@ -5616,21 +5071,6 @@ importers:
'@emotion/styled':
specifier: ^11.14.1
version: 11.14.1(@emotion/react@11.14.0(@types/react@19.2.2)(react@19.2.1))(@types/react@19.2.2)(react@19.2.1)
- '@liveblocks/core':
- specifier: 3.7.1-tiptap3
- version: 3.7.1-tiptap3(@types/json-schema@7.0.15)
- '@liveblocks/react':
- specifier: 3.7.1-tiptap3
- version: 3.7.1-tiptap3(@types/json-schema@7.0.15)(@types/react-dom@19.2.2(@types/react@19.2.2))(@types/react@19.2.2)(react@19.2.1)
- '@liveblocks/react-blocknote':
- specifier: 3.7.1-tiptap3
- version: 3.7.1-tiptap3(33c6616930f6f7c88a9e36083f9553b0)
- '@liveblocks/react-tiptap':
- specifier: 3.7.1-tiptap3
- version: 3.7.1-tiptap3(61deabd8fbfc94ee8c4893e0e616a70c)
- '@liveblocks/react-ui':
- specifier: 3.7.1-tiptap3
- version: 3.7.1-tiptap3(@types/json-schema@7.0.15)(@types/react-dom@19.2.2(@types/react@19.2.2))(@types/react@19.2.2)(react-dom@19.2.1(react@19.2.1))(react@19.2.1)
'@mantine/core':
specifier: ^8.3.4
version: 8.3.4(@mantine/hooks@8.3.4(react@19.2.1))(@types/react@19.2.2)(react-dom@19.2.1(react@19.2.1))(react@19.2.1)
@@ -5679,9 +5119,9 @@ importers:
'@uppy/xhr-upload':
specifier: ^3.6.8
version: 3.6.8(@uppy/core@3.13.1)
- '@y-sweet/react':
- specifier: ^0.6.4
- version: 0.6.4(react@19.2.1)(yjs@13.6.27)
+ '@y/y':
+ specifier: 14.0.0-19
+ version: 14.0.0-19
ai:
specifier: ^5.0.102
version: 5.0.102(zod@4.1.12)
@@ -5703,12 +5143,6 @@ importers:
react-router-dom:
specifier: ^6.30.1
version: 6.30.1(react-dom@19.2.1(react@19.2.1))(react@19.2.1)
- y-partykit:
- specifier: ^0.0.25
- version: 0.0.25
- yjs:
- specifier: ^13.6.27
- version: 13.6.27
devDependencies:
'@tailwindcss/vite':
specifier: ^4.1.14
@@ -6754,43 +6188,6 @@ packages:
'@better-fetch/fetch@1.1.18':
resolution: {integrity: sha512-rEFOE1MYIsBmoMJtQbl32PGHHXuG2hDxvEd7rUHE0vCBoFQVSDqaVs9hkZEtHCxRoY+CljXKFCOuJ8uxqw1LcA==}
- '@cloudflare/workerd-darwin-64@1.20240718.0':
- resolution: {integrity: sha512-BsPZcSCgoGnufog2GIgdPuiKicYTNyO/Dp++HbpLRH+yQdX3x4aWx83M+a0suTl1xv76dO4g9aw7SIB6OSgIyQ==}
- engines: {node: '>=16'}
- cpu: [x64]
- os: [darwin]
-
- '@cloudflare/workerd-darwin-arm64@1.20240718.0':
- resolution: {integrity: sha512-nlr4gaOO5gcJerILJQph3+2rnas/nx/lYsuaot1ntHu4LAPBoQo1q/Pucj2cSIav4UiMzTbDmoDwPlls4Kteog==}
- engines: {node: '>=16'}
- cpu: [arm64]
- os: [darwin]
-
- '@cloudflare/workerd-linux-64@1.20240718.0':
- resolution: {integrity: sha512-LJ/k3y47pBcjax0ee4K+6ZRrSsqWlfU4lbU8Dn6u5tSC9yzwI4YFNXDrKWInB0vd7RT3w4Yqq1S6ZEbfRrqVUg==}
- engines: {node: '>=16'}
- cpu: [x64]
- os: [linux]
-
- '@cloudflare/workerd-linux-arm64@1.20240718.0':
- resolution: {integrity: sha512-zBEZvy88EcAMGRGfuVtS00Yl7lJdUM9sH7i651OoL+q0Plv9kphlCC0REQPwzxrEYT1qibSYtWcD9IxQGgx2/g==}
- engines: {node: '>=16'}
- cpu: [arm64]
- os: [linux]
-
- '@cloudflare/workerd-windows-64@1.20240718.0':
- resolution: {integrity: sha512-YpCRvvT47XanFum7C3SedOZKK6BfVhqmwdAAVAQFyc4gsCdegZo0JkUkdloC/jwuWlbCACOG2HTADHOqyeolzQ==}
- engines: {node: '>=16'}
- cpu: [x64]
- os: [win32]
-
- '@cloudflare/workers-types@4.20240718.0':
- resolution: {integrity: sha512-7RqxXIM9HyhjfZ9ztXjITuc7mL0w4s+zXgypqKmMuvuObC3DgXutJ3bOYbQ+Ss5QbywrzWSNMlmGdL/ldg/yZg==}
-
- '@cspotcode/source-map-support@0.8.1':
- resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==}
- engines: {node: '>=12'}
-
'@csstools/color-helpers@5.1.0':
resolution: {integrity: sha512-S11EXWJyy0Mz5SYvRmY8nJYTFFd1LCNV+7cXyAgQtOOuzb4EsgfqDufL+9esx72/eLhsRdGZwaldu/h+E4t4BA==}
engines: {node: '>=18'}
@@ -6819,9 +6216,6 @@ packages:
resolution: {integrity: sha512-Vd/9EVDiu6PPJt9yAh6roZP6El1xHrdvIVGjyBsHR0RYwNHgL7FJPyIIW4fANJNG6FtyZfvlRPpFI4ZM/lubvw==}
engines: {node: '>=18'}
- '@cush/relative@1.0.0':
- resolution: {integrity: sha512-RpfLEtTlyIxeNPGKcokS+p3BZII/Q3bYxryFRglh5H3A3T8q9fsLYm72VYAMEOOIBLEa8o93kFLiBDUWKrwXZA==}
-
'@emnapi/core@1.5.0':
resolution: {integrity: sha512-sbP8GzB1WDzacS8fgNPpHlp6C9VZe+SJP3F90W9rLemaQj2PzIuTEl1qDOYQf58YIpyjViI24y9aPWCjEzY2cg==}
@@ -7200,10 +6594,6 @@ packages:
resolution: {integrity: sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
- '@fastify/busboy@2.1.1':
- resolution: {integrity: sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==}
- engines: {node: '>=14'}
-
'@floating-ui/core@1.7.3':
resolution: {integrity: sha512-sGnvb5dmrJaKEZ+LDIpguvdX3bDlEllmv4/ClQ9awcmCZrlx5jQyyMWFM5kBI+EyNOCDDiKk8il0zeuX3Zlg/w==}
@@ -7276,15 +6666,6 @@ packages:
'@hexagon/base64@1.1.28':
resolution: {integrity: sha512-lhqDEAvWixy3bZ+UOYbPwUbBkwBq5C1LAJ/xPC8Oi+lL54oyakv/npbA0aU2hgCsx/1NUd4IBvV03+aUBWxerw==}
- '@hocuspocus/common@2.15.3':
- resolution: {integrity: sha512-Rzh1HF0a2o/tf90A3w2XNdXd9Ym3aQzMDfD3lAUONCX9B9QOdqdyiORrj6M25QEaJrEIbXFy8LtAFcL0wRdWzA==}
-
- '@hocuspocus/provider@2.15.3':
- resolution: {integrity: sha512-oadN05m+KL4ylNKVo5YspNG4MXkT2Y+FUFzrgigpQeTjQibkPUwCNmUnkUxMgrGRgxb+O0lJCfirFIJMxedctA==}
- peerDependencies:
- y-protocols: ^1.0.6
- yjs: ^13.6.8
-
'@hono/node-server@1.19.5':
resolution: {integrity: sha512-iBuhh+uaaggeAuf+TftcjZyWh2GEgZcVGXkNtskLVoWaXhnJtC5HLHrU8W1KHDoucqO1MswwglmkWLFyiDn4WQ==}
engines: {node: '>=18.14.1'}
@@ -7515,98 +6896,17 @@ packages:
resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==}
engines: {node: '>=6.0.0'}
- '@jridgewell/source-map@0.3.11':
- resolution: {integrity: sha512-ZMp1V8ZFcPG5dIWnQLr3NSI1MiCU7UETdS/A0G8V/XWHvJv3ZsFqutJn1Y5RPmAPX6F3BiE397OqveU/9NCuIA==}
-
- '@jridgewell/sourcemap-codec@1.5.5':
- resolution: {integrity: sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==}
-
- '@jridgewell/trace-mapping@0.3.31':
- resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==}
-
- '@jridgewell/trace-mapping@0.3.9':
- resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==}
-
- '@juggle/resize-observer@3.4.0':
- resolution: {integrity: sha512-dfLbk+PwWvFzSxwk3n5ySL0hfBog779o8h68wK/7/APo/7cgyWp5jcXockbxdk5kFRkbeXWm4Fbi9FrdN381sA==}
-
- '@levischuck/tiny-cbor@0.2.11':
- resolution: {integrity: sha512-llBRm4dT4Z89aRsm6u2oEZ8tfwL/2l6BwpZ7JcyieouniDECM5AqNgr/y08zalEIvW3RSK4upYyybDcmjXqAow==}
-
- '@lifeomic/attempt@3.1.0':
- resolution: {integrity: sha512-QZqem4QuAnAyzfz+Gj5/+SLxqwCAw2qmt7732ZXodr6VDWGeYLG6w1i/vYLa55JQM9wRuBKLmXmiZ2P0LtE5rw==}
-
- '@liveblocks/client@3.7.1-tiptap3':
- resolution: {integrity: sha512-GgolT/FLHicy7CD00yF40odYZT8KO3DC81YNek8lvfXnx2+CEijNWiKYic5JIUnqbGI6kLNGM0AfAnQxxHXkbQ==}
-
- '@liveblocks/core@3.7.1-tiptap3':
- resolution: {integrity: sha512-UT6yWC6DwSS+PENoG4qzUSK46mEGRCEuldxsnrVkajnYr1EnhUaMPzZlV0hN9hzeyT38gciUQKUuTpBis5EBEg==}
- peerDependencies:
- '@types/json-schema': ^7
-
- '@liveblocks/react-blocknote@3.7.1-tiptap3':
- resolution: {integrity: sha512-dpsiQKy8IRlKraWADCT6IZh64br515eTVoUOCRNrhnFRrx+rMFdgK1/V8EEHqMWeVsnFo1Mu42uF8yJHG+sSiA==}
- peerDependencies:
- '@blocknote/core': 0.25.1 - 1.0.0
- '@blocknote/react': 0.25.1 - 1.0.0
- '@tiptap/core': ^3.0.0
- '@types/react': '*'
- '@types/react-dom': '*'
- react: ^18 || ^19 || ^19.0.0-rc
- react-dom: ^18 || ^19 || ^19.0.0-rc
- peerDependenciesMeta:
- '@types/react':
- optional: true
- '@types/react-dom':
- optional: true
-
- '@liveblocks/react-tiptap@3.7.1-tiptap3':
- resolution: {integrity: sha512-UkJpBVKg7FXE9rCdTnhUvC4RhyiHhCL668GuNJcEgvsUuC1iWDqL8GSTNKXTasDcG8VYsO92O5nEw1OqLEjwuw==}
- peerDependencies:
- '@tiptap/extension-collaboration': ^2.7.2
- '@tiptap/extension-collaboration-cursor': ^2.7.2
- '@tiptap/pm': ^3.0.0
- '@tiptap/react': ^2.7.2
- '@tiptap/suggestion': ^2.7.2
- '@types/react': '*'
- '@types/react-dom': '*'
- react: ^18 || ^19 || ^19.0.0-rc
- react-dom: ^18 || ^19 || ^19.0.0-rc
- peerDependenciesMeta:
- '@types/react':
- optional: true
- '@types/react-dom':
- optional: true
-
- '@liveblocks/react-ui@3.7.1-tiptap3':
- resolution: {integrity: sha512-Tq80YiMotbY4Y5g3FdvZlo9IH+MHEiXJ7vK5ygdpsIPNc/9RazEaC8L9pibs0rnyiq4PaDUU2PY3BA1LLRS7YQ==}
- peerDependencies:
- '@types/react': '*'
- '@types/react-dom': '*'
- react: ^18 || ^19 || ^19.0.0-rc
- react-dom: ^18 || ^19 || ^19.0.0-rc
- peerDependenciesMeta:
- '@types/react':
- optional: true
- '@types/react-dom':
- optional: true
+ '@jridgewell/source-map@0.3.11':
+ resolution: {integrity: sha512-ZMp1V8ZFcPG5dIWnQLr3NSI1MiCU7UETdS/A0G8V/XWHvJv3ZsFqutJn1Y5RPmAPX6F3BiE397OqveU/9NCuIA==}
- '@liveblocks/react@3.7.1-tiptap3':
- resolution: {integrity: sha512-08zdVhm+W++/IsTcQZWlTxw6JMsE+/apE7pgofkEUxQHMXhHIfaXlpmK87y5UbV4m7/8O1OI8b/rdjRrkW/6Ww==}
- peerDependencies:
- '@types/react': '*'
- '@types/react-dom': '*'
- react: ^18 || ^19 || ^19.0.0-rc
- peerDependenciesMeta:
- '@types/react':
- optional: true
- '@types/react-dom':
- optional: true
+ '@jridgewell/sourcemap-codec@1.5.5':
+ resolution: {integrity: sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==}
- '@liveblocks/yjs@3.7.1-tiptap3':
- resolution: {integrity: sha512-VpnjAhN4X8NfsKUaSv617SSsX5sdv8nepIsYH4HbKYnzloyMeGINVIIB5eA1Wf5c14TNh1H5zudreqtt3mgPpA==}
- peerDependencies:
- yjs: ^13.6.1
+ '@jridgewell/trace-mapping@0.3.31':
+ resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==}
+
+ '@levischuck/tiny-cbor@0.2.11':
+ resolution: {integrity: sha512-llBRm4dT4Z89aRsm6u2oEZ8tfwL/2l6BwpZ7JcyieouniDECM5AqNgr/y08zalEIvW3RSK4upYyybDcmjXqAow==}
'@mantine/core@8.3.4':
resolution: {integrity: sha512-RJ5QUe2FLLJ1uF8xWUpNhDqRFbaOn4S5yTjqLuaurqtZvzee85O/T90dRcR8UNDuE8e/Qqie/jsF/G9RiSxC6g==}
@@ -7792,10 +7092,6 @@ packages:
resolution: {integrity: sha512-xHK3XHPUW8DTAobU+G0XT+/w+JLM7/8k1UFdB5xg/zTFPnFCobhftzw8wl4Lw2aq/Rvir5pxfZV5fEazmeCJ2g==}
engines: {node: '>= 20.19.0'}
- '@noble/hashes@1.8.0':
- resolution: {integrity: sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==}
- engines: {node: ^14.21.3 || >=16}
-
'@noble/hashes@2.0.1':
resolution: {integrity: sha512-XlOlEbQcE9fmuXxrVTXCTlG2nlRXa9Rj3rr5Ue/+tX+nmkgbX720YHh0VR3hBF9xDvwnb8D2shVGOwNx+ulArw==}
engines: {node: '>= 20.19.0'}
@@ -9936,19 +9232,6 @@ packages:
peerDependencies:
'@tiptap/core': ^3.0.0
- '@tiptap/extension-collaboration-cursor@2.26.1':
- resolution: {integrity: sha512-U6voK6trikBaFe+vO8TXnpuMFvpRZ0U19f1RlElB+ltMK0zl1aqzkv4Rji9Xz5c/B8hMsAa6d2sxIlFvqnwEsw==}
- peerDependencies:
- '@tiptap/core': ^3.0.0
- y-prosemirror: ^1.2.11
-
- '@tiptap/extension-collaboration@2.26.1':
- resolution: {integrity: sha512-ozCrGW5IAzi/18Ngdi0v/Q175D7J3ZGoTffDDyPxnTK/oksfROajoe+ZIEgoDGXPeI/I7TTlTONuqQ6LZT5r7Q==}
- peerDependencies:
- '@tiptap/core': ^3.0.0
- '@tiptap/pm': ^3.0.0
- y-prosemirror: ^1.2.11
-
'@tiptap/extension-floating-menu@3.13.0':
resolution: {integrity: sha512-OsezV2cMofZM4c13gvgi93IEYBUzZgnu8BXTYZQiQYekz4bX4uulBmLa1KOA9EN71FzS+SoLkXHU0YzlbLjlxA==}
peerDependencies:
@@ -10017,12 +9300,6 @@ packages:
react: ^17.0.0 || ^18.0.0 || ^19.0.0
react-dom: ^17.0.0 || ^18.0.0 || ^19.0.0
- '@tiptap/suggestion@2.26.1':
- resolution: {integrity: sha512-iNWJdQN7h01keNoVwyCsdI7ZX11YkrexZjCnutWK17Dd72s3NYVTmQXu7saftwddT4nDdlczNxAFosrt0zMhcg==}
- peerDependencies:
- '@tiptap/core': ^3.0.0
- '@tiptap/pm': ^3.0.0
-
'@tootallnate/once@2.0.0':
resolution: {integrity: sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==}
engines: {node: '>= 10'}
@@ -10537,19 +9814,25 @@ packages:
'@xtuc/long@4.2.2':
resolution: {integrity: sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==}
- '@y-sweet/client@0.6.4':
- resolution: {integrity: sha512-dRfnMulK9HJWzm1BnmViZP93FZ/RrXlIN3Uke3f9iIDDDFLPQs5YBDWZ4dc24Hd8/BnX/Xe/uZzDJcAvENx3fw==}
+ '@y/prosemirror@2.0.0-2':
+ resolution: {integrity: sha512-QGd7H+O47mqzsfQx80RgTt64OMH+mMcqTadjC/lUk+d+DNiDhY1KCBfdJzjprPb5A66ZWtAQ3Ixmc5+Ivk5JQw==}
+ engines: {node: '>=16.0.0', npm: '>=8.0.0'}
peerDependencies:
- yjs: ^13.0.0
+ '@y/protocols': ^1.0.6-3
+ '@y/y': ^14.0.0-16
+ prosemirror-model: ^1.7.1
+ prosemirror-state: ^1.2.3
+ prosemirror-view: ^1.9.10
- '@y-sweet/react@0.6.4':
- resolution: {integrity: sha512-FotyT2MN+wicBl3tHm7CrkJUQu2YFIkOQ7w6DAQTVs6/o+/8kuL7a2svKL15mMAR1TVary1GSCASyRix9VqUCA==}
+ '@y/protocols@1.0.6-3':
+ resolution: {integrity: sha512-ZVp2am1/rYpvRx040m+5i1nj8KUfjDjdGuK+zqe5dicEUcz/cKEFP/+pA+Ap262qBksJx++HjlOKPhuj6of05Q==}
+ engines: {node: '>=16.0.0', npm: '>=8.0.0'}
peerDependencies:
- react: ^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc
- yjs: ^13
+ '@y/y': ^14.0.0-16 || ^14
- '@y-sweet/sdk@0.6.4':
- resolution: {integrity: sha512-px51qSbckGrucN83BM9jJyaBLLdYFT+zhvsootK+WW9t/9rQSQHQX54gdtF6M1kUktA4jOGfSiAXDzuTY0zYVg==}
+ '@y/y@14.0.0-19':
+ resolution: {integrity: sha512-w+wuYhJTRNjyGHZWEHoFggQdDyW/MlDL2ib9vJWaVqlSj+xxu1O07JABkgVzeWxKWIdTa98haXzCHoa1XaPUgQ==}
+ engines: {node: '>=16.0.0', npm: '>=8.0.0'}
'@yarnpkg/lockfile@1.1.0':
resolution: {integrity: sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==}
@@ -10676,9 +9959,6 @@ packages:
resolution: {integrity: sha512-0qWUglt9JEqLFr3w1I1pbrChn1grhaiAR2ocX1PP/flRmxgtwTzPFFFnfIlD6aMOLQZgSuCRlidD70lvx8yhzg==}
engines: {node: '>=14'}
- any-promise@1.3.0:
- resolution: {integrity: sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==}
-
anymatch@3.1.3:
resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==}
engines: {node: '>= 8'}
@@ -10750,9 +10030,6 @@ packages:
resolution: {integrity: sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ==}
engines: {node: '>= 0.4'}
- as-table@1.0.55:
- resolution: {integrity: sha512-xvsWESUJn0JN421Xb9MQw6AsMHRCUknCe0Wjlxvjud80mU4E6hQf1A6NzQKcYNmYw62MfzEtXc+badstZP3JpQ==}
-
asn1js@3.0.6:
resolution: {integrity: sha512-UOCGPYbl0tv8+006qks/dTgV9ajs97X2p0FAbyS2iyCRrmLSRolDaHdp+v/CLgnzHc3fVB+CwYiUmei7ndFcgA==}
engines: {node: '>=12.0.0'}
@@ -10859,10 +10136,6 @@ packages:
resolution: {integrity: sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==}
engines: {node: ^4.5.0 || >= 5.9}
- baseline-browser-mapping@2.8.18:
- resolution: {integrity: sha512-UYmTpOBwgPScZpS4A+YbapwWuBwasxvO/2IOHArSsAhL/+ZdmATBXTex3t+l2hXwLVYK382ibr/nKoY9GKe86w==}
- hasBin: true
-
baseline-browser-mapping@2.9.7:
resolution: {integrity: sha512-k9xFKplee6KIio3IDbwj+uaCLpqzOwakOgmqzPezM0sFJlFKcg30vk2wOiAJtkTSfx0SSQDSe8q+mWA/fSH5Zg==}
hasBin: true
@@ -10941,11 +10214,6 @@ packages:
browserify-zlib@0.2.0:
resolution: {integrity: sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==}
- browserslist@4.26.3:
- resolution: {integrity: sha512-lAUU+02RFBuCKQPj/P6NgjlbCnLBMp4UtgTx7vNHd3XSIJF87s9a5rA3aH2yw3GS9DqZAUbOtZdCCiZeVRqt0w==}
- engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7}
- hasBin: true
-
browserslist@4.28.1:
resolution: {integrity: sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA==}
engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7}
@@ -10995,9 +10263,6 @@ packages:
camelize@1.0.1:
resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==}
- caniuse-lite@1.0.30001751:
- resolution: {integrity: sha512-A0QJhug0Ly64Ii3eIqHu5X51ebln3k4yTUkY1j8drqpWHVreg/VLijN48cZ1bYPiqOQuqpkIKnzr/Ul8V+p6Cw==}
-
caniuse-lite@1.0.30001760:
resolution: {integrity: sha512-7AAMPcueWELt1p3mi13HR/LHH0TJLT11cnwDJEs3xA4+CK/PLKeO9Kl1oru24htkyUKtkGCvAx4ohB0Ttry8Dw==}
@@ -11009,9 +10274,6 @@ packages:
resolution: {integrity: sha512-tTj3CqqukVJ9NgSahykNwtGda7V33VLObwrHfzT0vqJXu7J4d4C/7kQQW3fOEGDfZZoILPut5H00gOjyttPGyg==}
engines: {node: ^18.12.0 || >= 20.9.0}
- capnp-ts@0.7.0:
- resolution: {integrity: sha512-XKxXAC3HVPv7r674zP0VC3RTXz+/JKhfyw94ljvF80yynK6VkTnqE3jMuN8b3dUVmmc43TjyxjW4KTsmB3c86g==}
-
ccount@2.0.1:
resolution: {integrity: sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==}
@@ -11125,10 +10387,6 @@ packages:
resolution: {integrity: sha512-Su+uU5sr1jkUy1sGRpLKjKrvEOVXgSgiSInwa/qeID6aJ07yh+5NWc3h2QfjHjBnfX4LhtFcuAWKUsJ3r+fjbg==}
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
- clipboardy@4.0.0:
- resolution: {integrity: sha512-5mOlNS0mhX0707P2I0aZ2V/cmHUEO/fL7VFLqszkhUsxt7RwnmrInf/eEQKlf5GzvYeHIjT+Ov1HRfNmymlG0w==}
- engines: {node: '>=18'}
-
cliui@8.0.1:
resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==}
engines: {node: '>=12'}
@@ -11189,10 +10447,6 @@ packages:
commander@2.20.3:
resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==}
- commander@4.1.1:
- resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==}
- engines: {node: '>= 6'}
-
commondir@1.0.1:
resolution: {integrity: sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==}
@@ -11215,9 +10469,6 @@ packages:
engines: {node: '>=18'}
hasBin: true
- confbox@0.1.8:
- resolution: {integrity: sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==}
-
confbox@0.2.2:
resolution: {integrity: sha512-1NB+BKqhtNipMsov4xI/NnhCKp9XG9NamYp5PVm9klAT0fsrNPjaFICsCFhNhwZJKNh7zB/3q8qXz0E9oaMNtQ==}
@@ -11315,9 +10566,6 @@ packages:
damerau-levenshtein@1.0.8:
resolution: {integrity: sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA==}
- data-uri-to-buffer@2.0.2:
- resolution: {integrity: sha512-ND9qDTLc6diwj+Xe5cdAgVTbLVdXbtxTJRXRhli8Mowuaan+0EJOtdqJ0QCHNSSPyoXGx9HX2/VMnKeC34AChA==}
-
data-urls@4.0.0:
resolution: {integrity: sha512-/mMTei/JXPqvFqQtfyTowxmJVwr2PVAeCcDxyFf6LhoOu/09TX2OX3kb2wzi4DMXcfj4OItwDOnhl5oziPnT6g==}
engines: {node: '>=14'}
@@ -11474,10 +10722,6 @@ packages:
resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==}
engines: {node: '>=8'}
- direction@1.0.4:
- resolution: {integrity: sha512-GYqKi1aH7PJXxdhTeZBFrg8vUBeKXi+cNprXsC1kpJcbcVnV9wBsrOu1cQEdG0WeQwlfHiy3XvnKfIrJ2R0NzQ==}
- hasBin: true
-
doctrine@2.1.0:
resolution: {integrity: sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==}
engines: {node: '>=0.10.0'}
@@ -11538,9 +10782,6 @@ packages:
engines: {node: '>=0.10.0'}
hasBin: true
- electron-to-chromium@1.5.237:
- resolution: {integrity: sha512-icUt1NvfhGLar5lSWH3tHNzablaA5js3HVHacQimfP8ViEBOQv+L7DKEuHdbTZ0SKCO1ogTJTIL1Gwk9S6Qvcg==}
-
electron-to-chromium@1.5.267:
resolution: {integrity: sha512-0Drusm6MVRXSOJpGbaSVgcQsuB4hEkMpHXaVstcPmhu5LIedxs1xNK/nIxmQIU/RPC0+1/o0AVZfBTkTNJOdUw==}
@@ -11573,10 +10814,6 @@ packages:
resolution: {integrity: sha512-ZCkIjSYNDyGn0R6ewHDtXgns/Zre/NT6Agvq1/WobF7JXgFff4SeDroKiCO3fNJreU9YG429Sc81o4w5ok/W5g==}
engines: {node: '>=10.2.0'}
- enhanced-resolve@5.18.3:
- resolution: {integrity: sha512-d4lC8xfavMeBjzGr2vECC3fsGXziXZQyJxD868h2M/mBI3PwAuODxAkLkq5HYuvrPYcUtiLzsTo8U3PgX3Ocww==}
- engines: {node: '>=10.13.0'}
-
enhanced-resolve@5.18.4:
resolution: {integrity: sha512-LgQMM4WXU3QI+SYgEc2liRgznaD5ojbmY3sb8LxyguVkIg5FxdpTkvk72te2R38/TGKxH634oLxXRGY6d7AP+Q==}
engines: {node: '>=10.13.0'}
@@ -11863,17 +11100,9 @@ packages:
resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==}
engines: {node: '>=10'}
- execa@8.0.1:
- resolution: {integrity: sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==}
- engines: {node: '>=16.17'}
-
exifr@7.1.3:
resolution: {integrity: sha512-g/aje2noHivrRSLbAUtBPWFbxKdKhgj/xr1vATDdUXPOFYJlQ62Ft0oy+72V6XLIpDJfHs6gXLbBLAolqOXYRw==}
- exit-hook@2.2.1:
- resolution: {integrity: sha512-eNTPlAD67BmP31LDINZ3U7HSF8l57TxOY2PmBJ1shpCvpnxBF93mWCE8YHBnXs8qiUZJc9WDcWIeC3a2HIAMfw==}
- engines: {node: '>=6'}
-
expand-template@2.0.3:
resolution: {integrity: sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==}
engines: {node: '>=6'}
@@ -12024,11 +11253,6 @@ packages:
react-dom:
optional: true
- frimousse@0.2.0:
- resolution: {integrity: sha512-viSrsVQWKR4Q7xzC0lkx3Wu9i1+IHrth0QXn0nlIIJXpltwUnjkGXSTuoW7WHI5aJ4z49WR8E/pyQizFjlNtTA==}
- peerDependencies:
- react: ^18 || ^19
-
front-matter@4.0.2:
resolution: {integrity: sha512-I8ZuJ/qG92NWX8i5x1Y8qyj3vizhXS31OxjKDu3LKP+7/qBgfIKValiZIEwoVoJKUHlhWtYrktkxV1XsX+pPlg==}
@@ -12172,9 +11396,6 @@ packages:
resolution: {integrity: sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==}
engines: {node: '>= 0.4'}
- get-source@2.0.12:
- resolution: {integrity: sha512-X5+4+iD+HoSeEED+uwrQ07BOQr0kEDFMVqqpBuI+RaZBpBpHCuXxo70bjar6f0b0u/DQJsJ7ssurpP0V60Az+w==}
-
get-stdin@5.0.1:
resolution: {integrity: sha512-jZV7n6jGE3Gt7fgSTJoz91Ak5MuTLwMwkoYdjxuJ/AmjIsE1UC03y/IWkZCQGEvVNS9qoRNwy5BCqxImv0FVeA==}
engines: {node: '>=0.12.0'}
@@ -12183,10 +11404,6 @@ packages:
resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==}
engines: {node: '>=10'}
- get-stream@8.0.1:
- resolution: {integrity: sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==}
- engines: {node: '>=16'}
-
get-symbol-description@1.1.0:
resolution: {integrity: sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg==}
engines: {node: '>= 0.4'}
@@ -12211,16 +11428,9 @@ packages:
resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==}
engines: {node: '>=10.13.0'}
- glob-regex@0.3.2:
- resolution: {integrity: sha512-m5blUd3/OqDTWwzBBtWBPrGlAzatRywHameHeekAZyZrskYouOGdNB8T/q6JucucvJXtOuyHIn0/Yia7iDasDw==}
-
glob-to-regexp@0.4.1:
resolution: {integrity: sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==}
- glob@10.4.5:
- resolution: {integrity: sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==}
- hasBin: true
-
glob@10.5.0:
resolution: {integrity: sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==}
hasBin: true
@@ -12250,9 +11460,6 @@ packages:
resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==}
engines: {node: '>=10'}
- globrex@0.1.2:
- resolution: {integrity: sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==}
-
glur@1.1.2:
resolution: {integrity: sha512-l+8esYHTKOx2G/Aao4lEQ0bnHWg4fWtJbVoZZT9Knxi01pB8C80BR85nONLFwkkQoFRCmXY+BUcGZN3yZ2QsRA==}
@@ -12432,10 +11639,6 @@ packages:
resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==}
engines: {node: '>=10.17.0'}
- human-signals@5.0.0:
- resolution: {integrity: sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==}
- engines: {node: '>=16.17.0'}
-
hyphen@1.10.6:
resolution: {integrity: sha512-fXHXcGFTXOvZTSkPJuGOQf5Lv5T/R2itiiCVPg9LxAje5D00O0pP83yJShFq5V89Ly//Gt6acj7z8pbBr34stw==}
@@ -12461,9 +11664,6 @@ packages:
immediate@3.0.6:
resolution: {integrity: sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==}
- immer@10.1.3:
- resolution: {integrity: sha512-tmjF/k8QDKydUlm3mZU+tjM6zeq9/fFpPqH9SzWmBnVVKsPBg/V66qsMwb3/Bo90cgUN+ghdVBess+hPsxUyRw==}
-
import-fresh@3.3.1:
resolution: {integrity: sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==}
engines: {node: '>=6'}
@@ -12586,9 +11786,6 @@ packages:
is-hexadecimal@2.0.1:
resolution: {integrity: sha512-DgZQp241c8oO6cA1SbTEWiXeoxV42vlcJxgH+B3hi1AiqqKruZR3ZGF8In3fj4+/y/7rHvlOZLZtgJ/4ttYGZg==}
- is-hotkey@0.2.0:
- resolution: {integrity: sha512-UknnZK4RakDmTgz4PI1wIph5yxSs/mvChWs9ifnlXsKuXgWmOkY/hAE0H/k2MIqH0RlRye0i1oC07MCRSD28Mw==}
-
is-inside-container@1.0.0:
resolution: {integrity: sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==}
engines: {node: '>=14.16'}
@@ -12669,10 +11866,6 @@ packages:
resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==}
engines: {node: '>=8'}
- is-stream@3.0.0:
- resolution: {integrity: sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==}
- engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
-
is-string@1.1.1:
resolution: {integrity: sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA==}
engines: {node: '>= 0.4'}
@@ -12720,10 +11913,6 @@ packages:
resolution: {integrity: sha512-UcVfVfaK4Sc4m7X3dUSoHoozQGBEFeDC+zVo06t98xe8CzHSZZBekNXH+tu0NalHolcJ/QAGqS46Hef7QXBIMw==}
engines: {node: '>=16'}
- is64bit@2.0.0:
- resolution: {integrity: sha512-jv+8jaWCl0g2lSBkNSVXdzfBA0npK1HGC2KtWM9FumFRoGS94g3NbCCLVnCYHLjp4GrW2KZeeSTMo5ddtznmGw==}
- engines: {node: '>=18'}
-
isarray@1.0.0:
resolution: {integrity: sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==}
@@ -12806,9 +11995,6 @@ packages:
jose@6.1.0:
resolution: {integrity: sha512-TTQJyoEoKcC1lscpVDCSsVgYzUDg/0Bt3WE//WiTPK6uOCQC2KZS4MpugbMWt/zyjkopgZoXhZuCi00gLudfUA==}
- js-base64@3.7.8:
- resolution: {integrity: sha512-hNngCeKxIUQiEUN3GPJOkz4wF/YvdUdbNL9hsBcMQTkKzboD7T/q3OYOuuPZLUE6dBxSGpwhk5mwuDud7JVAow==}
-
js-tokens@4.0.0:
resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==}
@@ -12909,8 +12095,8 @@ packages:
resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==}
engines: {node: '>= 0.8.0'}
- lib0@0.2.114:
- resolution: {integrity: sha512-gcxmNFzA4hv8UYi8j43uPlQ7CGcyMJ2KQb5kZASw6SnAKAf10hK12i2fjrS3Cl/ugZa5Ui6WwIu1/6MIXiHttQ==}
+ lib0@0.2.116:
+ resolution: {integrity: sha512-4zsosjzmt33rx5XjmFVYUAeLNh+BTeDTiwGdLt4muxiir2btsc60Nal0EvkvDRizg+pnlK1q+BtYi7M+d4eStw==}
engines: {node: '>=16'}
hasBin: true
@@ -13095,11 +12281,6 @@ packages:
react:
optional: true
- marked@15.0.12:
- resolution: {integrity: sha512-8dD6FusOQSrpv9Z1rdNMdlSgQOIP880DHqnohobOmYLElGEqAL/JvxvuxZO16r4HtjTlfPRDC1hbvxC9dPN2nA==}
- engines: {node: '>= 18'}
- hasBin: true
-
marked@7.0.4:
resolution: {integrity: sha512-t8eP0dXRJMtMvBojtkcsA7n48BkauktUKzfkPSCq85ZMTJ0v76Rke4DYz01omYpPTUh4p/f7HePgRo3ebG8+QQ==}
engines: {node: '>= 16'}
@@ -13318,10 +12499,6 @@ packages:
resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==}
engines: {node: '>=6'}
- mimic-fn@4.0.0:
- resolution: {integrity: sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==}
- engines: {node: '>=12'}
-
mimic-function@5.0.1:
resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==}
engines: {node: '>=18'}
@@ -13334,11 +12511,6 @@ packages:
resolution: {integrity: sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==}
engines: {node: '>=10'}
- miniflare@3.20240718.0:
- resolution: {integrity: sha512-TKgSeyqPBeT8TBLxbDJOKPWlq/wydoJRHjAyDdgxbw59N6wbP8JucK6AU1vXCfu21eKhrEin77ssXOpbfekzPA==}
- engines: {node: '>=16.13'}
- hasBin: true
-
minimalistic-assert@1.0.1:
resolution: {integrity: sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==}
@@ -13400,9 +12572,6 @@ packages:
engines: {node: '>=10'}
hasBin: true
- mlly@1.8.0:
- resolution: {integrity: sha512-l8D9ODSRWLe2KHJSifWGwBqpTZXIXTeo8mlKjY+E2HAakaTeNpqAyBZ8GSqLzHgw4XmHmC8whvpjJNMbFZN7/g==}
-
module-details-from-path@1.0.4:
resolution: {integrity: sha512-EGWKgxALGMgzvxYF1UyGTy0HXX/2vHLkw6+NvDKW2jypWbHpjQuj4UMcqQWXHERJhVGKikolT06G3bcKe4fi7w==}
@@ -13437,17 +12606,10 @@ packages:
typescript:
optional: true
- mustache@4.2.0:
- resolution: {integrity: sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==}
- hasBin: true
-
mute-stream@2.0.0:
resolution: {integrity: sha512-WWdIxpyjEn+FhQJQQv9aQAYlHoNVdzIzUySNV1gHUPDSdZJ3yZn7pAAbQcV7B56Mvu881q9FZV+0Vx2xC44VWA==}
engines: {node: ^18.17.0 || >=20.5.0}
- mz@2.7.0:
- resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==}
-
namespace-emitter@2.0.1:
resolution: {integrity: sha512-N/sMKHniSDJBjfrkbS/tpkPj4RAbvW3mr8UAzvlMHyun93XEm83IAvhWtJVHo+RHn/oO8Job5YN4b+wRjSVp5g==}
@@ -13545,9 +12707,6 @@ packages:
node-machine-id@1.1.12:
resolution: {integrity: sha512-QNABxbrPa3qEIfrE6GOJ7BYIuignnJw7iQ2YPbc3Nla1HzRJjXzZOiikfF8m7eAMfichLt3M4VgLOetqgDmgGQ==}
- node-releases@2.0.25:
- resolution: {integrity: sha512-4auku8B/vw5psvTiiN9j1dAOsXvMoGqJuKJcR+dTdqiXEK20mMTk1UEo3HS16LeGQsVG6+qKTPM9u/qQ2LqATA==}
-
node-releases@2.0.27:
resolution: {integrity: sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==}
@@ -13579,10 +12738,6 @@ packages:
resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==}
engines: {node: '>=8'}
- npm-run-path@5.3.0:
- resolution: {integrity: sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==}
- engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
-
npm-to-yarn@3.0.1:
resolution: {integrity: sha512-tt6PvKu4WyzPwWUzy/hvPFqn+uwXO0K1ZHka8az3NnrhWJDmSqI8ncWq0fkL0k/lmmi5tAC11FXwXuh0rFbt1A==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
@@ -13649,9 +12804,6 @@ packages:
ofetch@1.4.1:
resolution: {integrity: sha512-QZj2DfGplQAr2oj9KzceK9Hwz6Whxazmn85yYeVuS3u9XTMOGMRx0kO95MQ+vLsj/S/NwBDMMLU5hpxvI6Tklw==}
- ohash@1.1.6:
- resolution: {integrity: sha512-TBu7PtV8YkAZn0tSxobKY2n2aAQva936lhRrj6957aDaCf9IEtqsKbgMzXE/F/sjqYOwmrukeORHNLe5glk7Cg==}
-
ohash@2.0.11:
resolution: {integrity: sha512-RdR9FQrFwNBNXAr4GixM8YaRZRJ5PUWbKYbE5eOsrwAjJW0q2REGcf79oYPsLyskQCZG1PLN+S/K1V00joZAoQ==}
@@ -13666,10 +12818,6 @@ packages:
resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==}
engines: {node: '>=6'}
- onetime@6.0.0:
- resolution: {integrity: sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==}
- engines: {node: '>=12'}
-
onetime@7.0.0:
resolution: {integrity: sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==}
engines: {node: '>=18'}
@@ -13766,10 +12914,6 @@ packages:
parseley@0.12.1:
resolution: {integrity: sha512-e6qHKe3a9HWr0oMRVDTRhKce+bRO8VGQR3NyVwcjwrbhMmFCX9KszEV35+rn4AdilFAq9VPxP/Fe1wC9Qjd2lw==}
- partykit@0.0.115:
- resolution: {integrity: sha512-WHmJIZsAzRWrm1lrtU7wcl0tpD4rg2vgmn4+hXGPjU4mnXgFxyjVq2ZzO547xRXa1IbETOP6J9INl/ergR99bA==}
- hasBin: true
-
path-browserify@1.0.1:
resolution: {integrity: sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==}
@@ -13788,10 +12932,6 @@ packages:
resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==}
engines: {node: '>=8'}
- path-key@4.0.0:
- resolution: {integrity: sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==}
- engines: {node: '>=12'}
-
path-parse@1.0.7:
resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==}
@@ -13899,17 +13039,10 @@ packages:
resolution: {integrity: sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==}
engines: {node: '>=12'}
- pirates@4.0.7:
- resolution: {integrity: sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==}
- engines: {node: '>= 6'}
-
pixelmatch@5.3.0:
resolution: {integrity: sha512-o8mkY4E/+LNUf6LzX96ht6k6CEDi65k9G2rjMtBe9Oo+VPKSvl+0GKHuH/AlG+GA5LPG/i5hrekkxUc3s2HU+Q==}
hasBin: true
- pkg-types@1.3.1:
- resolution: {integrity: sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==}
-
pkg-types@2.3.0:
resolution: {integrity: sha512-SIqCzDRg0s9npO5XQ3tNZioRY1uK06lA41ynBC1YmFTmnY6FjUjVt6s4LoADmwoig1qqD0oK8h1p/8mlMx8Oig==}
@@ -14076,9 +13209,6 @@ packages:
resolution: {integrity: sha512-9uBdv/B4EefsuAL+pWqueZyZS2Ba+LxfFeQ9DN14HU4bN8bhaxKdkpjpB6fs9+pSjIBu+FXQHImEg8j/Lw0+vA==}
engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0}
- printable-characters@1.0.42:
- resolution: {integrity: sha512-dKp+C4iXWK4vVYZmYSd0KBH5F/h1HoZRsbJ82AVKRO3PEo8L4lBS/vLwhVtpwwuYcoIsVY+1JYKR268yn480uQ==}
-
prismjs@1.30.0:
resolution: {integrity: sha512-DEvV2ZF2r2/63V+tK8hQvrR2ZGn10srHbXviTlcv7Kpzw8jWiNTqbVgjO3IY8RxrrOUF8VPMQQFysYYYv0YZxw==}
engines: {node: '>=6'}
@@ -14371,10 +13501,6 @@ packages:
react: '>=16.6.0'
react-dom: '>=16.6.0'
- react@18.3.1:
- resolution: {integrity: sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==}
- engines: {node: '>=0.10.0'}
-
react@19.2.1:
resolution: {integrity: sha512-DGrYcCWK7tvYMnWh79yrPHt+vdx9tY+1gPZa7nJQtO/p8bLTDaHp4dzwEhQB7pZ4Xe3ok4XKuEPrVuc+wlpkmw==}
engines: {node: '>=0.10.0'}
@@ -14408,9 +13534,6 @@ packages:
recma-stringify@1.0.0:
resolution: {integrity: sha512-cjwII1MdIIVloKvC9ErQ+OgAtwHBmcZ0Bg4ciz78FtbT8In39aAYbaA7zvxQ61xVMSPE8WxhLwLbhif4Js2C+g==}
- recrawl-sync@2.2.3:
- resolution: {integrity: sha512-vSaTR9t+cpxlskkdUFrsEpnf67kSmPk66yAGT1fZPrDudxQjoMzPgQhSMImQ0pAw5k0NPirefQfhopSjhdUtpQ==}
-
reflect-metadata@0.2.2:
resolution: {integrity: sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==}
@@ -14772,26 +13895,6 @@ packages:
resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==}
engines: {node: '>=8'}
- slate-history@0.110.3:
- resolution: {integrity: sha512-sgdff4Usdflmw5ZUbhDkxFwCBQ2qlDKMMkF93w66KdV48vHOgN2BmLrf+2H8SdX8PYIpP/cTB0w8qWC2GwhDVA==}
- peerDependencies:
- slate: '>=0.65.3'
-
- slate-hyperscript@0.100.0:
- resolution: {integrity: sha512-fb2KdAYg6RkrQGlqaIi4wdqz3oa0S4zKNBJlbnJbNOwa23+9FLD6oPVx9zUGqCSIpy+HIpOeqXrg0Kzwh/Ii4A==}
- peerDependencies:
- slate: '>=0.65.3'
-
- slate-react@0.110.3:
- resolution: {integrity: sha512-AS8PPjwmsFS3Lq0MOEegLVlFoxhyos68G6zz2nW4sh3WeTXV7pX0exnwtY1a/docn+J3LGQO11aZXTenPXA/kg==}
- peerDependencies:
- react: '>=18.2.0'
- react-dom: '>=18.2.0'
- slate: '>=0.99.0'
-
- slate@0.110.2:
- resolution: {integrity: sha512-4xGULnyMCiEQ0Ml7JAC1A6HVE6MNpPJU7Eq4cXh1LxlrR0dFXC3XC+rNfQtUJ7chHoPkws57x7DDiWiZAt+PBA==}
-
socket.io-adapter@2.5.5:
resolution: {integrity: sha512-eLDQas5dzPgOWCk9GuuJC2lBqItuhKI4uxGgo9aIV7MYbk2h9Q6uULEh8WBzThoI7l+qU9Ast9fVUmkqPP9wYg==}
@@ -14849,9 +13952,6 @@ packages:
resolution: {integrity: sha512-WjlahMgHmCJpqzU8bIBy4qtsZdU9lRlcZE3Lvyej6t4tuOuv1vk57OW3MBrj6hXBFx/nNoC9MPMTcr5YA7NQbg==}
engines: {node: '>=6'}
- stacktracey@2.1.8:
- resolution: {integrity: sha512-Kpij9riA+UNg7TnphqjH7/CzctQ/owJGNbFkfEeve4Z4uxT5+JapVLFXcsurIfN34gnTWZNJ/f7NMG0E8JDzTw==}
-
standardwebhooks@1.0.0:
resolution: {integrity: sha512-BbHGOQK9olHPMvQNHWul6MYlrRTAOKn03rOe4A8O3CLWhNf4YHBqq2HJKKC+sfqpxiBY52pNeesD6jIiLDz8jg==}
@@ -14870,10 +13970,6 @@ packages:
resolution: {integrity: sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ==}
engines: {node: '>= 0.4'}
- stoppable@1.1.0:
- resolution: {integrity: sha512-KXDYZ9dszj6bzvnEMRYvxgeTHU74QBFL54XKtP3nyMuJ81CFYtABZ3bAzL2EdFUaEwJOBOgENyFj3R7oTzDyyw==}
- engines: {node: '>=4', npm: '>=6'}
-
strict-event-emitter@0.5.1:
resolution: {integrity: sha512-vMgjE/GGEPEFnhFub6pa4FmJBRBVOLpIII2hvCZ8Kzb7K0hlHo7mQv6xYrBvCL2LtAIBwFUK8wvuJgTVSQ5MFQ==}
@@ -14947,10 +14043,6 @@ packages:
resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==}
engines: {node: '>=6'}
- strip-final-newline@3.0.0:
- resolution: {integrity: sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==}
- engines: {node: '>=12'}
-
strip-json-comments@2.0.1:
resolution: {integrity: sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==}
engines: {node: '>=0.10.0'}
@@ -14984,11 +14076,6 @@ packages:
stylis@4.2.0:
resolution: {integrity: sha512-Orov6g6BB1sDfYgzWfTHDOxamtX1bE/zo104Dh9e6fqJ3PooipYyfJ0pUmrZO2wAvO8YbEyeFrkV91XTsGMSrw==}
- sucrase@3.35.0:
- resolution: {integrity: sha512-8EbVDiu9iN/nESwxeSxDKe0dunta1GOlHufmSSXxMD2z2/tMZpDMpvXQGsc+ajGo8y2uYUmixaSRUc/QPoQ0GA==}
- engines: {node: '>=16 || 14 >=14.17'}
- hasBin: true
-
supports-color@7.2.0:
resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==}
engines: {node: '>=8'}
@@ -15012,10 +14099,6 @@ packages:
symbol-tree@3.2.4:
resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==}
- system-architecture@0.1.0:
- resolution: {integrity: sha512-ulAk51I9UVUyJgxlv9M6lFot2WP3e7t8Kz9+IS6D4rVba1tR9kON+Ey69f+1R4Q8cd45Lod6a4IcJIxnzGc/zA==}
- engines: {node: '>=18'}
-
tabbable@6.2.0:
resolution: {integrity: sha512-Cat63mxsVJlzYvN51JmVXIgNoUokrIaT2zLclCXjRd8boZ0004U4KCs/sToJ75C6sdlByWxpYnb5Boif1VSFew==}
@@ -15071,13 +14154,6 @@ packages:
text-table@0.2.0:
resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==}
- thenify-all@1.6.0:
- resolution: {integrity: sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==}
- engines: {node: '>=0.8'}
-
- thenify@3.3.1:
- resolution: {integrity: sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==}
-
throttleit@2.1.0:
resolution: {integrity: sha512-nt6AMGKW1p/70DF/hGBdJB57B8Tspmbp5gfJ8ilhLnt7kkr2ye7hzD6NVG8GGErk2HWF34igrL2CXmNIkzKqKw==}
engines: {node: '>=18'}
@@ -15085,12 +14161,6 @@ packages:
tiny-inflate@1.0.3:
resolution: {integrity: sha512-pkY1fj1cKHb2seWDy0B16HeWyczlJA9/WW3u3c4z/NiWDsO3DOU5D7nhTLE9CF0yXv/QZFY7sEJmj24dK+Rrqw==}
- tiny-invariant@1.3.1:
- resolution: {integrity: sha512-AD5ih2NlSssTCwsMznbvwMZpJ1cbhkGd2uueNxzv2jDlEeZdU04JQfRnggJQ8DrcVBGjAsCKwFBbDlVNtEMlzw==}
-
- tiny-warning@1.0.3:
- resolution: {integrity: sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==}
-
tinybench@2.9.0:
resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==}
@@ -15182,13 +14252,6 @@ packages:
trough@2.2.0:
resolution: {integrity: sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw==}
- ts-dedent@2.2.0:
- resolution: {integrity: sha512-q5W7tVM71e2xjHZTlgfTDoPF/SmqKG5hddq9SzR49CH2hayqRKJtQ4mtRlSxKaJlR/+9rEM+mnBHf7I2/BQcpQ==}
- engines: {node: '>=6.10'}
-
- ts-interface-checker@0.1.13:
- resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==}
-
ts-morph@26.0.0:
resolution: {integrity: sha512-ztMO++owQnz8c/gIENcM9XfCEzgoGphTv+nKpYNM1bgsdOVC/jRZuEBf6N+mLLDNg68Kl+GgUZfOySaRiG1/Ug==}
@@ -15297,17 +14360,10 @@ packages:
undici-types@7.14.0:
resolution: {integrity: sha512-QQiYxHuyZ9gQUIrmPo3IA+hUl4KYk8uSA7cHrcKd/l3p1OTpZcM0Tbp9x7FAtXdAYhlasd60ncPpgu6ihG6TOA==}
- undici@5.29.0:
- resolution: {integrity: sha512-raqeBD6NQK4SkWhQzeYKd1KmIG6dllBOTt55Rmkt4HtI9mwdWtJljnrXjAFUBLTSN67HWrOIZ3EPF4kjUw80Bg==}
- engines: {node: '>=14.0'}
-
undici@6.22.0:
resolution: {integrity: sha512-hU/10obOIu62MGYjdskASR3CUAiYaFTtC9Pa6vHyf//mAipSvSQg6od2CnJswq7fvzNS3zJhxoRkgNVaHurWKw==}
engines: {node: '>=18.17'}
- unenv@2.0.0-rc.0:
- resolution: {integrity: sha512-H0kl2w8jFL/FAk0xvjVing4bS3jd//mbg1QChDnn58l9Sc5RtduaKmLAL8n+eBw5jJo8ZjYV7CrEGage5LAOZQ==}
-
unicode-canonical-property-names-ecmascript@2.0.1:
resolution: {integrity: sha512-dA8WbNeb2a6oQzAQ55YlT5vQAWGV9WXOsi3SskE3bcCdM0P4SDd+24zS/OCacdRq5BkdsRj9q3Pg6YyQoxIGqg==}
engines: {node: '>=4'}
@@ -15368,12 +14424,6 @@ packages:
until-async@3.0.2:
resolution: {integrity: sha512-IiSk4HlzAMqTUseHHe3VhIGyuFmN90zMTpD3Z3y8jeQbzLIq500MVM7Jq2vUAnTKAFPJrqwkzr6PoTcPhGcOiw==}
- update-browserslist-db@1.1.3:
- resolution: {integrity: sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw==}
- hasBin: true
- peerDependencies:
- browserslist: '>= 4.21.0'
-
update-browserslist-db@1.2.2:
resolution: {integrity: sha512-E85pfNzMQ9jpKkA7+TJAi4TJN+tBCuWh5rUcS/sv6cFi+1q9LYDwDI5dpUL0u/73EElyQ8d3TEaeW4sPedBqYA==}
hasBin: true
@@ -15580,9 +14630,6 @@ packages:
yaml:
optional: true
- vitest-tsconfig-paths@3.4.1:
- resolution: {integrity: sha512-CnRpA/jcqgZfnkk0yvwFW92UmIpf03wX/wLiQBNWAcOG7nv6Sdz3GsPESAMEqbVy8kHBoWB3XeNamu6PUrFZLA==}
-
vitest@2.1.9:
resolution: {integrity: sha512-MSmPM9REYqDGBI8439mA4mWhV5sKmDlBKWIYbA3lRb2PTHACE0mgKwA8yQ2xq9vxDTuk4iPrECBAEW2aoFXY0Q==}
engines: {node: ^18.0.0 || >=20.0.0}
@@ -15729,11 +14776,6 @@ packages:
resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==}
engines: {node: '>=0.10.0'}
- workerd@1.20240718.0:
- resolution: {integrity: sha512-w7lOLRy0XecQTg/ujTLWBiJJuoQvzB3CdQ6/8Wgex3QxFhV9Pbnh3UbwIuUfMw3OCCPQc4o7y+1P+mISAgp6yg==}
- engines: {node: '>=16'}
- hasBin: true
-
wrap-ansi@6.2.0:
resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==}
engines: {node: '>=8'}
@@ -15807,31 +14849,6 @@ packages:
resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==}
engines: {node: '>=0.4'}
- y-indexeddb@9.0.12:
- resolution: {integrity: sha512-9oCFRSPPzBK7/w5vOkJBaVCQZKHXB/v6SIT+WYhnJxlEC61juqG0hBrAf+y3gmSMLFLwICNH9nQ53uscuse6Hg==}
- engines: {node: '>=16.0.0', npm: '>=8.0.0'}
- peerDependencies:
- yjs: ^13.0.0
-
- y-partykit@0.0.25:
- resolution: {integrity: sha512-/EIL73TuYX6lYnxM4mb/kTTKllS1vNjBXk9KJXFwTXFrUqMo8hbJMqnE+glvBG2EDejEI06rk3jR50lpDB8Dqg==}
-
- y-prosemirror@1.3.7:
- resolution: {integrity: sha512-NpM99WSdD4Fx4if5xOMDpPtU3oAmTSjlzh5U4353ABbRHl1HtAFUx6HlebLZfyFxXN9jzKMDkVbcRjqOZVkYQg==}
- engines: {node: '>=16.0.0', npm: '>=8.0.0'}
- peerDependencies:
- prosemirror-model: ^1.7.1
- prosemirror-state: ^1.2.3
- prosemirror-view: ^1.9.10
- y-protocols: ^1.0.1
- yjs: ^13.5.38
-
- y-protocols@1.0.6:
- resolution: {integrity: sha512-vHRF2L6iT3rwj1jub/K5tYcTT/mEYDUppgNPXwp8fmLpui9f7Yeq3OEtTLVF012j39QnV+KEQpNqoN7CWU7Y9Q==}
- engines: {node: '>=16.0.0', npm: '>=8.0.0'}
- peerDependencies:
- yjs: ^13.0.0
-
y18n@5.0.8:
resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==}
engines: {node: '>=10'}
@@ -15863,10 +14880,6 @@ packages:
resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==}
engines: {node: '>=12'}
- yjs@13.6.27:
- resolution: {integrity: sha512-OIDwaflOaq4wC6YlPBy2L6ceKeKuF7DeTxx+jPzv1FHn9tCZ0ZwSRnUBxD05E3yed46fv/FWJbvR+Ud7x0L7zw==}
- engines: {node: '>=16.0.0', npm: '>=8.0.0'}
-
yocto-queue@0.1.0:
resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==}
engines: {node: '>=10'}
@@ -15885,9 +14898,6 @@ packages:
yoga-wasm-web@0.3.3:
resolution: {integrity: sha512-N+d4UJSJbt/R3wqY7Coqs5pcV0aUj2j9IaQ3rNj9bVCLld8tTGKRa2USARjnvZJWVx1NDmQev8EknoczaOQDOA==}
- youch@3.3.4:
- resolution: {integrity: sha512-UeVBXie8cA35DS6+nBkls68xaBBXCye0CNznrhszZjTbRVnJKQuNsyLKBTTL4ln1o1rh2PKtv35twV7irj5SEg==}
-
zod@3.25.76:
resolution: {integrity: sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==}
@@ -16591,7 +15601,7 @@ snapshots:
dependencies:
'@babel/compat-data': 7.28.4
'@babel/helper-validator-option': 7.27.1
- browserslist: 4.26.3
+ browserslist: 4.28.1
lru-cache: 5.1.1
semver: 6.3.1
@@ -17399,27 +16409,6 @@ snapshots:
'@better-fetch/fetch@1.1.18': {}
- '@cloudflare/workerd-darwin-64@1.20240718.0':
- optional: true
-
- '@cloudflare/workerd-darwin-arm64@1.20240718.0':
- optional: true
-
- '@cloudflare/workerd-linux-64@1.20240718.0':
- optional: true
-
- '@cloudflare/workerd-linux-arm64@1.20240718.0':
- optional: true
-
- '@cloudflare/workerd-windows-64@1.20240718.0':
- optional: true
-
- '@cloudflare/workers-types@4.20240718.0': {}
-
- '@cspotcode/source-map-support@0.8.1':
- dependencies:
- '@jridgewell/trace-mapping': 0.3.9
-
'@csstools/color-helpers@5.1.0': {}
'@csstools/css-calc@2.1.4(@csstools/css-parser-algorithms@3.0.5(@csstools/css-tokenizer@3.0.4))(@csstools/css-tokenizer@3.0.4)':
@@ -17440,8 +16429,6 @@ snapshots:
'@csstools/css-tokenizer@3.0.4': {}
- '@cush/relative@1.0.0': {}
-
'@emnapi/core@1.5.0':
dependencies:
'@emnapi/wasi-threads': 1.1.0
@@ -17710,8 +16697,6 @@ snapshots:
'@eslint/js@8.57.1': {}
- '@fastify/busboy@2.1.1': {}
-
'@floating-ui/core@1.7.3':
dependencies:
'@floating-ui/utils': 0.2.10
@@ -17796,22 +16781,6 @@ snapshots:
'@hexagon/base64@1.1.28': {}
- '@hocuspocus/common@2.15.3':
- dependencies:
- lib0: 0.2.114
-
- '@hocuspocus/provider@2.15.3(y-protocols@1.0.6(yjs@13.6.27))(yjs@13.6.27)':
- dependencies:
- '@hocuspocus/common': 2.15.3
- '@lifeomic/attempt': 3.1.0
- lib0: 0.2.114
- ws: 8.18.3
- y-protocols: 1.0.6(yjs@13.6.27)
- yjs: 13.6.27
- transitivePeerDependencies:
- - bufferutil
- - utf-8-validate
-
'@hono/node-server@1.19.5(hono@4.10.3)':
dependencies:
hono: 4.10.3
@@ -18014,163 +16983,35 @@ snapshots:
'@jest/schemas': 30.0.5
'@types/istanbul-lib-coverage': 2.0.6
'@types/istanbul-reports': 3.0.4
- '@types/node': 20.19.22
- '@types/yargs': 17.0.33
- chalk: 4.1.2
-
- '@jridgewell/gen-mapping@0.3.13':
- dependencies:
- '@jridgewell/sourcemap-codec': 1.5.5
- '@jridgewell/trace-mapping': 0.3.31
-
- '@jridgewell/remapping@2.3.5':
- dependencies:
- '@jridgewell/gen-mapping': 0.3.13
- '@jridgewell/trace-mapping': 0.3.31
-
- '@jridgewell/resolve-uri@3.1.2': {}
-
- '@jridgewell/source-map@0.3.11':
- dependencies:
- '@jridgewell/gen-mapping': 0.3.13
- '@jridgewell/trace-mapping': 0.3.31
-
- '@jridgewell/sourcemap-codec@1.5.5': {}
-
- '@jridgewell/trace-mapping@0.3.31':
- dependencies:
- '@jridgewell/resolve-uri': 3.1.2
- '@jridgewell/sourcemap-codec': 1.5.5
-
- '@jridgewell/trace-mapping@0.3.9':
- dependencies:
- '@jridgewell/resolve-uri': 3.1.2
- '@jridgewell/sourcemap-codec': 1.5.5
-
- '@juggle/resize-observer@3.4.0': {}
-
- '@levischuck/tiny-cbor@0.2.11': {}
-
- '@lifeomic/attempt@3.1.0': {}
-
- '@liveblocks/client@3.7.1-tiptap3(@types/json-schema@7.0.15)':
- dependencies:
- '@liveblocks/core': 3.7.1-tiptap3(@types/json-schema@7.0.15)
- transitivePeerDependencies:
- - '@types/json-schema'
-
- '@liveblocks/core@3.7.1-tiptap3(@types/json-schema@7.0.15)':
- dependencies:
- '@types/json-schema': 7.0.15
-
- '@liveblocks/react-blocknote@3.7.1-tiptap3(33c6616930f6f7c88a9e36083f9553b0)':
- dependencies:
- '@blocknote/core': link:packages/core
- '@blocknote/react': link:packages/react
- '@liveblocks/client': 3.7.1-tiptap3(@types/json-schema@7.0.15)
- '@liveblocks/core': 3.7.1-tiptap3(@types/json-schema@7.0.15)
- '@liveblocks/react': 3.7.1-tiptap3(@types/json-schema@7.0.15)(@types/react-dom@19.2.2(@types/react@19.2.2))(@types/react@19.2.2)(react@19.2.1)
- '@liveblocks/react-tiptap': 3.7.1-tiptap3(61deabd8fbfc94ee8c4893e0e616a70c)
- '@liveblocks/react-ui': 3.7.1-tiptap3(@types/json-schema@7.0.15)(@types/react-dom@19.2.2(@types/react@19.2.2))(@types/react@19.2.2)(react-dom@19.2.1(react@19.2.1))(react@19.2.1)
- '@liveblocks/yjs': 3.7.1-tiptap3(@types/json-schema@7.0.15)(yjs@13.6.27)
- '@tiptap/core': 3.13.0(@tiptap/pm@3.13.0)
- react: 19.2.1
- react-dom: 19.2.1(react@19.2.1)
- vitest-tsconfig-paths: 3.4.1
- optionalDependencies:
- '@types/react': 19.2.2
- '@types/react-dom': 19.2.2(@types/react@19.2.2)
- transitivePeerDependencies:
- - '@tiptap/extension-collaboration'
- - '@tiptap/extension-collaboration-cursor'
- - '@tiptap/pm'
- - '@tiptap/react'
- - '@tiptap/suggestion'
- - '@types/json-schema'
- - prosemirror-model
- - prosemirror-state
- - prosemirror-view
- - supports-color
- - y-protocols
- - yjs
-
- '@liveblocks/react-tiptap@3.7.1-tiptap3(61deabd8fbfc94ee8c4893e0e616a70c)':
- dependencies:
- '@floating-ui/react-dom': 2.1.6(react-dom@19.2.1(react@19.2.1))(react@19.2.1)
- '@liveblocks/client': 3.7.1-tiptap3(@types/json-schema@7.0.15)
- '@liveblocks/core': 3.7.1-tiptap3(@types/json-schema@7.0.15)
- '@liveblocks/react': 3.7.1-tiptap3(@types/json-schema@7.0.15)(@types/react-dom@19.2.2(@types/react@19.2.2))(@types/react@19.2.2)(react@19.2.1)
- '@liveblocks/react-ui': 3.7.1-tiptap3(@types/json-schema@7.0.15)(@types/react-dom@19.2.2(@types/react@19.2.2))(@types/react@19.2.2)(react-dom@19.2.1(react@19.2.1))(react@19.2.1)
- '@liveblocks/yjs': 3.7.1-tiptap3(@types/json-schema@7.0.15)(yjs@13.6.27)
- '@radix-ui/react-select': 2.2.6(@types/react-dom@19.2.2(@types/react@19.2.2))(@types/react@19.2.2)(react-dom@19.2.1(react@19.2.1))(react@19.2.1)
- '@radix-ui/react-toggle': 1.1.10(@types/react-dom@19.2.2(@types/react@19.2.2))(@types/react@19.2.2)(react-dom@19.2.1(react@19.2.1))(react@19.2.1)
- '@tiptap/core': 3.13.0(@tiptap/pm@3.13.0)
- '@tiptap/extension-collaboration': 2.26.1(@tiptap/core@3.13.0(@tiptap/pm@3.13.0))(@tiptap/pm@3.13.0)(y-prosemirror@1.3.7(prosemirror-model@1.25.4)(prosemirror-state@1.4.4)(prosemirror-view@1.41.4)(y-protocols@1.0.6(yjs@13.6.27))(yjs@13.6.27))
- '@tiptap/extension-collaboration-cursor': 2.26.1(@tiptap/core@3.13.0(@tiptap/pm@3.13.0))(y-prosemirror@1.3.7(prosemirror-model@1.25.4)(prosemirror-state@1.4.4)(prosemirror-view@1.41.4)(y-protocols@1.0.6(yjs@13.6.27))(yjs@13.6.27))
- '@tiptap/pm': 3.13.0
- '@tiptap/react': 3.13.0(@floating-ui/dom@1.7.4)(@tiptap/core@3.13.0(@tiptap/pm@3.13.0))(@tiptap/pm@3.13.0)(@types/react-dom@19.2.2(@types/react@19.2.2))(@types/react@19.2.2)(react-dom@19.2.1(react@19.2.1))(react@19.2.1)
- '@tiptap/suggestion': 2.26.1(@tiptap/core@3.13.0(@tiptap/pm@3.13.0))(@tiptap/pm@3.13.0)
- cmdk: 1.1.1(@types/react-dom@19.2.2(@types/react@19.2.2))(@types/react@19.2.2)(react-dom@19.2.1(react@19.2.1))(react@19.2.1)
- react: 19.2.1
- react-dom: 19.2.1(react@19.2.1)
- y-prosemirror: 1.3.7(prosemirror-model@1.25.4)(prosemirror-state@1.4.4)(prosemirror-view@1.41.4)(y-protocols@1.0.6(yjs@13.6.27))(yjs@13.6.27)
- yjs: 13.6.27
- optionalDependencies:
- '@types/react': 19.2.2
- '@types/react-dom': 19.2.2(@types/react@19.2.2)
- transitivePeerDependencies:
- - '@types/json-schema'
- - prosemirror-model
- - prosemirror-state
- - prosemirror-view
- - y-protocols
+ '@types/node': 20.19.22
+ '@types/yargs': 17.0.33
+ chalk: 4.1.2
- '@liveblocks/react-ui@3.7.1-tiptap3(@types/json-schema@7.0.15)(@types/react-dom@19.2.2(@types/react@19.2.2))(@types/react@19.2.2)(react-dom@19.2.1(react@19.2.1))(react@19.2.1)':
+ '@jridgewell/gen-mapping@0.3.13':
dependencies:
- '@floating-ui/react-dom': 2.1.6(react-dom@19.2.1(react@19.2.1))(react@19.2.1)
- '@liveblocks/client': 3.7.1-tiptap3(@types/json-schema@7.0.15)
- '@liveblocks/core': 3.7.1-tiptap3(@types/json-schema@7.0.15)
- '@liveblocks/react': 3.7.1-tiptap3(@types/json-schema@7.0.15)(@types/react-dom@19.2.2(@types/react@19.2.2))(@types/react@19.2.2)(react@19.2.1)
- '@radix-ui/react-dropdown-menu': 2.1.16(@types/react-dom@19.2.2(@types/react@19.2.2))(@types/react@19.2.2)(react-dom@19.2.1(react@19.2.1))(react@19.2.1)
- '@radix-ui/react-popover': 1.1.15(@types/react-dom@19.2.2(@types/react@19.2.2))(@types/react@19.2.2)(react-dom@19.2.1(react@19.2.1))(react@19.2.1)
- '@radix-ui/react-slot': 1.2.3(@types/react@19.2.2)(react@19.2.1)
- '@radix-ui/react-toggle': 1.1.10(@types/react-dom@19.2.2(@types/react@19.2.2))(@types/react@19.2.2)(react-dom@19.2.1(react@19.2.1))(react@19.2.1)
- '@radix-ui/react-tooltip': 1.2.8(@types/react-dom@19.2.2(@types/react@19.2.2))(@types/react@19.2.2)(react-dom@19.2.1(react@19.2.1))(react@19.2.1)
- frimousse: 0.2.0(react@19.2.1)
- marked: 15.0.12
- react: 19.2.1
- react-dom: 19.2.1(react@19.2.1)
- slate: 0.110.2
- slate-history: 0.110.3(slate@0.110.2)
- slate-hyperscript: 0.100.0(slate@0.110.2)
- slate-react: 0.110.3(react-dom@19.2.1(react@19.2.1))(react@19.2.1)(slate@0.110.2)
- optionalDependencies:
- '@types/react': 19.2.2
- '@types/react-dom': 19.2.2(@types/react@19.2.2)
- transitivePeerDependencies:
- - '@types/json-schema'
+ '@jridgewell/sourcemap-codec': 1.5.5
+ '@jridgewell/trace-mapping': 0.3.31
- '@liveblocks/react@3.7.1-tiptap3(@types/json-schema@7.0.15)(@types/react-dom@19.2.2(@types/react@19.2.2))(@types/react@19.2.2)(react@19.2.1)':
+ '@jridgewell/remapping@2.3.5':
dependencies:
- '@liveblocks/client': 3.7.1-tiptap3(@types/json-schema@7.0.15)
- '@liveblocks/core': 3.7.1-tiptap3(@types/json-schema@7.0.15)
- react: 19.2.1
- optionalDependencies:
- '@types/react': 19.2.2
- '@types/react-dom': 19.2.2(@types/react@19.2.2)
- transitivePeerDependencies:
- - '@types/json-schema'
+ '@jridgewell/gen-mapping': 0.3.13
+ '@jridgewell/trace-mapping': 0.3.31
+
+ '@jridgewell/resolve-uri@3.1.2': {}
- '@liveblocks/yjs@3.7.1-tiptap3(@types/json-schema@7.0.15)(yjs@13.6.27)':
+ '@jridgewell/source-map@0.3.11':
dependencies:
- '@liveblocks/client': 3.7.1-tiptap3(@types/json-schema@7.0.15)
- '@liveblocks/core': 3.7.1-tiptap3(@types/json-schema@7.0.15)
- '@noble/hashes': 1.8.0
- js-base64: 3.7.8
- y-indexeddb: 9.0.12(yjs@13.6.27)
- yjs: 13.6.27
- transitivePeerDependencies:
- - '@types/json-schema'
+ '@jridgewell/gen-mapping': 0.3.13
+ '@jridgewell/trace-mapping': 0.3.31
+
+ '@jridgewell/sourcemap-codec@1.5.5': {}
+
+ '@jridgewell/trace-mapping@0.3.31':
+ dependencies:
+ '@jridgewell/resolve-uri': 3.1.2
+ '@jridgewell/sourcemap-codec': 1.5.5
+
+ '@levischuck/tiny-cbor@0.2.11': {}
'@mantine/core@8.3.4(@mantine/hooks@8.3.4(react@19.2.1))(@types/react@19.2.2)(react-dom@19.2.1(react@19.2.1))(react@19.2.1)':
dependencies:
@@ -18387,8 +17228,6 @@ snapshots:
'@noble/ciphers@2.0.1': {}
- '@noble/hashes@1.8.0': {}
-
'@noble/hashes@2.0.1': {}
'@nodelib/fs.scandir@2.1.5':
@@ -18443,7 +17282,7 @@ snapshots:
picomatch: 4.0.2
semver: 7.7.3
source-map-support: 0.5.19
- tinyglobby: 0.2.15
+ tinyglobby: 0.2.12
tslib: 2.8.1
transitivePeerDependencies:
- '@babel/traverse'
@@ -20792,7 +19631,7 @@ snapshots:
'@tailwindcss/node@4.1.14':
dependencies:
'@jridgewell/remapping': 2.3.5
- enhanced-resolve: 5.18.3
+ enhanced-resolve: 5.18.4
jiti: 2.6.1
lightningcss: 1.30.1
magic-string: 0.30.19
@@ -20940,17 +19779,6 @@ snapshots:
dependencies:
'@tiptap/core': 3.13.0(@tiptap/pm@3.13.0)
- '@tiptap/extension-collaboration-cursor@2.26.1(@tiptap/core@3.13.0(@tiptap/pm@3.13.0))(y-prosemirror@1.3.7(prosemirror-model@1.25.4)(prosemirror-state@1.4.4)(prosemirror-view@1.41.4)(y-protocols@1.0.6(yjs@13.6.27))(yjs@13.6.27))':
- dependencies:
- '@tiptap/core': 3.13.0(@tiptap/pm@3.13.0)
- y-prosemirror: 1.3.7(prosemirror-model@1.25.4)(prosemirror-state@1.4.4)(prosemirror-view@1.41.4)(y-protocols@1.0.6(yjs@13.6.27))(yjs@13.6.27)
-
- '@tiptap/extension-collaboration@2.26.1(@tiptap/core@3.13.0(@tiptap/pm@3.13.0))(@tiptap/pm@3.13.0)(y-prosemirror@1.3.7(prosemirror-model@1.25.4)(prosemirror-state@1.4.4)(prosemirror-view@1.41.4)(y-protocols@1.0.6(yjs@13.6.27))(yjs@13.6.27))':
- dependencies:
- '@tiptap/core': 3.13.0(@tiptap/pm@3.13.0)
- '@tiptap/pm': 3.13.0
- y-prosemirror: 1.3.7(prosemirror-model@1.25.4)(prosemirror-state@1.4.4)(prosemirror-view@1.41.4)(y-protocols@1.0.6(yjs@13.6.27))(yjs@13.6.27)
-
'@tiptap/extension-floating-menu@3.13.0(@floating-ui/dom@1.7.4)(@tiptap/core@3.13.0(@tiptap/pm@3.13.0))(@tiptap/pm@3.13.0)':
dependencies:
'@floating-ui/dom': 1.7.4
@@ -21036,11 +19864,6 @@ snapshots:
transitivePeerDependencies:
- '@floating-ui/dom'
- '@tiptap/suggestion@2.26.1(@tiptap/core@3.13.0(@tiptap/pm@3.13.0))(@tiptap/pm@3.13.0)':
- dependencies:
- '@tiptap/core': 3.13.0(@tiptap/pm@3.13.0)
- '@tiptap/pm': 3.13.0
-
'@tootallnate/once@2.0.0': {}
'@transloadit/prettier-bytes@0.3.5': {}
@@ -21085,7 +19908,7 @@ snapshots:
'@types/better-sqlite3@7.6.13':
dependencies:
- '@types/node': 22.15.2
+ '@types/node': 20.19.22
'@types/connect@3.4.38':
dependencies:
@@ -21155,7 +19978,7 @@ snapshots:
'@types/jsdom@21.1.7':
dependencies:
- '@types/node': 24.8.1
+ '@types/node': 20.19.22
'@types/tough-cookie': 4.0.5
parse5: 7.3.0
@@ -21222,7 +20045,7 @@ snapshots:
'@types/nodemailer@6.4.17':
dependencies:
- '@types/node': 22.15.2
+ '@types/node': 20.19.22
'@types/parse-json@4.0.2': {}
@@ -21232,7 +20055,7 @@ snapshots:
'@types/pg@8.11.14':
dependencies:
- '@types/node': 22.15.2
+ '@types/node': 20.19.22
pg-protocol: 1.10.3
pg-types: 4.1.0
@@ -21244,7 +20067,7 @@ snapshots:
'@types/pixelmatch@5.2.6':
dependencies:
- '@types/node': 24.8.1
+ '@types/node': 20.19.22
'@types/prop-types@15.7.15': {}
@@ -21620,7 +20443,7 @@ snapshots:
flatted: 3.3.3
pathe: 1.1.2
sirv: 3.0.2
- tinyglobby: 0.2.15
+ tinyglobby: 0.2.12
tinyrainbow: 1.2.0
vitest: 2.1.9(@types/node@24.8.1)(@vitest/ui@2.1.9)(jsdom@25.0.1(canvas@2.11.2(encoding@0.1.13)))(lightningcss@1.30.1)(msw@2.11.5(@types/node@24.8.1)(typescript@5.9.3))(terser@5.44.1)
@@ -21710,23 +20533,23 @@ snapshots:
'@xtuc/long@4.2.2': {}
- '@y-sweet/client@0.6.4(yjs@13.6.27)':
+ '@y/prosemirror@2.0.0-2(patch_hash=f9d1f345073554bd5394487b602c1813d6723c77083017611a94bc9580cac896)(@y/protocols@1.0.6-3(@y/y@14.0.0-19))(@y/y@14.0.0-19)(prosemirror-model@1.25.4)(prosemirror-state@1.4.4)(prosemirror-view@1.41.4)':
dependencies:
- '@y-sweet/sdk': 0.6.4
- y-protocols: 1.0.6(yjs@13.6.27)
- yjs: 13.6.27
+ '@y/protocols': 1.0.6-3(@y/y@14.0.0-19)
+ '@y/y': 14.0.0-19
+ lib0: 0.2.116
+ prosemirror-model: 1.25.4
+ prosemirror-state: 1.4.4
+ prosemirror-view: 1.41.4
- '@y-sweet/react@0.6.4(react@19.2.1)(yjs@13.6.27)':
+ '@y/protocols@1.0.6-3(@y/y@14.0.0-19)':
dependencies:
- '@y-sweet/client': 0.6.4(yjs@13.6.27)
- '@y-sweet/sdk': 0.6.4
- react: 19.2.1
- y-protocols: 1.0.6(yjs@13.6.27)
- yjs: 13.6.27
+ '@y/y': 14.0.0-19
+ lib0: 0.2.116
- '@y-sweet/sdk@0.6.4':
+ '@y/y@14.0.0-19':
dependencies:
- '@types/node': 20.19.22
+ lib0: 0.2.116
'@yarnpkg/lockfile@1.1.0': {}
@@ -21850,8 +20673,6 @@ snapshots:
ansis@3.17.0: {}
- any-promise@1.3.0: {}
-
anymatch@3.1.3:
dependencies:
normalize-path: 3.0.0
@@ -21955,10 +20776,6 @@ snapshots:
get-intrinsic: 1.3.0
is-array-buffer: 3.0.5
- as-table@1.0.55:
- dependencies:
- printable-characters: 1.0.42
-
asn1js@3.0.6:
dependencies:
pvtsutils: 1.3.6
@@ -21979,8 +20796,8 @@ snapshots:
autoprefixer@10.4.21(postcss@8.5.6):
dependencies:
- browserslist: 4.26.3
- caniuse-lite: 1.0.30001751
+ browserslist: 4.28.1
+ caniuse-lite: 1.0.30001760
fraction.js: 4.3.7
normalize-range: 0.1.2
picocolors: 1.1.1
@@ -22087,8 +20904,6 @@ snapshots:
base64id@2.0.0: {}
- baseline-browser-mapping@2.8.18: {}
-
baseline-browser-mapping@2.9.7: {}
better-auth@1.3.27(next@15.5.9(@babel/core@7.28.4)(@opentelemetry/api@1.9.0)(@playwright/test@1.51.1)(babel-plugin-react-compiler@19.1.0-rc.2)(react-dom@19.2.1(react@19.2.1))(react@19.2.1))(react-dom@19.2.1(react@19.2.1))(react@19.2.1):
@@ -22148,7 +20963,7 @@ snapshots:
dependencies:
ansi-align: 3.0.1
camelcase: 7.0.1
- chalk: 5.0.1
+ chalk: 5.6.2
cli-boxes: 3.0.0
string-width: 5.1.2
type-fest: 2.19.0
@@ -22176,14 +20991,6 @@ snapshots:
dependencies:
pako: 1.0.11
- browserslist@4.26.3:
- dependencies:
- baseline-browser-mapping: 2.8.18
- caniuse-lite: 1.0.30001760
- electron-to-chromium: 1.5.237
- node-releases: 2.0.25
- update-browserslist-db: 1.1.3(browserslist@4.26.3)
-
browserslist@4.28.1:
dependencies:
baseline-browser-mapping: 2.9.7
@@ -22235,8 +21042,6 @@ snapshots:
camelize@1.0.1: {}
- caniuse-lite@1.0.30001751: {}
-
caniuse-lite@1.0.30001760: {}
canvas@2.11.2(encoding@0.1.13):
@@ -22254,13 +21059,6 @@ snapshots:
node-addon-api: 7.1.1
prebuild-install: 7.1.3
- capnp-ts@0.7.0:
- dependencies:
- debug: 4.4.3
- tslib: 2.8.1
- transitivePeerDependencies:
- - supports-color
-
ccount@2.0.1: {}
chai@5.3.3:
@@ -22362,12 +21160,6 @@ snapshots:
execa: 5.1.1
is-wsl: 2.2.0
- clipboardy@4.0.0:
- dependencies:
- execa: 8.0.1
- is-wsl: 3.1.0
- is64bit: 2.0.0
-
cliui@8.0.1:
dependencies:
string-width: 4.2.3
@@ -22425,8 +21217,6 @@ snapshots:
commander@2.20.3: {}
- commander@4.1.1: {}
-
commondir@1.0.1: {}
compressible@2.0.18:
@@ -22459,8 +21249,6 @@ snapshots:
tree-kill: 1.2.2
yargs: 17.7.2
- confbox@0.1.8: {}
-
confbox@0.2.2: {}
confusing-browser-globals@1.0.11: {}
@@ -22482,7 +21270,7 @@ snapshots:
core-js-compat@3.46.0:
dependencies:
- browserslist: 4.26.3
+ browserslist: 4.28.1
core-util-is@1.0.3: {}
@@ -22542,8 +21330,6 @@ snapshots:
damerau-levenshtein@1.0.8: {}
- data-uri-to-buffer@2.0.2: {}
-
data-urls@4.0.0:
dependencies:
abab: 2.0.6
@@ -22675,8 +21461,6 @@ snapshots:
dependencies:
path-type: 4.0.0
- direction@1.0.4: {}
-
doctrine@2.1.0:
dependencies:
esutils: 2.0.3
@@ -22725,7 +21509,7 @@ snapshots:
dotenv-expand@11.0.7:
dependencies:
- dotenv: 16.4.7
+ dotenv: 16.6.1
dotenv@16.4.7: {}
@@ -22743,8 +21527,6 @@ snapshots:
dependencies:
jake: 10.9.4
- electron-to-chromium@1.5.237: {}
-
electron-to-chromium@1.5.267: {}
emoji-mart@5.6.0: {}
@@ -22784,11 +21566,6 @@ snapshots:
- supports-color
- utf-8-validate
- enhanced-resolve@5.18.3:
- dependencies:
- graceful-fs: 4.2.11
- tapable: 2.3.0
-
enhanced-resolve@5.18.4:
dependencies:
graceful-fs: 4.2.11
@@ -23285,22 +22062,8 @@ snapshots:
signal-exit: 3.0.7
strip-final-newline: 2.0.0
- execa@8.0.1:
- dependencies:
- cross-spawn: 7.0.6
- get-stream: 8.0.1
- human-signals: 5.0.0
- is-stream: 3.0.0
- merge-stream: 2.0.0
- npm-run-path: 5.3.0
- onetime: 6.0.0
- signal-exit: 4.1.0
- strip-final-newline: 3.0.0
-
exifr@7.1.3: {}
- exit-hook@2.2.1: {}
-
expand-template@2.0.3: {}
expect-type@1.2.2: {}
@@ -23440,10 +22203,6 @@ snapshots:
react: 19.2.1
react-dom: 19.2.1(react@19.2.1)
- frimousse@0.2.0(react@19.2.1):
- dependencies:
- react: 19.2.1
-
front-matter@4.0.2:
dependencies:
js-yaml: 3.14.1
@@ -23643,17 +22402,10 @@ snapshots:
dunder-proto: 1.0.1
es-object-atoms: 1.1.1
- get-source@2.0.12:
- dependencies:
- data-uri-to-buffer: 2.0.2
- source-map: 0.6.1
-
get-stdin@5.0.1: {}
get-stream@6.0.1: {}
- get-stream@8.0.1: {}
-
get-symbol-description@1.1.0:
dependencies:
call-bound: 1.0.4
@@ -23678,19 +22430,8 @@ snapshots:
dependencies:
is-glob: 4.0.3
- glob-regex@0.3.2: {}
-
glob-to-regexp@0.4.1: {}
- glob@10.4.5:
- dependencies:
- foreground-child: 3.3.1
- jackspeak: 3.4.3
- minimatch: 9.0.5
- minipass: 7.1.2
- package-json-from-dist: 1.0.1
- path-scurry: 1.11.1
-
glob@10.5.0:
dependencies:
foreground-child: 3.3.1
@@ -23743,8 +22484,6 @@ snapshots:
merge2: 1.4.1
slash: 3.0.0
- globrex@0.1.2: {}
-
glur@1.1.2: {}
gopd@1.2.0: {}
@@ -24040,8 +22779,6 @@ snapshots:
human-signals@2.1.0: {}
- human-signals@5.0.0: {}
-
hyphen@1.10.6: {}
iconv-lite@0.6.3:
@@ -24058,8 +22795,6 @@ snapshots:
immediate@3.0.6: {}
- immer@10.1.3: {}
-
import-fresh@3.3.1:
dependencies:
parent-module: 1.0.1
@@ -24181,8 +22916,6 @@ snapshots:
is-hexadecimal@2.0.1: {}
- is-hotkey@0.2.0: {}
-
is-inside-container@1.0.0:
dependencies:
is-docker: 3.0.0
@@ -24239,8 +22972,6 @@ snapshots:
is-stream@2.0.1: {}
- is-stream@3.0.0: {}
-
is-string@1.1.1:
dependencies:
call-bound: 1.0.4
@@ -24283,10 +23014,6 @@ snapshots:
dependencies:
is-inside-container: 1.0.0
- is64bit@2.0.0:
- dependencies:
- system-architecture: 0.1.0
-
isarray@1.0.0: {}
isarray@2.0.5: {}
@@ -24397,8 +23124,6 @@ snapshots:
jose@6.1.0: {}
- js-base64@3.7.8: {}
-
js-tokens@4.0.0: {}
js-yaml@3.14.1:
@@ -24534,7 +23259,7 @@ snapshots:
prelude-ls: 1.2.1
type-check: 0.4.0
- lib0@0.2.114:
+ lib0@0.2.116:
dependencies:
isomorphic.js: 0.2.5
@@ -24687,8 +23412,6 @@ snapshots:
optionalDependencies:
react: 19.2.1
- marked@15.0.12: {}
-
marked@7.0.4: {}
math-intrinsics@1.1.0: {}
@@ -25164,8 +23887,6 @@ snapshots:
mimic-fn@2.1.0: {}
- mimic-fn@4.0.0: {}
-
mimic-function@5.0.1: {}
mimic-response@2.1.0:
@@ -25173,25 +23894,6 @@ snapshots:
mimic-response@3.1.0: {}
- miniflare@3.20240718.0:
- dependencies:
- '@cspotcode/source-map-support': 0.8.1
- acorn: 8.15.0
- acorn-walk: 8.3.4
- capnp-ts: 0.7.0
- exit-hook: 2.2.1
- glob-to-regexp: 0.4.1
- stoppable: 1.1.0
- undici: 5.29.0
- workerd: 1.20240718.0
- ws: 8.18.3
- youch: 3.3.4
- zod: 3.25.76
- transitivePeerDependencies:
- - bufferutil
- - supports-color
- - utf-8-validate
-
minimalistic-assert@1.0.1: {}
minimatch@10.0.3:
@@ -25247,13 +23949,6 @@ snapshots:
mkdirp@1.0.4:
optional: true
- mlly@1.8.0:
- dependencies:
- acorn: 8.15.0
- pathe: 2.0.3
- pkg-types: 1.3.1
- ufo: 1.6.1
-
module-details-from-path@1.0.4: {}
motion-dom@11.18.1:
@@ -25323,16 +24018,8 @@ snapshots:
transitivePeerDependencies:
- '@types/node'
- mustache@4.2.0: {}
-
mute-stream@2.0.0: {}
- mz@2.7.0:
- dependencies:
- any-promise: 1.3.0
- object-assign: 4.1.1
- thenify-all: 1.6.0
-
namespace-emitter@2.0.1: {}
nan@2.23.0:
@@ -25417,8 +24104,6 @@ snapshots:
node-machine-id@1.1.12: {}
- node-releases@2.0.25: {}
-
node-releases@2.0.27: {}
nodemailer@7.0.11: {}
@@ -25447,10 +24132,6 @@ snapshots:
dependencies:
path-key: 3.1.1
- npm-run-path@5.3.0:
- dependencies:
- path-key: 4.0.0
-
npm-to-yarn@3.0.1: {}
npmlog@5.0.1:
@@ -25572,8 +24253,6 @@ snapshots:
node-fetch-native: 1.6.7
ufo: 1.6.1
- ohash@1.1.6: {}
-
ohash@2.0.11: {}
on-headers@1.0.2: {}
@@ -25586,10 +24265,6 @@ snapshots:
dependencies:
mimic-fn: 2.1.0
- onetime@6.0.0:
- dependencies:
- mimic-fn: 4.0.0
-
onetime@7.0.0:
dependencies:
mimic-function: 5.0.1
@@ -25738,22 +24413,6 @@ snapshots:
leac: 0.6.0
peberminta: 0.9.0
- partykit@0.0.115:
- dependencies:
- '@cloudflare/workers-types': 4.20240718.0
- clipboardy: 4.0.0
- esbuild: 0.21.5
- miniflare: 3.20240718.0
- ts-dedent: 2.2.0
- unenv: 2.0.0-rc.0
- yoga-wasm-web: 0.3.3
- optionalDependencies:
- fsevents: 2.3.3
- transitivePeerDependencies:
- - bufferutil
- - supports-color
- - utf-8-validate
-
path-browserify@1.0.1: {}
path-exists@4.0.0: {}
@@ -25764,8 +24423,6 @@ snapshots:
path-key@3.1.1: {}
- path-key@4.0.0: {}
-
path-parse@1.0.7: {}
path-scurry@1.11.1:
@@ -25868,18 +24525,10 @@ snapshots:
picomatch@4.0.3: {}
- pirates@4.0.7: {}
-
pixelmatch@5.3.0:
dependencies:
pngjs: 6.0.0
- pkg-types@1.3.1:
- dependencies:
- confbox: 0.1.8
- mlly: 1.8.0
- pathe: 2.0.3
-
pkg-types@2.3.0:
dependencies:
confbox: 0.2.2
@@ -25980,8 +24629,6 @@ snapshots:
ansi-styles: 5.2.0
react-is: 18.3.1
- printable-characters@1.0.42: {}
-
prismjs@1.30.0: {}
proc-log@3.0.0: {}
@@ -26296,10 +24943,6 @@ snapshots:
react: 19.2.1
react-dom: 19.2.1(react@19.2.1)
- react@18.3.1:
- dependencies:
- loose-envify: 1.4.0
-
react@19.2.1: {}
readable-stream@2.3.8:
@@ -26353,14 +24996,6 @@ snapshots:
unified: 11.0.5
vfile: 6.0.3
- recrawl-sync@2.2.3:
- dependencies:
- '@cush/relative': 1.0.0
- glob-regex: 0.3.2
- slash: 3.0.0
- sucrase: 3.35.0
- tslib: 1.14.1
-
reflect-metadata@0.2.2: {}
reflect.getprototypeof@1.0.10:
@@ -26573,7 +25208,7 @@ snapshots:
rimraf@5.0.10:
dependencies:
- glob: 10.4.5
+ glob: 10.5.0
rollup-plugin-webpack-stats@0.2.6(rollup@4.52.4):
dependencies:
@@ -26902,35 +25537,6 @@ snapshots:
slash@3.0.0: {}
- slate-history@0.110.3(slate@0.110.2):
- dependencies:
- is-plain-object: 5.0.0
- slate: 0.110.2
-
- slate-hyperscript@0.100.0(slate@0.110.2):
- dependencies:
- is-plain-object: 5.0.0
- slate: 0.110.2
-
- slate-react@0.110.3(react-dom@19.2.1(react@19.2.1))(react@19.2.1)(slate@0.110.2):
- dependencies:
- '@juggle/resize-observer': 3.4.0
- direction: 1.0.4
- is-hotkey: 0.2.0
- is-plain-object: 5.0.0
- lodash: 4.17.21
- react: 19.2.1
- react-dom: 19.2.1(react@19.2.1)
- scroll-into-view-if-needed: 3.1.0
- slate: 0.110.2
- tiny-invariant: 1.3.1
-
- slate@0.110.2:
- dependencies:
- immer: 10.1.3
- is-plain-object: 5.0.0
- tiny-warning: 1.0.3
-
socket.io-adapter@2.5.5:
dependencies:
debug: 4.3.7
@@ -26997,11 +25603,6 @@ snapshots:
dependencies:
type-fest: 0.7.1
- stacktracey@2.1.8:
- dependencies:
- as-table: 1.0.55
- get-source: 2.0.12
-
standardwebhooks@1.0.0:
dependencies:
'@stablelib/base64': 1.0.1
@@ -27018,8 +25619,6 @@ snapshots:
es-errors: 1.3.0
internal-slot: 1.1.0
- stoppable@1.1.0: {}
-
strict-event-emitter@0.5.1: {}
string-natural-compare@3.0.1: {}
@@ -27121,8 +25720,6 @@ snapshots:
strip-final-newline@2.0.0: {}
- strip-final-newline@3.0.0: {}
-
strip-json-comments@2.0.1: {}
strip-json-comments@3.1.1: {}
@@ -27146,16 +25743,6 @@ snapshots:
stylis@4.2.0: {}
- sucrase@3.35.0:
- dependencies:
- '@jridgewell/gen-mapping': 0.3.13
- commander: 4.1.1
- glob: 10.5.0
- lines-and-columns: 1.2.4
- mz: 2.7.0
- pirates: 4.0.7
- ts-interface-checker: 0.1.13
-
supports-color@7.2.0:
dependencies:
has-flag: 4.0.0
@@ -27176,8 +25763,6 @@ snapshots:
symbol-tree@3.2.4: {}
- system-architecture@0.1.0: {}
-
tabbable@6.2.0: {}
tailwind-merge@2.6.0: {}
@@ -27239,22 +25824,10 @@ snapshots:
text-table@0.2.0: {}
- thenify-all@1.6.0:
- dependencies:
- thenify: 3.3.1
-
- thenify@3.3.1:
- dependencies:
- any-promise: 1.3.0
-
throttleit@2.1.0: {}
tiny-inflate@1.0.3: {}
- tiny-invariant@1.3.1: {}
-
- tiny-warning@1.0.3: {}
-
tinybench@2.9.0: {}
tinyexec@0.3.2: {}
@@ -27330,10 +25903,6 @@ snapshots:
trough@2.2.0: {}
- ts-dedent@2.2.0: {}
-
- ts-interface-checker@0.1.13: {}
-
ts-morph@26.0.0:
dependencies:
'@ts-morph/common': 0.27.0
@@ -27454,20 +26023,8 @@ snapshots:
undici-types@7.14.0: {}
- undici@5.29.0:
- dependencies:
- '@fastify/busboy': 2.1.1
-
undici@6.22.0: {}
- unenv@2.0.0-rc.0:
- dependencies:
- defu: 6.1.4
- mlly: 1.8.0
- ohash: 1.1.6
- pathe: 1.1.2
- ufo: 1.6.1
-
unicode-canonical-property-names-ecmascript@2.0.1: {}
unicode-match-property-ecmascript@2.0.0:
@@ -27547,12 +26104,6 @@ snapshots:
until-async@3.0.2: {}
- update-browserslist-db@1.1.3(browserslist@4.26.3):
- dependencies:
- browserslist: 4.26.3
- escalade: 3.2.0
- picocolors: 1.1.1
-
update-browserslist-db@1.2.2(browserslist@4.28.1):
dependencies:
browserslist: 4.28.1
@@ -27809,15 +26360,6 @@ snapshots:
tsx: 4.20.6
yaml: 2.8.1
- vitest-tsconfig-paths@3.4.1:
- dependencies:
- debug: 4.4.3
- globrex: 0.1.2
- recrawl-sync: 2.2.3
- tsconfig-paths: 3.15.0
- transitivePeerDependencies:
- - supports-color
-
vitest@2.1.9(@types/node@20.19.22)(@vitest/ui@2.1.9)(jsdom@25.0.1(canvas@2.11.2(encoding@0.1.13)))(lightningcss@1.30.1)(msw@2.11.5(@types/node@20.19.22)(typescript@5.9.3))(terser@5.44.1):
dependencies:
'@vitest/expect': 2.1.9
@@ -28090,14 +26632,6 @@ snapshots:
word-wrap@1.2.5: {}
- workerd@1.20240718.0:
- optionalDependencies:
- '@cloudflare/workerd-darwin-64': 1.20240718.0
- '@cloudflare/workerd-darwin-arm64': 1.20240718.0
- '@cloudflare/workerd-linux-64': 1.20240718.0
- '@cloudflare/workerd-linux-arm64': 1.20240718.0
- '@cloudflare/workerd-windows-64': 1.20240718.0
-
wrap-ansi@6.2.0:
dependencies:
ansi-styles: 4.3.0
@@ -28146,33 +26680,6 @@ snapshots:
xtend@4.0.2: {}
- y-indexeddb@9.0.12(yjs@13.6.27):
- dependencies:
- lib0: 0.2.114
- yjs: 13.6.27
-
- y-partykit@0.0.25:
- dependencies:
- lib0: 0.2.114
- lodash.debounce: 4.0.8
- react: 18.3.1
- y-protocols: 1.0.6(yjs@13.6.27)
- yjs: 13.6.27
-
- y-prosemirror@1.3.7(prosemirror-model@1.25.4)(prosemirror-state@1.4.4)(prosemirror-view@1.41.4)(y-protocols@1.0.6(yjs@13.6.27))(yjs@13.6.27):
- dependencies:
- lib0: 0.2.114
- prosemirror-model: 1.25.4
- prosemirror-state: 1.4.4
- prosemirror-view: 1.41.4
- y-protocols: 1.0.6(yjs@13.6.27)
- yjs: 13.6.27
-
- y-protocols@1.0.6(yjs@13.6.27):
- dependencies:
- lib0: 0.2.114
- yjs: 13.6.27
-
y18n@5.0.8: {}
yallist@3.1.1: {}
@@ -28198,10 +26705,6 @@ snapshots:
y18n: 5.0.8
yargs-parser: 21.1.1
- yjs@13.6.27:
- dependencies:
- lib0: 0.2.114
-
yocto-queue@0.1.0: {}
yoctocolors-cjs@2.1.3: {}
@@ -28212,12 +26715,6 @@ snapshots:
yoga-wasm-web@0.3.3: {}
- youch@3.3.4:
- dependencies:
- cookie: 0.7.2
- mustache: 4.2.0
- stacktracey: 2.1.8
-
zod@3.25.76: {}
zod@4.1.12: {}