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.
@@ -7522,7 +7522,10 @@ var _MessageComposer = class _MessageComposer extends WithSubscriptions {
7522
7522
  return !!(!this.attachmentManager.uploadsInProgressCount && (!this.textComposer.textIsEmpty || this.attachmentManager.successfulUploadsCount > 0) || this.pollId || !!this.locationComposer.validLocation);
7523
7523
  }
7524
7524
  get compositionIsEmpty() {
7525
- return !this.quotedMessage && this.textComposer.textIsEmpty && !this.attachmentManager.attachments.length && !this.pollId && !this.locationComposer.validLocation;
7525
+ return !this.quotedMessage && this.contentIsEmpty;
7526
+ }
7527
+ get contentIsEmpty() {
7528
+ return this.textComposer.textIsEmpty && !this.attachmentManager.attachments.length && !this.pollId && !this.locationComposer.validLocation;
7526
7529
  }
7527
7530
  get lastChangeOriginIsLocal() {
7528
7531
  const initiatedWithoutDraft = this.lastChange.draftUpdate === null;
@@ -12373,8 +12376,8 @@ var NotificationManager = class {
12373
12376
  add({ message, origin, options = {} }) {
12374
12377
  const id = generateUUIDv4();
12375
12378
  const now = Date.now();
12376
- const severity = options.severity || "info";
12377
- const duration = options.duration ?? this.config.durations[severity];
12379
+ const severity = options.severity;
12380
+ const duration = options.duration ?? (severity ? this.config.durations[severity] : void 0);
12378
12381
  const notification = {
12379
12382
  id,
12380
12383
  message,
@@ -12382,20 +12385,16 @@ var NotificationManager = class {
12382
12385
  type: options?.type,
12383
12386
  severity,
12384
12387
  createdAt: now,
12385
- expiresAt: now + duration,
12388
+ duration,
12386
12389
  actions: options.actions,
12387
12390
  metadata: options.metadata,
12391
+ tags: options.tags,
12388
12392
  originalError: options.originalError
12389
12393
  };
12394
+ const notifications = [...this.store.getLatestValue().notifications, notification];
12390
12395
  this.store.partialNext({
12391
- notifications: [...this.store.getLatestValue().notifications, notification]
12396
+ notifications: this.config.sortComparator ? [...notifications].sort(this.config.sortComparator) : notifications
12392
12397
  });
12393
- if (notification.expiresAt) {
12394
- const timeout = setTimeout(() => {
12395
- this.remove(id);
12396
- }, options.duration || this.config.durations[notification.severity]);
12397
- this.timeouts.set(id, timeout);
12398
- }
12399
12398
  return id;
12400
12399
  }
12401
12400
  addError({ message, origin, options }) {
@@ -12410,12 +12409,24 @@ var NotificationManager = class {
12410
12409
  addSuccess({ message, origin, options }) {
12411
12410
  return this.add({ message, origin, options: { ...options, severity: "success" } });
12412
12411
  }
12413
- remove(id) {
12412
+ clearTimeout(id) {
12414
12413
  const timeout = this.timeouts.get(id);
12415
- if (timeout) {
12416
- clearTimeout(timeout);
12417
- this.timeouts.delete(id);
12418
- }
12414
+ if (!timeout) return;
12415
+ clearTimeout(timeout);
12416
+ this.timeouts.delete(id);
12417
+ }
12418
+ startTimeout(id, durationOverride) {
12419
+ const notification = this.store.getLatestValue().notifications.find((n) => n.id === id);
12420
+ const duration = durationOverride ?? notification?.duration;
12421
+ if (!notification || !duration) return;
12422
+ this.clearTimeout(id);
12423
+ const timeout = setTimeout(() => {
12424
+ this.remove(id);
12425
+ }, duration);
12426
+ this.timeouts.set(id, timeout);
12427
+ }
12428
+ remove(id) {
12429
+ this.clearTimeout(id);
12419
12430
  this.store.partialNext({
12420
12431
  notifications: this.store.getLatestValue().notifications.filter((n) => n.id !== id)
12421
12432
  });
@@ -15113,7 +15124,7 @@ var StreamChat = class _StreamChat {
15113
15124
  if (this.userAgent) {
15114
15125
  return this.userAgent;
15115
15126
  }
15116
- const version = "9.36.2";
15127
+ const version = "9.38.0";
15117
15128
  const clientBundle = "browser-cjs";
15118
15129
  let userAgentString = "";
15119
15130
  if (this.sdkIdentifier) {