@eshal-bot/chat-widget 0.1.102 → 0.1.103

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.
@@ -1 +1 @@
1
- export{S as default}from"./chat-widget-index-BcPgyNKZ.esm.js";import"react";import"react-dom/client";import"react-dom";import"react/jsx-runtime";
1
+ export{S as default}from"./chat-widget-index-2LNAzlMS.esm.js";import"react";import"react-dom/client";import"react-dom";import"react/jsx-runtime";
@@ -17256,23 +17256,36 @@
17256
17256
  scrollbarWidth: "none",
17257
17257
  msOverflowStyle: "none"
17258
17258
  },
17259
- children: suggestions.map((p, index) => /*#__PURE__*/jsxRuntimeExports.jsx("button", {
17260
- type: "button",
17261
- onClick: () =>
17262
- // EV-2842: pass the prompt object + position so the click
17263
- // handler can record telemetry; extra args are ignored by
17264
- // handlers that only read the submit value.
17265
- onSuggestionClick(p.submitText || p.text || p, p, index),
17266
- dir: "auto",
17267
- className: "inline-flex items-center rounded-full px-4 py-1.5 whitespace-nowrap flex-shrink-0 border-0 transition-transform duration-150 active:scale-95",
17268
- style: {
17269
- background: "linear-gradient(135deg, ".concat(promptPrimary, " 0%, ").concat(promptPrimary, "dd 100%)"),
17270
- color: promptTextColor,
17271
- fontFamily: promptFontFamily,
17272
- fontSize: promptFontSize
17273
- },
17274
- children: getPromptDisplayText(p, questionDisplay)
17275
- }, "".concat(p.text || p, "-").concat(index)))
17259
+ children: suggestions.map((p, index) => {
17260
+ // EV-2993: the chip follows the direction of the string it
17261
+ // actually DISPLAYS - which under EV-2977 is the natural
17262
+ // question (submitText), not the title-case label - falling
17263
+ // back to the configured widget direction only when the text
17264
+ // itself is direction-neutral ("123", a lone "?"). `dir="auto"`
17265
+ // alone was not enough: it hard-defaults neutral text to LTR
17266
+ // and it leaves `text-align` on the container's direction.
17267
+ const displayText = getPromptDisplayText(p, questionDisplay);
17268
+ const chipIsRtl = detectTextDirection(displayText, isRtl);
17269
+ return /*#__PURE__*/jsxRuntimeExports.jsx("button", {
17270
+ type: "button",
17271
+ onClick: () =>
17272
+ // EV-2842: pass the prompt object + position so the click
17273
+ // handler can record telemetry; extra args are ignored by
17274
+ // handlers that only read the submit value.
17275
+ onSuggestionClick(p.submitText || p.text || p, p, index),
17276
+ dir: chipIsRtl ? "rtl" : "ltr",
17277
+ className: "inline-flex items-center rounded-full px-4 py-1.5 whitespace-nowrap flex-shrink-0 border-0 transition-transform duration-150 active:scale-95 ".concat(chipIsRtl ? "text-right" : "text-left"),
17278
+ style: {
17279
+ direction: chipIsRtl ? "rtl" : "ltr",
17280
+ textAlign: chipIsRtl ? "right" : "left",
17281
+ background: "linear-gradient(135deg, ".concat(promptPrimary, " 0%, ").concat(promptPrimary, "dd 100%)"),
17282
+ color: promptTextColor,
17283
+ fontFamily: promptFontFamily,
17284
+ fontSize: promptFontSize
17285
+ },
17286
+ children: displayText
17287
+ }, "".concat(p.text || p, "-").concat(index));
17288
+ })
17276
17289
  }), /*#__PURE__*/jsxRuntimeExports.jsx("button", {
17277
17290
  type: "button",
17278
17291
  onClick: () => scroll("right"),