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,1568 @@
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?.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 () { return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
129
+ type: Inject,
130
+ args: ['BASE_URL']
131
+ }] }]; } });
132
+
133
+ class UploadFilesBtnComponent {
134
+ constructor(_fileUploadService) {
135
+ this._fileUploadService = _fileUploadService;
136
+ this.extAccepts = "*/*";
137
+ this.isMultiple = true;
138
+ this.btnText = "Загрузить файлы";
139
+ this.createLocalCopiesNow = false;
140
+ this.hidden = false;
141
+ this.postFilesStarted = new EventEmitter();
142
+ this.onFilesUploaded = new EventEmitter();
143
+ }
144
+ handleFileInput(files) {
145
+ this.postFilesStarted.emit({
146
+ filesCount: files.length,
147
+ createLocalCopiesNow: this.createLocalCopiesNow
148
+ });
149
+ this._fileUploadService.postFiles(files, this.createLocalCopiesNow).subscribe(data => {
150
+ this.onFilesUploaded.emit(data);
151
+ });
152
+ }
153
+ clickFileInput() {
154
+ this.fileInput.nativeElement.click();
155
+ }
156
+ ngOnInit() {
157
+ }
158
+ }
159
+ UploadFilesBtnComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: UploadFilesBtnComponent, deps: [{ token: FileUploadService }], target: i0.ɵɵFactoryTarget.Component });
160
+ 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"] }] });
161
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: UploadFilesBtnComponent, decorators: [{
162
+ type: Component,
163
+ 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: [""] }]
164
+ }], ctorParameters: function () { return [{ type: FileUploadService }]; }, propDecorators: { fileInput: [{
165
+ type: ViewChild,
166
+ args: ['filesInput']
167
+ }], extAccepts: [{
168
+ type: Input
169
+ }], isMultiple: [{
170
+ type: Input
171
+ }], btnText: [{
172
+ type: Input
173
+ }], createLocalCopiesNow: [{
174
+ type: Input
175
+ }], hidden: [{
176
+ type: Input
177
+ }], postFilesStarted: [{
178
+ type: Output
179
+ }], onFilesUploaded: [{
180
+ type: Output
181
+ }] } });
182
+
183
+ class AddFilesBtnComponent {
184
+ constructor() {
185
+ this.postFilesStarted = new EventEmitter();
186
+ this.fileIds = [];
187
+ this.filesTagsReady = new EventEmitter();
188
+ }
189
+ postFilesStartedEventHandler(data) {
190
+ this.postFilesStarted.emit(data);
191
+ }
192
+ filesUploadedHandler(data) {
193
+ this.fileIds = data.responseObject;
194
+ let fileTags = [];
195
+ for (let i = 0; i < this.fileIds.length; i++) {
196
+ let fileTag = {
197
+ presentOrEdit: true,
198
+ tagDescription: {
199
+ tag: FileImageTagDataConsts.TagName,
200
+ displayValue: "Изображение"
201
+ },
202
+ attributes: {
203
+ [FileImageTagDataConsts.FileIdAttrName]: this.fileIds[i]
204
+ },
205
+ innerHtml: ""
206
+ };
207
+ fileTags.push(fileTag);
208
+ }
209
+ this.filesTagsReady.emit(fileTags);
210
+ }
211
+ handleClick() {
212
+ this.fakeBtn.clickFileInput();
213
+ }
214
+ ngOnInit() {
215
+ }
216
+ }
217
+ AddFilesBtnComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AddFilesBtnComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
218
+ 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"] }] });
219
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AddFilesBtnComponent, decorators: [{
220
+ type: Component,
221
+ 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: [""] }]
222
+ }], ctorParameters: function () { return []; }, propDecorators: { postFilesStarted: [{
223
+ type: Output
224
+ }], fakeBtn: [{
225
+ type: ViewChild,
226
+ args: ["fakeBtn"]
227
+ }], filesTagsReady: [{
228
+ type: Output
229
+ }] } });
230
+
231
+ class ExternalVideoTagDataConsts {
232
+ }
233
+ ExternalVideoTagDataConsts.TagName = "external-video";
234
+ ExternalVideoTagDataConsts.VideoTypeAttrName = "type";
235
+ ExternalVideoTagDataConsts.LinkAttrName = "link";
236
+ class ExternalVideoSupportedTypes {
237
+ }
238
+ ExternalVideoSupportedTypes.Youtube = "youtube";
239
+ class VideoMethods {
240
+ static ExtractExternalVideoTag(elem) {
241
+ return {
242
+ type: ExternalVideoTagDataConsts.TagName,
243
+ data: {
244
+ type: elem.getAttribute(ExternalVideoTagDataConsts.VideoTypeAttrName),
245
+ link: elem.getAttribute(ExternalVideoTagDataConsts.LinkAttrName)
246
+ }
247
+ };
248
+ }
249
+ }
250
+
251
+ class XmlTagExternalVideoComponent {
252
+ constructor(_domSanitizer) {
253
+ this._domSanitizer = _domSanitizer;
254
+ }
255
+ getYouTubeId(youtubeLink) {
256
+ //https://www.youtube.com/watch?v=l3KfbfkxJOU
257
+ if (youtubeLink.includes("watch?v=")) {
258
+ var url = new URL(youtubeLink);
259
+ return url.searchParams.get("v");
260
+ }
261
+ //https://youtu.be/jzBneaWSswY
262
+ let bits = youtubeLink.split('/');
263
+ return bits[bits.length - 1];
264
+ }
265
+ getWidgetLink(youtubeLink) {
266
+ let id = this.getYouTubeId(youtubeLink);
267
+ let result = `https://www.youtube.com/embed/${id}?controls=0`;
268
+ this.widgetUrl = this._domSanitizer.bypassSecurityTrustResourceUrl(result);
269
+ return result;
270
+ }
271
+ ngOnInit() {
272
+ if (this.data != null) {
273
+ this.tagData = this.data.data;
274
+ }
275
+ let youtubeWidgetLink = this.getWidgetLink(this.tagData.link);
276
+ this.widgetUrl = this._domSanitizer.bypassSecurityTrustResourceUrl(youtubeWidgetLink);
277
+ }
278
+ }
279
+ 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 });
280
+ 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"] }] });
281
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: XmlTagExternalVideoComponent, decorators: [{
282
+ type: Component,
283
+ args: [{ selector: 'croco-html-xml-tag-external-video', template: "<div class=\"d-flex justify-content-center\">\r\n <div *ngIf=\"widgetUrl\" class=\"y-video\">\r\n <iframe width=\"100%\" height=\"100%\" [src]=\"widgetUrl\"\r\n title=\"YouTube video player\" frameborder=\"0\"\r\n allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\"\r\n allowfullscreen></iframe>\r\n </div>\r\n</div>", styles: ["@media only screen and (min-width: 769px){.y-video{width:640px;height:360px;margin:0 auto}}@media only screen and (max-width: 768px){.y-video{width:560px;height:315px;margin:0 auto}}\n"] }]
284
+ }], ctorParameters: function () { return [{ type: i1$1.DomSanitizer }]; }, propDecorators: { data: [{
285
+ type: Input
286
+ }], tagData: [{
287
+ type: Input
288
+ }] } });
289
+
290
+ class ExternalVideoBlockComponent {
291
+ constructor() {
292
+ this.onTagUpdated = new EventEmitter();
293
+ this.myForm = new FormGroup({
294
+ youtubeLink: new FormControl()
295
+ });
296
+ this.defaultLink = "https://youtu.be/jzBneaWSswY";
297
+ this.data = {
298
+ youtubeLink: this.defaultLink
299
+ };
300
+ this.tagData = {
301
+ link: this.defaultLink,
302
+ type: ExternalVideoSupportedTypes.Youtube
303
+ };
304
+ }
305
+ linkChanged() {
306
+ this.tagData.link = this.data.youtubeLink;
307
+ this.tag.attributes = this.tagData;
308
+ }
309
+ ngOnInit() {
310
+ this.linkChanged();
311
+ this.tagData = this.tag.attributes;
312
+ this.data.youtubeLink = this.tagData.link;
313
+ }
314
+ }
315
+ ExternalVideoBlockComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ExternalVideoBlockComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
316
+ 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"] }] });
317
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ExternalVideoBlockComponent, decorators: [{
318
+ type: Component,
319
+ 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: [""] }]
320
+ }], propDecorators: { tag: [{
321
+ type: Input
322
+ }], onTagUpdated: [{
323
+ type: Output
324
+ }] } });
325
+
326
+ class HtmlRawEditorComponent {
327
+ constructor() {
328
+ this.onTagUpdated = new EventEmitter();
329
+ }
330
+ ngOnInit() {
331
+ }
332
+ }
333
+ HtmlRawEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: HtmlRawEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
334
+ 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"] }] });
335
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: HtmlRawEditorComponent, decorators: [{
336
+ type: Component,
337
+ 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: [""] }]
338
+ }], ctorParameters: function () { return []; }, propDecorators: { tag: [{
339
+ type: Input
340
+ }], onTagUpdated: [{
341
+ type: Output
342
+ }] } });
343
+
344
+ class FilesQueryService {
345
+ constructor(_httpClient, baseUrl) {
346
+ this._httpClient = _httpClient;
347
+ this._baseControllerUrl = baseUrl + 'Api/Files/';
348
+ }
349
+ getFilesWithRelations(model) {
350
+ return this._httpClient.post(this._baseControllerUrl + `GetFiles/WithRelations`, model);
351
+ }
352
+ getFiles(model) {
353
+ return this._httpClient.post(this._baseControllerUrl + `GetFiles`, model);
354
+ }
355
+ }
356
+ 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 });
357
+ FilesQueryService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FilesQueryService, providedIn: 'root' });
358
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FilesQueryService, decorators: [{
359
+ type: Injectable,
360
+ args: [{
361
+ providedIn: 'root'
362
+ }]
363
+ }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
364
+ type: Inject,
365
+ args: ['BASE_URL']
366
+ }] }]; } });
367
+
368
+ class FileIdSelectComponent {
369
+ constructor(fb, _fileService) {
370
+ this.fb = fb;
371
+ this._fileService = _fileService;
372
+ this.labelText = "Поиск файлов";
373
+ this.loading = false;
374
+ this.files = [];
375
+ this.onFileIdChanged = new EventEmitter();
376
+ this.form = this.fb.group({
377
+ fileName: '',
378
+ });
379
+ }
380
+ onModelChanged(fileId) {
381
+ this.onFileIdChanged.emit(fileId);
382
+ }
383
+ getSrc(fileId) {
384
+ return ImageMethods.buildSmallUrl(fileId);
385
+ }
386
+ ngOnInit() {
387
+ this.loadFiles();
388
+ }
389
+ loadFiles() {
390
+ this.loading = true;
391
+ this._fileService.getFiles({
392
+ count: 10,
393
+ offSet: 0,
394
+ fileName: null,
395
+ q: this.q
396
+ }).subscribe(data => {
397
+ this.files = [...data.list];
398
+ this.loading = false;
399
+ });
400
+ }
401
+ onSearchChanged(q) {
402
+ this.q = q.term;
403
+ this.loadFiles();
404
+ }
405
+ ngOnChanges(changes) {
406
+ this.loadFiles();
407
+ }
408
+ }
409
+ 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 });
410
+ 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]" }] });
411
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FileIdSelectComponent, decorators: [{
412
+ type: Component,
413
+ 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: [""] }]
414
+ }], ctorParameters: function () { return [{ type: i5$1.FormBuilder }, { type: FilesQueryService }]; }, propDecorators: { labelText: [{
415
+ type: Input
416
+ }], fileId: [{
417
+ type: Input
418
+ }, {
419
+ type: Output
420
+ }], onFileIdChanged: [{
421
+ type: Output
422
+ }] } });
423
+
424
+ class ImageEditorComponent {
425
+ constructor() {
426
+ this.hasImageError = false;
427
+ this.searchOrEdit = "search";
428
+ this.myForm = new FormGroup({
429
+ fileId: new FormControl()
430
+ });
431
+ this.onTagUpdated = new EventEmitter();
432
+ }
433
+ onErrorHandler() {
434
+ this.hasImageError = true;
435
+ }
436
+ getSrc() {
437
+ return ImageMethods.buildUrl(this.tag.attributes[FileImageTagDataConsts.FileIdAttrName]);
438
+ }
439
+ hasFileId() {
440
+ return this.tag.attributes.hasOwnProperty(FileImageTagDataConsts.FileIdAttrName) && !isNaN(this.tag.attributes[FileImageTagDataConsts.FileIdAttrName]);
441
+ }
442
+ onFileIdChanged(fileId) {
443
+ this.tag.attributes[FileImageTagDataConsts.FileIdAttrName] = fileId;
444
+ this.removeImageError();
445
+ }
446
+ removeImageError() {
447
+ this.hasImageError = false;
448
+ }
449
+ ngOnInit() {
450
+ }
451
+ }
452
+ ImageEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ImageEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
453
+ 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"] }] });
454
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ImageEditorComponent, decorators: [{
455
+ type: Component,
456
+ 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"] }]
457
+ }], ctorParameters: function () { return []; }, propDecorators: { tag: [{
458
+ type: Input
459
+ }], onTagUpdated: [{
460
+ type: Output
461
+ }] } });
462
+
463
+ class AngularMaterialTableMethods {
464
+ static getAngularMaterialTableData(columns, rows) {
465
+ let data = [];
466
+ for (let rowIndex = 0; rowIndex < rows.length; rowIndex++) {
467
+ const row = rows[rowIndex];
468
+ var elem = {};
469
+ for (let columnIndex = 0; columnIndex < columns.length; columnIndex++) {
470
+ const column = columns[columnIndex];
471
+ elem[column] = row.columns[columnIndex].data.text;
472
+ }
473
+ data.push(elem);
474
+ }
475
+ return {
476
+ displayedColumns: columns,
477
+ data: data,
478
+ };
479
+ }
480
+ static checkHeaders(tableData) {
481
+ if (tableData.header === null) {
482
+ return {
483
+ isSucceeded: false,
484
+ message: "Необходимо указать заголовок таблицы"
485
+ };
486
+ }
487
+ let columns = tableData.header.columns;
488
+ var uniqueDislayedColumns = columns.filter((v, i, a) => a.indexOf(v) === i);
489
+ if (uniqueDislayedColumns.length !== columns.length) {
490
+ return {
491
+ isSucceeded: false,
492
+ message: "Ошибка при обработке разметки таблицы. Обнаружены дубликаты заголовков."
493
+ };
494
+ }
495
+ return {
496
+ isSucceeded: true,
497
+ message: "Ok"
498
+ };
499
+ }
500
+ static checkAngularMaterialTableData(tableData, checkHeaders = true) {
501
+ if (checkHeaders) {
502
+ var checkHeadersResult = this.checkHeaders(tableData);
503
+ if (!checkHeadersResult.isSucceeded) {
504
+ return checkHeadersResult;
505
+ }
506
+ }
507
+ let rows = tableData.rows;
508
+ let columns = tableData.header.columns;
509
+ for (let i = 0; i < rows.length; i++) {
510
+ const row = rows[i];
511
+ if (row.columns.length !== columns.length) {
512
+ return {
513
+ isSucceeded: false,
514
+ message: `Ошибка при обработке разметки таблицы. `
515
+ + `Количество колонок в каждой строке таблицы должно соотвествовать количеству колонок указанных в заголовке. `
516
+ + `В строке таблицы №${i + 1} количество колонок = ${row.columns.length}, а должно быть ${columns.length}.`
517
+ };
518
+ }
519
+ }
520
+ return {
521
+ isSucceeded: true,
522
+ message: "Ok"
523
+ };
524
+ }
525
+ }
526
+
527
+ const TextTag = "text";
528
+ class TextSimpleMethods {
529
+ static ExtractTextTag(elem) {
530
+ var hAlignValue = elem.getAttribute("h-align") ?? "left";
531
+ var data = {
532
+ textTagName: elem.tagName.toLowerCase(),
533
+ text: elem.innerText.trim().replace('\n\t', ''),
534
+ html: elem.innerHTML.trim().replace('\n\t', ''),
535
+ horizontalAlignment: hAlignValue,
536
+ validationResult: {
537
+ isSucceeded: true,
538
+ message: "Ok"
539
+ }
540
+ };
541
+ let result = {
542
+ type: TextTag,
543
+ data: data
544
+ };
545
+ if (result.data.text === '\n') {
546
+ result.data.text = '';
547
+ }
548
+ if (result.data.html === '\n') {
549
+ result.data.html = '';
550
+ }
551
+ var alignmentVals = ["left", "right", "center"];
552
+ if (alignmentVals.indexOf(hAlignValue) < 0) {
553
+ result.data.validationResult = {
554
+ isSucceeded: false,
555
+ message: `Недопустимое значение атрибута h-align. Допустимые значения: ${alignmentVals.join(', ')}. `
556
+ + 'Данный тег можно не указывать, по-умолчанию будет применено выравнивание слева.'
557
+ };
558
+ }
559
+ var html = result.data.html;
560
+ var htmlValidation = this.ValidateTextHtml(html);
561
+ if (!htmlValidation.isSucceeded) {
562
+ result.data.validationResult = htmlValidation;
563
+ }
564
+ return result;
565
+ }
566
+ static ValidateTextHtml(html) {
567
+ var p = document.createElement("p");
568
+ p.innerHTML = html;
569
+ for (let i = 0; i < p.children.length; i++) {
570
+ const element = p.children.item(i);
571
+ var validationResult = this.ValidateTag(element);
572
+ if (!validationResult.isSucceeded) {
573
+ return validationResult;
574
+ }
575
+ }
576
+ return {
577
+ isSucceeded: true,
578
+ message: `Ok`
579
+ };
580
+ }
581
+ static ValidateTag(element) {
582
+ let lowerTag = element.tagName.toLowerCase();
583
+ if (!this.supportedTags.includes(lowerTag)) {
584
+ return {
585
+ isSucceeded: false,
586
+ message: `Тег <${lowerTag}> не поддерживается внутри тега <text>`
587
+ };
588
+ }
589
+ for (let i = 0; i < element.children.length; i++) {
590
+ const nElement = element.children.item(i);
591
+ var innerValidationResult = this.ValidateTag(nElement);
592
+ if (!innerValidationResult.isSucceeded) {
593
+ return innerValidationResult;
594
+ }
595
+ }
596
+ return {
597
+ isSucceeded: true,
598
+ message: "Ok"
599
+ };
600
+ }
601
+ }
602
+ TextSimpleMethods.supportedTags = ["sup", "sub", "strong", "b", "i"];
603
+
604
+ class BootstrapTableMethods {
605
+ static BuildTable(data) {
606
+ let result = `<table class="table table-bordered">`;
607
+ result += this.BuildHeader(data.header);
608
+ result += this.BuildBody(data.rows);
609
+ result += "</table>";
610
+ return result;
611
+ }
612
+ static BuildHeader(data) {
613
+ if (data === null) {
614
+ return "";
615
+ }
616
+ let result = "<thead>";
617
+ result += "<tr>";
618
+ for (let index = 0; index < data.columns.length; index++) {
619
+ result += `<th>${data.columns[index]}</th>`;
620
+ }
621
+ result += "</tr>";
622
+ result += "</thead>";
623
+ return result;
624
+ }
625
+ static BuildBody(rows) {
626
+ let result = "<tbody>";
627
+ for (let i = 0; i < rows.length; i++) {
628
+ const row = rows[i];
629
+ result += "<tr>";
630
+ for (let j = 0; j < row.columns.length; j++) {
631
+ const col = row.columns[j];
632
+ result += `<td class="align-middle">${this.BuildInnerTags(col.data.children)}</td>`;
633
+ }
634
+ result += "</tr>";
635
+ }
636
+ result += "</tbody>";
637
+ return result;
638
+ }
639
+ static BuildInnerTags(tags) {
640
+ let result = "";
641
+ for (let i = 0; i < tags.length; i++) {
642
+ result += this.BuildInnerTag(tags[i]);
643
+ }
644
+ return result;
645
+ }
646
+ static BuildInnerTag(data) {
647
+ if (data.type === FileImageTagDataConsts.TagName) {
648
+ let fileImageTag = data;
649
+ return `<img src=${fileImageTag.data.src} class="mx-auto d-block img-fluid" />`;
650
+ }
651
+ else if (data.type === TextTag) {
652
+ let simpleTextTag = data;
653
+ var map = {
654
+ ["left"]: "text-start",
655
+ ["center"]: "text-center",
656
+ ["right"]: "text-end"
657
+ };
658
+ if (!simpleTextTag.data.validationResult.isSucceeded) {
659
+ return `<span>Ошибка в тексте ${simpleTextTag.data.validationResult.message}</span>`;
660
+ }
661
+ return `<div class="${map[simpleTextTag.data.horizontalAlignment]}"><span>${simpleTextTag.data.html}</span></div>`;
662
+ }
663
+ else {
664
+ return `<p>Тег ${data.type} не поддерживается</p>`;
665
+ }
666
+ }
667
+ }
668
+
669
+ class TableTypes {
670
+ }
671
+ TableTypes.TableRowColumnData = "table-row-column-data";
672
+ TableTypes.Table = "table";
673
+ TableTypes.TableRowColumn = "table-row-column";
674
+ class TableMethods {
675
+ static getTableFromHtmlTag(tableTag) {
676
+ let tableData = {
677
+ header: TableMethods.getHeader(tableTag),
678
+ rows: TableMethods.getTableRows(tableTag)
679
+ };
680
+ var result = {
681
+ type: TableTypes.Table,
682
+ data: tableData,
683
+ validationResult: this.checkTable(tableData),
684
+ bootstrapHtml: ""
685
+ };
686
+ if (!result.validationResult) {
687
+ return result;
688
+ }
689
+ result.bootstrapHtml = BootstrapTableMethods.BuildTable(result.data);
690
+ var angularMaterialTableDataCheck = AngularMaterialTableMethods.checkAngularMaterialTableData(tableData);
691
+ if (!angularMaterialTableDataCheck.isSucceeded) {
692
+ return {
693
+ ...result,
694
+ angularMaterialTableDataCheck
695
+ };
696
+ }
697
+ return {
698
+ ...result,
699
+ angularMaterialTableDataCheck,
700
+ html: tableTag.outerHTML,
701
+ angularMaterialTableData: AngularMaterialTableMethods.getAngularMaterialTableData(tableData.header.columns, tableData.rows),
702
+ };
703
+ }
704
+ static checkTable(tableData) {
705
+ let rows = tableData.rows;
706
+ let prevRowCount = -1;
707
+ for (let i = 0; i < rows.length; i++) {
708
+ const row = rows[i];
709
+ if (row.columns.length !== prevRowCount && prevRowCount != -1) {
710
+ return {
711
+ isSucceeded: false,
712
+ message: `Ошибка при обработке разметки таблицы. `
713
+ + `Количество колонок в каждой строке таблицы должно соотвествовать друг другу. `
714
+ + `В строке таблицы №${i + 1} количество колонок = ${row.columns.length}, а в строке выше ${prevRowCount}.`
715
+ };
716
+ }
717
+ prevRowCount = row.columns.length;
718
+ }
719
+ return {
720
+ isSucceeded: true,
721
+ message: "Ok"
722
+ };
723
+ }
724
+ static getHeader(tableTag) {
725
+ let header = tableTag.tHead;
726
+ if (header === null) {
727
+ return null;
728
+ }
729
+ let tr = header.children.item(0);
730
+ let headerColumns = [];
731
+ for (let j = 0; j < tr.children.length; j++) {
732
+ const jElement = tr.children.item(j);
733
+ headerColumns.push(jElement.innerHTML);
734
+ }
735
+ return {
736
+ type: "table-header",
737
+ columns: headerColumns
738
+ };
739
+ }
740
+ static getTableRows(tableTag) {
741
+ let tBody = tableTag.tBodies.item(0);
742
+ let rows = [];
743
+ for (let i = 0; i < tBody.children.length; i++) {
744
+ const iElement = tBody.children.item(i);
745
+ let rowColumns = [];
746
+ for (let j = 0; j < iElement.children.length; j++) {
747
+ const jElement = iElement.children.item(j);
748
+ let children = HtmlExtractionMethods.transformHtmlElementToBlocks(jElement);
749
+ if (children.length === 0) {
750
+ var textTag = document.createElement("p");
751
+ textTag.innerHTML = jElement.innerHTML;
752
+ var textElem = TextSimpleMethods.ExtractTextTag(textTag);
753
+ children.push(textElem);
754
+ }
755
+ var result = {
756
+ type: TableTypes.TableRowColumnData,
757
+ data: {
758
+ text: jElement.innerHTML,
759
+ children
760
+ }
761
+ };
762
+ rowColumns.push(result);
763
+ }
764
+ rows.push({
765
+ type: TableTypes.TableRowColumn,
766
+ columns: rowColumns
767
+ });
768
+ }
769
+ return rows;
770
+ }
771
+ }
772
+
773
+ class TextMethods {
774
+ static ExtractRichTextData(elem) {
775
+ let children = [];
776
+ for (let i = 0; i < elem.children.length; i++) {
777
+ const child = elem.children.item(i);
778
+ if (child.tagName === "text-block".toUpperCase()) {
779
+ children.push({
780
+ type: "text-block",
781
+ data: {
782
+ text: child.innerHTML
783
+ }
784
+ });
785
+ }
786
+ else if (child.tagName === "line-break".toUpperCase()) {
787
+ children.push({
788
+ type: "line-break"
789
+ });
790
+ }
791
+ }
792
+ return {
793
+ type: "rich-text",
794
+ data: {
795
+ children
796
+ }
797
+ };
798
+ }
799
+ }
800
+ TextMethods.textTags = ["text", "h1", "h2", "h3", "h4", "h5", "h6"];
801
+
802
+ class HtmlExtractionMethods {
803
+ static ExtractHeaderTag(elem, tagName) {
804
+ var data = TextSimpleMethods.ExtractTextTag(elem);
805
+ data.type = tagName;
806
+ return data;
807
+ }
808
+ static transformHtmlElementToBlocks(element) {
809
+ var data = [];
810
+ for (let i = 0; i < element.children.length; i++) {
811
+ var elem = element.children.item(i);
812
+ if (!HtmlExtractionMethods.Extractors.hasOwnProperty(elem.tagName)) {
813
+ data.push({
814
+ type: "unsupported-tag",
815
+ data: {
816
+ tagString: elem.outerHTML
817
+ }
818
+ });
819
+ }
820
+ else {
821
+ var extractor = HtmlExtractionMethods.Extractors[elem.tagName];
822
+ var result = extractor(elem);
823
+ data.push(result);
824
+ }
825
+ }
826
+ return data;
827
+ }
828
+ static transformHtmlStringToBlocks(value) {
829
+ if (value === undefined) {
830
+ return [];
831
+ }
832
+ value = value
833
+ .replace('\n', '')
834
+ .replace('\t', '');
835
+ var div = document.createElement("div");
836
+ div.innerHTML = value;
837
+ return this.transformHtmlElementToBlocks(div);
838
+ }
839
+ }
840
+ HtmlExtractionMethods.Extractors = {
841
+ ["TEXT"]: (elem) => TextSimpleMethods.ExtractTextTag(elem),
842
+ ["FILE-IMAGE"]: (elem) => ImageMethods.ExtractImage(elem),
843
+ ["TABLE"]: (elem) => TableMethods.getTableFromHtmlTag(elem),
844
+ ["RICH-TEXT"]: (elem) => TextMethods.ExtractRichTextData(elem),
845
+ ["HTML-RAW"]: (elem) => ({
846
+ type: "html-raw",
847
+ data: {
848
+ innerHTML: elem.innerHTML
849
+ }
850
+ }),
851
+ ["H1"]: (elem) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h1"),
852
+ ["H2"]: (elem) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h2"),
853
+ ["H3"]: (elem) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h3"),
854
+ ["H4"]: (elem) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h4"),
855
+ ["H5"]: (elem) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h5"),
856
+ ["H6"]: (elem) => HtmlExtractionMethods.ExtractHeaderTag(elem, "h6"),
857
+ [ExternalVideoTagDataConsts.TagName.toUpperCase()]: (elem) => VideoMethods.ExtractExternalVideoTag(elem)
858
+ };
859
+
860
+ class HtmlRawTagDataConsts {
861
+ }
862
+ HtmlRawTagDataConsts.TagName = "html-raw";
863
+
864
+ class BodyTagsExtensions {
865
+ static getDescription(tagName) {
866
+ var descriptions = {
867
+ "text": "Текст",
868
+ "h1": "Заголовок 1 уровня",
869
+ "h2": "Заголовок 2 уровня",
870
+ "h3": "Заголовок 3 уровня",
871
+ "h4": "Заголовок 4 уровня",
872
+ "h5": "Заголовок 5 уровня",
873
+ "h6": "Заголовок 6 уровня",
874
+ [FileImageTagDataConsts.TagName]: "Изображение",
875
+ [ExternalVideoTagDataConsts.TagName]: "Внешнее видео YouTube",
876
+ [HtmlRawTagDataConsts.TagName]: "Html разметка"
877
+ };
878
+ return descriptions[tagName];
879
+ }
880
+ static toHtml(bodyTags) {
881
+ let htmls = bodyTags.map(x => {
882
+ if (TextMethods.textTags.includes(x.tagDescription.tag)) {
883
+ return `<${x.tagDescription.tag} h-align="${x.attributes['h-align']}">${x.innerHtml}</${x.tagDescription.tag}>`;
884
+ }
885
+ if (x.tagDescription.tag === ExternalVideoTagDataConsts.TagName) {
886
+ return `<${x.tagDescription.tag} type="${x.attributes['type']}" link="${x.attributes['link']}">${x.innerHtml}</${x.tagDescription.tag}>`;
887
+ }
888
+ if (x.tagDescription.tag === "html-raw") {
889
+ return `<${x.tagDescription.tag}>${x.innerHtml}</${x.tagDescription.tag}>`;
890
+ }
891
+ return BodyTagsExtensions.imageTagToHtml(x);
892
+ });
893
+ let result = "";
894
+ for (let index = 0; index < htmls.length; index++) {
895
+ const element = htmls[index];
896
+ result += element;
897
+ }
898
+ return result;
899
+ }
900
+ static imageTagToHtml(imageTag) {
901
+ var attrStr = "";
902
+ var attrValue = imageTag.attributes[FileImageTagDataConsts.FileIdAttrName];
903
+ if (imageTag.attributes.hasOwnProperty(FileImageTagDataConsts.FileIdAttrName) && attrValue) {
904
+ attrStr = `${FileImageTagDataConsts.FileIdAttrName}="${attrValue}"`;
905
+ }
906
+ return `<${FileImageTagDataConsts.TagName} ${attrStr}></${FileImageTagDataConsts.TagName}>`;
907
+ }
908
+ static getBodyTags(html) {
909
+ let result = HtmlExtractionMethods.transformHtmlStringToBlocks(html);
910
+ return result.map(x => BodyTagsExtensions.toBodyTag(x));
911
+ }
912
+ static sanitizeInnerHtml(html) {
913
+ return html.trim().replace('\n\t', '');
914
+ }
915
+ static toBodyTag(data) {
916
+ if (TextMethods.textTags.includes(data.type)) {
917
+ let textTagData = data.data;
918
+ return {
919
+ presentOrEdit: true,
920
+ tagDescription: {
921
+ tag: textTagData.textTagName,
922
+ displayValue: BodyTagsExtensions.getDescription(data.type)
923
+ },
924
+ attributes: { "h-align": textTagData.horizontalAlignment },
925
+ innerHtml: BodyTagsExtensions.sanitizeInnerHtml(textTagData.html)
926
+ };
927
+ }
928
+ if (data.type === FileImageTagDataConsts.TagName) {
929
+ let fileData = data.data;
930
+ let atts = {};
931
+ if (fileData.fileId) {
932
+ atts[FileImageTagDataConsts.FileIdAttrName] = fileData.fileId;
933
+ }
934
+ return {
935
+ presentOrEdit: true,
936
+ tagDescription: {
937
+ tag: FileImageTagDataConsts.TagName,
938
+ displayValue: BodyTagsExtensions.getDescription(data.type)
939
+ },
940
+ attributes: atts,
941
+ innerHtml: ""
942
+ };
943
+ }
944
+ if (data.type === ExternalVideoTagDataConsts.TagName) {
945
+ let fileData = data.data;
946
+ return {
947
+ presentOrEdit: true,
948
+ tagDescription: {
949
+ tag: ExternalVideoTagDataConsts.TagName,
950
+ displayValue: BodyTagsExtensions.getDescription(data.type)
951
+ },
952
+ attributes: fileData,
953
+ innerHtml: ""
954
+ };
955
+ }
956
+ if (data.type === HtmlRawTagDataConsts.TagName) {
957
+ return {
958
+ presentOrEdit: true,
959
+ tagDescription: {
960
+ tag: HtmlRawTagDataConsts.TagName,
961
+ displayValue: BodyTagsExtensions.getDescription(data.type)
962
+ },
963
+ attributes: {},
964
+ innerHtml: BodyTagsExtensions.sanitizeInnerHtml(data.data["innerHTML"])
965
+ };
966
+ }
967
+ return {
968
+ presentOrEdit: true,
969
+ tagDescription: {
970
+ tag: "unsupported-tag",
971
+ displayValue: "Неподдерживаемый тег"
972
+ },
973
+ attributes: {},
974
+ innerHtml: JSON.stringify(data)
975
+ };
976
+ }
977
+ }
978
+
979
+ class XmlExtensions {
980
+ static formatXml(xml, tab = '\t') {
981
+ var formatted = '', indent = '';
982
+ tab = tab || '\t';
983
+ xml.split(/>\s*</).forEach(function (node) {
984
+ if (node.match(/^\/\w/))
985
+ indent = indent.substring(tab.length); // decrease indent by one 'tab'
986
+ formatted += indent + '<' + node + '>\r\n';
987
+ if (node.match(/^<?\w[^>]*[^\/]$/))
988
+ indent += tab; // increase indent
989
+ });
990
+ return formatted.substring(1, formatted.length - 3);
991
+ }
992
+ static tagsToLower(xml) {
993
+ xml = this.replaceTagToLower(xml, "Body");
994
+ xml = this.replaceTagToLower(xml, "Image");
995
+ xml = this.replaceTagToLower(xml, "Text");
996
+ return xml;
997
+ }
998
+ static replaceTagToLower(xml, tag) {
999
+ return xml
1000
+ .replace(new RegExp(`<${tag}`, 'g'), `<${tag.toLowerCase()}`)
1001
+ .replace(new RegExp(`</${tag}>`, 'g'), `</${tag.toLowerCase()}>`);
1002
+ }
1003
+ }
1004
+
1005
+ class TextEditorComponent {
1006
+ constructor() {
1007
+ this.myForm = new FormGroup({
1008
+ "innerHtml": new FormControl()
1009
+ });
1010
+ this.onTagUpdated = new EventEmitter();
1011
+ }
1012
+ ngOnInit() {
1013
+ }
1014
+ getInnerHtml() {
1015
+ return `<${this.tag.tagDescription.tag}>${this.tag.innerHtml}<${this.tag.tagDescription.tag}/>`;
1016
+ }
1017
+ }
1018
+ TextEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TextEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1019
+ 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"] }] });
1020
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TextEditorComponent, decorators: [{
1021
+ type: Component,
1022
+ 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: [""] }]
1023
+ }], ctorParameters: function () { return []; }, propDecorators: { tag: [{
1024
+ type: Input
1025
+ }], onTagUpdated: [{
1026
+ type: Output
1027
+ }] } });
1028
+
1029
+ class MainEditorBlockComponent {
1030
+ constructor() {
1031
+ this.textTags = TextMethods.textTags;
1032
+ this.onTagSaved = new EventEmitter();
1033
+ this.onTagRemoved = new EventEmitter();
1034
+ }
1035
+ tagUpdatedHandler(tag) {
1036
+ }
1037
+ save() {
1038
+ this.tag.presentOrEdit = true;
1039
+ this.onTagSaved.emit(this.tag);
1040
+ }
1041
+ deleteItem() {
1042
+ this.onTagRemoved.emit(this.tag);
1043
+ }
1044
+ ngOnInit() {
1045
+ }
1046
+ }
1047
+ MainEditorBlockComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: MainEditorBlockComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1048
+ 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"] }] });
1049
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: MainEditorBlockComponent, decorators: [{
1050
+ type: Component,
1051
+ 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: [""] }]
1052
+ }], ctorParameters: function () { return []; }, propDecorators: { tag: [{
1053
+ type: Input
1054
+ }], onTagSaved: [{
1055
+ type: Output
1056
+ }], onTagRemoved: [{
1057
+ type: Output
1058
+ }] } });
1059
+
1060
+ class DefaultTags {
1061
+ static getTags(useHtmlRaw) {
1062
+ var result = [...DefaultTags.tags];
1063
+ if (useHtmlRaw) {
1064
+ result.push(DefaultTags.htmlRawTag);
1065
+ }
1066
+ return result;
1067
+ }
1068
+ }
1069
+ DefaultTags.tags = [
1070
+ { tag: FileImageTagDataConsts.TagName, displayValue: 'Изображение' },
1071
+ { tag: ExternalVideoTagDataConsts.TagName, displayValue: 'Внешнее видео Youtube' },
1072
+ { tag: 'text', displayValue: 'Текст' },
1073
+ { tag: 'h1', displayValue: 'Заголовок 1 уровня' },
1074
+ { tag: 'h2', displayValue: 'Заголовок 2 уровня' },
1075
+ { tag: 'h3', displayValue: 'Заголовок 3 уровня' },
1076
+ { tag: 'h4', displayValue: 'Заголовок 4 уровня' },
1077
+ { tag: 'h5', displayValue: 'Заголовок 5 уровня' },
1078
+ { tag: 'h6', displayValue: 'Заголовок 6 уровня' },
1079
+ ];
1080
+ DefaultTags.htmlRawTag = {
1081
+ tag: HtmlRawTagDataConsts.TagName, displayValue: 'Html разметка'
1082
+ };
1083
+ class VisualEditorComponent {
1084
+ constructor(_cdref) {
1085
+ this._cdref = _cdref;
1086
+ this.isLoading = false;
1087
+ this.loadingText = "Идёт загрузка";
1088
+ this.showMarkUp = true;
1089
+ this.myForm = new FormGroup({
1090
+ "html": new FormControl(),
1091
+ });
1092
+ this.tags = [];
1093
+ this.useHtmlRaw = false;
1094
+ this.html = "";
1095
+ this.onHtmlChanged = new EventEmitter();
1096
+ this.rendered = new EventEmitter();
1097
+ this.bodyTags = [];
1098
+ }
1099
+ isHtmlSet() {
1100
+ return this.html.startsWith("<body>");
1101
+ }
1102
+ clearHtml() {
1103
+ this.html = "";
1104
+ this.recalculateBodyTags();
1105
+ }
1106
+ getHtml() {
1107
+ this.recalculateHtml();
1108
+ return this.html;
1109
+ }
1110
+ ngAfterViewInit() {
1111
+ this.rendered.emit(true);
1112
+ }
1113
+ ngAfterContentChecked() {
1114
+ this._cdref.detectChanges();
1115
+ }
1116
+ addTag() {
1117
+ let tagDescription = this.tags
1118
+ .find(x => x.tag === this.selectedValue);
1119
+ let attrs = {};
1120
+ let innerHtml = "";
1121
+ if (TextMethods.textTags.includes(tagDescription.tag)) {
1122
+ attrs["h-align"] = "left";
1123
+ innerHtml = "Введите ваш текст";
1124
+ }
1125
+ else if (tagDescription.tag == ExternalVideoTagDataConsts.TagName) {
1126
+ attrs[ExternalVideoTagDataConsts.VideoTypeAttrName] = ExternalVideoSupportedTypes.Youtube;
1127
+ attrs[ExternalVideoTagDataConsts.LinkAttrName] = null;
1128
+ }
1129
+ else {
1130
+ attrs[FileImageTagDataConsts.FileIdAttrName] = null;
1131
+ }
1132
+ this.bodyTags.push({
1133
+ tagDescription,
1134
+ innerHtml,
1135
+ attributes: attrs,
1136
+ presentOrEdit: true
1137
+ });
1138
+ this.recalculateHtml();
1139
+ }
1140
+ postFilesStartedEventHandler(model) {
1141
+ this.loadingText = "Файлы загружаются на сервер";
1142
+ this.isLoading = true;
1143
+ }
1144
+ addTagCustom(tag) {
1145
+ this.bodyTags.push(tag);
1146
+ this.recalculateHtml();
1147
+ }
1148
+ filesTagsReadyHandler(tags) {
1149
+ for (let i = 0; i < tags.length; i++) {
1150
+ this.bodyTags.push(tags[i]);
1151
+ }
1152
+ this.recalculateHtml();
1153
+ this.isLoading = false;
1154
+ }
1155
+ drop(event) {
1156
+ moveItemInArray(this.bodyTags, event.previousIndex, event.currentIndex);
1157
+ this.recalculateHtml();
1158
+ }
1159
+ onTagSavedHandler(tag) {
1160
+ this.recalculateHtml();
1161
+ }
1162
+ onTagRemovedHandler(index) {
1163
+ this.bodyTags.splice(index, 1);
1164
+ this.recalculateHtml();
1165
+ }
1166
+ recalculateHtml() {
1167
+ let result = BodyTagsExtensions.toHtml(this.bodyTags);
1168
+ this.html = XmlExtensions.formatXml("<body>" + result + "</body>");
1169
+ this.onHtmlChanged.emit(this.html);
1170
+ }
1171
+ recalculateBodyTags() {
1172
+ this.bodyTags = BodyTagsExtensions.getBodyTags(this.html);
1173
+ }
1174
+ ngOnInit() {
1175
+ this.recalculateBodyTags();
1176
+ this.tags = DefaultTags.getTags(this.useHtmlRaw);
1177
+ this.selectedValue = this.tags[0].tag;
1178
+ }
1179
+ }
1180
+ VisualEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: VisualEditorComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1181
+ 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"] }] });
1182
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: VisualEditorComponent, decorators: [{
1183
+ type: Component,
1184
+ 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"] }]
1185
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { showMarkUp: [{
1186
+ type: Input
1187
+ }], useHtmlRaw: [{
1188
+ type: Input
1189
+ }], html: [{
1190
+ type: Input
1191
+ }, {
1192
+ type: Output
1193
+ }], onHtmlChanged: [{
1194
+ type: Output
1195
+ }], rendered: [{
1196
+ type: Output
1197
+ }] } });
1198
+
1199
+ class XmlTagTextViewComponent {
1200
+ constructor() { }
1201
+ ngOnInit() {
1202
+ }
1203
+ }
1204
+ XmlTagTextViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: XmlTagTextViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1205
+ 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"] }] });
1206
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: XmlTagTextViewComponent, decorators: [{
1207
+ type: Component,
1208
+ 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: [""] }]
1209
+ }], ctorParameters: function () { return []; }, propDecorators: { item: [{
1210
+ type: Input
1211
+ }] } });
1212
+
1213
+ class XmlTagHeaderInnerTextViewComponent {
1214
+ constructor() { }
1215
+ ngOnInit() {
1216
+ }
1217
+ }
1218
+ XmlTagHeaderInnerTextViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: XmlTagHeaderInnerTextViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1219
+ 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"] }] });
1220
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: XmlTagHeaderInnerTextViewComponent, decorators: [{
1221
+ type: Component,
1222
+ 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: [""] }]
1223
+ }], ctorParameters: function () { return []; }, propDecorators: { item: [{
1224
+ type: Input
1225
+ }] } });
1226
+
1227
+ class XmlTagHeaderTextViewComponent {
1228
+ constructor() { }
1229
+ ngOnInit() {
1230
+ }
1231
+ }
1232
+ XmlTagHeaderTextViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: XmlTagHeaderTextViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1233
+ 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"] }] });
1234
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: XmlTagHeaderTextViewComponent, decorators: [{
1235
+ type: Component,
1236
+ 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: [""] }]
1237
+ }], ctorParameters: function () { return []; }, propDecorators: { item: [{
1238
+ type: Input
1239
+ }] } });
1240
+
1241
+ class XmlTagHtmlViewComponent {
1242
+ constructor() {
1243
+ this.html = "";
1244
+ }
1245
+ }
1246
+ XmlTagHtmlViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: XmlTagHtmlViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1247
+ 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: [""] });
1248
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: XmlTagHtmlViewComponent, decorators: [{
1249
+ type: Component,
1250
+ args: [{ selector: 'croco-html-xml-tag-html-view', template: "<div class=\"col\" [innerHTML]=\"html\">\r\n \r\n</div>", styles: [""] }]
1251
+ }], ctorParameters: function () { return []; }, propDecorators: { html: [{
1252
+ type: Input
1253
+ }] } });
1254
+
1255
+ class XmlTagViewComponent {
1256
+ constructor() {
1257
+ this.data = [];
1258
+ }
1259
+ }
1260
+ XmlTagViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: XmlTagViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1261
+ 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 });
1262
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: XmlTagViewComponent, decorators: [{
1263
+ type: Component,
1264
+ 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"] }]
1265
+ }], ctorParameters: function () { return []; }, propDecorators: { data: [{
1266
+ type: Input
1267
+ }] } });
1268
+
1269
+ class ToPreviewPipe {
1270
+ transform(value) {
1271
+ return HtmlExtractionMethods.transformHtmlStringToBlocks(value);
1272
+ }
1273
+ }
1274
+ ToPreviewPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ToPreviewPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1275
+ ToPreviewPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ToPreviewPipe, name: "topreview" });
1276
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ToPreviewPipe, decorators: [{
1277
+ type: Pipe,
1278
+ args: [{
1279
+ name: 'topreview'
1280
+ }]
1281
+ }] });
1282
+
1283
+ class MainEditorComponent {
1284
+ constructor(_clipboardService, _snackBar, _cdref) {
1285
+ this._clipboardService = _clipboardService;
1286
+ this._snackBar = _snackBar;
1287
+ this._cdref = _cdref;
1288
+ this.visualEditorRendered = false;
1289
+ this.showMarkUp = true;
1290
+ this.useHtmlRaw = false;
1291
+ this.myForm = new FormGroup({
1292
+ "html": new FormControl(),
1293
+ });
1294
+ this.html = "";
1295
+ this.onHtmlChanged = new EventEmitter();
1296
+ }
1297
+ ngAfterContentChecked() {
1298
+ this._cdref.detectChanges();
1299
+ }
1300
+ visualEditorRenderedHandler() {
1301
+ this.visualEditorRendered = true;
1302
+ this.recalculateBodyTags();
1303
+ }
1304
+ onHtmlChangedHandler(html) {
1305
+ this.html = html;
1306
+ this.onHtmlChanged.emit(html);
1307
+ }
1308
+ textAreaModelChangedHandler() {
1309
+ this.recalculateBodyTags();
1310
+ this.onHtmlChangedHandler(this.html);
1311
+ }
1312
+ recalculateBodyTags() {
1313
+ this.visualEditor.html = this.html;
1314
+ this.visualEditor.recalculateBodyTags();
1315
+ }
1316
+ copyMarkUp() {
1317
+ this._snackBar.open("Разметка таблицы скопирована в буфер обмена", "Закрыть", { duration: 1500 });
1318
+ this._clipboardService.copy(this.html);
1319
+ }
1320
+ ngOnInit() {
1321
+ }
1322
+ }
1323
+ 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 });
1324
+ 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 } });
1325
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: MainEditorComponent, decorators: [{
1326
+ type: Component,
1327
+ 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"] }]
1328
+ }], ctorParameters: function () { return [{ type: i1$4.ClipboardService }, { type: i2$4.MatSnackBar }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { visualEditor: [{
1329
+ type: ViewChild,
1330
+ args: ["visualEditor"]
1331
+ }], showMarkUp: [{
1332
+ type: Input
1333
+ }], useHtmlRaw: [{
1334
+ type: Input
1335
+ }], html: [{
1336
+ type: Input
1337
+ }, {
1338
+ type: Output
1339
+ }], onHtmlChanged: [{
1340
+ type: Output
1341
+ }] } });
1342
+
1343
+ class RichTextToHtmlPipe {
1344
+ transform(value) {
1345
+ let result = "";
1346
+ for (let i = 0; i < value.data.children.length; i++) {
1347
+ const child = value.data.children[i];
1348
+ if (child.type === "text-block") {
1349
+ result += `<span>${child.data.text}</span>`;
1350
+ }
1351
+ else if (child.type === "line-break") {
1352
+ result += "</br>";
1353
+ }
1354
+ }
1355
+ return result;
1356
+ }
1357
+ }
1358
+ RichTextToHtmlPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: RichTextToHtmlPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1359
+ RichTextToHtmlPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: RichTextToHtmlPipe, name: "richTextToHtml" });
1360
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: RichTextToHtmlPipe, decorators: [{
1361
+ type: Pipe,
1362
+ args: [{
1363
+ name: 'richTextToHtml'
1364
+ }]
1365
+ }] });
1366
+
1367
+ class XmlTagRichTextViewComponent {
1368
+ constructor() {
1369
+ this.richTextData = null;
1370
+ }
1371
+ ngOnInit() {
1372
+ }
1373
+ }
1374
+ XmlTagRichTextViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: XmlTagRichTextViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1375
+ 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 } });
1376
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: XmlTagRichTextViewComponent, decorators: [{
1377
+ type: Component,
1378
+ args: [{ selector: 'croco-html-xml-tag-rich-text-view', template: "<div *ngIf=\"richTextData\" [innerHtml]=\"richTextData | richTextToHtml\">\r\n</div>", styles: [""] }]
1379
+ }], ctorParameters: function () { return []; }, propDecorators: { richTextData: [{
1380
+ type: Input
1381
+ }] } });
1382
+
1383
+ class XmlTagTableViewComponent {
1384
+ constructor() {
1385
+ this.displayedColumns = [];
1386
+ }
1387
+ }
1388
+ XmlTagTableViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: XmlTagTableViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1389
+ 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"] }] });
1390
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: XmlTagTableViewComponent, decorators: [{
1391
+ type: Component,
1392
+ 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: [""] }]
1393
+ }], propDecorators: { displayedColumns: [{
1394
+ type: Input
1395
+ }], data: [{
1396
+ type: Input
1397
+ }] } });
1398
+
1399
+ class TagToSpanPipe {
1400
+ transform(value) {
1401
+ return value.map(x => (`<b>${x}</b>`)).join(' | ');
1402
+ }
1403
+ }
1404
+ TagToSpanPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TagToSpanPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1405
+ TagToSpanPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TagToSpanPipe, name: "tagToSpan" });
1406
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: TagToSpanPipe, decorators: [{
1407
+ type: Pipe,
1408
+ args: [{
1409
+ name: 'tagToSpan'
1410
+ }]
1411
+ }] });
1412
+
1413
+ class ToHtmlBodyTagsPipe {
1414
+ transform(value) {
1415
+ return BodyTagsExtensions.getBodyTags(value);
1416
+ }
1417
+ }
1418
+ ToHtmlBodyTagsPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ToHtmlBodyTagsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1419
+ ToHtmlBodyTagsPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ToHtmlBodyTagsPipe, name: "tohtmlbodytags" });
1420
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ToHtmlBodyTagsPipe, decorators: [{
1421
+ type: Pipe,
1422
+ args: [{
1423
+ name: 'tohtmlbodytags'
1424
+ }]
1425
+ }] });
1426
+
1427
+ class TableBuilder {
1428
+ static getTableMarkUp(rows, cols, generateHeaders) {
1429
+ rows = +rows;
1430
+ cols = +cols;
1431
+ let result = "<table>";
1432
+ if (generateHeaders) {
1433
+ result += TableBuilder.getTableHeaderMarkUp(cols);
1434
+ }
1435
+ result += TableBuilder.getTableBodyMarkUp(cols, rows);
1436
+ result += "</table>";
1437
+ return XmlExtensions.formatXml(result);
1438
+ }
1439
+ static getTableHeaderMarkUp(cols) {
1440
+ let result = "<thead><tr>";
1441
+ for (let i = 0; i < cols; i++) {
1442
+ result += `<th>Колонка #${i + 1}</th>`;
1443
+ }
1444
+ result += "</tr></thead>";
1445
+ return result;
1446
+ }
1447
+ static getTableBodyMarkUp(cols, rows) {
1448
+ let result = "<tbody>";
1449
+ for (let row = 0; row < rows; row++) {
1450
+ result += "<tr>";
1451
+ for (let i = 0; i < cols; i++) {
1452
+ result += `<td>Ряд№${row + 1} Колонка #${i + 1}</td>`;
1453
+ }
1454
+ result += "</tr>";
1455
+ }
1456
+ result += "</tbody>";
1457
+ return result;
1458
+ }
1459
+ }
1460
+
1461
+ const EditorComponents = [
1462
+ MainEditorComponent,
1463
+ FileIdSelectComponent,
1464
+ TextEditorComponent,
1465
+ ExternalVideoBlockComponent,
1466
+ ImageEditorComponent,
1467
+ MainEditorBlockComponent,
1468
+ VisualEditorComponent,
1469
+ AddFilesBtnComponent,
1470
+ HtmlRawEditorComponent,
1471
+ ];
1472
+ const XmlComponents = [
1473
+ XmlTagTableViewComponent,
1474
+ XmlTagViewComponent,
1475
+ XmlTagRichTextViewComponent,
1476
+ XmlTagHtmlViewComponent,
1477
+ XmlTagTextViewComponent,
1478
+ XmlTagHeaderTextViewComponent,
1479
+ XmlTagHeaderInnerTextViewComponent,
1480
+ XmlTagExternalVideoComponent
1481
+ ];
1482
+ const CrocoPipes = [
1483
+ RichTextToHtmlPipe,
1484
+ TagToSpanPipe,
1485
+ ToPreviewPipe,
1486
+ ToHtmlBodyTagsPipe,
1487
+ ];
1488
+ const CrocoHtmlDeclarations = [
1489
+ UploadFilesBtnComponent,
1490
+ ...XmlComponents,
1491
+ ...EditorComponents,
1492
+ ...CrocoPipes
1493
+ ];
1494
+ const MaterialModules = [
1495
+ MatBadgeModule,
1496
+ MatTableModule,
1497
+ MatExpansionModule,
1498
+ MatFormFieldModule,
1499
+ MatSnackBarModule,
1500
+ MatProgressBarModule,
1501
+ MatProgressSpinnerModule,
1502
+ MatTabsModule,
1503
+ MatMenuModule,
1504
+ MatCardModule,
1505
+ MatSelectModule,
1506
+ MatTooltipModule,
1507
+ MatCheckboxModule,
1508
+ MatChipsModule,
1509
+ MatListModule,
1510
+ MatButtonModule,
1511
+ MatInputModule,
1512
+ MatDialogModule,
1513
+ MatPaginatorModule,
1514
+ MatDatepickerModule,
1515
+ MatGridListModule,
1516
+ MatSlideToggleModule,
1517
+ MatTreeModule,
1518
+ MatNativeDateModule,
1519
+ MatAutocompleteModule,
1520
+ MatSidenavModule,
1521
+ MatIconModule,
1522
+ DragDropModule,
1523
+ MatButtonToggleModule
1524
+ ];
1525
+
1526
+ class CrocoHtmlModule {
1527
+ }
1528
+ CrocoHtmlModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: CrocoHtmlModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1529
+ 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,
1530
+ FormsModule,
1531
+ ReactiveFormsModule,
1532
+ 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] });
1533
+ CrocoHtmlModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: CrocoHtmlModule, imports: [[
1534
+ CommonModule,
1535
+ FormsModule,
1536
+ ReactiveFormsModule,
1537
+ NgSelectModule,
1538
+ ...MaterialModules
1539
+ ]] });
1540
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: CrocoHtmlModule, decorators: [{
1541
+ type: NgModule,
1542
+ args: [{
1543
+ declarations: [
1544
+ ...CrocoHtmlDeclarations
1545
+ ],
1546
+ exports: [
1547
+ ...CrocoHtmlDeclarations,
1548
+ ],
1549
+ imports: [
1550
+ CommonModule,
1551
+ FormsModule,
1552
+ ReactiveFormsModule,
1553
+ NgSelectModule,
1554
+ ...MaterialModules
1555
+ ]
1556
+ }]
1557
+ }] });
1558
+
1559
+ /*
1560
+ * Public API Surface of croco-html
1561
+ */
1562
+
1563
+ /**
1564
+ * Generated bundle index. Do not edit.
1565
+ */
1566
+
1567
+ 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 };
1568
+ //# sourceMappingURL=croco-html.mjs.map