stream-chat-react 10.8.0 → 10.8.1

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
- {"version":3,"file":"Textarea.d.ts","sourceRoot":"","sources":["../../../src/components/AutoCompleteTextarea/Textarea.jsx"],"names":[],"mappings":"AAkBA;IACE;;;;;;;MAOE;IA2WF;;OAEG;IACH;;;aAMC;IAlXD,wBA4BC;IAZC;;;;;;;;;;;MAWC;IAGH;;;aAOE;IAEF,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,yCAiBE;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;IA2WF;;OAEG;IACH;;;aAMC;IAlXD,wBA4BC;IAZC;;;;;;;;;;;MAWC;IAGH;;;aAOE;IAEF,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"}
@@ -45,6 +45,7 @@ import { List as DefaultSuggestionList } from './List';
45
45
  import { DEFAULT_CARET_POSITION, defaultScrollToItem, errorMessage, triggerPropsCheck, } from './utils';
46
46
  import { CommandItem } from '../CommandItem';
47
47
  import { UserItem } from '../UserItem';
48
+ import { isSafari } from '../../utils/browsers';
48
49
  var ReactTextareaAutocomplete = /** @class */ (function (_super) {
49
50
  __extends(ReactTextareaAutocomplete, _super);
50
51
  function ReactTextareaAutocomplete(props) {
@@ -445,7 +446,14 @@ var ReactTextareaAutocomplete = /** @class */ (function (_super) {
445
446
  // that was actually clicked. If we clicked inside the auto-select dropdown, then
446
447
  // that's not a blur, from the auto-select point of view, so then do nothing.
447
448
  var el = e.relatedTarget;
448
- if (_this.dropdownRef && el instanceof Node && _this.dropdownRef.contains(el)) {
449
+ // If this is a blur event in Safari, then relatedTarget is never a dropdown item, but a common parent
450
+ // of textarea and dropdown container. That means that dropdownRef will not contain its parent and the
451
+ // autocomplete will be closed before onclick handler can be invoked selecting an item.
452
+ // It seems that Safari has different implementation determining the relatedTarget node than Chrome and Firefox.
453
+ // Therefore, if focused away in Safari, the dropdown will be kept rendered until pressing Esc or selecting and item from it.
454
+ var focusedAwayInSafari = isSafari() && e.type === 'blur';
455
+ if ((_this.dropdownRef && el instanceof Node && _this.dropdownRef.contains(el)) ||
456
+ focusedAwayInSafari) {
449
457
  return;
450
458
  }
451
459
  if (closeOnClickOutside)
package/dist/index.cjs.js CHANGED
@@ -24211,6 +24211,12 @@ var UnMemoizedUserItem = function (_a) {
24211
24211
  };
24212
24212
  var UserItem = React__default["default"].memo(UnMemoizedUserItem);
24213
24213
 
24214
+ var isSafari = function () {
24215
+ if (typeof navigator === 'undefined')
24216
+ return false;
24217
+ return /^((?!chrome|android).)*safari/i.test(navigator.userAgent || '');
24218
+ };
24219
+
24214
24220
  var _excluded$1 = ["onBlur", "onChange", "onClick", "onFocus", "onKeyDown", "onScroll", "onSelect"];
24215
24221
  function ownKeys$2(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
24216
24222
  function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$2(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$2(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
@@ -24588,7 +24594,13 @@ var ReactTextareaAutocomplete = /*#__PURE__*/function (_React$Component) {
24588
24594
  // that was actually clicked. If we clicked inside the auto-select dropdown, then
24589
24595
  // that's not a blur, from the auto-select point of view, so then do nothing.
24590
24596
  var el = e.relatedTarget;
24591
- if (_this.dropdownRef && el instanceof Node && _this.dropdownRef.contains(el)) {
24597
+ // If this is a blur event in Safari, then relatedTarget is never a dropdown item, but a common parent
24598
+ // of textarea and dropdown container. That means that dropdownRef will not contain its parent and the
24599
+ // autocomplete will be closed before onclick handler can be invoked selecting an item.
24600
+ // It seems that Safari has different implementation determining the relatedTarget node than Chrome and Firefox.
24601
+ // Therefore, if focused away in Safari, the dropdown will be kept rendered until pressing Esc or selecting and item from it.
24602
+ var focusedAwayInSafari = isSafari() && e.type === 'blur';
24603
+ if (_this.dropdownRef && el instanceof Node && _this.dropdownRef.contains(el) || focusedAwayInSafari) {
24592
24604
  return;
24593
24605
  }
24594
24606
  if (closeOnClickOutside) _this._closeAutocomplete();
@@ -33764,7 +33776,7 @@ var UnMemoizedChannelList = function (props) {
33764
33776
  */
33765
33777
  var ChannelList = React__default["default"].memo(UnMemoizedChannelList);
33766
33778
 
33767
- var version = '10.8.0';
33779
+ var version = '10.8.1';
33768
33780
 
33769
33781
  var useChat = function (_a) {
33770
33782
  var _b, _c;