@cimulate/copilot-widget 1.40.0 → 1.41.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/CHANGELOG.md +4 -0
- package/README.md +5 -0
- package/dist/messaging.d.ts +18 -0
- package/dist/messaging.es.js +8389 -8327
- package/dist/messaging.umd.js +29 -29
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
`@cimulate/copilot-widget` follows [Semantic Versioning](https://semver.org/). Each entry is a released `package.json` version (deployed on merge to `master`), newest first.
|
|
4
4
|
|
|
5
|
+
## 1.41.0 — 2026-09-21
|
|
6
|
+
|
|
7
|
+
- Agentforce messaging mode now exposes `sendMessage()` for storefronts (CDN and NPM). Hosts can submit a shopper query from a search bar or embedded question before the widget is open; the query is queued until the widget opens and the agent's welcome message has arrived. Pair with `eventHandlers.components.toggleWidgetOpen(true)` to show the widget. Exposed as `window.CimulateMessaging.sendMessage()` and `eventHandlers.session.sendMessage()`. React hosts continue to use `useMessaging().sendMessage()`.
|
|
8
|
+
|
|
5
9
|
## 1.40.0 — 2026-09-18
|
|
6
10
|
|
|
7
11
|
- Messaging mode: the follow-up suggestion buttons shown after an agent message are now overridable via the `Suggestions` key in `ComponentOverrides`, consistent with `ProductTile`/`ProductCarousel`/`ProductDetailCard`/`ProductComparison`/`ProgressSteps`. The override receives `{ suggestions }` (the follow-up strings, in order) and the standard `api`; posting a suggestion back to the agent goes through `api.sendMessage`, same as every other override.
|
package/README.md
CHANGED
|
@@ -112,6 +112,11 @@ Settings are in `public/index.html`. Example configurations you can modify:
|
|
|
112
112
|
eventHandlers.components.toggleWidgetOpen(true);
|
|
113
113
|
eventHandlers.pdp.setPdpContext({ productId: "product-123" });
|
|
114
114
|
eventHandlers.browse.setBrowseContext({ categoryId: "outdoor-gear" });
|
|
115
|
+
|
|
116
|
+
// Messaging mode: submit a query from a storefront search bar or embedded question
|
|
117
|
+
const { sendMessage, eventHandlers: messagingHandlers } = window.CimulateMessaging;
|
|
118
|
+
sendMessage("running shoes");
|
|
119
|
+
messagingHandlers.components.toggleWidgetOpen(true);
|
|
115
120
|
</script>
|
|
116
121
|
```
|
|
117
122
|
|
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;
|