@blocknote/xl-ai 0.46.1 → 0.46.2
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 +321 -315
- package/dist/blocknote-xl-ai.js.map +1 -1
- package/dist/webpack-stats.json +1 -1
- package/package.json +8 -8
- package/src/components/AIMenu/AIMenuController.tsx +6 -3
- package/src/components/AIMenu/PromptSuggestionMenu.tsx +2 -2
package/dist/webpack-stats.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"builtAt":
|
|
1
|
+
{"builtAt":1769545069355,"assets":[{"name":"server.cjs","size":1169},{"name":"blocknote-xl-ai.cjs","size":25871},{"name":"locales.cjs","size":23791},{"name":"client-BPNTLm1-.cjs","size":38123},{"name":"client-BPNTLm1-.cjs.map","size":193335},{"name":"server.cjs.map","size":91},{"name":"blocknote-xl-ai.cjs.map","size":2216703},{"name":"locales.cjs.map","size":55283}],"chunks":[{"id":"91fd206","entry":true,"initial":true,"files":["server.cjs"],"names":["server"]},{"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":"8392e5f","entry":false,"initial":true,"files":["client-BPNTLm1-.cjs"],"names":["client"]}],"modules":[{"name":"./src/server.ts","size":0,"chunks":["91fd206"]},{"name":"./src/style.css","size":0,"chunks":["a1ee98a"]},{"name":"./src/plugins/AgentCursorPlugin.ts","size":2444,"chunks":["a1ee98a"]},{"name":"./src/AIExtension.ts","size":11092,"chunks":["a1ee98a"]},{"name":"../../node_modules/.pnpm/react-icons@5.5.0_react@19.2.3/node_modules/react-icons/lib/iconContext.mjs","size":251,"chunks":["a1ee98a"]},{"name":"../../node_modules/.pnpm/react-icons@5.5.0_react@19.2.3/node_modules/react-icons/lib/iconBase.mjs","size":4003,"chunks":["a1ee98a"]},{"name":"../../node_modules/.pnpm/react-icons@5.5.0_react@19.2.3/node_modules/react-icons/ri/index.mjs","size":6747,"chunks":["a1ee98a"]},{"name":"./src/hooks/useAIDictionary.ts","size":120,"chunks":["a1ee98a"]},{"name":"./src/components/AIMenu/PromptSuggestionMenu.tsx","size":2999,"chunks":["a1ee98a"]},{"name":"./src/components/AIMenu/getDefaultAIMenuItems.tsx","size":7846,"chunks":["a1ee98a"]},{"name":"./src/components/AIMenu/AIMenu.tsx","size":3596,"chunks":["a1ee98a"]},{"name":"./src/components/AIMenu/AIMenuController.tsx","size":2581,"chunks":["a1ee98a"]},{"name":"./src/components/FormattingToolbar/AIToolbarButton.tsx","size":960,"chunks":["a1ee98a"]},{"name":"./src/components/SuggestionMenu/getAISlashMenuItems.tsx","size":728,"chunks":["a1ee98a"]},{"name":"./src/index.ts","size":0,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/ar.ts","size":1531,"chunks":["842df4c"]},{"name":"./src/i18n/locales/de.ts","size":1585,"chunks":["842df4c"]},{"name":"./src/i18n/locales/en.ts","size":1483,"chunks":["842df4c"]},{"name":"./src/i18n/locales/es.ts","size":1553,"chunks":["842df4c"]},{"name":"./src/i18n/locales/fr.ts","size":1569,"chunks":["842df4c"]},{"name":"./src/i18n/locales/he.ts","size":1401,"chunks":["842df4c"]},{"name":"./src/i18n/locales/hr.ts","size":1494,"chunks":["842df4c"]},{"name":"./src/i18n/locales/is.ts","size":1562,"chunks":["842df4c"]},{"name":"./src/i18n/locales/it.ts","size":1555,"chunks":["842df4c"]},{"name":"./src/i18n/locales/ja.ts","size":1372,"chunks":["842df4c"]},{"name":"./src/i18n/locales/ko.ts","size":1394,"chunks":["842df4c"]},{"name":"./src/i18n/locales/nl.ts","size":1536,"chunks":["842df4c"]},{"name":"./src/i18n/locales/no.ts","size":1509,"chunks":["842df4c"]},{"name":"./src/i18n/locales/pl.ts","size":1510,"chunks":["842df4c"]},{"name":"./src/i18n/locales/pt.ts","size":1548,"chunks":["842df4c"]},{"name":"./src/i18n/locales/ru.ts","size":1549,"chunks":["842df4c"]},{"name":"./src/i18n/locales/sk.ts","size":1511,"chunks":["842df4c"]},{"name":"./src/i18n/locales/uk.ts","size":1556,"chunks":["842df4c"]},{"name":"./src/i18n/locales/vi.ts","size":1506,"chunks":["842df4c"]},{"name":"./src/i18n/locales/zh-tw.ts","size":1345,"chunks":["842df4c"]},{"name":"./src/i18n/locales/zh.ts","size":1340,"chunks":["842df4c"]},{"name":"./src/i18n/locales/index.ts","size":0,"chunks":["842df4c"]},{"name":"./src/util/emptyBlock.ts","size":170,"chunks":["8392e5f"]},{"name":"./src/util/trimArray.ts","size":327,"chunks":["8392e5f"]},{"name":"./src/api/promptHelpers/trimEmptyBlocks.ts","size":272,"chunks":["8392e5f"]},{"name":"./src/api/aiRequest/builder.ts","size":1347,"chunks":["8392e5f"]},{"name":"./src/streamTool/jsonSchema.ts","size":1630,"chunks":["8392e5f"]},{"name":"./src/streamTool/ChunkExecutionError.ts","size":237,"chunks":["8392e5f"]},{"name":"./src/streamTool/StreamToolExecutor.ts","size":4984,"chunks":["8392e5f"]},{"name":"./src/streamTool/vercelAiSdk/util/injectDocumentStateMessages.ts","size":2819,"chunks":["8392e5f"]},{"name":"./src/streamTool/vercelAiSdk/util/toolDefinitions.ts","size":750,"chunks":["8392e5f"]},{"name":"./src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts","size":1493,"chunks":["8392e5f"]},{"name":"./src/streamTool/vercelAiSdk/util/appendableStream.ts","size":1196,"chunks":["8392e5f"]},{"name":"./src/util/stream.ts","size":1069,"chunks":["8392e5f"]},{"name":"./src/streamTool/filterNewOrUpdatedOperations.ts","size":933,"chunks":["8392e5f"]},{"name":"./src/streamTool/filterValidOperations.ts","size":681,"chunks":["8392e5f"]},{"name":"./src/streamTool/toValidatedOperations.ts","size":1182,"chunks":["8392e5f"]},{"name":"./src/streamTool/preprocess.ts","size":594,"chunks":["8392e5f"]},{"name":"./src/streamTool/vercelAiSdk/util/UIMessageStreamToOperationsResult.ts","size":306,"chunks":["8392e5f"]},{"name":"./src/streamTool/vercelAiSdk/util/chatHandlers.ts","size":4645,"chunks":["8392e5f"]},{"name":"./src/api/aiRequest/sendMessageWithAIRequest.ts","size":819,"chunks":["8392e5f"]},{"name":"./src/api/promptHelpers/addCursorPosition.ts","size":390,"chunks":["8392e5f"]},{"name":"./src/api/promptHelpers/convertBlocks.ts","size":183,"chunks":["8392e5f"]},{"name":"./src/api/promptHelpers/flattenBlocks.ts","size":162,"chunks":["8392e5f"]},{"name":"./src/api/promptHelpers/suffixIds.ts","size":204,"chunks":["8392e5f"]},{"name":"./src/api/formats/DocumentStateBuilder.ts","size":1985,"chunks":["8392e5f"]},{"name":"./src/prosemirror/fragmentUtil.ts","size":262,"chunks":["8392e5f"]},{"name":"./src/prosemirror/agent.ts","size":6220,"chunks":["8392e5f"]},{"name":"./src/prosemirror/changeset.ts","size":6000,"chunks":["8392e5f"]},{"name":"./src/streamTool/streamTool.ts","size":48,"chunks":["8392e5f"]},{"name":"./src/util/AbortError.ts","size":131,"chunks":["8392e5f"]},{"name":"./src/api/formats/base-tools/util/validateBlockArray.ts","size":574,"chunks":["8392e5f"]},{"name":"./src/api/formats/base-tools/createAddBlocksTool.ts","size":5549,"chunks":["8392e5f"]},{"name":"./src/api/formats/base-tools/createUpdateBlockTool.ts","size":4418,"chunks":["8392e5f"]},{"name":"./src/api/formats/base-tools/delete.ts","size":1869,"chunks":["8392e5f"]},{"name":"./src/api/formats/html-blocks/tools/getPartialHTML.ts","size":699,"chunks":["8392e5f"]},{"name":"./src/prosemirror/rebaseTool.ts","size":1508,"chunks":["8392e5f"]},{"name":"./src/api/formats/html-blocks/tools/rebaseTool.ts","size":893,"chunks":["8392e5f"]},{"name":"./src/api/formats/html-blocks/tools/validate.ts","size":204,"chunks":["8392e5f"]},{"name":"./src/api/formats/html-blocks/tools/index.ts","size":1886,"chunks":["8392e5f"]},{"name":"./src/api/formats/html-blocks/htmlBlocks.ts","size":2890,"chunks":["8392e5f"]},{"name":"./src/api/schema/mergeSchema.ts","size":829,"chunks":["8392e5f"]},{"name":"./src/api/schema/schemaToJSONSchema.ts","size":4910,"chunks":["8392e5f"]},{"name":"./src/api/formats/json/tools/validate.ts","size":1603,"chunks":["8392e5f"]},{"name":"./src/api/formats/json/tools/index.ts","size":1324,"chunks":["8392e5f"]},{"name":"./src/api/formats/json/json.ts","size":2550,"chunks":["8392e5f"]},{"name":"./src/api/formats/markdown-blocks/tools/rebaseTool.ts","size":633,"chunks":["8392e5f"]},{"name":"./src/api/formats/markdown-blocks/tools/validate.ts","size":202,"chunks":["8392e5f"]},{"name":"./src/api/formats/markdown-blocks/tools/index.ts","size":1505,"chunks":["8392e5f"]},{"name":"./src/api/formats/markdown-blocks/markdownBlocks.ts","size":2563,"chunks":["8392e5f"]},{"name":"./src/api/formats/formats.ts","size":149,"chunks":["8392e5f"]},{"name":"./src/api/promptHelpers/index.ts","size":112,"chunks":["8392e5f"]},{"name":"./src/i18n/dictionary.ts","size":150,"chunks":["8392e5f"]},{"name":"./src/blocknoteAIClient/client.ts","size":533,"chunks":["8392e5f"]}]}
|
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.46.
|
|
14
|
+
"version": "0.46.2",
|
|
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.46.
|
|
67
|
-
"@blocknote/mantine": "0.46.
|
|
68
|
-
"@blocknote/react": "0.46.
|
|
66
|
+
"@blocknote/core": "0.46.2",
|
|
67
|
+
"@blocknote/mantine": "0.46.2",
|
|
68
|
+
"@blocknote/react": "0.46.2",
|
|
69
69
|
"@floating-ui/react": "^0.26.28",
|
|
70
70
|
"@handlewithcare/prosemirror-suggest-changes": "^0.1.8",
|
|
71
71
|
"@tiptap/core": "^3.13.0",
|
|
@@ -78,8 +78,8 @@
|
|
|
78
78
|
"prosemirror-tables": "^1.8.3",
|
|
79
79
|
"prosemirror-transform": "^1.10.5",
|
|
80
80
|
"prosemirror-view": "^1.41.4",
|
|
81
|
-
"react": "^19.2.
|
|
82
|
-
"react-dom": "^19.2.
|
|
81
|
+
"react": "^19.2.3",
|
|
82
|
+
"react-dom": "^19.2.3",
|
|
83
83
|
"react-icons": "^5.5.0",
|
|
84
84
|
"remark-parse": "^11.0.0",
|
|
85
85
|
"remark-stringify": "^11.0.0",
|
|
@@ -99,8 +99,8 @@
|
|
|
99
99
|
"@types/json-schema": "^7.0.15",
|
|
100
100
|
"@types/lodash.isequal": "^4.5.8",
|
|
101
101
|
"@types/lodash.merge": "^4.6.9",
|
|
102
|
-
"@types/react": "^19.2.
|
|
103
|
-
"@types/react-dom": "^19.2.
|
|
102
|
+
"@types/react": "^19.2.3",
|
|
103
|
+
"@types/react-dom": "^19.2.3",
|
|
104
104
|
"@vitejs/plugin-react": "^4.7.0",
|
|
105
105
|
"@vitest/runner": "^2.1.9",
|
|
106
106
|
"eslint": "^8.57.1",
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
useExtension,
|
|
6
6
|
useExtensionState,
|
|
7
7
|
} from "@blocknote/react";
|
|
8
|
-
import { autoUpdate, offset, size } from "@floating-ui/react";
|
|
8
|
+
import { autoUpdate, flip, offset, size } from "@floating-ui/react";
|
|
9
9
|
import { FC, useMemo } from "react";
|
|
10
10
|
|
|
11
11
|
import { AIExtension } from "../../AIExtension.js";
|
|
@@ -27,12 +27,13 @@ export const AIMenuController = (props: {
|
|
|
27
27
|
|
|
28
28
|
const floatingUIOptions = useMemo<FloatingUIOptions>(
|
|
29
29
|
() => ({
|
|
30
|
+
...props.floatingUIOptions,
|
|
30
31
|
useFloatingOptions: {
|
|
31
32
|
open: aiMenuState !== "closed",
|
|
32
33
|
placement: "bottom",
|
|
33
34
|
middleware: [
|
|
34
35
|
offset(10),
|
|
35
|
-
|
|
36
|
+
flip(),
|
|
36
37
|
size({
|
|
37
38
|
apply({ rects, elements }) {
|
|
38
39
|
Object.assign(elements.floating.style, {
|
|
@@ -60,6 +61,7 @@ export const AIMenuController = (props: {
|
|
|
60
61
|
animationFrame: true,
|
|
61
62
|
});
|
|
62
63
|
},
|
|
64
|
+
...props.floatingUIOptions?.useFloatingOptions,
|
|
63
65
|
},
|
|
64
66
|
useDismissProps: {
|
|
65
67
|
enabled:
|
|
@@ -80,13 +82,14 @@ export const AIMenuController = (props: {
|
|
|
80
82
|
|
|
81
83
|
return true;
|
|
82
84
|
},
|
|
85
|
+
...props.floatingUIOptions?.useDismissProps,
|
|
83
86
|
},
|
|
84
87
|
elementProps: {
|
|
85
88
|
style: {
|
|
86
89
|
zIndex: 100,
|
|
87
90
|
},
|
|
91
|
+
...props.floatingUIOptions?.elementProps,
|
|
88
92
|
},
|
|
89
|
-
...props.floatingUIOptions,
|
|
90
93
|
}),
|
|
91
94
|
[ai, aiMenuState, blockId, props.floatingUIOptions],
|
|
92
95
|
);
|
|
@@ -38,7 +38,7 @@ export const PromptSuggestionMenu = (props: PromptSuggestionMenuProps) => {
|
|
|
38
38
|
|
|
39
39
|
const handleEnter = useCallback(
|
|
40
40
|
async (event: KeyboardEvent) => {
|
|
41
|
-
if (event.key === "Enter") {
|
|
41
|
+
if (event.key === "Enter" && !event.nativeEvent.isComposing) {
|
|
42
42
|
// console.log("ENTER", currentEditingPrompt);
|
|
43
43
|
onManualPromptSubmit(promptTextToUse);
|
|
44
44
|
}
|
|
@@ -71,7 +71,7 @@ export const PromptSuggestionMenu = (props: PromptSuggestionMenuProps) => {
|
|
|
71
71
|
const handleKeyDown = useCallback(
|
|
72
72
|
(event: KeyboardEvent) => {
|
|
73
73
|
// TODO: handle backspace to close
|
|
74
|
-
if (event.key === "Enter") {
|
|
74
|
+
if (event.key === "Enter" && !event.nativeEvent.isComposing) {
|
|
75
75
|
if (items.length > 0) {
|
|
76
76
|
handler(event);
|
|
77
77
|
} else {
|