@eshal-bot/chat-widget 0.1.110 → 0.1.111

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-BeabB7Lu.esm.js";import"react";import"react-dom/client";import"react-dom";import"react/jsx-runtime";
1
+ export{S as default}from"./chat-widget-index-CiAFsZbh.esm.js";import"react";import"react-dom/client";import"react-dom";import"react/jsx-runtime";
@@ -9054,6 +9054,33 @@
9054
9054
  return question && question !== label ? question : label;
9055
9055
  };
9056
9056
 
9057
+ /**
9058
+ * EV-3014: the chip-strip scroll-edge math, identical (down to the
9059
+ * `Math.abs`/`- 1` tolerance) across the widget's PromptSuggestionsRow,
9060
+ * the Testing Lab preview's PromptSuggestionsBar, and the SDK's
9061
+ * FollowUpPromptsBar — three independent copies before this, one of the
9062
+ * concerns EV-2993 flagged as having "already diverged once" for the
9063
+ * chip strip generally. `Math.abs(scrollLeft)` is required because an
9064
+ * RTL container's `scrollLeft` counts DOWN from 0 rather than up.
9065
+ *
9066
+ * Extracted so each surface's copy has a name to be tested against
9067
+ * instead of re-deriving the same arithmetic — see
9068
+ * chipStripScrollParity.test.ts, which drives this export plus the
9069
+ * frontend preview's and the SDK's local equivalents through the same
9070
+ * matrix.
9071
+ *
9072
+ * @param {number} scrollLeft
9073
+ * @param {number} scrollWidth
9074
+ * @param {number} clientWidth
9075
+ * @returns {{atStart: boolean, atEnd: boolean}}
9076
+ */
9077
+ const computeChipScrollState = (scrollLeft, scrollWidth, clientWidth) => {
9078
+ return {
9079
+ atStart: Math.abs(scrollLeft) <= 1,
9080
+ atEnd: Math.abs(scrollLeft) + clientWidth >= scrollWidth - 1
9081
+ };
9082
+ };
9083
+
9057
9084
  /**
9058
9085
  * Constructs the voice WebSocket base URL.
9059
9086
  *
@@ -17317,8 +17344,12 @@
17317
17344
  scrollWidth,
17318
17345
  clientWidth
17319
17346
  } = el;
17320
- setCanScrollToStart(Math.abs(scrollLeft) > 1);
17321
- setCanScrollToEnd(Math.abs(scrollLeft) + clientWidth < scrollWidth - 1);
17347
+ const {
17348
+ atStart,
17349
+ atEnd
17350
+ } = computeChipScrollState(scrollLeft, scrollWidth, clientWidth);
17351
+ setCanScrollToStart(!atStart);
17352
+ setCanScrollToEnd(!atEnd);
17322
17353
  }, []);
17323
17354
  reactExports.useEffect(() => {
17324
17355
  updateScrollState();