@banta/sdk 4.5.2 → 4.6.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/bundles/banta-sdk.umd.js +93 -6
- package/bundles/banta-sdk.umd.js.map +1 -1
- package/bundles/banta-sdk.umd.min.js +1 -1
- package/bundles/banta-sdk.umd.min.js.map +1 -1
- package/esm2015/lib/comments/banta-comments/banta-comments.component.js +53 -5
- package/esm2015/lib/comments/comment/comment.component.js +12 -5
- package/esm2015/lib/comments/comment-view/comment-view.component.js +19 -2
- package/fesm2015/banta-sdk.js +77 -7
- package/fesm2015/banta-sdk.js.map +1 -1
- package/lib/comments/banta-comments/banta-comments.component.d.ts +32 -1
- package/lib/comments/comment/comment.component.d.ts +4 -0
- package/lib/comments/comment-view/comment-view.component.d.ts +12 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ElementRef, NgZone } from '@angular/core';
|
|
1
|
+
import { ElementRef, NgZone, QueryList } from '@angular/core';
|
|
2
2
|
import { User, ChatMessage, CommentsOrder } from '@banta/common';
|
|
3
3
|
import { HashTag } from '../comment-field/comment-field.component';
|
|
4
4
|
import { Subject, Observable } from 'rxjs';
|
|
@@ -7,6 +7,8 @@ import { ChatBackendBase } from '../../chat-backend-base';
|
|
|
7
7
|
import { ChatSourceBase } from '../../chat-source-base';
|
|
8
8
|
import { MatSnackBar } from '@angular/material/snack-bar';
|
|
9
9
|
import { MessageMenuItem } from '../../message-menu-item';
|
|
10
|
+
import { CommentViewComponent } from '../comment-view/comment-view.component';
|
|
11
|
+
import { CommentComponent } from '../comment/comment.component';
|
|
10
12
|
/**
|
|
11
13
|
* Comments component
|
|
12
14
|
*/
|
|
@@ -17,6 +19,7 @@ export declare class BantaCommentsComponent {
|
|
|
17
19
|
private matSnackBar;
|
|
18
20
|
private ngZone;
|
|
19
21
|
constructor(backend: ChatBackendBase, elementRef: ElementRef<HTMLElement>, activatedRoute: ActivatedRoute, matSnackBar: MatSnackBar, ngZone: NgZone);
|
|
22
|
+
get element(): HTMLElement;
|
|
20
23
|
private handleBackendExceptionAsAlert;
|
|
21
24
|
private handleBackendException;
|
|
22
25
|
ngOnInit(): void;
|
|
@@ -44,6 +47,34 @@ export declare class BantaCommentsComponent {
|
|
|
44
47
|
maxCommentLength: number;
|
|
45
48
|
loadingMessages: string[];
|
|
46
49
|
useInlineReplies: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Access the CommentViewComponent for this BantaCommentsComponent.
|
|
52
|
+
* CommentViewComponent is responsible for interacting with the ChatSource
|
|
53
|
+
* object and rendering comments as CommentComponents. It is the source of
|
|
54
|
+
* truth for which CommentComponent corresponds to which ChatMessage.
|
|
55
|
+
*
|
|
56
|
+
* Note that this CommentViewComponent is only for the top level comments.
|
|
57
|
+
* Replies are handled by a separate CommentViewComponent which can be
|
|
58
|
+
* retrieved using the threadView property.
|
|
59
|
+
*/
|
|
60
|
+
commentView: CommentViewComponent;
|
|
61
|
+
threadViewQuery: QueryList<CommentViewComponent>;
|
|
62
|
+
/**
|
|
63
|
+
* Attempts to find the CommentComponent that corresponds to the given ChatMessage.
|
|
64
|
+
* The ChatMessage could be a top-level message in this conversation, or a reply,
|
|
65
|
+
* but note that a CommentComponent will only exist for a reply if the user has
|
|
66
|
+
* the relevant reply thread open.
|
|
67
|
+
* @param message The message to look for
|
|
68
|
+
*/
|
|
69
|
+
getCommentComponentForMessage(message: ChatMessage): CommentComponent;
|
|
70
|
+
/**
|
|
71
|
+
* Access the CommentViewComponent corresponding to the currently open reply thread.
|
|
72
|
+
* This is not the top level comments, but instead the reply thread that the user has
|
|
73
|
+
* opened (only one set of replies can be open at a time).
|
|
74
|
+
*
|
|
75
|
+
* For details about what CommentViewComponent affords you, see the commentView property.
|
|
76
|
+
*/
|
|
77
|
+
get threadView(): CommentViewComponent;
|
|
47
78
|
private updateLoading;
|
|
48
79
|
private _signInSelected;
|
|
49
80
|
private _permissionDeniedError;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
import { ElementRef } from "@angular/core";
|
|
1
2
|
import { ChatMessage, ChatPermissions, User } from '@banta/common';
|
|
2
3
|
import { MessageMenuItem } from "../../message-menu-item";
|
|
3
4
|
export declare class CommentComponent {
|
|
5
|
+
private elementRef;
|
|
6
|
+
constructor(elementRef: ElementRef<HTMLElement>);
|
|
7
|
+
get element(): HTMLElement;
|
|
4
8
|
private _reported;
|
|
5
9
|
private _selected;
|
|
6
10
|
private _liked;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { ElementRef } from "@angular/core";
|
|
1
|
+
import { ElementRef, QueryList } from "@angular/core";
|
|
2
2
|
import { User, ChatMessage, CommentsOrder } from '@banta/common';
|
|
3
3
|
import { Subject } from 'rxjs';
|
|
4
4
|
import { ChatBackendBase } from "../../chat-backend-base";
|
|
5
5
|
import { ChatSourceBase } from "../../chat-source-base";
|
|
6
6
|
import { MessageMenuItem } from "../../message-menu-item";
|
|
7
|
+
import { CommentComponent } from "../comment/comment.component";
|
|
7
8
|
export interface EditEvent {
|
|
8
9
|
message: ChatMessage;
|
|
9
10
|
newMessage: string;
|
|
@@ -26,6 +27,16 @@ export declare class CommentViewComponent {
|
|
|
26
27
|
showEmptyState: boolean;
|
|
27
28
|
allowReplies: boolean;
|
|
28
29
|
customMenuItems: MessageMenuItem[];
|
|
30
|
+
commentsQuery: QueryList<CommentComponent>;
|
|
31
|
+
get comments(): CommentComponent[];
|
|
32
|
+
/**
|
|
33
|
+
* Get the CommentComponent instantiated for the given ChatMessage,
|
|
34
|
+
* if it exists in the current view. Note that messages which are not
|
|
35
|
+
* currently shown to the user will not return a CommentComponent.
|
|
36
|
+
* @param message
|
|
37
|
+
* @returns
|
|
38
|
+
*/
|
|
39
|
+
getCommentComponentForMessage(message: ChatMessage): CommentComponent;
|
|
29
40
|
fixedHeight: boolean;
|
|
30
41
|
selectedMessage: ChatMessage;
|
|
31
42
|
get selected(): Subject<ChatMessage>;
|