stream-chat 9.36.2 → 9.38.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.
@@ -7501,7 +7501,10 @@ var _MessageComposer = class _MessageComposer extends WithSubscriptions {
7501
7501
  return !!(!this.attachmentManager.uploadsInProgressCount && (!this.textComposer.textIsEmpty || this.attachmentManager.successfulUploadsCount > 0) || this.pollId || !!this.locationComposer.validLocation);
7502
7502
  }
7503
7503
  get compositionIsEmpty() {
7504
- return !this.quotedMessage && this.textComposer.textIsEmpty && !this.attachmentManager.attachments.length && !this.pollId && !this.locationComposer.validLocation;
7504
+ return !this.quotedMessage && this.contentIsEmpty;
7505
+ }
7506
+ get contentIsEmpty() {
7507
+ return this.textComposer.textIsEmpty && !this.attachmentManager.attachments.length && !this.pollId && !this.locationComposer.validLocation;
7505
7508
  }
7506
7509
  get lastChangeOriginIsLocal() {
7507
7510
  const initiatedWithoutDraft = this.lastChange.draftUpdate === null;
@@ -12352,8 +12355,8 @@ var NotificationManager = class {
12352
12355
  add({ message, origin, options = {} }) {
12353
12356
  const id = generateUUIDv4();
12354
12357
  const now = Date.now();
12355
- const severity = options.severity || "info";
12356
- const duration = options.duration ?? this.config.durations[severity];
12358
+ const severity = options.severity;
12359
+ const duration = options.duration ?? (severity ? this.config.durations[severity] : void 0);
12357
12360
  const notification = {
12358
12361
  id,
12359
12362
  message,
@@ -12361,20 +12364,16 @@ var NotificationManager = class {
12361
12364
  type: options?.type,
12362
12365
  severity,
12363
12366
  createdAt: now,
12364
- expiresAt: now + duration,
12367
+ duration,
12365
12368
  actions: options.actions,
12366
12369
  metadata: options.metadata,
12370
+ tags: options.tags,
12367
12371
  originalError: options.originalError
12368
12372
  };
12373
+ const notifications = [...this.store.getLatestValue().notifications, notification];
12369
12374
  this.store.partialNext({
12370
- notifications: [...this.store.getLatestValue().notifications, notification]
12375
+ notifications: this.config.sortComparator ? [...notifications].sort(this.config.sortComparator) : notifications
12371
12376
  });
12372
- if (notification.expiresAt) {
12373
- const timeout = setTimeout(() => {
12374
- this.remove(id);
12375
- }, options.duration || this.config.durations[notification.severity]);
12376
- this.timeouts.set(id, timeout);
12377
- }
12378
12377
  return id;
12379
12378
  }
12380
12379
  addError({ message, origin, options }) {
@@ -12389,12 +12388,24 @@ var NotificationManager = class {
12389
12388
  addSuccess({ message, origin, options }) {
12390
12389
  return this.add({ message, origin, options: { ...options, severity: "success" } });
12391
12390
  }
12392
- remove(id) {
12391
+ clearTimeout(id) {
12393
12392
  const timeout = this.timeouts.get(id);
12394
- if (timeout) {
12395
- clearTimeout(timeout);
12396
- this.timeouts.delete(id);
12397
- }
12393
+ if (!timeout) return;
12394
+ clearTimeout(timeout);
12395
+ this.timeouts.delete(id);
12396
+ }
12397
+ startTimeout(id, durationOverride) {
12398
+ const notification = this.store.getLatestValue().notifications.find((n) => n.id === id);
12399
+ const duration = durationOverride ?? notification?.duration;
12400
+ if (!notification || !duration) return;
12401
+ this.clearTimeout(id);
12402
+ const timeout = setTimeout(() => {
12403
+ this.remove(id);
12404
+ }, duration);
12405
+ this.timeouts.set(id, timeout);
12406
+ }
12407
+ remove(id) {
12408
+ this.clearTimeout(id);
12398
12409
  this.store.partialNext({
12399
12410
  notifications: this.store.getLatestValue().notifications.filter((n) => n.id !== id)
12400
12411
  });
@@ -15092,7 +15103,7 @@ var StreamChat = class _StreamChat {
15092
15103
  if (this.userAgent) {
15093
15104
  return this.userAgent;
15094
15105
  }
15095
- const version = "9.36.2";
15106
+ const version = "9.38.0";
15096
15107
  const clientBundle = "node-cjs";
15097
15108
  let userAgentString = "";
15098
15109
  if (this.sdkIdentifier) {