stream-chat-angular 2.0.0 → 2.3.1

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 (36) hide show
  1. package/README.md +1 -1
  2. package/assets/i18n/en.d.ts +2 -0
  3. package/assets/version.d.ts +1 -1
  4. package/bundles/stream-chat-angular.umd.js +170 -72
  5. package/bundles/stream-chat-angular.umd.js.map +1 -1
  6. package/esm2015/assets/i18n/en.js +3 -1
  7. package/esm2015/assets/version.js +2 -2
  8. package/esm2015/lib/channel-header/channel-header.component.js +12 -3
  9. package/esm2015/lib/channel-preview/channel-preview.component.js +9 -5
  10. package/esm2015/lib/channel.service.js +18 -5
  11. package/esm2015/lib/message/message.component.js +4 -2
  12. package/esm2015/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.js +21 -11
  13. package/esm2015/lib/message-input/message-input.component.js +41 -18
  14. package/esm2015/lib/message-input/textarea.directive.js +12 -2
  15. package/esm2015/lib/message-list/message-list.component.js +3 -2
  16. package/esm2015/lib/message-reactions/message-reactions.component.js +12 -13
  17. package/esm2015/lib/stream-chat.module.js +4 -5
  18. package/esm2015/lib/transliteration.service.js +16 -0
  19. package/esm2015/public-api.js +2 -1
  20. package/fesm2015/stream-chat-angular.js +146 -61
  21. package/fesm2015/stream-chat-angular.js.map +1 -1
  22. package/lib/channel-header/channel-header.component.d.ts +1 -0
  23. package/lib/channel-preview/channel-preview.component.d.ts +1 -0
  24. package/lib/channel.service.d.ts +1 -0
  25. package/lib/message/message.component.d.ts +2 -1
  26. package/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.d.ts +7 -2
  27. package/lib/message-input/message-input.component.d.ts +10 -4
  28. package/lib/message-input/textarea.directive.d.ts +1 -0
  29. package/lib/message-list/message-list.component.d.ts +1 -0
  30. package/lib/message-reactions/message-reactions.component.d.ts +1 -1
  31. package/lib/stream-chat.module.d.ts +3 -4
  32. package/lib/transliteration.service.d.ts +7 -0
  33. package/package.json +12 -3
  34. package/public-api.d.ts +1 -0
  35. package/src/assets/i18n/en.ts +4 -0
  36. package/src/assets/version.ts +1 -1
@@ -6,6 +6,7 @@ export declare class ChannelHeaderComponent {
6
6
  private channelService;
7
7
  private channelListToggleService;
8
8
  activeChannel: Channel | undefined;
9
+ canReceiveConnectEvents: boolean | undefined;
9
10
  constructor(channelService: ChannelService, channelListToggleService: ChannelListToggleService);
10
11
  toggleMenu(event: Event): void;
11
12
  get memberCountParam(): {
@@ -9,6 +9,7 @@ export declare class ChannelPreviewComponent implements OnInit, OnDestroy {
9
9
  isUnread: boolean;
10
10
  latestMessage: string;
11
11
  private subscriptions;
12
+ private canSendReadEvents;
12
13
  constructor(channelService: ChannelService);
13
14
  ngOnInit(): void;
14
15
  ngOnDestroy(): void;
@@ -69,6 +69,7 @@ export declare class ChannelService {
69
69
  private handleChannelUpdate;
70
70
  private handleChannelTruncate;
71
71
  private get channels();
72
+ private get canSendReadEvents();
72
73
  static ɵfac: i0.ɵɵFactoryDeclaration<ChannelService, never>;
73
74
  static ɵprov: i0.ɵɵInjectableDeclaration<ChannelService>;
74
75
  }
@@ -12,6 +12,7 @@ export declare class MessageComponent {
12
12
  areReactionsEnabled: boolean | undefined;
13
13
  canReactToMessage: boolean | undefined;
14
14
  isLastSentMessage: boolean | undefined;
15
+ canReceiveReadEvents: boolean | undefined;
15
16
  isEditing: boolean | undefined;
16
17
  isActionBoxOpen: boolean;
17
18
  isReactionSelectorOpen: boolean;
@@ -33,5 +34,5 @@ export declare class MessageComponent {
33
34
  resendMessage(): void;
34
35
  textClicked(): void;
35
36
  static ɵfac: i0.ɵɵFactoryDeclaration<MessageComponent, never>;
36
- static ɵcmp: i0.ɵɵComponentDeclaration<MessageComponent, "stream-message", never, { "message": "message"; "enabledMessageActions": "enabledMessageActions"; "areReactionsEnabled": "areReactionsEnabled"; "canReactToMessage": "canReactToMessage"; "isLastSentMessage": "isLastSentMessage"; }, {}, never, never>;
37
+ static ɵcmp: i0.ɵɵComponentDeclaration<MessageComponent, "stream-message", never, { "message": "message"; "enabledMessageActions": "enabledMessageActions"; "areReactionsEnabled": "areReactionsEnabled"; "canReactToMessage": "canReactToMessage"; "isLastSentMessage": "isLastSentMessage"; "canReceiveReadEvents": "canReceiveReadEvents"; }, {}, never, never>;
37
38
  }
@@ -5,10 +5,12 @@ import { UserResponse } from 'stream-chat';
5
5
  import { ChannelService } from '../../channel.service';
6
6
  import { TextareaInterface } from '../textarea.interface';
7
7
  import { ChatClientService } from '../../chat-client.service';
8
+ import { TransliterationService } from '../../transliteration.service';
8
9
  import * as i0 from "@angular/core";
9
10
  export declare class AutocompleteTextareaComponent implements TextareaInterface, OnChanges {
10
11
  private channelService;
11
12
  private chatClientService;
13
+ private transliterationService;
12
14
  class: string;
13
15
  value: string;
14
16
  areMentionsEnabled: boolean | undefined;
@@ -25,16 +27,19 @@ export declare class AutocompleteTextareaComponent implements TextareaInterface,
25
27
  private mentionedUsers;
26
28
  private userMentionConfig;
27
29
  private searchTerm$;
28
- constructor(channelService: ChannelService, chatClientService: ChatClientService);
30
+ constructor(channelService: ChannelService, chatClientService: ChatClientService, transliterationService: TransliterationService);
29
31
  ngOnChanges(changes: SimpleChanges): void;
30
32
  filter(searchString: string, items: {
31
33
  autocompleteLabel: string;
32
- }[]): any[];
34
+ }[]): {
35
+ autocompleteLabel: string;
36
+ }[];
33
37
  mentioned(item: MentionAutcompleteListItem, triggerChar?: string): string;
34
38
  autcompleteSearchTermChanged(searchTerm: string): void;
35
39
  inputChanged(): void;
36
40
  inputLeft(): void;
37
41
  sent(event: Event): void;
42
+ private transliterate;
38
43
  private updateMentionOptions;
39
44
  private updateMentionedUsersFromText;
40
45
  static ɵfac: i0.ɵɵFactoryDeclaration<AutocompleteTextareaComponent, never>;
@@ -1,4 +1,4 @@
1
- import { ComponentFactoryResolver, ComponentRef, EventEmitter, OnChanges, OnDestroy, OnInit, SimpleChanges, TemplateRef, Type } from '@angular/core';
1
+ import { AfterViewInit, ChangeDetectorRef, ComponentFactoryResolver, ComponentRef, EventEmitter, OnChanges, OnDestroy, SimpleChanges, TemplateRef, Type } from '@angular/core';
2
2
  import { Observable } from 'rxjs';
3
3
  import { UserResponse } from 'stream-chat';
4
4
  import { AttachmentService } from '../attachment.service';
@@ -8,13 +8,14 @@ import { AttachmentUpload, MentionAutcompleteListItemContext, StreamMessage } fr
8
8
  import { MessageInputConfigService } from './message-input-config.service';
9
9
  import { TextareaInterface } from './textarea.interface';
10
10
  import * as i0 from "@angular/core";
11
- export declare class MessageInputComponent implements OnInit, OnChanges, OnDestroy {
11
+ export declare class MessageInputComponent implements OnChanges, OnDestroy, AfterViewInit {
12
12
  private channelService;
13
13
  private notificationService;
14
14
  private attachmentService;
15
15
  private configService;
16
16
  private textareaType;
17
17
  private componentFactoryResolver;
18
+ private cdRef;
18
19
  isFileUploadEnabled: boolean | undefined;
19
20
  areMentionsEnabled: boolean | undefined;
20
21
  mentionScope: 'channel' | 'application' | undefined;
@@ -24,6 +25,8 @@ export declare class MessageInputComponent implements OnInit, OnChanges, OnDestr
24
25
  message: StreamMessage | undefined;
25
26
  readonly messageUpdate: EventEmitter<void>;
26
27
  isFileUploadAuthorized: boolean | undefined;
28
+ canSendLinks: boolean | undefined;
29
+ canSendMessages: boolean | undefined;
27
30
  attachmentUploads$: Observable<AttachmentUpload[]>;
28
31
  textareaValue: string;
29
32
  textareaRef: ComponentRef<TextareaInterface> | undefined;
@@ -32,15 +35,18 @@ export declare class MessageInputComponent implements OnInit, OnChanges, OnDestr
32
35
  private textareaAnchor;
33
36
  private subscriptions;
34
37
  private hideNotification;
35
- constructor(channelService: ChannelService, notificationService: NotificationService, attachmentService: AttachmentService, configService: MessageInputConfigService, textareaType: Type<TextareaInterface>, componentFactoryResolver: ComponentFactoryResolver);
36
- ngOnInit(): void;
38
+ private isViewInited;
39
+ constructor(channelService: ChannelService, notificationService: NotificationService, attachmentService: AttachmentService, configService: MessageInputConfigService, textareaType: Type<TextareaInterface>, componentFactoryResolver: ComponentFactoryResolver, cdRef: ChangeDetectorRef);
40
+ ngAfterViewInit(): void;
37
41
  ngOnChanges(changes: SimpleChanges): void;
38
42
  ngOnDestroy(): void;
39
43
  messageSent(): Promise<void>;
44
+ get containsLinks(): boolean;
40
45
  get accept(): string;
41
46
  filesSelected(fileList: FileList | null): Promise<void>;
42
47
  private clearFileInput;
43
48
  private get isUpdate();
49
+ private initTextarea;
44
50
  static ɵfac: i0.ɵɵFactoryDeclaration<MessageInputComponent, never>;
45
51
  static ɵcmp: i0.ɵɵComponentDeclaration<MessageInputComponent, "stream-message-input", never, { "isFileUploadEnabled": "isFileUploadEnabled"; "areMentionsEnabled": "areMentionsEnabled"; "mentionScope": "mentionScope"; "mentionAutocompleteItemTemplate": "mentionAutocompleteItemTemplate"; "acceptedFileTypes": "acceptedFileTypes"; "isMultipleFileUploadEnabled": "isMultipleFileUploadEnabled"; "message": "message"; }, { "messageUpdate": "messageUpdate"; }, never, never>;
46
52
  }
@@ -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>;
@@ -16,6 +16,7 @@ export declare class MessageListComponent implements AfterViewChecked, OnChanges
16
16
  enabledMessageActionsInput: MessageActions[];
17
17
  messages$: Observable<StreamMessage[]>;
18
18
  canReactToMessage: boolean | undefined;
19
+ canReceiveReadEvents: boolean | undefined;
19
20
  enabledMessageActions: MessageActions[];
20
21
  private class;
21
22
  unreadMessageCount: number;
@@ -30,7 +30,7 @@ export declare class MessageReactionsComponent implements AfterViewChecked, OnCh
30
30
  get reactionsCount(): number;
31
31
  get reactionOptions(): MessageReactionType[];
32
32
  getLatestUserByReaction(reactionType: MessageReactionType): import("stream-chat").UserResponse<DefaultUserType<import("../types").DefaultUserTypeInternal>> | null | undefined;
33
- getEmojiNameByReaction(reactionType: MessageReactionType): string;
33
+ getEmojiByReaction(reactionType: MessageReactionType): string;
34
34
  getUsersByReaction(reactionType: MessageReactionType): string;
35
35
  showTooltip(event: Event, reactionType: MessageReactionType): void;
36
36
  hideTooltip(): void;
@@ -18,11 +18,10 @@ import * as i16 from "./modal/modal.component";
18
18
  import * as i17 from "./message-input/textarea.directive";
19
19
  import * as i18 from "./message/highlight-mentions.pipe";
20
20
  import * as i19 from "@angular/common";
21
- import * as i20 from "@ctrl/ngx-emoji-mart/ngx-emoji";
22
- import * as i21 from "@ngx-translate/core";
23
- import * as i22 from "./stream-avatar.module";
21
+ import * as i20 from "@ngx-translate/core";
22
+ import * as i21 from "./stream-avatar.module";
24
23
  export declare class StreamChatModule {
25
24
  static ɵfac: i0.ɵɵFactoryDeclaration<StreamChatModule, never>;
26
- 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.EmojiModule, typeof i21.TranslateModule, typeof i22.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]>;
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]>;
27
26
  static ɵinj: i0.ɵɵInjectorDeclaration<StreamChatModule>;
28
27
  }
@@ -0,0 +1,7 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class TransliterationService {
3
+ constructor();
4
+ transliterate(s: string): string;
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<TransliterationService, never>;
6
+ static ɵprov: i0.ɵɵInjectableDeclaration<TransliterationService>;
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stream-chat-angular",
3
- "version": "2.0.0",
3
+ "version": "2.3.1",
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,11 +13,20 @@
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",
20
- "@ctrl/ngx-emoji-mart": "^6.0.1",
29
+ "@stream-io/transliterate": "^1.5.2",
21
30
  "dayjs": "^1.10.7",
22
31
  "pretty-bytes": "^5.6.0",
23
32
  "tslib": "^2.3.0",
package/public-api.d.ts CHANGED
@@ -36,6 +36,7 @@ export * from './lib/is-image-attachment';
36
36
  export * from './lib/device-width';
37
37
  export * from './lib/message-preview';
38
38
  export * from './lib/notification.service';
39
+ export * from './lib/transliteration.service';
39
40
  export * from './lib/stream-chat.module';
40
41
  export * from './lib/stream-autocomplete-textarea.module';
41
42
  export * from './lib/stream-textarea.module';
@@ -86,5 +86,9 @@ export const en = {
86
86
  failed: 'failed',
87
87
  retry: 'retry',
88
88
  test: 'success',
89
+ 'Sending links is not allowed in this conversation':
90
+ 'Sending links is not allowed in this conversation',
91
+ "You can't send messages in this channel":
92
+ "You can't send messages in this channel",
89
93
  },
90
94
  };
@@ -1 +1 @@
1
- export const version = '2.0.0';
1
+ export const version = '2.3.1';