@platejs/ai 50.2.1 → 50.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/react/index.d.mts +9 -4
- package/dist/react/index.d.ts +9 -4
- package/dist/react/index.js +126 -2767
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs +39 -2680
- package/dist/react/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/react/index.d.mts
CHANGED
|
@@ -4,7 +4,6 @@ import * as platejs from 'platejs';
|
|
|
4
4
|
import { ExtendConfig, SlateEditor, Range, NodeEntry, TElement, PluginConfig, Path, TIdElement, TRange, OmitFirst, EditorNodesOptions, TText, Descendant, RemoveNodesOptions } from 'platejs';
|
|
5
5
|
import { B as BaseAIPluginConfig, b as AIMode, E as EditorPrompt, A as AIToolName } from '../getEditorPrompt-C7EEuMw8.mjs';
|
|
6
6
|
import { UIMessage, ChatRequestOptions } from 'ai';
|
|
7
|
-
import { Range as Range$1 } from 'slate';
|
|
8
7
|
import { UseChatHelpers } from '@ai-sdk/react';
|
|
9
8
|
import { TriggerComboboxPluginOptions } from '@platejs/combobox';
|
|
10
9
|
import { DeserializeMdOptions, SerializeMdOptions } from '@platejs/markdown';
|
|
@@ -42,7 +41,7 @@ declare const aiCommentToRange: (editor: SlateEditor, aiComment: TComment) => Ra
|
|
|
42
41
|
declare function findTextRangeInBlock({ block, findText, }: {
|
|
43
42
|
block: NodeEntry;
|
|
44
43
|
findText: string;
|
|
45
|
-
}): Range
|
|
44
|
+
}): Range | null;
|
|
46
45
|
|
|
47
46
|
declare const acceptAIChat: (editor: PlateEditor) => void;
|
|
48
47
|
declare const acceptSuggestions: (editor: PlateEditor) => void;
|
|
@@ -63,7 +62,9 @@ declare const replaceSelectionAIChat: (editor: PlateEditor, sourceEditor: SlateE
|
|
|
63
62
|
format?: "all" | "none" | "single";
|
|
64
63
|
}) => void;
|
|
65
64
|
|
|
66
|
-
declare const resetAIChat: (editor: PlateEditor
|
|
65
|
+
declare const resetAIChat: (editor: PlateEditor, { undo }?: {
|
|
66
|
+
undo?: boolean;
|
|
67
|
+
}) => void;
|
|
67
68
|
|
|
68
69
|
declare const submitAIChat: (editor: PlateEditor, input: string, { mode, options, prompt, toolName, }?: {
|
|
69
70
|
mode?: AIMode;
|
|
@@ -103,6 +104,7 @@ type AIChatPluginConfig = PluginConfig<'aiChat', {
|
|
|
103
104
|
submit: OmitFirst<typeof submitAIChat>;
|
|
104
105
|
hide: (options?: {
|
|
105
106
|
focus?: boolean;
|
|
107
|
+
undo?: boolean;
|
|
106
108
|
}) => void;
|
|
107
109
|
node: (options?: EditorNodesOptions & {
|
|
108
110
|
anchor?: boolean;
|
|
@@ -151,6 +153,7 @@ declare const AIChatPlugin: platejs_react.PlatePlugin<PluginConfig<"aiChat", {
|
|
|
151
153
|
submit: OmitFirst<typeof submitAIChat>;
|
|
152
154
|
hide: (options?: {
|
|
153
155
|
focus?: boolean;
|
|
156
|
+
undo?: boolean;
|
|
154
157
|
}) => void;
|
|
155
158
|
node: (options?: EditorNodesOptions & {
|
|
156
159
|
anchor?: boolean;
|
|
@@ -165,6 +168,7 @@ declare const AIChatPlugin: platejs_react.PlatePlugin<PluginConfig<"aiChat", {
|
|
|
165
168
|
submit: OmitFirst<typeof submitAIChat>;
|
|
166
169
|
hide: (options?: {
|
|
167
170
|
focus?: boolean;
|
|
171
|
+
undo?: boolean;
|
|
168
172
|
}) => void;
|
|
169
173
|
node: (options?: EditorNodesOptions & {
|
|
170
174
|
anchor?: boolean;
|
|
@@ -174,8 +178,9 @@ declare const AIChatPlugin: platejs_react.PlatePlugin<PluginConfig<"aiChat", {
|
|
|
174
178
|
show: () => void;
|
|
175
179
|
stop: () => void;
|
|
176
180
|
}, "node" | "stop" | "reset" | "submit">> & Record<"aiChat", {
|
|
177
|
-
hide: ({ focus }?: {
|
|
181
|
+
hide: ({ focus, undo, }?: {
|
|
178
182
|
focus?: boolean;
|
|
183
|
+
undo?: boolean;
|
|
179
184
|
}) => void;
|
|
180
185
|
show: () => void;
|
|
181
186
|
}>, {
|
package/dist/react/index.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ import * as platejs from 'platejs';
|
|
|
4
4
|
import { ExtendConfig, SlateEditor, Range, NodeEntry, TElement, PluginConfig, Path, TIdElement, TRange, OmitFirst, EditorNodesOptions, TText, Descendant, RemoveNodesOptions } from 'platejs';
|
|
5
5
|
import { B as BaseAIPluginConfig, b as AIMode, E as EditorPrompt, A as AIToolName } from '../getEditorPrompt-C7EEuMw8.js';
|
|
6
6
|
import { UIMessage, ChatRequestOptions } from 'ai';
|
|
7
|
-
import { Range as Range$1 } from 'slate';
|
|
8
7
|
import { UseChatHelpers } from '@ai-sdk/react';
|
|
9
8
|
import { TriggerComboboxPluginOptions } from '@platejs/combobox';
|
|
10
9
|
import { DeserializeMdOptions, SerializeMdOptions } from '@platejs/markdown';
|
|
@@ -42,7 +41,7 @@ declare const aiCommentToRange: (editor: SlateEditor, aiComment: TComment) => Ra
|
|
|
42
41
|
declare function findTextRangeInBlock({ block, findText, }: {
|
|
43
42
|
block: NodeEntry;
|
|
44
43
|
findText: string;
|
|
45
|
-
}): Range
|
|
44
|
+
}): Range | null;
|
|
46
45
|
|
|
47
46
|
declare const acceptAIChat: (editor: PlateEditor) => void;
|
|
48
47
|
declare const acceptSuggestions: (editor: PlateEditor) => void;
|
|
@@ -63,7 +62,9 @@ declare const replaceSelectionAIChat: (editor: PlateEditor, sourceEditor: SlateE
|
|
|
63
62
|
format?: "all" | "none" | "single";
|
|
64
63
|
}) => void;
|
|
65
64
|
|
|
66
|
-
declare const resetAIChat: (editor: PlateEditor
|
|
65
|
+
declare const resetAIChat: (editor: PlateEditor, { undo }?: {
|
|
66
|
+
undo?: boolean;
|
|
67
|
+
}) => void;
|
|
67
68
|
|
|
68
69
|
declare const submitAIChat: (editor: PlateEditor, input: string, { mode, options, prompt, toolName, }?: {
|
|
69
70
|
mode?: AIMode;
|
|
@@ -103,6 +104,7 @@ type AIChatPluginConfig = PluginConfig<'aiChat', {
|
|
|
103
104
|
submit: OmitFirst<typeof submitAIChat>;
|
|
104
105
|
hide: (options?: {
|
|
105
106
|
focus?: boolean;
|
|
107
|
+
undo?: boolean;
|
|
106
108
|
}) => void;
|
|
107
109
|
node: (options?: EditorNodesOptions & {
|
|
108
110
|
anchor?: boolean;
|
|
@@ -151,6 +153,7 @@ declare const AIChatPlugin: platejs_react.PlatePlugin<PluginConfig<"aiChat", {
|
|
|
151
153
|
submit: OmitFirst<typeof submitAIChat>;
|
|
152
154
|
hide: (options?: {
|
|
153
155
|
focus?: boolean;
|
|
156
|
+
undo?: boolean;
|
|
154
157
|
}) => void;
|
|
155
158
|
node: (options?: EditorNodesOptions & {
|
|
156
159
|
anchor?: boolean;
|
|
@@ -165,6 +168,7 @@ declare const AIChatPlugin: platejs_react.PlatePlugin<PluginConfig<"aiChat", {
|
|
|
165
168
|
submit: OmitFirst<typeof submitAIChat>;
|
|
166
169
|
hide: (options?: {
|
|
167
170
|
focus?: boolean;
|
|
171
|
+
undo?: boolean;
|
|
168
172
|
}) => void;
|
|
169
173
|
node: (options?: EditorNodesOptions & {
|
|
170
174
|
anchor?: boolean;
|
|
@@ -174,8 +178,9 @@ declare const AIChatPlugin: platejs_react.PlatePlugin<PluginConfig<"aiChat", {
|
|
|
174
178
|
show: () => void;
|
|
175
179
|
stop: () => void;
|
|
176
180
|
}, "node" | "stop" | "reset" | "submit">> & Record<"aiChat", {
|
|
177
|
-
hide: ({ focus }?: {
|
|
181
|
+
hide: ({ focus, undo, }?: {
|
|
178
182
|
focus?: boolean;
|
|
183
|
+
undo?: boolean;
|
|
179
184
|
}) => void;
|
|
180
185
|
show: () => void;
|
|
181
186
|
}>, {
|