stream-chat-react 10.22.2 → 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.
@@ -21,6 +21,7 @@ export class ReactTextareaAutocomplete extends React.Component<any, any, any> {
21
21
  currentTrigger: null;
22
22
  data: null;
23
23
  dataLoading: boolean;
24
+ isComposing: boolean;
24
25
  left: null;
25
26
  selectionEnd: number;
26
27
  selectionStart: number;
@@ -1 +1 @@
1
- {"version":3,"file":"Textarea.d.ts","sourceRoot":"","sources":["../../../src/components/AutoCompleteTextarea/Textarea.jsx"],"names":[],"mappings":"AAmBA;IACE;;;;;;;MAOE;IA6WF;;OAEG;IACH;;;aAMC;IApXD,wBA4BC;IAZC;;;;;;;;;;;MAWC;IAIH;;;aAOE;IAGF,2BAOE;IAEF,8CAKE;IAEF,+BAIE;IAEF;;;;;;OAMG;IACH,8CAC6E;IAE7E,qCAUE;IAEF,+BAcE;IAEF,qBAQE;IAEF,yBA6BE;IAEF,mCAqEE;IAEF,qEAuBE;IAEF,sEA2DE;IAEF,uDAQE;IAEF,mCA0CE;IAEF,6CAQE;IAYF;;OAEG;IACH,+BAQE;IAEF;;MA6CE;IAEF,mCAME;IAEF,iCA+EE;IAEF,iCASE;IAGF,yCA0BE;IAEF,6BAAmD;IAEnD,qCAiBE;IAEF;;;;;;;;MAoCE;IAEF,uCAEE;IADA,iBAA0B;IAG5B,oDA2CC;IAED,sBA2EC;IATS,oDAAsB;CAUjC"}
1
+ {"version":3,"file":"Textarea.d.ts","sourceRoot":"","sources":["../../../src/components/AutoCompleteTextarea/Textarea.jsx"],"names":[],"mappings":"AAmBA;IACE;;;;;;;MAOE;IA8WF;;OAEG;IACH;;;aAMC;IArXD,wBA6BC;IAbC;;;;;;;;;;;;MAYC;IAIH;;;aAOE;IAGF,2BAOE;IAEF,8CAKE;IAEF,+BAIE;IAEF;;;;;;OAMG;IACH,8CAC6E;IAE7E,qCAUE;IAEF,+BAcE;IAEF,qBAQE;IAEF,yBA6BE;IAEF,mCAqEE;IAEF,qEAuBE;IAEF,sEA2DE;IAEF,uDAQE;IAEF,mCA0CE;IAEF,6CAQE;IAYF;;OAEG;IACH,+BAQE;IAEF;;MA6CE;IAEF,mCAME;IAEF,iCA+EE;IAEF,iCASE;IAGF,yCA0BE;IAEF,6BAAmD;IAEnD,qCAiBE;IAEF;;;;;;;;MAoCE;IAEF,uCAEE;IADA,iBAA0B;IAG5B,oDA6CC;IAED,sBA6EC;IATS,oDAAsB;CAUjC"}
@@ -492,6 +492,7 @@ var ReactTextareaAutocomplete = /** @class */ (function (_super) {
492
492
  currentTrigger: null,
493
493
  data: null,
494
494
  dataLoading: false,
495
+ isComposing: false,
495
496
  left: null,
496
497
  selectionEnd: 0,
497
498
  selectionStart: 0,
@@ -513,14 +514,15 @@ var ReactTextareaAutocomplete = /** @class */ (function (_super) {
513
514
  };
514
515
  ReactTextareaAutocomplete.prototype.renderSuggestionListContainer = function () {
515
516
  var _a = this.props, disableMentions = _a.disableMentions, dropdownClassName = _a.dropdownClassName, dropdownStyle = _a.dropdownStyle, itemClassName = _a.itemClassName, itemStyle = _a.itemStyle, listClassName = _a.listClassName, SuggestionItem = _a.SuggestionItem, _b = _a.SuggestionList, SuggestionList = _b === void 0 ? DefaultSuggestionList : _b;
517
+ var isComposing = this.state.isComposing;
516
518
  var triggerProps = this.getTriggerProps();
517
- if (triggerProps.values &&
518
- triggerProps.currentTrigger &&
519
- !(disableMentions && triggerProps.currentTrigger === '@')) {
520
- return (React.createElement("div", { className: clsx('rta__autocomplete', 'str-chat__suggestion-list-container', dropdownClassName), ref: this.setDropdownRef, style: dropdownStyle },
521
- React.createElement(SuggestionList, __assign({ className: clsx('str-chat__suggestion-list', listClassName), dropdownScroll: this._dropdownScroll, itemClassName: clsx('str-chat__suggestion-list-item', itemClassName), itemStyle: itemStyle, onSelect: this._onSelect, SuggestionItem: SuggestionItem }, triggerProps))));
522
- }
523
- return null;
519
+ if (isComposing ||
520
+ !triggerProps.values ||
521
+ !triggerProps.currentTrigger ||
522
+ (disableMentions && triggerProps.currentTrigger === '@'))
523
+ return null;
524
+ return (React.createElement("div", { className: clsx('rta__autocomplete', 'str-chat__suggestion-list-container', dropdownClassName), ref: this.setDropdownRef, style: dropdownStyle },
525
+ React.createElement(SuggestionList, __assign({ className: clsx('str-chat__suggestion-list', listClassName), dropdownScroll: this._dropdownScroll, itemClassName: clsx('str-chat__suggestion-list-item', itemClassName), itemStyle: itemStyle, onSelect: this._onSelect, SuggestionItem: SuggestionItem }, triggerProps))));
524
526
  };
525
527
  ReactTextareaAutocomplete.prototype.render = function () {
526
528
  var _this = this;
@@ -546,7 +548,7 @@ var ReactTextareaAutocomplete = /** @class */ (function (_super) {
546
548
  }, onClick: function (e) {
547
549
  _this._onClickAndBlurHandler(e);
548
550
  onClick === null || onClick === void 0 ? void 0 : onClick(e);
549
- }, onFocus: function (e) {
551
+ }, onCompositionEnd: function () { return _this.setState(function (pv) { return (__assign(__assign({}, pv), { isComposing: false })); }); }, onCompositionStart: function () { return _this.setState(function (pv) { return (__assign(__assign({}, pv), { isComposing: true })); }); }, onFocus: function (e) {
550
552
  var _a, _b;
551
553
  (_b = (_a = _this.props).onFocus) === null || _b === void 0 ? void 0 : _b.call(_a, e);
552
554
  onFocus === null || onFocus === void 0 ? void 0 : onFocus(e);
package/dist/index.cjs.js CHANGED
@@ -27167,6 +27167,7 @@ var ReactTextareaAutocomplete = /*#__PURE__*/function (_React$Component) {
27167
27167
  currentTrigger: null,
27168
27168
  data: null,
27169
27169
  dataLoading: false,
27170
+ isComposing: false,
27170
27171
  left: null,
27171
27172
  selectionEnd: 0,
27172
27173
  selectionStart: 0,
@@ -27190,22 +27191,21 @@ var ReactTextareaAutocomplete = /*#__PURE__*/function (_React$Component) {
27190
27191
  SuggestionItem = _this$props7.SuggestionItem,
27191
27192
  _this$props7$Suggesti = _this$props7.SuggestionList,
27192
27193
  SuggestionList = _this$props7$Suggesti === void 0 ? List : _this$props7$Suggesti;
27194
+ var isComposing = this.state.isComposing;
27193
27195
  var triggerProps = this.getTriggerProps();
27194
- if (triggerProps.values && triggerProps.currentTrigger && !(disableMentions && triggerProps.currentTrigger === '@')) {
27195
- return /*#__PURE__*/React__default["default"].createElement("div", {
27196
- className: clsx('rta__autocomplete', 'str-chat__suggestion-list-container', dropdownClassName),
27197
- ref: this.setDropdownRef,
27198
- style: dropdownStyle
27199
- }, /*#__PURE__*/React__default["default"].createElement(SuggestionList, _extends__default["default"]({
27200
- className: clsx('str-chat__suggestion-list', listClassName),
27201
- dropdownScroll: this._dropdownScroll,
27202
- itemClassName: clsx('str-chat__suggestion-list-item', itemClassName),
27203
- itemStyle: itemStyle,
27204
- onSelect: this._onSelect,
27205
- SuggestionItem: SuggestionItem
27206
- }, triggerProps)));
27207
- }
27208
- return null;
27196
+ if (isComposing || !triggerProps.values || !triggerProps.currentTrigger || disableMentions && triggerProps.currentTrigger === '@') return null;
27197
+ return /*#__PURE__*/React__default["default"].createElement("div", {
27198
+ className: clsx('rta__autocomplete', 'str-chat__suggestion-list-container', dropdownClassName),
27199
+ ref: this.setDropdownRef,
27200
+ style: dropdownStyle
27201
+ }, /*#__PURE__*/React__default["default"].createElement(SuggestionList, _extends__default["default"]({
27202
+ className: clsx('str-chat__suggestion-list', listClassName),
27203
+ dropdownScroll: this._dropdownScroll,
27204
+ itemClassName: clsx('str-chat__suggestion-list-item', itemClassName),
27205
+ itemStyle: itemStyle,
27206
+ onSelect: this._onSelect,
27207
+ SuggestionItem: SuggestionItem
27208
+ }, triggerProps)));
27209
27209
  }
27210
27210
  }, {
27211
27211
  key: "render",
@@ -27257,6 +27257,20 @@ var ReactTextareaAutocomplete = /*#__PURE__*/function (_React$Component) {
27257
27257
  _this2._onClickAndBlurHandler(e);
27258
27258
  _onClick === null || _onClick === void 0 ? void 0 : _onClick(e);
27259
27259
  },
27260
+ onCompositionEnd: function onCompositionEnd() {
27261
+ return _this2.setState(function (pv) {
27262
+ return _objectSpread(_objectSpread({}, pv), {}, {
27263
+ isComposing: false
27264
+ });
27265
+ });
27266
+ },
27267
+ onCompositionStart: function onCompositionStart() {
27268
+ return _this2.setState(function (pv) {
27269
+ return _objectSpread(_objectSpread({}, pv), {}, {
27270
+ isComposing: true
27271
+ });
27272
+ });
27273
+ },
27260
27274
  onFocus: function onFocus(e) {
27261
27275
  var _this2$props$onFocus, _this2$props;
27262
27276
  (_this2$props$onFocus = (_this2$props = _this2.props).onFocus) === null || _this2$props$onFocus === void 0 ? void 0 : _this2$props$onFocus.call(_this2$props, e);
@@ -35169,7 +35183,7 @@ var UnMemoizedChannelList = function (props) {
35169
35183
  */
35170
35184
  var ChannelList = React__default["default"].memo(UnMemoizedChannelList);
35171
35185
 
35172
- var version = '10.22.2';
35186
+ var version = '10.22.3';
35173
35187
 
35174
35188
  var useChat = function (_a) {
35175
35189
  var _b, _c;