@platejs/ai 53.2.2 → 53.3.3
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/{index-D2hJDomP.d.ts → index-tNeux7Mo.d.ts} +13 -13
- package/dist/index.d.ts +1 -1
- package/dist/react/index.d.ts +19 -19
- package/package.json +17 -7
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as platejs13 from "platejs";
|
|
2
2
|
import { Descendant, History, OmitFirst, Path, PluginConfig, SlateEditor, TLocation, Value } from "platejs";
|
|
3
3
|
|
|
4
4
|
//#region src/lib/transforms/aiStreamSnapshot.d.ts
|
|
@@ -67,31 +67,31 @@ type BaseAIPluginConfig = PluginConfig<'ai', {}, {}, {
|
|
|
67
67
|
undo: OmitFirst<typeof undoAI>;
|
|
68
68
|
};
|
|
69
69
|
}>;
|
|
70
|
-
declare const BaseAIPlugin:
|
|
70
|
+
declare const BaseAIPlugin: platejs13.SlatePlugin<PluginConfig<"ai", {}, {}, {
|
|
71
71
|
ai: {
|
|
72
|
-
acceptPreview: ((_value?:
|
|
72
|
+
acceptPreview: ((_value?: platejs13.Value | undefined) => boolean) & ((_value?: platejs13.Value | undefined) => boolean);
|
|
73
73
|
beginPreview: ((args_0?: {
|
|
74
|
-
originalBlocks?:
|
|
74
|
+
originalBlocks?: platejs13.Value;
|
|
75
75
|
} | undefined) => boolean) & ((args_0?: {
|
|
76
|
-
originalBlocks?:
|
|
76
|
+
originalBlocks?: platejs13.Value;
|
|
77
77
|
} | undefined) => boolean);
|
|
78
78
|
cancelPreview: (() => boolean) & (() => boolean);
|
|
79
79
|
discardPreview: (() => boolean) & (() => boolean);
|
|
80
80
|
hasPreview: (() => boolean) & (() => boolean);
|
|
81
|
-
insertNodes: ((nodes:
|
|
82
|
-
target?:
|
|
83
|
-
} | undefined) => void) & ((nodes:
|
|
84
|
-
target?:
|
|
81
|
+
insertNodes: ((nodes: platejs13.Descendant[], args_1?: {
|
|
82
|
+
target?: platejs13.Path;
|
|
83
|
+
} | undefined) => void) & ((nodes: platejs13.Descendant[], args_1?: {
|
|
84
|
+
target?: platejs13.Path;
|
|
85
85
|
} | undefined) => void);
|
|
86
86
|
removeMarks: ((args_0?: {
|
|
87
|
-
at?:
|
|
87
|
+
at?: platejs13.TLocation;
|
|
88
88
|
} | undefined) => void) & ((args_0?: {
|
|
89
|
-
at?:
|
|
89
|
+
at?: platejs13.TLocation;
|
|
90
90
|
} | undefined) => void);
|
|
91
91
|
removeNodes: ((args_0?: {
|
|
92
|
-
at?:
|
|
92
|
+
at?: platejs13.Path;
|
|
93
93
|
} | undefined) => void) & ((args_0?: {
|
|
94
|
-
at?:
|
|
94
|
+
at?: platejs13.Path;
|
|
95
95
|
} | undefined) => void);
|
|
96
96
|
undo: (() => void) & (() => void);
|
|
97
97
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as hasAIPreview, S as discardAIPreview, _ as insertAINodes, a as EditorPromptParams, b as beginAIPreview, c as AIMode, d as BaseAIPluginConfig, f as AIBatch, g as removeAIMarks, h as removeAINodes, i as EditorPrompt, l as AIToolName, m as undoAI, n as MarkdownType, o as PromptConfig, p as withAIBatch, r as replacePlaceholders, s as getEditorPrompt, t as getMarkdown, u as BaseAIPlugin, v as AI_PREVIEW_KEY, x as cancelAIPreview, y as acceptAIPreview } from "./index-
|
|
1
|
+
import { C as hasAIPreview, S as discardAIPreview, _ as insertAINodes, a as EditorPromptParams, b as beginAIPreview, c as AIMode, d as BaseAIPluginConfig, f as AIBatch, g as removeAIMarks, h as removeAINodes, i as EditorPrompt, l as AIToolName, m as undoAI, n as MarkdownType, o as PromptConfig, p as withAIBatch, r as replacePlaceholders, s as getEditorPrompt, t as getMarkdown, u as BaseAIPlugin, v as AI_PREVIEW_KEY, x as cancelAIPreview, y as acceptAIPreview } from "./index-tNeux7Mo";
|
|
2
2
|
export { AIBatch, AIMode, AIToolName, AI_PREVIEW_KEY, BaseAIPlugin, BaseAIPluginConfig, EditorPrompt, EditorPromptParams, MarkdownType, PromptConfig, acceptAIPreview, beginAIPreview, cancelAIPreview, discardAIPreview, getEditorPrompt, getMarkdown, hasAIPreview, insertAINodes, removeAIMarks, removeAINodes, replacePlaceholders, undoAI, withAIBatch };
|
package/dist/react/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as AIMode, d as BaseAIPluginConfig, i as EditorPrompt, l as AIToolName } from "../index-
|
|
2
|
-
import * as
|
|
1
|
+
import { c as AIMode, d as BaseAIPluginConfig, i as EditorPrompt, l as AIToolName } from "../index-tNeux7Mo";
|
|
2
|
+
import * as platejs0 from "platejs";
|
|
3
3
|
import { Descendant, EditorNodesOptions, ExtendConfig, NodeEntry, OmitFirst, Path, PluginConfig, Range, RemoveNodesOptions, SlateEditor, TElement, TIdElement, TRange, TTableElement, TText } from "platejs";
|
|
4
4
|
import { DeserializeMdOptions, SerializeMdOptions } from "@platejs/markdown";
|
|
5
5
|
import * as platejs_react0 from "platejs/react";
|
|
@@ -11,31 +11,31 @@ import { TriggerComboboxPluginOptions } from "@platejs/combobox";
|
|
|
11
11
|
|
|
12
12
|
//#region src/react/ai/AIPlugin.d.ts
|
|
13
13
|
type AIPluginConfig = ExtendConfig<BaseAIPluginConfig>;
|
|
14
|
-
declare const AIPlugin: platejs_react0.PlatePlugin<
|
|
14
|
+
declare const AIPlugin: platejs_react0.PlatePlugin<platejs0.PluginConfig<"ai", {}, {}, {
|
|
15
15
|
ai: {
|
|
16
|
-
acceptPreview: ((_value?:
|
|
16
|
+
acceptPreview: ((_value?: platejs0.Value | undefined) => boolean) & ((_value?: platejs0.Value | undefined) => boolean);
|
|
17
17
|
beginPreview: ((args_0?: {
|
|
18
|
-
originalBlocks?:
|
|
18
|
+
originalBlocks?: platejs0.Value;
|
|
19
19
|
} | undefined) => boolean) & ((args_0?: {
|
|
20
|
-
originalBlocks?:
|
|
20
|
+
originalBlocks?: platejs0.Value;
|
|
21
21
|
} | undefined) => boolean);
|
|
22
22
|
cancelPreview: (() => boolean) & (() => boolean);
|
|
23
23
|
discardPreview: (() => boolean) & (() => boolean);
|
|
24
24
|
hasPreview: (() => boolean) & (() => boolean);
|
|
25
|
-
insertNodes: ((nodes:
|
|
26
|
-
target?:
|
|
27
|
-
} | undefined) => void) & ((nodes:
|
|
28
|
-
target?:
|
|
25
|
+
insertNodes: ((nodes: platejs0.Descendant[], args_1?: {
|
|
26
|
+
target?: platejs0.Path;
|
|
27
|
+
} | undefined) => void) & ((nodes: platejs0.Descendant[], args_1?: {
|
|
28
|
+
target?: platejs0.Path;
|
|
29
29
|
} | undefined) => void);
|
|
30
30
|
removeMarks: ((args_0?: {
|
|
31
|
-
at?:
|
|
31
|
+
at?: platejs0.TLocation;
|
|
32
32
|
} | undefined) => void) & ((args_0?: {
|
|
33
|
-
at?:
|
|
33
|
+
at?: platejs0.TLocation;
|
|
34
34
|
} | undefined) => void);
|
|
35
35
|
removeNodes: ((args_0?: {
|
|
36
|
-
at?:
|
|
36
|
+
at?: platejs0.Path;
|
|
37
37
|
} | undefined) => void) & ((args_0?: {
|
|
38
|
-
at?:
|
|
38
|
+
at?: platejs0.Path;
|
|
39
39
|
} | undefined) => void);
|
|
40
40
|
undo: (() => void) & (() => void);
|
|
41
41
|
};
|
|
@@ -223,7 +223,7 @@ declare const AIChatPlugin: platejs_react0.PlatePlugin<PluginConfig<"aiChat", {
|
|
|
223
223
|
reload: () => void;
|
|
224
224
|
show: () => void;
|
|
225
225
|
stop: () => void;
|
|
226
|
-
}, "node" | "
|
|
226
|
+
}, "node" | "stop" | "reset" | "submit">> & Record<"aiChat", {
|
|
227
227
|
hide: ({
|
|
228
228
|
focus,
|
|
229
229
|
undo
|
|
@@ -244,7 +244,7 @@ declare const AIChatPlugin: platejs_react0.PlatePlugin<PluginConfig<"aiChat", {
|
|
|
244
244
|
insertBelow: (sourceEditor: SlateEditor, args_1?: {
|
|
245
245
|
format?: "all" | "none" | "single";
|
|
246
246
|
} | undefined) => void;
|
|
247
|
-
removeAnchor: (options?:
|
|
247
|
+
removeAnchor: (options?: platejs0.RemoveNodesOptions | undefined) => void;
|
|
248
248
|
replaceSelection: (sourceEditor: SlateEditor, args_1?: {
|
|
249
249
|
format?: "all" | "none" | "single";
|
|
250
250
|
} | undefined) => void;
|
|
@@ -262,7 +262,7 @@ declare const withAIChat: OverrideEditor<AIChatPluginConfig>;
|
|
|
262
262
|
*/
|
|
263
263
|
declare const useAIChatEditor: (editor: SlateEditor, content: string, {
|
|
264
264
|
parser
|
|
265
|
-
}?: DeserializeMdOptions) =>
|
|
265
|
+
}?: DeserializeMdOptions) => platejs0.Value;
|
|
266
266
|
//#endregion
|
|
267
267
|
//#region src/react/ai-chat/hooks/useChatChunk.d.ts
|
|
268
268
|
declare const useChatChunk: ({
|
|
@@ -298,7 +298,7 @@ declare const useEditorChat: ({
|
|
|
298
298
|
}: UseEditorChatOptions) => void;
|
|
299
299
|
//#endregion
|
|
300
300
|
//#region src/react/ai-chat/streaming/streamDeserializeInlineMd.d.ts
|
|
301
|
-
declare const streamDeserializeInlineMd: (editor: PlateEditor, text: string, options?: DeserializeMdOptions) =>
|
|
301
|
+
declare const streamDeserializeInlineMd: (editor: PlateEditor, text: string, options?: DeserializeMdOptions) => platejs0.Descendant[] | {
|
|
302
302
|
text: string;
|
|
303
303
|
}[];
|
|
304
304
|
//#endregion
|
|
@@ -317,7 +317,7 @@ type SteamInsertChunkOptions = {
|
|
|
317
317
|
};
|
|
318
318
|
declare const getInsertPreviewStart: (editor: SlateEditor) => {
|
|
319
319
|
path: Path;
|
|
320
|
-
startBlock:
|
|
320
|
+
startBlock: platejs0.TElement | platejs0.TText | undefined;
|
|
321
321
|
startInEmptyParagraph: boolean;
|
|
322
322
|
};
|
|
323
323
|
/** @experimental */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platejs/ai",
|
|
3
|
-
"version": "53.
|
|
3
|
+
"version": "53.3.3",
|
|
4
4
|
"description": "Text AI plugin for Plate",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"plate",
|
|
@@ -32,22 +32,32 @@
|
|
|
32
32
|
"fastest-levenshtein": "1.0.16",
|
|
33
33
|
"lodash": "^4.17.21",
|
|
34
34
|
"react-compiler-runtime": "^1.0.0",
|
|
35
|
-
"@platejs/markdown": "^53.
|
|
35
|
+
"@platejs/markdown": "^53.3.3",
|
|
36
36
|
"@platejs/selection": "^53.1.6",
|
|
37
|
-
"@platejs/suggestion": "^53.
|
|
37
|
+
"@platejs/suggestion": "^53.2.3",
|
|
38
38
|
"@platejs/table": "^53.0.9"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@ai-sdk/react": "^
|
|
42
|
-
"ai": "^
|
|
41
|
+
"@ai-sdk/react": "^4.0.0",
|
|
42
|
+
"ai": "^7.0.0",
|
|
43
43
|
"@plate/scripts": "1.0.0",
|
|
44
|
-
"platejs": "^53.
|
|
44
|
+
"platejs": "^53.3.3"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
|
-
"
|
|
47
|
+
"@ai-sdk/react": "^4.0.0",
|
|
48
|
+
"ai": "^7.0.0",
|
|
49
|
+
"platejs": ">=53.3.3",
|
|
48
50
|
"react": ">=18.0.0",
|
|
49
51
|
"react-dom": ">=18.0.0"
|
|
50
52
|
},
|
|
53
|
+
"peerDependenciesMeta": {
|
|
54
|
+
"@ai-sdk/react": {
|
|
55
|
+
"optional": true
|
|
56
|
+
},
|
|
57
|
+
"ai": {
|
|
58
|
+
"optional": true
|
|
59
|
+
}
|
|
60
|
+
},
|
|
51
61
|
"publishConfig": {
|
|
52
62
|
"access": "public"
|
|
53
63
|
},
|