stream-chat 9.18.0 → 9.19.0

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.
@@ -2754,16 +2754,16 @@ function formatMessage(message) {
2754
2754
  if (!msg) return null;
2755
2755
  return {
2756
2756
  ...msg,
2757
- created_at: message.created_at ? new Date(message.created_at) : /* @__PURE__ */ new Date(),
2758
- deleted_at: message.deleted_at ? new Date(message.deleted_at) : null,
2759
- pinned_at: message.pinned_at ? new Date(message.pinned_at) : null,
2757
+ created_at: msg.created_at ? new Date(msg.created_at) : /* @__PURE__ */ new Date(),
2758
+ deleted_at: msg.deleted_at ? new Date(msg.deleted_at) : null,
2759
+ pinned_at: msg.pinned_at ? new Date(msg.pinned_at) : null,
2760
2760
  reaction_groups: maybeGetReactionGroupsFallback(
2761
- message.reaction_groups,
2762
- message.reaction_counts,
2763
- message.reaction_scores
2761
+ msg.reaction_groups,
2762
+ msg.reaction_counts,
2763
+ msg.reaction_scores
2764
2764
  ),
2765
- status: message.status || "received",
2766
- updated_at: message.updated_at ? new Date(message.updated_at) : /* @__PURE__ */ new Date()
2765
+ status: msg.status || "received",
2766
+ updated_at: msg.updated_at ? new Date(msg.updated_at) : /* @__PURE__ */ new Date()
2767
2767
  };
2768
2768
  };
2769
2769
  return {
@@ -6850,7 +6850,7 @@ var BaseSearchSourceBase = class {
6850
6850
  updatePaginationStateFromQuery(result) {
6851
6851
  const { items, next } = result;
6852
6852
  const stateUpdate = {};
6853
- if (next || next === null) {
6853
+ if (Object.prototype.hasOwnProperty.call(result, "next")) {
6854
6854
  stateUpdate.next = next;
6855
6855
  stateUpdate.hasNext = !!next;
6856
6856
  } else {
@@ -8038,8 +8038,8 @@ var TextComposer = class {
8038
8038
  0,
8039
8039
  typeof maxLengthOnEdit === "number" ? maxLengthOnEdit : textBeforeTrim.length
8040
8040
  );
8041
- const expectedCursorPosition = currentText.slice(0, finalSelection.start).length + text.length;
8042
- const cursorPosition = expectedCursorPosition >= finalText.length ? finalText.length : currentText.slice(0, expectedCursorPosition).length;
8041
+ const expectedCursorPosition = finalSelection.start + text.length;
8042
+ const cursorPosition = Math.min(expectedCursorPosition, finalText.length);
8043
8043
  await this.handleChange({
8044
8044
  text: finalText,
8045
8045
  selection: {
@@ -10950,13 +10950,21 @@ var Channel = class {
10950
10950
  }
10951
10951
  break;
10952
10952
  case "channel.hidden":
10953
- channel.data = { ...channel.data, hidden: true };
10953
+ channel.data = {
10954
+ ...channel.data,
10955
+ blocked: !!event.channel?.blocked,
10956
+ hidden: true
10957
+ };
10954
10958
  if (event.clear_history) {
10955
10959
  channelState.clearMessages();
10956
10960
  }
10957
10961
  break;
10958
10962
  case "channel.visible":
10959
- channel.data = { ...channel.data, hidden: false };
10963
+ channel.data = {
10964
+ ...channel.data,
10965
+ blocked: !!event.channel?.blocked,
10966
+ hidden: false
10967
+ };
10960
10968
  this.getClient().offlineDb?.handleChannelVisibilityEvent({ event });
10961
10969
  break;
10962
10970
  case "user.banned":
@@ -16212,7 +16220,7 @@ var StreamChat = class _StreamChat {
16212
16220
  if (this.userAgent) {
16213
16221
  return this.userAgent;
16214
16222
  }
16215
- const version = "9.18.0";
16223
+ const version = "9.19.0";
16216
16224
  const clientBundle = "browser-cjs";
16217
16225
  let userAgentString = "";
16218
16226
  if (this.sdkIdentifier) {