stream-chat-angular 4.65.3 → 4.66.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.
- package/assets/version.d.ts +1 -1
- package/bundles/stream-chat-angular.umd.js +169 -116
- package/bundles/stream-chat-angular.umd.js.map +1 -1
- package/esm2015/assets/version.js +2 -2
- package/esm2015/lib/channel-preview/channel-preview.component.js +42 -8
- package/esm2015/lib/date-parser.service.js +12 -1
- package/esm2015/lib/icon/icon.component.js +2 -2
- package/esm2015/lib/is-on-separate-date.js +11 -0
- package/esm2015/lib/message/message.component.js +2 -2
- package/esm2015/lib/message-list/message-list.component.js +3 -10
- package/esm2015/lib/parse-date.js +19 -11
- package/esm2015/lib/types.js +1 -1
- package/esm2015/public-api.js +2 -1
- package/fesm2015/stream-chat-angular.js +143 -91
- package/fesm2015/stream-chat-angular.js.map +1 -1
- package/lib/channel-preview/channel-preview.component.d.ts +7 -2
- package/lib/date-parser.service.d.ts +10 -0
- package/lib/icon/icon.component.d.ts +1 -1
- package/lib/is-on-separate-date.d.ts +1 -0
- package/lib/parse-date.d.ts +1 -1
- package/lib/types.d.ts +8 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
- package/src/assets/styles/v2/css/index.css +1 -1
- package/src/assets/styles/v2/css/index.layout.css +1 -1
- package/src/assets/styles/v2/scss/ChannelPreview/ChannelPreview-layout.scss +19 -2
- package/src/assets/styles/v2/scss/ChannelPreview/ChannelPreview-theme.scss +21 -0
- package/src/assets/version.ts +1 -1
|
@@ -5,6 +5,7 @@ import { DefaultStreamChatGenerics } from '../types';
|
|
|
5
5
|
import { ChatClientService } from '../chat-client.service';
|
|
6
6
|
import { MessageService } from '../message.service';
|
|
7
7
|
import { CustomTemplatesService } from '../custom-templates.service';
|
|
8
|
+
import { DateParserService } from '../date-parser.service';
|
|
8
9
|
import * as i0 from "@angular/core";
|
|
9
10
|
/**
|
|
10
11
|
* The `ChannelPreview` component displays a channel preview in the channel list, it consists of the image, name and latest message of the channel.
|
|
@@ -14,6 +15,7 @@ export declare class ChannelPreviewComponent implements OnInit, OnDestroy {
|
|
|
14
15
|
private ngZone;
|
|
15
16
|
private chatClientService;
|
|
16
17
|
customTemplatesService: CustomTemplatesService;
|
|
18
|
+
private dateParser;
|
|
17
19
|
/**
|
|
18
20
|
* The channel to be displayed
|
|
19
21
|
*/
|
|
@@ -23,11 +25,14 @@ export declare class ChannelPreviewComponent implements OnInit, OnDestroy {
|
|
|
23
25
|
isUnread: boolean;
|
|
24
26
|
unreadCount: number | undefined;
|
|
25
27
|
latestMessageText: string;
|
|
26
|
-
|
|
28
|
+
latestMessageStatus?: 'delivered' | 'read';
|
|
29
|
+
latestMessageTime?: string;
|
|
30
|
+
latestMessage?: FormatMessageResponse<DefaultStreamChatGenerics>;
|
|
27
31
|
displayAs: 'text' | 'html';
|
|
32
|
+
userId?: string;
|
|
28
33
|
private subscriptions;
|
|
29
34
|
private canSendReadEvents;
|
|
30
|
-
constructor(channelService: ChannelService, ngZone: NgZone, chatClientService: ChatClientService, messageService: MessageService, customTemplatesService: CustomTemplatesService);
|
|
35
|
+
constructor(channelService: ChannelService, ngZone: NgZone, chatClientService: ChatClientService, messageService: MessageService, customTemplatesService: CustomTemplatesService, dateParser: DateParserService);
|
|
31
36
|
ngOnInit(): void;
|
|
32
37
|
ngOnDestroy(): void;
|
|
33
38
|
get avatarImage(): string | undefined;
|
|
@@ -3,6 +3,10 @@ import * as i0 from "@angular/core";
|
|
|
3
3
|
* The `DateParserService` parses dates into user-friendly string representations.
|
|
4
4
|
*/
|
|
5
5
|
export declare class DateParserService {
|
|
6
|
+
/**
|
|
7
|
+
* Custom parser to override `parseTime`
|
|
8
|
+
*/
|
|
9
|
+
customTimeParser?: (date: Date) => string;
|
|
6
10
|
/**
|
|
7
11
|
* Custom parser to override `parseDate`
|
|
8
12
|
*/
|
|
@@ -12,6 +16,12 @@ export declare class DateParserService {
|
|
|
12
16
|
*/
|
|
13
17
|
customDateTimeParser?: (date: Date) => string;
|
|
14
18
|
constructor();
|
|
19
|
+
/**
|
|
20
|
+
* Return a user-friendly string representation of the time
|
|
21
|
+
* @param date
|
|
22
|
+
* @returns The parsed time
|
|
23
|
+
*/
|
|
24
|
+
parseTime(date: Date): string;
|
|
15
25
|
/**
|
|
16
26
|
* Return a user-friendly string representation of the date (year, month and date)
|
|
17
27
|
* @param date
|
|
@@ -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' | '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';
|
|
2
|
+
export declare type Icon = 'action-icon' | 'delivered-icon' | 'read-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
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isOnSeparateDate: (date1: Date, date2: Date) => boolean;
|
package/lib/parse-date.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const parseDate: (date: Date, format?: 'date' | 'date-time') => string;
|
|
1
|
+
export declare const parseDate: (date: Date, format?: 'date' | 'date-time' | 'time') => string;
|
package/lib/types.d.ts
CHANGED
|
@@ -99,6 +99,14 @@ export declare type ChannelPreviewInfoContext<T extends DefaultStreamChatGeneric
|
|
|
99
99
|
* The title of the channel, or the name of the channel members
|
|
100
100
|
*/
|
|
101
101
|
channelDisplayTitle: string;
|
|
102
|
+
/**
|
|
103
|
+
* The status of the last message (only available if the last message was sent by the current user)
|
|
104
|
+
*/
|
|
105
|
+
latestMessageStatus?: 'delivered' | 'read';
|
|
106
|
+
/**
|
|
107
|
+
* The time of the last message (formatted to a user-friendly string)
|
|
108
|
+
*/
|
|
109
|
+
latestMessageTime?: string;
|
|
102
110
|
unreadCount: number;
|
|
103
111
|
};
|
|
104
112
|
export declare type MessageInputContext = {
|
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -59,3 +59,4 @@ export * from './lib/message.service';
|
|
|
59
59
|
export * from './lib/message-actions.service';
|
|
60
60
|
export * from './lib/voice-recording/voice-recording.component';
|
|
61
61
|
export * from './lib/voice-recording/voice-recording-wavebar/voice-recording-wavebar.component';
|
|
62
|
+
export * from './lib/is-on-separate-date';
|