@banta/sdk 4.6.15 → 4.6.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 +35 -34
- 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/common/index.js +2 -1
- package/esm2015/lib/index.js +1 -2
- package/fesm2015/banta-sdk.js +31 -31
- package/fesm2015/banta-sdk.js.map +1 -1
- package/lib/common/index.d.ts +1 -0
- package/lib/index.d.ts +0 -1
- package/package.json +10 -10
|
@@ -3,7 +3,8 @@ export * from './timestamp.component';
|
|
|
3
3
|
export * from './lightbox/lightbox.component';
|
|
4
4
|
export * from './markdown-to-html.pipe';
|
|
5
5
|
export * from './trust-resource-url.pipe';
|
|
6
|
+
export * from './mention-linker.pipe';
|
|
6
7
|
export * from './attachment/attachment.component';
|
|
7
8
|
export * from './attachments/attachments.component';
|
|
8
9
|
export * from './common.module';
|
|
9
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
10
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9zZGsvc3JjL2xpYi9jb21tb24vaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxtQkFBbUIsQ0FBQztBQUNsQyxjQUFjLHVCQUF1QixDQUFDO0FBQ3RDLGNBQWMsK0JBQStCLENBQUM7QUFDOUMsY0FBYyx5QkFBeUIsQ0FBQztBQUN4QyxjQUFjLDJCQUEyQixDQUFDO0FBQzFDLGNBQWMsdUJBQXVCLENBQUM7QUFDdEMsY0FBYyxtQ0FBbUMsQ0FBQztBQUNsRCxjQUFjLHFDQUFxQyxDQUFDO0FBRXBELGNBQWMsaUJBQWlCLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL2xhenktY29ubmVjdGlvbic7XHJcbmV4cG9ydCAqIGZyb20gJy4vdGltZXN0YW1wLmNvbXBvbmVudCc7XHJcbmV4cG9ydCAqIGZyb20gJy4vbGlnaHRib3gvbGlnaHRib3guY29tcG9uZW50JztcclxuZXhwb3J0ICogZnJvbSAnLi9tYXJrZG93bi10by1odG1sLnBpcGUnO1xyXG5leHBvcnQgKiBmcm9tICcuL3RydXN0LXJlc291cmNlLXVybC5waXBlJztcclxuZXhwb3J0ICogZnJvbSAnLi9tZW50aW9uLWxpbmtlci5waXBlJztcclxuZXhwb3J0ICogZnJvbSAnLi9hdHRhY2htZW50L2F0dGFjaG1lbnQuY29tcG9uZW50JztcclxuZXhwb3J0ICogZnJvbSAnLi9hdHRhY2htZW50cy9hdHRhY2htZW50cy5jb21wb25lbnQnO1xyXG5cclxuZXhwb3J0ICogZnJvbSAnLi9jb21tb24ubW9kdWxlJzsiXX0=
|
package/esm2015/lib/index.js
CHANGED
|
@@ -16,6 +16,5 @@ export * from './youtube-attachments';
|
|
|
16
16
|
export * from './giphy-attachments';
|
|
17
17
|
export * from './tweet-attachments';
|
|
18
18
|
export * from './message-menu-item';
|
|
19
|
-
export * from './attachment-scraper';
|
|
20
19
|
export * from './banta-sdk.module';
|
|
21
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
20
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9zZGsvc3JjL2xpYi9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLFVBQVUsQ0FBQztBQUN6QixjQUFjLFNBQVMsQ0FBQztBQUN4QixjQUFjLHlCQUF5QixDQUFDO0FBQ3hDLGNBQ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vbSAnLi9hdHRhY2htZW50LXNjcmFwZXInO1xyXG5leHBvcnQgKiBmcm9tICcuL3VybC1hdHRhY2htZW50cyc7XHJcbmV4cG9ydCAqIGZyb20gJy4veW91dHViZS1hdHRhY2htZW50cyc7XHJcbmV4cG9ydCAqIGZyb20gJy4vZ2lwaHktYXR0YWNobWVudHMnO1xyXG5leHBvcnQgKiBmcm9tICcuL3R3ZWV0LWF0dGFjaG1lbnRzJztcclxuZXhwb3J0ICogZnJvbSAnLi9tZXNzYWdlLW1lbnUtaXRlbSc7XHJcblxyXG5leHBvcnQgKiBmcm9tICcuL2JhbnRhLXNkay5tb2R1bGUnOyJdfQ==
|
package/fesm2015/banta-sdk.js
CHANGED
|
@@ -259,6 +259,36 @@ BantaTrustResourceUrlPipe.ctorParameters = () => [
|
|
|
259
259
|
{ type: DomSanitizer }
|
|
260
260
|
];
|
|
261
261
|
|
|
262
|
+
class BantaMentionLinkerPipe {
|
|
263
|
+
transform(value, links) {
|
|
264
|
+
if (!value)
|
|
265
|
+
return '';
|
|
266
|
+
if (!links)
|
|
267
|
+
return value;
|
|
268
|
+
let text = value;
|
|
269
|
+
for (let i = 0, max = links.length; i < max; ++i) {
|
|
270
|
+
let mention = links[i];
|
|
271
|
+
text = text.replace(new RegExp(`${this.escapeRegExp(mention.text)}`, `gi`), `@{${i + 1}}`);
|
|
272
|
+
}
|
|
273
|
+
text = text.replace(/@\{(\d+)\}/g, (text, i) => links[i - 1] ? this.formatLink(links[i - 1]) : text);
|
|
274
|
+
return text;
|
|
275
|
+
}
|
|
276
|
+
formatLink(link) {
|
|
277
|
+
return `<a${link.external ? ` target="_blank" rel="noopener"` : ``} href="${link.link}">${link.text}</a>`;
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* https://stackoverflow.com/questions/3446170/escape-string-for-use-in-javascript-regex
|
|
281
|
+
*/
|
|
282
|
+
escapeRegExp(string) {
|
|
283
|
+
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
BantaMentionLinkerPipe.decorators = [
|
|
287
|
+
{ type: Pipe, args: [{
|
|
288
|
+
name: 'mentionLinker'
|
|
289
|
+
},] }
|
|
290
|
+
];
|
|
291
|
+
|
|
262
292
|
class BantaAttachmentComponent {
|
|
263
293
|
constructor(elementRef) {
|
|
264
294
|
this.elementRef = elementRef;
|
|
@@ -425,36 +455,6 @@ BantaAttachmentsComponent.propDecorators = {
|
|
|
425
455
|
loaded: [{ type: Output }]
|
|
426
456
|
};
|
|
427
457
|
|
|
428
|
-
class BantaMentionLinkerPipe {
|
|
429
|
-
transform(value, links) {
|
|
430
|
-
if (!value)
|
|
431
|
-
return '';
|
|
432
|
-
if (!links)
|
|
433
|
-
return value;
|
|
434
|
-
let text = value;
|
|
435
|
-
for (let i = 0, max = links.length; i < max; ++i) {
|
|
436
|
-
let mention = links[i];
|
|
437
|
-
text = text.replace(new RegExp(`${this.escapeRegExp(mention.text)}`, `gi`), `@{${i + 1}}`);
|
|
438
|
-
}
|
|
439
|
-
text = text.replace(/@\{(\d+)\}/g, (text, i) => links[i - 1] ? this.formatLink(links[i - 1]) : text);
|
|
440
|
-
return text;
|
|
441
|
-
}
|
|
442
|
-
formatLink(link) {
|
|
443
|
-
return `<a${link.external ? ` target="_blank" rel="noopener"` : ``} href="${link.link}">${link.text}</a>`;
|
|
444
|
-
}
|
|
445
|
-
/**
|
|
446
|
-
* https://stackoverflow.com/questions/3446170/escape-string-for-use-in-javascript-regex
|
|
447
|
-
*/
|
|
448
|
-
escapeRegExp(string) {
|
|
449
|
-
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
|
|
450
|
-
}
|
|
451
|
-
}
|
|
452
|
-
BantaMentionLinkerPipe.decorators = [
|
|
453
|
-
{ type: Pipe, args: [{
|
|
454
|
-
name: 'mentionLinker'
|
|
455
|
-
},] }
|
|
456
|
-
];
|
|
457
|
-
|
|
458
458
|
const COMPONENTS = [
|
|
459
459
|
TimestampComponent,
|
|
460
460
|
LightboxComponent,
|
|
@@ -10289,5 +10289,5 @@ BantaSdkModule.ctorParameters = () => [
|
|
|
10289
10289
|
* Generated bundle index. Do not edit.
|
|
10290
10290
|
*/
|
|
10291
10291
|
|
|
10292
|
-
export { AttachmentButtonComponent, AttachmentScraperDirective, BANTA_SDK_OPTIONS, BantaAttachmentComponent, BantaAttachmentsComponent, BantaChatComponent, BantaCommentsComponent, BantaCommonModule, BantaComponent, BantaLogoComponent, BantaMarkdownToHtmlPipe, BantaReplySendOptionsDirective, BantaSdkModule, BantaTrustResourceUrlPipe, ChatBackend, ChatBackendBase, ChatMessageComponent, ChatModule, ChatSource, ChatViewComponent, CommentComponent, CommentFieldComponent, CommentSortComponent, CommentViewComponent, CommentsModule, EMOJIS, EmojiModule, EmojiSelectorButtonComponent, EmojiSelectorPanelComponent, GiphyAttachmentResolver, LightboxComponent, LiveChatMessageComponent, LiveCommentComponent, LiveMessageComponent, TimestampComponent, TweetAttachmentResolver, UrlAttachmentResolver, UrlAttachmentScraper, YouTubeAttachmentResolver, lazyConnection };
|
|
10292
|
+
export { AttachmentButtonComponent, AttachmentScraperDirective, BANTA_SDK_OPTIONS, BantaAttachmentComponent, BantaAttachmentsComponent, BantaChatComponent, BantaCommentsComponent, BantaCommonModule, BantaComponent, BantaLogoComponent, BantaMarkdownToHtmlPipe, BantaMentionLinkerPipe, BantaReplySendOptionsDirective, BantaSdkModule, BantaTrustResourceUrlPipe, ChatBackend, ChatBackendBase, ChatMessageComponent, ChatModule, ChatSource, ChatViewComponent, CommentComponent, CommentFieldComponent, CommentSortComponent, CommentViewComponent, CommentsModule, EMOJIS, EmojiModule, EmojiSelectorButtonComponent, EmojiSelectorPanelComponent, GiphyAttachmentResolver, LightboxComponent, LiveChatMessageComponent, LiveCommentComponent, LiveMessageComponent, TimestampComponent, TweetAttachmentResolver, UrlAttachmentResolver, UrlAttachmentScraper, YouTubeAttachmentResolver, lazyConnection };
|
|
10293
10293
|
//# sourceMappingURL=banta-sdk.js.map
|