croco-html 0.2.20 → 2.0.0

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