@banta/sdk 4.9.0 → 5.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/{esm2020 → esm2022}/banta-sdk.mjs +4 -4
- package/{esm2020 → esm2022}/lib/attachment-scraper.mjs +1 -1
- package/esm2022/lib/banta/banta.component.mjs +204 -0
- package/{esm2020 → esm2022}/lib/banta-logo.component.mjs +11 -11
- package/esm2022/lib/banta-sdk.module.mjs +143 -0
- package/esm2022/lib/chat/banta-chat/banta-chat.component.mjs +187 -0
- package/esm2022/lib/chat/chat-message/chat-message.component.mjs +62 -0
- package/esm2022/lib/chat/chat-view/chat-view.component.mjs +170 -0
- package/{esm2020 → esm2022}/lib/chat/chat.module.mjs +51 -51
- package/{esm2020 → esm2022}/lib/chat/index.mjs +5 -5
- package/esm2022/lib/chat/live-chat-message.component.mjs +80 -0
- package/{esm2020 → esm2022}/lib/chat-backend-base.mjs +30 -30
- package/esm2022/lib/chat-backend.mjs +163 -0
- package/{esm2020 → esm2022}/lib/chat-source-base.mjs +1 -1
- package/esm2022/lib/chat-source.mjs +233 -0
- package/esm2022/lib/comments/attachment-button/attachment-button.component.mjs +76 -0
- package/esm2022/lib/comments/attachment-scraper.directive.mjs +107 -0
- package/esm2022/lib/comments/banta-comments/banta-comments.component.mjs +739 -0
- package/esm2022/lib/comments/comment/comment.component.mjs +175 -0
- package/esm2022/lib/comments/comment-field/comment-field.component.mjs +401 -0
- package/esm2022/lib/comments/comment-sort/comment-sort.component.mjs +37 -0
- package/esm2022/lib/comments/comment-view/comment-view.component.mjs +470 -0
- package/esm2022/lib/comments/comments.module.mjs +111 -0
- package/{esm2020 → esm2022}/lib/comments/index.mjs +10 -10
- package/esm2022/lib/comments/live-comment.component.mjs +80 -0
- package/{esm2020 → esm2022}/lib/comments/reply-send-options.directive.mjs +13 -13
- package/esm2022/lib/common/attachment/attachment.component.mjs +112 -0
- package/{esm2020 → esm2022}/lib/common/attachments/attachments.component.mjs +75 -75
- package/{esm2020 → esm2022}/lib/common/common.module.mjs +68 -68
- package/{esm2020 → esm2022}/lib/common/index.mjs +10 -10
- package/{esm2020 → esm2022}/lib/common/lazy-connection.mjs +14 -14
- package/esm2022/lib/common/lightbox/lightbox.component.mjs +31 -0
- package/esm2022/lib/common/markdown-to-html.pipe.mjs +89 -0
- package/esm2022/lib/common/mention-linker.pipe.mjs +35 -0
- package/esm2022/lib/common/timer-pool.service.mjs +83 -0
- package/esm2022/lib/common/timestamp.component.mjs +123 -0
- package/{esm2020 → esm2022}/lib/common/trust-resource-url.pipe.mjs +22 -22
- package/esm2022/lib/emoji/emoji-selector-button.component.mjs +115 -0
- package/esm2022/lib/emoji/emoji-selector-panel/emoji-selector-panel.component.mjs +98 -0
- package/{esm2020 → esm2022}/lib/emoji/emoji.module.mjs +55 -55
- package/{esm2020 → esm2022}/lib/emoji/emojis.mjs +6507 -6507
- package/{esm2020 → esm2022}/lib/emoji/index.mjs +4 -4
- package/esm2022/lib/giphy-attachments.mjs +16 -0
- package/{esm2020 → esm2022}/lib/index.mjs +19 -19
- package/{esm2020 → esm2022}/lib/live-message.component.mjs +61 -61
- package/{esm2020 → esm2022}/lib/message-menu-item.mjs +1 -1
- package/{esm2020 → esm2022}/lib/sdk-options.mjs +1 -1
- package/esm2022/lib/static-chat-source.mjs +71 -0
- package/esm2022/lib/tweet-attachments.mjs +13 -0
- package/esm2022/lib/url-attachments.mjs +42 -0
- package/esm2022/lib/youtube-attachments.mjs +29 -0
- package/{esm2020 → esm2022}/public-api.mjs +4 -4
- package/{fesm2020 → fesm2022}/banta-sdk.mjs +10753 -10754
- package/fesm2022/banta-sdk.mjs.map +1 -0
- package/index.d.ts +5 -5
- package/lib/attachment-scraper.d.ts +15 -15
- package/lib/banta/banta.component.d.ts +58 -58
- package/lib/banta-logo.component.d.ts +5 -5
- package/lib/banta-sdk.module.d.ts +31 -31
- package/lib/chat/banta-chat/banta-chat.component.d.ts +70 -70
- package/lib/chat/chat-message/chat-message.component.d.ts +21 -21
- package/lib/chat/chat-view/chat-view.component.d.ts +52 -52
- package/lib/chat/chat.module.d.ts +15 -15
- package/lib/chat/index.d.ts +5 -5
- package/lib/chat/live-chat-message.component.d.ts +23 -23
- package/lib/chat-backend-base.d.ts +36 -36
- package/lib/chat-backend.d.ts +55 -55
- package/lib/chat-source-base.d.ts +44 -44
- package/lib/chat-source.d.ts +65 -65
- package/lib/comments/attachment-button/attachment-button.component.d.ts +17 -17
- package/lib/comments/attachment-scraper.directive.d.ts +21 -21
- package/lib/comments/banta-comments/banta-comments.component.d.ts +196 -196
- package/lib/comments/comment/comment.component.d.ts +72 -72
- package/lib/comments/comment-field/comment-field.component.d.ts +89 -89
- package/lib/comments/comment-sort/comment-sort.component.d.ts +12 -12
- package/lib/comments/comment-view/comment-view.component.d.ts +121 -121
- package/lib/comments/comments.module.d.ts +30 -30
- package/lib/comments/index.d.ts +10 -10
- package/lib/comments/live-comment.component.d.ts +23 -23
- package/lib/comments/reply-send-options.directive.d.ts +5 -5
- package/lib/common/attachment/attachment.component.d.ts +33 -33
- package/lib/common/attachments/attachments.component.d.ts +26 -26
- package/lib/common/common.module.d.ts +19 -19
- package/lib/common/index.d.ts +10 -10
- package/lib/common/lazy-connection.d.ts +6 -6
- package/lib/common/lightbox/lightbox.component.d.ts +14 -14
- package/lib/common/markdown-to-html.pipe.d.ts +15 -15
- package/lib/common/mention-linker.pipe.d.ts +13 -13
- package/lib/common/timer-pool.service.d.ts +15 -15
- package/lib/common/timestamp.component.d.ts +19 -19
- package/lib/common/trust-resource-url.pipe.d.ts +10 -10
- package/lib/emoji/emoji-selector-button.component.d.ts +30 -30
- package/lib/emoji/emoji-selector-panel/emoji-selector-panel.component.d.ts +26 -26
- package/lib/emoji/emoji.module.d.ts +16 -16
- package/lib/emoji/emojis.d.ts +6507 -6507
- package/lib/emoji/index.d.ts +4 -4
- package/lib/giphy-attachments.d.ts +5 -5
- package/lib/index.d.ts +19 -19
- package/lib/live-message.component.d.ts +22 -22
- package/lib/message-menu-item.d.ts +6 -6
- package/lib/sdk-options.d.ts +5 -5
- package/lib/static-chat-source.d.ts +42 -42
- package/lib/tweet-attachments.d.ts +5 -5
- package/lib/url-attachments.d.ts +14 -14
- package/lib/youtube-attachments.d.ts +5 -5
- package/package.json +15 -21
- package/public-api.d.ts +1 -1
- package/esm2020/lib/banta/banta.component.mjs +0 -204
- package/esm2020/lib/banta-sdk.module.mjs +0 -143
- package/esm2020/lib/chat/banta-chat/banta-chat.component.mjs +0 -187
- package/esm2020/lib/chat/chat-message/chat-message.component.mjs +0 -62
- package/esm2020/lib/chat/chat-view/chat-view.component.mjs +0 -170
- package/esm2020/lib/chat/live-chat-message.component.mjs +0 -80
- package/esm2020/lib/chat-backend.mjs +0 -163
- package/esm2020/lib/chat-source.mjs +0 -233
- package/esm2020/lib/comments/attachment-button/attachment-button.component.mjs +0 -76
- package/esm2020/lib/comments/attachment-scraper.directive.mjs +0 -107
- package/esm2020/lib/comments/banta-comments/banta-comments.component.mjs +0 -740
- package/esm2020/lib/comments/comment/comment.component.mjs +0 -175
- package/esm2020/lib/comments/comment-field/comment-field.component.mjs +0 -401
- package/esm2020/lib/comments/comment-sort/comment-sort.component.mjs +0 -37
- package/esm2020/lib/comments/comment-view/comment-view.component.mjs +0 -470
- package/esm2020/lib/comments/comments.module.mjs +0 -111
- package/esm2020/lib/comments/live-comment.component.mjs +0 -80
- package/esm2020/lib/common/attachment/attachment.component.mjs +0 -112
- package/esm2020/lib/common/lightbox/lightbox.component.mjs +0 -31
- package/esm2020/lib/common/markdown-to-html.pipe.mjs +0 -89
- package/esm2020/lib/common/mention-linker.pipe.mjs +0 -35
- package/esm2020/lib/common/timer-pool.service.mjs +0 -83
- package/esm2020/lib/common/timestamp.component.mjs +0 -123
- package/esm2020/lib/emoji/emoji-selector-button.component.mjs +0 -116
- package/esm2020/lib/emoji/emoji-selector-panel/emoji-selector-panel.component.mjs +0 -98
- package/esm2020/lib/giphy-attachments.mjs +0 -16
- package/esm2020/lib/static-chat-source.mjs +0 -71
- package/esm2020/lib/tweet-attachments.mjs +0 -13
- package/esm2020/lib/url-attachments.mjs +0 -42
- package/esm2020/lib/youtube-attachments.mjs +0 -29
- package/fesm2015/banta-sdk.mjs +0 -11181
- package/fesm2015/banta-sdk.mjs.map +0 -1
- package/fesm2020/banta-sdk.mjs.map +0 -1
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { Observable } from 'rxjs';
|
|
2
|
-
import { ChatMessage, CommentsOrder, Notification, User, UrlCard, FilterMode } from '@banta/common';
|
|
3
|
-
import { ChatSourceBase } from './chat-source-base';
|
|
4
|
-
import { AttachmentResolver, AttachmentScraper } from './attachment-scraper';
|
|
5
|
-
export interface ChatSourceOptions {
|
|
6
|
-
sortOrder?: CommentsOrder;
|
|
7
|
-
filterMode?: FilterMode;
|
|
8
|
-
/**
|
|
9
|
-
* How many messages should be loaded initially?
|
|
10
|
-
*/
|
|
11
|
-
initialMessageCount?: number;
|
|
12
|
-
}
|
|
13
|
-
export declare abstract class ChatBackendBase {
|
|
14
|
-
constructor();
|
|
15
|
-
abstract getSourceForTopic(topicId: string, options?: ChatSourceOptions): Promise<ChatSourceBase>;
|
|
16
|
-
abstract getSourceForThread(topicId: string, messageId: string, options?: ChatSourceOptions): Promise<ChatSourceBase>;
|
|
17
|
-
abstract getSourceCountForTopic(topicId: string): Promise<number>;
|
|
18
|
-
abstract refreshMessage(message: ChatMessage): Promise<ChatMessage>;
|
|
19
|
-
abstract getMessage(topicId: string, messageId: string): Promise<ChatMessage>;
|
|
20
|
-
abstract getSubMessage(topicId: string, parentMessageId: string, messageId: string): Promise<ChatMessage>;
|
|
21
|
-
abstract watchMessage(message: ChatMessage, handler: (message: ChatMessage) => void): () => void;
|
|
22
|
-
abstract getCardForUrl(url: string): Promise<UrlCard>;
|
|
23
|
-
readonly notificationsChanged: Observable<Notification[]>;
|
|
24
|
-
readonly newNotification: Observable<Notification>;
|
|
25
|
-
private _userChanged;
|
|
26
|
-
private _user;
|
|
27
|
-
get userChanged(): Observable<User>;
|
|
28
|
-
set user(user: User);
|
|
29
|
-
get user(): User;
|
|
30
|
-
private _attachmentScrapers;
|
|
31
|
-
private _attachmentResolvers;
|
|
32
|
-
registerAttachmentScraper(scraper: AttachmentScraper): void;
|
|
33
|
-
registerAttachmentResolver(resolver: AttachmentResolver): void;
|
|
34
|
-
get attachmentScrapers(): AttachmentScraper[];
|
|
35
|
-
get attachmentResolvers(): AttachmentResolver[];
|
|
36
|
-
}
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { ChatMessage, CommentsOrder, Notification, User, UrlCard, FilterMode } from '@banta/common';
|
|
3
|
+
import { ChatSourceBase } from './chat-source-base';
|
|
4
|
+
import { AttachmentResolver, AttachmentScraper } from './attachment-scraper';
|
|
5
|
+
export interface ChatSourceOptions {
|
|
6
|
+
sortOrder?: CommentsOrder;
|
|
7
|
+
filterMode?: FilterMode;
|
|
8
|
+
/**
|
|
9
|
+
* How many messages should be loaded initially?
|
|
10
|
+
*/
|
|
11
|
+
initialMessageCount?: number;
|
|
12
|
+
}
|
|
13
|
+
export declare abstract class ChatBackendBase {
|
|
14
|
+
constructor();
|
|
15
|
+
abstract getSourceForTopic(topicId: string, options?: ChatSourceOptions): Promise<ChatSourceBase>;
|
|
16
|
+
abstract getSourceForThread(topicId: string, messageId: string, options?: ChatSourceOptions): Promise<ChatSourceBase>;
|
|
17
|
+
abstract getSourceCountForTopic(topicId: string): Promise<number>;
|
|
18
|
+
abstract refreshMessage(message: ChatMessage): Promise<ChatMessage>;
|
|
19
|
+
abstract getMessage(topicId: string, messageId: string): Promise<ChatMessage>;
|
|
20
|
+
abstract getSubMessage(topicId: string, parentMessageId: string, messageId: string): Promise<ChatMessage>;
|
|
21
|
+
abstract watchMessage(message: ChatMessage, handler: (message: ChatMessage) => void): () => void;
|
|
22
|
+
abstract getCardForUrl(url: string): Promise<UrlCard>;
|
|
23
|
+
readonly notificationsChanged: Observable<Notification[]>;
|
|
24
|
+
readonly newNotification: Observable<Notification>;
|
|
25
|
+
private _userChanged;
|
|
26
|
+
private _user;
|
|
27
|
+
get userChanged(): Observable<User>;
|
|
28
|
+
set user(user: User);
|
|
29
|
+
get user(): User;
|
|
30
|
+
private _attachmentScrapers;
|
|
31
|
+
private _attachmentResolvers;
|
|
32
|
+
registerAttachmentScraper(scraper: AttachmentScraper): void;
|
|
33
|
+
registerAttachmentResolver(resolver: AttachmentResolver): void;
|
|
34
|
+
get attachmentScrapers(): AttachmentScraper[];
|
|
35
|
+
get attachmentResolvers(): AttachmentResolver[];
|
|
36
|
+
}
|
package/lib/chat-backend.d.ts
CHANGED
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
import { ChatMessage, CommentsOrder, FilterMode, Notification, Topic, UrlCard } from "@banta/common";
|
|
2
|
-
import { Observable } from "rxjs";
|
|
3
|
-
import { ChatBackendBase, ChatSourceOptions } from "./chat-backend-base";
|
|
4
|
-
import { ChatSourceBase } from "./chat-source-base";
|
|
5
|
-
import { SdkOptions } from "./sdk-options";
|
|
6
|
-
import * as i0 from "@angular/core";
|
|
7
|
-
export declare class ChatBackend extends ChatBackendBase {
|
|
8
|
-
private options;
|
|
9
|
-
private platformId;
|
|
10
|
-
constructor(options: SdkOptions, platformId: any);
|
|
11
|
-
get serviceUrl(): string;
|
|
12
|
-
private connectToService;
|
|
13
|
-
private isServer;
|
|
14
|
-
/**
|
|
15
|
-
* Check if we are currently running inside a Googlebot user agent or via the Google inspection tool in Search Console.
|
|
16
|
-
* We'll use this to avoid WebSockets so that comments can be indexable.
|
|
17
|
-
* @returns
|
|
18
|
-
*/
|
|
19
|
-
private isGooglebot;
|
|
20
|
-
getSourceForTopic(topicId: string, options?: ChatSourceOptions): Promise<ChatSourceBase>;
|
|
21
|
-
getSourceForThread(topicId: string, messageId: string, options?: ChatSourceOptions): Promise<ChatSourceBase>;
|
|
22
|
-
/**
|
|
23
|
-
* Get the count of the given topic
|
|
24
|
-
* @param topicId
|
|
25
|
-
* @returns
|
|
26
|
-
*/
|
|
27
|
-
getSourceCountForTopic(topicId: string): Promise<number>;
|
|
28
|
-
/**
|
|
29
|
-
* Get the count of the given topic
|
|
30
|
-
* @param topicId
|
|
31
|
-
* @returns
|
|
32
|
-
*/
|
|
33
|
-
getTopic(topicId: string): Promise<Topic>;
|
|
34
|
-
/**
|
|
35
|
-
* Get a set of messages from the given topic.
|
|
36
|
-
* @param topicId
|
|
37
|
-
* @returns
|
|
38
|
-
*/
|
|
39
|
-
getMessages(topicId: string, sort?: CommentsOrder, filter?: FilterMode, offset?: number, limit?: number): Promise<ChatMessage[]>;
|
|
40
|
-
/**
|
|
41
|
-
* Get a set of messages from the given topic.
|
|
42
|
-
* @param topicId
|
|
43
|
-
* @returns
|
|
44
|
-
*/
|
|
45
|
-
getReplies(parentMessageId: string, sort?: CommentsOrder, filter?: FilterMode, offset?: number, limit?: number): Promise<ChatMessage[]>;
|
|
46
|
-
refreshMessage(message: ChatMessage): Promise<ChatMessage>;
|
|
47
|
-
getMessage(topicId: string, messageId: string): Promise<ChatMessage>;
|
|
48
|
-
getSubMessage(topicId: string, parentMessageId: string, messageId: string): Promise<ChatMessage>;
|
|
49
|
-
watchMessage(message: ChatMessage, handler: (message: ChatMessage) => void): () => void;
|
|
50
|
-
notificationsChanged: Observable<Notification[]>;
|
|
51
|
-
newNotification: Observable<Notification>;
|
|
52
|
-
getCardForUrl(url: string): Promise<UrlCard>;
|
|
53
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ChatBackend, never>;
|
|
54
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<ChatBackend>;
|
|
55
|
-
}
|
|
1
|
+
import { ChatMessage, CommentsOrder, FilterMode, Notification, Topic, UrlCard } from "@banta/common";
|
|
2
|
+
import { Observable } from "rxjs";
|
|
3
|
+
import { ChatBackendBase, ChatSourceOptions } from "./chat-backend-base";
|
|
4
|
+
import { ChatSourceBase } from "./chat-source-base";
|
|
5
|
+
import { SdkOptions } from "./sdk-options";
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export declare class ChatBackend extends ChatBackendBase {
|
|
8
|
+
private options;
|
|
9
|
+
private platformId;
|
|
10
|
+
constructor(options: SdkOptions, platformId: any);
|
|
11
|
+
get serviceUrl(): string;
|
|
12
|
+
private connectToService;
|
|
13
|
+
private isServer;
|
|
14
|
+
/**
|
|
15
|
+
* Check if we are currently running inside a Googlebot user agent or via the Google inspection tool in Search Console.
|
|
16
|
+
* We'll use this to avoid WebSockets so that comments can be indexable.
|
|
17
|
+
* @returns
|
|
18
|
+
*/
|
|
19
|
+
private isGooglebot;
|
|
20
|
+
getSourceForTopic(topicId: string, options?: ChatSourceOptions): Promise<ChatSourceBase>;
|
|
21
|
+
getSourceForThread(topicId: string, messageId: string, options?: ChatSourceOptions): Promise<ChatSourceBase>;
|
|
22
|
+
/**
|
|
23
|
+
* Get the count of the given topic
|
|
24
|
+
* @param topicId
|
|
25
|
+
* @returns
|
|
26
|
+
*/
|
|
27
|
+
getSourceCountForTopic(topicId: string): Promise<number>;
|
|
28
|
+
/**
|
|
29
|
+
* Get the count of the given topic
|
|
30
|
+
* @param topicId
|
|
31
|
+
* @returns
|
|
32
|
+
*/
|
|
33
|
+
getTopic(topicId: string): Promise<Topic>;
|
|
34
|
+
/**
|
|
35
|
+
* Get a set of messages from the given topic.
|
|
36
|
+
* @param topicId
|
|
37
|
+
* @returns
|
|
38
|
+
*/
|
|
39
|
+
getMessages(topicId: string, sort?: CommentsOrder, filter?: FilterMode, offset?: number, limit?: number): Promise<ChatMessage[]>;
|
|
40
|
+
/**
|
|
41
|
+
* Get a set of messages from the given topic.
|
|
42
|
+
* @param topicId
|
|
43
|
+
* @returns
|
|
44
|
+
*/
|
|
45
|
+
getReplies(parentMessageId: string, sort?: CommentsOrder, filter?: FilterMode, offset?: number, limit?: number): Promise<ChatMessage[]>;
|
|
46
|
+
refreshMessage(message: ChatMessage): Promise<ChatMessage>;
|
|
47
|
+
getMessage(topicId: string, messageId: string): Promise<ChatMessage>;
|
|
48
|
+
getSubMessage(topicId: string, parentMessageId: string, messageId: string): Promise<ChatMessage>;
|
|
49
|
+
watchMessage(message: ChatMessage, handler: (message: ChatMessage) => void): () => void;
|
|
50
|
+
notificationsChanged: Observable<Notification[]>;
|
|
51
|
+
newNotification: Observable<Notification>;
|
|
52
|
+
getCardForUrl(url: string): Promise<UrlCard>;
|
|
53
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ChatBackend, never>;
|
|
54
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ChatBackend>;
|
|
55
|
+
}
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import { Observable } from 'rxjs';
|
|
2
|
-
import { ChatMessage, CommentsOrder, ChatPermissions, FilterMode } from '@banta/common';
|
|
3
|
-
export interface ChatSourceBase {
|
|
4
|
-
/**
|
|
5
|
-
* The topic identifier for the current chat/comments
|
|
6
|
-
*/
|
|
7
|
-
identifier: string;
|
|
8
|
-
permissions: ChatPermissions;
|
|
9
|
-
ready: Promise<void>;
|
|
10
|
-
/**
|
|
11
|
-
* The ID of the parent message that this thread chat source is for.
|
|
12
|
-
* When this is not set, the chat source is a top-level ("topic") source.
|
|
13
|
-
* When it is set, this chat source is a thread source (ie replies).
|
|
14
|
-
*/
|
|
15
|
-
parentIdentifier?: string;
|
|
16
|
-
sortOrder?: CommentsOrder;
|
|
17
|
-
filterMode?: FilterMode;
|
|
18
|
-
messageReceived: Observable<ChatMessage>;
|
|
19
|
-
messageObserved: Observable<ChatMessage>;
|
|
20
|
-
messageUpdated: Observable<ChatMessage>;
|
|
21
|
-
messageSent: Observable<ChatMessage>;
|
|
22
|
-
messages: ChatMessage[];
|
|
23
|
-
send(message: ChatMessage): Promise<ChatMessage>;
|
|
24
|
-
close(): any;
|
|
25
|
-
getCount(): Promise<number>;
|
|
26
|
-
getExistingMessages(): Promise<ChatMessage[]>;
|
|
27
|
-
loadAfter(message: ChatMessage, count: number): Promise<ChatMessage[]>;
|
|
28
|
-
get(id: string): Promise<ChatMessage>;
|
|
29
|
-
likeMessage(messageId: string): Promise<void>;
|
|
30
|
-
unlikeMessage(messageId: string): Promise<void>;
|
|
31
|
-
editMessage(messageId: string, text: string): Promise<void>;
|
|
32
|
-
deleteMessage(messageId: string): Promise<void>;
|
|
33
|
-
connectionStateChanged?: Observable<'connected' | 'connecting' | 'lost' | 'restored'>;
|
|
34
|
-
state?: 'connecting' | 'connected' | 'lost' | 'restored';
|
|
35
|
-
/**
|
|
36
|
-
* When true, this source is readonly, so messages cannot be sent/edited/deleted, nor liked/unliked.
|
|
37
|
-
*/
|
|
38
|
-
readonly?: boolean;
|
|
39
|
-
/**
|
|
40
|
-
* When true/undefined, the source supports loading more messages. When false, it does not.
|
|
41
|
-
*/
|
|
42
|
-
canLoadMore?: boolean;
|
|
43
|
-
get errorState(): any;
|
|
44
|
-
}
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { ChatMessage, CommentsOrder, ChatPermissions, FilterMode } from '@banta/common';
|
|
3
|
+
export interface ChatSourceBase {
|
|
4
|
+
/**
|
|
5
|
+
* The topic identifier for the current chat/comments
|
|
6
|
+
*/
|
|
7
|
+
identifier: string;
|
|
8
|
+
permissions: ChatPermissions;
|
|
9
|
+
ready: Promise<void>;
|
|
10
|
+
/**
|
|
11
|
+
* The ID of the parent message that this thread chat source is for.
|
|
12
|
+
* When this is not set, the chat source is a top-level ("topic") source.
|
|
13
|
+
* When it is set, this chat source is a thread source (ie replies).
|
|
14
|
+
*/
|
|
15
|
+
parentIdentifier?: string;
|
|
16
|
+
sortOrder?: CommentsOrder;
|
|
17
|
+
filterMode?: FilterMode;
|
|
18
|
+
messageReceived: Observable<ChatMessage>;
|
|
19
|
+
messageObserved: Observable<ChatMessage>;
|
|
20
|
+
messageUpdated: Observable<ChatMessage>;
|
|
21
|
+
messageSent: Observable<ChatMessage>;
|
|
22
|
+
messages: ChatMessage[];
|
|
23
|
+
send(message: ChatMessage): Promise<ChatMessage>;
|
|
24
|
+
close(): any;
|
|
25
|
+
getCount(): Promise<number>;
|
|
26
|
+
getExistingMessages(): Promise<ChatMessage[]>;
|
|
27
|
+
loadAfter(message: ChatMessage, count: number): Promise<ChatMessage[]>;
|
|
28
|
+
get(id: string): Promise<ChatMessage>;
|
|
29
|
+
likeMessage(messageId: string): Promise<void>;
|
|
30
|
+
unlikeMessage(messageId: string): Promise<void>;
|
|
31
|
+
editMessage(messageId: string, text: string): Promise<void>;
|
|
32
|
+
deleteMessage(messageId: string): Promise<void>;
|
|
33
|
+
connectionStateChanged?: Observable<'connected' | 'connecting' | 'lost' | 'restored'>;
|
|
34
|
+
state?: 'connecting' | 'connected' | 'lost' | 'restored';
|
|
35
|
+
/**
|
|
36
|
+
* When true, this source is readonly, so messages cannot be sent/edited/deleted, nor liked/unliked.
|
|
37
|
+
*/
|
|
38
|
+
readonly?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* When true/undefined, the source supports loading more messages. When false, it does not.
|
|
41
|
+
*/
|
|
42
|
+
canLoadMore?: boolean;
|
|
43
|
+
get errorState(): any;
|
|
44
|
+
}
|
package/lib/chat-source.d.ts
CHANGED
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
import { ChatMessage, ChatPermissions, CommentsOrder, DurableSocket } from "@banta/common";
|
|
2
|
-
import { SocketRPC } from "@banta/common";
|
|
3
|
-
import { ChatSourceBase } from "./chat-source-base";
|
|
4
|
-
import { ChatBackend } from "./chat-backend";
|
|
5
|
-
import { ChatSourceOptions } from "./chat-backend-base";
|
|
6
|
-
export
|
|
7
|
-
export declare class ChatSource extends SocketRPC implements ChatSourceBase {
|
|
8
|
-
readonly backend: ChatBackend;
|
|
9
|
-
readonly identifier: string;
|
|
10
|
-
readonly parentIdentifier: string;
|
|
11
|
-
constructor(backend: ChatBackend, identifier: string, parentIdentifier: string, options: ChatSourceOptions);
|
|
12
|
-
private options;
|
|
13
|
-
private subscription;
|
|
14
|
-
private markReady;
|
|
15
|
-
readonly: boolean;
|
|
16
|
-
canLoadMore: boolean;
|
|
17
|
-
ready: Promise<void>;
|
|
18
|
-
permissions: ChatPermissions;
|
|
19
|
-
private _state;
|
|
20
|
-
get sortOrder(): CommentsOrder;
|
|
21
|
-
get filterMode(): import("@banta/common").FilterMode;
|
|
22
|
-
get state(): "
|
|
23
|
-
set state(value: "
|
|
24
|
-
private _connectionStateChanged;
|
|
25
|
-
private _connectionStateChanged$;
|
|
26
|
-
get connectionStateChanged(): import("rxjs").Observable<"
|
|
27
|
-
private wasRestored;
|
|
28
|
-
bind(socket: DurableSocket): Promise<this>;
|
|
29
|
-
private mapOrUpdateMessages;
|
|
30
|
-
private mapOrUpdateMessage;
|
|
31
|
-
getExistingMessages(): Promise<ChatMessage[]>;
|
|
32
|
-
private ensureConnection;
|
|
33
|
-
editMessage(messageId: string, text: string): Promise<void>;
|
|
34
|
-
private subscribeAttempt;
|
|
35
|
-
private _errorState;
|
|
36
|
-
get errorState(): string;
|
|
37
|
-
subscribeToTopic(): Promise<void>;
|
|
38
|
-
private _signInState;
|
|
39
|
-
private _signInStateChanged;
|
|
40
|
-
private _signInStateChanged$;
|
|
41
|
-
get signInState(): SignInState;
|
|
42
|
-
get signInStateChanged(): import("rxjs").Observable<SignInState>;
|
|
43
|
-
private setSignInState;
|
|
44
|
-
authenticate(): Promise<void>;
|
|
45
|
-
close(): void;
|
|
46
|
-
onPermissions(permissions: ChatPermissions): void;
|
|
47
|
-
onChatMessage(message: ChatMessage): ChatMessage;
|
|
48
|
-
private messageMap;
|
|
49
|
-
private _messageReceived;
|
|
50
|
-
private _messageUpdated;
|
|
51
|
-
private _messageSent;
|
|
52
|
-
private _messageObserved;
|
|
53
|
-
get messageReceived(): import("rxjs").Observable<ChatMessage>;
|
|
54
|
-
get messageUpdated(): import("rxjs").Observable<ChatMessage>;
|
|
55
|
-
get messageSent(): import("rxjs").Observable<ChatMessage>;
|
|
56
|
-
get messageObserved(): import("rxjs").Observable<ChatMessage>;
|
|
57
|
-
messages: ChatMessage[];
|
|
58
|
-
send(message: ChatMessage): Promise<ChatMessage>;
|
|
59
|
-
loadAfter(message: ChatMessage, count: number): Promise<ChatMessage[]>;
|
|
60
|
-
get(id: string): Promise<ChatMessage>;
|
|
61
|
-
getCount(): Promise<number>;
|
|
62
|
-
likeMessage(messageId: string): Promise<void>;
|
|
63
|
-
unlikeMessage(messageId: string): Promise<void>;
|
|
64
|
-
deleteMessage(messageId: string): Promise<void>;
|
|
65
|
-
}
|
|
1
|
+
import { ChatMessage, ChatPermissions, CommentsOrder, DurableSocket } from "@banta/common";
|
|
2
|
+
import { SocketRPC } from "@banta/common";
|
|
3
|
+
import { ChatSourceBase } from "./chat-source-base";
|
|
4
|
+
import { ChatBackend } from "./chat-backend";
|
|
5
|
+
import { ChatSourceOptions } from "./chat-backend-base";
|
|
6
|
+
export type SignInState = 'signed-out' | 'signed-in' | 'signing-in';
|
|
7
|
+
export declare class ChatSource extends SocketRPC implements ChatSourceBase {
|
|
8
|
+
readonly backend: ChatBackend;
|
|
9
|
+
readonly identifier: string;
|
|
10
|
+
readonly parentIdentifier: string;
|
|
11
|
+
constructor(backend: ChatBackend, identifier: string, parentIdentifier: string, options: ChatSourceOptions);
|
|
12
|
+
private options;
|
|
13
|
+
private subscription;
|
|
14
|
+
private markReady;
|
|
15
|
+
readonly: boolean;
|
|
16
|
+
canLoadMore: boolean;
|
|
17
|
+
ready: Promise<void>;
|
|
18
|
+
permissions: ChatPermissions;
|
|
19
|
+
private _state;
|
|
20
|
+
get sortOrder(): CommentsOrder;
|
|
21
|
+
get filterMode(): import("@banta/common").FilterMode;
|
|
22
|
+
get state(): "lost" | "connected" | "connecting" | "restored";
|
|
23
|
+
set state(value: "lost" | "connected" | "connecting" | "restored");
|
|
24
|
+
private _connectionStateChanged;
|
|
25
|
+
private _connectionStateChanged$;
|
|
26
|
+
get connectionStateChanged(): import("rxjs").Observable<"lost" | "connected" | "connecting" | "restored">;
|
|
27
|
+
private wasRestored;
|
|
28
|
+
bind(socket: DurableSocket): Promise<this>;
|
|
29
|
+
private mapOrUpdateMessages;
|
|
30
|
+
private mapOrUpdateMessage;
|
|
31
|
+
getExistingMessages(): Promise<ChatMessage[]>;
|
|
32
|
+
private ensureConnection;
|
|
33
|
+
editMessage(messageId: string, text: string): Promise<void>;
|
|
34
|
+
private subscribeAttempt;
|
|
35
|
+
private _errorState;
|
|
36
|
+
get errorState(): string;
|
|
37
|
+
subscribeToTopic(): Promise<void>;
|
|
38
|
+
private _signInState;
|
|
39
|
+
private _signInStateChanged;
|
|
40
|
+
private _signInStateChanged$;
|
|
41
|
+
get signInState(): SignInState;
|
|
42
|
+
get signInStateChanged(): import("rxjs").Observable<SignInState>;
|
|
43
|
+
private setSignInState;
|
|
44
|
+
authenticate(): Promise<void>;
|
|
45
|
+
close(): void;
|
|
46
|
+
onPermissions(permissions: ChatPermissions): void;
|
|
47
|
+
onChatMessage(message: ChatMessage): ChatMessage;
|
|
48
|
+
private messageMap;
|
|
49
|
+
private _messageReceived;
|
|
50
|
+
private _messageUpdated;
|
|
51
|
+
private _messageSent;
|
|
52
|
+
private _messageObserved;
|
|
53
|
+
get messageReceived(): import("rxjs").Observable<ChatMessage>;
|
|
54
|
+
get messageUpdated(): import("rxjs").Observable<ChatMessage>;
|
|
55
|
+
get messageSent(): import("rxjs").Observable<ChatMessage>;
|
|
56
|
+
get messageObserved(): import("rxjs").Observable<ChatMessage>;
|
|
57
|
+
messages: ChatMessage[];
|
|
58
|
+
send(message: ChatMessage): Promise<ChatMessage>;
|
|
59
|
+
loadAfter(message: ChatMessage, count: number): Promise<ChatMessage[]>;
|
|
60
|
+
get(id: string): Promise<ChatMessage>;
|
|
61
|
+
getCount(): Promise<number>;
|
|
62
|
+
likeMessage(messageId: string): Promise<void>;
|
|
63
|
+
unlikeMessage(messageId: string): Promise<void>;
|
|
64
|
+
deleteMessage(messageId: string): Promise<void>;
|
|
65
|
+
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { ElementRef } from '@angular/core';
|
|
2
|
-
import { CDNProvider, ChatMessageAttachment } from '@banta/common';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class AttachmentButtonComponent {
|
|
5
|
-
private cdnProvider;
|
|
6
|
-
constructor(cdnProvider: CDNProvider);
|
|
7
|
-
private _addedAttachment;
|
|
8
|
-
private _attachmentError;
|
|
9
|
-
disabled: boolean;
|
|
10
|
-
get addedAttachment(): import("rxjs").Observable<ChatMessageAttachment>;
|
|
11
|
-
get attachmentError(): import("rxjs").Observable<ChatMessageAttachment>;
|
|
12
|
-
fileInput: ElementRef<HTMLInputElement>;
|
|
13
|
-
show(): void;
|
|
14
|
-
fileChange(event: Event): Promise<void>;
|
|
15
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<AttachmentButtonComponent, never>;
|
|
16
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<AttachmentButtonComponent, "banta-attachment-button", never, { "disabled": "disabled"; }, { "addedAttachment": "addedAttachment"; "attachmentError": "attachmentError"; }, never, never, false>;
|
|
17
|
-
}
|
|
1
|
+
import { ElementRef } from '@angular/core';
|
|
2
|
+
import { CDNProvider, ChatMessageAttachment } from '@banta/common';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class AttachmentButtonComponent {
|
|
5
|
+
private cdnProvider;
|
|
6
|
+
constructor(cdnProvider: CDNProvider);
|
|
7
|
+
private _addedAttachment;
|
|
8
|
+
private _attachmentError;
|
|
9
|
+
disabled: boolean;
|
|
10
|
+
get addedAttachment(): import("rxjs").Observable<ChatMessageAttachment>;
|
|
11
|
+
get attachmentError(): import("rxjs").Observable<ChatMessageAttachment>;
|
|
12
|
+
fileInput: ElementRef<HTMLInputElement>;
|
|
13
|
+
show(): void;
|
|
14
|
+
fileChange(event: Event): Promise<void>;
|
|
15
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AttachmentButtonComponent, never>;
|
|
16
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AttachmentButtonComponent, "banta-attachment-button", never, { "disabled": { "alias": "disabled"; "required": false; }; }, { "addedAttachment": "addedAttachment"; "attachmentError": "attachmentError"; }, never, never, false, never>;
|
|
17
|
+
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { ElementRef } from "@angular/core";
|
|
2
|
-
import { ChatMessageAttachment } from "@banta/common";
|
|
3
|
-
import { Subject } from "rxjs";
|
|
4
|
-
import { ChatBackendBase } from "../chat-backend-base";
|
|
5
|
-
import * as i0 from "@angular/core";
|
|
6
|
-
export declare class AttachmentScraperDirective {
|
|
7
|
-
private elementRef;
|
|
8
|
-
private chatBackend;
|
|
9
|
-
constructor(elementRef: ElementRef<HTMLTextAreaElement>, chatBackend: ChatBackendBase);
|
|
10
|
-
attachments: ChatMessageAttachment[];
|
|
11
|
-
attachmentsChange: Subject<ChatMessageAttachment[]>;
|
|
12
|
-
ngOnInit(): void;
|
|
13
|
-
get element(): HTMLTextAreaElement;
|
|
14
|
-
get text(): string;
|
|
15
|
-
private scrapeTimeout;
|
|
16
|
-
private scrapeDebounce;
|
|
17
|
-
private fragments;
|
|
18
|
-
private scrape;
|
|
19
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<AttachmentScraperDirective, never>;
|
|
20
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<AttachmentScraperDirective, "[attachmentScraper]", never, { "attachments": "attachments"; }, { "attachmentsChange": "attachmentsChange"; }, never, never, false>;
|
|
21
|
-
}
|
|
1
|
+
import { ElementRef } from "@angular/core";
|
|
2
|
+
import { ChatMessageAttachment } from "@banta/common";
|
|
3
|
+
import { Subject } from "rxjs";
|
|
4
|
+
import { ChatBackendBase } from "../chat-backend-base";
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class AttachmentScraperDirective {
|
|
7
|
+
private elementRef;
|
|
8
|
+
private chatBackend;
|
|
9
|
+
constructor(elementRef: ElementRef<HTMLTextAreaElement>, chatBackend: ChatBackendBase);
|
|
10
|
+
attachments: ChatMessageAttachment[];
|
|
11
|
+
attachmentsChange: Subject<ChatMessageAttachment[]>;
|
|
12
|
+
ngOnInit(): void;
|
|
13
|
+
get element(): HTMLTextAreaElement;
|
|
14
|
+
get text(): string;
|
|
15
|
+
private scrapeTimeout;
|
|
16
|
+
private scrapeDebounce;
|
|
17
|
+
private fragments;
|
|
18
|
+
private scrape;
|
|
19
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AttachmentScraperDirective, never>;
|
|
20
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<AttachmentScraperDirective, "[attachmentScraper]", never, { "attachments": { "alias": "attachments"; "required": false; }; }, { "attachmentsChange": "attachmentsChange"; }, never, never, false, never>;
|
|
21
|
+
}
|