stream-chat 9.18.1 → 9.19.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.
@@ -19370,7 +19370,7 @@ var BaseSearchSourceBase = class {
19370
19370
  updatePaginationStateFromQuery(result) {
19371
19371
  const { items, next } = result;
19372
19372
  const stateUpdate = {};
19373
- if (next || next === null) {
19373
+ if (Object.prototype.hasOwnProperty.call(result, "next")) {
19374
19374
  stateUpdate.next = next;
19375
19375
  stateUpdate.hasNext = !!next;
19376
19376
  } else {
@@ -20558,8 +20558,8 @@ var TextComposer = class {
20558
20558
  0,
20559
20559
  typeof maxLengthOnEdit === "number" ? maxLengthOnEdit : textBeforeTrim.length
20560
20560
  );
20561
- const expectedCursorPosition = currentText.slice(0, finalSelection.start).length + text.length;
20562
- const cursorPosition = expectedCursorPosition >= finalText.length ? finalText.length : currentText.slice(0, expectedCursorPosition).length;
20561
+ const expectedCursorPosition = finalSelection.start + text.length;
20562
+ const cursorPosition = Math.min(expectedCursorPosition, finalText.length);
20563
20563
  await this.handleChange({
20564
20564
  text: finalText,
20565
20565
  selection: {
@@ -21720,9 +21720,6 @@ var _MessageComposer = class _MessageComposer extends WithSubscriptions {
21720
21720
  get config() {
21721
21721
  return this.configState.getLatestValue();
21722
21722
  }
21723
- updateConfig(config) {
21724
- this.configState.partialNext(mergeWith(this.config, config));
21725
- }
21726
21723
  get contextType() {
21727
21724
  return _MessageComposer.evaluateContextType(this.compositionContext);
21728
21725
  }
@@ -21781,6 +21778,9 @@ var _MessageComposer = class _MessageComposer extends WithSubscriptions {
21781
21778
  const draftWasChanged = !!this.lastChange.draftUpdate && this.lastChange.draftUpdate < this.lastChange.stateUpdate;
21782
21779
  return editedMessageWasUpdated || draftWasChanged || composingMessageFromScratch;
21783
21780
  }
21781
+ updateConfig(config) {
21782
+ this.configState.partialNext(mergeWith(this.config, config));
21783
+ }
21784
21784
  logStateUpdateTimestamp() {
21785
21785
  this.editingAuditState.partialNext({
21786
21786
  lastChange: { ...this.lastChange, stateUpdate: (/* @__PURE__ */ new Date()).getTime() }
@@ -22958,6 +22958,11 @@ var Channel = class {
22958
22958
  }
22959
22959
  }
22960
22960
  this.getClient()._addChannelConfig(state.channel);
22961
+ if (typeof state.channel.config?.shared_locations !== "undefined") {
22962
+ this.messageComposer.updateConfig({
22963
+ location: { enabled: state.channel.config.shared_locations }
22964
+ });
22965
+ }
22961
22966
  const { messageSet } = this._initializeState(state, messageSetToAddToIfDoesNotExist);
22962
22967
  messageSet.pagination = {
22963
22968
  ...messageSet.pagination,
@@ -23470,13 +23475,21 @@ var Channel = class {
23470
23475
  }
23471
23476
  break;
23472
23477
  case "channel.hidden":
23473
- channel.data = { ...channel.data, hidden: true };
23478
+ channel.data = {
23479
+ ...channel.data,
23480
+ blocked: !!event.channel?.blocked,
23481
+ hidden: true
23482
+ };
23474
23483
  if (event.clear_history) {
23475
23484
  channelState.clearMessages();
23476
23485
  }
23477
23486
  break;
23478
23487
  case "channel.visible":
23479
- channel.data = { ...channel.data, hidden: false };
23488
+ channel.data = {
23489
+ ...channel.data,
23490
+ blocked: !!event.channel?.blocked,
23491
+ hidden: false
23492
+ };
23480
23493
  this.getClient().offlineDb?.handleChannelVisibilityEvent({ event });
23481
23494
  break;
23482
23495
  case "user.banned":
@@ -28720,7 +28733,7 @@ var StreamChat = class _StreamChat {
28720
28733
  if (this.userAgent) {
28721
28734
  return this.userAgent;
28722
28735
  }
28723
- const version = "9.18.1";
28736
+ const version = "9.19.1";
28724
28737
  const clientBundle = "node-cjs";
28725
28738
  let userAgentString = "";
28726
28739
  if (this.sdkIdentifier) {