stream-chat-react 10.22.1 → 10.22.3

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.
@@ -10886,7 +10886,16 @@ var StreamChatReact = (function (exports, React$2, streamChat, ReactDOM) {
10886
10886
 
10887
10887
  var ImageGallery = /*@__PURE__*/getDefaultExportFromCjs(imageGallery.exports);
10888
10888
 
10889
- window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};var ModalGallery = function (props) {
10889
+ window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};var onError = function (e) {
10890
+ // Prevent having alt attribute on img as the img takes the height of the alt text
10891
+ // instead of the CSS / element width & height when the CSS mask (fallback) is applied.
10892
+ e.target.alt = '';
10893
+ };
10894
+ var renderItem = function (_a) {
10895
+ var original = _a.original, originalAlt = _a.originalAlt;
10896
+ return (React__default["default"].createElement(BaseImage, { alt: originalAlt, className: 'image-gallery-image', onError: onError, src: original }));
10897
+ };
10898
+ var ModalGallery = function (props) {
10890
10899
  var images = props.images, index = props.index;
10891
10900
  var t = useTranslationContext('ModalGallery').t;
10892
10901
  var formattedArray = React$2.useMemo(function () {
@@ -10899,7 +10908,7 @@ var StreamChatReact = (function (exports, React$2, streamChat, ReactDOM) {
10899
10908
  };
10900
10909
  });
10901
10910
  }, [images]);
10902
- return (React__default["default"].createElement(ImageGallery, { items: formattedArray, showIndex: true, showPlayButton: false, showThumbnails: false, startIndex: index }));
10911
+ return (React__default["default"].createElement(ImageGallery, { items: formattedArray, renderItem: renderItem, showIndex: true, showPlayButton: false, showThumbnails: false, startIndex: index }));
10903
10912
  };
10904
10913
 
10905
10914
  window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};var UnMemoizedGallery = function (props) {
@@ -38632,6 +38641,7 @@ var StreamChatReact = (function (exports, React$2, streamChat, ReactDOM) {
38632
38641
  currentTrigger: null,
38633
38642
  data: null,
38634
38643
  dataLoading: false,
38644
+ isComposing: false,
38635
38645
  left: null,
38636
38646
  selectionEnd: 0,
38637
38647
  selectionStart: 0,
@@ -38655,22 +38665,21 @@ var StreamChatReact = (function (exports, React$2, streamChat, ReactDOM) {
38655
38665
  SuggestionItem = _this$props7.SuggestionItem,
38656
38666
  _this$props7$Suggesti = _this$props7.SuggestionList,
38657
38667
  SuggestionList = _this$props7$Suggesti === void 0 ? List$1 : _this$props7$Suggesti;
38668
+ var isComposing = this.state.isComposing;
38658
38669
  var triggerProps = this.getTriggerProps();
38659
- if (triggerProps.values && triggerProps.currentTrigger && !(disableMentions && triggerProps.currentTrigger === '@')) {
38660
- return /*#__PURE__*/React__default["default"].createElement("div", {
38661
- className: clsx('rta__autocomplete', 'str-chat__suggestion-list-container', dropdownClassName),
38662
- ref: this.setDropdownRef,
38663
- style: dropdownStyle
38664
- }, /*#__PURE__*/React__default["default"].createElement(SuggestionList, _extendsExports({
38665
- className: clsx('str-chat__suggestion-list', listClassName),
38666
- dropdownScroll: this._dropdownScroll,
38667
- itemClassName: clsx('str-chat__suggestion-list-item', itemClassName),
38668
- itemStyle: itemStyle,
38669
- onSelect: this._onSelect,
38670
- SuggestionItem: SuggestionItem
38671
- }, triggerProps)));
38672
- }
38673
- return null;
38670
+ if (isComposing || !triggerProps.values || !triggerProps.currentTrigger || disableMentions && triggerProps.currentTrigger === '@') return null;
38671
+ return /*#__PURE__*/React__default["default"].createElement("div", {
38672
+ className: clsx('rta__autocomplete', 'str-chat__suggestion-list-container', dropdownClassName),
38673
+ ref: this.setDropdownRef,
38674
+ style: dropdownStyle
38675
+ }, /*#__PURE__*/React__default["default"].createElement(SuggestionList, _extendsExports({
38676
+ className: clsx('str-chat__suggestion-list', listClassName),
38677
+ dropdownScroll: this._dropdownScroll,
38678
+ itemClassName: clsx('str-chat__suggestion-list-item', itemClassName),
38679
+ itemStyle: itemStyle,
38680
+ onSelect: this._onSelect,
38681
+ SuggestionItem: SuggestionItem
38682
+ }, triggerProps)));
38674
38683
  }
38675
38684
  }, {
38676
38685
  key: "render",
@@ -38722,6 +38731,20 @@ var StreamChatReact = (function (exports, React$2, streamChat, ReactDOM) {
38722
38731
  _this2._onClickAndBlurHandler(e);
38723
38732
  _onClick === null || _onClick === void 0 ? void 0 : _onClick(e);
38724
38733
  },
38734
+ onCompositionEnd: function onCompositionEnd() {
38735
+ return _this2.setState(function (pv) {
38736
+ return _objectSpread(_objectSpread({}, pv), {}, {
38737
+ isComposing: false
38738
+ });
38739
+ });
38740
+ },
38741
+ onCompositionStart: function onCompositionStart() {
38742
+ return _this2.setState(function (pv) {
38743
+ return _objectSpread(_objectSpread({}, pv), {}, {
38744
+ isComposing: true
38745
+ });
38746
+ });
38747
+ },
38725
38748
  onFocus: function onFocus(e) {
38726
38749
  var _this2$props$onFocus, _this2$props;
38727
38750
  (_this2$props$onFocus = (_this2$props = _this2.props).onFocus) === null || _this2$props$onFocus === void 0 ? void 0 : _this2$props$onFocus.call(_this2$props, e);
@@ -47781,7 +47804,7 @@ var StreamChatReact = (function (exports, React$2, streamChat, ReactDOM) {
47781
47804
 
47782
47805
  window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};
47783
47806
 
47784
- window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};var version$1 = '10.22.1';
47807
+ window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};var version$1 = '10.22.3';
47785
47808
 
47786
47809
  window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};var useChat = function (_a) {
47787
47810
  var _b, _c;