croco-html 0.2.7 → 0.2.9

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.
@@ -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: {
@@ -277,10 +285,10 @@ class XmlTagExternalVideoComponent {
277
285
  }
278
286
  }
279
287
  XmlTagExternalVideoComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: XmlTagExternalVideoComponent, deps: [{ token: i1$1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component });
280
- XmlTagExternalVideoComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: XmlTagExternalVideoComponent, selector: "croco-html-xml-tag-external-video", inputs: { data: "data", tagData: "tagData" }, ngImport: i0, template: "<div class=\"d-flex justify-content-center\">\r\n <div *ngIf=\"widgetUrl\" class=\"y-video\">\r\n <iframe width=\"100%\" height=\"100%\" [src]=\"widgetUrl\"\r\n title=\"YouTube video player\" frameborder=\"0\"\r\n allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\"\r\n allowfullscreen></iframe>\r\n </div>\r\n</div>", styles: ["@media only screen and (min-width: 769px){.y-video{width:640px;height:360px;margin:0 auto}}@media only screen and (max-width: 768px){.y-video{width:560px;height:315px;margin:0 auto}}\n"], dependencies: [{ kind: "directive", type: i1$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
288
+ XmlTagExternalVideoComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: XmlTagExternalVideoComponent, selector: "croco-html-xml-tag-external-video", inputs: { data: "data", tagData: "tagData" }, ngImport: i0, template: "<div class=\"d-flex justify-content-center\">\r\n <div *ngIf=\"widgetUrl\" class=\"y-video\">\r\n <iframe width=\"100%\" height=\"100%\" [src]=\"widgetUrl\"\r\n title=\"YouTube video player\" frameborder=\"0\"\r\n allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\"\r\n allowfullscreen></iframe>\r\n </div>\r\n</div>", styles: ["@media only screen and (min-width: 769px){.y-video{width:640px;height:360px;margin:0 auto}}@media only screen and (max-width: 827px){.y-video{width:100%;height:315px}}\n"], dependencies: [{ kind: "directive", type: i1$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
281
289
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: XmlTagExternalVideoComponent, decorators: [{
282
290
  type: Component,
283
- args: [{ selector: 'croco-html-xml-tag-external-video', template: "<div class=\"d-flex justify-content-center\">\r\n <div *ngIf=\"widgetUrl\" class=\"y-video\">\r\n <iframe width=\"100%\" height=\"100%\" [src]=\"widgetUrl\"\r\n title=\"YouTube video player\" frameborder=\"0\"\r\n allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\"\r\n allowfullscreen></iframe>\r\n </div>\r\n</div>", styles: ["@media only screen and (min-width: 769px){.y-video{width:640px;height:360px;margin:0 auto}}@media only screen and (max-width: 768px){.y-video{width:560px;height:315px;margin:0 auto}}\n"] }]
291
+ args: [{ selector: 'croco-html-xml-tag-external-video', template: "<div class=\"d-flex justify-content-center\">\r\n <div *ngIf=\"widgetUrl\" class=\"y-video\">\r\n <iframe width=\"100%\" height=\"100%\" [src]=\"widgetUrl\"\r\n title=\"YouTube video player\" frameborder=\"0\"\r\n allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\"\r\n allowfullscreen></iframe>\r\n </div>\r\n</div>", styles: ["@media only screen and (min-width: 769px){.y-video{width:640px;height:360px;margin:0 auto}}@media only screen and (max-width: 827px){.y-video{width:100%;height:315px}}\n"] }]
284
292
  }], ctorParameters: function () { return [{ type: i1$1.DomSanitizer }]; }, propDecorators: { data: [{
285
293
  type: Input
286
294
  }], tagData: [{
@@ -374,7 +382,7 @@ class FileIdSelectComponent {
374
382
  this.onFileIdChanged.emit(fileId);
375
383
  }
376
384
  getSrc(fileId) {
377
- return ImageMethods.buildSmallUrl(fileId);
385
+ return ImageMethods.buildSmallUrl(fileId, { useCustomDomain: false, domain: "" });
378
386
  }
379
387
  ngOnInit() {
380
388
  this.loadFiles();
@@ -424,7 +432,7 @@ class ImageEditorComponent {
424
432
  this.onTagUpdated = new EventEmitter();
425
433
  }
426
434
  getSrc() {
427
- return ImageMethods.buildUrl(this.tag.attributes[FileImageTagDataConsts.FileIdAttrName]);
435
+ return ImageMethods.buildUrl(this.tag.attributes[FileImageTagDataConsts.FileIdAttrName], { useCustomDomain: false, domain: "" });
428
436
  }
429
437
  hasFileId() {
430
438
  return this.tag.attributes.hasOwnProperty(FileImageTagDataConsts.FileIdAttrName) && !isNaN(this.tag.attributes[FileImageTagDataConsts.FileIdAttrName]);
@@ -512,10 +520,10 @@ class XmlTagViewComponent {
512
520
  }
513
521
  }
514
522
  XmlTagViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: XmlTagViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
515
- 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 });
523
+ 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 });
516
524
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: XmlTagViewComponent, decorators: [{
517
525
  type: Component,
518
- 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"] }]
526
+ 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"] }]
519
527
  }], ctorParameters: function () { return []; }, propDecorators: { data: [{
520
528
  type: Input
521
529
  }] } });
@@ -732,10 +740,10 @@ TableTypes.TableRowColumnData = "table-row-column-data";
732
740
  TableTypes.Table = "table";
733
741
  TableTypes.TableRowColumn = "table-row-column";
734
742
  class TableMethods {
735
- static getTableFromHtmlTag(tableTag) {
743
+ static getTableFromHtmlTag(tableTag, options) {
736
744
  let tableData = {
737
745
  header: TableMethods.getHeader(tableTag),
738
- rows: TableMethods.getTableRows(tableTag)
746
+ rows: TableMethods.getTableRows(tableTag, options)
739
747
  };
740
748
  var result = {
741
749
  type: TableTypes.Table,
@@ -797,7 +805,7 @@ class TableMethods {
797
805
  columns: headerColumns
798
806
  };
799
807
  }
800
- static getTableRows(tableTag) {
808
+ static getTableRows(tableTag, options) {
801
809
  let tBody = tableTag.tBodies.item(0);
802
810
  let rows = [];
803
811
  for (let i = 0; i < tBody.children.length; i++) {
@@ -805,7 +813,7 @@ class TableMethods {
805
813
  let rowColumns = [];
806
814
  for (let j = 0; j < iElement.children.length; j++) {
807
815
  const jElement = iElement.children.item(j);
808
- let children = HtmlExtractionMethods.transformHtmlElementToBlocks(jElement);
816
+ let children = HtmlExtractionMethods.transformHtmlElementToBlocks(jElement, options);
809
817
  if (children.length === 0) {
810
818
  var textTag = document.createElement("p");
811
819
  textTag.innerHTML = jElement.innerHTML;
@@ -865,7 +873,7 @@ class HtmlExtractionMethods {
865
873
  data.type = tagName;
866
874
  return data;
867
875
  }
868
- static transformHtmlElementToBlocks(element) {
876
+ static transformHtmlElementToBlocks(element, options) {
869
877
  var data = [];
870
878
  for (let i = 0; i < element.children.length; i++) {
871
879
  var elem = element.children.item(i);
@@ -879,13 +887,13 @@ class HtmlExtractionMethods {
879
887
  }
880
888
  else {
881
889
  var extractor = HtmlExtractionMethods.Extractors[elem.tagName];
882
- var result = extractor(elem);
890
+ var result = extractor(elem, options);
883
891
  data.push(result);
884
892
  }
885
893
  }
886
894
  return data;
887
895
  }
888
- static transformHtmlStringToBlocks(value) {
896
+ static transformHtmlStringToBlocks(value, options) {
889
897
  if (value === undefined) {
890
898
  return [];
891
899
  }
@@ -894,27 +902,27 @@ class HtmlExtractionMethods {
894
902
  .replace('\t', '');
895
903
  var div = document.createElement("div");
896
904
  div.innerHTML = value;
897
- return this.transformHtmlElementToBlocks(div);
905
+ return this.transformHtmlElementToBlocks(div, options);
898
906
  }
899
907
  }
900
908
  HtmlExtractionMethods.Extractors = {
901
- ["TEXT"]: (elem) => TextSimpleMethods.ExtractTextTag(elem),
902
- ["FILE-IMAGE"]: (elem) => ImageMethods.ExtractImage(elem),
903
- ["TABLE"]: (elem) => TableMethods.getTableFromHtmlTag(elem),
904
- ["RICH-TEXT"]: (elem) => TextMethods.ExtractRichTextData(elem),
905
- ["HTML-RAW"]: (elem) => ({
909
+ ["TEXT"]: (elem, options) => TextSimpleMethods.ExtractTextTag(elem),
910
+ ["FILE-IMAGE"]: (elem, options) => ImageMethods.ExtractImage(elem, options),
911
+ ["TABLE"]: (elem, options) => TableMethods.getTableFromHtmlTag(elem, options),
912
+ ["RICH-TEXT"]: (elem, options) => TextMethods.ExtractRichTextData(elem),
913
+ ["HTML-RAW"]: (elem, options) => ({
906
914
  type: "html-raw",
907
915
  data: {
908
916
  innerHTML: elem.innerHTML
909
917
  }
910
918
  }),
911
- ["H1"]: (elem) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h1"),
912
- ["H2"]: (elem) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h2"),
913
- ["H3"]: (elem) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h3"),
914
- ["H4"]: (elem) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h4"),
915
- ["H5"]: (elem) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h5"),
916
- ["H6"]: (elem) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h6"),
917
- [ExternalVideoTagDataConsts.TagName.toUpperCase()]: (elem) => VideoMethods.ExtractExternalVideoTag(elem)
919
+ ["H1"]: (elem, options) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h1"),
920
+ ["H2"]: (elem, options) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h2"),
921
+ ["H3"]: (elem, options) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h3"),
922
+ ["H4"]: (elem, options) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h4"),
923
+ ["H5"]: (elem, options) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h5"),
924
+ ["H6"]: (elem, options) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h6"),
925
+ [ExternalVideoTagDataConsts.TagName.toUpperCase()]: (elem, options) => VideoMethods.ExtractExternalVideoTag(elem)
918
926
  };
919
927
 
920
928
  class HtmlRawTagDataConsts {
@@ -965,8 +973,8 @@ class BodyTagsExtensions {
965
973
  }
966
974
  return `<${FileImageTagDataConsts.TagName} ${attrStr}></${FileImageTagDataConsts.TagName}>`;
967
975
  }
968
- static getBodyTags(html) {
969
- let result = HtmlExtractionMethods.transformHtmlStringToBlocks(html);
976
+ static getBodyTags(html, options) {
977
+ let result = HtmlExtractionMethods.transformHtmlStringToBlocks(html, options);
970
978
  return result.map(x => BodyTagsExtensions.toBodyTag(x));
971
979
  }
972
980
  static sanitizeInnerHtml(html) {
@@ -1224,7 +1232,7 @@ class VisualEditorComponent {
1224
1232
  this.onHtmlChanged.emit(this.html);
1225
1233
  }
1226
1234
  recalculateBodyTags() {
1227
- this.bodyTags = BodyTagsExtensions.getBodyTags(this.html);
1235
+ this.bodyTags = BodyTagsExtensions.getBodyTags(this.html, { useCustomDomain: false, domain: "" });
1228
1236
  }
1229
1237
  ngOnInit() {
1230
1238
  this.recalculateBodyTags();
@@ -1253,7 +1261,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1253
1261
 
1254
1262
  class ToPreviewPipe {
1255
1263
  transform(value) {
1256
- return HtmlExtractionMethods.transformHtmlStringToBlocks(value);
1264
+ return HtmlExtractionMethods.transformHtmlStringToBlocks(value, {
1265
+ useCustomDomain: false,
1266
+ domain: ""
1267
+ });
1257
1268
  }
1258
1269
  }
1259
1270
  ToPreviewPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ToPreviewPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
@@ -1398,7 +1409,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1398
1409
 
1399
1410
  class ToHtmlBodyTagsPipe {
1400
1411
  transform(value) {
1401
- return BodyTagsExtensions.getBodyTags(value);
1412
+ return BodyTagsExtensions.getBodyTags(value, { useCustomDomain: false, domain: "" });
1402
1413
  }
1403
1414
  }
1404
1415
  ToHtmlBodyTagsPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ToHtmlBodyTagsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });