@banta/sdk 3.2.2 → 3.2.3

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.
@@ -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('subsink'), 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', 'subsink', '@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.subsink, 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, subsink, 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('@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';
6
6
 
7
7
  function lazyConnection(options) {
8
8
  var obs = new rxjs.Observable(function (observer) {
@@ -7219,7 +7219,7 @@
7219
7219
  this.banta = banta;
7220
7220
  this.backend = backend;
7221
7221
  this.matDialog = matDialog;
7222
- this._subs = new subsink.SubSink();
7222
+ this._subs = new rxjs.Subscription();
7223
7223
  this.auxOpen = false;
7224
7224
  this.auxTitle = 'Notifications';
7225
7225
  this.auxMode = 'notifications';
@@ -7235,7 +7235,9 @@
7235
7235
  }
7236
7236
  BantaComponent.prototype.ngOnInit = function () {
7237
7237
  var _this = this;
7238
- 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) {
7238
+ this._subs.add(this.banta.userChanged.subscribe(function (user) { return _this.currentUser = user; }));
7239
+ this._subs.add(this.backend.notificationsChanged.subscribe(function (notifs) { return _this.notifications = notifs; }));
7240
+ this._subs.add(this.backend.newNotification.subscribe(function (notif) {
7239
7241
  _this.newNotifications = true;
7240
7242
  }));
7241
7243
  };
@@ -7632,7 +7634,7 @@
7632
7634
  var ChatViewComponent = /** @class */ (function () {
7633
7635
  function ChatViewComponent(elementRef) {
7634
7636
  this.elementRef = elementRef;
7635
- this._sourceSubs = new subsink.SubSink();
7637
+ this._sourceSubs = new rxjs.Subscription();
7636
7638
  this._selected = new rxjs.Subject();
7637
7639
  this._reported = new rxjs.Subject();
7638
7640
  this._upvoted = new rxjs.Subject();
@@ -7653,15 +7655,14 @@
7653
7655
  this._source = value;
7654
7656
  this.messages = [];
7655
7657
  if (value) {
7656
- this._sourceSubs = new subsink.SubSink();
7658
+ this._sourceSubs = new rxjs.Subscription();
7657
7659
  this.messages = value.messages.slice();
7658
7660
  console.log("Source set:");
7659
7661
  console.dir(value);
7660
7662
  console.log("Messages loaded:");
7661
7663
  console.dir(this.messages);
7662
- this._sourceSubs.add(this._source.messageReceived
7663
- .subscribe(function (msg) { return _this.messageReceived(msg); }), this._source.messageSent
7664
- .subscribe(function (msg) { return _this.messageSent(msg); }));
7664
+ this._sourceSubs.add(this._source.messageReceived.subscribe(function (msg) { return _this.messageReceived(msg); }));
7665
+ this._sourceSubs.add(this._source.messageSent.subscribe(function (msg) { return _this.messageSent(msg); }));
7665
7666
  if (this._source.currentUserChanged) {
7666
7667
  this._sourceSubs.add(this._source.currentUserChanged
7667
7668
  .subscribe(function (user) { return _this.currentUser = user; }));
@@ -7805,7 +7806,7 @@
7805
7806
  this.banta = banta;
7806
7807
  this.backend = backend;
7807
7808
  this.elementRef = elementRef;
7808
- this._subs = new subsink.SubSink();
7809
+ this._subs = new rxjs.Subscription();
7809
7810
  this.user = null;
7810
7811
  this.signInLabel = 'Sign In';
7811
7812
  this.sendLabel = 'Send';
@@ -8116,6 +8117,8 @@
8116
8117
  this._selected = new rxjs.Subject();
8117
8118
  this._upvoted = new rxjs.Subject();
8118
8119
  this._userSelected = new rxjs.Subject();
8120
+ this._avatarSelected = new rxjs.Subject();
8121
+ this._usernameSelected = new rxjs.Subject();
8119
8122
  this.isNew = false;
8120
8123
  this.visible = false;
8121
8124
  this.showReplyAction = true;
@@ -8133,28 +8136,42 @@
8133
8136
  };
8134
8137
  Object.defineProperty(CommentComponent.prototype, "userSelected", {
8135
8138
  get: function () {
8136
- return this._userSelected;
8139
+ return this._userSelected.asObservable();
8140
+ },
8141
+ enumerable: false,
8142
+ configurable: true
8143
+ });
8144
+ Object.defineProperty(CommentComponent.prototype, "usernameSelected", {
8145
+ get: function () {
8146
+ return this._usernameSelected.asObservable();
8147
+ },
8148
+ enumerable: false,
8149
+ configurable: true
8150
+ });
8151
+ Object.defineProperty(CommentComponent.prototype, "avatarSelected", {
8152
+ get: function () {
8153
+ return this._avatarSelected.asObservable();
8137
8154
  },
8138
8155
  enumerable: false,
8139
8156
  configurable: true
8140
8157
  });
8141
8158
  Object.defineProperty(CommentComponent.prototype, "reported", {
8142
8159
  get: function () {
8143
- return this._reported;
8160
+ return this._reported.asObservable();
8144
8161
  },
8145
8162
  enumerable: false,
8146
8163
  configurable: true
8147
8164
  });
8148
8165
  Object.defineProperty(CommentComponent.prototype, "upvoted", {
8149
8166
  get: function () {
8150
- return this._upvoted;
8167
+ return this._upvoted.asObservable();
8151
8168
  },
8152
8169
  enumerable: false,
8153
8170
  configurable: true
8154
8171
  });
8155
8172
  Object.defineProperty(CommentComponent.prototype, "selected", {
8156
8173
  get: function () {
8157
- return this._selected;
8174
+ return this._selected.asObservable();
8158
8175
  },
8159
8176
  enumerable: false,
8160
8177
  configurable: true
@@ -8177,7 +8194,15 @@
8177
8194
  this._selected.next();
8178
8195
  };
8179
8196
  CommentComponent.prototype.selectUser = function () {
8180
- return this._userSelected.next();
8197
+ this._userSelected.next();
8198
+ };
8199
+ CommentComponent.prototype.selectUsername = function (user) {
8200
+ this._usernameSelected.next(user);
8201
+ this.selectUser();
8202
+ };
8203
+ CommentComponent.prototype.selectAvatar = function (user) {
8204
+ this._avatarSelected.next(user);
8205
+ this.selectUser();
8181
8206
  };
8182
8207
  CommentComponent.prototype.avatarForUser = function (user) {
8183
8208
  if (user && user.avatarUrl) {
@@ -8191,7 +8216,7 @@
8191
8216
  CommentComponent.decorators = [
8192
8217
  { type: core.Component, args: [{
8193
8218
  selector: 'banta-comment',
8194
- 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)=\"selectUser()\"\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)=\"selectUser()\">@{{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 <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",
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 \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 <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",
8195
8220
  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}}"]
8196
8221
  },] }
8197
8222
  ];
@@ -8201,6 +8226,8 @@
8201
8226
  message: [{ type: core.Input }],
8202
8227
  showReplyAction: [{ type: core.Input }],
8203
8228
  userSelected: [{ type: core.Output }],
8229
+ usernameSelected: [{ type: core.Output }],
8230
+ avatarSelected: [{ type: core.Output }],
8204
8231
  reported: [{ type: core.Output }],
8205
8232
  upvoted: [{ type: core.Output }],
8206
8233
  selected: [{ type: core.Output }],
@@ -8210,11 +8237,13 @@
8210
8237
  var CommentViewComponent = /** @class */ (function () {
8211
8238
  function CommentViewComponent(backend) {
8212
8239
  this.backend = backend;
8213
- this._sourceSubs = new subsink.SubSink();
8240
+ this._sourceSubs = new rxjs.Subscription();
8214
8241
  this._selected = new rxjs.Subject();
8215
8242
  this._upvoted = new rxjs.Subject();
8216
8243
  this._reported = new rxjs.Subject();
8217
8244
  this._userSelected = new rxjs.Subject();
8245
+ this._usernameSelected = new rxjs.Subject();
8246
+ this._avatarSelected = new rxjs.Subject();
8218
8247
  this.showEmptyState = true;
8219
8248
  this.allowReplies = true;
8220
8249
  this.menuMessage = null;
@@ -8256,6 +8285,20 @@
8256
8285
  enumerable: false,
8257
8286
  configurable: true
8258
8287
  });
8288
+ Object.defineProperty(CommentViewComponent.prototype, "usernameSelected", {
8289
+ get: function () {
8290
+ return this._usernameSelected;
8291
+ },
8292
+ enumerable: false,
8293
+ configurable: true
8294
+ });
8295
+ Object.defineProperty(CommentViewComponent.prototype, "avatarSelected", {
8296
+ get: function () {
8297
+ return this._avatarSelected;
8298
+ },
8299
+ enumerable: false,
8300
+ configurable: true
8301
+ });
8259
8302
  Object.defineProperty(CommentViewComponent.prototype, "source", {
8260
8303
  get: function () {
8261
8304
  return this._source;
@@ -8272,10 +8315,9 @@
8272
8315
  this.messages = messages;
8273
8316
  this.olderMessages = messages.splice(this.maxVisibleMessages, messages.length);
8274
8317
  this.hasMore = this.olderMessages.length > 0;
8275
- this._sourceSubs = new subsink.SubSink();
8276
- this._sourceSubs.add(this._source.messageReceived
8277
- .subscribe(function (msg) { return _this.messageReceived(msg); }), this._source.messageSent
8278
- .subscribe(function (msg) { return _this.messageSent(msg); }));
8318
+ this._sourceSubs = new rxjs.Subscription();
8319
+ this._sourceSubs.add(this._source.messageReceived.subscribe(function (msg) { return _this.messageReceived(msg); }));
8320
+ this._sourceSubs.add(this._source.messageSent.subscribe(function (msg) { return _this.messageSent(msg); }));
8279
8321
  if (this._source.currentUserChanged) {
8280
8322
  this._sourceSubs.add(this._source.currentUserChanged.subscribe(function (user) { return _this.currentUser = user; }));
8281
8323
  }
@@ -8291,16 +8333,17 @@
8291
8333
  this._reported.next(message);
8292
8334
  };
8293
8335
  CommentViewComponent.prototype.selectMessage = function (message) {
8294
- return __awaiter(this, void 0, void 0, function () {
8295
- return __generator(this, function (_a) {
8296
- this._selected.next(message);
8297
- return [2 /*return*/];
8298
- });
8299
- });
8336
+ this._selected.next(message);
8300
8337
  };
8301
8338
  CommentViewComponent.prototype.selectMessageUser = function (message) {
8302
8339
  this._userSelected.next(message);
8303
8340
  };
8341
+ CommentViewComponent.prototype.selectUsername = function (user) {
8342
+ this._usernameSelected.next(user);
8343
+ };
8344
+ CommentViewComponent.prototype.selectAvatar = function (user) {
8345
+ this._avatarSelected.next(user);
8346
+ };
8304
8347
  CommentViewComponent.prototype.messageIdentity = function (index, chatMessage) {
8305
8348
  return chatMessage.id;
8306
8349
  };
@@ -8412,7 +8455,7 @@
8412
8455
  CommentViewComponent.decorators = [
8413
8456
  { type: core.Component, args: [{
8414
8457
  selector: 'banta-comment-view',
8415
- 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 (userSelected)=\"selectMessageUser(message)\"\r\n (upvoted)=\"upvoteMessage(message)\"\r\n (reported)=\"reportMessage(message)\"\r\n (selected)=\"selectMessage(message)\"\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>",
8458
+ 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 ></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>",
8416
8459
  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}}"]
8417
8460
  },] }
8418
8461
  ];
@@ -8427,6 +8470,8 @@
8427
8470
  userSelected: [{ type: core.Output }],
8428
8471
  reported: [{ type: core.Output }],
8429
8472
  upvoted: [{ type: core.Output }],
8473
+ usernameSelected: [{ type: core.Output }],
8474
+ avatarSelected: [{ type: core.Output }],
8430
8475
  source: [{ type: core.Input }],
8431
8476
  genericAvatarUrl: [{ type: core.Input }],
8432
8477
  messageContainer: [{ type: core.ViewChild, args: ['messageContainer',] }],
@@ -8447,7 +8492,9 @@
8447
8492
  this._reported = new rxjs.Subject();
8448
8493
  this._selected = new rxjs.Subject();
8449
8494
  this._userSelected = new rxjs.Subject();
8450
- this._subs = new subsink.SubSink();
8495
+ this._usernameSelected = new rxjs.Subject();
8496
+ this._avatarSelected = new rxjs.Subject();
8497
+ this._subs = new rxjs.Subscription();
8451
8498
  this.hashtags = [
8452
8499
  { hashtag: 'error', description: 'Cause an error' },
8453
8500
  { hashtag: 'timeout', description: 'Cause a slow timeout error' },
@@ -8584,28 +8631,42 @@
8584
8631
  });
8585
8632
  Object.defineProperty(BantaCommentsComponent.prototype, "upvoted", {
8586
8633
  get: function () {
8587
- return this._upvoted;
8634
+ return this._upvoted.asObservable();
8588
8635
  },
8589
8636
  enumerable: false,
8590
8637
  configurable: true
8591
8638
  });
8592
8639
  Object.defineProperty(BantaCommentsComponent.prototype, "reported", {
8593
8640
  get: function () {
8594
- return this._reported;
8641
+ return this._reported.asObservable();
8595
8642
  },
8596
8643
  enumerable: false,
8597
8644
  configurable: true
8598
8645
  });
8599
8646
  Object.defineProperty(BantaCommentsComponent.prototype, "selected", {
8600
8647
  get: function () {
8601
- return this._selected;
8648
+ return this._selected.asObservable();
8602
8649
  },
8603
8650
  enumerable: false,
8604
8651
  configurable: true
8605
8652
  });
8606
8653
  Object.defineProperty(BantaCommentsComponent.prototype, "userSelected", {
8607
8654
  get: function () {
8608
- return this._userSelected;
8655
+ return this._userSelected.asObservable();
8656
+ },
8657
+ enumerable: false,
8658
+ configurable: true
8659
+ });
8660
+ Object.defineProperty(BantaCommentsComponent.prototype, "usernameSelected", {
8661
+ get: function () {
8662
+ return this._usernameSelected.asObservable();
8663
+ },
8664
+ enumerable: false,
8665
+ configurable: true
8666
+ });
8667
+ Object.defineProperty(BantaCommentsComponent.prototype, "avatarSelected", {
8668
+ get: function () {
8669
+ return this._avatarSelected.asObservable();
8609
8670
  },
8610
8671
  enumerable: false,
8611
8672
  configurable: true
@@ -8693,6 +8754,12 @@
8693
8754
  BantaCommentsComponent.prototype.selectMessageUser = function (message) {
8694
8755
  this._userSelected.next(message);
8695
8756
  };
8757
+ BantaCommentsComponent.prototype.selectUsername = function (user) {
8758
+ this._usernameSelected.next(user);
8759
+ };
8760
+ BantaCommentsComponent.prototype.selectAvatar = function (user) {
8761
+ this._avatarSelected.next(user);
8762
+ };
8696
8763
  BantaCommentsComponent.prototype.sendReply = function () {
8697
8764
  return __awaiter(this, void 0, void 0, function () {
8698
8765
  return __generator(this, function (_b) {
@@ -8726,7 +8793,7 @@
8726
8793
  BantaCommentsComponent.decorators = [
8727
8794
  { type: core.Component, args: [{
8728
8795
  selector: 'banta-comments',
8729
- 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 [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 ></banta-comment-field>\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 ></banta-comment-view>\r\n</div>",
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 \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 [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 ></banta-comment-field>\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 ></banta-comment-view>\r\n</div>\r\n",
8730
8797
  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}}"]
8731
8798
  },] }
8732
8799
  ];
@@ -8757,7 +8824,9 @@
8757
8824
  upvoted: [{ type: core.Output }],
8758
8825
  reported: [{ type: core.Output }],
8759
8826
  selected: [{ type: core.Output }],
8760
- userSelected: [{ type: core.Output }]
8827
+ userSelected: [{ type: core.Output }],
8828
+ usernameSelected: [{ type: core.Output }],
8829
+ avatarSelected: [{ type: core.Output }]
8761
8830
  };
8762
8831
 
8763
8832
  var LiveCommentComponent = /** @class */ (function () {