@eshal-bot/chat-widget 0.1.100 → 0.1.101
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-D1RW8GZa.esm.js → chat-widget-MarkdownRenderer-DwAarA-l.esm.js} +1 -1
- package/dist/chat-widget-index-B5VwIIEZ.esm.js +20 -0
- package/dist/chat-widget.esm.js +1 -1
- package/dist/chat-widget.js +51 -3
- package/dist/chat-widget.min.js +6 -6
- package/dist/chat-widget.umd.js +8 -8
- package/package.json +1 -1
- package/dist/chat-widget-index-BOARafNH.esm.js +0 -20
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-B5VwIIEZ.esm.js";import"react";import"react-dom/client";import"react-dom";import"react/jsx-runtime";
|
package/dist/chat-widget.js
CHANGED
|
@@ -8968,6 +8968,34 @@
|
|
|
8968
8968
|
return classes.filter(Boolean).join(' ');
|
|
8969
8969
|
};
|
|
8970
8970
|
|
|
8971
|
+
/**
|
|
8972
|
+
* EV-2977: what an auto-prompt chip DISPLAYS.
|
|
8973
|
+
*
|
|
8974
|
+
* Each auto-prompt has a dual output: `text` (short title-case label,
|
|
8975
|
+
* e.g. "Geidea Accept Payments") and `submitText` (the full natural
|
|
8976
|
+
* question, e.g. "How do I accept payments?") which is what actually
|
|
8977
|
+
* gets submitted on click. Product decision: the web widget shows the
|
|
8978
|
+
* natural question (Perplexity/ChatGPT-style follow-ups) instead of
|
|
8979
|
+
* the label. Display-only - the SUBMIT value and the prompt payload
|
|
8980
|
+
* (`text`, `submitText`) are untouched.
|
|
8981
|
+
*
|
|
8982
|
+
* Kill-switch: `behavior.autoPromptQuestionDisplay` (default true).
|
|
8983
|
+
* When false - or when `submitText` is absent/identical - falls back
|
|
8984
|
+
* to the label, i.e. the pre-EV-2977 rendering.
|
|
8985
|
+
*
|
|
8986
|
+
* @param {{text?: string, submitText?: string}|string} prompt
|
|
8987
|
+
* @param {boolean} [questionDisplay=true]
|
|
8988
|
+
* @returns {string}
|
|
8989
|
+
*/
|
|
8990
|
+
const getPromptDisplayText = function (prompt) {
|
|
8991
|
+
let questionDisplay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
8992
|
+
if (!prompt || typeof prompt === 'string') return prompt || '';
|
|
8993
|
+
const label = typeof prompt.text === 'string' ? prompt.text : '';
|
|
8994
|
+
if (!questionDisplay) return label;
|
|
8995
|
+
const question = typeof prompt.submitText === 'string' ? prompt.submitText.trim() : '';
|
|
8996
|
+
return question && question !== label ? question : label;
|
|
8997
|
+
};
|
|
8998
|
+
|
|
8971
8999
|
/**
|
|
8972
9000
|
* Constructs the voice WebSocket base URL.
|
|
8973
9001
|
*
|
|
@@ -17152,7 +17180,11 @@
|
|
|
17152
17180
|
promptFontSize,
|
|
17153
17181
|
isDark,
|
|
17154
17182
|
isRtl,
|
|
17155
|
-
t
|
|
17183
|
+
t,
|
|
17184
|
+
// EV-2977: show the natural question (submitText) on the chip face
|
|
17185
|
+
// instead of the title-case label. Display-only; see
|
|
17186
|
+
// getPromptDisplayText. Kill-switch: behavior.autoPromptQuestionDisplay.
|
|
17187
|
+
questionDisplay = true
|
|
17156
17188
|
} = _ref;
|
|
17157
17189
|
const scrollRef = reactExports.useRef(null);
|
|
17158
17190
|
const [canScrollLeft, setCanScrollLeft] = reactExports.useState(false);
|
|
@@ -17235,7 +17267,7 @@
|
|
|
17235
17267
|
fontFamily: promptFontFamily,
|
|
17236
17268
|
fontSize: promptFontSize
|
|
17237
17269
|
},
|
|
17238
|
-
children: p
|
|
17270
|
+
children: getPromptDisplayText(p, questionDisplay)
|
|
17239
17271
|
}, "".concat(p.text || p, "-").concat(index)))
|
|
17240
17272
|
}), /*#__PURE__*/jsxRuntimeExports.jsx("button", {
|
|
17241
17273
|
type: "button",
|
|
@@ -17297,6 +17329,10 @@
|
|
|
17297
17329
|
userTextColor,
|
|
17298
17330
|
promptSuggestions,
|
|
17299
17331
|
onPromptSuggestionClick,
|
|
17332
|
+
// EV-2977: chip face shows the natural question (submitText) instead
|
|
17333
|
+
// of the title-case label. Kill-switch per deployment via
|
|
17334
|
+
// behavior.autoPromptQuestionDisplay; default on.
|
|
17335
|
+
autoPromptQuestionDisplay = true,
|
|
17300
17336
|
// Inline tag selector, rendered at the top of the input card in the
|
|
17301
17337
|
// same slot as PromptSuggestionsRow. Mutually exclusive with prompt
|
|
17302
17338
|
// suggestions in practice (tag selector only shows before the user
|
|
@@ -17580,6 +17616,7 @@
|
|
|
17580
17616
|
children: [tagSelectorNode ? tagSelectorNode : promptSuggestions.length > 0 && onPromptSuggestionClick && /*#__PURE__*/jsxRuntimeExports.jsx(PromptSuggestionsRow, {
|
|
17581
17617
|
suggestions: promptSuggestions,
|
|
17582
17618
|
onSuggestionClick: onPromptSuggestionClick,
|
|
17619
|
+
questionDisplay: autoPromptQuestionDisplay,
|
|
17583
17620
|
promptPrimary: promptPrimary,
|
|
17584
17621
|
promptTextColor: promptTextColor,
|
|
17585
17622
|
promptFontFamily: promptFontFamily,
|
|
@@ -18874,6 +18911,10 @@
|
|
|
18874
18911
|
onboardingEnabled = false,
|
|
18875
18912
|
onResetConversation,
|
|
18876
18913
|
autoPromptEnabled = true,
|
|
18914
|
+
// EV-2977: auto-prompt chips display the natural question
|
|
18915
|
+
// (submitText) instead of the title-case label. Display-only;
|
|
18916
|
+
// kill-switch via behavior.autoPromptQuestionDisplay (default on).
|
|
18917
|
+
autoPromptQuestionDisplay = true,
|
|
18877
18918
|
allowFeedback = true,
|
|
18878
18919
|
provideCitations = true,
|
|
18879
18920
|
onFeedback,
|
|
@@ -19697,6 +19738,7 @@
|
|
|
19697
19738
|
userTextColor: userTextColor,
|
|
19698
19739
|
promptSuggestions: showResolveForm || isConversationResolved || autoPromptEnabled === false || isLoading ? [] : stablePromptSuggestions,
|
|
19699
19740
|
onPromptSuggestionClick: stableOnPromptSuggestionClick,
|
|
19741
|
+
autoPromptQuestionDisplay: autoPromptQuestionDisplay,
|
|
19700
19742
|
tagSelectorNode: null,
|
|
19701
19743
|
showResolveButton: isCsatEnabled && hasUserMessages && !isConversationResolved && !showResolveForm && !showCsat && !shouldHideResolveForOnboarding,
|
|
19702
19744
|
onResolve: () => {
|
|
@@ -20038,7 +20080,7 @@
|
|
|
20038
20080
|
|
|
20039
20081
|
// Map API response to widget props (use props as overrides if provided)
|
|
20040
20082
|
const widgetConfig = reactExports.useMemo(() => {
|
|
20041
|
-
var _agentConfig$config, _cfg$identity, _cfg$branding, _cfg$typography, _cfg$messages, _cfg$voice, _cfg$onboarding, _cfg$disclaimer, _cfg$csat, _cfg$inactivity, _cfg$behavior, _cfg$security, _cfg$layout, _ref2, _messages$bundles$loc, _messages$bundles, _messages$bundles$en, _messages$bundles2, _ref3, _ref4, _security$domains, _ref5, _ref6, _ref7, _branding$chatbotAvat, _branding$chatbotAvat2, _ref8, _ref9, _ref0, _ref1, _ref10, _ref11, _ref12, _ref13, _typography$headerTex, _identity$subtitle, _identity$showStatus, _identity$statusMode, _identity$officeHours, _ref14, _ref15, _ref16, _ref17, _ref18, _ref19, _inactivity$timeoutVa, _inactivity$timeoutUn, _ref20, _ref21, _ref22, _ref23, _ref24, _ref25, _ref26, _ref27, _csat$enabled, _csat$format, _csat$prompt, _csat$triggerType, _csat$idleTimeoutMins, _csat$followUpEnabled, _csat$followUpPrompt, _behavior$autoPromptE, _behavior$allowFeedba, _behavior$provideCita, _agentConfig$organiza, _cfg$chatFeatures;
|
|
20083
|
+
var _agentConfig$config, _cfg$identity, _cfg$branding, _cfg$typography, _cfg$messages, _cfg$voice, _cfg$onboarding, _cfg$disclaimer, _cfg$csat, _cfg$inactivity, _cfg$behavior, _cfg$security, _cfg$layout, _ref2, _messages$bundles$loc, _messages$bundles, _messages$bundles$en, _messages$bundles2, _ref3, _ref4, _security$domains, _ref5, _ref6, _ref7, _branding$chatbotAvat, _branding$chatbotAvat2, _ref8, _ref9, _ref0, _ref1, _ref10, _ref11, _ref12, _ref13, _typography$headerTex, _identity$subtitle, _identity$showStatus, _identity$statusMode, _identity$officeHours, _ref14, _ref15, _ref16, _ref17, _ref18, _ref19, _inactivity$timeoutVa, _inactivity$timeoutUn, _ref20, _ref21, _ref22, _ref23, _ref24, _ref25, _ref26, _ref27, _csat$enabled, _csat$format, _csat$prompt, _csat$triggerType, _csat$idleTimeoutMins, _csat$followUpEnabled, _csat$followUpPrompt, _behavior$autoPromptE, _behavior$autoPromptQ, _behavior$allowFeedba, _behavior$provideCita, _agentConfig$organiza, _cfg$chatFeatures;
|
|
20042
20084
|
if (!agentConfig) {
|
|
20043
20085
|
return null;
|
|
20044
20086
|
}
|
|
@@ -20133,6 +20175,11 @@
|
|
|
20133
20175
|
csatFollowUpEnabled: (_csat$followUpEnabled = csat.followUpEnabled) !== null && _csat$followUpEnabled !== void 0 ? _csat$followUpEnabled : false,
|
|
20134
20176
|
csatFollowUpPrompt: (_csat$followUpPrompt = csat.followUpPrompt) !== null && _csat$followUpPrompt !== void 0 ? _csat$followUpPrompt : null,
|
|
20135
20177
|
autoPromptEnabled: (_behavior$autoPromptE = behavior.autoPromptEnabled) !== null && _behavior$autoPromptE !== void 0 ? _behavior$autoPromptE : true,
|
|
20178
|
+
// EV-2977: chip face shows the natural follow-up question
|
|
20179
|
+
// (submitText) instead of the title-case label. Display-only
|
|
20180
|
+
// (submit payload untouched). Kill-switch per deployment: set
|
|
20181
|
+
// behavior.autoPromptQuestionDisplay=false to revert to labels.
|
|
20182
|
+
autoPromptQuestionDisplay: (_behavior$autoPromptQ = behavior.autoPromptQuestionDisplay) !== null && _behavior$autoPromptQ !== void 0 ? _behavior$autoPromptQ : true,
|
|
20136
20183
|
allowFeedback: (_behavior$allowFeedba = behavior.allowFeedback) !== null && _behavior$allowFeedba !== void 0 ? _behavior$allowFeedba : true,
|
|
20137
20184
|
// behavior.provideCitations - when false, hide the Sources panel on
|
|
20138
20185
|
// every message and tell the backend to skip citation generation.
|
|
@@ -20430,6 +20477,7 @@
|
|
|
20430
20477
|
onboardingEnabled: widgetConfig.onboardingEnabled,
|
|
20431
20478
|
onResetConversation: resetConversation,
|
|
20432
20479
|
autoPromptEnabled: widgetConfig.autoPromptEnabled,
|
|
20480
|
+
autoPromptQuestionDisplay: widgetConfig.autoPromptQuestionDisplay,
|
|
20433
20481
|
allowFeedback: widgetConfig.allowFeedback,
|
|
20434
20482
|
provideCitations: widgetConfig.provideCitations,
|
|
20435
20483
|
onFeedback: handleMessageFeedback,
|