@eshal-bot/chat-widget 0.2.47 → 0.2.48
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/{chat-widget-MarkdownRenderer-vumwhHph.esm.js → chat-widget-MarkdownRenderer-DIcPzPvl.esm.js} +1 -1
- package/dist/{chat-widget-index-MI4rHyOE.esm.js → chat-widget-index-DhXcfBZg.esm.js} +4 -4
- package/dist/chat-widget.esm.js +1 -1
- package/dist/chat-widget.js +10 -3
- package/dist/chat-widget.min.js +4 -4
- package/dist/chat-widget.umd.js +8 -8
- package/package.json +1 -1
package/dist/chat-widget.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{S as default}from"./chat-widget-index-
|
|
1
|
+
export{S as default}from"./chat-widget-index-DhXcfBZg.esm.js";import"react";import"react-dom/client";import"react/jsx-runtime";import"react-dom";
|
package/dist/chat-widget.js
CHANGED
|
@@ -12684,9 +12684,16 @@
|
|
|
12684
12684
|
* - The static welcome this call added (`welcomeId`) is replaced by the
|
|
12685
12685
|
* greeting, so the call does not show both.
|
|
12686
12686
|
* - A bubble already on screen with the same text (a welcome shown before the
|
|
12687
|
-
* call started, in either list) is kept and no duplicate is added.
|
|
12687
|
+
* call started, in either list) is kept and no duplicate is added. "The
|
|
12688
|
+
* same" ignores case, spacing and curly or straight quotes: the welcome on
|
|
12689
|
+
* screen and the spoken one can differ only in those (dev, 11 Nov 2026,
|
|
12690
|
+
* the greeting showed twice).
|
|
12688
12691
|
* - Otherwise the greeting is appended as the bot's bubble.
|
|
12689
12692
|
*/
|
|
12693
|
+
function sameGreeting(a, b) {
|
|
12694
|
+
const norm = s => String(s).replace(/[‘’ʼ]/g, "'").replace(/[“”]/g, '"').replace(/\s+/g, " ").trim().toLowerCase();
|
|
12695
|
+
return norm(a) === norm(b);
|
|
12696
|
+
}
|
|
12690
12697
|
function applyVoiceGreeting(prev, text, welcomeId, others, makeBubble) {
|
|
12691
12698
|
if (welcomeId) {
|
|
12692
12699
|
const at = prev.findIndex(m => m.id === welcomeId);
|
|
@@ -12699,7 +12706,7 @@
|
|
|
12699
12706
|
return next;
|
|
12700
12707
|
}
|
|
12701
12708
|
}
|
|
12702
|
-
const shown = [...prev, ...(others || [])].some(m => m.role === "assistant" && typeof m.content === "string" && m.content
|
|
12709
|
+
const shown = [...prev, ...(others || [])].some(m => m.role === "assistant" && typeof m.content === "string" && sameGreeting(m.content, text));
|
|
12703
12710
|
if (shown) return prev;
|
|
12704
12711
|
return [...prev, makeBubble(text)];
|
|
12705
12712
|
}
|
|
@@ -23961,7 +23968,7 @@
|
|
|
23961
23968
|
* value by its own test (that constant sat at 0.1.113 while this package was
|
|
23962
23969
|
* at 0.2.2 precisely because nothing enforced it - EV-2431).
|
|
23963
23970
|
*/
|
|
23964
|
-
const WIDGET_VERSION = '0.2.
|
|
23971
|
+
const WIDGET_VERSION = '0.2.48';
|
|
23965
23972
|
|
|
23966
23973
|
/**
|
|
23967
23974
|
* API utility functions
|