@banta/sdk 4.7.14 → 4.7.15
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/lib/banta/banta.component.mjs +1 -1
- package/esm2020/lib/chat-source.mjs +50 -26
- package/esm2020/lib/comments/banta-comments/banta-comments.component.mjs +29 -9
- package/esm2020/lib/comments/comment-field/comment-field.component.mjs +38 -4
- package/fesm2015/banta-sdk.mjs +116 -37
- package/fesm2015/banta-sdk.mjs.map +1 -1
- package/fesm2020/banta-sdk.mjs +114 -36
- package/fesm2020/banta-sdk.mjs.map +1 -1
- package/lib/chat-source.d.ts +13 -6
- package/lib/comments/banta-comments/banta-comments.component.d.ts +5 -1
- package/lib/comments/comment-field/comment-field.component.d.ts +6 -1
- package/package.json +2 -2
package/lib/chat-source.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ChatMessage, ChatPermissions, CommentsOrder, DurableSocket } from "@banta/common";
|
|
2
|
-
import { Observable } from "rxjs";
|
|
3
2
|
import { SocketRPC } from "@banta/common";
|
|
4
3
|
import { ChatSourceBase } from "./chat-source-base";
|
|
5
4
|
import { ChatBackend } from "./chat-backend";
|
|
5
|
+
export declare type SignInState = 'signed-out' | 'signed-in' | 'signing-in';
|
|
6
6
|
export declare class ChatSource extends SocketRPC implements ChatSourceBase {
|
|
7
7
|
readonly backend: ChatBackend;
|
|
8
8
|
readonly identifier: string;
|
|
@@ -17,7 +17,8 @@ export declare class ChatSource extends SocketRPC implements ChatSourceBase {
|
|
|
17
17
|
get state(): "connected" | "connecting" | "lost" | "restored";
|
|
18
18
|
set state(value: "connected" | "connecting" | "lost" | "restored");
|
|
19
19
|
private _connectionStateChanged;
|
|
20
|
-
|
|
20
|
+
private _connectionStateChanged$;
|
|
21
|
+
get connectionStateChanged(): import("rxjs").Observable<"connected" | "connecting" | "lost" | "restored">;
|
|
21
22
|
private wasRestored;
|
|
22
23
|
bind(socket: DurableSocket): Promise<this>;
|
|
23
24
|
private mapOrUpdateMessages;
|
|
@@ -29,6 +30,12 @@ export declare class ChatSource extends SocketRPC implements ChatSourceBase {
|
|
|
29
30
|
private _errorState;
|
|
30
31
|
get errorState(): string;
|
|
31
32
|
subscribeToTopic(): Promise<void>;
|
|
33
|
+
private _signInState;
|
|
34
|
+
private _signInStateChanged;
|
|
35
|
+
private _signInStateChanged$;
|
|
36
|
+
get signInState(): SignInState;
|
|
37
|
+
get signInStateChanged(): import("rxjs").Observable<SignInState>;
|
|
38
|
+
private setSignInState;
|
|
32
39
|
authenticate(): Promise<void>;
|
|
33
40
|
close(): void;
|
|
34
41
|
onPermissions(permissions: ChatPermissions): void;
|
|
@@ -38,10 +45,10 @@ export declare class ChatSource extends SocketRPC implements ChatSourceBase {
|
|
|
38
45
|
private _messageUpdated;
|
|
39
46
|
private _messageSent;
|
|
40
47
|
private _messageObserved;
|
|
41
|
-
get messageReceived(): Observable<ChatMessage>;
|
|
42
|
-
get messageUpdated(): Observable<ChatMessage>;
|
|
43
|
-
get messageSent(): Observable<ChatMessage>;
|
|
44
|
-
get messageObserved(): Observable<ChatMessage>;
|
|
48
|
+
get messageReceived(): import("rxjs").Observable<ChatMessage>;
|
|
49
|
+
get messageUpdated(): import("rxjs").Observable<ChatMessage>;
|
|
50
|
+
get messageSent(): import("rxjs").Observable<ChatMessage>;
|
|
51
|
+
get messageObserved(): import("rxjs").Observable<ChatMessage>;
|
|
45
52
|
messages: ChatMessage[];
|
|
46
53
|
send(message: ChatMessage): Promise<ChatMessage>;
|
|
47
54
|
loadAfter(message: ChatMessage, count: number): Promise<ChatMessage[]>;
|
|
@@ -22,6 +22,7 @@ export declare class BantaCommentsComponent {
|
|
|
22
22
|
constructor(backend: ChatBackendBase, elementRef: ElementRef<HTMLElement>, activatedRoute: ActivatedRoute, matSnackBar: MatSnackBar, ngZone: NgZone);
|
|
23
23
|
get element(): HTMLElement;
|
|
24
24
|
private handleBackendExceptionAsAlert;
|
|
25
|
+
private handleBackendExceptionAsSnack;
|
|
25
26
|
private handleBackendException;
|
|
26
27
|
ngOnInit(): void;
|
|
27
28
|
private resizeObserver;
|
|
@@ -34,6 +35,7 @@ export declare class BantaCommentsComponent {
|
|
|
34
35
|
ngAfterViewInit(): void;
|
|
35
36
|
ngOnDestroy(): void;
|
|
36
37
|
private setSourceFromTopicID;
|
|
38
|
+
loadingTitle: string;
|
|
37
39
|
private _loadingMessage;
|
|
38
40
|
loadingMessageVisible: boolean;
|
|
39
41
|
get loadingMessage(): string;
|
|
@@ -107,8 +109,10 @@ export declare class BantaCommentsComponent {
|
|
|
107
109
|
selectedMessage: ChatMessage;
|
|
108
110
|
selectedMessageThread: ChatSourceBase;
|
|
109
111
|
selectedMessageVisible: boolean;
|
|
112
|
+
connectionState: string;
|
|
110
113
|
signInLabel: string;
|
|
111
114
|
sendLabel: string;
|
|
115
|
+
signingInLabel: string;
|
|
112
116
|
replyLabel: string;
|
|
113
117
|
sendingLabel: string;
|
|
114
118
|
permissionDeniedLabel: string;
|
|
@@ -166,5 +170,5 @@ export declare class BantaCommentsComponent {
|
|
|
166
170
|
startEditing(message: ChatMessage): Promise<void>;
|
|
167
171
|
saveEdit(message: ChatMessage, text: string): Promise<void>;
|
|
168
172
|
static ɵfac: i0.ɵɵFactoryDeclaration<BantaCommentsComponent, never>;
|
|
169
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<BantaCommentsComponent, "banta-comments", never, { "customMenuItems": "customMenuItems"; "maxCommentLength": "maxCommentLength"; "loadingMessages": "loadingMessages"; "useInlineReplies": "useInlineReplies"; "signInLabel": "signInLabel"; "sendLabel": "sendLabel"; "replyLabel": "replyLabel"; "sendingLabel": "sendingLabel"; "permissionDeniedLabel": "permissionDeniedLabel"; "postCommentLabel": "postCommentLabel"; "postReplyLabel": "postReplyLabel"; "allowAttachments": "allowAttachments"; "fixedHeight": "fixedHeight"; "maxMessages": "maxMessages"; "maxVisibleMessages": "maxVisibleMessages"; "genericAvatarUrl": "genericAvatarUrl"; "shouldInterceptMessageSend": "shouldInterceptMessageSend"; "participants": "participants"; "source": "source"; "hashtags": "hashtags"; "topicID": "topicID"; }, { "signInSelected": "signInSelected"; "editAvatarSelected": "editAvatarSelected"; "permissionDeniedError": "permissionDeniedError"; "upvoted": "upvoted"; "reported": "reported"; "selected": "selected"; "userSelected": "userSelected"; "usernameSelected": "usernameSelected"; "avatarSelected": "avatarSelected"; "shared": "shared"; }, ["sendReplyOptionsTemplate"], never, false>;
|
|
173
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<BantaCommentsComponent, "banta-comments", never, { "customMenuItems": "customMenuItems"; "maxCommentLength": "maxCommentLength"; "loadingMessages": "loadingMessages"; "useInlineReplies": "useInlineReplies"; "signInLabel": "signInLabel"; "sendLabel": "sendLabel"; "signingInLabel": "signingInLabel"; "replyLabel": "replyLabel"; "sendingLabel": "sendingLabel"; "permissionDeniedLabel": "permissionDeniedLabel"; "postCommentLabel": "postCommentLabel"; "postReplyLabel": "postReplyLabel"; "allowAttachments": "allowAttachments"; "fixedHeight": "fixedHeight"; "maxMessages": "maxMessages"; "maxVisibleMessages": "maxVisibleMessages"; "genericAvatarUrl": "genericAvatarUrl"; "shouldInterceptMessageSend": "shouldInterceptMessageSend"; "participants": "participants"; "source": "source"; "hashtags": "hashtags"; "topicID": "topicID"; }, { "signInSelected": "signInSelected"; "editAvatarSelected": "editAvatarSelected"; "permissionDeniedError": "permissionDeniedError"; "upvoted": "upvoted"; "reported": "reported"; "selected": "selected"; "userSelected": "userSelected"; "usernameSelected": "usernameSelected"; "avatarSelected": "avatarSelected"; "shared": "shared"; }, ["sendReplyOptionsTemplate"], never, false>;
|
|
170
174
|
}
|
|
@@ -3,6 +3,7 @@ import { ChatMessage, ChatMessageAttachment, User } from "@banta/common";
|
|
|
3
3
|
import { Observable, Subject } from "rxjs";
|
|
4
4
|
import { ChatBackendBase } from "../../chat-backend-base";
|
|
5
5
|
import { ChatSourceBase } from "../../chat-source-base";
|
|
6
|
+
import { SignInState } from "../../chat-source";
|
|
6
7
|
import * as i0 from "@angular/core";
|
|
7
8
|
export interface AutoCompleteOption {
|
|
8
9
|
label: string;
|
|
@@ -21,6 +22,7 @@ export declare class CommentFieldComponent {
|
|
|
21
22
|
private _subs;
|
|
22
23
|
user: User;
|
|
23
24
|
canComment: boolean;
|
|
25
|
+
signInState: SignInState;
|
|
24
26
|
allowAttachments: boolean;
|
|
25
27
|
signInSelected: Subject<void>;
|
|
26
28
|
editAvatarSelected: Subject<void>;
|
|
@@ -31,7 +33,10 @@ export declare class CommentFieldComponent {
|
|
|
31
33
|
private _text;
|
|
32
34
|
get text(): string;
|
|
33
35
|
set text(value: string);
|
|
36
|
+
get indicatorState(): "none" | "error" | "transient" | "sending";
|
|
37
|
+
get buttonState(): "signing-in" | "sending" | "permission-denied" | "send";
|
|
34
38
|
sendLabel: string;
|
|
39
|
+
signingInLabel: string;
|
|
35
40
|
sendingLabel: string;
|
|
36
41
|
label: string;
|
|
37
42
|
permissionDeniedLabel: string;
|
|
@@ -80,5 +85,5 @@ export declare class CommentFieldComponent {
|
|
|
80
85
|
removeAttachment(attachment: ChatMessageAttachment): void;
|
|
81
86
|
alertError(): void;
|
|
82
87
|
static ɵfac: i0.ɵɵFactoryDeclaration<CommentFieldComponent, never>;
|
|
83
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<CommentFieldComponent, "banta-comment-field", never, { "source": "source"; "user": "user"; "canComment": "canComment"; "allowAttachments": "allowAttachments"; "transientMessage": "transientMessage"; "sendLabel": "sendLabel"; "sendingLabel": "sendingLabel"; "label": "label"; "permissionDeniedLabel": "permissionDeniedLabel"; "signInLabel": "signInLabel"; "maxLength": "maxLength"; "placeholder": "placeholder"; "shouldInterceptMessageSend": "shouldInterceptMessageSend"; "hashtags": "hashtags"; "participants": "participants"; "genericAvatarUrl": "genericAvatarUrl"; "submit": "submit"; }, { "signInSelected": "signInSelected"; "editAvatarSelected": "editAvatarSelected"; "textChanged": "textChanged"; "permissionDeniedError": "permissionDeniedError"; }, never, ["*"], false>;
|
|
88
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CommentFieldComponent, "banta-comment-field", never, { "source": "source"; "user": "user"; "canComment": "canComment"; "signInState": "signInState"; "allowAttachments": "allowAttachments"; "transientMessage": "transientMessage"; "sendLabel": "sendLabel"; "signingInLabel": "signingInLabel"; "sendingLabel": "sendingLabel"; "label": "label"; "permissionDeniedLabel": "permissionDeniedLabel"; "signInLabel": "signInLabel"; "maxLength": "maxLength"; "placeholder": "placeholder"; "shouldInterceptMessageSend": "shouldInterceptMessageSend"; "hashtags": "hashtags"; "participants": "participants"; "genericAvatarUrl": "genericAvatarUrl"; "submit": "submit"; }, { "signInSelected": "signInSelected"; "editAvatarSelected": "editAvatarSelected"; "textChanged": "textChanged"; "permissionDeniedError": "permissionDeniedError"; }, never, ["*"], false>;
|
|
84
89
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@banta/sdk",
|
|
3
|
-
"version": "4.7.
|
|
3
|
+
"version": "4.7.15",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"@angular/router": "^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0 || ^14.0.0",
|
|
18
18
|
"@astronautlabs/datastore": "^3.1.2",
|
|
19
19
|
"@astronautlabs/datastore-firestore": "^3.1.2",
|
|
20
|
-
"@banta/common": "^2.2.
|
|
20
|
+
"@banta/common": "^2.2.21",
|
|
21
21
|
"@types/marked": "^4.0.3",
|
|
22
22
|
"@types/dompurify": "^2.3.3",
|
|
23
23
|
"dompurify": "^2.3.10",
|