@banta/sdk 4.6.19 → 4.6.21

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.
@@ -7350,27 +7350,26 @@ class ChatViewComponent {
7350
7350
  this.elementRef = elementRef;
7351
7351
  this._sourceSubs = new Subscription();
7352
7352
  this._selected = new Subject();
7353
+ this._selected$ = this._selected.asObservable();
7353
7354
  this._reported = new Subject();
7355
+ this._reported$ = this._reported.asObservable();
7354
7356
  this._upvoted = new Subject();
7357
+ this._upvoted$ = this._upvoted.asObservable();
7355
7358
  this._userSelected = new Subject();
7359
+ this._userSelected$ = this._userSelected.asObservable();
7360
+ this._received = new Subject();
7361
+ this._received$ = this._received.asObservable();
7356
7362
  this.messages = [];
7357
7363
  this.maxMessages = 200;
7358
7364
  }
7359
7365
  get source() {
7360
7366
  return this._source;
7361
7367
  }
7362
- get selected() {
7363
- return this._selected;
7364
- }
7365
- get userSelected() {
7366
- return this._userSelected;
7367
- }
7368
- get reported() {
7369
- return this._reported;
7370
- }
7371
- get upvoted() {
7372
- return this._upvoted;
7373
- }
7368
+ get selected() { return this._selected$; }
7369
+ get userSelected() { return this._userSelected$; }
7370
+ get reported() { return this._reported$; }
7371
+ get upvoted() { return this._upvoted$; }
7372
+ get received() { return this._received$; }
7374
7373
  set source(value) {
7375
7374
  if (this._sourceSubs) {
7376
7375
  this._sourceSubs.unsubscribe();
@@ -7417,6 +7416,7 @@ class ChatViewComponent {
7417
7416
  }
7418
7417
  messageReceived(message) {
7419
7418
  this.addMessage(message);
7419
+ this._received.next(message);
7420
7420
  if (this.isScrolledToLatest())
7421
7421
  setTimeout(() => this.scrollToLatest());
7422
7422
  }
@@ -7500,6 +7500,7 @@ ChatViewComponent.propDecorators = {
7500
7500
  userSelected: [{ type: Output }],
7501
7501
  reported: [{ type: Output }],
7502
7502
  upvoted: [{ type: Output }],
7503
+ received: [{ type: Output }],
7503
7504
  messageContainer: [{ type: ViewChild, args: ['messageContainer',] }],
7504
7505
  maxMessages: [{ type: Input }]
7505
7506
  };
@@ -7516,11 +7517,19 @@ class BantaChatComponent {
7516
7517
  this.sendLabel = 'Send';
7517
7518
  this.permissionDeniedLabel = 'Send';
7518
7519
  this._selected = new Subject();
7520
+ this._selected$ = this._selected.asObservable();
7519
7521
  this._reported = new Subject();
7522
+ this._reported$ = this._reported.asObservable();
7520
7523
  this._upvoted = new Subject();
7524
+ this._upvoted$ = this._upvoted.asObservable();
7521
7525
  this._userSelected = new Subject();
7522
- this._signInSelected = new Subject();
7526
+ this._userSelected$ = this._userSelected.asObservable();
7523
7527
  this._permissionDeniedError = new Subject();
7528
+ this._permissionDeniedError$ = this._permissionDeniedError.asObservable();
7529
+ this._signInSelected = new Subject();
7530
+ this._signInSelected$ = this._signInSelected.asObservable();
7531
+ this._received = new Subject();
7532
+ this._received$ = this._received.asObservable();
7524
7533
  this.showEmojiPanel = false;
7525
7534
  this.newMessage = {};
7526
7535
  }
@@ -7550,11 +7559,15 @@ class BantaChatComponent {
7550
7559
  this._source = yield this.backend.getSourceForTopic(topicID);
7551
7560
  });
7552
7561
  }
7553
- get signInSelected() {
7554
- return this._signInSelected;
7555
- }
7556
- get permissionDeniedError() {
7557
- return this._permissionDeniedError;
7562
+ get selected() { return this._selected$; }
7563
+ get reported() { return this._reported$; }
7564
+ get upvoted() { return this._upvoted$; }
7565
+ get userSelected() { return this._userSelected$; }
7566
+ get permissionDeniedError() { return this._permissionDeniedError$; }
7567
+ get signInSelected() { return this._signInSelected$; }
7568
+ get received() { return this._received$; }
7569
+ onReceived(message) {
7570
+ this._received.next(message);
7558
7571
  }
7559
7572
  showSignIn() {
7560
7573
  this._signInSelected.next();
@@ -7588,18 +7601,6 @@ class BantaChatComponent {
7588
7601
  this._upvoted.next(message);
7589
7602
  });
7590
7603
  }
7591
- get selected() {
7592
- return this._selected;
7593
- }
7594
- get reported() {
7595
- return this._reported;
7596
- }
7597
- get upvoted() {
7598
- return this._upvoted;
7599
- }
7600
- get userSelected() {
7601
- return this._userSelected;
7602
- }
7603
7604
  get canChat() {
7604
7605
  if (!this.user)
7605
7606
  return false;
@@ -7643,8 +7644,8 @@ class BantaChatComponent {
7643
7644
  BantaChatComponent.decorators = [
7644
7645
  { type: Component, args: [{
7645
7646
  selector: 'banta-chat',
7646
- 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>",
7647
- styles: [":host{flex-direction:column;border-radius:5px;padding:10px;font-size:10pt}.entry-container,:host{display:flex;flex-grow:1}.entry-container{flex-direction:row;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:1px solid #9da302;-webkit-text-fill-color:#9da302;-webkit-box-shadow:0 0 0 1000px #211e07 inset;-webkit-transition:background-color 5000s ease-in-out 0s;transition:background-color 5000s ease-in-out 0s;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:auto}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}"]
7647
+ 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 (received)=\"onMessageReceived($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>",
7648
+ styles: [":host{flex-direction:column;border-radius:5px;padding:10px;font-size:10pt;min-height:1px}.entry-container,:host{display:flex;flex-grow:1}.entry-container{flex-direction:row;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:1px solid #9da302;-webkit-text-fill-color:#9da302;-webkit-box-shadow:0 0 0 1000px #211e07 inset;-webkit-transition:background-color 5000s ease-in-out 0s;transition:background-color 5000s ease-in-out 0s;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:auto}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}"]
7648
7649
  },] }
7649
7650
  ];
7650
7651
  BantaChatComponent.ctorParameters = () => [
@@ -7657,13 +7658,14 @@ BantaChatComponent.propDecorators = {
7657
7658
  signInLabel: [{ type: Input }],
7658
7659
  sendLabel: [{ type: Input }],
7659
7660
  permissionDeniedLabel: [{ type: Input }],
7660
- signInSelected: [{ type: Output }],
7661
- permissionDeniedError: [{ type: Output }],
7662
- chatView: [{ type: ViewChild, args: ['chatView', { static: true },] }],
7663
7661
  selected: [{ type: Output }],
7664
7662
  reported: [{ type: Output }],
7665
7663
  upvoted: [{ type: Output }],
7666
- userSelected: [{ type: Output }]
7664
+ userSelected: [{ type: Output }],
7665
+ permissionDeniedError: [{ type: Output }],
7666
+ signInSelected: [{ type: Output }],
7667
+ received: [{ type: Output }],
7668
+ chatView: [{ type: ViewChild, args: ['chatView', { static: true },] }]
7667
7669
  };
7668
7670
 
7669
7671
  const COMPONENTS$2 = [
@@ -8584,6 +8586,7 @@ class BantaCommentsComponent {
8584
8586
  this.postCommentLabel = 'Post a comment';
8585
8587
  this.postReplyLabel = 'Post a reply';
8586
8588
  this.allowAttachments = true;
8589
+ this.maxVisibleMessages = 20;
8587
8590
  this.genericAvatarUrl = `https://gravatar.com/avatar/${Date.now().toString(16)}?s=512&d=robohash`;
8588
8591
  this.participants = [];
8589
8592
  this.hashtags = [