@banta/sdk 0.0.35 → 1.0.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.
- package/banta-sdk.metadata.json +1 -1
- package/bundles/banta-sdk.umd.js +238 -509
- package/bundles/banta-sdk.umd.js.map +1 -1
- package/bundles/banta-sdk.umd.min.js +2 -2
- package/bundles/banta-sdk.umd.min.js.map +1 -1
- package/esm2015/lib/banta/banta.component.js +217 -0
- package/esm2015/lib/banta-logo.component.js +22 -0
- package/esm2015/lib/banta-sdk.module.js +17 -12
- package/esm2015/lib/chat/banta-chat/banta-chat.component.js +197 -0
- package/esm2015/lib/chat/chat-message/chat-message.component.js +2 -2
- package/esm2015/lib/chat/chat-view/chat-view.component.js +5 -5
- package/esm2015/lib/chat/chat.module.js +3 -3
- package/esm2015/lib/chat/index.js +2 -2
- package/esm2015/lib/chat/live-chat-message.component.js +4 -4
- package/esm2015/lib/comments/banta-comments/banta-comments.component.js +180 -0
- package/esm2015/lib/comments/comment/comment.component.js +4 -4
- package/esm2015/lib/comments/comment-view/comment-view.component.js +3 -3
- package/esm2015/lib/comments/comments.module.js +5 -5
- package/esm2015/lib/comments/index.js +2 -2
- package/esm2015/lib/comments/live-comment.component.js +4 -4
- package/esm2015/lib/common/common.module.js +7 -7
- package/esm2015/lib/common/timestamp.component.js +2 -2
- package/esm2015/lib/index.js +3 -3
- package/esm2015/lib/live-message.component.js +6 -6
- package/esm5/lib/banta/banta.component.js +283 -0
- package/esm5/lib/banta-logo.component.js +16 -0
- package/esm5/lib/banta-sdk.module.js +17 -12
- package/esm5/lib/chat/banta-chat/banta-chat.component.js +245 -0
- package/esm5/lib/chat/chat-message/chat-message.component.js +2 -2
- package/esm5/lib/chat/chat-view/chat-view.component.js +5 -5
- package/esm5/lib/chat/chat.module.js +3 -3
- package/esm5/lib/chat/index.js +2 -2
- package/esm5/lib/chat/live-chat-message.component.js +3 -3
- package/esm5/lib/comments/banta-comments/banta-comments.component.js +228 -0
- package/esm5/lib/comments/comment/comment.component.js +4 -4
- package/esm5/lib/comments/comment-view/comment-view.component.js +3 -3
- package/esm5/lib/comments/comments.module.js +5 -5
- package/esm5/lib/comments/index.js +2 -2
- package/esm5/lib/comments/live-comment.component.js +3 -3
- package/esm5/lib/common/common.module.js +11 -11
- package/esm5/lib/common/timestamp.component.js +2 -2
- package/esm5/lib/index.js +3 -3
- package/esm5/lib/live-message.component.js +3 -3
- package/fesm2015/banta-sdk.js +143 -387
- package/fesm2015/banta-sdk.js.map +1 -1
- package/fesm5/banta-sdk.js +234 -502
- package/fesm5/banta-sdk.js.map +1 -1
- package/lib/banta/banta.component.d.ts +55 -0
- package/lib/banta-logo.component.d.ts +2 -0
- package/lib/chat/{firehose-chat/firehose-chat.component.d.ts → banta-chat/banta-chat.component.d.ts} +7 -1
- package/lib/chat/index.d.ts +1 -1
- package/lib/comments/{comments-box/comments-box.component.d.ts → banta-comments/banta-comments.component.d.ts} +8 -2
- package/lib/comments/index.d.ts +1 -1
- package/lib/common/common.module.d.ts +2 -2
- package/lib/index.d.ts +2 -2
- package/package.json +2 -3
- package/esm2015/lib/chat/firehose-chat/firehose-chat.component.js +0 -175
- package/esm2015/lib/comments/comments-box/comments-box.component.js +0 -158
- package/esm2015/lib/engage/engage.component.js +0 -510
- package/esm2015/lib/engage-logo.component.js +0 -22
- package/esm5/lib/chat/firehose-chat/firehose-chat.component.js +0 -209
- package/esm5/lib/comments/comments-box/comments-box.component.js +0 -192
- package/esm5/lib/engage/engage.component.js +0 -631
- package/esm5/lib/engage-logo.component.js +0 -16
- package/lib/engage/engage.component.d.ts +0 -98
- package/lib/engage-logo.component.d.ts +0 -2
package/bundles/banta-sdk.umd.js
CHANGED
|
@@ -357,7 +357,7 @@
|
|
|
357
357
|
], TimestampComponent.prototype, "value", null);
|
|
358
358
|
TimestampComponent = __decorate([
|
|
359
359
|
core.Component({
|
|
360
|
-
selector: '
|
|
360
|
+
selector: 'banta-timestamp',
|
|
361
361
|
template: "\n <span *ngIf=\"showAbsolute\" [title]=\"value | date : 'short'\">\n {{value | date : 'shortDate'}}\n </span>\n <span *ngIf=\"!showAbsolute\" [title]=\"value | date : 'short'\">\n {{relative}}\n </span>\n ",
|
|
362
362
|
styles: [""]
|
|
363
363
|
})
|
|
@@ -368,20 +368,20 @@
|
|
|
368
368
|
var COMPONENTS = [
|
|
369
369
|
TimestampComponent
|
|
370
370
|
];
|
|
371
|
-
var
|
|
372
|
-
function
|
|
371
|
+
var BantaCommonModule = /** @class */ (function () {
|
|
372
|
+
function BantaCommonModule() {
|
|
373
373
|
}
|
|
374
|
-
|
|
375
|
-
|
|
374
|
+
BantaCommonModule_1 = BantaCommonModule;
|
|
375
|
+
BantaCommonModule.forRoot = function () {
|
|
376
376
|
return {
|
|
377
|
-
ngModule:
|
|
377
|
+
ngModule: BantaCommonModule_1,
|
|
378
378
|
providers: [
|
|
379
379
|
BantaService
|
|
380
380
|
]
|
|
381
381
|
};
|
|
382
382
|
};
|
|
383
|
-
var
|
|
384
|
-
|
|
383
|
+
var BantaCommonModule_1;
|
|
384
|
+
BantaCommonModule = BantaCommonModule_1 = __decorate([
|
|
385
385
|
core.NgModule({
|
|
386
386
|
declarations: COMPONENTS,
|
|
387
387
|
imports: [
|
|
@@ -389,8 +389,8 @@
|
|
|
389
389
|
],
|
|
390
390
|
exports: COMPONENTS
|
|
391
391
|
})
|
|
392
|
-
],
|
|
393
|
-
return
|
|
392
|
+
], BantaCommonModule);
|
|
393
|
+
return BantaCommonModule;
|
|
394
394
|
}());
|
|
395
395
|
|
|
396
396
|
var EMOJIS = {
|
|
@@ -7130,7 +7130,7 @@
|
|
|
7130
7130
|
], ChatMessageComponent.prototype, "upvoted", null);
|
|
7131
7131
|
ChatMessageComponent = __decorate([
|
|
7132
7132
|
core.Component({
|
|
7133
|
-
selector: '
|
|
7133
|
+
selector: 'banta-chat-message',
|
|
7134
7134
|
template: "<div class=\"message-content\">\r\n <div class=\"user\" (click)=\"selectUser()\">\r\n <div class=\"avatar\" [style.background-image]=\"avatarForUser(message.user)\"></div>\r\n <label>{{message.user.username}}</label>\r\n </div>\r\n <div class=\"content\">\r\n <div (click)=\"select()\">\r\n {{message.message}}\r\n </div>\r\n <div class=\"status\">\r\n <div class=\"count-indicator\" *ngIf=\"message.upvotes > 0\">\r\n {{message.upvotes}} <mat-icon [inline]=\"true\">star</mat-icon>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n<div class=\"actions\">\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 <button mat-icon-button matTooltip=\"Report\" matTooltipPosition=\"below\" (click)=\"report()\">\r\n <mat-icon [inline]=\"true\">report</mat-icon>\r\n </button>\r\n</div>",
|
|
7135
7135
|
styles: [":host{display:flex;flex-direction:row;align-items:center;padding:0 1em;background-color:#fff;color:#000;transition:background-color .4s ease-out}:host:hover{background-color:#ddd}:host.highlight{background:#00121b}:host.highlight:hover{background:#01324d}:host:nth-child(2n){background-color:#eee}:host:nth-child(2n):hover{background:#ddd}:host:nth-child(2n) .message-content .content{color:#222}:host:nth-child(2n).highlight{background:#001a2a}:host:nth-child(2n).highlight:hover{background:#002b44}:host .message-content{display:flex;flex-direction:row;flex-grow:1;align-items:center}:host .message-content .content{color:#111;display:flex;flex-direction:row;padding:5px 0}:host .message-content .content .status{display:flex;flex-direction:row;align-items:center;margin-left:1em}:host .message-content .content .status mat-icon{margin-left:.5em}:host .user{color:#999;font-weight:400;text-align:right;margin-right:.25em;flex-shrink:0;display:flex;align-items:center}:host .user .avatar{background-position:center;background-size:cover;background-color:#333;border-radius:100%;flex-shrink:0;flex-grow:0;margin-right:1em;width:2em;height:2em}:host .user:after{content:\":\";margin-right:1em}:host .content{flex-grow:1}:host .actions{flex-shrink:0;white-space:nowrap;opacity:0;transition:opacity .4s ease-out}:host:hover .actions{opacity:1}.count-indicator{white-space:nowrap}:host-context(.mat-dark-theme){background-color:#000;color:#fff}:host-context(.mat-dark-theme) .message-content .content{color:#ddd}:host-context(.mat-dark-theme):hover{background-color:#111}:host-context(.mat-dark-theme):nth-child(2n).highlight{background:#001a2a}:host-context(.mat-dark-theme):nth-child(2n).highlight:hover{background:#002b44}:host-context(.mat-dark-theme):nth-child(2n):hover{background-color:#111}:host-context(.mat-dark-theme):nth-child(2n){background-color:#080808}:host-context(.mat-dark-theme):nth-child(2n) .message-content .content{color:#eee}label{margin:0}"]
|
|
7136
7136
|
})
|
|
@@ -7231,8 +7231,8 @@
|
|
|
7231
7231
|
], LiveChatMessageComponent.prototype, "message", null);
|
|
7232
7232
|
LiveChatMessageComponent = __decorate([
|
|
7233
7233
|
core.Component({
|
|
7234
|
-
selector: '
|
|
7235
|
-
template: "\n <
|
|
7234
|
+
selector: 'banta-live-chat-message',
|
|
7235
|
+
template: "\n <banta-chat-message \n *ngIf=\"message\"\n [message]=\"message\"\n (upvoted)=\"upvote()\"\n (reported)=\"report()\"\n (selected)=\"select()\"\n ></banta-chat-message>\n ",
|
|
7236
7236
|
styles: [""]
|
|
7237
7237
|
}),
|
|
7238
7238
|
__metadata("design:paramtypes", [ChatBackendService])
|
|
@@ -7346,7 +7346,7 @@
|
|
|
7346
7346
|
};
|
|
7347
7347
|
ChatViewComponent.prototype.jumpTo = function (message) {
|
|
7348
7348
|
var element = this.elementRef.nativeElement;
|
|
7349
|
-
var messageElement = element.querySelector("
|
|
7349
|
+
var messageElement = element.querySelector("banta-chat-message[data-id=\"" + message.id + "\"]");
|
|
7350
7350
|
if (!messageElement) {
|
|
7351
7351
|
alert("could not find message " + message.id);
|
|
7352
7352
|
return;
|
|
@@ -7424,17 +7424,20 @@
|
|
|
7424
7424
|
], ChatViewComponent.prototype, "maxMessages", void 0);
|
|
7425
7425
|
ChatViewComponent = __decorate([
|
|
7426
7426
|
core.Component({
|
|
7427
|
-
selector: '
|
|
7428
|
-
template: "<div class=\"message-container\" #messageContainer>\r\n <ng-content select=\"[data-before]\"></ng-content>\r\n <
|
|
7429
|
-
styles: [":host{display:flex;flex-direction:column;flex-grow:1}.message-container{flex-grow:1;overflow-y:auto;overflow-x:hidden;height:10em;color:#000;background:#fff;padding:.5em 1em .5em .5em}.message-container.no-scroll{height:auto;overflow-y:visible}:host-context(.mat-dark-theme) .message-container{color:#fff;background:#000}
|
|
7427
|
+
selector: 'banta-chat-view',
|
|
7428
|
+
template: "<div class=\"message-container\" #messageContainer>\r\n <ng-content select=\"[data-before]\"></ng-content>\r\n <banta-chat-message \r\n *ngFor=\"let message of messages\"\r\n [message]=\"message\"\r\n [class.highlight]=\"mentionsMe(message)\" \r\n [class.flash]=\"message.id === flashedMessageId\"\r\n (selected)=\"selectMessage(message)\"\r\n (upvoted)=\"upvoteMessage(message)\"\r\n (reported)=\"reportMessage(message)\"\r\n (userSelected)=\"selectMessageUser(message)\"\r\n [attr.data-id]=\"message.id\"\r\n >\r\n </banta-chat-message>\r\n <ng-content select=\":not([data-before])\"></ng-content>\r\n</div>",
|
|
7429
|
+
styles: [":host{display:flex;flex-direction:column;flex-grow:1}.message-container{flex-grow:1;overflow-y:auto;overflow-x:hidden;height:10em;color:#000;background:#fff;padding:.5em 1em .5em .5em}.message-container.no-scroll{height:auto;overflow-y:visible}:host-context(.mat-dark-theme) .message-container{color:#fff;background:#000}banta-chat-message.flash{-webkit-animation:2.5s flash;animation:2.5s flash}@-webkit-keyframes flash{0%{transform:scale(1);background:#425700}25%,75%{transform:scale(1.05)}100%,50%{transform:scale(1)}}@keyframes flash{0%{transform:scale(1);background:#425700}25%,75%{transform:scale(1.05)}100%,50%{transform:scale(1)}}"]
|
|
7430
7430
|
}),
|
|
7431
7431
|
__metadata("design:paramtypes", [core.ElementRef])
|
|
7432
7432
|
], ChatViewComponent);
|
|
7433
7433
|
return ChatViewComponent;
|
|
7434
7434
|
}());
|
|
7435
7435
|
|
|
7436
|
-
|
|
7437
|
-
|
|
7436
|
+
/**
|
|
7437
|
+
* Chat component
|
|
7438
|
+
*/
|
|
7439
|
+
var BantaChatComponent = /** @class */ (function () {
|
|
7440
|
+
function BantaChatComponent(banta, backend, elementRef) {
|
|
7438
7441
|
this.banta = banta;
|
|
7439
7442
|
this.backend = backend;
|
|
7440
7443
|
this.elementRef = elementRef;
|
|
@@ -7452,14 +7455,14 @@
|
|
|
7452
7455
|
this.showEmojiPanel = false;
|
|
7453
7456
|
this.newMessage = {};
|
|
7454
7457
|
}
|
|
7455
|
-
|
|
7458
|
+
BantaChatComponent.prototype.ngOnInit = function () {
|
|
7456
7459
|
var _this = this;
|
|
7457
7460
|
this._subs.add(this.banta.userChanged.subscribe(function (user) { return _this.user = user; }));
|
|
7458
7461
|
};
|
|
7459
|
-
|
|
7462
|
+
BantaChatComponent.prototype.ngOnDestroy = function () {
|
|
7460
7463
|
this._subs.unsubscribe();
|
|
7461
7464
|
};
|
|
7462
|
-
Object.defineProperty(
|
|
7465
|
+
Object.defineProperty(BantaChatComponent.prototype, "source", {
|
|
7463
7466
|
get: function () {
|
|
7464
7467
|
return this._source;
|
|
7465
7468
|
},
|
|
@@ -7469,78 +7472,106 @@
|
|
|
7469
7472
|
enumerable: true,
|
|
7470
7473
|
configurable: true
|
|
7471
7474
|
});
|
|
7472
|
-
Object.defineProperty(
|
|
7475
|
+
Object.defineProperty(BantaChatComponent.prototype, "topicID", {
|
|
7476
|
+
get: function () {
|
|
7477
|
+
return this._source.identifier;
|
|
7478
|
+
},
|
|
7479
|
+
set: function (value) {
|
|
7480
|
+
this.setSourceFromTopicID(value);
|
|
7481
|
+
},
|
|
7482
|
+
enumerable: true,
|
|
7483
|
+
configurable: true
|
|
7484
|
+
});
|
|
7485
|
+
BantaChatComponent.prototype.setSourceFromTopicID = function (topicID) {
|
|
7486
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
7487
|
+
var _a;
|
|
7488
|
+
return __generator(this, function (_b) {
|
|
7489
|
+
switch (_b.label) {
|
|
7490
|
+
case 0:
|
|
7491
|
+
if (this._source && this._source.close)
|
|
7492
|
+
this._source.close();
|
|
7493
|
+
this._source = null;
|
|
7494
|
+
_a = this;
|
|
7495
|
+
return [4 /*yield*/, this.backend.getSourceForTopic(topicID)];
|
|
7496
|
+
case 1:
|
|
7497
|
+
_a._source = _b.sent();
|
|
7498
|
+
return [2 /*return*/];
|
|
7499
|
+
}
|
|
7500
|
+
});
|
|
7501
|
+
});
|
|
7502
|
+
};
|
|
7503
|
+
Object.defineProperty(BantaChatComponent.prototype, "signInSelected", {
|
|
7473
7504
|
get: function () {
|
|
7474
7505
|
return this._signInSelected;
|
|
7475
7506
|
},
|
|
7476
7507
|
enumerable: true,
|
|
7477
7508
|
configurable: true
|
|
7478
7509
|
});
|
|
7479
|
-
Object.defineProperty(
|
|
7510
|
+
Object.defineProperty(BantaChatComponent.prototype, "permissionDeniedError", {
|
|
7480
7511
|
get: function () {
|
|
7481
7512
|
return this._permissionDeniedError;
|
|
7482
7513
|
},
|
|
7483
7514
|
enumerable: true,
|
|
7484
7515
|
configurable: true
|
|
7485
7516
|
});
|
|
7486
|
-
|
|
7517
|
+
BantaChatComponent.prototype.showSignIn = function () {
|
|
7487
7518
|
this._signInSelected.next();
|
|
7488
7519
|
};
|
|
7489
|
-
|
|
7520
|
+
BantaChatComponent.prototype.sendPermissionError = function () {
|
|
7490
7521
|
this._permissionDeniedError.next();
|
|
7491
7522
|
};
|
|
7492
|
-
|
|
7523
|
+
BantaChatComponent.prototype.insertEmoji = function (emoji) {
|
|
7493
7524
|
var message = this.newMessage.message || '';
|
|
7494
7525
|
this.newMessage.message = message + emoji;
|
|
7495
7526
|
};
|
|
7496
|
-
|
|
7527
|
+
BantaChatComponent.prototype.onKeyDown = function (event) {
|
|
7497
7528
|
// TODO
|
|
7498
7529
|
};
|
|
7499
|
-
|
|
7530
|
+
BantaChatComponent.prototype.jumpToMessage = function (message) {
|
|
7500
7531
|
if (this.chatView)
|
|
7501
7532
|
this.chatView.jumpTo(message);
|
|
7502
7533
|
};
|
|
7503
|
-
|
|
7534
|
+
BantaChatComponent.prototype.select = function (message) {
|
|
7504
7535
|
this._selected.next(message);
|
|
7505
7536
|
};
|
|
7506
|
-
|
|
7537
|
+
BantaChatComponent.prototype.selectUser = function (message) {
|
|
7507
7538
|
this._userSelected.next(message);
|
|
7508
7539
|
};
|
|
7509
|
-
|
|
7540
|
+
BantaChatComponent.prototype.report = function (message) {
|
|
7510
7541
|
this._reported.next(message);
|
|
7511
7542
|
};
|
|
7512
|
-
|
|
7543
|
+
BantaChatComponent.prototype.upvote = function (message) {
|
|
7513
7544
|
this._upvoted.next(message);
|
|
7514
7545
|
};
|
|
7515
|
-
Object.defineProperty(
|
|
7546
|
+
Object.defineProperty(BantaChatComponent.prototype, "selected", {
|
|
7516
7547
|
get: function () {
|
|
7517
7548
|
return this._selected;
|
|
7518
7549
|
},
|
|
7519
7550
|
enumerable: true,
|
|
7520
7551
|
configurable: true
|
|
7521
7552
|
});
|
|
7522
|
-
Object.defineProperty(
|
|
7553
|
+
Object.defineProperty(BantaChatComponent.prototype, "reported", {
|
|
7523
7554
|
get: function () {
|
|
7524
7555
|
return this._reported;
|
|
7525
7556
|
},
|
|
7526
7557
|
enumerable: true,
|
|
7527
7558
|
configurable: true
|
|
7528
7559
|
});
|
|
7529
|
-
Object.defineProperty(
|
|
7560
|
+
Object.defineProperty(BantaChatComponent.prototype, "upvoted", {
|
|
7530
7561
|
get: function () {
|
|
7531
7562
|
return this._upvoted;
|
|
7532
7563
|
},
|
|
7533
7564
|
enumerable: true,
|
|
7534
7565
|
configurable: true
|
|
7535
7566
|
});
|
|
7536
|
-
Object.defineProperty(
|
|
7567
|
+
Object.defineProperty(BantaChatComponent.prototype, "userSelected", {
|
|
7537
7568
|
get: function () {
|
|
7538
7569
|
return this._userSelected;
|
|
7539
7570
|
},
|
|
7540
7571
|
enumerable: true,
|
|
7541
7572
|
configurable: true
|
|
7542
7573
|
});
|
|
7543
|
-
Object.defineProperty(
|
|
7574
|
+
Object.defineProperty(BantaChatComponent.prototype, "canChat", {
|
|
7544
7575
|
get: function () {
|
|
7545
7576
|
var _a;
|
|
7546
7577
|
if (!this.user.permissions)
|
|
@@ -7550,7 +7581,7 @@
|
|
|
7550
7581
|
enumerable: true,
|
|
7551
7582
|
configurable: true
|
|
7552
7583
|
});
|
|
7553
|
-
|
|
7584
|
+
BantaChatComponent.prototype.sendMessage = function () {
|
|
7554
7585
|
if (!this.source)
|
|
7555
7586
|
return;
|
|
7556
7587
|
var text = (this.newMessage.message || '').trim();
|
|
@@ -7565,7 +7596,7 @@
|
|
|
7565
7596
|
};
|
|
7566
7597
|
this.source.send(message);
|
|
7567
7598
|
};
|
|
7568
|
-
|
|
7599
|
+
BantaChatComponent.ctorParameters = function () { return [
|
|
7569
7600
|
{ type: BantaService },
|
|
7570
7601
|
{ type: ChatBackendService },
|
|
7571
7602
|
{ type: core.ElementRef }
|
|
@@ -7574,71 +7605,76 @@
|
|
|
7574
7605
|
core.Input(),
|
|
7575
7606
|
__metadata("design:type", Object),
|
|
7576
7607
|
__metadata("design:paramtypes", [Object])
|
|
7577
|
-
],
|
|
7608
|
+
], BantaChatComponent.prototype, "source", null);
|
|
7609
|
+
__decorate([
|
|
7610
|
+
core.Input(),
|
|
7611
|
+
__metadata("design:type", String),
|
|
7612
|
+
__metadata("design:paramtypes", [Object])
|
|
7613
|
+
], BantaChatComponent.prototype, "topicID", null);
|
|
7578
7614
|
__decorate([
|
|
7579
7615
|
core.Input(),
|
|
7580
7616
|
__metadata("design:type", Object)
|
|
7581
|
-
],
|
|
7617
|
+
], BantaChatComponent.prototype, "signInLabel", void 0);
|
|
7582
7618
|
__decorate([
|
|
7583
7619
|
core.Input(),
|
|
7584
7620
|
__metadata("design:type", Object)
|
|
7585
|
-
],
|
|
7621
|
+
], BantaChatComponent.prototype, "sendLabel", void 0);
|
|
7586
7622
|
__decorate([
|
|
7587
7623
|
core.Input(),
|
|
7588
7624
|
__metadata("design:type", Object)
|
|
7589
|
-
],
|
|
7625
|
+
], BantaChatComponent.prototype, "permissionDeniedLabel", void 0);
|
|
7590
7626
|
__decorate([
|
|
7591
7627
|
core.Output(),
|
|
7592
7628
|
__metadata("design:type", rxjs.Observable),
|
|
7593
7629
|
__metadata("design:paramtypes", [])
|
|
7594
|
-
],
|
|
7630
|
+
], BantaChatComponent.prototype, "signInSelected", null);
|
|
7595
7631
|
__decorate([
|
|
7596
7632
|
core.Output(),
|
|
7597
7633
|
__metadata("design:type", rxjs.Observable),
|
|
7598
7634
|
__metadata("design:paramtypes", [])
|
|
7599
|
-
],
|
|
7635
|
+
], BantaChatComponent.prototype, "permissionDeniedError", null);
|
|
7600
7636
|
__decorate([
|
|
7601
7637
|
core.ViewChild('chatView', { static: true }),
|
|
7602
7638
|
__metadata("design:type", ChatViewComponent)
|
|
7603
|
-
],
|
|
7639
|
+
], BantaChatComponent.prototype, "chatView", void 0);
|
|
7604
7640
|
__decorate([
|
|
7605
7641
|
core.Output(),
|
|
7606
7642
|
__metadata("design:type", Object),
|
|
7607
7643
|
__metadata("design:paramtypes", [])
|
|
7608
|
-
],
|
|
7644
|
+
], BantaChatComponent.prototype, "selected", null);
|
|
7609
7645
|
__decorate([
|
|
7610
7646
|
core.Output(),
|
|
7611
7647
|
__metadata("design:type", Object),
|
|
7612
7648
|
__metadata("design:paramtypes", [])
|
|
7613
|
-
],
|
|
7649
|
+
], BantaChatComponent.prototype, "reported", null);
|
|
7614
7650
|
__decorate([
|
|
7615
7651
|
core.Output(),
|
|
7616
7652
|
__metadata("design:type", Object),
|
|
7617
7653
|
__metadata("design:paramtypes", [])
|
|
7618
|
-
],
|
|
7654
|
+
], BantaChatComponent.prototype, "upvoted", null);
|
|
7619
7655
|
__decorate([
|
|
7620
7656
|
core.Output(),
|
|
7621
7657
|
__metadata("design:type", Object),
|
|
7622
7658
|
__metadata("design:paramtypes", [])
|
|
7623
|
-
],
|
|
7624
|
-
|
|
7659
|
+
], BantaChatComponent.prototype, "userSelected", null);
|
|
7660
|
+
BantaChatComponent = __decorate([
|
|
7625
7661
|
core.Component({
|
|
7626
|
-
selector: '
|
|
7627
|
-
template: "<
|
|
7662
|
+
selector: 'banta-chat',
|
|
7663
|
+
template: "<banta-chat-view \r\n #chatView\r\n [source]=\"source\"\r\n (upvoted)=\"upvote($event)\"\r\n (reported)=\"report($event)\"\r\n (selected)=\"select($event)\"\r\n (userSelected)=\"selectUser($event)\"\r\n ></banta-chat-view>\r\n\r\n<form class=\"new-message\" (submit)=\"sendMessage()\">\r\n \r\n <div class=\"entry-container\">\r\n <input\r\n type=\"text\"\r\n name=\"message\" \r\n (keydown)=\"onKeyDown($event)\"\r\n [(ngModel)]=\"newMessage.message\" />\r\n \r\n <emoji-selector-button\r\n (selected)=\"insertEmoji($event)\"\r\n ></emoji-selector-button>\r\n </div>\r\n\r\n <div class=\"actions\">\r\n\r\n <ng-container *ngIf=\"!user\">\r\n <button type=\"button\" (click)=\"showSignIn()\" mat-raised-button color=\"primary\">{{signInLabel}}</button>\r\n </ng-container>\r\n <ng-container *ngIf=\"user\">\r\n <button *ngIf=\"canChat\" [disabled]=\"!newMessage.message\" mat-raised-button color=\"primary\">{{sendLabel}}</button>\r\n <button *ngIf=\"!canChat\" type=\"button\" (click)=\"sendPermissionError()\" mat-raised-button color=\"primary\">{{permissionDeniedLabel}}</button>\r\n </ng-container>\r\n </div>\r\n</form>",
|
|
7628
7664
|
styles: [":host{display:flex;flex-direction:column;border-radius:5px;padding:10px;flex-grow:1;font-size:10pt}.entry-container{display:flex;flex-direction:row;flex-grow:1;position:relative}.entry-container emoji-selector-button{position:absolute;right:0;top:.15em}.entry-container input{height:2.6em;font-size:12pt;padding-left:1em}.entry-container input:-webkit-autofill,.entry-container input:-webkit-autofill:focus,.entry-container input:-webkit-autofill:hover{outline:#9da302 solid 1px;-webkit-text-fill-color:#9da302;-webkit-box-shadow:0 0 0 1000px #211e07 inset;-webkit-transition:background-color 5000s ease-in-out;transition:background-color 5000s ease-in-out;caret-color:#9da302}.entry-container emoji-selector-panel{pointer-events:none;opacity:0;position:absolute;bottom:3.5em;right:0}.entry-container emoji-selector-panel.visible{opacity:1;pointer-events:initial}form{display:flex;padding:.5em 0;align-items:center}form textarea{font-size:14pt;background:#000;color:#fff;border:1px solid #333;min-height:6em;width:100%}form input[type=text]{background:#fff;color:#000;border:1px solid #ccc;width:100%;height:2.5em}form .actions{margin-left:1em}form button{display:block;margin:0 0 0 auto}:host-context(.mat-dark-theme) form input[type=text]{background:#000;color:#fff;border:1px solid #333}"]
|
|
7629
7665
|
}),
|
|
7630
7666
|
__metadata("design:paramtypes", [BantaService,
|
|
7631
7667
|
ChatBackendService,
|
|
7632
7668
|
core.ElementRef])
|
|
7633
|
-
],
|
|
7634
|
-
return
|
|
7669
|
+
], BantaChatComponent);
|
|
7670
|
+
return BantaChatComponent;
|
|
7635
7671
|
}());
|
|
7636
7672
|
|
|
7637
7673
|
var COMPONENTS$2 = [
|
|
7638
7674
|
ChatMessageComponent,
|
|
7639
7675
|
LiveChatMessageComponent,
|
|
7640
7676
|
ChatViewComponent,
|
|
7641
|
-
|
|
7677
|
+
BantaChatComponent
|
|
7642
7678
|
];
|
|
7643
7679
|
var ChatModule = /** @class */ (function () {
|
|
7644
7680
|
function ChatModule() {
|
|
@@ -7659,356 +7695,11 @@
|
|
|
7659
7695
|
return ChatModule;
|
|
7660
7696
|
}());
|
|
7661
7697
|
|
|
7662
|
-
|
|
7663
|
-
|
|
7664
|
-
|
|
7665
|
-
|
|
7666
|
-
|
|
7667
|
-
displayName: "Tom",
|
|
7668
|
-
username: "tom"
|
|
7669
|
-
}, {
|
|
7670
|
-
id: 'b',
|
|
7671
|
-
avatarUrl: GENERIC_AVATAR_URL,
|
|
7672
|
-
displayName: "Dick",
|
|
7673
|
-
username: "dick"
|
|
7674
|
-
}, {
|
|
7675
|
-
id: 'c',
|
|
7676
|
-
avatarUrl: GENERIC_AVATAR_URL,
|
|
7677
|
-
displayName: "Harry",
|
|
7678
|
-
username: "harry"
|
|
7679
|
-
}, {
|
|
7680
|
-
id: 'd',
|
|
7681
|
-
avatarUrl: GENERIC_AVATAR_URL,
|
|
7682
|
-
displayName: "John",
|
|
7683
|
-
username: "john"
|
|
7684
|
-
}, {
|
|
7685
|
-
id: 'e',
|
|
7686
|
-
avatarUrl: GENERIC_AVATAR_URL,
|
|
7687
|
-
displayName: "Wayne",
|
|
7688
|
-
username: "wayne"
|
|
7689
|
-
}, {
|
|
7690
|
-
id: 'f',
|
|
7691
|
-
avatarUrl: GENERIC_AVATAR_URL,
|
|
7692
|
-
displayName: "Heather",
|
|
7693
|
-
username: "heather"
|
|
7694
|
-
}, {
|
|
7695
|
-
id: 'g',
|
|
7696
|
-
avatarUrl: GENERIC_AVATAR_URL,
|
|
7697
|
-
displayName: "Mary",
|
|
7698
|
-
username: "mary"
|
|
7699
|
-
}, {
|
|
7700
|
-
id: 'h',
|
|
7701
|
-
avatarUrl: GENERIC_AVATAR_URL,
|
|
7702
|
-
displayName: "Jennifer",
|
|
7703
|
-
username: "jennifer"
|
|
7704
|
-
}, {
|
|
7705
|
-
id: 'i',
|
|
7706
|
-
avatarUrl: GENERIC_AVATAR_URL,
|
|
7707
|
-
displayName: "Kyle",
|
|
7708
|
-
username: "kyle"
|
|
7709
|
-
}, {
|
|
7710
|
-
id: 'j',
|
|
7711
|
-
avatarUrl: GENERIC_AVATAR_URL,
|
|
7712
|
-
displayName: "Wanda",
|
|
7713
|
-
username: "wanda"
|
|
7714
|
-
}, {
|
|
7715
|
-
id: 'k',
|
|
7716
|
-
avatarUrl: GENERIC_AVATAR_URL,
|
|
7717
|
-
displayName: "Josh",
|
|
7718
|
-
username: "josh"
|
|
7719
|
-
}, {
|
|
7720
|
-
id: 'l',
|
|
7721
|
-
avatarUrl: GENERIC_AVATAR_URL,
|
|
7722
|
-
displayName: "Jane",
|
|
7723
|
-
username: "jane"
|
|
7724
|
-
}, {
|
|
7725
|
-
id: 'm',
|
|
7726
|
-
avatarUrl: GENERIC_AVATAR_URL,
|
|
7727
|
-
displayName: "Joy",
|
|
7728
|
-
username: "joy"
|
|
7729
|
-
}, {
|
|
7730
|
-
id: 'n',
|
|
7731
|
-
avatarUrl: GENERIC_AVATAR_URL,
|
|
7732
|
-
displayName: "Jesus",
|
|
7733
|
-
username: "jesus"
|
|
7734
|
-
}, {
|
|
7735
|
-
id: 'o',
|
|
7736
|
-
avatarUrl: GENERIC_AVATAR_URL,
|
|
7737
|
-
displayName: "I bathe in Bernie's tears of joy",
|
|
7738
|
-
username: "landem"
|
|
7739
|
-
}, {
|
|
7740
|
-
id: 'p',
|
|
7741
|
-
avatarUrl: GENERIC_AVATAR_URL,
|
|
7742
|
-
displayName: "The thing about socialism is that its the best",
|
|
7743
|
-
username: "mangahead"
|
|
7744
|
-
}, {
|
|
7745
|
-
id: 'q',
|
|
7746
|
-
avatarUrl: GENERIC_AVATAR_URL,
|
|
7747
|
-
displayName: "If only I knew the first thing about this stuff",
|
|
7748
|
-
username: "redstripe"
|
|
7749
|
-
}, {
|
|
7750
|
-
id: 'r',
|
|
7751
|
-
avatarUrl: GENERIC_AVATAR_URL,
|
|
7752
|
-
displayName: "Time is not something that should be treated unfairly",
|
|
7753
|
-
username: "fantom"
|
|
7754
|
-
}, {
|
|
7755
|
-
id: 's',
|
|
7756
|
-
avatarUrl: GENERIC_AVATAR_URL,
|
|
7757
|
-
displayName: "What is the meaning of this capitalism?",
|
|
7758
|
-
username: "ganjaking"
|
|
7759
|
-
}, {
|
|
7760
|
-
id: 't',
|
|
7761
|
-
avatarUrl: GENERIC_AVATAR_URL,
|
|
7762
|
-
displayName: "The world is not ready for us",
|
|
7763
|
-
username: "leggo"
|
|
7764
|
-
}, {
|
|
7765
|
-
id: 'u',
|
|
7766
|
-
avatarUrl: GENERIC_AVATAR_URL,
|
|
7767
|
-
displayName: "Make or break, now is our time",
|
|
7768
|
-
username: "mako"
|
|
7769
|
-
}
|
|
7770
|
-
];
|
|
7771
|
-
var MockFirehoseSource = /** @class */ (function () {
|
|
7772
|
-
function MockFirehoseSource() {
|
|
7773
|
-
var _this = this;
|
|
7774
|
-
this.identifier = 'mock';
|
|
7775
|
-
this.currentUser = {
|
|
7776
|
-
id: 'z',
|
|
7777
|
-
username: 'liam',
|
|
7778
|
-
displayName: 'Liam',
|
|
7779
|
-
avatarUrl: GENERIC_AVATAR_URL
|
|
7780
|
-
};
|
|
7781
|
-
this._messages = [];
|
|
7782
|
-
this._currentUserChanged = new rxjs.BehaviorSubject(null);
|
|
7783
|
-
this._messageReceived = new rxjs.Subject();
|
|
7784
|
-
this._messageSent = new rxjs.Subject();
|
|
7785
|
-
var randomMessages = [
|
|
7786
|
-
"Whoa!",
|
|
7787
|
-
"Cool!",
|
|
7788
|
-
"Nifty!",
|
|
7789
|
-
"Sweet!",
|
|
7790
|
-
"@liam, awesome!",
|
|
7791
|
-
"Crazy!",
|
|
7792
|
-
"Wunderbar!",
|
|
7793
|
-
"Lasagna!",
|
|
7794
|
-
"Tacos!",
|
|
7795
|
-
"@liam, Life is a box of chocolates, you never know which one... oh fuck it",
|
|
7796
|
-
"Lorem ipsum dolor sit amet! Lorem ipsum dolor sit amet! LOREM IPSUM DOLOR SIT AMET GDI!",
|
|
7797
|
-
"Lorem ipsum dolor sit amet! Lorem ipsum dolor sit amet! LOREM IPSUM DOLOR SIT AMET GDI! The orange one makes me dislike oranges. Orange orangutan is obsolete and unoriginal! Monkeys and such. Life is a box of chocolates, you never know which one... oh fuck it. Lorem ipsum dolor sit amet! Lorem ipsum dolor sit amet! LOREM IPSUM DOLOR SIT AMET GDI!",
|
|
7798
|
-
"The orange one makes me dislike oranges. Orange orangutan is obsolete and unoriginal! Monkeys and such."
|
|
7799
|
-
];
|
|
7800
|
-
setInterval(function () {
|
|
7801
|
-
var messageText = randomMessages[Math.floor(randomMessages.length * Math.random())];
|
|
7802
|
-
var user = MOCK_USERS[Math.floor(MOCK_USERS.length * Math.random())];
|
|
7803
|
-
var message = {
|
|
7804
|
-
user: user,
|
|
7805
|
-
sentAt: Date.now(),
|
|
7806
|
-
upvotes: 0,
|
|
7807
|
-
message: messageText,
|
|
7808
|
-
submessages: []
|
|
7809
|
-
};
|
|
7810
|
-
_this.addMessage(message);
|
|
7811
|
-
_this.messageReceived.next(message);
|
|
7812
|
-
}, 1000);
|
|
7813
|
-
this._currentUserChanged.next(this.currentUser);
|
|
7814
|
-
}
|
|
7815
|
-
MockFirehoseSource.prototype.close = function () {
|
|
7816
|
-
// TODO
|
|
7817
|
-
};
|
|
7818
|
-
MockFirehoseSource.prototype.addMessage = function (message) {
|
|
7819
|
-
this._messages.push(message);
|
|
7820
|
-
};
|
|
7821
|
-
MockFirehoseSource.prototype.send = function (message) {
|
|
7822
|
-
this.addMessage(message);
|
|
7823
|
-
this._messageSent.next(message);
|
|
7824
|
-
};
|
|
7825
|
-
Object.defineProperty(MockFirehoseSource.prototype, "messages", {
|
|
7826
|
-
get: function () {
|
|
7827
|
-
return this._messages;
|
|
7828
|
-
},
|
|
7829
|
-
enumerable: true,
|
|
7830
|
-
configurable: true
|
|
7831
|
-
});
|
|
7832
|
-
Object.defineProperty(MockFirehoseSource.prototype, "currentUserChanged", {
|
|
7833
|
-
get: function () {
|
|
7834
|
-
return this._currentUserChanged;
|
|
7835
|
-
},
|
|
7836
|
-
enumerable: true,
|
|
7837
|
-
configurable: true
|
|
7838
|
-
});
|
|
7839
|
-
Object.defineProperty(MockFirehoseSource.prototype, "messageReceived", {
|
|
7840
|
-
get: function () {
|
|
7841
|
-
return this._messageReceived;
|
|
7842
|
-
},
|
|
7843
|
-
enumerable: true,
|
|
7844
|
-
configurable: true
|
|
7845
|
-
});
|
|
7846
|
-
Object.defineProperty(MockFirehoseSource.prototype, "messageSent", {
|
|
7847
|
-
get: function () {
|
|
7848
|
-
return this._messageSent;
|
|
7849
|
-
},
|
|
7850
|
-
enumerable: true,
|
|
7851
|
-
configurable: true
|
|
7852
|
-
});
|
|
7853
|
-
return MockFirehoseSource;
|
|
7854
|
-
}());
|
|
7855
|
-
var MockPointSource = /** @class */ (function () {
|
|
7856
|
-
function MockPointSource() {
|
|
7857
|
-
var _this = this;
|
|
7858
|
-
this.identifier = 'mock-point';
|
|
7859
|
-
this.currentUser = {
|
|
7860
|
-
id: 'z',
|
|
7861
|
-
username: 'liam',
|
|
7862
|
-
displayName: 'Liam',
|
|
7863
|
-
avatarUrl: GENERIC_AVATAR_URL
|
|
7864
|
-
};
|
|
7865
|
-
this._messages = [];
|
|
7866
|
-
this._currentUserChanged = new rxjs.BehaviorSubject(null);
|
|
7867
|
-
this._messageReceived = new rxjs.Subject();
|
|
7868
|
-
this._messageSent = new rxjs.Subject();
|
|
7869
|
-
var randomPoints = [
|
|
7870
|
-
"I think that Trump has a specific form of braindead called\n \"Trumpitis\".",
|
|
7871
|
-
"Other things that could be said will be said",
|
|
7872
|
-
"If only things were as simple as they appear",
|
|
7873
|
-
"Life is a box of chocolates, you never know which one... oh fuck it",
|
|
7874
|
-
"More things that are done tomorrow may not be done today",
|
|
7875
|
-
"Google is a useful tool to find things",
|
|
7876
|
-
"Lorem ipsum dolor sit amet! Lorem ipsum dolor sit amet! LOREM IPSUM DOLOR SIT AMET GDI! The orange one makes me dislike oranges. Orange orangutan is obsolete and unoriginal! Monkeys and such. Life is a box of chocolates, you never know which one... oh fuck it. Lorem ipsum dolor sit amet! Lorem ipsum dolor sit amet! LOREM IPSUM DOLOR SIT AMET GDI! Lorem ipsum dolor sit amet! Lorem ipsum dolor sit amet! LOREM IPSUM DOLOR SIT AMET GDI! The orange one makes me dislike oranges. Orange orangutan is obsolete and unoriginal! Monkeys and such. Life is a box of chocolates, you never know which one... oh fuck it. Lorem ipsum dolor sit amet! Lorem ipsum dolor sit amet! LOREM IPSUM DOLOR SIT AMET GDI! Lorem ipsum dolor sit amet! Lorem ipsum dolor sit amet! LOREM IPSUM DOLOR SIT AMET GDI! The orange one makes me dislike oranges. Orange orangutan is obsolete and unoriginal! Monkeys and such. Life is a box of chocolates, you never know which one... oh fuck it. Lorem ipsum dolor sit amet! Lorem ipsum dolor sit amet! LOREM IPSUM DOLOR SIT AMET GDI! Lorem ipsum dolor sit amet! Lorem ipsum dolor sit amet! LOREM IPSUM DOLOR SIT AMET GDI! The orange one makes me dislike oranges. Orange orangutan is obsolete and unoriginal! Monkeys and such. Life is a box of chocolates, you never know which one... oh fuck it. Lorem ipsum dolor sit amet! Lorem ipsum dolor sit amet! LOREM IPSUM DOLOR SIT AMET GDI!"
|
|
7877
|
-
];
|
|
7878
|
-
setInterval(function () {
|
|
7879
|
-
var messageText = randomPoints[Math.floor(randomPoints.length * Math.random())];
|
|
7880
|
-
var user = MOCK_USERS[Math.floor(MOCK_USERS.length * Math.random())];
|
|
7881
|
-
var message = {
|
|
7882
|
-
user: user,
|
|
7883
|
-
sentAt: Date.now(),
|
|
7884
|
-
upvotes: 0,
|
|
7885
|
-
message: messageText,
|
|
7886
|
-
submessages: [
|
|
7887
|
-
{
|
|
7888
|
-
user: _this.currentUser,
|
|
7889
|
-
message: "Good point!",
|
|
7890
|
-
sentAt: Date.now(),
|
|
7891
|
-
upvotes: 0
|
|
7892
|
-
},
|
|
7893
|
-
{
|
|
7894
|
-
user: {
|
|
7895
|
-
id: 'aa',
|
|
7896
|
-
avatarUrl: GENERIC_AVATAR_URL,
|
|
7897
|
-
displayName: 'FunnilyGuy',
|
|
7898
|
-
username: 'funnyguy'
|
|
7899
|
-
},
|
|
7900
|
-
sentAt: Date.now(),
|
|
7901
|
-
message: "What would this mean for Buttigieg?",
|
|
7902
|
-
upvotes: 0
|
|
7903
|
-
},
|
|
7904
|
-
{
|
|
7905
|
-
user: user,
|
|
7906
|
-
sentAt: Date.now(),
|
|
7907
|
-
message: "Klobucharino",
|
|
7908
|
-
upvotes: 0
|
|
7909
|
-
},
|
|
7910
|
-
{
|
|
7911
|
-
user: _this.currentUser,
|
|
7912
|
-
sentAt: Date.now(),
|
|
7913
|
-
message: "Good question!",
|
|
7914
|
-
upvotes: 0
|
|
7915
|
-
},
|
|
7916
|
-
{
|
|
7917
|
-
user: user,
|
|
7918
|
-
sentAt: Date.now(),
|
|
7919
|
-
message: "But whyigieg",
|
|
7920
|
-
upvotes: 0
|
|
7921
|
-
}
|
|
7922
|
-
]
|
|
7923
|
-
};
|
|
7924
|
-
_this.addMessage(message);
|
|
7925
|
-
_this.messageReceived.next(message);
|
|
7926
|
-
}, 5000);
|
|
7927
|
-
this._currentUserChanged.next(this.currentUser);
|
|
7928
|
-
}
|
|
7929
|
-
MockPointSource.prototype.addMessage = function (message) {
|
|
7930
|
-
this._messages.push(message);
|
|
7931
|
-
};
|
|
7932
|
-
Object.defineProperty(MockPointSource.prototype, "messages", {
|
|
7933
|
-
get: function () {
|
|
7934
|
-
return this._messages;
|
|
7935
|
-
},
|
|
7936
|
-
enumerable: true,
|
|
7937
|
-
configurable: true
|
|
7938
|
-
});
|
|
7939
|
-
Object.defineProperty(MockPointSource.prototype, "currentUserChanged", {
|
|
7940
|
-
get: function () {
|
|
7941
|
-
return this._currentUserChanged;
|
|
7942
|
-
},
|
|
7943
|
-
enumerable: true,
|
|
7944
|
-
configurable: true
|
|
7945
|
-
});
|
|
7946
|
-
Object.defineProperty(MockPointSource.prototype, "messageReceived", {
|
|
7947
|
-
get: function () {
|
|
7948
|
-
return this._messageReceived;
|
|
7949
|
-
},
|
|
7950
|
-
enumerable: true,
|
|
7951
|
-
configurable: true
|
|
7952
|
-
});
|
|
7953
|
-
Object.defineProperty(MockPointSource.prototype, "messageSent", {
|
|
7954
|
-
get: function () {
|
|
7955
|
-
return this._messageSent;
|
|
7956
|
-
},
|
|
7957
|
-
enumerable: true,
|
|
7958
|
-
configurable: true
|
|
7959
|
-
});
|
|
7960
|
-
MockPointSource.prototype.send = function (message) {
|
|
7961
|
-
this.addMessage(message);
|
|
7962
|
-
this._messageSent.next(message);
|
|
7963
|
-
};
|
|
7964
|
-
return MockPointSource;
|
|
7965
|
-
}());
|
|
7966
|
-
var MockSubpointSource = /** @class */ (function () {
|
|
7967
|
-
function MockSubpointSource(parentSource, message) {
|
|
7968
|
-
this.parentSource = parentSource;
|
|
7969
|
-
this.message = message;
|
|
7970
|
-
this.identifier = 'mock-subpoint';
|
|
7971
|
-
this._messages = [];
|
|
7972
|
-
this._messageReceived = new rxjs.Subject();
|
|
7973
|
-
this._messageSent = new rxjs.Subject();
|
|
7974
|
-
this._currentUserChanged = parentSource.currentUserChanged;
|
|
7975
|
-
this._messages = message.submessages;
|
|
7976
|
-
}
|
|
7977
|
-
Object.defineProperty(MockSubpointSource.prototype, "messages", {
|
|
7978
|
-
get: function () {
|
|
7979
|
-
return this._messages;
|
|
7980
|
-
},
|
|
7981
|
-
enumerable: true,
|
|
7982
|
-
configurable: true
|
|
7983
|
-
});
|
|
7984
|
-
Object.defineProperty(MockSubpointSource.prototype, "messageReceived", {
|
|
7985
|
-
get: function () {
|
|
7986
|
-
return this._messageReceived;
|
|
7987
|
-
},
|
|
7988
|
-
enumerable: true,
|
|
7989
|
-
configurable: true
|
|
7990
|
-
});
|
|
7991
|
-
Object.defineProperty(MockSubpointSource.prototype, "messageSent", {
|
|
7992
|
-
get: function () {
|
|
7993
|
-
return this._messageSent;
|
|
7994
|
-
},
|
|
7995
|
-
enumerable: true,
|
|
7996
|
-
configurable: true
|
|
7997
|
-
});
|
|
7998
|
-
Object.defineProperty(MockSubpointSource.prototype, "currentUserChanged", {
|
|
7999
|
-
get: function () {
|
|
8000
|
-
return this._currentUserChanged;
|
|
8001
|
-
},
|
|
8002
|
-
enumerable: true,
|
|
8003
|
-
configurable: true
|
|
8004
|
-
});
|
|
8005
|
-
MockSubpointSource.prototype.send = function (message) {
|
|
8006
|
-
//throw new Error("Method not implemented.");
|
|
8007
|
-
};
|
|
8008
|
-
return MockSubpointSource;
|
|
8009
|
-
}());
|
|
8010
|
-
var EngageComponent = /** @class */ (function () {
|
|
8011
|
-
function EngageComponent(banta, backend, matDialog) {
|
|
7698
|
+
/**
|
|
7699
|
+
* Unified chat and comments component
|
|
7700
|
+
*/
|
|
7701
|
+
var BantaComponent = /** @class */ (function () {
|
|
7702
|
+
function BantaComponent(banta, backend, matDialog) {
|
|
8012
7703
|
this.banta = banta;
|
|
8013
7704
|
this.backend = backend;
|
|
8014
7705
|
this.matDialog = matDialog;
|
|
@@ -8026,16 +7717,16 @@
|
|
|
8026
7717
|
// this.firehoseSource = new MockFirehoseSource();
|
|
8027
7718
|
// this.pointSource = new MockPointSource();
|
|
8028
7719
|
}
|
|
8029
|
-
|
|
7720
|
+
BantaComponent.prototype.ngOnInit = function () {
|
|
8030
7721
|
var _this = this;
|
|
8031
7722
|
this._subs.add(this.banta.userChanged.subscribe(function (user) { return _this.currentUser = user; }), this.backend.notificationsChanged.subscribe(function (notifs) { return _this.notifications = notifs; }), this.backend.newNotification.subscribe(function (notif) {
|
|
8032
7723
|
_this.newNotifications = true;
|
|
8033
7724
|
}));
|
|
8034
7725
|
};
|
|
8035
|
-
|
|
7726
|
+
BantaComponent.prototype.newPointSubMessageKeyDown = function (event) {
|
|
8036
7727
|
// TODO
|
|
8037
7728
|
};
|
|
8038
|
-
|
|
7729
|
+
BantaComponent.prototype.sendPointSubMessage = function () {
|
|
8039
7730
|
return __awaiter(this, void 0, void 0, function () {
|
|
8040
7731
|
var text, message, e_1;
|
|
8041
7732
|
return __generator(this, function (_a) {
|
|
@@ -8068,7 +7759,7 @@
|
|
|
8068
7759
|
});
|
|
8069
7760
|
});
|
|
8070
7761
|
};
|
|
8071
|
-
|
|
7762
|
+
BantaComponent.prototype.goToMessage = function (message) {
|
|
8072
7763
|
return __awaiter(this, void 0, void 0, function () {
|
|
8073
7764
|
var targetMessage, parentMessage, viewType, _a, _b;
|
|
8074
7765
|
return __generator(this, function (_c) {
|
|
@@ -8118,7 +7809,7 @@
|
|
|
8118
7809
|
});
|
|
8119
7810
|
});
|
|
8120
7811
|
};
|
|
8121
|
-
|
|
7812
|
+
BantaComponent.prototype.pointUnfocus = function () {
|
|
8122
7813
|
this.pointOpen = null;
|
|
8123
7814
|
if (this.pointSubChat) {
|
|
8124
7815
|
if (this.pointSubChat.close)
|
|
@@ -8126,19 +7817,19 @@
|
|
|
8126
7817
|
this.pointSubChat = null;
|
|
8127
7818
|
}
|
|
8128
7819
|
};
|
|
8129
|
-
|
|
7820
|
+
BantaComponent.prototype.ngOnDestroy = function () {
|
|
8130
7821
|
this._subs.unsubscribe();
|
|
8131
7822
|
};
|
|
8132
|
-
|
|
7823
|
+
BantaComponent.prototype.showAux = function (title, mode) {
|
|
8133
7824
|
this.auxOpen = true;
|
|
8134
7825
|
this.auxTitle = title;
|
|
8135
7826
|
this.auxMode = mode;
|
|
8136
7827
|
this.mobileFocus = 'aux';
|
|
8137
7828
|
};
|
|
8138
|
-
|
|
7829
|
+
BantaComponent.prototype.showNotifications = function () {
|
|
8139
7830
|
this.showAux('Notifications', 'notifications');
|
|
8140
7831
|
};
|
|
8141
|
-
Object.defineProperty(
|
|
7832
|
+
Object.defineProperty(BantaComponent.prototype, "topicID", {
|
|
8142
7833
|
get: function () {
|
|
8143
7834
|
return this._topicID;
|
|
8144
7835
|
},
|
|
@@ -8150,7 +7841,7 @@
|
|
|
8150
7841
|
enumerable: true,
|
|
8151
7842
|
configurable: true
|
|
8152
7843
|
});
|
|
8153
|
-
|
|
7844
|
+
BantaComponent.prototype.connectToTopic = function (id) {
|
|
8154
7845
|
return __awaiter(this, void 0, void 0, function () {
|
|
8155
7846
|
var _a, _b;
|
|
8156
7847
|
return __generator(this, function (_c) {
|
|
@@ -8169,17 +7860,17 @@
|
|
|
8169
7860
|
});
|
|
8170
7861
|
});
|
|
8171
7862
|
};
|
|
8172
|
-
Object.defineProperty(
|
|
7863
|
+
Object.defineProperty(BantaComponent.prototype, "signInSelected", {
|
|
8173
7864
|
get: function () {
|
|
8174
7865
|
return this._signInSelected;
|
|
8175
7866
|
},
|
|
8176
7867
|
enumerable: true,
|
|
8177
7868
|
configurable: true
|
|
8178
7869
|
});
|
|
8179
|
-
|
|
7870
|
+
BantaComponent.prototype.showSignIn = function () {
|
|
8180
7871
|
this._signInSelected.next();
|
|
8181
7872
|
};
|
|
8182
|
-
|
|
7873
|
+
BantaComponent.prototype.close = function () {
|
|
8183
7874
|
if (this.firehoseSource) {
|
|
8184
7875
|
if (this.firehoseSource.close)
|
|
8185
7876
|
this.firehoseSource.close();
|
|
@@ -8191,25 +7882,25 @@
|
|
|
8191
7882
|
this.pointSource = null;
|
|
8192
7883
|
}
|
|
8193
7884
|
};
|
|
8194
|
-
Object.defineProperty(
|
|
7885
|
+
Object.defineProperty(BantaComponent.prototype, "hasPoint", {
|
|
8195
7886
|
get: function () {
|
|
8196
7887
|
return this.pointOpen != null;
|
|
8197
7888
|
},
|
|
8198
7889
|
enumerable: true,
|
|
8199
7890
|
configurable: true
|
|
8200
7891
|
});
|
|
8201
|
-
|
|
7892
|
+
BantaComponent.prototype.closeAux = function () {
|
|
8202
7893
|
this.auxOpen = false;
|
|
8203
7894
|
this.mobileFocus = 'firehose';
|
|
8204
7895
|
};
|
|
8205
|
-
|
|
7896
|
+
BantaComponent.prototype.getViewType = function (message) {
|
|
8206
7897
|
if (message.topicId.endsWith('_firehose'))
|
|
8207
7898
|
return 'chat';
|
|
8208
7899
|
else if (message.topicId.endsWith('_thepoint'))
|
|
8209
7900
|
return 'comment';
|
|
8210
7901
|
return 'comment';
|
|
8211
7902
|
};
|
|
8212
|
-
|
|
7903
|
+
BantaComponent.prototype.upvoteMessage = function (message) {
|
|
8213
7904
|
return __awaiter(this, void 0, void 0, function () {
|
|
8214
7905
|
return __generator(this, function (_a) {
|
|
8215
7906
|
switch (_a.label) {
|
|
@@ -8228,66 +7919,66 @@
|
|
|
8228
7919
|
});
|
|
8229
7920
|
});
|
|
8230
7921
|
};
|
|
8231
|
-
|
|
7922
|
+
BantaComponent.prototype.showProfile = function (user) {
|
|
8232
7923
|
this.profileUser = user;
|
|
8233
7924
|
this.showAux("@" + user.username + "'s Profile", 'profile');
|
|
8234
7925
|
};
|
|
8235
|
-
|
|
7926
|
+
BantaComponent.prototype.sendReport = function (message) {
|
|
8236
7927
|
this.auxOpen = false;
|
|
8237
7928
|
alert('would send report');
|
|
8238
7929
|
};
|
|
8239
|
-
|
|
7930
|
+
BantaComponent.prototype.reportMessage = function (message) {
|
|
8240
7931
|
this.reportedMessage = message;
|
|
8241
7932
|
this.showAux("Report message from @" + message.user.username, 'report');
|
|
8242
7933
|
};
|
|
8243
|
-
|
|
7934
|
+
BantaComponent.ctorParameters = function () { return [
|
|
8244
7935
|
{ type: BantaService },
|
|
8245
7936
|
{ type: ChatBackendService },
|
|
8246
7937
|
{ type: dialog.MatDialog }
|
|
8247
7938
|
]; };
|
|
8248
7939
|
__decorate([
|
|
8249
7940
|
core.ViewChild('firehose', { static: true }),
|
|
8250
|
-
__metadata("design:type",
|
|
8251
|
-
],
|
|
7941
|
+
__metadata("design:type", BantaChatComponent)
|
|
7942
|
+
], BantaComponent.prototype, "firehose", void 0);
|
|
8252
7943
|
__decorate([
|
|
8253
7944
|
core.Input(),
|
|
8254
7945
|
__metadata("design:type", String),
|
|
8255
7946
|
__metadata("design:paramtypes", [Object])
|
|
8256
|
-
],
|
|
7947
|
+
], BantaComponent.prototype, "topicID", null);
|
|
8257
7948
|
__decorate([
|
|
8258
7949
|
core.Output(),
|
|
8259
7950
|
__metadata("design:type", rxjs.Observable),
|
|
8260
7951
|
__metadata("design:paramtypes", [])
|
|
8261
|
-
],
|
|
7952
|
+
], BantaComponent.prototype, "signInSelected", null);
|
|
8262
7953
|
__decorate([
|
|
8263
7954
|
core.HostBinding('class.point-focus'),
|
|
8264
7955
|
__metadata("design:type", Object),
|
|
8265
7956
|
__metadata("design:paramtypes", [])
|
|
8266
|
-
],
|
|
8267
|
-
|
|
7957
|
+
], BantaComponent.prototype, "hasPoint", null);
|
|
7958
|
+
BantaComponent = __decorate([
|
|
8268
7959
|
core.Component({
|
|
8269
|
-
selector: "
|
|
8270
|
-
template: "\r\n<mat-menu #userMenu=\"matMenu\">\r\n <ng-container *ngIf=\"currentUser\">\r\n <button [disabled]=\"true\" mat-menu-item>{{currentUser.displayName}} (@{{currentUser.username}})</button>\r\n <button mat-menu-item (click)=\"signOut()\">Sign Out</button>\r\n </ng-container>\r\n <ng-container *ngIf=\"!currentUser\">\r\n <button mat-menu-item>Sign In</button>\r\n </ng-container>\r\n <button mat-menu-item>Help</button>\r\n</mat-menu>\r\n\r\n<div class=\"tabs\">\r\n <div>\r\n <a mat-button (click)=\"mobileFocus = 'firehose'\">Firehose</a>\r\n <a mat-button (click)=\"mobileFocus = 'points'\">The Point</a>\r\n </div>\r\n <div class=\"spacer\"></div>\r\n <div>\r\n <ng-container *ngIf=\"currentUser\">\r\n <button mat-button [matMenuTriggerFor]=\"userMenu\">\r\n @{{currentUser.username}}\r\n </button>\r\n <button mat-icon-button (click)=\"showNotifications()\">\r\n <mat-icon>notification_important</mat-icon>\r\n </button>\r\n </ng-container>\r\n \r\n <button mat-button *ngIf=\"!currentUser\" (click)=\"showSignIn()\">\r\n Sign In\r\n </button>\r\n </div>\r\n</div>\r\n\r\n<div class=\"firehose\" [class.focus]=\"mobileFocus === 'firehose'\">\r\n <header>\r\n <div>\r\n <label (click)=\"mobileFocus = 'firehose'\">Firehose</label>\r\n <div class=\"spacer\"></div>\r\n\r\n <ng-container *ngIf=\"currentUser\">\r\n <button mat-button [matMenuTriggerFor]=\"userMenu\">\r\n @{{currentUser.username}}\r\n </button>\r\n <button mat-icon-button (click)=\"showNotifications()\">\r\n <mat-icon>notification_important</mat-icon>\r\n </button>\r\n </ng-container>\r\n \r\n <button mat-button *ngIf=\"!currentUser\" (click)=\"showSignIn()\">\r\n Sign In\r\n </button>\r\n </div>\r\n </header>\r\n <engage-firehose \r\n #firehose\r\n [source]=\"firehoseSource\"\r\n (signInSelected)=\"showSignIn()\"\r\n (upvoted)=\"upvoteMessage($event)\"\r\n (userSelected)=\"showProfile($event.user)\"\r\n (reported)=\"reportMessage($event)\"\r\n ></engage-firehose>\r\n</div>\r\n\r\n<div class=\"aux\" [class.focus]=\"mobileFocus === 'aux'\" [class.open]=\"auxOpen\">\r\n <header>\r\n <div>\r\n <label>{{auxTitle}}</label>\r\n <div class=\"spacer\"></div>\r\n <button mat-icon-button (click)=\"auxOpen = false\">\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n </div>\r\n </header>\r\n <div class=\"aux-contents\">\r\n <ng-container *ngIf=\"auxMode === 'profile'\">\r\n <ng-container *ngIf=\"profileUser\">\r\n\r\n <div>\r\n <strong style=\"font-size: 125%;\">\r\n {{profileUser.displayName}}\r\n </strong>\r\n @{{profileUser.username}}\r\n </div>\r\n\r\n <br/>\r\n <strong>Top Messages</strong>\r\n\r\n <div>\r\n <em>Not yet available</em>\r\n </div>\r\n\r\n <br/>\r\n <strong>Recent Messages</strong>\r\n\r\n <div>\r\n <em>Not yet available</em>\r\n </div>\r\n\r\n <pre>{{profileUser | json}}</pre>\r\n </ng-container>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"auxMode === 'report'\">\r\n <p>Are you sure you want to report this message?</p>\r\n\r\n <engage-live-message [message]=\"reportedMessage\"></engage-live-message>\r\n\r\n <div style=\"text-align: center;\">\r\n <button mat-raised-button color=\"primary\" (click)=\"sendReport(reportedMessage)\">Yes, Report</button>\r\n \r\n <button mat-raised-button color=\"secondary\" (click)=\"auxOpen = false\">No, Cancel</button>\r\n </div>\r\n\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"auxMode === 'notifications'\">\r\n\r\n <div *ngIf=\"!notifications || notifications.length === 0\">\r\n <em>You do not have any notifications yet</em>\r\n </div>\r\n \r\n <div class=\"notifications\">\r\n <div class=\"notification\" *ngFor=\"let notif of notifications\">\r\n <div>\r\n <ng-container *ngIf=\"notif.type === 'upvote'\">\r\n @{{notif.message?.user?.username}} upvoted your post\r\n \r\n <engage-live-message\r\n [message]=\"notif.message\"\r\n (upvoted)=\"upvoteMessage(notif.message)\"\r\n (reported)=\"reportMessage(notif.message)\"\r\n (selected)=\"goToMessage(notif.message)\">\r\n </engage-live-message>\r\n\r\n </ng-container>\r\n <ng-container *ngIf=\"notif.type === 'notice'\">\r\n <div>\r\n {{notif.message}}\r\n </div>\r\n <a mat-button target=\"_blank\" href=\"{{notif.actionUrl}}\">\r\n {{notif.actionLabel}}\r\n </a>\r\n </ng-container>\r\n <ng-container *ngIf=\"notif.type === 'mention'\">\r\n You were mentioned by @{{notif.message?.user?.username}}\r\n\r\n <engage-live-message\r\n [message]=\"notif.message\"\r\n (upvoted)=\"upvoteMessage(notif.message)\"\r\n (reported)=\"reportMessage(notif.message)\"\r\n (selected)=\"goToMessage(notif.message)\">\r\n </engage-live-message>\r\n\r\n </ng-container>\r\n <ng-container *ngIf=\"notif.type === 'reply'\">\r\n @{{notif.replyMessage?.user?.username}} replied to your post\r\n \r\n <engage-live-message\r\n [message]=\"notif.replyMessage\"\r\n (upvoted)=\"upvoteMessage(notif.replyMessage)\"\r\n (reported)=\"reportMessage(notif.replyMessage)\"\r\n (selected)=\"goToMessage(notif.replyMessage)\">\r\n </engage-live-message>\r\n </ng-container>\r\n </div>\r\n\r\n <engage-timestamp [value]=\"notif.sentAt\"></engage-timestamp>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n</div>\r\n<div class=\"points\" [class.focus]=\"mobileFocus === 'points'\">\r\n <header>\r\n <div>\r\n <label>The Point</label>\r\n </div>\r\n </header>\r\n <div class=\"point-focus\">\r\n <div class=\"actions\">\r\n <button mat-button (click)=\"pointUnfocus()\">\r\n <mat-icon>arrow_back</mat-icon>\r\n Back\r\n </button>\r\n\r\n <div class=\"spacer\"></div>\r\n \r\n <ng-container *ngIf=\"pointOpen\">\r\n <div class=\"counted-action\">\r\n <div class=\"count-indicator\"> \r\n {{pointOpen.upvotes}}\r\n </div>\r\n <button mat-icon-button>\r\n <mat-icon>thumb_up</mat-icon>\r\n </button>\r\n </div>\r\n\r\n </ng-container>\r\n </div>\r\n\r\n <div *ngIf=\"!pointSubChat\">\r\n Error: No subchat\r\n </div>\r\n \r\n <engage-comment-view\r\n class=\"subcomments\"\r\n *ngIf=\"pointSubChat\"\r\n [newestLast]=\"true\"\r\n [allowReplies]=\"false\"\r\n [source]=\"pointSubChat\"\r\n (upvoted)=\"upvoteMessage($event)\"\r\n (reported)=\"reportMessage($event)\"\r\n (userSelected)=\"showProfile($event.user)\"\r\n >\r\n \r\n <engage-comment\r\n class=\"focused-comment\"\r\n data-before\r\n *ngIf=\"pointOpen\"\r\n (upvoted)=\"upvoteMessage(pointOpen)\"\r\n (userSelected)=\"showProfile(pointOpen.user)\"\r\n (reported)=\"reportMessage(pointOpen)\"\r\n [showReplyAction]=\"false\"\r\n [message]=\"pointOpen\"\r\n ></engage-comment>\r\n \r\n <div class=\"message reply\">\r\n Reply:\r\n <form class=\"new-message\" (submit)=\"sendPointSubMessage()\">\r\n <textarea \r\n name=\"message\" \r\n (keydown)=\"newPointSubMessageKeyDown($event)\"\r\n [(ngModel)]=\"newPointSubMessage.message\"></textarea>\r\n \r\n <div class=\"actions\">\r\n <button [disabled]=\"!newPointSubMessage.message\" \r\n mat-raised-button color=\"primary\">Send</button>\r\n </div>\r\n </form>\r\n </div>\r\n </engage-comment-view>\r\n </div>\r\n <div class=\"points-section\">\r\n <engage-comments\r\n [source]=\"pointSource\"\r\n (signInSelected)=\"showSignIn()\"\r\n (upvoted)=\"upvoteMessage($event)\"\r\n (reported)=\"reportMessage($event)\"\r\n (selected)=\"goToMessage($event)\"\r\n (userSelected)=\"showProfile($event.user)\"\r\n ></engage-comments>\r\n </div>\r\n</div>",
|
|
8271
|
-
styles: [":host{display:flex;flex-direction:row;padding:.5em;height:40em;position:relative}.counted-action{display:flex;align-items:center}.count-indicator{font-size:9pt;padding:0 3px;border-radius:3px;border:1px solid #333}header{position:relative;margin-bottom:1em}header div{display:flex;align-items:center;height:30px}header button{color:#666}header label{text-transform:uppercase;z-index:1;font-size:12pt;letter-spacing:2px;font-weight:100;color:#333;margin:0 auto 0 0;display:block;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;position:relative;white-space:nowrap;overflow-x:hidden;text-overflow:ellipsis}header:after{content:\"\";border:1px solid #ccc;height:0;width:100%;display:block;position:relative;z-index:0}.points{max-width:50em;display:flex;flex-direction:column}:host.point-focus .points{width:66%;max-width:50em}:host.point-focus .points .points-section{opacity:0;pointer-events:none}:host.point-focus .points .point-focus{opacity:1;pointer-events:initial}:host.point-focus .points .point-focus .actions{display:flex}
|
|
7960
|
+
selector: "banta",
|
|
7961
|
+
template: "\r\n<mat-menu #userMenu=\"matMenu\">\r\n <ng-container *ngIf=\"currentUser\">\r\n <button [disabled]=\"true\" mat-menu-item>{{currentUser.displayName}} (@{{currentUser.username}})</button>\r\n <button mat-menu-item (click)=\"signOut()\">Sign Out</button>\r\n </ng-container>\r\n <ng-container *ngIf=\"!currentUser\">\r\n <button mat-menu-item>Sign In</button>\r\n </ng-container>\r\n <button mat-menu-item>Help</button>\r\n</mat-menu>\r\n\r\n<div class=\"tabs\">\r\n <div>\r\n <a mat-button (click)=\"mobileFocus = 'firehose'\">Firehose</a>\r\n <a mat-button (click)=\"mobileFocus = 'points'\">The Point</a>\r\n </div>\r\n <div class=\"spacer\"></div>\r\n <div>\r\n <ng-container *ngIf=\"currentUser\">\r\n <button mat-button [matMenuTriggerFor]=\"userMenu\">\r\n @{{currentUser.username}}\r\n </button>\r\n <button mat-icon-button (click)=\"showNotifications()\">\r\n <mat-icon>notification_important</mat-icon>\r\n </button>\r\n </ng-container>\r\n \r\n <button mat-button *ngIf=\"!currentUser\" (click)=\"showSignIn()\">\r\n Sign In\r\n </button>\r\n </div>\r\n</div>\r\n\r\n<div class=\"firehose\" [class.focus]=\"mobileFocus === 'firehose'\">\r\n <header>\r\n <div>\r\n <label (click)=\"mobileFocus = 'firehose'\">Firehose</label>\r\n <div class=\"spacer\"></div>\r\n\r\n <ng-container *ngIf=\"currentUser\">\r\n <button mat-button [matMenuTriggerFor]=\"userMenu\">\r\n @{{currentUser.username}}\r\n </button>\r\n <button mat-icon-button (click)=\"showNotifications()\">\r\n <mat-icon>notification_important</mat-icon>\r\n </button>\r\n </ng-container>\r\n \r\n <button mat-button *ngIf=\"!currentUser\" (click)=\"showSignIn()\">\r\n Sign In\r\n </button>\r\n </div>\r\n </header>\r\n <banta-chat \r\n #firehose\r\n [source]=\"firehoseSource\"\r\n (signInSelected)=\"showSignIn()\"\r\n (upvoted)=\"upvoteMessage($event)\"\r\n (userSelected)=\"showProfile($event.user)\"\r\n (reported)=\"reportMessage($event)\"\r\n ></banta-chat>\r\n</div>\r\n\r\n<div class=\"aux\" [class.focus]=\"mobileFocus === 'aux'\" [class.open]=\"auxOpen\">\r\n <header>\r\n <div>\r\n <label>{{auxTitle}}</label>\r\n <div class=\"spacer\"></div>\r\n <button mat-icon-button (click)=\"auxOpen = false\">\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n </div>\r\n </header>\r\n <div class=\"aux-contents\">\r\n <ng-container *ngIf=\"auxMode === 'profile'\">\r\n <ng-container *ngIf=\"profileUser\">\r\n\r\n <div>\r\n <strong style=\"font-size: 125%;\">\r\n {{profileUser.displayName}}\r\n </strong>\r\n @{{profileUser.username}}\r\n </div>\r\n\r\n <br/>\r\n <strong>Top Messages</strong>\r\n\r\n <div>\r\n <em>Not yet available</em>\r\n </div>\r\n\r\n <br/>\r\n <strong>Recent Messages</strong>\r\n\r\n <div>\r\n <em>Not yet available</em>\r\n </div>\r\n\r\n <pre>{{profileUser | json}}</pre>\r\n </ng-container>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"auxMode === 'report'\">\r\n <p>Are you sure you want to report this message?</p>\r\n\r\n <banta-live-message [message]=\"reportedMessage\"></banta-live-message>\r\n\r\n <div style=\"text-align: center;\">\r\n <button mat-raised-button color=\"primary\" (click)=\"sendReport(reportedMessage)\">Yes, Report</button>\r\n \r\n <button mat-raised-button color=\"secondary\" (click)=\"auxOpen = false\">No, Cancel</button>\r\n </div>\r\n\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"auxMode === 'notifications'\">\r\n\r\n <div *ngIf=\"!notifications || notifications.length === 0\">\r\n <em>You do not have any notifications yet</em>\r\n </div>\r\n \r\n <div class=\"notifications\">\r\n <div class=\"notification\" *ngFor=\"let notif of notifications\">\r\n <div>\r\n <ng-container *ngIf=\"notif.type === 'upvote'\">\r\n @{{notif.message?.user?.username}} upvoted your post\r\n \r\n <banta-live-message\r\n [message]=\"notif.message\"\r\n (upvoted)=\"upvoteMessage(notif.message)\"\r\n (reported)=\"reportMessage(notif.message)\"\r\n (selected)=\"goToMessage(notif.message)\">\r\n </banta-live-message>\r\n\r\n </ng-container>\r\n <ng-container *ngIf=\"notif.type === 'notice'\">\r\n <div>\r\n {{notif.message}}\r\n </div>\r\n <a mat-button target=\"_blank\" href=\"{{notif.actionUrl}}\">\r\n {{notif.actionLabel}}\r\n </a>\r\n </ng-container>\r\n <ng-container *ngIf=\"notif.type === 'mention'\">\r\n You were mentioned by @{{notif.message?.user?.username}}\r\n\r\n <banta-live-message\r\n [message]=\"notif.message\"\r\n (upvoted)=\"upvoteMessage(notif.message)\"\r\n (reported)=\"reportMessage(notif.message)\"\r\n (selected)=\"goToMessage(notif.message)\">\r\n </banta-live-message>\r\n\r\n </ng-container>\r\n <ng-container *ngIf=\"notif.type === 'reply'\">\r\n @{{notif.replyMessage?.user?.username}} replied to your post\r\n \r\n <banta-live-message\r\n [message]=\"notif.replyMessage\"\r\n (upvoted)=\"upvoteMessage(notif.replyMessage)\"\r\n (reported)=\"reportMessage(notif.replyMessage)\"\r\n (selected)=\"goToMessage(notif.replyMessage)\">\r\n </banta-live-message>\r\n </ng-container>\r\n </div>\r\n\r\n <banta-timestamp [value]=\"notif.sentAt\"></banta-timestamp>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n</div>\r\n<div class=\"points\" [class.focus]=\"mobileFocus === 'points'\">\r\n <header>\r\n <div>\r\n <label>The Point</label>\r\n </div>\r\n </header>\r\n <div class=\"point-focus\">\r\n <div class=\"actions\">\r\n <button mat-button (click)=\"pointUnfocus()\">\r\n <mat-icon>arrow_back</mat-icon>\r\n Back\r\n </button>\r\n\r\n <div class=\"spacer\"></div>\r\n \r\n <ng-container *ngIf=\"pointOpen\">\r\n <div class=\"counted-action\">\r\n <div class=\"count-indicator\"> \r\n {{pointOpen.upvotes}}\r\n </div>\r\n <button mat-icon-button>\r\n <mat-icon>thumb_up</mat-icon>\r\n </button>\r\n </div>\r\n\r\n </ng-container>\r\n </div>\r\n\r\n <div *ngIf=\"!pointSubChat\">\r\n Error: No subchat\r\n </div>\r\n \r\n <banta-comment-view\r\n class=\"subcomments\"\r\n *ngIf=\"pointSubChat\"\r\n [newestLast]=\"true\"\r\n [allowReplies]=\"false\"\r\n [source]=\"pointSubChat\"\r\n (upvoted)=\"upvoteMessage($event)\"\r\n (reported)=\"reportMessage($event)\"\r\n (userSelected)=\"showProfile($event.user)\"\r\n >\r\n \r\n <banta-comment\r\n class=\"focused-comment\"\r\n data-before\r\n *ngIf=\"pointOpen\"\r\n (upvoted)=\"upvoteMessage(pointOpen)\"\r\n (userSelected)=\"showProfile(pointOpen.user)\"\r\n (reported)=\"reportMessage(pointOpen)\"\r\n [showReplyAction]=\"false\"\r\n [message]=\"pointOpen\"\r\n ></banta-comment>\r\n \r\n <div class=\"message reply\">\r\n Reply:\r\n <form class=\"new-message\" (submit)=\"sendPointSubMessage()\">\r\n <textarea \r\n name=\"message\" \r\n (keydown)=\"newPointSubMessageKeyDown($event)\"\r\n [(ngModel)]=\"newPointSubMessage.message\"></textarea>\r\n \r\n <div class=\"actions\">\r\n <button [disabled]=\"!newPointSubMessage.message\" \r\n mat-raised-button color=\"primary\">Send</button>\r\n </div>\r\n </form>\r\n </div>\r\n </banta-comment-view>\r\n </div>\r\n <div class=\"points-section\">\r\n <banta-comments\r\n [source]=\"pointSource\"\r\n (signInSelected)=\"showSignIn()\"\r\n (upvoted)=\"upvoteMessage($event)\"\r\n (reported)=\"reportMessage($event)\"\r\n (selected)=\"goToMessage($event)\"\r\n (userSelected)=\"showProfile($event.user)\"\r\n ></banta-comments>\r\n </div>\r\n</div>",
|
|
7962
|
+
styles: [":host{display:flex;flex-direction:row;padding:.5em;height:40em;position:relative}.counted-action{display:flex;align-items:center}.count-indicator{font-size:9pt;padding:0 3px;border-radius:3px;border:1px solid #333}header{position:relative;margin-bottom:1em}header div{display:flex;align-items:center;height:30px}header button{color:#666}header label{text-transform:uppercase;z-index:1;font-size:12pt;letter-spacing:2px;font-weight:100;color:#333;margin:0 auto 0 0;display:block;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;position:relative;white-space:nowrap;overflow-x:hidden;text-overflow:ellipsis}header:after{content:\"\";border:1px solid #ccc;height:0;width:100%;display:block;position:relative;z-index:0}.points{max-width:50em;display:flex;flex-direction:column}:host.point-focus .points{width:66%;max-width:50em}:host.point-focus .points .points-section{opacity:0;pointer-events:none}:host.point-focus .points .point-focus{opacity:1;pointer-events:initial}:host.point-focus .points .point-focus .actions{display:flex}banta-comments{flex-grow:1}.points{width:33%;margin-left:.5em;font-size:12pt;flex-shrink:0;max-width:30em;transition:width .2s ease-in,max-width .2s ease-in;position:relative}.points .points-section{flex-grow:1;display:flex;flex-direction:column;opacity:1;transition:opacity .2s ease-in;z-index:2}.points .point-focus{position:absolute;width:100%;bottom:0;top:1.75em;right:0;left:0;padding:.5em;opacity:0;transition:opacity .2s ease-in;flex-grow:1;display:flex;flex-direction:column}.firehose{flex-grow:1;font-size:10pt;display:flex;flex-direction:column}form{display:flex;padding:.5em 0;align-items:center}form textarea{font-size:14pt;background:#000;color:#fff;border:1px solid #333;min-height:6em;width:100%}form input[type=text]{background:#000;color:#fff;border:1px solid #333;width:100%;height:1em}form .actions{margin-left:1em}form button{display:block;margin:0 0 0 auto}.subcomments ::ng-deep banta-comment{font-size:10pt}.subcomments ::ng-deep banta-comment.focused-comment{background:#001321;color:#fff;font-size:12pt}.aux{width:0;min-width:0;overflow-x:hidden;transition:width .4s ease-out,min-width .4s ease-out;display:flex;flex-direction:column}.aux.open{width:30em;min-width:18em}.aux .aux-contents{width:30em;min-width:10em;max-width:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;flex-grow:1}.notifications .notification{border-bottom:1px solid #333;padding:1em}.notifications .notification banta-timestamp{display:block;text-align:right;font-size:9pt;color:#999}.message.reply{padding:1em}.tabs{display:none}@media (max-width:1015px){:host{flex-direction:column}.tabs{display:flex;position:absolute;top:0;left:0;right:0;width:100%;z-index:10;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);background:rgba(0,0,0,.5)}.points{width:100%;max-width:100%;margin-left:0}header{display:none}:host.point-focus .points{width:100%;max-width:100%}.aux{width:100%;min-width:initial;max-width:100%}.aux,.firehose,.points{position:absolute;top:2em;left:0;right:0;bottom:0;z-index:0;background:#000}.aux.focus,.firehose.focus,.points.focus{z-index:2}}:host-context(.mat-dark-theme) :host{background:#090909;color:#fff}:host-context(.mat-dark-theme) form textarea{background:#ccc;color:#333}:host-context(.mat-dark-theme) header:after{border-color:#222}:host-context(.mat-dark-theme) header label{color:#aaa}"]
|
|
8272
7963
|
}),
|
|
8273
7964
|
__metadata("design:paramtypes", [BantaService,
|
|
8274
7965
|
ChatBackendService,
|
|
8275
7966
|
dialog.MatDialog])
|
|
8276
|
-
],
|
|
8277
|
-
return
|
|
7967
|
+
], BantaComponent);
|
|
7968
|
+
return BantaComponent;
|
|
8278
7969
|
}());
|
|
8279
7970
|
|
|
8280
|
-
var
|
|
8281
|
-
function
|
|
7971
|
+
var BantaLogoComponent = /** @class */ (function () {
|
|
7972
|
+
function BantaLogoComponent() {
|
|
8282
7973
|
}
|
|
8283
|
-
|
|
7974
|
+
BantaLogoComponent = __decorate([
|
|
8284
7975
|
core.Component({
|
|
8285
|
-
selector: '
|
|
7976
|
+
selector: 'banta-logo',
|
|
8286
7977
|
template: "banta",
|
|
8287
7978
|
styles: ["\n :host {\n font-family: 'Odibee Sans', sans-serif;\n font-size: 40pt;\n }\n\n :host.small {\n font-size: 30pt;\n }\n "]
|
|
8288
7979
|
})
|
|
8289
|
-
],
|
|
8290
|
-
return
|
|
7980
|
+
], BantaLogoComponent);
|
|
7981
|
+
return BantaLogoComponent;
|
|
8291
7982
|
}());
|
|
8292
7983
|
|
|
8293
7984
|
var LiveMessageComponent = /** @class */ (function () {
|
|
@@ -8366,8 +8057,8 @@
|
|
|
8366
8057
|
], LiveMessageComponent.prototype, "message", null);
|
|
8367
8058
|
LiveMessageComponent = __decorate([
|
|
8368
8059
|
core.Component({
|
|
8369
|
-
selector: '
|
|
8370
|
-
template: "\n <ng-container *ngIf=\"message\">\n <
|
|
8060
|
+
selector: 'banta-live-message',
|
|
8061
|
+
template: "\n <ng-container *ngIf=\"message\">\n <banta-live-chat-message\n *ngIf=\"viewType === 'chat'\"\n [message]=\"message\"\n (upvoted)=\"upvote(message)\"\n (reported)=\"report(message)\"\n (selected)=\"select(message)\">\n </banta-live-chat-message>\n\n <banta-live-comment \n *ngIf=\"viewType === 'comment'\"\n [message]=\"message\"\n (upvoted)=\"upvote(message)\"\n (reported)=\"report(message)\"\n (selected)=\"select(message)\">\n </banta-live-comment>\n </ng-container>\n ",
|
|
8371
8062
|
styles: [""]
|
|
8372
8063
|
}),
|
|
8373
8064
|
__metadata("design:paramtypes", [])
|
|
@@ -8460,9 +8151,9 @@
|
|
|
8460
8151
|
], CommentComponent.prototype, "selected", null);
|
|
8461
8152
|
CommentComponent = __decorate([
|
|
8462
8153
|
core.Component({
|
|
8463
|
-
selector: '
|
|
8464
|
-
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 <div class=\"avatar\" \r\n (click)=\"selectUser()\"\r\n [style.background-image]=\"avatarForUser(message.user)\"></div>\r\n <label class=\"display-name\" (click)=\"selectUser()\">{{message.user.displayName}}</label>\r\n <label class=\"username\" (click)=\"selectUser()\">@{{message.user.username}}</label>\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 class=\"content\" (click)=\"select()\">\r\n {{message.message}}\r\n </div>\r\n \r\n <div class=\"actions\">\r\n <
|
|
8465
|
-
styles: [":host{display:flex;flex-direction:column;position:relative;padding:.5em}:host:hover{background:#eee}:host .message-content .content{margin-left:4em;margin-right:3em}:host.abbreviated .message-content .content{max-height:8.5em;text-overflow:ellipsis;overflow-y:hidden}:host .actions{display:flex;padding-right:10px;margin-left:4em;align-items:center}:host .actions button{color:#666}:host .actions
|
|
8154
|
+
selector: 'banta-comment',
|
|
8155
|
+
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 <div class=\"avatar\" \r\n (click)=\"selectUser()\"\r\n [style.background-image]=\"avatarForUser(message.user)\"></div>\r\n <label class=\"display-name\" (click)=\"selectUser()\">{{message.user.displayName}}</label>\r\n <label class=\"username\" (click)=\"selectUser()\">@{{message.user.username}}</label>\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 class=\"content\" (click)=\"select()\">\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 </div>\r\n</div>\r\n",
|
|
8156
|
+
styles: [":host{display:flex;flex-direction:column;position:relative;padding:.5em}:host:hover{background:#eee}:host .message-content .content{margin-left:4em;margin-right:3em}:host.abbreviated .message-content .content{max-height:8.5em;text-overflow:ellipsis;overflow-y:hidden}:host .actions{display:flex;padding-right:10px;margin-left:4em;align-items:center}:host .actions button{color:#666}:host .actions banta-timestamp{color:#666;font-size:10pt}.user{position:relative;margin:1em 0 0;display:flex;align-items:center}.user label{z-index:1;position:relative;padding:0 0 0 1em;font-size:10pt;color:#000;margin:0 auto 0 0;display:block;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;max-width:100%;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;flex-shrink:1;flex-grow:0}.user label.username{color:#666;flex-shrink:0;flex-grow:1}.avatar{height:3em;width:3em;background-position:center;background-size:cover;background-color:#333;border-radius:100%;flex-shrink:0;flex-grow:0}.counted-action{display:flex;align-items:center}.count-indicator{font-size:9pt;padding:0 3px;border-radius:3px;border:1px solid #ccc;color:#666}:host-context(.mat-dark-theme) .count-indicator{border-color:#333}:host-context(.mat-dark-theme):hover{background:#060606}:host-context(.mat-dark-theme) .user label{color:#fff}"]
|
|
8466
8157
|
})
|
|
8467
8158
|
], CommentComponent);
|
|
8468
8159
|
return CommentComponent;
|
|
@@ -8645,8 +8336,8 @@
|
|
|
8645
8336
|
], CommentViewComponent.prototype, "newestLast", void 0);
|
|
8646
8337
|
CommentViewComponent = __decorate([
|
|
8647
8338
|
core.Component({
|
|
8648
|
-
selector: '
|
|
8649
|
-
template: "<div class=\"message-container\">\r\n <ng-content select=\"[data-before]\"></ng-content>\r\n <
|
|
8339
|
+
selector: 'banta-comment-view',
|
|
8340
|
+
template: "<div class=\"message-container\">\r\n <ng-content select=\"[data-before]\"></ng-content>\r\n <banta-comment \r\n *ngFor=\"let message of messages\"\r\n class=\"abbreviated\"\r\n [message]=\"message\"\r\n [showReplyAction]=\"allowReplies\"\r\n (userSelected)=\"selectMessageUser(message)\"\r\n (upvoted)=\"upvoteMessage(message)\"\r\n (reported)=\"reportMessage(message)\"\r\n (selected)=\"selectMessage(message)\"\r\n ></banta-comment>\r\n <ng-content select=\":not([data-before])\"></ng-content>\r\n</div>",
|
|
8650
8341
|
styles: [":host{flex-grow:1;display:flex;flex-direction:column;opacity:1;transition:opacity .2s ease-in}.message-container{flex-grow:1;overflow-y:auto;overflow-x:hidden;height:10em;color:#000;background:#fff;padding:.5em 1em .5em .5em}.message-container.no-scroll{height:auto;overflow-y:visible}:host-context(.mat-dark-theme) .message-container{color:#fff;background:#000}"]
|
|
8651
8342
|
}),
|
|
8652
8343
|
__metadata("design:paramtypes", [])
|
|
@@ -8654,8 +8345,11 @@
|
|
|
8654
8345
|
return CommentViewComponent;
|
|
8655
8346
|
}());
|
|
8656
8347
|
|
|
8657
|
-
|
|
8658
|
-
|
|
8348
|
+
/**
|
|
8349
|
+
* Comments component
|
|
8350
|
+
*/
|
|
8351
|
+
var BantaCommentsComponent = /** @class */ (function () {
|
|
8352
|
+
function BantaCommentsComponent(banta, backend) {
|
|
8659
8353
|
this.banta = banta;
|
|
8660
8354
|
this.backend = backend;
|
|
8661
8355
|
this._upvoted = new rxjs.Subject();
|
|
@@ -8669,14 +8363,14 @@
|
|
|
8669
8363
|
this._signInSelected = new rxjs.Subject();
|
|
8670
8364
|
this._permissionDeniedError = new rxjs.Subject();
|
|
8671
8365
|
}
|
|
8672
|
-
|
|
8366
|
+
BantaCommentsComponent.prototype.ngOnInit = function () {
|
|
8673
8367
|
var _this = this;
|
|
8674
8368
|
this._subs.add(this.banta.userChanged.subscribe(function (user) { return _this.user = user; }));
|
|
8675
8369
|
};
|
|
8676
|
-
|
|
8370
|
+
BantaCommentsComponent.prototype.ngOnDestroy = function () {
|
|
8677
8371
|
this._subs.unsubscribe();
|
|
8678
8372
|
};
|
|
8679
|
-
Object.defineProperty(
|
|
8373
|
+
Object.defineProperty(BantaCommentsComponent.prototype, "source", {
|
|
8680
8374
|
get: function () {
|
|
8681
8375
|
return this._source;
|
|
8682
8376
|
},
|
|
@@ -8686,27 +8380,55 @@
|
|
|
8686
8380
|
enumerable: true,
|
|
8687
8381
|
configurable: true
|
|
8688
8382
|
});
|
|
8689
|
-
|
|
8383
|
+
Object.defineProperty(BantaCommentsComponent.prototype, "topicID", {
|
|
8384
|
+
get: function () {
|
|
8385
|
+
return this._source.identifier;
|
|
8386
|
+
},
|
|
8387
|
+
set: function (value) {
|
|
8388
|
+
this.setSourceFromTopicID(value);
|
|
8389
|
+
},
|
|
8390
|
+
enumerable: true,
|
|
8391
|
+
configurable: true
|
|
8392
|
+
});
|
|
8393
|
+
BantaCommentsComponent.prototype.setSourceFromTopicID = function (topicID) {
|
|
8394
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
8395
|
+
var _a;
|
|
8396
|
+
return __generator(this, function (_b) {
|
|
8397
|
+
switch (_b.label) {
|
|
8398
|
+
case 0:
|
|
8399
|
+
if (this._source && this._source.close)
|
|
8400
|
+
this._source.close();
|
|
8401
|
+
this._source = null;
|
|
8402
|
+
_a = this;
|
|
8403
|
+
return [4 /*yield*/, this.backend.getSourceForTopic(topicID)];
|
|
8404
|
+
case 1:
|
|
8405
|
+
_a._source = _b.sent();
|
|
8406
|
+
return [2 /*return*/];
|
|
8407
|
+
}
|
|
8408
|
+
});
|
|
8409
|
+
});
|
|
8410
|
+
};
|
|
8411
|
+
BantaCommentsComponent.prototype.showSignIn = function () {
|
|
8690
8412
|
this._signInSelected.next();
|
|
8691
8413
|
};
|
|
8692
|
-
Object.defineProperty(
|
|
8414
|
+
Object.defineProperty(BantaCommentsComponent.prototype, "signInSelected", {
|
|
8693
8415
|
get: function () {
|
|
8694
8416
|
return this._signInSelected;
|
|
8695
8417
|
},
|
|
8696
8418
|
enumerable: true,
|
|
8697
8419
|
configurable: true
|
|
8698
8420
|
});
|
|
8699
|
-
Object.defineProperty(
|
|
8421
|
+
Object.defineProperty(BantaCommentsComponent.prototype, "permissionDeniedError", {
|
|
8700
8422
|
get: function () {
|
|
8701
8423
|
return this._permissionDeniedError;
|
|
8702
8424
|
},
|
|
8703
8425
|
enumerable: true,
|
|
8704
8426
|
configurable: true
|
|
8705
8427
|
});
|
|
8706
|
-
|
|
8428
|
+
BantaCommentsComponent.prototype.showPermissionDenied = function () {
|
|
8707
8429
|
this._permissionDeniedError.next();
|
|
8708
8430
|
};
|
|
8709
|
-
Object.defineProperty(
|
|
8431
|
+
Object.defineProperty(BantaCommentsComponent.prototype, "canComment", {
|
|
8710
8432
|
get: function () {
|
|
8711
8433
|
var _a;
|
|
8712
8434
|
if (!this.user.permissions)
|
|
@@ -8716,40 +8438,40 @@
|
|
|
8716
8438
|
enumerable: true,
|
|
8717
8439
|
configurable: true
|
|
8718
8440
|
});
|
|
8719
|
-
Object.defineProperty(
|
|
8441
|
+
Object.defineProperty(BantaCommentsComponent.prototype, "upvoted", {
|
|
8720
8442
|
get: function () {
|
|
8721
8443
|
return this._upvoted;
|
|
8722
8444
|
},
|
|
8723
8445
|
enumerable: true,
|
|
8724
8446
|
configurable: true
|
|
8725
8447
|
});
|
|
8726
|
-
Object.defineProperty(
|
|
8448
|
+
Object.defineProperty(BantaCommentsComponent.prototype, "reported", {
|
|
8727
8449
|
get: function () {
|
|
8728
8450
|
return this._reported;
|
|
8729
8451
|
},
|
|
8730
8452
|
enumerable: true,
|
|
8731
8453
|
configurable: true
|
|
8732
8454
|
});
|
|
8733
|
-
Object.defineProperty(
|
|
8455
|
+
Object.defineProperty(BantaCommentsComponent.prototype, "selected", {
|
|
8734
8456
|
get: function () {
|
|
8735
8457
|
return this._selected;
|
|
8736
8458
|
},
|
|
8737
8459
|
enumerable: true,
|
|
8738
8460
|
configurable: true
|
|
8739
8461
|
});
|
|
8740
|
-
Object.defineProperty(
|
|
8462
|
+
Object.defineProperty(BantaCommentsComponent.prototype, "userSelected", {
|
|
8741
8463
|
get: function () {
|
|
8742
8464
|
return this._userSelected;
|
|
8743
8465
|
},
|
|
8744
8466
|
enumerable: true,
|
|
8745
8467
|
configurable: true
|
|
8746
8468
|
});
|
|
8747
|
-
|
|
8469
|
+
BantaCommentsComponent.prototype.onKeyDown = function (event) {
|
|
8748
8470
|
};
|
|
8749
|
-
|
|
8471
|
+
BantaCommentsComponent.prototype.insertEmoji = function (text) {
|
|
8750
8472
|
this.newMessageText += text;
|
|
8751
8473
|
};
|
|
8752
|
-
|
|
8474
|
+
BantaCommentsComponent.prototype.sendMessage = function () {
|
|
8753
8475
|
if (!this.source)
|
|
8754
8476
|
return;
|
|
8755
8477
|
var text = (this.newMessageText || '').trim();
|
|
@@ -8764,19 +8486,19 @@
|
|
|
8764
8486
|
};
|
|
8765
8487
|
this.source.send(message);
|
|
8766
8488
|
};
|
|
8767
|
-
|
|
8489
|
+
BantaCommentsComponent.prototype.upvoteMessage = function (message) {
|
|
8768
8490
|
this._upvoted.next(message);
|
|
8769
8491
|
};
|
|
8770
|
-
|
|
8492
|
+
BantaCommentsComponent.prototype.reportMessage = function (message) {
|
|
8771
8493
|
this._reported.next(message);
|
|
8772
8494
|
};
|
|
8773
|
-
|
|
8495
|
+
BantaCommentsComponent.prototype.selectMessage = function (message) {
|
|
8774
8496
|
this._selected.next(message);
|
|
8775
8497
|
};
|
|
8776
|
-
|
|
8498
|
+
BantaCommentsComponent.prototype.selectMessageUser = function (message) {
|
|
8777
8499
|
this._userSelected.next(message);
|
|
8778
8500
|
};
|
|
8779
|
-
|
|
8501
|
+
BantaCommentsComponent.ctorParameters = function () { return [
|
|
8780
8502
|
{ type: BantaService },
|
|
8781
8503
|
{ type: ChatBackendService }
|
|
8782
8504
|
]; };
|
|
@@ -8784,59 +8506,64 @@
|
|
|
8784
8506
|
core.Input(),
|
|
8785
8507
|
__metadata("design:type", Object),
|
|
8786
8508
|
__metadata("design:paramtypes", [Object])
|
|
8787
|
-
],
|
|
8509
|
+
], BantaCommentsComponent.prototype, "source", null);
|
|
8510
|
+
__decorate([
|
|
8511
|
+
core.Input(),
|
|
8512
|
+
__metadata("design:type", String),
|
|
8513
|
+
__metadata("design:paramtypes", [Object])
|
|
8514
|
+
], BantaCommentsComponent.prototype, "topicID", null);
|
|
8788
8515
|
__decorate([
|
|
8789
8516
|
core.Input(),
|
|
8790
8517
|
__metadata("design:type", Object)
|
|
8791
|
-
],
|
|
8518
|
+
], BantaCommentsComponent.prototype, "signInLabel", void 0);
|
|
8792
8519
|
__decorate([
|
|
8793
8520
|
core.Input(),
|
|
8794
8521
|
__metadata("design:type", Object)
|
|
8795
|
-
],
|
|
8522
|
+
], BantaCommentsComponent.prototype, "sendLabel", void 0);
|
|
8796
8523
|
__decorate([
|
|
8797
8524
|
core.Input(),
|
|
8798
8525
|
__metadata("design:type", Object)
|
|
8799
|
-
],
|
|
8526
|
+
], BantaCommentsComponent.prototype, "permissionDeniedLabel", void 0);
|
|
8800
8527
|
__decorate([
|
|
8801
8528
|
core.Output(),
|
|
8802
8529
|
__metadata("design:type", rxjs.Observable),
|
|
8803
8530
|
__metadata("design:paramtypes", [])
|
|
8804
|
-
],
|
|
8531
|
+
], BantaCommentsComponent.prototype, "signInSelected", null);
|
|
8805
8532
|
__decorate([
|
|
8806
8533
|
core.Output(),
|
|
8807
8534
|
__metadata("design:type", rxjs.Observable),
|
|
8808
8535
|
__metadata("design:paramtypes", [])
|
|
8809
|
-
],
|
|
8536
|
+
], BantaCommentsComponent.prototype, "permissionDeniedError", null);
|
|
8810
8537
|
__decorate([
|
|
8811
8538
|
core.Output(),
|
|
8812
8539
|
__metadata("design:type", Object),
|
|
8813
8540
|
__metadata("design:paramtypes", [])
|
|
8814
|
-
],
|
|
8541
|
+
], BantaCommentsComponent.prototype, "upvoted", null);
|
|
8815
8542
|
__decorate([
|
|
8816
8543
|
core.Output(),
|
|
8817
8544
|
__metadata("design:type", Object),
|
|
8818
8545
|
__metadata("design:paramtypes", [])
|
|
8819
|
-
],
|
|
8546
|
+
], BantaCommentsComponent.prototype, "reported", null);
|
|
8820
8547
|
__decorate([
|
|
8821
8548
|
core.Output(),
|
|
8822
8549
|
__metadata("design:type", Object),
|
|
8823
8550
|
__metadata("design:paramtypes", [])
|
|
8824
|
-
],
|
|
8551
|
+
], BantaCommentsComponent.prototype, "selected", null);
|
|
8825
8552
|
__decorate([
|
|
8826
8553
|
core.Output(),
|
|
8827
8554
|
__metadata("design:type", Object),
|
|
8828
8555
|
__metadata("design:paramtypes", [])
|
|
8829
|
-
],
|
|
8830
|
-
|
|
8556
|
+
], BantaCommentsComponent.prototype, "userSelected", null);
|
|
8557
|
+
BantaCommentsComponent = __decorate([
|
|
8831
8558
|
core.Component({
|
|
8832
|
-
selector: '
|
|
8833
|
-
template: "\r\n<form class=\"new-message\" (submit)=\"sendMessage()\">\r\n <div class=\"text-container\">\r\n <textarea \r\n name=\"message\" \r\n (keydown)=\"onKeyDown($event)\"\r\n [(ngModel)]=\"newMessageText\"></textarea>\r\n <emoji-selector-button \r\n class=\"top-right\"\r\n (selected)=\"insertEmoji($event)\"\r\n ></emoji-selector-button>\r\n </div>\r\n <div class=\"actions\">\r\n\r\n <ng-container *ngIf=\"!user\">\r\n <button \r\n mat-raised-button \r\n color=\"primary\"\r\n type=\"button\"\r\n (click)=\"showSignIn()\"\r\n >{{signInLabel}}</button>\r\n </ng-container>\r\n <ng-container *ngIf=\"user\">\r\n <button \r\n *ngIf=\"canComment\"\r\n mat-raised-button \r\n color=\"primary\"\r\n [disabled]=\"!newMessageText\" \r\n >{{sendLabel}}</button>\r\n <button \r\n *ngIf=\"!canComment\"\r\n type=\"button\"\r\n (click)=\"showPermissionDenied()\"\r\n mat-raised-button \r\n color=\"primary\"\r\n >{{permissionDeniedLabel}</button>\r\n </ng-container>\r\n </div>\r\n</form>\r\n\r\n<
|
|
8559
|
+
selector: 'banta-comments',
|
|
8560
|
+
template: "\r\n<form class=\"new-message\" (submit)=\"sendMessage()\">\r\n <div class=\"text-container\">\r\n <textarea \r\n name=\"message\" \r\n (keydown)=\"onKeyDown($event)\"\r\n [(ngModel)]=\"newMessageText\"></textarea>\r\n <emoji-selector-button \r\n class=\"top-right\"\r\n (selected)=\"insertEmoji($event)\"\r\n ></emoji-selector-button>\r\n </div>\r\n <div class=\"actions\">\r\n\r\n <ng-container *ngIf=\"!user\">\r\n <button \r\n mat-raised-button \r\n color=\"primary\"\r\n type=\"button\"\r\n (click)=\"showSignIn()\"\r\n >{{signInLabel}}</button>\r\n </ng-container>\r\n <ng-container *ngIf=\"user\">\r\n <button \r\n *ngIf=\"canComment\"\r\n mat-raised-button \r\n color=\"primary\"\r\n [disabled]=\"!newMessageText\" \r\n >{{sendLabel}}</button>\r\n <button \r\n *ngIf=\"!canComment\"\r\n type=\"button\"\r\n (click)=\"showPermissionDenied()\"\r\n mat-raised-button \r\n color=\"primary\"\r\n >{{permissionDeniedLabel}</button>\r\n </ng-container>\r\n </div>\r\n</form>\r\n\r\n<banta-comment-view \r\n [source]=\"source\"\r\n (userSelected)=\"selectMessageUser($event)\"\r\n (selected)=\"selectMessage($event)\"\r\n (upvoted)=\"upvoteMessage($event)\"\r\n (reported)=\"reportMessage($event)\"\r\n ></banta-comment-view>",
|
|
8834
8561
|
styles: [":host{display:flex;flex-direction:column}form{display:flex;padding:.5em 0;align-items:center}form .text-container{position:relative;display:flex;flex-grow:1}form .text-container textarea{font-size:14pt;background-color:#fff;color:#333;border:1px solid #ccc;min-height:6em;width:100%}form .text-container emoji-selector-button{bottom:0;right:0;position:absolute}form input[type=text]{background:#000;color:#fff;border:1px solid #333;width:100%;height:1em}form .actions{margin-left:1em}form button{display:block;margin:0 0 0 auto}:host-context(.mat-dark-theme) form .text-container textarea{background:#000;color:#fff;border-color:#333}"]
|
|
8835
8562
|
}),
|
|
8836
8563
|
__metadata("design:paramtypes", [BantaService,
|
|
8837
8564
|
ChatBackendService])
|
|
8838
|
-
],
|
|
8839
|
-
return
|
|
8565
|
+
], BantaCommentsComponent);
|
|
8566
|
+
return BantaCommentsComponent;
|
|
8840
8567
|
}());
|
|
8841
8568
|
|
|
8842
8569
|
var LiveCommentComponent = /** @class */ (function () {
|
|
@@ -8923,8 +8650,8 @@
|
|
|
8923
8650
|
], LiveCommentComponent.prototype, "message", null);
|
|
8924
8651
|
LiveCommentComponent = __decorate([
|
|
8925
8652
|
core.Component({
|
|
8926
|
-
selector: '
|
|
8927
|
-
template: "\n <
|
|
8653
|
+
selector: 'banta-live-comment',
|
|
8654
|
+
template: "\n <banta-comment \n *ngIf=\"message\"\n [message]=\"message\"\n (upvoted)=\"upvote()\"\n (reported)=\"report()\"\n (selected)=\"select()\"\n ></banta-comment>\n ",
|
|
8928
8655
|
styles: [""]
|
|
8929
8656
|
}),
|
|
8930
8657
|
__metadata("design:paramtypes", [ChatBackendService])
|
|
@@ -8935,7 +8662,7 @@
|
|
|
8935
8662
|
var COMPONENTS$3 = [
|
|
8936
8663
|
CommentComponent,
|
|
8937
8664
|
CommentViewComponent,
|
|
8938
|
-
|
|
8665
|
+
BantaCommentsComponent,
|
|
8939
8666
|
LiveCommentComponent
|
|
8940
8667
|
];
|
|
8941
8668
|
var CommentsModule = /** @class */ (function () {
|
|
@@ -8950,7 +8677,7 @@
|
|
|
8950
8677
|
icon.MatIconModule,
|
|
8951
8678
|
button.MatButtonModule,
|
|
8952
8679
|
menu.MatMenuModule,
|
|
8953
|
-
|
|
8680
|
+
BantaCommonModule,
|
|
8954
8681
|
EmojiModule
|
|
8955
8682
|
],
|
|
8956
8683
|
exports: COMPONENTS$3
|
|
@@ -8959,11 +8686,6 @@
|
|
|
8959
8686
|
return CommentsModule;
|
|
8960
8687
|
}());
|
|
8961
8688
|
|
|
8962
|
-
var COMPONENTS$4 = [
|
|
8963
|
-
EngageComponent,
|
|
8964
|
-
EngageLogoComponent,
|
|
8965
|
-
LiveMessageComponent
|
|
8966
|
-
];
|
|
8967
8689
|
var BantaSdkModule = /** @class */ (function () {
|
|
8968
8690
|
function BantaSdkModule() {
|
|
8969
8691
|
}
|
|
@@ -8972,7 +8694,7 @@
|
|
|
8972
8694
|
imports: [
|
|
8973
8695
|
common.CommonModule,
|
|
8974
8696
|
forms.FormsModule,
|
|
8975
|
-
|
|
8697
|
+
BantaCommonModule.forRoot(),
|
|
8976
8698
|
CommentsModule,
|
|
8977
8699
|
ChatModule,
|
|
8978
8700
|
EmojiModule,
|
|
@@ -8984,13 +8706,28 @@
|
|
|
8984
8706
|
formField.MatFormFieldModule,
|
|
8985
8707
|
input.MatInputModule
|
|
8986
8708
|
],
|
|
8987
|
-
declarations:
|
|
8988
|
-
|
|
8709
|
+
declarations: [
|
|
8710
|
+
BantaComponent,
|
|
8711
|
+
BantaLogoComponent,
|
|
8712
|
+
LiveMessageComponent
|
|
8713
|
+
],
|
|
8714
|
+
exports: [
|
|
8715
|
+
BantaComponent,
|
|
8716
|
+
BantaLogoComponent,
|
|
8717
|
+
LiveMessageComponent,
|
|
8718
|
+
ChatModule,
|
|
8719
|
+
CommentsModule
|
|
8720
|
+
]
|
|
8989
8721
|
})
|
|
8990
8722
|
], BantaSdkModule);
|
|
8991
8723
|
return BantaSdkModule;
|
|
8992
8724
|
}());
|
|
8993
8725
|
|
|
8726
|
+
exports.BantaChatComponent = BantaChatComponent;
|
|
8727
|
+
exports.BantaCommentsComponent = BantaCommentsComponent;
|
|
8728
|
+
exports.BantaCommonModule = BantaCommonModule;
|
|
8729
|
+
exports.BantaComponent = BantaComponent;
|
|
8730
|
+
exports.BantaLogoComponent = BantaLogoComponent;
|
|
8994
8731
|
exports.BantaSdkModule = BantaSdkModule;
|
|
8995
8732
|
exports.BantaService = BantaService;
|
|
8996
8733
|
exports.ChatBackendService = ChatBackendService;
|
|
@@ -8999,22 +8736,14 @@
|
|
|
8999
8736
|
exports.ChatViewComponent = ChatViewComponent;
|
|
9000
8737
|
exports.CommentComponent = CommentComponent;
|
|
9001
8738
|
exports.CommentViewComponent = CommentViewComponent;
|
|
9002
|
-
exports.CommentsBoxComponent = CommentsBoxComponent;
|
|
9003
8739
|
exports.CommentsModule = CommentsModule;
|
|
9004
8740
|
exports.EMOJIS = EMOJIS;
|
|
9005
8741
|
exports.EmojiModule = EmojiModule;
|
|
9006
8742
|
exports.EmojiSelectorButtonComponent = EmojiSelectorButtonComponent;
|
|
9007
8743
|
exports.EmojiSelectorPanelComponent = EmojiSelectorPanelComponent;
|
|
9008
|
-
exports.EngageCommonModule = EngageCommonModule;
|
|
9009
|
-
exports.EngageComponent = EngageComponent;
|
|
9010
|
-
exports.EngageLogoComponent = EngageLogoComponent;
|
|
9011
|
-
exports.FirehoseChatComponent = FirehoseChatComponent;
|
|
9012
8744
|
exports.LiveChatMessageComponent = LiveChatMessageComponent;
|
|
9013
8745
|
exports.LiveCommentComponent = LiveCommentComponent;
|
|
9014
8746
|
exports.LiveMessageComponent = LiveMessageComponent;
|
|
9015
|
-
exports.MockFirehoseSource = MockFirehoseSource;
|
|
9016
|
-
exports.MockPointSource = MockPointSource;
|
|
9017
|
-
exports.MockSubpointSource = MockSubpointSource;
|
|
9018
8747
|
exports.TimestampComponent = TimestampComponent;
|
|
9019
8748
|
exports.lazyConnection = lazyConnection;
|
|
9020
8749
|
|