@blocknote/xl-ai 0.50.0 → 0.51.1
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/webpack-stats.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"builtAt":
|
|
1
|
+
{"builtAt":1779123416942,"assets":[{"name":"blocknote-xl-ai.cjs","size":16875},{"name":"locales.cjs","size":23775},{"name":"server.cjs","size":760},{"name":"server-D-Xyj9BS.cjs","size":38286},{"name":"blocknote-xl-ai.cjs.map","size":63114},{"name":"locales.cjs.map","size":56423},{"name":"server-D-Xyj9BS.cjs.map","size":186169}],"chunks":[{"id":"a1ee98a","entry":true,"initial":true,"files":["blocknote-xl-ai.cjs"],"names":["blocknote-xl-ai"]},{"id":"842df4c","entry":true,"initial":true,"files":["locales.cjs"],"names":["locales"]},{"id":"791e108","entry":true,"initial":true,"files":["server.cjs"],"names":["server"]},{"id":"91fd206","entry":false,"initial":true,"files":["server-D-Xyj9BS.cjs"],"names":["server"]}],"modules":[{"name":"./src/style.css","size":0,"chunks":["a1ee98a"]},{"name":"./src/plugins/AgentCursorPlugin.ts","size":2201,"chunks":["a1ee98a"]},{"name":"./src/AIExtension.ts","size":7732,"chunks":["a1ee98a"]},{"name":"./src/hooks/useAIDictionary.ts","size":161,"chunks":["a1ee98a"]},{"name":"./src/components/AIMenu/PromptSuggestionMenu.tsx","size":3233,"chunks":["a1ee98a"]},{"name":"./src/components/AIMenu/getDefaultAIMenuItems.tsx","size":6452,"chunks":["a1ee98a"]},{"name":"./src/components/AIMenu/AIMenu.tsx","size":3485,"chunks":["a1ee98a"]},{"name":"./src/components/AIMenu/AIMenuController.tsx","size":2391,"chunks":["a1ee98a"]},{"name":"./src/components/FormattingToolbar/AIToolbarButton.tsx","size":1068,"chunks":["a1ee98a"]},{"name":"./src/components/SuggestionMenu/getAISlashMenuItems.tsx","size":670,"chunks":["a1ee98a"]},{"name":"./src/index.ts","size":0,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/ar.ts","size":1427,"chunks":["842df4c"]},{"name":"./src/i18n/locales/de.ts","size":1481,"chunks":["842df4c"]},{"name":"./src/i18n/locales/en.ts","size":1379,"chunks":["842df4c"]},{"name":"./src/i18n/locales/es.ts","size":1449,"chunks":["842df4c"]},{"name":"./src/i18n/locales/fr.ts","size":1465,"chunks":["842df4c"]},{"name":"./src/i18n/locales/he.ts","size":1297,"chunks":["842df4c"]},{"name":"./src/i18n/locales/hr.ts","size":1390,"chunks":["842df4c"]},{"name":"./src/i18n/locales/is.ts","size":1458,"chunks":["842df4c"]},{"name":"./src/i18n/locales/it.ts","size":1451,"chunks":["842df4c"]},{"name":"./src/i18n/locales/ja.ts","size":1268,"chunks":["842df4c"]},{"name":"./src/i18n/locales/ko.ts","size":1290,"chunks":["842df4c"]},{"name":"./src/i18n/locales/nl.ts","size":1432,"chunks":["842df4c"]},{"name":"./src/i18n/locales/no.ts","size":1405,"chunks":["842df4c"]},{"name":"./src/i18n/locales/pl.ts","size":1406,"chunks":["842df4c"]},{"name":"./src/i18n/locales/pt.ts","size":1444,"chunks":["842df4c"]},{"name":"./src/i18n/locales/ru.ts","size":1445,"chunks":["842df4c"]},{"name":"./src/i18n/locales/sk.ts","size":1407,"chunks":["842df4c"]},{"name":"./src/i18n/locales/uk.ts","size":1452,"chunks":["842df4c"]},{"name":"./src/i18n/locales/vi.ts","size":1402,"chunks":["842df4c"]},{"name":"./src/i18n/locales/zh-tw.ts","size":1244,"chunks":["842df4c"]},{"name":"./src/i18n/locales/zh.ts","size":1236,"chunks":["842df4c"]},{"name":"./src/i18n/locales/index.ts","size":0,"chunks":["842df4c"]},{"name":"./rolldown/runtime.js","size":1008,"chunks":["91fd206"]},{"name":"./src/util/emptyBlock.ts","size":216,"chunks":["91fd206"]},{"name":"./src/util/trimArray.ts","size":320,"chunks":["91fd206"]},{"name":"./src/api/promptHelpers/trimEmptyBlocks.ts","size":270,"chunks":["91fd206"]},{"name":"./src/api/aiRequest/builder.ts","size":1312,"chunks":["91fd206"]},{"name":"./src/streamTool/jsonSchema.ts","size":1326,"chunks":["91fd206"]},{"name":"./src/streamTool/ChunkExecutionError.ts","size":295,"chunks":["91fd206"]},{"name":"./src/streamTool/StreamToolExecutor.ts","size":3431,"chunks":["91fd206"]},{"name":"./src/streamTool/vercelAiSdk/util/injectDocumentStateMessages.ts","size":1755,"chunks":["91fd206"]},{"name":"./src/streamTool/vercelAiSdk/util/toolDefinitions.ts","size":745,"chunks":["91fd206"]},{"name":"./src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts","size":1172,"chunks":["91fd206"]},{"name":"./src/streamTool/vercelAiSdk/util/appendableStream.ts","size":1069,"chunks":["91fd206"]},{"name":"./src/util/stream.ts","size":1003,"chunks":["91fd206"]},{"name":"./src/streamTool/filterNewOrUpdatedOperations.ts","size":925,"chunks":["91fd206"]},{"name":"./src/streamTool/filterValidOperations.ts","size":692,"chunks":["91fd206"]},{"name":"./src/streamTool/toValidatedOperations.ts","size":1106,"chunks":["91fd206"]},{"name":"./src/streamTool/preprocess.ts","size":431,"chunks":["91fd206"]},{"name":"./src/streamTool/vercelAiSdk/util/UIMessageStreamToOperationsResult.ts","size":348,"chunks":["91fd206"]},{"name":"./src/streamTool/vercelAiSdk/util/chatHandlers.ts","size":4033,"chunks":["91fd206"]},{"name":"./src/api/aiRequest/sendMessageWithAIRequest.ts","size":786,"chunks":["91fd206"]},{"name":"./src/api/promptHelpers/addCursorPosition.ts","size":410,"chunks":["91fd206"]},{"name":"./src/api/promptHelpers/convertBlocks.ts","size":234,"chunks":["91fd206"]},{"name":"./src/api/promptHelpers/flattenBlocks.ts","size":201,"chunks":["91fd206"]},{"name":"./src/api/promptHelpers/suffixIds.ts","size":229,"chunks":["91fd206"]},{"name":"./src/api/formats/DocumentStateBuilder.ts","size":1530,"chunks":["91fd206"]},{"name":"./src/prosemirror/fragmentUtil.ts","size":285,"chunks":["91fd206"]},{"name":"./src/prosemirror/agent.ts","size":5303,"chunks":["91fd206"]},{"name":"./src/prosemirror/changeset.ts","size":5344,"chunks":["91fd206"]},{"name":"./src/streamTool/streamTool.ts","size":100,"chunks":["91fd206"]},{"name":"./src/util/AbortError.ts","size":179,"chunks":["91fd206"]},{"name":"./src/api/formats/base-tools/util/validateBlockArray.ts","size":587,"chunks":["91fd206"]},{"name":"./src/api/formats/base-tools/createAddBlocksTool.ts","size":4117,"chunks":["91fd206"]},{"name":"./src/api/formats/base-tools/createUpdateBlockTool.ts","size":3314,"chunks":["91fd206"]},{"name":"./src/api/formats/base-tools/delete.ts","size":1440,"chunks":["91fd206"]},{"name":"./src/api/formats/html-blocks/tools/getPartialHTML.ts","size":657,"chunks":["91fd206"]},{"name":"./src/prosemirror/rebaseTool.ts","size":940,"chunks":["91fd206"]},{"name":"./src/api/formats/html-blocks/tools/rebaseTool.ts","size":837,"chunks":["91fd206"]},{"name":"./src/api/formats/html-blocks/tools/validate.ts","size":246,"chunks":["91fd206"]},{"name":"./src/api/formats/html-blocks/tools/index.ts","size":1618,"chunks":["91fd206"]},{"name":"./src/api/formats/html-blocks/htmlBlocks.ts","size":2552,"chunks":["91fd206"]},{"name":"./src/api/schema/mergeSchema.ts","size":767,"chunks":["91fd206"]},{"name":"./src/api/schema/schemaToJSONSchema.ts","size":3581,"chunks":["91fd206"]},{"name":"./src/api/formats/json/tools/validate.ts","size":1409,"chunks":["91fd206"]},{"name":"./src/api/formats/json/tools/index.ts","size":1242,"chunks":["91fd206"]},{"name":"./src/api/formats/json/json.ts","size":2244,"chunks":["91fd206"]},{"name":"./src/api/formats/markdown-blocks/tools/rebaseTool.ts","size":651,"chunks":["91fd206"]},{"name":"./src/api/formats/markdown-blocks/tools/validate.ts","size":248,"chunks":["91fd206"]},{"name":"./src/api/formats/markdown-blocks/tools/index.ts","size":1377,"chunks":["91fd206"]},{"name":"./src/api/formats/markdown-blocks/markdownBlocks.ts","size":2373,"chunks":["91fd206"]},{"name":"./src/api/formats/formats.ts","size":195,"chunks":["91fd206"]},{"name":"./src/api/promptHelpers/index.ts","size":160,"chunks":["91fd206"]},{"name":"./src/i18n/dictionary.ts","size":185,"chunks":["91fd206"]},{"name":"./src/blocknoteAIClient/client.ts","size":376,"chunks":["91fd206"]},{"name":"./src/server.ts","size":0,"chunks":["91fd206"]}]}
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"directory": "packages/xl-ai"
|
|
12
12
|
},
|
|
13
13
|
"license": "GPL-3.0 OR PROPRIETARY",
|
|
14
|
-
"version": "0.
|
|
14
|
+
"version": "0.51.1",
|
|
15
15
|
"files": [
|
|
16
16
|
"dist",
|
|
17
17
|
"types",
|
|
@@ -63,9 +63,9 @@
|
|
|
63
63
|
"dependencies": {
|
|
64
64
|
"@ai-sdk/provider-utils": "^4.0.2",
|
|
65
65
|
"@ai-sdk/react": "^3.0.5",
|
|
66
|
-
"@blocknote/core": "0.
|
|
67
|
-
"@blocknote/mantine": "0.
|
|
68
|
-
"@blocknote/react": "0.
|
|
66
|
+
"@blocknote/core": "0.51.1",
|
|
67
|
+
"@blocknote/mantine": "0.51.1",
|
|
68
|
+
"@blocknote/react": "0.51.1",
|
|
69
69
|
"@floating-ui/react": "^0.27.18",
|
|
70
70
|
"@handlewithcare/prosemirror-suggest-changes": "^0.1.8",
|
|
71
71
|
"@tiptap/core": "^3.13.0",
|
|
@@ -81,9 +81,6 @@
|
|
|
81
81
|
"react": "^19.2.5",
|
|
82
82
|
"react-dom": "^19.2.5",
|
|
83
83
|
"react-icons": "^5.5.0",
|
|
84
|
-
"remark-parse": "^11.0.0",
|
|
85
|
-
"remark-stringify": "^11.0.0",
|
|
86
|
-
"unified": "^11.0.5",
|
|
87
84
|
"y-prosemirror": "^1.3.7"
|
|
88
85
|
},
|
|
89
86
|
"devDependencies": {
|
|
@@ -93,6 +90,7 @@
|
|
|
93
90
|
"@ai-sdk/mistral": "^3.0.2",
|
|
94
91
|
"@ai-sdk/openai": "^3.0.2",
|
|
95
92
|
"@ai-sdk/openai-compatible": "^2.0.2",
|
|
93
|
+
"@blocknote/xl-multi-column": "0.51.1",
|
|
96
94
|
"@mswjs/interceptors": "^0.37.6",
|
|
97
95
|
"@types/diff": "^6.0.0",
|
|
98
96
|
"@types/json-diff": "^1.0.3",
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
// @vitest-environment jsdom
|
|
2
|
+
|
|
3
|
+
import { BlockNoteEditor, BlockNoteSchema } from "@blocknote/core";
|
|
4
|
+
import { withMultiColumn } from "@blocknote/xl-multi-column";
|
|
5
|
+
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
|
6
|
+
|
|
7
|
+
import { htmlBlockLLMFormat } from "./htmlBlocks.js";
|
|
8
|
+
|
|
9
|
+
const schema = withMultiColumn(BlockNoteSchema.create());
|
|
10
|
+
|
|
11
|
+
// Regression test for https://github.com/TypeCellOS/BlockNote/issues/2716
|
|
12
|
+
describe("htmlBlockLLMFormat.defaultDocumentStateBuilder with multi-column", () => {
|
|
13
|
+
let editor: BlockNoteEditor<any, any, any>;
|
|
14
|
+
const div = document.createElement("div");
|
|
15
|
+
|
|
16
|
+
beforeEach(() => {
|
|
17
|
+
editor = BlockNoteEditor.create({
|
|
18
|
+
schema,
|
|
19
|
+
initialContent: [
|
|
20
|
+
{
|
|
21
|
+
id: "column-list-0",
|
|
22
|
+
type: "columnList",
|
|
23
|
+
children: [
|
|
24
|
+
{
|
|
25
|
+
id: "column-0",
|
|
26
|
+
type: "column",
|
|
27
|
+
children: [
|
|
28
|
+
{
|
|
29
|
+
id: "left-paragraph",
|
|
30
|
+
type: "paragraph",
|
|
31
|
+
content: "left column",
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
id: "column-1",
|
|
37
|
+
type: "column",
|
|
38
|
+
children: [
|
|
39
|
+
{
|
|
40
|
+
id: "right-paragraph",
|
|
41
|
+
type: "paragraph",
|
|
42
|
+
content: "right column",
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
});
|
|
50
|
+
editor.mount(div);
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
afterEach(() => {
|
|
54
|
+
editor._tiptapEditor.destroy();
|
|
55
|
+
editor = undefined as any;
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it("builds the document state for a doc containing a columnList without throwing", async () => {
|
|
59
|
+
const result = await htmlBlockLLMFormat.defaultDocumentStateBuilder({
|
|
60
|
+
editor,
|
|
61
|
+
streamTools: [],
|
|
62
|
+
onStart: () => {
|
|
63
|
+
// no-op
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
if (result.selection !== false) {
|
|
68
|
+
throw new Error("expected selection-less document state");
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const idEntries = result.blocks.filter(
|
|
72
|
+
(b): b is { id: string; block: string } => "id" in b,
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
const columnListEntry = idEntries.find((b) =>
|
|
76
|
+
b.id.includes("column-list-0"),
|
|
77
|
+
);
|
|
78
|
+
expect(columnListEntry).toBeDefined();
|
|
79
|
+
expect(columnListEntry!.block).toContain('data-node-type="columnList"');
|
|
80
|
+
|
|
81
|
+
expect(idEntries.find((b) => b.id.includes("column-0"))).toBeDefined();
|
|
82
|
+
expect(idEntries.find((b) => b.id.includes("column-1"))).toBeDefined();
|
|
83
|
+
expect(
|
|
84
|
+
idEntries.find((b) => b.id.includes("left-paragraph")),
|
|
85
|
+
).toBeDefined();
|
|
86
|
+
expect(
|
|
87
|
+
idEntries.find((b) => b.id.includes("right-paragraph")),
|
|
88
|
+
).toBeDefined();
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
it("builds the document state when invoked with selectedBlocks containing a columnList", async () => {
|
|
92
|
+
const result = await htmlBlockLLMFormat.defaultDocumentStateBuilder({
|
|
93
|
+
editor,
|
|
94
|
+
selectedBlocks: editor.document,
|
|
95
|
+
streamTools: [],
|
|
96
|
+
onStart: () => {
|
|
97
|
+
// no-op
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
if (result.selection !== true) {
|
|
102
|
+
throw new Error("expected selection-based document state");
|
|
103
|
+
}
|
|
104
|
+
expect(result.selectedBlocks.length).toBeGreaterThan(0);
|
|
105
|
+
});
|
|
106
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|