Skip to content

feature: AI #1674

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 248 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
248 commits
Select commit Hold shift + click to select a range
3e1983b
Added AI block
matthewlipski Aug 1, 2024
0da498e
Added inline and slash menu AI
matthewlipski Aug 6, 2024
d48d91e
Small fix
matthewlipski Aug 6, 2024
82a56a9
UX improvements & refactor
matthewlipski Aug 6, 2024
5c66cfe
Extracted AI to separate package & changed AI block toolbar UX
matthewlipski Sep 9, 2024
22db2b4
Finished initial package split
matthewlipski Sep 9, 2024
e0f60a8
Moved last AI references to AI package
matthewlipski Sep 9, 2024
a2bab5d
Reverted minor unneeded changes
matthewlipski Sep 9, 2024
bcf9d31
refactor architecture
YousefED Sep 10, 2024
b814336
add extensions
YousefED Sep 10, 2024
cfc1bed
Refactored AI dictionary
matthewlipski Sep 10, 2024
ec36733
clean dictionary
YousefED Sep 10, 2024
78ac784
fix
YousefED Sep 10, 2024
2970e9d
fix
YousefED Sep 10, 2024
78924bb
Made AI button use suggestion menu components
matthewlipski Sep 11, 2024
4083cd9
Added keyboard navigation to AI button
matthewlipski Sep 11, 2024
d0d82a4
Refactored AI button
matthewlipski Sep 11, 2024
2df84f5
Changed AI from suggestion menu to propriety menu
matthewlipski Sep 11, 2024
644aa15
Minor changes
matthewlipski Sep 11, 2024
0fcb46a
Prevented focus swapping on suggestion menu items
matthewlipski Sep 11, 2024
251e82b
- AI Menu input spans full block width
matthewlipski Sep 11, 2024
736a8ff
Fixed AI Menu position for empty blocks
matthewlipski Sep 11, 2024
ffa466d
Made AI block react instead of vanilla
matthewlipski Sep 12, 2024
2c20238
fix build
YousefED Sep 16, 2024
f474949
schema
YousefED Sep 17, 2024
6ddf7b0
improve json schema methods
YousefED Sep 18, 2024
34abf80
Merge remote-tracking branch 'origin/main' into ai-block
YousefED Sep 23, 2024
b3926fe
merge
YousefED Sep 23, 2024
a9d25c9
improve json schema methods
YousefED Sep 23, 2024
2021ce7
fix build
YousefED Sep 23, 2024
10c6f5e
WIP: schemas and selections
YousefED Sep 25, 2024
a554ff1
selections wip
YousefED Sep 25, 2024
6833d9d
update selections
YousefED Sep 25, 2024
39642ce
wip selectionmarkers
YousefED Sep 25, 2024
7693b10
drop core / react structure
YousefED Sep 26, 2024
a8752e1
ai menu
YousefED Sep 26, 2024
979b917
add comment
YousefED Sep 26, 2024
f88a986
misc
YousefED Sep 26, 2024
3b7a80b
Added `size` field to React suggestion menu items
matthewlipski Sep 26, 2024
5f20d34
Merge branch 'ai-block' of github.com:TypeCellOS/BlockNote into ai-block
YousefED Sep 27, 2024
bb02ee6
basis for accept / reject menu
YousefED Sep 27, 2024
da2f06d
selection commands
YousefED Sep 27, 2024
f7bbf0e
Added `.env` file for API key and AI menu buttons for after an AI com…
matthewlipski Sep 27, 2024
6952a2e
Merge remote-tracking branch 'origin/ai-block' into ai-block
matthewlipski Sep 27, 2024
3ae2152
Added loader to AI menu
matthewlipski Sep 27, 2024
08d31a9
Updated styles
matthewlipski Sep 29, 2024
b0993e2
wip
YousefED Sep 30, 2024
5367284
gitignore
YousefED Sep 30, 2024
8d32b78
Merge remote-tracking branch 'origin/main' into ai-block
YousefED Nov 26, 2024
a271b22
move to xl-ai and add server
YousefED Nov 26, 2024
b8ac4db
fix test
YousefED Nov 27, 2024
0262670
small merge fixes
YousefED Nov 27, 2024
2934697
Merge remote-tracking branch 'origin/main' into ai-block
YousefED Dec 4, 2024
faa52f7
update lock
YousefED Dec 4, 2024
0b8c728
update ai sdk
YousefED Dec 4, 2024
908a3db
improve tests
YousefED Dec 4, 2024
4f8a337
model selector
YousefED Dec 5, 2024
075c025
add markdowndiff
YousefED Dec 10, 2024
fb0a2e1
wip
YousefED Dec 11, 2024
2829adc
split and update tests
YousefED Dec 11, 2024
f533c91
add list support
YousefED Dec 11, 2024
f7e0e81
wip
YousefED Dec 11, 2024
449d0b6
Merge remote-tracking branch 'origin/main' into ai-block
YousefED Dec 11, 2024
1b54e27
merge
YousefED Dec 11, 2024
0a376f1
Merge remote-tracking branch 'origin/main' into ai-block
YousefED Jan 21, 2025
cec0390
refactor
YousefED Jan 22, 2025
c7259bd
improve tests
YousefED Jan 22, 2025
b0ff91a
update tests
YousefED Jan 22, 2025
cfa26c4
wip
YousefED Jan 22, 2025
6fcf9ed
fixes
YousefED Jan 22, 2025
062deec
wip
YousefED Jan 22, 2025
6235cd7
fix tests
YousefED Jan 23, 2025
235c9f4
fix, before removing commented code
YousefED Jan 24, 2025
c0ce50b
fix
YousefED Jan 24, 2025
cd8b8dc
fix tests
YousefED Jan 24, 2025
36b9440
fix lint
YousefED Jan 24, 2025
9b13f4b
add comments
YousefED Jan 24, 2025
3625034
update tests
YousefED Jan 24, 2025
947a73a
fix
YousefED Jan 24, 2025
286b114
fix build
YousefED Jan 24, 2025
e6e18e0
fix lock
YousefED Jan 24, 2025
d30e060
wip
YousefED Jan 30, 2025
aaa08aa
misc
YousefED Feb 4, 2025
d1365c6
remove unused files, fix basic toolbar ux
YousefED Feb 4, 2025
d64d79f
fix build
YousefED Feb 4, 2025
c97af9a
fix lint
YousefED Feb 4, 2025
ff61213
fix build
YousefED Feb 4, 2025
947d24e
fix build
YousefED Feb 4, 2025
4691ee3
fix start command
YousefED Feb 4, 2025
11d6452
fix start
YousefED Feb 4, 2025
259c811
port
YousefED Feb 4, 2025
d15818a
fix deploy
YousefED Feb 4, 2025
02be4b4
fix build
YousefED Feb 4, 2025
19e2dae
ai client env variables
YousefED Feb 4, 2025
9b5d8d7
add + fix test
YousefED Feb 4, 2025
d446bc4
add prepare scripts
YousefED Feb 4, 2025
75e0275
test
YousefED Feb 4, 2025
e6d9435
albert
YousefED Feb 4, 2025
daac02d
fix build
YousefED Feb 4, 2025
9024e7a
Made editor non-editable until user finishes LLM generation
matthewlipski Feb 4, 2025
a11db32
Merge remote-tracking branch 'origin/ai-block' into ai-block
matthewlipski Feb 4, 2025
5d70d15
Implemented TODO LLM commands
matthewlipski Feb 4, 2025
d65ff5d
disable fix
YousefED Feb 4, 2025
78b8f98
support selections
YousefED Feb 5, 2025
a72d491
fix
YousefED Feb 5, 2025
47d7d49
fix
YousefED Feb 5, 2025
cc5f198
fix blank line processing with markdown
YousefED Feb 5, 2025
9cd4c38
improve prompt
YousefED Feb 5, 2025
4de0e4e
Merge remote-tracking branch 'origin/main' into ai-block
YousefED Feb 25, 2025
4cdf8a7
merge / undo button separation
YousefED Feb 25, 2025
11c4921
revert some changes
YousefED Feb 25, 2025
c212ba2
Merge branch 'main' of github.com:TypeCellOS/BlockNote into ai-block
YousefED Mar 5, 2025
f1ff110
lockfile
YousefED Mar 5, 2025
707a33a
remove unneeded files
YousefED Mar 5, 2025
3ee1a6e
Merge branch 'main' into ai-block
YousefED Mar 10, 2025
ffd374f
remove file
YousefED Mar 10, 2025
b6db78b
better streaming
YousefED Mar 10, 2025
d97bec6
refactor streams
YousefED Mar 11, 2025
40bd7ad
update position
YousefED Mar 11, 2025
59c5a5f
small ux fixes
YousefED Mar 11, 2025
30022ca
remove file
YousefED Mar 11, 2025
2625175
fix build
YousefED Mar 11, 2025
8d271ee
fix some tests
YousefED Mar 11, 2025
7ec3b9a
fix some tests
YousefED Mar 11, 2025
4b9be50
fix tests
YousefED Mar 11, 2025
9a3858f
fix types, add test for errors
YousefED Mar 11, 2025
dbef5e8
albert
YousefED Mar 12, 2025
d0c34a2
wip
YousefED Mar 14, 2025
05d5277
wip
YousefED Mar 17, 2025
e509857
add tests
YousefED Mar 20, 2025
f758cc5
misc
YousefED Mar 21, 2025
38bae08
dontReplaceContentAtEnd
YousefED Mar 21, 2025
06b69a8
change snap paths
YousefED Mar 21, 2025
107667f
rewrite snapshot / test system
YousefED Mar 21, 2025
a38625a
refactor
YousefED Mar 22, 2025
f671a58
test improvements
YousefED Mar 23, 2025
59096c3
markdownblocks :D
YousefED Mar 23, 2025
ec9e043
wip
YousefED Mar 24, 2025
7dc4226
upgrade ai package and add snapshot check
YousefED Mar 24, 2025
9af24f6
update json snaps
YousefED Mar 24, 2025
664e9fd
update msw snapshots
YousefED Mar 24, 2025
0253df6
fix so me tests
YousefED Mar 24, 2025
f2c3a50
update msw snaps
YousefED Mar 24, 2025
5677af6
wip
YousefED Mar 24, 2025
ab472e7
wip html
YousefED Mar 25, 2025
e0121fb
wip
YousefED Mar 26, 2025
e4b9552
remove debug test
YousefED Mar 26, 2025
3c7dfab
fix
YousefED Mar 26, 2025
8191c86
Merge branch 'main' into ai-block
YousefED Mar 26, 2025
f30f6c7
Merge remote-tracking branch 'origin/main' into ai-block
YousefED Mar 26, 2025
22f989c
merge
YousefED Mar 26, 2025
a0bc870
html blocks fixes
YousefED Mar 26, 2025
b2e45a7
fix build
YousefED Mar 27, 2025
0fb2f1f
revert tsconfig
YousefED Mar 27, 2025
0d8743a
Merge remote-tracking branch 'origin/main' into ai-block
YousefED Mar 27, 2025
35f79ae
update selections with new table logic
YousefED Mar 27, 2025
3b54350
simplify some code re. selections
YousefED Mar 27, 2025
65fa438
clean
YousefED Mar 27, 2025
84e5a5c
wip
YousefED Mar 29, 2025
8c18edb
wip
YousefED Mar 29, 2025
704e613
wip
YousefED Apr 1, 2025
b5897c7
WIP: Zustand instead of context
YousefED Apr 1, 2025
5a529cb
better type safety (zustand)
YousefED Apr 1, 2025
d4abe05
wip
YousefED Apr 2, 2025
3b72003
wip
YousefED Apr 2, 2025
ac72b00
misc
YousefED Apr 2, 2025
2661e6d
fix
YousefED Apr 2, 2025
cf3deb3
fix deps
YousefED Apr 2, 2025
24697bf
fix build and slow stream
YousefED Apr 2, 2025
b4f954d
cleanup
YousefED Apr 3, 2025
b24bc17
wip
YousefED Apr 3, 2025
05da6dc
Merge remote-tracking branch 'origin/main' into ai-block
YousefED Apr 5, 2025
7166957
merge + fullslug for examples
YousefED Apr 5, 2025
6757c06
cleanup
YousefED Apr 6, 2025
8f46bfb
wip
YousefED Apr 8, 2025
14ed829
improve tests + changeset
YousefED Apr 14, 2025
f42f019
wip agent improvements
YousefED Apr 23, 2025
c5a09a8
fix snaps
YousefED May 5, 2025
f47b411
wip: support block type / attr changes, better table handling
YousefED May 5, 2025
a8ecff7
updte tests
YousefED May 8, 2025
dd08294
update prosemirror-transform
YousefED May 8, 2025
f5d9879
Merge remote-tracking branch 'origin/main' into ai-block
YousefED May 8, 2025
bbf25e4
fix tests
YousefED May 8, 2025
f2e778a
tests async
YousefED May 8, 2025
b5e7571
clean tests
YousefED May 8, 2025
3dd2b8c
switch to mapper
YousefED May 8, 2025
cdc3f50
refactor
YousefED May 8, 2025
22b5c06
cleanup
YousefED May 9, 2025
69434df
cleanup
YousefED May 9, 2025
426b705
misc fixes + test cases
YousefED May 9, 2025
81efa57
refactor tests
YousefED May 10, 2025
50c4f5a
chore: reformat everything with new prettier version
nperez0111 May 12, 2025
563a025
improve tests
YousefED May 12, 2025
4f99302
fix styles
YousefED May 12, 2025
f90a5e1
small fixes
YousefED May 12, 2025
fa21e19
cleanup
YousefED May 13, 2025
c6262cc
bugfix (filterValidOperations)
YousefED May 13, 2025
1537176
referenceIdMap
YousefED May 13, 2025
2e42c50
fix lint and build
YousefED May 13, 2025
4efd4ac
clean up selection related code
YousefED May 13, 2025
3011a93
fix
YousefED May 13, 2025
9a540ee
migrate inline extensions to blocknoteextension
YousefED May 13, 2025
c378e46
clean / revert suggestion items types for now
YousefED May 13, 2025
91686db
move agentcursorplugin
YousefED May 13, 2025
9595d82
fixes to tables
YousefED May 13, 2025
a72cb90
cleanup
YousefED May 13, 2025
5dad541
Merge remote-tracking branch 'origin/main' into feature/ai
YousefED May 13, 2025
9c08bb9
merge
YousefED May 13, 2025
25d8360
fix ci build?
YousefED May 13, 2025
d15b352
try fix build
YousefED May 13, 2025
f632bc8
wip: update examples
YousefED May 13, 2025
8a16b59
use suggest changes fork
YousefED May 13, 2025
2757c73
fix json snapshots
YousefED May 13, 2025
01480c6
tests passing
YousefED May 13, 2025
83cfed9
chore: Refactored selection cut tests (#1684)
matthewlipski May 13, 2025
b68cd17
fix build
YousefED May 14, 2025
bfec751
Merge branch 'feature/ai' of github.com:TypeCellOS/BlockNote into fea…
YousefED May 14, 2025
9ff1578
add AI server auth
YousefED May 14, 2025
3331ca9
fix tests
YousefED May 14, 2025
276b9c9
remove test
YousefED May 14, 2025
90e879f
fix tests
YousefED May 14, 2025
f493954
fix build
YousefED May 14, 2025
61fc473
fix build
YousefED May 14, 2025
121e76b
try fix build
YousefED May 14, 2025
9cfc795
fix build?
YousefED May 14, 2025
33d9a5d
update lockfile
YousefED May 14, 2025
90c8582
add repo config
YousefED May 14, 2025
47f3e4b
rename
YousefED May 14, 2025
fe4fc7f
small fixes
YousefED May 14, 2025
615097f
revert markdownexporter
YousefED May 14, 2025
f52b5c0
fix providers and update deps
YousefED May 15, 2025
5da58d1
clean example
YousefED May 15, 2025
e559168
fix
YousefED May 15, 2025
5bfc40e
Feature/ai promptbuilder (#1686)
YousefED May 15, 2025
39a3fd5
fix types
YousefED May 15, 2025
8042603
fragmentUtil
YousefED May 15, 2025
a60df0b
refactor InvalidOrOk to Result
YousefED May 15, 2025
49bbf93
fix stream error
YousefED May 15, 2025
2c39452
docs wip
YousefED May 16, 2025
9fbebd3
Merge branch 'prettier' into feature/ai
nperez0111 May 16, 2025
5e325df
Merge branch 'main' into feature/ai
nperez0111 May 16, 2025
dffae07
fix: ShadCN/Ariakit AI menu & translations (#1688)
matthewlipski May 16, 2025
f695cf2
fix: de-dupe
nperez0111 May 16, 2025
1407e0b
Fixed suggestion menu crash
matthewlipski May 16, 2025
7e4844a
Merge branch 'feature/ai' of github.com:TypeCellOS/BlockNote into fea…
matthewlipski May 16, 2025
80f4267
Fixed build
matthewlipski May 16, 2025
8419c04
docs: Custom AI menu items docs (#1690)
matthewlipski May 16, 2025
d940535
simplify api and types + update examples
YousefED May 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,6 @@ release
/test-results/
/playwright-report/
/playwright/.cache/
.nx/
.env
*.pem
.nx/
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,10 @@
"typescript.tsdk": "node_modules/typescript/lib",
"[xml]": {
"editor.defaultFormatter": "redhat.vscode-xml"
},
"scm.defaultViewMode": "tree",
"search.defaultViewMode": "tree",
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "docs",
"version": "0.26.0",
"version": "0.30.0",
"private": true,
"scripts": {
"dev": "next dev",
Expand Down
1 change: 1 addition & 0 deletions docs/pages/docs/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"custom-schemas": "Custom Schemas",
"collaboration": "Collaboration",
"advanced": "Advanced",
"ai": "AI",
"discord-link": {
"title": "Community ↗",
"href": "https://discord.gg/Qc2QTTH5dF",
Expand Down
43 changes: 43 additions & 0 deletions docs/pages/docs/ai.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
title: AI Rich Text Editing
description: Add AI functionality to your BlockNote rich text editor
imageTitle: BlockNote AI
path: /docs/ai
---

import { Example } from "@/components/example";
import { Callout } from "nextra/components";

# BlockNote AI integration

With BlockNote AI, you can add AI functionality to your rich text editor.
Users can work with an AI agent to edit, write and format their documents.

[VIDEO]

- Try the [basic AI demo](/examples/ai/minimal)
- ..or try different models in the [AI playground](/examples/ai/playground)
- [Setup documentation](/docs/ai/getting-started)
- TODO

## Features

BlockNote AI has been designed to be fully customizable.
BlockNote shows exactly what the AI agent is doing - making it easy for users to
work hand in hand with AI agents.

- Customize commands to write new content or update existing content or formatting
- Streaming support for quick feedback
- Users can accept or reject AI suggestions
- Connect any LLM model (from Llama to OpenAI, Mistral or Anthropic)
- Customizable prompts
- Built directly on the [Vercel AI SDK](https://sdk.vercel.ai)
- No dependency on our backend - use your own infrastructure or connect directly to a hosted LLM API
- Feature requests? [Get in touch](/about).

<Callout type={"info"}>
This feature is provided by the `@blocknote/xl-ai`. `xl-` packages are fully
open source, but released under a copyleft license. A commercial license for
usage in closed source, proprietary products comes as part of the [Business
subscription](/pricing).
</Callout>
5 changes: 5 additions & 0 deletions docs/pages/docs/ai/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"setup": "Editor Setup",
"custom-commands": "Customizing Commands",
"reference": "Reference"
}
Empty file.
Empty file.
106 changes: 106 additions & 0 deletions docs/pages/docs/ai/setup.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
---
title: AI Rich Text Editing
description: Add AI functionality to your BlockNote rich text editor
imageTitle: BlockNote AI
path: /docs/ai
---

import { Example } from "@/components/example";
import { Callout } from "nextra/components";

# Getting Started with BlockNote AI
First, install the `@blocknote/xl-ai` package:

```bash
npm install @blocknote/xl-ai
```

## Creating a Model

BlockNote AI uses the the [AI SDK](https://ai-sdk.dev/docs/foundations/overview) to standardize integrating artificial intelligence (AI) models across [supported providers](https://ai-sdk.dev/docs/foundations/providers-and-models).

As a first step, you'll need to register a new model with the AI SDK. For example, for Llama hosted on Groq:

```bash
npm install @ai-sdk/groq
```

```ts
import { createGroq } from "@ai-sdk/groq";

const provider = createGroq({
apiKey: "YOUR_GROQ_API_KEY",
});

const model = provider("llama-3.3-70b-versatile");
```

<Callout type={"warning"}>
Note that this setup directly calls the provider from the client, and exposes
your API keys on the client. For Production scenarios, a more common approach is to
handle authentication on your own server and proxy requests to a provider. See
our [Demo AI
Server](https://github.com/TypeCellOS/BlockNote/tree/main/packages/xl-ai-server)
for a Node.js example or check the AI SDK best practices.
</Callout>

## Setting up the editor

Now, you can create the editor with the AI Extension enabled:

```ts
import { createBlockNoteEditor } from "@blocknote/core";
import { BlockNoteAIExtension } from "@blocknote/xl-ai";
import {
AIToolbarButton,
BlockNoteAIUI,
locales as aiLocales,
createAIExtension,
createBlockNoteAIClient,
getAISlashMenuItems,
} from "@blocknote/xl-ai";

const editor = createBlockNoteEditor({
dictionary: {
...en,
ai: aiLocales.en, // add default translations for the AI extension
},
extensions: [
createAIExtension({
model,
}),
],
// ... other editor options
});
```

### The `createAIExtension` method

TODO

## Adding AI UI elements

Now, the only thing left to do is to customize the UI elements of your editor.

```tsx
<BlockNoteView
editor={editor}
// We're disabling some default UI elements
formattingToolbar={false}
slashMenu={false}>
{/* This has AI specific components like the AI Command menu */}
<BlockNoteAIUI />

{/* Create you own Formatting Toolbar with an AI button,
(see the full example code below) */}
<FormattingToolbarWithAI />

{/* Create you own SlashMenu with an AI option,
(see the full example code below) */}
<SuggestionMenuWithAI editor={editor} />
</BlockNoteView>
```

# Full Example

<Example name="ai/minimal" />
3 changes: 2 additions & 1 deletion docs/pages/examples/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
"interoperability": "Interoperability",
"custom-schema": "Custom Schemas",
"collaboration": "Collaboration",
"extensions": "Extensions"
"extensions": "Extensions",
"ai": "AI"
}
2 changes: 1 addition & 1 deletion examples/01-basic/01-minimal/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@blocknote/example-minimal",
"name": "@blocknote/example-basic-minimal",
"description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
"private": true,
"version": "0.12.4",
Expand Down
2 changes: 1 addition & 1 deletion examples/01-basic/02-block-objects/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@blocknote/example-block-objects",
"name": "@blocknote/example-basic-block-objects",
"description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
"private": true,
"version": "0.12.4",
Expand Down
2 changes: 1 addition & 1 deletion examples/01-basic/03-multi-column/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@blocknote/example-multi-column",
"name": "@blocknote/example-basic-multi-column",
"description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
"private": true,
"version": "0.12.4",
Expand Down
2 changes: 1 addition & 1 deletion examples/01-basic/04-default-blocks/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@blocknote/example-default-blocks",
"name": "@blocknote/example-basic-default-blocks",
"description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
"private": true,
"version": "0.12.4",
Expand Down
2 changes: 1 addition & 1 deletion examples/01-basic/05-removing-default-blocks/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@blocknote/example-removing-default-blocks",
"name": "@blocknote/example-basic-removing-default-blocks",
"description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
"private": true,
"version": "0.12.4",
Expand Down
2 changes: 1 addition & 1 deletion examples/01-basic/06-block-manipulation/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@blocknote/example-block-manipulation",
"name": "@blocknote/example-basic-block-manipulation",
"description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
"private": true,
"version": "0.12.4",
Expand Down
2 changes: 1 addition & 1 deletion examples/01-basic/07-selection-blocks/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@blocknote/example-selection-blocks",
"name": "@blocknote/example-basic-selection-blocks",
"description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
"private": true,
"version": "0.12.4",
Expand Down
2 changes: 1 addition & 1 deletion examples/01-basic/08-ariakit/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@blocknote/example-ariakit",
"name": "@blocknote/example-basic-ariakit",
"description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
"private": true,
"version": "0.12.4",
Expand Down
2 changes: 1 addition & 1 deletion examples/01-basic/09-shadcn/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@blocknote/example-shadcn",
"name": "@blocknote/example-basic-shadcn",
"description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
"private": true,
"version": "0.12.4",
Expand Down
2 changes: 1 addition & 1 deletion examples/01-basic/10-localization/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@blocknote/example-localization",
"name": "@blocknote/example-basic-localization",
"description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
"private": true,
"version": "0.12.4",
Expand Down
2 changes: 1 addition & 1 deletion examples/01-basic/11-custom-placeholder/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@blocknote/example-custom-placeholder",
"name": "@blocknote/example-basic-custom-placeholder",
"description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
"private": true,
"version": "0.12.4",
Expand Down
2 changes: 1 addition & 1 deletion examples/01-basic/12-multi-editor/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@blocknote/example-multi-editor",
"name": "@blocknote/example-basic-multi-editor",
"description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
"private": true,
"version": "0.12.4",
Expand Down
2 changes: 1 addition & 1 deletion examples/01-basic/13-custom-paste-handler/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@blocknote/example-custom-paste-handler",
"name": "@blocknote/example-basic-custom-paste-handler",
"description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
"private": true,
"version": "0.12.4",
Expand Down
2 changes: 1 addition & 1 deletion examples/01-basic/testing/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@blocknote/example-testing",
"name": "@blocknote/example-basic-testing",
"description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
"private": true,
"version": "0.12.4",
Expand Down
2 changes: 1 addition & 1 deletion examples/02-backend/01-file-uploading/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@blocknote/example-file-uploading",
"name": "@blocknote/example-backend-file-uploading",
"description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
"private": true,
"version": "0.12.4",
Expand Down
2 changes: 1 addition & 1 deletion examples/02-backend/02-saving-loading/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@blocknote/example-saving-loading",
"name": "@blocknote/example-backend-saving-loading",
"description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
"private": true,
"version": "0.12.4",
Expand Down
2 changes: 1 addition & 1 deletion examples/02-backend/03-s3/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@blocknote/example-s3",
"name": "@blocknote/example-backend-s3",
"description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
"private": true,
"version": "0.12.4",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@blocknote/example-rendering-static-documents",
"name": "@blocknote/example-backend-rendering-static-documents",
"description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
"private": true,
"version": "0.12.4",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@blocknote/example-ui-elements-remove",
"name": "@blocknote/example-ui-components-ui-elements-remove",
"description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
"private": true,
"version": "0.12.4",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import "@blocknote/mantine/style.css";
import {
useBlockNoteEditor,
useComponentsContext,
useEditorContentOrSelectionChange,
} from "@blocknote/react";
import "@blocknote/mantine/style.css";
import { useState } from "react";

// Custom Formatting Toolbar Button to toggle blue text & background color.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@blocknote/example-formatting-toolbar-buttons",
"name": "@blocknote/example-ui-components-formatting-toolbar-buttons",
"description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
"private": true,
"version": "0.12.4",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@blocknote/example-formatting-toolbar-block-type-items",
"name": "@blocknote/example-ui-components-formatting-toolbar-block-type-items",
"description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
"private": true,
"version": "0.12.4",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@blocknote/example-side-menu-buttons",
"name": "@blocknote/example-ui-components-side-menu-buttons",
"description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
"private": true,
"version": "0.12.4",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@blocknote/example-side-menu-drag-handle-items",
"name": "@blocknote/example-ui-components-side-menu-drag-handle-items",
"description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
"private": true,
"version": "0.12.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@ import {
BlockNoteEditor,
filterSuggestionItems,
insertOrUpdateBlock,
PartialBlock,
} from "@blocknote/core";
import "@blocknote/core/fonts/inter.css";
import { BlockNoteView } from "@blocknote/mantine";
import "@blocknote/mantine/style.css";
import {
DefaultReactSuggestionItem,
getDefaultReactSlashMenuItems,
SuggestionMenuController,
useCreateBlockNote,
} from "@blocknote/react";
import { BlockNoteView } from "@blocknote/mantine";
import "@blocknote/mantine/style.css";
import { HiOutlineGlobeAlt } from "react-icons/hi";

// Custom Slash Menu item to insert a block after the current one.
Expand Down
Loading
Loading