@smarter.sh/ui-chat 0.36.0-alpha.4 → 0.36.0-alpha.5
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/embed.js +35 -35
- package/dist/embed.js.map +1 -1
- package/dist/smarter-chat-library.es.js +1566 -1546
- package/dist/smarter-chat-library.es.js.map +1 -1
- package/dist/smarter-chat-library.umd.js +34 -34
- package/dist/smarter-chat-library.umd.js.map +1 -1
- package/dist/types/src/lib/paste.d.ts +22 -0
- package/package.json +1 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pasting into the message input as plain text.
|
|
3
|
+
*
|
|
4
|
+
* The message input is a contenteditable element, which by default pastes the clipboard's html: text copied
|
|
5
|
+
* from a chat bubble, e.g. an example prompt, would bring the bubble's fonts, colors and list bullets with it.
|
|
6
|
+
* pastePlainText pastes the clipboard's text only.
|
|
7
|
+
*/
|
|
8
|
+
import type { ClipboardEvent } from "react";
|
|
9
|
+
/**
|
|
10
|
+
* Inserts text at the caret of the focused contenteditable element, replacing the selection, and tells the
|
|
11
|
+
* element's input listeners, as typing would.
|
|
12
|
+
*
|
|
13
|
+
* @param text - The text to insert.
|
|
14
|
+
* @param doc - The document whose selection to use.
|
|
15
|
+
*/
|
|
16
|
+
export declare function insertPlainText(text: string, doc?: Document): void;
|
|
17
|
+
/**
|
|
18
|
+
* A paste handler that pastes the clipboard's plain text instead of its html.
|
|
19
|
+
*
|
|
20
|
+
* @param event - The paste event of the message input, or of an element that contains it.
|
|
21
|
+
*/
|
|
22
|
+
export declare function pastePlainText(event: ClipboardEvent<HTMLElement>): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smarter.sh/ui-chat",
|
|
3
|
-
"version": "0.36.0-alpha.
|
|
3
|
+
"version": "0.36.0-alpha.5",
|
|
4
4
|
"description": "chatbot React.js component for the https://smarter.sh declarative, plugin-based AI resource management platform.",
|
|
5
5
|
"homepage": "https://smarter.sh",
|
|
6
6
|
"type": "module",
|