@cognigy/webchat 3.30.1 → 3.31.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/OSS_LICENSES.txt +2 -2
- package/dist/webchat.esm.js +14 -6
- package/dist/webchat.js +27 -27
- package/package.json +1 -1
package/OSS_LICENSES.txt
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Created on
|
|
1
|
+
Created on 17-09-2025 at 11:54:39
|
|
2
2
|
|
|
3
3
|
{
|
|
4
4
|
"@ampproject/remapping@2.3.0": {
|
|
@@ -170,7 +170,7 @@ Created on 05-09-2025 at 15:38:59
|
|
|
170
170
|
"licenseFile": "node_modules/@cognigy/socket-client/LICENSE",
|
|
171
171
|
"copyright": "Copyright (c) 2019 Cognigy GmbH"
|
|
172
172
|
},
|
|
173
|
-
"@cognigy/webchat@3.
|
|
173
|
+
"@cognigy/webchat@3.31.0": {
|
|
174
174
|
"licenses": "MIT*",
|
|
175
175
|
"publisher": "Cognigy GmbH",
|
|
176
176
|
"email": "info@cognigy.com",
|
package/dist/webchat.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* webchat.esm.js v3.
|
|
3
|
-
* https://github.com/Cognigy/Webchat/tree/v3.
|
|
4
|
-
* https://github.com/Cognigy/Webchat/tree/v3.
|
|
2
|
+
* webchat.esm.js v3.31.0
|
|
3
|
+
* https://github.com/Cognigy/Webchat/tree/v3.31.0
|
|
4
|
+
* https://github.com/Cognigy/Webchat/tree/v3.31.0/OSS_LICENSES.txt
|
|
5
5
|
*/
|
|
6
6
|
import * as __WEBPACK_EXTERNAL_MODULE_react_dom_7dac9eee__ from "react-dom";
|
|
7
7
|
import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
|
|
@@ -27428,7 +27428,12 @@ const getFinishReason = (message, messageId) => {
|
|
|
27428
27428
|
return messageId ? message.data?._cognigy?._finishReason : "stop";
|
|
27429
27429
|
};
|
|
27430
27430
|
|
|
27431
|
-
//
|
|
27431
|
+
// Helper to determine if a message should be set as the currently animating message
|
|
27432
|
+
const shouldSetAsAnimating = (nextAnimatingId, newMessage, isEngagementMessageHidden) => {
|
|
27433
|
+
return !nextAnimatingId && !(newMessage.source === "engagement" && isEngagementMessageHidden);
|
|
27434
|
+
};
|
|
27435
|
+
|
|
27436
|
+
// slice of the store state that contains the info about streaming mode and teaserMessage, to avoid circular dependency
|
|
27432
27437
|
|
|
27433
27438
|
const createMessageReducer = getState => {
|
|
27434
27439
|
return (state = initialState, action) => {
|
|
@@ -27445,6 +27450,7 @@ const createMessageReducer = getState => {
|
|
|
27445
27450
|
const newMessage = action.message;
|
|
27446
27451
|
const isOutputCollationEnabled = getState().config?.settings?.behavior?.collateStreamedOutputs;
|
|
27447
27452
|
const isprogressiveMessageRenderingEnabled = getState().config?.settings?.behavior?.progressiveMessageRendering;
|
|
27453
|
+
const isEngagementMessageHidden = getState().config?.settings?.teaserMessage?.showInChat === false;
|
|
27448
27454
|
if (!isOutputCollationEnabled && !isprogressiveMessageRenderingEnabled || newMessage.source !== "bot" && newMessage.source !== "engagement") {
|
|
27449
27455
|
return {
|
|
27450
27456
|
...state,
|
|
@@ -27464,7 +27470,8 @@ const createMessageReducer = getState => {
|
|
|
27464
27470
|
if (!state.currentlyAnimatingId) {
|
|
27465
27471
|
visibleOutputMessages.push(newMessageId);
|
|
27466
27472
|
}
|
|
27467
|
-
|
|
27473
|
+
const shouldAnimate = shouldSetAsAnimating(nextAnimatingId, newMessage, isEngagementMessageHidden);
|
|
27474
|
+
if (shouldAnimate) {
|
|
27468
27475
|
nextAnimatingId = isAnimated ? newMessageId : null;
|
|
27469
27476
|
}
|
|
27470
27477
|
return {
|
|
@@ -27499,7 +27506,8 @@ const createMessageReducer = getState => {
|
|
|
27499
27506
|
if (!newMessageId || !isOutputCollationEnabled) {
|
|
27500
27507
|
newMessageId = (0,_helper__WEBPACK_IMPORTED_MODULE_0__/* .generateRandomId */ .M)();
|
|
27501
27508
|
}
|
|
27502
|
-
|
|
27509
|
+
const shouldAnimate = shouldSetAsAnimating(nextAnimatingId, newMessage, isEngagementMessageHidden);
|
|
27510
|
+
if (shouldAnimate) {
|
|
27503
27511
|
nextAnimatingId = newMessageId;
|
|
27504
27512
|
}
|
|
27505
27513
|
|