stream-chat-angular 4.62.0 → 4.63.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.
Files changed (32) hide show
  1. package/assets/i18n/en.d.ts +1 -0
  2. package/assets/version.d.ts +1 -1
  3. package/bundles/stream-chat-angular.umd.js +381 -43
  4. package/bundles/stream-chat-angular.umd.js.map +1 -1
  5. package/esm2015/assets/i18n/en.js +2 -1
  6. package/esm2015/assets/version.js +2 -2
  7. package/esm2015/lib/attachment-list/attachment-list.component.js +10 -5
  8. package/esm2015/lib/custom-templates.service.js +5 -1
  9. package/esm2015/lib/icon/icon.component.js +2 -2
  10. package/esm2015/lib/stream-chat.module.js +13 -3
  11. package/esm2015/lib/voice-recording/voice-recording-wavebar/voice-recording-wavebar.component.js +192 -0
  12. package/esm2015/lib/voice-recording/voice-recording.component.js +115 -0
  13. package/esm2015/public-api.js +3 -1
  14. package/fesm2015/stream-chat-angular.js +343 -30
  15. package/fesm2015/stream-chat-angular.js.map +1 -1
  16. package/lib/attachment-list/attachment-list.component.d.ts +1 -0
  17. package/lib/custom-templates.service.d.ts +4 -0
  18. package/lib/icon/icon.component.d.ts +1 -1
  19. package/lib/stream-chat.module.d.ts +7 -5
  20. package/lib/voice-recording/voice-recording-wavebar/voice-recording-wavebar.component.d.ts +43 -0
  21. package/lib/voice-recording/voice-recording.component.d.ts +31 -0
  22. package/package.json +2 -2
  23. package/public-api.d.ts +2 -0
  24. package/src/assets/i18n/en.ts +1 -0
  25. package/src/assets/styles/v2/css/index.css +3 -1
  26. package/src/assets/styles/v2/css/index.layout.css +3 -1
  27. package/src/assets/styles/v2/scss/AttachmentList/AttachmentList-layout.scss +127 -1
  28. package/src/assets/styles/v2/scss/AttachmentList/AttachmentList-theme.scss +91 -2
  29. package/src/assets/styles/v2/scss/ImageCarousel/ImageCarousel-layout.scss +11 -2
  30. package/src/assets/styles/v2/scss/ImageCarousel/ImageCarousel-theme.scss +14 -0
  31. package/src/assets/styles/v2/scss/Message/Message-layout.scss +2 -2
  32. package/src/assets/version.ts +1 -1
@@ -45,6 +45,7 @@ export declare class AttachmentListComponent implements OnChanges {
45
45
  isGallery(attachment: Attachment): boolean;
46
46
  isVideo(attachment: Attachment): boolean | "" | undefined;
47
47
  isCard(attachment: Attachment): boolean;
48
+ isVoiceMessage(attachment: Attachment): boolean;
48
49
  hasFileSize(attachment: Attachment<DefaultStreamChatGenerics>): boolean | "" | 0 | undefined;
49
50
  getFileSize(attachment: Attachment<DefaultStreamChatGenerics>): string;
50
51
  getModalContext(): ModalContext;
@@ -172,6 +172,10 @@ export declare class CustomTemplatesService<T extends DefaultStreamChatGenerics
172
172
  * The template that can be used to override how a single image attachment is displayed inside the [attachment list](../components/AttachmentListComponent.mdx)
173
173
  */
174
174
  imageAttachmentTemplate$: BehaviorSubject<TemplateRef<AttachmentContext> | undefined>;
175
+ /**
176
+ * The template that can be used to override how a voice recording attachment is displayed inside the [attachment list](../components/AttachmentListComponent.mdx), by default the [voice recording component](../components/VoiceRecordingComponent.mdx) is used
177
+ */
178
+ voiceRecordingAttachmentTemplate$: BehaviorSubject<TemplateRef<AttachmentContext> | undefined>;
175
179
  /**
176
180
  * The template that can be used to override how a video attachment is displayed inside the [attachment list](../components/AttachmentListComponent.mdx)
177
181
  */
@@ -1,5 +1,5 @@
1
1
  import * as i0 from "@angular/core";
2
- export declare type Icon = 'action-icon' | 'delivered-icon' | 'reaction-icon' | 'connection-error' | 'send' | 'file-upload' | 'retry' | 'close' | 'file' | 'reply' | 'close-no-outline' | 'reply-in-thread' | 'arrow-left' | 'arrow-right' | 'menu' | 'arrow-up' | 'arrow-down' | 'chat-bubble' | 'attach' | 'unspecified-filetype' | 'download' | 'error';
2
+ export declare type Icon = 'action-icon' | 'delivered-icon' | 'reaction-icon' | 'connection-error' | 'send' | 'file-upload' | 'retry' | 'close' | 'file' | 'audio-file' | 'reply' | 'close-no-outline' | 'reply-in-thread' | 'arrow-left' | 'arrow-right' | 'menu' | 'arrow-up' | 'arrow-down' | 'chat-bubble' | 'attach' | 'unspecified-filetype' | 'download' | 'error' | 'play' | 'pause';
3
3
  /**
4
4
  * The `Icon` component can be used to display different icons (i. e. message delivered icon).
5
5
  */
@@ -21,12 +21,14 @@ import * as i19 from "./icon-placeholder/icon-placeholder.component";
21
21
  import * as i20 from "./loading-indicator-placeholder/loading-indicator-placeholder.component";
22
22
  import * as i21 from "./edit-message-form/edit-message-form.component";
23
23
  import * as i22 from "./message-bounce-prompt/message-bounce-prompt.component";
24
- import * as i23 from "@angular/common";
25
- import * as i24 from "@ngx-translate/core";
26
- import * as i25 from "./stream-avatar.module";
27
- import * as i26 from "ngx-popperjs";
24
+ import * as i23 from "./voice-recording/voice-recording.component";
25
+ import * as i24 from "./voice-recording/voice-recording-wavebar/voice-recording-wavebar.component";
26
+ import * as i25 from "@angular/common";
27
+ import * as i26 from "@ngx-translate/core";
28
+ import * as i27 from "./stream-avatar.module";
29
+ import * as i28 from "ngx-popperjs";
28
30
  export declare class StreamChatModule {
29
31
  static ɵfac: i0.ɵɵFactoryDeclaration<StreamChatModule, never>;
30
- 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.ThreadComponent, typeof i19.IconPlaceholderComponent, typeof i20.LoadingIndicatorPlaceholderComponent, typeof i21.EditMessageFormComponent, typeof i22.MessageBouncePromptComponent], [typeof i23.CommonModule, typeof i24.TranslateModule, typeof i25.StreamAvatarModule, typeof i26.NgxPopperjsModule], [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 i25.StreamAvatarModule, typeof i18.ThreadComponent, typeof i19.IconPlaceholderComponent, typeof i20.LoadingIndicatorPlaceholderComponent, typeof i21.EditMessageFormComponent, typeof i22.MessageBouncePromptComponent]>;
32
+ 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.ThreadComponent, typeof i19.IconPlaceholderComponent, typeof i20.LoadingIndicatorPlaceholderComponent, typeof i21.EditMessageFormComponent, typeof i22.MessageBouncePromptComponent, typeof i23.VoiceRecordingComponent, typeof i24.VoiceRecordingWavebarComponent], [typeof i25.CommonModule, typeof i26.TranslateModule, typeof i27.StreamAvatarModule, typeof i28.NgxPopperjsModule], [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 i27.StreamAvatarModule, typeof i18.ThreadComponent, typeof i19.IconPlaceholderComponent, typeof i20.LoadingIndicatorPlaceholderComponent, typeof i21.EditMessageFormComponent, typeof i22.MessageBouncePromptComponent, typeof i23.VoiceRecordingComponent, typeof i24.VoiceRecordingWavebarComponent]>;
31
33
  static ɵinj: i0.ɵɵInjectorDeclaration<StreamChatModule>;
32
34
  }
@@ -0,0 +1,43 @@
1
+ import { AfterViewInit, ChangeDetectorRef, NgZone, OnChanges, OnInit, SimpleChanges } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ /**
4
+ * This component can be used to visualize the wave bar of a voice recording
5
+ */
6
+ export declare class VoiceRecordingWavebarComponent implements OnInit, OnChanges, AfterViewInit {
7
+ private ngZone;
8
+ private cdRef;
9
+ /**
10
+ * The audio element that plays the voice recording
11
+ */
12
+ audioElement?: HTMLAudioElement;
13
+ /**
14
+ * The waveform data to visualize
15
+ */
16
+ waveFormData: number[];
17
+ /**
18
+ * The duration of the voice recording in seconds
19
+ */
20
+ duration?: number;
21
+ resampledWaveFormData: number[];
22
+ progress: number;
23
+ isDragging: boolean;
24
+ private sampleSize;
25
+ private container?;
26
+ private isViewInited;
27
+ constructor(ngZone: NgZone, cdRef: ChangeDetectorRef);
28
+ ngOnInit(): void;
29
+ ngOnChanges(changes: SimpleChanges): void;
30
+ ngAfterViewInit(): void;
31
+ seek(event: any): void;
32
+ trackByIndex(index: number): number;
33
+ private containerSizeChanged;
34
+ private downsample;
35
+ private upsample;
36
+ private getNextBucketMean;
37
+ private mean;
38
+ private triangleAreaHeron;
39
+ private triangleBase;
40
+ private divMod;
41
+ static ɵfac: i0.ɵɵFactoryDeclaration<VoiceRecordingWavebarComponent, never>;
42
+ static ɵcmp: i0.ɵɵComponentDeclaration<VoiceRecordingWavebarComponent, "stream-voice-recording-wavebar", never, { "audioElement": "audioElement"; "waveFormData": "waveFormData"; "duration": "duration"; }, {}, never, never>;
43
+ }
@@ -0,0 +1,31 @@
1
+ import { AfterViewInit, ChangeDetectorRef, NgZone, OnChanges, SimpleChanges } from '@angular/core';
2
+ import { Attachment } from 'stream-chat';
3
+ import { DefaultStreamChatGenerics } from '../types';
4
+ import * as i0 from "@angular/core";
5
+ /**
6
+ * This component can be used to display an attachment with type `voiceRecording`. The component allows playing the attachment inside the browser.
7
+ */
8
+ export declare class VoiceRecordingComponent implements OnChanges, AfterViewInit {
9
+ private ngZone;
10
+ private cdRef;
11
+ /**
12
+ * The voice recording attachment
13
+ */
14
+ attachment?: Attachment<DefaultStreamChatGenerics>;
15
+ fileSize: string;
16
+ secondsElapsedFormatted: string;
17
+ durationFormatted: string;
18
+ secondsElapsed: number;
19
+ isError: boolean;
20
+ private audioElement?;
21
+ constructor(ngZone: NgZone, cdRef: ChangeDetectorRef);
22
+ ngOnChanges(changes: SimpleChanges): void;
23
+ ngAfterViewInit(): void;
24
+ togglePlay(): Promise<void>;
25
+ setPlaybackRate(): void;
26
+ private getFormattedDuration;
27
+ private getFileSize;
28
+ private divMod;
29
+ static ɵfac: i0.ɵɵFactoryDeclaration<VoiceRecordingComponent, never>;
30
+ static ɵcmp: i0.ɵɵComponentDeclaration<VoiceRecordingComponent, "stream-voice-recording", never, { "attachment": "attachment"; }, {}, never, never>;
31
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stream-chat-angular",
3
- "version": "4.62.0",
3
+ "version": "4.63.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/",
@@ -12,7 +12,7 @@
12
12
  "@angular/common": "^12.2.0 || ^13.0.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0",
13
13
  "@angular/core": "^12.2.0 || ^13.0.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0",
14
14
  "@ngx-translate/core": "^13.0.0 || ^14.0.0 || ^15.0.0",
15
- "stream-chat": "^8.20.0"
15
+ "stream-chat": "^8.24.0"
16
16
  },
17
17
  "dependencies": {
18
18
  "angular-mentions": "^1.4.0",
package/public-api.d.ts CHANGED
@@ -57,3 +57,5 @@ export * from './lib/date-parser.service';
57
57
  export * from './lib/types';
58
58
  export * from './lib/message.service';
59
59
  export * from './lib/message-actions.service';
60
+ export * from './lib/voice-recording/voice-recording.component';
61
+ export * from './lib/voice-recording/voice-recording-wavebar/voice-recording-wavebar.component';
@@ -118,5 +118,6 @@ export const en = {
118
118
  'This message did not meet our content guidelines',
119
119
  'Send Anyway': 'Send Anyway',
120
120
  Edited: 'Edited',
121
+ 'Error playing audio': 'Error playing audio',
121
122
  },
122
123
  };