stream-chat 9.30.0 → 9.31.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.
@@ -6980,10 +6980,12 @@ var initState6 = (composition) => {
6980
6980
  id: MessageComposer.generateId(),
6981
6981
  pollId: null,
6982
6982
  quotedMessage: null,
6983
- showReplyInChannel: false
6983
+ showReplyInChannel: false,
6984
+ editedMessage: null
6984
6985
  };
6985
6986
  }
6986
6987
  const quotedMessage = composition.quoted_message;
6988
+ const editedMessage = compositionIsDraftResponse(composition) ? null : formatMessage(composition);
6987
6989
  let message;
6988
6990
  let draftId = null;
6989
6991
  let id = MessageComposer.generateId();
@@ -6999,7 +7001,8 @@ var initState6 = (composition) => {
6999
7001
  id,
7000
7002
  pollId: message.poll_id ?? null,
7001
7003
  quotedMessage: quotedMessage ? formatMessage(quotedMessage) : null,
7002
- showReplyInChannel: false
7004
+ showReplyInChannel: false,
7005
+ editedMessage
7003
7006
  };
7004
7007
  };
7005
7008
  var _MessageComposer = class _MessageComposer extends WithSubscriptions {
@@ -7011,6 +7014,9 @@ var _MessageComposer = class _MessageComposer extends WithSubscriptions {
7011
7014
  client
7012
7015
  }) {
7013
7016
  super();
7017
+ this.setEditedMessage = (editedMessage) => {
7018
+ this.state.partialNext({ editedMessage: editedMessage ?? null });
7019
+ };
7014
7020
  this.refreshId = () => {
7015
7021
  this.state.partialNext({ id: _MessageComposer.generateId() });
7016
7022
  };
@@ -7026,9 +7032,6 @@ var _MessageComposer = class _MessageComposer extends WithSubscriptions {
7026
7032
  this.pollComposer.initState();
7027
7033
  this.customDataManager.initState({ message });
7028
7034
  this.state.next(initState6(composition));
7029
- if (composition && !compositionIsDraftResponse(composition) && message && isLocalMessage(message)) {
7030
- this.editedMessage = message;
7031
- }
7032
7035
  };
7033
7036
  this.initStateFromChannelResponse = (channelApiResponse) => {
7034
7037
  if (this.channel.cid !== channelApiResponse.channel.cid) {
@@ -7445,7 +7448,6 @@ var _MessageComposer = class _MessageComposer extends WithSubscriptions {
7445
7448
  message = composition.message;
7446
7449
  } else if (composition) {
7447
7450
  message = formatMessage(composition);
7448
- this.editedMessage = message;
7449
7451
  }
7450
7452
  this.attachmentManager = new AttachmentManager({ composer: this, message });
7451
7453
  this.linkPreviewsManager = new LinkPreviewsManager({ composer: this, message });
@@ -7482,6 +7484,12 @@ var _MessageComposer = class _MessageComposer extends WithSubscriptions {
7482
7484
  get config() {
7483
7485
  return this.configState.getLatestValue();
7484
7486
  }
7487
+ get editedMessage() {
7488
+ return this.state.getLatestValue().editedMessage ?? void 0;
7489
+ }
7490
+ set editedMessage(editedMessage) {
7491
+ this.state.partialNext({ editedMessage: editedMessage ?? null });
7492
+ }
7485
7493
  get contextType() {
7486
7494
  return _MessageComposer.evaluateContextType(this.compositionContext);
7487
7495
  }
@@ -11091,14 +11099,17 @@ var Moderation = class {
11091
11099
  * @returns
11092
11100
  */
11093
11101
  async check(entityType, entityID, entityCreatorID, moderationPayload, configKey, options) {
11094
- return await this.client.post(this.client.baseURL + `/api/v2/moderation/check`, {
11095
- entity_type: entityType,
11096
- entity_id: entityID,
11097
- entity_creator_id: entityCreatorID,
11098
- moderation_payload: moderationPayload,
11099
- config_key: configKey,
11100
- options
11101
- });
11102
+ return await this.client.post(
11103
+ this.client.baseURL + `/api/v2/moderation/check`,
11104
+ {
11105
+ entity_type: entityType,
11106
+ entity_id: entityID,
11107
+ entity_creator_id: entityCreatorID,
11108
+ moderation_payload: moderationPayload,
11109
+ config_key: configKey,
11110
+ options
11111
+ }
11112
+ );
11102
11113
  }
11103
11114
  /**
11104
11115
  * Experimental: Check user profile
@@ -11161,13 +11172,16 @@ var Moderation = class {
11161
11172
  * @returns
11162
11173
  */
11163
11174
  async addCustomFlags(entityType, entityID, entityCreatorID, moderationPayload, flags) {
11164
- return await this.client.post(this.client.baseURL + `/api/v2/moderation/custom_check`, {
11165
- entity_type: entityType,
11166
- entity_id: entityID,
11167
- entity_creator_id: entityCreatorID,
11168
- moderation_payload: moderationPayload,
11169
- flags
11170
- });
11175
+ return await this.client.post(
11176
+ this.client.baseURL + `/api/v2/moderation/custom_check`,
11177
+ {
11178
+ entity_type: entityType,
11179
+ entity_id: entityID,
11180
+ entity_creator_id: entityCreatorID,
11181
+ moderation_payload: moderationPayload,
11182
+ flags
11183
+ }
11184
+ );
11171
11185
  }
11172
11186
  /**
11173
11187
  * Add custom flags to a message
@@ -15087,7 +15101,7 @@ var StreamChat = class _StreamChat {
15087
15101
  if (this.userAgent) {
15088
15102
  return this.userAgent;
15089
15103
  }
15090
- const version = "9.30.0";
15104
+ const version = "9.31.0";
15091
15105
  const clientBundle = "browser-cjs";
15092
15106
  let userAgentString = "";
15093
15107
  if (this.sdkIdentifier) {