@eshal-bot/chat-widget 0.1.102 → 0.1.104

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-DpoyZhy6.esm.js";import"react";import"react-dom/client";import"react-dom";import"react/jsx-runtime";
@@ -14295,8 +14295,13 @@
14295
14295
  // EV-2351: Unicode ranges for RTL scripts (Arabic, Hebrew, and their
14296
14296
  // Extended-A blocks + Arabic Presentation Forms) and for common LTR scripts.
14297
14297
  // Used by detectTextDirection's "first strong character" scan below.
14298
- const RTL_CHAR_RANGE = /[֐-׿؀-ۿ܀-ݏݐ-ݿࢠ-ࣿיִ-ﭏﭐ-﷿ﹰ-]/;
14299
- const LTR_CHAR_RANGE = /[A-Za-zÀ-ɏͰ-ϿЀ-ӿ]/;
14298
+ const RTL_CHAR_RANGE =
14299
+ // Escaped ON PURPOSE. This copy's bound was always right, but the raw
14300
+ // glyphs did not survive being pasted into the frontend's two copies -
14301
+ // the precomposed U+FB1D arrived as U+05D9 U+05B4, read as the range
14302
+ // U+05B4-U+FB4F. Escapes cannot be mangled that way.
14303
+ /[\u0590-\u05ff\u0600-\u06ff\u0700-\u074f\u0750-\u077f\u08a0-\u08ff\ufb1d-\ufb4f\ufb50-\ufdff\ufe70-\ufeff]/;
14304
+ const LTR_CHAR_RANGE = /[A-Za-z\u00c0-\u024f\u0370-\u03ff\u0400-\u04ff]/;
14300
14305
 
14301
14306
  /**
14302
14307
  * EV-2351: detect the writing direction of a piece of TEXT, not the
@@ -17256,23 +17261,36 @@
17256
17261
  scrollbarWidth: "none",
17257
17262
  msOverflowStyle: "none"
17258
17263
  },
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)))
17264
+ children: suggestions.map((p, index) => {
17265
+ // EV-2993: the chip follows the direction of the string it
17266
+ // actually DISPLAYS - which under EV-2977 is the natural
17267
+ // question (submitText), not the title-case label - falling
17268
+ // back to the configured widget direction only when the text
17269
+ // itself is direction-neutral ("123", a lone "?"). `dir="auto"`
17270
+ // alone was not enough: it hard-defaults neutral text to LTR
17271
+ // and it leaves `text-align` on the container's direction.
17272
+ const displayText = getPromptDisplayText(p, questionDisplay);
17273
+ const chipIsRtl = detectTextDirection(displayText, isRtl);
17274
+ return /*#__PURE__*/jsxRuntimeExports.jsx("button", {
17275
+ type: "button",
17276
+ onClick: () =>
17277
+ // EV-2842: pass the prompt object + position so the click
17278
+ // handler can record telemetry; extra args are ignored by
17279
+ // handlers that only read the submit value.
17280
+ onSuggestionClick(p.submitText || p.text || p, p, index),
17281
+ dir: chipIsRtl ? "rtl" : "ltr",
17282
+ 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"),
17283
+ style: {
17284
+ direction: chipIsRtl ? "rtl" : "ltr",
17285
+ textAlign: chipIsRtl ? "right" : "left",
17286
+ background: "linear-gradient(135deg, ".concat(promptPrimary, " 0%, ").concat(promptPrimary, "dd 100%)"),
17287
+ color: promptTextColor,
17288
+ fontFamily: promptFontFamily,
17289
+ fontSize: promptFontSize
17290
+ },
17291
+ children: displayText
17292
+ }, "".concat(p.text || p, "-").concat(index));
17293
+ })
17276
17294
  }), /*#__PURE__*/jsxRuntimeExports.jsx("button", {
17277
17295
  type: "button",
17278
17296
  onClick: () => scroll("right"),