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.
package/dist/esm/index.js CHANGED
@@ -7800,7 +7800,7 @@ var BaseSearchSourceBase = class {
7800
7800
  updatePaginationStateFromQuery(result) {
7801
7801
  const { items, next } = result;
7802
7802
  const stateUpdate = {};
7803
- if (next || next === null) {
7803
+ if (Object.prototype.hasOwnProperty.call(result, "next")) {
7804
7804
  stateUpdate.next = next;
7805
7805
  stateUpdate.hasNext = !!next;
7806
7806
  } else {
@@ -8988,8 +8988,8 @@ var TextComposer = class {
8988
8988
  0,
8989
8989
  typeof maxLengthOnEdit === "number" ? maxLengthOnEdit : textBeforeTrim.length
8990
8990
  );
8991
- const expectedCursorPosition = currentText.slice(0, finalSelection.start).length + text.length;
8992
- const cursorPosition = expectedCursorPosition >= finalText.length ? finalText.length : currentText.slice(0, expectedCursorPosition).length;
8991
+ const expectedCursorPosition = finalSelection.start + text.length;
8992
+ const cursorPosition = Math.min(expectedCursorPosition, finalText.length);
8993
8993
  await this.handleChange({
8994
8994
  text: finalText,
8995
8995
  selection: {
@@ -10150,9 +10150,6 @@ var _MessageComposer = class _MessageComposer extends WithSubscriptions {
10150
10150
  get config() {
10151
10151
  return this.configState.getLatestValue();
10152
10152
  }
10153
- updateConfig(config) {
10154
- this.configState.partialNext(mergeWith(this.config, config));
10155
- }
10156
10153
  get contextType() {
10157
10154
  return _MessageComposer.evaluateContextType(this.compositionContext);
10158
10155
  }
@@ -10211,6 +10208,9 @@ var _MessageComposer = class _MessageComposer extends WithSubscriptions {
10211
10208
  const draftWasChanged = !!this.lastChange.draftUpdate && this.lastChange.draftUpdate < this.lastChange.stateUpdate;
10212
10209
  return editedMessageWasUpdated || draftWasChanged || composingMessageFromScratch;
10213
10210
  }
10211
+ updateConfig(config) {
10212
+ this.configState.partialNext(mergeWith(this.config, config));
10213
+ }
10214
10214
  logStateUpdateTimestamp() {
10215
10215
  this.editingAuditState.partialNext({
10216
10216
  lastChange: { ...this.lastChange, stateUpdate: (/* @__PURE__ */ new Date()).getTime() }
@@ -11388,6 +11388,11 @@ var Channel = class {
11388
11388
  }
11389
11389
  }
11390
11390
  this.getClient()._addChannelConfig(state.channel);
11391
+ if (typeof state.channel.config?.shared_locations !== "undefined") {
11392
+ this.messageComposer.updateConfig({
11393
+ location: { enabled: state.channel.config.shared_locations }
11394
+ });
11395
+ }
11391
11396
  const { messageSet } = this._initializeState(state, messageSetToAddToIfDoesNotExist);
11392
11397
  messageSet.pagination = {
11393
11398
  ...messageSet.pagination,
@@ -11900,13 +11905,21 @@ var Channel = class {
11900
11905
  }
11901
11906
  break;
11902
11907
  case "channel.hidden":
11903
- channel.data = { ...channel.data, hidden: true };
11908
+ channel.data = {
11909
+ ...channel.data,
11910
+ blocked: !!event.channel?.blocked,
11911
+ hidden: true
11912
+ };
11904
11913
  if (event.clear_history) {
11905
11914
  channelState.clearMessages();
11906
11915
  }
11907
11916
  break;
11908
11917
  case "channel.visible":
11909
- channel.data = { ...channel.data, hidden: false };
11918
+ channel.data = {
11919
+ ...channel.data,
11920
+ blocked: !!event.channel?.blocked,
11921
+ hidden: false
11922
+ };
11910
11923
  this.getClient().offlineDb?.handleChannelVisibilityEvent({ event });
11911
11924
  break;
11912
11925
  case "user.banned":
@@ -17162,7 +17175,7 @@ var StreamChat = class _StreamChat {
17162
17175
  if (this.userAgent) {
17163
17176
  return this.userAgent;
17164
17177
  }
17165
- const version = "9.18.1";
17178
+ const version = "9.19.1";
17166
17179
  const clientBundle = "browser-esm";
17167
17180
  let userAgentString = "";
17168
17181
  if (this.sdkIdentifier) {