@banta/sdk 5.5.3 → 5.6.1

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.
@@ -43,7 +43,7 @@ export declare class BantaComponent {
43
43
  pointOpen: ChatMessage;
44
44
  pointSubChat: ChatSourceBase;
45
45
  closeAux(): void;
46
- getViewType(message: ChatMessage): "comment" | "chat";
46
+ getViewType(message: ChatMessage): "chat" | "comment";
47
47
  upvoteMessage(message: ChatMessage): Promise<void>;
48
48
  showProfile(user: User): void;
49
49
  profileUser: User;
@@ -23,7 +23,8 @@ import * as i18 from "@angular/material/snack-bar";
23
23
  import * as i19 from "@angular/cdk/overlay";
24
24
  import * as i20 from "@angular/cdk/portal";
25
25
  export declare class BantaSdkModule {
26
- constructor(chatBackend: ChatBackendBase);
26
+ chatBackend: ChatBackendBase;
27
+ constructor();
27
28
  static configure(options?: SdkOptions): ModuleWithProviders<BantaSdkModule>;
28
29
  static ɵfac: i0.ɵɵFactoryDeclaration<BantaSdkModule, never>;
29
30
  static ɵmod: i0.ɵɵNgModuleDeclaration<BantaSdkModule, [typeof i1.BantaComponent, typeof i2.BantaLogoComponent, typeof i3.LiveMessageComponent], [typeof i4.CommonModule, typeof i5.FormsModule, typeof i6.BantaCommonModule, typeof i7.CommentsModule, typeof i8.ChatModule, typeof i9.EmojiModule, typeof i10.MatIconModule, typeof i11.MatButtonModule, typeof i12.MatTooltipModule, typeof i13.MatMenuModule, typeof i14.MatDialogModule, typeof i15.MatFormFieldModule, typeof i16.MatInputModule, typeof i17.MatProgressSpinnerModule, typeof i18.MatSnackBarModule, typeof i19.OverlayModule, typeof i20.PortalModule], [typeof i1.BantaComponent, typeof i2.BantaLogoComponent, typeof i3.LiveMessageComponent, typeof i6.BantaCommonModule, typeof i8.ChatModule, typeof i7.CommentsModule, typeof i9.EmojiModule]>;
@@ -88,6 +88,7 @@ export declare class BantaCommentsComponent {
88
88
  waitForThreadView(): Promise<CommentViewComponent>;
89
89
  markLoaded: () => void;
90
90
  loaded: Promise<void>;
91
+ get sourceState(): "connected" | "connecting" | "lost" | "restored" | "no-source";
91
92
  private updateLoading;
92
93
  private _signInSelected;
93
94
  private _permissionDeniedError;
@@ -26,7 +26,29 @@ export declare class CommentViewComponent {
26
26
  isViewingMore: boolean;
27
27
  isLoadingMore: boolean;
28
28
  hasMore: boolean;
29
+ get previousMessages(): ChatMessage[];
30
+ get nextMessages(): ChatMessage[];
31
+ /**
32
+ * While this is called "new" messages, it really represents the messages that would be visible *at the beginning
33
+ * of the sort order*, which can be flipped by the newestLast feature (used for replies mode).
34
+ *
35
+ * So, when newestLast is false, regardless of the current sortOrder, newMessages are conceptually
36
+ * *above* the visible set of messages.
37
+ *
38
+ * When newestLast is true (as in replies mode), regardless of the current sortOrder, newMessages are conceptually
39
+ * *below* the visible set of messages.
40
+ */
29
41
  newMessages: ChatMessage[];
42
+ /**
43
+ * While this is called "older" messages, it really represents the messages that would be visible *at the end of the
44
+ * sort order*, which can be flipped by the newestLast feature (useds for replies mode).
45
+ *
46
+ * So, when newestLast is false, regardless of the current sortOrder, olderMessages are conceptually *below*
47
+ * the visible set of messages.
48
+ *
49
+ * When newestLast is true (as in replies mode), regardless of the current sortOrder, olderMessages are conceptually
50
+ * *above* the visible set of messages.
51
+ */
30
52
  olderMessages: ChatMessage[];
31
53
  maxMessages: number;
32
54
  maxVisibleMessages: number;
@@ -97,9 +119,50 @@ export declare class CommentViewComponent {
97
119
  deleteMessage(message: ChatMessage): void;
98
120
  private setSource;
99
121
  private getInitialMessages;
122
+ debugMessages(): void;
123
+ zeroPad(number: number | string, count?: number): string;
124
+ leftPad(str: string, count?: number): string;
100
125
  messageIdentity(index: number, chatMessage: ChatMessage): string;
101
- showNew(event: MouseEvent): Promise<void>;
126
+ get sourceSortOrder(): "newest" | "oldest" | "likes";
127
+ get sourceFilterMode(): string;
128
+ /**
129
+ * Show the newest content.
130
+ * - If an unnatural sort order is active (ie Oldest or Likes), it will be changed to Newest.
131
+ * - The new content will be placed where new content goes based on newestLast (replies mode), so if it is true, the content is
132
+ * placed at the end, otherwise it is placed at the beginning.
133
+ *
134
+ * @param event
135
+ * @returns
136
+ */
137
+ showNewest(event: MouseEvent): Promise<void>;
138
+ get showDebug(): boolean;
139
+ get shouldShowNext(): boolean;
140
+ get shouldShowPrevious(): boolean;
141
+ get pageSize(): number;
142
+ showPrevious(): Promise<void>;
143
+ get sortNextLabel(): "Older" | "Newer" | "Less Likes" | "More";
144
+ get sortPreviousLabel(): "Older" | "Newer" | "More" | "More Likes";
145
+ get nextLabel(): "Older" | "Newer" | "Less Likes" | "More" | "More Likes";
146
+ get previousLabel(): "Older" | "Newer" | "Less Likes" | "More" | "More Likes";
147
+ /**
148
+ * Show more content
149
+ * - When in replies mode (newestLast), the content is added at the top
150
+ * - When in normal mode, the content is added at the bottom
151
+ * - The current sort order does *not* factor in here, which is why it is showMore() not showEarlier().
152
+ *
153
+ * @returns
154
+ */
155
+ showNext(): Promise<void>;
156
+ /**
157
+ * Show more content
158
+ * - When in replies mode (newestLast), the content is added at the top
159
+ * - When in normal mode, the content is added at the bottom
160
+ * - The current sort order does *not* factor in here, which is why it is showMore() not showEarlier().
161
+ *
162
+ * @returns
163
+ */
102
164
  showMore(): Promise<void>;
165
+ private heldMessages;
103
166
  private addMessage;
104
167
  private incrementPagingCursors;
105
168
  /**
@@ -1,6 +1,8 @@
1
- import { InjectionToken } from "@angular/core";
1
+ import { InjectionToken, Type } from "@angular/core";
2
+ import { ChatBackendBase } from "./chat-backend-base";
2
3
  export interface SdkOptions {
3
4
  serviceUrl?: string;
4
5
  emojiUrl?: string;
6
+ backendClass?: Type<ChatBackendBase>;
5
7
  }
6
8
  export declare const BANTA_SDK_OPTIONS: InjectionToken<SdkOptions>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@banta/sdk",
3
- "version": "5.5.3",
3
+ "version": "5.6.1",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"