croco-html 20.2.0 → 20.2.2

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.
@@ -684,6 +684,77 @@ class CustomWidgetTagService {
684
684
  }
685
685
  }
686
686
 
687
+ class LinkTagConsts {
688
+ static { this.TagName = "croco-link"; }
689
+ }
690
+ class LinkTagAttrs {
691
+ static { this.FileId = "file-id"; }
692
+ static { this.Url = "url"; }
693
+ static { this.Title = "title"; }
694
+ static { this.Type = "type"; }
695
+ }
696
+ class LinkTagService {
697
+ constructor() {
698
+ this.tagName = LinkTagConsts.TagName;
699
+ this.shortDescription = "Ссылка";
700
+ }
701
+ bodyTagToHtmlStringConverter(bodyTag) {
702
+ const urlVal = bodyTag.attributes[LinkTagAttrs.Url] ?? "";
703
+ const urlValStr = `${LinkTagAttrs.Url}="${urlVal}"`;
704
+ const titleVal = bodyTag.attributes[LinkTagAttrs.Title] ?? "";
705
+ const titleValStr = `${LinkTagAttrs.Title}="${titleVal}"`;
706
+ const typeVal = bodyTag.attributes[LinkTagAttrs.Type] ?? "";
707
+ const typeValStr = typeVal.length > 0 ? `${LinkTagAttrs.Type}="${typeVal}"` : "";
708
+ const attrStr = [urlValStr, titleValStr, typeValStr].join(" ");
709
+ return `<${this.tagName} ${attrStr}></${this.tagName}>`;
710
+ }
711
+ extractBlockFromHtmlElement(elem, _) {
712
+ const data = {
713
+ url: elem.getAttribute(LinkTagAttrs.Url),
714
+ title: elem.getAttribute(LinkTagAttrs.Title),
715
+ type: elem.getAttribute(LinkTagAttrs.Type),
716
+ fileId: elem.getAttribute(LinkTagAttrs.FileId),
717
+ };
718
+ return {
719
+ tagName: this.tagName,
720
+ data
721
+ };
722
+ }
723
+ toBodyTag(data) {
724
+ let tagData = data.data;
725
+ const attrs = {
726
+ [LinkTagAttrs.Url]: tagData.url,
727
+ [LinkTagAttrs.Type]: tagData.type,
728
+ [LinkTagAttrs.FileId]: tagData.fileId,
729
+ [LinkTagAttrs.Title]: tagData.title
730
+ };
731
+ return {
732
+ tagDescription: {
733
+ tag: data.tagName,
734
+ displayValue: this.shortDescription,
735
+ isCustom: false
736
+ },
737
+ attributes: attrs,
738
+ innerHtml: ""
739
+ };
740
+ }
741
+ getDefaultValue(props) {
742
+ return {
743
+ tagDescription: {
744
+ tag: this.tagName,
745
+ displayValue: this.shortDescription,
746
+ isCustom: false
747
+ },
748
+ attributes: {
749
+ [LinkTagAttrs.Title]: 'Презентация',
750
+ [LinkTagAttrs.Url]: 'https://storage.yandexcloud.net/mega-academy/presentation.pdf',
751
+ [LinkTagAttrs.Type]: 'pdf'
752
+ },
753
+ innerHtml: props.htmlRaw,
754
+ };
755
+ }
756
+ }
757
+
687
758
  class TextTags {
688
759
  static { this.text = "text"; }
689
760
  static { this.h1 = "h1"; }
@@ -1087,77 +1158,6 @@ class TableTagService {
1087
1158
  }
1088
1159
  }
1089
1160
 
1090
- class LinkTagConsts {
1091
- static { this.TagName = "croco-link"; }
1092
- }
1093
- class LinkTagAttrs {
1094
- static { this.FileId = "file-id"; }
1095
- static { this.Url = "url"; }
1096
- static { this.Title = "title"; }
1097
- static { this.Type = "type"; }
1098
- }
1099
- class LinkTagService {
1100
- constructor() {
1101
- this.tagName = LinkTagConsts.TagName;
1102
- this.shortDescription = "Ссылка";
1103
- }
1104
- bodyTagToHtmlStringConverter(bodyTag) {
1105
- const urlVal = bodyTag.attributes[LinkTagAttrs.Url] ?? "";
1106
- const urlValStr = `${LinkTagAttrs.Url}="${urlVal}"`;
1107
- const titleVal = bodyTag.attributes[LinkTagAttrs.Title] ?? "";
1108
- const titleValStr = `${LinkTagAttrs.Title}="${titleVal}"`;
1109
- const typeVal = bodyTag.attributes[LinkTagAttrs.Type] ?? "";
1110
- const typeValStr = typeVal.length > 0 ? `${LinkTagAttrs.Type}="${typeVal}"` : "";
1111
- const attrStr = [urlValStr, titleValStr, typeValStr].join(" ");
1112
- return `<${this.tagName} ${attrStr}></${this.tagName}>`;
1113
- }
1114
- extractBlockFromHtmlElement(elem, _) {
1115
- const data = {
1116
- url: elem.getAttribute(LinkTagAttrs.Url),
1117
- title: elem.getAttribute(LinkTagAttrs.Title),
1118
- type: elem.getAttribute(LinkTagAttrs.Type),
1119
- fileId: elem.getAttribute(LinkTagAttrs.FileId),
1120
- };
1121
- return {
1122
- tagName: this.tagName,
1123
- data
1124
- };
1125
- }
1126
- toBodyTag(data) {
1127
- let tagData = data.data;
1128
- const attrs = {
1129
- [LinkTagAttrs.Url]: tagData.url,
1130
- [LinkTagAttrs.Type]: tagData.type,
1131
- [LinkTagAttrs.FileId]: tagData.fileId,
1132
- [LinkTagAttrs.Title]: tagData.title
1133
- };
1134
- return {
1135
- tagDescription: {
1136
- tag: data.tagName,
1137
- displayValue: this.shortDescription,
1138
- isCustom: false
1139
- },
1140
- attributes: attrs,
1141
- innerHtml: ""
1142
- };
1143
- }
1144
- getDefaultValue(props) {
1145
- return {
1146
- tagDescription: {
1147
- tag: this.tagName,
1148
- displayValue: this.shortDescription,
1149
- isCustom: false
1150
- },
1151
- attributes: {
1152
- [LinkTagAttrs.Title]: 'Презентация',
1153
- [LinkTagAttrs.Url]: 'https://storage.yandexcloud.net/mega-academy/presentation.pdf',
1154
- [LinkTagAttrs.Type]: 'pdf'
1155
- },
1156
- innerHtml: props.htmlRaw,
1157
- };
1158
- }
1159
- }
1160
-
1161
1161
  class BodyTagsExtensions {
1162
1162
  static { this._tagServices = {
1163
1163
  [TextTags.text]: new TextTagHtmlMarkupTagService("text", "T"),
@@ -3273,9 +3273,9 @@ class MainEditorBlockComponent {
3273
3273
  cancelSave() {
3274
3274
  this._tagService.presentOrEdit$.next(false);
3275
3275
  }
3276
- isDefinedCustomTag() {
3276
+ isEditorDefined() {
3277
3277
  const tagName = this._tag.tagDescription.tag;
3278
- if (this._options.definedCustomTags.hasOwnProperty(tagName)) {
3278
+ if (this._options.definedEditorViewRenderers.hasOwnProperty(tagName)) {
3279
3279
  return true;
3280
3280
  }
3281
3281
  return false;
@@ -3288,7 +3288,7 @@ class MainEditorBlockComponent {
3288
3288
  this.unsubscribe.complete();
3289
3289
  }
3290
3290
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: MainEditorBlockComponent, deps: [{ token: CrocoHtmlOptionsToken }], target: i0.ɵɵFactoryTarget.Component }); }
3291
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: MainEditorBlockComponent, isStandalone: true, selector: "croco-html-main-editor-block", inputs: { tag: "tag" }, outputs: { onTagSaved: "onTagSaved", onTagRemoved: "onTagRemoved" }, ngImport: i0, template: "<div class=\"main-editor-block\">\n <div class=\"editor-container\">\n @if (textTags.includes(_tag.tagDescription.tag)) {\n <div>\n <croco-html-text-editor [tagService]=\"_tagService\">\n </croco-html-text-editor>\n </div>\n }\n @else if (_tag.tagDescription.tag === 'file-image') {\n <div>\n <croco-html-image-editor [presentOrEdit]=\"presentOrEdit\" [tag]=\"_tag\">\n </croco-html-image-editor>\n </div>\n }\n @else if (_tag.tagDescription.tag === 'audio-player') {\n <div>\n <croco-html-audio-editor [presentOrEdit]=\"presentOrEdit\" [tag]=\"_tag\">\n </croco-html-audio-editor>\n </div>\n }\n @else if (_tag.tagDescription.tag === 'custom-widget') {\n <div>\n <croco-html-custom-widget-editor [presentOrEdit]=\"presentOrEdit\" [tag]=\"_tag\">\n </croco-html-custom-widget-editor>\n </div>\n }\n @else if (_tag.tagDescription.tag === 'external-video') {\n <div>\n <croco-html-external-video-editor [presentOrEdit]=\"presentOrEdit\" [tag]=\"_tag\">\n </croco-html-external-video-editor>\n </div>\n }\n @else if (_tag.tagDescription.tag === 'download-file-button') {\n <div>\n <croco-html-download-file-button-editor [presentOrEdit]=\"presentOrEdit\" [tag]=\"_tag\">\n </croco-html-download-file-button-editor>\n </div>\n }\n @else if (_tag.tagDescription.tag === 'button') {\n <div>\n <croco-html-button-editor [presentOrEdit]=\"presentOrEdit\" [tag]=\"_tag\">\n </croco-html-button-editor>\n </div>\n }\n @else if (_tag.tagDescription.tag === 'html-raw') {\n <div>\n <croco-html-html-raw-editor [presentOrEdit]=\"presentOrEdit\" [tag]=\"_tag\">\n </croco-html-html-raw-editor>\n </div>\n }\n @else if (isDefinedCustomTag()) {\n <div>\n <croco-html-defined-custom-editor-block [tagService]=\"_tagService\"></croco-html-defined-custom-editor-block>\n </div>\n }\n @else {\n <div>\n {{_tag.tagDescription.tag}} \u043D\u0435 \u043F\u043E\u043A\u0430\u0437\u0430\u043D\n </div>\n <div>\n {{_tag | json}}\n </div>\n }\n\n </div>\n\n <div class=\"d-flex justify-content-between\">\n <div class=\"d-flex justify-content-end align-self-center\">\n <div style=\"margin-left: 16px;min-width: 96px\">\n @if (presentOrEdit) {\n <button (click)=\"cancelSave()\" mat-icon-button>\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\"\n d=\"M14.4374 0C15.0921 0 15.7197 0.261421 16.1781 0.723424L19.279 3.82432C19.7407 4.286 20.0001 4.91217 20.0001 5.56508C20.0001 6.21799 19.7407 6.84416 19.279 7.30584L7.95751 18.6238C7.25903 19.4295 6.2689 19.9245 5.1346 20.0023H0V19.0023L0.00324754 14.7873C0.0884381 13.7328 0.578667 12.7523 1.3265 12.0934L12.6954 0.72463C13.1564 0.260831 13.7834 0 14.4374 0ZM5.06401 18.0048C5.59823 17.967 6.09551 17.7184 6.49482 17.2616L14.0567 9.69971L10.3024 5.94518L2.69613 13.5496C2.29098 13.9079 2.04034 14.4092 2.00003 14.8678V18.0029L5.06401 18.0048ZM11.7167 4.53114L15.471 8.28549L17.8648 5.89162C17.9514 5.80502 18.0001 5.68756 18.0001 5.56508C18.0001 5.4426 17.9514 5.32514 17.8648 5.23854L14.7612 2.13486C14.6755 2.04855 14.559 2 14.4374 2C14.3158 2 14.1992 2.04855 14.1136 2.13486L11.7167 4.53114Z\"\n fill=\"#323E8B\" />\n </svg>\n </button>\n }\n @else {\n <button (click)=\"save()\" mat-icon-button>\n <svg width=\"800px\" height=\"800px\" viewBox=\"0 0 24 24\" role=\"img\" xmlns=\"http://www.w3.org/2000/svg\"\n aria-labelledby=\"saveIconTitle\" stroke=\"#000000\" stroke-width=\"1\" stroke-linecap=\"square\"\n stroke-linejoin=\"miter\" fill=\"none\" color=\"#000000\">\n <title id=\"saveIconTitle\">Save</title>\n <path\n d=\"M17.2928932,3.29289322 L21,7 L21,20 C21,20.5522847 20.5522847,21 20,21 L4,21 C3.44771525,21 3,20.5522847 3,20 L3,4 C3,3.44771525 3.44771525,3 4,3 L16.5857864,3 C16.8510029,3 17.1053568,3.10535684 17.2928932,3.29289322 Z\" />\n <rect width=\"10\" height=\"8\" x=\"7\" y=\"13\" />\n <rect width=\"8\" height=\"5\" x=\"8\" y=\"3\" />\n </svg>\n </button>\n }\n <button (click)=\"deleteItem()\" mat-icon-button color=\"warn\">\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\"\n d=\"M7.49988 0.833332H12.4999C13.4204 0.833332 14.1665 1.57952 14.1665 2.5V3.33333H16.6665C17.587 3.33333 18.3332 4.07952 18.3332 4.99999V6.66666C18.3332 7.58714 17.587 8.33333 16.6665 8.33333H16.5998L15.8332 17.5C15.8332 18.4205 15.087 19.1667 14.1665 19.1667H5.8332C4.91272 19.1667 4.16653 18.4205 4.16941 17.5692L3.39975 8.33333H3.33317C2.4127 8.33333 1.6665 7.58714 1.6665 6.66666V4.99999C1.6665 4.07952 2.4127 3.33333 3.33317 3.33333H5.83321V2.5C5.83321 1.57952 6.5794 0.833332 7.49988 0.833332ZM5.83321 5V4.99999H3.33317V6.66666H16.6665V4.99999L14.1665 5H5.83321ZM5.83324 17.5L5.07198 8.33333H14.9276L14.1695 17.4308L14.1666 17.5H5.83324ZM12.4999 2.5V3.33334H7.49992V2.5H12.4999Z\"\n fill=\"#F96666\" />\n </svg>\n </button>\n </div>\n </div>\n\n </div>\n</div>\n", styles: [".main-editor-block{display:flex;justify-content:space-between}.editor-container{flex-grow:1}@media screen and (max-width: 700px){.main-editor-block{display:flex;flex-direction:column}}\n"], dependencies: [{ kind: "component", type: TextEditorComponent, selector: "croco-html-text-editor", inputs: ["tagService"] }, { kind: "component", type: ImageEditorComponent, selector: "croco-html-image-editor", inputs: ["tag", "presentOrEdit"] }, { kind: "component", type: AudioEditorComponent, selector: "croco-html-audio-editor", inputs: ["tag", "presentOrEdit"] }, { kind: "component", type: DownloadFileButtonEditorComponent, selector: "croco-html-download-file-button-editor", inputs: ["tag", "presentOrEdit"] }, { kind: "component", type: HtmlRawEditorComponent, selector: "croco-html-html-raw-editor", inputs: ["tag", "presentOrEdit"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: ExternalVideoEditorComponent, selector: "croco-html-external-video-editor", inputs: ["tag", "presentOrEdit"] }, { kind: "component", type: ButtonEditorComponent, selector: "croco-html-button-editor", inputs: ["tag", "presentOrEdit"] }, { kind: "component", type: CustomWidgetEditorComponent, selector: "croco-html-custom-widget-editor", inputs: ["tag", "presentOrEdit"] }, { kind: "component", type: DefinedCustomEditorBlockComponent, selector: "croco-html-defined-custom-editor-block", inputs: ["tagService"] }, { kind: "pipe", type: JsonPipe, name: "json" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
3291
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: MainEditorBlockComponent, isStandalone: true, selector: "croco-html-main-editor-block", inputs: { tag: "tag" }, outputs: { onTagSaved: "onTagSaved", onTagRemoved: "onTagRemoved" }, ngImport: i0, template: "<div class=\"main-editor-block\">\n <div class=\"editor-container\">\n @if (textTags.includes(_tag.tagDescription.tag)) {\n <div>\n <croco-html-text-editor [tagService]=\"_tagService\">\n </croco-html-text-editor>\n </div>\n }\n @else if (_tag.tagDescription.tag === 'file-image') {\n <div>\n <croco-html-image-editor [presentOrEdit]=\"presentOrEdit\" [tag]=\"_tag\">\n </croco-html-image-editor>\n </div>\n }\n @else if (_tag.tagDescription.tag === 'audio-player') {\n <div>\n <croco-html-audio-editor [presentOrEdit]=\"presentOrEdit\" [tag]=\"_tag\">\n </croco-html-audio-editor>\n </div>\n }\n @else if (_tag.tagDescription.tag === 'custom-widget') {\n <div>\n <croco-html-custom-widget-editor [presentOrEdit]=\"presentOrEdit\" [tag]=\"_tag\">\n </croco-html-custom-widget-editor>\n </div>\n }\n @else if (_tag.tagDescription.tag === 'external-video') {\n <div>\n <croco-html-external-video-editor [presentOrEdit]=\"presentOrEdit\" [tag]=\"_tag\">\n </croco-html-external-video-editor>\n </div>\n }\n @else if (_tag.tagDescription.tag === 'download-file-button') {\n <div>\n <croco-html-download-file-button-editor [presentOrEdit]=\"presentOrEdit\" [tag]=\"_tag\">\n </croco-html-download-file-button-editor>\n </div>\n }\n @else if (_tag.tagDescription.tag === 'button') {\n <div>\n <croco-html-button-editor [presentOrEdit]=\"presentOrEdit\" [tag]=\"_tag\">\n </croco-html-button-editor>\n </div>\n }\n @else if (_tag.tagDescription.tag === 'html-raw') {\n <div>\n <croco-html-html-raw-editor [presentOrEdit]=\"presentOrEdit\" [tag]=\"_tag\">\n </croco-html-html-raw-editor>\n </div>\n }\n @else if (isEditorDefined()) {\n <div>\n <croco-html-defined-custom-editor-block [tagService]=\"_tagService\"></croco-html-defined-custom-editor-block>\n </div>\n }\n @else {\n <div>\n {{_tag.tagDescription.tag}} \u043D\u0435 \u043F\u043E\u043A\u0430\u0437\u0430\u043D\n </div>\n <div>\n {{_tag | json}}\n </div>\n }\n\n </div>\n\n <div class=\"d-flex justify-content-between\">\n <div class=\"d-flex justify-content-end align-self-center\">\n <div style=\"margin-left: 16px;min-width: 96px\">\n @if (presentOrEdit) {\n <button (click)=\"cancelSave()\" mat-icon-button>\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\"\n d=\"M14.4374 0C15.0921 0 15.7197 0.261421 16.1781 0.723424L19.279 3.82432C19.7407 4.286 20.0001 4.91217 20.0001 5.56508C20.0001 6.21799 19.7407 6.84416 19.279 7.30584L7.95751 18.6238C7.25903 19.4295 6.2689 19.9245 5.1346 20.0023H0V19.0023L0.00324754 14.7873C0.0884381 13.7328 0.578667 12.7523 1.3265 12.0934L12.6954 0.72463C13.1564 0.260831 13.7834 0 14.4374 0ZM5.06401 18.0048C5.59823 17.967 6.09551 17.7184 6.49482 17.2616L14.0567 9.69971L10.3024 5.94518L2.69613 13.5496C2.29098 13.9079 2.04034 14.4092 2.00003 14.8678V18.0029L5.06401 18.0048ZM11.7167 4.53114L15.471 8.28549L17.8648 5.89162C17.9514 5.80502 18.0001 5.68756 18.0001 5.56508C18.0001 5.4426 17.9514 5.32514 17.8648 5.23854L14.7612 2.13486C14.6755 2.04855 14.559 2 14.4374 2C14.3158 2 14.1992 2.04855 14.1136 2.13486L11.7167 4.53114Z\"\n fill=\"#323E8B\" />\n </svg>\n </button>\n }\n @else {\n <button (click)=\"save()\" mat-icon-button>\n <svg width=\"800px\" height=\"800px\" viewBox=\"0 0 24 24\" role=\"img\" xmlns=\"http://www.w3.org/2000/svg\"\n aria-labelledby=\"saveIconTitle\" stroke=\"#000000\" stroke-width=\"1\" stroke-linecap=\"square\"\n stroke-linejoin=\"miter\" fill=\"none\" color=\"#000000\">\n <title id=\"saveIconTitle\">Save</title>\n <path\n d=\"M17.2928932,3.29289322 L21,7 L21,20 C21,20.5522847 20.5522847,21 20,21 L4,21 C3.44771525,21 3,20.5522847 3,20 L3,4 C3,3.44771525 3.44771525,3 4,3 L16.5857864,3 C16.8510029,3 17.1053568,3.10535684 17.2928932,3.29289322 Z\" />\n <rect width=\"10\" height=\"8\" x=\"7\" y=\"13\" />\n <rect width=\"8\" height=\"5\" x=\"8\" y=\"3\" />\n </svg>\n </button>\n }\n <button (click)=\"deleteItem()\" mat-icon-button color=\"warn\">\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\"\n d=\"M7.49988 0.833332H12.4999C13.4204 0.833332 14.1665 1.57952 14.1665 2.5V3.33333H16.6665C17.587 3.33333 18.3332 4.07952 18.3332 4.99999V6.66666C18.3332 7.58714 17.587 8.33333 16.6665 8.33333H16.5998L15.8332 17.5C15.8332 18.4205 15.087 19.1667 14.1665 19.1667H5.8332C4.91272 19.1667 4.16653 18.4205 4.16941 17.5692L3.39975 8.33333H3.33317C2.4127 8.33333 1.6665 7.58714 1.6665 6.66666V4.99999C1.6665 4.07952 2.4127 3.33333 3.33317 3.33333H5.83321V2.5C5.83321 1.57952 6.5794 0.833332 7.49988 0.833332ZM5.83321 5V4.99999H3.33317V6.66666H16.6665V4.99999L14.1665 5H5.83321ZM5.83324 17.5L5.07198 8.33333H14.9276L14.1695 17.4308L14.1666 17.5H5.83324ZM12.4999 2.5V3.33334H7.49992V2.5H12.4999Z\"\n fill=\"#F96666\" />\n </svg>\n </button>\n </div>\n </div>\n\n </div>\n</div>\n", styles: [".main-editor-block{display:flex;justify-content:space-between}.editor-container{flex-grow:1}@media screen and (max-width: 700px){.main-editor-block{display:flex;flex-direction:column}}\n"], dependencies: [{ kind: "component", type: TextEditorComponent, selector: "croco-html-text-editor", inputs: ["tagService"] }, { kind: "component", type: ImageEditorComponent, selector: "croco-html-image-editor", inputs: ["tag", "presentOrEdit"] }, { kind: "component", type: AudioEditorComponent, selector: "croco-html-audio-editor", inputs: ["tag", "presentOrEdit"] }, { kind: "component", type: DownloadFileButtonEditorComponent, selector: "croco-html-download-file-button-editor", inputs: ["tag", "presentOrEdit"] }, { kind: "component", type: HtmlRawEditorComponent, selector: "croco-html-html-raw-editor", inputs: ["tag", "presentOrEdit"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: ExternalVideoEditorComponent, selector: "croco-html-external-video-editor", inputs: ["tag", "presentOrEdit"] }, { kind: "component", type: ButtonEditorComponent, selector: "croco-html-button-editor", inputs: ["tag", "presentOrEdit"] }, { kind: "component", type: CustomWidgetEditorComponent, selector: "croco-html-custom-widget-editor", inputs: ["tag", "presentOrEdit"] }, { kind: "component", type: DefinedCustomEditorBlockComponent, selector: "croco-html-defined-custom-editor-block", inputs: ["tagService"] }, { kind: "pipe", type: JsonPipe, name: "json" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
3292
3292
  }
3293
3293
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: MainEditorBlockComponent, decorators: [{
3294
3294
  type: Component,
@@ -3304,7 +3304,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
3304
3304
  CustomWidgetEditorComponent,
3305
3305
  JsonPipe,
3306
3306
  DefinedCustomEditorBlockComponent,
3307
- ], template: "<div class=\"main-editor-block\">\n <div class=\"editor-container\">\n @if (textTags.includes(_tag.tagDescription.tag)) {\n <div>\n <croco-html-text-editor [tagService]=\"_tagService\">\n </croco-html-text-editor>\n </div>\n }\n @else if (_tag.tagDescription.tag === 'file-image') {\n <div>\n <croco-html-image-editor [presentOrEdit]=\"presentOrEdit\" [tag]=\"_tag\">\n </croco-html-image-editor>\n </div>\n }\n @else if (_tag.tagDescription.tag === 'audio-player') {\n <div>\n <croco-html-audio-editor [presentOrEdit]=\"presentOrEdit\" [tag]=\"_tag\">\n </croco-html-audio-editor>\n </div>\n }\n @else if (_tag.tagDescription.tag === 'custom-widget') {\n <div>\n <croco-html-custom-widget-editor [presentOrEdit]=\"presentOrEdit\" [tag]=\"_tag\">\n </croco-html-custom-widget-editor>\n </div>\n }\n @else if (_tag.tagDescription.tag === 'external-video') {\n <div>\n <croco-html-external-video-editor [presentOrEdit]=\"presentOrEdit\" [tag]=\"_tag\">\n </croco-html-external-video-editor>\n </div>\n }\n @else if (_tag.tagDescription.tag === 'download-file-button') {\n <div>\n <croco-html-download-file-button-editor [presentOrEdit]=\"presentOrEdit\" [tag]=\"_tag\">\n </croco-html-download-file-button-editor>\n </div>\n }\n @else if (_tag.tagDescription.tag === 'button') {\n <div>\n <croco-html-button-editor [presentOrEdit]=\"presentOrEdit\" [tag]=\"_tag\">\n </croco-html-button-editor>\n </div>\n }\n @else if (_tag.tagDescription.tag === 'html-raw') {\n <div>\n <croco-html-html-raw-editor [presentOrEdit]=\"presentOrEdit\" [tag]=\"_tag\">\n </croco-html-html-raw-editor>\n </div>\n }\n @else if (isDefinedCustomTag()) {\n <div>\n <croco-html-defined-custom-editor-block [tagService]=\"_tagService\"></croco-html-defined-custom-editor-block>\n </div>\n }\n @else {\n <div>\n {{_tag.tagDescription.tag}} \u043D\u0435 \u043F\u043E\u043A\u0430\u0437\u0430\u043D\n </div>\n <div>\n {{_tag | json}}\n </div>\n }\n\n </div>\n\n <div class=\"d-flex justify-content-between\">\n <div class=\"d-flex justify-content-end align-self-center\">\n <div style=\"margin-left: 16px;min-width: 96px\">\n @if (presentOrEdit) {\n <button (click)=\"cancelSave()\" mat-icon-button>\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\"\n d=\"M14.4374 0C15.0921 0 15.7197 0.261421 16.1781 0.723424L19.279 3.82432C19.7407 4.286 20.0001 4.91217 20.0001 5.56508C20.0001 6.21799 19.7407 6.84416 19.279 7.30584L7.95751 18.6238C7.25903 19.4295 6.2689 19.9245 5.1346 20.0023H0V19.0023L0.00324754 14.7873C0.0884381 13.7328 0.578667 12.7523 1.3265 12.0934L12.6954 0.72463C13.1564 0.260831 13.7834 0 14.4374 0ZM5.06401 18.0048C5.59823 17.967 6.09551 17.7184 6.49482 17.2616L14.0567 9.69971L10.3024 5.94518L2.69613 13.5496C2.29098 13.9079 2.04034 14.4092 2.00003 14.8678V18.0029L5.06401 18.0048ZM11.7167 4.53114L15.471 8.28549L17.8648 5.89162C17.9514 5.80502 18.0001 5.68756 18.0001 5.56508C18.0001 5.4426 17.9514 5.32514 17.8648 5.23854L14.7612 2.13486C14.6755 2.04855 14.559 2 14.4374 2C14.3158 2 14.1992 2.04855 14.1136 2.13486L11.7167 4.53114Z\"\n fill=\"#323E8B\" />\n </svg>\n </button>\n }\n @else {\n <button (click)=\"save()\" mat-icon-button>\n <svg width=\"800px\" height=\"800px\" viewBox=\"0 0 24 24\" role=\"img\" xmlns=\"http://www.w3.org/2000/svg\"\n aria-labelledby=\"saveIconTitle\" stroke=\"#000000\" stroke-width=\"1\" stroke-linecap=\"square\"\n stroke-linejoin=\"miter\" fill=\"none\" color=\"#000000\">\n <title id=\"saveIconTitle\">Save</title>\n <path\n d=\"M17.2928932,3.29289322 L21,7 L21,20 C21,20.5522847 20.5522847,21 20,21 L4,21 C3.44771525,21 3,20.5522847 3,20 L3,4 C3,3.44771525 3.44771525,3 4,3 L16.5857864,3 C16.8510029,3 17.1053568,3.10535684 17.2928932,3.29289322 Z\" />\n <rect width=\"10\" height=\"8\" x=\"7\" y=\"13\" />\n <rect width=\"8\" height=\"5\" x=\"8\" y=\"3\" />\n </svg>\n </button>\n }\n <button (click)=\"deleteItem()\" mat-icon-button color=\"warn\">\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\"\n d=\"M7.49988 0.833332H12.4999C13.4204 0.833332 14.1665 1.57952 14.1665 2.5V3.33333H16.6665C17.587 3.33333 18.3332 4.07952 18.3332 4.99999V6.66666C18.3332 7.58714 17.587 8.33333 16.6665 8.33333H16.5998L15.8332 17.5C15.8332 18.4205 15.087 19.1667 14.1665 19.1667H5.8332C4.91272 19.1667 4.16653 18.4205 4.16941 17.5692L3.39975 8.33333H3.33317C2.4127 8.33333 1.6665 7.58714 1.6665 6.66666V4.99999C1.6665 4.07952 2.4127 3.33333 3.33317 3.33333H5.83321V2.5C5.83321 1.57952 6.5794 0.833332 7.49988 0.833332ZM5.83321 5V4.99999H3.33317V6.66666H16.6665V4.99999L14.1665 5H5.83321ZM5.83324 17.5L5.07198 8.33333H14.9276L14.1695 17.4308L14.1666 17.5H5.83324ZM12.4999 2.5V3.33334H7.49992V2.5H12.4999Z\"\n fill=\"#F96666\" />\n </svg>\n </button>\n </div>\n </div>\n\n </div>\n</div>\n", styles: [".main-editor-block{display:flex;justify-content:space-between}.editor-container{flex-grow:1}@media screen and (max-width: 700px){.main-editor-block{display:flex;flex-direction:column}}\n"] }]
3307
+ ], template: "<div class=\"main-editor-block\">\n <div class=\"editor-container\">\n @if (textTags.includes(_tag.tagDescription.tag)) {\n <div>\n <croco-html-text-editor [tagService]=\"_tagService\">\n </croco-html-text-editor>\n </div>\n }\n @else if (_tag.tagDescription.tag === 'file-image') {\n <div>\n <croco-html-image-editor [presentOrEdit]=\"presentOrEdit\" [tag]=\"_tag\">\n </croco-html-image-editor>\n </div>\n }\n @else if (_tag.tagDescription.tag === 'audio-player') {\n <div>\n <croco-html-audio-editor [presentOrEdit]=\"presentOrEdit\" [tag]=\"_tag\">\n </croco-html-audio-editor>\n </div>\n }\n @else if (_tag.tagDescription.tag === 'custom-widget') {\n <div>\n <croco-html-custom-widget-editor [presentOrEdit]=\"presentOrEdit\" [tag]=\"_tag\">\n </croco-html-custom-widget-editor>\n </div>\n }\n @else if (_tag.tagDescription.tag === 'external-video') {\n <div>\n <croco-html-external-video-editor [presentOrEdit]=\"presentOrEdit\" [tag]=\"_tag\">\n </croco-html-external-video-editor>\n </div>\n }\n @else if (_tag.tagDescription.tag === 'download-file-button') {\n <div>\n <croco-html-download-file-button-editor [presentOrEdit]=\"presentOrEdit\" [tag]=\"_tag\">\n </croco-html-download-file-button-editor>\n </div>\n }\n @else if (_tag.tagDescription.tag === 'button') {\n <div>\n <croco-html-button-editor [presentOrEdit]=\"presentOrEdit\" [tag]=\"_tag\">\n </croco-html-button-editor>\n </div>\n }\n @else if (_tag.tagDescription.tag === 'html-raw') {\n <div>\n <croco-html-html-raw-editor [presentOrEdit]=\"presentOrEdit\" [tag]=\"_tag\">\n </croco-html-html-raw-editor>\n </div>\n }\n @else if (isEditorDefined()) {\n <div>\n <croco-html-defined-custom-editor-block [tagService]=\"_tagService\"></croco-html-defined-custom-editor-block>\n </div>\n }\n @else {\n <div>\n {{_tag.tagDescription.tag}} \u043D\u0435 \u043F\u043E\u043A\u0430\u0437\u0430\u043D\n </div>\n <div>\n {{_tag | json}}\n </div>\n }\n\n </div>\n\n <div class=\"d-flex justify-content-between\">\n <div class=\"d-flex justify-content-end align-self-center\">\n <div style=\"margin-left: 16px;min-width: 96px\">\n @if (presentOrEdit) {\n <button (click)=\"cancelSave()\" mat-icon-button>\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\"\n d=\"M14.4374 0C15.0921 0 15.7197 0.261421 16.1781 0.723424L19.279 3.82432C19.7407 4.286 20.0001 4.91217 20.0001 5.56508C20.0001 6.21799 19.7407 6.84416 19.279 7.30584L7.95751 18.6238C7.25903 19.4295 6.2689 19.9245 5.1346 20.0023H0V19.0023L0.00324754 14.7873C0.0884381 13.7328 0.578667 12.7523 1.3265 12.0934L12.6954 0.72463C13.1564 0.260831 13.7834 0 14.4374 0ZM5.06401 18.0048C5.59823 17.967 6.09551 17.7184 6.49482 17.2616L14.0567 9.69971L10.3024 5.94518L2.69613 13.5496C2.29098 13.9079 2.04034 14.4092 2.00003 14.8678V18.0029L5.06401 18.0048ZM11.7167 4.53114L15.471 8.28549L17.8648 5.89162C17.9514 5.80502 18.0001 5.68756 18.0001 5.56508C18.0001 5.4426 17.9514 5.32514 17.8648 5.23854L14.7612 2.13486C14.6755 2.04855 14.559 2 14.4374 2C14.3158 2 14.1992 2.04855 14.1136 2.13486L11.7167 4.53114Z\"\n fill=\"#323E8B\" />\n </svg>\n </button>\n }\n @else {\n <button (click)=\"save()\" mat-icon-button>\n <svg width=\"800px\" height=\"800px\" viewBox=\"0 0 24 24\" role=\"img\" xmlns=\"http://www.w3.org/2000/svg\"\n aria-labelledby=\"saveIconTitle\" stroke=\"#000000\" stroke-width=\"1\" stroke-linecap=\"square\"\n stroke-linejoin=\"miter\" fill=\"none\" color=\"#000000\">\n <title id=\"saveIconTitle\">Save</title>\n <path\n d=\"M17.2928932,3.29289322 L21,7 L21,20 C21,20.5522847 20.5522847,21 20,21 L4,21 C3.44771525,21 3,20.5522847 3,20 L3,4 C3,3.44771525 3.44771525,3 4,3 L16.5857864,3 C16.8510029,3 17.1053568,3.10535684 17.2928932,3.29289322 Z\" />\n <rect width=\"10\" height=\"8\" x=\"7\" y=\"13\" />\n <rect width=\"8\" height=\"5\" x=\"8\" y=\"3\" />\n </svg>\n </button>\n }\n <button (click)=\"deleteItem()\" mat-icon-button color=\"warn\">\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\"\n d=\"M7.49988 0.833332H12.4999C13.4204 0.833332 14.1665 1.57952 14.1665 2.5V3.33333H16.6665C17.587 3.33333 18.3332 4.07952 18.3332 4.99999V6.66666C18.3332 7.58714 17.587 8.33333 16.6665 8.33333H16.5998L15.8332 17.5C15.8332 18.4205 15.087 19.1667 14.1665 19.1667H5.8332C4.91272 19.1667 4.16653 18.4205 4.16941 17.5692L3.39975 8.33333H3.33317C2.4127 8.33333 1.6665 7.58714 1.6665 6.66666V4.99999C1.6665 4.07952 2.4127 3.33333 3.33317 3.33333H5.83321V2.5C5.83321 1.57952 6.5794 0.833332 7.49988 0.833332ZM5.83321 5V4.99999H3.33317V6.66666H16.6665V4.99999L14.1665 5H5.83321ZM5.83324 17.5L5.07198 8.33333H14.9276L14.1695 17.4308L14.1666 17.5H5.83324ZM12.4999 2.5V3.33334H7.49992V2.5H12.4999Z\"\n fill=\"#F96666\" />\n </svg>\n </button>\n </div>\n </div>\n\n </div>\n</div>\n", styles: [".main-editor-block{display:flex;justify-content:space-between}.editor-container{flex-grow:1}@media screen and (max-width: 700px){.main-editor-block{display:flex;flex-direction:column}}\n"] }]
3308
3308
  }], ctorParameters: () => [{ type: undefined, decorators: [{
3309
3309
  type: Inject,
3310
3310
  args: [CrocoHtmlOptionsToken]
@@ -4049,5 +4049,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
4049
4049
  * Generated bundle index. Do not edit.
4050
4050
  */
4051
4051
 
4052
- export { AddFilesBtnComponent, AngularMaterialTableMethods, AudioEditorComponent, AudioMethods, AudioPlayerTagViewComponent, BodyTagsExtensions, BootstrapTableMethods, ButtonTagDataConsts, ButtonTagService, CrocoHtmlFileOptionsService, CrocoHtmlModule, CrocoHtmlOptionsToken, CustomWidgetEditorComponent, CustomWidgetIconComponent, CustomWidgetTagDataConsts, CustomWidgetTagService, DefinedCustomEditorBlockComponent, DefinedCustomTagViewComponent, DownloadButtonTagDataConsts, DownloadButtonTagService, ExternalVideoEditorComponent, ExternalVideoPlayers, ExternalVideoSupportedTypes, ExternalVideoTagDataConsts, ExternalVideoTagService, FileAudioTagDataConsts, FileIdSelectComponent, FileImageTagDataConsts, FileImageTagService, FileImageTagViewComponent, FileType, HtmlPageDataController, HtmlRawEditorComponent, HtmlRawTagDataConsts, HtmlRawTagService, HtmlRawViewComponent, HtmlViewComponent, HtmlViewController, ImageEditorComponent, ImageMethods, MainEditorBlockComponent, MainEditorComponent, TableBuilder, TableMethods, TableTypes, TagEditorService, TagToSpanPipe, TextAlignment, TextEditorComponent, TextSimpleMethods, TextTag, TextTagDataConsts, TextTagHtmlMarkupTagService, TextTags, ToHtmlBodyTagsPipe, ToPreviewHtmlPipe, ToPreviewPipe, UploadFilesBtnComponent, VisualEditorComponent, XmlExtensions, XmlTagCustomWidgetComponent, XmlTagExternalVideoComponent, XmlTagHeaderInnerTextViewComponent, XmlTagHeaderTextViewComponent, XmlTagHtmlViewComponent, XmlTagTextViewComponent, XmlTagViewComponent };
4052
+ export { AddFilesBtnComponent, AngularMaterialTableMethods, AudioEditorComponent, AudioMethods, AudioPlayerTagViewComponent, BodyTagsExtensions, BootstrapTableMethods, ButtonTagDataConsts, ButtonTagService, CrocoHtmlFileOptionsService, CrocoHtmlModule, CrocoHtmlOptionsToken, CustomWidgetEditorComponent, CustomWidgetIconComponent, CustomWidgetTagDataConsts, CustomWidgetTagService, DefinedCustomEditorBlockComponent, DefinedCustomTagViewComponent, DownloadButtonTagDataConsts, DownloadButtonTagService, ExternalVideoEditorComponent, ExternalVideoPlayers, ExternalVideoSupportedTypes, ExternalVideoTagDataConsts, ExternalVideoTagService, FileAudioTagDataConsts, FileIdSelectComponent, FileImageTagDataConsts, FileImageTagService, FileImageTagViewComponent, FileType, HtmlPageDataController, HtmlRawEditorComponent, HtmlRawTagDataConsts, HtmlRawTagService, HtmlRawViewComponent, HtmlViewComponent, HtmlViewController, ImageEditorComponent, ImageMethods, LinkTagAttrs, LinkTagConsts, LinkTagService, MainEditorBlockComponent, MainEditorComponent, TableBuilder, TableMethods, TableTypes, TagEditorService, TagToSpanPipe, TextAlignment, TextEditorComponent, TextSimpleMethods, TextTag, TextTagDataConsts, TextTagHtmlMarkupTagService, TextTags, ToHtmlBodyTagsPipe, ToPreviewHtmlPipe, ToPreviewPipe, UploadFilesBtnComponent, VisualEditorComponent, XmlExtensions, XmlTagCustomWidgetComponent, XmlTagExternalVideoComponent, XmlTagHeaderInnerTextViewComponent, XmlTagHeaderTextViewComponent, XmlTagHtmlViewComponent, XmlTagTextViewComponent, XmlTagViewComponent };
4053
4053
  //# sourceMappingURL=croco-html.mjs.map