@banta/sdk 3.2.4 → 3.3.2
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 +218 -71
- 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/chat/banta-chat/banta-chat.component.js +7 -2
- package/esm2015/lib/comments/banta-comments/banta-comments.component.js +63 -13
- package/esm2015/lib/comments/comment/comment.component.js +11 -3
- package/esm2015/lib/comments/comment-field/comment-field.component.js +7 -2
- package/esm2015/lib/comments/comment-sort/comment-sort.component.js +34 -0
- package/esm2015/lib/comments/comment-view/comment-view.component.js +16 -7
- package/esm2015/lib/comments/comments.module.js +10 -4
- package/esm2015/lib/comments/index.js +2 -1
- package/esm2015/lib/common/chat-backend.service.js +1 -1
- package/fesm2015/banta-sdk.js +137 -25
- package/fesm2015/banta-sdk.js.map +1 -1
- package/lib/chat/banta-chat/banta-chat.component.d.ts +1 -0
- package/lib/comments/banta-comments/banta-comments.component.d.ts +17 -4
- package/lib/comments/comment/comment.component.d.ts +3 -0
- package/lib/comments/comment-field/comment-field.component.d.ts +2 -1
- package/lib/comments/comment-sort/comment-sort.component.d.ts +9 -0
- package/lib/comments/comment-view/comment-view.component.d.ts +3 -0
- package/lib/comments/index.d.ts +1 -0
- package/lib/common/chat-backend.service.d.ts +3 -3
- package/package.json +2 -2
package/bundles/banta-sdk.umd.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('rxjs'), require('rxjs/operators'), require('@angular/core'), require('@angular/common'), require('@angular/platform-browser'), require('@angular/material/icon'), require('@angular/material/button'), require('@angular/material/form-field'), require('@angular/material/input'), require('@angular/forms'), require('@angular/material/dialog'), require('@angular/material/menu'), require('@angular/material/progress-spinner'), require('@angular/cdk/text-field'), require('@angular/material/tooltip')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@banta/sdk', ['exports', 'rxjs', 'rxjs/operators', '@angular/core', '@angular/common', '@angular/platform-browser', '@angular/material/icon', '@angular/material/button', '@angular/material/form-field', '@angular/material/input', '@angular/forms', '@angular/material/dialog', '@angular/material/menu', '@angular/material/progress-spinner', '@angular/cdk/text-field', '@angular/material/tooltip'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.banta = global.banta || {}, global.banta.sdk = {}), global.rxjs, global.rxjs.operators, global.ng.core, global.ng.common, global.ng.platformBrowser, global.ng.material.icon, global.ng.material.button, global.ng.material.formField, global.ng.material.input, global.ng.forms, global.ng.material.dialog, global.ng.material.menu, global.ng.material.progressSpinner, global.ng.cdk.textField, global.ng.material.tooltip));
|
|
5
|
-
}(this, (function (exports, rxjs, operators, core, common, platformBrowser, icon, button, formField, input, forms, dialog, menu, progressSpinner, textField, tooltip) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('rxjs'), require('rxjs/operators'), require('@angular/core'), require('@angular/common'), require('@angular/platform-browser'), require('@angular/material/icon'), require('@angular/material/button'), require('@angular/material/form-field'), require('@angular/material/input'), require('@angular/forms'), require('@angular/material/dialog'), require('@banta/common'), require('@angular/router'), require('@angular/material/menu'), require('@angular/material/progress-spinner'), require('@angular/cdk/text-field'), require('@angular/material/tooltip'), require('@angular/material/select')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@banta/sdk', ['exports', 'rxjs', 'rxjs/operators', '@angular/core', '@angular/common', '@angular/platform-browser', '@angular/material/icon', '@angular/material/button', '@angular/material/form-field', '@angular/material/input', '@angular/forms', '@angular/material/dialog', '@banta/common', '@angular/router', '@angular/material/menu', '@angular/material/progress-spinner', '@angular/cdk/text-field', '@angular/material/tooltip', '@angular/material/select'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.banta = global.banta || {}, global.banta.sdk = {}), global.rxjs, global.rxjs.operators, global.ng.core, global.ng.common, global.ng.platformBrowser, global.ng.material.icon, global.ng.material.button, global.ng.material.formField, global.ng.material.input, global.ng.forms, global.ng.material.dialog, global.common$1, global.ng.router, global.ng.material.menu, global.ng.material.progressSpinner, global.ng.cdk.textField, global.ng.material.tooltip, global.ng.material.select));
|
|
5
|
+
}(this, (function (exports, rxjs, operators, core, common, platformBrowser, icon, button, formField, input, forms, dialog, common$1, router, menu, progressSpinner, textField, tooltip, select) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function lazyConnection(options) {
|
|
8
8
|
var obs = new rxjs.Observable(function (observer) {
|
|
@@ -7951,8 +7951,9 @@
|
|
|
7951
7951
|
configurable: true
|
|
7952
7952
|
});
|
|
7953
7953
|
BantaChatComponent.prototype.sendMessage = function () {
|
|
7954
|
+
var _a;
|
|
7954
7955
|
return __awaiter(this, void 0, void 0, function () {
|
|
7955
|
-
var text, message, e_1;
|
|
7956
|
+
var text, message, intercept, e_1;
|
|
7956
7957
|
return __generator(this, function (_b) {
|
|
7957
7958
|
switch (_b.label) {
|
|
7958
7959
|
case 0:
|
|
@@ -7971,17 +7972,22 @@
|
|
|
7971
7972
|
};
|
|
7972
7973
|
_b.label = 1;
|
|
7973
7974
|
case 1:
|
|
7974
|
-
_b.trys.push([1,
|
|
7975
|
-
return [4 /*yield*/, this.
|
|
7975
|
+
_b.trys.push([1, 5, , 6]);
|
|
7976
|
+
return [4 /*yield*/, ((_a = this.shouldInterceptMessageSend) === null || _a === void 0 ? void 0 : _a.call(this, message))];
|
|
7976
7977
|
case 2:
|
|
7977
|
-
_b.sent();
|
|
7978
|
-
return [3 /*break*/, 4];
|
|
7978
|
+
intercept = _b.sent();
|
|
7979
|
+
if (!!intercept) return [3 /*break*/, 4];
|
|
7980
|
+
return [4 /*yield*/, this.source.send(message)];
|
|
7979
7981
|
case 3:
|
|
7982
|
+
_b.sent();
|
|
7983
|
+
_b.label = 4;
|
|
7984
|
+
case 4: return [3 /*break*/, 6];
|
|
7985
|
+
case 5:
|
|
7980
7986
|
e_1 = _b.sent();
|
|
7981
7987
|
console.error("Failed to send message: ", message);
|
|
7982
7988
|
console.error(e_1);
|
|
7983
|
-
return [3 /*break*/,
|
|
7984
|
-
case
|
|
7989
|
+
return [3 /*break*/, 6];
|
|
7990
|
+
case 6: return [2 /*return*/];
|
|
7985
7991
|
}
|
|
7986
7992
|
});
|
|
7987
7993
|
});
|
|
@@ -8001,6 +8007,7 @@
|
|
|
8001
8007
|
{ type: core.ElementRef }
|
|
8002
8008
|
]; };
|
|
8003
8009
|
BantaChatComponent.propDecorators = {
|
|
8010
|
+
shouldInterceptMessageSend: [{ type: core.Input }],
|
|
8004
8011
|
source: [{ type: core.Input }],
|
|
8005
8012
|
topicID: [{ type: core.Input }],
|
|
8006
8013
|
signInLabel: [{ type: core.Input }],
|
|
@@ -8116,6 +8123,7 @@
|
|
|
8116
8123
|
this._reported = new rxjs.Subject();
|
|
8117
8124
|
this._selected = new rxjs.Subject();
|
|
8118
8125
|
this._upvoted = new rxjs.Subject();
|
|
8126
|
+
this._shared = new rxjs.Subject();
|
|
8119
8127
|
this._userSelected = new rxjs.Subject();
|
|
8120
8128
|
this._avatarSelected = new rxjs.Subject();
|
|
8121
8129
|
this._usernameSelected = new rxjs.Subject();
|
|
@@ -8184,12 +8192,22 @@
|
|
|
8184
8192
|
enumerable: false,
|
|
8185
8193
|
configurable: true
|
|
8186
8194
|
});
|
|
8195
|
+
Object.defineProperty(CommentComponent.prototype, "shared", {
|
|
8196
|
+
get: function () {
|
|
8197
|
+
return this._shared.asObservable();
|
|
8198
|
+
},
|
|
8199
|
+
enumerable: false,
|
|
8200
|
+
configurable: true
|
|
8201
|
+
});
|
|
8187
8202
|
CommentComponent.prototype.report = function () {
|
|
8188
8203
|
this._reported.next();
|
|
8189
8204
|
};
|
|
8190
8205
|
CommentComponent.prototype.upvote = function () {
|
|
8191
8206
|
this._upvoted.next();
|
|
8192
8207
|
};
|
|
8208
|
+
CommentComponent.prototype.share = function () {
|
|
8209
|
+
this._shared.next(this.message);
|
|
8210
|
+
};
|
|
8193
8211
|
CommentComponent.prototype.select = function () {
|
|
8194
8212
|
this._selected.next();
|
|
8195
8213
|
};
|
|
@@ -8216,7 +8234,7 @@
|
|
|
8216
8234
|
CommentComponent.decorators = [
|
|
8217
8235
|
{ type: core.Component, args: [{
|
|
8218
8236
|
selector: 'banta-comment',
|
|
8219
|
-
template: "\r\n<mat-menu #pointItemMenu=\"matMenu\">\r\n <button mat-menu-item (click)=\"report()\">Report</button>\r\n <button mat-menu-item>Help</button>\r\n</mat-menu>\r\n\r\n<div class=\"message-content\">\r\n <div class=\"user\">\r\n <a
|
|
8237
|
+
template: "\r\n<mat-menu #pointItemMenu=\"matMenu\">\r\n <button mat-menu-item (click)=\"report()\">Report</button>\r\n <button mat-menu-item>Help</button>\r\n</mat-menu>\r\n\r\n<div class=\"message-content\">\r\n <div class=\"user\">\r\n <a\r\n href=\"javascript:;\"\r\n class=\"avatar\"\r\n (click)=\"selectAvatar(message.user)\"\r\n [style.background-image]=\"avatarForUser(message.user)\"></a>\r\n <a href=\"javascript:;\" class=\"display-name\" (click)=\"selectUser()\">{{message.user.displayName}}</a>\r\n <a href=\"javascript:;\" class=\"username\" (click)=\"selectUsername(message.user)\">@{{message.user.username}}</a>\r\n </div>\r\n <div class=\"content\">\r\n {{message.message}}\r\n </div>\r\n\r\n <div class=\"actions\">\r\n <banta-timestamp [value]=\"message.sentAt\"></banta-timestamp>\r\n <div class=\"spacer\"></div>\r\n <div class=\"counted-action\" *ngIf=\"showReplyAction\">\r\n <div class=\"count-indicator\">\r\n {{message.submessages?.length || 0}}\r\n </div>\r\n <button mat-icon-button matTooltip=\"Comment\" matTooltipPosition=\"below\" (click)=\"select()\">\r\n <mat-icon [inline]=\"true\">comment</mat-icon>\r\n </button>\r\n </div>\r\n <div class=\"counted-action\">\r\n <div class=\"count-indicator\">\r\n {{message.upvotes}}\r\n </div>\r\n <button mat-icon-button matTooltip=\"Upvote\" matTooltipPosition=\"below\" (click)=\"upvote()\">\r\n <mat-icon [inline]=\"true\">thumb_up</mat-icon>\r\n </button>\r\n </div>\r\n\r\n <div class=\"counted-action\">\r\n <button mat-icon-button matTooltip=\"Share this comment\" matTooltipPosition=\"below\" (click)=\"share()\">\r\n <mat-icon [inline]=\"true\" >share</mat-icon>\r\n </button>\r\n </div>\r\n\r\n <button mat-icon-button [matMenuTriggerFor]=\"pointItemMenu\">\r\n <mat-icon [inline]=\"true\">more_vert</mat-icon>\r\n </button>\r\n </div>\r\n</div>\r\n",
|
|
8220
8238
|
styles: ["@-webkit-keyframes comment-appear{0%{transform:translate(100vw)}to{transform:translate(0)}}@keyframes comment-appear{0%{transform:translate(100vw)}to{transform:translate(0)}}:host{display:flex;flex-direction:column;padding:.5em;position:relative;visibility:hidden}:host.new{-webkit-animation-duration:.4s;-webkit-animation-fill-mode:both;-webkit-animation-name:comment-appear;animation-duration:.4s;animation-fill-mode:both;animation-name:comment-appear}:host.new,:host.visible{visibility:visible}:host:hover{background:#eee}:host .message-content .content{margin-left:60px;margin-right:.5em}:host.abbreviated .message-content .content{max-height:8.5em;overflow-y:hidden;text-overflow:ellipsis}:host .actions{align-items:center;display:flex;margin-left:60px;padding-right:10px}:host .actions button{color:#666}:host .actions banta-timestamp{color:#666;font-size:10pt}.user{align-items:center;display:flex;margin:1em 0 0;position:relative}.user .display-name,.user .username{color:#000;display:block;flex-grow:0;flex-shrink:1;font-size:10pt;margin:0 auto 0 0;max-width:100%;overflow:hidden;padding:0 0 0 1em;position:relative;text-overflow:ellipsis;white-space:nowrap;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;z-index:1}.user .display-name.username,.user .username.username{color:#666;flex-grow:1;flex-shrink:0}.avatar{background-color:#333;background-position:50%;background-size:cover;border-radius:100%;flex-grow:0;flex-shrink:0;height:48px;width:48px}.counted-action{align-items:center;display:flex}.count-indicator{color:#666;font-size:9pt;padding:0 0 0 3px}:host-context(.mat-dark-theme) .count-indicator{border-color:#333}:host-context(.mat-dark-theme):hover{background:#060606}:host-context(.mat-dark-theme) .user .display-name,:host-context(.mat-dark-theme) .user .username{color:#fff}@media (max-width:400px){.avatar{height:32px;width:32px}:host .actions{margin-left:44px}:host .message-content .content{margin-left:44px;margin-right:.5em}}"]
|
|
8221
8239
|
},] }
|
|
8222
8240
|
];
|
|
@@ -8231,7 +8249,8 @@
|
|
|
8231
8249
|
reported: [{ type: core.Output }],
|
|
8232
8250
|
upvoted: [{ type: core.Output }],
|
|
8233
8251
|
selected: [{ type: core.Output }],
|
|
8234
|
-
commentId: [{ type: core.HostBinding, args: ['attr.data-comment-id',] }]
|
|
8252
|
+
commentId: [{ type: core.HostBinding, args: ['attr.data-comment-id',] }],
|
|
8253
|
+
shared: [{ type: core.Output }]
|
|
8235
8254
|
};
|
|
8236
8255
|
|
|
8237
8256
|
var CommentViewComponent = /** @class */ (function () {
|
|
@@ -8244,6 +8263,7 @@
|
|
|
8244
8263
|
this._userSelected = new rxjs.Subject();
|
|
8245
8264
|
this._usernameSelected = new rxjs.Subject();
|
|
8246
8265
|
this._avatarSelected = new rxjs.Subject();
|
|
8266
|
+
this._shared = new rxjs.Subject();
|
|
8247
8267
|
this.showEmptyState = true;
|
|
8248
8268
|
this.allowReplies = true;
|
|
8249
8269
|
this.menuMessage = null;
|
|
@@ -8299,6 +8319,13 @@
|
|
|
8299
8319
|
enumerable: false,
|
|
8300
8320
|
configurable: true
|
|
8301
8321
|
});
|
|
8322
|
+
Object.defineProperty(CommentViewComponent.prototype, "shared", {
|
|
8323
|
+
get: function () {
|
|
8324
|
+
return this._shared;
|
|
8325
|
+
},
|
|
8326
|
+
enumerable: false,
|
|
8327
|
+
configurable: true
|
|
8328
|
+
});
|
|
8302
8329
|
Object.defineProperty(CommentViewComponent.prototype, "source", {
|
|
8303
8330
|
get: function () {
|
|
8304
8331
|
return this._source;
|
|
@@ -8311,6 +8338,7 @@
|
|
|
8311
8338
|
}
|
|
8312
8339
|
this._source = value;
|
|
8313
8340
|
if (value) {
|
|
8341
|
+
console.log("[banta-comment-view] Subscribing to source...");
|
|
8314
8342
|
var messages = (value.messages || []).slice();
|
|
8315
8343
|
this.messages = messages;
|
|
8316
8344
|
this.olderMessages = messages.splice(this.maxVisibleMessages, messages.length);
|
|
@@ -8344,6 +8372,9 @@
|
|
|
8344
8372
|
CommentViewComponent.prototype.selectAvatar = function (user) {
|
|
8345
8373
|
this._avatarSelected.next(user);
|
|
8346
8374
|
};
|
|
8375
|
+
CommentViewComponent.prototype.sharedMessage = function (message) {
|
|
8376
|
+
this._shared.next(message);
|
|
8377
|
+
};
|
|
8347
8378
|
CommentViewComponent.prototype.messageIdentity = function (index, chatMessage) {
|
|
8348
8379
|
return chatMessage.id;
|
|
8349
8380
|
};
|
|
@@ -8455,7 +8486,7 @@
|
|
|
8455
8486
|
CommentViewComponent.decorators = [
|
|
8456
8487
|
{ type: core.Component, args: [{
|
|
8457
8488
|
selector: 'banta-comment-view',
|
|
8458
|
-
template: "<div class=\"message-container\">\r\n <ng-content select=\"[data-before]\"></ng-content>\r\n
|
|
8489
|
+
template: "<div class=\"message-container\">\r\n <ng-content select=\"[data-before]\"></ng-content>\r\n\r\n <a mat-button class=\"nav\" [class.visible]=\"isViewingMore\" href=\"javascript:;\" (click)=\"showNew()\">\r\n <mat-icon>file_upload</mat-icon>\r\n New\r\n <ng-container *ngIf=\"newMessages.length >= 1\">\r\n ({{newMessages.length}})\r\n </ng-container>\r\n </a>\r\n\r\n <ng-container *ngIf=\"messages.length === 0\">\r\n <div class=\"empty-state\" *ngIf=\"showEmptyState\">\r\n Be the first to comment!\r\n </div>\r\n </ng-container>\r\n <banta-comment\r\n *ngFor=\"let message of messages; trackBy: messageIdentity\"\r\n class=\"abbreviated\"\r\n [message]=\"message\"\r\n (click)=\"isViewingMore = true\"\r\n [showReplyAction]=\"allowReplies\"\r\n\t\t(userSelected)=\"selectMessageUser(message)\"\r\n (avatarSelected)=\"selectAvatar($event)\"\r\n\t\t(usernameSelected)=\"selectUsername($event)\"\r\n (upvoted)=\"upvoteMessage(message)\"\r\n (reported)=\"reportMessage(message)\"\r\n (selected)=\"selectMessage(message)\"\r\n (shared)=\"sharedMessage($event)\"\r\n ></banta-comment>\r\n\r\n <a mat-button class=\"nav\" [class.visible]=\"hasMore && !isLoadingMore\" href=\"javascript:;\" (click)=\"showMore()\">Show more</a>\r\n\r\n <div class=\"loading-more\" *ngIf=\"isLoadingMore\">\r\n <mat-spinner></mat-spinner>\r\n </div>\r\n\r\n <!-- <div style=\"color: #666\">\r\n n={{newMessages.length}}, m={{messages.length}}, o={{olderMessages.length}},\r\n v={{maxVisibleMessages}}, M={{maxMessages}}\r\n </div> -->\r\n\r\n <ng-content select=\":not([data-before])\"></ng-content>\r\n</div>\r\n",
|
|
8459
8490
|
styles: [":host{display:flex;flex-direction:column;flex-grow:1;opacity:1;transition:opacity .2s ease-in}.message-container{background:#fff;color:#111;flex-grow:1;opacity:1;overflow-x:hidden;padding:.5em 1em 3em .5em;position:relative;transition:opacity .5s ease-in-out}.message-container.no-scroll{height:auto;overflow-y:visible}.message-container.faded{opacity:.25}.message-container .overlay{bottom:0;left:0;position:absolute;right:0;top:0;z-index:10}:host.fixed-height .message-container{overflow-y:auto}:host-context(.mat-dark-theme) .message-container{background:#111;color:#fff}.empty-state{color:#666;margin:3em;text-align:center}:host-context(.mat-dark-theme) .empty-state{color:#666}a.nav{background:#222;border-radius:2em;opacity:0;pointer-events:none;position:absolute;right:.5em;text-align:center;transition:opacity .4s ease-in-out;z-index:10}a.nav.visible{opacity:1;pointer-events:auto}.loading-more{margin:0 auto;padding:2em;text-align:center;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}@media (max-width:400px){.message-container{padding:0 0 3em}}"]
|
|
8460
8491
|
},] }
|
|
8461
8492
|
];
|
|
@@ -8472,6 +8503,7 @@
|
|
|
8472
8503
|
upvoted: [{ type: core.Output }],
|
|
8473
8504
|
usernameSelected: [{ type: core.Output }],
|
|
8474
8505
|
avatarSelected: [{ type: core.Output }],
|
|
8506
|
+
shared: [{ type: core.Output }],
|
|
8475
8507
|
source: [{ type: core.Input }],
|
|
8476
8508
|
genericAvatarUrl: [{ type: core.Input }],
|
|
8477
8509
|
messageContainer: [{ type: core.ViewChild, args: ['messageContainer',] }],
|
|
@@ -8484,17 +8516,20 @@
|
|
|
8484
8516
|
* Comments component
|
|
8485
8517
|
*/
|
|
8486
8518
|
var BantaCommentsComponent = /** @class */ (function () {
|
|
8487
|
-
function BantaCommentsComponent(banta, backend, elementRef) {
|
|
8519
|
+
function BantaCommentsComponent(banta, backend, elementRef, activatedRoute) {
|
|
8488
8520
|
this.banta = banta;
|
|
8489
8521
|
this.backend = backend;
|
|
8490
8522
|
this.elementRef = elementRef;
|
|
8523
|
+
this.activatedRoute = activatedRoute;
|
|
8491
8524
|
this._upvoted = new rxjs.Subject();
|
|
8492
8525
|
this._reported = new rxjs.Subject();
|
|
8493
8526
|
this._selected = new rxjs.Subject();
|
|
8494
8527
|
this._userSelected = new rxjs.Subject();
|
|
8528
|
+
this._shared = new rxjs.Subject();
|
|
8495
8529
|
this._usernameSelected = new rxjs.Subject();
|
|
8496
8530
|
this._avatarSelected = new rxjs.Subject();
|
|
8497
8531
|
this._subs = new rxjs.Subscription();
|
|
8532
|
+
this._sortOrder = common$1.CommentsOrder.NEWEST;
|
|
8498
8533
|
this.hashtags = [
|
|
8499
8534
|
{ hashtag: 'error', description: 'Cause an error' },
|
|
8500
8535
|
{ hashtag: 'timeout', description: 'Cause a slow timeout error' },
|
|
@@ -8515,10 +8550,45 @@
|
|
|
8515
8550
|
this.expandError = false;
|
|
8516
8551
|
this.selectedMessageVisible = false;
|
|
8517
8552
|
}
|
|
8553
|
+
Object.defineProperty(BantaCommentsComponent.prototype, "sortOrder", {
|
|
8554
|
+
get: function () {
|
|
8555
|
+
return this._sortOrder;
|
|
8556
|
+
},
|
|
8557
|
+
set: function (value) {
|
|
8558
|
+
var _this = this;
|
|
8559
|
+
if (this._sortOrder !== value) {
|
|
8560
|
+
this._sortOrder = value;
|
|
8561
|
+
setTimeout(function () {
|
|
8562
|
+
_this.setSourceFromTopicID(_this.topicID);
|
|
8563
|
+
});
|
|
8564
|
+
}
|
|
8565
|
+
},
|
|
8566
|
+
enumerable: false,
|
|
8567
|
+
configurable: true
|
|
8568
|
+
});
|
|
8518
8569
|
BantaCommentsComponent.prototype.ngOnInit = function () {
|
|
8519
8570
|
var _this = this;
|
|
8520
8571
|
this._subs.add(this.banta.userChanged.subscribe(function (user) { return _this.user = user; }));
|
|
8521
8572
|
};
|
|
8573
|
+
BantaCommentsComponent.prototype.ngAfterViewInit = function () {
|
|
8574
|
+
if (typeof window !== 'undefined')
|
|
8575
|
+
this.checkForSharedComment();
|
|
8576
|
+
};
|
|
8577
|
+
BantaCommentsComponent.prototype.scrollToComment = function (commentId) {
|
|
8578
|
+
setTimeout(function () {
|
|
8579
|
+
var comment = document.querySelectorAll("[data-comment-id=\"" + commentId + "\"]");
|
|
8580
|
+
console.log(comment);
|
|
8581
|
+
if (comment.length > 0) {
|
|
8582
|
+
// comment.item(0).scroll({behavior: 'smooth'});
|
|
8583
|
+
comment.item(0).scrollIntoView();
|
|
8584
|
+
}
|
|
8585
|
+
}, 1000);
|
|
8586
|
+
};
|
|
8587
|
+
BantaCommentsComponent.prototype.checkForSharedComment = function () {
|
|
8588
|
+
var commentID = this.activatedRoute.snapshot.queryParamMap.get('comment');
|
|
8589
|
+
if (commentID)
|
|
8590
|
+
this.scrollToComment(commentID);
|
|
8591
|
+
};
|
|
8522
8592
|
BantaCommentsComponent.prototype.ngOnDestroy = function () {
|
|
8523
8593
|
this._subs.unsubscribe();
|
|
8524
8594
|
};
|
|
@@ -8534,33 +8604,44 @@
|
|
|
8534
8604
|
});
|
|
8535
8605
|
Object.defineProperty(BantaCommentsComponent.prototype, "topicID", {
|
|
8536
8606
|
get: function () {
|
|
8537
|
-
return this.
|
|
8607
|
+
return this._topicID;
|
|
8538
8608
|
},
|
|
8539
8609
|
set: function (value) {
|
|
8540
|
-
this
|
|
8610
|
+
var _this = this;
|
|
8611
|
+
if (this._topicID !== value) {
|
|
8612
|
+
this._topicID = value;
|
|
8613
|
+
setTimeout(function () { return _this.setSourceFromTopicID(value); });
|
|
8614
|
+
}
|
|
8541
8615
|
},
|
|
8542
8616
|
enumerable: false,
|
|
8543
8617
|
configurable: true
|
|
8544
8618
|
});
|
|
8545
8619
|
BantaCommentsComponent.prototype.setSourceFromTopicID = function (topicID) {
|
|
8620
|
+
var _a, _b;
|
|
8546
8621
|
return __awaiter(this, void 0, void 0, function () {
|
|
8547
|
-
var _b;
|
|
8548
8622
|
var _this = this;
|
|
8549
8623
|
return __generator(this, function (_c) {
|
|
8550
|
-
|
|
8551
|
-
|
|
8552
|
-
|
|
8553
|
-
|
|
8554
|
-
|
|
8555
|
-
|
|
8556
|
-
|
|
8557
|
-
|
|
8558
|
-
|
|
8559
|
-
|
|
8560
|
-
|
|
8561
|
-
|
|
8562
|
-
|
|
8563
|
-
|
|
8624
|
+
(_b = (_a = this._source) === null || _a === void 0 ? void 0 : _a.close) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
8625
|
+
this._source = null;
|
|
8626
|
+
setTimeout(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
8627
|
+
var _c;
|
|
8628
|
+
var _this = this;
|
|
8629
|
+
return __generator(this, function (_d) {
|
|
8630
|
+
switch (_d.label) {
|
|
8631
|
+
case 0:
|
|
8632
|
+
_c = this;
|
|
8633
|
+
return [4 /*yield*/, this.backend.getSourceForTopic(topicID, { sortOrder: this.sortOrder })];
|
|
8634
|
+
case 1:
|
|
8635
|
+
_c._source = _d.sent();
|
|
8636
|
+
console.log("[banta-comments] Subscribing to source for topic '" + topicID + "'");
|
|
8637
|
+
this._source.messageReceived.subscribe(function (m) { return _this.addParticipant(m); });
|
|
8638
|
+
this._source.messageSent.subscribe(function (m) { return _this.addParticipant(m); });
|
|
8639
|
+
this._source.messages.forEach(function (m) { return _this.addParticipant(m); });
|
|
8640
|
+
return [2 /*return*/];
|
|
8641
|
+
}
|
|
8642
|
+
});
|
|
8643
|
+
}); });
|
|
8644
|
+
return [2 /*return*/];
|
|
8564
8645
|
});
|
|
8565
8646
|
});
|
|
8566
8647
|
};
|
|
@@ -8671,6 +8752,13 @@
|
|
|
8671
8752
|
enumerable: false,
|
|
8672
8753
|
configurable: true
|
|
8673
8754
|
});
|
|
8755
|
+
Object.defineProperty(BantaCommentsComponent.prototype, "shared", {
|
|
8756
|
+
get: function () {
|
|
8757
|
+
return this._shared.asObservable();
|
|
8758
|
+
},
|
|
8759
|
+
enumerable: false,
|
|
8760
|
+
configurable: true
|
|
8761
|
+
});
|
|
8674
8762
|
BantaCommentsComponent.prototype.onKeyDown = function (event) {
|
|
8675
8763
|
};
|
|
8676
8764
|
BantaCommentsComponent.prototype.insertEmoji = function (text) {
|
|
@@ -8693,13 +8781,13 @@
|
|
|
8693
8781
|
};
|
|
8694
8782
|
BantaCommentsComponent.prototype.upvoteMessage = function (message) {
|
|
8695
8783
|
return __awaiter(this, void 0, void 0, function () {
|
|
8696
|
-
return __generator(this, function (
|
|
8697
|
-
switch (
|
|
8784
|
+
return __generator(this, function (_c) {
|
|
8785
|
+
switch (_c.label) {
|
|
8698
8786
|
case 0:
|
|
8699
8787
|
this._upvoted.next(message);
|
|
8700
8788
|
return [4 /*yield*/, this.backend.upvoteMessage(message.topicId, message.parentMessageId ? message.parentMessageId : message.id, message.parentMessageId ? message.id : undefined)];
|
|
8701
8789
|
case 1:
|
|
8702
|
-
|
|
8790
|
+
_c.sent();
|
|
8703
8791
|
return [2 /*return*/];
|
|
8704
8792
|
}
|
|
8705
8793
|
});
|
|
@@ -8712,7 +8800,7 @@
|
|
|
8712
8800
|
return __awaiter(this, void 0, void 0, function () {
|
|
8713
8801
|
var message;
|
|
8714
8802
|
var _this = this;
|
|
8715
|
-
return __generator(this, function (
|
|
8803
|
+
return __generator(this, function (_c) {
|
|
8716
8804
|
message = this.selectedMessage;
|
|
8717
8805
|
this._selected.next(null);
|
|
8718
8806
|
this.selectedMessage = null;
|
|
@@ -8730,19 +8818,19 @@
|
|
|
8730
8818
|
BantaCommentsComponent.prototype.selectMessage = function (message) {
|
|
8731
8819
|
return __awaiter(this, void 0, void 0, function () {
|
|
8732
8820
|
var _this = this;
|
|
8733
|
-
return __generator(this, function (
|
|
8821
|
+
return __generator(this, function (_c) {
|
|
8734
8822
|
this._selected.next(message);
|
|
8735
8823
|
this.selectedMessage = message;
|
|
8736
8824
|
setTimeout(function () { return _this.selectedMessageVisible = true; });
|
|
8737
8825
|
setTimeout(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
8738
|
-
var
|
|
8739
|
-
return __generator(this, function (
|
|
8740
|
-
switch (
|
|
8826
|
+
var _c;
|
|
8827
|
+
return __generator(this, function (_d) {
|
|
8828
|
+
switch (_d.label) {
|
|
8741
8829
|
case 0:
|
|
8742
|
-
|
|
8830
|
+
_c = this;
|
|
8743
8831
|
return [4 /*yield*/, this.backend.getSourceForThread(this.topicID, message.id)];
|
|
8744
8832
|
case 1:
|
|
8745
|
-
|
|
8833
|
+
_c.selectedMessageThread = _d.sent();
|
|
8746
8834
|
return [2 /*return*/];
|
|
8747
8835
|
}
|
|
8748
8836
|
});
|
|
@@ -8760,10 +8848,13 @@
|
|
|
8760
8848
|
BantaCommentsComponent.prototype.selectAvatar = function (user) {
|
|
8761
8849
|
this._avatarSelected.next(user);
|
|
8762
8850
|
};
|
|
8851
|
+
BantaCommentsComponent.prototype.shareMessage = function (message) {
|
|
8852
|
+
this._shared.next(message);
|
|
8853
|
+
};
|
|
8763
8854
|
BantaCommentsComponent.prototype.sendReply = function () {
|
|
8764
8855
|
return __awaiter(this, void 0, void 0, function () {
|
|
8765
|
-
return __generator(this, function (
|
|
8766
|
-
switch (
|
|
8856
|
+
return __generator(this, function (_c) {
|
|
8857
|
+
switch (_c.label) {
|
|
8767
8858
|
case 0: return [4 /*yield*/, this.selectedMessageThread.send({
|
|
8768
8859
|
message: this.replyMessage,
|
|
8769
8860
|
parentMessageId: this.selectedMessage.id,
|
|
@@ -8775,7 +8866,7 @@
|
|
|
8775
8866
|
updatedAt: Date.now()
|
|
8776
8867
|
})];
|
|
8777
8868
|
case 1:
|
|
8778
|
-
|
|
8869
|
+
_c.sent();
|
|
8779
8870
|
this.replyMessage = '';
|
|
8780
8871
|
return [2 /*return*/];
|
|
8781
8872
|
}
|
|
@@ -8793,14 +8884,15 @@
|
|
|
8793
8884
|
BantaCommentsComponent.decorators = [
|
|
8794
8885
|
{ type: core.Component, args: [{
|
|
8795
8886
|
selector: 'banta-comments',
|
|
8796
|
-
template: "\r\n<div class=\"focused\" [class.visible]=\"selectedMessageVisible\" *ngIf=\"selectedMessage\">\r\n\r\n <div>\r\n <a mat-button href=\"javascript:;\" (click)=\"unselectMessage()\">\r\n <mat-icon>arrow_back</mat-icon>\r\n Latest Comments\r\n </a>\r\n </div>\r\n\r\n <banta-comment
|
|
8887
|
+
template: "\r\n<div class=\"focused\" [class.visible]=\"selectedMessageVisible\" *ngIf=\"selectedMessage\">\r\n\r\n <div>\r\n <a mat-button href=\"javascript:;\" (click)=\"unselectMessage()\">\r\n <mat-icon>arrow_back</mat-icon>\r\n Latest Comments\r\n </a>\r\n </div>\r\n\r\n <banta-comment\r\n [message]=\"selectedMessage\"\r\n ></banta-comment>\r\n\r\n <div class=\"replies\">\r\n\r\n <ng-container *ngIf=\"!selectedMessageThread\">\r\n <div class=\"loading\">\r\n <mat-spinner></mat-spinner>\r\n </div>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"selectedMessageThread\">\r\n <banta-comment-view\r\n [source]=\"selectedMessageThread\"\r\n [allowReplies]=\"false\"\r\n [fixedHeight]=\"false\"\r\n [showEmptyState]=\"false\"\r\n [newestLast]=\"true\"\r\n ></banta-comment-view>\r\n\r\n <banta-comment-field\r\n [sendLabel]=\"replyLabel\"\r\n [sendingLabel]=\"sendingLabel\"\r\n [hashtags]=\"hashtags\"\r\n [participants]=\"participants\"\r\n (signInSelected)=\"showSignIn()\"\r\n (editAvatarSelected)=\"showEditAvatar()\"\r\n [source]=\"selectedMessageThread\"\r\n [canComment]=\"canComment\"\r\n [signInLabel]=\"signInLabel\"\r\n [permissionDeniedLabel]=\"permissionDeniedLabel\"\r\n (permissionDeniedError)=\"showPermissionDenied()\"\r\n [shouldInterceptMessageSend]=\"shouldInterceptMessageSend\"\r\n [user]=\"user\"\r\n [label]=\"postReplyLabel\"\r\n ></banta-comment-field>\r\n </ng-container>\r\n </div>\r\n</div>\r\n\r\n<div class=\"main\" [class.hidden]=\"selectedMessage\">\r\n <banta-comment-field\r\n [source]=\"source\"\r\n [user]=\"user\"\r\n [sendLabel]=\"sendLabel\"\r\n [sendingLabel]=\"sendingLabel\"\r\n [signInLabel]=\"signInLabel\"\r\n [canComment]=\"canComment\"\r\n [hashtags]=\"hashtags\"\r\n [participants]=\"participants\"\r\n [label]=\"postCommentLabel\"\r\n (editAvatarSelected)=\"showEditAvatar()\"\r\n (signInSelected)=\"showSignIn()\"\r\n [permissionDeniedLabel]=\"permissionDeniedLabel\"\r\n (permissionDeniedError)=\"showPermissionDenied()\"\r\n [shouldInterceptMessageSend]=\"shouldInterceptMessageSend\"\r\n ></banta-comment-field>\r\n\r\n <banta-comment-sort\r\n [(sort)]=\"sortOrder\"></banta-comment-sort>\r\n\r\n <banta-comment-view\r\n [class.faded]=\"selectedMessage\"\r\n [source]=\"source\"\r\n [fixedHeight]=\"fixedHeight\"\r\n [maxMessages]=\"maxMessages\"\r\n [maxVisibleMessages]=\"maxVisibleMessages\"\r\n [genericAvatarUrl]=\"genericAvatarUrl\"\r\n (userSelected)=\"selectMessageUser($event)\"\r\n (selected)=\"selectMessage($event)\"\r\n (upvoted)=\"upvoteMessage($event)\"\r\n (reported)=\"reportMessage($event)\"\r\n (usernameSelected)=\"selectUsername($event)\"\r\n (avatarSelected)=\"selectAvatar($event)\"\r\n (shared)=\"shareMessage($event)\"\r\n ></banta-comment-view>\r\n</div>\r\n",
|
|
8797
8888
|
styles: [":host{display:flex;flex-direction:column}@-webkit-keyframes select-comment{0%{transform:scale(1.15)}to{transform:scale(1)}}@keyframes select-comment{0%{transform:scale(1.15)}to{transform:scale(1)}}.focused{-webkit-animation-duration:.4s;-webkit-animation-fill-mode:both;-webkit-animation-name:select-comment;animation-duration:.4s;animation-fill-mode:both;animation-name:select-comment}.focused .replies{margin-left:4em;margin-top:1em}banta-comment-view{opacity:1;transition:opacity .4s ease-in-out}banta-comment-view.faded{opacity:.25}.loading{display:block;margin:0 auto;min-height:16em;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.main.hidden{display:none}@media (max-width:500px){.focused .replies{margin-left:0}}"]
|
|
8798
8889
|
},] }
|
|
8799
8890
|
];
|
|
8800
8891
|
BantaCommentsComponent.ctorParameters = function () { return [
|
|
8801
8892
|
{ type: BantaService },
|
|
8802
8893
|
{ type: ChatBackendService },
|
|
8803
|
-
{ type: core.ElementRef }
|
|
8894
|
+
{ type: core.ElementRef },
|
|
8895
|
+
{ type: router.ActivatedRoute }
|
|
8804
8896
|
]; };
|
|
8805
8897
|
BantaCommentsComponent.propDecorators = {
|
|
8806
8898
|
hashtags: [{ type: core.Input }],
|
|
@@ -8810,6 +8902,7 @@
|
|
|
8810
8902
|
maxMessages: [{ type: core.Input }],
|
|
8811
8903
|
maxVisibleMessages: [{ type: core.Input }],
|
|
8812
8904
|
genericAvatarUrl: [{ type: core.Input }],
|
|
8905
|
+
shouldInterceptMessageSend: [{ type: core.Input }],
|
|
8813
8906
|
topicID: [{ type: core.Input }],
|
|
8814
8907
|
signInLabel: [{ type: core.Input }],
|
|
8815
8908
|
sendLabel: [{ type: core.Input }],
|
|
@@ -8826,7 +8919,8 @@
|
|
|
8826
8919
|
selected: [{ type: core.Output }],
|
|
8827
8920
|
userSelected: [{ type: core.Output }],
|
|
8828
8921
|
usernameSelected: [{ type: core.Output }],
|
|
8829
|
-
avatarSelected: [{ type: core.Output }]
|
|
8922
|
+
avatarSelected: [{ type: core.Output }],
|
|
8923
|
+
shared: [{ type: core.Output }]
|
|
8830
8924
|
};
|
|
8831
8925
|
|
|
8832
8926
|
var LiveCommentComponent = /** @class */ (function () {
|
|
@@ -8973,7 +9067,7 @@
|
|
|
8973
9067
|
CommentFieldComponent.prototype.autocomplete = function (replacement) {
|
|
8974
9068
|
return __awaiter(this, void 0, void 0, function () {
|
|
8975
9069
|
var el;
|
|
8976
|
-
return __generator(this, function (
|
|
9070
|
+
return __generator(this, function (_b) {
|
|
8977
9071
|
el = this.textareaEl.nativeElement;
|
|
8978
9072
|
this.text = this.text.slice(0, el.selectionStart - this.completionPrefix.length) + replacement + this.text.slice(el.selectionStart);
|
|
8979
9073
|
return [2 /*return*/];
|
|
@@ -8983,7 +9077,7 @@
|
|
|
8983
9077
|
CommentFieldComponent.prototype.insert = function (str) {
|
|
8984
9078
|
return __awaiter(this, void 0, void 0, function () {
|
|
8985
9079
|
var el;
|
|
8986
|
-
return __generator(this, function (
|
|
9080
|
+
return __generator(this, function (_b) {
|
|
8987
9081
|
el = this.textareaEl.nativeElement;
|
|
8988
9082
|
this.text = this.text.slice(0, el.selectionStart) + str + this.text.slice(el.selectionStart);
|
|
8989
9083
|
return [2 /*return*/];
|
|
@@ -8993,8 +9087,8 @@
|
|
|
8993
9087
|
CommentFieldComponent.prototype.onKeyDown = function (event) {
|
|
8994
9088
|
return __awaiter(this, void 0, void 0, function () {
|
|
8995
9089
|
var _this = this;
|
|
8996
|
-
return __generator(this, function (
|
|
8997
|
-
switch (
|
|
9090
|
+
return __generator(this, function (_b) {
|
|
9091
|
+
switch (_b.label) {
|
|
8998
9092
|
case 0:
|
|
8999
9093
|
console.log(event.key);
|
|
9000
9094
|
if (this.autocompleteVisible) {
|
|
@@ -9030,7 +9124,7 @@
|
|
|
9030
9124
|
if (!(event.key === 'Enter' && event.ctrlKey)) return [3 /*break*/, 2];
|
|
9031
9125
|
return [4 /*yield*/, this.sendMessage()];
|
|
9032
9126
|
case 1:
|
|
9033
|
-
|
|
9127
|
+
_b.sent();
|
|
9034
9128
|
return [2 /*return*/];
|
|
9035
9129
|
case 2:
|
|
9036
9130
|
if (this.completionFunc) {
|
|
@@ -9113,18 +9207,19 @@
|
|
|
9113
9207
|
this.editAvatarSelected.next();
|
|
9114
9208
|
};
|
|
9115
9209
|
CommentFieldComponent.prototype.sendMessage = function () {
|
|
9210
|
+
var _a;
|
|
9116
9211
|
return __awaiter(this, void 0, void 0, function () {
|
|
9117
|
-
var text, message, e_1;
|
|
9118
|
-
return __generator(this, function (
|
|
9119
|
-
switch (
|
|
9212
|
+
var text, message, intercept, e_1;
|
|
9213
|
+
return __generator(this, function (_b) {
|
|
9214
|
+
switch (_b.label) {
|
|
9120
9215
|
case 0:
|
|
9121
9216
|
if (!this.source)
|
|
9122
9217
|
return [2 /*return*/];
|
|
9123
9218
|
this.sending = true;
|
|
9124
9219
|
this.sendError = null;
|
|
9125
|
-
|
|
9220
|
+
_b.label = 1;
|
|
9126
9221
|
case 1:
|
|
9127
|
-
|
|
9222
|
+
_b.trys.push([1, , 8, 9]);
|
|
9128
9223
|
text = (this.text || '').trim();
|
|
9129
9224
|
if (text === '')
|
|
9130
9225
|
return [2 /*return*/];
|
|
@@ -9135,25 +9230,31 @@
|
|
|
9135
9230
|
upvotes: 0,
|
|
9136
9231
|
message: text
|
|
9137
9232
|
};
|
|
9138
|
-
|
|
9233
|
+
_b.label = 2;
|
|
9139
9234
|
case 2:
|
|
9140
|
-
|
|
9141
|
-
return [4 /*yield*/, this.
|
|
9235
|
+
_b.trys.push([2, 6, , 7]);
|
|
9236
|
+
return [4 /*yield*/, ((_a = this.shouldInterceptMessageSend) === null || _a === void 0 ? void 0 : _a.call(this, message))];
|
|
9142
9237
|
case 3:
|
|
9143
|
-
|
|
9144
|
-
|
|
9145
|
-
return [
|
|
9238
|
+
intercept = _b.sent();
|
|
9239
|
+
if (!!intercept) return [3 /*break*/, 5];
|
|
9240
|
+
return [4 /*yield*/, this.source.send(message)];
|
|
9146
9241
|
case 4:
|
|
9147
|
-
|
|
9242
|
+
_b.sent();
|
|
9243
|
+
_b.label = 5;
|
|
9244
|
+
case 5:
|
|
9245
|
+
this.text = '';
|
|
9246
|
+
return [3 /*break*/, 7];
|
|
9247
|
+
case 6:
|
|
9248
|
+
e_1 = _b.sent();
|
|
9148
9249
|
this.indicateError("Could not send: " + e_1.message);
|
|
9149
9250
|
console.error("Failed to send message: ", message);
|
|
9150
9251
|
console.error(e_1);
|
|
9151
|
-
return [3 /*break*/,
|
|
9152
|
-
case
|
|
9153
|
-
case
|
|
9252
|
+
return [3 /*break*/, 7];
|
|
9253
|
+
case 7: return [3 /*break*/, 9];
|
|
9254
|
+
case 8:
|
|
9154
9255
|
this.sending = false;
|
|
9155
9256
|
return [7 /*endfinally*/];
|
|
9156
|
-
case
|
|
9257
|
+
case 9: return [2 /*return*/];
|
|
9157
9258
|
}
|
|
9158
9259
|
});
|
|
9159
9260
|
});
|
|
@@ -9179,6 +9280,7 @@
|
|
|
9179
9280
|
permissionDeniedLabel: [{ type: core.Input }],
|
|
9180
9281
|
signInLabel: [{ type: core.Input }],
|
|
9181
9282
|
placeholder: [{ type: core.Input }],
|
|
9283
|
+
shouldInterceptMessageSend: [{ type: core.Input }],
|
|
9182
9284
|
autocompleteEl: [{ type: core.ViewChild, args: ['autocomplete',] }],
|
|
9183
9285
|
autocompleteContainerEl: [{ type: core.ViewChild, args: ['autocompleteContainer',] }],
|
|
9184
9286
|
textareaEl: [{ type: core.ViewChild, args: ['textarea',] }],
|
|
@@ -9187,12 +9289,54 @@
|
|
|
9187
9289
|
permissionDeniedError: [{ type: core.Output }]
|
|
9188
9290
|
};
|
|
9189
9291
|
|
|
9292
|
+
var CommentSortComponent = /** @class */ (function () {
|
|
9293
|
+
function CommentSortComponent() {
|
|
9294
|
+
this.commentsOrder = common$1.CommentsOrder;
|
|
9295
|
+
this._sortChange = new rxjs.Subject();
|
|
9296
|
+
this._sort = common$1.CommentsOrder.LIKES;
|
|
9297
|
+
}
|
|
9298
|
+
Object.defineProperty(CommentSortComponent.prototype, "sort", {
|
|
9299
|
+
get: function () {
|
|
9300
|
+
return this._sort;
|
|
9301
|
+
},
|
|
9302
|
+
set: function (value) {
|
|
9303
|
+
var _this = this;
|
|
9304
|
+
if (this._sort !== value) {
|
|
9305
|
+
this._sort = value;
|
|
9306
|
+
setTimeout(function () { return _this._sortChange.next(value); });
|
|
9307
|
+
}
|
|
9308
|
+
},
|
|
9309
|
+
enumerable: false,
|
|
9310
|
+
configurable: true
|
|
9311
|
+
});
|
|
9312
|
+
Object.defineProperty(CommentSortComponent.prototype, "sortChange", {
|
|
9313
|
+
get: function () {
|
|
9314
|
+
return this._sortChange.asObservable();
|
|
9315
|
+
},
|
|
9316
|
+
enumerable: false,
|
|
9317
|
+
configurable: true
|
|
9318
|
+
});
|
|
9319
|
+
return CommentSortComponent;
|
|
9320
|
+
}());
|
|
9321
|
+
CommentSortComponent.decorators = [
|
|
9322
|
+
{ type: core.Component, args: [{
|
|
9323
|
+
selector: 'banta-comment-sort',
|
|
9324
|
+
template: "<div class=\"sort-row\">\r\n <mat-form-field>\r\n <mat-label>Sort by</mat-label>\r\n <mat-select [(value)]=\"sort\" >\r\n <mat-option [value]=\"commentsOrder.NEWEST\">Newest</mat-option>\r\n <mat-option [value]=\"commentsOrder.OLDEST\">Oldest</mat-option>\r\n <mat-option [value]=\"commentsOrder.LIKES\">Likes</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n</div>\r\n",
|
|
9325
|
+
styles: [".sort-row{display:flex;justify-content:end;padding-right:3em}"]
|
|
9326
|
+
},] }
|
|
9327
|
+
];
|
|
9328
|
+
CommentSortComponent.propDecorators = {
|
|
9329
|
+
sort: [{ type: core.Input }],
|
|
9330
|
+
sortChange: [{ type: core.Output }]
|
|
9331
|
+
};
|
|
9332
|
+
|
|
9190
9333
|
var COMPONENTS$3 = [
|
|
9191
9334
|
CommentComponent,
|
|
9192
9335
|
CommentViewComponent,
|
|
9193
9336
|
BantaCommentsComponent,
|
|
9194
9337
|
LiveCommentComponent,
|
|
9195
|
-
CommentFieldComponent
|
|
9338
|
+
CommentFieldComponent,
|
|
9339
|
+
CommentSortComponent
|
|
9196
9340
|
];
|
|
9197
9341
|
var CommentsModule = /** @class */ (function () {
|
|
9198
9342
|
function CommentsModule() {
|
|
@@ -9213,7 +9357,9 @@
|
|
|
9213
9357
|
menu.MatMenuModule,
|
|
9214
9358
|
progressSpinner.MatProgressSpinnerModule,
|
|
9215
9359
|
BantaCommonModule,
|
|
9216
|
-
EmojiModule
|
|
9360
|
+
EmojiModule,
|
|
9361
|
+
tooltip.MatTooltipModule,
|
|
9362
|
+
select.MatSelectModule
|
|
9217
9363
|
],
|
|
9218
9364
|
exports: COMPONENTS$3
|
|
9219
9365
|
},] }
|
|
@@ -9286,6 +9432,7 @@
|
|
|
9286
9432
|
exports.ChatViewComponent = ChatViewComponent;
|
|
9287
9433
|
exports.CommentComponent = CommentComponent;
|
|
9288
9434
|
exports.CommentFieldComponent = CommentFieldComponent;
|
|
9435
|
+
exports.CommentSortComponent = CommentSortComponent;
|
|
9289
9436
|
exports.CommentViewComponent = CommentViewComponent;
|
|
9290
9437
|
exports.CommentsModule = CommentsModule;
|
|
9291
9438
|
exports.EMOJIS = EMOJIS;
|