stream-chat-angular 2.2.0 → 2.5.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.
@@ -1,12 +1,15 @@
1
+ import { TemplateRef, OnChanges, SimpleChanges } from '@angular/core';
1
2
  import { UserResponse } from 'stream-chat';
2
3
  import { ChannelService } from '../channel.service';
3
4
  import { ChatClientService } from '../chat-client.service';
4
5
  import { MessageActions } from '../message-actions-box/message-actions-box.component';
5
6
  import { DefaultUserType, StreamMessage } from '../types';
6
7
  import * as i0 from "@angular/core";
7
- export declare class MessageComponent {
8
+ export declare class MessageComponent implements OnChanges {
8
9
  private chatClientService;
9
10
  private channelService;
11
+ messageInputTemplate: TemplateRef<any> | undefined;
12
+ mentionTemplate: TemplateRef<any> | undefined;
10
13
  message: StreamMessage | undefined;
11
14
  enabledMessageActions: MessageActions[];
12
15
  areReactionsEnabled: boolean | undefined;
@@ -18,9 +21,15 @@ export declare class MessageComponent {
18
21
  isReactionSelectorOpen: boolean;
19
22
  isPressedOnMobile: boolean;
20
23
  visibleMessageActionsCount: number;
24
+ messageTextParts: {
25
+ content: string;
26
+ type: 'text' | 'mention';
27
+ user?: UserResponse;
28
+ }[];
21
29
  private user;
22
30
  private container;
23
31
  constructor(chatClientService: ChatClientService, channelService: ChannelService);
32
+ ngOnChanges(changes: SimpleChanges): void;
24
33
  get isSentByCurrentUser(): boolean;
25
34
  get readByText(): string;
26
35
  get lastReadUser(): UserResponse<DefaultUserType<import("../types").DefaultUserTypeInternal>> | undefined;
@@ -34,5 +43,5 @@ export declare class MessageComponent {
34
43
  resendMessage(): void;
35
44
  textClicked(): void;
36
45
  static ɵfac: i0.ɵɵFactoryDeclaration<MessageComponent, never>;
37
- static ɵcmp: i0.ɵɵComponentDeclaration<MessageComponent, "stream-message", never, { "message": "message"; "enabledMessageActions": "enabledMessageActions"; "areReactionsEnabled": "areReactionsEnabled"; "canReactToMessage": "canReactToMessage"; "isLastSentMessage": "isLastSentMessage"; "canReceiveReadEvents": "canReceiveReadEvents"; }, {}, never, never>;
46
+ static ɵcmp: i0.ɵɵComponentDeclaration<MessageComponent, "stream-message", never, { "messageInputTemplate": "messageInputTemplate"; "mentionTemplate": "mentionTemplate"; "message": "message"; "enabledMessageActions": "enabledMessageActions"; "areReactionsEnabled": "areReactionsEnabled"; "canReactToMessage": "canReactToMessage"; "isLastSentMessage": "isLastSentMessage"; "canReceiveReadEvents": "canReceiveReadEvents"; }, {}, never, never>;
38
47
  }
@@ -1,4 +1,4 @@
1
- import { EventEmitter, OnChanges, SimpleChanges } from '@angular/core';
1
+ import { EventEmitter, OnChanges, SimpleChanges, TemplateRef } from '@angular/core';
2
2
  import { ChannelService } from '../channel.service';
3
3
  import { ChatClientService } from '../chat-client.service';
4
4
  import { NotificationService } from '../notification.service';
@@ -9,6 +9,7 @@ export declare class MessageActionsBoxComponent implements OnChanges {
9
9
  private chatClientService;
10
10
  private notificationService;
11
11
  private channelService;
12
+ messageInputTemplate: TemplateRef<any> | undefined;
12
13
  isOpen: boolean;
13
14
  isMine: boolean;
14
15
  message: StreamMessage | undefined;
@@ -31,8 +32,8 @@ export declare class MessageActionsBoxComponent implements OnChanges {
31
32
  quoteClicked(): void;
32
33
  editClicked(): void;
33
34
  sendClicked(): void;
34
- modalClosed(): void;
35
+ modalClosed: () => void;
35
36
  deleteClicked(): Promise<void>;
36
37
  static ɵfac: i0.ɵɵFactoryDeclaration<MessageActionsBoxComponent, never>;
37
- static ɵcmp: i0.ɵɵComponentDeclaration<MessageActionsBoxComponent, "stream-message-actions-box", never, { "isOpen": "isOpen"; "isMine": "isMine"; "message": "message"; "enabledActions": "enabledActions"; }, { "displayedActionsCount": "displayedActionsCount"; "isEditing": "isEditing"; }, never, never>;
38
+ static ɵcmp: i0.ɵɵComponentDeclaration<MessageActionsBoxComponent, "stream-message-actions-box", never, { "messageInputTemplate": "messageInputTemplate"; "isOpen": "isOpen"; "isMine": "isMine"; "message": "message"; "enabledActions": "enabledActions"; }, { "displayedActionsCount": "displayedActionsCount"; "isEditing": "isEditing"; }, never, never>;
38
39
  }
@@ -1,4 +1,3 @@
1
- import { OnInit } from '@angular/core';
2
1
  import { AfterViewInit, ChangeDetectorRef, ComponentFactoryResolver, ComponentRef, EventEmitter, OnChanges, OnDestroy, SimpleChanges, TemplateRef, Type } from '@angular/core';
3
2
  import { Observable } from 'rxjs';
4
3
  import { UserResponse } from 'stream-chat';
@@ -9,7 +8,7 @@ import { AttachmentUpload, MentionAutcompleteListItemContext, StreamMessage } fr
9
8
  import { MessageInputConfigService } from './message-input-config.service';
10
9
  import { TextareaInterface } from './textarea.interface';
11
10
  import * as i0 from "@angular/core";
12
- export declare class MessageInputComponent implements OnInit, OnChanges, OnDestroy, AfterViewInit {
11
+ export declare class MessageInputComponent implements OnChanges, OnDestroy, AfterViewInit {
13
12
  private channelService;
14
13
  private notificationService;
15
14
  private attachmentService;
@@ -36,8 +35,8 @@ export declare class MessageInputComponent implements OnInit, OnChanges, OnDestr
36
35
  private textareaAnchor;
37
36
  private subscriptions;
38
37
  private hideNotification;
38
+ private isViewInited;
39
39
  constructor(channelService: ChannelService, notificationService: NotificationService, attachmentService: AttachmentService, configService: MessageInputConfigService, textareaType: Type<TextareaInterface>, componentFactoryResolver: ComponentFactoryResolver, cdRef: ChangeDetectorRef);
40
- ngOnInit(): void;
41
40
  ngAfterViewInit(): void;
42
41
  ngOnChanges(changes: SimpleChanges): void;
43
42
  ngOnDestroy(): void;
@@ -14,6 +14,7 @@ export declare class TextareaDirective implements OnChanges {
14
14
  readonly send: EventEmitter<void>;
15
15
  readonly userMentions: EventEmitter<UserResponse<import("stream-chat").UnknownType>[]>;
16
16
  private subscriptions;
17
+ private unpropagatedChanges;
17
18
  constructor(viewContainerRef: ViewContainerRef);
18
19
  ngOnChanges(changes: SimpleChanges): void;
19
20
  static ɵfac: i0.ɵɵFactoryDeclaration<TextareaDirective, never>;
@@ -12,6 +12,8 @@ export declare class MessageListComponent implements AfterViewChecked, OnChanges
12
12
  private chatClientService;
13
13
  private imageLoadService;
14
14
  messageTemplate: TemplateRef<any> | undefined;
15
+ messageInputTemplate: TemplateRef<any> | undefined;
16
+ mentionTemplate: TemplateRef<any> | undefined;
15
17
  areReactionsEnabled: boolean;
16
18
  enabledMessageActionsInput: MessageActions[];
17
19
  messages$: Observable<StreamMessage[]>;
@@ -41,5 +43,5 @@ export declare class MessageListComponent implements AfterViewChecked, OnChanges
41
43
  private preserveScrollbarPosition;
42
44
  private setEnabledActions;
43
45
  static ɵfac: i0.ɵɵFactoryDeclaration<MessageListComponent, never>;
44
- static ɵcmp: i0.ɵɵComponentDeclaration<MessageListComponent, "stream-message-list", never, { "messageTemplate": "messageTemplate"; "areReactionsEnabled": "areReactionsEnabled"; "enabledMessageActionsInput": "enabledMessageActions"; }, {}, never, never>;
46
+ static ɵcmp: i0.ɵɵComponentDeclaration<MessageListComponent, "stream-message-list", never, { "messageTemplate": "messageTemplate"; "messageInputTemplate": "messageInputTemplate"; "mentionTemplate": "mentionTemplate"; "areReactionsEnabled": "areReactionsEnabled"; "enabledMessageActionsInput": "enabledMessageActions"; }, {}, never, never>;
45
47
  }
@@ -16,12 +16,11 @@ import * as i14 from "./notification-list/notification-list.component";
16
16
  import * as i15 from "./attachment-preview-list/attachment-preview-list.component";
17
17
  import * as i16 from "./modal/modal.component";
18
18
  import * as i17 from "./message-input/textarea.directive";
19
- import * as i18 from "./message/highlight-mentions.pipe";
20
- import * as i19 from "@angular/common";
21
- import * as i20 from "@ngx-translate/core";
22
- import * as i21 from "./stream-avatar.module";
19
+ import * as i18 from "@angular/common";
20
+ import * as i19 from "@ngx-translate/core";
21
+ import * as i20 from "./stream-avatar.module";
23
22
  export declare class StreamChatModule {
24
23
  static ɵfac: i0.ɵɵFactoryDeclaration<StreamChatModule, never>;
25
- static ɵmod: i0.ɵɵNgModuleDeclaration<StreamChatModule, [typeof i1.ChannelComponent, typeof i2.ChannelHeaderComponent, typeof i3.ChannelListComponent, typeof i4.ChannelPreviewComponent, typeof i5.MessageComponent, typeof i6.MessageInputComponent, typeof i7.MessageListComponent, typeof i8.LoadingIndicatorComponent, typeof i9.IconComponent, typeof i10.MessageActionsBoxComponent, typeof i11.AttachmentListComponent, typeof i12.MessageReactionsComponent, typeof i13.NotificationComponent, typeof i14.NotificationListComponent, typeof i15.AttachmentPreviewListComponent, typeof i16.ModalComponent, typeof i17.TextareaDirective, typeof i18.HighlightMentionsPipe], [typeof i19.CommonModule, typeof i20.TranslateModule, typeof i21.StreamAvatarModule], [typeof i1.ChannelComponent, typeof i2.ChannelHeaderComponent, typeof i3.ChannelListComponent, typeof i4.ChannelPreviewComponent, typeof i5.MessageComponent, typeof i6.MessageInputComponent, typeof i7.MessageListComponent, typeof i8.LoadingIndicatorComponent, typeof i9.IconComponent, typeof i10.MessageActionsBoxComponent, typeof i11.AttachmentListComponent, typeof i12.MessageReactionsComponent, typeof i13.NotificationComponent, typeof i14.NotificationListComponent, typeof i15.AttachmentPreviewListComponent, typeof i16.ModalComponent, typeof i18.HighlightMentionsPipe]>;
24
+ static ɵmod: i0.ɵɵNgModuleDeclaration<StreamChatModule, [typeof i1.ChannelComponent, typeof i2.ChannelHeaderComponent, typeof i3.ChannelListComponent, typeof i4.ChannelPreviewComponent, typeof i5.MessageComponent, typeof i6.MessageInputComponent, typeof i7.MessageListComponent, typeof i8.LoadingIndicatorComponent, typeof i9.IconComponent, typeof i10.MessageActionsBoxComponent, typeof i11.AttachmentListComponent, typeof i12.MessageReactionsComponent, typeof i13.NotificationComponent, typeof i14.NotificationListComponent, typeof i15.AttachmentPreviewListComponent, typeof i16.ModalComponent, typeof i17.TextareaDirective], [typeof i18.CommonModule, typeof i19.TranslateModule, typeof i20.StreamAvatarModule], [typeof i1.ChannelComponent, typeof i2.ChannelHeaderComponent, typeof i3.ChannelListComponent, typeof i4.ChannelPreviewComponent, typeof i5.MessageComponent, typeof i6.MessageInputComponent, typeof i7.MessageListComponent, typeof i8.LoadingIndicatorComponent, typeof i9.IconComponent, typeof i10.MessageActionsBoxComponent, typeof i11.AttachmentListComponent, typeof i12.MessageReactionsComponent, typeof i13.NotificationComponent, typeof i14.NotificationListComponent, typeof i15.AttachmentPreviewListComponent, typeof i16.ModalComponent, typeof i20.StreamAvatarModule]>;
26
25
  static ɵinj: i0.ɵɵInjectorDeclaration<StreamChatModule>;
27
26
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stream-chat-angular",
3
- "version": "2.2.0",
3
+ "version": "2.5.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/",
@@ -13,7 +13,16 @@
13
13
  "@angular/core": "^12.2.0 || ^13.0.0",
14
14
  "@ngx-translate/core": "^13.0.0 || ^14.0.0",
15
15
  "stream-chat": "^4.3.0",
16
- "stream-chat-css": "^1.0.23"
16
+ "stream-chat-css": "1.0.23",
17
+ "@stream-io/stream-chat-css": "1.0.26"
18
+ },
19
+ "peerDependenciesMeta": {
20
+ "stream-chat-css": {
21
+ "optional": true
22
+ },
23
+ "@stream-io/stream-chat-css": {
24
+ "optional": true
25
+ }
17
26
  },
18
27
  "dependencies": {
19
28
  "angular-mentions": "^1.4.0",
package/public-api.d.ts CHANGED
@@ -15,7 +15,6 @@ export * from './lib/channel-list/channel-list-toggle.service';
15
15
  export * from './lib/message/message.component';
16
16
  export * from './lib/message/parse-date';
17
17
  export * from './lib/message/read-by-text';
18
- export * from './lib/message/highlight-mentions.pipe';
19
18
  export * from './lib/message-input/message-input.component';
20
19
  export * from './lib/message-input/textarea/textarea.component';
21
20
  export * from './lib/message-input/autocomplete-textarea/autocomplete-textarea.component';
@@ -38,6 +37,7 @@ export * from './lib/message-preview';
38
37
  export * from './lib/notification.service';
39
38
  export * from './lib/transliteration.service';
40
39
  export * from './lib/stream-chat.module';
40
+ export * from './lib/stream-avatar.module';
41
41
  export * from './lib/stream-autocomplete-textarea.module';
42
42
  export * from './lib/stream-textarea.module';
43
43
  export * from './lib/injection-tokens';
@@ -1 +1 @@
1
- export const version = '2.2.0';
1
+ export const version = '2.5.0';
@@ -1,23 +0,0 @@
1
- import { Pipe } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- export class HighlightMentionsPipe {
4
- transform(value, mentionedUsers) {
5
- if (!value || !mentionedUsers) {
6
- return value || '';
7
- }
8
- let result = value;
9
- mentionedUsers.forEach((u) => {
10
- result = result.replace(new RegExp(`@${u.name || u.id}`, 'g'), `<b>@${u.name || u.id}</b>`);
11
- });
12
- return result;
13
- }
14
- }
15
- HighlightMentionsPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0, type: HighlightMentionsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
16
- HighlightMentionsPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0, type: HighlightMentionsPipe, name: "highlightMentions" });
17
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0, type: HighlightMentionsPipe, decorators: [{
18
- type: Pipe,
19
- args: [{
20
- name: 'highlightMentions',
21
- }]
22
- }] });
23
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaGlnaGxpZ2h0LW1lbnRpb25zLnBpcGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9zdHJlYW0tY2hhdC1hbmd1bGFyL3NyYy9saWIvbWVzc2FnZS9oaWdobGlnaHQtbWVudGlvbnMucGlwZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsSUFBSSxFQUFpQixNQUFNLGVBQWUsQ0FBQzs7QUFNcEQsTUFBTSxPQUFPLHFCQUFxQjtJQUNoQyxTQUFTLENBQUMsS0FBYyxFQUFFLGNBQStCO1FBQ3ZEL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ycykge1xuICAgICAgcmV0dXJuIHZhbHVlIHx8ICcnO1xuICAgIH1cbiAgICBsZXQgcmVzdWx0ID0gdmFsdWU7XG4gICAgbWVudGlvbmVkVXNlcnMuZm9yRWFjaCgodSkgPT4ge1xuICAgICAgcmVzdWx0ID0gcmVzdWx0LnJlcGxhY2UoXG4gICAgICAgIG5ldyBSZWdFeHAoYEAke3UubmFtZSB8fCB1LmlkfWAsICdnJyksXG4gICAgICAgIGA8Yj5AJHt1Lm5hbWUgfHwgdS5pZH08L2I+YFxuICAgICAgKTtcbiAgICB9KTtcblxuICAgIHJldHVybiByZXN1bHQ7XG4gIH1cbn1cbiJdfQ==
@@ -1,8 +0,0 @@
1
- import { PipeTransform } from '@angular/core';
2
- import { UserResponse } from 'stream-chat';
3
- import * as i0 from "@angular/core";
4
- export declare class HighlightMentionsPipe implements PipeTransform {
5
- transform(value?: string, mentionedUsers?: UserResponse[]): string;
6
- static ɵfac: i0.ɵɵFactoryDeclaration<HighlightMentionsPipe, never>;
7
- static ɵpipe: i0.ɵɵPipeDeclaration<HighlightMentionsPipe, "highlightMentions">;
8
- }