@cimulate/copilot-widget 1.40.0 → 1.41.1
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/CHANGELOG.md +8 -0
- package/README.md +36 -1
- package/dist/cimulate-copilot-widget.es.js +13590 -19182
- package/dist/copilot.es.js +13589 -19181
- package/dist/messaging.d.ts +18 -0
- package/dist/messaging.es.js +14485 -20029
- package/dist/messaging.umd.js +29 -29
- package/package.json +2 -1
package/dist/messaging.d.ts
CHANGED
|
@@ -360,6 +360,7 @@ export declare const eventHandlers: {
|
|
|
360
360
|
session: {
|
|
361
361
|
resetConversation: () => void;
|
|
362
362
|
endConversation: () => void;
|
|
363
|
+
sendMessage: typeof sendMessage;
|
|
363
364
|
};
|
|
364
365
|
};
|
|
365
366
|
|
|
@@ -991,6 +992,23 @@ declare interface SendError {
|
|
|
991
992
|
|
|
992
993
|
export declare type SendMessage = (text: string, options?: SendMessageOptions) => Promise<SendMessageResult>;
|
|
993
994
|
|
|
995
|
+
/**
|
|
996
|
+
* Send a shopper query into the current conversation.
|
|
997
|
+
*
|
|
998
|
+
* Safe to call before the widget is open: the query is queued until the
|
|
999
|
+
* widget opens and the agent's welcome message has arrived. Pair with
|
|
1000
|
+
* `eventHandlers.components.toggleWidgetOpen(true)` to show the widget.
|
|
1001
|
+
* Rejects if called before `injectMessagingWidget()` has mounted the widget.
|
|
1002
|
+
*
|
|
1003
|
+
* @example
|
|
1004
|
+
* ```js
|
|
1005
|
+
* const { sendMessage, eventHandlers } = window.CimulateMessaging;
|
|
1006
|
+
* sendMessage("running shoes");
|
|
1007
|
+
* eventHandlers.components.toggleWidgetOpen(true);
|
|
1008
|
+
* ```
|
|
1009
|
+
*/
|
|
1010
|
+
export declare function sendMessage(text: string, options?: SendMessageOptions): Promise<SendMessageResult>;
|
|
1011
|
+
|
|
994
1012
|
export declare interface SendMessageOptions {
|
|
995
1013
|
silent?: boolean;
|
|
996
1014
|
reconcileMessageId?: string;
|