@ermis-network/ermis-chat-react 1.0.6 → 1.0.7

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.
Files changed (43) hide show
  1. package/dist/index.cjs +2410 -1308
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.css +471 -16
  4. package/dist/index.css.map +1 -1
  5. package/dist/index.d.mts +145 -1
  6. package/dist/index.d.ts +145 -1
  7. package/dist/index.mjs +2339 -1241
  8. package/dist/index.mjs.map +1 -1
  9. package/package.json +2 -2
  10. package/src/components/BannedOverlay.tsx +40 -0
  11. package/src/components/ChannelActions.tsx +231 -0
  12. package/src/components/ChannelHeader.tsx +38 -2
  13. package/src/components/ChannelInfo/ChannelInfo.tsx +118 -20
  14. package/src/components/ChannelInfo/ChannelInfoTabs.tsx +10 -2
  15. package/src/components/ChannelInfo/ChannelSettingsPanel.tsx +88 -1
  16. package/src/components/ChannelInfo/EditChannelModal.tsx +4 -4
  17. package/src/components/ChannelList.tsx +460 -38
  18. package/src/components/ClosedTopicOverlay.tsx +38 -0
  19. package/src/components/MessageInput.tsx +19 -2
  20. package/src/components/MessageItem.tsx +8 -11
  21. package/src/components/MessageQuickReactions.tsx +3 -2
  22. package/src/components/MessageReactions.tsx +8 -3
  23. package/src/components/MessageRenderers.tsx +7 -9
  24. package/src/components/PendingOverlay.tsx +41 -0
  25. package/src/components/TopicModal.tsx +189 -0
  26. package/src/components/VirtualMessageList.tsx +74 -43
  27. package/src/hooks/useBannedState.ts +27 -3
  28. package/src/hooks/useChannelCapabilities.ts +7 -3
  29. package/src/hooks/useChannelData.ts +1 -1
  30. package/src/hooks/useChannelListUpdates.ts +24 -3
  31. package/src/hooks/useChannelRowUpdates.ts +6 -0
  32. package/src/hooks/useMessageActions.ts +1 -1
  33. package/src/index.ts +6 -1
  34. package/src/styles/_channel-info.css +21 -0
  35. package/src/styles/_channel-list.css +217 -6
  36. package/src/styles/_message-bubble.css +75 -9
  37. package/src/styles/_message-input.css +24 -0
  38. package/src/styles/_message-list.css +51 -6
  39. package/src/styles/_message-quick-reactions.css +5 -0
  40. package/src/styles/_message-reactions.css +7 -0
  41. package/src/styles/_topic-modal.css +154 -0
  42. package/src/styles/index.css +1 -0
  43. package/src/types.ts +157 -3
package/dist/index.d.mts CHANGED
@@ -1,5 +1,6 @@
1
1
  import React$1 from 'react';
2
2
  import { Channel as Channel$1, Attachment, FormatMessageResponse, ChannelFilters, ChannelSort, ChannelQueryOptions, ErmisChat, UserCallInfo, MessageLabel, ErmisCallNode, CallStatus } from '@ermis-network/ermis-chat-sdk';
3
+ import * as react_jsx_runtime from 'react/jsx-runtime';
3
4
  import { VListHandle } from 'virtua';
4
5
 
5
6
  type Theme = 'dark' | 'light';
@@ -265,6 +266,44 @@ type ChannelHeaderData = {
265
266
  name: string;
266
267
  image?: string;
267
268
  };
269
+ type ChannelAction = {
270
+ id: string;
271
+ label: string;
272
+ icon?: React.ReactNode;
273
+ onClick: (channel: Channel$1, e: React.MouseEvent) => void;
274
+ isDanger?: boolean;
275
+ };
276
+ type ChannelActionLabels = {
277
+ pinChannel?: string;
278
+ unpinChannel?: string;
279
+ pinTopic?: string;
280
+ unpinTopic?: string;
281
+ blockUser?: string;
282
+ unblockUser?: string;
283
+ editTopic?: string;
284
+ closeTopic?: string;
285
+ reopenTopic?: string;
286
+ createTopic?: string;
287
+ deleteChannel?: string;
288
+ leaveChannel?: string;
289
+ };
290
+ type ChannelActionIcons = {
291
+ PinIcon?: React.ReactNode;
292
+ UnpinIcon?: React.ReactNode;
293
+ BlockIcon?: React.ReactNode;
294
+ UnblockIcon?: React.ReactNode;
295
+ EditTopicIcon?: React.ReactNode;
296
+ CloseTopicIcon?: React.ReactNode;
297
+ ReopenTopicIcon?: React.ReactNode;
298
+ CreateTopicIcon?: React.ReactNode;
299
+ DeleteChannelIcon?: React.ReactNode;
300
+ LeaveChannelIcon?: React.ReactNode;
301
+ };
302
+ type ChannelActionsProps = {
303
+ channel: Channel$1;
304
+ actions: ChannelAction[];
305
+ onClose: () => void;
306
+ };
268
307
  type ChannelItemProps = {
269
308
  channel: Channel$1;
270
309
  isActive: boolean;
@@ -272,6 +311,7 @@ type ChannelItemProps = {
272
311
  unreadCount: number;
273
312
  lastMessageText: string;
274
313
  lastMessageUser: string;
314
+ lastMessageTimestamp?: Date | string | null;
275
315
  onSelect: (channel: Channel$1) => void;
276
316
  AvatarComponent: React.ComponentType<AvatarProps>;
277
317
  /** Whether the current user has blocked this channel (messaging only) */
@@ -282,6 +322,22 @@ type ChannelItemProps = {
282
322
  pendingBadgeLabel?: string;
283
323
  /** Label for the blocked channel badge indicator */
284
324
  blockedBadgeLabel?: string;
325
+ isClosedTopic?: boolean;
326
+ closedTopicIcon?: React.ReactNode;
327
+ PinnedIconComponent?: React.ComponentType;
328
+ ChannelActionsComponent?: React.ComponentType<ChannelActionsProps>;
329
+ /** Handler when Create Topic action is triggered */
330
+ onAddTopic?: (channel: Channel$1) => void;
331
+ /** Handler when Edit Topic action is triggered */
332
+ onEditTopic?: (channel: Channel$1) => void;
333
+ /** Handler when Close/Reopen Topic action is triggered */
334
+ onToggleCloseTopic?: (channel: Channel$1, isClosed: boolean) => void;
335
+ /** Array of action IDs to hide from the actions dropdown */
336
+ hiddenActions?: string[];
337
+ /** Custom labels for default channel actions */
338
+ actionLabels?: ChannelActionLabels;
339
+ /** Custom icons for default channel actions */
340
+ actionIcons?: ChannelActionIcons;
285
341
  };
286
342
  type ChannelListProps = {
287
343
  filters?: ChannelFilters;
@@ -290,6 +346,8 @@ type ChannelListProps = {
290
346
  renderChannel?: (channel: Channel$1, isActive: boolean) => React.ReactNode;
291
347
  onChannelSelect?: (channel: Channel$1) => void;
292
348
  className?: string;
349
+ /** Array of action IDs to hide from the actions dropdown */
350
+ hiddenActions?: string[];
293
351
  LoadingIndicator?: React.ComponentType<{
294
352
  text?: string;
295
353
  }>;
@@ -311,6 +369,30 @@ type ChannelListProps = {
311
369
  emptyStateLabel?: string;
312
370
  /** Label for the blocked channel badge hover */
313
371
  blockedBadgeLabel?: string;
372
+ /** Custom component for rendering topic group */
373
+ ChannelTopicGroupComponent?: React.ComponentType<any>;
374
+ /** Custom avatar component for general topic */
375
+ GeneralTopicAvatarComponent?: React.ComponentType<any>;
376
+ /** Custom avatar component for other topics */
377
+ TopicAvatarComponent?: React.ComponentType<any>;
378
+ /** Name for the general topic (default: "general") */
379
+ generalTopicLabel?: string;
380
+ /** Handler when Add Topic button is clicked on a team channel */
381
+ onAddTopic?: (channel: Channel$1) => void;
382
+ /** Optional custom emoji picker for TopicModal */
383
+ TopicEmojiPickerComponent?: React.ComponentType<any>;
384
+ closedTopicIcon?: React.ReactNode;
385
+ PinnedIconComponent?: React.ComponentType;
386
+ /** Custom component for channel actions dropdown */
387
+ ChannelActionsComponent?: React.ComponentType<ChannelActionsProps>;
388
+ /** Handler when Edit Topic action is triggered */
389
+ onEditTopic?: (channel: Channel$1) => void;
390
+ /** Handler when Close/Reopen Topic action is triggered */
391
+ onToggleCloseTopic?: (channel: Channel$1, isClosed: boolean) => void;
392
+ /** Custom labels for default channel actions */
393
+ actionLabels?: ChannelActionLabels;
394
+ /** Custom icons for default channel actions */
395
+ actionIcons?: ChannelActionIcons;
314
396
  };
315
397
  type AttachmentProps = {
316
398
  attachment: Attachment;
@@ -389,6 +471,9 @@ type MessageListProps = {
389
471
  pendingOverlaySubtitle?: string;
390
472
  pendingAcceptLabel?: string;
391
473
  pendingRejectLabel?: string;
474
+ closedTopicOverlayTitle?: string;
475
+ closedTopicOverlaySubtitle?: string;
476
+ closedTopicReopenLabel?: string;
392
477
  };
393
478
  type ReactionUser = {
394
479
  id: string;
@@ -410,6 +495,8 @@ type MessageReactionsProps = {
410
495
  AvatarComponent?: React.ComponentType<AvatarProps>;
411
496
  /** Callback when clicking a reaction */
412
497
  onClickReaction?: (type: string) => void;
498
+ /** Whether interactions are disabled */
499
+ disabled?: boolean;
413
500
  };
414
501
  type ReadReceiptUser = {
415
502
  id: string;
@@ -542,6 +629,8 @@ type MessageInputProps = {
542
629
  sendDisabledLabel?: string;
543
630
  /** I18n Label for slow mode active */
544
631
  slowModeLabel?: (cooldown: number) => React.ReactNode;
632
+ /** I18n Label for closed topic */
633
+ closedTopicLabel?: string;
545
634
  };
546
635
  type ReplyPreviewProps = {
547
636
  message: FormatMessageResponse;
@@ -756,6 +845,10 @@ type ChannelInfoCoverProps = {
756
845
  onEditClick?: () => void;
757
846
  /** Whether the channel is public */
758
847
  isPublic?: boolean;
848
+ /** Name of the parent channel (if this is a topic) */
849
+ parentChannelName?: string;
850
+ /** Whether the channel is a topic */
851
+ isTopic?: boolean;
759
852
  /** Whether the channel is a team channel */
760
853
  isTeamChannel?: boolean;
761
854
  };
@@ -767,6 +860,8 @@ type ChannelInfoActionsProps = {
767
860
  onBlockUser?: () => void;
768
861
  onUnblockUser?: () => void;
769
862
  isTeamChannel?: boolean;
863
+ isTopic?: boolean;
864
+ isClosedTopic?: boolean;
770
865
  isBlocked?: boolean;
771
866
  currentUserRole?: string;
772
867
  searchLabel?: string;
@@ -775,6 +870,10 @@ type ChannelInfoActionsProps = {
775
870
  leaveLabel?: string;
776
871
  blockLabel?: string;
777
872
  unblockLabel?: string;
873
+ onCloseTopic?: () => void;
874
+ onReopenTopic?: () => void;
875
+ closeTopicLabel?: string;
876
+ reopenTopicLabel?: string;
778
877
  };
779
878
  type ChannelInfoMember = {
780
879
  id: string;
@@ -976,6 +1075,12 @@ type ChannelInfoProps = {
976
1075
  /** I18n labels for block/unblock actions */
977
1076
  actionsBlockLabel?: string;
978
1077
  actionsUnblockLabel?: string;
1078
+ actionsCloseTopicLabel?: string;
1079
+ actionsReopenTopicLabel?: string;
1080
+ /** Settings Panel Topics Labels */
1081
+ settingsWorkspaceTopicsTitle?: string;
1082
+ settingsTopicsFeatureName?: string;
1083
+ settingsTopicsFeatureDescription?: string;
979
1084
  };
980
1085
  /** Individual user item in UserPicker */
981
1086
  type UserPickerUser = {
@@ -1060,6 +1165,30 @@ type CreateChannelModalProps = {
1060
1165
  maxImageSize?: number;
1061
1166
  maxImageSizeError?: string;
1062
1167
  };
1168
+ type TopicModalProps = {
1169
+ isOpen: boolean;
1170
+ onClose: () => void;
1171
+ onSuccess?: (channel: Channel$1) => void;
1172
+ /** Inject external emoji picker component */
1173
+ EmojiPickerComponent?: React.ComponentType<{
1174
+ onSelect: (emoji: any) => void;
1175
+ [key: string]: any;
1176
+ }>;
1177
+ /** Parent team channel to create topic under, will use activeChannel if not provided */
1178
+ parentChannel?: Channel$1;
1179
+ /** If provided, operates in edit mode for this topic */
1180
+ topic?: Channel$1;
1181
+ /** i18n labels */
1182
+ title?: string;
1183
+ nameLabel?: string;
1184
+ namePlaceholder?: string;
1185
+ emojiLabel?: string;
1186
+ descriptionLabel?: string;
1187
+ descriptionPlaceholder?: string;
1188
+ cancelButtonLabel?: string;
1189
+ saveButtonLabel?: string;
1190
+ savingButtonLabel?: string;
1191
+ };
1063
1192
 
1064
1193
  declare const ChatProvider: React$1.FC<ChatProviderProps>;
1065
1194
 
@@ -1095,6 +1224,7 @@ declare function useChannelRowUpdates(channel: Channel$1, currentUserId?: string
1095
1224
  *
1096
1225
  * Reads the initial value from `channel.state.membership.banned` and subscribes
1097
1226
  * to `member.banned` / `member.unbanned` WebSocket events for real-time updates.
1227
+ * If the channel is a topic, it also synchronizes with the parent channel's ban state.
1098
1228
  *
1099
1229
  * Only triggers a re-render when the *current user* is the target of the event.
1100
1230
  */
@@ -1132,7 +1262,18 @@ declare function usePendingState(channel: Channel$1 | null | undefined, currentU
1132
1262
  */
1133
1263
  declare const Avatar: React$1.FC<AvatarProps>;
1134
1264
 
1265
+ declare function computeDefaultActions(channel: Channel$1, currentUserId?: string, options?: {
1266
+ onAddTopic?: (channel: Channel$1) => void;
1267
+ onEditTopic?: (channel: Channel$1) => void;
1268
+ onToggleCloseTopic?: (channel: Channel$1, isClosed: boolean) => void;
1269
+ isBlocked?: boolean;
1270
+ actionLabels?: ChannelActionLabels;
1271
+ actionIcons?: ChannelActionIcons;
1272
+ }): ChannelAction[];
1273
+ declare const DefaultChannelActions: React$1.FC<ChannelActionsProps>;
1274
+
1135
1275
  declare const ChannelItem: React$1.FC<ChannelItemProps>;
1276
+ declare const ChannelTopicGroup: React$1.MemoExoticComponent<({ channel, activeChannel, handleSelect, renderChannel, ChannelItemComponent, AvatarComponent, GeneralTopicAvatarComponent, TopicAvatarComponent, currentUserId, pendingBadgeLabel, blockedBadgeLabel, generalTopicLabel, closedTopicIcon, PinnedIconComponent, ChannelActionsComponent, onAddTopic, onEditTopic, onToggleCloseTopic, hiddenActions, actionLabels, actionIcons, }: any) => react_jsx_runtime.JSX.Element>;
1136
1277
  declare const ChannelList: React$1.FC<ChannelListProps>;
1137
1278
 
1138
1279
  /**
@@ -1193,6 +1334,7 @@ declare const MessageReactions: React$1.FC<MessageReactionsProps>;
1193
1334
  declare const MessageQuickReactions: React$1.FC<{
1194
1335
  message: FormatMessageResponse;
1195
1336
  isOwnMessage: boolean;
1337
+ disabled?: boolean;
1196
1338
  }>;
1197
1339
 
1198
1340
  type MessageActionList = {
@@ -1340,6 +1482,8 @@ declare const ReplyPreview: React$1.FC<ReplyPreviewProps>;
1340
1482
 
1341
1483
  declare const ForwardMessageModal: React$1.FC<ForwardMessageModalProps>;
1342
1484
 
1485
+ declare const TopicModal: React$1.FC<TopicModalProps>;
1486
+
1343
1487
  type TypingUser = {
1344
1488
  id: string;
1345
1489
  name?: string;
@@ -1439,4 +1583,4 @@ declare const ErmisCallProvider: React$1.FC<ErmisCallProviderProps>;
1439
1583
 
1440
1584
  declare const ErmisCallUI: React$1.FC<ErmisCallUIProps>;
1441
1585
 
1442
- export { type AddMemberButtonProps, type AddMemberModalProps, type AddMemberUserItemProps, type AttachButtonProps, type AttachmentItem, AttachmentList, type AttachmentProps, Avatar, type AvatarProps, type CallContextValue, Channel, ChannelHeader, type ChannelHeaderData, type ChannelHeaderProps, ChannelInfo, type ChannelInfoActionsProps, type ChannelInfoCoverProps, type ChannelInfoEmptyStateProps, type ChannelInfoFileItemProps, type ChannelInfoHeaderProps, type ChannelInfoLinkItemProps, type ChannelInfoMediaItemProps, type ChannelInfoMemberItemProps, type ChannelInfoProps, type ChannelInfoTabsProps, ChannelItem, type ChannelItemProps, ChannelList, type ChannelListProps, type ChannelProps, type ChatContextValue, ChatProvider, type ChatProviderProps, CreateChannelModal, type CreateChannelModalProps, type DateSeparatorProps, DefaultChannelInfoActions, DefaultChannelInfoCover, DefaultChannelInfoHeader, DefaultChannelInfoTabs, Dropdown, type DropdownProps, type EmojiButtonProps, type EmojiPickerProps, type ErmisCallConnectedAudioProps, type ErmisCallConnectedVideoProps, ErmisCallContext, type ErmisCallControlsBarProps, type ErmisCallErrorProps, ErmisCallProvider, type ErmisCallProviderProps, type ErmisCallRingingProps, ErmisCallUI, type ErmisCallUIProps, ErrorMessage, type FilePreviewItem, FilesPreview, type FilesPreviewProps, type ForwardChannelItemProps, ForwardMessageModal, type ForwardMessageModalProps, type JumpToLatestProps, type LatestReaction, type MediaTab, type MentionMember, type MentionPayload, MentionSuggestions, type MentionSuggestionsProps, MessageActionsBox, type MessageActionsBoxProps, MessageAttachment, type MessageBubbleProps, MessageInput, type MessageInputProps, MessageItem, type MessageItemProps, type MessageListProps, MessageQuickReactions, MessageReactions, type MessageReactionsProps, type MessageRendererProps, Modal, type ModalProps, Panel, type PinnedMessageItemProps, PinnedMessages, type PinnedMessagesProps, PollMessage, QuotedMessagePreview, type QuotedMessagePreviewProps, type ReactionUser, RegularMessage, ReplyPreview, type ReplyPreviewProps, type SendButtonProps, SignalMessage, StickerMessage, SystemMessage, SystemMessageItem, type SystemMessageItemProps, type Theme, TypingIndicator, type TypingIndicatorProps, type TypingUser, type UseChannelMessagesOptions, type UseChannelReturn, type UseLoadMessagesOptions, type UseLoadMessagesReturn, type UseMentionsOptions, type UseMentionsReturn, type UseScrollToMessageOptions, type UseScrollToMessageReturn, UserPicker, type UserPickerItemProps, type UserPickerProps, type UserPickerSelectedBoxProps, type UserPickerUser, VirtualMessageList, closeAllDropdowns, dedupMessages, defaultMessageRenderers, formatDateLabel, formatTime, getDateKey, getMessageUserId, replaceMentionsForPreview, useBannedState, useBlockedState, useCallContext, useChannel, useChannelListUpdates, useChannelMessages, useChannelRowUpdates, useChatClient, useLoadMessages, useMentions, useMessageActions, usePendingState, useScrollToMessage, useTypingIndicator };
1586
+ export { type AddMemberButtonProps, type AddMemberModalProps, type AddMemberUserItemProps, type AttachButtonProps, type AttachmentItem, AttachmentList, type AttachmentProps, Avatar, type AvatarProps, type CallContextValue, Channel, type ChannelAction, type ChannelActionsProps, ChannelHeader, type ChannelHeaderData, type ChannelHeaderProps, ChannelInfo, type ChannelInfoActionsProps, type ChannelInfoCoverProps, type ChannelInfoEmptyStateProps, type ChannelInfoFileItemProps, type ChannelInfoHeaderProps, type ChannelInfoLinkItemProps, type ChannelInfoMediaItemProps, type ChannelInfoMemberItemProps, type ChannelInfoProps, type ChannelInfoTabsProps, ChannelItem, type ChannelItemProps, ChannelList, type ChannelListProps, type ChannelProps, ChannelTopicGroup, type ChatContextValue, ChatProvider, type ChatProviderProps, CreateChannelModal, type CreateChannelModalProps, type DateSeparatorProps, DefaultChannelActions, DefaultChannelInfoActions, DefaultChannelInfoCover, DefaultChannelInfoHeader, DefaultChannelInfoTabs, Dropdown, type DropdownProps, type EmojiButtonProps, type EmojiPickerProps, type ErmisCallConnectedAudioProps, type ErmisCallConnectedVideoProps, ErmisCallContext, type ErmisCallControlsBarProps, type ErmisCallErrorProps, ErmisCallProvider, type ErmisCallProviderProps, type ErmisCallRingingProps, ErmisCallUI, type ErmisCallUIProps, ErrorMessage, type FilePreviewItem, FilesPreview, type FilesPreviewProps, type ForwardChannelItemProps, ForwardMessageModal, type ForwardMessageModalProps, type JumpToLatestProps, type LatestReaction, type MediaTab, type MentionMember, type MentionPayload, MentionSuggestions, type MentionSuggestionsProps, MessageActionsBox, type MessageActionsBoxProps, MessageAttachment, type MessageBubbleProps, MessageInput, type MessageInputProps, MessageItem, type MessageItemProps, type MessageListProps, MessageQuickReactions, MessageReactions, type MessageReactionsProps, type MessageRendererProps, Modal, type ModalProps, Panel, type PinnedMessageItemProps, PinnedMessages, type PinnedMessagesProps, PollMessage, QuotedMessagePreview, type QuotedMessagePreviewProps, type ReactionUser, RegularMessage, ReplyPreview, type ReplyPreviewProps, type SendButtonProps, SignalMessage, StickerMessage, SystemMessage, SystemMessageItem, type SystemMessageItemProps, type Theme, TopicModal, TypingIndicator, type TypingIndicatorProps, type TypingUser, type UseChannelMessagesOptions, type UseChannelReturn, type UseLoadMessagesOptions, type UseLoadMessagesReturn, type UseMentionsOptions, type UseMentionsReturn, type UseScrollToMessageOptions, type UseScrollToMessageReturn, UserPicker, type UserPickerItemProps, type UserPickerProps, type UserPickerSelectedBoxProps, type UserPickerUser, VirtualMessageList, closeAllDropdowns, computeDefaultActions, dedupMessages, defaultMessageRenderers, formatDateLabel, formatTime, getDateKey, getMessageUserId, replaceMentionsForPreview, useBannedState, useBlockedState, useCallContext, useChannel, useChannelListUpdates, useChannelMessages, useChannelRowUpdates, useChatClient, useLoadMessages, useMentions, useMessageActions, usePendingState, useScrollToMessage, useTypingIndicator };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import React$1 from 'react';
2
2
  import { Channel as Channel$1, Attachment, FormatMessageResponse, ChannelFilters, ChannelSort, ChannelQueryOptions, ErmisChat, UserCallInfo, MessageLabel, ErmisCallNode, CallStatus } from '@ermis-network/ermis-chat-sdk';
3
+ import * as react_jsx_runtime from 'react/jsx-runtime';
3
4
  import { VListHandle } from 'virtua';
4
5
 
5
6
  type Theme = 'dark' | 'light';
@@ -265,6 +266,44 @@ type ChannelHeaderData = {
265
266
  name: string;
266
267
  image?: string;
267
268
  };
269
+ type ChannelAction = {
270
+ id: string;
271
+ label: string;
272
+ icon?: React.ReactNode;
273
+ onClick: (channel: Channel$1, e: React.MouseEvent) => void;
274
+ isDanger?: boolean;
275
+ };
276
+ type ChannelActionLabels = {
277
+ pinChannel?: string;
278
+ unpinChannel?: string;
279
+ pinTopic?: string;
280
+ unpinTopic?: string;
281
+ blockUser?: string;
282
+ unblockUser?: string;
283
+ editTopic?: string;
284
+ closeTopic?: string;
285
+ reopenTopic?: string;
286
+ createTopic?: string;
287
+ deleteChannel?: string;
288
+ leaveChannel?: string;
289
+ };
290
+ type ChannelActionIcons = {
291
+ PinIcon?: React.ReactNode;
292
+ UnpinIcon?: React.ReactNode;
293
+ BlockIcon?: React.ReactNode;
294
+ UnblockIcon?: React.ReactNode;
295
+ EditTopicIcon?: React.ReactNode;
296
+ CloseTopicIcon?: React.ReactNode;
297
+ ReopenTopicIcon?: React.ReactNode;
298
+ CreateTopicIcon?: React.ReactNode;
299
+ DeleteChannelIcon?: React.ReactNode;
300
+ LeaveChannelIcon?: React.ReactNode;
301
+ };
302
+ type ChannelActionsProps = {
303
+ channel: Channel$1;
304
+ actions: ChannelAction[];
305
+ onClose: () => void;
306
+ };
268
307
  type ChannelItemProps = {
269
308
  channel: Channel$1;
270
309
  isActive: boolean;
@@ -272,6 +311,7 @@ type ChannelItemProps = {
272
311
  unreadCount: number;
273
312
  lastMessageText: string;
274
313
  lastMessageUser: string;
314
+ lastMessageTimestamp?: Date | string | null;
275
315
  onSelect: (channel: Channel$1) => void;
276
316
  AvatarComponent: React.ComponentType<AvatarProps>;
277
317
  /** Whether the current user has blocked this channel (messaging only) */
@@ -282,6 +322,22 @@ type ChannelItemProps = {
282
322
  pendingBadgeLabel?: string;
283
323
  /** Label for the blocked channel badge indicator */
284
324
  blockedBadgeLabel?: string;
325
+ isClosedTopic?: boolean;
326
+ closedTopicIcon?: React.ReactNode;
327
+ PinnedIconComponent?: React.ComponentType;
328
+ ChannelActionsComponent?: React.ComponentType<ChannelActionsProps>;
329
+ /** Handler when Create Topic action is triggered */
330
+ onAddTopic?: (channel: Channel$1) => void;
331
+ /** Handler when Edit Topic action is triggered */
332
+ onEditTopic?: (channel: Channel$1) => void;
333
+ /** Handler when Close/Reopen Topic action is triggered */
334
+ onToggleCloseTopic?: (channel: Channel$1, isClosed: boolean) => void;
335
+ /** Array of action IDs to hide from the actions dropdown */
336
+ hiddenActions?: string[];
337
+ /** Custom labels for default channel actions */
338
+ actionLabels?: ChannelActionLabels;
339
+ /** Custom icons for default channel actions */
340
+ actionIcons?: ChannelActionIcons;
285
341
  };
286
342
  type ChannelListProps = {
287
343
  filters?: ChannelFilters;
@@ -290,6 +346,8 @@ type ChannelListProps = {
290
346
  renderChannel?: (channel: Channel$1, isActive: boolean) => React.ReactNode;
291
347
  onChannelSelect?: (channel: Channel$1) => void;
292
348
  className?: string;
349
+ /** Array of action IDs to hide from the actions dropdown */
350
+ hiddenActions?: string[];
293
351
  LoadingIndicator?: React.ComponentType<{
294
352
  text?: string;
295
353
  }>;
@@ -311,6 +369,30 @@ type ChannelListProps = {
311
369
  emptyStateLabel?: string;
312
370
  /** Label for the blocked channel badge hover */
313
371
  blockedBadgeLabel?: string;
372
+ /** Custom component for rendering topic group */
373
+ ChannelTopicGroupComponent?: React.ComponentType<any>;
374
+ /** Custom avatar component for general topic */
375
+ GeneralTopicAvatarComponent?: React.ComponentType<any>;
376
+ /** Custom avatar component for other topics */
377
+ TopicAvatarComponent?: React.ComponentType<any>;
378
+ /** Name for the general topic (default: "general") */
379
+ generalTopicLabel?: string;
380
+ /** Handler when Add Topic button is clicked on a team channel */
381
+ onAddTopic?: (channel: Channel$1) => void;
382
+ /** Optional custom emoji picker for TopicModal */
383
+ TopicEmojiPickerComponent?: React.ComponentType<any>;
384
+ closedTopicIcon?: React.ReactNode;
385
+ PinnedIconComponent?: React.ComponentType;
386
+ /** Custom component for channel actions dropdown */
387
+ ChannelActionsComponent?: React.ComponentType<ChannelActionsProps>;
388
+ /** Handler when Edit Topic action is triggered */
389
+ onEditTopic?: (channel: Channel$1) => void;
390
+ /** Handler when Close/Reopen Topic action is triggered */
391
+ onToggleCloseTopic?: (channel: Channel$1, isClosed: boolean) => void;
392
+ /** Custom labels for default channel actions */
393
+ actionLabels?: ChannelActionLabels;
394
+ /** Custom icons for default channel actions */
395
+ actionIcons?: ChannelActionIcons;
314
396
  };
315
397
  type AttachmentProps = {
316
398
  attachment: Attachment;
@@ -389,6 +471,9 @@ type MessageListProps = {
389
471
  pendingOverlaySubtitle?: string;
390
472
  pendingAcceptLabel?: string;
391
473
  pendingRejectLabel?: string;
474
+ closedTopicOverlayTitle?: string;
475
+ closedTopicOverlaySubtitle?: string;
476
+ closedTopicReopenLabel?: string;
392
477
  };
393
478
  type ReactionUser = {
394
479
  id: string;
@@ -410,6 +495,8 @@ type MessageReactionsProps = {
410
495
  AvatarComponent?: React.ComponentType<AvatarProps>;
411
496
  /** Callback when clicking a reaction */
412
497
  onClickReaction?: (type: string) => void;
498
+ /** Whether interactions are disabled */
499
+ disabled?: boolean;
413
500
  };
414
501
  type ReadReceiptUser = {
415
502
  id: string;
@@ -542,6 +629,8 @@ type MessageInputProps = {
542
629
  sendDisabledLabel?: string;
543
630
  /** I18n Label for slow mode active */
544
631
  slowModeLabel?: (cooldown: number) => React.ReactNode;
632
+ /** I18n Label for closed topic */
633
+ closedTopicLabel?: string;
545
634
  };
546
635
  type ReplyPreviewProps = {
547
636
  message: FormatMessageResponse;
@@ -756,6 +845,10 @@ type ChannelInfoCoverProps = {
756
845
  onEditClick?: () => void;
757
846
  /** Whether the channel is public */
758
847
  isPublic?: boolean;
848
+ /** Name of the parent channel (if this is a topic) */
849
+ parentChannelName?: string;
850
+ /** Whether the channel is a topic */
851
+ isTopic?: boolean;
759
852
  /** Whether the channel is a team channel */
760
853
  isTeamChannel?: boolean;
761
854
  };
@@ -767,6 +860,8 @@ type ChannelInfoActionsProps = {
767
860
  onBlockUser?: () => void;
768
861
  onUnblockUser?: () => void;
769
862
  isTeamChannel?: boolean;
863
+ isTopic?: boolean;
864
+ isClosedTopic?: boolean;
770
865
  isBlocked?: boolean;
771
866
  currentUserRole?: string;
772
867
  searchLabel?: string;
@@ -775,6 +870,10 @@ type ChannelInfoActionsProps = {
775
870
  leaveLabel?: string;
776
871
  blockLabel?: string;
777
872
  unblockLabel?: string;
873
+ onCloseTopic?: () => void;
874
+ onReopenTopic?: () => void;
875
+ closeTopicLabel?: string;
876
+ reopenTopicLabel?: string;
778
877
  };
779
878
  type ChannelInfoMember = {
780
879
  id: string;
@@ -976,6 +1075,12 @@ type ChannelInfoProps = {
976
1075
  /** I18n labels for block/unblock actions */
977
1076
  actionsBlockLabel?: string;
978
1077
  actionsUnblockLabel?: string;
1078
+ actionsCloseTopicLabel?: string;
1079
+ actionsReopenTopicLabel?: string;
1080
+ /** Settings Panel Topics Labels */
1081
+ settingsWorkspaceTopicsTitle?: string;
1082
+ settingsTopicsFeatureName?: string;
1083
+ settingsTopicsFeatureDescription?: string;
979
1084
  };
980
1085
  /** Individual user item in UserPicker */
981
1086
  type UserPickerUser = {
@@ -1060,6 +1165,30 @@ type CreateChannelModalProps = {
1060
1165
  maxImageSize?: number;
1061
1166
  maxImageSizeError?: string;
1062
1167
  };
1168
+ type TopicModalProps = {
1169
+ isOpen: boolean;
1170
+ onClose: () => void;
1171
+ onSuccess?: (channel: Channel$1) => void;
1172
+ /** Inject external emoji picker component */
1173
+ EmojiPickerComponent?: React.ComponentType<{
1174
+ onSelect: (emoji: any) => void;
1175
+ [key: string]: any;
1176
+ }>;
1177
+ /** Parent team channel to create topic under, will use activeChannel if not provided */
1178
+ parentChannel?: Channel$1;
1179
+ /** If provided, operates in edit mode for this topic */
1180
+ topic?: Channel$1;
1181
+ /** i18n labels */
1182
+ title?: string;
1183
+ nameLabel?: string;
1184
+ namePlaceholder?: string;
1185
+ emojiLabel?: string;
1186
+ descriptionLabel?: string;
1187
+ descriptionPlaceholder?: string;
1188
+ cancelButtonLabel?: string;
1189
+ saveButtonLabel?: string;
1190
+ savingButtonLabel?: string;
1191
+ };
1063
1192
 
1064
1193
  declare const ChatProvider: React$1.FC<ChatProviderProps>;
1065
1194
 
@@ -1095,6 +1224,7 @@ declare function useChannelRowUpdates(channel: Channel$1, currentUserId?: string
1095
1224
  *
1096
1225
  * Reads the initial value from `channel.state.membership.banned` and subscribes
1097
1226
  * to `member.banned` / `member.unbanned` WebSocket events for real-time updates.
1227
+ * If the channel is a topic, it also synchronizes with the parent channel's ban state.
1098
1228
  *
1099
1229
  * Only triggers a re-render when the *current user* is the target of the event.
1100
1230
  */
@@ -1132,7 +1262,18 @@ declare function usePendingState(channel: Channel$1 | null | undefined, currentU
1132
1262
  */
1133
1263
  declare const Avatar: React$1.FC<AvatarProps>;
1134
1264
 
1265
+ declare function computeDefaultActions(channel: Channel$1, currentUserId?: string, options?: {
1266
+ onAddTopic?: (channel: Channel$1) => void;
1267
+ onEditTopic?: (channel: Channel$1) => void;
1268
+ onToggleCloseTopic?: (channel: Channel$1, isClosed: boolean) => void;
1269
+ isBlocked?: boolean;
1270
+ actionLabels?: ChannelActionLabels;
1271
+ actionIcons?: ChannelActionIcons;
1272
+ }): ChannelAction[];
1273
+ declare const DefaultChannelActions: React$1.FC<ChannelActionsProps>;
1274
+
1135
1275
  declare const ChannelItem: React$1.FC<ChannelItemProps>;
1276
+ declare const ChannelTopicGroup: React$1.MemoExoticComponent<({ channel, activeChannel, handleSelect, renderChannel, ChannelItemComponent, AvatarComponent, GeneralTopicAvatarComponent, TopicAvatarComponent, currentUserId, pendingBadgeLabel, blockedBadgeLabel, generalTopicLabel, closedTopicIcon, PinnedIconComponent, ChannelActionsComponent, onAddTopic, onEditTopic, onToggleCloseTopic, hiddenActions, actionLabels, actionIcons, }: any) => react_jsx_runtime.JSX.Element>;
1136
1277
  declare const ChannelList: React$1.FC<ChannelListProps>;
1137
1278
 
1138
1279
  /**
@@ -1193,6 +1334,7 @@ declare const MessageReactions: React$1.FC<MessageReactionsProps>;
1193
1334
  declare const MessageQuickReactions: React$1.FC<{
1194
1335
  message: FormatMessageResponse;
1195
1336
  isOwnMessage: boolean;
1337
+ disabled?: boolean;
1196
1338
  }>;
1197
1339
 
1198
1340
  type MessageActionList = {
@@ -1340,6 +1482,8 @@ declare const ReplyPreview: React$1.FC<ReplyPreviewProps>;
1340
1482
 
1341
1483
  declare const ForwardMessageModal: React$1.FC<ForwardMessageModalProps>;
1342
1484
 
1485
+ declare const TopicModal: React$1.FC<TopicModalProps>;
1486
+
1343
1487
  type TypingUser = {
1344
1488
  id: string;
1345
1489
  name?: string;
@@ -1439,4 +1583,4 @@ declare const ErmisCallProvider: React$1.FC<ErmisCallProviderProps>;
1439
1583
 
1440
1584
  declare const ErmisCallUI: React$1.FC<ErmisCallUIProps>;
1441
1585
 
1442
- export { type AddMemberButtonProps, type AddMemberModalProps, type AddMemberUserItemProps, type AttachButtonProps, type AttachmentItem, AttachmentList, type AttachmentProps, Avatar, type AvatarProps, type CallContextValue, Channel, ChannelHeader, type ChannelHeaderData, type ChannelHeaderProps, ChannelInfo, type ChannelInfoActionsProps, type ChannelInfoCoverProps, type ChannelInfoEmptyStateProps, type ChannelInfoFileItemProps, type ChannelInfoHeaderProps, type ChannelInfoLinkItemProps, type ChannelInfoMediaItemProps, type ChannelInfoMemberItemProps, type ChannelInfoProps, type ChannelInfoTabsProps, ChannelItem, type ChannelItemProps, ChannelList, type ChannelListProps, type ChannelProps, type ChatContextValue, ChatProvider, type ChatProviderProps, CreateChannelModal, type CreateChannelModalProps, type DateSeparatorProps, DefaultChannelInfoActions, DefaultChannelInfoCover, DefaultChannelInfoHeader, DefaultChannelInfoTabs, Dropdown, type DropdownProps, type EmojiButtonProps, type EmojiPickerProps, type ErmisCallConnectedAudioProps, type ErmisCallConnectedVideoProps, ErmisCallContext, type ErmisCallControlsBarProps, type ErmisCallErrorProps, ErmisCallProvider, type ErmisCallProviderProps, type ErmisCallRingingProps, ErmisCallUI, type ErmisCallUIProps, ErrorMessage, type FilePreviewItem, FilesPreview, type FilesPreviewProps, type ForwardChannelItemProps, ForwardMessageModal, type ForwardMessageModalProps, type JumpToLatestProps, type LatestReaction, type MediaTab, type MentionMember, type MentionPayload, MentionSuggestions, type MentionSuggestionsProps, MessageActionsBox, type MessageActionsBoxProps, MessageAttachment, type MessageBubbleProps, MessageInput, type MessageInputProps, MessageItem, type MessageItemProps, type MessageListProps, MessageQuickReactions, MessageReactions, type MessageReactionsProps, type MessageRendererProps, Modal, type ModalProps, Panel, type PinnedMessageItemProps, PinnedMessages, type PinnedMessagesProps, PollMessage, QuotedMessagePreview, type QuotedMessagePreviewProps, type ReactionUser, RegularMessage, ReplyPreview, type ReplyPreviewProps, type SendButtonProps, SignalMessage, StickerMessage, SystemMessage, SystemMessageItem, type SystemMessageItemProps, type Theme, TypingIndicator, type TypingIndicatorProps, type TypingUser, type UseChannelMessagesOptions, type UseChannelReturn, type UseLoadMessagesOptions, type UseLoadMessagesReturn, type UseMentionsOptions, type UseMentionsReturn, type UseScrollToMessageOptions, type UseScrollToMessageReturn, UserPicker, type UserPickerItemProps, type UserPickerProps, type UserPickerSelectedBoxProps, type UserPickerUser, VirtualMessageList, closeAllDropdowns, dedupMessages, defaultMessageRenderers, formatDateLabel, formatTime, getDateKey, getMessageUserId, replaceMentionsForPreview, useBannedState, useBlockedState, useCallContext, useChannel, useChannelListUpdates, useChannelMessages, useChannelRowUpdates, useChatClient, useLoadMessages, useMentions, useMessageActions, usePendingState, useScrollToMessage, useTypingIndicator };
1586
+ export { type AddMemberButtonProps, type AddMemberModalProps, type AddMemberUserItemProps, type AttachButtonProps, type AttachmentItem, AttachmentList, type AttachmentProps, Avatar, type AvatarProps, type CallContextValue, Channel, type ChannelAction, type ChannelActionsProps, ChannelHeader, type ChannelHeaderData, type ChannelHeaderProps, ChannelInfo, type ChannelInfoActionsProps, type ChannelInfoCoverProps, type ChannelInfoEmptyStateProps, type ChannelInfoFileItemProps, type ChannelInfoHeaderProps, type ChannelInfoLinkItemProps, type ChannelInfoMediaItemProps, type ChannelInfoMemberItemProps, type ChannelInfoProps, type ChannelInfoTabsProps, ChannelItem, type ChannelItemProps, ChannelList, type ChannelListProps, type ChannelProps, ChannelTopicGroup, type ChatContextValue, ChatProvider, type ChatProviderProps, CreateChannelModal, type CreateChannelModalProps, type DateSeparatorProps, DefaultChannelActions, DefaultChannelInfoActions, DefaultChannelInfoCover, DefaultChannelInfoHeader, DefaultChannelInfoTabs, Dropdown, type DropdownProps, type EmojiButtonProps, type EmojiPickerProps, type ErmisCallConnectedAudioProps, type ErmisCallConnectedVideoProps, ErmisCallContext, type ErmisCallControlsBarProps, type ErmisCallErrorProps, ErmisCallProvider, type ErmisCallProviderProps, type ErmisCallRingingProps, ErmisCallUI, type ErmisCallUIProps, ErrorMessage, type FilePreviewItem, FilesPreview, type FilesPreviewProps, type ForwardChannelItemProps, ForwardMessageModal, type ForwardMessageModalProps, type JumpToLatestProps, type LatestReaction, type MediaTab, type MentionMember, type MentionPayload, MentionSuggestions, type MentionSuggestionsProps, MessageActionsBox, type MessageActionsBoxProps, MessageAttachment, type MessageBubbleProps, MessageInput, type MessageInputProps, MessageItem, type MessageItemProps, type MessageListProps, MessageQuickReactions, MessageReactions, type MessageReactionsProps, type MessageRendererProps, Modal, type ModalProps, Panel, type PinnedMessageItemProps, PinnedMessages, type PinnedMessagesProps, PollMessage, QuotedMessagePreview, type QuotedMessagePreviewProps, type ReactionUser, RegularMessage, ReplyPreview, type ReplyPreviewProps, type SendButtonProps, SignalMessage, StickerMessage, SystemMessage, SystemMessageItem, type SystemMessageItemProps, type Theme, TopicModal, TypingIndicator, type TypingIndicatorProps, type TypingUser, type UseChannelMessagesOptions, type UseChannelReturn, type UseLoadMessagesOptions, type UseLoadMessagesReturn, type UseMentionsOptions, type UseMentionsReturn, type UseScrollToMessageOptions, type UseScrollToMessageReturn, UserPicker, type UserPickerItemProps, type UserPickerProps, type UserPickerSelectedBoxProps, type UserPickerUser, VirtualMessageList, closeAllDropdowns, computeDefaultActions, dedupMessages, defaultMessageRenderers, formatDateLabel, formatTime, getDateKey, getMessageUserId, replaceMentionsForPreview, useBannedState, useBlockedState, useCallContext, useChannel, useChannelListUpdates, useChannelMessages, useChannelRowUpdates, useChatClient, useLoadMessages, useMentions, useMessageActions, usePendingState, useScrollToMessage, useTypingIndicator };