@blocknote/xl-ai 0.44.1 → 0.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blocknote-xl-ai.cjs +1 -1
- package/dist/blocknote-xl-ai.cjs.map +1 -1
- package/dist/blocknote-xl-ai.js +370 -369
- package/dist/blocknote-xl-ai.js.map +1 -1
- package/dist/{client-C4uaJa77.js → client-B0lU3j7B.js} +60 -29
- package/dist/client-B0lU3j7B.js.map +1 -0
- package/dist/client-CUJscXD0.cjs +36 -0
- package/dist/client-CUJscXD0.cjs.map +1 -0
- package/dist/server.cjs +1 -1
- package/dist/server.js +1 -1
- package/dist/webpack-stats.json +1 -1
- package/package.json +9 -9
- package/src/AIExtension.ts +6 -2
- package/src/api/aiRequest/builder.ts +1 -1
- package/src/api/formats/base-tools/createUpdateBlockTool.ts +5 -3
- package/src/api/formats/base-tools/delete.ts +5 -1
- package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add paragraph and update selection_1_ed2eea810db5ab73a8478e981735f2a6.json +15 -0
- package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add paragraph and update selection_1_9d907341d7a5b18529ccaf20cacbbe6f.json +15 -0
- package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add paragraph and update selection_1_a7100ba9aeac25c6dbfc977b2325ae74.json +15 -0
- package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add paragraph and update selection_1_b6c3311e72a434273d25e4a6dc74731a.json +15 -0
- package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/fix spelling mid-word selection_1_ce6692c22eda2a757e123681118a333d.json +15 -0
- package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/translate selection_1_1ad7d1a857e525e2d0f5a8c85b645a0e.json +15 -0
- package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/fix spelling mid-word selection_1_8c47595610a6a2d15e1c5c751528e97a.json +15 -0
- package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/translate selection_1_59b3c2f2328276dc62dad98af951d63c.json +15 -0
- package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/fix spelling mid-word selection_1_a6c5e74c3098077445378d6645e2672e.json +15 -0
- package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/translate selection_1_d51b8ed2dc61e8f8e333a3221be46316.json +15 -0
- package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/fix spelling mid-word selection_1_d4b4abc5fa45932eec4efcc43bb337bd.json +15 -0
- package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/translate selection_1_e4b712a415f8af6f2b49382cac85ae77.json +15 -0
- package/src/api/formats/html-blocks/htmlBlocks.ts +1 -1
- package/src/api/formats/html-blocks/tools/rebaseTool.ts +6 -2
- package/src/api/formats/json/json.ts +1 -1
- package/src/api/formats/json/tools/jsontools.test.ts +12 -2
- package/src/api/formats/markdown-blocks/markdownBlocks.ts +1 -1
- package/src/api/formats/tests/validateTestEnvironment.test.ts +1 -0
- package/src/prosemirror/__snapshots__/agent.test.ts.snap +7 -0
- package/src/prosemirror/__snapshots__/changeset.test.ts.snap +28 -0
- package/src/prosemirror/agent.test.ts +14 -2
- package/src/prosemirror/changeset.test.ts +8 -2
- package/src/prosemirror/rebaseTool.ts +1 -1
- package/src/streamTool/filterValidOperations.ts +1 -0
- package/src/streamTool/preprocess.test.ts +32 -66
- package/src/streamTool/preprocess.ts +8 -38
- package/src/streamTool/toValidatedOperations.ts +12 -0
- package/src/streamTool/vercelAiSdk/util/chatHandlers.ts +2 -0
- package/src/testUtil/cases/combinedOperationsTestCases.ts +1 -1
- package/src/testUtil/cases/editors/simpleEditor.ts +15 -0
- package/src/testUtil/cases/index.ts +6 -1
- package/src/testUtil/cases/updateOperationTestCases.ts +30 -1
- package/src/testUtil/suggestChangesTestUtil.ts +1 -1
- package/types/src/streamTool/preprocess.d.ts +0 -13
- package/types/src/testUtil/cases/editors/simpleEditor.d.ts +268 -0
- package/dist/client-C4uaJa77.js.map +0 -1
- package/dist/client-DrruPiJu.cjs +0 -36
- package/dist/client-DrruPiJu.cjs.map +0 -1
- package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add paragraph and update selection_1_039451748eb07d71d3d7f96c97950d62.json +0 -15
- package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add paragraph and update selection_1_a7597ddda3f5117e1572545c53c19414.json +0 -15
- package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/add paragraph and update selection_1_bb81e06e77589983badfe53e3839ab83.json +0 -15
- package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add paragraph and update selection_1_8b11b2a66564f9985f33774d3862cd8c.json +0 -15
- package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/translate selection_1_885e9088214dbb6d50dcda19d0056f3c.json +0 -15
- package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/translate selection_1_1e9c30fa14f61508e6d90cbfa4d9b891.json +0 -15
- package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming + generateObject)/translate selection_1_f82bcc59263074bf367562f7380b9cef.json +0 -15
- package/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/translate selection_1_94c4e51be42ba73c81d7edc503e92b40.json +0 -15
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { BlockNoteEditor } from "@blocknote/core";
|
|
2
2
|
import { beforeEach, describe, expect, it } from "vitest";
|
|
3
3
|
import { tools } from "../api/formats/json/tools/index.js";
|
|
4
|
-
import {
|
|
5
|
-
preprocessOperationsNonStreaming,
|
|
6
|
-
preprocessOperationsStreaming,
|
|
7
|
-
} from "./preprocess.js";
|
|
4
|
+
import { preprocessOperationsStreaming } from "./preprocess.js";
|
|
8
5
|
import { StreamTool } from "./streamTool.js";
|
|
9
6
|
|
|
10
7
|
const addOperationValid = {
|
|
@@ -148,68 +145,37 @@ describe("preprocess", () => {
|
|
|
148
145
|
});
|
|
149
146
|
});
|
|
150
147
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
)
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
});
|
|
168
|
-
|
|
169
|
-
it("should throw an error on invalid operations (invalid id)", async () => {
|
|
170
|
-
async function* mockStream() {
|
|
171
|
-
yield {
|
|
172
|
-
partialOperation: addOperationInvalidId,
|
|
173
|
-
isUpdateToPreviousOperation: false,
|
|
174
|
-
isPossiblyPartial: false,
|
|
175
|
-
metadata: undefined,
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
await expect(
|
|
180
|
-
collectStreamToArray(
|
|
181
|
-
preprocessOperationsNonStreaming(mockStream(), streamTools),
|
|
182
|
-
),
|
|
183
|
-
).rejects.toThrow();
|
|
184
|
-
});
|
|
185
|
-
|
|
186
|
-
it("should throw an error on invalid operations (invalid type)", async () => {
|
|
187
|
-
async function* mockStream() {
|
|
188
|
-
yield {
|
|
189
|
-
partialOperation: invalidOperationType,
|
|
190
|
-
isUpdateToPreviousOperation: false,
|
|
191
|
-
isPossiblyPartial: false,
|
|
192
|
-
metadata: undefined,
|
|
193
|
-
};
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
await expect(
|
|
197
|
-
collectStreamToArray(
|
|
198
|
-
preprocessOperationsNonStreaming(mockStream(), streamTools),
|
|
199
|
-
),
|
|
200
|
-
).rejects.toThrow();
|
|
201
|
-
});
|
|
202
|
-
|
|
203
|
-
it("should handle empty operation streams", async () => {
|
|
204
|
-
async function* mockStream() {
|
|
205
|
-
// Empty stream
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
const results = await collectStreamToArray(
|
|
209
|
-
preprocessOperationsNonStreaming(mockStream(), streamTools),
|
|
210
|
-
);
|
|
148
|
+
it("should throw an error on invalid operations (invalid id)", async () => {
|
|
149
|
+
async function* mockStream() {
|
|
150
|
+
yield {
|
|
151
|
+
partialOperation: addOperationInvalidId,
|
|
152
|
+
isUpdateToPreviousOperation: false,
|
|
153
|
+
isPossiblyPartial: false,
|
|
154
|
+
metadata: undefined,
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
await expect(
|
|
159
|
+
collectStreamToArray(
|
|
160
|
+
preprocessOperationsStreaming(mockStream(), streamTools),
|
|
161
|
+
),
|
|
162
|
+
).rejects.toThrow();
|
|
163
|
+
});
|
|
211
164
|
|
|
212
|
-
|
|
213
|
-
|
|
165
|
+
it("should throw an error on invalid operations (invalid type)", async () => {
|
|
166
|
+
async function* mockStream() {
|
|
167
|
+
yield {
|
|
168
|
+
partialOperation: invalidOperationType,
|
|
169
|
+
isUpdateToPreviousOperation: false,
|
|
170
|
+
isPossiblyPartial: false,
|
|
171
|
+
metadata: undefined,
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
await expect(
|
|
176
|
+
collectStreamToArray(
|
|
177
|
+
preprocessOperationsStreaming(mockStream(), streamTools),
|
|
178
|
+
),
|
|
179
|
+
).rejects.toThrow();
|
|
214
180
|
});
|
|
215
181
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getErrorMessage } from "@ai-sdk/provider-utils";
|
|
1
2
|
import { ChunkExecutionError } from "./ChunkExecutionError.js";
|
|
2
3
|
import { filterValidOperations } from "./filterValidOperations.js";
|
|
3
4
|
import { StreamTool, StreamToolCall } from "./streamTool.js";
|
|
@@ -36,47 +37,16 @@ export async function* preprocessOperationsStreaming<
|
|
|
36
37
|
(chunk) => {
|
|
37
38
|
if (!chunk.isPossiblyPartial) {
|
|
38
39
|
// only throw if the operation is not possibly partial
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
throw new ChunkExecutionError(
|
|
41
|
+
`Invalid operation. ${getErrorMessage(chunk.operation.error)}`,
|
|
42
|
+
chunk,
|
|
43
|
+
{
|
|
44
|
+
cause: chunk.operation.error,
|
|
45
|
+
},
|
|
46
|
+
);
|
|
41
47
|
}
|
|
42
48
|
},
|
|
43
49
|
);
|
|
44
50
|
|
|
45
51
|
yield* validOperationsStream;
|
|
46
52
|
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Validates an stream of operations and throws an error if an invalid operation is found.
|
|
50
|
-
*
|
|
51
|
-
* TODO: remove
|
|
52
|
-
*
|
|
53
|
-
* @deprecated
|
|
54
|
-
*/
|
|
55
|
-
export async function* preprocessOperationsNonStreaming<
|
|
56
|
-
T extends StreamTool<any>[],
|
|
57
|
-
>(
|
|
58
|
-
operationsStream: AsyncIterable<{
|
|
59
|
-
partialOperation: any;
|
|
60
|
-
isUpdateToPreviousOperation: boolean;
|
|
61
|
-
isPossiblyPartial: boolean;
|
|
62
|
-
metadata: any;
|
|
63
|
-
}>,
|
|
64
|
-
streamTools: T,
|
|
65
|
-
): AsyncGenerator<PreprocessOperationResult<T>> {
|
|
66
|
-
// from partial operations to valid / invalid operations
|
|
67
|
-
const validatedOperationsStream = toValidatedOperations(
|
|
68
|
-
operationsStream,
|
|
69
|
-
streamTools,
|
|
70
|
-
);
|
|
71
|
-
|
|
72
|
-
// filter valid operations, invalid operations should throw an error
|
|
73
|
-
const validOperationsStream = filterValidOperations(
|
|
74
|
-
validatedOperationsStream,
|
|
75
|
-
(chunk) => {
|
|
76
|
-
throw new Error("invalid operation: " + chunk.operation.error);
|
|
77
|
-
},
|
|
78
|
-
);
|
|
79
|
-
|
|
80
|
-
// yield results
|
|
81
|
-
yield* validOperationsStream;
|
|
82
|
-
}
|
|
@@ -22,6 +22,18 @@ export async function* toValidatedOperations<T extends StreamTool<any>[]>(
|
|
|
22
22
|
metadata: any;
|
|
23
23
|
}> {
|
|
24
24
|
for await (const chunk of partialObjectStream) {
|
|
25
|
+
if (!chunk.partialOperation.type) {
|
|
26
|
+
yield {
|
|
27
|
+
operation: {
|
|
28
|
+
ok: false,
|
|
29
|
+
error: "The `type` property of an operation is required.",
|
|
30
|
+
},
|
|
31
|
+
isUpdateToPreviousOperation: chunk.isUpdateToPreviousOperation,
|
|
32
|
+
isPossiblyPartial: chunk.isPossiblyPartial,
|
|
33
|
+
metadata: chunk.metadata,
|
|
34
|
+
};
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
25
37
|
const func = streamTools.find(
|
|
26
38
|
(f) => f.name === chunk.partialOperation.type,
|
|
27
39
|
)!;
|
|
@@ -129,6 +129,8 @@ export async function setupToolCallStreaming(
|
|
|
129
129
|
|
|
130
130
|
if (result.status === "rejected") {
|
|
131
131
|
if (result.reason instanceof ChunkExecutionError) {
|
|
132
|
+
// all errors thrown in the pipeline should be ChunkExecutionErrors,
|
|
133
|
+
// so we can retrieve the chunk that caused the error
|
|
132
134
|
error = result.reason;
|
|
133
135
|
} else {
|
|
134
136
|
if (!chat.error) {
|
|
@@ -44,3 +44,18 @@ export function getSimpleEditorWithCursorBetweenBlocks() {
|
|
|
44
44
|
editor.setTextCursorPosition("ref2");
|
|
45
45
|
return editor;
|
|
46
46
|
}
|
|
47
|
+
|
|
48
|
+
export function getSimpleEditorSpellingError() {
|
|
49
|
+
const editor = BlockNoteEditor.create({
|
|
50
|
+
initialContent: [
|
|
51
|
+
{
|
|
52
|
+
id: "ref1",
|
|
53
|
+
content: "Hello, world! Dow are you?",
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
trailingBlock: false,
|
|
57
|
+
schema,
|
|
58
|
+
extensions: [AIExtension()],
|
|
59
|
+
});
|
|
60
|
+
return editor;
|
|
61
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BlockNoteEditor,
|
|
3
|
+
expandPMRangeToWords,
|
|
3
4
|
getNodeById,
|
|
4
5
|
PartialBlock,
|
|
5
6
|
updateBlockTr,
|
|
@@ -82,8 +83,12 @@ export function getExpectedEditor(
|
|
|
82
83
|
|
|
83
84
|
for (const toolCall of testCase.baseToolCalls) {
|
|
84
85
|
if (toolCall.type === "update") {
|
|
85
|
-
|
|
86
|
+
let selection = testCase.getTestSelection?.(editor);
|
|
86
87
|
if (selection) {
|
|
88
|
+
selection = expandPMRangeToWords(editor.prosemirrorState.doc, {
|
|
89
|
+
$from: editor.prosemirrorState.doc.resolve(selection.from),
|
|
90
|
+
$to: editor.prosemirrorState.doc.resolve(selection.to),
|
|
91
|
+
});
|
|
87
92
|
editor.transact((tr) => {
|
|
88
93
|
const pos = getNodeById(toolCall.id, tr.doc)!;
|
|
89
94
|
// this is a bit of an ugly internal API, do we want to expose this (updating a selection)
|
|
@@ -2,6 +2,7 @@ import { BlockNoteEditor, getBlockInfo, getNodeById } from "@blocknote/core";
|
|
|
2
2
|
import { AIExtension } from "../../AIExtension.js";
|
|
3
3
|
import { getEditorWithBlockFormatting } from "./editors/blockFormatting.js";
|
|
4
4
|
import { getEditorWithFormattingAndMentions } from "./editors/formattingAndMentions.js";
|
|
5
|
+
import { getSimpleEditorSpellingError } from "./editors/simpleEditor.js";
|
|
5
6
|
import { DocumentOperationTestCase } from "./index.js";
|
|
6
7
|
import { schemaWithMention as schema } from "./schemas/mention.js";
|
|
7
8
|
|
|
@@ -33,7 +34,7 @@ export const updateOperationTestCases: DocumentOperationTestCase[] = [
|
|
|
33
34
|
type: "update",
|
|
34
35
|
id: "ref2",
|
|
35
36
|
block: {
|
|
36
|
-
content: [{ type: "text", text: "Hallo", styles: {} }],
|
|
37
|
+
content: [{ type: "text", text: "Hallo,", styles: {} }],
|
|
37
38
|
},
|
|
38
39
|
},
|
|
39
40
|
],
|
|
@@ -50,6 +51,34 @@ export const updateOperationTestCases: DocumentOperationTestCase[] = [
|
|
|
50
51
|
},
|
|
51
52
|
userPrompt: "translate to German",
|
|
52
53
|
},
|
|
54
|
+
{
|
|
55
|
+
editor: getSimpleEditorSpellingError,
|
|
56
|
+
description: "fix spelling mid-word selection",
|
|
57
|
+
baseToolCalls: [
|
|
58
|
+
{
|
|
59
|
+
type: "update",
|
|
60
|
+
id: "ref1",
|
|
61
|
+
block: {
|
|
62
|
+
content: [
|
|
63
|
+
{ type: "text", text: "Hello, world! How are you?", styles: {} },
|
|
64
|
+
],
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
getTestSelection: (editor: BlockNoteEditor<any, any, any>) => {
|
|
69
|
+
const posInfo = getNodeById("ref1", editor.prosemirrorState.doc)!;
|
|
70
|
+
const block = getBlockInfo(posInfo);
|
|
71
|
+
if (!block.isBlockContainer) {
|
|
72
|
+
throw new Error("Block is not a block container");
|
|
73
|
+
}
|
|
74
|
+
// 'ello, world! Dow are yo'
|
|
75
|
+
return {
|
|
76
|
+
from: block.blockContent.beforePos + 2,
|
|
77
|
+
to: block.blockContent.afterPos - 3,
|
|
78
|
+
};
|
|
79
|
+
},
|
|
80
|
+
userPrompt: "fix spelling",
|
|
81
|
+
},
|
|
53
82
|
{
|
|
54
83
|
editor: getEditorWithFormattingAndMentions,
|
|
55
84
|
description: "update block type",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BlockNoteEditor } from "@blocknote/core";
|
|
2
|
-
import { revertSuggestions } from "@
|
|
2
|
+
import { revertSuggestions } from "@handlewithcare/prosemirror-suggest-changes";
|
|
3
3
|
import { Node } from "prosemirror-model";
|
|
4
4
|
import { expect } from "vitest";
|
|
5
5
|
|
|
@@ -14,16 +14,3 @@ export declare function preprocessOperationsStreaming<T extends StreamTool<any>[
|
|
|
14
14
|
isPossiblyPartial: boolean;
|
|
15
15
|
metadata: any;
|
|
16
16
|
}>, streamTools: T): AsyncGenerator<PreprocessOperationResult<T>>;
|
|
17
|
-
/**
|
|
18
|
-
* Validates an stream of operations and throws an error if an invalid operation is found.
|
|
19
|
-
*
|
|
20
|
-
* TODO: remove
|
|
21
|
-
*
|
|
22
|
-
* @deprecated
|
|
23
|
-
*/
|
|
24
|
-
export declare function preprocessOperationsNonStreaming<T extends StreamTool<any>[]>(operationsStream: AsyncIterable<{
|
|
25
|
-
partialOperation: any;
|
|
26
|
-
isUpdateToPreviousOperation: boolean;
|
|
27
|
-
isPossiblyPartial: boolean;
|
|
28
|
-
metadata: any;
|
|
29
|
-
}>, streamTools: T): AsyncGenerator<PreprocessOperationResult<T>>;
|
|
@@ -535,3 +535,271 @@ export declare function getSimpleEditorWithCursorBetweenBlocks(): BlockNoteEdito
|
|
|
535
535
|
readonly propSchema: "string";
|
|
536
536
|
}>;
|
|
537
537
|
}>>;
|
|
538
|
+
export declare function getSimpleEditorSpellingError(): BlockNoteEditor<import("@blocknote/core").BlockSchemaFromSpecs<{
|
|
539
|
+
readonly audio: import("@blocknote/core").BlockSpec<"audio", {
|
|
540
|
+
readonly backgroundColor: {
|
|
541
|
+
default: "default";
|
|
542
|
+
};
|
|
543
|
+
readonly name: {
|
|
544
|
+
readonly default: "";
|
|
545
|
+
};
|
|
546
|
+
readonly url: {
|
|
547
|
+
readonly default: "";
|
|
548
|
+
};
|
|
549
|
+
readonly caption: {
|
|
550
|
+
readonly default: "";
|
|
551
|
+
};
|
|
552
|
+
readonly showPreview: {
|
|
553
|
+
readonly default: true;
|
|
554
|
+
};
|
|
555
|
+
}, "none">;
|
|
556
|
+
readonly bulletListItem: import("@blocknote/core").BlockSpec<"bulletListItem", {
|
|
557
|
+
readonly backgroundColor: {
|
|
558
|
+
default: "default";
|
|
559
|
+
};
|
|
560
|
+
readonly textColor: {
|
|
561
|
+
default: "default";
|
|
562
|
+
};
|
|
563
|
+
readonly textAlignment: {
|
|
564
|
+
default: "left";
|
|
565
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
566
|
+
};
|
|
567
|
+
}, "inline">;
|
|
568
|
+
readonly checkListItem: import("@blocknote/core").BlockSpec<"checkListItem", {
|
|
569
|
+
readonly checked: {
|
|
570
|
+
readonly default: false;
|
|
571
|
+
readonly type: "boolean";
|
|
572
|
+
};
|
|
573
|
+
readonly backgroundColor: {
|
|
574
|
+
default: "default";
|
|
575
|
+
};
|
|
576
|
+
readonly textColor: {
|
|
577
|
+
default: "default";
|
|
578
|
+
};
|
|
579
|
+
readonly textAlignment: {
|
|
580
|
+
default: "left";
|
|
581
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
582
|
+
};
|
|
583
|
+
}, "inline">;
|
|
584
|
+
readonly codeBlock: import("@blocknote/core").BlockSpec<"codeBlock", {
|
|
585
|
+
readonly language: {
|
|
586
|
+
readonly default: string;
|
|
587
|
+
};
|
|
588
|
+
}, "inline">;
|
|
589
|
+
readonly divider: import("@blocknote/core").BlockSpec<"divider", {}, "none">;
|
|
590
|
+
readonly file: import("@blocknote/core").BlockSpec<"file", {
|
|
591
|
+
readonly backgroundColor: {
|
|
592
|
+
default: "default";
|
|
593
|
+
};
|
|
594
|
+
readonly name: {
|
|
595
|
+
readonly default: "";
|
|
596
|
+
};
|
|
597
|
+
readonly url: {
|
|
598
|
+
readonly default: "";
|
|
599
|
+
};
|
|
600
|
+
readonly caption: {
|
|
601
|
+
readonly default: "";
|
|
602
|
+
};
|
|
603
|
+
}, "none">;
|
|
604
|
+
readonly heading: import("@blocknote/core").BlockSpec<"heading", {
|
|
605
|
+
readonly isToggleable?: {
|
|
606
|
+
readonly default: false;
|
|
607
|
+
readonly optional: true;
|
|
608
|
+
} | undefined;
|
|
609
|
+
readonly level: {
|
|
610
|
+
readonly default: 1 | 4 | 2 | 3 | 5 | 6;
|
|
611
|
+
readonly values: readonly number[];
|
|
612
|
+
};
|
|
613
|
+
readonly backgroundColor: {
|
|
614
|
+
default: "default";
|
|
615
|
+
};
|
|
616
|
+
readonly textColor: {
|
|
617
|
+
default: "default";
|
|
618
|
+
};
|
|
619
|
+
readonly textAlignment: {
|
|
620
|
+
default: "left";
|
|
621
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
622
|
+
};
|
|
623
|
+
}, "inline">;
|
|
624
|
+
readonly image: import("@blocknote/core").BlockSpec<"image", {
|
|
625
|
+
readonly textAlignment: {
|
|
626
|
+
default: "left";
|
|
627
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
628
|
+
};
|
|
629
|
+
readonly backgroundColor: {
|
|
630
|
+
default: "default";
|
|
631
|
+
};
|
|
632
|
+
readonly name: {
|
|
633
|
+
readonly default: "";
|
|
634
|
+
};
|
|
635
|
+
readonly url: {
|
|
636
|
+
readonly default: "";
|
|
637
|
+
};
|
|
638
|
+
readonly caption: {
|
|
639
|
+
readonly default: "";
|
|
640
|
+
};
|
|
641
|
+
readonly showPreview: {
|
|
642
|
+
readonly default: true;
|
|
643
|
+
};
|
|
644
|
+
readonly previewWidth: {
|
|
645
|
+
readonly default: undefined;
|
|
646
|
+
readonly type: "number";
|
|
647
|
+
};
|
|
648
|
+
}, "none">;
|
|
649
|
+
readonly numberedListItem: import("@blocknote/core").BlockSpec<"numberedListItem", {
|
|
650
|
+
readonly start: {
|
|
651
|
+
readonly default: undefined;
|
|
652
|
+
readonly type: "number";
|
|
653
|
+
};
|
|
654
|
+
readonly backgroundColor: {
|
|
655
|
+
default: "default";
|
|
656
|
+
};
|
|
657
|
+
readonly textColor: {
|
|
658
|
+
default: "default";
|
|
659
|
+
};
|
|
660
|
+
readonly textAlignment: {
|
|
661
|
+
default: "left";
|
|
662
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
663
|
+
};
|
|
664
|
+
}, "inline">;
|
|
665
|
+
readonly paragraph: import("@blocknote/core").BlockSpec<"paragraph", {
|
|
666
|
+
backgroundColor: {
|
|
667
|
+
default: "default";
|
|
668
|
+
};
|
|
669
|
+
textColor: {
|
|
670
|
+
default: "default";
|
|
671
|
+
};
|
|
672
|
+
textAlignment: {
|
|
673
|
+
default: "left";
|
|
674
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
675
|
+
};
|
|
676
|
+
}, "inline">;
|
|
677
|
+
readonly quote: import("@blocknote/core").BlockSpec<"quote", {
|
|
678
|
+
readonly backgroundColor: {
|
|
679
|
+
default: "default";
|
|
680
|
+
};
|
|
681
|
+
readonly textColor: {
|
|
682
|
+
default: "default";
|
|
683
|
+
};
|
|
684
|
+
}, "inline">;
|
|
685
|
+
readonly table: import("@blocknote/core").LooseBlockSpec<"table", {
|
|
686
|
+
textColor: {
|
|
687
|
+
default: "default";
|
|
688
|
+
};
|
|
689
|
+
}, "table">;
|
|
690
|
+
readonly toggleListItem: import("@blocknote/core").BlockSpec<"toggleListItem", {
|
|
691
|
+
readonly backgroundColor: {
|
|
692
|
+
default: "default";
|
|
693
|
+
};
|
|
694
|
+
readonly textColor: {
|
|
695
|
+
default: "default";
|
|
696
|
+
};
|
|
697
|
+
readonly textAlignment: {
|
|
698
|
+
default: "left";
|
|
699
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
700
|
+
};
|
|
701
|
+
}, "inline">;
|
|
702
|
+
readonly video: import("@blocknote/core").BlockSpec<"video", {
|
|
703
|
+
textAlignment: {
|
|
704
|
+
default: "left";
|
|
705
|
+
values: readonly ["left", "center", "right", "justify"];
|
|
706
|
+
};
|
|
707
|
+
backgroundColor: {
|
|
708
|
+
default: "default";
|
|
709
|
+
};
|
|
710
|
+
name: {
|
|
711
|
+
default: "";
|
|
712
|
+
};
|
|
713
|
+
url: {
|
|
714
|
+
default: "";
|
|
715
|
+
};
|
|
716
|
+
caption: {
|
|
717
|
+
default: "";
|
|
718
|
+
};
|
|
719
|
+
showPreview: {
|
|
720
|
+
default: boolean;
|
|
721
|
+
};
|
|
722
|
+
previewWidth: {
|
|
723
|
+
default: undefined;
|
|
724
|
+
type: "number";
|
|
725
|
+
};
|
|
726
|
+
}, "none">;
|
|
727
|
+
}>, import("@blocknote/core").InlineContentSchemaFromSpecs<{
|
|
728
|
+
text: {
|
|
729
|
+
config: "text";
|
|
730
|
+
implementation: any;
|
|
731
|
+
};
|
|
732
|
+
link: {
|
|
733
|
+
config: "link";
|
|
734
|
+
implementation: any;
|
|
735
|
+
};
|
|
736
|
+
}> & {
|
|
737
|
+
mention: {
|
|
738
|
+
type: string;
|
|
739
|
+
propSchema: {
|
|
740
|
+
user: {
|
|
741
|
+
default: string;
|
|
742
|
+
};
|
|
743
|
+
};
|
|
744
|
+
content: "none";
|
|
745
|
+
};
|
|
746
|
+
}, import("@blocknote/core").StyleSchemaFromSpecs<{
|
|
747
|
+
bold: {
|
|
748
|
+
config: {
|
|
749
|
+
type: string;
|
|
750
|
+
propSchema: "boolean";
|
|
751
|
+
};
|
|
752
|
+
implementation: import("@blocknote/core").StyleImplementation<{
|
|
753
|
+
type: string;
|
|
754
|
+
propSchema: "boolean";
|
|
755
|
+
}>;
|
|
756
|
+
};
|
|
757
|
+
italic: {
|
|
758
|
+
config: {
|
|
759
|
+
type: string;
|
|
760
|
+
propSchema: "boolean";
|
|
761
|
+
};
|
|
762
|
+
implementation: import("@blocknote/core").StyleImplementation<{
|
|
763
|
+
type: string;
|
|
764
|
+
propSchema: "boolean";
|
|
765
|
+
}>;
|
|
766
|
+
};
|
|
767
|
+
underline: {
|
|
768
|
+
config: {
|
|
769
|
+
type: string;
|
|
770
|
+
propSchema: "boolean";
|
|
771
|
+
};
|
|
772
|
+
implementation: import("@blocknote/core").StyleImplementation<{
|
|
773
|
+
type: string;
|
|
774
|
+
propSchema: "boolean";
|
|
775
|
+
}>;
|
|
776
|
+
};
|
|
777
|
+
strike: {
|
|
778
|
+
config: {
|
|
779
|
+
type: string;
|
|
780
|
+
propSchema: "boolean";
|
|
781
|
+
};
|
|
782
|
+
implementation: import("@blocknote/core").StyleImplementation<{
|
|
783
|
+
type: string;
|
|
784
|
+
propSchema: "boolean";
|
|
785
|
+
}>;
|
|
786
|
+
};
|
|
787
|
+
code: {
|
|
788
|
+
config: {
|
|
789
|
+
type: string;
|
|
790
|
+
propSchema: "boolean";
|
|
791
|
+
};
|
|
792
|
+
implementation: import("@blocknote/core").StyleImplementation<{
|
|
793
|
+
type: string;
|
|
794
|
+
propSchema: "boolean";
|
|
795
|
+
}>;
|
|
796
|
+
};
|
|
797
|
+
textColor: import("@blocknote/core").StyleSpec<{
|
|
798
|
+
readonly type: "textColor";
|
|
799
|
+
readonly propSchema: "string";
|
|
800
|
+
}>;
|
|
801
|
+
backgroundColor: import("@blocknote/core").StyleSpec<{
|
|
802
|
+
readonly type: "backgroundColor";
|
|
803
|
+
readonly propSchema: "string";
|
|
804
|
+
}>;
|
|
805
|
+
}>>;
|