croco-html 0.2.8 → 0.2.10

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.
@@ -0,0 +1,17 @@
1
+ import { Pipe } from '@angular/core';
2
+ import { HtmlExtractionMethods } from '../extensions/HtmlExtractionMethods';
3
+ import * as i0 from "@angular/core";
4
+ export class ToPreviewHtmlPipe {
5
+ transform(value, options) {
6
+ return HtmlExtractionMethods.transformHtmlStringToBlocks(value, options);
7
+ }
8
+ }
9
+ ToPreviewHtmlPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ToPreviewHtmlPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
10
+ ToPreviewHtmlPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: ToPreviewHtmlPipe, name: "topreviewhtml" });
11
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ToPreviewHtmlPipe, decorators: [{
12
+ type: Pipe,
13
+ args: [{
14
+ name: 'topreviewhtml'
15
+ }]
16
+ }] });
17
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiVG9QcmV2aWV3SHRtbFBpcGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9jcm9jby1odG1sL3NyYy9saWIvcGlwZXMvVG9QcmV2aWV3SHRtbFBpcGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLElBQUksRUFBaUIsTUFBTSxlQUFlLENBQUM7QUFDcEQsT0FBTyxFQUFFLHFCQUFxQixFQUF5QixNQUFNLHFDQUFxQyxDQUFDOztBQVFuRyxNQUFNLE9BQU8saUJBQWlCO0lBQzVCLFNBQVMsQ0FBQyxLQUFhLEVBQUUsT0FBOEI7UUFDckQsT0FBTyxxQkFBcUIsQ0FBQywyQkFBMkIsQ0FBQyxLQUFLLEVBQUUsT0FBTyxDQUFDLENBQUM7SUFDM0UsQ0FBQzs7OEdBSFUsaUJBQWlCOzRHQUFqQixpQkFBaUI7MkZBQWpCLGlCQUFpQjtrQkFIN0IsSUFBSTttQkFBQztvQkFDSixJQUFJLEVBQUUsZUFBZTtpQkFDdEIiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBQaXBlLCBQaXBlVHJhbnNmb3JtIH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XHJcbmltcG9ydCB7IEh0bWxFeHRyYWN0aW9uTWV0aG9kcywgSHRtbEV4dHJhY3Rpb25PcHRpb25zIH0gZnJvbSAnLi4vZXh0ZW5zaW9ucy9IdG1sRXh0cmFjdGlvbk1ldGhvZHMnO1xyXG5pbXBvcnQgeyBJbnRlcmZhY2VCbG9jayB9IGZyb20gXCIuLi9leHRlbnNpb25zL0ludGVyZmFjZUJsb2NrXCI7XHJcblxyXG5cclxuXHJcbkBQaXBlKHtcclxuICBuYW1lOiAndG9wcmV2aWV3aHRtbCdcclxufSlcclxuZXhwb3J0IGNsYXNzIFRvUHJldmlld0h0bWxQaXBlIGltcGxlbWVudHMgUGlwZVRyYW5zZm9ybSB7XHJcbiAgdHJhbnNmb3JtKHZhbHVlOiBzdHJpbmcsIG9wdGlvbnM6IEh0bWxFeHRyYWN0aW9uT3B0aW9ucyk6IEludGVyZmFjZUJsb2NrW10ge1xyXG4gICAgcmV0dXJuIEh0bWxFeHRyYWN0aW9uTWV0aG9kcy50cmFuc2Zvcm1IdG1sU3RyaW5nVG9CbG9ja3ModmFsdWUsIG9wdGlvbnMpO1xyXG4gIH1cclxufVxyXG4iXX0=
@@ -2,4 +2,5 @@ export * from "./RichTextToHtmlPipe";
2
2
  export * from "./TagToSpanPipe";
3
3
  export * from "./to-preview.pipe";
4
4
  export * from "./ToHtmlBodyTagsPipe";
5
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9jcm9jby1odG1sL3NyYy9saWIvcGlwZXMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxzQkFBc0IsQ0FBQztBQUNyQyxjQUFjLGlCQUFpQixDQUFDO0FBQ2hDLGNBQWMsbUJBQW1CLENBQUM7QUFDbEMsY0FBYyxzQkFBc0IsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCAqIGZyb20gXCIuL1JpY2hUZXh0VG9IdG1sUGlwZVwiO1xyXG5leHBvcnQgKiBmcm9tIFwiLi9UYWdUb1NwYW5QaXBlXCI7XHJcbmV4cG9ydCAqIGZyb20gXCIuL3RvLXByZXZpZXcucGlwZVwiO1xyXG5leHBvcnQgKiBmcm9tIFwiLi9Ub0h0bWxCb2R5VGFnc1BpcGVcIjtcclxuIl19
5
+ export * from "./ToPreviewHtmlPipe";
6
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9jcm9jby1odG1sL3NyYy9saWIvcGlwZXMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxzQkFBc0IsQ0FBQztBQUNyQyxjQUFjLGlCQUFpQixDQUFDO0FBQ2hDLGNBQWMsbUJBQW1CLENBQUM7QUFDbEMsY0FBYyxzQkFBc0IsQ0FBQztBQUNyQyxjQUFjLHFCQUFxQixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0ICogZnJvbSBcIi4vUmljaFRleHRUb0h0bWxQaXBlXCI7XHJcbmV4cG9ydCAqIGZyb20gXCIuL1RhZ1RvU3BhblBpcGVcIjtcclxuZXhwb3J0ICogZnJvbSBcIi4vdG8tcHJldmlldy5waXBlXCI7XHJcbmV4cG9ydCAqIGZyb20gXCIuL1RvSHRtbEJvZHlUYWdzUGlwZVwiO1xyXG5leHBvcnQgKiBmcm9tIFwiLi9Ub1ByZXZpZXdIdG1sUGlwZVwiO1xyXG4iXX0=
@@ -3,7 +3,10 @@ import { HtmlExtractionMethods } from '../extensions/HtmlExtractionMethods';
3
3
  import * as i0 from "@angular/core";
4
4
  export class ToPreviewPipe {
5
5
  transform(value) {
6
- return HtmlExtractionMethods.transformHtmlStringToBlocks(value);
6
+ return HtmlExtractionMethods.transformHtmlStringToBlocks(value, {
7
+ useCustomDomain: false,
8
+ domain: ""
9
+ });
7
10
  }
8
11
  }
9
12
  ToPreviewPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ToPreviewPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
@@ -14,4 +17,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
14
17
  name: 'topreview'
15
18
  }]
16
19
  }] });
17
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG8tcHJldmlldy5waXBlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvY3JvY28taHRtbC9zcmMvbGliL3BpcGVzL3RvLXByZXZpZXcucGlwZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsSUFBSSxFQUFpQixNQUFNLGVBQWUsQ0FBQztBQUNwRCxPQUFPLEVBQUUscUJBQXFCLEVBQUUsTUFBTSxxQ0FBcUMsQ0FBQzs7QUFNNUUsTUFBTSxPQUFPLGFBQWE7SUFDeEIsU0FBUyxDQUFDLEtBQWE7UUFDckIsT0FBTyxx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pbjogXCJcIlxyXG4gICAgfSk7XHJcbiAgfVxyXG59XHJcbiJdfQ==
@@ -74,15 +74,23 @@ class FileImageTagDataConsts {
74
74
  FileImageTagDataConsts.TagName = "file-image";
75
75
  FileImageTagDataConsts.FileIdAttrName = "file-id";
76
76
  class ImageMethods {
77
- static buildUrl(fileId) {
78
- return `/FileCopies/Images/Medium/${fileId}.jpg`;
77
+ static buildUrl(fileId, options) {
78
+ var baseUrl = `/FileCopies/Images/Medium/${fileId}.jpg`;
79
+ if (!options.useCustomDomain) {
80
+ return baseUrl;
81
+ }
82
+ return `${options.domain}${baseUrl}`;
79
83
  }
80
- static buildSmallUrl(fileId) {
81
- return `/FileCopies/Images/Small/${fileId}.jpg`;
84
+ static buildSmallUrl(fileId, options) {
85
+ var baseUrl = `/FileCopies/Images/Small/${fileId}.jpg`;
86
+ if (!options.useCustomDomain) {
87
+ return baseUrl;
88
+ }
89
+ return `${options.domain}${baseUrl}`;
82
90
  }
83
- static ExtractImage(elem) {
91
+ static ExtractImage(elem, options) {
84
92
  let fileId = +elem.getAttribute(FileImageTagDataConsts.FileIdAttrName);
85
- let src = ImageMethods.buildUrl(fileId);
93
+ let src = ImageMethods.buildUrl(fileId, options);
86
94
  return {
87
95
  type: FileImageTagDataConsts.TagName,
88
96
  data: {
@@ -378,7 +386,7 @@ class FileIdSelectComponent {
378
386
  this.onFileIdChanged.emit(fileId);
379
387
  }
380
388
  getSrc(fileId) {
381
- return ImageMethods.buildSmallUrl(fileId);
389
+ return ImageMethods.buildSmallUrl(fileId, { useCustomDomain: false, domain: "" });
382
390
  }
383
391
  ngOnInit() {
384
392
  this.loadFiles();
@@ -428,7 +436,7 @@ class ImageEditorComponent {
428
436
  this.onTagUpdated = new EventEmitter();
429
437
  }
430
438
  getSrc() {
431
- return ImageMethods.buildUrl(this.tag.attributes[FileImageTagDataConsts.FileIdAttrName]);
439
+ return ImageMethods.buildUrl(this.tag.attributes[FileImageTagDataConsts.FileIdAttrName], { useCustomDomain: false, domain: "" });
432
440
  }
433
441
  hasFileId() {
434
442
  return this.tag.attributes.hasOwnProperty(FileImageTagDataConsts.FileIdAttrName) && !isNaN(this.tag.attributes[FileImageTagDataConsts.FileIdAttrName]);
@@ -516,10 +524,10 @@ class XmlTagViewComponent {
516
524
  }
517
525
  }
518
526
  XmlTagViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: XmlTagViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
519
- XmlTagViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: XmlTagViewComponent, selector: "croco-html-xml-tag-view", inputs: { data: "data" }, ngImport: i0, template: "<div class=\"\">\r\n <div class=\"row\" *ngFor=\"let item of data\">\r\n <div *ngIf=\"item.type === 'text'\">\r\n <croco-html-xml-tag-text-view [item]=\"item\"></croco-html-xml-tag-text-view>\r\n </div>\r\n <div *ngIf=\"item.type === 'image'\" class=\"red\" style=\"margin-top: 10px;\" >\r\n <h4>\u0414\u0430\u043D\u043D\u044B\u0439 \u0442\u0435\u0433 \u0431\u043E\u043B\u044C\u0448\u0435 \u0431\u043E\u043B\u044C\u0448\u0435 \u043D\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044F</h4>\r\n <span>\r\n \u0412\u043C\u0435\u0442\u043E \u044D\u0442\u043E\u0433\u043E \u043F\u0435\u0440\u0435\u0438\u043C\u0435\u043D\u0443\u0439\u0442\u0435 \u0442\u0435\u0433 image \u043D\u0430 file-image\r\n </span>\r\n </div>\r\n <div *ngIf=\"item.type === 'html-raw'\" [innerHTML]=\"item.data.innerHTML\">\r\n </div>\r\n <div *ngIf=\"item.type === 'h1' || item.type === 'h2' || item.type === 'h3' || item.type === 'h4' || item.type === 'h5' || item.type === 'h6'\">\r\n <croco-html-xml-tag-header-text-view [item]=\"item\"></croco-html-xml-tag-header-text-view>\r\n </div>\r\n <div *ngIf=\"item.type === 'file-image'\">\r\n <img class=\"mx-auto d-block img-fluid\" [src]=\"item.data.src\"/>\r\n </div>\r\n <div *ngIf=\"item.type === 'table'\">\r\n \r\n <croco-html-xml-tag-html-view *ngIf=\"item.validationResult.isSucceeded\" [html]=\"item.bootstrapHtml\">\r\n </croco-html-xml-tag-html-view>\r\n \r\n <app-tutor-baseapiresponse-banner \r\n *ngIf=\"item.validationResult && !item.validationResult.isSucceeded\" \r\n [message]=\"item.validationResult.message\">\r\n </app-tutor-baseapiresponse-banner>\r\n </div>\r\n \r\n <div *ngIf=\"item.type === 'rich-text'\">\r\n <croco-html-xml-tag-text-view [richTextData]=\"item\"></croco-html-xml-tag-text-view>\r\n </div>\r\n <div *ngIf=\"item.type === 'external-video'\">\r\n <croco-html-xml-tag-external-video [data]=\"item\"></croco-html-xml-tag-external-video>\r\n </div>\r\n <div *ngIf=\"item.type === 'unsupported-tag'\" class=\"red\" style=\"margin-top: 10px;\" >\r\n <h4>\u0414\u0430\u043D\u043D\u044B\u0439 \u0442\u0435\u0433 \u043D\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044F</h4>\r\n <span>\r\n {{item.data.tagString}}\r\n </span>\r\n </div>\r\n </div>\r\n</div>", styles: [".red{background-color:#c94444;color:#fff}\n"], dependencies: [{ kind: "directive", type: i1$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: XmlTagHtmlViewComponent, selector: "croco-html-xml-tag-html-view", inputs: ["html"] }, { kind: "component", type: XmlTagTextViewComponent, selector: "croco-html-xml-tag-text-view", inputs: ["item"] }, { kind: "component", type: XmlTagHeaderTextViewComponent, selector: "croco-html-xml-tag-header-text-view", inputs: ["item"] }, { kind: "component", type: XmlTagExternalVideoComponent, selector: "croco-html-xml-tag-external-video", inputs: ["data", "tagData"] }], encapsulation: i0.ViewEncapsulation.None });
527
+ XmlTagViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: XmlTagViewComponent, selector: "croco-html-xml-tag-view", inputs: { data: "data" }, ngImport: i0, template: "<div class=\"\">\r\n <div class=\"row\" *ngFor=\"let item of data\">\r\n <div *ngIf=\"item.type === 'text'\">\r\n <croco-html-xml-tag-text-view [item]=\"item\"></croco-html-xml-tag-text-view>\r\n </div>\r\n <div *ngIf=\"item.type === 'html-raw'\" [innerHTML]=\"item.data.innerHTML\">\r\n </div>\r\n <div *ngIf=\"item.type === 'h1' || item.type === 'h2' || item.type === 'h3' || item.type === 'h4' || item.type === 'h5' || item.type === 'h6'\">\r\n <croco-html-xml-tag-header-text-view [item]=\"item\"></croco-html-xml-tag-header-text-view>\r\n </div>\r\n <div *ngIf=\"item.type === 'file-image'\">\r\n <img class=\"mx-auto d-block img-fluid\" [src]=\"item.data.src\"/>\r\n </div>\r\n <div *ngIf=\"item.type === 'table'\">\r\n \r\n <croco-html-xml-tag-html-view *ngIf=\"item.validationResult.isSucceeded\" [html]=\"item.bootstrapHtml\">\r\n </croco-html-xml-tag-html-view>\r\n \r\n <app-tutor-baseapiresponse-banner \r\n *ngIf=\"item.validationResult && !item.validationResult.isSucceeded\" \r\n [message]=\"item.validationResult.message\">\r\n </app-tutor-baseapiresponse-banner>\r\n </div>\r\n \r\n <div *ngIf=\"item.type === 'rich-text'\">\r\n <croco-html-xml-tag-text-view [richTextData]=\"item\"></croco-html-xml-tag-text-view>\r\n </div>\r\n <div *ngIf=\"item.type === 'external-video'\">\r\n <croco-html-xml-tag-external-video [data]=\"item\"></croco-html-xml-tag-external-video>\r\n </div>\r\n <div *ngIf=\"item.type === 'unsupported-tag'\" class=\"red\" style=\"margin-top: 10px;\" >\r\n <h4>\u0414\u0430\u043D\u043D\u044B\u0439 \u0442\u0435\u0433 \u043D\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044F</h4>\r\n <span>\r\n {{item.data.tagString}}\r\n </span>\r\n </div>\r\n </div>\r\n</div>", styles: [".red{background-color:#c94444;color:#fff}\n"], dependencies: [{ kind: "directive", type: i1$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: XmlTagHtmlViewComponent, selector: "croco-html-xml-tag-html-view", inputs: ["html"] }, { kind: "component", type: XmlTagTextViewComponent, selector: "croco-html-xml-tag-text-view", inputs: ["item"] }, { kind: "component", type: XmlTagHeaderTextViewComponent, selector: "croco-html-xml-tag-header-text-view", inputs: ["item"] }, { kind: "component", type: XmlTagExternalVideoComponent, selector: "croco-html-xml-tag-external-video", inputs: ["data", "tagData"] }], encapsulation: i0.ViewEncapsulation.None });
520
528
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: XmlTagViewComponent, decorators: [{
521
529
  type: Component,
522
- args: [{ selector: 'croco-html-xml-tag-view', encapsulation: ViewEncapsulation.None, template: "<div class=\"\">\r\n <div class=\"row\" *ngFor=\"let item of data\">\r\n <div *ngIf=\"item.type === 'text'\">\r\n <croco-html-xml-tag-text-view [item]=\"item\"></croco-html-xml-tag-text-view>\r\n </div>\r\n <div *ngIf=\"item.type === 'image'\" class=\"red\" style=\"margin-top: 10px;\" >\r\n <h4>\u0414\u0430\u043D\u043D\u044B\u0439 \u0442\u0435\u0433 \u0431\u043E\u043B\u044C\u0448\u0435 \u0431\u043E\u043B\u044C\u0448\u0435 \u043D\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044F</h4>\r\n <span>\r\n \u0412\u043C\u0435\u0442\u043E \u044D\u0442\u043E\u0433\u043E \u043F\u0435\u0440\u0435\u0438\u043C\u0435\u043D\u0443\u0439\u0442\u0435 \u0442\u0435\u0433 image \u043D\u0430 file-image\r\n </span>\r\n </div>\r\n <div *ngIf=\"item.type === 'html-raw'\" [innerHTML]=\"item.data.innerHTML\">\r\n </div>\r\n <div *ngIf=\"item.type === 'h1' || item.type === 'h2' || item.type === 'h3' || item.type === 'h4' || item.type === 'h5' || item.type === 'h6'\">\r\n <croco-html-xml-tag-header-text-view [item]=\"item\"></croco-html-xml-tag-header-text-view>\r\n </div>\r\n <div *ngIf=\"item.type === 'file-image'\">\r\n <img class=\"mx-auto d-block img-fluid\" [src]=\"item.data.src\"/>\r\n </div>\r\n <div *ngIf=\"item.type === 'table'\">\r\n \r\n <croco-html-xml-tag-html-view *ngIf=\"item.validationResult.isSucceeded\" [html]=\"item.bootstrapHtml\">\r\n </croco-html-xml-tag-html-view>\r\n \r\n <app-tutor-baseapiresponse-banner \r\n *ngIf=\"item.validationResult && !item.validationResult.isSucceeded\" \r\n [message]=\"item.validationResult.message\">\r\n </app-tutor-baseapiresponse-banner>\r\n </div>\r\n \r\n <div *ngIf=\"item.type === 'rich-text'\">\r\n <croco-html-xml-tag-text-view [richTextData]=\"item\"></croco-html-xml-tag-text-view>\r\n </div>\r\n <div *ngIf=\"item.type === 'external-video'\">\r\n <croco-html-xml-tag-external-video [data]=\"item\"></croco-html-xml-tag-external-video>\r\n </div>\r\n <div *ngIf=\"item.type === 'unsupported-tag'\" class=\"red\" style=\"margin-top: 10px;\" >\r\n <h4>\u0414\u0430\u043D\u043D\u044B\u0439 \u0442\u0435\u0433 \u043D\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044F</h4>\r\n <span>\r\n {{item.data.tagString}}\r\n </span>\r\n </div>\r\n </div>\r\n</div>", styles: [".red{background-color:#c94444;color:#fff}\n"] }]
530
+ args: [{ selector: 'croco-html-xml-tag-view', encapsulation: ViewEncapsulation.None, template: "<div class=\"\">\r\n <div class=\"row\" *ngFor=\"let item of data\">\r\n <div *ngIf=\"item.type === 'text'\">\r\n <croco-html-xml-tag-text-view [item]=\"item\"></croco-html-xml-tag-text-view>\r\n </div>\r\n <div *ngIf=\"item.type === 'html-raw'\" [innerHTML]=\"item.data.innerHTML\">\r\n </div>\r\n <div *ngIf=\"item.type === 'h1' || item.type === 'h2' || item.type === 'h3' || item.type === 'h4' || item.type === 'h5' || item.type === 'h6'\">\r\n <croco-html-xml-tag-header-text-view [item]=\"item\"></croco-html-xml-tag-header-text-view>\r\n </div>\r\n <div *ngIf=\"item.type === 'file-image'\">\r\n <img class=\"mx-auto d-block img-fluid\" [src]=\"item.data.src\"/>\r\n </div>\r\n <div *ngIf=\"item.type === 'table'\">\r\n \r\n <croco-html-xml-tag-html-view *ngIf=\"item.validationResult.isSucceeded\" [html]=\"item.bootstrapHtml\">\r\n </croco-html-xml-tag-html-view>\r\n \r\n <app-tutor-baseapiresponse-banner \r\n *ngIf=\"item.validationResult && !item.validationResult.isSucceeded\" \r\n [message]=\"item.validationResult.message\">\r\n </app-tutor-baseapiresponse-banner>\r\n </div>\r\n \r\n <div *ngIf=\"item.type === 'rich-text'\">\r\n <croco-html-xml-tag-text-view [richTextData]=\"item\"></croco-html-xml-tag-text-view>\r\n </div>\r\n <div *ngIf=\"item.type === 'external-video'\">\r\n <croco-html-xml-tag-external-video [data]=\"item\"></croco-html-xml-tag-external-video>\r\n </div>\r\n <div *ngIf=\"item.type === 'unsupported-tag'\" class=\"red\" style=\"margin-top: 10px;\" >\r\n <h4>\u0414\u0430\u043D\u043D\u044B\u0439 \u0442\u0435\u0433 \u043D\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044F</h4>\r\n <span>\r\n {{item.data.tagString}}\r\n </span>\r\n </div>\r\n </div>\r\n</div>", styles: [".red{background-color:#c94444;color:#fff}\n"] }]
523
531
  }], ctorParameters: function () { return []; }, propDecorators: { data: [{
524
532
  type: Input
525
533
  }] } });
@@ -737,10 +745,10 @@ TableTypes.TableRowColumnData = "table-row-column-data";
737
745
  TableTypes.Table = "table";
738
746
  TableTypes.TableRowColumn = "table-row-column";
739
747
  class TableMethods {
740
- static getTableFromHtmlTag(tableTag) {
748
+ static getTableFromHtmlTag(tableTag, options) {
741
749
  let tableData = {
742
750
  header: TableMethods.getHeader(tableTag),
743
- rows: TableMethods.getTableRows(tableTag)
751
+ rows: TableMethods.getTableRows(tableTag, options)
744
752
  };
745
753
  var result = {
746
754
  type: TableTypes.Table,
@@ -794,7 +802,7 @@ class TableMethods {
794
802
  columns: headerColumns
795
803
  };
796
804
  }
797
- static getTableRows(tableTag) {
805
+ static getTableRows(tableTag, options) {
798
806
  let tBody = tableTag.tBodies.item(0);
799
807
  let rows = [];
800
808
  for (let i = 0; i < tBody.children.length; i++) {
@@ -802,7 +810,7 @@ class TableMethods {
802
810
  let rowColumns = [];
803
811
  for (let j = 0; j < iElement.children.length; j++) {
804
812
  const jElement = iElement.children.item(j);
805
- let children = HtmlExtractionMethods.transformHtmlElementToBlocks(jElement);
813
+ let children = HtmlExtractionMethods.transformHtmlElementToBlocks(jElement, options);
806
814
  if (children.length === 0) {
807
815
  var textTag = document.createElement("p");
808
816
  textTag.innerHTML = jElement.innerHTML;
@@ -862,7 +870,7 @@ class HtmlExtractionMethods {
862
870
  data.type = tagName;
863
871
  return data;
864
872
  }
865
- static transformHtmlElementToBlocks(element) {
873
+ static transformHtmlElementToBlocks(element, options) {
866
874
  var data = [];
867
875
  for (let i = 0; i < element.children.length; i++) {
868
876
  var elem = element.children.item(i);
@@ -876,13 +884,13 @@ class HtmlExtractionMethods {
876
884
  }
877
885
  else {
878
886
  var extractor = HtmlExtractionMethods.Extractors[elem.tagName];
879
- var result = extractor(elem);
887
+ var result = extractor(elem, options);
880
888
  data.push(result);
881
889
  }
882
890
  }
883
891
  return data;
884
892
  }
885
- static transformHtmlStringToBlocks(value) {
893
+ static transformHtmlStringToBlocks(value, options) {
886
894
  if (value === undefined) {
887
895
  return [];
888
896
  }
@@ -891,27 +899,27 @@ class HtmlExtractionMethods {
891
899
  .replace('\t', '');
892
900
  var div = document.createElement("div");
893
901
  div.innerHTML = value;
894
- return this.transformHtmlElementToBlocks(div);
902
+ return this.transformHtmlElementToBlocks(div, options);
895
903
  }
896
904
  }
897
905
  HtmlExtractionMethods.Extractors = {
898
- ["TEXT"]: (elem) => TextSimpleMethods.ExtractTextTag(elem),
899
- ["FILE-IMAGE"]: (elem) => ImageMethods.ExtractImage(elem),
900
- ["TABLE"]: (elem) => TableMethods.getTableFromHtmlTag(elem),
901
- ["RICH-TEXT"]: (elem) => TextMethods.ExtractRichTextData(elem),
902
- ["HTML-RAW"]: (elem) => ({
906
+ ["TEXT"]: (elem, options) => TextSimpleMethods.ExtractTextTag(elem),
907
+ ["FILE-IMAGE"]: (elem, options) => ImageMethods.ExtractImage(elem, options),
908
+ ["TABLE"]: (elem, options) => TableMethods.getTableFromHtmlTag(elem, options),
909
+ ["RICH-TEXT"]: (elem, options) => TextMethods.ExtractRichTextData(elem),
910
+ ["HTML-RAW"]: (elem, options) => ({
903
911
  type: "html-raw",
904
912
  data: {
905
913
  innerHTML: elem.innerHTML
906
914
  }
907
915
  }),
908
- ["H1"]: (elem) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h1"),
909
- ["H2"]: (elem) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h2"),
910
- ["H3"]: (elem) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h3"),
911
- ["H4"]: (elem) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h4"),
912
- ["H5"]: (elem) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h5"),
913
- ["H6"]: (elem) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h6"),
914
- [ExternalVideoTagDataConsts.TagName.toUpperCase()]: (elem) => VideoMethods.ExtractExternalVideoTag(elem)
916
+ ["H1"]: (elem, options) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h1"),
917
+ ["H2"]: (elem, options) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h2"),
918
+ ["H3"]: (elem, options) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h3"),
919
+ ["H4"]: (elem, options) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h4"),
920
+ ["H5"]: (elem, options) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h5"),
921
+ ["H6"]: (elem, options) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h6"),
922
+ [ExternalVideoTagDataConsts.TagName.toUpperCase()]: (elem, options) => VideoMethods.ExtractExternalVideoTag(elem)
915
923
  };
916
924
 
917
925
  class HtmlRawTagDataConsts {
@@ -962,8 +970,8 @@ class BodyTagsExtensions {
962
970
  }
963
971
  return `<${FileImageTagDataConsts.TagName} ${attrStr}></${FileImageTagDataConsts.TagName}>`;
964
972
  }
965
- static getBodyTags(html) {
966
- let result = HtmlExtractionMethods.transformHtmlStringToBlocks(html);
973
+ static getBodyTags(html, options) {
974
+ let result = HtmlExtractionMethods.transformHtmlStringToBlocks(html, options);
967
975
  return result.map(x => BodyTagsExtensions.toBodyTag(x));
968
976
  }
969
977
  static sanitizeInnerHtml(html) {
@@ -1221,7 +1229,7 @@ class VisualEditorComponent {
1221
1229
  this.onHtmlChanged.emit(this.html);
1222
1230
  }
1223
1231
  recalculateBodyTags() {
1224
- this.bodyTags = BodyTagsExtensions.getBodyTags(this.html);
1232
+ this.bodyTags = BodyTagsExtensions.getBodyTags(this.html, { useCustomDomain: false, domain: "" });
1225
1233
  }
1226
1234
  ngOnInit() {
1227
1235
  this.recalculateBodyTags();
@@ -1250,7 +1258,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1250
1258
 
1251
1259
  class ToPreviewPipe {
1252
1260
  transform(value) {
1253
- return HtmlExtractionMethods.transformHtmlStringToBlocks(value);
1261
+ return HtmlExtractionMethods.transformHtmlStringToBlocks(value, {
1262
+ useCustomDomain: false,
1263
+ domain: ""
1264
+ });
1254
1265
  }
1255
1266
  }
1256
1267
  ToPreviewPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ToPreviewPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
@@ -1395,7 +1406,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1395
1406
 
1396
1407
  class ToHtmlBodyTagsPipe {
1397
1408
  transform(value) {
1398
- return BodyTagsExtensions.getBodyTags(value);
1409
+ return BodyTagsExtensions.getBodyTags(value, { useCustomDomain: false, domain: "" });
1399
1410
  }
1400
1411
  }
1401
1412
  ToHtmlBodyTagsPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ToHtmlBodyTagsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
@@ -1407,6 +1418,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1407
1418
  }]
1408
1419
  }] });
1409
1420
 
1421
+ class ToPreviewHtmlPipe {
1422
+ transform(value, options) {
1423
+ return HtmlExtractionMethods.transformHtmlStringToBlocks(value, options);
1424
+ }
1425
+ }
1426
+ ToPreviewHtmlPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ToPreviewHtmlPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1427
+ ToPreviewHtmlPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: ToPreviewHtmlPipe, name: "topreviewhtml" });
1428
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ToPreviewHtmlPipe, decorators: [{
1429
+ type: Pipe,
1430
+ args: [{
1431
+ name: 'topreviewhtml'
1432
+ }]
1433
+ }] });
1434
+
1410
1435
  class TableBuilder {
1411
1436
  static getTableMarkUp(rows, cols, generateHeaders) {
1412
1437
  rows = +rows;
@@ -1544,5 +1569,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1544
1569
  * Generated bundle index. Do not edit.
1545
1570
  */
1546
1571
 
1547
- export { AddFilesBtnComponent, AngularMaterialTableMethods, BodyTagsExtensions, BootstrapTableMethods, CrocoHtmlModule, ExternalVideoBlockComponent, ExternalVideoSupportedTypes, ExternalVideoTagDataConsts, FileIdSelectComponent, FileImageTagDataConsts, HtmlRawEditorComponent, ImageEditorComponent, ImageMethods, MainEditorBlockComponent, MainEditorComponent, RichTextToHtmlPipe, TableBuilder, TableMethods, TableTypes, TagToSpanPipe, TextEditorComponent, TextMethods, TextSimpleMethods, TextTag, ToHtmlBodyTagsPipe, ToPreviewPipe, UploadFilesBtnComponent, VideoMethods, VisualEditorComponent, XmlExtensions, XmlTagExternalVideoComponent, XmlTagHeaderInnerTextViewComponent, XmlTagHeaderTextViewComponent, XmlTagHtmlViewComponent, XmlTagRichTextViewComponent, XmlTagTableViewComponent, XmlTagTextViewComponent, XmlTagViewComponent };
1572
+ export { AddFilesBtnComponent, AngularMaterialTableMethods, BodyTagsExtensions, BootstrapTableMethods, CrocoHtmlModule, ExternalVideoBlockComponent, ExternalVideoSupportedTypes, ExternalVideoTagDataConsts, FileIdSelectComponent, FileImageTagDataConsts, HtmlRawEditorComponent, ImageEditorComponent, ImageMethods, MainEditorBlockComponent, MainEditorComponent, RichTextToHtmlPipe, TableBuilder, TableMethods, TableTypes, TagToSpanPipe, TextEditorComponent, TextMethods, TextSimpleMethods, TextTag, ToHtmlBodyTagsPipe, ToPreviewHtmlPipe, ToPreviewPipe, UploadFilesBtnComponent, VideoMethods, VisualEditorComponent, XmlExtensions, XmlTagExternalVideoComponent, XmlTagHeaderInnerTextViewComponent, XmlTagHeaderTextViewComponent, XmlTagHtmlViewComponent, XmlTagRichTextViewComponent, XmlTagTableViewComponent, XmlTagTextViewComponent, XmlTagViewComponent };
1548
1573
  //# sourceMappingURL=croco-html.mjs.map