stream-chat-angular 4.27.1 → 4.29.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.
@@ -189,6 +189,8 @@ export declare class ChannelService<T extends DefaultStreamChatGenerics = Defaul
189
189
  set shouldMarkActiveChannelAsRead(shouldMarkActiveChannelAsRead: boolean);
190
190
  /**
191
191
  * Sets the given `channel` as active and marks it as read.
192
+ * If the channel wasn't previously part of the channel, it will be added to the beginning of the list.
193
+ *
192
194
  * @param channel
193
195
  */
194
196
  setAsActiveChannel(channel: Channel<T>): void;
@@ -296,6 +298,12 @@ export declare class ChannelService<T extends DefaultStreamChatGenerics = Defaul
296
298
  * @param message The message to select, if called with `undefined`, it deselects the message
297
299
  */
298
300
  selectMessageToQuote(message: StreamMessage | undefined): void;
301
+ /**
302
+ * Add a new channel to the channel list
303
+ * The channel will be added to the beginning of the channel list
304
+ * @param channel
305
+ */
306
+ addChannel(channel: Channel<T>): void;
299
307
  private sendMessageRequest;
300
308
  /**
301
309
  * Jumps to the selected message inside the message list, if the message is not yet loaded, it'll load the message (and it's surroundings) from the API.
@@ -3,6 +3,7 @@ import { ReactionResponse } from 'stream-chat';
3
3
  import { ChannelService } from '../channel.service';
4
4
  import { MessageReactionType, DefaultStreamChatGenerics } from '../types';
5
5
  import { NgxPopperjsTriggers, NgxPopperjsPlacements } from 'ngx-popperjs';
6
+ import { MessageReactionsService } from '../message-reactions.service';
6
7
  import * as i0 from "@angular/core";
7
8
  /**
8
9
  * The `MessageReactions` component displays the reactions of a message, the current user can add and remove reactions. You can read more about [message reactions](https://getstream.io/chat/docs/javascript/send_reaction/?language=javascript) in the platform documentation.
@@ -10,6 +11,7 @@ import * as i0 from "@angular/core";
10
11
  export declare class MessageReactionsComponent implements AfterViewChecked, OnChanges {
11
12
  private cdRef;
12
13
  private channelService;
14
+ private messageReactionsService;
13
15
  /**
14
16
  * The id of the message the reactions belong to
15
17
  */
@@ -46,7 +48,7 @@ export declare class MessageReactionsComponent implements AfterViewChecked, OnCh
46
48
  currentTooltipTarget: HTMLElement | undefined;
47
49
  popperTriggerHover: NgxPopperjsTriggers;
48
50
  popperPlacementAuto: NgxPopperjsPlacements;
49
- constructor(cdRef: ChangeDetectorRef, channelService: ChannelService);
51
+ constructor(cdRef: ChangeDetectorRef, channelService: ChannelService, messageReactionsService: MessageReactionsService);
50
52
  ngOnChanges(changes: SimpleChanges): void;
51
53
  ngAfterViewChecked(): void;
52
54
  get existingReactions(): MessageReactionType[];
@@ -57,7 +59,7 @@ export declare class MessageReactionsComponent implements AfterViewChecked, OnCh
57
59
  getUsersByReaction(reactionType: MessageReactionType): string;
58
60
  showTooltip(event: Event, reactionType: MessageReactionType): void;
59
61
  hideTooltip(): void;
60
- trackByMessageReaction(index: number, item: MessageReactionType): MessageReactionType;
62
+ trackByMessageReaction(index: number, item: MessageReactionType): string;
61
63
  react(type: MessageReactionType): void;
62
64
  isOwnReaction(reactionType: MessageReactionType): boolean;
63
65
  private eventHandler;
@@ -0,0 +1,32 @@
1
+ import { MessageReactionType } from './types';
2
+ import { BehaviorSubject } from 'rxjs';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * The `MessageReactionsService` allows you to set which [reactions](https://getstream.io/chat/docs/javascript/send_reaction/?language=javascript) are enabled and their associated emoji.
6
+ *
7
+ */
8
+ export declare class MessageReactionsService {
9
+ /**
10
+ * The enabled [reactions](https://getstream.io/chat/docs/javascript/send_reaction/?language=javascript) and the associated emoji
11
+ *
12
+ * You can provide any string as a reaction. The emoji can be provided as a string, if you want to use custom images for reactions you have to provide a [custom reactions UI](../../services/CustomTemplatesService/#messagereactionstemplate)
13
+ */
14
+ reactions$: BehaviorSubject<{
15
+ [x: string]: string;
16
+ }>;
17
+ constructor();
18
+ /**
19
+ * Sets the enabled reactions
20
+ */
21
+ set reactions(reactions: {
22
+ [key in MessageReactionType]: string;
23
+ });
24
+ /**
25
+ * Get the currently enabled reactions
26
+ */
27
+ get reactions(): {
28
+ [key in MessageReactionType]: string;
29
+ };
30
+ static ɵfac: i0.ɵɵFactoryDeclaration<MessageReactionsService, never>;
31
+ static ɵprov: i0.ɵɵInjectableDeclaration<MessageReactionsService>;
32
+ }
package/lib/types.d.ts CHANGED
@@ -200,7 +200,7 @@ export declare type ThreadHeaderContext = {
200
200
  parentMessage: StreamMessage | undefined;
201
201
  closeThreadHandler: Function;
202
202
  };
203
- export declare type MessageReactionType = 'angry' | 'haha' | 'like' | 'love' | 'sad' | 'wow';
203
+ export declare type MessageReactionType = 'angry' | 'haha' | 'like' | 'love' | 'sad' | 'wow' | string;
204
204
  export declare type AttachmentConfigration = {
205
205
  url: string;
206
206
  height: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stream-chat-angular",
3
- "version": "4.27.1",
3
+ "version": "4.29.0",
4
4
  "description": "Angular components to create chat conversations or livestream style chat",
5
5
  "author": "GetStream",
6
6
  "homepage": "https://getstream.io/chat/",
package/public-api.d.ts CHANGED
@@ -50,4 +50,5 @@ export * from './lib/stream-autocomplete-textarea.module';
50
50
  export * from './lib/stream-textarea.module';
51
51
  export * from './lib/injection-tokens';
52
52
  export * from './lib/custom-templates.service';
53
+ export * from './lib/message-reactions.service';
53
54
  export * from './lib/types';
@@ -1 +1 @@
1
- export const version = '4.27.1';
1
+ export const version = '4.29.0';