From 1ae2d78109c97c8fcb662cad97861e84310ed037 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?He=CC=81ctor=20Chong?= Date: Fri, 4 Jul 2025 18:39:48 -0400 Subject: [PATCH 1/5] feat: add `draggable` prop to enable inline content dragging --- .../custom-schemas/custom-inline-content.mdx | 7 ++ .../inline-content-draggable/.bnexample.json | 6 ++ .../inline-content-draggable/App.tsx | 80 +++++++++++++++++++ .../inline-content-draggable/README.md | 1 + .../inline-content-draggable/index.html | 14 ++++ .../inline-content-draggable/main.tsx | 11 +++ .../inline-content-draggable/package.json | 37 +++++++++ .../inline-content-draggable/tsconfig.json | 36 +++++++++ .../inline-content-draggable/vite.config.ts | 32 ++++++++ .../core/src/schema/inlineContent/types.ts | 1 + .../src/schema/ReactInlineContentSpec.tsx | 1 + playground/src/examples.gen.tsx | 21 +++++ 12 files changed, 247 insertions(+) create mode 100644 examples/06-custom-schema/inline-content-draggable/.bnexample.json create mode 100644 examples/06-custom-schema/inline-content-draggable/App.tsx create mode 100644 examples/06-custom-schema/inline-content-draggable/README.md create mode 100644 examples/06-custom-schema/inline-content-draggable/index.html create mode 100644 examples/06-custom-schema/inline-content-draggable/main.tsx create mode 100644 examples/06-custom-schema/inline-content-draggable/package.json create mode 100644 examples/06-custom-schema/inline-content-draggable/tsconfig.json create mode 100644 examples/06-custom-schema/inline-content-draggable/vite.config.ts diff --git a/docs/pages/docs/custom-schemas/custom-inline-content.mdx b/docs/pages/docs/custom-schemas/custom-inline-content.mdx index 20f55490ea..eeedcf0aee 100644 --- a/docs/pages/docs/custom-schemas/custom-inline-content.mdx +++ b/docs/pages/docs/custom-schemas/custom-inline-content.mdx @@ -47,6 +47,7 @@ type CustomInlineContentConfig = { type: string; content: "styled" | "none"; readonly propSchema: PropSchema; + draggable?: boolean; }; ``` @@ -84,6 +85,12 @@ type PropSchema< _In the mentions demo, we add a `user` prop for the user that's being mentioned._ +**`draggable`** + +Specifies whether the inline content can be dragged within the editor. If set to `true`, the inline content will be draggable. Defaults to `false` if not specified. + +If this is true, you should add `data-drag-handle` to the DOM element that should function as the drag handle. + #### Inline Content Implementation (`ReactCustomInlineContentImplementation`) The Inline Content Implementation defines how the inline content should be rendered to HTML. diff --git a/examples/06-custom-schema/inline-content-draggable/.bnexample.json b/examples/06-custom-schema/inline-content-draggable/.bnexample.json new file mode 100644 index 0000000000..1f5f98054c --- /dev/null +++ b/examples/06-custom-schema/inline-content-draggable/.bnexample.json @@ -0,0 +1,6 @@ +{ + "playground": true, + "docs": false, + "author": "hectorzhuang", + "tags": [] +} diff --git a/examples/06-custom-schema/inline-content-draggable/App.tsx b/examples/06-custom-schema/inline-content-draggable/App.tsx new file mode 100644 index 0000000000..7d597e3b6d --- /dev/null +++ b/examples/06-custom-schema/inline-content-draggable/App.tsx @@ -0,0 +1,80 @@ +import { BlockNoteSchema, defaultInlineContentSpecs } from "@blocknote/core"; +import "@blocknote/core/fonts/inter.css"; +import { + createReactInlineContentSpec, + useCreateBlockNote, +} from "@blocknote/react"; +import { BlockNoteView } from "@blocknote/mantine"; +import "@blocknote/mantine/style.css"; + +const draggableButton = createReactInlineContentSpec( + { + type: "draggableButton", + propSchema: { + title: { + default: "", + }, + }, + draggable: true, + content: "none" + }, + { + render: (props) => { + return ( + + {props.inlineContent.props.title} + + ); + }, + } +); + +const schema = BlockNoteSchema.create({ + inlineContentSpecs: { + draggableButton, + ...defaultInlineContentSpecs, + }, +}); + +export default function ReactInlineContent() { + const editor = useCreateBlockNote({ + schema, + initialContent: [ + { + type: "paragraph", + content: [ + "I enjoy working with ", + { + type: "draggableButton", + props: { + title: "Hector", + }, + }, + ], + }, + { + type: "paragraph", + content: [ + "I love ", + { + type: "draggableButton", + props: { + title: "BlockNote", + }, + }, + ], + }, + ], + }); + + return ; +} diff --git a/examples/06-custom-schema/inline-content-draggable/README.md b/examples/06-custom-schema/inline-content-draggable/README.md new file mode 100644 index 0000000000..0b2a378236 --- /dev/null +++ b/examples/06-custom-schema/inline-content-draggable/README.md @@ -0,0 +1 @@ +# Inline Content Draggable diff --git a/examples/06-custom-schema/inline-content-draggable/index.html b/examples/06-custom-schema/inline-content-draggable/index.html new file mode 100644 index 0000000000..ce79fe6702 --- /dev/null +++ b/examples/06-custom-schema/inline-content-draggable/index.html @@ -0,0 +1,14 @@ + + + + + + Draggable Inline Content + + +
+ + + diff --git a/examples/06-custom-schema/inline-content-draggable/main.tsx b/examples/06-custom-schema/inline-content-draggable/main.tsx new file mode 100644 index 0000000000..f88b490fbd --- /dev/null +++ b/examples/06-custom-schema/inline-content-draggable/main.tsx @@ -0,0 +1,11 @@ +// AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY +import React from "react"; +import { createRoot } from "react-dom/client"; +import App from "./App"; + +const root = createRoot(document.getElementById("root")!); +root.render( + + + +); diff --git a/examples/06-custom-schema/inline-content-draggable/package.json b/examples/06-custom-schema/inline-content-draggable/package.json new file mode 100644 index 0000000000..2e9823da21 --- /dev/null +++ b/examples/06-custom-schema/inline-content-draggable/package.json @@ -0,0 +1,37 @@ +{ + "name": "@blocknote/example-inline-content-draggable", + "description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY", + "private": true, + "version": "0.12.4", + "scripts": { + "start": "vite", + "dev": "vite", + "build": "tsc && vite build", + "preview": "vite preview", + "lint": "eslint . --max-warnings 0" + }, + "dependencies": { + "@blocknote/core": "latest", + "@blocknote/react": "latest", + "@blocknote/ariakit": "latest", + "@blocknote/mantine": "latest", + "@blocknote/shadcn": "latest", + "react": "^18.3.1", + "react-dom": "^18.3.1" + }, + "devDependencies": { + "@types/react": "^18.0.25", + "@types/react-dom": "^18.0.9", + "@vitejs/plugin-react": "^4.3.1", + "eslint": "^8.10.0", + "vite": "^5.3.4" + }, + "eslintConfig": { + "extends": [ + "../../../.eslintrc.js" + ] + }, + "eslintIgnore": [ + "dist" + ] +} diff --git a/examples/06-custom-schema/inline-content-draggable/tsconfig.json b/examples/06-custom-schema/inline-content-draggable/tsconfig.json new file mode 100644 index 0000000000..1bd8ab3c57 --- /dev/null +++ b/examples/06-custom-schema/inline-content-draggable/tsconfig.json @@ -0,0 +1,36 @@ +{ + "__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": "Node", + "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/06-custom-schema/inline-content-draggable/vite.config.ts b/examples/06-custom-schema/inline-content-draggable/vite.config.ts new file mode 100644 index 0000000000..852465e288 --- /dev/null +++ b/examples/06-custom-schema/inline-content-draggable/vite.config.ts @@ -0,0 +1,32 @@ +// 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/packages/core/src/schema/inlineContent/types.ts b/packages/core/src/schema/inlineContent/types.ts index 6ec87055d4..913d0d1ece 100644 --- a/packages/core/src/schema/inlineContent/types.ts +++ b/packages/core/src/schema/inlineContent/types.ts @@ -5,6 +5,7 @@ import { StyleSchema, Styles } from "../styles/types.js"; export type CustomInlineContentConfig = { type: string; content: "styled" | "none"; // | "plain" + draggable?: boolean; readonly propSchema: PropSchema; // content: "inline" | "none" | "table"; }; diff --git a/packages/react/src/schema/ReactInlineContentSpec.tsx b/packages/react/src/schema/ReactInlineContentSpec.tsx index 63d81c0142..4c3cd5fd06 100644 --- a/packages/react/src/schema/ReactInlineContentSpec.tsx +++ b/packages/react/src/schema/ReactInlineContentSpec.tsx @@ -101,6 +101,7 @@ export function createReactInlineContentSpec< group: "inline", selectable: inlineContentConfig.content === "styled", atom: inlineContentConfig.content === "none", + draggable: inlineContentConfig.draggable, content: (inlineContentConfig.content === "styled" ? "inline*" : "") as T["content"] extends "styled" ? "inline*" : "", diff --git a/playground/src/examples.gen.tsx b/playground/src/examples.gen.tsx index e136417a60..40e7bad578 100644 --- a/playground/src/examples.gen.tsx +++ b/playground/src/examples.gen.tsx @@ -1238,6 +1238,27 @@ "pathFromRoot": "examples/06-custom-schema", "slug": "custom-schema" } + }, + { + "projectSlug": "inline-content-draggable", + "fullSlug": "custom-schema/inline-content-draggable", + "pathFromRoot": "examples/06-custom-schema/inline-content-draggable", + "config": { + "playground": true, + "docs": true, + "author": "hectorchong", + "tags": [ + "Intermediate", + "Inline Content", + "Custom Schemas", + "Draggable" + ] + }, + "title": "Draggable Inline Content", + "group": { + "pathFromRoot": "examples/06-custom-schema", + "slug": "custom-schema" + } } ] }, From 3b62ee12dc621159dfa7aa1303824861a034f39d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?He=CC=81ctor=20Chong?= Date: Fri, 4 Jul 2025 23:34:13 -0400 Subject: [PATCH 2/5] fix: prevent duplicate items when dragging content within the editor --- .../src/extensions/SideMenu/SideMenuPlugin.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/core/src/extensions/SideMenu/SideMenuPlugin.ts b/packages/core/src/extensions/SideMenu/SideMenuPlugin.ts index efb6d5f3e8..45bfb656f0 100644 --- a/packages/core/src/extensions/SideMenu/SideMenuPlugin.ts +++ b/packages/core/src/extensions/SideMenu/SideMenuPlugin.ts @@ -286,6 +286,14 @@ export class SideMenuView< return; } + if ( + this.sideMenuDetection === "editor" || + (event as any).synthetic || + !event.dataTransfer?.types.includes("blocknote/html") + ) { + return; + } + this.editor._tiptapEditor.commands.blur(); // Finds the BlockNote editor element that the drop event occurred in (if @@ -335,14 +343,6 @@ export class SideMenuView< } } - if ( - this.sideMenuDetection === "editor" || - (event as any).synthetic || - !event.dataTransfer?.types.includes("blocknote/html") - ) { - return; - } - const pos = this.pmView.posAtCoords({ left: event.clientX, top: event.clientY, From 9015bd0dd6539970e86366a858a4d439d2524890 Mon Sep 17 00:00:00 2001 From: Nick the Sick Date: Thu, 17 Jul 2025 13:45:27 +0200 Subject: [PATCH 3/5] chore: update pnpm lock --- pnpm-lock.yaml | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5a7453c3ff..1b9fc22bcc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -2399,6 +2399,46 @@ importers: specifier: ^5.3.4 version: 5.4.15(@types/node@22.14.1)(lightningcss@1.30.1)(terser@5.43.1) + examples/06-custom-schema/inline-content-draggable: + 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 + react: + specifier: ^18.3.1 + version: 18.3.1 + react-dom: + specifier: ^18.3.1 + version: 18.3.1(react@18.3.1) + devDependencies: + '@types/react': + specifier: ^18.0.25 + version: 18.3.23 + '@types/react-dom': + specifier: ^18.0.9 + version: 18.3.7(@types/react@18.3.23) + '@vitejs/plugin-react': + specifier: ^4.3.1 + version: 4.4.1(vite@5.4.15(@types/node@22.14.1)(lightningcss@1.30.1)(terser@5.43.1)) + eslint: + specifier: ^8.10.0 + version: 8.57.1 + vite: + specifier: ^5.3.4 + version: 5.4.15(@types/node@22.14.1)(lightningcss@1.30.1)(terser@5.43.1) + examples/06-custom-schema/react-custom-blocks: dependencies: '@blocknote/ariakit': @@ -8884,6 +8924,11 @@ packages: '@types/prop-types@15.7.14': resolution: {integrity: sha512-gNMvNH49DJ7OJYv+KAKn0Xp45p8PLl6zo2YnvDIbTd4J6MER2BmWN49TG7n9LvkyihINxeKW8+3bfS2yDC9dzQ==} + '@types/react-dom@18.3.7': + resolution: {integrity: sha512-MEe3UeoENYVFXzoXEWsvcpg6ZvlrFNlOQ7EOsvhI3CfAXwzPfO8Qwuxd40nepsYKqyyVQnTdEfv68q91yLcKrQ==} + peerDependencies: + '@types/react': ^18.0.0 + '@types/react-dom@19.1.6': resolution: {integrity: sha512-4hOiT/dwO8Ko0gV1m/TJZYk3y0KBnY9vzDh7W+DH17b2HFSOGgdj33dhihPeuy3l0q23+4e+hoXHV6hCC4dCXw==} peerDependencies: @@ -8894,6 +8939,9 @@ packages: peerDependencies: '@types/react': '*' + '@types/react@18.3.23': + resolution: {integrity: sha512-/LDXMQh55EzZQ0uVAZmKKhfENivEvWz6E+EYzh+/MCjMhNsotd+ZHhBGIjFDTi6+fz0OhQQQLbTgdQIxxCsC0w==} + '@types/react@19.1.8': resolution: {integrity: sha512-AwAfQ2Wa5bCx9WP8nZL2uMZWod7J7/JSplxbTmBQ5ms6QpqNYm672H0Vu9ZVKVngQ+ii4R/byguVEUZQyeg44g==} @@ -13440,6 +13488,11 @@ packages: resolution: {integrity: sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==} hasBin: true + react-dom@18.3.1: + resolution: {integrity: sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==} + peerDependencies: + react: ^18.3.1 + react-dom@19.1.0: resolution: {integrity: sha512-Xs1hdnE+DyKgeHJeJznQmYMIBG3TKIHJJT95Q58nHLSrElKlGQqDTR2HQ9fx5CN/Gk6Vh/kupBTDLU11/nDk/g==} peerDependencies: @@ -13867,6 +13920,9 @@ packages: resolution: {integrity: sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==} engines: {node: '>=v12.22.7'} + scheduler@0.23.2: + resolution: {integrity: sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==} + scheduler@0.25.0-rc-603e6108-20241029: resolution: {integrity: sha512-pFwF6H1XrSdYYNLfOcGlM28/j8CGLu8IvdrxqhjWULe2bPcKiKW4CV+OWqR/9fT52mywx65l7ysNkjLKBda7eA==} @@ -20165,6 +20221,10 @@ snapshots: '@types/prop-types@15.7.14': {} + '@types/react-dom@18.3.7(@types/react@18.3.23)': + dependencies: + '@types/react': 18.3.23 + '@types/react-dom@19.1.6(@types/react@19.1.8)': dependencies: '@types/react': 19.1.8 @@ -20173,6 +20233,11 @@ snapshots: dependencies: '@types/react': 19.1.8 + '@types/react@18.3.23': + dependencies: + '@types/prop-types': 15.7.14 + csstype: 3.1.3 + '@types/react@19.1.8': dependencies: csstype: 3.1.3 @@ -25814,6 +25879,12 @@ snapshots: minimist: 1.2.8 strip-json-comments: 2.0.1 + react-dom@18.3.1(react@18.3.1): + dependencies: + loose-envify: 1.4.0 + react: 18.3.1 + scheduler: 0.23.2 + react-dom@19.1.0(react@19.1.0): dependencies: react: 19.1.0 @@ -26403,6 +26474,10 @@ snapshots: dependencies: xmlchars: 2.2.0 + scheduler@0.23.2: + dependencies: + loose-envify: 1.4.0 + scheduler@0.25.0-rc-603e6108-20241029: {} scheduler@0.26.0: {} From 04c6671fdf8ff35a533fecaf693ac6b7ecc8903f Mon Sep 17 00:00:00 2001 From: Nick the Sick Date: Thu, 17 Jul 2025 13:50:47 +0200 Subject: [PATCH 4/5] docs: move example --- .../.bnexample.json | 0 .../App.tsx | 0 .../draggable-inline-content/README.md | 1 + .../index.html | 6 +-- .../main.tsx | 2 +- .../package.json | 28 +++++--------- .../tsconfig.json | 2 +- .../vite.config.ts | 4 +- .../inline-content-draggable/README.md | 1 - playground/src/examples.gen.tsx | 37 ++++++++----------- 10 files changed, 33 insertions(+), 48 deletions(-) rename examples/06-custom-schema/{inline-content-draggable => draggable-inline-content}/.bnexample.json (100%) rename examples/06-custom-schema/{inline-content-draggable => draggable-inline-content}/App.tsx (100%) create mode 100644 examples/06-custom-schema/draggable-inline-content/README.md rename examples/06-custom-schema/{inline-content-draggable => draggable-inline-content}/index.html (100%) rename examples/06-custom-schema/{inline-content-draggable => draggable-inline-content}/main.tsx (89%) rename examples/06-custom-schema/{inline-content-draggable => draggable-inline-content}/package.json (51%) rename examples/06-custom-schema/{inline-content-draggable => draggable-inline-content}/tsconfig.json (95%) rename examples/06-custom-schema/{inline-content-draggable => draggable-inline-content}/vite.config.ts (91%) delete mode 100644 examples/06-custom-schema/inline-content-draggable/README.md diff --git a/examples/06-custom-schema/inline-content-draggable/.bnexample.json b/examples/06-custom-schema/draggable-inline-content/.bnexample.json similarity index 100% rename from examples/06-custom-schema/inline-content-draggable/.bnexample.json rename to examples/06-custom-schema/draggable-inline-content/.bnexample.json diff --git a/examples/06-custom-schema/inline-content-draggable/App.tsx b/examples/06-custom-schema/draggable-inline-content/App.tsx similarity index 100% rename from examples/06-custom-schema/inline-content-draggable/App.tsx rename to examples/06-custom-schema/draggable-inline-content/App.tsx diff --git a/examples/06-custom-schema/draggable-inline-content/README.md b/examples/06-custom-schema/draggable-inline-content/README.md new file mode 100644 index 0000000000..3a3d0e5ba6 --- /dev/null +++ b/examples/06-custom-schema/draggable-inline-content/README.md @@ -0,0 +1 @@ +# Draggable Inline Content diff --git a/examples/06-custom-schema/inline-content-draggable/index.html b/examples/06-custom-schema/draggable-inline-content/index.html similarity index 100% rename from examples/06-custom-schema/inline-content-draggable/index.html rename to examples/06-custom-schema/draggable-inline-content/index.html index ce79fe6702..76ee82ac6b 100644 --- a/examples/06-custom-schema/inline-content-draggable/index.html +++ b/examples/06-custom-schema/draggable-inline-content/index.html @@ -1,11 +1,11 @@ - Draggable Inline Content +
diff --git a/examples/06-custom-schema/inline-content-draggable/main.tsx b/examples/06-custom-schema/draggable-inline-content/main.tsx similarity index 89% rename from examples/06-custom-schema/inline-content-draggable/main.tsx rename to examples/06-custom-schema/draggable-inline-content/main.tsx index f88b490fbd..6284417d60 100644 --- a/examples/06-custom-schema/inline-content-draggable/main.tsx +++ b/examples/06-custom-schema/draggable-inline-content/main.tsx @@ -1,7 +1,7 @@ // AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY import React from "react"; import { createRoot } from "react-dom/client"; -import App from "./App"; +import App from "./App.jsx"; const root = createRoot(document.getElementById("root")!); root.render( diff --git a/examples/06-custom-schema/inline-content-draggable/package.json b/examples/06-custom-schema/draggable-inline-content/package.json similarity index 51% rename from examples/06-custom-schema/inline-content-draggable/package.json rename to examples/06-custom-schema/draggable-inline-content/package.json index 2e9823da21..b177176f26 100644 --- a/examples/06-custom-schema/inline-content-draggable/package.json +++ b/examples/06-custom-schema/draggable-inline-content/package.json @@ -1,14 +1,13 @@ { - "name": "@blocknote/example-inline-content-draggable", + "name": "@blocknote/example-custom-schema-draggable-inline-content", "description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY", "private": true, "version": "0.12.4", "scripts": { "start": "vite", "dev": "vite", - "build": "tsc && vite build", - "preview": "vite preview", - "lint": "eslint . --max-warnings 0" + "build:prod": "tsc && vite build", + "preview": "vite preview" }, "dependencies": { "@blocknote/core": "latest", @@ -16,22 +15,13 @@ "@blocknote/ariakit": "latest", "@blocknote/mantine": "latest", "@blocknote/shadcn": "latest", - "react": "^18.3.1", - "react-dom": "^18.3.1" + "react": "^19.1.0", + "react-dom": "^19.1.0" }, "devDependencies": { - "@types/react": "^18.0.25", - "@types/react-dom": "^18.0.9", + "@types/react": "^19.1.0", + "@types/react-dom": "^19.1.0", "@vitejs/plugin-react": "^4.3.1", - "eslint": "^8.10.0", "vite": "^5.3.4" - }, - "eslintConfig": { - "extends": [ - "../../../.eslintrc.js" - ] - }, - "eslintIgnore": [ - "dist" - ] -} + } +} \ No newline at end of file diff --git a/examples/06-custom-schema/inline-content-draggable/tsconfig.json b/examples/06-custom-schema/draggable-inline-content/tsconfig.json similarity index 95% rename from examples/06-custom-schema/inline-content-draggable/tsconfig.json rename to examples/06-custom-schema/draggable-inline-content/tsconfig.json index 1bd8ab3c57..dbe3e6f62d 100644 --- a/examples/06-custom-schema/inline-content-draggable/tsconfig.json +++ b/examples/06-custom-schema/draggable-inline-content/tsconfig.json @@ -15,7 +15,7 @@ "strict": true, "forceConsistentCasingInFileNames": true, "module": "ESNext", - "moduleResolution": "Node", + "moduleResolution": "bundler", "resolveJsonModule": true, "isolatedModules": true, "noEmit": true, diff --git a/examples/06-custom-schema/inline-content-draggable/vite.config.ts b/examples/06-custom-schema/draggable-inline-content/vite.config.ts similarity index 91% rename from examples/06-custom-schema/inline-content-draggable/vite.config.ts rename to examples/06-custom-schema/draggable-inline-content/vite.config.ts index 852465e288..f62ab20bc2 100644 --- a/examples/06-custom-schema/inline-content-draggable/vite.config.ts +++ b/examples/06-custom-schema/draggable-inline-content/vite.config.ts @@ -21,11 +21,11 @@ export default defineConfig((conf) => ({ // or, keep as is to load live from sources with live reload working "@blocknote/core": path.resolve( __dirname, - "../../packages/core/src/", + "../../packages/core/src/" ), "@blocknote/react": path.resolve( __dirname, - "../../packages/react/src/", + "../../packages/react/src/" ), } as any), }, diff --git a/examples/06-custom-schema/inline-content-draggable/README.md b/examples/06-custom-schema/inline-content-draggable/README.md deleted file mode 100644 index 0b2a378236..0000000000 --- a/examples/06-custom-schema/inline-content-draggable/README.md +++ /dev/null @@ -1 +0,0 @@ -# Inline Content Draggable diff --git a/playground/src/examples.gen.tsx b/playground/src/examples.gen.tsx index 0a2d933efa..ba2b521e96 100644 --- a/playground/src/examples.gen.tsx +++ b/playground/src/examples.gen.tsx @@ -1194,6 +1194,22 @@ "slug": "custom-schema" } }, + { + "projectSlug": "draggable-inline-content", + "fullSlug": "custom-schema/draggable-inline-content", + "pathFromRoot": "examples/06-custom-schema/draggable-inline-content", + "config": { + "playground": true, + "docs": false, + "author": "hectorzhuang", + "tags": [] + }, + "title": "Draggable Inline Content", + "group": { + "pathFromRoot": "examples/06-custom-schema", + "slug": "custom-schema" + } + }, { "projectSlug": "react-custom-blocks", "fullSlug": "custom-schema/react-custom-blocks", @@ -1241,27 +1257,6 @@ "pathFromRoot": "examples/06-custom-schema", "slug": "custom-schema" } - }, - { - "projectSlug": "inline-content-draggable", - "fullSlug": "custom-schema/inline-content-draggable", - "pathFromRoot": "examples/06-custom-schema/inline-content-draggable", - "config": { - "playground": true, - "docs": true, - "author": "hectorchong", - "tags": [ - "Intermediate", - "Inline Content", - "Custom Schemas", - "Draggable" - ] - }, - "title": "Draggable Inline Content", - "group": { - "pathFromRoot": "examples/06-custom-schema", - "slug": "custom-schema" - } } ] }, From 307cbfdef2df8751e60417f6912b01948e6ed04c Mon Sep 17 00:00:00 2001 From: Nick the Sick Date: Thu, 17 Jul 2025 13:56:42 +0200 Subject: [PATCH 5/5] chore: pnpm lock --- pnpm-lock.yaml | 56 ++++++++------------------------------------------ 1 file changed, 9 insertions(+), 47 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1b9fc22bcc..d912556111 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -2399,7 +2399,7 @@ importers: specifier: ^5.3.4 version: 5.4.15(@types/node@22.14.1)(lightningcss@1.30.1)(terser@5.43.1) - examples/06-custom-schema/inline-content-draggable: + examples/06-custom-schema/draggable-inline-content: dependencies: '@blocknote/ariakit': specifier: latest @@ -2417,24 +2417,21 @@ importers: specifier: latest version: link:../../../packages/shadcn react: - specifier: ^18.3.1 - version: 18.3.1 + specifier: ^19.1.0 + version: 19.1.0 react-dom: - specifier: ^18.3.1 - version: 18.3.1(react@18.3.1) + specifier: ^19.1.0 + version: 19.1.0(react@19.1.0) devDependencies: '@types/react': - specifier: ^18.0.25 - version: 18.3.23 + specifier: ^19.1.0 + version: 19.1.8 '@types/react-dom': - specifier: ^18.0.9 - version: 18.3.7(@types/react@18.3.23) + specifier: ^19.1.0 + version: 19.1.6(@types/react@19.1.8) '@vitejs/plugin-react': specifier: ^4.3.1 version: 4.4.1(vite@5.4.15(@types/node@22.14.1)(lightningcss@1.30.1)(terser@5.43.1)) - eslint: - specifier: ^8.10.0 - version: 8.57.1 vite: specifier: ^5.3.4 version: 5.4.15(@types/node@22.14.1)(lightningcss@1.30.1)(terser@5.43.1) @@ -8924,11 +8921,6 @@ packages: '@types/prop-types@15.7.14': resolution: {integrity: sha512-gNMvNH49DJ7OJYv+KAKn0Xp45p8PLl6zo2YnvDIbTd4J6MER2BmWN49TG7n9LvkyihINxeKW8+3bfS2yDC9dzQ==} - '@types/react-dom@18.3.7': - resolution: {integrity: sha512-MEe3UeoENYVFXzoXEWsvcpg6ZvlrFNlOQ7EOsvhI3CfAXwzPfO8Qwuxd40nepsYKqyyVQnTdEfv68q91yLcKrQ==} - peerDependencies: - '@types/react': ^18.0.0 - '@types/react-dom@19.1.6': resolution: {integrity: sha512-4hOiT/dwO8Ko0gV1m/TJZYk3y0KBnY9vzDh7W+DH17b2HFSOGgdj33dhihPeuy3l0q23+4e+hoXHV6hCC4dCXw==} peerDependencies: @@ -8939,9 +8931,6 @@ packages: peerDependencies: '@types/react': '*' - '@types/react@18.3.23': - resolution: {integrity: sha512-/LDXMQh55EzZQ0uVAZmKKhfENivEvWz6E+EYzh+/MCjMhNsotd+ZHhBGIjFDTi6+fz0OhQQQLbTgdQIxxCsC0w==} - '@types/react@19.1.8': resolution: {integrity: sha512-AwAfQ2Wa5bCx9WP8nZL2uMZWod7J7/JSplxbTmBQ5ms6QpqNYm672H0Vu9ZVKVngQ+ii4R/byguVEUZQyeg44g==} @@ -13488,11 +13477,6 @@ packages: resolution: {integrity: sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==} hasBin: true - react-dom@18.3.1: - resolution: {integrity: sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==} - peerDependencies: - react: ^18.3.1 - react-dom@19.1.0: resolution: {integrity: sha512-Xs1hdnE+DyKgeHJeJznQmYMIBG3TKIHJJT95Q58nHLSrElKlGQqDTR2HQ9fx5CN/Gk6Vh/kupBTDLU11/nDk/g==} peerDependencies: @@ -13920,9 +13904,6 @@ packages: resolution: {integrity: sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==} engines: {node: '>=v12.22.7'} - scheduler@0.23.2: - resolution: {integrity: sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==} - scheduler@0.25.0-rc-603e6108-20241029: resolution: {integrity: sha512-pFwF6H1XrSdYYNLfOcGlM28/j8CGLu8IvdrxqhjWULe2bPcKiKW4CV+OWqR/9fT52mywx65l7ysNkjLKBda7eA==} @@ -20221,10 +20202,6 @@ snapshots: '@types/prop-types@15.7.14': {} - '@types/react-dom@18.3.7(@types/react@18.3.23)': - dependencies: - '@types/react': 18.3.23 - '@types/react-dom@19.1.6(@types/react@19.1.8)': dependencies: '@types/react': 19.1.8 @@ -20233,11 +20210,6 @@ snapshots: dependencies: '@types/react': 19.1.8 - '@types/react@18.3.23': - dependencies: - '@types/prop-types': 15.7.14 - csstype: 3.1.3 - '@types/react@19.1.8': dependencies: csstype: 3.1.3 @@ -25879,12 +25851,6 @@ snapshots: minimist: 1.2.8 strip-json-comments: 2.0.1 - react-dom@18.3.1(react@18.3.1): - dependencies: - loose-envify: 1.4.0 - react: 18.3.1 - scheduler: 0.23.2 - react-dom@19.1.0(react@19.1.0): dependencies: react: 19.1.0 @@ -26474,10 +26440,6 @@ snapshots: dependencies: xmlchars: 2.2.0 - scheduler@0.23.2: - dependencies: - loose-envify: 1.4.0 - scheduler@0.25.0-rc-603e6108-20241029: {} scheduler@0.26.0: {}