@copilotkit/react-textarea 1.81.0 → 1.82.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/index.cjs +2 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +2 -5
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +2 -5
- package/dist/index.umd.js.map +1 -1
- package/package.json +4 -4
- package/src/lib/editor-to-text.test.ts +60 -0
- package/src/lib/editor-to-text.ts +17 -9
- package/src/lib/slatejs-edits/replace-text.test.ts +56 -0
- package/src/lib/slatejs-edits/replace-text.ts +8 -13
package/dist/index.umd.js
CHANGED
|
@@ -358,10 +358,7 @@ lodash_merge = __toESM(lodash_merge);
|
|
|
358
358
|
anchor: slate.Editor.start(editor, []),
|
|
359
359
|
focus: slate.Editor.end(editor, [])
|
|
360
360
|
} });
|
|
361
|
-
if (newText && newText !== "") slate.Transforms.
|
|
362
|
-
type: "paragraph",
|
|
363
|
-
children: [{ text: newText }]
|
|
364
|
-
}], { at: [0] });
|
|
361
|
+
if (newText && newText !== "") slate.Transforms.insertText(editor, newText, { at: slate.Editor.start(editor, []) });
|
|
365
362
|
}
|
|
366
363
|
|
|
367
364
|
//#endregion
|
|
@@ -1194,7 +1191,7 @@ lodash_merge = __toESM(lodash_merge);
|
|
|
1194
1191
|
}).reduce((acc, val) => acc.concat(val), []);
|
|
1195
1192
|
}
|
|
1196
1193
|
const editorToText = (editor) => {
|
|
1197
|
-
return nodeChildrenToTextComponents(editor,
|
|
1194
|
+
return editor.children.map((node) => nodeChildrenToTextComponents(editor, [node]).map((textComponent) => textComponent.text).join("")).join("\n");
|
|
1198
1195
|
};
|
|
1199
1196
|
|
|
1200
1197
|
//#endregion
|