stream-chat 9.32.0 → 9.34.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.
@@ -76,7 +76,6 @@ export declare const DEFAULT_CHANNEL_MANAGER_OPTIONS: {
76
76
  lockChannelOrder: boolean;
77
77
  };
78
78
  export declare const DEFAULT_CHANNEL_MANAGER_PAGINATION_OPTIONS: {
79
- limit: number;
80
79
  offset: number;
81
80
  };
82
81
  /**
@@ -1975,6 +1975,7 @@ export type ChannelData = CustomChannelData & Partial<{
1975
1975
  blocklist_behavior: AutomodBehavior;
1976
1976
  automod: Automod;
1977
1977
  filter_tags: string[];
1978
+ team?: string;
1978
1979
  }>;
1979
1980
  export type ChannelMute = {
1980
1981
  user: UserResponse;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stream-chat",
3
- "version": "9.32.0",
3
+ "version": "9.34.0",
4
4
  "description": "JS SDK for the Stream Chat API",
5
5
  "homepage": "https://getstream.io/chat/",
6
6
  "author": {
@@ -149,7 +149,6 @@ export const DEFAULT_CHANNEL_MANAGER_OPTIONS = {
149
149
  };
150
150
 
151
151
  export const DEFAULT_CHANNEL_MANAGER_PAGINATION_OPTIONS = {
152
- limit: 10,
153
152
  offset: 0,
154
153
  };
155
154
 
@@ -293,7 +292,7 @@ export class ChannelManager extends WithSubscriptions {
293
292
  channels,
294
293
  pagination: {
295
294
  ...pagination,
296
- hasNext: (channels?.length ?? 0) >= limit,
295
+ hasNext: (channels?.length ?? 0) >= (limit ?? 1),
297
296
  isLoading: false,
298
297
  options: newOptions,
299
298
  },
@@ -446,7 +445,7 @@ export class ChannelManager extends WithSubscriptions {
446
445
  channels: uniqBy<Channel>([...(channels || []), ...nextChannels], 'cid'),
447
446
  pagination: {
448
447
  ...pagination,
449
- hasNext: (nextChannels?.length ?? 0) >= limit,
448
+ hasNext: (nextChannels?.length ?? 0) >= (limit ?? 1),
450
449
  isLoading: false,
451
450
  isLoadingNext: false,
452
451
  options: newOptions,
@@ -106,6 +106,13 @@ export const isTargetedOptionTextUpdate = (
106
106
  typeof (value as TargetedPollOptionTextUpdate)?.index === 'number' &&
107
107
  typeof (value as TargetedPollOptionTextUpdate)?.text === 'string';
108
108
 
109
+ const clampMaxVotesAllowed = (value: unknown): string => {
110
+ if (value === '' || value == null) return '';
111
+ const num = typeof value === 'string' ? parseInt(value, 10) : Number(value);
112
+ if (!Number.isInteger(num) || Number.isNaN(num)) return '';
113
+ return String(Math.min(10, Math.max(2, num)));
114
+ };
115
+
109
116
  export const pollCompositionStateProcessors: Partial<
110
117
  Record<keyof PollComposerState['data'], PollCompositionStateProcessor>
111
118
  > = {
@@ -113,6 +120,9 @@ export const pollCompositionStateProcessors: Partial<
113
120
  enforce_unique_vote: value,
114
121
  max_votes_allowed: '',
115
122
  }),
123
+ max_votes_allowed: ({ value }) => ({
124
+ max_votes_allowed: clampMaxVotesAllowed(value),
125
+ }),
116
126
  options: ({ value, data }) => {
117
127
  // If it's a direct array update (like drag-drop reordering)
118
128
  if (Array.isArray(value)) {
package/src/types.ts CHANGED
@@ -2514,6 +2514,7 @@ export type ChannelData = CustomChannelData &
2514
2514
  blocklist_behavior: AutomodBehavior;
2515
2515
  automod: Automod;
2516
2516
  filter_tags: string[];
2517
+ team?: string;
2517
2518
  }>;
2518
2519
 
2519
2520
  export type ChannelMute = {