croco-html 0.0.1 → 0.1.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.
Files changed (127) hide show
  1. package/README.md +24 -24
  2. package/croco-html.d.ts +5 -5
  3. package/{esm2015/croco-html.js → esm2020/croco-html.mjs} +4 -4
  4. package/esm2020/lib/components/add-files-btn/add-files-btn.component.mjs +53 -0
  5. package/esm2020/lib/components/editor/external-video-block/external-video-block.component.mjs +45 -0
  6. package/esm2020/lib/components/editor/html-raw-editor/html-raw-editor.component.mjs +25 -0
  7. package/esm2020/lib/components/editor/image-editor/image-editor.component.mjs +50 -0
  8. package/{esm2015/lib/components/editor/index.js → esm2020/lib/components/editor/index.mjs} +8 -8
  9. package/esm2020/lib/components/editor/main-editor/main-editor.component.mjs +76 -0
  10. package/esm2020/lib/components/editor/main-editor-block/main-editor-block.component.mjs +41 -0
  11. package/esm2020/lib/components/editor/text-editor/text-editor.component.mjs +34 -0
  12. package/esm2020/lib/components/editor/visual-editor/visual-editor.component.mjs +161 -0
  13. package/esm2020/lib/components/file-id-select/file-id-select.component.mjs +62 -0
  14. package/{esm2015/lib/components/index.js → esm2020/lib/components/index.mjs} +6 -6
  15. package/esm2020/lib/components/upload-files-btn/upload-files-btn.component.mjs +54 -0
  16. package/{esm2015/lib/components/xml-tags/index.js → esm2020/lib/components/xml-tags/index.mjs} +9 -9
  17. package/esm2020/lib/components/xml-tags/xml-tag-external-video/xml-tag-external-video.component.mjs +43 -0
  18. package/esm2020/lib/components/xml-tags/xml-tag-header-inner-text-view/xml-tag-header-inner-text-view.component.mjs +17 -0
  19. package/esm2020/lib/components/xml-tags/xml-tag-header-text-view/xml-tag-header-text-view.component.mjs +18 -0
  20. package/esm2020/lib/components/xml-tags/xml-tag-html-view/xml-tag-html-view.component.mjs +16 -0
  21. package/esm2020/lib/components/xml-tags/xml-tag-rich-text-view/xml-tag-rich-text-view.component.mjs +20 -0
  22. package/esm2020/lib/components/xml-tags/xml-tag-table-view/xml-tag-table-view.component.mjs +20 -0
  23. package/esm2020/lib/components/xml-tags/xml-tag-text-view/xml-tag-text-view.component.mjs +17 -0
  24. package/esm2020/lib/components/xml-tags/xml-tag-view/xml-tag-view.component.mjs +21 -0
  25. package/{esm2015/lib/croco-html.module.js → esm2020/lib/croco-html.module.mjs} +90 -90
  26. package/{esm2015/lib/extensions/AngularMaterialTableMethods.js → esm2020/lib/extensions/AngularMaterialTableMethods.mjs} +64 -64
  27. package/{esm2015/lib/extensions/BodyTagsExtensions.js → esm2020/lib/extensions/BodyTagsExtensions.mjs} +120 -120
  28. package/{esm2015/lib/extensions/BootstrapTableMethods.js → esm2020/lib/extensions/BootstrapTableMethods.mjs} +67 -67
  29. package/{esm2015/lib/extensions/HtmlExtractionMethods.js → esm2020/lib/extensions/HtmlExtractionMethods.mjs} +63 -63
  30. package/{esm2015/lib/extensions/HtmlRawTagDataConsts.js → esm2020/lib/extensions/HtmlRawTagDataConsts.mjs} +4 -4
  31. package/{esm2015/lib/extensions/ImageMethods.js → esm2020/lib/extensions/ImageMethods.mjs} +24 -24
  32. package/{esm2015/lib/extensions/InterfaceBlock.js → esm2020/lib/extensions/InterfaceBlock.mjs} +2 -2
  33. package/{esm2015/lib/extensions/TableBuilder.js → esm2020/lib/extensions/TableBuilder.mjs} +35 -35
  34. package/esm2020/lib/extensions/TableMethods.mjs +108 -0
  35. package/{esm2015/lib/extensions/TextMethods.js → esm2020/lib/extensions/TextMethods.mjs} +29 -29
  36. package/esm2020/lib/extensions/TextSimpleMethods.mjs +77 -0
  37. package/{esm2015/lib/extensions/VideoMethods.js → esm2020/lib/extensions/VideoMethods.mjs} +20 -20
  38. package/{esm2015/lib/extensions/XmlExtensions.js → esm2020/lib/extensions/XmlExtensions.mjs} +26 -26
  39. package/{esm2015/lib/extensions/index.js → esm2020/lib/extensions/index.mjs} +13 -13
  40. package/{esm2015/lib/index.js → esm2020/lib/index.mjs} +113 -113
  41. package/esm2020/lib/models/models.mjs +2 -0
  42. package/{esm2015/lib/pipes/RichTextToHtmlPipe.js → esm2020/lib/pipes/RichTextToHtmlPipe.mjs} +26 -26
  43. package/{esm2015/lib/pipes/TagToSpanPipe.js → esm2020/lib/pipes/TagToSpanPipe.mjs} +16 -16
  44. package/{esm2015/lib/pipes/ToHtmlBodyTagsPipe.js → esm2020/lib/pipes/ToHtmlBodyTagsPipe.mjs} +17 -17
  45. package/{esm2015/lib/pipes/index.js → esm2020/lib/pipes/index.mjs} +5 -5
  46. package/{esm2015/lib/pipes/to-preview.pipe.js → esm2020/lib/pipes/to-preview.pipe.mjs} +17 -17
  47. package/esm2020/lib/services/file-upload.service.mjs +40 -0
  48. package/esm2020/lib/services/files-query.service.mjs +27 -0
  49. package/{esm2015/public-api.js → esm2020/public-api.mjs} +8 -8
  50. package/fesm2015/croco-html.mjs +1565 -0
  51. package/fesm2015/croco-html.mjs.map +1 -0
  52. package/fesm2020/croco-html.mjs +1568 -0
  53. package/fesm2020/croco-html.mjs.map +1 -0
  54. package/lib/components/add-files-btn/add-files-btn.component.d.ts +18 -18
  55. package/lib/components/editor/external-video-block/external-video-block.component.d.ts +19 -19
  56. package/lib/components/editor/html-raw-editor/html-raw-editor.component.d.ts +11 -11
  57. package/lib/components/editor/image-editor/image-editor.component.d.ts +20 -20
  58. package/lib/components/editor/index.d.ts +7 -7
  59. package/lib/components/editor/main-editor/main-editor.component.d.ts +28 -28
  60. package/lib/components/editor/main-editor-block/main-editor-block.component.d.ts +16 -16
  61. package/lib/components/editor/text-editor/text-editor.component.d.ts +14 -14
  62. package/lib/components/editor/visual-editor/visual-editor.component.d.ts +43 -43
  63. package/lib/components/file-id-select/file-id-select.component.d.ts +30 -30
  64. package/lib/components/index.d.ts +5 -5
  65. package/lib/components/upload-files-btn/upload-files-btn.component.d.ts +24 -24
  66. package/lib/components/xml-tags/index.d.ts +8 -8
  67. package/lib/components/xml-tags/xml-tag-external-video/xml-tag-external-video.component.d.ts +17 -17
  68. package/lib/components/xml-tags/xml-tag-header-inner-text-view/xml-tag-header-inner-text-view.component.d.ts +10 -10
  69. package/lib/components/xml-tags/xml-tag-header-text-view/xml-tag-header-text-view.component.d.ts +10 -10
  70. package/lib/components/xml-tags/xml-tag-html-view/xml-tag-html-view.component.d.ts +7 -7
  71. package/lib/components/xml-tags/xml-tag-rich-text-view/xml-tag-rich-text-view.component.d.ts +10 -10
  72. package/lib/components/xml-tags/xml-tag-table-view/xml-tag-table-view.component.d.ts +7 -7
  73. package/lib/components/xml-tags/xml-tag-text-view/xml-tag-text-view.component.d.ts +10 -10
  74. package/lib/components/xml-tags/xml-tag-view/xml-tag-view.component.d.ts +8 -8
  75. package/lib/croco-html.module.d.ts +60 -60
  76. package/lib/extensions/AngularMaterialTableMethods.d.ts +10 -10
  77. package/lib/extensions/BodyTagsExtensions.d.ts +10 -10
  78. package/lib/extensions/BootstrapTableMethods.d.ts +9 -9
  79. package/lib/extensions/HtmlExtractionMethods.d.ts +69 -69
  80. package/lib/extensions/HtmlRawTagDataConsts.d.ts +3 -3
  81. package/lib/extensions/ImageMethods.d.ts +17 -17
  82. package/lib/extensions/InterfaceBlock.d.ts +4 -4
  83. package/lib/extensions/TableBuilder.d.ts +5 -5
  84. package/lib/extensions/TableMethods.d.ts +58 -58
  85. package/lib/extensions/TextMethods.d.ts +19 -19
  86. package/lib/extensions/TextSimpleMethods.d.ts +23 -23
  87. package/lib/extensions/VideoMethods.d.ts +19 -19
  88. package/lib/extensions/XmlExtensions.d.ts +5 -5
  89. package/lib/extensions/index.d.ts +10 -10
  90. package/lib/index.d.ts +20 -20
  91. package/lib/models/models.d.ts +10 -10
  92. package/lib/pipes/RichTextToHtmlPipe.d.ts +8 -8
  93. package/lib/pipes/TagToSpanPipe.d.ts +7 -7
  94. package/lib/pipes/ToHtmlBodyTagsPipe.d.ts +8 -8
  95. package/lib/pipes/index.d.ts +4 -4
  96. package/lib/pipes/to-preview.pipe.d.ts +8 -8
  97. package/lib/services/file-upload.service.d.ts +23 -23
  98. package/lib/services/files-query.service.d.ts +42 -42
  99. package/package.json +26 -14
  100. package/public-api.d.ts +4 -4
  101. package/bundles/croco-html.umd.js +0 -2091
  102. package/bundles/croco-html.umd.js.map +0 -1
  103. package/esm2015/lib/components/add-files-btn/add-files-btn.component.js +0 -57
  104. package/esm2015/lib/components/editor/external-video-block/external-video-block.component.js +0 -49
  105. package/esm2015/lib/components/editor/html-raw-editor/html-raw-editor.component.js +0 -29
  106. package/esm2015/lib/components/editor/image-editor/image-editor.component.js +0 -54
  107. package/esm2015/lib/components/editor/main-editor/main-editor.component.js +0 -80
  108. package/esm2015/lib/components/editor/main-editor-block/main-editor-block.component.js +0 -45
  109. package/esm2015/lib/components/editor/text-editor/text-editor.component.js +0 -38
  110. package/esm2015/lib/components/editor/visual-editor/visual-editor.component.js +0 -165
  111. package/esm2015/lib/components/file-id-select/file-id-select.component.js +0 -66
  112. package/esm2015/lib/components/upload-files-btn/upload-files-btn.component.js +0 -58
  113. package/esm2015/lib/components/xml-tags/xml-tag-external-video/xml-tag-external-video.component.js +0 -47
  114. package/esm2015/lib/components/xml-tags/xml-tag-header-inner-text-view/xml-tag-header-inner-text-view.component.js +0 -21
  115. package/esm2015/lib/components/xml-tags/xml-tag-header-text-view/xml-tag-header-text-view.component.js +0 -22
  116. package/esm2015/lib/components/xml-tags/xml-tag-html-view/xml-tag-html-view.component.js +0 -20
  117. package/esm2015/lib/components/xml-tags/xml-tag-rich-text-view/xml-tag-rich-text-view.component.js +0 -24
  118. package/esm2015/lib/components/xml-tags/xml-tag-table-view/xml-tag-table-view.component.js +0 -24
  119. package/esm2015/lib/components/xml-tags/xml-tag-text-view/xml-tag-text-view.component.js +0 -21
  120. package/esm2015/lib/components/xml-tags/xml-tag-view/xml-tag-view.component.js +0 -26
  121. package/esm2015/lib/extensions/TableMethods.js +0 -100
  122. package/esm2015/lib/extensions/TextSimpleMethods.js +0 -78
  123. package/esm2015/lib/models/models.js +0 -2
  124. package/esm2015/lib/services/file-upload.service.js +0 -40
  125. package/esm2015/lib/services/files-query.service.js +0 -27
  126. package/fesm2015/croco-html.js +0 -1634
  127. package/fesm2015/croco-html.js.map +0 -1
@@ -0,0 +1,1565 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, Inject, EventEmitter, Component, ViewChild, Input, Output, ViewEncapsulation, Pipe, NgModule } from '@angular/core';
3
+ import * as i1 from '@angular/common/http';
4
+ import * as i2 from '@angular/material/button';
5
+ import { MatButtonModule } from '@angular/material/button';
6
+ import * as i5$1 from '@angular/forms';
7
+ import { FormGroup, FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
8
+ import * as i1$1 from '@angular/platform-browser';
9
+ import * as i2$1 from '@angular/common';
10
+ import { CommonModule } from '@angular/common';
11
+ import * as i5 from '@angular/material/form-field';
12
+ import { MatFormFieldModule } from '@angular/material/form-field';
13
+ import * as i5$2 from '@angular/material/input';
14
+ import { MatInputModule } from '@angular/material/input';
15
+ import * as i4 from '@angular/cdk/text-field';
16
+ import * as i1$2 from '@angular/material/button-toggle';
17
+ import { MatButtonToggleModule } from '@angular/material/button-toggle';
18
+ import * as i2$2 from '@angular/material/icon';
19
+ import { MatIconModule } from '@angular/material/icon';
20
+ import * as i3 from '@ng-select/ng-select';
21
+ import { NgSelectModule } from '@ng-select/ng-select';
22
+ import * as i1$4 from 'ngx-clipboard';
23
+ import * as i2$4 from '@angular/material/snack-bar';
24
+ import { MatSnackBarModule } from '@angular/material/snack-bar';
25
+ import * as i3$2 from '@angular/material/tabs';
26
+ import { MatTabsModule } from '@angular/material/tabs';
27
+ import * as i11 from '@angular/cdk/drag-drop';
28
+ import { moveItemInArray, DragDropModule } from '@angular/cdk/drag-drop';
29
+ import * as i1$3 from '@angular/material/progress-spinner';
30
+ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
31
+ import * as i2$3 from '@angular/material/card';
32
+ import { MatCardModule } from '@angular/material/card';
33
+ import * as i3$1 from '@angular/material/chips';
34
+ import { MatChipsModule } from '@angular/material/chips';
35
+ import * as i6 from '@angular/material/select';
36
+ import { MatSelectModule } from '@angular/material/select';
37
+ import * as i7 from '@angular/material/core';
38
+ import { MatNativeDateModule } from '@angular/material/core';
39
+ import * as i1$5 from '@angular/material/table';
40
+ import { MatTableModule } from '@angular/material/table';
41
+ import * as i34 from '@angular/material/tooltip';
42
+ import { MatTooltipModule } from '@angular/material/tooltip';
43
+ import * as i35 from '@angular/material/checkbox';
44
+ import { MatCheckboxModule } from '@angular/material/checkbox';
45
+ import * as i47 from '@angular/material/autocomplete';
46
+ import { MatAutocompleteModule } from '@angular/material/autocomplete';
47
+ import * as i42 from '@angular/material/datepicker';
48
+ import { MatDatepickerModule } from '@angular/material/datepicker';
49
+ import * as i40 from '@angular/material/dialog';
50
+ import { MatDialogModule } from '@angular/material/dialog';
51
+ import * as i25 from '@angular/material/expansion';
52
+ import { MatExpansionModule } from '@angular/material/expansion';
53
+ import * as i43 from '@angular/material/grid-list';
54
+ import { MatGridListModule } from '@angular/material/grid-list';
55
+ import * as i37 from '@angular/material/list';
56
+ import { MatListModule } from '@angular/material/list';
57
+ import * as i31 from '@angular/material/menu';
58
+ import { MatMenuModule } from '@angular/material/menu';
59
+ import * as i41 from '@angular/material/paginator';
60
+ import { MatPaginatorModule } from '@angular/material/paginator';
61
+ import * as i28 from '@angular/material/progress-bar';
62
+ import { MatProgressBarModule } from '@angular/material/progress-bar';
63
+ import * as i48 from '@angular/material/sidenav';
64
+ import { MatSidenavModule } from '@angular/material/sidenav';
65
+ import * as i44 from '@angular/material/slide-toggle';
66
+ import { MatSlideToggleModule } from '@angular/material/slide-toggle';
67
+ import * as i45 from '@angular/material/tree';
68
+ import { MatTreeModule } from '@angular/material/tree';
69
+ import * as i23 from '@angular/material/badge';
70
+ import { MatBadgeModule } from '@angular/material/badge';
71
+
72
+ class FileImageTagDataConsts {
73
+ }
74
+ FileImageTagDataConsts.TagName = "file-image";
75
+ FileImageTagDataConsts.FileIdAttrName = "file-id";
76
+ class ImageMethods {
77
+ static buildUrl(fileId) {
78
+ return `/FileCopies/Images/Medium/${fileId}.jpg`;
79
+ }
80
+ static buildSmallUrl(fileId) {
81
+ return `/FileCopies/Images/Small/${fileId}.jpg`;
82
+ }
83
+ static ExtractImage(elem) {
84
+ let fileId = +elem.getAttribute(FileImageTagDataConsts.FileIdAttrName);
85
+ let src = ImageMethods.buildUrl(fileId);
86
+ return {
87
+ type: FileImageTagDataConsts.TagName,
88
+ data: {
89
+ src,
90
+ fileId: fileId,
91
+ }
92
+ };
93
+ }
94
+ }
95
+
96
+ class FileUploadService {
97
+ constructor(_httpClient, baseUrl) {
98
+ this._httpClient = _httpClient;
99
+ this.baseUrl = baseUrl;
100
+ }
101
+ postFile(file, createLocalCopiesNow = false) {
102
+ const formData = new FormData();
103
+ formData.append(`fileKey1`, file, file.name);
104
+ return this.postFilesInner(formData, createLocalCopiesNow);
105
+ }
106
+ postFiles(files, createLocalCopiesNow = false) {
107
+ const formData = new FormData();
108
+ for (let i = 0; i < files.length; i++) {
109
+ var fileToUpload = files.item(i);
110
+ formData.append(`fileKey${i}`, fileToUpload, fileToUpload === null || fileToUpload === void 0 ? void 0 : fileToUpload.name);
111
+ }
112
+ return this.postFilesInner(formData, createLocalCopiesNow);
113
+ }
114
+ postFilesInner(formData, createLocalCopiesNow = false) {
115
+ let endpoint = this.baseUrl + 'Api/Files/UploadFiles';
116
+ if (createLocalCopiesNow) {
117
+ endpoint += '/Now';
118
+ }
119
+ return this._httpClient
120
+ .post(endpoint, formData);
121
+ }
122
+ }
123
+ FileUploadService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FileUploadService, deps: [{ token: i1.HttpClient }, { token: 'BASE_URL' }], target: i0.ɵɵFactoryTarget.Injectable });
124
+ FileUploadService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FileUploadService, providedIn: 'root' });
125
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FileUploadService, decorators: [{
126
+ type: Injectable,
127
+ args: [{ providedIn: 'root' }]
128
+ }], ctorParameters: function () {
129
+ return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
130
+ type: Inject,
131
+ args: ['BASE_URL']
132
+ }] }];
133
+ } });
134
+
135
+ class UploadFilesBtnComponent {
136
+ constructor(_fileUploadService) {
137
+ this._fileUploadService = _fileUploadService;
138
+ this.extAccepts = "*/*";
139
+ this.isMultiple = true;
140
+ this.btnText = "Загрузить файлы";
141
+ this.createLocalCopiesNow = false;
142
+ this.hidden = false;
143
+ this.postFilesStarted = new EventEmitter();
144
+ this.onFilesUploaded = new EventEmitter();
145
+ }
146
+ handleFileInput(files) {
147
+ this.postFilesStarted.emit({
148
+ filesCount: files.length,
149
+ createLocalCopiesNow: this.createLocalCopiesNow
150
+ });
151
+ this._fileUploadService.postFiles(files, this.createLocalCopiesNow).subscribe(data => {
152
+ this.onFilesUploaded.emit(data);
153
+ });
154
+ }
155
+ clickFileInput() {
156
+ this.fileInput.nativeElement.click();
157
+ }
158
+ ngOnInit() {
159
+ }
160
+ }
161
+ UploadFilesBtnComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: UploadFilesBtnComponent, deps: [{ token: FileUploadService }], target: i0.ɵɵFactoryTarget.Component });
162
+ UploadFilesBtnComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: UploadFilesBtnComponent, selector: "app-upload-files-btn", inputs: { extAccepts: "extAccepts", isMultiple: "isMultiple", btnText: "btnText", createLocalCopiesNow: "createLocalCopiesNow", hidden: "hidden" }, outputs: { postFilesStarted: "postFilesStarted", onFilesUploaded: "onFilesUploaded" }, viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["filesInput"], descendants: true }], ngImport: i0, template: "<button [hidden]=\"hidden\" mat-raised-button color=\"primary\" (click)=\"filesInput.click()\">{{btnText}}</button>\r\n<input [hidden]=\"true\" [accept]=\"extAccepts\" [multiple]=\"isMultiple\" type=\"file\" #filesInput (change)=\"handleFileInput($event.target.files)\" />", styles: [""], components: [{ type: i2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }] });
163
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: UploadFilesBtnComponent, decorators: [{
164
+ type: Component,
165
+ args: [{ selector: 'app-upload-files-btn', template: "<button [hidden]=\"hidden\" mat-raised-button color=\"primary\" (click)=\"filesInput.click()\">{{btnText}}</button>\r\n<input [hidden]=\"true\" [accept]=\"extAccepts\" [multiple]=\"isMultiple\" type=\"file\" #filesInput (change)=\"handleFileInput($event.target.files)\" />", styles: [""] }]
166
+ }], ctorParameters: function () { return [{ type: FileUploadService }]; }, propDecorators: { fileInput: [{
167
+ type: ViewChild,
168
+ args: ['filesInput']
169
+ }], extAccepts: [{
170
+ type: Input
171
+ }], isMultiple: [{
172
+ type: Input
173
+ }], btnText: [{
174
+ type: Input
175
+ }], createLocalCopiesNow: [{
176
+ type: Input
177
+ }], hidden: [{
178
+ type: Input
179
+ }], postFilesStarted: [{
180
+ type: Output
181
+ }], onFilesUploaded: [{
182
+ type: Output
183
+ }] } });
184
+
185
+ class AddFilesBtnComponent {
186
+ constructor() {
187
+ this.postFilesStarted = new EventEmitter();
188
+ this.fileIds = [];
189
+ this.filesTagsReady = new EventEmitter();
190
+ }
191
+ postFilesStartedEventHandler(data) {
192
+ this.postFilesStarted.emit(data);
193
+ }
194
+ filesUploadedHandler(data) {
195
+ this.fileIds = data.responseObject;
196
+ let fileTags = [];
197
+ for (let i = 0; i < this.fileIds.length; i++) {
198
+ let fileTag = {
199
+ presentOrEdit: true,
200
+ tagDescription: {
201
+ tag: FileImageTagDataConsts.TagName,
202
+ displayValue: "Изображение"
203
+ },
204
+ attributes: {
205
+ [FileImageTagDataConsts.FileIdAttrName]: this.fileIds[i]
206
+ },
207
+ innerHtml: ""
208
+ };
209
+ fileTags.push(fileTag);
210
+ }
211
+ this.filesTagsReady.emit(fileTags);
212
+ }
213
+ handleClick() {
214
+ this.fakeBtn.clickFileInput();
215
+ }
216
+ ngOnInit() {
217
+ }
218
+ }
219
+ AddFilesBtnComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AddFilesBtnComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
220
+ AddFilesBtnComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: AddFilesBtnComponent, selector: "croco-add-files-btn", outputs: { postFilesStarted: "postFilesStarted", filesTagsReady: "filesTagsReady" }, viewQueries: [{ propertyName: "fakeBtn", first: true, predicate: ["fakeBtn"], descendants: true }], ngImport: i0, template: "<div [hidden]=\"true\">\r\n <app-upload-files-btn #fakeBtn \r\n (onFilesUploaded)=\"filesUploadedHandler($event)\" \r\n [btnText]=\"'\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F'\"\r\n [createLocalCopiesNow]=\"true\"\r\n (postFilesStarted)=\"postFilesStartedEventHandler($event)\" \r\n [extAccepts]=\"'image/*'\"></app-upload-files-btn>\r\n</div>\r\n\r\n<div>\r\n <button class=\"w-100\" \r\n (click)=\"handleClick()\"\r\n mat-stroked-button>\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F</button>\r\n</div>", styles: [""], components: [{ type: UploadFilesBtnComponent, selector: "app-upload-files-btn", inputs: ["extAccepts", "isMultiple", "btnText", "createLocalCopiesNow", "hidden"], outputs: ["postFilesStarted", "onFilesUploaded"] }, { type: i2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }] });
221
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AddFilesBtnComponent, decorators: [{
222
+ type: Component,
223
+ args: [{ selector: 'croco-add-files-btn', template: "<div [hidden]=\"true\">\r\n <app-upload-files-btn #fakeBtn \r\n (onFilesUploaded)=\"filesUploadedHandler($event)\" \r\n [btnText]=\"'\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F'\"\r\n [createLocalCopiesNow]=\"true\"\r\n (postFilesStarted)=\"postFilesStartedEventHandler($event)\" \r\n [extAccepts]=\"'image/*'\"></app-upload-files-btn>\r\n</div>\r\n\r\n<div>\r\n <button class=\"w-100\" \r\n (click)=\"handleClick()\"\r\n mat-stroked-button>\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F</button>\r\n</div>", styles: [""] }]
224
+ }], ctorParameters: function () { return []; }, propDecorators: { postFilesStarted: [{
225
+ type: Output
226
+ }], fakeBtn: [{
227
+ type: ViewChild,
228
+ args: ["fakeBtn"]
229
+ }], filesTagsReady: [{
230
+ type: Output
231
+ }] } });
232
+
233
+ class ExternalVideoTagDataConsts {
234
+ }
235
+ ExternalVideoTagDataConsts.TagName = "external-video";
236
+ ExternalVideoTagDataConsts.VideoTypeAttrName = "type";
237
+ ExternalVideoTagDataConsts.LinkAttrName = "link";
238
+ class ExternalVideoSupportedTypes {
239
+ }
240
+ ExternalVideoSupportedTypes.Youtube = "youtube";
241
+ class VideoMethods {
242
+ static ExtractExternalVideoTag(elem) {
243
+ return {
244
+ type: ExternalVideoTagDataConsts.TagName,
245
+ data: {
246
+ type: elem.getAttribute(ExternalVideoTagDataConsts.VideoTypeAttrName),
247
+ link: elem.getAttribute(ExternalVideoTagDataConsts.LinkAttrName)
248
+ }
249
+ };
250
+ }
251
+ }
252
+
253
+ class XmlTagExternalVideoComponent {
254
+ constructor(_domSanitizer) {
255
+ this._domSanitizer = _domSanitizer;
256
+ }
257
+ getYouTubeId(youtubeLink) {
258
+ //https://www.youtube.com/watch?v=l3KfbfkxJOU
259
+ if (youtubeLink.includes("watch?v=")) {
260
+ var url = new URL(youtubeLink);
261
+ return url.searchParams.get("v");
262
+ }
263
+ //https://youtu.be/jzBneaWSswY
264
+ let bits = youtubeLink.split('/');
265
+ return bits[bits.length - 1];
266
+ }
267
+ getWidgetLink(youtubeLink) {
268
+ let id = this.getYouTubeId(youtubeLink);
269
+ let result = `https://www.youtube.com/embed/${id}?controls=0`;
270
+ this.widgetUrl = this._domSanitizer.bypassSecurityTrustResourceUrl(result);
271
+ return result;
272
+ }
273
+ ngOnInit() {
274
+ if (this.data != null) {
275
+ this.tagData = this.data.data;
276
+ }
277
+ let youtubeWidgetLink = this.getWidgetLink(this.tagData.link);
278
+ this.widgetUrl = this._domSanitizer.bypassSecurityTrustResourceUrl(youtubeWidgetLink);
279
+ }
280
+ }
281
+ XmlTagExternalVideoComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: XmlTagExternalVideoComponent, deps: [{ token: i1$1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component });
282
+ XmlTagExternalVideoComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", 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"], directives: [{ type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
283
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: XmlTagExternalVideoComponent, decorators: [{
284
+ type: Component,
285
+ 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"] }]
286
+ }], ctorParameters: function () { return [{ type: i1$1.DomSanitizer }]; }, propDecorators: { data: [{
287
+ type: Input
288
+ }], tagData: [{
289
+ type: Input
290
+ }] } });
291
+
292
+ class ExternalVideoBlockComponent {
293
+ constructor() {
294
+ this.onTagUpdated = new EventEmitter();
295
+ this.myForm = new FormGroup({
296
+ youtubeLink: new FormControl()
297
+ });
298
+ this.defaultLink = "https://youtu.be/jzBneaWSswY";
299
+ this.data = {
300
+ youtubeLink: this.defaultLink
301
+ };
302
+ this.tagData = {
303
+ link: this.defaultLink,
304
+ type: ExternalVideoSupportedTypes.Youtube
305
+ };
306
+ }
307
+ linkChanged() {
308
+ this.tagData.link = this.data.youtubeLink;
309
+ this.tag.attributes = this.tagData;
310
+ }
311
+ ngOnInit() {
312
+ this.linkChanged();
313
+ this.tagData = this.tag.attributes;
314
+ this.data.youtubeLink = this.tagData.link;
315
+ }
316
+ }
317
+ ExternalVideoBlockComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ExternalVideoBlockComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
318
+ ExternalVideoBlockComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: ExternalVideoBlockComponent, selector: "croco-html-external-video-block", inputs: { tag: "tag" }, outputs: { onTagUpdated: "onTagUpdated" }, ngImport: i0, template: "<div *ngIf=\"tag.presentOrEdit\">\r\n \r\n <div>\r\n \u0421\u0441\u044B\u043B\u043A\u0430 \u043D\u0430 YouTube: {{data.youtubeLink}}\r\n </div>\r\n\r\n <div style=\"height: 10px;\"></div>\r\n\r\n <croco-html-xml-tag-external-video [tagData]=\"tagData\">\r\n </croco-html-xml-tag-external-video>\r\n</div>\r\n\r\n<div *ngIf=\"!tag.presentOrEdit\">\r\n <div>\r\n <form [formGroup]=\"myForm\">\r\n <mat-form-field class=\"w-100\">\r\n <input matInput placeholder=\"\u0421\u0441\u044B\u043B\u043A\u0430 \u043D\u0430 YouTube\"\r\n new-autocomplete=\"off\"\r\n autocomplete=\"off\"\r\n formControlName=\"youtubeLink\"\r\n [(ngModel)]=\"data.youtubeLink\"\r\n (ngModelChange)=\"linkChanged()\">\r\n </mat-form-field>\r\n </form>\r\n </div>\r\n</div>\r\n\r\n", styles: [""], components: [{ type: XmlTagExternalVideoComponent, selector: "croco-html-xml-tag-external-video", inputs: ["data", "tagData"] }, { type: i5.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }], directives: [{ type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i5$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i5$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i5$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i5$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] });
319
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ExternalVideoBlockComponent, decorators: [{
320
+ type: Component,
321
+ args: [{ selector: 'croco-html-external-video-block', template: "<div *ngIf=\"tag.presentOrEdit\">\r\n \r\n <div>\r\n \u0421\u0441\u044B\u043B\u043A\u0430 \u043D\u0430 YouTube: {{data.youtubeLink}}\r\n </div>\r\n\r\n <div style=\"height: 10px;\"></div>\r\n\r\n <croco-html-xml-tag-external-video [tagData]=\"tagData\">\r\n </croco-html-xml-tag-external-video>\r\n</div>\r\n\r\n<div *ngIf=\"!tag.presentOrEdit\">\r\n <div>\r\n <form [formGroup]=\"myForm\">\r\n <mat-form-field class=\"w-100\">\r\n <input matInput placeholder=\"\u0421\u0441\u044B\u043B\u043A\u0430 \u043D\u0430 YouTube\"\r\n new-autocomplete=\"off\"\r\n autocomplete=\"off\"\r\n formControlName=\"youtubeLink\"\r\n [(ngModel)]=\"data.youtubeLink\"\r\n (ngModelChange)=\"linkChanged()\">\r\n </mat-form-field>\r\n </form>\r\n </div>\r\n</div>\r\n\r\n", styles: [""] }]
322
+ }], propDecorators: { tag: [{
323
+ type: Input
324
+ }], onTagUpdated: [{
325
+ type: Output
326
+ }] } });
327
+
328
+ class HtmlRawEditorComponent {
329
+ constructor() {
330
+ this.onTagUpdated = new EventEmitter();
331
+ }
332
+ ngOnInit() {
333
+ }
334
+ }
335
+ HtmlRawEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: HtmlRawEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
336
+ HtmlRawEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: HtmlRawEditorComponent, selector: "croco-html-html-raw-editor", inputs: { tag: "tag" }, outputs: { onTagUpdated: "onTagUpdated" }, ngImport: i0, template: "<div *ngIf=\"tag.presentOrEdit\">\r\n <div [innerHTML]=\"tag.innerHtml\"></div>\r\n</div>\r\n\r\n<div *ngIf=\"!tag.presentOrEdit\">\r\n <div style=\"height: 10px;\">\r\n </div>\r\n <div>\r\n <mat-form-field class=\"w-100\">\r\n <textarea matInput cdkTextareaAutosize #autosize=\"cdkTextareaAutosize\"\r\n cdkAutosizeMinRows=\"1\"\r\n placeholder=\"\u0412\u043D\u0443\u0442\u0440\u0435\u043D\u043D\u044F\u044F \u0440\u0430\u0437\u043C\u0435\u0442\u043A\u0430 \u0442\u0435\u0433\u0430\"\r\n [(ngModel)]=\"tag.innerHtml\"></textarea>\r\n </mat-form-field>\r\n </div>\r\n</div>\r\n\r\n", styles: [""], components: [{ type: i5.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }], directives: [{ type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i4.CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }, { type: i5$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i5$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
337
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: HtmlRawEditorComponent, decorators: [{
338
+ type: Component,
339
+ args: [{ selector: 'croco-html-html-raw-editor', template: "<div *ngIf=\"tag.presentOrEdit\">\r\n <div [innerHTML]=\"tag.innerHtml\"></div>\r\n</div>\r\n\r\n<div *ngIf=\"!tag.presentOrEdit\">\r\n <div style=\"height: 10px;\">\r\n </div>\r\n <div>\r\n <mat-form-field class=\"w-100\">\r\n <textarea matInput cdkTextareaAutosize #autosize=\"cdkTextareaAutosize\"\r\n cdkAutosizeMinRows=\"1\"\r\n placeholder=\"\u0412\u043D\u0443\u0442\u0440\u0435\u043D\u043D\u044F\u044F \u0440\u0430\u0437\u043C\u0435\u0442\u043A\u0430 \u0442\u0435\u0433\u0430\"\r\n [(ngModel)]=\"tag.innerHtml\"></textarea>\r\n </mat-form-field>\r\n </div>\r\n</div>\r\n\r\n", styles: [""] }]
340
+ }], ctorParameters: function () { return []; }, propDecorators: { tag: [{
341
+ type: Input
342
+ }], onTagUpdated: [{
343
+ type: Output
344
+ }] } });
345
+
346
+ class FilesQueryService {
347
+ constructor(_httpClient, baseUrl) {
348
+ this._httpClient = _httpClient;
349
+ this._baseControllerUrl = baseUrl + 'Api/Files/';
350
+ }
351
+ getFilesWithRelations(model) {
352
+ return this._httpClient.post(this._baseControllerUrl + `GetFiles/WithRelations`, model);
353
+ }
354
+ getFiles(model) {
355
+ return this._httpClient.post(this._baseControllerUrl + `GetFiles`, model);
356
+ }
357
+ }
358
+ FilesQueryService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FilesQueryService, deps: [{ token: i1.HttpClient }, { token: 'BASE_URL' }], target: i0.ɵɵFactoryTarget.Injectable });
359
+ FilesQueryService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FilesQueryService, providedIn: 'root' });
360
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FilesQueryService, decorators: [{
361
+ type: Injectable,
362
+ args: [{
363
+ providedIn: 'root'
364
+ }]
365
+ }], ctorParameters: function () {
366
+ return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
367
+ type: Inject,
368
+ args: ['BASE_URL']
369
+ }] }];
370
+ } });
371
+
372
+ class FileIdSelectComponent {
373
+ constructor(fb, _fileService) {
374
+ this.fb = fb;
375
+ this._fileService = _fileService;
376
+ this.labelText = "Поиск файлов";
377
+ this.loading = false;
378
+ this.files = [];
379
+ this.onFileIdChanged = new EventEmitter();
380
+ this.form = this.fb.group({
381
+ fileName: '',
382
+ });
383
+ }
384
+ onModelChanged(fileId) {
385
+ this.onFileIdChanged.emit(fileId);
386
+ }
387
+ getSrc(fileId) {
388
+ return ImageMethods.buildSmallUrl(fileId);
389
+ }
390
+ ngOnInit() {
391
+ this.loadFiles();
392
+ }
393
+ loadFiles() {
394
+ this.loading = true;
395
+ this._fileService.getFiles({
396
+ count: 10,
397
+ offSet: 0,
398
+ fileName: null,
399
+ q: this.q
400
+ }).subscribe(data => {
401
+ this.files = [...data.list];
402
+ this.loading = false;
403
+ });
404
+ }
405
+ onSearchChanged(q) {
406
+ this.q = q.term;
407
+ this.loadFiles();
408
+ }
409
+ ngOnChanges(changes) {
410
+ this.loadFiles();
411
+ }
412
+ }
413
+ FileIdSelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FileIdSelectComponent, deps: [{ token: i5$1.FormBuilder }, { token: FilesQueryService }], target: i0.ɵɵFactoryTarget.Component });
414
+ FileIdSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: FileIdSelectComponent, selector: "croco-html-file-id-select", inputs: { labelText: "labelText", fileId: "fileId" }, outputs: { fileId: "fileId", onFileIdChanged: "onFileIdChanged" }, usesOnChanges: true, ngImport: i0, template: "<form [formGroup]=\"form\">\r\n <div class=\"form-group\">\r\n <label for=\"fileName\">{{labelText}}</label>\r\n <ng-select [(ngModel)]=\"fileId\" (ngModelChange)=\"onModelChanged($event)\"\r\n [items]=\"files\"\r\n #select\r\n bindLabel=\"fileName\"\r\n (search)=\"onSearchChanged($event)\"\r\n [loading]=\"loading\"\r\n [loadingText]=\"'\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u044E \u0444\u0430\u0439\u043B\u044B'\"\r\n dropdownPosition=\"auto\"\r\n bindValue=\"fileId\"\r\n labelForId=\"fileName\"\r\n placeholder=\"\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0444\u0430\u0439\u043B\"\r\n [virtualScroll]=\"true\"\r\n formControlName=\"fileName\">\r\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\r\n <div>\r\n <img class=\"mx-auto d-block img-fluid\" [src]=\"getSrc(item.fileId)\"/>\r\n </div>\r\n <div>\r\n <span class=\"h5\">\u0424\u0430\u0439\u043B: </span>\r\n <span class=\"h5\" [ngOptionHighlight]=\"search\"><b>{{item.fileName}}</b></span>\r\n </div>\r\n <div>\r\n <small>\r\n <span>\r\n \u0418\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440 \u0444\u0430\u0439\u043B\u0430: <b>{{item.fileId}}</b>\r\n </span>\r\n </small>\r\n </div>\r\n </ng-template>\r\n </ng-select>\r\n </div>\r\n</form>\r\n\r\n<div>\r\n \u0418\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440 \u0444\u0430\u0439\u043B\u0430: {{fileId}}\r\n</div>\r\n", styles: [""], components: [{ type: i3.NgSelectComponent, selector: "ng-select", inputs: ["markFirst", "dropdownPosition", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "bufferAmount", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "keyDownFn", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "bindLabel", "placeholder", "notFoundText", "typeToSearchText", "addTagText", "loadingText", "clearAllText", "virtualScroll", "openOnEnter", "appendTo", "bindValue", "appearance", "maxSelectedItems", "groupBy", "groupValue", "tabIndex", "typeahead"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }], directives: [{ type: i5$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i5$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i5$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: i3.ɵf, selector: "[ng-option-tmp]" }] });
415
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FileIdSelectComponent, decorators: [{
416
+ type: Component,
417
+ args: [{ selector: 'croco-html-file-id-select', template: "<form [formGroup]=\"form\">\r\n <div class=\"form-group\">\r\n <label for=\"fileName\">{{labelText}}</label>\r\n <ng-select [(ngModel)]=\"fileId\" (ngModelChange)=\"onModelChanged($event)\"\r\n [items]=\"files\"\r\n #select\r\n bindLabel=\"fileName\"\r\n (search)=\"onSearchChanged($event)\"\r\n [loading]=\"loading\"\r\n [loadingText]=\"'\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u044E \u0444\u0430\u0439\u043B\u044B'\"\r\n dropdownPosition=\"auto\"\r\n bindValue=\"fileId\"\r\n labelForId=\"fileName\"\r\n placeholder=\"\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0444\u0430\u0439\u043B\"\r\n [virtualScroll]=\"true\"\r\n formControlName=\"fileName\">\r\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\r\n <div>\r\n <img class=\"mx-auto d-block img-fluid\" [src]=\"getSrc(item.fileId)\"/>\r\n </div>\r\n <div>\r\n <span class=\"h5\">\u0424\u0430\u0439\u043B: </span>\r\n <span class=\"h5\" [ngOptionHighlight]=\"search\"><b>{{item.fileName}}</b></span>\r\n </div>\r\n <div>\r\n <small>\r\n <span>\r\n \u0418\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440 \u0444\u0430\u0439\u043B\u0430: <b>{{item.fileId}}</b>\r\n </span>\r\n </small>\r\n </div>\r\n </ng-template>\r\n </ng-select>\r\n </div>\r\n</form>\r\n\r\n<div>\r\n \u0418\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440 \u0444\u0430\u0439\u043B\u0430: {{fileId}}\r\n</div>\r\n", styles: [""] }]
418
+ }], ctorParameters: function () { return [{ type: i5$1.FormBuilder }, { type: FilesQueryService }]; }, propDecorators: { labelText: [{
419
+ type: Input
420
+ }], fileId: [{
421
+ type: Input
422
+ }, {
423
+ type: Output
424
+ }], onFileIdChanged: [{
425
+ type: Output
426
+ }] } });
427
+
428
+ class ImageEditorComponent {
429
+ constructor() {
430
+ this.hasImageError = false;
431
+ this.searchOrEdit = "search";
432
+ this.myForm = new FormGroup({
433
+ fileId: new FormControl()
434
+ });
435
+ this.onTagUpdated = new EventEmitter();
436
+ }
437
+ onErrorHandler() {
438
+ this.hasImageError = true;
439
+ }
440
+ getSrc() {
441
+ return ImageMethods.buildUrl(this.tag.attributes[FileImageTagDataConsts.FileIdAttrName]);
442
+ }
443
+ hasFileId() {
444
+ return this.tag.attributes.hasOwnProperty(FileImageTagDataConsts.FileIdAttrName) && !isNaN(this.tag.attributes[FileImageTagDataConsts.FileIdAttrName]);
445
+ }
446
+ onFileIdChanged(fileId) {
447
+ this.tag.attributes[FileImageTagDataConsts.FileIdAttrName] = fileId;
448
+ this.removeImageError();
449
+ }
450
+ removeImageError() {
451
+ this.hasImageError = false;
452
+ }
453
+ ngOnInit() {
454
+ }
455
+ }
456
+ ImageEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ImageEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
457
+ ImageEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: ImageEditorComponent, selector: "croco-html-image-editor", inputs: { tag: "tag" }, outputs: { onTagUpdated: "onTagUpdated" }, ngImport: i0, template: "<div>\r\n <div style=\"height: 10px;\">\r\n </div>\r\n \r\n <div *ngIf=\"hasImageError\" class=\"error-block\">\r\n \u0418\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u043E \u043F\u043E \u0443\u043A\u0430\u0437\u0430\u043D\u043D\u043E\u043C\u0443 \u0438\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440\u0443, \u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u0444\u0430\u0439\u043B \u043D\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0438\u043B\u0438 \u043E\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043D\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435.\r\n </div>\r\n\r\n <div *ngIf=\"hasFileId() && !hasImageError\">\r\n <img class=\"mx-auto d-block img-fluid\" [src]=\"getSrc()\" (error)=\"onErrorHandler()\"/>\r\n </div>\r\n\r\n <div *ngIf=\"!hasFileId()\">\r\n <h5>[\u0418\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u043D\u0435 \u0432\u044B\u0431\u0440\u0430\u043D\u043E]</h5>\r\n </div>\r\n</div>\r\n\r\n<div *ngIf=\"!tag.presentOrEdit\">\r\n <div style=\"height: 10px;\"></div>\r\n\r\n <div style=\"overflow-x:auto;\">\r\n <mat-button-toggle-group [(ngModel)]=\"searchOrEdit\">\r\n <mat-button-toggle value=\"search\">\r\n \u0418\u0441\u043A\u0430\u0442\u044C \u0444\u0430\u0439\u043B <mat-icon>search</mat-icon>\r\n </mat-button-toggle>\r\n <mat-button-toggle value=\"edit\">\r\n \u0423\u043A\u0430\u0437\u0430\u0442\u044C \u043F\u043E \u0438\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440\u0443 <mat-icon>settings</mat-icon>\r\n </mat-button-toggle>\r\n </mat-button-toggle-group>\r\n </div>\r\n \r\n\r\n <div style=\"height: 10px;\"></div>\r\n\r\n <div [hidden]=\"searchOrEdit !== 'search'\">\r\n <croco-html-file-id-select\r\n [labelText]=\"'\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0444\u0430\u0439\u043B'\"\r\n [(fileId)]=\"tag.attributes['file-id']\"\r\n (onFileIdChanged)=\"onFileIdChanged($event)\">\r\n </croco-html-file-id-select>\r\n </div>\r\n\r\n <div [hidden]=\"searchOrEdit !== 'edit'\">\r\n <form [formGroup]=\"myForm\">\r\n <mat-form-field class=\"w-100\">\r\n <input matInput placeholder=\"\u0418\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440 \u0444\u0430\u0439\u043B\u0430\" new-autocomplete=\"off\" autocomplete=\"off\"\r\n formControlName=\"fileId\" \r\n type=\"number\"\r\n [(ngModel)]=\"tag.attributes['file-id']\"\r\n (ngModelChange)=\"removeImageError()\">\r\n </mat-form-field>\r\n </form>\r\n </div>\r\n</div>", styles: [".error-block{background-color:#f32323;color:#fff;text-align:center;border-radius:10px;padding:10px}\n"], components: [{ type: i1$2.MatButtonToggle, selector: "mat-button-toggle", inputs: ["disableRipple", "aria-labelledby", "tabIndex", "appearance", "checked", "disabled", "id", "name", "aria-label", "value"], outputs: ["change"], exportAs: ["matButtonToggle"] }, { type: i2$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: FileIdSelectComponent, selector: "croco-html-file-id-select", inputs: ["labelText", "fileId"], outputs: ["fileId", "onFileIdChanged"] }, { type: i5.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }], directives: [{ type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$2.MatButtonToggleGroup, selector: "mat-button-toggle-group", inputs: ["appearance", "name", "vertical", "value", "multiple", "disabled"], outputs: ["valueChange", "change"], exportAs: ["matButtonToggleGroup"] }, { type: i5$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i5$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i5$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i5$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i5$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i5$1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { type: i5$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] });
458
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ImageEditorComponent, decorators: [{
459
+ type: Component,
460
+ args: [{ selector: 'croco-html-image-editor', template: "<div>\r\n <div style=\"height: 10px;\">\r\n </div>\r\n \r\n <div *ngIf=\"hasImageError\" class=\"error-block\">\r\n \u0418\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u043E \u043F\u043E \u0443\u043A\u0430\u0437\u0430\u043D\u043D\u043E\u043C\u0443 \u0438\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440\u0443, \u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u0444\u0430\u0439\u043B \u043D\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0438\u043B\u0438 \u043E\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043D\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435.\r\n </div>\r\n\r\n <div *ngIf=\"hasFileId() && !hasImageError\">\r\n <img class=\"mx-auto d-block img-fluid\" [src]=\"getSrc()\" (error)=\"onErrorHandler()\"/>\r\n </div>\r\n\r\n <div *ngIf=\"!hasFileId()\">\r\n <h5>[\u0418\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u043D\u0435 \u0432\u044B\u0431\u0440\u0430\u043D\u043E]</h5>\r\n </div>\r\n</div>\r\n\r\n<div *ngIf=\"!tag.presentOrEdit\">\r\n <div style=\"height: 10px;\"></div>\r\n\r\n <div style=\"overflow-x:auto;\">\r\n <mat-button-toggle-group [(ngModel)]=\"searchOrEdit\">\r\n <mat-button-toggle value=\"search\">\r\n \u0418\u0441\u043A\u0430\u0442\u044C \u0444\u0430\u0439\u043B <mat-icon>search</mat-icon>\r\n </mat-button-toggle>\r\n <mat-button-toggle value=\"edit\">\r\n \u0423\u043A\u0430\u0437\u0430\u0442\u044C \u043F\u043E \u0438\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440\u0443 <mat-icon>settings</mat-icon>\r\n </mat-button-toggle>\r\n </mat-button-toggle-group>\r\n </div>\r\n \r\n\r\n <div style=\"height: 10px;\"></div>\r\n\r\n <div [hidden]=\"searchOrEdit !== 'search'\">\r\n <croco-html-file-id-select\r\n [labelText]=\"'\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0444\u0430\u0439\u043B'\"\r\n [(fileId)]=\"tag.attributes['file-id']\"\r\n (onFileIdChanged)=\"onFileIdChanged($event)\">\r\n </croco-html-file-id-select>\r\n </div>\r\n\r\n <div [hidden]=\"searchOrEdit !== 'edit'\">\r\n <form [formGroup]=\"myForm\">\r\n <mat-form-field class=\"w-100\">\r\n <input matInput placeholder=\"\u0418\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440 \u0444\u0430\u0439\u043B\u0430\" new-autocomplete=\"off\" autocomplete=\"off\"\r\n formControlName=\"fileId\" \r\n type=\"number\"\r\n [(ngModel)]=\"tag.attributes['file-id']\"\r\n (ngModelChange)=\"removeImageError()\">\r\n </mat-form-field>\r\n </form>\r\n </div>\r\n</div>", styles: [".error-block{background-color:#f32323;color:#fff;text-align:center;border-radius:10px;padding:10px}\n"] }]
461
+ }], ctorParameters: function () { return []; }, propDecorators: { tag: [{
462
+ type: Input
463
+ }], onTagUpdated: [{
464
+ type: Output
465
+ }] } });
466
+
467
+ class AngularMaterialTableMethods {
468
+ static getAngularMaterialTableData(columns, rows) {
469
+ let data = [];
470
+ for (let rowIndex = 0; rowIndex < rows.length; rowIndex++) {
471
+ const row = rows[rowIndex];
472
+ var elem = {};
473
+ for (let columnIndex = 0; columnIndex < columns.length; columnIndex++) {
474
+ const column = columns[columnIndex];
475
+ elem[column] = row.columns[columnIndex].data.text;
476
+ }
477
+ data.push(elem);
478
+ }
479
+ return {
480
+ displayedColumns: columns,
481
+ data: data,
482
+ };
483
+ }
484
+ static checkHeaders(tableData) {
485
+ if (tableData.header === null) {
486
+ return {
487
+ isSucceeded: false,
488
+ message: "Необходимо указать заголовок таблицы"
489
+ };
490
+ }
491
+ let columns = tableData.header.columns;
492
+ var uniqueDislayedColumns = columns.filter((v, i, a) => a.indexOf(v) === i);
493
+ if (uniqueDislayedColumns.length !== columns.length) {
494
+ return {
495
+ isSucceeded: false,
496
+ message: "Ошибка при обработке разметки таблицы. Обнаружены дубликаты заголовков."
497
+ };
498
+ }
499
+ return {
500
+ isSucceeded: true,
501
+ message: "Ok"
502
+ };
503
+ }
504
+ static checkAngularMaterialTableData(tableData, checkHeaders = true) {
505
+ if (checkHeaders) {
506
+ var checkHeadersResult = this.checkHeaders(tableData);
507
+ if (!checkHeadersResult.isSucceeded) {
508
+ return checkHeadersResult;
509
+ }
510
+ }
511
+ let rows = tableData.rows;
512
+ let columns = tableData.header.columns;
513
+ for (let i = 0; i < rows.length; i++) {
514
+ const row = rows[i];
515
+ if (row.columns.length !== columns.length) {
516
+ return {
517
+ isSucceeded: false,
518
+ message: `Ошибка при обработке разметки таблицы. `
519
+ + `Количество колонок в каждой строке таблицы должно соотвествовать количеству колонок указанных в заголовке. `
520
+ + `В строке таблицы №${i + 1} количество колонок = ${row.columns.length}, а должно быть ${columns.length}.`
521
+ };
522
+ }
523
+ }
524
+ return {
525
+ isSucceeded: true,
526
+ message: "Ok"
527
+ };
528
+ }
529
+ }
530
+
531
+ const TextTag = "text";
532
+ class TextSimpleMethods {
533
+ static ExtractTextTag(elem) {
534
+ var _a;
535
+ var hAlignValue = (_a = elem.getAttribute("h-align")) !== null && _a !== void 0 ? _a : "left";
536
+ var data = {
537
+ textTagName: elem.tagName.toLowerCase(),
538
+ text: elem.innerText.trim().replace('\n\t', ''),
539
+ html: elem.innerHTML.trim().replace('\n\t', ''),
540
+ horizontalAlignment: hAlignValue,
541
+ validationResult: {
542
+ isSucceeded: true,
543
+ message: "Ok"
544
+ }
545
+ };
546
+ let result = {
547
+ type: TextTag,
548
+ data: data
549
+ };
550
+ if (result.data.text === '\n') {
551
+ result.data.text = '';
552
+ }
553
+ if (result.data.html === '\n') {
554
+ result.data.html = '';
555
+ }
556
+ var alignmentVals = ["left", "right", "center"];
557
+ if (alignmentVals.indexOf(hAlignValue) < 0) {
558
+ result.data.validationResult = {
559
+ isSucceeded: false,
560
+ message: `Недопустимое значение атрибута h-align. Допустимые значения: ${alignmentVals.join(', ')}. `
561
+ + 'Данный тег можно не указывать, по-умолчанию будет применено выравнивание слева.'
562
+ };
563
+ }
564
+ var html = result.data.html;
565
+ var htmlValidation = this.ValidateTextHtml(html);
566
+ if (!htmlValidation.isSucceeded) {
567
+ result.data.validationResult = htmlValidation;
568
+ }
569
+ return result;
570
+ }
571
+ static ValidateTextHtml(html) {
572
+ var p = document.createElement("p");
573
+ p.innerHTML = html;
574
+ for (let i = 0; i < p.children.length; i++) {
575
+ const element = p.children.item(i);
576
+ var validationResult = this.ValidateTag(element);
577
+ if (!validationResult.isSucceeded) {
578
+ return validationResult;
579
+ }
580
+ }
581
+ return {
582
+ isSucceeded: true,
583
+ message: `Ok`
584
+ };
585
+ }
586
+ static ValidateTag(element) {
587
+ let lowerTag = element.tagName.toLowerCase();
588
+ if (!this.supportedTags.includes(lowerTag)) {
589
+ return {
590
+ isSucceeded: false,
591
+ message: `Тег <${lowerTag}> не поддерживается внутри тега <text>`
592
+ };
593
+ }
594
+ for (let i = 0; i < element.children.length; i++) {
595
+ const nElement = element.children.item(i);
596
+ var innerValidationResult = this.ValidateTag(nElement);
597
+ if (!innerValidationResult.isSucceeded) {
598
+ return innerValidationResult;
599
+ }
600
+ }
601
+ return {
602
+ isSucceeded: true,
603
+ message: "Ok"
604
+ };
605
+ }
606
+ }
607
+ TextSimpleMethods.supportedTags = ["sup", "sub", "strong", "b", "i"];
608
+
609
+ class BootstrapTableMethods {
610
+ static BuildTable(data) {
611
+ let result = `<table class="table table-bordered">`;
612
+ result += this.BuildHeader(data.header);
613
+ result += this.BuildBody(data.rows);
614
+ result += "</table>";
615
+ return result;
616
+ }
617
+ static BuildHeader(data) {
618
+ if (data === null) {
619
+ return "";
620
+ }
621
+ let result = "<thead>";
622
+ result += "<tr>";
623
+ for (let index = 0; index < data.columns.length; index++) {
624
+ result += `<th>${data.columns[index]}</th>`;
625
+ }
626
+ result += "</tr>";
627
+ result += "</thead>";
628
+ return result;
629
+ }
630
+ static BuildBody(rows) {
631
+ let result = "<tbody>";
632
+ for (let i = 0; i < rows.length; i++) {
633
+ const row = rows[i];
634
+ result += "<tr>";
635
+ for (let j = 0; j < row.columns.length; j++) {
636
+ const col = row.columns[j];
637
+ result += `<td class="align-middle">${this.BuildInnerTags(col.data.children)}</td>`;
638
+ }
639
+ result += "</tr>";
640
+ }
641
+ result += "</tbody>";
642
+ return result;
643
+ }
644
+ static BuildInnerTags(tags) {
645
+ let result = "";
646
+ for (let i = 0; i < tags.length; i++) {
647
+ result += this.BuildInnerTag(tags[i]);
648
+ }
649
+ return result;
650
+ }
651
+ static BuildInnerTag(data) {
652
+ if (data.type === FileImageTagDataConsts.TagName) {
653
+ let fileImageTag = data;
654
+ return `<img src=${fileImageTag.data.src} class="mx-auto d-block img-fluid" />`;
655
+ }
656
+ else if (data.type === TextTag) {
657
+ let simpleTextTag = data;
658
+ var map = {
659
+ ["left"]: "text-start",
660
+ ["center"]: "text-center",
661
+ ["right"]: "text-end"
662
+ };
663
+ if (!simpleTextTag.data.validationResult.isSucceeded) {
664
+ return `<span>Ошибка в тексте ${simpleTextTag.data.validationResult.message}</span>`;
665
+ }
666
+ return `<div class="${map[simpleTextTag.data.horizontalAlignment]}"><span>${simpleTextTag.data.html}</span></div>`;
667
+ }
668
+ else {
669
+ return `<p>Тег ${data.type} не поддерживается</p>`;
670
+ }
671
+ }
672
+ }
673
+
674
+ class TableTypes {
675
+ }
676
+ TableTypes.TableRowColumnData = "table-row-column-data";
677
+ TableTypes.Table = "table";
678
+ TableTypes.TableRowColumn = "table-row-column";
679
+ class TableMethods {
680
+ static getTableFromHtmlTag(tableTag) {
681
+ let tableData = {
682
+ header: TableMethods.getHeader(tableTag),
683
+ rows: TableMethods.getTableRows(tableTag)
684
+ };
685
+ var result = {
686
+ type: TableTypes.Table,
687
+ data: tableData,
688
+ validationResult: this.checkTable(tableData),
689
+ bootstrapHtml: ""
690
+ };
691
+ if (!result.validationResult) {
692
+ return result;
693
+ }
694
+ result.bootstrapHtml = BootstrapTableMethods.BuildTable(result.data);
695
+ var angularMaterialTableDataCheck = AngularMaterialTableMethods.checkAngularMaterialTableData(tableData);
696
+ if (!angularMaterialTableDataCheck.isSucceeded) {
697
+ return Object.assign(Object.assign({}, result), { angularMaterialTableDataCheck });
698
+ }
699
+ return Object.assign(Object.assign({}, result), { angularMaterialTableDataCheck, html: tableTag.outerHTML, angularMaterialTableData: AngularMaterialTableMethods.getAngularMaterialTableData(tableData.header.columns, tableData.rows) });
700
+ }
701
+ static checkTable(tableData) {
702
+ let rows = tableData.rows;
703
+ let prevRowCount = -1;
704
+ for (let i = 0; i < rows.length; i++) {
705
+ const row = rows[i];
706
+ if (row.columns.length !== prevRowCount && prevRowCount != -1) {
707
+ return {
708
+ isSucceeded: false,
709
+ message: `Ошибка при обработке разметки таблицы. `
710
+ + `Количество колонок в каждой строке таблицы должно соотвествовать друг другу. `
711
+ + `В строке таблицы №${i + 1} количество колонок = ${row.columns.length}, а в строке выше ${prevRowCount}.`
712
+ };
713
+ }
714
+ prevRowCount = row.columns.length;
715
+ }
716
+ return {
717
+ isSucceeded: true,
718
+ message: "Ok"
719
+ };
720
+ }
721
+ static getHeader(tableTag) {
722
+ let header = tableTag.tHead;
723
+ if (header === null) {
724
+ return null;
725
+ }
726
+ let tr = header.children.item(0);
727
+ let headerColumns = [];
728
+ for (let j = 0; j < tr.children.length; j++) {
729
+ const jElement = tr.children.item(j);
730
+ headerColumns.push(jElement.innerHTML);
731
+ }
732
+ return {
733
+ type: "table-header",
734
+ columns: headerColumns
735
+ };
736
+ }
737
+ static getTableRows(tableTag) {
738
+ let tBody = tableTag.tBodies.item(0);
739
+ let rows = [];
740
+ for (let i = 0; i < tBody.children.length; i++) {
741
+ const iElement = tBody.children.item(i);
742
+ let rowColumns = [];
743
+ for (let j = 0; j < iElement.children.length; j++) {
744
+ const jElement = iElement.children.item(j);
745
+ let children = HtmlExtractionMethods.transformHtmlElementToBlocks(jElement);
746
+ if (children.length === 0) {
747
+ var textTag = document.createElement("p");
748
+ textTag.innerHTML = jElement.innerHTML;
749
+ var textElem = TextSimpleMethods.ExtractTextTag(textTag);
750
+ children.push(textElem);
751
+ }
752
+ var result = {
753
+ type: TableTypes.TableRowColumnData,
754
+ data: {
755
+ text: jElement.innerHTML,
756
+ children
757
+ }
758
+ };
759
+ rowColumns.push(result);
760
+ }
761
+ rows.push({
762
+ type: TableTypes.TableRowColumn,
763
+ columns: rowColumns
764
+ });
765
+ }
766
+ return rows;
767
+ }
768
+ }
769
+
770
+ class TextMethods {
771
+ static ExtractRichTextData(elem) {
772
+ let children = [];
773
+ for (let i = 0; i < elem.children.length; i++) {
774
+ const child = elem.children.item(i);
775
+ if (child.tagName === "text-block".toUpperCase()) {
776
+ children.push({
777
+ type: "text-block",
778
+ data: {
779
+ text: child.innerHTML
780
+ }
781
+ });
782
+ }
783
+ else if (child.tagName === "line-break".toUpperCase()) {
784
+ children.push({
785
+ type: "line-break"
786
+ });
787
+ }
788
+ }
789
+ return {
790
+ type: "rich-text",
791
+ data: {
792
+ children
793
+ }
794
+ };
795
+ }
796
+ }
797
+ TextMethods.textTags = ["text", "h1", "h2", "h3", "h4", "h5", "h6"];
798
+
799
+ class HtmlExtractionMethods {
800
+ static ExtractHeaderTag(elem, tagName) {
801
+ var data = TextSimpleMethods.ExtractTextTag(elem);
802
+ data.type = tagName;
803
+ return data;
804
+ }
805
+ static transformHtmlElementToBlocks(element) {
806
+ var data = [];
807
+ for (let i = 0; i < element.children.length; i++) {
808
+ var elem = element.children.item(i);
809
+ if (!HtmlExtractionMethods.Extractors.hasOwnProperty(elem.tagName)) {
810
+ data.push({
811
+ type: "unsupported-tag",
812
+ data: {
813
+ tagString: elem.outerHTML
814
+ }
815
+ });
816
+ }
817
+ else {
818
+ var extractor = HtmlExtractionMethods.Extractors[elem.tagName];
819
+ var result = extractor(elem);
820
+ data.push(result);
821
+ }
822
+ }
823
+ return data;
824
+ }
825
+ static transformHtmlStringToBlocks(value) {
826
+ if (value === undefined) {
827
+ return [];
828
+ }
829
+ value = value
830
+ .replace('\n', '')
831
+ .replace('\t', '');
832
+ var div = document.createElement("div");
833
+ div.innerHTML = value;
834
+ return this.transformHtmlElementToBlocks(div);
835
+ }
836
+ }
837
+ HtmlExtractionMethods.Extractors = {
838
+ ["TEXT"]: (elem) => TextSimpleMethods.ExtractTextTag(elem),
839
+ ["FILE-IMAGE"]: (elem) => ImageMethods.ExtractImage(elem),
840
+ ["TABLE"]: (elem) => TableMethods.getTableFromHtmlTag(elem),
841
+ ["RICH-TEXT"]: (elem) => TextMethods.ExtractRichTextData(elem),
842
+ ["HTML-RAW"]: (elem) => ({
843
+ type: "html-raw",
844
+ data: {
845
+ innerHTML: elem.innerHTML
846
+ }
847
+ }),
848
+ ["H1"]: (elem) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h1"),
849
+ ["H2"]: (elem) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h2"),
850
+ ["H3"]: (elem) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h3"),
851
+ ["H4"]: (elem) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h4"),
852
+ ["H5"]: (elem) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h5"),
853
+ ["H6"]: (elem) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h6"),
854
+ [ExternalVideoTagDataConsts.TagName.toUpperCase()]: (elem) => VideoMethods.ExtractExternalVideoTag(elem)
855
+ };
856
+
857
+ class HtmlRawTagDataConsts {
858
+ }
859
+ HtmlRawTagDataConsts.TagName = "html-raw";
860
+
861
+ class BodyTagsExtensions {
862
+ static getDescription(tagName) {
863
+ var descriptions = {
864
+ "text": "Текст",
865
+ "h1": "Заголовок 1 уровня",
866
+ "h2": "Заголовок 2 уровня",
867
+ "h3": "Заголовок 3 уровня",
868
+ "h4": "Заголовок 4 уровня",
869
+ "h5": "Заголовок 5 уровня",
870
+ "h6": "Заголовок 6 уровня",
871
+ [FileImageTagDataConsts.TagName]: "Изображение",
872
+ [ExternalVideoTagDataConsts.TagName]: "Внешнее видео YouTube",
873
+ [HtmlRawTagDataConsts.TagName]: "Html разметка"
874
+ };
875
+ return descriptions[tagName];
876
+ }
877
+ static toHtml(bodyTags) {
878
+ let htmls = bodyTags.map(x => {
879
+ if (TextMethods.textTags.includes(x.tagDescription.tag)) {
880
+ return `<${x.tagDescription.tag} h-align="${x.attributes['h-align']}">${x.innerHtml}</${x.tagDescription.tag}>`;
881
+ }
882
+ if (x.tagDescription.tag === ExternalVideoTagDataConsts.TagName) {
883
+ return `<${x.tagDescription.tag} type="${x.attributes['type']}" link="${x.attributes['link']}">${x.innerHtml}</${x.tagDescription.tag}>`;
884
+ }
885
+ if (x.tagDescription.tag === "html-raw") {
886
+ return `<${x.tagDescription.tag}>${x.innerHtml}</${x.tagDescription.tag}>`;
887
+ }
888
+ return BodyTagsExtensions.imageTagToHtml(x);
889
+ });
890
+ let result = "";
891
+ for (let index = 0; index < htmls.length; index++) {
892
+ const element = htmls[index];
893
+ result += element;
894
+ }
895
+ return result;
896
+ }
897
+ static imageTagToHtml(imageTag) {
898
+ var attrStr = "";
899
+ var attrValue = imageTag.attributes[FileImageTagDataConsts.FileIdAttrName];
900
+ if (imageTag.attributes.hasOwnProperty(FileImageTagDataConsts.FileIdAttrName) && attrValue) {
901
+ attrStr = `${FileImageTagDataConsts.FileIdAttrName}="${attrValue}"`;
902
+ }
903
+ return `<${FileImageTagDataConsts.TagName} ${attrStr}></${FileImageTagDataConsts.TagName}>`;
904
+ }
905
+ static getBodyTags(html) {
906
+ let result = HtmlExtractionMethods.transformHtmlStringToBlocks(html);
907
+ return result.map(x => BodyTagsExtensions.toBodyTag(x));
908
+ }
909
+ static sanitizeInnerHtml(html) {
910
+ return html.trim().replace('\n\t', '');
911
+ }
912
+ static toBodyTag(data) {
913
+ if (TextMethods.textTags.includes(data.type)) {
914
+ let textTagData = data.data;
915
+ return {
916
+ presentOrEdit: true,
917
+ tagDescription: {
918
+ tag: textTagData.textTagName,
919
+ displayValue: BodyTagsExtensions.getDescription(data.type)
920
+ },
921
+ attributes: { "h-align": textTagData.horizontalAlignment },
922
+ innerHtml: BodyTagsExtensions.sanitizeInnerHtml(textTagData.html)
923
+ };
924
+ }
925
+ if (data.type === FileImageTagDataConsts.TagName) {
926
+ let fileData = data.data;
927
+ let atts = {};
928
+ if (fileData.fileId) {
929
+ atts[FileImageTagDataConsts.FileIdAttrName] = fileData.fileId;
930
+ }
931
+ return {
932
+ presentOrEdit: true,
933
+ tagDescription: {
934
+ tag: FileImageTagDataConsts.TagName,
935
+ displayValue: BodyTagsExtensions.getDescription(data.type)
936
+ },
937
+ attributes: atts,
938
+ innerHtml: ""
939
+ };
940
+ }
941
+ if (data.type === ExternalVideoTagDataConsts.TagName) {
942
+ let fileData = data.data;
943
+ return {
944
+ presentOrEdit: true,
945
+ tagDescription: {
946
+ tag: ExternalVideoTagDataConsts.TagName,
947
+ displayValue: BodyTagsExtensions.getDescription(data.type)
948
+ },
949
+ attributes: fileData,
950
+ innerHtml: ""
951
+ };
952
+ }
953
+ if (data.type === HtmlRawTagDataConsts.TagName) {
954
+ return {
955
+ presentOrEdit: true,
956
+ tagDescription: {
957
+ tag: HtmlRawTagDataConsts.TagName,
958
+ displayValue: BodyTagsExtensions.getDescription(data.type)
959
+ },
960
+ attributes: {},
961
+ innerHtml: BodyTagsExtensions.sanitizeInnerHtml(data.data["innerHTML"])
962
+ };
963
+ }
964
+ return {
965
+ presentOrEdit: true,
966
+ tagDescription: {
967
+ tag: "unsupported-tag",
968
+ displayValue: "Неподдерживаемый тег"
969
+ },
970
+ attributes: {},
971
+ innerHtml: JSON.stringify(data)
972
+ };
973
+ }
974
+ }
975
+
976
+ class XmlExtensions {
977
+ static formatXml(xml, tab = '\t') {
978
+ var formatted = '', indent = '';
979
+ tab = tab || '\t';
980
+ xml.split(/>\s*</).forEach(function (node) {
981
+ if (node.match(/^\/\w/))
982
+ indent = indent.substring(tab.length); // decrease indent by one 'tab'
983
+ formatted += indent + '<' + node + '>\r\n';
984
+ if (node.match(/^<?\w[^>]*[^\/]$/))
985
+ indent += tab; // increase indent
986
+ });
987
+ return formatted.substring(1, formatted.length - 3);
988
+ }
989
+ static tagsToLower(xml) {
990
+ xml = this.replaceTagToLower(xml, "Body");
991
+ xml = this.replaceTagToLower(xml, "Image");
992
+ xml = this.replaceTagToLower(xml, "Text");
993
+ return xml;
994
+ }
995
+ static replaceTagToLower(xml, tag) {
996
+ return xml
997
+ .replace(new RegExp(`<${tag}`, 'g'), `<${tag.toLowerCase()}`)
998
+ .replace(new RegExp(`</${tag}>`, 'g'), `</${tag.toLowerCase()}>`);
999
+ }
1000
+ }
1001
+
1002
+ class TextEditorComponent {
1003
+ constructor() {
1004
+ this.myForm = new FormGroup({
1005
+ "innerHtml": new FormControl()
1006
+ });
1007
+ this.onTagUpdated = new EventEmitter();
1008
+ }
1009
+ ngOnInit() {
1010
+ }
1011
+ getInnerHtml() {
1012
+ return `<${this.tag.tagDescription.tag}>${this.tag.innerHtml}<${this.tag.tagDescription.tag}/>`;
1013
+ }
1014
+ }
1015
+ TextEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TextEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1016
+ TextEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: TextEditorComponent, selector: "croco-html-text-editor", inputs: { tag: "tag" }, outputs: { onTagUpdated: "onTagUpdated" }, ngImport: i0, template: "<div *ngIf=\"tag.presentOrEdit\">\r\n <div style=\"height: 10px;\">\r\n </div>\r\n\r\n <div style=\"text-align: left;\" *ngIf=\"tag.attributes['h-align'] === 'left'\" [innerHtml]=\"getInnerHtml()\">\r\n </div>\r\n <div style=\"text-align: right;\" *ngIf=\"tag.attributes['h-align'] === 'right'\" [innerHtml]=\"getInnerHtml()\">\r\n </div>\r\n <div style=\"text-align: center;\" *ngIf=\"tag.attributes['h-align'] === 'center'\" [innerHtml]=\"getInnerHtml()\">\r\n </div>\r\n</div>\r\n\r\n<div *ngIf=\"!tag.presentOrEdit\">\r\n <div style=\"overflow-x: auto;\">\r\n <mat-button-toggle-group [(ngModel)]=\"tag.attributes['h-align']\">\r\n <mat-button-toggle value=\"center\">\r\n \u041F\u043E \u0446\u0435\u043D\u0442\u0440\u0443 <mat-icon>format_align_center</mat-icon>\r\n </mat-button-toggle>\r\n <mat-button-toggle value=\"left\">\r\n \u0421\u043B\u0435\u0432\u0430 <mat-icon>format_align_left</mat-icon>\r\n </mat-button-toggle>\r\n <mat-button-toggle value=\"right\">\r\n \u0421\u043F\u0440\u0430\u0432\u0430 <mat-icon> format_align_right</mat-icon>\r\n </mat-button-toggle>\r\n </mat-button-toggle-group>\r\n </div>\r\n\r\n <div style=\"height: 10px;\">\r\n </div>\r\n <form [formGroup]=\"myForm\">\r\n <mat-form-field class=\"w-100\">\r\n <textarea matInput cdkTextareaAutosize #autosize=\"cdkTextareaAutosize\"\r\n cdkAutosizeMinRows=\"1\"\r\n placeholder=\"\u0412\u043D\u0443\u0442\u0440\u0435\u043D\u043D\u044F\u044F \u0440\u0430\u0437\u043C\u0435\u0442\u043A\u0430 \u0442\u0435\u043A\u0441\u0442\u043E\u0432\u043E\u0433\u043E \u0442\u0435\u0433\u0430\"\r\n formControlName=\"innerHtml\"\r\n [(ngModel)]=\"tag.innerHtml\"></textarea>\r\n </mat-form-field>\r\n </form>\r\n</div>", styles: [""], components: [{ type: i1$2.MatButtonToggle, selector: "mat-button-toggle", inputs: ["disableRipple", "aria-labelledby", "tabIndex", "appearance", "checked", "disabled", "id", "name", "aria-label", "value"], outputs: ["change"], exportAs: ["matButtonToggle"] }, { type: i2$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i5.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }], directives: [{ type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$2.MatButtonToggleGroup, selector: "mat-button-toggle-group", inputs: ["appearance", "name", "vertical", "value", "multiple", "disabled"], outputs: ["valueChange", "change"], exportAs: ["matButtonToggleGroup"] }, { type: i5$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i5$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i5$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i5$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i4.CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }, { type: i5$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i5$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] });
1017
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TextEditorComponent, decorators: [{
1018
+ type: Component,
1019
+ args: [{ selector: 'croco-html-text-editor', template: "<div *ngIf=\"tag.presentOrEdit\">\r\n <div style=\"height: 10px;\">\r\n </div>\r\n\r\n <div style=\"text-align: left;\" *ngIf=\"tag.attributes['h-align'] === 'left'\" [innerHtml]=\"getInnerHtml()\">\r\n </div>\r\n <div style=\"text-align: right;\" *ngIf=\"tag.attributes['h-align'] === 'right'\" [innerHtml]=\"getInnerHtml()\">\r\n </div>\r\n <div style=\"text-align: center;\" *ngIf=\"tag.attributes['h-align'] === 'center'\" [innerHtml]=\"getInnerHtml()\">\r\n </div>\r\n</div>\r\n\r\n<div *ngIf=\"!tag.presentOrEdit\">\r\n <div style=\"overflow-x: auto;\">\r\n <mat-button-toggle-group [(ngModel)]=\"tag.attributes['h-align']\">\r\n <mat-button-toggle value=\"center\">\r\n \u041F\u043E \u0446\u0435\u043D\u0442\u0440\u0443 <mat-icon>format_align_center</mat-icon>\r\n </mat-button-toggle>\r\n <mat-button-toggle value=\"left\">\r\n \u0421\u043B\u0435\u0432\u0430 <mat-icon>format_align_left</mat-icon>\r\n </mat-button-toggle>\r\n <mat-button-toggle value=\"right\">\r\n \u0421\u043F\u0440\u0430\u0432\u0430 <mat-icon> format_align_right</mat-icon>\r\n </mat-button-toggle>\r\n </mat-button-toggle-group>\r\n </div>\r\n\r\n <div style=\"height: 10px;\">\r\n </div>\r\n <form [formGroup]=\"myForm\">\r\n <mat-form-field class=\"w-100\">\r\n <textarea matInput cdkTextareaAutosize #autosize=\"cdkTextareaAutosize\"\r\n cdkAutosizeMinRows=\"1\"\r\n placeholder=\"\u0412\u043D\u0443\u0442\u0440\u0435\u043D\u043D\u044F\u044F \u0440\u0430\u0437\u043C\u0435\u0442\u043A\u0430 \u0442\u0435\u043A\u0441\u0442\u043E\u0432\u043E\u0433\u043E \u0442\u0435\u0433\u0430\"\r\n formControlName=\"innerHtml\"\r\n [(ngModel)]=\"tag.innerHtml\"></textarea>\r\n </mat-form-field>\r\n </form>\r\n</div>", styles: [""] }]
1020
+ }], ctorParameters: function () { return []; }, propDecorators: { tag: [{
1021
+ type: Input
1022
+ }], onTagUpdated: [{
1023
+ type: Output
1024
+ }] } });
1025
+
1026
+ class MainEditorBlockComponent {
1027
+ constructor() {
1028
+ this.textTags = TextMethods.textTags;
1029
+ this.onTagSaved = new EventEmitter();
1030
+ this.onTagRemoved = new EventEmitter();
1031
+ }
1032
+ tagUpdatedHandler(tag) {
1033
+ }
1034
+ save() {
1035
+ this.tag.presentOrEdit = true;
1036
+ this.onTagSaved.emit(this.tag);
1037
+ }
1038
+ deleteItem() {
1039
+ this.onTagRemoved.emit(this.tag);
1040
+ }
1041
+ ngOnInit() {
1042
+ }
1043
+ }
1044
+ MainEditorBlockComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: MainEditorBlockComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1045
+ MainEditorBlockComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: MainEditorBlockComponent, selector: "croco-html-main-editor-block", inputs: { tag: "tag" }, outputs: { onTagSaved: "onTagSaved", onTagRemoved: "onTagRemoved" }, ngImport: i0, template: "<div>\r\n <div>\r\n <div *ngIf=\"textTags.includes(tag.tagDescription.tag)\">\r\n <croco-html-text-editor (onTagUpdated)=\"tagUpdatedHandler($event)\" [tag]=\"tag\">\r\n </croco-html-text-editor>\r\n </div>\r\n\r\n <div *ngIf=\"tag.tagDescription.tag === 'file-image'\"> \r\n <croco-html-image-editor (onTagUpdated)=\"tagUpdatedHandler($event)\" [tag]=\"tag\">\r\n </croco-html-image-editor>\r\n </div>\r\n\r\n <div *ngIf=\"tag.tagDescription.tag === 'external-video'\">\r\n <croco-html-external-video-block (onTagUpdated)=\"tagUpdatedHandler($event)\" [tag]=\"tag\">\r\n </croco-html-external-video-block>\r\n </div>\r\n\r\n <div *ngIf=\"tag.tagDescription.tag === 'html-raw'\">\r\n <croco-html-html-raw-editor (onTagUpdated)=\"tagUpdatedHandler($event)\" [tag]=\"tag\">\r\n </croco-html-html-raw-editor>\r\n </div>\r\n\r\n </div>\r\n\r\n <div class=\"d-flex justify-content-between\">\r\n <div class=\"d-flex justify-content-end align-self-center\">\r\n <div>\r\n <button *ngIf=\"tag.presentOrEdit\" (click)=\"tag.presentOrEdit = false\" mat-icon-button>\r\n <mat-icon>edit</mat-icon>\r\n </button>\r\n <button *ngIf=\"!tag.presentOrEdit\" (click)=\"save()\" mat-icon-button>\r\n <mat-icon>save</mat-icon>\r\n </button>\r\n <button (click)=\"deleteItem()\" mat-icon-button color=\"warn\">\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n </div>\r\n </div>\r\n\r\n </div>\r\n</div>", styles: [""], components: [{ type: TextEditorComponent, selector: "croco-html-text-editor", inputs: ["tag"], outputs: ["onTagUpdated"] }, { type: ImageEditorComponent, selector: "croco-html-image-editor", inputs: ["tag"], outputs: ["onTagUpdated"] }, { type: ExternalVideoBlockComponent, selector: "croco-html-external-video-block", inputs: ["tag"], outputs: ["onTagUpdated"] }, { type: HtmlRawEditorComponent, selector: "croco-html-html-raw-editor", inputs: ["tag"], outputs: ["onTagUpdated"] }, { type: i2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i2$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], directives: [{ type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
1046
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: MainEditorBlockComponent, decorators: [{
1047
+ type: Component,
1048
+ args: [{ selector: 'croco-html-main-editor-block', template: "<div>\r\n <div>\r\n <div *ngIf=\"textTags.includes(tag.tagDescription.tag)\">\r\n <croco-html-text-editor (onTagUpdated)=\"tagUpdatedHandler($event)\" [tag]=\"tag\">\r\n </croco-html-text-editor>\r\n </div>\r\n\r\n <div *ngIf=\"tag.tagDescription.tag === 'file-image'\"> \r\n <croco-html-image-editor (onTagUpdated)=\"tagUpdatedHandler($event)\" [tag]=\"tag\">\r\n </croco-html-image-editor>\r\n </div>\r\n\r\n <div *ngIf=\"tag.tagDescription.tag === 'external-video'\">\r\n <croco-html-external-video-block (onTagUpdated)=\"tagUpdatedHandler($event)\" [tag]=\"tag\">\r\n </croco-html-external-video-block>\r\n </div>\r\n\r\n <div *ngIf=\"tag.tagDescription.tag === 'html-raw'\">\r\n <croco-html-html-raw-editor (onTagUpdated)=\"tagUpdatedHandler($event)\" [tag]=\"tag\">\r\n </croco-html-html-raw-editor>\r\n </div>\r\n\r\n </div>\r\n\r\n <div class=\"d-flex justify-content-between\">\r\n <div class=\"d-flex justify-content-end align-self-center\">\r\n <div>\r\n <button *ngIf=\"tag.presentOrEdit\" (click)=\"tag.presentOrEdit = false\" mat-icon-button>\r\n <mat-icon>edit</mat-icon>\r\n </button>\r\n <button *ngIf=\"!tag.presentOrEdit\" (click)=\"save()\" mat-icon-button>\r\n <mat-icon>save</mat-icon>\r\n </button>\r\n <button (click)=\"deleteItem()\" mat-icon-button color=\"warn\">\r\n <mat-icon>delete</mat-icon>\r\n </button>\r\n </div>\r\n </div>\r\n\r\n </div>\r\n</div>", styles: [""] }]
1049
+ }], ctorParameters: function () { return []; }, propDecorators: { tag: [{
1050
+ type: Input
1051
+ }], onTagSaved: [{
1052
+ type: Output
1053
+ }], onTagRemoved: [{
1054
+ type: Output
1055
+ }] } });
1056
+
1057
+ class DefaultTags {
1058
+ static getTags(useHtmlRaw) {
1059
+ var result = [...DefaultTags.tags];
1060
+ if (useHtmlRaw) {
1061
+ result.push(DefaultTags.htmlRawTag);
1062
+ }
1063
+ return result;
1064
+ }
1065
+ }
1066
+ DefaultTags.tags = [
1067
+ { tag: FileImageTagDataConsts.TagName, displayValue: 'Изображение' },
1068
+ { tag: ExternalVideoTagDataConsts.TagName, displayValue: 'Внешнее видео Youtube' },
1069
+ { tag: 'text', displayValue: 'Текст' },
1070
+ { tag: 'h1', displayValue: 'Заголовок 1 уровня' },
1071
+ { tag: 'h2', displayValue: 'Заголовок 2 уровня' },
1072
+ { tag: 'h3', displayValue: 'Заголовок 3 уровня' },
1073
+ { tag: 'h4', displayValue: 'Заголовок 4 уровня' },
1074
+ { tag: 'h5', displayValue: 'Заголовок 5 уровня' },
1075
+ { tag: 'h6', displayValue: 'Заголовок 6 уровня' },
1076
+ ];
1077
+ DefaultTags.htmlRawTag = {
1078
+ tag: HtmlRawTagDataConsts.TagName, displayValue: 'Html разметка'
1079
+ };
1080
+ class VisualEditorComponent {
1081
+ constructor(_cdref) {
1082
+ this._cdref = _cdref;
1083
+ this.isLoading = false;
1084
+ this.loadingText = "Идёт загрузка";
1085
+ this.showMarkUp = true;
1086
+ this.myForm = new FormGroup({
1087
+ "html": new FormControl(),
1088
+ });
1089
+ this.tags = [];
1090
+ this.useHtmlRaw = false;
1091
+ this.html = "";
1092
+ this.onHtmlChanged = new EventEmitter();
1093
+ this.rendered = new EventEmitter();
1094
+ this.bodyTags = [];
1095
+ }
1096
+ isHtmlSet() {
1097
+ return this.html.startsWith("<body>");
1098
+ }
1099
+ clearHtml() {
1100
+ this.html = "";
1101
+ this.recalculateBodyTags();
1102
+ }
1103
+ getHtml() {
1104
+ this.recalculateHtml();
1105
+ return this.html;
1106
+ }
1107
+ ngAfterViewInit() {
1108
+ this.rendered.emit(true);
1109
+ }
1110
+ ngAfterContentChecked() {
1111
+ this._cdref.detectChanges();
1112
+ }
1113
+ addTag() {
1114
+ let tagDescription = this.tags
1115
+ .find(x => x.tag === this.selectedValue);
1116
+ let attrs = {};
1117
+ let innerHtml = "";
1118
+ if (TextMethods.textTags.includes(tagDescription.tag)) {
1119
+ attrs["h-align"] = "left";
1120
+ innerHtml = "Введите ваш текст";
1121
+ }
1122
+ else if (tagDescription.tag == ExternalVideoTagDataConsts.TagName) {
1123
+ attrs[ExternalVideoTagDataConsts.VideoTypeAttrName] = ExternalVideoSupportedTypes.Youtube;
1124
+ attrs[ExternalVideoTagDataConsts.LinkAttrName] = null;
1125
+ }
1126
+ else {
1127
+ attrs[FileImageTagDataConsts.FileIdAttrName] = null;
1128
+ }
1129
+ this.bodyTags.push({
1130
+ tagDescription,
1131
+ innerHtml,
1132
+ attributes: attrs,
1133
+ presentOrEdit: true
1134
+ });
1135
+ this.recalculateHtml();
1136
+ }
1137
+ postFilesStartedEventHandler(model) {
1138
+ this.loadingText = "Файлы загружаются на сервер";
1139
+ this.isLoading = true;
1140
+ }
1141
+ addTagCustom(tag) {
1142
+ this.bodyTags.push(tag);
1143
+ this.recalculateHtml();
1144
+ }
1145
+ filesTagsReadyHandler(tags) {
1146
+ for (let i = 0; i < tags.length; i++) {
1147
+ this.bodyTags.push(tags[i]);
1148
+ }
1149
+ this.recalculateHtml();
1150
+ this.isLoading = false;
1151
+ }
1152
+ drop(event) {
1153
+ moveItemInArray(this.bodyTags, event.previousIndex, event.currentIndex);
1154
+ this.recalculateHtml();
1155
+ }
1156
+ onTagSavedHandler(tag) {
1157
+ this.recalculateHtml();
1158
+ }
1159
+ onTagRemovedHandler(index) {
1160
+ this.bodyTags.splice(index, 1);
1161
+ this.recalculateHtml();
1162
+ }
1163
+ recalculateHtml() {
1164
+ let result = BodyTagsExtensions.toHtml(this.bodyTags);
1165
+ this.html = XmlExtensions.formatXml("<body>" + result + "</body>");
1166
+ this.onHtmlChanged.emit(this.html);
1167
+ }
1168
+ recalculateBodyTags() {
1169
+ this.bodyTags = BodyTagsExtensions.getBodyTags(this.html);
1170
+ }
1171
+ ngOnInit() {
1172
+ this.recalculateBodyTags();
1173
+ this.tags = DefaultTags.getTags(this.useHtmlRaw);
1174
+ this.selectedValue = this.tags[0].tag;
1175
+ }
1176
+ }
1177
+ VisualEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: VisualEditorComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1178
+ VisualEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: VisualEditorComponent, selector: "croco-visual-editor", inputs: { showMarkUp: "showMarkUp", useHtmlRaw: "useHtmlRaw", html: "html" }, outputs: { html: "html", onHtmlChanged: "onHtmlChanged", rendered: "rendered" }, ngImport: i0, template: "<div *ngIf=\"isLoading\">\r\n <div>\r\n <mat-spinner style=\"margin:0 auto;\"></mat-spinner>\r\n <div style=\"text-align: center;\">{{loadingText}}</div>\r\n </div>\r\n <div style=\"height: 10px;\"></div>\r\n</div>\r\n\r\n<div [hidden]=\"isLoading\">\r\n <div cdkDropList (cdkDropListDropped)=\"drop($event)\">\r\n <div *ngFor=\"let tag of bodyTags; let i = index\" cdkDrag>\r\n <mat-card>\r\n <div class=\"d-flex justify-content-between\">\r\n <div class=\"example-handle\" cdkDragHandle>\r\n <svg width=\"24px\" fill=\"currentColor\" viewBox=\"0 0 24 24\">\r\n <path\r\n d=\"M10 9h4V6h3l-5-5-5 5h3v3zm-1 1H6V7l-5 5 5 5v-3h3v-4zm14 2l-5-5v3h-3v4h3v3l5-5zm-9 3h-4v3H7l5 5 5-5h-3v-3z\">\r\n </path>\r\n <path d=\"M0 0h24v24H0z\" fill=\"none\"></path>\r\n </svg>\r\n </div>\r\n <div>\r\n <mat-chip-list aria-label=\"Tag display value\">\r\n <mat-chip color=\"primary\" selected>{{tag.tagDescription.displayValue}}</mat-chip>\r\n </mat-chip-list>\r\n </div>\r\n </div>\r\n \r\n <div style=\"height: 15px;\"></div>\r\n \r\n <croco-html-main-editor-block [tag]=\"tag\" \r\n (onTagSaved)=\"onTagSavedHandler($event)\"\r\n (onTagRemoved)=\"onTagRemovedHandler(i)\">\r\n </croco-html-main-editor-block>\r\n </mat-card>\r\n \r\n <div style=\"height: 10px;\">\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n\r\n<div [hidden]=\"isLoading\">\r\n <mat-card>\r\n <div class=\"row d-flex align-items-center\">\r\n <div class=\"col-12\">\r\n <mat-form-field class=\"w-100\" appearance=\"fill\">\r\n <mat-label>\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0442\u0435\u0433</mat-label>\r\n <mat-select [(ngModel)]=\"selectedValue\">\r\n <mat-option *ngFor=\"let tag of tags\" [value]=\"tag.tag\">\r\n {{tag.displayValue}}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </div>\r\n <div class=\"col-12\">\r\n <button (click)=\"addTag()\" class=\"w-100\" mat-stroked-button>\r\n \u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0442\u0435\u0433\r\n </button>\r\n </div>\r\n </div>\r\n </mat-card>\r\n\r\n <div style=\"height: 10px;\">\r\n </div>\r\n</div>\r\n\r\n<div [hidden]=\"isLoading\">\r\n <mat-card>\r\n <div class=\"row d-flex align-items-center\">\r\n <div class=\"col-12\">\r\n <croco-add-files-btn \r\n (filesTagsReady)=\"filesTagsReadyHandler($event)\"\r\n (postFilesStarted)=\"postFilesStartedEventHandler($event)\"\r\n class=\"w-100\">\r\n </croco-add-files-btn>\r\n </div>\r\n </div>\r\n </mat-card>\r\n\r\n <div style=\"height: 10px;\">\r\n </div>\r\n</div>", styles: [".example-list{width:500px;max-width:100%;border:solid 1px #ccc;min-height:60px;display:block;background:white;border-radius:4px;overflow:hidden}.example-box{padding:20px 10px;border-bottom:solid 1px #ccc;color:#000000de;display:flex;flex-direction:row;align-items:center;justify-content:space-between;box-sizing:border-box;cursor:move;background:white;font-size:14px}.cdk-drag-preview{box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.example-box:last-child{border:none}.example-list.cdk-drop-list-dragging .example-box:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}\n"], components: [{ type: i1$3.MatSpinner, selector: "mat-spinner", inputs: ["color"] }, { type: i2$3.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { type: i3$1.MatChipList, selector: "mat-chip-list", inputs: ["aria-orientation", "multiple", "compareWith", "value", "required", "placeholder", "disabled", "selectable", "tabIndex", "errorStateMatcher"], outputs: ["change", "valueChange"], exportAs: ["matChipList"] }, { type: MainEditorBlockComponent, selector: "croco-html-main-editor-block", inputs: ["tag"], outputs: ["onTagSaved", "onTagRemoved"] }, { type: i5.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i6.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i7.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { type: i2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: AddFilesBtnComponent, selector: "croco-add-files-btn", outputs: ["postFilesStarted", "filesTagsReady"] }], directives: [{ type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i11.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i11.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { type: i11.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { type: i3$1.MatChip, selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", inputs: ["color", "disableRipple", "tabIndex", "selected", "value", "selectable", "disabled", "removable"], outputs: ["selectionChange", "destroyed", "removed"], exportAs: ["matChip"] }, { type: i5.MatLabel, selector: "mat-label" }, { type: i5$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
1179
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: VisualEditorComponent, decorators: [{
1180
+ type: Component,
1181
+ args: [{ selector: 'croco-visual-editor', template: "<div *ngIf=\"isLoading\">\r\n <div>\r\n <mat-spinner style=\"margin:0 auto;\"></mat-spinner>\r\n <div style=\"text-align: center;\">{{loadingText}}</div>\r\n </div>\r\n <div style=\"height: 10px;\"></div>\r\n</div>\r\n\r\n<div [hidden]=\"isLoading\">\r\n <div cdkDropList (cdkDropListDropped)=\"drop($event)\">\r\n <div *ngFor=\"let tag of bodyTags; let i = index\" cdkDrag>\r\n <mat-card>\r\n <div class=\"d-flex justify-content-between\">\r\n <div class=\"example-handle\" cdkDragHandle>\r\n <svg width=\"24px\" fill=\"currentColor\" viewBox=\"0 0 24 24\">\r\n <path\r\n d=\"M10 9h4V6h3l-5-5-5 5h3v3zm-1 1H6V7l-5 5 5 5v-3h3v-4zm14 2l-5-5v3h-3v4h3v3l5-5zm-9 3h-4v3H7l5 5 5-5h-3v-3z\">\r\n </path>\r\n <path d=\"M0 0h24v24H0z\" fill=\"none\"></path>\r\n </svg>\r\n </div>\r\n <div>\r\n <mat-chip-list aria-label=\"Tag display value\">\r\n <mat-chip color=\"primary\" selected>{{tag.tagDescription.displayValue}}</mat-chip>\r\n </mat-chip-list>\r\n </div>\r\n </div>\r\n \r\n <div style=\"height: 15px;\"></div>\r\n \r\n <croco-html-main-editor-block [tag]=\"tag\" \r\n (onTagSaved)=\"onTagSavedHandler($event)\"\r\n (onTagRemoved)=\"onTagRemovedHandler(i)\">\r\n </croco-html-main-editor-block>\r\n </mat-card>\r\n \r\n <div style=\"height: 10px;\">\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n\r\n<div [hidden]=\"isLoading\">\r\n <mat-card>\r\n <div class=\"row d-flex align-items-center\">\r\n <div class=\"col-12\">\r\n <mat-form-field class=\"w-100\" appearance=\"fill\">\r\n <mat-label>\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0442\u0435\u0433</mat-label>\r\n <mat-select [(ngModel)]=\"selectedValue\">\r\n <mat-option *ngFor=\"let tag of tags\" [value]=\"tag.tag\">\r\n {{tag.displayValue}}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </div>\r\n <div class=\"col-12\">\r\n <button (click)=\"addTag()\" class=\"w-100\" mat-stroked-button>\r\n \u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0442\u0435\u0433\r\n </button>\r\n </div>\r\n </div>\r\n </mat-card>\r\n\r\n <div style=\"height: 10px;\">\r\n </div>\r\n</div>\r\n\r\n<div [hidden]=\"isLoading\">\r\n <mat-card>\r\n <div class=\"row d-flex align-items-center\">\r\n <div class=\"col-12\">\r\n <croco-add-files-btn \r\n (filesTagsReady)=\"filesTagsReadyHandler($event)\"\r\n (postFilesStarted)=\"postFilesStartedEventHandler($event)\"\r\n class=\"w-100\">\r\n </croco-add-files-btn>\r\n </div>\r\n </div>\r\n </mat-card>\r\n\r\n <div style=\"height: 10px;\">\r\n </div>\r\n</div>", styles: [".example-list{width:500px;max-width:100%;border:solid 1px #ccc;min-height:60px;display:block;background:white;border-radius:4px;overflow:hidden}.example-box{padding:20px 10px;border-bottom:solid 1px #ccc;color:#000000de;display:flex;flex-direction:row;align-items:center;justify-content:space-between;box-sizing:border-box;cursor:move;background:white;font-size:14px}.cdk-drag-preview{box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.example-box:last-child{border:none}.example-list.cdk-drop-list-dragging .example-box:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}\n"] }]
1182
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { showMarkUp: [{
1183
+ type: Input
1184
+ }], useHtmlRaw: [{
1185
+ type: Input
1186
+ }], html: [{
1187
+ type: Input
1188
+ }, {
1189
+ type: Output
1190
+ }], onHtmlChanged: [{
1191
+ type: Output
1192
+ }], rendered: [{
1193
+ type: Output
1194
+ }] } });
1195
+
1196
+ class XmlTagTextViewComponent {
1197
+ constructor() { }
1198
+ ngOnInit() {
1199
+ }
1200
+ }
1201
+ XmlTagTextViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: XmlTagTextViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1202
+ XmlTagTextViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: XmlTagTextViewComponent, selector: "croco-html-xml-tag-text-view", inputs: { item: "item" }, ngImport: i0, template: "<div *ngIf=\"item.data.validationResult.isSucceeded && item.data.horizontalAlignment === 'left'\" style=\"text-align: left;\">\r\n <span *ngIf=\"item.data.html.length === 0 || !item.data.html\">&nbsp;</span>\r\n <span *ngIf=\"item.data.html.length > 0\" [innerHtml]=\"item.data.html\"></span>\r\n</div>\r\n\r\n<div *ngIf=\"item.data.validationResult.isSucceeded && item.data.horizontalAlignment === 'right'\" style=\"text-align: right;\">\r\n <span *ngIf=\"item.data.html.length === 0 || !item.data.html\">&nbsp;</span>\r\n <span *ngIf=\"item.data.html.length > 0\" [innerHtml]=\"item.data.html\"></span>\r\n</div>\r\n\r\n<div *ngIf=\"item.data.validationResult.isSucceeded && item.data.horizontalAlignment === 'center'\" style=\"text-align: center;\">\r\n <span *ngIf=\"item.data.html.length === 0 || !item.data.html\">&nbsp;</span>\r\n <span *ngIf=\"item.data.html.length > 0\" [innerHtml]=\"item.data.html\"></span>\r\n</div>\r\n\r\n<div *ngIf=\"!item.data.validationResult.isSucceeded\" class=\"red\" style=\"margin-top: 10px;\" >\r\n <h4>\u0414\u043E\u043F\u0443\u0449\u0435\u043D\u0430 \u043E\u0448\u0438\u0431\u043A\u0430 \u0432 \u0442\u0435\u0433\u0435 &lt;text&gt;</h4>\r\n <span>\r\n {{item.data.validationResult.message}}\r\n </span>\r\n</div>", styles: [""], directives: [{ type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
1203
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: XmlTagTextViewComponent, decorators: [{
1204
+ type: Component,
1205
+ args: [{ selector: 'croco-html-xml-tag-text-view', template: "<div *ngIf=\"item.data.validationResult.isSucceeded && item.data.horizontalAlignment === 'left'\" style=\"text-align: left;\">\r\n <span *ngIf=\"item.data.html.length === 0 || !item.data.html\">&nbsp;</span>\r\n <span *ngIf=\"item.data.html.length > 0\" [innerHtml]=\"item.data.html\"></span>\r\n</div>\r\n\r\n<div *ngIf=\"item.data.validationResult.isSucceeded && item.data.horizontalAlignment === 'right'\" style=\"text-align: right;\">\r\n <span *ngIf=\"item.data.html.length === 0 || !item.data.html\">&nbsp;</span>\r\n <span *ngIf=\"item.data.html.length > 0\" [innerHtml]=\"item.data.html\"></span>\r\n</div>\r\n\r\n<div *ngIf=\"item.data.validationResult.isSucceeded && item.data.horizontalAlignment === 'center'\" style=\"text-align: center;\">\r\n <span *ngIf=\"item.data.html.length === 0 || !item.data.html\">&nbsp;</span>\r\n <span *ngIf=\"item.data.html.length > 0\" [innerHtml]=\"item.data.html\"></span>\r\n</div>\r\n\r\n<div *ngIf=\"!item.data.validationResult.isSucceeded\" class=\"red\" style=\"margin-top: 10px;\" >\r\n <h4>\u0414\u043E\u043F\u0443\u0449\u0435\u043D\u0430 \u043E\u0448\u0438\u0431\u043A\u0430 \u0432 \u0442\u0435\u0433\u0435 &lt;text&gt;</h4>\r\n <span>\r\n {{item.data.validationResult.message}}\r\n </span>\r\n</div>", styles: [""] }]
1206
+ }], ctorParameters: function () { return []; }, propDecorators: { item: [{
1207
+ type: Input
1208
+ }] } });
1209
+
1210
+ class XmlTagHeaderInnerTextViewComponent {
1211
+ constructor() { }
1212
+ ngOnInit() {
1213
+ }
1214
+ }
1215
+ XmlTagHeaderInnerTextViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: XmlTagHeaderInnerTextViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1216
+ XmlTagHeaderInnerTextViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: XmlTagHeaderInnerTextViewComponent, selector: "croco-html-xml-tag-header-inner-text-view", inputs: { item: "item" }, ngImport: i0, template: "<h1 *ngIf=\"item.type === 'h1'\" \r\n [innerHtml]=\"item.data.html\">\r\n</h1>\r\n<h2 *ngIf=\"item.type === 'h2'\" \r\n [innerHtml]=\"item.data.html\">\r\n</h2>\r\n<h3 *ngIf=\"item.type === 'h3'\" \r\n [innerHtml]=\"item.data.html\">\r\n</h3>\r\n<h4 *ngIf=\"item.type === 'h4'\" \r\n [innerHtml]=\"item.data.html\">\r\n</h4>\r\n<h5 *ngIf=\"item.type === 'h5'\" \r\n [innerHtml]=\"item.data.html\">\r\n</h5>\r\n<h6 *ngIf=\"item.type === 'h6'\" \r\n [innerHtml]=\"item.data.html\">\r\n</h6>", styles: [""], directives: [{ type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
1217
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: XmlTagHeaderInnerTextViewComponent, decorators: [{
1218
+ type: Component,
1219
+ args: [{ selector: 'croco-html-xml-tag-header-inner-text-view', template: "<h1 *ngIf=\"item.type === 'h1'\" \r\n [innerHtml]=\"item.data.html\">\r\n</h1>\r\n<h2 *ngIf=\"item.type === 'h2'\" \r\n [innerHtml]=\"item.data.html\">\r\n</h2>\r\n<h3 *ngIf=\"item.type === 'h3'\" \r\n [innerHtml]=\"item.data.html\">\r\n</h3>\r\n<h4 *ngIf=\"item.type === 'h4'\" \r\n [innerHtml]=\"item.data.html\">\r\n</h4>\r\n<h5 *ngIf=\"item.type === 'h5'\" \r\n [innerHtml]=\"item.data.html\">\r\n</h5>\r\n<h6 *ngIf=\"item.type === 'h6'\" \r\n [innerHtml]=\"item.data.html\">\r\n</h6>", styles: [""] }]
1220
+ }], ctorParameters: function () { return []; }, propDecorators: { item: [{
1221
+ type: Input
1222
+ }] } });
1223
+
1224
+ class XmlTagHeaderTextViewComponent {
1225
+ constructor() { }
1226
+ ngOnInit() {
1227
+ }
1228
+ }
1229
+ XmlTagHeaderTextViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: XmlTagHeaderTextViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1230
+ XmlTagHeaderTextViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: XmlTagHeaderTextViewComponent, selector: "croco-html-xml-tag-header-text-view", inputs: { item: "item" }, ngImport: i0, template: "<div *ngIf=\"item.data.validationResult.isSucceeded && item.data.horizontalAlignment === 'left'\" style=\"text-align: left;\">\r\n <span *ngIf=\"item.data.html.length === 0 || !item.data.html\">&nbsp;</span>\r\n <croco-html-xml-tag-header-inner-text-view *ngIf=\"item.data.html.length > 0\" [item]=\"item\">\r\n </croco-html-xml-tag-header-inner-text-view>\r\n</div>\r\n\r\n<div *ngIf=\"item.data.validationResult.isSucceeded && item.data.horizontalAlignment === 'right'\" style=\"text-align: right;\">\r\n <span *ngIf=\"item.data.html.length === 0 || !item.data.html\">&nbsp;</span>\r\n <croco-html-xml-tag-header-inner-text-view *ngIf=\"item.data.html.length > 0\" [item]=\"item\">\r\n </croco-html-xml-tag-header-inner-text-view>\r\n</div>\r\n\r\n<div *ngIf=\"item.data.validationResult.isSucceeded && item.data.horizontalAlignment === 'center'\" style=\"text-align: center;\">\r\n <span *ngIf=\"item.data.html.length === 0 || !item.data.html\">&nbsp;</span>\r\n\r\n <croco-html-xml-tag-header-inner-text-view *ngIf=\"item.data.html.length > 0\" [item]=\"item\">\r\n </croco-html-xml-tag-header-inner-text-view>\r\n</div>\r\n\r\n<div *ngIf=\"!item.data.validationResult.isSucceeded\" class=\"red\" style=\"margin-top: 10px;\" >\r\n <h4>\u0414\u043E\u043F\u0443\u0449\u0435\u043D\u0430 \u043E\u0448\u0438\u0431\u043A\u0430 \u0432 \u0442\u0435\u0433\u0435 &lt;text&gt;</h4>\r\n <span>\r\n {{item.data.validationResult.message}}\r\n </span>\r\n</div>", styles: [""], components: [{ type: XmlTagHeaderInnerTextViewComponent, selector: "croco-html-xml-tag-header-inner-text-view", inputs: ["item"] }], directives: [{ type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
1231
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: XmlTagHeaderTextViewComponent, decorators: [{
1232
+ type: Component,
1233
+ args: [{ selector: 'croco-html-xml-tag-header-text-view', template: "<div *ngIf=\"item.data.validationResult.isSucceeded && item.data.horizontalAlignment === 'left'\" style=\"text-align: left;\">\r\n <span *ngIf=\"item.data.html.length === 0 || !item.data.html\">&nbsp;</span>\r\n <croco-html-xml-tag-header-inner-text-view *ngIf=\"item.data.html.length > 0\" [item]=\"item\">\r\n </croco-html-xml-tag-header-inner-text-view>\r\n</div>\r\n\r\n<div *ngIf=\"item.data.validationResult.isSucceeded && item.data.horizontalAlignment === 'right'\" style=\"text-align: right;\">\r\n <span *ngIf=\"item.data.html.length === 0 || !item.data.html\">&nbsp;</span>\r\n <croco-html-xml-tag-header-inner-text-view *ngIf=\"item.data.html.length > 0\" [item]=\"item\">\r\n </croco-html-xml-tag-header-inner-text-view>\r\n</div>\r\n\r\n<div *ngIf=\"item.data.validationResult.isSucceeded && item.data.horizontalAlignment === 'center'\" style=\"text-align: center;\">\r\n <span *ngIf=\"item.data.html.length === 0 || !item.data.html\">&nbsp;</span>\r\n\r\n <croco-html-xml-tag-header-inner-text-view *ngIf=\"item.data.html.length > 0\" [item]=\"item\">\r\n </croco-html-xml-tag-header-inner-text-view>\r\n</div>\r\n\r\n<div *ngIf=\"!item.data.validationResult.isSucceeded\" class=\"red\" style=\"margin-top: 10px;\" >\r\n <h4>\u0414\u043E\u043F\u0443\u0449\u0435\u043D\u0430 \u043E\u0448\u0438\u0431\u043A\u0430 \u0432 \u0442\u0435\u0433\u0435 &lt;text&gt;</h4>\r\n <span>\r\n {{item.data.validationResult.message}}\r\n </span>\r\n</div>", styles: [""] }]
1234
+ }], ctorParameters: function () { return []; }, propDecorators: { item: [{
1235
+ type: Input
1236
+ }] } });
1237
+
1238
+ class XmlTagHtmlViewComponent {
1239
+ constructor() {
1240
+ this.html = "";
1241
+ }
1242
+ }
1243
+ XmlTagHtmlViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: XmlTagHtmlViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1244
+ XmlTagHtmlViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: XmlTagHtmlViewComponent, selector: "croco-html-xml-tag-html-view", inputs: { html: "html" }, ngImport: i0, template: "<div class=\"col\" [innerHTML]=\"html\">\r\n \r\n</div>", styles: [""] });
1245
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: XmlTagHtmlViewComponent, decorators: [{
1246
+ type: Component,
1247
+ args: [{ selector: 'croco-html-xml-tag-html-view', template: "<div class=\"col\" [innerHTML]=\"html\">\r\n \r\n</div>", styles: [""] }]
1248
+ }], ctorParameters: function () { return []; }, propDecorators: { html: [{
1249
+ type: Input
1250
+ }] } });
1251
+
1252
+ class XmlTagViewComponent {
1253
+ constructor() {
1254
+ this.data = [];
1255
+ }
1256
+ }
1257
+ XmlTagViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: XmlTagViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1258
+ XmlTagViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", 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"], components: [{ type: XmlTagTextViewComponent, selector: "croco-html-xml-tag-text-view", inputs: ["item"] }, { type: XmlTagHeaderTextViewComponent, selector: "croco-html-xml-tag-header-text-view", inputs: ["item"] }, { type: XmlTagHtmlViewComponent, selector: "croco-html-xml-tag-html-view", inputs: ["html"] }, { type: XmlTagExternalVideoComponent, selector: "croco-html-xml-tag-external-video", inputs: ["data", "tagData"] }], directives: [{ type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], encapsulation: i0.ViewEncapsulation.None });
1259
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: XmlTagViewComponent, decorators: [{
1260
+ type: Component,
1261
+ 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"] }]
1262
+ }], ctorParameters: function () { return []; }, propDecorators: { data: [{
1263
+ type: Input
1264
+ }] } });
1265
+
1266
+ class ToPreviewPipe {
1267
+ transform(value) {
1268
+ return HtmlExtractionMethods.transformHtmlStringToBlocks(value);
1269
+ }
1270
+ }
1271
+ ToPreviewPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ToPreviewPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1272
+ ToPreviewPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ToPreviewPipe, name: "topreview" });
1273
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ToPreviewPipe, decorators: [{
1274
+ type: Pipe,
1275
+ args: [{
1276
+ name: 'topreview'
1277
+ }]
1278
+ }] });
1279
+
1280
+ class MainEditorComponent {
1281
+ constructor(_clipboardService, _snackBar, _cdref) {
1282
+ this._clipboardService = _clipboardService;
1283
+ this._snackBar = _snackBar;
1284
+ this._cdref = _cdref;
1285
+ this.visualEditorRendered = false;
1286
+ this.showMarkUp = true;
1287
+ this.useHtmlRaw = false;
1288
+ this.myForm = new FormGroup({
1289
+ "html": new FormControl(),
1290
+ });
1291
+ this.html = "";
1292
+ this.onHtmlChanged = new EventEmitter();
1293
+ }
1294
+ ngAfterContentChecked() {
1295
+ this._cdref.detectChanges();
1296
+ }
1297
+ visualEditorRenderedHandler() {
1298
+ this.visualEditorRendered = true;
1299
+ this.recalculateBodyTags();
1300
+ }
1301
+ onHtmlChangedHandler(html) {
1302
+ this.html = html;
1303
+ this.onHtmlChanged.emit(html);
1304
+ }
1305
+ textAreaModelChangedHandler() {
1306
+ this.recalculateBodyTags();
1307
+ this.onHtmlChangedHandler(this.html);
1308
+ }
1309
+ recalculateBodyTags() {
1310
+ this.visualEditor.html = this.html;
1311
+ this.visualEditor.recalculateBodyTags();
1312
+ }
1313
+ copyMarkUp() {
1314
+ this._snackBar.open("Разметка таблицы скопирована в буфер обмена", "Закрыть", { duration: 1500 });
1315
+ this._clipboardService.copy(this.html);
1316
+ }
1317
+ ngOnInit() {
1318
+ }
1319
+ }
1320
+ MainEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: MainEditorComponent, deps: [{ token: i1$4.ClipboardService }, { token: i2$4.MatSnackBar }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1321
+ MainEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: MainEditorComponent, selector: "croco-html-main-editor", inputs: { showMarkUp: "showMarkUp", useHtmlRaw: "useHtmlRaw", html: "html" }, outputs: { html: "html", onHtmlChanged: "onHtmlChanged" }, viewQueries: [{ propertyName: "visualEditor", first: true, predicate: ["visualEditor"], descendants: true }], ngImport: i0, template: "<mat-tab-group>\r\n <mat-tab label=\"\u0412\u0438\u0437\u0443\u0430\u043B\u044C\u043D\u044B\u0439 \u0440\u0435\u0434\u0430\u043A\u0442\u043E\u0440\">\r\n\r\n <div style=\"height: 20px;\"></div>\r\n\r\n <croco-visual-editor #visualEditor\r\n [useHtmlRaw]=\"useHtmlRaw\"\r\n [html]=\"html\"\r\n (onHtmlChanged)=\"onHtmlChangedHandler($event)\"\r\n (rendered)=\"visualEditorRenderedHandler()\">\r\n </croco-visual-editor>\r\n\r\n <div style=\"height: 20px;\"></div>\r\n\r\n </mat-tab>\r\n\r\n <mat-tab label=\"\u0420\u0430\u0437\u043C\u0435\u0442\u043A\u0430\">\r\n <div style=\"height: 10px;\"></div>\r\n <form *ngIf=\"visualEditorRendered\" [formGroup]=\"myForm\">\r\n <mat-form-field class=\"w-100\">\r\n <textarea matInput cdkTextareaAutosize #autosize=\"cdkTextareaAutosize\"\r\n cdkAutosizeMinRows=\"1\"\r\n placeholder=\"\u0418\u0441\u0445\u043E\u0434\u043D\u044B\u0439 \u043A\u043E\u0434\" formControlName=\"html\" [(ngModel)]=\"html\"\r\n (ngModelChange)=\"textAreaModelChangedHandler()\"></textarea>\r\n </mat-form-field>\r\n </form>\r\n\r\n <button (click)=\"copyMarkUp()\" \r\n mat-raised-button color=\"primary\">\r\n \u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0440\u0430\u0437\u043C\u0435\u0442\u043A\u0443\r\n </button>\r\n </mat-tab>\r\n <mat-tab label=\"\u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\">\r\n <mat-card>\r\n <croco-html-xml-tag-view [data]=\"html | topreview\">\r\n </croco-html-xml-tag-view>\r\n </mat-card>\r\n </mat-tab>\r\n</mat-tab-group>", styles: [".example-list{width:500px;max-width:100%;border:solid 1px #ccc;min-height:60px;display:block;background:white;border-radius:4px;overflow:hidden}.example-box{padding:20px 10px;border-bottom:solid 1px #ccc;color:#000000de;display:flex;flex-direction:row;align-items:center;justify-content:space-between;box-sizing:border-box;cursor:move;background:white;font-size:14px}.cdk-drag-preview{box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.example-box:last-child{border:none}.example-list.cdk-drop-list-dragging .example-box:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}\n"], components: [{ type: i3$2.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "disableRipple"], exportAs: ["matTabGroup"] }, { type: i3$2.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby"], exportAs: ["matTab"] }, { type: VisualEditorComponent, selector: "croco-visual-editor", inputs: ["showMarkUp", "useHtmlRaw", "html"], outputs: ["html", "onHtmlChanged", "rendered"] }, { type: i5.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i2$3.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { type: XmlTagViewComponent, selector: "croco-html-xml-tag-view", inputs: ["data"] }], directives: [{ type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i5$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i5$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i4.CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }, { type: i5$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i5$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }], pipes: { "topreview": ToPreviewPipe } });
1322
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: MainEditorComponent, decorators: [{
1323
+ type: Component,
1324
+ args: [{ selector: 'croco-html-main-editor', template: "<mat-tab-group>\r\n <mat-tab label=\"\u0412\u0438\u0437\u0443\u0430\u043B\u044C\u043D\u044B\u0439 \u0440\u0435\u0434\u0430\u043A\u0442\u043E\u0440\">\r\n\r\n <div style=\"height: 20px;\"></div>\r\n\r\n <croco-visual-editor #visualEditor\r\n [useHtmlRaw]=\"useHtmlRaw\"\r\n [html]=\"html\"\r\n (onHtmlChanged)=\"onHtmlChangedHandler($event)\"\r\n (rendered)=\"visualEditorRenderedHandler()\">\r\n </croco-visual-editor>\r\n\r\n <div style=\"height: 20px;\"></div>\r\n\r\n </mat-tab>\r\n\r\n <mat-tab label=\"\u0420\u0430\u0437\u043C\u0435\u0442\u043A\u0430\">\r\n <div style=\"height: 10px;\"></div>\r\n <form *ngIf=\"visualEditorRendered\" [formGroup]=\"myForm\">\r\n <mat-form-field class=\"w-100\">\r\n <textarea matInput cdkTextareaAutosize #autosize=\"cdkTextareaAutosize\"\r\n cdkAutosizeMinRows=\"1\"\r\n placeholder=\"\u0418\u0441\u0445\u043E\u0434\u043D\u044B\u0439 \u043A\u043E\u0434\" formControlName=\"html\" [(ngModel)]=\"html\"\r\n (ngModelChange)=\"textAreaModelChangedHandler()\"></textarea>\r\n </mat-form-field>\r\n </form>\r\n\r\n <button (click)=\"copyMarkUp()\" \r\n mat-raised-button color=\"primary\">\r\n \u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0440\u0430\u0437\u043C\u0435\u0442\u043A\u0443\r\n </button>\r\n </mat-tab>\r\n <mat-tab label=\"\u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\">\r\n <mat-card>\r\n <croco-html-xml-tag-view [data]=\"html | topreview\">\r\n </croco-html-xml-tag-view>\r\n </mat-card>\r\n </mat-tab>\r\n</mat-tab-group>", styles: [".example-list{width:500px;max-width:100%;border:solid 1px #ccc;min-height:60px;display:block;background:white;border-radius:4px;overflow:hidden}.example-box{padding:20px 10px;border-bottom:solid 1px #ccc;color:#000000de;display:flex;flex-direction:row;align-items:center;justify-content:space-between;box-sizing:border-box;cursor:move;background:white;font-size:14px}.cdk-drag-preview{box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.example-box:last-child{border:none}.example-list.cdk-drop-list-dragging .example-box:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}\n"] }]
1325
+ }], ctorParameters: function () { return [{ type: i1$4.ClipboardService }, { type: i2$4.MatSnackBar }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { visualEditor: [{
1326
+ type: ViewChild,
1327
+ args: ["visualEditor"]
1328
+ }], showMarkUp: [{
1329
+ type: Input
1330
+ }], useHtmlRaw: [{
1331
+ type: Input
1332
+ }], html: [{
1333
+ type: Input
1334
+ }, {
1335
+ type: Output
1336
+ }], onHtmlChanged: [{
1337
+ type: Output
1338
+ }] } });
1339
+
1340
+ class RichTextToHtmlPipe {
1341
+ transform(value) {
1342
+ let result = "";
1343
+ for (let i = 0; i < value.data.children.length; i++) {
1344
+ const child = value.data.children[i];
1345
+ if (child.type === "text-block") {
1346
+ result += `<span>${child.data.text}</span>`;
1347
+ }
1348
+ else if (child.type === "line-break") {
1349
+ result += "</br>";
1350
+ }
1351
+ }
1352
+ return result;
1353
+ }
1354
+ }
1355
+ RichTextToHtmlPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: RichTextToHtmlPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1356
+ RichTextToHtmlPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: RichTextToHtmlPipe, name: "richTextToHtml" });
1357
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: RichTextToHtmlPipe, decorators: [{
1358
+ type: Pipe,
1359
+ args: [{
1360
+ name: 'richTextToHtml'
1361
+ }]
1362
+ }] });
1363
+
1364
+ class XmlTagRichTextViewComponent {
1365
+ constructor() {
1366
+ this.richTextData = null;
1367
+ }
1368
+ ngOnInit() {
1369
+ }
1370
+ }
1371
+ XmlTagRichTextViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: XmlTagRichTextViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1372
+ XmlTagRichTextViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: XmlTagRichTextViewComponent, selector: "croco-html-xml-tag-rich-text-view", inputs: { richTextData: "richTextData" }, ngImport: i0, template: "<div *ngIf=\"richTextData\" [innerHtml]=\"richTextData | richTextToHtml\">\r\n</div>", styles: [""], directives: [{ type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "richTextToHtml": RichTextToHtmlPipe } });
1373
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: XmlTagRichTextViewComponent, decorators: [{
1374
+ type: Component,
1375
+ args: [{ selector: 'croco-html-xml-tag-rich-text-view', template: "<div *ngIf=\"richTextData\" [innerHtml]=\"richTextData | richTextToHtml\">\r\n</div>", styles: [""] }]
1376
+ }], ctorParameters: function () { return []; }, propDecorators: { richTextData: [{
1377
+ type: Input
1378
+ }] } });
1379
+
1380
+ class XmlTagTableViewComponent {
1381
+ constructor() {
1382
+ this.displayedColumns = [];
1383
+ }
1384
+ }
1385
+ XmlTagTableViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: XmlTagTableViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1386
+ XmlTagTableViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: XmlTagTableViewComponent, selector: "croco-html-xml-tag-table-view", inputs: { displayedColumns: "displayedColumns", data: "data" }, ngImport: i0, template: "<table mat-table [dataSource]=\"data\" class=\"mat-elevation-z8 w-100 example-container\">\r\n <ng-container [matColumnDef]=\"column\" *ngFor=\"let column of displayedColumns\">\r\n <th mat-header-cell *matHeaderCellDef> {{column}} </th>\r\n <td mat-cell *matCellDef=\"let element\"> {{element[column]}} </td>\r\n </ng-container>\r\n\r\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\r\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\r\n</table>", styles: [""], components: [{ type: i1$5.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { type: i1$5.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { type: i1$5.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }], directives: [{ type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1$5.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { type: i1$5.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { type: i1$5.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { type: i1$5.MatCellDef, selector: "[matCellDef]" }, { type: i1$5.MatCell, selector: "mat-cell, td[mat-cell]" }, { type: i1$5.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { type: i1$5.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }] });
1387
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: XmlTagTableViewComponent, decorators: [{
1388
+ type: Component,
1389
+ args: [{ selector: 'croco-html-xml-tag-table-view', template: "<table mat-table [dataSource]=\"data\" class=\"mat-elevation-z8 w-100 example-container\">\r\n <ng-container [matColumnDef]=\"column\" *ngFor=\"let column of displayedColumns\">\r\n <th mat-header-cell *matHeaderCellDef> {{column}} </th>\r\n <td mat-cell *matCellDef=\"let element\"> {{element[column]}} </td>\r\n </ng-container>\r\n\r\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\r\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\r\n</table>", styles: [""] }]
1390
+ }], propDecorators: { displayedColumns: [{
1391
+ type: Input
1392
+ }], data: [{
1393
+ type: Input
1394
+ }] } });
1395
+
1396
+ class TagToSpanPipe {
1397
+ transform(value) {
1398
+ return value.map(x => (`<b>${x}</b>`)).join(' | ');
1399
+ }
1400
+ }
1401
+ TagToSpanPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TagToSpanPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1402
+ TagToSpanPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TagToSpanPipe, name: "tagToSpan" });
1403
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TagToSpanPipe, decorators: [{
1404
+ type: Pipe,
1405
+ args: [{
1406
+ name: 'tagToSpan'
1407
+ }]
1408
+ }] });
1409
+
1410
+ class ToHtmlBodyTagsPipe {
1411
+ transform(value) {
1412
+ return BodyTagsExtensions.getBodyTags(value);
1413
+ }
1414
+ }
1415
+ ToHtmlBodyTagsPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ToHtmlBodyTagsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1416
+ ToHtmlBodyTagsPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ToHtmlBodyTagsPipe, name: "tohtmlbodytags" });
1417
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ToHtmlBodyTagsPipe, decorators: [{
1418
+ type: Pipe,
1419
+ args: [{
1420
+ name: 'tohtmlbodytags'
1421
+ }]
1422
+ }] });
1423
+
1424
+ class TableBuilder {
1425
+ static getTableMarkUp(rows, cols, generateHeaders) {
1426
+ rows = +rows;
1427
+ cols = +cols;
1428
+ let result = "<table>";
1429
+ if (generateHeaders) {
1430
+ result += TableBuilder.getTableHeaderMarkUp(cols);
1431
+ }
1432
+ result += TableBuilder.getTableBodyMarkUp(cols, rows);
1433
+ result += "</table>";
1434
+ return XmlExtensions.formatXml(result);
1435
+ }
1436
+ static getTableHeaderMarkUp(cols) {
1437
+ let result = "<thead><tr>";
1438
+ for (let i = 0; i < cols; i++) {
1439
+ result += `<th>Колонка #${i + 1}</th>`;
1440
+ }
1441
+ result += "</tr></thead>";
1442
+ return result;
1443
+ }
1444
+ static getTableBodyMarkUp(cols, rows) {
1445
+ let result = "<tbody>";
1446
+ for (let row = 0; row < rows; row++) {
1447
+ result += "<tr>";
1448
+ for (let i = 0; i < cols; i++) {
1449
+ result += `<td>Ряд№${row + 1} Колонка #${i + 1}</td>`;
1450
+ }
1451
+ result += "</tr>";
1452
+ }
1453
+ result += "</tbody>";
1454
+ return result;
1455
+ }
1456
+ }
1457
+
1458
+ const EditorComponents = [
1459
+ MainEditorComponent,
1460
+ FileIdSelectComponent,
1461
+ TextEditorComponent,
1462
+ ExternalVideoBlockComponent,
1463
+ ImageEditorComponent,
1464
+ MainEditorBlockComponent,
1465
+ VisualEditorComponent,
1466
+ AddFilesBtnComponent,
1467
+ HtmlRawEditorComponent,
1468
+ ];
1469
+ const XmlComponents = [
1470
+ XmlTagTableViewComponent,
1471
+ XmlTagViewComponent,
1472
+ XmlTagRichTextViewComponent,
1473
+ XmlTagHtmlViewComponent,
1474
+ XmlTagTextViewComponent,
1475
+ XmlTagHeaderTextViewComponent,
1476
+ XmlTagHeaderInnerTextViewComponent,
1477
+ XmlTagExternalVideoComponent
1478
+ ];
1479
+ const CrocoPipes = [
1480
+ RichTextToHtmlPipe,
1481
+ TagToSpanPipe,
1482
+ ToPreviewPipe,
1483
+ ToHtmlBodyTagsPipe,
1484
+ ];
1485
+ const CrocoHtmlDeclarations = [
1486
+ UploadFilesBtnComponent,
1487
+ ...XmlComponents,
1488
+ ...EditorComponents,
1489
+ ...CrocoPipes
1490
+ ];
1491
+ const MaterialModules = [
1492
+ MatBadgeModule,
1493
+ MatTableModule,
1494
+ MatExpansionModule,
1495
+ MatFormFieldModule,
1496
+ MatSnackBarModule,
1497
+ MatProgressBarModule,
1498
+ MatProgressSpinnerModule,
1499
+ MatTabsModule,
1500
+ MatMenuModule,
1501
+ MatCardModule,
1502
+ MatSelectModule,
1503
+ MatTooltipModule,
1504
+ MatCheckboxModule,
1505
+ MatChipsModule,
1506
+ MatListModule,
1507
+ MatButtonModule,
1508
+ MatInputModule,
1509
+ MatDialogModule,
1510
+ MatPaginatorModule,
1511
+ MatDatepickerModule,
1512
+ MatGridListModule,
1513
+ MatSlideToggleModule,
1514
+ MatTreeModule,
1515
+ MatNativeDateModule,
1516
+ MatAutocompleteModule,
1517
+ MatSidenavModule,
1518
+ MatIconModule,
1519
+ DragDropModule,
1520
+ MatButtonToggleModule
1521
+ ];
1522
+
1523
+ class CrocoHtmlModule {
1524
+ }
1525
+ CrocoHtmlModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: CrocoHtmlModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1526
+ CrocoHtmlModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: CrocoHtmlModule, declarations: [UploadFilesBtnComponent, XmlTagTableViewComponent, XmlTagViewComponent, XmlTagRichTextViewComponent, XmlTagHtmlViewComponent, XmlTagTextViewComponent, XmlTagHeaderTextViewComponent, XmlTagHeaderInnerTextViewComponent, XmlTagExternalVideoComponent, MainEditorComponent, FileIdSelectComponent, TextEditorComponent, ExternalVideoBlockComponent, ImageEditorComponent, MainEditorBlockComponent, VisualEditorComponent, AddFilesBtnComponent, HtmlRawEditorComponent, RichTextToHtmlPipe, TagToSpanPipe, ToPreviewPipe, ToHtmlBodyTagsPipe], imports: [CommonModule,
1527
+ FormsModule,
1528
+ ReactiveFormsModule,
1529
+ NgSelectModule, i23.MatBadgeModule, i1$5.MatTableModule, i25.MatExpansionModule, i5.MatFormFieldModule, i2$4.MatSnackBarModule, i28.MatProgressBarModule, i1$3.MatProgressSpinnerModule, i3$2.MatTabsModule, i31.MatMenuModule, i2$3.MatCardModule, i6.MatSelectModule, i34.MatTooltipModule, i35.MatCheckboxModule, i3$1.MatChipsModule, i37.MatListModule, i2.MatButtonModule, i5$2.MatInputModule, i40.MatDialogModule, i41.MatPaginatorModule, i42.MatDatepickerModule, i43.MatGridListModule, i44.MatSlideToggleModule, i45.MatTreeModule, i7.MatNativeDateModule, i47.MatAutocompleteModule, i48.MatSidenavModule, i2$2.MatIconModule, i11.DragDropModule, i1$2.MatButtonToggleModule], exports: [UploadFilesBtnComponent, XmlTagTableViewComponent, XmlTagViewComponent, XmlTagRichTextViewComponent, XmlTagHtmlViewComponent, XmlTagTextViewComponent, XmlTagHeaderTextViewComponent, XmlTagHeaderInnerTextViewComponent, XmlTagExternalVideoComponent, MainEditorComponent, FileIdSelectComponent, TextEditorComponent, ExternalVideoBlockComponent, ImageEditorComponent, MainEditorBlockComponent, VisualEditorComponent, AddFilesBtnComponent, HtmlRawEditorComponent, RichTextToHtmlPipe, TagToSpanPipe, ToPreviewPipe, ToHtmlBodyTagsPipe] });
1530
+ CrocoHtmlModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: CrocoHtmlModule, imports: [[
1531
+ CommonModule,
1532
+ FormsModule,
1533
+ ReactiveFormsModule,
1534
+ NgSelectModule,
1535
+ ...MaterialModules
1536
+ ]] });
1537
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: CrocoHtmlModule, decorators: [{
1538
+ type: NgModule,
1539
+ args: [{
1540
+ declarations: [
1541
+ ...CrocoHtmlDeclarations
1542
+ ],
1543
+ exports: [
1544
+ ...CrocoHtmlDeclarations,
1545
+ ],
1546
+ imports: [
1547
+ CommonModule,
1548
+ FormsModule,
1549
+ ReactiveFormsModule,
1550
+ NgSelectModule,
1551
+ ...MaterialModules
1552
+ ]
1553
+ }]
1554
+ }] });
1555
+
1556
+ /*
1557
+ * Public API Surface of croco-html
1558
+ */
1559
+
1560
+ /**
1561
+ * Generated bundle index. Do not edit.
1562
+ */
1563
+
1564
+ export { AddFilesBtnComponent, AngularMaterialTableMethods, BodyTagsExtensions, BootstrapTableMethods, CrocoHtmlModule, DefaultTags, 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 };
1565
+ //# sourceMappingURL=croco-html.mjs.map