@banta/sdk 3.2.0 → 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';
@@ -7965,6 +7966,7 @@
7965
7966
  user: null,
7966
7967
  sentAt: Date.now(),
7967
7968
  upvotes: 0,
7969
+ url: location.href,
7968
7970
  message: text
7969
7971
  };
7970
7972
  _b.label = 1;
@@ -8115,6 +8117,8 @@
8115
8117
  this._selected = new rxjs.Subject();
8116
8118
  this._upvoted = new rxjs.Subject();
8117
8119
  this._userSelected = new rxjs.Subject();
8120
+ this._avatarSelected = new rxjs.Subject();
8121
+ this._usernameSelected = new rxjs.Subject();
8118
8122
  this.isNew = false;
8119
8123
  this.visible = false;
8120
8124
  this.showReplyAction = true;
@@ -8132,28 +8136,42 @@
8132
8136
  };
8133
8137
  Object.defineProperty(CommentComponent.prototype, "userSelected", {
8134
8138
  get: function () {
8135
- 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();
8136
8154
  },
8137
8155
  enumerable: false,
8138
8156
  configurable: true
8139
8157
  });
8140
8158
  Object.defineProperty(CommentComponent.prototype, "reported", {
8141
8159
  get: function () {
8142
- return this._reported;
8160
+ return this._reported.asObservable();
8143
8161
  },
8144
8162
  enumerable: false,
8145
8163
  configurable: true
8146
8164
  });
8147
8165
  Object.defineProperty(CommentComponent.prototype, "upvoted", {
8148
8166
  get: function () {
8149
- return this._upvoted;
8167
+ return this._upvoted.asObservable();
8150
8168
  },
8151
8169
  enumerable: false,
8152
8170
  configurable: true
8153
8171
  });
8154
8172
  Object.defineProperty(CommentComponent.prototype, "selected", {
8155
8173
  get: function () {
8156
- return this._selected;
8174
+ return this._selected.asObservable();
8157
8175
  },
8158
8176
  enumerable: false,
8159
8177
  configurable: true
@@ -8176,7 +8194,15 @@
8176
8194
  this._selected.next();
8177
8195
  };
8178
8196
  CommentComponent.prototype.selectUser = function () {
8179
- 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();
8180
8206
  };
8181
8207
  CommentComponent.prototype.avatarForUser = function (user) {
8182
8208
  if (user && user.avatarUrl) {
@@ -8190,7 +8216,7 @@
8190
8216
  CommentComponent.decorators = [
8191
8217
  { type: core.Component, args: [{
8192
8218
  selector: 'banta-comment',
8193
- 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",
8194
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}}"]
8195
8221
  },] }
8196
8222
  ];
@@ -8200,6 +8226,8 @@
8200
8226
  message: [{ type: core.Input }],
8201
8227
  showReplyAction: [{ type: core.Input }],
8202
8228
  userSelected: [{ type: core.Output }],
8229
+ usernameSelected: [{ type: core.Output }],
8230
+ avatarSelected: [{ type: core.Output }],
8203
8231
  reported: [{ type: core.Output }],
8204
8232
  upvoted: [{ type: core.Output }],
8205
8233
  selected: [{ type: core.Output }],
@@ -8209,11 +8237,13 @@
8209
8237
  var CommentViewComponent = /** @class */ (function () {
8210
8238
  function CommentViewComponent(backend) {
8211
8239
  this.backend = backend;
8212
- this._sourceSubs = new subsink.SubSink();
8240
+ this._sourceSubs = new rxjs.Subscription();
8213
8241
  this._selected = new rxjs.Subject();
8214
8242
  this._upvoted = new rxjs.Subject();
8215
8243
  this._reported = new rxjs.Subject();
8216
8244
  this._userSelected = new rxjs.Subject();
8245
+ this._usernameSelected = new rxjs.Subject();
8246
+ this._avatarSelected = new rxjs.Subject();
8217
8247
  this.showEmptyState = true;
8218
8248
  this.allowReplies = true;
8219
8249
  this.menuMessage = null;
@@ -8255,6 +8285,20 @@
8255
8285
  enumerable: false,
8256
8286
  configurable: true
8257
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
+ });
8258
8302
  Object.defineProperty(CommentViewComponent.prototype, "source", {
8259
8303
  get: function () {
8260
8304
  return this._source;
@@ -8271,10 +8315,9 @@
8271
8315
  this.messages = messages;
8272
8316
  this.olderMessages = messages.splice(this.maxVisibleMessages, messages.length);
8273
8317
  this.hasMore = this.olderMessages.length > 0;
8274
- this._sourceSubs = new subsink.SubSink();
8275
- this._sourceSubs.add(this._source.messageReceived
8276
- .subscribe(function (msg) { return _this.messageReceived(msg); }), this._source.messageSent
8277
- .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); }));
8278
8321
  if (this._source.currentUserChanged) {
8279
8322
  this._sourceSubs.add(this._source.currentUserChanged.subscribe(function (user) { return _this.currentUser = user; }));
8280
8323
  }
@@ -8290,16 +8333,17 @@
8290
8333
  this._reported.next(message);
8291
8334
  };
8292
8335
  CommentViewComponent.prototype.selectMessage = function (message) {
8293
- return __awaiter(this, void 0, void 0, function () {
8294
- return __generator(this, function (_a) {
8295
- this._selected.next(message);
8296
- return [2 /*return*/];
8297
- });
8298
- });
8336
+ this._selected.next(message);
8299
8337
  };
8300
8338
  CommentViewComponent.prototype.selectMessageUser = function (message) {
8301
8339
  this._userSelected.next(message);
8302
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
+ };
8303
8347
  CommentViewComponent.prototype.messageIdentity = function (index, chatMessage) {
8304
8348
  return chatMessage.id;
8305
8349
  };
@@ -8411,7 +8455,7 @@
8411
8455
  CommentViewComponent.decorators = [
8412
8456
  { type: core.Component, args: [{
8413
8457
  selector: 'banta-comment-view',
8414
- 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>",
8415
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}}"]
8416
8460
  },] }
8417
8461
  ];
@@ -8426,6 +8470,8 @@
8426
8470
  userSelected: [{ type: core.Output }],
8427
8471
  reported: [{ type: core.Output }],
8428
8472
  upvoted: [{ type: core.Output }],
8473
+ usernameSelected: [{ type: core.Output }],
8474
+ avatarSelected: [{ type: core.Output }],
8429
8475
  source: [{ type: core.Input }],
8430
8476
  genericAvatarUrl: [{ type: core.Input }],
8431
8477
  messageContainer: [{ type: core.ViewChild, args: ['messageContainer',] }],
@@ -8446,7 +8492,9 @@
8446
8492
  this._reported = new rxjs.Subject();
8447
8493
  this._selected = new rxjs.Subject();
8448
8494
  this._userSelected = new rxjs.Subject();
8449
- this._subs = new subsink.SubSink();
8495
+ this._usernameSelected = new rxjs.Subject();
8496
+ this._avatarSelected = new rxjs.Subject();
8497
+ this._subs = new rxjs.Subscription();
8450
8498
  this.hashtags = [
8451
8499
  { hashtag: 'error', description: 'Cause an error' },
8452
8500
  { hashtag: 'timeout', description: 'Cause a slow timeout error' },
@@ -8583,28 +8631,42 @@
8583
8631
  });
8584
8632
  Object.defineProperty(BantaCommentsComponent.prototype, "upvoted", {
8585
8633
  get: function () {
8586
- return this._upvoted;
8634
+ return this._upvoted.asObservable();
8587
8635
  },
8588
8636
  enumerable: false,
8589
8637
  configurable: true
8590
8638
  });
8591
8639
  Object.defineProperty(BantaCommentsComponent.prototype, "reported", {
8592
8640
  get: function () {
8593
- return this._reported;
8641
+ return this._reported.asObservable();
8594
8642
  },
8595
8643
  enumerable: false,
8596
8644
  configurable: true
8597
8645
  });
8598
8646
  Object.defineProperty(BantaCommentsComponent.prototype, "selected", {
8599
8647
  get: function () {
8600
- return this._selected;
8648
+ return this._selected.asObservable();
8601
8649
  },
8602
8650
  enumerable: false,
8603
8651
  configurable: true
8604
8652
  });
8605
8653
  Object.defineProperty(BantaCommentsComponent.prototype, "userSelected", {
8606
8654
  get: function () {
8607
- 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();
8608
8670
  },
8609
8671
  enumerable: false,
8610
8672
  configurable: true
@@ -8629,51 +8691,6 @@
8629
8691
  }, 5 * 1000);
8630
8692
  });
8631
8693
  };
8632
- BantaCommentsComponent.prototype.sendMessage = function () {
8633
- return __awaiter(this, void 0, void 0, function () {
8634
- var text, message, e_1;
8635
- return __generator(this, function (_b) {
8636
- switch (_b.label) {
8637
- case 0:
8638
- if (!this.source)
8639
- return [2 /*return*/];
8640
- this.sending = true;
8641
- this.sendError = null;
8642
- _b.label = 1;
8643
- case 1:
8644
- _b.trys.push([1, , 6, 7]);
8645
- text = (this.newMessageText || '').trim();
8646
- if (text === '')
8647
- return [2 /*return*/];
8648
- message = {
8649
- user: this.user,
8650
- sentAt: Date.now(),
8651
- upvotes: 0,
8652
- message: text
8653
- };
8654
- _b.label = 2;
8655
- case 2:
8656
- _b.trys.push([2, 4, , 5]);
8657
- return [4 /*yield*/, this.source.send(message)];
8658
- case 3:
8659
- _b.sent();
8660
- this.newMessageText = '';
8661
- return [3 /*break*/, 5];
8662
- case 4:
8663
- e_1 = _b.sent();
8664
- this.indicateError("Could not send: " + e_1.message);
8665
- console.error("Failed to send message: ", message);
8666
- console.error(e_1);
8667
- return [3 /*break*/, 5];
8668
- case 5: return [3 /*break*/, 7];
8669
- case 6:
8670
- this.sending = false;
8671
- return [7 /*endfinally*/];
8672
- case 7: return [2 /*return*/];
8673
- }
8674
- });
8675
- });
8676
- };
8677
8694
  BantaCommentsComponent.prototype.upvoteMessage = function (message) {
8678
8695
  return __awaiter(this, void 0, void 0, function () {
8679
8696
  return __generator(this, function (_b) {
@@ -8737,6 +8754,12 @@
8737
8754
  BantaCommentsComponent.prototype.selectMessageUser = function (message) {
8738
8755
  this._userSelected.next(message);
8739
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
+ };
8740
8763
  BantaCommentsComponent.prototype.sendReply = function () {
8741
8764
  return __awaiter(this, void 0, void 0, function () {
8742
8765
  return __generator(this, function (_b) {
@@ -8770,7 +8793,7 @@
8770
8793
  BantaCommentsComponent.decorators = [
8771
8794
  { type: core.Component, args: [{
8772
8795
  selector: 'banta-comments',
8773
- 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 ></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",
8774
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}}"]
8775
8798
  },] }
8776
8799
  ];
@@ -8801,7 +8824,9 @@
8801
8824
  upvoted: [{ type: core.Output }],
8802
8825
  reported: [{ type: core.Output }],
8803
8826
  selected: [{ type: core.Output }],
8804
- userSelected: [{ type: core.Output }]
8827
+ userSelected: [{ type: core.Output }],
8828
+ usernameSelected: [{ type: core.Output }],
8829
+ avatarSelected: [{ type: core.Output }]
8805
8830
  };
8806
8831
 
8807
8832
  var LiveCommentComponent = /** @class */ (function () {
@@ -9106,6 +9131,7 @@
9106
9131
  message = {
9107
9132
  user: this.user,
9108
9133
  sentAt: Date.now(),
9134
+ url: location.href,
9109
9135
  upvotes: 0,
9110
9136
  message: text
9111
9137
  };