@platejs/ai 52.0.4 → 52.0.6

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.
@@ -1,4 +1,4 @@
1
- import * as platejs0 from "platejs";
1
+ import * as platejs5 from "platejs";
2
2
  import { Descendant, History, OmitFirst, Path, PluginConfig, SlateEditor, TLocation } from "platejs";
3
3
 
4
4
  //#region src/lib/transforms/insertAINodes.d.ts
@@ -43,15 +43,15 @@ type BaseAIPluginConfig = PluginConfig<'ai', {}, {}, {
43
43
  removeNodes: OmitFirst<typeof removeAINodes>;
44
44
  };
45
45
  }>;
46
- declare const BaseAIPlugin: platejs0.SlatePlugin<PluginConfig<any, {}, {}, Record<any, {
47
- insertNodes: (nodes: platejs0.Descendant[], args_1?: {
48
- target?: platejs0.Path;
46
+ declare const BaseAIPlugin: platejs5.SlatePlugin<PluginConfig<any, {}, {}, Record<any, {
47
+ insertNodes: (nodes: platejs5.Descendant[], args_1?: {
48
+ target?: platejs5.Path;
49
49
  } | undefined) => void;
50
50
  removeMarks: (args_0?: {
51
- at?: platejs0.TLocation;
51
+ at?: platejs5.TLocation;
52
52
  } | undefined) => void;
53
53
  removeNodes: (args_0?: {
54
- at?: platejs0.Path;
54
+ at?: platejs5.Path;
55
55
  } | undefined) => void;
56
56
  undo: () => void;
57
57
  }>, {}>>;
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { _ as insertAINodes, a as EditorPromptParams, 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 } from "./index-CyVv31EV.js";
1
+ import { _ as insertAINodes, a as EditorPromptParams, 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 } from "./index-DOcs1xmw.js";
2
2
  export { AIBatch, AIMode, AIToolName, BaseAIPlugin, BaseAIPluginConfig, EditorPrompt, EditorPromptParams, MarkdownType, PromptConfig, getEditorPrompt, getMarkdown, insertAINodes, removeAIMarks, removeAINodes, replacePlaceholders, undoAI, withAIBatch };
@@ -1,5 +1,5 @@
1
- import { c as AIMode, d as BaseAIPluginConfig, i as EditorPrompt, l as AIToolName } from "../index-CyVv31EV.js";
2
- import * as platejs4 from "platejs";
1
+ import { c as AIMode, d as BaseAIPluginConfig, i as EditorPrompt, l as AIToolName } from "../index-DOcs1xmw.js";
2
+ import * as platejs0 from "platejs";
3
3
  import { Descendant, EditorNodesOptions, ExtendConfig, NodeEntry, OmitFirst, Path, PluginConfig, Range, RemoveNodesOptions, SlateEditor, TElement, TIdElement, TRange, TText } from "platejs";
4
4
  import { DeserializeMdOptions, SerializeMdOptions } from "@platejs/markdown";
5
5
  import * as platejs_react0 from "platejs/react";
@@ -11,15 +11,15 @@ 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<platejs4.PluginConfig<any, {}, {}, Record<any, {
15
- insertNodes: (nodes: platejs4.Descendant[], args_1?: {
16
- target?: platejs4.Path;
14
+ declare const AIPlugin: platejs_react0.PlatePlugin<platejs0.PluginConfig<any, {}, {}, Record<any, {
15
+ insertNodes: (nodes: platejs0.Descendant[], args_1?: {
16
+ target?: platejs0.Path;
17
17
  } | undefined) => void;
18
18
  removeMarks: (args_0?: {
19
- at?: platejs4.TLocation;
19
+ at?: platejs0.TLocation;
20
20
  } | undefined) => void;
21
21
  removeNodes: (args_0?: {
22
- at?: platejs4.Path;
22
+ at?: platejs0.Path;
23
23
  } | undefined) => void;
24
24
  undo: () => void;
25
25
  }>, {}>>;
@@ -227,7 +227,7 @@ declare const AIChatPlugin: platejs_react0.PlatePlugin<PluginConfig<"aiChat", {
227
227
  insertBelow: (sourceEditor: SlateEditor, args_1?: {
228
228
  format?: "all" | "none" | "single";
229
229
  } | undefined) => void;
230
- removeAnchor: (options?: platejs4.RemoveNodesOptions | undefined) => void;
230
+ removeAnchor: (options?: platejs0.RemoveNodesOptions | undefined) => void;
231
231
  replaceSelection: (sourceEditor: SlateEditor, args_1?: {
232
232
  format?: "all" | "none" | "single";
233
233
  } | undefined) => void;
@@ -279,7 +279,7 @@ declare const useEditorChat: ({
279
279
  }: UseEditorChatOptions) => void;
280
280
  //#endregion
281
281
  //#region src/react/ai-chat/streaming/streamDeserializeInlineMd.d.ts
282
- declare const streamDeserializeInlineMd: (editor: PlateEditor, text: string, options?: DeserializeMdOptions) => platejs4.Descendant[];
282
+ declare const streamDeserializeInlineMd: (editor: PlateEditor, text: string, options?: DeserializeMdOptions) => platejs0.Descendant[];
283
283
  //#endregion
284
284
  //#region src/react/ai-chat/streaming/streamDeserializeMd.d.ts
285
285
  declare const streamDeserializeMd: (editor: PlateEditor, data: string, options?: DeserializeMdOptions) => TElement[] | {
@@ -202,9 +202,8 @@ const acceptAIChat = (editor) => {
202
202
  const applyAISuggestions = (editor, content) => {
203
203
  /** Conflict with block selection */
204
204
  editor.getApi({ key: KEYS.cursorOverlay })?.cursorOverlay?.removeCursor("selection");
205
- const isBlockSelecting = editor.getOption(BlockSelectionPlugin, "isSelectingSome");
206
205
  const { chatNodes } = editor.getOptions(AIChatPlugin);
207
- if (isBlockSelecting || editor.api.blocks({ mode: "highest" }).length > 1) {
206
+ if (chatNodes.length > 1) {
208
207
  const setReplaceIds = (ids) => {
209
208
  editor.setOption(AIChatPlugin, "_replaceIds", ids);
210
209
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platejs/ai",
3
- "version": "52.0.4",
3
+ "version": "52.0.6",
4
4
  "description": "Text AI plugin for Plate",
5
5
  "keywords": [
6
6
  "plate",