@banta/sdk 4.4.4 → 4.4.7
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 +30 -19
- 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/chat/banta-chat/banta-chat.component.js +2 -2
- package/esm2015/lib/comments/banta-comments/banta-comments.component.js +17 -12
- package/esm2015/lib/comments/comment-field/comment-field.component.js +9 -5
- package/esm2015/lib/common/attachment/attachment.component.js +3 -3
- package/esm2015/lib/common/lightbox/lightbox.component.js +4 -2
- package/fesm2015/banta-sdk.js +30 -19
- package/fesm2015/banta-sdk.js.map +1 -1
- package/package.json +1 -1
|
@@ -62,8 +62,8 @@ export class BantaAttachmentComponent {
|
|
|
62
62
|
BantaAttachmentComponent.decorators = [
|
|
63
63
|
{ type: Component, args: [{
|
|
64
64
|
selector: 'banta-attachment',
|
|
65
|
-
template: "<button type=\"button\" (click)=\"remove()\" mat-mini-fab color=\"primary\" class=\"remove-button\" *ngIf=\"editing\">\r\n <mat-icon>close</mat-icon>\r\n</button>\r\n\r\n<ng-container *ngIf=\"isError\">\r\n <mat-icon class=\"error\">close</mat-icon>\r\n <em class=\"error\">{{theErrorMessage}}</em>\r\n</ng-container>\r\n<ng-container *ngIf=\"!isError\">\r\n <ng-container *ngIf=\"isLoading\">\r\n <mat-spinner></mat-spinner>\r\n <em>{{loadingMessage}}</em>\r\n </ng-container>\r\n <ng-container *ngIf=\"!isLoading\">\r\n <iframe *ngIf=\"hasFrame\"\r\n sandbox=\"allow-scripts allow-popups allow-same-origin allow-presentation\" \r\n [src]=\"frameUrl | trustResourceUrl\"></iframe>\r\n <a *ngIf=\"attachment.type === 'card'\" class=\"card\" [href]=\"attachment.url\" target=\"_blank\" [class.has-image]=\"attachment.card.image\">\r\n <img \r\n *ngIf=\"attachment.card.image\"\r\n class=\"thumbnail\" \r\n [src]=\"attachment.card.image\"\r\n />\r\n <div class=\"description\">\r\n <h1>{{attachment.card.title}}</h1>\r\n <div>\r\n {{attachment.card.description}}\r\n </div>\r\n <cite>{{attachment.card.url}}</cite>\r\n </div>\r\n </a>\r\n <a class=\"image-attachment\" *ngIf=\"isImageAttachment\" href=\"javascript:;\" (click)=\"activate()\">\r\n <img [src]=\"attachment.url\" alt=\"Image Attachment\">\r\n </a>\r\n <blockquote *ngIf=\"attachment.type === 'tweet'\" \r\n class=\"twitter-tweet\">\r\n <p lang=\"en\" dir=\"ltr\"></p>\r\n <a href=\"
|
|
66
|
-
styles: [":host{position:relative;display:block}:host.loading{outline:1px solid #333;padding:1em 0;width:300px;text-align:center}:host.loading mat-spinner{display:block;margin:0 auto .5em;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}a.card{display:flex;align-items:flex-start;gap:1em;width:100%;border:1px solid #666;border-radius:4px;padding:1em;box-sizing:border-box;background-color:#191919;margin:1em 0}a.card img{width:250px;aspect-ratio:16/9;-o-object-fit:cover;object-fit:cover;border-radius:10px}a.card.has-image h1{font-size:22px}a.card h1{min-width:0;margin:0 0 .5em;font-size:26px}a.card cite{min-width:0;opacity:.75;margin-top:1em;display:block;font-size:90%;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}a.card .description{min-width:0}.remove-button{position:absolute;right:10px;top:10px;margin:0;z-index:1}a.image-attachment{width:300px;position:relative;text-align:center}a.image-attachment.with-border{outline:1px solid #333;padding:1em 0}a.image-attachment mat-spinner{display:block;margin:0 auto .5em;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}a.image-attachment mat-icon.error{display:block;font-size:48px;width:48px;height:48px;margin:0 auto .5em}a.image-attachment .error{color:#b76363}a.image-attachment img{width:300px;border-radius:10px;max-width:100%;max-height:20em;-o-object-fit:cover;object-fit:cover}iframe{border:none;width:100%;aspect-ratio:16/9}"]
|
|
65
|
+
template: "<button type=\"button\" (click)=\"remove()\" mat-mini-fab color=\"primary\" class=\"remove-button\" *ngIf=\"editing\">\r\n <mat-icon>close</mat-icon>\r\n</button>\r\n\r\n<ng-container *ngIf=\"isError\">\r\n <mat-icon class=\"error\">close</mat-icon>\r\n <em class=\"error\">{{theErrorMessage}}</em>\r\n</ng-container>\r\n<ng-container *ngIf=\"!isError\">\r\n <ng-container *ngIf=\"isLoading\">\r\n <mat-spinner></mat-spinner>\r\n <em>{{loadingMessage}}</em>\r\n </ng-container>\r\n <ng-container *ngIf=\"!isLoading\">\r\n <iframe *ngIf=\"hasFrame\"\r\n sandbox=\"allow-scripts allow-popups allow-same-origin allow-presentation\" \r\n [src]=\"frameUrl | trustResourceUrl\"></iframe>\r\n <a *ngIf=\"attachment.type === 'card'\" class=\"card-attachment\" [href]=\"attachment.url\" target=\"_blank\" [class.has-image]=\"attachment.card.image\">\r\n <img \r\n *ngIf=\"attachment.card.image\"\r\n class=\"thumbnail\" \r\n [src]=\"attachment.card.image\"\r\n />\r\n <div class=\"description\">\r\n <h1>{{attachment.card.title}}</h1>\r\n <div>\r\n {{attachment.card.description}}\r\n </div>\r\n <cite>{{attachment.card.url}}</cite>\r\n </div>\r\n </a>\r\n <a class=\"image-attachment\" *ngIf=\"isImageAttachment\" href=\"javascript:;\" (click)=\"activate()\">\r\n <img [src]=\"attachment.url\" alt=\"Image Attachment\">\r\n </a>\r\n <blockquote *ngIf=\"attachment.type === 'tweet'\" \r\n class=\"twitter-tweet\">\r\n <p lang=\"en\" dir=\"ltr\"></p>\r\n <a [href]=\"attachment.url\"></a>\r\n </blockquote>\r\n </ng-container>\r\n</ng-container>",
|
|
66
|
+
styles: [":host{position:relative;display:block}:host.loading{outline:1px solid #333;padding:1em 0;width:300px;text-align:center}:host.loading mat-spinner{display:block;margin:0 auto .5em;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}a.card-attachment{display:flex;align-items:flex-start;gap:1em;width:100%;border:1px solid #666;border-radius:4px;padding:1em;box-sizing:border-box;background-color:#191919;margin:1em 0}a.card-attachment img{width:250px;aspect-ratio:16/9;-o-object-fit:cover;object-fit:cover;border-radius:10px}a.card-attachment.has-image h1{font-size:22px}a.card-attachment h1{min-width:0;margin:0 0 .5em;font-size:26px}a.card-attachment cite{min-width:0;opacity:.75;margin-top:1em;display:block;font-size:90%;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}a.card-attachment .description{min-width:0}.remove-button{position:absolute;right:10px;top:10px;margin:0;z-index:1}a.image-attachment{width:300px;position:relative;text-align:center}a.image-attachment.with-border{outline:1px solid #333;padding:1em 0}a.image-attachment mat-spinner{display:block;margin:0 auto .5em;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}a.image-attachment mat-icon.error{display:block;font-size:48px;width:48px;height:48px;margin:0 auto .5em}a.image-attachment .error{color:#b76363}a.image-attachment img{width:300px;border-radius:10px;max-width:100%;max-height:20em;-o-object-fit:cover;object-fit:cover}iframe{border:none;width:100%;aspect-ratio:16/9}@media (max-width:700px){a.card-attachment{flex-direction:column}a.card-attachment img{width:100%}}"]
|
|
67
67
|
},] }
|
|
68
68
|
];
|
|
69
69
|
BantaAttachmentComponent.ctorParameters = () => [];
|
|
@@ -78,4 +78,4 @@ BantaAttachmentComponent.propDecorators = {
|
|
|
78
78
|
activated: [{ type: Output }],
|
|
79
79
|
isLoading: [{ type: HostBinding, args: ['class.loading',] }]
|
|
80
80
|
};
|
|
81
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
81
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXR0YWNobWVudC5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9zZGsvc3JjL2xpYi9jb21tb24vYXR0YWNobWVudC9hdHRhY2htZW50LmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFFLFdBQ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RpdGluZyA9IGZhbHNlO1xyXG4gICAgQElucHV0KCkgbG9hZGluZ01lc3NhZ2U6IHN0cmluZyA9ICdQbGVhc2Ugd2FpdC4uLic7XHJcbiAgICBASW5wdXQoKSBlcnJvciA9IGZhbHNlO1xyXG4gICAgQElucHV0KCkgZXJyb3JNZXNzYWdlOiBzdHJpbmcgPSAnQW4gZXJyb3IgaGFzIG9jY3VycmVkJztcclxuICAgIEBPdXRwdXQoKSByZW1vdmVkID0gbmV3IFN1YmplY3Q8dm9pZD4oKTtcclxuICAgIEBPdXRwdXQoKSBhY3RpdmF0ZWQgPSBuZXcgU3ViamVjdDx2b2lkPigpO1xyXG5cclxuICAgIG5nT25Jbml0KCkge1xyXG4gICAgICAgIGlmICh0eXBlb2Ygd2luZG93ICE9PSAndW5kZWZpbmVkJykge1xyXG4gICAgICAgICAgICBzZXRUaW1lb3V0KCgpID0+IHtcclxuICAgICAgICAgICAgICAgIGlmICghd2luZG93Wyd0d3R0ciddKVxyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICAgICAgICAgIHdpbmRvd1sndHd0dHInXS53aWRnZXRzLmxvYWQoKTtcclxuICAgICAgICAgICAgfSwgMTAwKTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcblxyXG4gICAgYWN0aXZhdGUoKSB7XHJcbiAgICAgICAgdGhpcy5hY3RpdmF0ZWQubmV4dCgpO1xyXG4gICAgfVxyXG5cclxuICAgIHJlbW92ZSgpIHtcclxuICAgICAgICB0aGlzLnJlbW92ZWQubmV4dCgpO1xyXG4gICAgfVxyXG5cclxuICAgIGdldCBpc0Vycm9yKCkge1xyXG4gICAgICAgIHJldHVybiB0aGlzLmVycm9yIHx8IHRoaXMuYXR0YWNobWVudD8udHJhbnNpZW50U3RhdGU/LmVycm9yO1xyXG4gICAgfVxyXG5cclxuICAgIGdldCB0aGVFcnJvck1lc3NhZ2UoKSB7XHJcbiAgICAgICAgcmV0dXJuIHRoaXMuZXJyb3JNZXNz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AgICAgICAgICAgcmV0dXJuIHRoaXMuYXR0YWNobWVudC51cmw7XHJcbiAgICAgICAgfSBlbHNlIGlmICh0aGlzLmF0dGFjaG1lbnQudHlwZSA9PT0gJ2NhcmQnKSB7XHJcbiAgICAgICAgICAgIHJldHVybiB0aGlzLmF0dGFjaG1lbnQuY2FyZC5wbGF5ZXI7XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG59Il19
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Component, ElementRef, ViewChild } from "@angular/core";
|
|
2
2
|
export class LightboxComponent {
|
|
3
3
|
ngAfterViewInit() {
|
|
4
|
-
|
|
4
|
+
if (typeof window !== 'undefined') {
|
|
5
|
+
document.body.appendChild(this.containerElement.nativeElement);
|
|
6
|
+
}
|
|
5
7
|
}
|
|
6
8
|
ngOnDestroy() {
|
|
7
9
|
this.containerElement.nativeElement.remove();
|
|
@@ -25,4 +27,4 @@ LightboxComponent.decorators = [
|
|
|
25
27
|
LightboxComponent.propDecorators = {
|
|
26
28
|
containerElement: [{ type: ViewChild, args: ['container',] }]
|
|
27
29
|
};
|
|
28
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
30
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGlnaHRib3guY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvc2RrL3NyYy9saWIvY29tbW9uL2xpZ2h0Ym94L2xpZ2h0Ym94LmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFFLFVBQVUsRUFBRSxTQUFTLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFPakUsTUFBTSxPQUFPLGlCQUFpQjtJQUkxQixlQUFlO1FBQ1gsSUFBSSxPQUFPLE1BQU0sS0FBSyxXQUFXLEVBQUU7WUFD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SZWY8SFRNTERpdkVsZW1lbnQ+O1xyXG5cclxuICAgIG5nQWZ0ZXJWaWV3SW5pdCgpIHtcclxuICAgICAgICBpZiAodHlwZW9mIHdpbmRvdyAhPT0gJ3VuZGVmaW5lZCcpIHtcclxuICAgICAgICAgICAgZG9jdW1lbnQuYm9keS5hcHBlbmRDaGlsZCh0aGlzLmNvbnRhaW5lckVsZW1lbnQubmF0aXZlRWxlbWVudCk7XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG5cclxuICAgIG5nT25EZXN0cm95KCkge1xyXG4gICAgICAgIHRoaXMuY29udGFpbmVyRWxlbWVudC5uYXRpdmVFbGVtZW50LnJlbW92ZSgpO1xyXG4gICAgfVxyXG5cclxuICAgIGltYWdlczogc3RyaW5nW107XHJcbiAgICBjdXJyZW50SW1hZ2U6IHN0cmluZztcclxuXHJcbiAgICBpc09wZW46IGJvb2xlYW47XHJcblxyXG4gICAgY2xvc2UoKSB7XHJcbiAgICAgICAgdGhpcy5pc09wZW4gPSBmYWxzZTtcclxuICAgIH1cclxuXHJcbiAgICBvcGVuKGN1cnJlbnRJbWFnZTogc3RyaW5nLCBpbWFnZXM6IHN0cmluZ1tdKSB7XHJcbiAgICAgICAgdGhpcy5jdXJyZW50SW1hZ2UgPSBjdXJyZW50SW1hZ2U7XHJcbiAgICAgICAgdGhpcy5pbWFnZXMgPSBpbWFnZXM7XHJcbiAgICAgICAgdGhpcy5pc09wZW4gPSB0cnVlO1xyXG4gICAgfVxyXG59Il19
|
package/fesm2015/banta-sdk.js
CHANGED
|
@@ -143,7 +143,9 @@ TimestampComponent.propDecorators = {
|
|
|
143
143
|
|
|
144
144
|
class LightboxComponent {
|
|
145
145
|
ngAfterViewInit() {
|
|
146
|
-
|
|
146
|
+
if (typeof window !== 'undefined') {
|
|
147
|
+
document.body.appendChild(this.containerElement.nativeElement);
|
|
148
|
+
}
|
|
147
149
|
}
|
|
148
150
|
ngOnDestroy() {
|
|
149
151
|
this.containerElement.nativeElement.remove();
|
|
@@ -303,8 +305,8 @@ class BantaAttachmentComponent {
|
|
|
303
305
|
BantaAttachmentComponent.decorators = [
|
|
304
306
|
{ type: Component, args: [{
|
|
305
307
|
selector: 'banta-attachment',
|
|
306
|
-
template: "<button type=\"button\" (click)=\"remove()\" mat-mini-fab color=\"primary\" class=\"remove-button\" *ngIf=\"editing\">\r\n <mat-icon>close</mat-icon>\r\n</button>\r\n\r\n<ng-container *ngIf=\"isError\">\r\n <mat-icon class=\"error\">close</mat-icon>\r\n <em class=\"error\">{{theErrorMessage}}</em>\r\n</ng-container>\r\n<ng-container *ngIf=\"!isError\">\r\n <ng-container *ngIf=\"isLoading\">\r\n <mat-spinner></mat-spinner>\r\n <em>{{loadingMessage}}</em>\r\n </ng-container>\r\n <ng-container *ngIf=\"!isLoading\">\r\n <iframe *ngIf=\"hasFrame\"\r\n sandbox=\"allow-scripts allow-popups allow-same-origin allow-presentation\" \r\n [src]=\"frameUrl | trustResourceUrl\"></iframe>\r\n <a *ngIf=\"attachment.type === 'card'\" class=\"card\" [href]=\"attachment.url\" target=\"_blank\" [class.has-image]=\"attachment.card.image\">\r\n <img \r\n *ngIf=\"attachment.card.image\"\r\n class=\"thumbnail\" \r\n [src]=\"attachment.card.image\"\r\n />\r\n <div class=\"description\">\r\n <h1>{{attachment.card.title}}</h1>\r\n <div>\r\n {{attachment.card.description}}\r\n </div>\r\n <cite>{{attachment.card.url}}</cite>\r\n </div>\r\n </a>\r\n <a class=\"image-attachment\" *ngIf=\"isImageAttachment\" href=\"javascript:;\" (click)=\"activate()\">\r\n <img [src]=\"attachment.url\" alt=\"Image Attachment\">\r\n </a>\r\n <blockquote *ngIf=\"attachment.type === 'tweet'\" \r\n class=\"twitter-tweet\">\r\n <p lang=\"en\" dir=\"ltr\"></p>\r\n <a href=\"
|
|
307
|
-
styles: [":host{position:relative;display:block}:host.loading{outline:1px solid #333;padding:1em 0;width:300px;text-align:center}:host.loading mat-spinner{display:block;margin:0 auto .5em;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}a.card{display:flex;align-items:flex-start;gap:1em;width:100%;border:1px solid #666;border-radius:4px;padding:1em;box-sizing:border-box;background-color:#191919;margin:1em 0}a.card img{width:250px;aspect-ratio:16/9;-o-object-fit:cover;object-fit:cover;border-radius:10px}a.card.has-image h1{font-size:22px}a.card h1{min-width:0;margin:0 0 .5em;font-size:26px}a.card cite{min-width:0;opacity:.75;margin-top:1em;display:block;font-size:90%;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}a.card .description{min-width:0}.remove-button{position:absolute;right:10px;top:10px;margin:0;z-index:1}a.image-attachment{width:300px;position:relative;text-align:center}a.image-attachment.with-border{outline:1px solid #333;padding:1em 0}a.image-attachment mat-spinner{display:block;margin:0 auto .5em;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}a.image-attachment mat-icon.error{display:block;font-size:48px;width:48px;height:48px;margin:0 auto .5em}a.image-attachment .error{color:#b76363}a.image-attachment img{width:300px;border-radius:10px;max-width:100%;max-height:20em;-o-object-fit:cover;object-fit:cover}iframe{border:none;width:100%;aspect-ratio:16/9}"]
|
|
308
|
+
template: "<button type=\"button\" (click)=\"remove()\" mat-mini-fab color=\"primary\" class=\"remove-button\" *ngIf=\"editing\">\r\n <mat-icon>close</mat-icon>\r\n</button>\r\n\r\n<ng-container *ngIf=\"isError\">\r\n <mat-icon class=\"error\">close</mat-icon>\r\n <em class=\"error\">{{theErrorMessage}}</em>\r\n</ng-container>\r\n<ng-container *ngIf=\"!isError\">\r\n <ng-container *ngIf=\"isLoading\">\r\n <mat-spinner></mat-spinner>\r\n <em>{{loadingMessage}}</em>\r\n </ng-container>\r\n <ng-container *ngIf=\"!isLoading\">\r\n <iframe *ngIf=\"hasFrame\"\r\n sandbox=\"allow-scripts allow-popups allow-same-origin allow-presentation\" \r\n [src]=\"frameUrl | trustResourceUrl\"></iframe>\r\n <a *ngIf=\"attachment.type === 'card'\" class=\"card-attachment\" [href]=\"attachment.url\" target=\"_blank\" [class.has-image]=\"attachment.card.image\">\r\n <img \r\n *ngIf=\"attachment.card.image\"\r\n class=\"thumbnail\" \r\n [src]=\"attachment.card.image\"\r\n />\r\n <div class=\"description\">\r\n <h1>{{attachment.card.title}}</h1>\r\n <div>\r\n {{attachment.card.description}}\r\n </div>\r\n <cite>{{attachment.card.url}}</cite>\r\n </div>\r\n </a>\r\n <a class=\"image-attachment\" *ngIf=\"isImageAttachment\" href=\"javascript:;\" (click)=\"activate()\">\r\n <img [src]=\"attachment.url\" alt=\"Image Attachment\">\r\n </a>\r\n <blockquote *ngIf=\"attachment.type === 'tweet'\" \r\n class=\"twitter-tweet\">\r\n <p lang=\"en\" dir=\"ltr\"></p>\r\n <a [href]=\"attachment.url\"></a>\r\n </blockquote>\r\n </ng-container>\r\n</ng-container>",
|
|
309
|
+
styles: [":host{position:relative;display:block}:host.loading{outline:1px solid #333;padding:1em 0;width:300px;text-align:center}:host.loading mat-spinner{display:block;margin:0 auto .5em;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}a.card-attachment{display:flex;align-items:flex-start;gap:1em;width:100%;border:1px solid #666;border-radius:4px;padding:1em;box-sizing:border-box;background-color:#191919;margin:1em 0}a.card-attachment img{width:250px;aspect-ratio:16/9;-o-object-fit:cover;object-fit:cover;border-radius:10px}a.card-attachment.has-image h1{font-size:22px}a.card-attachment h1{min-width:0;margin:0 0 .5em;font-size:26px}a.card-attachment cite{min-width:0;opacity:.75;margin-top:1em;display:block;font-size:90%;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}a.card-attachment .description{min-width:0}.remove-button{position:absolute;right:10px;top:10px;margin:0;z-index:1}a.image-attachment{width:300px;position:relative;text-align:center}a.image-attachment.with-border{outline:1px solid #333;padding:1em 0}a.image-attachment mat-spinner{display:block;margin:0 auto .5em;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}a.image-attachment mat-icon.error{display:block;font-size:48px;width:48px;height:48px;margin:0 auto .5em}a.image-attachment .error{color:#b76363}a.image-attachment img{width:300px;border-radius:10px;max-width:100%;max-height:20em;-o-object-fit:cover;object-fit:cover}iframe{border:none;width:100%;aspect-ratio:16/9}@media (max-width:700px){a.card-attachment{flex-direction:column}a.card-attachment img{width:100%}}"]
|
|
308
310
|
},] }
|
|
309
311
|
];
|
|
310
312
|
BantaAttachmentComponent.ctorParameters = () => [];
|
|
@@ -7508,7 +7510,7 @@ class BantaChatComponent {
|
|
|
7508
7510
|
user: null,
|
|
7509
7511
|
sentAt: Date.now(),
|
|
7510
7512
|
likes: 0,
|
|
7511
|
-
url: location.href,
|
|
7513
|
+
url: typeof window !== 'undefined' ? location.href : undefined,
|
|
7512
7514
|
message: text
|
|
7513
7515
|
};
|
|
7514
7516
|
try {
|
|
@@ -8380,20 +8382,23 @@ class BantaCommentsComponent {
|
|
|
8380
8382
|
}
|
|
8381
8383
|
get isMobileSized() { return this.width < 500; }
|
|
8382
8384
|
ngAfterViewInit() {
|
|
8383
|
-
|
|
8384
|
-
let
|
|
8385
|
-
|
|
8386
|
-
this.
|
|
8387
|
-
|
|
8388
|
-
|
|
8389
|
-
|
|
8390
|
-
|
|
8391
|
-
|
|
8392
|
-
|
|
8385
|
+
if (typeof window !== 'undefined') {
|
|
8386
|
+
let callback = () => {
|
|
8387
|
+
let size = this.elementRef.nativeElement.getBoundingClientRect();
|
|
8388
|
+
this.ngZone.run(() => {
|
|
8389
|
+
this.width = size.width;
|
|
8390
|
+
this.height = size.height;
|
|
8391
|
+
});
|
|
8392
|
+
};
|
|
8393
|
+
this.resizeObserver = new ResizeObserver(callback);
|
|
8394
|
+
this.resizeObserver.observe(this.elementRef.nativeElement);
|
|
8395
|
+
callback();
|
|
8396
|
+
}
|
|
8393
8397
|
}
|
|
8394
8398
|
ngOnDestroy() {
|
|
8395
8399
|
this._subs.unsubscribe();
|
|
8396
|
-
this.resizeObserver
|
|
8400
|
+
if (this.resizeObserver)
|
|
8401
|
+
this.resizeObserver.disconnect();
|
|
8397
8402
|
}
|
|
8398
8403
|
setSourceFromTopicID(topicID) {
|
|
8399
8404
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -8517,6 +8522,8 @@ class BantaCommentsComponent {
|
|
|
8517
8522
|
}
|
|
8518
8523
|
// UI Interactions
|
|
8519
8524
|
scrollToComment(commentId) {
|
|
8525
|
+
if (typeof window === 'undefined')
|
|
8526
|
+
return;
|
|
8520
8527
|
setTimeout(() => {
|
|
8521
8528
|
const comment = document.querySelectorAll(`[data-comment-id="${commentId}"]`);
|
|
8522
8529
|
if (comment.length > 0) {
|
|
@@ -9005,13 +9012,17 @@ class CommentFieldComponent {
|
|
|
9005
9012
|
return this._permissionDeniedError;
|
|
9006
9013
|
}
|
|
9007
9014
|
ngAfterViewInit() {
|
|
9008
|
-
|
|
9009
|
-
|
|
9015
|
+
if (typeof window !== 'undefined') {
|
|
9016
|
+
let root = document.body.querySelector('[ng-version]') || document.body;
|
|
9017
|
+
root.appendChild(this.autocompleteEl.nativeElement);
|
|
9018
|
+
}
|
|
9010
9019
|
}
|
|
9011
9020
|
sendPermissionDenied(message) {
|
|
9012
9021
|
this._permissionDeniedError.next(message);
|
|
9013
9022
|
}
|
|
9014
9023
|
showAutoComplete(options) {
|
|
9024
|
+
if (typeof window === 'undefined')
|
|
9025
|
+
return;
|
|
9015
9026
|
this.autoCompleteSelected = 0;
|
|
9016
9027
|
this.autocompleteOptions = options;
|
|
9017
9028
|
let pos = this.autocompleteContainerEl.nativeElement.getBoundingClientRect();
|
|
@@ -9041,7 +9052,7 @@ class CommentFieldComponent {
|
|
|
9041
9052
|
}, 5 * 1000);
|
|
9042
9053
|
}, 100);
|
|
9043
9054
|
// On mobile, just show an alert dialog
|
|
9044
|
-
if (window.innerWidth < 430)
|
|
9055
|
+
if (typeof window !== 'undefined' && window.innerWidth < 430)
|
|
9045
9056
|
alert(message);
|
|
9046
9057
|
}
|
|
9047
9058
|
get isValidMessage() {
|
|
@@ -9196,7 +9207,7 @@ class CommentFieldComponent {
|
|
|
9196
9207
|
let message = {
|
|
9197
9208
|
user: this.user,
|
|
9198
9209
|
sentAt: Date.now(),
|
|
9199
|
-
url: location.href,
|
|
9210
|
+
url: typeof window !== 'undefined' ? location.href : undefined,
|
|
9200
9211
|
likes: 0,
|
|
9201
9212
|
message: text,
|
|
9202
9213
|
attachments: this.chatMessageAttachments.filter(x => x.url)
|