@banta/sdk 4.0.14 → 4.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/banta-sdk.umd.js +70 -14
- package/bundles/banta-sdk.umd.js.map +1 -1
- package/bundles/banta-sdk.umd.min.js +1 -1
- package/bundles/banta-sdk.umd.min.js.map +1 -1
- package/esm2015/lib/comments/banta-comments/banta-comments.component.js +23 -5
- package/esm2015/lib/comments/comment/comment.component.js +3 -3
- package/esm2015/lib/comments/comment-field/comment-field.component.js +1 -1
- package/esm2015/lib/emoji/emoji-selector-button.component.js +40 -27
- package/esm2015/lib/emoji/emoji-selector-panel/emoji-selector-panel.component.js +1 -1
- package/fesm2015/banta-sdk.js +64 -33
- package/fesm2015/banta-sdk.js.map +1 -1
- package/lib/comments/banta-comments/banta-comments.component.d.ts +9 -3
- package/lib/emoji/emoji-selector-button.component.d.ts +5 -0
- package/package.json +1 -1
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="@types/resize-observer-browser" />
|
|
2
|
+
import { Component, ElementRef, HostBinding, Output, ViewChild } from '@angular/core';
|
|
2
3
|
import { Subject, Observable } from 'rxjs';
|
|
3
4
|
export class EmojiSelectorButtonComponent {
|
|
4
|
-
constructor() {
|
|
5
|
+
constructor(elementRef) {
|
|
6
|
+
this.elementRef = elementRef;
|
|
5
7
|
this._selected = new Subject();
|
|
6
8
|
this.showEmojiPanel = false;
|
|
7
9
|
}
|
|
@@ -12,8 +14,8 @@ export class EmojiSelectorButtonComponent {
|
|
|
12
14
|
this.removeListener();
|
|
13
15
|
this.panelElement.nativeElement.remove();
|
|
14
16
|
}
|
|
17
|
+
get widthConstrained() { return this.width < 700; }
|
|
15
18
|
ngAfterViewInit() {
|
|
16
|
-
this.putPanelAtRoot();
|
|
17
19
|
}
|
|
18
20
|
putPanelAtRoot() {
|
|
19
21
|
// If we are in full-screen, placing the panel outside of the full-screen element will result in it
|
|
@@ -27,12 +29,17 @@ export class EmojiSelectorButtonComponent {
|
|
|
27
29
|
window.removeEventListener('resize', this.resizeListener);
|
|
28
30
|
}
|
|
29
31
|
place() {
|
|
32
|
+
// Not currently used as it can't be easily done handling all
|
|
33
|
+
// scrolling corner cases.
|
|
30
34
|
this.putPanelAtRoot();
|
|
31
35
|
let pos = this.buttonElement.nativeElement.getBoundingClientRect();
|
|
32
36
|
let size = this.panelElement.nativeElement.getBoundingClientRect();
|
|
33
37
|
let left = window.scrollX + pos.left + pos.width - size.width;
|
|
34
38
|
if (left < 0)
|
|
35
39
|
left = (window.scrollX + window.innerWidth) / 2 - size.width / 2;
|
|
40
|
+
let scrollY = window.scrollY;
|
|
41
|
+
if (document.fullscreenElement) {
|
|
42
|
+
}
|
|
36
43
|
Object.assign(this.panelElement.nativeElement.style, {
|
|
37
44
|
top: `${window.scrollY + pos.top + pos.height}px`,
|
|
38
45
|
left: `${Math.max(0, left)}px`
|
|
@@ -44,13 +51,32 @@ export class EmojiSelectorButtonComponent {
|
|
|
44
51
|
return;
|
|
45
52
|
}
|
|
46
53
|
this.showEmojiPanel = true;
|
|
47
|
-
this.place();
|
|
54
|
+
//this.place();
|
|
48
55
|
setTimeout(() => {
|
|
49
|
-
|
|
56
|
+
let onResize = () => {
|
|
50
57
|
if (!this.showEmojiPanel)
|
|
51
58
|
return;
|
|
52
|
-
this.
|
|
59
|
+
this.width = window.innerWidth;
|
|
60
|
+
this.height = window.innerHeight;
|
|
61
|
+
let edgeOffset = 0;
|
|
62
|
+
let commentField = this.elementRef.nativeElement.closest(`banta-comment-field`);
|
|
63
|
+
if (commentField) {
|
|
64
|
+
let size = commentField.getBoundingClientRect();
|
|
65
|
+
this.width = size.width;
|
|
66
|
+
edgeOffset = window.innerWidth - size.right;
|
|
67
|
+
}
|
|
68
|
+
let buttonRect = this.buttonElement.nativeElement.getBoundingClientRect();
|
|
69
|
+
let buttonRight = window.innerWidth - buttonRect.right - edgeOffset - 10;
|
|
70
|
+
if (this.width < 700) {
|
|
71
|
+
this.panelElement.nativeElement.style.right = `${-buttonRight}px`;
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
this.panelElement.nativeElement.style.right = '';
|
|
75
|
+
}
|
|
76
|
+
this.panelElement.nativeElement.style.maxWidth = `${this.width - 15}px`;
|
|
53
77
|
};
|
|
78
|
+
this.resizeListener = onResize;
|
|
79
|
+
onResize();
|
|
54
80
|
this.clickListener = (ev) => {
|
|
55
81
|
let parent = ev.target;
|
|
56
82
|
let isInDialog = false;
|
|
@@ -93,8 +119,8 @@ EmojiSelectorButtonComponent.decorators = [
|
|
|
93
119
|
|
|
94
120
|
emoji-selector-panel {
|
|
95
121
|
position: absolute;
|
|
96
|
-
|
|
97
|
-
right: 0;
|
|
122
|
+
top: 2.5em;
|
|
123
|
+
right: 0;
|
|
98
124
|
opacity: 0;
|
|
99
125
|
pointer-events: none;
|
|
100
126
|
z-index: 10;
|
|
@@ -108,29 +134,16 @@ EmojiSelectorButtonComponent.decorators = [
|
|
|
108
134
|
button {
|
|
109
135
|
color: #666
|
|
110
136
|
}
|
|
111
|
-
|
|
112
|
-
/* :host.bottom-left emoji-selector-panel {
|
|
113
|
-
right: auto;
|
|
114
|
-
left: 0;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
:host.top-right emoji-selector-panel {
|
|
118
|
-
top: 2.4em;
|
|
119
|
-
bottom: auto;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
:host.top-left emoji-selector-panel {
|
|
123
|
-
top: 2.4em;
|
|
124
|
-
bottom: auto;
|
|
125
|
-
left: 0;
|
|
126
|
-
right: auto;
|
|
127
|
-
} */
|
|
128
137
|
`]
|
|
129
138
|
},] }
|
|
130
139
|
];
|
|
140
|
+
EmojiSelectorButtonComponent.ctorParameters = () => [
|
|
141
|
+
{ type: ElementRef }
|
|
142
|
+
];
|
|
131
143
|
EmojiSelectorButtonComponent.propDecorators = {
|
|
132
144
|
selected: [{ type: Output }],
|
|
133
145
|
panelElement: [{ type: ViewChild, args: ['panel', { read: ElementRef },] }],
|
|
134
|
-
buttonElement: [{ type: ViewChild, args: ['button', { read: ElementRef },] }]
|
|
146
|
+
buttonElement: [{ type: ViewChild, args: ['button', { read: ElementRef },] }],
|
|
147
|
+
widthConstrained: [{ type: HostBinding, args: ['class.width-constrained',] }]
|
|
135
148
|
};
|
|
136
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW1vamktc2VsZWN0b3ItYnV0dG9uLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3Nkay9zcmMvbGliL2Vtb2ppL2Vtb2ppLXNlbGVjdG9yLWJ1dHRvbi5jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFNBQVMsRUFBRSxVQUFVLEVBQUUsTUFBTSxFQUFFLFNBQVMsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUN6RSxPQUFPLEVBQUUsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLE1BQU0sQ0FBQztBQXdEM0MsTUFBTSxPQUFPLDRCQUE0QjtJQXREekM7UUF3RFksY0FBUyxHQUFHLElBQUksT0FBTyxFQUFVLENBQUM7UUFHMUMsbUJBQWMsR0FBRyxLQUFLLENBQUM7SUFnRzNCLENBQUM7SUE5RkcsSUFDSSxRQUFRO1FBQ1IsT0FBTyxJQUFJLENBQUMsU0FBUyxDQUFDO0lBQzFCLENBQUM7SUFRRCxXQUFXO1FBQ1AsSUFBSSxDQUFDLGNBQWMsRUFBRSxDQUFDO1FBQ3RCLElBQUksQ0FBQyxZQUFZLENBQUMsYUFBYSxDQUFDLE1BQU0sRUFBRSxDQUFDO0lBQzdDLENBQUM7SUFFRCxlQUFlO1FBQ1gsSUFBSSxDQUFDLGNBQWMsRUFBRSxDQUFDO0lBQzFC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G9yOiAnZW1vamktc2VsZWN0b3ItYnV0dG9uJyxcclxuICAgIHRlbXBsYXRlOiBgXHJcbiAgICAgICAgPGJ1dHRvbiAjYnV0dG9uIHR5cGU9XCJidXR0b25cIiBtYXQtaWNvbi1idXR0b24gKGNsaWNrKT1cInNob3coKVwiPlxyXG4gICAgICAgICAgICA8bWF0LWljb24+ZW1vamlfZW1vdGlvbnM8L21hdC1pY29uPlxyXG4gICAgICAgIDwvYnV0dG9uPlxyXG4gICAgICAgIDxlbW9qaS1zZWxlY3Rvci1wYW5lbCBcclxuICAgICAgICAgICAgI3BhbmVsXHJcbiAgICAgICAgICAgIChzZWxlY3RlZCk9XCJpbnNlcnQoJGV2ZW50KVwiXHJcbiAgICAgICAgICAgIFtjbGFzcy52aXNpYmxlXT1cInNob3dFbW9qaVBhbmVsXCJcclxuICAgICAgICAgICAgPjwvZW1vamktc2VsZWN0b3ItcGFuZWw+XHJcbiAgICBgLFxyXG4gICAgc3R5bGVzOiBbYFxyXG4gICAgICAgIDpob3N0IHtcclxuICAgICAgICAgICAgZGlzcGxheTogYmxvY2s7XHJcbiAgICAgICAgICAgIHBvc2l0aW9uOiByZWxhdGl2ZTtcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIGVtb2ppLXNlbGVjdG9yLXBhbmVsIHtcclxuICAgICAgICAgICAgcG9zaXRpb246IGFic29sdXRlO1xyXG4gICAgICAgICAgICAvKiBib3R0b206IDIuNWVtO1xyXG4gICAgICAgICAgICByaWdodDogMDsgKi9cclxuICAgICAgICAgICAgb3BhY2l0eTogMDtcclxuICAgICAgICAgICAgcG9pbnRlci1ldmVudHM6IG5vbmU7XHJcbiAgICAgICAgICAgIHotaW5kZXg6IDEwO1xyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgZW1vamktc2VsZWN0b3ItcGFuZWwudmlzaWJsZSB7XHJcbiAgICAgICAgICAgIHBvaW50ZXItZXZlbnRzOiBpbml0aWFsO1xyXG4gICAgICAgICAgICBvcGFjaXR5OiAxO1xyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgYnV0dG9uIHtcclxuICAgICAgICAgICAgY29sb3I6ICM2NjZcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIC8qIDpob3N0LmJvdHRvbS1sZWZ0IGVtb2ppLXNlbGVjdG9yLXBhbmVsIHtcclxuICAgICAgICAgICAgcmlnaHQ6IGF1dG87XHJcbiAgICAgICAgICAgIGxlZnQ6IDA7XHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICA6aG9zdC50b3AtcmlnaHQgZW1vamktc2VsZWN0b3ItcGFuZWwge1xyXG4gICAgICAgICAgICB0b3A6IDIuNGVtO1xyXG4gICAgICAgICAgICBib3R0b206IGF1dG87XHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICA6aG9zdC50b3AtbGVmdCBlbW9qaS1zZWxlY3Rvci1wYW5lbCB7XHJcbiAgICAgICAgICAgIHRvcDogMi40ZW07XHJcbiAgICAgICAgICAgIGJvdHRvbTogYXV0bztcclxuICAgICAgICAgICAgbGVmdDogMDtcclxuICAgICAgICAgICAgcmlnaHQ6IGF1dG87XHJcbiAgICAgICAgfSAqL1xyXG4gICAgYF1cclxufSlcclxuZXhwb3J0IGNsYXNzIEVtb2ppU2VsZWN0b3JCdXR0b25Db21wb25lbnQge1xyXG5cclxuICAgIHByaXZhdGUgX3NlbGVjdGVkID0gbmV3IFN1YmplY3Q8c3RyaW5nPigpO1xyXG4gICAgcHJpdmF0ZSBjbGlja0xpc3RlbmVyIDogYW55O1xyXG4gICAgcHJpdmF0ZSByZXNpemVMaXN0ZW5lciA6IGFueTtcclxuICAgIHNob3dFbW9qaVBhbmVsID0gZmFsc2U7XHJcblxyXG4gICAgQE91dHB1dCgpXHJcbiAgICBnZXQgc2VsZWN0ZWQoKSA6IE9ic2VydmFibGU8c3RyaW5nPiB7XHJcbiAgICAgICAgcmV0dXJuIHRoaXMuX3NlbGVjdGVkO1xyXG4gICAgfVxyXG5cclxuICAgIEBW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hdGgubWF4KDAsIGxlZnQpfXB4YFxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgKTtcclxuICAgIH1cclxuXHJcbiAgICBzaG93KCkge1xyXG4gICAgICAgIGlmICh0aGlzLnNob3dFbW9qaVBhbmVsKSB7XHJcbiAgICAgICAgICAgIHRoaXMuc2hvd0Vtb2ppUGFuZWwgPSBmYWxzZTtcclxuICAgICAgICAgICAgcmV0dXJuO1xyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgdGhpcy5zaG93RW1vamlQYW5lbCA9IHRydWU7XHJcbiAgICAgICAgdGhpcy5wbGFjZSgpO1xyXG5cclxuICAgICAgICBzZXRUaW1lb3V0KCgpID0+IHtcclxuICAgICAgICAgICAgdGhpcy5yZXNpemVMaXN0ZW5lciA9ICgpID0+IHtcclxuICAgICAgICAgICAgICAgIGlmICghdGhpcy5zaG93RW1vamlQYW5lbClcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgICAgICAgICB0aGlzLnBsYWNlKCk7XHJcbiAgICAgICAgICAgIH07XHJcblxyXG4gICAgICAgICAgICB0aGlzLmNsaWNrTGlzdGVuZXIgPSAoZXYgOiBNb3VzZUV2ZW50KSA9PiB7XHJcblxyXG4gICAgICAgICAgICAgICAgbGV0IHBhcmVudCA9IDxIVE1MRWxlbWVudD4gZXYudGFyZ2V0O1xyXG4gICAgICAgICAgICAgICAgbGV0IGlzSW5EaWFsb2cgPSBmYWxzZTtcclxuICAgICAgICAgICAgICAgIFxyXG4gICAgICAgICAgICAgICAgd2hpbGUgKHBhcmVudCkge1xyXG4gICAgICAgICAgICAgICAgICAgIGlmIChwYXJlbnQubWF0Y2hlcygnZW1vamktc2VsZWN0b3ItcGFuZWwnKSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgaXNJbkRpYWxvZyA9IHRydWU7XHJcblxyXG4gICAgICAgICAgICAgICAgICAgIHBhcmVudCA9IHBhcmVudC5wYXJlbnRFbGVtZW50O1xyXG4gICAgICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgICAgIGlmIChpc0luRGlhbG9nKVxyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcclxuXHJcbiAgICAgICAgICAgICAgICB0aGlzLnNob3dFbW9qaVBhbmVsID0gZmFsc2U7XHJcbiAgICAgICAgICAgICAgICB0aGlzLnJlbW92ZUxpc3RlbmVyKCk7XHJcbiAgICAgICAgICAgIH07XHJcbiAgICBcclxuICAgICAgICAgICAgZG9jdW1lbnQuYWRkRXZlbnRMaXN0ZW5lcignY2xpY2snLCB0aGlzLmNsaWNrTGlzdGVuZXIpO1xyXG4gICAgICAgICAgICB3aW5kb3cuYWRkRXZlbnRMaXN0ZW5lcigncmVzaXplJywgdGhpcy5yZXNpemVMaXN0ZW5lcik7XHJcbiAgICAgICAgfSk7XHJcbiAgICB9XHJcblxyXG4gICAgaW5zZXJ0KHN0cikge1xyXG4gICAgICAgIHRoaXMuX3NlbGVjdGVkLm5leHQoc3RyKTtcclxuICAgIH1cclxufSJdfQ==
|
|
149
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW1vamktc2VsZWN0b3ItYnV0dG9uLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3Nkay9zcmMvbGliL2Vtb2ppL2Vtb2ppLXNlbGVjdG9yLWJ1dHRvbi5jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsd0RBQXdEO0FBRXhELE9BQU8sRUFBRSxTQUFTLEVBQUUsVUFBVSxFQUFFLFdBQVcsRUFBRSxNQUFNLEVBQUUsU0FBUyxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQ3RGLE9BQU8sRUFBRSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sTUFBTSxDQUFDO0FBdUMzQyxNQUFNLE9BQU8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taWNvbj5cclxuICAgICAgICA8L2J1dHRvbj5cclxuICAgICAgICA8ZW1vamktc2VsZWN0b3ItcGFuZWwgXHJcbiAgICAgICAgICAgICNwYW5lbFxyXG4gICAgICAgICAgICAoc2VsZWN0ZWQpPVwiaW5zZXJ0KCRldmVudClcIlxyXG4gICAgICAgICAgICBbY2xhc3MudmlzaWJsZV09XCJzaG93RW1vamlQYW5lbFwiXHJcbiAgICAgICAgICAgID48L2Vtb2ppLXNlbGVjdG9yLXBhbmVsPlxyXG4gICAgYCxcclxuICAgIHN0eWxlczogW2BcclxuICAgICAgICA6aG9zdCB7XHJcbiAgICAgICAgICAgIGRpc3BsYXk6IGJsb2NrO1xyXG4gICAgICAgICAgICBwb3NpdGlvbjogcmVsYXRpdmU7XHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICBlbW9qaS1zZWxlY3Rvci1wYW5lbCB7XHJcbiAgICAgICAgICAgIHBvc2l0aW9uOiBhYnNvbHV0ZTtcclxuICAgICAgICAgICAgdG9wOiAyLjVlbTtcclxuICAgICAgICAgICAgcmlnaHQ6IDA7XHJcbiAgICAgICAgICAgIG9wYWNpdHk6IDA7XHJcbiAgICAgICAgICAgIHBvaW50ZXItZXZlbnRzOiBub25lO1xyXG4gICAgICAgICAgICB6LWluZGV4OiAxMDtcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIGVtb2ppLXNlbGVjdG9yLXBhbmVsLnZpc2libGUge1xyXG4gICAgICAgICAgICBwb2ludGVyLWV2ZW50czogaW5pdGlhbDtcclxuICAgICAgICAgICAgb3BhY2l0eTogMTtcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIGJ1dHRvbiB7XHJcbiAgICAgICAgICAgIGNvbG9yOiAjNjY2XHJcbiAgICAgICAgfVxyXG4gICAgYF1cclxufSlcclxuZXhwb3J0IGNsYXNzIEVtb2ppU2VsZWN0b3JCdXR0b25Db21wb25lbnQge1xyXG4gICAgY29uc3RydWN0b3IocHJpdmF0ZSBlbGVtZW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cgY29ybmVyIGNhc2VzLlxyXG5cclxuICAgICAgICB0aGlzLnB1dFBhbmVsQXRSb290KCk7XHJcbiAgICAgICAgbGV0IHBvcyA9IHRoaXMuYnV0dG9uRWxlbWVudC5uYXRpdmVFbGVtZW50LmdldEJvdW5kaW5nQ2xpZW50UmVjdCgpO1xyXG4gICAgICAgIGxldCBzaXplID0gdGhpcy5wYW5lbEVsZW1lbnQubmF0aXZlRWxlbWVudC5nZXRCb3VuZGluZ0NsaWVudFJlY3QoKTtcclxuICAgICAgICBsZXQgbGVmdCA9IHdpbmRvdy5zY3JvbGxYICsgcG9zLmxlZnQgKyBwb3Mud2lkdGggLSBzaXplLndpZHRoO1xyXG4gICAgICAgIGlmIChsZWZ0IDwgMClcclxuICAgICAgICAgICAgbGVmdCA9ICh3aW5kb3cuc2Nyb2xsWCArIHdpbmRvdy5pbm5lcldpZHRoKSAvIDIgLSBzaXplLndpZHRoIC8gMjtcclxuICAgICAgICBsZXQgc2Nyb2xsWSA9IHdpbmRvdy5zY3JvbGxZO1xyXG4gICAgICAgIGlmIChkb2N1bWVudC5mdWxsc2NyZWVuRWxlbWVudCkge1xyXG4gICAgICAgICAgICBcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIE9iamVjdC5hc3NpZ24oXHJcbiAgICAgICAgICAgIHRoaXMucGFuZWxFbGVtZW50Lm5hdGl2ZUVsZW1lbnQuc3R5bGUsXHJcbiAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgIHRvcDogYCR7d2luZG93LnNjcm9sbFkgKyBwb3MudG9wICsgcG9zLmhlaWdodH1weGAsXHJcbiAgICAgICAgICAgICAgICBsZWZ0OiBgJHtNYXRoLm1heCgwLCBsZWZ0KX1weGBcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICk7XHJcbiAgICB9XHJcblxyXG4gICAgc2hvdygpIHtcclxuICAgICAgICBpZiAodGhpcy5zaG93RW1vamlQYW5lbCkge1xyXG4gICAgICAgICAgICB0aGlzLnNob3dFbW9qaVBhbmVsID0gZmFsc2U7XHJcbiAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIHRoaXMuc2hvd0Vtb2ppUGFuZWwgPSB0cnVlO1xyXG4gICAgICAgIC8vdGhpcy5wbGFjZSgpO1xyXG5cclxuICAgICAgICBzZXRUaW1lb3V0KCgpID0+IHtcclxuICAgICAgICAgICAgbGV0IG9uUmVzaXplID0gKCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgaWYgKCF0aGlzLnNob3dFbW9qaVBhbmVsKVxyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICAgICAgICAgIHRoaXMud2lkdGggPSB3aW5kb3cuaW5uZXJXaWR0aDtcclxuICAgICAgICAgICAgICAgIHRoaXMuaGVpZ2h0ID0gd2luZG93LmlubmVySGVpZ2h0O1xyXG5cclxuICAgICAgICAgICAgICAgIGxldCBlZGdlT2Zmc2V0ID0gMDtcclxuICAgICAgICAgICAgICAgIGxldCBjb21tZW50RmllbGQgPSB0aGlzLmVsZW1lbnRSZWYubmF0aXZlRWxlbWVudC5jbG9zZXN0KGBiYW50YS1jb21tZW50LWZpZWxkYCk7XHJcbiAgICAgICAgICAgICAgICBpZiAoY29tbWVudEZpZWxkKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgbGV0IHNpemUgPSBjb21tZW50RmllbGQuZ2V0Qm91bmRpbmdDbGllbnRSZWN0KCk7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy53aWR0aCA9IHNpemUud2lkdGg7XHJcbiAgICAgICAgICAgICAgICAgICAgZWRnZU9mZnNldCA9IHdpbmRvdy5pbm5lcldpZHRoIC0gc2l6ZS5yaWdodDtcclxuICAgICAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgICAgICBsZXQgYnV0dG9uUmVjdCA9IHRoaXMuYnV0dG9uRWxlbWVudC5uYXRpdmVFbGVtZW50LmdldEJvdW5kaW5nQ2xpZW50UmVjdCgpO1xyXG4gICAgICAgICAgICAgICAgbGV0IGJ1dHRvblJpZ2h0ID0gd2luZG93LmlubmVyV2lkdGggLSBidXR0b25SZWN0LnJpZ2h0IC0gZWRnZU9mZnNldCAtIDEwO1xyXG5cclxuICAgICAgICAgICAgICAgIGlmICh0aGlzLndpZHRoIDwgNzAwKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5wYW5lbEVsZW1lbnQubmF0aXZlRWxlbWVudC5zdHlsZS5yaWdodCA9IGAkey1idXR0b25SaWdodH1weGA7XHJcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMucGFuZWxFbGVtZW50Lm5hdGl2ZUVsZW1lbnQuc3R5bGUucmlnaHQgPSAnJztcclxuICAgICAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgICAgICB0aGlzLnBhbmVsRWxlbWVudC5uYXRpdmVFbGVtZW50LnN0eWxlLm1heFdpZHRoID0gYCR7dGhpcy53aWR0aCAtIDE1fXB4YDtcclxuICAgICAgICAgICAgfTtcclxuXHJcbiAgICAgICAgICAgIHRoaXMucmVzaXplTGlzdGVuZXIgPSBvblJlc2l6ZTtcclxuICAgICAgICAgICAgb25SZXNpemUoKTtcclxuXHJcbiAgICAgICAgICAgIHRoaXMuY2xpY2tMaXN0ZW5lciA9IChldiA6IE1vdXNlRXZlbnQpID0+IHtcclxuXHJcbiAgICAgICAgICAgICAgICBsZXQgcGFyZW50ID0gPEhUTUxFbGVtZW50PiBldi50YXJnZXQ7XHJcbiAgICAgICAgICAgICAgICBsZXQgaXNJbkRpYWxvZyA9IGZhbHNlO1xyXG4gICAgICAgICAgICAgICAgXHJcbiAgICAgICAgICAgICAgICB3aGlsZSAocGFyZW50KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKHBhcmVudC5tYXRjaGVzKCdlbW9qaS1zZWxlY3Rvci1wYW5lbCcpKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBpc0luRGlhbG9nID0gdHJ1ZTtcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgcGFyZW50ID0gcGFyZW50LnBhcmVudEVsZW1lbnQ7XHJcbiAgICAgICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAgICAgaWYgKGlzSW5EaWFsb2cpXHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xyXG5cclxuICAgICAgICAgICAgICAgIHRoaXMuc2hvd0Vtb2ppUGFuZWwgPSBmYWxzZTtcclxuICAgICAgICAgICAgICAgIHRoaXMucmVtb3ZlTGlzdGVuZXIoKTtcclxuICAgICAgICAgICAgfTtcclxuICAgIFxyXG4gICAgICAgICAgICBkb2N1bWVudC5hZGRFdmVudExpc3RlbmVyKCdjbGljaycsIHRoaXMuY2xpY2tMaXN0ZW5lcik7XHJcbiAgICAgICAgICAgIHdpbmRvdy5hZGRFdmVudExpc3RlbmVyKCdyZXNpemUnLCB0aGlzLnJlc2l6ZUxpc3RlbmVyKTtcclxuICAgICAgICB9KTtcclxuICAgIH1cclxuXHJcbiAgICBpbnNlcnQoc3RyKSB7XHJcbiAgICAgICAgdGhpcy5fc2VsZWN0ZWQubmV4dChzdHIpO1xyXG4gICAgfVxyXG59Il19
|
|
@@ -74,7 +74,7 @@ EmojiSelectorPanelComponent.decorators = [
|
|
|
74
74
|
{ type: Component, args: [{
|
|
75
75
|
selector: 'emoji-selector-panel',
|
|
76
76
|
template: "<div class=\"search-box\" *ngIf=\"searchVisible\">\r\n\t<a mat-icon-button href=\"javascript:;\" (click)=\"hideSearch()\">\r\n\t\t<mat-icon>arrow_back</mat-icon>\r\n\t</a>\r\n\t<mat-form-field appearance=\"outline\" floatLabel=\"always\">\r\n\t\t<mat-label>Search for emoji</mat-label>\r\n\t\t<input name=\"search\" type=\"text\" matInput placeholder=\"Start typing\" [(ngModel)]=\"searchQuery\" />\r\n\t</mat-form-field>\r\n</div>\r\n\r\n<div class=\"selector\">\r\n\t<ng-container *ngIf=\"searchVisible\">\r\n\t\t<div class=\"emoji-list\">\r\n\t\t\t<a href=\"javascript:;\" (click)=\"select(emoji.char)\" \r\n\t\t\t\t*ngFor=\"let emoji of searchResults\" [innerHtml]=\"emoji.html || ''\">\r\n\t\t\t</a>\r\n\t\t</div>\r\n\t</ng-container>\r\n\t<ng-container *ngIf=\"!searchVisible\">\r\n\t\t<div class=\"categories\">\r\n\t\t\t<ng-container *ngIf=\"!searchVisible\">\r\n\t\t\t\t<a [title]=\"humanize(category.name)\" [class.active]=\"activeCategory === category.name\" mat-icon-button *ngFor=\"let category of categories\" (click)=\"activeCategory = category.name\">\r\n\t\t\t\t\t<mat-icon>{{category.icon}}</mat-icon>\r\n\t\t\t\t</a>\r\n\r\n\t\t\t\t<a title=\"Search\" [class.active] mat-icon-button (click)=\"showSearch()\">\r\n\t\t\t\t\t<mat-icon>search</mat-icon>\r\n\t\t\t\t</a>\r\n\t\t\t</ng-container>\r\n\t\t</div>\r\n\t\t<ng-container *ngFor=\"let category of categories\">\r\n\t\t\t<div class=\"emoji-list\" *ngIf=\"activeCategory && activeCategory == category.name\">\r\n\t\t\t\t<a href=\"javascript:;\" (click)=\"select(emoji.char)\" \r\n\t\t\t\t\t*ngFor=\"let emoji of category.emojis\" [innerHtml]=\"emoji.html || ''\">\r\n\t\t\t\t</a>\r\n\t\t\t</div>\r\n\t\t</ng-container>\r\n\t</ng-container>\r\n</div>",
|
|
77
|
-
styles: [":host{background:#111;color:#fff;border:1px solid #333;border-radius:5px;padding:.5em;width:calc(9*(32px + 1em));max-width:calc(100vw - 1.5em)}.selector{display:flex;flex-direction:column}.categories a{opacity:.25;transition:opacity .4s ease-in-out}.categories a:hover{opacity:.5}.categories a.active{opacity:1}.emoji-list{flex-grow:1;overflow-y:auto;height:20em}.emoji-list a{display:inline-block;padding:2px;margin:4px;background-color:#111}.emoji-list a ::ng-deep .emoji{width:32px;height:32px}.emoji-list a:hover{background-color:#333}.search-box{display:flex;align-items:baseline}.search-box mat-form-field{flex-grow:1}@media (max-width:500px){.selector{flex-direction:row;height:27em}.emoji-list{height:auto}}"]
|
|
77
|
+
styles: [":host{background:#111;color:#fff;border:1px solid #333;border-radius:5px;padding:.5em;width:calc(9*(32px + 1em));max-width:calc(100vw - 1.5em - 5px)}.selector{display:flex;flex-direction:column}.categories a{opacity:.25;transition:opacity .4s ease-in-out}.categories a:hover{opacity:.5}.categories a.active{opacity:1}.emoji-list{flex-grow:1;overflow-y:auto;height:20em}.emoji-list a{display:inline-block;padding:2px;margin:4px;background-color:#111}.emoji-list a ::ng-deep .emoji{width:32px;height:32px}.emoji-list a:hover{background-color:#333}.search-box{display:flex;align-items:baseline}.search-box mat-form-field{flex-grow:1}@media (max-width:500px){.selector{flex-direction:row;height:27em}.emoji-list{height:auto}}:host-context(.banta-mobile) .selector{flex-direction:row;height:27em}:host-context(.banta-mobile) .emoji-list{height:auto}"]
|
|
78
78
|
},] }
|
|
79
79
|
];
|
|
80
80
|
EmojiSelectorPanelComponent.ctorParameters = () => [
|
package/fesm2015/banta-sdk.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Observable, Subject, BehaviorSubject, Subscription } from 'rxjs';
|
|
2
2
|
import { publish } from 'rxjs/operators';
|
|
3
|
-
import { Component, Input, ViewChild, NgModule, Output, ElementRef, HostBinding, Injectable, Inject } from '@angular/core';
|
|
3
|
+
import { Component, Input, ViewChild, NgModule, Output, ElementRef, HostBinding, NgZone, Injectable, Inject } from '@angular/core';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
5
|
import { MatIconModule } from '@angular/material/icon';
|
|
6
6
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
@@ -6761,7 +6761,7 @@ EmojiSelectorPanelComponent.decorators = [
|
|
|
6761
6761
|
{ type: Component, args: [{
|
|
6762
6762
|
selector: 'emoji-selector-panel',
|
|
6763
6763
|
template: "<div class=\"search-box\" *ngIf=\"searchVisible\">\r\n\t<a mat-icon-button href=\"javascript:;\" (click)=\"hideSearch()\">\r\n\t\t<mat-icon>arrow_back</mat-icon>\r\n\t</a>\r\n\t<mat-form-field appearance=\"outline\" floatLabel=\"always\">\r\n\t\t<mat-label>Search for emoji</mat-label>\r\n\t\t<input name=\"search\" type=\"text\" matInput placeholder=\"Start typing\" [(ngModel)]=\"searchQuery\" />\r\n\t</mat-form-field>\r\n</div>\r\n\r\n<div class=\"selector\">\r\n\t<ng-container *ngIf=\"searchVisible\">\r\n\t\t<div class=\"emoji-list\">\r\n\t\t\t<a href=\"javascript:;\" (click)=\"select(emoji.char)\" \r\n\t\t\t\t*ngFor=\"let emoji of searchResults\" [innerHtml]=\"emoji.html || ''\">\r\n\t\t\t</a>\r\n\t\t</div>\r\n\t</ng-container>\r\n\t<ng-container *ngIf=\"!searchVisible\">\r\n\t\t<div class=\"categories\">\r\n\t\t\t<ng-container *ngIf=\"!searchVisible\">\r\n\t\t\t\t<a [title]=\"humanize(category.name)\" [class.active]=\"activeCategory === category.name\" mat-icon-button *ngFor=\"let category of categories\" (click)=\"activeCategory = category.name\">\r\n\t\t\t\t\t<mat-icon>{{category.icon}}</mat-icon>\r\n\t\t\t\t</a>\r\n\r\n\t\t\t\t<a title=\"Search\" [class.active] mat-icon-button (click)=\"showSearch()\">\r\n\t\t\t\t\t<mat-icon>search</mat-icon>\r\n\t\t\t\t</a>\r\n\t\t\t</ng-container>\r\n\t\t</div>\r\n\t\t<ng-container *ngFor=\"let category of categories\">\r\n\t\t\t<div class=\"emoji-list\" *ngIf=\"activeCategory && activeCategory == category.name\">\r\n\t\t\t\t<a href=\"javascript:;\" (click)=\"select(emoji.char)\" \r\n\t\t\t\t\t*ngFor=\"let emoji of category.emojis\" [innerHtml]=\"emoji.html || ''\">\r\n\t\t\t\t</a>\r\n\t\t\t</div>\r\n\t\t</ng-container>\r\n\t</ng-container>\r\n</div>",
|
|
6764
|
-
styles: [":host{background:#111;color:#fff;border:1px solid #333;border-radius:5px;padding:.5em;width:calc(9*(32px + 1em));max-width:calc(100vw - 1.5em)}.selector{display:flex;flex-direction:column}.categories a{opacity:.25;transition:opacity .4s ease-in-out}.categories a:hover{opacity:.5}.categories a.active{opacity:1}.emoji-list{flex-grow:1;overflow-y:auto;height:20em}.emoji-list a{display:inline-block;padding:2px;margin:4px;background-color:#111}.emoji-list a ::ng-deep .emoji{width:32px;height:32px}.emoji-list a:hover{background-color:#333}.search-box{display:flex;align-items:baseline}.search-box mat-form-field{flex-grow:1}@media (max-width:500px){.selector{flex-direction:row;height:27em}.emoji-list{height:auto}}"]
|
|
6764
|
+
styles: [":host{background:#111;color:#fff;border:1px solid #333;border-radius:5px;padding:.5em;width:calc(9*(32px + 1em));max-width:calc(100vw - 1.5em - 5px)}.selector{display:flex;flex-direction:column}.categories a{opacity:.25;transition:opacity .4s ease-in-out}.categories a:hover{opacity:.5}.categories a.active{opacity:1}.emoji-list{flex-grow:1;overflow-y:auto;height:20em}.emoji-list a{display:inline-block;padding:2px;margin:4px;background-color:#111}.emoji-list a ::ng-deep .emoji{width:32px;height:32px}.emoji-list a:hover{background-color:#333}.search-box{display:flex;align-items:baseline}.search-box mat-form-field{flex-grow:1}@media (max-width:500px){.selector{flex-direction:row;height:27em}.emoji-list{height:auto}}:host-context(.banta-mobile) .selector{flex-direction:row;height:27em}:host-context(.banta-mobile) .emoji-list{height:auto}"]
|
|
6765
6765
|
},] }
|
|
6766
6766
|
];
|
|
6767
6767
|
EmojiSelectorPanelComponent.ctorParameters = () => [
|
|
@@ -6771,8 +6771,10 @@ EmojiSelectorPanelComponent.propDecorators = {
|
|
|
6771
6771
|
selected: [{ type: Output }]
|
|
6772
6772
|
};
|
|
6773
6773
|
|
|
6774
|
+
/// <reference types="@types/resize-observer-browser" />
|
|
6774
6775
|
class EmojiSelectorButtonComponent {
|
|
6775
|
-
constructor() {
|
|
6776
|
+
constructor(elementRef) {
|
|
6777
|
+
this.elementRef = elementRef;
|
|
6776
6778
|
this._selected = new Subject();
|
|
6777
6779
|
this.showEmojiPanel = false;
|
|
6778
6780
|
}
|
|
@@ -6783,8 +6785,8 @@ class EmojiSelectorButtonComponent {
|
|
|
6783
6785
|
this.removeListener();
|
|
6784
6786
|
this.panelElement.nativeElement.remove();
|
|
6785
6787
|
}
|
|
6788
|
+
get widthConstrained() { return this.width < 700; }
|
|
6786
6789
|
ngAfterViewInit() {
|
|
6787
|
-
this.putPanelAtRoot();
|
|
6788
6790
|
}
|
|
6789
6791
|
putPanelAtRoot() {
|
|
6790
6792
|
// If we are in full-screen, placing the panel outside of the full-screen element will result in it
|
|
@@ -6798,12 +6800,17 @@ class EmojiSelectorButtonComponent {
|
|
|
6798
6800
|
window.removeEventListener('resize', this.resizeListener);
|
|
6799
6801
|
}
|
|
6800
6802
|
place() {
|
|
6803
|
+
// Not currently used as it can't be easily done handling all
|
|
6804
|
+
// scrolling corner cases.
|
|
6801
6805
|
this.putPanelAtRoot();
|
|
6802
6806
|
let pos = this.buttonElement.nativeElement.getBoundingClientRect();
|
|
6803
6807
|
let size = this.panelElement.nativeElement.getBoundingClientRect();
|
|
6804
6808
|
let left = window.scrollX + pos.left + pos.width - size.width;
|
|
6805
6809
|
if (left < 0)
|
|
6806
6810
|
left = (window.scrollX + window.innerWidth) / 2 - size.width / 2;
|
|
6811
|
+
let scrollY = window.scrollY;
|
|
6812
|
+
if (document.fullscreenElement) {
|
|
6813
|
+
}
|
|
6807
6814
|
Object.assign(this.panelElement.nativeElement.style, {
|
|
6808
6815
|
top: `${window.scrollY + pos.top + pos.height}px`,
|
|
6809
6816
|
left: `${Math.max(0, left)}px`
|
|
@@ -6815,13 +6822,32 @@ class EmojiSelectorButtonComponent {
|
|
|
6815
6822
|
return;
|
|
6816
6823
|
}
|
|
6817
6824
|
this.showEmojiPanel = true;
|
|
6818
|
-
this.place();
|
|
6825
|
+
//this.place();
|
|
6819
6826
|
setTimeout(() => {
|
|
6820
|
-
|
|
6827
|
+
let onResize = () => {
|
|
6821
6828
|
if (!this.showEmojiPanel)
|
|
6822
6829
|
return;
|
|
6823
|
-
this.
|
|
6830
|
+
this.width = window.innerWidth;
|
|
6831
|
+
this.height = window.innerHeight;
|
|
6832
|
+
let edgeOffset = 0;
|
|
6833
|
+
let commentField = this.elementRef.nativeElement.closest(`banta-comment-field`);
|
|
6834
|
+
if (commentField) {
|
|
6835
|
+
let size = commentField.getBoundingClientRect();
|
|
6836
|
+
this.width = size.width;
|
|
6837
|
+
edgeOffset = window.innerWidth - size.right;
|
|
6838
|
+
}
|
|
6839
|
+
let buttonRect = this.buttonElement.nativeElement.getBoundingClientRect();
|
|
6840
|
+
let buttonRight = window.innerWidth - buttonRect.right - edgeOffset - 10;
|
|
6841
|
+
if (this.width < 700) {
|
|
6842
|
+
this.panelElement.nativeElement.style.right = `${-buttonRight}px`;
|
|
6843
|
+
}
|
|
6844
|
+
else {
|
|
6845
|
+
this.panelElement.nativeElement.style.right = '';
|
|
6846
|
+
}
|
|
6847
|
+
this.panelElement.nativeElement.style.maxWidth = `${this.width - 15}px`;
|
|
6824
6848
|
};
|
|
6849
|
+
this.resizeListener = onResize;
|
|
6850
|
+
onResize();
|
|
6825
6851
|
this.clickListener = (ev) => {
|
|
6826
6852
|
let parent = ev.target;
|
|
6827
6853
|
let isInDialog = false;
|
|
@@ -6864,8 +6890,8 @@ EmojiSelectorButtonComponent.decorators = [
|
|
|
6864
6890
|
|
|
6865
6891
|
emoji-selector-panel {
|
|
6866
6892
|
position: absolute;
|
|
6867
|
-
|
|
6868
|
-
right: 0;
|
|
6893
|
+
top: 2.5em;
|
|
6894
|
+
right: 0;
|
|
6869
6895
|
opacity: 0;
|
|
6870
6896
|
pointer-events: none;
|
|
6871
6897
|
z-index: 10;
|
|
@@ -6879,30 +6905,17 @@ EmojiSelectorButtonComponent.decorators = [
|
|
|
6879
6905
|
button {
|
|
6880
6906
|
color: #666
|
|
6881
6907
|
}
|
|
6882
|
-
|
|
6883
|
-
/* :host.bottom-left emoji-selector-panel {
|
|
6884
|
-
right: auto;
|
|
6885
|
-
left: 0;
|
|
6886
|
-
}
|
|
6887
|
-
|
|
6888
|
-
:host.top-right emoji-selector-panel {
|
|
6889
|
-
top: 2.4em;
|
|
6890
|
-
bottom: auto;
|
|
6891
|
-
}
|
|
6892
|
-
|
|
6893
|
-
:host.top-left emoji-selector-panel {
|
|
6894
|
-
top: 2.4em;
|
|
6895
|
-
bottom: auto;
|
|
6896
|
-
left: 0;
|
|
6897
|
-
right: auto;
|
|
6898
|
-
} */
|
|
6899
6908
|
`]
|
|
6900
6909
|
},] }
|
|
6901
6910
|
];
|
|
6911
|
+
EmojiSelectorButtonComponent.ctorParameters = () => [
|
|
6912
|
+
{ type: ElementRef }
|
|
6913
|
+
];
|
|
6902
6914
|
EmojiSelectorButtonComponent.propDecorators = {
|
|
6903
6915
|
selected: [{ type: Output }],
|
|
6904
6916
|
panelElement: [{ type: ViewChild, args: ['panel', { read: ElementRef },] }],
|
|
6905
|
-
buttonElement: [{ type: ViewChild, args: ['button', { read: ElementRef },] }]
|
|
6917
|
+
buttonElement: [{ type: ViewChild, args: ['button', { read: ElementRef },] }],
|
|
6918
|
+
widthConstrained: [{ type: HostBinding, args: ['class.width-constrained',] }]
|
|
6906
6919
|
};
|
|
6907
6920
|
|
|
6908
6921
|
const COMPONENTS$1 = [
|
|
@@ -7782,8 +7795,8 @@ class CommentComponent {
|
|
|
7782
7795
|
CommentComponent.decorators = [
|
|
7783
7796
|
{ type: Component, args: [{
|
|
7784
7797
|
selector: 'banta-comment',
|
|
7785
|
-
template: "\r\n<mat-menu #pointItemMenu=\"matMenu\">\r\n <button *ngIf=\"!mine\" mat-menu-item (click)=\"report()\">Report</button>\r\n <button *ngIf=\"mine\" [disabled]=\"!permissions?.canEdit\" mat-menu-item (click)=\"startEdit()\">Edit</button>\r\n <button *ngIf=\"mine\" [disabled]=\"!permissions?.canDelete\" mat-menu-item (click)=\"delete()\">Delete</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 <span class=\"user-tag\" *ngIf=\"message.user.tag\">{{message.user.tag}}</span>\r\n <span class=\"spacer\"></span>\r\n </div>\r\n <div class=\"content\" *ngIf=\"!editing\">\r\n {{message.message}}\r\n\r\n <ng-container *ngIf=\"message.attachments?.length > 0\">\r\n <banta-lightbox #lightbox></banta-lightbox>\r\n <div class=\"attachments-row\" [class.single]=\"message.attachments?.length === 1\">\r\n <a \r\n href=\"javascript:;\" \r\n (click)=\"showLightbox(attachment)\"\r\n *ngFor=\"let attachment of message.attachments\" \r\n >\r\n <img [src]=\"attachment.url\" alt=\"\">\r\n </a>\r\n </div>\r\n </ng-container>\r\n </div>\r\n <div class=\"content\" *ngIf=\"editing\" style=\"padding-bottom: 2em;\">\r\n <div>\r\n <mat-form-field floatLabel=\"always\" appearance=\"outline\" style=\"width: 100%;\">\r\n <mat-label>Edit Message</mat-label>\r\n <textarea matInput [(ngModel)]=\"editedMessage\"></textarea>\r\n </mat-form-field>\r\n </div>\r\n <button mat-raised-button (click)=\"saveEdit()\">Save</button> \r\n <button mat-button (click)=\"endEditing()\">Cancel</button>\r\n </div>\r\n\r\n <div class=\"actions\">\r\n <banta-timestamp [value]=\"message.sentAt\"></banta-timestamp>\r\n <ul class=\"message-facts\">\r\n <li *ngIf=\"message.edits?.length > 0\">Edited</li>\r\n </ul>\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 || message.submessageCount || 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\" [class.active]=\"message.userState?.liked\">\r\n <div class=\"count-indicator\">\r\n {{message.likes}}\r\n </div>\r\n <button \r\n *ngIf=\"message.transientState?.liking\"\r\n mat-icon-button \r\n [disabled]=\"true\" \r\n [matTooltip]=\"upvoting ? 'Please wait...' : message.userState?.liked ? 'Unlike' : 'Like'\" \r\n matTooltipPosition=\"below\" \r\n >\r\n <mat-spinner [diameter]=\"15\" style=\"margin-left: 1em;\"></mat-spinner>\r\n </button>\r\n <button \r\n *ngIf=\"!message.transientState?.liking\"\r\n mat-icon-button \r\n [disabled]=\"!permissions?.canLike\" \r\n [matTooltip]=\"upvoting ? 'Please wait...' : 'Like'\" \r\n matTooltipPosition=\"below\" \r\n (click)=\"message.userState?.liked ? unlike() : like()\" \r\n >\r\n <mat-icon [inline]=\"true\">thumb_up</mat-icon>\r\n </button>\r\n </div>\r\n\r\n <div class=\"counted-action\">\r\n <button mat-icon-button matTooltip=\"Share this comment\" matTooltipPosition=\"below\" (click)=\"share()\">\r\n <mat-icon [inline]=\"true\" >share</mat-icon>\r\n </button>\r\n </div>\r\n\r\n <button mat-icon-button [matMenuTriggerFor]=\"pointItemMenu\">\r\n <mat-icon [inline]=\"true\">more_vert</mat-icon>\r\n </button>\r\n </div>\r\n</div>\r\n",
|
|
7786
|
-
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;position:relative;padding:.5em;visibility:hidden}:host.new{visibility:visible;-webkit-animation-name:comment-appear;animation-name:comment-appear;-webkit-animation-duration:.4s;animation-duration:.4s;-webkit-animation-fill-mode:both;animation-fill-mode:both}:host.highlighted{background:#00223a;outline:2px solid #003277}:host.visible{visibility:visible}:host:hover{background:#eee}:host .message-content .content{margin-left:60px;margin-right:.5em}:host .message-content .attachments-row{margin-top:15px;display:flex;gap:10px}:host .message-content .attachments-row img{border-radius:10px;width:300px;max-width:100%;max-height:20em;-o-object-fit:cover;object-fit:cover}:host.abbreviated .message-content .content{text-overflow:ellipsis;overflow-y:hidden}:host .actions{display:flex;padding-right:10px;margin-left:60px;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 .display-name,.user .username{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 .display-name.username.username.username,.user .username.username.username.username{color:#666}.avatar{height:48px;width:48px;background-position:50%;background-size:cover;background-color:#333;border-radius:100%;flex-shrink:0;flex-grow:0}.counted-action{display:flex;align-items:center}.counted-action.active .count-indicator,.counted-action.active button{color:#00a5ff}.count-indicator{font-size:9pt;padding:0 0 0 3px;color:#666}:host-context(.mat-dark-theme) .count-indicator{border-color:#333}:host-context(.mat-dark-theme):hover{background:#060606}
|
|
7798
|
+
template: "\r\n<mat-menu #pointItemMenu=\"matMenu\">\r\n <button *ngIf=\"!mine\" mat-menu-item (click)=\"report()\">Report</button>\r\n <button *ngIf=\"mine\" [disabled]=\"!permissions?.canEdit\" mat-menu-item (click)=\"startEdit()\">Edit</button>\r\n <button *ngIf=\"mine\" [disabled]=\"!permissions?.canDelete\" mat-menu-item (click)=\"delete()\">Delete</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 <span class=\"user-tag\" *ngIf=\"message.user.tag\">{{message.user.tag}}</span>\r\n <span class=\"spacer\"></span>\r\n </div>\r\n <div class=\"content\" *ngIf=\"!editing\">\r\n {{message.message}}\r\n\r\n <ng-container *ngIf=\"message.attachments?.length > 0\">\r\n <banta-lightbox #lightbox></banta-lightbox>\r\n <div class=\"attachments-row\" [class.single]=\"message.attachments?.length === 1\" *ngIf=\"message.attachments && message.attachments?.length > 0\">\r\n <a \r\n href=\"javascript:;\" \r\n (click)=\"showLightbox(attachment)\"\r\n *ngFor=\"let attachment of message.attachments\" \r\n >\r\n <img [src]=\"attachment.url\" alt=\"\">\r\n </a>\r\n </div>\r\n </ng-container>\r\n\r\n <ul class=\"message-facts small\">\r\n <li *ngIf=\"message.edits?.length > 0\">(Edited)</li>\r\n </ul>\r\n </div>\r\n <div class=\"content\" *ngIf=\"editing\" style=\"padding-bottom: 2em;\">\r\n <div>\r\n <mat-form-field floatLabel=\"always\" appearance=\"outline\" style=\"width: 100%;\">\r\n <mat-label>Edit Message</mat-label>\r\n <textarea matInput [(ngModel)]=\"editedMessage\"></textarea>\r\n </mat-form-field>\r\n </div>\r\n <button mat-raised-button (click)=\"saveEdit()\">Save</button> \r\n <button mat-button (click)=\"endEditing()\">Cancel</button>\r\n </div>\r\n\r\n\r\n <div class=\"actions\">\r\n <banta-timestamp [value]=\"message.sentAt\"></banta-timestamp>\r\n <ul class=\"message-facts\">\r\n <li *ngIf=\"message.edits?.length > 0\">Edited</li>\r\n </ul>\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 || message.submessageCount || 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\" [class.active]=\"message.userState?.liked\">\r\n <div class=\"count-indicator\">\r\n {{message.likes}}\r\n </div>\r\n <button \r\n *ngIf=\"message.transientState?.liking\"\r\n mat-icon-button \r\n [disabled]=\"true\" \r\n [matTooltip]=\"upvoting ? 'Please wait...' : message.userState?.liked ? 'Unlike' : 'Like'\" \r\n matTooltipPosition=\"below\" \r\n >\r\n <mat-spinner [diameter]=\"15\" style=\"margin-left: 1em;\"></mat-spinner>\r\n </button>\r\n <button \r\n *ngIf=\"!message.transientState?.liking\"\r\n mat-icon-button \r\n [disabled]=\"!permissions?.canLike\" \r\n [matTooltip]=\"upvoting ? 'Please wait...' : 'Like'\" \r\n matTooltipPosition=\"below\" \r\n (click)=\"message.userState?.liked ? unlike() : like()\" \r\n >\r\n <mat-icon [inline]=\"true\">thumb_up</mat-icon>\r\n </button>\r\n </div>\r\n\r\n <div class=\"counted-action\">\r\n <button mat-icon-button matTooltip=\"Share this comment\" matTooltipPosition=\"below\" (click)=\"share()\">\r\n <mat-icon [inline]=\"true\" >share</mat-icon>\r\n </button>\r\n </div>\r\n\r\n <button mat-icon-button [matMenuTriggerFor]=\"pointItemMenu\">\r\n <mat-icon [inline]=\"true\">more_vert</mat-icon>\r\n </button>\r\n </div>\r\n</div>\r\n",
|
|
7799
|
+
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;position:relative;padding:.5em;visibility:hidden}:host.new{visibility:visible;-webkit-animation-name:comment-appear;animation-name:comment-appear;-webkit-animation-duration:.4s;animation-duration:.4s;-webkit-animation-fill-mode:both;animation-fill-mode:both}:host.highlighted{background:#00223a;outline:2px solid #003277}:host.visible{visibility:visible}:host:hover{background:#eee}:host .message-content .content{margin-left:60px;margin-right:.5em}:host .message-content .attachments-row{margin-top:15px;display:flex;gap:10px}:host .message-content .attachments-row img{border-radius:10px;width:300px;max-width:100%;max-height:20em;-o-object-fit:cover;object-fit:cover}:host.abbreviated .message-content .content{text-overflow:ellipsis;overflow-y:hidden}:host .actions{display:flex;padding-right:10px;margin-left:60px;align-items:center}:host .actions button{color:#666;flex-shrink:0}:host .actions banta-timestamp{color:#666;font-size:10pt;flex-shrink:0}.user{position:relative;margin:1em 0 0;display:flex;align-items:center}.user .display-name,.user .username{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 .display-name.username.username.username,.user .username.username.username.username{color:#666}.avatar{height:48px;width:48px;background-position:50%;background-size:cover;background-color:#333;border-radius:100%;flex-shrink:0;flex-grow:0}.counted-action{display:flex;align-items:center}.counted-action.active .count-indicator,.counted-action.active button{color:#00a5ff}.count-indicator{font-size:9pt;padding:0 0 0 3px;color:#666}:host-context(.mat-dark-theme) .count-indicator{border-color:#333}:host-context(.mat-dark-theme):hover{background:#060606}.user-tag,:host-context(.mat-dark-theme) .user .display-name,:host-context(.mat-dark-theme) .user .username{color:#fff}.user-tag{text-transform:uppercase;font-size:12px;border:1px solid #b27373;background:#7a412b;padding:3px 5px;margin:0 .5em 0 1em;border-radius:3px}.spacer{flex-shrink:1;flex-grow:1}ul.message-facts{margin:0;padding:0;color:#666}ul.message-facts li{list-style-type:none;border-left:1px solid #666;font-size:10pt;padding-left:.5em;margin-left:.5em}ul.message-facts.small{display:none}ul.message-facts.small li{margin-top:.5em}ul.message-facts.small li:first-child{border-left:1px solid transparent;margin-left:0;padding-left:0}@media (max-width:400px){.avatar{height:32px;width:32px}.actions ul.message-facts{display:none}ul.message-facts.small{display:initial}:host .actions{margin-left:0;margin-top:.5em}:host .message-content .content{margin-left:44px;margin-right:.5em}}:host-context(.banta-mobile) .avatar{height:32px;width:32px}:host-context(.banta-mobile) .actions ul.message-facts{display:none}:host-context(.banta-mobile) ul.message-facts.small{display:initial}:host-context(.banta-mobile) :host .actions{margin-left:0;margin-top:.5em}:host-context(.banta-mobile) :host .message-content .content{margin-left:44px;margin-right:.5em}"]
|
|
7787
7800
|
},] }
|
|
7788
7801
|
];
|
|
7789
7802
|
CommentComponent.propDecorators = {
|
|
@@ -8055,15 +8068,17 @@ CommentViewComponent.propDecorators = {
|
|
|
8055
8068
|
sortOrderChanged: [{ type: Output }]
|
|
8056
8069
|
};
|
|
8057
8070
|
|
|
8071
|
+
/// <reference types="@types/resize-observer-browser" />
|
|
8058
8072
|
/**
|
|
8059
8073
|
* Comments component
|
|
8060
8074
|
*/
|
|
8061
8075
|
class BantaCommentsComponent {
|
|
8062
|
-
constructor(backend, elementRef, activatedRoute, matSnackBar) {
|
|
8076
|
+
constructor(backend, elementRef, activatedRoute, matSnackBar, ngZone) {
|
|
8063
8077
|
this.backend = backend;
|
|
8064
8078
|
this.elementRef = elementRef;
|
|
8065
8079
|
this.activatedRoute = activatedRoute;
|
|
8066
8080
|
this.matSnackBar = matSnackBar;
|
|
8081
|
+
this.ngZone = ngZone;
|
|
8067
8082
|
// Loading Screen
|
|
8068
8083
|
this._loadingMessage = '';
|
|
8069
8084
|
this.loadingMessageVisible = false;
|
|
@@ -8183,8 +8198,22 @@ class BantaCommentsComponent {
|
|
|
8183
8198
|
}
|
|
8184
8199
|
}
|
|
8185
8200
|
}
|
|
8201
|
+
get isMobileSized() { return this.width < 500; }
|
|
8202
|
+
ngAfterViewInit() {
|
|
8203
|
+
let callback = () => {
|
|
8204
|
+
let size = this.elementRef.nativeElement.getBoundingClientRect();
|
|
8205
|
+
this.ngZone.run(() => {
|
|
8206
|
+
this.width = size.width;
|
|
8207
|
+
this.height = size.height;
|
|
8208
|
+
});
|
|
8209
|
+
};
|
|
8210
|
+
this.resizeObserver = new ResizeObserver(callback);
|
|
8211
|
+
this.resizeObserver.observe(this.elementRef.nativeElement);
|
|
8212
|
+
callback();
|
|
8213
|
+
}
|
|
8186
8214
|
ngOnDestroy() {
|
|
8187
8215
|
this._subs.unsubscribe();
|
|
8216
|
+
this.resizeObserver.disconnect();
|
|
8188
8217
|
}
|
|
8189
8218
|
setSourceFromTopicID(topicID) {
|
|
8190
8219
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -8522,16 +8551,18 @@ BantaCommentsComponent.decorators = [
|
|
|
8522
8551
|
{ type: Component, args: [{
|
|
8523
8552
|
selector: 'banta-comments',
|
|
8524
8553
|
template: "<ng-container *ngIf=\"loading\">\r\n <div class=\"loading-screen\" [class.visible]=\"showLoadingScreen\">\r\n <h1>Loading Comments</h1>\r\n <div>\r\n <mat-spinner [diameter]=\"300\" [strokeWidth]=\"2\"></mat-spinner>\r\n </div>\r\n\r\n <p class=\"loading-message\" [class.visible]=\"loadingMessageVisible\">{{loadingMessage}}</p>\r\n </div>\r\n</ng-container>\r\n<ng-container *ngIf=\"!loading\">\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 [liking]=\"selectedMessage.transientState.liking\"\r\n [mine]=\"user?.id === selectedMessage.user?.id\"\r\n [permissions]=\"source?.permissions\"\r\n [showReplyAction]=\"false\"\r\n [editing]=\"selectedMessage.transientState.editing\"\r\n [genericAvatarUrl]=\"genericAvatarUrl\"\r\n (editStarted)=\"startEditing(selectedMessage)\"\r\n (editEnded)=\"selectedMessage.transientState.editing = false\"\r\n (edited)=\"saveEdit(selectedMessage, $event)\"\r\n (userSelected)=\"selectMessageUser(selectedMessage)\"\r\n (avatarSelected)=\"selectAvatar($event)\"\r\n (usernameSelected)=\"selectUsername($event)\"\r\n (liked)=\"likeMessage(source, selectedMessage)\"\r\n (unliked)=\"unlikeMessage(source, selectedMessage)\"\r\n (reported)=\"reportMessage(selectedMessage)\"\r\n (selected)=\"selectMessage(selectedMessage)\"\r\n (shared)=\"shareMessage($event)\"\r\n (deleted)=\"deleteMessage(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 [genericAvatarUrl]=\"genericAvatarUrl\"\r\n (liked)=\"likeMessage(selectedMessageThread, $event)\"\r\n (unliked)=\"unlikeMessage(selectedMessageThread, $event)\"\r\n (messageEdited)=\"editMessage(selectedMessageThread, $event.message, $event.newMessage)\"\r\n (reported)=\"reportMessage($event)\"\r\n (usernameSelected)=\"selectUsername($event)\"\r\n (avatarSelected)=\"selectAvatar($event)\"\r\n (shared)=\"shareMessage($event)\"\r\n (deleted)=\"deleteMessage($event)\"\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]=\"source?.permissions?.canPost\"\r\n [signInLabel]=\"signInLabel\"\r\n [permissionDeniedLabel]=\"source?.permissions?.canPostErrorMessage || permissionDeniedLabel\"\r\n (permissionDeniedError)=\"handlePermissionDenied($event)\"\r\n [shouldInterceptMessageSend]=\"shouldInterceptMessageSend\"\r\n [user]=\"user\"\r\n [label]=\"postReplyLabel\"\r\n [submit]=\"sendReply\"\r\n [allowAttachments]=\"allowAttachments\"\r\n [genericAvatarUrl]=\"genericAvatarUrl\"\r\n >\r\n <ng-content select=\".reply-send-options\"></ng-content>\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]=\"source?.permissions?.canPost\"\r\n [hashtags]=\"hashtags\"\r\n [participants]=\"participants\"\r\n [label]=\"postCommentLabel\"\r\n (editAvatarSelected)=\"showEditAvatar()\"\r\n (signInSelected)=\"showSignIn()\"\r\n [permissionDeniedLabel]=\"source?.permissions?.canPostErrorMessage || permissionDeniedLabel\"\r\n (permissionDeniedError)=\"handlePermissionDenied($event)\"\r\n [shouldInterceptMessageSend]=\"shouldInterceptMessageSend\"\r\n [submit]=\"sendMessage\"\r\n [allowAttachments]=\"allowAttachments\"\r\n [genericAvatarUrl]=\"genericAvatarUrl\"\r\n >\r\n \r\n </banta-comment-field>\r\n\r\n <banta-comment-sort\r\n [(sort)]=\"sortOrder\"></banta-comment-sort>\r\n\r\n <banta-comment-view\r\n [class.faded]=\"selectedMessage\"\r\n [source]=\"source\"\r\n [fixedHeight]=\"fixedHeight\"\r\n [maxMessages]=\"maxMessages\"\r\n [maxVisibleMessages]=\"maxVisibleMessages\"\r\n [genericAvatarUrl]=\"genericAvatarUrl\"\r\n (userSelected)=\"selectMessageUser($event)\"\r\n (sortOrderChanged)=\"sortOrder = $event\"\r\n (selected)=\"selectMessage($event)\"\r\n (liked)=\"likeMessage(source, $event)\"\r\n (unliked)=\"unlikeMessage(source, $event)\"\r\n (messageEdited)=\"editMessage(source, $event.message, $event.newMessage)\"\r\n (reported)=\"reportMessage($event)\"\r\n (usernameSelected)=\"selectUsername($event)\"\r\n (avatarSelected)=\"selectAvatar($event)\"\r\n (shared)=\"shareMessage($event)\"\r\n (deleted)=\"deleteMessage($event)\"\r\n ></banta-comment-view>\r\n </div>\r\n</ng-container>\r\n",
|
|
8525
|
-
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-name:select-comment;animation-name:select-comment;-webkit-animation-duration:.4s;animation-duration:.4s;-webkit-animation-fill-mode:both;animation-fill-mode:both}.focused .replies{margin-top:1em;margin-left:4em}banta-comment-view{opacity:1;transition:opacity .4s ease-in-out}banta-comment-view.faded{opacity:.25}.loading{display:block;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;margin:0 auto;min-height:16em}.main.hidden{display:none}
|
|
8554
|
+
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-name:select-comment;animation-name:select-comment;-webkit-animation-duration:.4s;animation-duration:.4s;-webkit-animation-fill-mode:both;animation-fill-mode:both}.focused .replies{margin-top:1em;margin-left:4em}banta-comment-view{opacity:1;transition:opacity .4s ease-in-out}banta-comment-view.faded{opacity:.25}.loading{display:block;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;margin:0 auto;min-height:16em}.main.hidden{display:none}.loading-screen{text-align:center;opacity:0;transition:opacity .25s ease-in-out}.loading-screen.visible{opacity:1}.loading-screen h1{font-weight:100}.loading-screen mat-spinner{margin:5em auto}.loading-screen .loading-message{opacity:0;transition:opacity .25s ease-in-out;width:500px;max-width:100%;margin:0 auto}.loading-screen .loading-message.visible{opacity:1}banta-comment-sort{margin:0 0 0 auto;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;display:block}@media (max-width:500px){.focused .replies{margin-left:0}banta-comment-sort{margin:0;width:100%}}:host-context(.banta-mobile) .focused .replies{margin-left:0}:host-context(.banta-mobile) banta-comment-sort{margin:0;width:100%}"]
|
|
8526
8555
|
},] }
|
|
8527
8556
|
];
|
|
8528
8557
|
BantaCommentsComponent.ctorParameters = () => [
|
|
8529
8558
|
{ type: ChatBackendBase },
|
|
8530
8559
|
{ type: ElementRef },
|
|
8531
8560
|
{ type: ActivatedRoute },
|
|
8532
|
-
{ type: MatSnackBar }
|
|
8561
|
+
{ type: MatSnackBar },
|
|
8562
|
+
{ type: NgZone }
|
|
8533
8563
|
];
|
|
8534
8564
|
BantaCommentsComponent.propDecorators = {
|
|
8565
|
+
isMobileSized: [{ type: HostBinding, args: ['class.banta-mobile',] }],
|
|
8535
8566
|
loadingMessages: [{ type: Input }],
|
|
8536
8567
|
signInLabel: [{ type: Input }],
|
|
8537
8568
|
sendLabel: [{ type: Input }],
|
|
@@ -8871,7 +8902,7 @@ CommentFieldComponent.decorators = [
|
|
|
8871
8902
|
{ type: Component, args: [{
|
|
8872
8903
|
selector: 'banta-comment-field',
|
|
8873
8904
|
template: "<form class=\"new-message\" (submit)=\"sendMessage()\">\r\n <div class=\"avatar-container\">\r\n <a href=\"javascript:;\"\r\n class=\"avatar\"\r\n (click)=\"showEditAvatar()\"\r\n [style.background-image]=\"'url(' + userAvatarUrl + ')'\"\r\n ></a>\r\n </div>\r\n <div class=\"text-container\">\r\n <div class=\"field-container\">\r\n <div class=\"field-row\">\r\n <mat-form-field appearance=\"outline\" floatLabel=\"always\">\r\n <mat-label>{{label}}</mat-label>\r\n <textarea\r\n #textarea\r\n name=\"message\"\r\n [placeholder]=\"placeholder\"\r\n matInput\r\n cdkTextareaAutosize\r\n (keydown)=\"onKeyDown($event)\"\r\n (blur)=\"onBlur()\"\r\n [disabled]=\"sending\"\r\n [(ngModel)]=\"text\"></textarea>\r\n </mat-form-field>\r\n <div class=\"options-line\">\r\n <mat-spinner *ngIf=\"sending\" class=\"icon loading\" diameter=\"18\" strokeWidth=\"2\"></mat-spinner>\r\n <div *ngIf=\"sendError\" class=\"error-message\" [class.expanded]=\"expandError\" [matTooltip]=\"sendError.message\" (click)=\"alertError()\">\r\n <mat-icon *ngIf=\"sendError\">error</mat-icon>\r\n {{sendError.message}}\r\n </div>\r\n <div class=\"spacer\"></div>\r\n <div class=\"custom\">\r\n <ng-content></ng-content>\r\n </div>\r\n <banta-attachment-button (addedAttachment)=\"addedAttachment($event)\" *ngIf=\"allowAttachments\"></banta-attachment-button>\r\n <emoji-selector-button (selected)=\"insertEmoji($event)\"></emoji-selector-button>\r\n </div>\r\n \r\n </div>\r\n <div #autocompleteContainer class=\"autocomplete-container\">\r\n <div #autocomplete class=\"autocomplete\" [class.visible]=\"autocompleteVisible\">\r\n\r\n <div>\r\n <strong>{{completionPrefix}}</strong>...\r\n </div>\r\n <a\r\n mat-button\r\n *ngFor=\"let option of autocompleteOptions; index as index\"\r\n (click)=\"activateAutoComplete(option)\"\r\n [class.active]=\"autoCompleteSelected === index\"\r\n >\r\n {{option.label}}\r\n </a>\r\n </div>\r\n </div>\r\n\r\n\r\n <div *ngIf=\"chatMessageAttachments && chatMessageAttachments.length\" class=\"message-attachments-container\">\r\n <div *ngFor=\"let attachment of chatMessageAttachments; index as attachmentIndex\"\r\n class=\"message-attachment\">\r\n <button (click)=\"removeAttachment(attachmentIndex)\" mat-mini-fab color=\"primary\" class=\"remove-img\">\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n <img [src]=\"attachment.url\" alt=\"Message Attachment\">\r\n </div>\r\n </div>\r\n\r\n </div>\r\n </div>\r\n <div class=\"actions\">\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 mat-raised-button\r\n class=\"send\"\r\n color=\"primary\"\r\n [disabled]=\"canComment && ((!text && !chatMessageAttachments.length) || sending)\"\r\n >\r\n <ng-container *ngIf=\"canComment\">\r\n <mat-icon *ngIf=\"!sending\">chevron_right</mat-icon>\r\n <mat-spinner *ngIf=\"sending\" class=\"icon\" diameter=\"18\" strokeWidth=\"2\"></mat-spinner>\r\n </ng-container>\r\n <span class=\"label\">\r\n <ng-container *ngIf=\"!canComment\">\r\n {{permissionDeniedLabel}}\r\n </ng-container>\r\n <ng-container *ngIf=\"canComment\">\r\n <ng-container *ngIf=\"!sending\">\r\n {{sendLabel}}\r\n </ng-container>\r\n <ng-container *ngIf=\"sending\">\r\n {{sendingLabel}}\r\n </ng-container>\r\n </ng-container>\r\n </span>\r\n </button>\r\n </ng-container>\r\n </div>\r\n</form>",
|
|
8874
|
-
styles: ["@-webkit-keyframes comment-field-appear{0%{transform:translateY(128px);opacity:0}to{transform:translate(0);opacity:1}}@keyframes comment-field-appear{0%{transform:translateY(128px);opacity:0}to{transform:translate(0);opacity:1}}:host{margin:0 2em 0 0;display:block;-webkit-animation-name:comment-field-appear;animation-name:comment-field-appear;-webkit-animation-duration:.8s;animation-duration:.8s;-webkit-animation-delay:.4s;animation-delay:.4s;-webkit-animation-fill-mode:both;animation-fill-mode:both}.avatar-container{width:calc(48px + 1.75em);display:flex;justify-content:flex-end;flex-shrink:0}.avatar-container .avatar{width:48px;height:48px;background:#000;border-radius:100%;background-size:cover;background-repeat:no-repeat;background-position:50%;margin-top:.75em;margin-right:.75em}form{display:flex;padding:.5em;align-items:center}form .text-container{position:relative;display:flex;flex-grow:1;min-width:0}form .text-container textarea{font-size:14pt;width:100%}form .text-container textarea[disabled]{opacity:.5}form .text-container mat-spinner.loading{position:absolute;left:.5em;bottom:.5em}form .text-container .options-line{display:flex;align-items:center}form .text-container .options-line>*{flex-shrink:0}form .text-container .options-line .error-message{left:.5em;bottom:.5em;color:#683333;overflow-x:hidden;max-width:1.5em;white-space:nowrap;transition:max-width 2s ease-in-out;text-overflow:ellipsis;overflow:hidden;flex-shrink:1}form .text-container .options-line .error-message.expanded,form .text-container .options-line .error-message:hover{max-width:100%}form .text-container .options-line .error-message mat-icon{vertical-align:middle}form input[type=text]{background:#000;color:#fff;border:1px solid #333;width:100%;height:1em}form .actions{margin-left:1em;flex-shrink:0}form button{display:block;margin:0 0 0 auto}form.new-message{display:flex;align-items:flex-start;min-width:0}form.new-message .field-container{flex-grow:1;display:flex;flex-direction:column;min-width:0}form.new-message mat-form-field{width:100%}form.new-message mat-form-field ::ng-deep .mat-form-field-wrapper{padding-bottom:0}form.new-message button{margin:1.25em 0 0}button.send{min-width:9em}textarea{max-height:7em}.autocomplete-container{width:calc(100% - 2em);position:relative;pointer-events:none;top:-2em}.autocomplete{visibility:hidden;pointer-events:none;position:absolute;background:#333;padding:.5em;display:flex;flex-direction:column;z-index:100}.autocomplete.visible{visibility:visible;pointer-events:auto}.autocomplete a{width:100%;text-align:left}.autocomplete a.active{background:#555}@media (max-width:500px){:host{margin:0}.avatar-container{width:auto;flex-shrink:0}.avatar-container .avatar{width:32px;height:32px;margin-top:1.5em}button.send{min-width:auto;margin-top:1.5em}button.send .label{display:none}}.message-attachments-container{display:flex;gap:20px}.message-attachments-container .message-attachment{width:300px;position:relative}.message-attachments-container .message-attachment img{width:300px;border-radius:10px}.message-attachments-container .message-attachment .remove-img{position:absolute;right:10px;top:10px;margin:0}.field-row{position:relative}"]
|
|
8905
|
+
styles: ["@-webkit-keyframes comment-field-appear{0%{transform:translateY(128px);opacity:0}to{transform:translate(0);opacity:1}}@keyframes comment-field-appear{0%{transform:translateY(128px);opacity:0}to{transform:translate(0);opacity:1}}:host{margin:0 2em 0 0;display:block;-webkit-animation-name:comment-field-appear;animation-name:comment-field-appear;-webkit-animation-duration:.8s;animation-duration:.8s;-webkit-animation-delay:.4s;animation-delay:.4s;-webkit-animation-fill-mode:both;animation-fill-mode:both;position:relative;z-index:20}.avatar-container{width:calc(48px + 1.75em);display:flex;justify-content:flex-end;flex-shrink:0}.avatar-container .avatar{width:48px;height:48px;background:#000;border-radius:100%;background-size:cover;background-repeat:no-repeat;background-position:50%;margin-top:.75em;margin-right:.75em}form{display:flex;padding:.5em;align-items:center}form .text-container{position:relative;display:flex;flex-grow:1;min-width:0}form .text-container textarea{font-size:14pt;width:100%}form .text-container textarea[disabled]{opacity:.5}form .text-container mat-spinner.loading{position:absolute;left:.5em;bottom:.5em}form .text-container .options-line{display:flex;align-items:center}form .text-container .options-line>*{flex-shrink:0}form .text-container .options-line .error-message{left:.5em;bottom:.5em;color:#683333;overflow-x:hidden;max-width:1.5em;white-space:nowrap;transition:max-width 2s ease-in-out;text-overflow:ellipsis;overflow:hidden;flex-shrink:1}form .text-container .options-line .error-message.expanded,form .text-container .options-line .error-message:hover{max-width:100%}form .text-container .options-line .error-message mat-icon{vertical-align:middle}form input[type=text]{background:#000;color:#fff;border:1px solid #333;width:100%;height:1em}form .actions{margin-left:1em;flex-shrink:0}form button{display:block;margin:0 0 0 auto}form.new-message{display:flex;align-items:flex-start;min-width:0}form.new-message .field-container{flex-grow:1;display:flex;flex-direction:column;min-width:0}form.new-message mat-form-field{width:100%}form.new-message mat-form-field ::ng-deep .mat-form-field-wrapper{padding-bottom:0}form.new-message button{margin:1.25em 0 0}button.send{min-width:9em}textarea{max-height:7em}.autocomplete-container{width:calc(100% - 2em);position:relative;pointer-events:none;top:-2em}.autocomplete{visibility:hidden;pointer-events:none;position:absolute;background:#333;padding:.5em;display:flex;flex-direction:column;z-index:100}.autocomplete.visible{visibility:visible;pointer-events:auto}.autocomplete a{width:100%;text-align:left}.autocomplete a.active{background:#555}@media (max-width:500px){:host{margin:0}.avatar-container{width:auto;flex-shrink:0}.avatar-container .avatar{width:32px;height:32px;margin-top:1.5em}button.send{min-width:auto;margin-top:1.5em}button.send .label{display:none}}:host-context(.banta-mobile) :host{margin:0}:host-context(.banta-mobile) .avatar-container{width:auto;flex-shrink:0}:host-context(.banta-mobile) .avatar-container .avatar{width:32px;height:32px;margin-top:1.5em}:host-context(.banta-mobile) button.send{min-width:auto;margin-top:1.5em}:host-context(.banta-mobile) button.send .label{display:none}.message-attachments-container{display:flex;gap:20px}.message-attachments-container .message-attachment{width:300px;position:relative}.message-attachments-container .message-attachment img{width:300px;border-radius:10px}.message-attachments-container .message-attachment .remove-img{position:absolute;right:10px;top:10px;margin:0}.field-row{position:relative}"]
|
|
8875
8906
|
},] }
|
|
8876
8907
|
];
|
|
8877
8908
|
CommentFieldComponent.propDecorators = {
|