@banta/sdk 6.0.2 → 7.0.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/fesm2022/banta-sdk.mjs +327 -6762
- package/fesm2022/banta-sdk.mjs.map +1 -1
- package/index.d.ts +1472 -3
- package/package.json +11 -13
- package/esm2022/banta-sdk.mjs +0 -5
- package/esm2022/lib/attachment-scraper.mjs +0 -2
- package/esm2022/lib/banta/banta.component.mjs +0 -207
- package/esm2022/lib/banta-logo.component.mjs +0 -11
- package/esm2022/lib/banta-sdk.module.mjs +0 -135
- package/esm2022/lib/chat/banta-chat/banta-chat.component.mjs +0 -209
- package/esm2022/lib/chat/chat-message/chat-message.component.mjs +0 -62
- package/esm2022/lib/chat/chat-view/chat-view.component.mjs +0 -166
- package/esm2022/lib/chat/chat.module.mjs +0 -51
- package/esm2022/lib/chat/index.mjs +0 -6
- package/esm2022/lib/chat/live-chat-message.component.mjs +0 -80
- package/esm2022/lib/chat-backend-base.mjs +0 -31
- package/esm2022/lib/chat-backend.mjs +0 -199
- package/esm2022/lib/chat-source-base.mjs +0 -2
- package/esm2022/lib/chat-source.mjs +0 -282
- package/esm2022/lib/comments/attachment-button/attachment-button.component.mjs +0 -75
- package/esm2022/lib/comments/attachment-scraper.directive.mjs +0 -101
- package/esm2022/lib/comments/banta-comments/banta-comments.component.mjs +0 -817
- package/esm2022/lib/comments/comment/comment.component.mjs +0 -224
- package/esm2022/lib/comments/comment-field/comment-field.component.mjs +0 -411
- package/esm2022/lib/comments/comment-sort/comment-sort.component.mjs +0 -37
- package/esm2022/lib/comments/comment-view/comment-view.component.mjs +0 -780
- package/esm2022/lib/comments/comments.module.mjs +0 -127
- package/esm2022/lib/comments/index.mjs +0 -12
- package/esm2022/lib/comments/inline-replies.directive.mjs +0 -13
- package/esm2022/lib/comments/live-comment.component.mjs +0 -80
- package/esm2022/lib/comments/reply-send-options.directive.mjs +0 -13
- package/esm2022/lib/common/attachment/attachment.component.mjs +0 -128
- package/esm2022/lib/common/attachments/attachments.component.mjs +0 -75
- package/esm2022/lib/common/common.module.mjs +0 -68
- package/esm2022/lib/common/index.mjs +0 -11
- package/esm2022/lib/common/lazy-connection.mjs +0 -15
- package/esm2022/lib/common/lightbox/lightbox.component.mjs +0 -31
- package/esm2022/lib/common/markdown-to-html.pipe.mjs +0 -83
- package/esm2022/lib/common/mention-linker.pipe.mjs +0 -35
- package/esm2022/lib/common/timer-pool.service.mjs +0 -85
- package/esm2022/lib/common/timestamp.component.mjs +0 -124
- package/esm2022/lib/common/trust-resource-url.pipe.mjs +0 -22
- package/esm2022/lib/emoji/emoji-selector-button.component.mjs +0 -115
- package/esm2022/lib/emoji/emoji-selector-panel/emoji-selector-panel.component.mjs +0 -93
- package/esm2022/lib/emoji/emoji.module.mjs +0 -55
- package/esm2022/lib/emoji/emojis.mjs +0 -6508
- package/esm2022/lib/emoji/index.mjs +0 -5
- package/esm2022/lib/giphy-attachments.mjs +0 -16
- package/esm2022/lib/index.mjs +0 -20
- package/esm2022/lib/live-message.component.mjs +0 -96
- package/esm2022/lib/message-menu-item.mjs +0 -2
- package/esm2022/lib/sdk-options.mjs +0 -3
- package/esm2022/lib/static-chat-source.mjs +0 -101
- package/esm2022/lib/tweet-attachments.mjs +0 -13
- package/esm2022/lib/url-attachments.mjs +0 -42
- package/esm2022/lib/youtube-attachments.mjs +0 -29
- package/esm2022/public-api.mjs +0 -5
- package/lib/attachment-scraper.d.ts +0 -15
- package/lib/banta/banta.component.d.ts +0 -59
- package/lib/banta-logo.component.d.ts +0 -5
- package/lib/banta-sdk.module.d.ts +0 -32
- package/lib/chat/banta-chat/banta-chat.component.d.ts +0 -79
- package/lib/chat/chat-message/chat-message.component.d.ts +0 -21
- package/lib/chat/chat-view/chat-view.component.d.ts +0 -52
- package/lib/chat/chat.module.d.ts +0 -15
- package/lib/chat/index.d.ts +0 -5
- package/lib/chat/live-chat-message.component.d.ts +0 -23
- package/lib/chat-backend-base.d.ts +0 -72
- package/lib/chat-backend.d.ts +0 -66
- package/lib/chat-source-base.d.ts +0 -51
- package/lib/chat-source.d.ts +0 -85
- package/lib/comments/attachment-button/attachment-button.component.d.ts +0 -17
- package/lib/comments/attachment-scraper.directive.d.ts +0 -21
- package/lib/comments/banta-comments/banta-comments.component.d.ts +0 -216
- package/lib/comments/comment/comment.component.d.ts +0 -90
- package/lib/comments/comment-field/comment-field.component.d.ts +0 -92
- package/lib/comments/comment-sort/comment-sort.component.d.ts +0 -16
- package/lib/comments/comment-view/comment-view.component.d.ts +0 -205
- package/lib/comments/comments.module.d.ts +0 -34
- package/lib/comments/index.d.ts +0 -11
- package/lib/comments/inline-replies.directive.d.ts +0 -5
- package/lib/comments/live-comment.component.d.ts +0 -23
- package/lib/comments/reply-send-options.directive.d.ts +0 -5
- package/lib/common/attachment/attachment.component.d.ts +0 -34
- package/lib/common/attachments/attachments.component.d.ts +0 -26
- package/lib/common/common.module.d.ts +0 -19
- package/lib/common/index.d.ts +0 -10
- package/lib/common/lazy-connection.d.ts +0 -6
- package/lib/common/lightbox/lightbox.component.d.ts +0 -14
- package/lib/common/markdown-to-html.pipe.d.ts +0 -13
- package/lib/common/mention-linker.pipe.d.ts +0 -13
- package/lib/common/timer-pool.service.d.ts +0 -15
- package/lib/common/timestamp.component.d.ts +0 -19
- package/lib/common/trust-resource-url.pipe.d.ts +0 -10
- package/lib/emoji/emoji-selector-button.component.d.ts +0 -30
- package/lib/emoji/emoji-selector-panel/emoji-selector-panel.component.d.ts +0 -23
- package/lib/emoji/emoji.module.d.ts +0 -16
- package/lib/emoji/emojis.d.ts +0 -6507
- package/lib/emoji/index.d.ts +0 -4
- package/lib/giphy-attachments.d.ts +0 -5
- package/lib/index.d.ts +0 -19
- package/lib/live-message.component.d.ts +0 -22
- package/lib/message-menu-item.d.ts +0 -6
- package/lib/sdk-options.d.ts +0 -8
- package/lib/static-chat-source.d.ts +0 -49
- package/lib/tweet-attachments.d.ts +0 -5
- package/lib/url-attachments.d.ts +0 -14
- package/lib/youtube-attachments.d.ts +0 -5
- package/public-api.d.ts +0 -1
package/index.d.ts
CHANGED
|
@@ -1,5 +1,1474 @@
|
|
|
1
|
+
import * as rxjs from 'rxjs';
|
|
2
|
+
import { Subject, Observable } from 'rxjs';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { ElementRef, PipeTransform, ModuleWithProviders, OnInit, TemplateRef, QueryList, NgZone, Type, InjectionToken } from '@angular/core';
|
|
5
|
+
import * as _angular_platform_browser from '@angular/platform-browser';
|
|
6
|
+
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
|
|
7
|
+
import * as marked from 'marked';
|
|
8
|
+
import { ChatMessageMention, ChatMessageAttachment, ChatMessage, User, Topic, CommentsOrder, FilterMode, Notification, UrlCard, SocketRPC, ChatPermissions, DurableSocket, ServerInfo, NewMessageForm, UpvoteNotification, NoticeNotification, MentionNotification, ReplyNotification, CDNProvider } from '@banta/common';
|
|
9
|
+
import * as i8 from '@angular/common';
|
|
10
|
+
import * as i9 from '@angular/material/icon';
|
|
11
|
+
import * as i10 from '@angular/material/progress-spinner';
|
|
12
|
+
import * as i11 from '@angular/material/button';
|
|
13
|
+
import { EmojiCategory, Emoji } from '@astronautlabs/emoji';
|
|
14
|
+
import * as i9$1 from '@angular/cdk/overlay';
|
|
15
|
+
import { Overlay, OverlayRef } from '@angular/cdk/overlay';
|
|
16
|
+
import * as i10$1 from '@angular/cdk/portal';
|
|
17
|
+
import { TemplatePortal } from '@angular/cdk/portal';
|
|
18
|
+
import * as i4 from '@angular/forms';
|
|
19
|
+
import * as i15 from '@angular/material/form-field';
|
|
20
|
+
import * as i16 from '@angular/material/input';
|
|
21
|
+
import * as i14 from '@angular/material/dialog';
|
|
22
|
+
import { MatDialog } from '@angular/material/dialog';
|
|
23
|
+
import { ActivatedRoute } from '@angular/router';
|
|
24
|
+
import * as i18$1 from '@angular/material/snack-bar';
|
|
25
|
+
import { MatSnackBar } from '@angular/material/snack-bar';
|
|
26
|
+
import * as i12 from '@angular/cdk/text-field';
|
|
27
|
+
import * as i18 from '@angular/material/menu';
|
|
28
|
+
import * as i19 from '@angular/material/divider';
|
|
29
|
+
import * as i23 from '@angular/material/tooltip';
|
|
30
|
+
import * as i24 from '@angular/material/datepicker';
|
|
31
|
+
import * as i25 from '@angular/material/select';
|
|
32
|
+
import * as i26 from '@angular/material/badge';
|
|
33
|
+
import * as i27 from '@angular/material/radio';
|
|
34
|
+
|
|
35
|
+
interface LazyConnectionOptions<T> {
|
|
36
|
+
start: (subject: Subject<T>) => void;
|
|
37
|
+
stop: () => void;
|
|
38
|
+
}
|
|
39
|
+
declare function lazyConnection<T>(options: LazyConnectionOptions<T>): Observable<T>;
|
|
40
|
+
|
|
1
41
|
/**
|
|
2
|
-
*
|
|
42
|
+
* Provides a way to hook in to a shared set of timers, instead of creating a timer per instance.
|
|
43
|
+
* This is very useful for cases where the update is not extremely time-sensitive, but happens at scale.
|
|
44
|
+
* The principal use case is the TimestampComponent. When several hundred (or several thousand) comments are
|
|
45
|
+
* being displayed, we do not want to trigger thousands of independent relative timestamp updates, because over
|
|
46
|
+
* time the updates will saturate the CPU since they don't perfectly align.
|
|
3
47
|
*/
|
|
4
|
-
|
|
5
|
-
|
|
48
|
+
declare class TimerPool {
|
|
49
|
+
private subscriptions;
|
|
50
|
+
private newSubscriptionsNotice;
|
|
51
|
+
private newSubscriptions;
|
|
52
|
+
private removedSubscriptionsNotice;
|
|
53
|
+
private removedSubscriptions;
|
|
54
|
+
addTimer(interval: number, callback: () => void): () => void;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
declare class TimestampComponent {
|
|
58
|
+
private timerPool;
|
|
59
|
+
constructor(timerPool: TimerPool);
|
|
60
|
+
private _value;
|
|
61
|
+
relative: string;
|
|
62
|
+
tooltip: string;
|
|
63
|
+
private timerUnsubscribe;
|
|
64
|
+
private timerInterval;
|
|
65
|
+
private _destroyed;
|
|
66
|
+
ngOnDestroy(): void;
|
|
67
|
+
get value(): number;
|
|
68
|
+
showAbsolute: boolean;
|
|
69
|
+
update(): void;
|
|
70
|
+
set value(v: number);
|
|
71
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TimestampComponent, never>;
|
|
72
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TimestampComponent, "banta-timestamp", never, { "value": { "alias": "value"; "required": false; }; }, {}, never, never, false, never>;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
declare class LightboxComponent {
|
|
76
|
+
containerElement: ElementRef<HTMLDivElement>;
|
|
77
|
+
ngAfterViewInit(): void;
|
|
78
|
+
ngOnDestroy(): void;
|
|
79
|
+
images: string[];
|
|
80
|
+
currentImage: string;
|
|
81
|
+
isOpen: boolean;
|
|
82
|
+
close(): void;
|
|
83
|
+
open(currentImage: string, images: string[]): void;
|
|
84
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LightboxComponent, never>;
|
|
85
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<LightboxComponent, "banta-lightbox", never, {}, {}, never, never, false, never>;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
declare class BantaMarkdownToHtmlPipe implements PipeTransform {
|
|
89
|
+
private sanitizer;
|
|
90
|
+
private sdkOptions;
|
|
91
|
+
constructor();
|
|
92
|
+
private get emojiUrl();
|
|
93
|
+
renderer: marked.Renderer;
|
|
94
|
+
transform(value: string): _angular_platform_browser.SafeHtml;
|
|
95
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BantaMarkdownToHtmlPipe, never>;
|
|
96
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<BantaMarkdownToHtmlPipe, "bantaMarkdownToHtml", false>;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
declare class BantaTrustResourceUrlPipe implements PipeTransform {
|
|
100
|
+
private sanitizer;
|
|
101
|
+
constructor(sanitizer: DomSanitizer);
|
|
102
|
+
transform(value: string): _angular_platform_browser.SafeResourceUrl;
|
|
103
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BantaTrustResourceUrlPipe, never>;
|
|
104
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<BantaTrustResourceUrlPipe, "trustResourceUrl", false>;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
declare class BantaMentionLinkerPipe implements PipeTransform {
|
|
108
|
+
transform(value: string, links?: ChatMessageMention[]): string;
|
|
109
|
+
formatLink(link: ChatMessageMention): string;
|
|
110
|
+
/**
|
|
111
|
+
* https://stackoverflow.com/questions/3446170/escape-string-for-use-in-javascript-regex
|
|
112
|
+
*/
|
|
113
|
+
escapeRegExp(string: any): any;
|
|
114
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BantaMentionLinkerPipe, never>;
|
|
115
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<BantaMentionLinkerPipe, "mentionLinker", false>;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
declare class BantaAttachmentComponent {
|
|
119
|
+
private elementRef;
|
|
120
|
+
constructor(elementRef: ElementRef<HTMLElement>);
|
|
121
|
+
private _attachment;
|
|
122
|
+
get attachment(): ChatMessageAttachment;
|
|
123
|
+
set attachment(value: ChatMessageAttachment);
|
|
124
|
+
loading: boolean;
|
|
125
|
+
editing: boolean;
|
|
126
|
+
loadingMessage: string;
|
|
127
|
+
error: boolean;
|
|
128
|
+
errorMessage: string;
|
|
129
|
+
removed: Subject<void>;
|
|
130
|
+
activated: Subject<void>;
|
|
131
|
+
loaded: Subject<void>;
|
|
132
|
+
private _viewLoaded;
|
|
133
|
+
ngAfterViewInit(): void;
|
|
134
|
+
private loadTwitterWidgets;
|
|
135
|
+
private loadPlatformSpecific;
|
|
136
|
+
private checkLoad;
|
|
137
|
+
activate(): void;
|
|
138
|
+
remove(): void;
|
|
139
|
+
get isError(): any;
|
|
140
|
+
get theErrorMessage(): any;
|
|
141
|
+
get isLoading(): any;
|
|
142
|
+
get isImageAttachment(): boolean;
|
|
143
|
+
get hasFrame(): string | boolean;
|
|
144
|
+
get frameUrl(): string;
|
|
145
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BantaAttachmentComponent, never>;
|
|
146
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<BantaAttachmentComponent, "banta-attachment", never, { "attachment": { "alias": "attachment"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "editing": { "alias": "editing"; "required": false; }; "loadingMessage": { "alias": "loadingMessage"; "required": false; }; "error": { "alias": "error"; "required": false; }; "errorMessage": { "alias": "errorMessage"; "required": false; }; }, { "removed": "removed"; "activated": "activated"; "loaded": "loaded"; }, never, never, false, never>;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
declare class BantaAttachmentsComponent {
|
|
150
|
+
attachments: ChatMessageAttachment[];
|
|
151
|
+
editing: boolean;
|
|
152
|
+
lightbox: LightboxComponent;
|
|
153
|
+
remove: Subject<ChatMessageAttachment>;
|
|
154
|
+
loaded: Subject<void>;
|
|
155
|
+
loadedAttachments: WeakMap<ChatMessageAttachment, boolean>;
|
|
156
|
+
ngAfterViewInit(): void;
|
|
157
|
+
markAttachmentLoaded(attachment: ChatMessageAttachment): void;
|
|
158
|
+
isAttachmentLoaded(attachment: ChatMessageAttachment): boolean;
|
|
159
|
+
get allAttachmentsLoaded(): boolean;
|
|
160
|
+
removeAttachment(attachment: ChatMessageAttachment): void;
|
|
161
|
+
isImageAttachment(attachment: ChatMessageAttachment): boolean;
|
|
162
|
+
isCardAttachment(attachment: ChatMessageAttachment): boolean;
|
|
163
|
+
showLightbox(image: ChatMessageAttachment): void;
|
|
164
|
+
get validAttachments(): ChatMessageAttachment[];
|
|
165
|
+
get inlineAttachments(): ChatMessageAttachment[];
|
|
166
|
+
get blockAttachments(): ChatMessageAttachment[];
|
|
167
|
+
attachmentId(index: number, attachment: ChatMessageAttachment): string;
|
|
168
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BantaAttachmentsComponent, never>;
|
|
169
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<BantaAttachmentsComponent, "banta-attachments", never, { "attachments": { "alias": "attachments"; "required": false; }; "editing": { "alias": "editing"; "required": false; }; }, { "remove": "remove"; "loaded": "loaded"; }, never, never, false, never>;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
declare class BantaCommonModule {
|
|
173
|
+
static forRoot(): ModuleWithProviders<BantaCommonModule>;
|
|
174
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BantaCommonModule, never>;
|
|
175
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<BantaCommonModule, [typeof TimestampComponent, typeof LightboxComponent, typeof BantaMarkdownToHtmlPipe, typeof BantaMentionLinkerPipe, typeof BantaTrustResourceUrlPipe, typeof BantaAttachmentComponent, typeof BantaAttachmentsComponent], [typeof i8.CommonModule, typeof i9.MatIconModule, typeof i10.MatProgressSpinnerModule, typeof i11.MatButtonModule], [typeof TimestampComponent, typeof LightboxComponent, typeof BantaMarkdownToHtmlPipe, typeof BantaMentionLinkerPipe, typeof BantaTrustResourceUrlPipe, typeof BantaAttachmentComponent, typeof BantaAttachmentsComponent]>;
|
|
176
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<BantaCommonModule>;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
interface AugmentedCategory extends EmojiCategory {
|
|
180
|
+
icon: string;
|
|
181
|
+
items: AugmentedEmoji[];
|
|
182
|
+
}
|
|
183
|
+
interface AugmentedEmoji extends Emoji {
|
|
184
|
+
html: SafeHtml;
|
|
185
|
+
}
|
|
186
|
+
declare class EmojiSelectorPanelComponent implements OnInit {
|
|
187
|
+
private sanitizer;
|
|
188
|
+
private sdkOptions;
|
|
189
|
+
categories: AugmentedCategory[];
|
|
190
|
+
allEmoji: AugmentedEmoji[];
|
|
191
|
+
activeCategory: string;
|
|
192
|
+
searchResults: any[];
|
|
193
|
+
searchVisible: boolean;
|
|
194
|
+
private selected;
|
|
195
|
+
private _searchQuery;
|
|
196
|
+
get searchQuery(): string;
|
|
197
|
+
set searchQuery(value: string);
|
|
198
|
+
humanize(str: string): string;
|
|
199
|
+
select(char: string): void;
|
|
200
|
+
hideSearch(): void;
|
|
201
|
+
showSearch(): void;
|
|
202
|
+
private get emojiUrl();
|
|
203
|
+
ngOnInit(): void;
|
|
204
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EmojiSelectorPanelComponent, never>;
|
|
205
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<EmojiSelectorPanelComponent, "emoji-selector-panel", never, {}, { "selected": "selected"; }, never, never, false, never>;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
declare class EmojiSelectorButtonComponent {
|
|
209
|
+
private elementRef;
|
|
210
|
+
private overlay;
|
|
211
|
+
constructor(elementRef: ElementRef<HTMLElement>, overlay: Overlay);
|
|
212
|
+
selectorPanelTemplate: TemplatePortal<any>;
|
|
213
|
+
private _selected;
|
|
214
|
+
showEmojiPanel: boolean;
|
|
215
|
+
get selected(): Observable<string>;
|
|
216
|
+
private overlayRef;
|
|
217
|
+
get isOpen(): OverlayRef;
|
|
218
|
+
/**
|
|
219
|
+
* Insert the given emoji.
|
|
220
|
+
* @param str
|
|
221
|
+
*/
|
|
222
|
+
insert(str: any): void;
|
|
223
|
+
close(): void;
|
|
224
|
+
disabled: boolean;
|
|
225
|
+
overlayX: 'start' | 'center' | 'end';
|
|
226
|
+
overlayY: 'top' | 'center' | 'bottom';
|
|
227
|
+
originX: 'start' | 'center' | 'end';
|
|
228
|
+
originY: 'top' | 'center' | 'bottom';
|
|
229
|
+
show(): void;
|
|
230
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EmojiSelectorButtonComponent, never>;
|
|
231
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<EmojiSelectorButtonComponent, "emoji-selector-button", never, { "disabled": { "alias": "disabled"; "required": false; }; "overlayX": { "alias": "overlayX"; "required": false; }; "overlayY": { "alias": "overlayY"; "required": false; }; "originX": { "alias": "originX"; "required": false; }; "originY": { "alias": "originY"; "required": false; }; }, { "selected": "selected"; }, never, never, false, never>;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
declare class EmojiModule {
|
|
235
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EmojiModule, never>;
|
|
236
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<EmojiModule, [typeof EmojiSelectorPanelComponent, typeof EmojiSelectorButtonComponent], [typeof i8.CommonModule, typeof i4.FormsModule, typeof i9.MatIconModule, typeof i11.MatButtonModule, typeof i15.MatFormFieldModule, typeof i16.MatInputModule, typeof i9$1.OverlayModule, typeof i10$1.PortalModule], [typeof EmojiSelectorPanelComponent, typeof EmojiSelectorButtonComponent]>;
|
|
237
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<EmojiModule>;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
declare class ChatMessageComponent {
|
|
241
|
+
private _selected;
|
|
242
|
+
private _reported;
|
|
243
|
+
private _upvoted;
|
|
244
|
+
private _userSelected;
|
|
245
|
+
message: ChatMessage;
|
|
246
|
+
get userSelected(): Subject<User>;
|
|
247
|
+
get selected(): Subject<void>;
|
|
248
|
+
get reported(): Subject<void>;
|
|
249
|
+
get upvoted(): Subject<void>;
|
|
250
|
+
avatarForUser(user: User): string;
|
|
251
|
+
upvote(): void;
|
|
252
|
+
report(): void;
|
|
253
|
+
select(): void;
|
|
254
|
+
selectUser(): void;
|
|
255
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ChatMessageComponent, never>;
|
|
256
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ChatMessageComponent, "banta-chat-message", never, { "message": { "alias": "message"; "required": false; }; }, { "userSelected": "userSelected"; "selected": "selected"; "reported": "reported"; "upvoted": "upvoted"; }, never, never, false, never>;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
declare class ChatBackend extends ChatBackendBase {
|
|
260
|
+
private options;
|
|
261
|
+
private platformId;
|
|
262
|
+
runId: string;
|
|
263
|
+
get serviceUrl(): string;
|
|
264
|
+
private connectToService;
|
|
265
|
+
private isServer;
|
|
266
|
+
/**
|
|
267
|
+
* Check if we are currently running inside a Googlebot user agent or via the Google inspection tool in Search Console.
|
|
268
|
+
* We'll use this to avoid WebSockets so that comments can be indexable.
|
|
269
|
+
* @returns
|
|
270
|
+
*/
|
|
271
|
+
private isGooglebot;
|
|
272
|
+
getSourceForTopic(topicId: string, options?: ChatSourceOptions): Promise<ChatSourceBase>;
|
|
273
|
+
getSourceForThread(topicId: string, messageId: string, options?: ChatSourceOptions): Promise<ChatSourceBase>;
|
|
274
|
+
/**
|
|
275
|
+
* Get the count of the given topic
|
|
276
|
+
* @param topicId
|
|
277
|
+
* @returns
|
|
278
|
+
*/
|
|
279
|
+
getSourceCountForTopic(topicId: string): Promise<number>;
|
|
280
|
+
/**
|
|
281
|
+
* Get the count of the given topics.
|
|
282
|
+
* @param topicId Topics to count messages on. Maximum of 1000.
|
|
283
|
+
* @returns
|
|
284
|
+
*/
|
|
285
|
+
getSourceCountForTopics(topicIds: string[]): Promise<Record<string, number>>;
|
|
286
|
+
/**
|
|
287
|
+
* Get information about the given topic.
|
|
288
|
+
* @param topicId
|
|
289
|
+
* @returns The topic object, or undefined if no such topic was found.
|
|
290
|
+
*/
|
|
291
|
+
getTopic(topicId: string): Promise<Topic | undefined>;
|
|
292
|
+
/**
|
|
293
|
+
* Get information about the given topics
|
|
294
|
+
* @param topicIds The topic IDs to look up. Maximum of 1000.
|
|
295
|
+
* @returns An array of matching topic objects.
|
|
296
|
+
*/
|
|
297
|
+
getTopicsById(topicIds: string[]): Promise<Topic[]>;
|
|
298
|
+
/**
|
|
299
|
+
* Get a set of messages from the given topic.
|
|
300
|
+
* @param topicId
|
|
301
|
+
* @returns
|
|
302
|
+
*/
|
|
303
|
+
getMessages(topicId: string, sort?: CommentsOrder, filter?: FilterMode, offset?: number, limit?: number, pinned?: boolean): Promise<ChatMessage[]>;
|
|
304
|
+
/**
|
|
305
|
+
* Get a set of messages from the given topic.
|
|
306
|
+
* @param topicId
|
|
307
|
+
* @returns
|
|
308
|
+
*/
|
|
309
|
+
getReplies(parentMessageId: string, sort?: CommentsOrder, filter?: FilterMode, offset?: number, limit?: number, pinned?: boolean): Promise<ChatMessage[]>;
|
|
310
|
+
refreshMessage(message: ChatMessage): Promise<ChatMessage>;
|
|
311
|
+
getMessage(topicId: string, messageId: string): Promise<ChatMessage>;
|
|
312
|
+
getSubMessage(topicId: string, parentMessageId: string, messageId: string): Promise<ChatMessage>;
|
|
313
|
+
watchMessage(message: ChatMessage, handler: (message: ChatMessage) => void): () => void;
|
|
314
|
+
notificationsChanged: Observable<Notification[]>;
|
|
315
|
+
newNotification: Observable<Notification>;
|
|
316
|
+
getCardForUrl(url: string): Promise<UrlCard>;
|
|
317
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ChatBackend, never>;
|
|
318
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ChatBackend>;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
type SignInState = 'signed-out' | 'signed-in' | 'signing-in';
|
|
322
|
+
interface PinOptions {
|
|
323
|
+
until?: number;
|
|
324
|
+
}
|
|
325
|
+
declare class ChatSource extends SocketRPC implements ChatSourceBase {
|
|
326
|
+
readonly backend: ChatBackend;
|
|
327
|
+
readonly identifier: string;
|
|
328
|
+
readonly parentIdentifier: string;
|
|
329
|
+
constructor(backend: ChatBackend, identifier: string, parentIdentifier: string, options: ChatSourceOptions);
|
|
330
|
+
private options;
|
|
331
|
+
private subscription;
|
|
332
|
+
private markReady;
|
|
333
|
+
readonly: boolean;
|
|
334
|
+
canLoadMore: boolean;
|
|
335
|
+
ready: Promise<void>;
|
|
336
|
+
permissions: ChatPermissions;
|
|
337
|
+
private _state;
|
|
338
|
+
get sortOrder(): "newest" | "oldest" | "likes";
|
|
339
|
+
get filterMode(): string;
|
|
340
|
+
get state(): "connected" | "connecting" | "lost" | "restored";
|
|
341
|
+
set state(value: "connected" | "connecting" | "lost" | "restored");
|
|
342
|
+
private _connectionStateChanged;
|
|
343
|
+
private _connectionStateChanged$;
|
|
344
|
+
get connectionStateChanged(): rxjs.Observable<"connected" | "connecting" | "lost" | "restored">;
|
|
345
|
+
private wasRestored;
|
|
346
|
+
bind(socket: DurableSocket): Promise<this>;
|
|
347
|
+
private mapOrUpdateMessages;
|
|
348
|
+
private mapOrUpdateMessage;
|
|
349
|
+
/**
|
|
350
|
+
* Ask server for messages that have occurred since the message with the given ID.
|
|
351
|
+
* This is used during brief reconnects to avoid dropping messages, while also not
|
|
352
|
+
* causing mobbing as everyone reconnects after an issue. The backend can choose to
|
|
353
|
+
* not service this request, instead returning undefined. In that case, the client
|
|
354
|
+
* is expected to fetch the existing messages and start state anew.
|
|
355
|
+
*
|
|
356
|
+
* TODO: this is not yet used
|
|
357
|
+
*
|
|
358
|
+
* @param id
|
|
359
|
+
* @returns
|
|
360
|
+
*/
|
|
361
|
+
loadSince(id: string): Promise<ChatMessage[]>;
|
|
362
|
+
getExistingMessages(): Promise<ChatMessage[]>;
|
|
363
|
+
getPinnedMessages(): Promise<ChatMessage[]>;
|
|
364
|
+
private ensureConnection;
|
|
365
|
+
editMessage(messageId: string, text: string): Promise<void>;
|
|
366
|
+
private subscribeAttempt;
|
|
367
|
+
private _errorState;
|
|
368
|
+
get errorState(): string;
|
|
369
|
+
subscribeToTopic(): Promise<void>;
|
|
370
|
+
private _signInState;
|
|
371
|
+
private _signInStateChanged;
|
|
372
|
+
private _signInStateChanged$;
|
|
373
|
+
get signInState(): SignInState;
|
|
374
|
+
get signInStateChanged(): rxjs.Observable<SignInState>;
|
|
375
|
+
private setSignInState;
|
|
376
|
+
authenticate(): Promise<void>;
|
|
377
|
+
close(): void;
|
|
378
|
+
onPermissions(permissions: ChatPermissions): void;
|
|
379
|
+
onChatMessage(message: ChatMessage): void;
|
|
380
|
+
private messageMap;
|
|
381
|
+
private _messageReceived;
|
|
382
|
+
private _messageUpdated;
|
|
383
|
+
private _messageSent;
|
|
384
|
+
private _messageObserved;
|
|
385
|
+
get messageReceived(): rxjs.Observable<ChatMessage>;
|
|
386
|
+
get messageUpdated(): rxjs.Observable<ChatMessage>;
|
|
387
|
+
get messageSent(): rxjs.Observable<ChatMessage>;
|
|
388
|
+
get messageObserved(): rxjs.Observable<ChatMessage>;
|
|
389
|
+
messages: ChatMessage[];
|
|
390
|
+
getServerInfo(): Promise<ServerInfo>;
|
|
391
|
+
send(message: ChatMessage): Promise<ChatMessage>;
|
|
392
|
+
loadAfter(message: ChatMessage, count: number): Promise<ChatMessage[]>;
|
|
393
|
+
get(id: string): Promise<ChatMessage>;
|
|
394
|
+
getCount(): Promise<number>;
|
|
395
|
+
likeMessage(messageId: string): Promise<void>;
|
|
396
|
+
pinMessage(messageId: string, options?: PinOptions): Promise<void>;
|
|
397
|
+
unpinMessage(messageId: string): Promise<void>;
|
|
398
|
+
unlikeMessage(messageId: string): Promise<void>;
|
|
399
|
+
deleteMessage(messageId: string): Promise<void>;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
interface ChatSourceBase {
|
|
403
|
+
/**
|
|
404
|
+
* The topic identifier for the current chat/comments
|
|
405
|
+
*/
|
|
406
|
+
identifier: string;
|
|
407
|
+
permissions: ChatPermissions;
|
|
408
|
+
ready: Promise<void>;
|
|
409
|
+
/**
|
|
410
|
+
* The ID of the parent message that this thread chat source is for.
|
|
411
|
+
* When this is not set, the chat source is a top-level ("topic") source.
|
|
412
|
+
* When it is set, this chat source is a thread source (ie replies).
|
|
413
|
+
*/
|
|
414
|
+
parentIdentifier?: string;
|
|
415
|
+
sortOrder?: CommentsOrder;
|
|
416
|
+
filterMode?: FilterMode;
|
|
417
|
+
messageReceived: Observable<ChatMessage>;
|
|
418
|
+
messageObserved: Observable<ChatMessage>;
|
|
419
|
+
messageUpdated: Observable<ChatMessage>;
|
|
420
|
+
signInState?: SignInState;
|
|
421
|
+
signInStateChanged?: Observable<SignInState>;
|
|
422
|
+
messageSent: Observable<ChatMessage>;
|
|
423
|
+
messages: ChatMessage[];
|
|
424
|
+
send(message: ChatMessage): Promise<ChatMessage>;
|
|
425
|
+
close(): any;
|
|
426
|
+
getCount(): Promise<number>;
|
|
427
|
+
loadSince(id: string): Promise<ChatMessage[]>;
|
|
428
|
+
getExistingMessages(): Promise<ChatMessage[]>;
|
|
429
|
+
getPinnedMessages(): Promise<ChatMessage[]>;
|
|
430
|
+
loadAfter(message: ChatMessage, count: number): Promise<ChatMessage[]>;
|
|
431
|
+
get(id: string): Promise<ChatMessage>;
|
|
432
|
+
getServerInfo(): Promise<ServerInfo>;
|
|
433
|
+
likeMessage(messageId: string): Promise<void>;
|
|
434
|
+
unlikeMessage(messageId: string): Promise<void>;
|
|
435
|
+
pinMessage(messageId: string, options?: {
|
|
436
|
+
until?: number;
|
|
437
|
+
}): Promise<void>;
|
|
438
|
+
unpinMessage(messageId: string): Promise<void>;
|
|
439
|
+
editMessage(messageId: string, text: string): Promise<void>;
|
|
440
|
+
deleteMessage(messageId: string): Promise<void>;
|
|
441
|
+
connectionStateChanged?: Observable<'connected' | 'connecting' | 'lost' | 'restored'>;
|
|
442
|
+
state?: 'connecting' | 'connected' | 'lost' | 'restored';
|
|
443
|
+
/**
|
|
444
|
+
* When true, this source is readonly, so messages cannot be sent/edited/deleted, nor liked/unliked.
|
|
445
|
+
*/
|
|
446
|
+
readonly?: boolean;
|
|
447
|
+
/**
|
|
448
|
+
* When true/undefined, the source supports loading more messages. When false, it does not.
|
|
449
|
+
*/
|
|
450
|
+
canLoadMore?: boolean;
|
|
451
|
+
get errorState(): any;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
interface AttachmentFragment {
|
|
455
|
+
text: string;
|
|
456
|
+
offset: number;
|
|
457
|
+
type: string;
|
|
458
|
+
}
|
|
459
|
+
interface AttachmentScraper {
|
|
460
|
+
findFragments(message: ChatMessage): AttachmentFragment[];
|
|
461
|
+
}
|
|
462
|
+
interface AttachmentResolver {
|
|
463
|
+
resolveFragment(message: ChatMessage, fragment: AttachmentFragment): Promise<ChatMessageAttachment>;
|
|
464
|
+
}
|
|
465
|
+
interface AttachmentRenderer {
|
|
466
|
+
attachment: ChatMessageAttachment;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
interface ChatSourceOptions {
|
|
470
|
+
sortOrder?: CommentsOrder;
|
|
471
|
+
filterMode?: FilterMode;
|
|
472
|
+
/**
|
|
473
|
+
* How many messages should be loaded initially?
|
|
474
|
+
*/
|
|
475
|
+
initialMessageCount?: number;
|
|
476
|
+
metadata?: Record<string, any>;
|
|
477
|
+
}
|
|
478
|
+
declare abstract class ChatBackendBase {
|
|
479
|
+
constructor();
|
|
480
|
+
abstract getSourceForTopic(topicId: string, options?: ChatSourceOptions): Promise<ChatSourceBase>;
|
|
481
|
+
abstract getSourceForThread(topicId: string, messageId: string, options?: ChatSourceOptions): Promise<ChatSourceBase>;
|
|
482
|
+
/**
|
|
483
|
+
* Get the count of the given topic
|
|
484
|
+
* @param topicId
|
|
485
|
+
* @returns
|
|
486
|
+
*/
|
|
487
|
+
abstract getSourceCountForTopic(topicId: string): Promise<number>;
|
|
488
|
+
/**
|
|
489
|
+
* Get the count of the given topics.
|
|
490
|
+
* @param topicId Topics to count messages on. Maximum of 1000.
|
|
491
|
+
* @returns
|
|
492
|
+
*/
|
|
493
|
+
abstract getSourceCountForTopics(topicIds: string[]): Promise<Record<string, number>>;
|
|
494
|
+
/**
|
|
495
|
+
* Get information about the given topic.
|
|
496
|
+
* @param topicId
|
|
497
|
+
* @returns The topic object, or undefined if no such topic was found.
|
|
498
|
+
*/
|
|
499
|
+
abstract getTopic(topicId: string): Promise<Topic | undefined>;
|
|
500
|
+
/**
|
|
501
|
+
* Get information about the given topics
|
|
502
|
+
* @param topicIds The topic IDs to look up. Maximum of 1000.
|
|
503
|
+
* @returns An array of matching topic objects.
|
|
504
|
+
*/
|
|
505
|
+
abstract getTopicsById(topicIds: string[]): Promise<Topic[]>;
|
|
506
|
+
/**
|
|
507
|
+
* Get a set of messages from the given topic.
|
|
508
|
+
* @param topicId
|
|
509
|
+
* @returns
|
|
510
|
+
*/
|
|
511
|
+
abstract getMessages(topicId: string, sort?: CommentsOrder, filter?: FilterMode, offset?: number, limit?: number, pinned?: boolean): Promise<ChatMessage[]>;
|
|
512
|
+
/**
|
|
513
|
+
* Get a set of messages from the given topic.
|
|
514
|
+
* @param topicId
|
|
515
|
+
* @returns
|
|
516
|
+
*/
|
|
517
|
+
abstract getReplies(parentMessageId: string, sort?: CommentsOrder, filter?: FilterMode, offset?: number, limit?: number): Promise<ChatMessage[]>;
|
|
518
|
+
abstract refreshMessage(message: ChatMessage): Promise<ChatMessage>;
|
|
519
|
+
abstract getMessage(topicId: string, messageId: string): Promise<ChatMessage>;
|
|
520
|
+
abstract getSubMessage(topicId: string, parentMessageId: string, messageId: string): Promise<ChatMessage>;
|
|
521
|
+
abstract watchMessage(message: ChatMessage, handler: (message: ChatMessage) => void): () => void;
|
|
522
|
+
abstract getCardForUrl(url: string): Promise<UrlCard>;
|
|
523
|
+
readonly notificationsChanged: Observable<Notification[]>;
|
|
524
|
+
readonly newNotification: Observable<Notification>;
|
|
525
|
+
private _userChanged;
|
|
526
|
+
private _user;
|
|
527
|
+
get userChanged(): Observable<User>;
|
|
528
|
+
set user(user: User);
|
|
529
|
+
get user(): User;
|
|
530
|
+
private _attachmentScrapers;
|
|
531
|
+
private _attachmentResolvers;
|
|
532
|
+
registerAttachmentScraper(scraper: AttachmentScraper): void;
|
|
533
|
+
registerAttachmentResolver(resolver: AttachmentResolver): void;
|
|
534
|
+
get attachmentScrapers(): AttachmentScraper[];
|
|
535
|
+
get attachmentResolvers(): AttachmentResolver[];
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
declare class LiveChatMessageComponent {
|
|
539
|
+
private backend;
|
|
540
|
+
constructor(backend: ChatBackendBase);
|
|
541
|
+
private _message;
|
|
542
|
+
private _upvoted;
|
|
543
|
+
private _reported;
|
|
544
|
+
private _selected;
|
|
545
|
+
get upvoted(): Observable<void>;
|
|
546
|
+
get reported(): Observable<void>;
|
|
547
|
+
get selected(): Observable<void>;
|
|
548
|
+
get message(): ChatMessage;
|
|
549
|
+
private unsubscribe;
|
|
550
|
+
set message(value: ChatMessage);
|
|
551
|
+
report(): void;
|
|
552
|
+
upvote(): void;
|
|
553
|
+
select(): void;
|
|
554
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LiveChatMessageComponent, never>;
|
|
555
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<LiveChatMessageComponent, "banta-live-chat-message", never, { "message": { "alias": "message"; "required": false; }; }, { "upvoted": "upvoted"; "reported": "reported"; "selected": "selected"; }, never, never, false, never>;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
declare class ChatViewComponent {
|
|
559
|
+
private backend;
|
|
560
|
+
private elementRef;
|
|
561
|
+
constructor(backend: ChatBackendBase, elementRef: ElementRef<HTMLElement>);
|
|
562
|
+
private _sourceSubs;
|
|
563
|
+
private _source;
|
|
564
|
+
get source(): ChatSourceBase;
|
|
565
|
+
private _selected;
|
|
566
|
+
private _selected$;
|
|
567
|
+
private _reported;
|
|
568
|
+
private _reported$;
|
|
569
|
+
private _upvoted;
|
|
570
|
+
private _upvoted$;
|
|
571
|
+
private _userSelected;
|
|
572
|
+
private _userSelected$;
|
|
573
|
+
private _received;
|
|
574
|
+
private _received$;
|
|
575
|
+
get selected(): rxjs.Observable<ChatMessage>;
|
|
576
|
+
get userSelected(): rxjs.Observable<ChatMessage>;
|
|
577
|
+
get reported(): rxjs.Observable<ChatMessage>;
|
|
578
|
+
get upvoted(): rxjs.Observable<ChatMessage>;
|
|
579
|
+
get received(): rxjs.Observable<ChatMessage>;
|
|
580
|
+
set source(value: ChatSourceBase);
|
|
581
|
+
private getInitialMessages;
|
|
582
|
+
private sortMessages;
|
|
583
|
+
messages: ChatMessage[];
|
|
584
|
+
currentUser: User;
|
|
585
|
+
messageContainer: ElementRef<HTMLElement>;
|
|
586
|
+
maxMessages: number;
|
|
587
|
+
emptyLabel: string;
|
|
588
|
+
private addMessage;
|
|
589
|
+
private messageReceived;
|
|
590
|
+
isScrolledToLatest(): boolean;
|
|
591
|
+
private messageSent;
|
|
592
|
+
scrollToLatest(): void;
|
|
593
|
+
jumpTo(message: ChatMessage): void;
|
|
594
|
+
flashMessage(message: ChatMessage): void;
|
|
595
|
+
flashedMessageId: string;
|
|
596
|
+
mentionsMe(message: ChatMessage): boolean;
|
|
597
|
+
upvoteMessage(message: ChatMessage): void;
|
|
598
|
+
reportMessage(message: ChatMessage): void;
|
|
599
|
+
selectMessage(message: ChatMessage): void;
|
|
600
|
+
selectMessageUser(message: ChatMessage): void;
|
|
601
|
+
avatarForUser(user: User): string;
|
|
602
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ChatViewComponent, never>;
|
|
603
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ChatViewComponent, "banta-chat-view", never, { "source": { "alias": "source"; "required": false; }; "maxMessages": { "alias": "maxMessages"; "required": false; }; "emptyLabel": { "alias": "emptyLabel"; "required": false; }; }, { "selected": "selected"; "userSelected": "userSelected"; "reported": "reported"; "upvoted": "upvoted"; "received": "received"; }, never, ["[data-before]", ":not([data-before])"], false, never>;
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
/**
|
|
607
|
+
* Chat component
|
|
608
|
+
*/
|
|
609
|
+
declare class BantaChatComponent {
|
|
610
|
+
private backend;
|
|
611
|
+
constructor(backend: ChatBackendBase);
|
|
612
|
+
private _source;
|
|
613
|
+
private _subs;
|
|
614
|
+
user: User;
|
|
615
|
+
shouldInterceptMessageSend?: (message: ChatMessage, source: ChatSourceBase) => boolean | Promise<boolean>;
|
|
616
|
+
url: string;
|
|
617
|
+
ngOnInit(): void;
|
|
618
|
+
ngOnDestroy(): void;
|
|
619
|
+
get source(): ChatSourceBase;
|
|
620
|
+
set source(value: ChatSourceBase);
|
|
621
|
+
get topicID(): string;
|
|
622
|
+
set topicID(value: string);
|
|
623
|
+
private _metadata;
|
|
624
|
+
/**
|
|
625
|
+
* Arbitrary metadata to send to the chat server. This can be used to provide context about the client to the server
|
|
626
|
+
* for things like validating authorization and other uses.
|
|
627
|
+
*/
|
|
628
|
+
get metadata(): Record<string, any>;
|
|
629
|
+
set metadata(value: Record<string, any>);
|
|
630
|
+
private _reloadSourceTimeout;
|
|
631
|
+
private reloadSource;
|
|
632
|
+
private setSourceFromTopicID;
|
|
633
|
+
signInLabel: string;
|
|
634
|
+
sendLabel: string;
|
|
635
|
+
permissionDeniedLabel: string;
|
|
636
|
+
messageFieldPlaceholder: string;
|
|
637
|
+
emptyLabel: string;
|
|
638
|
+
private _selected;
|
|
639
|
+
private _selected$;
|
|
640
|
+
private _reported;
|
|
641
|
+
private _reported$;
|
|
642
|
+
private _upvoted;
|
|
643
|
+
private _upvoted$;
|
|
644
|
+
private _userSelected;
|
|
645
|
+
private _userSelected$;
|
|
646
|
+
private _permissionDeniedError;
|
|
647
|
+
private _permissionDeniedError$;
|
|
648
|
+
private _signInSelected;
|
|
649
|
+
private _signInSelected$;
|
|
650
|
+
private _received;
|
|
651
|
+
private _received$;
|
|
652
|
+
get selected(): Observable<ChatMessage>;
|
|
653
|
+
get reported(): Observable<ChatMessage>;
|
|
654
|
+
get upvoted(): Observable<ChatMessage>;
|
|
655
|
+
get userSelected(): Observable<ChatMessage>;
|
|
656
|
+
get permissionDeniedError(): Observable<string>;
|
|
657
|
+
get signInSelected(): Observable<void>;
|
|
658
|
+
get received(): Observable<ChatMessage>;
|
|
659
|
+
onReceived(message: ChatMessage): void;
|
|
660
|
+
showEmojiPanel: boolean;
|
|
661
|
+
showSignIn(): void;
|
|
662
|
+
sendPermissionError(message?: string): void;
|
|
663
|
+
insertEmoji(emoji: any): void;
|
|
664
|
+
onKeyDown(event: KeyboardEvent): void;
|
|
665
|
+
chatView: ChatViewComponent;
|
|
666
|
+
inputElementRef: ElementRef<HTMLInputElement>;
|
|
667
|
+
jumpToMessage(message: ChatMessage): void;
|
|
668
|
+
select(message: ChatMessage): void;
|
|
669
|
+
selectUser(message: ChatMessage): void;
|
|
670
|
+
report(message: ChatMessage): void;
|
|
671
|
+
upvote(message: ChatMessage): Promise<void>;
|
|
672
|
+
get canChat(): boolean;
|
|
673
|
+
newMessage: NewMessageForm;
|
|
674
|
+
sendMessage(): Promise<void>;
|
|
675
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BantaChatComponent, never>;
|
|
676
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<BantaChatComponent, "banta-chat", never, { "shouldInterceptMessageSend": { "alias": "shouldInterceptMessageSend"; "required": false; }; "url": { "alias": "url"; "required": false; }; "source": { "alias": "source"; "required": false; }; "topicID": { "alias": "topicID"; "required": false; }; "metadata": { "alias": "metadata"; "required": false; }; "signInLabel": { "alias": "signInLabel"; "required": false; }; "sendLabel": { "alias": "sendLabel"; "required": false; }; "permissionDeniedLabel": { "alias": "permissionDeniedLabel"; "required": false; }; "messageFieldPlaceholder": { "alias": "messageFieldPlaceholder"; "required": false; }; "emptyLabel": { "alias": "emptyLabel"; "required": false; }; }, { "selected": "selected"; "reported": "reported"; "upvoted": "upvoted"; "userSelected": "userSelected"; "permissionDeniedError": "permissionDeniedError"; "signInSelected": "signInSelected"; "received": "received"; }, never, never, false, never>;
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
declare class ChatModule {
|
|
680
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ChatModule, never>;
|
|
681
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<ChatModule, [typeof ChatMessageComponent, typeof LiveChatMessageComponent, typeof ChatViewComponent, typeof BantaChatComponent], [typeof i8.CommonModule, typeof i4.FormsModule, typeof i9.MatIconModule, typeof i11.MatButtonModule, typeof EmojiModule], [typeof ChatMessageComponent, typeof LiveChatMessageComponent, typeof ChatViewComponent, typeof BantaChatComponent]>;
|
|
682
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<ChatModule>;
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
/**
|
|
686
|
+
* Unified chat and comments component
|
|
687
|
+
*/
|
|
688
|
+
declare class BantaComponent {
|
|
689
|
+
private backend;
|
|
690
|
+
private matDialog;
|
|
691
|
+
constructor(backend: ChatBackendBase, matDialog: MatDialog);
|
|
692
|
+
firehoseSource: ChatSourceBase;
|
|
693
|
+
pointSource: ChatSourceBase;
|
|
694
|
+
private _topicID;
|
|
695
|
+
private _subs;
|
|
696
|
+
auxOpen: boolean;
|
|
697
|
+
auxTitle: string;
|
|
698
|
+
auxMode: string;
|
|
699
|
+
ngOnInit(): void;
|
|
700
|
+
mobileFocus: string;
|
|
701
|
+
sendPointSubMessage(): Promise<void>;
|
|
702
|
+
firehose: BantaChatComponent;
|
|
703
|
+
goToMessage(message: ChatMessage): Promise<void>;
|
|
704
|
+
notifications: Notification[];
|
|
705
|
+
newNotifications: boolean;
|
|
706
|
+
pointUnfocus(): void;
|
|
707
|
+
ngOnDestroy(): void;
|
|
708
|
+
showAux(title: string, mode: string): void;
|
|
709
|
+
showNotifications(): void;
|
|
710
|
+
get topicID(): string;
|
|
711
|
+
chatLabel: string;
|
|
712
|
+
commentsLabel: string;
|
|
713
|
+
allowServerInfoRequest: boolean;
|
|
714
|
+
set topicID(value: string);
|
|
715
|
+
private connectToTopic;
|
|
716
|
+
private _signInSelected;
|
|
717
|
+
get signInSelected(): Observable<void>;
|
|
718
|
+
showSignIn(): void;
|
|
719
|
+
close(): void;
|
|
720
|
+
get hasPoint(): boolean;
|
|
721
|
+
pointOpen: ChatMessage;
|
|
722
|
+
pointSubChat: ChatSourceBase;
|
|
723
|
+
closeAux(): void;
|
|
724
|
+
getViewType(message: ChatMessage): "chat" | "comment";
|
|
725
|
+
upvoteMessage(message: ChatMessage): Promise<void>;
|
|
726
|
+
showProfile(user: User): void;
|
|
727
|
+
profileUser: User;
|
|
728
|
+
reportedMessage: ChatMessage;
|
|
729
|
+
sendReport(message: ChatMessage): void;
|
|
730
|
+
reportMessage(message: ChatMessage): void;
|
|
731
|
+
currentUser: User;
|
|
732
|
+
newPointSubMessage: NewMessageForm;
|
|
733
|
+
genericAvatarUrl: string;
|
|
734
|
+
notifIsUpvote(notif: Notification): notif is UpvoteNotification;
|
|
735
|
+
notifIsNotice(notif: Notification): notif is NoticeNotification;
|
|
736
|
+
notifIsMention(notif: Notification): notif is MentionNotification;
|
|
737
|
+
notifIsReply(notif: Notification): notif is ReplyNotification;
|
|
738
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BantaComponent, never>;
|
|
739
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<BantaComponent, "banta", never, { "topicID": { "alias": "topicID"; "required": false; }; "chatLabel": { "alias": "chatLabel"; "required": false; }; "commentsLabel": { "alias": "commentsLabel"; "required": false; }; "allowServerInfoRequest": { "alias": "allowServerInfoRequest"; "required": false; }; }, { "signInSelected": "signInSelected"; }, never, never, false, never>;
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
declare class BantaLogoComponent {
|
|
743
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BantaLogoComponent, never>;
|
|
744
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<BantaLogoComponent, "banta-logo", never, {}, {}, never, never, false, never>;
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
declare class LiveMessageComponent {
|
|
748
|
+
constructor();
|
|
749
|
+
private _message;
|
|
750
|
+
private _upvoted;
|
|
751
|
+
private _reported;
|
|
752
|
+
private _selected;
|
|
753
|
+
viewType: string;
|
|
754
|
+
get upvoted(): Observable<void>;
|
|
755
|
+
get reported(): Observable<void>;
|
|
756
|
+
get selected(): Observable<void>;
|
|
757
|
+
get message(): ChatMessage;
|
|
758
|
+
set message(value: ChatMessage);
|
|
759
|
+
private getViewType;
|
|
760
|
+
upvote(): void;
|
|
761
|
+
report(): void;
|
|
762
|
+
select(): void;
|
|
763
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LiveMessageComponent, never>;
|
|
764
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<LiveMessageComponent, "banta-live-message", never, { "message": { "alias": "message"; "required": false; }; }, { "upvoted": "upvoted"; "reported": "reported"; "selected": "selected"; }, never, never, false, never>;
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
interface MessageMenuItem {
|
|
768
|
+
icon: string;
|
|
769
|
+
label: string;
|
|
770
|
+
action: (message: ChatMessage) => void;
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
declare class CommentComponent {
|
|
774
|
+
private elementRef;
|
|
775
|
+
constructor(elementRef: ElementRef<HTMLElement>);
|
|
776
|
+
ngOnInit(): void;
|
|
777
|
+
busy: boolean;
|
|
778
|
+
get message(): ChatMessage;
|
|
779
|
+
set message(value: ChatMessage);
|
|
780
|
+
private _message;
|
|
781
|
+
private isLoaded;
|
|
782
|
+
editedMessage: string;
|
|
783
|
+
pinFormVisible: boolean;
|
|
784
|
+
pinUntilDate: Date;
|
|
785
|
+
pinUntilTime: string;
|
|
786
|
+
pinMode: 'forever' | 'until';
|
|
787
|
+
today: Date;
|
|
788
|
+
customMenuItems: MessageMenuItem[];
|
|
789
|
+
showReplyAction: boolean;
|
|
790
|
+
maxLength: number;
|
|
791
|
+
permissions: ChatPermissions;
|
|
792
|
+
mine: boolean;
|
|
793
|
+
editing: boolean;
|
|
794
|
+
genericAvatarUrl: string;
|
|
795
|
+
readonly: boolean;
|
|
796
|
+
private _reported;
|
|
797
|
+
private _selected;
|
|
798
|
+
private _liked;
|
|
799
|
+
private _unliked;
|
|
800
|
+
private _shared;
|
|
801
|
+
private _userSelected;
|
|
802
|
+
private _avatarSelected;
|
|
803
|
+
private _usernameSelected;
|
|
804
|
+
private _editStarted;
|
|
805
|
+
private _deleted;
|
|
806
|
+
private _editEnded;
|
|
807
|
+
private _edited;
|
|
808
|
+
private _loaded;
|
|
809
|
+
private _pinned;
|
|
810
|
+
private _unpinned;
|
|
811
|
+
readonly liked: rxjs.Observable<void>;
|
|
812
|
+
readonly unliked: rxjs.Observable<void>;
|
|
813
|
+
readonly selected: rxjs.Observable<void>;
|
|
814
|
+
readonly edited: rxjs.Observable<string>;
|
|
815
|
+
readonly deleted: rxjs.Observable<void>;
|
|
816
|
+
readonly editStarted: rxjs.Observable<void>;
|
|
817
|
+
readonly editEnded: rxjs.Observable<void>;
|
|
818
|
+
readonly shared: rxjs.Observable<ChatMessage>;
|
|
819
|
+
readonly userSelected: rxjs.Observable<void>;
|
|
820
|
+
readonly usernameSelected: rxjs.Observable<User>;
|
|
821
|
+
readonly avatarSelected: rxjs.Observable<User>;
|
|
822
|
+
readonly reported: rxjs.Observable<void>;
|
|
823
|
+
readonly loaded: rxjs.Observable<void>;
|
|
824
|
+
readonly pinned: rxjs.Observable<{
|
|
825
|
+
message: ChatMessage;
|
|
826
|
+
options: PinOptions;
|
|
827
|
+
}>;
|
|
828
|
+
readonly unpinned: rxjs.Observable<ChatMessage>;
|
|
829
|
+
get commentId(): string;
|
|
830
|
+
isNew: boolean;
|
|
831
|
+
get isHighlighted(): any;
|
|
832
|
+
visible: boolean;
|
|
833
|
+
get replyCount(): number;
|
|
834
|
+
get element(): HTMLElement;
|
|
835
|
+
get isPinned(): boolean;
|
|
836
|
+
get pinFormValid(): boolean;
|
|
837
|
+
avatarForUser(user: User): string;
|
|
838
|
+
waitForLoad(): Promise<void>;
|
|
839
|
+
private setMessage;
|
|
840
|
+
markAttachmentsLoaded(): void;
|
|
841
|
+
saveEdit(): void;
|
|
842
|
+
endEditing(): void;
|
|
843
|
+
delete(): void;
|
|
844
|
+
report(): void;
|
|
845
|
+
like(): void;
|
|
846
|
+
unlike(): void;
|
|
847
|
+
share(): void;
|
|
848
|
+
unpin(): void;
|
|
849
|
+
select(): void;
|
|
850
|
+
selectUser(): void;
|
|
851
|
+
startEdit(): void;
|
|
852
|
+
selectUsername(user: User): void;
|
|
853
|
+
selectAvatar(user: User): void;
|
|
854
|
+
showPinForm(): void;
|
|
855
|
+
submitPin(): void;
|
|
856
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CommentComponent, never>;
|
|
857
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CommentComponent, "banta-comment", never, { "busy": { "alias": "busy"; "required": false; }; "message": { "alias": "message"; "required": false; }; "customMenuItems": { "alias": "customMenuItems"; "required": false; }; "showReplyAction": { "alias": "showReplyAction"; "required": false; }; "maxLength": { "alias": "maxLength"; "required": false; }; "permissions": { "alias": "permissions"; "required": false; }; "mine": { "alias": "mine"; "required": false; }; "editing": { "alias": "editing"; "required": false; }; "genericAvatarUrl": { "alias": "genericAvatarUrl"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; }, { "liked": "liked"; "unliked": "unliked"; "selected": "selected"; "edited": "edited"; "deleted": "deleted"; "editStarted": "editStarted"; "editEnded": "editEnded"; "shared": "shared"; "userSelected": "userSelected"; "usernameSelected": "usernameSelected"; "avatarSelected": "avatarSelected"; "reported": "reported"; "loaded": "loaded"; "pinned": "pinned"; "unpinned": "unpinned"; }, never, never, false, never>;
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
interface EditEvent {
|
|
861
|
+
message: ChatMessage;
|
|
862
|
+
newMessage: string;
|
|
863
|
+
}
|
|
864
|
+
declare class CommentViewComponent {
|
|
865
|
+
private backend;
|
|
866
|
+
private elementRef;
|
|
867
|
+
constructor(backend: ChatBackendBase, elementRef: ElementRef<HTMLElement>);
|
|
868
|
+
private _source;
|
|
869
|
+
get source(): ChatSourceBase;
|
|
870
|
+
set source(value: ChatSourceBase);
|
|
871
|
+
private _sourceSubs;
|
|
872
|
+
menuMessage: ChatMessage;
|
|
873
|
+
pinnedMessages: ChatMessage[];
|
|
874
|
+
messages: ChatMessage[];
|
|
875
|
+
currentUser: User;
|
|
876
|
+
customSortEnabled: boolean;
|
|
877
|
+
markSourceLoaded: () => void;
|
|
878
|
+
sourceLoaded: Promise<void>;
|
|
879
|
+
isViewingMore: boolean;
|
|
880
|
+
isLoadingMore: boolean;
|
|
881
|
+
hasMore: boolean;
|
|
882
|
+
messageClicked: boolean;
|
|
883
|
+
get previousMessages(): ChatMessage[];
|
|
884
|
+
get nextMessages(): ChatMessage[];
|
|
885
|
+
/**
|
|
886
|
+
* While this is called "new" messages, it really represents the messages that would be visible *at the beginning
|
|
887
|
+
* of the sort order*, which can be flipped by the newestLast feature (used for replies mode).
|
|
888
|
+
*
|
|
889
|
+
* So, when newestLast is false (top-level comments), regardless of the current sortOrder, newMessages are conceptually
|
|
890
|
+
* *above* the visible set of messages.
|
|
891
|
+
*
|
|
892
|
+
* When newestLast is true (as in replies mode), regardless of the current sortOrder, newMessages are conceptually
|
|
893
|
+
* *below* the visible set of messages.
|
|
894
|
+
*/
|
|
895
|
+
newMessages: ChatMessage[];
|
|
896
|
+
/**
|
|
897
|
+
* While this is called "older" messages, it really represents the messages that would be visible *at the end of the
|
|
898
|
+
* sort order*, which can be flipped by the newestLast feature (useds for replies mode).
|
|
899
|
+
*
|
|
900
|
+
* So, when newestLast is false, regardless of the current sortOrder, olderMessages are conceptually *below*
|
|
901
|
+
* the visible set of messages.
|
|
902
|
+
*
|
|
903
|
+
* When newestLast is true (as in replies mode), regardless of the current sortOrder, olderMessages are conceptually
|
|
904
|
+
* *above* the visible set of messages.
|
|
905
|
+
*/
|
|
906
|
+
olderMessages: ChatMessage[];
|
|
907
|
+
private _maxMessages;
|
|
908
|
+
set maxMessages(value: number);
|
|
909
|
+
get maxMessages(): number;
|
|
910
|
+
private _maxVisibleMessages;
|
|
911
|
+
set maxVisibleMessages(value: number);
|
|
912
|
+
get maxVisibleMessages(): number;
|
|
913
|
+
collapsePins: boolean;
|
|
914
|
+
newestLast: boolean;
|
|
915
|
+
holdNewMessages: boolean;
|
|
916
|
+
showEmptyState: boolean;
|
|
917
|
+
emptyStateMessage: string;
|
|
918
|
+
allowReplies: boolean;
|
|
919
|
+
enableHoldOnClick: boolean;
|
|
920
|
+
enableHoldOnScroll: boolean;
|
|
921
|
+
customMenuItems: MessageMenuItem[];
|
|
922
|
+
fixedHeight: boolean;
|
|
923
|
+
selectedMessage: ChatMessage;
|
|
924
|
+
genericAvatarUrl: string;
|
|
925
|
+
inlineRepliesTemplate: TemplateRef<any>;
|
|
926
|
+
private _selected;
|
|
927
|
+
private _liked;
|
|
928
|
+
private _unliked;
|
|
929
|
+
private _pinned;
|
|
930
|
+
private _unpinned;
|
|
931
|
+
private _reported;
|
|
932
|
+
private _userSelected;
|
|
933
|
+
private _usernameSelected;
|
|
934
|
+
private _avatarSelected;
|
|
935
|
+
private _shared;
|
|
936
|
+
private _deleted;
|
|
937
|
+
private _messageEdited;
|
|
938
|
+
private _sortOrderChanged;
|
|
939
|
+
private _filterModeChanged;
|
|
940
|
+
readonly userSelected: rxjs.Observable<ChatMessage>;
|
|
941
|
+
readonly reported: rxjs.Observable<ChatMessage>;
|
|
942
|
+
readonly liked: rxjs.Observable<ChatMessage>;
|
|
943
|
+
readonly unliked: rxjs.Observable<ChatMessage>;
|
|
944
|
+
readonly pinned: rxjs.Observable<{
|
|
945
|
+
message: ChatMessage;
|
|
946
|
+
options: PinOptions;
|
|
947
|
+
}>;
|
|
948
|
+
readonly unpinned: rxjs.Observable<ChatMessage>;
|
|
949
|
+
readonly usernameSelected: rxjs.Observable<User>;
|
|
950
|
+
readonly avatarSelected: rxjs.Observable<User>;
|
|
951
|
+
readonly shared: rxjs.Observable<ChatMessage>;
|
|
952
|
+
readonly deleted: rxjs.Observable<ChatMessage>;
|
|
953
|
+
readonly selected: rxjs.Observable<ChatMessage>;
|
|
954
|
+
readonly messageEdited: rxjs.Observable<EditEvent>;
|
|
955
|
+
readonly sortOrderChanged: rxjs.Observable<"newest" | "oldest" | "likes">;
|
|
956
|
+
readonly filterModeChanged: rxjs.Observable<string>;
|
|
957
|
+
commentsQuery: QueryList<CommentComponent>;
|
|
958
|
+
messageContainer: ElementRef<HTMLElement>;
|
|
959
|
+
get comments(): CommentComponent[];
|
|
960
|
+
/**
|
|
961
|
+
* Returns true if this message can be found within one of the message buffers (older, current, newer)
|
|
962
|
+
* @param message
|
|
963
|
+
*/
|
|
964
|
+
isMessageLoadedInContext(message: ChatMessage): ChatMessage;
|
|
965
|
+
loadMessageInContext(message: ChatMessage): Promise<boolean>;
|
|
966
|
+
get shouldShowNewMessageIndicator(): boolean;
|
|
967
|
+
get shouldHoldNewMessages(): boolean;
|
|
968
|
+
private isElementVisible;
|
|
969
|
+
/**
|
|
970
|
+
* Get the CommentComponent instantiated for the given ChatMessage,
|
|
971
|
+
* if it exists in the current view. Note that messages which are not
|
|
972
|
+
* currently shown to the user will not return a CommentComponent.
|
|
973
|
+
* @param message
|
|
974
|
+
* @returns
|
|
975
|
+
*/
|
|
976
|
+
getCommentComponentForMessage(message: ChatMessage): CommentComponent;
|
|
977
|
+
saveEdit(message: ChatMessage, newMessage: string): void;
|
|
978
|
+
likeMessage(message: ChatMessage): void;
|
|
979
|
+
unlikeMessage(message: ChatMessage): void;
|
|
980
|
+
pinMessage(message: ChatMessage, options: PinOptions): void;
|
|
981
|
+
unpinMessage(message: ChatMessage): void;
|
|
982
|
+
reportMessage(message: ChatMessage): void;
|
|
983
|
+
selectMessage(message: ChatMessage): void;
|
|
984
|
+
selectMessageUser(message: ChatMessage): void;
|
|
985
|
+
selectUsername(user: User): void;
|
|
986
|
+
selectAvatar(user: User): void;
|
|
987
|
+
sharedMessage(message: ChatMessage): void;
|
|
988
|
+
startEditing(message: ChatMessage): void;
|
|
989
|
+
deleteMessage(message: ChatMessage): void;
|
|
990
|
+
private setSource;
|
|
991
|
+
private getInitialMessages;
|
|
992
|
+
debugMessages(): void;
|
|
993
|
+
zeroPad(number: number | string, count?: number): string;
|
|
994
|
+
leftPad(str: string, count?: number): string;
|
|
995
|
+
messageIdentity(index: number, chatMessage: ChatMessage): string;
|
|
996
|
+
get sourceSortOrder(): "newest" | "oldest" | "likes";
|
|
997
|
+
get sourceFilterMode(): string;
|
|
998
|
+
/**
|
|
999
|
+
* Show the newest content.
|
|
1000
|
+
* - If an unnatural sort order is active (ie Oldest or Likes), it will be changed to Newest.
|
|
1001
|
+
* - The new content will be placed where new content goes based on newestLast (replies mode), so if it is true, the content is
|
|
1002
|
+
* placed at the end, otherwise it is placed at the beginning.
|
|
1003
|
+
*
|
|
1004
|
+
* @param event
|
|
1005
|
+
* @returns
|
|
1006
|
+
*/
|
|
1007
|
+
showNewest(event: MouseEvent): Promise<void>;
|
|
1008
|
+
get showDebug(): boolean;
|
|
1009
|
+
get shouldShowNext(): boolean;
|
|
1010
|
+
get shouldShowPrevious(): boolean;
|
|
1011
|
+
get pageSize(): number;
|
|
1012
|
+
showPrevious(): Promise<void>;
|
|
1013
|
+
get sortNextLabel(): "Older" | "Newer" | "Less Likes" | "More";
|
|
1014
|
+
get sortPreviousLabel(): "Older" | "Newer" | "More" | "More Likes";
|
|
1015
|
+
get nextLabel(): "Older" | "Newer" | "Less Likes" | "More" | "More Likes";
|
|
1016
|
+
get previousLabel(): "Older" | "Newer" | "Less Likes" | "More" | "More Likes";
|
|
1017
|
+
/**
|
|
1018
|
+
* Show more content
|
|
1019
|
+
* - When in replies mode (newestLast), the content is added at the top
|
|
1020
|
+
* - When in normal mode, the content is added at the bottom
|
|
1021
|
+
* - The current sort order does *not* factor in here, which is why it is showMore() not showEarlier().
|
|
1022
|
+
*
|
|
1023
|
+
* @returns
|
|
1024
|
+
*/
|
|
1025
|
+
showNext(): Promise<void>;
|
|
1026
|
+
/**
|
|
1027
|
+
* Show more content
|
|
1028
|
+
* - When in replies mode (newestLast), the content is added at the top
|
|
1029
|
+
* - When in normal mode, the content is added at the bottom
|
|
1030
|
+
* - The current sort order does *not* factor in here, which is why it is showMore() not showEarlier().
|
|
1031
|
+
*
|
|
1032
|
+
* @returns
|
|
1033
|
+
*/
|
|
1034
|
+
showMore(): Promise<void>;
|
|
1035
|
+
heldMessages: ChatMessage[];
|
|
1036
|
+
private addMessage;
|
|
1037
|
+
private incrementPagingCursors;
|
|
1038
|
+
/**
|
|
1039
|
+
* Wait for all currently visible comments to be fully loaded, including all attachments.
|
|
1040
|
+
* Doing this will prevent layout shift when scrolling to a specific comment.
|
|
1041
|
+
*/
|
|
1042
|
+
waitForAllCommentsToLoad(): Promise<void>;
|
|
1043
|
+
private sortMessages;
|
|
1044
|
+
private messageReceived;
|
|
1045
|
+
isScrolledToLatest(): boolean;
|
|
1046
|
+
private messageSent;
|
|
1047
|
+
private isPinned;
|
|
1048
|
+
private messageUpdated;
|
|
1049
|
+
scrollToLatest(): void;
|
|
1050
|
+
get element(): HTMLElement;
|
|
1051
|
+
scrollToComment(commentId: ChatMessage['id']): Promise<void>;
|
|
1052
|
+
getElementForComment(commentId: string): Element;
|
|
1053
|
+
mentionsMe(message: ChatMessage): boolean;
|
|
1054
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CommentViewComponent, never>;
|
|
1055
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CommentViewComponent, "banta-comment-view", never, { "source": { "alias": "source"; "required": false; }; "maxMessages": { "alias": "maxMessages"; "required": false; }; "maxVisibleMessages": { "alias": "maxVisibleMessages"; "required": false; }; "collapsePins": { "alias": "collapsePins"; "required": false; }; "newestLast": { "alias": "newestLast"; "required": false; }; "holdNewMessages": { "alias": "holdNewMessages"; "required": false; }; "showEmptyState": { "alias": "showEmptyState"; "required": false; }; "emptyStateMessage": { "alias": "emptyStateMessage"; "required": false; }; "allowReplies": { "alias": "allowReplies"; "required": false; }; "enableHoldOnClick": { "alias": "enableHoldOnClick"; "required": false; }; "enableHoldOnScroll": { "alias": "enableHoldOnScroll"; "required": false; }; "customMenuItems": { "alias": "customMenuItems"; "required": false; }; "fixedHeight": { "alias": "fixedHeight"; "required": false; }; "selectedMessage": { "alias": "selectedMessage"; "required": false; }; "genericAvatarUrl": { "alias": "genericAvatarUrl"; "required": false; }; }, { "userSelected": "userSelected"; "reported": "reported"; "liked": "liked"; "unliked": "unliked"; "pinned": "pinned"; "unpinned": "unpinned"; "usernameSelected": "usernameSelected"; "avatarSelected": "avatarSelected"; "shared": "shared"; "deleted": "deleted"; "selected": "selected"; "messageEdited": "messageEdited"; "sortOrderChanged": "sortOrderChanged"; "filterModeChanged": "filterModeChanged"; }, ["inlineRepliesTemplate"], ["[data-before]", ":not([data-before]):not(.inline-replies)"], false, never>;
|
|
1056
|
+
}
|
|
1057
|
+
|
|
1058
|
+
interface AutoCompleteOption {
|
|
1059
|
+
label: string;
|
|
1060
|
+
action?: () => void;
|
|
1061
|
+
}
|
|
1062
|
+
interface HashTag {
|
|
1063
|
+
hashtag: string;
|
|
1064
|
+
description: string;
|
|
1065
|
+
}
|
|
1066
|
+
declare class CommentFieldComponent {
|
|
1067
|
+
ngAfterViewInit(): void;
|
|
1068
|
+
private _source;
|
|
1069
|
+
get source(): ChatSourceBase;
|
|
1070
|
+
set source(value: ChatSourceBase);
|
|
1071
|
+
private _permissionDeniedError;
|
|
1072
|
+
private errorTimeout;
|
|
1073
|
+
private _subs;
|
|
1074
|
+
sending: boolean;
|
|
1075
|
+
sendError: Error;
|
|
1076
|
+
expandError: boolean;
|
|
1077
|
+
autocompleteVisible: boolean;
|
|
1078
|
+
autocompleteOptions: AutoCompleteOption[];
|
|
1079
|
+
completionFunc: (str: string) => AutoCompleteOption[];
|
|
1080
|
+
completionPrefix: string;
|
|
1081
|
+
autoCompleteSelected: number;
|
|
1082
|
+
text: string;
|
|
1083
|
+
chatMessageAttachments: ChatMessageAttachment[];
|
|
1084
|
+
user: User;
|
|
1085
|
+
canComment: boolean;
|
|
1086
|
+
signInState: SignInState;
|
|
1087
|
+
allowAttachments: boolean;
|
|
1088
|
+
transientMessage: string;
|
|
1089
|
+
sendLabel: string;
|
|
1090
|
+
signingInLabel: string;
|
|
1091
|
+
sendingLabel: string;
|
|
1092
|
+
label: string;
|
|
1093
|
+
permissionDeniedLabel: string;
|
|
1094
|
+
signInLabel: string;
|
|
1095
|
+
maxLength: number;
|
|
1096
|
+
placeholder: string;
|
|
1097
|
+
shouldInterceptMessageSend?: (message: ChatMessage, source: ChatSourceBase) => boolean | Promise<boolean>;
|
|
1098
|
+
hashtags: HashTag[];
|
|
1099
|
+
participants: User[];
|
|
1100
|
+
genericAvatarUrl: string;
|
|
1101
|
+
url: string;
|
|
1102
|
+
submit: (message: ChatMessage) => void;
|
|
1103
|
+
readonly: boolean;
|
|
1104
|
+
allowServerInfoRequest: boolean;
|
|
1105
|
+
signInSelected: Subject<void>;
|
|
1106
|
+
editAvatarSelected: Subject<void>;
|
|
1107
|
+
focusChange: Subject<boolean>;
|
|
1108
|
+
textChanged: Subject<void>;
|
|
1109
|
+
serverInfoRequested: Subject<void>;
|
|
1110
|
+
reconnectRequested: Subject<void>;
|
|
1111
|
+
get permissionDeniedError(): Subject<string>;
|
|
1112
|
+
autocompleteEl: ElementRef<HTMLElement>;
|
|
1113
|
+
autocompleteContainerEl: ElementRef<HTMLElement>;
|
|
1114
|
+
textareaEl: ElementRef<HTMLTextAreaElement>;
|
|
1115
|
+
get indicatorState(): "error" | "transient" | "sending" | "none";
|
|
1116
|
+
get buttonState(): "signing-in" | "sending" | "permission-denied" | "send";
|
|
1117
|
+
get sendButtonEnabled(): boolean;
|
|
1118
|
+
get userAvatarUrl(): string;
|
|
1119
|
+
get isValidMessage(): string | boolean;
|
|
1120
|
+
get hasPendingAttachments(): boolean;
|
|
1121
|
+
private setSource;
|
|
1122
|
+
sendPermissionDenied(message: string): void;
|
|
1123
|
+
activateAutoComplete(option: AutoCompleteOption): void;
|
|
1124
|
+
onFocus(): void;
|
|
1125
|
+
onBlur(): void;
|
|
1126
|
+
showSignIn(): void;
|
|
1127
|
+
showEditAvatar(): void;
|
|
1128
|
+
insertEmoji(text: string): void;
|
|
1129
|
+
showAutoComplete(options: AutoCompleteOption[]): void;
|
|
1130
|
+
dismissAutoComplete(): void;
|
|
1131
|
+
indicateError(message: string): void;
|
|
1132
|
+
autocomplete(replacement: string): Promise<void>;
|
|
1133
|
+
insert(str: string): Promise<void>;
|
|
1134
|
+
onKeyDown(event: KeyboardEvent): Promise<void>;
|
|
1135
|
+
startAutoComplete(event: KeyboardEvent, completionFunc: (str: string) => AutoCompleteOption[]): void;
|
|
1136
|
+
sendMessage(): Promise<void>;
|
|
1137
|
+
addedAttachment(attachment: ChatMessageAttachment): void;
|
|
1138
|
+
attachmentError(attachment: ChatMessageAttachment): void;
|
|
1139
|
+
removeAttachment(attachment: ChatMessageAttachment): void;
|
|
1140
|
+
alertError(): void;
|
|
1141
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CommentFieldComponent, never>;
|
|
1142
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CommentFieldComponent, "banta-comment-field", never, { "source": { "alias": "source"; "required": false; }; "user": { "alias": "user"; "required": false; }; "canComment": { "alias": "canComment"; "required": false; }; "signInState": { "alias": "signInState"; "required": false; }; "allowAttachments": { "alias": "allowAttachments"; "required": false; }; "transientMessage": { "alias": "transientMessage"; "required": false; }; "sendLabel": { "alias": "sendLabel"; "required": false; }; "signingInLabel": { "alias": "signingInLabel"; "required": false; }; "sendingLabel": { "alias": "sendingLabel"; "required": false; }; "label": { "alias": "label"; "required": false; }; "permissionDeniedLabel": { "alias": "permissionDeniedLabel"; "required": false; }; "signInLabel": { "alias": "signInLabel"; "required": false; }; "maxLength": { "alias": "maxLength"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "shouldInterceptMessageSend": { "alias": "shouldInterceptMessageSend"; "required": false; }; "hashtags": { "alias": "hashtags"; "required": false; }; "participants": { "alias": "participants"; "required": false; }; "genericAvatarUrl": { "alias": "genericAvatarUrl"; "required": false; }; "url": { "alias": "url"; "required": false; }; "submit": { "alias": "submit"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "allowServerInfoRequest": { "alias": "allowServerInfoRequest"; "required": false; }; }, { "signInSelected": "signInSelected"; "editAvatarSelected": "editAvatarSelected"; "focusChange": "focusChange"; "textChanged": "textChanged"; "serverInfoRequested": "serverInfoRequested"; "reconnectRequested": "reconnectRequested"; "permissionDeniedError": "permissionDeniedError"; }, never, ["*"], false, never>;
|
|
1143
|
+
}
|
|
1144
|
+
|
|
1145
|
+
/**
|
|
1146
|
+
* Comments component
|
|
1147
|
+
*/
|
|
1148
|
+
declare class BantaCommentsComponent {
|
|
1149
|
+
private backend;
|
|
1150
|
+
private elementRef;
|
|
1151
|
+
private activatedRoute;
|
|
1152
|
+
private matSnackBar;
|
|
1153
|
+
private ngZone;
|
|
1154
|
+
constructor(backend: ChatBackendBase, elementRef: ElementRef<HTMLElement>, activatedRoute: ActivatedRoute, matSnackBar: MatSnackBar, ngZone: NgZone);
|
|
1155
|
+
get element(): HTMLElement;
|
|
1156
|
+
private handleBackendExceptionAsAlert;
|
|
1157
|
+
private handleBackendExceptionAsSnack;
|
|
1158
|
+
private handleBackendException;
|
|
1159
|
+
ngOnInit(): void;
|
|
1160
|
+
private resizeObserver;
|
|
1161
|
+
private width;
|
|
1162
|
+
private height;
|
|
1163
|
+
isMobileSized: boolean;
|
|
1164
|
+
sendReplyOptionsTemplate: any;
|
|
1165
|
+
markViewReady: () => void;
|
|
1166
|
+
viewReady: Promise<void>;
|
|
1167
|
+
ngAfterViewInit(): void;
|
|
1168
|
+
ngOnDestroy(): void;
|
|
1169
|
+
private setSourceFromTopicID;
|
|
1170
|
+
loadingTitle: string;
|
|
1171
|
+
private _loadingMessage;
|
|
1172
|
+
loadingMessageVisible: boolean;
|
|
1173
|
+
get loadingMessage(): string;
|
|
1174
|
+
set loadingMessage(value: string);
|
|
1175
|
+
loading: boolean;
|
|
1176
|
+
showLoadingScreen: boolean;
|
|
1177
|
+
loadingStartedAt: number;
|
|
1178
|
+
messageChangedAt: number;
|
|
1179
|
+
sharedCommentID: string;
|
|
1180
|
+
lastSharedCommentID: string;
|
|
1181
|
+
customMenuItems: MessageMenuItem[];
|
|
1182
|
+
private startLoading;
|
|
1183
|
+
private _loadingTimer;
|
|
1184
|
+
private _loadingMessageIndex;
|
|
1185
|
+
/**
|
|
1186
|
+
* The canonical URL where this comment section can be found. If not specified, uses the current URL.
|
|
1187
|
+
*/
|
|
1188
|
+
url: string;
|
|
1189
|
+
maxCommentLength: number;
|
|
1190
|
+
loadingMessages: string[];
|
|
1191
|
+
useInlineReplies: boolean;
|
|
1192
|
+
/**
|
|
1193
|
+
* Access the CommentViewComponent for this BantaCommentsComponent.
|
|
1194
|
+
* CommentViewComponent is responsible for interacting with the ChatSource
|
|
1195
|
+
* object and rendering comments as CommentComponents. It is the source of
|
|
1196
|
+
* truth for which CommentComponent corresponds to which ChatMessage.
|
|
1197
|
+
*
|
|
1198
|
+
* Note that this CommentViewComponent is only for the top level comments.
|
|
1199
|
+
* Replies are handled by a separate CommentViewComponent which can be
|
|
1200
|
+
* retrieved using the threadView property.
|
|
1201
|
+
*/
|
|
1202
|
+
commentView: CommentViewComponent;
|
|
1203
|
+
threadViewQuery: QueryList<CommentViewComponent>;
|
|
1204
|
+
/**
|
|
1205
|
+
* Attempts to find the CommentComponent that corresponds to the given ChatMessage.
|
|
1206
|
+
* The ChatMessage could be a top-level message in this conversation, or a reply,
|
|
1207
|
+
* but note that a CommentComponent will only exist for a reply if the user has
|
|
1208
|
+
* the relevant reply thread open.
|
|
1209
|
+
* @param message The message to look for
|
|
1210
|
+
*/
|
|
1211
|
+
getCommentComponentForMessage(message: ChatMessage): CommentComponent;
|
|
1212
|
+
/**
|
|
1213
|
+
* Access the CommentViewComponent corresponding to the currently open reply thread.
|
|
1214
|
+
* This is not the top level comments, but instead the reply thread that the user has
|
|
1215
|
+
* opened (only one set of replies can be open at a time).
|
|
1216
|
+
*
|
|
1217
|
+
* For details about what CommentViewComponent affords you, see the commentView property.
|
|
1218
|
+
*/
|
|
1219
|
+
get threadView(): CommentViewComponent;
|
|
1220
|
+
waitForThreadView(): Promise<CommentViewComponent>;
|
|
1221
|
+
markLoaded: () => void;
|
|
1222
|
+
loaded: Promise<void>;
|
|
1223
|
+
get sourceState(): "connected" | "connecting" | "lost" | "restored" | "no-source";
|
|
1224
|
+
private updateLoading;
|
|
1225
|
+
private _signInSelected;
|
|
1226
|
+
private _permissionDeniedError;
|
|
1227
|
+
private _editAvatarSelected;
|
|
1228
|
+
private _upvoted;
|
|
1229
|
+
private _reported;
|
|
1230
|
+
private _selected;
|
|
1231
|
+
private _userSelected;
|
|
1232
|
+
private _shared;
|
|
1233
|
+
private _usernameSelected;
|
|
1234
|
+
private _avatarSelected;
|
|
1235
|
+
private _reconnectRequested;
|
|
1236
|
+
private _source;
|
|
1237
|
+
/**
|
|
1238
|
+
* Track whether we created this source. If we did not (ie it was passed in from the caller),
|
|
1239
|
+
* then we are not responsible for calling close(). If we do own it though, we will call close()
|
|
1240
|
+
* when we are done with it.
|
|
1241
|
+
*/
|
|
1242
|
+
private _sourceIsOwned;
|
|
1243
|
+
private _subs;
|
|
1244
|
+
private _topicID;
|
|
1245
|
+
user: User;
|
|
1246
|
+
selectedMessage: ChatMessage;
|
|
1247
|
+
selectedMessageThread: ChatSourceBase;
|
|
1248
|
+
selectedMessageVisible: boolean;
|
|
1249
|
+
connectionState: string;
|
|
1250
|
+
signInLabel: string;
|
|
1251
|
+
sendLabel: string;
|
|
1252
|
+
signingInLabel: string;
|
|
1253
|
+
replyLabel: string;
|
|
1254
|
+
sendingLabel: string;
|
|
1255
|
+
permissionDeniedLabel: string;
|
|
1256
|
+
postCommentLabel: string;
|
|
1257
|
+
postReplyLabel: string;
|
|
1258
|
+
allowAttachments: boolean;
|
|
1259
|
+
allowServerInfoRequest: boolean;
|
|
1260
|
+
fixedHeight: boolean;
|
|
1261
|
+
maxMessages: number;
|
|
1262
|
+
maxVisibleMessages: number;
|
|
1263
|
+
genericAvatarUrl: string;
|
|
1264
|
+
shouldInterceptMessageSend?: (message: ChatMessage, source: ChatSourceBase) => boolean | Promise<boolean>;
|
|
1265
|
+
participants: User[];
|
|
1266
|
+
private _sourceSubscription;
|
|
1267
|
+
reconnect(): void;
|
|
1268
|
+
replyFieldFocused: boolean;
|
|
1269
|
+
get source(): ChatSourceBase;
|
|
1270
|
+
set source(value: ChatSourceBase);
|
|
1271
|
+
hashtags: HashTag[];
|
|
1272
|
+
get topicID(): string;
|
|
1273
|
+
set topicID(value: string);
|
|
1274
|
+
readonly signInSelected: Observable<void>;
|
|
1275
|
+
readonly editAvatarSelected: Observable<void>;
|
|
1276
|
+
readonly permissionDeniedError: Observable<string>;
|
|
1277
|
+
readonly upvoted: Observable<ChatMessage>;
|
|
1278
|
+
readonly reported: Observable<ChatMessage>;
|
|
1279
|
+
readonly selected: Observable<ChatMessage>;
|
|
1280
|
+
readonly userSelected: Observable<ChatMessage>;
|
|
1281
|
+
readonly usernameSelected: Observable<User>;
|
|
1282
|
+
readonly avatarSelected: Observable<User>;
|
|
1283
|
+
readonly shared: Observable<ChatMessage>;
|
|
1284
|
+
readonly reconnectRequested: Observable<void>;
|
|
1285
|
+
private _reloadSourceTimeout;
|
|
1286
|
+
private reloadSource;
|
|
1287
|
+
private _sortOrder;
|
|
1288
|
+
get sortOrder(): "newest" | "oldest" | "likes";
|
|
1289
|
+
set sortOrder(value: "newest" | "oldest" | "likes");
|
|
1290
|
+
private _filterMode;
|
|
1291
|
+
get filterMode(): string;
|
|
1292
|
+
set filterMode(value: string);
|
|
1293
|
+
initialMessageCount: number;
|
|
1294
|
+
private _metadata;
|
|
1295
|
+
/**
|
|
1296
|
+
* Arbitrary metadata to send to the chat server. This can be used to provide context about the client to the server
|
|
1297
|
+
* for things like validating authorization and other uses.
|
|
1298
|
+
*/
|
|
1299
|
+
get metadata(): Record<string, any>;
|
|
1300
|
+
set metadata(value: Record<string, any>);
|
|
1301
|
+
get filterModes(): string[];
|
|
1302
|
+
get filterModeLabels(): {
|
|
1303
|
+
all: string;
|
|
1304
|
+
mine: string;
|
|
1305
|
+
threads: string;
|
|
1306
|
+
"my-likes": string;
|
|
1307
|
+
};
|
|
1308
|
+
get sortOrders(): readonly ["newest", "oldest", "likes"];
|
|
1309
|
+
get sortOrderLabels(): {
|
|
1310
|
+
newest: string;
|
|
1311
|
+
oldest: string;
|
|
1312
|
+
likes: string;
|
|
1313
|
+
};
|
|
1314
|
+
sendMessage: (message: ChatMessage) => void;
|
|
1315
|
+
sendReply: (message: ChatMessage) => void;
|
|
1316
|
+
scrollToComment(commentId: ChatMessage['id']): Promise<void>;
|
|
1317
|
+
serverInfoVisible: boolean;
|
|
1318
|
+
serverInfoLoading: boolean;
|
|
1319
|
+
serverInfo: ServerInfo;
|
|
1320
|
+
showServerInfo(): Promise<void>;
|
|
1321
|
+
loadingSharedComment: boolean;
|
|
1322
|
+
sharedCommentMissing: boolean;
|
|
1323
|
+
navigateToSharedComment(id: string): Promise<void>;
|
|
1324
|
+
handlePermissionDenied(errorMessage: string): void;
|
|
1325
|
+
sendPermissionDenied(message: string): void;
|
|
1326
|
+
scrollToMessage(message: ChatMessage): void;
|
|
1327
|
+
private addParticipant;
|
|
1328
|
+
likeMessage(source: ChatSourceBase, message: ChatMessage): Promise<void>;
|
|
1329
|
+
pinMessage(source: ChatSourceBase, message: ChatMessage, options: PinOptions): Promise<void>;
|
|
1330
|
+
unpinMessage(source: ChatSourceBase, message: ChatMessage): Promise<void>;
|
|
1331
|
+
unlikeMessage(source: ChatSourceBase, message: ChatMessage): Promise<void>;
|
|
1332
|
+
reportMessage(message: ChatMessage): Promise<void>;
|
|
1333
|
+
unselectMessage(): Promise<void>;
|
|
1334
|
+
toggleSelectedMessage(message: ChatMessage): Promise<void>;
|
|
1335
|
+
selectMessage(message: ChatMessage): Promise<ChatSourceBase>;
|
|
1336
|
+
showSignIn(): Promise<void>;
|
|
1337
|
+
showEditAvatar(): Promise<void>;
|
|
1338
|
+
selectMessageUser(message: ChatMessage): Promise<void>;
|
|
1339
|
+
selectUsername(user: User): Promise<void>;
|
|
1340
|
+
selectAvatar(user: User): Promise<void>;
|
|
1341
|
+
shareMessage(message: ChatMessage): Promise<void>;
|
|
1342
|
+
deleteMessage(message: ChatMessage): Promise<void>;
|
|
1343
|
+
editMessage(source: ChatSourceBase, message: ChatMessage, newText: string): Promise<void>;
|
|
1344
|
+
startEditing(message: ChatMessage): Promise<void>;
|
|
1345
|
+
saveEdit(message: ChatMessage, text: string): Promise<void>;
|
|
1346
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BantaCommentsComponent, never>;
|
|
1347
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<BantaCommentsComponent, "banta-comments", never, { "customMenuItems": { "alias": "customMenuItems"; "required": false; }; "url": { "alias": "url"; "required": false; }; "maxCommentLength": { "alias": "maxCommentLength"; "required": false; }; "loadingMessages": { "alias": "loadingMessages"; "required": false; }; "useInlineReplies": { "alias": "useInlineReplies"; "required": false; }; "signInLabel": { "alias": "signInLabel"; "required": false; }; "sendLabel": { "alias": "sendLabel"; "required": false; }; "signingInLabel": { "alias": "signingInLabel"; "required": false; }; "replyLabel": { "alias": "replyLabel"; "required": false; }; "sendingLabel": { "alias": "sendingLabel"; "required": false; }; "permissionDeniedLabel": { "alias": "permissionDeniedLabel"; "required": false; }; "postCommentLabel": { "alias": "postCommentLabel"; "required": false; }; "postReplyLabel": { "alias": "postReplyLabel"; "required": false; }; "allowAttachments": { "alias": "allowAttachments"; "required": false; }; "allowServerInfoRequest": { "alias": "allowServerInfoRequest"; "required": false; }; "fixedHeight": { "alias": "fixedHeight"; "required": false; }; "maxMessages": { "alias": "maxMessages"; "required": false; }; "maxVisibleMessages": { "alias": "maxVisibleMessages"; "required": false; }; "genericAvatarUrl": { "alias": "genericAvatarUrl"; "required": false; }; "shouldInterceptMessageSend": { "alias": "shouldInterceptMessageSend"; "required": false; }; "participants": { "alias": "participants"; "required": false; }; "source": { "alias": "source"; "required": false; }; "hashtags": { "alias": "hashtags"; "required": false; }; "topicID": { "alias": "topicID"; "required": false; }; "sortOrder": { "alias": "sortOrder"; "required": false; }; "filterMode": { "alias": "filterMode"; "required": false; }; "initialMessageCount": { "alias": "initialMessageCount"; "required": false; }; "metadata": { "alias": "metadata"; "required": false; }; }, { "signInSelected": "signInSelected"; "editAvatarSelected": "editAvatarSelected"; "permissionDeniedError": "permissionDeniedError"; "upvoted": "upvoted"; "reported": "reported"; "selected": "selected"; "userSelected": "userSelected"; "usernameSelected": "usernameSelected"; "avatarSelected": "avatarSelected"; "shared": "shared"; "reconnectRequested": "reconnectRequested"; }, ["sendReplyOptionsTemplate"], never, false, never>;
|
|
1348
|
+
}
|
|
1349
|
+
|
|
1350
|
+
declare class LiveCommentComponent {
|
|
1351
|
+
private backend;
|
|
1352
|
+
constructor(backend: ChatBackendBase);
|
|
1353
|
+
private _message;
|
|
1354
|
+
private _upvoted;
|
|
1355
|
+
private _reported;
|
|
1356
|
+
private _selected;
|
|
1357
|
+
get upvoted(): Observable<void>;
|
|
1358
|
+
get reported(): Observable<void>;
|
|
1359
|
+
get selected(): Observable<void>;
|
|
1360
|
+
get message(): ChatMessage;
|
|
1361
|
+
private unsubscribe;
|
|
1362
|
+
set message(value: ChatMessage);
|
|
1363
|
+
report(): void;
|
|
1364
|
+
upvote(): void;
|
|
1365
|
+
select(): void;
|
|
1366
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LiveCommentComponent, never>;
|
|
1367
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<LiveCommentComponent, "banta-live-comment", never, { "message": { "alias": "message"; "required": false; }; }, { "upvoted": "upvoted"; "reported": "reported"; "selected": "selected"; }, never, never, false, never>;
|
|
1368
|
+
}
|
|
1369
|
+
|
|
1370
|
+
declare class CommentSortComponent {
|
|
1371
|
+
commentsOrder: {
|
|
1372
|
+
readonly NEWEST: "newest";
|
|
1373
|
+
readonly OLDEST: "oldest";
|
|
1374
|
+
readonly LIKES: "likes";
|
|
1375
|
+
readonly options: readonly ["newest", "oldest", "likes"];
|
|
1376
|
+
};
|
|
1377
|
+
private _sortChange;
|
|
1378
|
+
private _sort;
|
|
1379
|
+
get sort(): "newest" | "oldest" | "likes";
|
|
1380
|
+
set sort(value: "newest" | "oldest" | "likes");
|
|
1381
|
+
get sortChange(): rxjs.Observable<"newest" | "oldest" | "likes">;
|
|
1382
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CommentSortComponent, never>;
|
|
1383
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CommentSortComponent, "banta-comment-sort", never, { "sort": { "alias": "sort"; "required": false; }; }, { "sortChange": "sortChange"; }, never, never, false, never>;
|
|
1384
|
+
}
|
|
1385
|
+
|
|
1386
|
+
declare class AttachmentButtonComponent {
|
|
1387
|
+
private cdnProvider;
|
|
1388
|
+
constructor(cdnProvider: CDNProvider);
|
|
1389
|
+
private _addedAttachment;
|
|
1390
|
+
private _attachmentError;
|
|
1391
|
+
disabled: boolean;
|
|
1392
|
+
get addedAttachment(): rxjs.Observable<ChatMessageAttachment>;
|
|
1393
|
+
get attachmentError(): rxjs.Observable<ChatMessageAttachment>;
|
|
1394
|
+
fileInput: ElementRef<HTMLInputElement>;
|
|
1395
|
+
show(): void;
|
|
1396
|
+
fileChange(event: Event): Promise<void>;
|
|
1397
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AttachmentButtonComponent, never>;
|
|
1398
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AttachmentButtonComponent, "banta-attachment-button", never, { "disabled": { "alias": "disabled"; "required": false; }; }, { "addedAttachment": "addedAttachment"; "attachmentError": "attachmentError"; }, never, never, false, never>;
|
|
1399
|
+
}
|
|
1400
|
+
|
|
1401
|
+
declare class BantaReplySendOptionsDirective {
|
|
1402
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BantaReplySendOptionsDirective, never>;
|
|
1403
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<BantaReplySendOptionsDirective, "[bantaReplySendOptions]", never, {}, {}, never, never, false, never>;
|
|
1404
|
+
}
|
|
1405
|
+
|
|
1406
|
+
declare class BantaInlineRepliesDirective {
|
|
1407
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BantaInlineRepliesDirective, never>;
|
|
1408
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<BantaInlineRepliesDirective, "[bantaInlineReplies]", never, {}, {}, never, never, false, never>;
|
|
1409
|
+
}
|
|
1410
|
+
|
|
1411
|
+
declare class AttachmentScraperDirective {
|
|
1412
|
+
private elementRef;
|
|
1413
|
+
private chatBackend;
|
|
1414
|
+
constructor(elementRef: ElementRef<HTMLTextAreaElement>, chatBackend: ChatBackendBase);
|
|
1415
|
+
attachments: ChatMessageAttachment[];
|
|
1416
|
+
attachmentsChange: Subject<ChatMessageAttachment[]>;
|
|
1417
|
+
ngOnInit(): void;
|
|
1418
|
+
get element(): HTMLTextAreaElement;
|
|
1419
|
+
get text(): string;
|
|
1420
|
+
private scrapeTimeout;
|
|
1421
|
+
private scrapeDebounce;
|
|
1422
|
+
private fragments;
|
|
1423
|
+
private scrape;
|
|
1424
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AttachmentScraperDirective, never>;
|
|
1425
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<AttachmentScraperDirective, "[attachmentScraper]", never, { "attachments": { "alias": "attachments"; "required": false; }; }, { "attachmentsChange": "attachmentsChange"; }, never, never, false, never>;
|
|
1426
|
+
}
|
|
1427
|
+
|
|
1428
|
+
declare class CommentsModule {
|
|
1429
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CommentsModule, never>;
|
|
1430
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<CommentsModule, [typeof CommentComponent, typeof CommentViewComponent, typeof BantaCommentsComponent, typeof LiveCommentComponent, typeof CommentFieldComponent, typeof CommentSortComponent, typeof AttachmentButtonComponent, typeof BantaReplySendOptionsDirective, typeof BantaInlineRepliesDirective, typeof AttachmentScraperDirective], [typeof i8.CommonModule, typeof i12.TextFieldModule, typeof i4.FormsModule, typeof i9.MatIconModule, typeof i15.MatFormFieldModule, typeof i16.MatInputModule, typeof i11.MatButtonModule, typeof i18.MatMenuModule, typeof i19.MatDividerModule, typeof i10.MatProgressSpinnerModule, typeof BantaCommonModule, typeof EmojiModule, typeof i23.MatTooltipModule, typeof i24.MatDatepickerModule, typeof i25.MatSelectModule, typeof i26.MatBadgeModule, typeof i27.MatRadioModule, typeof i9$1.OverlayModule, typeof i10$1.PortalModule], [typeof CommentComponent, typeof CommentViewComponent, typeof BantaCommentsComponent, typeof LiveCommentComponent, typeof CommentFieldComponent, typeof CommentSortComponent, typeof AttachmentButtonComponent, typeof BantaReplySendOptionsDirective, typeof BantaInlineRepliesDirective, typeof AttachmentScraperDirective]>;
|
|
1431
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<CommentsModule>;
|
|
1432
|
+
}
|
|
1433
|
+
|
|
1434
|
+
interface SdkOptions {
|
|
1435
|
+
serviceUrl?: string;
|
|
1436
|
+
emojiUrl?: string;
|
|
1437
|
+
backendClass?: Type<ChatBackendBase>;
|
|
1438
|
+
}
|
|
1439
|
+
declare const BANTA_SDK_OPTIONS: InjectionToken<SdkOptions>;
|
|
1440
|
+
|
|
1441
|
+
declare class UrlAttachmentScraper implements AttachmentScraper {
|
|
1442
|
+
findFragments(message: ChatMessage): AttachmentFragment[];
|
|
1443
|
+
}
|
|
1444
|
+
declare class UrlAttachmentResolver implements AttachmentResolver {
|
|
1445
|
+
private backend;
|
|
1446
|
+
constructor(backend: ChatBackendBase);
|
|
1447
|
+
resolveFragment(message: ChatMessage, fragment: AttachmentFragment): Promise<ChatMessageAttachment>;
|
|
1448
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<UrlAttachmentResolver, never>;
|
|
1449
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<UrlAttachmentResolver>;
|
|
1450
|
+
}
|
|
1451
|
+
|
|
1452
|
+
declare class YouTubeAttachmentResolver implements AttachmentResolver {
|
|
1453
|
+
resolveFragment(message: ChatMessage, fragment: AttachmentFragment): Promise<ChatMessageAttachment>;
|
|
1454
|
+
}
|
|
1455
|
+
|
|
1456
|
+
declare class GiphyAttachmentResolver implements AttachmentResolver {
|
|
1457
|
+
resolveFragment(message: ChatMessage, fragment: AttachmentFragment): Promise<ChatMessageAttachment>;
|
|
1458
|
+
}
|
|
1459
|
+
|
|
1460
|
+
declare class TweetAttachmentResolver implements AttachmentResolver {
|
|
1461
|
+
resolveFragment(message: ChatMessage, fragment: AttachmentFragment): Promise<ChatMessageAttachment>;
|
|
1462
|
+
}
|
|
1463
|
+
|
|
1464
|
+
declare class BantaSdkModule {
|
|
1465
|
+
chatBackend: ChatBackendBase;
|
|
1466
|
+
constructor();
|
|
1467
|
+
static configure(options?: SdkOptions): ModuleWithProviders<BantaSdkModule>;
|
|
1468
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BantaSdkModule, never>;
|
|
1469
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<BantaSdkModule, [typeof BantaComponent, typeof BantaLogoComponent, typeof LiveMessageComponent], [typeof i8.CommonModule, typeof i4.FormsModule, typeof BantaCommonModule, typeof CommentsModule, typeof ChatModule, typeof EmojiModule, typeof i9.MatIconModule, typeof i11.MatButtonModule, typeof i23.MatTooltipModule, typeof i18.MatMenuModule, typeof i14.MatDialogModule, typeof i15.MatFormFieldModule, typeof i16.MatInputModule, typeof i10.MatProgressSpinnerModule, typeof i18$1.MatSnackBarModule, typeof i9$1.OverlayModule, typeof i10$1.PortalModule], [typeof BantaComponent, typeof BantaLogoComponent, typeof LiveMessageComponent, typeof BantaCommonModule, typeof ChatModule, typeof CommentsModule, typeof EmojiModule]>;
|
|
1470
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<BantaSdkModule>;
|
|
1471
|
+
}
|
|
1472
|
+
|
|
1473
|
+
export { AttachmentButtonComponent, AttachmentScraperDirective, BANTA_SDK_OPTIONS, BantaAttachmentComponent, BantaAttachmentsComponent, BantaChatComponent, BantaCommentsComponent, BantaCommonModule, BantaComponent, BantaInlineRepliesDirective, BantaLogoComponent, BantaMarkdownToHtmlPipe, BantaMentionLinkerPipe, BantaReplySendOptionsDirective, BantaSdkModule, BantaTrustResourceUrlPipe, ChatBackend, ChatBackendBase, ChatMessageComponent, ChatModule, ChatSource, ChatViewComponent, CommentComponent, CommentFieldComponent, CommentSortComponent, CommentViewComponent, CommentsModule, EmojiModule, EmojiSelectorButtonComponent, EmojiSelectorPanelComponent, GiphyAttachmentResolver, LightboxComponent, LiveChatMessageComponent, LiveCommentComponent, LiveMessageComponent, TimerPool, TimestampComponent, TweetAttachmentResolver, UrlAttachmentResolver, UrlAttachmentScraper, YouTubeAttachmentResolver, lazyConnection };
|
|
1474
|
+
export type { AttachmentFragment, AttachmentRenderer, AttachmentResolver, AttachmentScraper, AugmentedCategory, AugmentedEmoji, AutoCompleteOption, ChatSourceBase, ChatSourceOptions, EditEvent, HashTag, LazyConnectionOptions, MessageMenuItem, PinOptions, SdkOptions, SignInState };
|