@platejs/ai 49.2.15 → 50.0.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/{BaseAIPlugin-DyivsvyQ.d.mts → getEditorPrompt-FgyoD13L.d.mts} +23 -1
- package/dist/{BaseAIPlugin-DyivsvyQ.d.ts → getEditorPrompt-FgyoD13L.d.ts} +23 -1
- package/dist/index.d.mts +6 -32
- package/dist/index.d.ts +6 -32
- package/dist/index.js +48 -898
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +45 -902
- package/dist/index.mjs.map +1 -1
- package/dist/react/index.d.mts +72 -66
- package/dist/react/index.d.ts +72 -66
- package/dist/react/index.js +3392 -227
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs +3322 -157
- package/dist/react/index.mjs.map +1 -1
- package/package.json +6 -4
|
@@ -33,4 +33,26 @@ declare const BaseAIPlugin: platejs.SlatePlugin<PluginConfig<any, {}, {}, Record
|
|
|
33
33
|
undo: () => void;
|
|
34
34
|
}>, {}>>;
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
type AIToolName = 'comment' | 'edit' | 'generate' | null;
|
|
37
|
+
type AIMode = 'chat' | 'insert';
|
|
38
|
+
|
|
39
|
+
type EditorPrompt = ((params: EditorPromptParams) => string) | PromptConfig | string;
|
|
40
|
+
interface EditorPromptParams {
|
|
41
|
+
editor: SlateEditor;
|
|
42
|
+
isBlockSelecting: boolean;
|
|
43
|
+
isSelecting: boolean;
|
|
44
|
+
}
|
|
45
|
+
type MarkdownType = 'block' | 'blockSelection' | 'blockSelectionWithBlockId' | 'blockWithBlockId' | 'editor' | 'editorWithBlockId';
|
|
46
|
+
interface PromptConfig {
|
|
47
|
+
default: string;
|
|
48
|
+
blockSelecting?: string;
|
|
49
|
+
selecting?: string;
|
|
50
|
+
}
|
|
51
|
+
declare const replacePlaceholders: (editor: SlateEditor, text: string, { prompt, }?: {
|
|
52
|
+
prompt?: string;
|
|
53
|
+
}) => string;
|
|
54
|
+
declare const getEditorPrompt: (editor: SlateEditor, { prompt, }: {
|
|
55
|
+
prompt?: EditorPrompt;
|
|
56
|
+
}) => string;
|
|
57
|
+
|
|
58
|
+
export { type AIToolName as A, type BaseAIPluginConfig as B, type EditorPrompt as E, type MarkdownType as M, type PromptConfig as P, BaseAIPlugin as a, type AIMode as b, removeAINodes as c, type EditorPromptParams as d, replacePlaceholders as e, getEditorPrompt as g, insertAINodes as i, removeAIMarks as r };
|
|
@@ -33,4 +33,26 @@ declare const BaseAIPlugin: platejs.SlatePlugin<PluginConfig<any, {}, {}, Record
|
|
|
33
33
|
undo: () => void;
|
|
34
34
|
}>, {}>>;
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
type AIToolName = 'comment' | 'edit' | 'generate' | null;
|
|
37
|
+
type AIMode = 'chat' | 'insert';
|
|
38
|
+
|
|
39
|
+
type EditorPrompt = ((params: EditorPromptParams) => string) | PromptConfig | string;
|
|
40
|
+
interface EditorPromptParams {
|
|
41
|
+
editor: SlateEditor;
|
|
42
|
+
isBlockSelecting: boolean;
|
|
43
|
+
isSelecting: boolean;
|
|
44
|
+
}
|
|
45
|
+
type MarkdownType = 'block' | 'blockSelection' | 'blockSelectionWithBlockId' | 'blockWithBlockId' | 'editor' | 'editorWithBlockId';
|
|
46
|
+
interface PromptConfig {
|
|
47
|
+
default: string;
|
|
48
|
+
blockSelecting?: string;
|
|
49
|
+
selecting?: string;
|
|
50
|
+
}
|
|
51
|
+
declare const replacePlaceholders: (editor: SlateEditor, text: string, { prompt, }?: {
|
|
52
|
+
prompt?: string;
|
|
53
|
+
}) => string;
|
|
54
|
+
declare const getEditorPrompt: (editor: SlateEditor, { prompt, }: {
|
|
55
|
+
prompt?: EditorPrompt;
|
|
56
|
+
}) => string;
|
|
57
|
+
|
|
58
|
+
export { type AIToolName as A, type BaseAIPluginConfig as B, type EditorPrompt as E, type MarkdownType as M, type PromptConfig as P, BaseAIPlugin as a, type AIMode as b, removeAINodes as c, type EditorPromptParams as d, replacePlaceholders as e, getEditorPrompt as g, insertAINodes as i, removeAIMarks as r };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { SlateEditor, History
|
|
4
|
-
import { PlateEditor } from 'platejs/react';
|
|
5
|
-
import { DeserializeMdOptions, SerializeMdOptions } from '@platejs/markdown';
|
|
1
|
+
import { M as MarkdownType } from './getEditorPrompt-FgyoD13L.mjs';
|
|
2
|
+
export { b as AIMode, A as AIToolName, a as BaseAIPlugin, B as BaseAIPluginConfig, E as EditorPrompt, d as EditorPromptParams, P as PromptConfig, g as getEditorPrompt, i as insertAINodes, r as removeAIMarks, c as removeAINodes, e as replacePlaceholders } from './getEditorPrompt-FgyoD13L.mjs';
|
|
3
|
+
import { SlateEditor, History } from 'platejs';
|
|
6
4
|
|
|
7
5
|
declare const undoAI: (editor: SlateEditor) => void;
|
|
8
6
|
|
|
@@ -13,32 +11,8 @@ declare const withAIBatch: (editor: SlateEditor, fn: () => void, { split, }?: {
|
|
|
13
11
|
split?: boolean;
|
|
14
12
|
}) => void;
|
|
15
13
|
|
|
16
|
-
declare const
|
|
17
|
-
|
|
18
|
-
declare const streamDeserializeMd: (editor: PlateEditor, data: string, options?: DeserializeMdOptions) => any;
|
|
19
|
-
|
|
20
|
-
interface SteamInsertChunkOptions {
|
|
21
|
-
elementProps?: any;
|
|
22
|
-
textProps?: any;
|
|
23
|
-
}
|
|
24
|
-
/** @experimental */
|
|
25
|
-
declare function streamInsertChunk(editor: PlateEditor, chunk: string, options?: SteamInsertChunkOptions): void;
|
|
26
|
-
declare const getCurrentBlockPath: (editor: SlateEditor) => Path;
|
|
27
|
-
|
|
28
|
-
declare const streamSerializeMd: (editor: PlateEditor, options: SerializeMdOptions, chunk: string) => string;
|
|
29
|
-
|
|
30
|
-
declare const escapeInput: (data: string) => string;
|
|
31
|
-
|
|
32
|
-
declare const getListNode: (editor: PlateEditor, node: TElement) => TElement;
|
|
33
|
-
|
|
34
|
-
declare const isSameNode: (editor: PlateEditor, node1: TElement | TText, node2: TElement | TText) => boolean;
|
|
35
|
-
|
|
36
|
-
declare const nodesWithProps: (editor: PlateEditor, nodes: Descendant[], options: SteamInsertChunkOptions) => Descendant[];
|
|
37
|
-
|
|
38
|
-
declare const getChunkTrimmed: (chunk: string, { direction, }?: {
|
|
39
|
-
direction?: "left" | "right";
|
|
14
|
+
declare const getMarkdown: (editor: SlateEditor, { type, }: {
|
|
15
|
+
type: MarkdownType;
|
|
40
16
|
}) => string;
|
|
41
|
-
declare function isCompleteCodeBlock(str: string): boolean;
|
|
42
|
-
declare function isCompleteMath(str: string): boolean;
|
|
43
17
|
|
|
44
|
-
export { type AIBatch,
|
|
18
|
+
export { type AIBatch, MarkdownType, getMarkdown, undoAI, withAIBatch };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { SlateEditor, History
|
|
4
|
-
import { PlateEditor } from 'platejs/react';
|
|
5
|
-
import { DeserializeMdOptions, SerializeMdOptions } from '@platejs/markdown';
|
|
1
|
+
import { M as MarkdownType } from './getEditorPrompt-FgyoD13L.js';
|
|
2
|
+
export { b as AIMode, A as AIToolName, a as BaseAIPlugin, B as BaseAIPluginConfig, E as EditorPrompt, d as EditorPromptParams, P as PromptConfig, g as getEditorPrompt, i as insertAINodes, r as removeAIMarks, c as removeAINodes, e as replacePlaceholders } from './getEditorPrompt-FgyoD13L.js';
|
|
3
|
+
import { SlateEditor, History } from 'platejs';
|
|
6
4
|
|
|
7
5
|
declare const undoAI: (editor: SlateEditor) => void;
|
|
8
6
|
|
|
@@ -13,32 +11,8 @@ declare const withAIBatch: (editor: SlateEditor, fn: () => void, { split, }?: {
|
|
|
13
11
|
split?: boolean;
|
|
14
12
|
}) => void;
|
|
15
13
|
|
|
16
|
-
declare const
|
|
17
|
-
|
|
18
|
-
declare const streamDeserializeMd: (editor: PlateEditor, data: string, options?: DeserializeMdOptions) => any;
|
|
19
|
-
|
|
20
|
-
interface SteamInsertChunkOptions {
|
|
21
|
-
elementProps?: any;
|
|
22
|
-
textProps?: any;
|
|
23
|
-
}
|
|
24
|
-
/** @experimental */
|
|
25
|
-
declare function streamInsertChunk(editor: PlateEditor, chunk: string, options?: SteamInsertChunkOptions): void;
|
|
26
|
-
declare const getCurrentBlockPath: (editor: SlateEditor) => Path;
|
|
27
|
-
|
|
28
|
-
declare const streamSerializeMd: (editor: PlateEditor, options: SerializeMdOptions, chunk: string) => string;
|
|
29
|
-
|
|
30
|
-
declare const escapeInput: (data: string) => string;
|
|
31
|
-
|
|
32
|
-
declare const getListNode: (editor: PlateEditor, node: TElement) => TElement;
|
|
33
|
-
|
|
34
|
-
declare const isSameNode: (editor: PlateEditor, node1: TElement | TText, node2: TElement | TText) => boolean;
|
|
35
|
-
|
|
36
|
-
declare const nodesWithProps: (editor: PlateEditor, nodes: Descendant[], options: SteamInsertChunkOptions) => Descendant[];
|
|
37
|
-
|
|
38
|
-
declare const getChunkTrimmed: (chunk: string, { direction, }?: {
|
|
39
|
-
direction?: "left" | "right";
|
|
14
|
+
declare const getMarkdown: (editor: SlateEditor, { type, }: {
|
|
15
|
+
type: MarkdownType;
|
|
40
16
|
}) => string;
|
|
41
|
-
declare function isCompleteCodeBlock(str: string): boolean;
|
|
42
|
-
declare function isCompleteMath(str: string): boolean;
|
|
43
17
|
|
|
44
|
-
export { type AIBatch,
|
|
18
|
+
export { type AIBatch, MarkdownType, getMarkdown, undoAI, withAIBatch };
|