stream-chat 9.43.0 → 9.43.2

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.
@@ -3086,7 +3086,7 @@ var _AttachmentManager = class _AttachmentManager {
3086
3086
  this.setCustomUploadFn = (doUploadRequest) => {
3087
3087
  this.composer.updateConfig({ attachments: { doUploadRequest } });
3088
3088
  };
3089
- this.cancelAttachmentUploads = (attachments) => {
3089
+ this.cancelAttachmentUploads = (attachments = this.attachments) => {
3090
3090
  for (const { localMetadata } of attachments) {
3091
3091
  this.client.uploadManager.deleteUploadRecord(localMetadata.id);
3092
3092
  }
@@ -3104,7 +3104,6 @@ var _AttachmentManager = class _AttachmentManager {
3104
3104
  };
3105
3105
  };
3106
3106
  this.initState = ({ message } = {}) => {
3107
- this.cancelAttachmentUploads(this.attachments);
3108
3107
  this.state.next(initState({ message }));
3109
3108
  };
3110
3109
  this.getSnapshot = () => {
@@ -3971,7 +3970,9 @@ var applyCommandActivationEffect = (effect, composer) => {
3971
3970
  selection: { start: 0, end: 0 },
3972
3971
  text: ""
3973
3972
  });
3973
+ const attachmentsToCancel = composer.attachmentManager.attachments;
3974
3974
  composer.attachmentManager.initState();
3975
+ composer.attachmentManager.cancelAttachmentUploads(attachmentsToCancel);
3975
3976
  composer.linkPreviewsManager.initState();
3976
3977
  composer.locationComposer.initState();
3977
3978
  composer.pollComposer.initState();
@@ -10266,8 +10267,9 @@ var StableWSConnection = class {
10266
10267
  this.onmessage = (wsID, event) => {
10267
10268
  if (this.wsID !== wsID) return;
10268
10269
  this._log("onmessage() - onmessage callback", { event, wsID });
10269
- const data = typeof event.data === "string" ? JSON.parse(event.data) : null;
10270
- if (!this.isResolved && data) {
10270
+ if (typeof event.data !== "string") return;
10271
+ const data = JSON.parse(event.data);
10272
+ if (!this.isResolved) {
10271
10273
  this.isResolved = true;
10272
10274
  if (data.error) {
10273
10275
  this.rejectPromise?.(this._errorFromWSEvent(data, false));
@@ -10277,10 +10279,10 @@ var StableWSConnection = class {
10277
10279
  this._setHealth(true);
10278
10280
  }
10279
10281
  this.lastEvent = /* @__PURE__ */ new Date();
10280
- if (data && data.type === "health.check") {
10282
+ if (data.type === "health.check") {
10281
10283
  this.scheduleNextPing();
10282
10284
  }
10283
- this.client.handleEvent(event);
10285
+ this.client.dispatchEvent(data);
10284
10286
  this.scheduleConnectionCheck();
10285
10287
  };
10286
10288
  this.onclose = (wsID, event) => {
@@ -13383,11 +13385,6 @@ var StreamChat = class _StreamChat {
13383
13385
  method: `handleEvent;${event.type}`
13384
13386
  });
13385
13387
  };
13386
- this.handleEvent = (messageEvent) => {
13387
- const jsonString = messageEvent.data;
13388
- const event = JSON.parse(jsonString);
13389
- this.dispatchEvent(event);
13390
- };
13391
13388
  /**
13392
13389
  * Updates the members, watchers and read references of the currently active channels that contain this user
13393
13390
  *
@@ -14304,15 +14301,17 @@ var StreamChat = class _StreamChat {
14304
14301
  defaultOptions.watch = false;
14305
14302
  }
14306
14303
  const { predefined_filter, filter_values, sort_values, ...restOptions } = options;
14304
+ const normalizedSort = normalizeQuerySort(sort);
14307
14305
  const payload = predefined_filter ? {
14308
14306
  predefined_filter,
14309
14307
  filter_values,
14310
14308
  sort_values,
14309
+ sort: normalizedSort,
14311
14310
  ...defaultOptions,
14312
14311
  ...restOptions
14313
14312
  } : {
14314
14313
  filter_conditions: filterConditions,
14315
- sort: normalizeQuerySort(sort),
14314
+ sort: normalizedSort,
14316
14315
  ...defaultOptions,
14317
14316
  ...restOptions
14318
14317
  };
@@ -15475,7 +15474,7 @@ var StreamChat = class _StreamChat {
15475
15474
  if (this.userAgent) {
15476
15475
  return this.userAgent;
15477
15476
  }
15478
- const version = "9.43.0";
15477
+ const version = "9.43.2";
15479
15478
  const clientBundle = "browser-esm";
15480
15479
  let userAgentString = "";
15481
15480
  if (this.sdkIdentifier) {
@@ -18208,12 +18207,15 @@ export {
18208
18207
  defaultPollFieldChangeEventValidators,
18209
18208
  encodeBase64,
18210
18209
  ensureIsLocalAttachment,
18210
+ escapeCommandRegExp,
18211
18211
  extractPollData,
18212
18212
  extractPollEnrichedData,
18213
18213
  formatMessage,
18214
18214
  generateFileName,
18215
18215
  getAttachmentTypeFromMimeType,
18216
+ getCompleteCommandInString,
18216
18217
  getExtensionFromMimeType,
18218
+ getRawCommandName,
18217
18219
  getTokenizedSuggestionDisplayName,
18218
18220
  getTriggerCharWithToken,
18219
18221
  insertItemWithTrigger,
@@ -18245,6 +18247,7 @@ export {
18245
18247
  localMessageToNewMessagePayload,
18246
18248
  logChatPromiseExecution,
18247
18249
  mapPollStateToResponse,
18250
+ notifyCommandDisabled,
18248
18251
  pollCompositionStateProcessors,
18249
18252
  pollStateChangeValidators,
18250
18253
  postInsights,
@@ -18252,6 +18255,7 @@ export {
18252
18255
  readFileAsArrayBuffer,
18253
18256
  removeDiacritics,
18254
18257
  replaceWordWithEntity,
18258
+ stripCommandFromText,
18255
18259
  textIsEmpty,
18256
18260
  timeLeftMs
18257
18261
  };