@banta/sdk 6.0.3 → 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.
Files changed (109) hide show
  1. package/fesm2022/banta-sdk.mjs +327 -6762
  2. package/fesm2022/banta-sdk.mjs.map +1 -1
  3. package/index.d.ts +1472 -3
  4. package/package.json +11 -13
  5. package/esm2022/banta-sdk.mjs +0 -5
  6. package/esm2022/lib/attachment-scraper.mjs +0 -2
  7. package/esm2022/lib/banta/banta.component.mjs +0 -207
  8. package/esm2022/lib/banta-logo.component.mjs +0 -11
  9. package/esm2022/lib/banta-sdk.module.mjs +0 -135
  10. package/esm2022/lib/chat/banta-chat/banta-chat.component.mjs +0 -209
  11. package/esm2022/lib/chat/chat-message/chat-message.component.mjs +0 -62
  12. package/esm2022/lib/chat/chat-view/chat-view.component.mjs +0 -166
  13. package/esm2022/lib/chat/chat.module.mjs +0 -51
  14. package/esm2022/lib/chat/index.mjs +0 -6
  15. package/esm2022/lib/chat/live-chat-message.component.mjs +0 -80
  16. package/esm2022/lib/chat-backend-base.mjs +0 -31
  17. package/esm2022/lib/chat-backend.mjs +0 -199
  18. package/esm2022/lib/chat-source-base.mjs +0 -2
  19. package/esm2022/lib/chat-source.mjs +0 -282
  20. package/esm2022/lib/comments/attachment-button/attachment-button.component.mjs +0 -75
  21. package/esm2022/lib/comments/attachment-scraper.directive.mjs +0 -101
  22. package/esm2022/lib/comments/banta-comments/banta-comments.component.mjs +0 -817
  23. package/esm2022/lib/comments/comment/comment.component.mjs +0 -224
  24. package/esm2022/lib/comments/comment-field/comment-field.component.mjs +0 -411
  25. package/esm2022/lib/comments/comment-sort/comment-sort.component.mjs +0 -37
  26. package/esm2022/lib/comments/comment-view/comment-view.component.mjs +0 -780
  27. package/esm2022/lib/comments/comments.module.mjs +0 -127
  28. package/esm2022/lib/comments/index.mjs +0 -12
  29. package/esm2022/lib/comments/inline-replies.directive.mjs +0 -13
  30. package/esm2022/lib/comments/live-comment.component.mjs +0 -80
  31. package/esm2022/lib/comments/reply-send-options.directive.mjs +0 -13
  32. package/esm2022/lib/common/attachment/attachment.component.mjs +0 -128
  33. package/esm2022/lib/common/attachments/attachments.component.mjs +0 -75
  34. package/esm2022/lib/common/common.module.mjs +0 -68
  35. package/esm2022/lib/common/index.mjs +0 -11
  36. package/esm2022/lib/common/lazy-connection.mjs +0 -15
  37. package/esm2022/lib/common/lightbox/lightbox.component.mjs +0 -31
  38. package/esm2022/lib/common/markdown-to-html.pipe.mjs +0 -83
  39. package/esm2022/lib/common/mention-linker.pipe.mjs +0 -35
  40. package/esm2022/lib/common/timer-pool.service.mjs +0 -85
  41. package/esm2022/lib/common/timestamp.component.mjs +0 -124
  42. package/esm2022/lib/common/trust-resource-url.pipe.mjs +0 -22
  43. package/esm2022/lib/emoji/emoji-selector-button.component.mjs +0 -115
  44. package/esm2022/lib/emoji/emoji-selector-panel/emoji-selector-panel.component.mjs +0 -93
  45. package/esm2022/lib/emoji/emoji.module.mjs +0 -55
  46. package/esm2022/lib/emoji/emojis.mjs +0 -6508
  47. package/esm2022/lib/emoji/index.mjs +0 -5
  48. package/esm2022/lib/giphy-attachments.mjs +0 -16
  49. package/esm2022/lib/index.mjs +0 -20
  50. package/esm2022/lib/live-message.component.mjs +0 -96
  51. package/esm2022/lib/message-menu-item.mjs +0 -2
  52. package/esm2022/lib/sdk-options.mjs +0 -3
  53. package/esm2022/lib/static-chat-source.mjs +0 -101
  54. package/esm2022/lib/tweet-attachments.mjs +0 -13
  55. package/esm2022/lib/url-attachments.mjs +0 -42
  56. package/esm2022/lib/youtube-attachments.mjs +0 -29
  57. package/esm2022/public-api.mjs +0 -5
  58. package/lib/attachment-scraper.d.ts +0 -15
  59. package/lib/banta/banta.component.d.ts +0 -59
  60. package/lib/banta-logo.component.d.ts +0 -5
  61. package/lib/banta-sdk.module.d.ts +0 -32
  62. package/lib/chat/banta-chat/banta-chat.component.d.ts +0 -79
  63. package/lib/chat/chat-message/chat-message.component.d.ts +0 -21
  64. package/lib/chat/chat-view/chat-view.component.d.ts +0 -52
  65. package/lib/chat/chat.module.d.ts +0 -15
  66. package/lib/chat/index.d.ts +0 -5
  67. package/lib/chat/live-chat-message.component.d.ts +0 -23
  68. package/lib/chat-backend-base.d.ts +0 -72
  69. package/lib/chat-backend.d.ts +0 -66
  70. package/lib/chat-source-base.d.ts +0 -51
  71. package/lib/chat-source.d.ts +0 -85
  72. package/lib/comments/attachment-button/attachment-button.component.d.ts +0 -17
  73. package/lib/comments/attachment-scraper.directive.d.ts +0 -21
  74. package/lib/comments/banta-comments/banta-comments.component.d.ts +0 -216
  75. package/lib/comments/comment/comment.component.d.ts +0 -90
  76. package/lib/comments/comment-field/comment-field.component.d.ts +0 -92
  77. package/lib/comments/comment-sort/comment-sort.component.d.ts +0 -16
  78. package/lib/comments/comment-view/comment-view.component.d.ts +0 -205
  79. package/lib/comments/comments.module.d.ts +0 -34
  80. package/lib/comments/index.d.ts +0 -11
  81. package/lib/comments/inline-replies.directive.d.ts +0 -5
  82. package/lib/comments/live-comment.component.d.ts +0 -23
  83. package/lib/comments/reply-send-options.directive.d.ts +0 -5
  84. package/lib/common/attachment/attachment.component.d.ts +0 -34
  85. package/lib/common/attachments/attachments.component.d.ts +0 -26
  86. package/lib/common/common.module.d.ts +0 -19
  87. package/lib/common/index.d.ts +0 -10
  88. package/lib/common/lazy-connection.d.ts +0 -6
  89. package/lib/common/lightbox/lightbox.component.d.ts +0 -14
  90. package/lib/common/markdown-to-html.pipe.d.ts +0 -13
  91. package/lib/common/mention-linker.pipe.d.ts +0 -13
  92. package/lib/common/timer-pool.service.d.ts +0 -15
  93. package/lib/common/timestamp.component.d.ts +0 -19
  94. package/lib/common/trust-resource-url.pipe.d.ts +0 -10
  95. package/lib/emoji/emoji-selector-button.component.d.ts +0 -30
  96. package/lib/emoji/emoji-selector-panel/emoji-selector-panel.component.d.ts +0 -23
  97. package/lib/emoji/emoji.module.d.ts +0 -16
  98. package/lib/emoji/emojis.d.ts +0 -6507
  99. package/lib/emoji/index.d.ts +0 -4
  100. package/lib/giphy-attachments.d.ts +0 -5
  101. package/lib/index.d.ts +0 -19
  102. package/lib/live-message.component.d.ts +0 -22
  103. package/lib/message-menu-item.d.ts +0 -6
  104. package/lib/sdk-options.d.ts +0 -8
  105. package/lib/static-chat-source.d.ts +0 -49
  106. package/lib/tweet-attachments.d.ts +0 -5
  107. package/lib/url-attachments.d.ts +0 -14
  108. package/lib/youtube-attachments.d.ts +0 -5
  109. package/public-api.d.ts +0 -1
@@ -1,52 +0,0 @@
1
- import { ElementRef } from "@angular/core";
2
- import { User, ChatMessage } from '@banta/common';
3
- import { ChatBackendBase } from "../../chat-backend-base";
4
- import { ChatSourceBase } from "../../chat-source-base";
5
- import * as i0 from "@angular/core";
6
- export declare class ChatViewComponent {
7
- private backend;
8
- private elementRef;
9
- constructor(backend: ChatBackendBase, elementRef: ElementRef<HTMLElement>);
10
- private _sourceSubs;
11
- private _source;
12
- get source(): ChatSourceBase;
13
- private _selected;
14
- private _selected$;
15
- private _reported;
16
- private _reported$;
17
- private _upvoted;
18
- private _upvoted$;
19
- private _userSelected;
20
- private _userSelected$;
21
- private _received;
22
- private _received$;
23
- get selected(): import("rxjs").Observable<ChatMessage>;
24
- get userSelected(): import("rxjs").Observable<ChatMessage>;
25
- get reported(): import("rxjs").Observable<ChatMessage>;
26
- get upvoted(): import("rxjs").Observable<ChatMessage>;
27
- get received(): import("rxjs").Observable<ChatMessage>;
28
- set source(value: ChatSourceBase);
29
- private getInitialMessages;
30
- private sortMessages;
31
- messages: ChatMessage[];
32
- currentUser: User;
33
- messageContainer: ElementRef<HTMLElement>;
34
- maxMessages: number;
35
- emptyLabel: string;
36
- private addMessage;
37
- private messageReceived;
38
- isScrolledToLatest(): boolean;
39
- private messageSent;
40
- scrollToLatest(): void;
41
- jumpTo(message: ChatMessage): void;
42
- flashMessage(message: ChatMessage): void;
43
- flashedMessageId: string;
44
- mentionsMe(message: ChatMessage): boolean;
45
- upvoteMessage(message: ChatMessage): void;
46
- reportMessage(message: ChatMessage): void;
47
- selectMessage(message: ChatMessage): void;
48
- selectMessageUser(message: ChatMessage): void;
49
- avatarForUser(user: User): string;
50
- static ɵfac: i0.ɵɵFactoryDeclaration<ChatViewComponent, never>;
51
- 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>;
52
- }
@@ -1,15 +0,0 @@
1
- import * as i0 from "@angular/core";
2
- import * as i1 from "./chat-message/chat-message.component";
3
- import * as i2 from "./live-chat-message.component";
4
- import * as i3 from "./chat-view/chat-view.component";
5
- import * as i4 from "./banta-chat/banta-chat.component";
6
- import * as i5 from "@angular/common";
7
- import * as i6 from "@angular/forms";
8
- import * as i7 from "@angular/material/icon";
9
- import * as i8 from "@angular/material/button";
10
- import * as i9 from "../emoji/emoji.module";
11
- export declare class ChatModule {
12
- static ɵfac: i0.ɵɵFactoryDeclaration<ChatModule, never>;
13
- static ɵmod: i0.ɵɵNgModuleDeclaration<ChatModule, [typeof i1.ChatMessageComponent, typeof i2.LiveChatMessageComponent, typeof i3.ChatViewComponent, typeof i4.BantaChatComponent], [typeof i5.CommonModule, typeof i6.FormsModule, typeof i7.MatIconModule, typeof i8.MatButtonModule, typeof i9.EmojiModule], [typeof i1.ChatMessageComponent, typeof i2.LiveChatMessageComponent, typeof i3.ChatViewComponent, typeof i4.BantaChatComponent]>;
14
- static ɵinj: i0.ɵɵInjectorDeclaration<ChatModule>;
15
- }
@@ -1,5 +0,0 @@
1
- export * from './chat-message/chat-message.component';
2
- export * from './live-chat-message.component';
3
- export * from './chat-view/chat-view.component';
4
- export * from './banta-chat/banta-chat.component';
5
- export * from './chat.module';
@@ -1,23 +0,0 @@
1
- import { ChatMessage } from '@banta/common';
2
- import { Observable } from 'rxjs';
3
- import { ChatBackendBase } from '../chat-backend-base';
4
- import * as i0 from "@angular/core";
5
- export declare class LiveChatMessageComponent {
6
- private backend;
7
- constructor(backend: ChatBackendBase);
8
- private _message;
9
- private _upvoted;
10
- private _reported;
11
- private _selected;
12
- get upvoted(): Observable<void>;
13
- get reported(): Observable<void>;
14
- get selected(): Observable<void>;
15
- get message(): ChatMessage;
16
- private unsubscribe;
17
- set message(value: ChatMessage);
18
- report(): void;
19
- upvote(): void;
20
- select(): void;
21
- static ɵfac: i0.ɵɵFactoryDeclaration<LiveChatMessageComponent, never>;
22
- 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>;
23
- }
@@ -1,72 +0,0 @@
1
- import { Observable } from 'rxjs';
2
- import { ChatMessage, CommentsOrder, Notification, User, UrlCard, FilterMode, Topic } 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
- metadata?: Record<string, any>;
13
- }
14
- export declare abstract class ChatBackendBase {
15
- constructor();
16
- abstract getSourceForTopic(topicId: string, options?: ChatSourceOptions): Promise<ChatSourceBase>;
17
- abstract getSourceForThread(topicId: string, messageId: string, options?: ChatSourceOptions): Promise<ChatSourceBase>;
18
- /**
19
- * Get the count of the given topic
20
- * @param topicId
21
- * @returns
22
- */
23
- abstract getSourceCountForTopic(topicId: string): Promise<number>;
24
- /**
25
- * Get the count of the given topics.
26
- * @param topicId Topics to count messages on. Maximum of 1000.
27
- * @returns
28
- */
29
- abstract getSourceCountForTopics(topicIds: string[]): Promise<Record<string, number>>;
30
- /**
31
- * Get information about the given topic.
32
- * @param topicId
33
- * @returns The topic object, or undefined if no such topic was found.
34
- */
35
- abstract getTopic(topicId: string): Promise<Topic | undefined>;
36
- /**
37
- * Get information about the given topics
38
- * @param topicIds The topic IDs to look up. Maximum of 1000.
39
- * @returns An array of matching topic objects.
40
- */
41
- abstract getTopicsById(topicIds: string[]): Promise<Topic[]>;
42
- /**
43
- * Get a set of messages from the given topic.
44
- * @param topicId
45
- * @returns
46
- */
47
- abstract getMessages(topicId: string, sort?: CommentsOrder, filter?: FilterMode, offset?: number, limit?: number, pinned?: boolean): Promise<ChatMessage[]>;
48
- /**
49
- * Get a set of messages from the given topic.
50
- * @param topicId
51
- * @returns
52
- */
53
- abstract getReplies(parentMessageId: string, sort?: CommentsOrder, filter?: FilterMode, offset?: number, limit?: number): Promise<ChatMessage[]>;
54
- abstract refreshMessage(message: ChatMessage): Promise<ChatMessage>;
55
- abstract getMessage(topicId: string, messageId: string): Promise<ChatMessage>;
56
- abstract getSubMessage(topicId: string, parentMessageId: string, messageId: string): Promise<ChatMessage>;
57
- abstract watchMessage(message: ChatMessage, handler: (message: ChatMessage) => void): () => void;
58
- abstract getCardForUrl(url: string): Promise<UrlCard>;
59
- readonly notificationsChanged: Observable<Notification[]>;
60
- readonly newNotification: Observable<Notification>;
61
- private _userChanged;
62
- private _user;
63
- get userChanged(): Observable<User>;
64
- set user(user: User);
65
- get user(): User;
66
- private _attachmentScrapers;
67
- private _attachmentResolvers;
68
- registerAttachmentScraper(scraper: AttachmentScraper): void;
69
- registerAttachmentResolver(resolver: AttachmentResolver): void;
70
- get attachmentScrapers(): AttachmentScraper[];
71
- get attachmentResolvers(): AttachmentResolver[];
72
- }
@@ -1,66 +0,0 @@
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 * as i0 from "@angular/core";
6
- export declare class ChatBackend extends ChatBackendBase {
7
- private options;
8
- private platformId;
9
- runId: string;
10
- get serviceUrl(): string;
11
- private connectToService;
12
- private isServer;
13
- /**
14
- * Check if we are currently running inside a Googlebot user agent or via the Google inspection tool in Search Console.
15
- * We'll use this to avoid WebSockets so that comments can be indexable.
16
- * @returns
17
- */
18
- private isGooglebot;
19
- getSourceForTopic(topicId: string, options?: ChatSourceOptions): Promise<ChatSourceBase>;
20
- getSourceForThread(topicId: string, messageId: string, options?: ChatSourceOptions): Promise<ChatSourceBase>;
21
- /**
22
- * Get the count of the given topic
23
- * @param topicId
24
- * @returns
25
- */
26
- getSourceCountForTopic(topicId: string): Promise<number>;
27
- /**
28
- * Get the count of the given topics.
29
- * @param topicId Topics to count messages on. Maximum of 1000.
30
- * @returns
31
- */
32
- getSourceCountForTopics(topicIds: string[]): Promise<Record<string, number>>;
33
- /**
34
- * Get information about the given topic.
35
- * @param topicId
36
- * @returns The topic object, or undefined if no such topic was found.
37
- */
38
- getTopic(topicId: string): Promise<Topic | undefined>;
39
- /**
40
- * Get information about the given topics
41
- * @param topicIds The topic IDs to look up. Maximum of 1000.
42
- * @returns An array of matching topic objects.
43
- */
44
- getTopicsById(topicIds: string[]): Promise<Topic[]>;
45
- /**
46
- * Get a set of messages from the given topic.
47
- * @param topicId
48
- * @returns
49
- */
50
- getMessages(topicId: string, sort?: CommentsOrder, filter?: FilterMode, offset?: number, limit?: number, pinned?: boolean): Promise<ChatMessage[]>;
51
- /**
52
- * Get a set of messages from the given topic.
53
- * @param topicId
54
- * @returns
55
- */
56
- getReplies(parentMessageId: string, sort?: CommentsOrder, filter?: FilterMode, offset?: number, limit?: number, pinned?: boolean): Promise<ChatMessage[]>;
57
- refreshMessage(message: ChatMessage): Promise<ChatMessage>;
58
- getMessage(topicId: string, messageId: string): Promise<ChatMessage>;
59
- getSubMessage(topicId: string, parentMessageId: string, messageId: string): Promise<ChatMessage>;
60
- watchMessage(message: ChatMessage, handler: (message: ChatMessage) => void): () => void;
61
- notificationsChanged: Observable<Notification[]>;
62
- newNotification: Observable<Notification>;
63
- getCardForUrl(url: string): Promise<UrlCard>;
64
- static ɵfac: i0.ɵɵFactoryDeclaration<ChatBackend, never>;
65
- static ɵprov: i0.ɵɵInjectableDeclaration<ChatBackend>;
66
- }
@@ -1,51 +0,0 @@
1
- import { Observable } from 'rxjs';
2
- import { ChatMessage, CommentsOrder, ChatPermissions, FilterMode, ServerInfo } 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
- loadSince(id: string): Promise<ChatMessage[]>;
27
- getExistingMessages(): Promise<ChatMessage[]>;
28
- getPinnedMessages(): Promise<ChatMessage[]>;
29
- loadAfter(message: ChatMessage, count: number): Promise<ChatMessage[]>;
30
- get(id: string): Promise<ChatMessage>;
31
- getServerInfo(): Promise<ServerInfo>;
32
- likeMessage(messageId: string): Promise<void>;
33
- unlikeMessage(messageId: string): Promise<void>;
34
- pinMessage(messageId: string, options?: {
35
- until?: number;
36
- }): Promise<void>;
37
- unpinMessage(messageId: string): Promise<void>;
38
- editMessage(messageId: string, text: string): Promise<void>;
39
- deleteMessage(messageId: string): Promise<void>;
40
- connectionStateChanged?: Observable<'connected' | 'connecting' | 'lost' | 'restored'>;
41
- state?: 'connecting' | 'connected' | 'lost' | 'restored';
42
- /**
43
- * When true, this source is readonly, so messages cannot be sent/edited/deleted, nor liked/unliked.
44
- */
45
- readonly?: boolean;
46
- /**
47
- * When true/undefined, the source supports loading more messages. When false, it does not.
48
- */
49
- canLoadMore?: boolean;
50
- get errorState(): any;
51
- }
@@ -1,85 +0,0 @@
1
- import { ChatMessage, ChatPermissions, DurableSocket, ServerInfo } 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 interface PinOptions {
8
- until?: number;
9
- }
10
- export declare class ChatSource extends SocketRPC implements ChatSourceBase {
11
- readonly backend: ChatBackend;
12
- readonly identifier: string;
13
- readonly parentIdentifier: string;
14
- constructor(backend: ChatBackend, identifier: string, parentIdentifier: string, options: ChatSourceOptions);
15
- private options;
16
- private subscription;
17
- private markReady;
18
- readonly: boolean;
19
- canLoadMore: boolean;
20
- ready: Promise<void>;
21
- permissions: ChatPermissions;
22
- private _state;
23
- get sortOrder(): "newest" | "oldest" | "likes";
24
- get filterMode(): string;
25
- get state(): "connected" | "connecting" | "lost" | "restored";
26
- set state(value: "connected" | "connecting" | "lost" | "restored");
27
- private _connectionStateChanged;
28
- private _connectionStateChanged$;
29
- get connectionStateChanged(): import("rxjs").Observable<"connected" | "connecting" | "lost" | "restored">;
30
- private wasRestored;
31
- bind(socket: DurableSocket): Promise<this>;
32
- private mapOrUpdateMessages;
33
- private mapOrUpdateMessage;
34
- /**
35
- * Ask server for messages that have occurred since the message with the given ID.
36
- * This is used during brief reconnects to avoid dropping messages, while also not
37
- * causing mobbing as everyone reconnects after an issue. The backend can choose to
38
- * not service this request, instead returning undefined. In that case, the client
39
- * is expected to fetch the existing messages and start state anew.
40
- *
41
- * TODO: this is not yet used
42
- *
43
- * @param id
44
- * @returns
45
- */
46
- loadSince(id: string): Promise<ChatMessage[]>;
47
- getExistingMessages(): Promise<ChatMessage[]>;
48
- getPinnedMessages(): Promise<ChatMessage[]>;
49
- private ensureConnection;
50
- editMessage(messageId: string, text: string): Promise<void>;
51
- private subscribeAttempt;
52
- private _errorState;
53
- get errorState(): string;
54
- subscribeToTopic(): Promise<void>;
55
- private _signInState;
56
- private _signInStateChanged;
57
- private _signInStateChanged$;
58
- get signInState(): SignInState;
59
- get signInStateChanged(): import("rxjs").Observable<SignInState>;
60
- private setSignInState;
61
- authenticate(): Promise<void>;
62
- close(): void;
63
- onPermissions(permissions: ChatPermissions): void;
64
- onChatMessage(message: ChatMessage): void;
65
- private messageMap;
66
- private _messageReceived;
67
- private _messageUpdated;
68
- private _messageSent;
69
- private _messageObserved;
70
- get messageReceived(): import("rxjs").Observable<ChatMessage>;
71
- get messageUpdated(): import("rxjs").Observable<ChatMessage>;
72
- get messageSent(): import("rxjs").Observable<ChatMessage>;
73
- get messageObserved(): import("rxjs").Observable<ChatMessage>;
74
- messages: ChatMessage[];
75
- getServerInfo(): Promise<ServerInfo>;
76
- send(message: ChatMessage): Promise<ChatMessage>;
77
- loadAfter(message: ChatMessage, count: number): Promise<ChatMessage[]>;
78
- get(id: string): Promise<ChatMessage>;
79
- getCount(): Promise<number>;
80
- likeMessage(messageId: string): Promise<void>;
81
- pinMessage(messageId: string, options?: PinOptions): Promise<void>;
82
- unpinMessage(messageId: string): Promise<void>;
83
- unlikeMessage(messageId: string): Promise<void>;
84
- deleteMessage(messageId: string): Promise<void>;
85
- }
@@ -1,17 +0,0 @@
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 +0,0 @@
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
- }
@@ -1,216 +0,0 @@
1
- import { ElementRef, NgZone, QueryList } from '@angular/core';
2
- import { User, ChatMessage, ServerInfo } from '@banta/common';
3
- import { HashTag } from '../comment-field/comment-field.component';
4
- import { Observable } from 'rxjs';
5
- import { ActivatedRoute } from '@angular/router';
6
- import { ChatBackendBase } from '../../chat-backend-base';
7
- import { ChatSourceBase } from '../../chat-source-base';
8
- import { MatSnackBar } from '@angular/material/snack-bar';
9
- import { MessageMenuItem } from '../../message-menu-item';
10
- import { CommentViewComponent } from '../comment-view/comment-view.component';
11
- import { CommentComponent } from '../comment/comment.component';
12
- import { PinOptions } from '../../chat-source';
13
- import * as i0 from "@angular/core";
14
- /**
15
- * Comments component
16
- */
17
- export declare class BantaCommentsComponent {
18
- private backend;
19
- private elementRef;
20
- private activatedRoute;
21
- private matSnackBar;
22
- private ngZone;
23
- constructor(backend: ChatBackendBase, elementRef: ElementRef<HTMLElement>, activatedRoute: ActivatedRoute, matSnackBar: MatSnackBar, ngZone: NgZone);
24
- get element(): HTMLElement;
25
- private handleBackendExceptionAsAlert;
26
- private handleBackendExceptionAsSnack;
27
- private handleBackendException;
28
- ngOnInit(): void;
29
- private resizeObserver;
30
- private width;
31
- private height;
32
- isMobileSized: boolean;
33
- sendReplyOptionsTemplate: any;
34
- markViewReady: () => void;
35
- viewReady: Promise<void>;
36
- ngAfterViewInit(): void;
37
- ngOnDestroy(): void;
38
- private setSourceFromTopicID;
39
- loadingTitle: string;
40
- private _loadingMessage;
41
- loadingMessageVisible: boolean;
42
- get loadingMessage(): string;
43
- set loadingMessage(value: string);
44
- loading: boolean;
45
- showLoadingScreen: boolean;
46
- loadingStartedAt: number;
47
- messageChangedAt: number;
48
- sharedCommentID: string;
49
- lastSharedCommentID: string;
50
- customMenuItems: MessageMenuItem[];
51
- private startLoading;
52
- private _loadingTimer;
53
- private _loadingMessageIndex;
54
- /**
55
- * The canonical URL where this comment section can be found. If not specified, uses the current URL.
56
- */
57
- url: string;
58
- maxCommentLength: number;
59
- loadingMessages: string[];
60
- useInlineReplies: boolean;
61
- /**
62
- * Access the CommentViewComponent for this BantaCommentsComponent.
63
- * CommentViewComponent is responsible for interacting with the ChatSource
64
- * object and rendering comments as CommentComponents. It is the source of
65
- * truth for which CommentComponent corresponds to which ChatMessage.
66
- *
67
- * Note that this CommentViewComponent is only for the top level comments.
68
- * Replies are handled by a separate CommentViewComponent which can be
69
- * retrieved using the threadView property.
70
- */
71
- commentView: CommentViewComponent;
72
- threadViewQuery: QueryList<CommentViewComponent>;
73
- /**
74
- * Attempts to find the CommentComponent that corresponds to the given ChatMessage.
75
- * The ChatMessage could be a top-level message in this conversation, or a reply,
76
- * but note that a CommentComponent will only exist for a reply if the user has
77
- * the relevant reply thread open.
78
- * @param message The message to look for
79
- */
80
- getCommentComponentForMessage(message: ChatMessage): CommentComponent;
81
- /**
82
- * Access the CommentViewComponent corresponding to the currently open reply thread.
83
- * This is not the top level comments, but instead the reply thread that the user has
84
- * opened (only one set of replies can be open at a time).
85
- *
86
- * For details about what CommentViewComponent affords you, see the commentView property.
87
- */
88
- get threadView(): CommentViewComponent;
89
- waitForThreadView(): Promise<CommentViewComponent>;
90
- markLoaded: () => void;
91
- loaded: Promise<void>;
92
- get sourceState(): "connected" | "connecting" | "lost" | "restored" | "no-source";
93
- private updateLoading;
94
- private _signInSelected;
95
- private _permissionDeniedError;
96
- private _editAvatarSelected;
97
- private _upvoted;
98
- private _reported;
99
- private _selected;
100
- private _userSelected;
101
- private _shared;
102
- private _usernameSelected;
103
- private _avatarSelected;
104
- private _reconnectRequested;
105
- private _source;
106
- /**
107
- * Track whether we created this source. If we did not (ie it was passed in from the caller),
108
- * then we are not responsible for calling close(). If we do own it though, we will call close()
109
- * when we are done with it.
110
- */
111
- private _sourceIsOwned;
112
- private _subs;
113
- private _topicID;
114
- user: User;
115
- selectedMessage: ChatMessage;
116
- selectedMessageThread: ChatSourceBase;
117
- selectedMessageVisible: boolean;
118
- connectionState: string;
119
- signInLabel: string;
120
- sendLabel: string;
121
- signingInLabel: string;
122
- replyLabel: string;
123
- sendingLabel: string;
124
- permissionDeniedLabel: string;
125
- postCommentLabel: string;
126
- postReplyLabel: string;
127
- allowAttachments: boolean;
128
- allowServerInfoRequest: boolean;
129
- fixedHeight: boolean;
130
- maxMessages: number;
131
- maxVisibleMessages: number;
132
- genericAvatarUrl: string;
133
- shouldInterceptMessageSend?: (message: ChatMessage, source: ChatSourceBase) => boolean | Promise<boolean>;
134
- participants: User[];
135
- private _sourceSubscription;
136
- reconnect(): void;
137
- get source(): ChatSourceBase;
138
- set source(value: ChatSourceBase);
139
- hashtags: HashTag[];
140
- get topicID(): string;
141
- set topicID(value: string);
142
- readonly signInSelected: Observable<void>;
143
- readonly editAvatarSelected: Observable<void>;
144
- readonly permissionDeniedError: Observable<string>;
145
- readonly upvoted: Observable<ChatMessage>;
146
- readonly reported: Observable<ChatMessage>;
147
- readonly selected: Observable<ChatMessage>;
148
- readonly userSelected: Observable<ChatMessage>;
149
- readonly usernameSelected: Observable<User>;
150
- readonly avatarSelected: Observable<User>;
151
- readonly shared: Observable<ChatMessage>;
152
- readonly reconnectRequested: Observable<void>;
153
- private _reloadSourceTimeout;
154
- private reloadSource;
155
- private _sortOrder;
156
- get sortOrder(): "newest" | "oldest" | "likes";
157
- set sortOrder(value: "newest" | "oldest" | "likes");
158
- private _filterMode;
159
- get filterMode(): string;
160
- set filterMode(value: string);
161
- initialMessageCount: number;
162
- private _metadata;
163
- /**
164
- * Arbitrary metadata to send to the chat server. This can be used to provide context about the client to the server
165
- * for things like validating authorization and other uses.
166
- */
167
- get metadata(): Record<string, any>;
168
- set metadata(value: Record<string, any>);
169
- get filterModes(): string[];
170
- get filterModeLabels(): {
171
- all: string;
172
- mine: string;
173
- threads: string;
174
- "my-likes": string;
175
- };
176
- get sortOrders(): readonly ["newest", "oldest", "likes"];
177
- get sortOrderLabels(): {
178
- newest: string;
179
- oldest: string;
180
- likes: string;
181
- };
182
- sendMessage: (message: ChatMessage) => void;
183
- sendReply: (message: ChatMessage) => void;
184
- scrollToComment(commentId: ChatMessage['id']): Promise<void>;
185
- serverInfoVisible: boolean;
186
- serverInfoLoading: boolean;
187
- serverInfo: ServerInfo;
188
- showServerInfo(): Promise<void>;
189
- loadingSharedComment: boolean;
190
- sharedCommentMissing: boolean;
191
- navigateToSharedComment(id: string): Promise<void>;
192
- handlePermissionDenied(errorMessage: string): void;
193
- sendPermissionDenied(message: string): void;
194
- scrollToMessage(message: ChatMessage): void;
195
- private addParticipant;
196
- likeMessage(source: ChatSourceBase, message: ChatMessage): Promise<void>;
197
- pinMessage(source: ChatSourceBase, message: ChatMessage, options: PinOptions): Promise<void>;
198
- unpinMessage(source: ChatSourceBase, message: ChatMessage): Promise<void>;
199
- unlikeMessage(source: ChatSourceBase, message: ChatMessage): Promise<void>;
200
- reportMessage(message: ChatMessage): Promise<void>;
201
- unselectMessage(): Promise<void>;
202
- toggleSelectedMessage(message: ChatMessage): Promise<void>;
203
- selectMessage(message: ChatMessage): Promise<ChatSourceBase>;
204
- showSignIn(): Promise<void>;
205
- showEditAvatar(): Promise<void>;
206
- selectMessageUser(message: ChatMessage): Promise<void>;
207
- selectUsername(user: User): Promise<void>;
208
- selectAvatar(user: User): Promise<void>;
209
- shareMessage(message: ChatMessage): Promise<void>;
210
- deleteMessage(message: ChatMessage): Promise<void>;
211
- editMessage(source: ChatSourceBase, message: ChatMessage, newText: string): Promise<void>;
212
- startEditing(message: ChatMessage): Promise<void>;
213
- saveEdit(message: ChatMessage, text: string): Promise<void>;
214
- static ɵfac: i0.ɵɵFactoryDeclaration<BantaCommentsComponent, never>;
215
- 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>;
216
- }