croco-html 0.0.1

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 (100) hide show
  1. package/README.md +24 -0
  2. package/bundles/croco-html.umd.js +2091 -0
  3. package/bundles/croco-html.umd.js.map +1 -0
  4. package/croco-html.d.ts +5 -0
  5. package/esm2015/croco-html.js +5 -0
  6. package/esm2015/lib/components/add-files-btn/add-files-btn.component.js +57 -0
  7. package/esm2015/lib/components/editor/external-video-block/external-video-block.component.js +49 -0
  8. package/esm2015/lib/components/editor/html-raw-editor/html-raw-editor.component.js +29 -0
  9. package/esm2015/lib/components/editor/image-editor/image-editor.component.js +54 -0
  10. package/esm2015/lib/components/editor/index.js +8 -0
  11. package/esm2015/lib/components/editor/main-editor/main-editor.component.js +80 -0
  12. package/esm2015/lib/components/editor/main-editor-block/main-editor-block.component.js +45 -0
  13. package/esm2015/lib/components/editor/text-editor/text-editor.component.js +38 -0
  14. package/esm2015/lib/components/editor/visual-editor/visual-editor.component.js +165 -0
  15. package/esm2015/lib/components/file-id-select/file-id-select.component.js +66 -0
  16. package/esm2015/lib/components/index.js +6 -0
  17. package/esm2015/lib/components/upload-files-btn/upload-files-btn.component.js +58 -0
  18. package/esm2015/lib/components/xml-tags/index.js +9 -0
  19. package/esm2015/lib/components/xml-tags/xml-tag-external-video/xml-tag-external-video.component.js +47 -0
  20. package/esm2015/lib/components/xml-tags/xml-tag-header-inner-text-view/xml-tag-header-inner-text-view.component.js +21 -0
  21. package/esm2015/lib/components/xml-tags/xml-tag-header-text-view/xml-tag-header-text-view.component.js +22 -0
  22. package/esm2015/lib/components/xml-tags/xml-tag-html-view/xml-tag-html-view.component.js +20 -0
  23. package/esm2015/lib/components/xml-tags/xml-tag-rich-text-view/xml-tag-rich-text-view.component.js +24 -0
  24. package/esm2015/lib/components/xml-tags/xml-tag-table-view/xml-tag-table-view.component.js +24 -0
  25. package/esm2015/lib/components/xml-tags/xml-tag-text-view/xml-tag-text-view.component.js +21 -0
  26. package/esm2015/lib/components/xml-tags/xml-tag-view/xml-tag-view.component.js +26 -0
  27. package/esm2015/lib/croco-html.module.js +90 -0
  28. package/esm2015/lib/extensions/AngularMaterialTableMethods.js +64 -0
  29. package/esm2015/lib/extensions/BodyTagsExtensions.js +120 -0
  30. package/esm2015/lib/extensions/BootstrapTableMethods.js +67 -0
  31. package/esm2015/lib/extensions/HtmlExtractionMethods.js +63 -0
  32. package/esm2015/lib/extensions/HtmlRawTagDataConsts.js +4 -0
  33. package/esm2015/lib/extensions/ImageMethods.js +24 -0
  34. package/esm2015/lib/extensions/InterfaceBlock.js +2 -0
  35. package/esm2015/lib/extensions/TableBuilder.js +35 -0
  36. package/esm2015/lib/extensions/TableMethods.js +100 -0
  37. package/esm2015/lib/extensions/TextMethods.js +29 -0
  38. package/esm2015/lib/extensions/TextSimpleMethods.js +78 -0
  39. package/esm2015/lib/extensions/VideoMethods.js +20 -0
  40. package/esm2015/lib/extensions/XmlExtensions.js +26 -0
  41. package/esm2015/lib/extensions/index.js +13 -0
  42. package/esm2015/lib/index.js +113 -0
  43. package/esm2015/lib/models/models.js +2 -0
  44. package/esm2015/lib/pipes/RichTextToHtmlPipe.js +26 -0
  45. package/esm2015/lib/pipes/TagToSpanPipe.js +16 -0
  46. package/esm2015/lib/pipes/ToHtmlBodyTagsPipe.js +17 -0
  47. package/esm2015/lib/pipes/index.js +5 -0
  48. package/esm2015/lib/pipes/to-preview.pipe.js +17 -0
  49. package/esm2015/lib/services/file-upload.service.js +40 -0
  50. package/esm2015/lib/services/files-query.service.js +27 -0
  51. package/esm2015/public-api.js +8 -0
  52. package/fesm2015/croco-html.js +1634 -0
  53. package/fesm2015/croco-html.js.map +1 -0
  54. package/lib/components/add-files-btn/add-files-btn.component.d.ts +18 -0
  55. package/lib/components/editor/external-video-block/external-video-block.component.d.ts +19 -0
  56. package/lib/components/editor/html-raw-editor/html-raw-editor.component.d.ts +11 -0
  57. package/lib/components/editor/image-editor/image-editor.component.d.ts +20 -0
  58. package/lib/components/editor/index.d.ts +7 -0
  59. package/lib/components/editor/main-editor/main-editor.component.d.ts +28 -0
  60. package/lib/components/editor/main-editor-block/main-editor-block.component.d.ts +16 -0
  61. package/lib/components/editor/text-editor/text-editor.component.d.ts +14 -0
  62. package/lib/components/editor/visual-editor/visual-editor.component.d.ts +43 -0
  63. package/lib/components/file-id-select/file-id-select.component.d.ts +30 -0
  64. package/lib/components/index.d.ts +5 -0
  65. package/lib/components/upload-files-btn/upload-files-btn.component.d.ts +24 -0
  66. package/lib/components/xml-tags/index.d.ts +8 -0
  67. package/lib/components/xml-tags/xml-tag-external-video/xml-tag-external-video.component.d.ts +17 -0
  68. package/lib/components/xml-tags/xml-tag-header-inner-text-view/xml-tag-header-inner-text-view.component.d.ts +10 -0
  69. package/lib/components/xml-tags/xml-tag-header-text-view/xml-tag-header-text-view.component.d.ts +10 -0
  70. package/lib/components/xml-tags/xml-tag-html-view/xml-tag-html-view.component.d.ts +7 -0
  71. package/lib/components/xml-tags/xml-tag-rich-text-view/xml-tag-rich-text-view.component.d.ts +10 -0
  72. package/lib/components/xml-tags/xml-tag-table-view/xml-tag-table-view.component.d.ts +7 -0
  73. package/lib/components/xml-tags/xml-tag-text-view/xml-tag-text-view.component.d.ts +10 -0
  74. package/lib/components/xml-tags/xml-tag-view/xml-tag-view.component.d.ts +8 -0
  75. package/lib/croco-html.module.d.ts +60 -0
  76. package/lib/extensions/AngularMaterialTableMethods.d.ts +10 -0
  77. package/lib/extensions/BodyTagsExtensions.d.ts +10 -0
  78. package/lib/extensions/BootstrapTableMethods.d.ts +9 -0
  79. package/lib/extensions/HtmlExtractionMethods.d.ts +69 -0
  80. package/lib/extensions/HtmlRawTagDataConsts.d.ts +3 -0
  81. package/lib/extensions/ImageMethods.d.ts +17 -0
  82. package/lib/extensions/InterfaceBlock.d.ts +4 -0
  83. package/lib/extensions/TableBuilder.d.ts +5 -0
  84. package/lib/extensions/TableMethods.d.ts +58 -0
  85. package/lib/extensions/TextMethods.d.ts +19 -0
  86. package/lib/extensions/TextSimpleMethods.d.ts +23 -0
  87. package/lib/extensions/VideoMethods.d.ts +19 -0
  88. package/lib/extensions/XmlExtensions.d.ts +5 -0
  89. package/lib/extensions/index.d.ts +10 -0
  90. package/lib/index.d.ts +20 -0
  91. package/lib/models/models.d.ts +10 -0
  92. package/lib/pipes/RichTextToHtmlPipe.d.ts +8 -0
  93. package/lib/pipes/TagToSpanPipe.d.ts +7 -0
  94. package/lib/pipes/ToHtmlBodyTagsPipe.d.ts +8 -0
  95. package/lib/pipes/index.d.ts +4 -0
  96. package/lib/pipes/to-preview.pipe.d.ts +8 -0
  97. package/lib/services/file-upload.service.d.ts +23 -0
  98. package/lib/services/files-query.service.d.ts +42 -0
  99. package/package.json +23 -0
  100. package/public-api.d.ts +4 -0
@@ -0,0 +1,2091 @@
1
+ (function (global, factory) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common/http'), require('@angular/material/button'), require('@angular/forms'), require('@angular/platform-browser'), require('@angular/common'), require('@angular/material/form-field'), require('@angular/material/input'), require('@angular/cdk/text-field'), require('@angular/material/button-toggle'), require('@angular/material/icon'), require('@ng-select/ng-select'), require('ngx-clipboard'), require('@angular/material/snack-bar'), require('@angular/material/tabs'), require('@angular/cdk/drag-drop'), require('@angular/material/progress-spinner'), require('@angular/material/card'), require('@angular/material/chips'), require('@angular/material/select'), require('@angular/material/core'), require('@angular/material/table'), require('@angular/material/tooltip'), require('@angular/material/checkbox'), require('@angular/material/autocomplete'), require('@angular/material/datepicker'), require('@angular/material/dialog'), require('@angular/material/expansion'), require('@angular/material/grid-list'), require('@angular/material/list'), require('@angular/material/menu'), require('@angular/material/paginator'), require('@angular/material/progress-bar'), require('@angular/material/sidenav'), require('@angular/material/slide-toggle'), require('@angular/material/tree'), require('@angular/material/badge')) :
3
+ typeof define === 'function' && define.amd ? define('croco-html', ['exports', '@angular/core', '@angular/common/http', '@angular/material/button', '@angular/forms', '@angular/platform-browser', '@angular/common', '@angular/material/form-field', '@angular/material/input', '@angular/cdk/text-field', '@angular/material/button-toggle', '@angular/material/icon', '@ng-select/ng-select', 'ngx-clipboard', '@angular/material/snack-bar', '@angular/material/tabs', '@angular/cdk/drag-drop', '@angular/material/progress-spinner', '@angular/material/card', '@angular/material/chips', '@angular/material/select', '@angular/material/core', '@angular/material/table', '@angular/material/tooltip', '@angular/material/checkbox', '@angular/material/autocomplete', '@angular/material/datepicker', '@angular/material/dialog', '@angular/material/expansion', '@angular/material/grid-list', '@angular/material/list', '@angular/material/menu', '@angular/material/paginator', '@angular/material/progress-bar', '@angular/material/sidenav', '@angular/material/slide-toggle', '@angular/material/tree', '@angular/material/badge'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["croco-html"] = {}, global.ng.core, global.ng.common.http, global.ng.material.button, global.ng.forms, global.ng.platformBrowser, global.ng.common, global.ng.material.formField, global.ng.material.input, global.ng.cdk.textField, global.ng.material.buttonToggle, global.ng.material.icon, global.i3, global.i1$4, global.ng.material.snackBar, global.ng.material.tabs, global.ng.cdk.dragDrop, global.ng.material.progressSpinner, global.ng.material.card, global.ng.material.chips, global.ng.material.select, global.ng.material.core, global.ng.material.table, global.ng.material.tooltip, global.ng.material.checkbox, global.ng.material.autocomplete, global.ng.material.datepicker, global.ng.material.dialog, global.ng.material.expansion, global.ng.material.gridList, global.ng.material.list, global.ng.material.menu, global.ng.material.paginator, global.ng.material.progressBar, global.ng.material.sidenav, global.ng.material.slideToggle, global.ng.material.tree, global.ng.material.badge));
5
+ })(this, (function (exports, i0, i1, i2, i5, i1$1, i2$1, i5$1, i5$2, i4, i1$2, i2$2, i3, i1$4, i2$4, i3$2, i11, i1$3, i2$3, i3$1, i6, i7, i1$5, i34, i35, i47, i42, i40, i25, i43, i37, i31, i41, i28, i48, i44, i45, i23) { 'use strict';
6
+
7
+ function _interopNamespace(e) {
8
+ if (e && e.__esModule) return e;
9
+ var n = Object.create(null);
10
+ if (e) {
11
+ Object.keys(e).forEach(function (k) {
12
+ if (k !== 'default') {
13
+ var d = Object.getOwnPropertyDescriptor(e, k);
14
+ Object.defineProperty(n, k, d.get ? d : {
15
+ enumerable: true,
16
+ get: function () { return e[k]; }
17
+ });
18
+ }
19
+ });
20
+ }
21
+ n["default"] = e;
22
+ return Object.freeze(n);
23
+ }
24
+
25
+ var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
26
+ var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
27
+ var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
28
+ var i5__namespace$1 = /*#__PURE__*/_interopNamespace(i5);
29
+ var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$1);
30
+ var i2__namespace$1 = /*#__PURE__*/_interopNamespace(i2$1);
31
+ var i5__namespace = /*#__PURE__*/_interopNamespace(i5$1);
32
+ var i5__namespace$2 = /*#__PURE__*/_interopNamespace(i5$2);
33
+ var i4__namespace = /*#__PURE__*/_interopNamespace(i4);
34
+ var i1__namespace$2 = /*#__PURE__*/_interopNamespace(i1$2);
35
+ var i2__namespace$2 = /*#__PURE__*/_interopNamespace(i2$2);
36
+ var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
37
+ var i1__namespace$4 = /*#__PURE__*/_interopNamespace(i1$4);
38
+ var i2__namespace$4 = /*#__PURE__*/_interopNamespace(i2$4);
39
+ var i3__namespace$2 = /*#__PURE__*/_interopNamespace(i3$2);
40
+ var i11__namespace = /*#__PURE__*/_interopNamespace(i11);
41
+ var i1__namespace$3 = /*#__PURE__*/_interopNamespace(i1$3);
42
+ var i2__namespace$3 = /*#__PURE__*/_interopNamespace(i2$3);
43
+ var i3__namespace$1 = /*#__PURE__*/_interopNamespace(i3$1);
44
+ var i6__namespace = /*#__PURE__*/_interopNamespace(i6);
45
+ var i7__namespace = /*#__PURE__*/_interopNamespace(i7);
46
+ var i1__namespace$5 = /*#__PURE__*/_interopNamespace(i1$5);
47
+ var i34__namespace = /*#__PURE__*/_interopNamespace(i34);
48
+ var i35__namespace = /*#__PURE__*/_interopNamespace(i35);
49
+ var i47__namespace = /*#__PURE__*/_interopNamespace(i47);
50
+ var i42__namespace = /*#__PURE__*/_interopNamespace(i42);
51
+ var i40__namespace = /*#__PURE__*/_interopNamespace(i40);
52
+ var i25__namespace = /*#__PURE__*/_interopNamespace(i25);
53
+ var i43__namespace = /*#__PURE__*/_interopNamespace(i43);
54
+ var i37__namespace = /*#__PURE__*/_interopNamespace(i37);
55
+ var i31__namespace = /*#__PURE__*/_interopNamespace(i31);
56
+ var i41__namespace = /*#__PURE__*/_interopNamespace(i41);
57
+ var i28__namespace = /*#__PURE__*/_interopNamespace(i28);
58
+ var i48__namespace = /*#__PURE__*/_interopNamespace(i48);
59
+ var i44__namespace = /*#__PURE__*/_interopNamespace(i44);
60
+ var i45__namespace = /*#__PURE__*/_interopNamespace(i45);
61
+ var i23__namespace = /*#__PURE__*/_interopNamespace(i23);
62
+
63
+ var FileImageTagDataConsts = /** @class */ (function () {
64
+ function FileImageTagDataConsts() {
65
+ }
66
+ return FileImageTagDataConsts;
67
+ }());
68
+ FileImageTagDataConsts.TagName = "file-image";
69
+ FileImageTagDataConsts.FileIdAttrName = "file-id";
70
+ var ImageMethods = /** @class */ (function () {
71
+ function ImageMethods() {
72
+ }
73
+ ImageMethods.buildUrl = function (fileId) {
74
+ return "/FileCopies/Images/Medium/" + fileId + ".jpg";
75
+ };
76
+ ImageMethods.buildSmallUrl = function (fileId) {
77
+ return "/FileCopies/Images/Small/" + fileId + ".jpg";
78
+ };
79
+ ImageMethods.ExtractImage = function (elem) {
80
+ var fileId = +elem.getAttribute(FileImageTagDataConsts.FileIdAttrName);
81
+ var src = ImageMethods.buildUrl(fileId);
82
+ return {
83
+ type: FileImageTagDataConsts.TagName,
84
+ data: {
85
+ src: src,
86
+ fileId: fileId,
87
+ }
88
+ };
89
+ };
90
+ return ImageMethods;
91
+ }());
92
+
93
+ var FileUploadService = /** @class */ (function () {
94
+ function FileUploadService(_httpClient, baseUrl) {
95
+ this._httpClient = _httpClient;
96
+ this.baseUrl = baseUrl;
97
+ }
98
+ FileUploadService.prototype.postFile = function (file, createLocalCopiesNow) {
99
+ if (createLocalCopiesNow === void 0) { createLocalCopiesNow = false; }
100
+ var formData = new FormData();
101
+ formData.append("fileKey1", file, file.name);
102
+ return this.postFilesInner(formData, createLocalCopiesNow);
103
+ };
104
+ FileUploadService.prototype.postFiles = function (files, createLocalCopiesNow) {
105
+ if (createLocalCopiesNow === void 0) { createLocalCopiesNow = false; }
106
+ var formData = new FormData();
107
+ for (var i = 0; i < files.length; i++) {
108
+ var fileToUpload = files.item(i);
109
+ formData.append("fileKey" + i, fileToUpload, fileToUpload === null || fileToUpload === void 0 ? void 0 : fileToUpload.name);
110
+ }
111
+ return this.postFilesInner(formData, createLocalCopiesNow);
112
+ };
113
+ FileUploadService.prototype.postFilesInner = function (formData, createLocalCopiesNow) {
114
+ if (createLocalCopiesNow === void 0) { createLocalCopiesNow = false; }
115
+ var endpoint = this.baseUrl + 'Api/Files/UploadFiles';
116
+ if (createLocalCopiesNow) {
117
+ endpoint += '/Now';
118
+ }
119
+ return this._httpClient
120
+ .post(endpoint, formData);
121
+ };
122
+ return FileUploadService;
123
+ }());
124
+ FileUploadService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: FileUploadService, deps: [{ token: i1__namespace.HttpClient }, { token: 'BASE_URL' }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
125
+ FileUploadService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: FileUploadService, providedIn: 'root' });
126
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: FileUploadService, decorators: [{
127
+ type: i0.Injectable,
128
+ args: [{ providedIn: 'root' }]
129
+ }], ctorParameters: function () {
130
+ return [{ type: i1__namespace.HttpClient }, { type: undefined, decorators: [{
131
+ type: i0.Inject,
132
+ args: ['BASE_URL']
133
+ }] }];
134
+ } });
135
+
136
+ var UploadFilesBtnComponent = /** @class */ (function () {
137
+ function UploadFilesBtnComponent(_fileUploadService) {
138
+ this._fileUploadService = _fileUploadService;
139
+ this.extAccepts = "*/*";
140
+ this.isMultiple = true;
141
+ this.btnText = "Загрузить файлы";
142
+ this.createLocalCopiesNow = false;
143
+ this.hidden = false;
144
+ this.postFilesStarted = new i0.EventEmitter();
145
+ this.onFilesUploaded = new i0.EventEmitter();
146
+ }
147
+ UploadFilesBtnComponent.prototype.handleFileInput = function (files) {
148
+ var _this = this;
149
+ this.postFilesStarted.emit({
150
+ filesCount: files.length,
151
+ createLocalCopiesNow: this.createLocalCopiesNow
152
+ });
153
+ this._fileUploadService.postFiles(files, this.createLocalCopiesNow).subscribe(function (data) {
154
+ _this.onFilesUploaded.emit(data);
155
+ });
156
+ };
157
+ UploadFilesBtnComponent.prototype.clickFileInput = function () {
158
+ this.fileInput.nativeElement.click();
159
+ };
160
+ UploadFilesBtnComponent.prototype.ngOnInit = function () {
161
+ };
162
+ return UploadFilesBtnComponent;
163
+ }());
164
+ UploadFilesBtnComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: UploadFilesBtnComponent, deps: [{ token: FileUploadService }], target: i0__namespace.ɵɵFactoryTarget.Component });
165
+ UploadFilesBtnComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.5", type: UploadFilesBtnComponent, selector: "app-upload-files-btn", inputs: { extAccepts: "extAccepts", isMultiple: "isMultiple", btnText: "btnText", createLocalCopiesNow: "createLocalCopiesNow", hidden: "hidden" }, outputs: { postFilesStarted: "postFilesStarted", onFilesUploaded: "onFilesUploaded" }, viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["filesInput"], descendants: true }], ngImport: i0__namespace, template: "<button [hidden]=\"hidden\" mat-raised-button color=\"primary\" (click)=\"filesInput.click()\">{{btnText}}</button>\n<input [hidden]=\"true\" [accept]=\"extAccepts\" [multiple]=\"isMultiple\" type=\"file\" #filesInput (change)=\"handleFileInput($event.target.files)\" />", styles: [""], components: [{ type: i2__namespace.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }] });
166
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: UploadFilesBtnComponent, decorators: [{
167
+ type: i0.Component,
168
+ args: [{
169
+ selector: 'app-upload-files-btn',
170
+ templateUrl: './upload-files-btn.component.html',
171
+ styleUrls: ['./upload-files-btn.component.css']
172
+ }]
173
+ }], ctorParameters: function () { return [{ type: FileUploadService }]; }, propDecorators: { fileInput: [{
174
+ type: i0.ViewChild,
175
+ args: ['filesInput']
176
+ }], extAccepts: [{
177
+ type: i0.Input
178
+ }], isMultiple: [{
179
+ type: i0.Input
180
+ }], btnText: [{
181
+ type: i0.Input
182
+ }], createLocalCopiesNow: [{
183
+ type: i0.Input
184
+ }], hidden: [{
185
+ type: i0.Input
186
+ }], postFilesStarted: [{
187
+ type: i0.Output
188
+ }], onFilesUploaded: [{
189
+ type: i0.Output
190
+ }] } });
191
+
192
+ var AddFilesBtnComponent = /** @class */ (function () {
193
+ function AddFilesBtnComponent() {
194
+ this.postFilesStarted = new i0.EventEmitter();
195
+ this.fileIds = [];
196
+ this.filesTagsReady = new i0.EventEmitter();
197
+ }
198
+ AddFilesBtnComponent.prototype.postFilesStartedEventHandler = function (data) {
199
+ this.postFilesStarted.emit(data);
200
+ };
201
+ AddFilesBtnComponent.prototype.filesUploadedHandler = function (data) {
202
+ var _a;
203
+ this.fileIds = data.responseObject;
204
+ var fileTags = [];
205
+ for (var i = 0; i < this.fileIds.length; i++) {
206
+ var fileTag = {
207
+ presentOrEdit: true,
208
+ tagDescription: {
209
+ tag: FileImageTagDataConsts.TagName,
210
+ displayValue: "Изображение"
211
+ },
212
+ attributes: (_a = {},
213
+ _a[FileImageTagDataConsts.FileIdAttrName] = this.fileIds[i],
214
+ _a),
215
+ innerHtml: ""
216
+ };
217
+ fileTags.push(fileTag);
218
+ }
219
+ this.filesTagsReady.emit(fileTags);
220
+ };
221
+ AddFilesBtnComponent.prototype.handleClick = function () {
222
+ this.fakeBtn.clickFileInput();
223
+ };
224
+ AddFilesBtnComponent.prototype.ngOnInit = function () {
225
+ };
226
+ return AddFilesBtnComponent;
227
+ }());
228
+ AddFilesBtnComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: AddFilesBtnComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
229
+ AddFilesBtnComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.5", type: AddFilesBtnComponent, selector: "croco-add-files-btn", outputs: { postFilesStarted: "postFilesStarted", filesTagsReady: "filesTagsReady" }, viewQueries: [{ propertyName: "fakeBtn", first: true, predicate: ["fakeBtn"], descendants: true }], ngImport: i0__namespace, template: "<div [hidden]=\"true\">\n <app-upload-files-btn #fakeBtn \n (onFilesUploaded)=\"filesUploadedHandler($event)\" \n [btnText]=\"'\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F'\"\n [createLocalCopiesNow]=\"true\"\n (postFilesStarted)=\"postFilesStartedEventHandler($event)\" \n [extAccepts]=\"'image/*'\"></app-upload-files-btn>\n</div>\n\n<div>\n <button class=\"w-100\" \n (click)=\"handleClick()\"\n mat-stroked-button>\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F</button>\n</div>", styles: [""], components: [{ type: UploadFilesBtnComponent, selector: "app-upload-files-btn", inputs: ["extAccepts", "isMultiple", "btnText", "createLocalCopiesNow", "hidden"], outputs: ["postFilesStarted", "onFilesUploaded"] }, { type: i2__namespace.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }] });
230
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: AddFilesBtnComponent, decorators: [{
231
+ type: i0.Component,
232
+ args: [{
233
+ selector: 'croco-add-files-btn',
234
+ templateUrl: './add-files-btn.component.html',
235
+ styleUrls: ['./add-files-btn.component.css']
236
+ }]
237
+ }], ctorParameters: function () { return []; }, propDecorators: { postFilesStarted: [{
238
+ type: i0.Output
239
+ }], fakeBtn: [{
240
+ type: i0.ViewChild,
241
+ args: ["fakeBtn"]
242
+ }], filesTagsReady: [{
243
+ type: i0.Output
244
+ }] } });
245
+
246
+ var ExternalVideoTagDataConsts = /** @class */ (function () {
247
+ function ExternalVideoTagDataConsts() {
248
+ }
249
+ return ExternalVideoTagDataConsts;
250
+ }());
251
+ ExternalVideoTagDataConsts.TagName = "external-video";
252
+ ExternalVideoTagDataConsts.VideoTypeAttrName = "type";
253
+ ExternalVideoTagDataConsts.LinkAttrName = "link";
254
+ var ExternalVideoSupportedTypes = /** @class */ (function () {
255
+ function ExternalVideoSupportedTypes() {
256
+ }
257
+ return ExternalVideoSupportedTypes;
258
+ }());
259
+ ExternalVideoSupportedTypes.Youtube = "youtube";
260
+ var VideoMethods = /** @class */ (function () {
261
+ function VideoMethods() {
262
+ }
263
+ VideoMethods.ExtractExternalVideoTag = function (elem) {
264
+ return {
265
+ type: ExternalVideoTagDataConsts.TagName,
266
+ data: {
267
+ type: elem.getAttribute(ExternalVideoTagDataConsts.VideoTypeAttrName),
268
+ link: elem.getAttribute(ExternalVideoTagDataConsts.LinkAttrName)
269
+ }
270
+ };
271
+ };
272
+ return VideoMethods;
273
+ }());
274
+
275
+ var XmlTagExternalVideoComponent = /** @class */ (function () {
276
+ function XmlTagExternalVideoComponent(_domSanitizer) {
277
+ this._domSanitizer = _domSanitizer;
278
+ }
279
+ XmlTagExternalVideoComponent.prototype.getYouTubeId = function (youtubeLink) {
280
+ //https://www.youtube.com/watch?v=l3KfbfkxJOU
281
+ if (youtubeLink.includes("watch?v=")) {
282
+ var url = new URL(youtubeLink);
283
+ return url.searchParams.get("v");
284
+ }
285
+ //https://youtu.be/jzBneaWSswY
286
+ var bits = youtubeLink.split('/');
287
+ return bits[bits.length - 1];
288
+ };
289
+ XmlTagExternalVideoComponent.prototype.getWidgetLink = function (youtubeLink) {
290
+ var id = this.getYouTubeId(youtubeLink);
291
+ var result = "https://www.youtube.com/embed/" + id + "?controls=0";
292
+ this.widgetUrl = this._domSanitizer.bypassSecurityTrustResourceUrl(result);
293
+ return result;
294
+ };
295
+ XmlTagExternalVideoComponent.prototype.ngOnInit = function () {
296
+ if (this.data != null) {
297
+ this.tagData = this.data.data;
298
+ }
299
+ var youtubeWidgetLink = this.getWidgetLink(this.tagData.link);
300
+ this.widgetUrl = this._domSanitizer.bypassSecurityTrustResourceUrl(youtubeWidgetLink);
301
+ };
302
+ return XmlTagExternalVideoComponent;
303
+ }());
304
+ XmlTagExternalVideoComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: XmlTagExternalVideoComponent, deps: [{ token: i1__namespace$1.DomSanitizer }], target: i0__namespace.ɵɵFactoryTarget.Component });
305
+ XmlTagExternalVideoComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.5", type: XmlTagExternalVideoComponent, selector: "croco-html-xml-tag-external-video", inputs: { data: "data", tagData: "tagData" }, ngImport: i0__namespace, template: "<div class=\"d-flex justify-content-center\">\n <div *ngIf=\"widgetUrl\" class=\"y-video\">\n <iframe width=\"100%\" height=\"100%\" [src]=\"widgetUrl\"\n title=\"YouTube video player\" frameborder=\"0\"\n allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\"\n allowfullscreen></iframe>\n </div>\n</div>", styles: ["@media only screen and (min-width: 769px){.y-video{width:640px;height:360px;margin:0 auto}}@media only screen and (max-width: 768px){.y-video{width:560px;height:315px;margin:0 auto}}\n"], directives: [{ type: i2__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
306
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: XmlTagExternalVideoComponent, decorators: [{
307
+ type: i0.Component,
308
+ args: [{
309
+ selector: 'croco-html-xml-tag-external-video',
310
+ templateUrl: './xml-tag-external-video.component.html',
311
+ styleUrls: ['./xml-tag-external-video.component.css']
312
+ }]
313
+ }], ctorParameters: function () { return [{ type: i1__namespace$1.DomSanitizer }]; }, propDecorators: { data: [{
314
+ type: i0.Input
315
+ }], tagData: [{
316
+ type: i0.Input
317
+ }] } });
318
+
319
+ var ExternalVideoBlockComponent = /** @class */ (function () {
320
+ function ExternalVideoBlockComponent() {
321
+ this.onTagUpdated = new i0.EventEmitter();
322
+ this.myForm = new i5.FormGroup({
323
+ youtubeLink: new i5.FormControl()
324
+ });
325
+ this.defaultLink = "https://youtu.be/jzBneaWSswY";
326
+ this.data = {
327
+ youtubeLink: this.defaultLink
328
+ };
329
+ this.tagData = {
330
+ link: this.defaultLink,
331
+ type: ExternalVideoSupportedTypes.Youtube
332
+ };
333
+ }
334
+ ExternalVideoBlockComponent.prototype.linkChanged = function () {
335
+ this.tagData.link = this.data.youtubeLink;
336
+ this.tag.attributes = this.tagData;
337
+ };
338
+ ExternalVideoBlockComponent.prototype.ngOnInit = function () {
339
+ this.linkChanged();
340
+ this.tagData = this.tag.attributes;
341
+ this.data.youtubeLink = this.tagData.link;
342
+ };
343
+ return ExternalVideoBlockComponent;
344
+ }());
345
+ ExternalVideoBlockComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: ExternalVideoBlockComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
346
+ ExternalVideoBlockComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.5", type: ExternalVideoBlockComponent, selector: "croco-html-external-video-block", inputs: { tag: "tag" }, outputs: { onTagUpdated: "onTagUpdated" }, ngImport: i0__namespace, template: "<div *ngIf=\"tag.presentOrEdit\">\n \n <div>\n \u0421\u0441\u044B\u043B\u043A\u0430 \u043D\u0430 YouTube: {{data.youtubeLink}}\n </div>\n\n <div style=\"height: 10px;\"></div>\n\n <croco-html-xml-tag-external-video [tagData]=\"tagData\">\n </croco-html-xml-tag-external-video>\n</div>\n\n<div *ngIf=\"!tag.presentOrEdit\">\n <div>\n <form [formGroup]=\"myForm\">\n <mat-form-field class=\"w-100\">\n <input matInput placeholder=\"\u0421\u0441\u044B\u043B\u043A\u0430 \u043D\u0430 YouTube\"\n new-autocomplete=\"off\"\n autocomplete=\"off\"\n formControlName=\"youtubeLink\"\n [(ngModel)]=\"data.youtubeLink\"\n (ngModelChange)=\"linkChanged()\">\n </mat-form-field>\n </form>\n </div>\n</div>\n\n", styles: [""], components: [{ type: XmlTagExternalVideoComponent, selector: "croco-html-xml-tag-external-video", inputs: ["data", "tagData"] }, { type: i5__namespace.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }], directives: [{ type: i2__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5__namespace$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i5__namespace$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i5__namespace$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5__namespace$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i5__namespace$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i5__namespace$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5__namespace$1.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }] });
347
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: ExternalVideoBlockComponent, decorators: [{
348
+ type: i0.Component,
349
+ args: [{
350
+ selector: 'croco-html-external-video-block',
351
+ templateUrl: './external-video-block.component.html',
352
+ styleUrls: ['./external-video-block.component.css']
353
+ }]
354
+ }], propDecorators: { tag: [{
355
+ type: i0.Input
356
+ }], onTagUpdated: [{
357
+ type: i0.Output
358
+ }] } });
359
+
360
+ var HtmlRawEditorComponent = /** @class */ (function () {
361
+ function HtmlRawEditorComponent() {
362
+ this.onTagUpdated = new i0.EventEmitter();
363
+ }
364
+ HtmlRawEditorComponent.prototype.ngOnInit = function () {
365
+ };
366
+ return HtmlRawEditorComponent;
367
+ }());
368
+ HtmlRawEditorComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: HtmlRawEditorComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
369
+ HtmlRawEditorComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.5", type: HtmlRawEditorComponent, selector: "croco-html-html-raw-editor", inputs: { tag: "tag" }, outputs: { onTagUpdated: "onTagUpdated" }, ngImport: i0__namespace, template: "<div *ngIf=\"tag.presentOrEdit\">\n <div [innerHTML]=\"tag.innerHtml\"></div>\n</div>\n\n<div *ngIf=\"!tag.presentOrEdit\">\n <div style=\"height: 10px;\">\n </div>\n <div>\n <mat-form-field class=\"w-100\">\n <textarea matInput cdkTextareaAutosize #autosize=\"cdkTextareaAutosize\"\n cdkAutosizeMinRows=\"1\"\n placeholder=\"\u0412\u043D\u0443\u0442\u0440\u0435\u043D\u043D\u044F\u044F \u0440\u0430\u0437\u043C\u0435\u0442\u043A\u0430 \u0442\u0435\u0433\u0430\"\n [(ngModel)]=\"tag.innerHtml\"></textarea>\n </mat-form-field>\n </div>\n</div>\n\n", styles: [""], components: [{ type: i5__namespace.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }], directives: [{ type: i2__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5__namespace$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i4__namespace.CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }, { type: i5__namespace$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i5__namespace$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5__namespace$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
370
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: HtmlRawEditorComponent, decorators: [{
371
+ type: i0.Component,
372
+ args: [{
373
+ selector: 'croco-html-html-raw-editor',
374
+ templateUrl: './html-raw-editor.component.html',
375
+ styleUrls: ['./html-raw-editor.component.css']
376
+ }]
377
+ }], ctorParameters: function () { return []; }, propDecorators: { tag: [{
378
+ type: i0.Input
379
+ }], onTagUpdated: [{
380
+ type: i0.Output
381
+ }] } });
382
+
383
+ /******************************************************************************
384
+ Copyright (c) Microsoft Corporation.
385
+
386
+ Permission to use, copy, modify, and/or distribute this software for any
387
+ purpose with or without fee is hereby granted.
388
+
389
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
390
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
391
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
392
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
393
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
394
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
395
+ PERFORMANCE OF THIS SOFTWARE.
396
+ ***************************************************************************** */
397
+ /* global Reflect, Promise */
398
+ var extendStatics = function (d, b) {
399
+ extendStatics = Object.setPrototypeOf ||
400
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
401
+ function (d, b) { for (var p in b)
402
+ if (Object.prototype.hasOwnProperty.call(b, p))
403
+ d[p] = b[p]; };
404
+ return extendStatics(d, b);
405
+ };
406
+ function __extends(d, b) {
407
+ if (typeof b !== "function" && b !== null)
408
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
409
+ extendStatics(d, b);
410
+ function __() { this.constructor = d; }
411
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
412
+ }
413
+ var __assign = function () {
414
+ __assign = Object.assign || function __assign(t) {
415
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
416
+ s = arguments[i];
417
+ for (var p in s)
418
+ if (Object.prototype.hasOwnProperty.call(s, p))
419
+ t[p] = s[p];
420
+ }
421
+ return t;
422
+ };
423
+ return __assign.apply(this, arguments);
424
+ };
425
+ function __rest(s, e) {
426
+ var t = {};
427
+ for (var p in s)
428
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
429
+ t[p] = s[p];
430
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
431
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
432
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
433
+ t[p[i]] = s[p[i]];
434
+ }
435
+ return t;
436
+ }
437
+ function __decorate(decorators, target, key, desc) {
438
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
439
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
440
+ r = Reflect.decorate(decorators, target, key, desc);
441
+ else
442
+ for (var i = decorators.length - 1; i >= 0; i--)
443
+ if (d = decorators[i])
444
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
445
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
446
+ }
447
+ function __param(paramIndex, decorator) {
448
+ return function (target, key) { decorator(target, key, paramIndex); };
449
+ }
450
+ function __metadata(metadataKey, metadataValue) {
451
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
452
+ return Reflect.metadata(metadataKey, metadataValue);
453
+ }
454
+ function __awaiter(thisArg, _arguments, P, generator) {
455
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
456
+ return new (P || (P = Promise))(function (resolve, reject) {
457
+ function fulfilled(value) { try {
458
+ step(generator.next(value));
459
+ }
460
+ catch (e) {
461
+ reject(e);
462
+ } }
463
+ function rejected(value) { try {
464
+ step(generator["throw"](value));
465
+ }
466
+ catch (e) {
467
+ reject(e);
468
+ } }
469
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
470
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
471
+ });
472
+ }
473
+ function __generator(thisArg, body) {
474
+ var _ = { label: 0, sent: function () { if (t[0] & 1)
475
+ throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
476
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
477
+ function verb(n) { return function (v) { return step([n, v]); }; }
478
+ function step(op) {
479
+ if (f)
480
+ throw new TypeError("Generator is already executing.");
481
+ while (_)
482
+ try {
483
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
484
+ return t;
485
+ if (y = 0, t)
486
+ op = [op[0] & 2, t.value];
487
+ switch (op[0]) {
488
+ case 0:
489
+ case 1:
490
+ t = op;
491
+ break;
492
+ case 4:
493
+ _.label++;
494
+ return { value: op[1], done: false };
495
+ case 5:
496
+ _.label++;
497
+ y = op[1];
498
+ op = [0];
499
+ continue;
500
+ case 7:
501
+ op = _.ops.pop();
502
+ _.trys.pop();
503
+ continue;
504
+ default:
505
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
506
+ _ = 0;
507
+ continue;
508
+ }
509
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
510
+ _.label = op[1];
511
+ break;
512
+ }
513
+ if (op[0] === 6 && _.label < t[1]) {
514
+ _.label = t[1];
515
+ t = op;
516
+ break;
517
+ }
518
+ if (t && _.label < t[2]) {
519
+ _.label = t[2];
520
+ _.ops.push(op);
521
+ break;
522
+ }
523
+ if (t[2])
524
+ _.ops.pop();
525
+ _.trys.pop();
526
+ continue;
527
+ }
528
+ op = body.call(thisArg, _);
529
+ }
530
+ catch (e) {
531
+ op = [6, e];
532
+ y = 0;
533
+ }
534
+ finally {
535
+ f = t = 0;
536
+ }
537
+ if (op[0] & 5)
538
+ throw op[1];
539
+ return { value: op[0] ? op[1] : void 0, done: true };
540
+ }
541
+ }
542
+ var __createBinding = Object.create ? (function (o, m, k, k2) {
543
+ if (k2 === undefined)
544
+ k2 = k;
545
+ var desc = Object.getOwnPropertyDescriptor(m, k);
546
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
547
+ desc = { enumerable: true, get: function () { return m[k]; } };
548
+ }
549
+ Object.defineProperty(o, k2, desc);
550
+ }) : (function (o, m, k, k2) {
551
+ if (k2 === undefined)
552
+ k2 = k;
553
+ o[k2] = m[k];
554
+ });
555
+ function __exportStar(m, o) {
556
+ for (var p in m)
557
+ if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
558
+ __createBinding(o, m, p);
559
+ }
560
+ function __values(o) {
561
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
562
+ if (m)
563
+ return m.call(o);
564
+ if (o && typeof o.length === "number")
565
+ return {
566
+ next: function () {
567
+ if (o && i >= o.length)
568
+ o = void 0;
569
+ return { value: o && o[i++], done: !o };
570
+ }
571
+ };
572
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
573
+ }
574
+ function __read(o, n) {
575
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
576
+ if (!m)
577
+ return o;
578
+ var i = m.call(o), r, ar = [], e;
579
+ try {
580
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
581
+ ar.push(r.value);
582
+ }
583
+ catch (error) {
584
+ e = { error: error };
585
+ }
586
+ finally {
587
+ try {
588
+ if (r && !r.done && (m = i["return"]))
589
+ m.call(i);
590
+ }
591
+ finally {
592
+ if (e)
593
+ throw e.error;
594
+ }
595
+ }
596
+ return ar;
597
+ }
598
+ /** @deprecated */
599
+ function __spread() {
600
+ for (var ar = [], i = 0; i < arguments.length; i++)
601
+ ar = ar.concat(__read(arguments[i]));
602
+ return ar;
603
+ }
604
+ /** @deprecated */
605
+ function __spreadArrays() {
606
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++)
607
+ s += arguments[i].length;
608
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
609
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
610
+ r[k] = a[j];
611
+ return r;
612
+ }
613
+ function __spreadArray(to, from, pack) {
614
+ if (pack || arguments.length === 2)
615
+ for (var i = 0, l = from.length, ar; i < l; i++) {
616
+ if (ar || !(i in from)) {
617
+ if (!ar)
618
+ ar = Array.prototype.slice.call(from, 0, i);
619
+ ar[i] = from[i];
620
+ }
621
+ }
622
+ return to.concat(ar || Array.prototype.slice.call(from));
623
+ }
624
+ function __await(v) {
625
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
626
+ }
627
+ function __asyncGenerator(thisArg, _arguments, generator) {
628
+ if (!Symbol.asyncIterator)
629
+ throw new TypeError("Symbol.asyncIterator is not defined.");
630
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
631
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
632
+ function verb(n) { if (g[n])
633
+ i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
634
+ function resume(n, v) { try {
635
+ step(g[n](v));
636
+ }
637
+ catch (e) {
638
+ settle(q[0][3], e);
639
+ } }
640
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
641
+ function fulfill(value) { resume("next", value); }
642
+ function reject(value) { resume("throw", value); }
643
+ function settle(f, v) { if (f(v), q.shift(), q.length)
644
+ resume(q[0][0], q[0][1]); }
645
+ }
646
+ function __asyncDelegator(o) {
647
+ var i, p;
648
+ return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
649
+ function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
650
+ }
651
+ function __asyncValues(o) {
652
+ if (!Symbol.asyncIterator)
653
+ throw new TypeError("Symbol.asyncIterator is not defined.");
654
+ var m = o[Symbol.asyncIterator], i;
655
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
656
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
657
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
658
+ }
659
+ function __makeTemplateObject(cooked, raw) {
660
+ if (Object.defineProperty) {
661
+ Object.defineProperty(cooked, "raw", { value: raw });
662
+ }
663
+ else {
664
+ cooked.raw = raw;
665
+ }
666
+ return cooked;
667
+ }
668
+ ;
669
+ var __setModuleDefault = Object.create ? (function (o, v) {
670
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
671
+ }) : function (o, v) {
672
+ o["default"] = v;
673
+ };
674
+ function __importStar(mod) {
675
+ if (mod && mod.__esModule)
676
+ return mod;
677
+ var result = {};
678
+ if (mod != null)
679
+ for (var k in mod)
680
+ if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
681
+ __createBinding(result, mod, k);
682
+ __setModuleDefault(result, mod);
683
+ return result;
684
+ }
685
+ function __importDefault(mod) {
686
+ return (mod && mod.__esModule) ? mod : { default: mod };
687
+ }
688
+ function __classPrivateFieldGet(receiver, state, kind, f) {
689
+ if (kind === "a" && !f)
690
+ throw new TypeError("Private accessor was defined without a getter");
691
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
692
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
693
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
694
+ }
695
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
696
+ if (kind === "m")
697
+ throw new TypeError("Private method is not writable");
698
+ if (kind === "a" && !f)
699
+ throw new TypeError("Private accessor was defined without a setter");
700
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
701
+ throw new TypeError("Cannot write private member to an object whose class did not declare it");
702
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
703
+ }
704
+ function __classPrivateFieldIn(state, receiver) {
705
+ if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function"))
706
+ throw new TypeError("Cannot use 'in' operator on non-object");
707
+ return typeof state === "function" ? receiver === state : state.has(receiver);
708
+ }
709
+
710
+ var FilesQueryService = /** @class */ (function () {
711
+ function FilesQueryService(_httpClient, baseUrl) {
712
+ this._httpClient = _httpClient;
713
+ this._baseControllerUrl = baseUrl + 'Api/Files/';
714
+ }
715
+ FilesQueryService.prototype.getFilesWithRelations = function (model) {
716
+ return this._httpClient.post(this._baseControllerUrl + "GetFiles/WithRelations", model);
717
+ };
718
+ FilesQueryService.prototype.getFiles = function (model) {
719
+ return this._httpClient.post(this._baseControllerUrl + "GetFiles", model);
720
+ };
721
+ return FilesQueryService;
722
+ }());
723
+ FilesQueryService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: FilesQueryService, deps: [{ token: i1__namespace.HttpClient }, { token: 'BASE_URL' }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
724
+ FilesQueryService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: FilesQueryService, providedIn: 'root' });
725
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: FilesQueryService, decorators: [{
726
+ type: i0.Injectable,
727
+ args: [{
728
+ providedIn: 'root'
729
+ }]
730
+ }], ctorParameters: function () {
731
+ return [{ type: i1__namespace.HttpClient }, { type: undefined, decorators: [{
732
+ type: i0.Inject,
733
+ args: ['BASE_URL']
734
+ }] }];
735
+ } });
736
+
737
+ var FileIdSelectComponent = /** @class */ (function () {
738
+ function FileIdSelectComponent(fb, _fileService) {
739
+ this.fb = fb;
740
+ this._fileService = _fileService;
741
+ this.labelText = "Поиск файлов";
742
+ this.loading = false;
743
+ this.files = [];
744
+ this.onFileIdChanged = new i0.EventEmitter();
745
+ this.form = this.fb.group({
746
+ fileName: '',
747
+ });
748
+ }
749
+ FileIdSelectComponent.prototype.onModelChanged = function (fileId) {
750
+ this.onFileIdChanged.emit(fileId);
751
+ };
752
+ FileIdSelectComponent.prototype.getSrc = function (fileId) {
753
+ return ImageMethods.buildSmallUrl(fileId);
754
+ };
755
+ FileIdSelectComponent.prototype.ngOnInit = function () {
756
+ this.loadFiles();
757
+ };
758
+ FileIdSelectComponent.prototype.loadFiles = function () {
759
+ var _this = this;
760
+ this.loading = true;
761
+ this._fileService.getFiles({
762
+ count: 10,
763
+ offSet: 0,
764
+ fileName: null,
765
+ q: this.q
766
+ }).subscribe(function (data) {
767
+ _this.files = __spreadArray([], __read(data.list));
768
+ _this.loading = false;
769
+ });
770
+ };
771
+ FileIdSelectComponent.prototype.onSearchChanged = function (q) {
772
+ this.q = q.term;
773
+ this.loadFiles();
774
+ };
775
+ FileIdSelectComponent.prototype.ngOnChanges = function (changes) {
776
+ this.loadFiles();
777
+ };
778
+ return FileIdSelectComponent;
779
+ }());
780
+ FileIdSelectComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: FileIdSelectComponent, deps: [{ token: i5__namespace$1.FormBuilder }, { token: FilesQueryService }], target: i0__namespace.ɵɵFactoryTarget.Component });
781
+ FileIdSelectComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.5", type: FileIdSelectComponent, selector: "croco-html-file-id-select", inputs: { labelText: "labelText", fileId: "fileId" }, outputs: { fileId: "fileId", onFileIdChanged: "onFileIdChanged" }, usesOnChanges: true, ngImport: i0__namespace, template: "<form [formGroup]=\"form\">\n <div class=\"form-group\">\n <label for=\"fileName\">{{labelText}}</label>\n <ng-select [(ngModel)]=\"fileId\" (ngModelChange)=\"onModelChanged($event)\"\n [items]=\"files\"\n #select\n bindLabel=\"fileName\"\n (search)=\"onSearchChanged($event)\"\n [loading]=\"loading\"\n [loadingText]=\"'\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u044E \u0444\u0430\u0439\u043B\u044B'\"\n dropdownPosition=\"auto\"\n bindValue=\"fileId\"\n labelForId=\"fileName\"\n placeholder=\"\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0444\u0430\u0439\u043B\"\n [virtualScroll]=\"true\"\n formControlName=\"fileName\">\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\n <div>\n <img class=\"mx-auto d-block img-fluid\" [src]=\"getSrc(item.fileId)\"/>\n </div>\n <div>\n <span class=\"h5\">\u0424\u0430\u0439\u043B: </span>\n <span class=\"h5\" [ngOptionHighlight]=\"search\"><b>{{item.fileName}}</b></span>\n </div>\n <div>\n <small>\n <span>\n \u0418\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440 \u0444\u0430\u0439\u043B\u0430: <b>{{item.fileId}}</b>\n </span>\n </small>\n </div>\n </ng-template>\n </ng-select>\n </div>\n</form>\n\n<div>\n \u0418\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440 \u0444\u0430\u0439\u043B\u0430: {{fileId}}\n</div>\n", styles: [""], components: [{ type: i3__namespace.NgSelectComponent, selector: "ng-select", inputs: ["markFirst", "dropdownPosition", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "bufferAmount", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "keyDownFn", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "bindLabel", "placeholder", "notFoundText", "typeToSearchText", "addTagText", "loadingText", "clearAllText", "virtualScroll", "openOnEnter", "appendTo", "bindValue", "appearance", "maxSelectedItems", "groupBy", "groupValue", "tabIndex", "typeahead"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }], directives: [{ type: i5__namespace$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i5__namespace$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i5__namespace$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5__namespace$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5__namespace$1.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i3__namespace.ɵf, selector: "[ng-option-tmp]" }] });
782
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: FileIdSelectComponent, decorators: [{
783
+ type: i0.Component,
784
+ args: [{
785
+ selector: 'croco-html-file-id-select',
786
+ templateUrl: './file-id-select.component.html',
787
+ styleUrls: ['./file-id-select.component.css']
788
+ }]
789
+ }], ctorParameters: function () { return [{ type: i5__namespace$1.FormBuilder }, { type: FilesQueryService }]; }, propDecorators: { labelText: [{
790
+ type: i0.Input
791
+ }], fileId: [{
792
+ type: i0.Input
793
+ }, {
794
+ type: i0.Output
795
+ }], onFileIdChanged: [{
796
+ type: i0.Output
797
+ }] } });
798
+
799
+ var ImageEditorComponent = /** @class */ (function () {
800
+ function ImageEditorComponent() {
801
+ this.hasImageError = false;
802
+ this.searchOrEdit = "search";
803
+ this.myForm = new i5.FormGroup({
804
+ fileId: new i5.FormControl()
805
+ });
806
+ this.onTagUpdated = new i0.EventEmitter();
807
+ }
808
+ ImageEditorComponent.prototype.onErrorHandler = function () {
809
+ this.hasImageError = true;
810
+ };
811
+ ImageEditorComponent.prototype.getSrc = function () {
812
+ return ImageMethods.buildUrl(this.tag.attributes[FileImageTagDataConsts.FileIdAttrName]);
813
+ };
814
+ ImageEditorComponent.prototype.hasFileId = function () {
815
+ return this.tag.attributes.hasOwnProperty(FileImageTagDataConsts.FileIdAttrName) && !isNaN(this.tag.attributes[FileImageTagDataConsts.FileIdAttrName]);
816
+ };
817
+ ImageEditorComponent.prototype.onFileIdChanged = function (fileId) {
818
+ this.tag.attributes[FileImageTagDataConsts.FileIdAttrName] = fileId;
819
+ this.removeImageError();
820
+ };
821
+ ImageEditorComponent.prototype.removeImageError = function () {
822
+ this.hasImageError = false;
823
+ };
824
+ ImageEditorComponent.prototype.ngOnInit = function () {
825
+ };
826
+ return ImageEditorComponent;
827
+ }());
828
+ ImageEditorComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: ImageEditorComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
829
+ ImageEditorComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.5", type: ImageEditorComponent, selector: "croco-html-image-editor", inputs: { tag: "tag" }, outputs: { onTagUpdated: "onTagUpdated" }, ngImport: i0__namespace, template: "<div>\n <div style=\"height: 10px;\">\n </div>\n \n <div *ngIf=\"hasImageError\" class=\"error-block\">\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.\n </div>\n\n <div *ngIf=\"hasFileId() && !hasImageError\">\n <img class=\"mx-auto d-block img-fluid\" [src]=\"getSrc()\" (error)=\"onErrorHandler()\"/>\n </div>\n\n <div *ngIf=\"!hasFileId()\">\n <h5>[\u0418\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u043D\u0435 \u0432\u044B\u0431\u0440\u0430\u043D\u043E]</h5>\n </div>\n</div>\n\n<div *ngIf=\"!tag.presentOrEdit\">\n <div style=\"height: 10px;\"></div>\n\n <div style=\"overflow-x:auto;\">\n <mat-button-toggle-group [(ngModel)]=\"searchOrEdit\">\n <mat-button-toggle value=\"search\">\n \u0418\u0441\u043A\u0430\u0442\u044C \u0444\u0430\u0439\u043B <mat-icon>search</mat-icon>\n </mat-button-toggle>\n <mat-button-toggle value=\"edit\">\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>\n </mat-button-toggle>\n </mat-button-toggle-group>\n </div>\n \n\n <div style=\"height: 10px;\"></div>\n\n <div [hidden]=\"searchOrEdit !== 'search'\">\n <croco-html-file-id-select\n [labelText]=\"'\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0444\u0430\u0439\u043B'\"\n [(fileId)]=\"tag.attributes['file-id']\"\n (onFileIdChanged)=\"onFileIdChanged($event)\">\n </croco-html-file-id-select>\n </div>\n\n <div [hidden]=\"searchOrEdit !== 'edit'\">\n <form [formGroup]=\"myForm\">\n <mat-form-field class=\"w-100\">\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\"\n formControlName=\"fileId\" \n type=\"number\"\n [(ngModel)]=\"tag.attributes['file-id']\"\n (ngModelChange)=\"removeImageError()\">\n </mat-form-field>\n </form>\n </div>\n</div>", styles: [".error-block{background-color:#f32323;color:#fff;text-align:center;border-radius:10px;padding:10px}\n"], components: [{ type: i1__namespace$2.MatButtonToggle, selector: "mat-button-toggle", inputs: ["disableRipple", "aria-labelledby", "tabIndex", "appearance", "checked", "disabled", "id", "name", "aria-label", "value"], outputs: ["change"], exportAs: ["matButtonToggle"] }, { type: i2__namespace$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: FileIdSelectComponent, selector: "croco-html-file-id-select", inputs: ["labelText", "fileId"], outputs: ["fileId", "onFileIdChanged"] }, { type: i5__namespace.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }], directives: [{ type: i2__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1__namespace$2.MatButtonToggleGroup, selector: "mat-button-toggle-group", inputs: ["appearance", "name", "vertical", "value", "multiple", "disabled"], outputs: ["valueChange", "change"], exportAs: ["matButtonToggleGroup"] }, { type: i5__namespace$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5__namespace$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i5__namespace$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i5__namespace$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i5__namespace$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5__namespace$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i5__namespace$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i5__namespace$1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { type: i5__namespace$1.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }] });
830
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: ImageEditorComponent, decorators: [{
831
+ type: i0.Component,
832
+ args: [{
833
+ selector: 'croco-html-image-editor',
834
+ templateUrl: './image-editor.component.html',
835
+ styleUrls: ['./image-editor.component.css']
836
+ }]
837
+ }], ctorParameters: function () { return []; }, propDecorators: { tag: [{
838
+ type: i0.Input
839
+ }], onTagUpdated: [{
840
+ type: i0.Output
841
+ }] } });
842
+
843
+ var AngularMaterialTableMethods = /** @class */ (function () {
844
+ function AngularMaterialTableMethods() {
845
+ }
846
+ AngularMaterialTableMethods.getAngularMaterialTableData = function (columns, rows) {
847
+ var data = [];
848
+ for (var rowIndex = 0; rowIndex < rows.length; rowIndex++) {
849
+ var row = rows[rowIndex];
850
+ var elem = {};
851
+ for (var columnIndex = 0; columnIndex < columns.length; columnIndex++) {
852
+ var column = columns[columnIndex];
853
+ elem[column] = row.columns[columnIndex].data.text;
854
+ }
855
+ data.push(elem);
856
+ }
857
+ return {
858
+ displayedColumns: columns,
859
+ data: data,
860
+ };
861
+ };
862
+ AngularMaterialTableMethods.checkHeaders = function (tableData) {
863
+ if (tableData.header === null) {
864
+ return {
865
+ isSucceeded: false,
866
+ message: "Необходимо указать заголовок таблицы"
867
+ };
868
+ }
869
+ var columns = tableData.header.columns;
870
+ var uniqueDislayedColumns = columns.filter(function (v, i, a) { return a.indexOf(v) === i; });
871
+ if (uniqueDislayedColumns.length !== columns.length) {
872
+ return {
873
+ isSucceeded: false,
874
+ message: "Ошибка при обработке разметки таблицы. Обнаружены дубликаты заголовков."
875
+ };
876
+ }
877
+ return {
878
+ isSucceeded: true,
879
+ message: "Ok"
880
+ };
881
+ };
882
+ AngularMaterialTableMethods.checkAngularMaterialTableData = function (tableData, checkHeaders) {
883
+ if (checkHeaders === void 0) { checkHeaders = true; }
884
+ if (checkHeaders) {
885
+ var checkHeadersResult = this.checkHeaders(tableData);
886
+ if (!checkHeadersResult.isSucceeded) {
887
+ return checkHeadersResult;
888
+ }
889
+ }
890
+ var rows = tableData.rows;
891
+ var columns = tableData.header.columns;
892
+ for (var i = 0; i < rows.length; i++) {
893
+ var row = rows[i];
894
+ if (row.columns.length !== columns.length) {
895
+ return {
896
+ isSucceeded: false,
897
+ message: "\u041E\u0448\u0438\u0431\u043A\u0430 \u043F\u0440\u0438 \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0435 \u0440\u0430\u0437\u043C\u0435\u0442\u043A\u0438 \u0442\u0430\u0431\u043B\u0438\u0446\u044B. "
898
+ + "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043A\u043E\u043B\u043E\u043D\u043E\u043A \u0432 \u043A\u0430\u0436\u0434\u043E\u0439 \u0441\u0442\u0440\u043E\u043A\u0435 \u0442\u0430\u0431\u043B\u0438\u0446\u044B \u0434\u043E\u043B\u0436\u043D\u043E \u0441\u043E\u043E\u0442\u0432\u0435\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u043A\u043E\u043B\u043E\u043D\u043E\u043A \u0443\u043A\u0430\u0437\u0430\u043D\u043D\u044B\u0445 \u0432 \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043A\u0435. "
899
+ + ("\u0412 \u0441\u0442\u0440\u043E\u043A\u0435 \u0442\u0430\u0431\u043B\u0438\u0446\u044B \u2116" + (i + 1) + " \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043A\u043E\u043B\u043E\u043D\u043E\u043A = " + row.columns.length + ", \u0430 \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C " + columns.length + ".")
900
+ };
901
+ }
902
+ }
903
+ return {
904
+ isSucceeded: true,
905
+ message: "Ok"
906
+ };
907
+ };
908
+ return AngularMaterialTableMethods;
909
+ }());
910
+
911
+ var TextTag = "text";
912
+ var TextSimpleMethods = /** @class */ (function () {
913
+ function TextSimpleMethods() {
914
+ }
915
+ TextSimpleMethods.ExtractTextTag = function (elem) {
916
+ var _a;
917
+ var hAlignValue = (_a = elem.getAttribute("h-align")) !== null && _a !== void 0 ? _a : "left";
918
+ var data = {
919
+ textTagName: elem.tagName.toLowerCase(),
920
+ text: elem.innerText.trim().replace('\n\t', ''),
921
+ html: elem.innerHTML.trim().replace('\n\t', ''),
922
+ horizontalAlignment: hAlignValue,
923
+ validationResult: {
924
+ isSucceeded: true,
925
+ message: "Ok"
926
+ }
927
+ };
928
+ var result = {
929
+ type: TextTag,
930
+ data: data
931
+ };
932
+ if (result.data.text === '\n') {
933
+ result.data.text = '';
934
+ }
935
+ if (result.data.html === '\n') {
936
+ result.data.html = '';
937
+ }
938
+ var alignmentVals = ["left", "right", "center"];
939
+ if (alignmentVals.indexOf(hAlignValue) < 0) {
940
+ result.data.validationResult = {
941
+ isSucceeded: false,
942
+ message: "\u041D\u0435\u0434\u043E\u043F\u0443\u0441\u0442\u0438\u043C\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 h-align. \u0414\u043E\u043F\u0443\u0441\u0442\u0438\u043C\u044B\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F: " + alignmentVals.join(', ') + ". "
943
+ + 'Данный тег можно не указывать, по-умолчанию будет применено выравнивание слева.'
944
+ };
945
+ }
946
+ var html = result.data.html;
947
+ var htmlValidation = this.ValidateTextHtml(html);
948
+ if (!htmlValidation.isSucceeded) {
949
+ result.data.validationResult = htmlValidation;
950
+ }
951
+ return result;
952
+ };
953
+ TextSimpleMethods.ValidateTextHtml = function (html) {
954
+ var p = document.createElement("p");
955
+ p.innerHTML = html;
956
+ for (var i = 0; i < p.children.length; i++) {
957
+ var element = p.children.item(i);
958
+ var validationResult = this.ValidateTag(element);
959
+ if (!validationResult.isSucceeded) {
960
+ return validationResult;
961
+ }
962
+ }
963
+ return {
964
+ isSucceeded: true,
965
+ message: "Ok"
966
+ };
967
+ };
968
+ TextSimpleMethods.ValidateTag = function (element) {
969
+ var lowerTag = element.tagName.toLowerCase();
970
+ if (!this.supportedTags.includes(lowerTag)) {
971
+ return {
972
+ isSucceeded: false,
973
+ message: "\u0422\u0435\u0433 <" + lowerTag + "> \u043D\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044F \u0432\u043D\u0443\u0442\u0440\u0438 \u0442\u0435\u0433\u0430 <text>"
974
+ };
975
+ }
976
+ for (var i = 0; i < element.children.length; i++) {
977
+ var nElement = element.children.item(i);
978
+ var innerValidationResult = this.ValidateTag(nElement);
979
+ if (!innerValidationResult.isSucceeded) {
980
+ return innerValidationResult;
981
+ }
982
+ }
983
+ return {
984
+ isSucceeded: true,
985
+ message: "Ok"
986
+ };
987
+ };
988
+ return TextSimpleMethods;
989
+ }());
990
+ TextSimpleMethods.supportedTags = ["sup", "sub", "strong", "b", "i"];
991
+
992
+ var BootstrapTableMethods = /** @class */ (function () {
993
+ function BootstrapTableMethods() {
994
+ }
995
+ BootstrapTableMethods.BuildTable = function (data) {
996
+ var result = "<table class=\"table table-bordered\">";
997
+ result += this.BuildHeader(data.header);
998
+ result += this.BuildBody(data.rows);
999
+ result += "</table>";
1000
+ return result;
1001
+ };
1002
+ BootstrapTableMethods.BuildHeader = function (data) {
1003
+ if (data === null) {
1004
+ return "";
1005
+ }
1006
+ var result = "<thead>";
1007
+ result += "<tr>";
1008
+ for (var index = 0; index < data.columns.length; index++) {
1009
+ result += "<th>" + data.columns[index] + "</th>";
1010
+ }
1011
+ result += "</tr>";
1012
+ result += "</thead>";
1013
+ return result;
1014
+ };
1015
+ BootstrapTableMethods.BuildBody = function (rows) {
1016
+ var result = "<tbody>";
1017
+ for (var i = 0; i < rows.length; i++) {
1018
+ var row = rows[i];
1019
+ result += "<tr>";
1020
+ for (var j = 0; j < row.columns.length; j++) {
1021
+ var col = row.columns[j];
1022
+ result += "<td class=\"align-middle\">" + this.BuildInnerTags(col.data.children) + "</td>";
1023
+ }
1024
+ result += "</tr>";
1025
+ }
1026
+ result += "</tbody>";
1027
+ return result;
1028
+ };
1029
+ BootstrapTableMethods.BuildInnerTags = function (tags) {
1030
+ var result = "";
1031
+ for (var i = 0; i < tags.length; i++) {
1032
+ result += this.BuildInnerTag(tags[i]);
1033
+ }
1034
+ return result;
1035
+ };
1036
+ BootstrapTableMethods.BuildInnerTag = function (data) {
1037
+ var _a;
1038
+ if (data.type === FileImageTagDataConsts.TagName) {
1039
+ var fileImageTag = data;
1040
+ return "<img src=" + fileImageTag.data.src + " class=\"mx-auto d-block img-fluid\" />";
1041
+ }
1042
+ else if (data.type === TextTag) {
1043
+ var simpleTextTag = data;
1044
+ var map = (_a = {},
1045
+ _a["left"] = "text-start",
1046
+ _a["center"] = "text-center",
1047
+ _a["right"] = "text-end",
1048
+ _a);
1049
+ if (!simpleTextTag.data.validationResult.isSucceeded) {
1050
+ return "<span>\u041E\u0448\u0438\u0431\u043A\u0430 \u0432 \u0442\u0435\u043A\u0441\u0442\u0435 " + simpleTextTag.data.validationResult.message + "</span>";
1051
+ }
1052
+ return "<div class=\"" + map[simpleTextTag.data.horizontalAlignment] + "\"><span>" + simpleTextTag.data.html + "</span></div>";
1053
+ }
1054
+ else {
1055
+ return "<p>\u0422\u0435\u0433 " + data.type + " \u043D\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044F</p>";
1056
+ }
1057
+ };
1058
+ return BootstrapTableMethods;
1059
+ }());
1060
+
1061
+ var TableTypes = /** @class */ (function () {
1062
+ function TableTypes() {
1063
+ }
1064
+ return TableTypes;
1065
+ }());
1066
+ TableTypes.TableRowColumnData = "table-row-column-data";
1067
+ TableTypes.Table = "table";
1068
+ TableTypes.TableRowColumn = "table-row-column";
1069
+ var TableMethods = /** @class */ (function () {
1070
+ function TableMethods() {
1071
+ }
1072
+ TableMethods.getTableFromHtmlTag = function (tableTag) {
1073
+ var tableData = {
1074
+ header: TableMethods.getHeader(tableTag),
1075
+ rows: TableMethods.getTableRows(tableTag)
1076
+ };
1077
+ var result = {
1078
+ type: TableTypes.Table,
1079
+ data: tableData,
1080
+ validationResult: this.checkTable(tableData),
1081
+ bootstrapHtml: ""
1082
+ };
1083
+ if (!result.validationResult) {
1084
+ return result;
1085
+ }
1086
+ result.bootstrapHtml = BootstrapTableMethods.BuildTable(result.data);
1087
+ var angularMaterialTableDataCheck = AngularMaterialTableMethods.checkAngularMaterialTableData(tableData);
1088
+ if (!angularMaterialTableDataCheck.isSucceeded) {
1089
+ return Object.assign(Object.assign({}, result), { angularMaterialTableDataCheck: angularMaterialTableDataCheck });
1090
+ }
1091
+ return Object.assign(Object.assign({}, result), { angularMaterialTableDataCheck: angularMaterialTableDataCheck, html: tableTag.outerHTML, angularMaterialTableData: AngularMaterialTableMethods.getAngularMaterialTableData(tableData.header.columns, tableData.rows) });
1092
+ };
1093
+ TableMethods.checkTable = function (tableData) {
1094
+ var rows = tableData.rows;
1095
+ var prevRowCount = -1;
1096
+ for (var i = 0; i < rows.length; i++) {
1097
+ var row = rows[i];
1098
+ if (row.columns.length !== prevRowCount && prevRowCount != -1) {
1099
+ return {
1100
+ isSucceeded: false,
1101
+ message: "\u041E\u0448\u0438\u0431\u043A\u0430 \u043F\u0440\u0438 \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0435 \u0440\u0430\u0437\u043C\u0435\u0442\u043A\u0438 \u0442\u0430\u0431\u043B\u0438\u0446\u044B. "
1102
+ + "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043A\u043E\u043B\u043E\u043D\u043E\u043A \u0432 \u043A\u0430\u0436\u0434\u043E\u0439 \u0441\u0442\u0440\u043E\u043A\u0435 \u0442\u0430\u0431\u043B\u0438\u0446\u044B \u0434\u043E\u043B\u0436\u043D\u043E \u0441\u043E\u043E\u0442\u0432\u0435\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0434\u0440\u0443\u0433 \u0434\u0440\u0443\u0433\u0443. "
1103
+ + ("\u0412 \u0441\u0442\u0440\u043E\u043A\u0435 \u0442\u0430\u0431\u043B\u0438\u0446\u044B \u2116" + (i + 1) + " \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043A\u043E\u043B\u043E\u043D\u043E\u043A = " + row.columns.length + ", \u0430 \u0432 \u0441\u0442\u0440\u043E\u043A\u0435 \u0432\u044B\u0448\u0435 " + prevRowCount + ".")
1104
+ };
1105
+ }
1106
+ prevRowCount = row.columns.length;
1107
+ }
1108
+ return {
1109
+ isSucceeded: true,
1110
+ message: "Ok"
1111
+ };
1112
+ };
1113
+ TableMethods.getHeader = function (tableTag) {
1114
+ var header = tableTag.tHead;
1115
+ if (header === null) {
1116
+ return null;
1117
+ }
1118
+ var tr = header.children.item(0);
1119
+ var headerColumns = [];
1120
+ for (var j = 0; j < tr.children.length; j++) {
1121
+ var jElement = tr.children.item(j);
1122
+ headerColumns.push(jElement.innerHTML);
1123
+ }
1124
+ return {
1125
+ type: "table-header",
1126
+ columns: headerColumns
1127
+ };
1128
+ };
1129
+ TableMethods.getTableRows = function (tableTag) {
1130
+ var tBody = tableTag.tBodies.item(0);
1131
+ var rows = [];
1132
+ for (var i = 0; i < tBody.children.length; i++) {
1133
+ var iElement = tBody.children.item(i);
1134
+ var rowColumns = [];
1135
+ for (var j = 0; j < iElement.children.length; j++) {
1136
+ var jElement = iElement.children.item(j);
1137
+ var children = HtmlExtractionMethods.transformHtmlElementToBlocks(jElement);
1138
+ if (children.length === 0) {
1139
+ var textTag = document.createElement("p");
1140
+ textTag.innerHTML = jElement.innerHTML;
1141
+ var textElem = TextSimpleMethods.ExtractTextTag(textTag);
1142
+ children.push(textElem);
1143
+ }
1144
+ var result = {
1145
+ type: TableTypes.TableRowColumnData,
1146
+ data: {
1147
+ text: jElement.innerHTML,
1148
+ children: children
1149
+ }
1150
+ };
1151
+ rowColumns.push(result);
1152
+ }
1153
+ rows.push({
1154
+ type: TableTypes.TableRowColumn,
1155
+ columns: rowColumns
1156
+ });
1157
+ }
1158
+ return rows;
1159
+ };
1160
+ return TableMethods;
1161
+ }());
1162
+
1163
+ var TextMethods = /** @class */ (function () {
1164
+ function TextMethods() {
1165
+ }
1166
+ TextMethods.ExtractRichTextData = function (elem) {
1167
+ var children = [];
1168
+ for (var i = 0; i < elem.children.length; i++) {
1169
+ var child = elem.children.item(i);
1170
+ if (child.tagName === "text-block".toUpperCase()) {
1171
+ children.push({
1172
+ type: "text-block",
1173
+ data: {
1174
+ text: child.innerHTML
1175
+ }
1176
+ });
1177
+ }
1178
+ else if (child.tagName === "line-break".toUpperCase()) {
1179
+ children.push({
1180
+ type: "line-break"
1181
+ });
1182
+ }
1183
+ }
1184
+ return {
1185
+ type: "rich-text",
1186
+ data: {
1187
+ children: children
1188
+ }
1189
+ };
1190
+ };
1191
+ return TextMethods;
1192
+ }());
1193
+ TextMethods.textTags = ["text", "h1", "h2", "h3", "h4", "h5", "h6"];
1194
+
1195
+ var _a;
1196
+ var HtmlExtractionMethods = /** @class */ (function () {
1197
+ function HtmlExtractionMethods() {
1198
+ }
1199
+ HtmlExtractionMethods.ExtractHeaderTag = function (elem, tagName) {
1200
+ var data = TextSimpleMethods.ExtractTextTag(elem);
1201
+ data.type = tagName;
1202
+ return data;
1203
+ };
1204
+ HtmlExtractionMethods.transformHtmlElementToBlocks = function (element) {
1205
+ var data = [];
1206
+ for (var i = 0; i < element.children.length; i++) {
1207
+ var elem = element.children.item(i);
1208
+ if (!HtmlExtractionMethods.Extractors.hasOwnProperty(elem.tagName)) {
1209
+ data.push({
1210
+ type: "unsupported-tag",
1211
+ data: {
1212
+ tagString: elem.outerHTML
1213
+ }
1214
+ });
1215
+ }
1216
+ else {
1217
+ var extractor = HtmlExtractionMethods.Extractors[elem.tagName];
1218
+ var result = extractor(elem);
1219
+ data.push(result);
1220
+ }
1221
+ }
1222
+ return data;
1223
+ };
1224
+ HtmlExtractionMethods.transformHtmlStringToBlocks = function (value) {
1225
+ if (value === undefined) {
1226
+ return [];
1227
+ }
1228
+ value = value
1229
+ .replace('\n', '')
1230
+ .replace('\t', '');
1231
+ var div = document.createElement("div");
1232
+ div.innerHTML = value;
1233
+ return this.transformHtmlElementToBlocks(div);
1234
+ };
1235
+ return HtmlExtractionMethods;
1236
+ }());
1237
+ HtmlExtractionMethods.Extractors = (_a = {},
1238
+ _a["TEXT"] = function (elem) { return TextSimpleMethods.ExtractTextTag(elem); },
1239
+ _a["FILE-IMAGE"] = function (elem) { return ImageMethods.ExtractImage(elem); },
1240
+ _a["TABLE"] = function (elem) { return TableMethods.getTableFromHtmlTag(elem); },
1241
+ _a["RICH-TEXT"] = function (elem) { return TextMethods.ExtractRichTextData(elem); },
1242
+ _a["HTML-RAW"] = function (elem) { return ({
1243
+ type: "html-raw",
1244
+ data: {
1245
+ innerHTML: elem.innerHTML
1246
+ }
1247
+ }); },
1248
+ _a["H1"] = function (elem) { return HtmlExtractionMethods.ExtractHeaderTag(elem, "h1"); },
1249
+ _a["H2"] = function (elem) { return HtmlExtractionMethods.ExtractHeaderTag(elem, "h2"); },
1250
+ _a["H3"] = function (elem) { return HtmlExtractionMethods.ExtractHeaderTag(elem, "h3"); },
1251
+ _a["H4"] = function (elem) { return HtmlExtractionMethods.ExtractHeaderTag(elem, "h4"); },
1252
+ _a["H5"] = function (elem) { return HtmlExtractionMethods.ExtractHeaderTag(elem, "h5"); },
1253
+ _a["H6"] = function (elem) { return HtmlExtractionMethods.ExtractHeaderTag(elem, "h6"); },
1254
+ _a[ExternalVideoTagDataConsts.TagName.toUpperCase()] = function (elem) { return VideoMethods.ExtractExternalVideoTag(elem); },
1255
+ _a);
1256
+
1257
+ var HtmlRawTagDataConsts = /** @class */ (function () {
1258
+ function HtmlRawTagDataConsts() {
1259
+ }
1260
+ return HtmlRawTagDataConsts;
1261
+ }());
1262
+ HtmlRawTagDataConsts.TagName = "html-raw";
1263
+
1264
+ var BodyTagsExtensions = /** @class */ (function () {
1265
+ function BodyTagsExtensions() {
1266
+ }
1267
+ BodyTagsExtensions.getDescription = function (tagName) {
1268
+ var _a;
1269
+ var descriptions = (_a = {
1270
+ "text": "Текст",
1271
+ "h1": "Заголовок 1 уровня",
1272
+ "h2": "Заголовок 2 уровня",
1273
+ "h3": "Заголовок 3 уровня",
1274
+ "h4": "Заголовок 4 уровня",
1275
+ "h5": "Заголовок 5 уровня",
1276
+ "h6": "Заголовок 6 уровня"
1277
+ },
1278
+ _a[FileImageTagDataConsts.TagName] = "Изображение",
1279
+ _a[ExternalVideoTagDataConsts.TagName] = "Внешнее видео YouTube",
1280
+ _a[HtmlRawTagDataConsts.TagName] = "Html разметка",
1281
+ _a);
1282
+ return descriptions[tagName];
1283
+ };
1284
+ BodyTagsExtensions.toHtml = function (bodyTags) {
1285
+ var htmls = bodyTags.map(function (x) {
1286
+ if (TextMethods.textTags.includes(x.tagDescription.tag)) {
1287
+ return "<" + x.tagDescription.tag + " h-align=\"" + x.attributes['h-align'] + "\">" + x.innerHtml + "</" + x.tagDescription.tag + ">";
1288
+ }
1289
+ if (x.tagDescription.tag === ExternalVideoTagDataConsts.TagName) {
1290
+ return "<" + x.tagDescription.tag + " type=\"" + x.attributes['type'] + "\" link=\"" + x.attributes['link'] + "\">" + x.innerHtml + "</" + x.tagDescription.tag + ">";
1291
+ }
1292
+ if (x.tagDescription.tag === "html-raw") {
1293
+ return "<" + x.tagDescription.tag + ">" + x.innerHtml + "</" + x.tagDescription.tag + ">";
1294
+ }
1295
+ return BodyTagsExtensions.imageTagToHtml(x);
1296
+ });
1297
+ var result = "";
1298
+ for (var index = 0; index < htmls.length; index++) {
1299
+ var element = htmls[index];
1300
+ result += element;
1301
+ }
1302
+ return result;
1303
+ };
1304
+ BodyTagsExtensions.imageTagToHtml = function (imageTag) {
1305
+ var attrStr = "";
1306
+ var attrValue = imageTag.attributes[FileImageTagDataConsts.FileIdAttrName];
1307
+ if (imageTag.attributes.hasOwnProperty(FileImageTagDataConsts.FileIdAttrName) && attrValue) {
1308
+ attrStr = FileImageTagDataConsts.FileIdAttrName + "=\"" + attrValue + "\"";
1309
+ }
1310
+ return "<" + FileImageTagDataConsts.TagName + " " + attrStr + "></" + FileImageTagDataConsts.TagName + ">";
1311
+ };
1312
+ BodyTagsExtensions.getBodyTags = function (html) {
1313
+ var result = HtmlExtractionMethods.transformHtmlStringToBlocks(html);
1314
+ return result.map(function (x) { return BodyTagsExtensions.toBodyTag(x); });
1315
+ };
1316
+ BodyTagsExtensions.sanitizeInnerHtml = function (html) {
1317
+ return html.trim().replace('\n\t', '');
1318
+ };
1319
+ BodyTagsExtensions.toBodyTag = function (data) {
1320
+ if (TextMethods.textTags.includes(data.type)) {
1321
+ var textTagData = data.data;
1322
+ return {
1323
+ presentOrEdit: true,
1324
+ tagDescription: {
1325
+ tag: textTagData.textTagName,
1326
+ displayValue: BodyTagsExtensions.getDescription(data.type)
1327
+ },
1328
+ attributes: { "h-align": textTagData.horizontalAlignment },
1329
+ innerHtml: BodyTagsExtensions.sanitizeInnerHtml(textTagData.html)
1330
+ };
1331
+ }
1332
+ if (data.type === FileImageTagDataConsts.TagName) {
1333
+ var fileData = data.data;
1334
+ var atts = {};
1335
+ if (fileData.fileId) {
1336
+ atts[FileImageTagDataConsts.FileIdAttrName] = fileData.fileId;
1337
+ }
1338
+ return {
1339
+ presentOrEdit: true,
1340
+ tagDescription: {
1341
+ tag: FileImageTagDataConsts.TagName,
1342
+ displayValue: BodyTagsExtensions.getDescription(data.type)
1343
+ },
1344
+ attributes: atts,
1345
+ innerHtml: ""
1346
+ };
1347
+ }
1348
+ if (data.type === ExternalVideoTagDataConsts.TagName) {
1349
+ var fileData = data.data;
1350
+ return {
1351
+ presentOrEdit: true,
1352
+ tagDescription: {
1353
+ tag: ExternalVideoTagDataConsts.TagName,
1354
+ displayValue: BodyTagsExtensions.getDescription(data.type)
1355
+ },
1356
+ attributes: fileData,
1357
+ innerHtml: ""
1358
+ };
1359
+ }
1360
+ if (data.type === HtmlRawTagDataConsts.TagName) {
1361
+ return {
1362
+ presentOrEdit: true,
1363
+ tagDescription: {
1364
+ tag: HtmlRawTagDataConsts.TagName,
1365
+ displayValue: BodyTagsExtensions.getDescription(data.type)
1366
+ },
1367
+ attributes: {},
1368
+ innerHtml: BodyTagsExtensions.sanitizeInnerHtml(data.data["innerHTML"])
1369
+ };
1370
+ }
1371
+ return {
1372
+ presentOrEdit: true,
1373
+ tagDescription: {
1374
+ tag: "unsupported-tag",
1375
+ displayValue: "Неподдерживаемый тег"
1376
+ },
1377
+ attributes: {},
1378
+ innerHtml: JSON.stringify(data)
1379
+ };
1380
+ };
1381
+ return BodyTagsExtensions;
1382
+ }());
1383
+
1384
+ var XmlExtensions = /** @class */ (function () {
1385
+ function XmlExtensions() {
1386
+ }
1387
+ XmlExtensions.formatXml = function (xml, tab) {
1388
+ if (tab === void 0) { tab = '\t'; }
1389
+ var formatted = '', indent = '';
1390
+ tab = tab || '\t';
1391
+ xml.split(/>\s*</).forEach(function (node) {
1392
+ if (node.match(/^\/\w/))
1393
+ indent = indent.substring(tab.length); // decrease indent by one 'tab'
1394
+ formatted += indent + '<' + node + '>\r\n';
1395
+ if (node.match(/^<?\w[^>]*[^\/]$/))
1396
+ indent += tab; // increase indent
1397
+ });
1398
+ return formatted.substring(1, formatted.length - 3);
1399
+ };
1400
+ XmlExtensions.tagsToLower = function (xml) {
1401
+ xml = this.replaceTagToLower(xml, "Body");
1402
+ xml = this.replaceTagToLower(xml, "Image");
1403
+ xml = this.replaceTagToLower(xml, "Text");
1404
+ return xml;
1405
+ };
1406
+ XmlExtensions.replaceTagToLower = function (xml, tag) {
1407
+ return xml
1408
+ .replace(new RegExp("<" + tag, 'g'), "<" + tag.toLowerCase())
1409
+ .replace(new RegExp("</" + tag + ">", 'g'), "</" + tag.toLowerCase() + ">");
1410
+ };
1411
+ return XmlExtensions;
1412
+ }());
1413
+
1414
+ var TextEditorComponent = /** @class */ (function () {
1415
+ function TextEditorComponent() {
1416
+ this.myForm = new i5.FormGroup({
1417
+ "innerHtml": new i5.FormControl()
1418
+ });
1419
+ this.onTagUpdated = new i0.EventEmitter();
1420
+ }
1421
+ TextEditorComponent.prototype.ngOnInit = function () {
1422
+ };
1423
+ TextEditorComponent.prototype.getInnerHtml = function () {
1424
+ return "<" + this.tag.tagDescription.tag + ">" + this.tag.innerHtml + "<" + this.tag.tagDescription.tag + "/>";
1425
+ };
1426
+ return TextEditorComponent;
1427
+ }());
1428
+ TextEditorComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: TextEditorComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
1429
+ TextEditorComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.5", type: TextEditorComponent, selector: "croco-html-text-editor", inputs: { tag: "tag" }, outputs: { onTagUpdated: "onTagUpdated" }, ngImport: i0__namespace, template: "<div *ngIf=\"tag.presentOrEdit\">\n <div style=\"height: 10px;\">\n </div>\n\n <div style=\"text-align: left;\" *ngIf=\"tag.attributes['h-align'] === 'left'\" [innerHtml]=\"getInnerHtml()\">\n </div>\n <div style=\"text-align: right;\" *ngIf=\"tag.attributes['h-align'] === 'right'\" [innerHtml]=\"getInnerHtml()\">\n </div>\n <div style=\"text-align: center;\" *ngIf=\"tag.attributes['h-align'] === 'center'\" [innerHtml]=\"getInnerHtml()\">\n </div>\n</div>\n\n<div *ngIf=\"!tag.presentOrEdit\">\n <div style=\"overflow-x: auto;\">\n <mat-button-toggle-group [(ngModel)]=\"tag.attributes['h-align']\">\n <mat-button-toggle value=\"center\">\n \u041F\u043E \u0446\u0435\u043D\u0442\u0440\u0443 <mat-icon>format_align_center</mat-icon>\n </mat-button-toggle>\n <mat-button-toggle value=\"left\">\n \u0421\u043B\u0435\u0432\u0430 <mat-icon>format_align_left</mat-icon>\n </mat-button-toggle>\n <mat-button-toggle value=\"right\">\n \u0421\u043F\u0440\u0430\u0432\u0430 <mat-icon> format_align_right</mat-icon>\n </mat-button-toggle>\n </mat-button-toggle-group>\n </div>\n\n <div style=\"height: 10px;\">\n </div>\n <form [formGroup]=\"myForm\">\n <mat-form-field class=\"w-100\">\n <textarea matInput cdkTextareaAutosize #autosize=\"cdkTextareaAutosize\"\n cdkAutosizeMinRows=\"1\"\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\"\n formControlName=\"innerHtml\"\n [(ngModel)]=\"tag.innerHtml\"></textarea>\n </mat-form-field>\n </form>\n</div>", styles: [""], components: [{ type: i1__namespace$2.MatButtonToggle, selector: "mat-button-toggle", inputs: ["disableRipple", "aria-labelledby", "tabIndex", "appearance", "checked", "disabled", "id", "name", "aria-label", "value"], outputs: ["change"], exportAs: ["matButtonToggle"] }, { type: i2__namespace$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i5__namespace.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }], directives: [{ type: i2__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1__namespace$2.MatButtonToggleGroup, selector: "mat-button-toggle-group", inputs: ["appearance", "name", "vertical", "value", "multiple", "disabled"], outputs: ["valueChange", "change"], exportAs: ["matButtonToggleGroup"] }, { type: i5__namespace$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5__namespace$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i5__namespace$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i5__namespace$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i5__namespace$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5__namespace$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i4__namespace.CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }, { type: i5__namespace$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i5__namespace$1.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }] });
1430
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: TextEditorComponent, decorators: [{
1431
+ type: i0.Component,
1432
+ args: [{
1433
+ selector: 'croco-html-text-editor',
1434
+ templateUrl: './text-editor.component.html',
1435
+ styleUrls: ['./text-editor.component.css']
1436
+ }]
1437
+ }], ctorParameters: function () { return []; }, propDecorators: { tag: [{
1438
+ type: i0.Input
1439
+ }], onTagUpdated: [{
1440
+ type: i0.Output
1441
+ }] } });
1442
+
1443
+ var MainEditorBlockComponent = /** @class */ (function () {
1444
+ function MainEditorBlockComponent() {
1445
+ this.textTags = TextMethods.textTags;
1446
+ this.onTagSaved = new i0.EventEmitter();
1447
+ this.onTagRemoved = new i0.EventEmitter();
1448
+ }
1449
+ MainEditorBlockComponent.prototype.tagUpdatedHandler = function (tag) {
1450
+ };
1451
+ MainEditorBlockComponent.prototype.save = function () {
1452
+ this.tag.presentOrEdit = true;
1453
+ this.onTagSaved.emit(this.tag);
1454
+ };
1455
+ MainEditorBlockComponent.prototype.deleteItem = function () {
1456
+ this.onTagRemoved.emit(this.tag);
1457
+ };
1458
+ MainEditorBlockComponent.prototype.ngOnInit = function () {
1459
+ };
1460
+ return MainEditorBlockComponent;
1461
+ }());
1462
+ MainEditorBlockComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: MainEditorBlockComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
1463
+ MainEditorBlockComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.5", type: MainEditorBlockComponent, selector: "croco-html-main-editor-block", inputs: { tag: "tag" }, outputs: { onTagSaved: "onTagSaved", onTagRemoved: "onTagRemoved" }, ngImport: i0__namespace, template: "<div>\n <div>\n <div *ngIf=\"textTags.includes(tag.tagDescription.tag)\">\n <croco-html-text-editor (onTagUpdated)=\"tagUpdatedHandler($event)\" [tag]=\"tag\">\n </croco-html-text-editor>\n </div>\n\n <div *ngIf=\"tag.tagDescription.tag === 'file-image'\"> \n <croco-html-image-editor (onTagUpdated)=\"tagUpdatedHandler($event)\" [tag]=\"tag\">\n </croco-html-image-editor>\n </div>\n\n <div *ngIf=\"tag.tagDescription.tag === 'external-video'\">\n <croco-html-external-video-block (onTagUpdated)=\"tagUpdatedHandler($event)\" [tag]=\"tag\">\n </croco-html-external-video-block>\n </div>\n\n <div *ngIf=\"tag.tagDescription.tag === 'html-raw'\">\n <croco-html-html-raw-editor (onTagUpdated)=\"tagUpdatedHandler($event)\" [tag]=\"tag\">\n </croco-html-html-raw-editor>\n </div>\n\n </div>\n\n <div class=\"d-flex justify-content-between\">\n <div class=\"d-flex justify-content-end align-self-center\">\n <div>\n <button *ngIf=\"tag.presentOrEdit\" (click)=\"tag.presentOrEdit = false\" mat-icon-button>\n <mat-icon>edit</mat-icon>\n </button>\n <button *ngIf=\"!tag.presentOrEdit\" (click)=\"save()\" mat-icon-button>\n <mat-icon>save</mat-icon>\n </button>\n <button (click)=\"deleteItem()\" mat-icon-button color=\"warn\">\n <mat-icon>delete</mat-icon>\n </button>\n </div>\n </div>\n\n </div>\n</div>", styles: [""], components: [{ type: TextEditorComponent, selector: "croco-html-text-editor", inputs: ["tag"], outputs: ["onTagUpdated"] }, { type: ImageEditorComponent, selector: "croco-html-image-editor", inputs: ["tag"], outputs: ["onTagUpdated"] }, { type: ExternalVideoBlockComponent, selector: "croco-html-external-video-block", inputs: ["tag"], outputs: ["onTagUpdated"] }, { type: HtmlRawEditorComponent, selector: "croco-html-html-raw-editor", inputs: ["tag"], outputs: ["onTagUpdated"] }, { type: i2__namespace.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i2__namespace$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], directives: [{ type: i2__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
1464
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: MainEditorBlockComponent, decorators: [{
1465
+ type: i0.Component,
1466
+ args: [{
1467
+ selector: 'croco-html-main-editor-block',
1468
+ templateUrl: './main-editor-block.component.html',
1469
+ styleUrls: ['./main-editor-block.component.css']
1470
+ }]
1471
+ }], ctorParameters: function () { return []; }, propDecorators: { tag: [{
1472
+ type: i0.Input
1473
+ }], onTagSaved: [{
1474
+ type: i0.Output
1475
+ }], onTagRemoved: [{
1476
+ type: i0.Output
1477
+ }] } });
1478
+
1479
+ var DefaultTags = /** @class */ (function () {
1480
+ function DefaultTags() {
1481
+ }
1482
+ DefaultTags.getTags = function (useHtmlRaw) {
1483
+ var result = __spreadArray([], __read(DefaultTags.tags));
1484
+ if (useHtmlRaw) {
1485
+ result.push(DefaultTags.htmlRawTag);
1486
+ }
1487
+ return result;
1488
+ };
1489
+ return DefaultTags;
1490
+ }());
1491
+ DefaultTags.tags = [
1492
+ { tag: FileImageTagDataConsts.TagName, displayValue: 'Изображение' },
1493
+ { tag: ExternalVideoTagDataConsts.TagName, displayValue: 'Внешнее видео Youtube' },
1494
+ { tag: 'text', displayValue: 'Текст' },
1495
+ { tag: 'h1', displayValue: 'Заголовок 1 уровня' },
1496
+ { tag: 'h2', displayValue: 'Заголовок 2 уровня' },
1497
+ { tag: 'h3', displayValue: 'Заголовок 3 уровня' },
1498
+ { tag: 'h4', displayValue: 'Заголовок 4 уровня' },
1499
+ { tag: 'h5', displayValue: 'Заголовок 5 уровня' },
1500
+ { tag: 'h6', displayValue: 'Заголовок 6 уровня' },
1501
+ ];
1502
+ DefaultTags.htmlRawTag = {
1503
+ tag: HtmlRawTagDataConsts.TagName, displayValue: 'Html разметка'
1504
+ };
1505
+ var VisualEditorComponent = /** @class */ (function () {
1506
+ function VisualEditorComponent(_cdref) {
1507
+ this._cdref = _cdref;
1508
+ this.isLoading = false;
1509
+ this.loadingText = "Идёт загрузка";
1510
+ this.showMarkUp = true;
1511
+ this.myForm = new i5.FormGroup({
1512
+ "html": new i5.FormControl(),
1513
+ });
1514
+ this.tags = [];
1515
+ this.useHtmlRaw = false;
1516
+ this.html = "";
1517
+ this.onHtmlChanged = new i0.EventEmitter();
1518
+ this.rendered = new i0.EventEmitter();
1519
+ this.bodyTags = [];
1520
+ }
1521
+ VisualEditorComponent.prototype.isHtmlSet = function () {
1522
+ return this.html.startsWith("<body>");
1523
+ };
1524
+ VisualEditorComponent.prototype.clearHtml = function () {
1525
+ this.html = "";
1526
+ this.recalculateBodyTags();
1527
+ };
1528
+ VisualEditorComponent.prototype.getHtml = function () {
1529
+ this.recalculateHtml();
1530
+ return this.html;
1531
+ };
1532
+ VisualEditorComponent.prototype.ngAfterViewInit = function () {
1533
+ this.rendered.emit(true);
1534
+ };
1535
+ VisualEditorComponent.prototype.ngAfterContentChecked = function () {
1536
+ this._cdref.detectChanges();
1537
+ };
1538
+ VisualEditorComponent.prototype.addTag = function () {
1539
+ var _this = this;
1540
+ var tagDescription = this.tags
1541
+ .find(function (x) { return x.tag === _this.selectedValue; });
1542
+ var attrs = {};
1543
+ var innerHtml = "";
1544
+ if (TextMethods.textTags.includes(tagDescription.tag)) {
1545
+ attrs["h-align"] = "left";
1546
+ innerHtml = "Введите ваш текст";
1547
+ }
1548
+ else if (tagDescription.tag == ExternalVideoTagDataConsts.TagName) {
1549
+ attrs[ExternalVideoTagDataConsts.VideoTypeAttrName] = ExternalVideoSupportedTypes.Youtube;
1550
+ attrs[ExternalVideoTagDataConsts.LinkAttrName] = null;
1551
+ }
1552
+ else {
1553
+ attrs[FileImageTagDataConsts.FileIdAttrName] = null;
1554
+ }
1555
+ this.bodyTags.push({
1556
+ tagDescription: tagDescription,
1557
+ innerHtml: innerHtml,
1558
+ attributes: attrs,
1559
+ presentOrEdit: true
1560
+ });
1561
+ this.recalculateHtml();
1562
+ };
1563
+ VisualEditorComponent.prototype.postFilesStartedEventHandler = function (model) {
1564
+ this.loadingText = "Файлы загружаются на сервер";
1565
+ this.isLoading = true;
1566
+ };
1567
+ VisualEditorComponent.prototype.addTagCustom = function (tag) {
1568
+ this.bodyTags.push(tag);
1569
+ this.recalculateHtml();
1570
+ };
1571
+ VisualEditorComponent.prototype.filesTagsReadyHandler = function (tags) {
1572
+ for (var i = 0; i < tags.length; i++) {
1573
+ this.bodyTags.push(tags[i]);
1574
+ }
1575
+ this.recalculateHtml();
1576
+ this.isLoading = false;
1577
+ };
1578
+ VisualEditorComponent.prototype.drop = function (event) {
1579
+ i11.moveItemInArray(this.bodyTags, event.previousIndex, event.currentIndex);
1580
+ this.recalculateHtml();
1581
+ };
1582
+ VisualEditorComponent.prototype.onTagSavedHandler = function (tag) {
1583
+ this.recalculateHtml();
1584
+ };
1585
+ VisualEditorComponent.prototype.onTagRemovedHandler = function (index) {
1586
+ this.bodyTags.splice(index, 1);
1587
+ this.recalculateHtml();
1588
+ };
1589
+ VisualEditorComponent.prototype.recalculateHtml = function () {
1590
+ var result = BodyTagsExtensions.toHtml(this.bodyTags);
1591
+ this.html = XmlExtensions.formatXml("<body>" + result + "</body>");
1592
+ this.onHtmlChanged.emit(this.html);
1593
+ };
1594
+ VisualEditorComponent.prototype.recalculateBodyTags = function () {
1595
+ this.bodyTags = BodyTagsExtensions.getBodyTags(this.html);
1596
+ };
1597
+ VisualEditorComponent.prototype.ngOnInit = function () {
1598
+ this.recalculateBodyTags();
1599
+ this.tags = DefaultTags.getTags(this.useHtmlRaw);
1600
+ this.selectedValue = this.tags[0].tag;
1601
+ };
1602
+ return VisualEditorComponent;
1603
+ }());
1604
+ VisualEditorComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: VisualEditorComponent, deps: [{ token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
1605
+ VisualEditorComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.5", type: VisualEditorComponent, selector: "croco-visual-editor", inputs: { showMarkUp: "showMarkUp", useHtmlRaw: "useHtmlRaw", html: "html" }, outputs: { html: "html", onHtmlChanged: "onHtmlChanged", rendered: "rendered" }, ngImport: i0__namespace, template: "<div *ngIf=\"isLoading\">\n <div>\n <mat-spinner style=\"margin:0 auto;\"></mat-spinner>\n <div style=\"text-align: center;\">{{loadingText}}</div>\n </div>\n <div style=\"height: 10px;\"></div>\n</div>\n\n<div [hidden]=\"isLoading\">\n <div cdkDropList (cdkDropListDropped)=\"drop($event)\">\n <div *ngFor=\"let tag of bodyTags; let i = index\" cdkDrag>\n <mat-card>\n <div class=\"d-flex justify-content-between\">\n <div class=\"example-handle\" cdkDragHandle>\n <svg width=\"24px\" fill=\"currentColor\" viewBox=\"0 0 24 24\">\n <path\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\">\n </path>\n <path d=\"M0 0h24v24H0z\" fill=\"none\"></path>\n </svg>\n </div>\n <div>\n <mat-chip-list aria-label=\"Tag display value\">\n <mat-chip color=\"primary\" selected>{{tag.tagDescription.displayValue}}</mat-chip>\n </mat-chip-list>\n </div>\n </div>\n \n <div style=\"height: 15px;\"></div>\n \n <croco-html-main-editor-block [tag]=\"tag\" \n (onTagSaved)=\"onTagSavedHandler($event)\"\n (onTagRemoved)=\"onTagRemovedHandler(i)\">\n </croco-html-main-editor-block>\n </mat-card>\n \n <div style=\"height: 10px;\">\n </div>\n </div>\n </div>\n</div>\n\n\n<div [hidden]=\"isLoading\">\n <mat-card>\n <div class=\"row d-flex align-items-center\">\n <div class=\"col-12\">\n <mat-form-field class=\"w-100\" appearance=\"fill\">\n <mat-label>\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0442\u0435\u0433</mat-label>\n <mat-select [(ngModel)]=\"selectedValue\">\n <mat-option *ngFor=\"let tag of tags\" [value]=\"tag.tag\">\n {{tag.displayValue}}\n </mat-option>\n </mat-select>\n </mat-form-field>\n </div>\n <div class=\"col-12\">\n <button (click)=\"addTag()\" class=\"w-100\" mat-stroked-button>\n \u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0442\u0435\u0433\n </button>\n </div>\n </div>\n </mat-card>\n\n <div style=\"height: 10px;\">\n </div>\n</div>\n\n<div [hidden]=\"isLoading\">\n <mat-card>\n <div class=\"row d-flex align-items-center\">\n <div class=\"col-12\">\n <croco-add-files-btn \n (filesTagsReady)=\"filesTagsReadyHandler($event)\"\n (postFilesStarted)=\"postFilesStartedEventHandler($event)\"\n class=\"w-100\">\n </croco-add-files-btn>\n </div>\n </div>\n </mat-card>\n\n <div style=\"height: 10px;\">\n </div>\n</div>", styles: [".example-list{width:500px;max-width:100%;border:solid 1px #ccc;min-height:60px;display:block;background:white;border-radius:4px;overflow:hidden}.example-box{padding:20px 10px;border-bottom:solid 1px #ccc;color:#000000de;display:flex;flex-direction:row;align-items:center;justify-content:space-between;box-sizing:border-box;cursor:move;background:white;font-size:14px}.cdk-drag-preview{box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.example-box:last-child{border:none}.example-list.cdk-drop-list-dragging .example-box:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}\n"], components: [{ type: i1__namespace$3.MatSpinner, selector: "mat-spinner", inputs: ["color"] }, { type: i2__namespace$3.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { type: i3__namespace$1.MatChipList, selector: "mat-chip-list", inputs: ["aria-orientation", "multiple", "compareWith", "value", "required", "placeholder", "disabled", "selectable", "tabIndex", "errorStateMatcher"], outputs: ["change", "valueChange"], exportAs: ["matChipList"] }, { type: MainEditorBlockComponent, selector: "croco-html-main-editor-block", inputs: ["tag"], outputs: ["onTagSaved", "onTagRemoved"] }, { type: i5__namespace.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i6__namespace.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i7__namespace.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { type: i2__namespace.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: AddFilesBtnComponent, selector: "croco-add-files-btn", outputs: ["postFilesStarted", "filesTagsReady"] }], directives: [{ type: i2__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i11__namespace.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "id", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListAutoScrollDisabled", "cdkDropListOrientation", "cdkDropListLockAxis", "cdkDropListData", "cdkDropListAutoScrollStep"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { type: i2__namespace$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i11__namespace.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragDisabled", "cdkDragStartDelay", "cdkDragLockAxis", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragBoundary", "cdkDragRootElement", "cdkDragPreviewContainer", "cdkDragData", "cdkDragFreeDragPosition"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { type: i11__namespace.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { type: i3__namespace$1.MatChip, selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", inputs: ["color", "disableRipple", "tabIndex", "selected", "value", "selectable", "disabled", "removable"], outputs: ["selectionChange", "destroyed", "removed"], exportAs: ["matChip"] }, { type: i5__namespace.MatLabel, selector: "mat-label" }, { type: i5__namespace$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5__namespace$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
1606
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: VisualEditorComponent, decorators: [{
1607
+ type: i0.Component,
1608
+ args: [{
1609
+ selector: 'croco-visual-editor',
1610
+ templateUrl: './visual-editor.component.html',
1611
+ styleUrls: ['./visual-editor.component.css']
1612
+ }]
1613
+ }], ctorParameters: function () { return [{ type: i0__namespace.ChangeDetectorRef }]; }, propDecorators: { showMarkUp: [{
1614
+ type: i0.Input
1615
+ }], useHtmlRaw: [{
1616
+ type: i0.Input
1617
+ }], html: [{
1618
+ type: i0.Input
1619
+ }, {
1620
+ type: i0.Output
1621
+ }], onHtmlChanged: [{
1622
+ type: i0.Output
1623
+ }], rendered: [{
1624
+ type: i0.Output
1625
+ }] } });
1626
+
1627
+ var XmlTagTextViewComponent = /** @class */ (function () {
1628
+ function XmlTagTextViewComponent() {
1629
+ }
1630
+ XmlTagTextViewComponent.prototype.ngOnInit = function () {
1631
+ };
1632
+ return XmlTagTextViewComponent;
1633
+ }());
1634
+ XmlTagTextViewComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: XmlTagTextViewComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
1635
+ XmlTagTextViewComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.5", type: XmlTagTextViewComponent, selector: "croco-html-xml-tag-text-view", inputs: { item: "item" }, ngImport: i0__namespace, template: "<div *ngIf=\"item.data.validationResult.isSucceeded && item.data.horizontalAlignment === 'left'\" style=\"text-align: left;\">\n <span *ngIf=\"item.data.html.length === 0 || !item.data.html\">&nbsp;</span>\n <span *ngIf=\"item.data.html.length > 0\" [innerHtml]=\"item.data.html\"></span>\n</div>\n\n<div *ngIf=\"item.data.validationResult.isSucceeded && item.data.horizontalAlignment === 'right'\" style=\"text-align: right;\">\n <span *ngIf=\"item.data.html.length === 0 || !item.data.html\">&nbsp;</span>\n <span *ngIf=\"item.data.html.length > 0\" [innerHtml]=\"item.data.html\"></span>\n</div>\n\n<div *ngIf=\"item.data.validationResult.isSucceeded && item.data.horizontalAlignment === 'center'\" style=\"text-align: center;\">\n <span *ngIf=\"item.data.html.length === 0 || !item.data.html\">&nbsp;</span>\n <span *ngIf=\"item.data.html.length > 0\" [innerHtml]=\"item.data.html\"></span>\n</div>\n\n<div *ngIf=\"!item.data.validationResult.isSucceeded\" class=\"red\" style=\"margin-top: 10px;\" >\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>\n <span>\n {{item.data.validationResult.message}}\n </span>\n</div>", styles: [""], directives: [{ type: i2__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
1636
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: XmlTagTextViewComponent, decorators: [{
1637
+ type: i0.Component,
1638
+ args: [{
1639
+ selector: 'croco-html-xml-tag-text-view',
1640
+ templateUrl: './xml-tag-text-view.component.html',
1641
+ styleUrls: ['./xml-tag-text-view.component.css']
1642
+ }]
1643
+ }], ctorParameters: function () { return []; }, propDecorators: { item: [{
1644
+ type: i0.Input
1645
+ }] } });
1646
+
1647
+ var XmlTagHeaderInnerTextViewComponent = /** @class */ (function () {
1648
+ function XmlTagHeaderInnerTextViewComponent() {
1649
+ }
1650
+ XmlTagHeaderInnerTextViewComponent.prototype.ngOnInit = function () {
1651
+ };
1652
+ return XmlTagHeaderInnerTextViewComponent;
1653
+ }());
1654
+ XmlTagHeaderInnerTextViewComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: XmlTagHeaderInnerTextViewComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
1655
+ XmlTagHeaderInnerTextViewComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.5", type: XmlTagHeaderInnerTextViewComponent, selector: "croco-html-xml-tag-header-inner-text-view", inputs: { item: "item" }, ngImport: i0__namespace, template: "<h1 *ngIf=\"item.type === 'h1'\" \n [innerHtml]=\"item.data.html\">\n</h1>\n<h2 *ngIf=\"item.type === 'h2'\" \n [innerHtml]=\"item.data.html\">\n</h2>\n<h3 *ngIf=\"item.type === 'h3'\" \n [innerHtml]=\"item.data.html\">\n</h3>\n<h4 *ngIf=\"item.type === 'h4'\" \n [innerHtml]=\"item.data.html\">\n</h4>\n<h5 *ngIf=\"item.type === 'h5'\" \n [innerHtml]=\"item.data.html\">\n</h5>\n<h6 *ngIf=\"item.type === 'h6'\" \n [innerHtml]=\"item.data.html\">\n</h6>", styles: [""], directives: [{ type: i2__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
1656
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: XmlTagHeaderInnerTextViewComponent, decorators: [{
1657
+ type: i0.Component,
1658
+ args: [{
1659
+ selector: 'croco-html-xml-tag-header-inner-text-view',
1660
+ templateUrl: './xml-tag-header-inner-text-view.component.html',
1661
+ styleUrls: ['./xml-tag-header-inner-text-view.component.css']
1662
+ }]
1663
+ }], ctorParameters: function () { return []; }, propDecorators: { item: [{
1664
+ type: i0.Input
1665
+ }] } });
1666
+
1667
+ var XmlTagHeaderTextViewComponent = /** @class */ (function () {
1668
+ function XmlTagHeaderTextViewComponent() {
1669
+ }
1670
+ XmlTagHeaderTextViewComponent.prototype.ngOnInit = function () {
1671
+ };
1672
+ return XmlTagHeaderTextViewComponent;
1673
+ }());
1674
+ XmlTagHeaderTextViewComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: XmlTagHeaderTextViewComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
1675
+ XmlTagHeaderTextViewComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.5", type: XmlTagHeaderTextViewComponent, selector: "croco-html-xml-tag-header-text-view", inputs: { item: "item" }, ngImport: i0__namespace, template: "<div *ngIf=\"item.data.validationResult.isSucceeded && item.data.horizontalAlignment === 'left'\" style=\"text-align: left;\">\n <span *ngIf=\"item.data.html.length === 0 || !item.data.html\">&nbsp;</span>\n <croco-html-xml-tag-header-inner-text-view *ngIf=\"item.data.html.length > 0\" [item]=\"item\">\n </croco-html-xml-tag-header-inner-text-view>\n</div>\n\n<div *ngIf=\"item.data.validationResult.isSucceeded && item.data.horizontalAlignment === 'right'\" style=\"text-align: right;\">\n <span *ngIf=\"item.data.html.length === 0 || !item.data.html\">&nbsp;</span>\n <croco-html-xml-tag-header-inner-text-view *ngIf=\"item.data.html.length > 0\" [item]=\"item\">\n </croco-html-xml-tag-header-inner-text-view>\n</div>\n\n<div *ngIf=\"item.data.validationResult.isSucceeded && item.data.horizontalAlignment === 'center'\" style=\"text-align: center;\">\n <span *ngIf=\"item.data.html.length === 0 || !item.data.html\">&nbsp;</span>\n\n <croco-html-xml-tag-header-inner-text-view *ngIf=\"item.data.html.length > 0\" [item]=\"item\">\n </croco-html-xml-tag-header-inner-text-view>\n</div>\n\n<div *ngIf=\"!item.data.validationResult.isSucceeded\" class=\"red\" style=\"margin-top: 10px;\" >\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>\n <span>\n {{item.data.validationResult.message}}\n </span>\n</div>", styles: [""], components: [{ type: XmlTagHeaderInnerTextViewComponent, selector: "croco-html-xml-tag-header-inner-text-view", inputs: ["item"] }], directives: [{ type: i2__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
1676
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: XmlTagHeaderTextViewComponent, decorators: [{
1677
+ type: i0.Component,
1678
+ args: [{
1679
+ selector: 'croco-html-xml-tag-header-text-view',
1680
+ templateUrl: './xml-tag-header-text-view.component.html',
1681
+ styleUrls: ['./xml-tag-header-text-view.component.css']
1682
+ }]
1683
+ }], ctorParameters: function () { return []; }, propDecorators: { item: [{
1684
+ type: i0.Input
1685
+ }] } });
1686
+
1687
+ var XmlTagHtmlViewComponent = /** @class */ (function () {
1688
+ function XmlTagHtmlViewComponent() {
1689
+ this.html = "";
1690
+ }
1691
+ return XmlTagHtmlViewComponent;
1692
+ }());
1693
+ XmlTagHtmlViewComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: XmlTagHtmlViewComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
1694
+ XmlTagHtmlViewComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.5", type: XmlTagHtmlViewComponent, selector: "croco-html-xml-tag-html-view", inputs: { html: "html" }, ngImport: i0__namespace, template: "<div class=\"col\" [innerHTML]=\"html\">\n \n</div>", styles: [""] });
1695
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: XmlTagHtmlViewComponent, decorators: [{
1696
+ type: i0.Component,
1697
+ args: [{
1698
+ selector: 'croco-html-xml-tag-html-view',
1699
+ templateUrl: './xml-tag-html-view.component.html',
1700
+ styleUrls: ['./xml-tag-html-view.component.css']
1701
+ }]
1702
+ }], ctorParameters: function () { return []; }, propDecorators: { html: [{
1703
+ type: i0.Input
1704
+ }] } });
1705
+
1706
+ var XmlTagViewComponent = /** @class */ (function () {
1707
+ function XmlTagViewComponent() {
1708
+ this.data = [];
1709
+ }
1710
+ return XmlTagViewComponent;
1711
+ }());
1712
+ XmlTagViewComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: XmlTagViewComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
1713
+ XmlTagViewComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.5", type: XmlTagViewComponent, selector: "croco-html-xml-tag-view", inputs: { data: "data" }, ngImport: i0__namespace, template: "<div class=\"\">\n <div class=\"row\" *ngFor=\"let item of data\">\n <div *ngIf=\"item.type === 'text'\">\n <croco-html-xml-tag-text-view [item]=\"item\"></croco-html-xml-tag-text-view>\n </div>\n <div *ngIf=\"item.type === 'image'\" class=\"red\" style=\"margin-top: 10px;\" >\n <h4>\u0414\u0430\u043D\u043D\u044B\u0439 \u0442\u0435\u0433 \u0431\u043E\u043B\u044C\u0448\u0435 \u0431\u043E\u043B\u044C\u0448\u0435 \u043D\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044F</h4>\n <span>\n \u0412\u043C\u0435\u0442\u043E \u044D\u0442\u043E\u0433\u043E \u043F\u0435\u0440\u0435\u0438\u043C\u0435\u043D\u0443\u0439\u0442\u0435 \u0442\u0435\u0433 image \u043D\u0430 file-image\n </span>\n </div>\n <div *ngIf=\"item.type === 'html-raw'\" [innerHTML]=\"item.data.innerHTML\">\n </div>\n <div *ngIf=\"item.type === 'h1' || item.type === 'h2' || item.type === 'h3' || item.type === 'h4' || item.type === 'h5' || item.type === 'h6'\">\n <croco-html-xml-tag-header-text-view [item]=\"item\"></croco-html-xml-tag-header-text-view>\n </div>\n <div *ngIf=\"item.type === 'file-image'\">\n <img class=\"mx-auto d-block img-fluid\" [src]=\"item.data.src\"/>\n </div>\n <div *ngIf=\"item.type === 'table'\">\n \n <croco-html-xml-tag-html-view *ngIf=\"item.validationResult.isSucceeded\" [html]=\"item.bootstrapHtml\">\n </croco-html-xml-tag-html-view>\n \n <app-tutor-baseapiresponse-banner \n *ngIf=\"item.validationResult && !item.validationResult.isSucceeded\" \n [message]=\"item.validationResult.message\">\n </app-tutor-baseapiresponse-banner>\n </div>\n \n <div *ngIf=\"item.type === 'rich-text'\">\n <croco-html-xml-tag-text-view [richTextData]=\"item\"></croco-html-xml-tag-text-view>\n </div>\n <div *ngIf=\"item.type === 'external-video'\">\n <croco-html-xml-tag-external-video [data]=\"item\"></croco-html-xml-tag-external-video>\n </div>\n <div *ngIf=\"item.type === 'unsupported-tag'\" class=\"red\" style=\"margin-top: 10px;\" >\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>\n <span>\n {{item.data.tagString}}\n </span>\n </div>\n </div>\n</div>", styles: [".red{background-color:#c94444;color:#fff}\n"], components: [{ type: XmlTagTextViewComponent, selector: "croco-html-xml-tag-text-view", inputs: ["item"] }, { type: XmlTagHeaderTextViewComponent, selector: "croco-html-xml-tag-header-text-view", inputs: ["item"] }, { type: XmlTagHtmlViewComponent, selector: "croco-html-xml-tag-html-view", inputs: ["html"] }, { type: XmlTagExternalVideoComponent, selector: "croco-html-xml-tag-external-video", inputs: ["data", "tagData"] }], directives: [{ type: i2__namespace$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], encapsulation: i0__namespace.ViewEncapsulation.None });
1714
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: XmlTagViewComponent, decorators: [{
1715
+ type: i0.Component,
1716
+ args: [{
1717
+ selector: 'croco-html-xml-tag-view',
1718
+ templateUrl: './xml-tag-view.component.html',
1719
+ styleUrls: ['./xml-tag-view.component.css'],
1720
+ encapsulation: i0.ViewEncapsulation.None,
1721
+ }]
1722
+ }], ctorParameters: function () { return []; }, propDecorators: { data: [{
1723
+ type: i0.Input
1724
+ }] } });
1725
+
1726
+ var ToPreviewPipe = /** @class */ (function () {
1727
+ function ToPreviewPipe() {
1728
+ }
1729
+ ToPreviewPipe.prototype.transform = function (value) {
1730
+ return HtmlExtractionMethods.transformHtmlStringToBlocks(value);
1731
+ };
1732
+ return ToPreviewPipe;
1733
+ }());
1734
+ ToPreviewPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: ToPreviewPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
1735
+ ToPreviewPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: ToPreviewPipe, name: "topreview" });
1736
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: ToPreviewPipe, decorators: [{
1737
+ type: i0.Pipe,
1738
+ args: [{
1739
+ name: 'topreview'
1740
+ }]
1741
+ }] });
1742
+
1743
+ var MainEditorComponent = /** @class */ (function () {
1744
+ function MainEditorComponent(_clipboardService, _snackBar, _cdref) {
1745
+ this._clipboardService = _clipboardService;
1746
+ this._snackBar = _snackBar;
1747
+ this._cdref = _cdref;
1748
+ this.visualEditorRendered = false;
1749
+ this.showMarkUp = true;
1750
+ this.useHtmlRaw = false;
1751
+ this.myForm = new i5.FormGroup({
1752
+ "html": new i5.FormControl(),
1753
+ });
1754
+ this.html = "";
1755
+ this.onHtmlChanged = new i0.EventEmitter();
1756
+ }
1757
+ MainEditorComponent.prototype.ngAfterContentChecked = function () {
1758
+ this._cdref.detectChanges();
1759
+ };
1760
+ MainEditorComponent.prototype.visualEditorRenderedHandler = function () {
1761
+ this.visualEditorRendered = true;
1762
+ this.recalculateBodyTags();
1763
+ };
1764
+ MainEditorComponent.prototype.onHtmlChangedHandler = function (html) {
1765
+ this.html = html;
1766
+ this.onHtmlChanged.emit(html);
1767
+ };
1768
+ MainEditorComponent.prototype.textAreaModelChangedHandler = function () {
1769
+ this.recalculateBodyTags();
1770
+ this.onHtmlChangedHandler(this.html);
1771
+ };
1772
+ MainEditorComponent.prototype.recalculateBodyTags = function () {
1773
+ this.visualEditor.html = this.html;
1774
+ this.visualEditor.recalculateBodyTags();
1775
+ };
1776
+ MainEditorComponent.prototype.copyMarkUp = function () {
1777
+ this._snackBar.open("Разметка таблицы скопирована в буфер обмена", "Закрыть", { duration: 1500 });
1778
+ this._clipboardService.copy(this.html);
1779
+ };
1780
+ MainEditorComponent.prototype.ngOnInit = function () {
1781
+ };
1782
+ return MainEditorComponent;
1783
+ }());
1784
+ MainEditorComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: MainEditorComponent, deps: [{ token: i1__namespace$4.ClipboardService }, { token: i2__namespace$4.MatSnackBar }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
1785
+ MainEditorComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.5", type: MainEditorComponent, selector: "croco-html-main-editor", inputs: { showMarkUp: "showMarkUp", useHtmlRaw: "useHtmlRaw", html: "html" }, outputs: { html: "html", onHtmlChanged: "onHtmlChanged" }, viewQueries: [{ propertyName: "visualEditor", first: true, predicate: ["visualEditor"], descendants: true }], ngImport: i0__namespace, template: "<mat-tab-group>\n <mat-tab label=\"\u0412\u0438\u0437\u0443\u0430\u043B\u044C\u043D\u044B\u0439 \u0440\u0435\u0434\u0430\u043A\u0442\u043E\u0440\">\n\n <div style=\"height: 20px;\"></div>\n\n <croco-visual-editor #visualEditor\n [useHtmlRaw]=\"useHtmlRaw\"\n [html]=\"html\"\n (onHtmlChanged)=\"onHtmlChangedHandler($event)\"\n (rendered)=\"visualEditorRenderedHandler()\">\n </croco-visual-editor>\n\n <div style=\"height: 20px;\"></div>\n\n </mat-tab>\n\n <mat-tab label=\"\u0420\u0430\u0437\u043C\u0435\u0442\u043A\u0430\">\n <div style=\"height: 10px;\"></div>\n <form *ngIf=\"visualEditorRendered\" [formGroup]=\"myForm\">\n <mat-form-field class=\"w-100\">\n <textarea matInput cdkTextareaAutosize #autosize=\"cdkTextareaAutosize\"\n cdkAutosizeMinRows=\"1\"\n placeholder=\"\u0418\u0441\u0445\u043E\u0434\u043D\u044B\u0439 \u043A\u043E\u0434\" formControlName=\"html\" [(ngModel)]=\"html\"\n (ngModelChange)=\"textAreaModelChangedHandler()\"></textarea>\n </mat-form-field>\n </form>\n\n <button (click)=\"copyMarkUp()\" \n mat-raised-button color=\"primary\">\n \u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0440\u0430\u0437\u043C\u0435\u0442\u043A\u0443\n </button>\n </mat-tab>\n <mat-tab label=\"\u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\">\n <mat-card>\n <croco-html-xml-tag-view [data]=\"html | topreview\">\n </croco-html-xml-tag-view>\n </mat-card>\n </mat-tab>\n</mat-tab-group>", styles: [".example-list{width:500px;max-width:100%;border:solid 1px #ccc;min-height:60px;display:block;background:white;border-radius:4px;overflow:hidden}.example-box{padding:20px 10px;border-bottom:solid 1px #ccc;color:#000000de;display:flex;flex-direction:row;align-items:center;justify-content:space-between;box-sizing:border-box;cursor:move;background:white;font-size:14px}.cdk-drag-preview{box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.example-box:last-child{border:none}.example-list.cdk-drop-list-dragging .example-box:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}\n"], components: [{ type: i3__namespace$2.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "disableRipple"], exportAs: ["matTabGroup"] }, { type: i3__namespace$2.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby"], exportAs: ["matTab"] }, { type: VisualEditorComponent, selector: "croco-visual-editor", inputs: ["showMarkUp", "useHtmlRaw", "html"], outputs: ["html", "onHtmlChanged", "rendered"] }, { type: i5__namespace.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i2__namespace.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i2__namespace$3.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { type: XmlTagViewComponent, selector: "croco-html-xml-tag-view", inputs: ["data"] }], directives: [{ type: i2__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5__namespace$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i5__namespace$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i5__namespace$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5__namespace$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i4__namespace.CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }, { type: i5__namespace$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i5__namespace$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5__namespace$1.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }], pipes: { "topreview": ToPreviewPipe } });
1786
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: MainEditorComponent, decorators: [{
1787
+ type: i0.Component,
1788
+ args: [{
1789
+ selector: 'croco-html-main-editor',
1790
+ templateUrl: './main-editor.component.html',
1791
+ styleUrls: ['./main-editor.component.css']
1792
+ }]
1793
+ }], ctorParameters: function () { return [{ type: i1__namespace$4.ClipboardService }, { type: i2__namespace$4.MatSnackBar }, { type: i0__namespace.ChangeDetectorRef }]; }, propDecorators: { visualEditor: [{
1794
+ type: i0.ViewChild,
1795
+ args: ["visualEditor"]
1796
+ }], showMarkUp: [{
1797
+ type: i0.Input
1798
+ }], useHtmlRaw: [{
1799
+ type: i0.Input
1800
+ }], html: [{
1801
+ type: i0.Input
1802
+ }, {
1803
+ type: i0.Output
1804
+ }], onHtmlChanged: [{
1805
+ type: i0.Output
1806
+ }] } });
1807
+
1808
+ var RichTextToHtmlPipe = /** @class */ (function () {
1809
+ function RichTextToHtmlPipe() {
1810
+ }
1811
+ RichTextToHtmlPipe.prototype.transform = function (value) {
1812
+ var result = "";
1813
+ for (var i = 0; i < value.data.children.length; i++) {
1814
+ var child = value.data.children[i];
1815
+ if (child.type === "text-block") {
1816
+ result += "<span>" + child.data.text + "</span>";
1817
+ }
1818
+ else if (child.type === "line-break") {
1819
+ result += "</br>";
1820
+ }
1821
+ }
1822
+ return result;
1823
+ };
1824
+ return RichTextToHtmlPipe;
1825
+ }());
1826
+ RichTextToHtmlPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: RichTextToHtmlPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
1827
+ RichTextToHtmlPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: RichTextToHtmlPipe, name: "richTextToHtml" });
1828
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: RichTextToHtmlPipe, decorators: [{
1829
+ type: i0.Pipe,
1830
+ args: [{
1831
+ name: 'richTextToHtml'
1832
+ }]
1833
+ }] });
1834
+
1835
+ var XmlTagRichTextViewComponent = /** @class */ (function () {
1836
+ function XmlTagRichTextViewComponent() {
1837
+ this.richTextData = null;
1838
+ }
1839
+ XmlTagRichTextViewComponent.prototype.ngOnInit = function () {
1840
+ };
1841
+ return XmlTagRichTextViewComponent;
1842
+ }());
1843
+ XmlTagRichTextViewComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: XmlTagRichTextViewComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
1844
+ XmlTagRichTextViewComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.5", type: XmlTagRichTextViewComponent, selector: "croco-html-xml-tag-rich-text-view", inputs: { richTextData: "richTextData" }, ngImport: i0__namespace, template: "<div *ngIf=\"richTextData\" [innerHtml]=\"richTextData | richTextToHtml\">\n</div>", styles: [""], directives: [{ type: i2__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "richTextToHtml": RichTextToHtmlPipe } });
1845
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: XmlTagRichTextViewComponent, decorators: [{
1846
+ type: i0.Component,
1847
+ args: [{
1848
+ selector: 'croco-html-xml-tag-rich-text-view',
1849
+ templateUrl: './xml-tag-rich-text-view.component.html',
1850
+ styleUrls: ['./xml-tag-rich-text-view.component.css']
1851
+ }]
1852
+ }], ctorParameters: function () { return []; }, propDecorators: { richTextData: [{
1853
+ type: i0.Input
1854
+ }] } });
1855
+
1856
+ var XmlTagTableViewComponent = /** @class */ (function () {
1857
+ function XmlTagTableViewComponent() {
1858
+ this.displayedColumns = [];
1859
+ }
1860
+ return XmlTagTableViewComponent;
1861
+ }());
1862
+ XmlTagTableViewComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: XmlTagTableViewComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
1863
+ XmlTagTableViewComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.1.5", type: XmlTagTableViewComponent, selector: "croco-html-xml-tag-table-view", inputs: { displayedColumns: "displayedColumns", data: "data" }, ngImport: i0__namespace, template: "<table mat-table [dataSource]=\"data\" class=\"mat-elevation-z8 w-100 example-container\">\n <ng-container [matColumnDef]=\"column\" *ngFor=\"let column of displayedColumns\">\n <th mat-header-cell *matHeaderCellDef> {{column}} </th>\n <td mat-cell *matCellDef=\"let element\"> {{element[column]}} </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\n</table>", styles: [""], components: [{ type: i1__namespace$5.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { type: i1__namespace$5.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { type: i1__namespace$5.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }], directives: [{ type: i2__namespace$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1__namespace$5.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { type: i1__namespace$5.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { type: i1__namespace$5.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { type: i1__namespace$5.MatCellDef, selector: "[matCellDef]" }, { type: i1__namespace$5.MatCell, selector: "mat-cell, td[mat-cell]" }, { type: i1__namespace$5.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { type: i1__namespace$5.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }] });
1864
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: XmlTagTableViewComponent, decorators: [{
1865
+ type: i0.Component,
1866
+ args: [{
1867
+ selector: 'croco-html-xml-tag-table-view',
1868
+ templateUrl: './xml-tag-table-view.component.html',
1869
+ styleUrls: ['./xml-tag-table-view.component.css']
1870
+ }]
1871
+ }], propDecorators: { displayedColumns: [{
1872
+ type: i0.Input
1873
+ }], data: [{
1874
+ type: i0.Input
1875
+ }] } });
1876
+
1877
+ var TagToSpanPipe = /** @class */ (function () {
1878
+ function TagToSpanPipe() {
1879
+ }
1880
+ TagToSpanPipe.prototype.transform = function (value) {
1881
+ return value.map(function (x) { return ("<b>" + x + "</b>"); }).join(' | ');
1882
+ };
1883
+ return TagToSpanPipe;
1884
+ }());
1885
+ TagToSpanPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: TagToSpanPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
1886
+ TagToSpanPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: TagToSpanPipe, name: "tagToSpan" });
1887
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: TagToSpanPipe, decorators: [{
1888
+ type: i0.Pipe,
1889
+ args: [{
1890
+ name: 'tagToSpan'
1891
+ }]
1892
+ }] });
1893
+
1894
+ var ToHtmlBodyTagsPipe = /** @class */ (function () {
1895
+ function ToHtmlBodyTagsPipe() {
1896
+ }
1897
+ ToHtmlBodyTagsPipe.prototype.transform = function (value) {
1898
+ return BodyTagsExtensions.getBodyTags(value);
1899
+ };
1900
+ return ToHtmlBodyTagsPipe;
1901
+ }());
1902
+ ToHtmlBodyTagsPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: ToHtmlBodyTagsPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
1903
+ ToHtmlBodyTagsPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: ToHtmlBodyTagsPipe, name: "tohtmlbodytags" });
1904
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: ToHtmlBodyTagsPipe, decorators: [{
1905
+ type: i0.Pipe,
1906
+ args: [{
1907
+ name: 'tohtmlbodytags'
1908
+ }]
1909
+ }] });
1910
+
1911
+ var TableBuilder = /** @class */ (function () {
1912
+ function TableBuilder() {
1913
+ }
1914
+ TableBuilder.getTableMarkUp = function (rows, cols, generateHeaders) {
1915
+ rows = +rows;
1916
+ cols = +cols;
1917
+ var result = "<table>";
1918
+ if (generateHeaders) {
1919
+ result += TableBuilder.getTableHeaderMarkUp(cols);
1920
+ }
1921
+ result += TableBuilder.getTableBodyMarkUp(cols, rows);
1922
+ result += "</table>";
1923
+ return XmlExtensions.formatXml(result);
1924
+ };
1925
+ TableBuilder.getTableHeaderMarkUp = function (cols) {
1926
+ var result = "<thead><tr>";
1927
+ for (var i = 0; i < cols; i++) {
1928
+ result += "<th>\u041A\u043E\u043B\u043E\u043D\u043A\u0430 #" + (i + 1) + "</th>";
1929
+ }
1930
+ result += "</tr></thead>";
1931
+ return result;
1932
+ };
1933
+ TableBuilder.getTableBodyMarkUp = function (cols, rows) {
1934
+ var result = "<tbody>";
1935
+ for (var row = 0; row < rows; row++) {
1936
+ result += "<tr>";
1937
+ for (var i = 0; i < cols; i++) {
1938
+ result += "<td>\u0420\u044F\u0434\u2116" + (row + 1) + " \u041A\u043E\u043B\u043E\u043D\u043A\u0430 #" + (i + 1) + "</td>";
1939
+ }
1940
+ result += "</tr>";
1941
+ }
1942
+ result += "</tbody>";
1943
+ return result;
1944
+ };
1945
+ return TableBuilder;
1946
+ }());
1947
+
1948
+ var EditorComponents = [
1949
+ MainEditorComponent,
1950
+ FileIdSelectComponent,
1951
+ TextEditorComponent,
1952
+ ExternalVideoBlockComponent,
1953
+ ImageEditorComponent,
1954
+ MainEditorBlockComponent,
1955
+ VisualEditorComponent,
1956
+ AddFilesBtnComponent,
1957
+ HtmlRawEditorComponent,
1958
+ ];
1959
+ var XmlComponents = [
1960
+ XmlTagTableViewComponent,
1961
+ XmlTagViewComponent,
1962
+ XmlTagRichTextViewComponent,
1963
+ XmlTagHtmlViewComponent,
1964
+ XmlTagTextViewComponent,
1965
+ XmlTagHeaderTextViewComponent,
1966
+ XmlTagHeaderInnerTextViewComponent,
1967
+ XmlTagExternalVideoComponent
1968
+ ];
1969
+ var CrocoPipes = [
1970
+ RichTextToHtmlPipe,
1971
+ TagToSpanPipe,
1972
+ ToPreviewPipe,
1973
+ ToHtmlBodyTagsPipe,
1974
+ ];
1975
+ var CrocoHtmlDeclarations = __spreadArray(__spreadArray(__spreadArray([
1976
+ UploadFilesBtnComponent
1977
+ ], __read(XmlComponents)), __read(EditorComponents)), __read(CrocoPipes));
1978
+ var MaterialModules = [
1979
+ i23.MatBadgeModule,
1980
+ i1$5.MatTableModule,
1981
+ i25.MatExpansionModule,
1982
+ i5$1.MatFormFieldModule,
1983
+ i2$4.MatSnackBarModule,
1984
+ i28.MatProgressBarModule,
1985
+ i1$3.MatProgressSpinnerModule,
1986
+ i3$2.MatTabsModule,
1987
+ i31.MatMenuModule,
1988
+ i2$3.MatCardModule,
1989
+ i6.MatSelectModule,
1990
+ i34.MatTooltipModule,
1991
+ i35.MatCheckboxModule,
1992
+ i3$1.MatChipsModule,
1993
+ i37.MatListModule,
1994
+ i2.MatButtonModule,
1995
+ i5$2.MatInputModule,
1996
+ i40.MatDialogModule,
1997
+ i41.MatPaginatorModule,
1998
+ i42.MatDatepickerModule,
1999
+ i43.MatGridListModule,
2000
+ i44.MatSlideToggleModule,
2001
+ i45.MatTreeModule,
2002
+ i7.MatNativeDateModule,
2003
+ i47.MatAutocompleteModule,
2004
+ i48.MatSidenavModule,
2005
+ i2$2.MatIconModule,
2006
+ i11.DragDropModule,
2007
+ i1$2.MatButtonToggleModule
2008
+ ];
2009
+
2010
+ var CrocoHtmlModule = /** @class */ (function () {
2011
+ function CrocoHtmlModule() {
2012
+ }
2013
+ return CrocoHtmlModule;
2014
+ }());
2015
+ CrocoHtmlModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: CrocoHtmlModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
2016
+ CrocoHtmlModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: CrocoHtmlModule, declarations: [UploadFilesBtnComponent, XmlTagTableViewComponent, XmlTagViewComponent, XmlTagRichTextViewComponent, XmlTagHtmlViewComponent, XmlTagTextViewComponent, XmlTagHeaderTextViewComponent, XmlTagHeaderInnerTextViewComponent, XmlTagExternalVideoComponent, MainEditorComponent, FileIdSelectComponent, TextEditorComponent, ExternalVideoBlockComponent, ImageEditorComponent, MainEditorBlockComponent, VisualEditorComponent, AddFilesBtnComponent, HtmlRawEditorComponent, RichTextToHtmlPipe, TagToSpanPipe, ToPreviewPipe, ToHtmlBodyTagsPipe], imports: [i2$1.CommonModule,
2017
+ i5.FormsModule,
2018
+ i5.ReactiveFormsModule,
2019
+ i3.NgSelectModule, i23__namespace.MatBadgeModule, i1__namespace$5.MatTableModule, i25__namespace.MatExpansionModule, i5__namespace.MatFormFieldModule, i2__namespace$4.MatSnackBarModule, i28__namespace.MatProgressBarModule, i1__namespace$3.MatProgressSpinnerModule, i3__namespace$2.MatTabsModule, i31__namespace.MatMenuModule, i2__namespace$3.MatCardModule, i6__namespace.MatSelectModule, i34__namespace.MatTooltipModule, i35__namespace.MatCheckboxModule, i3__namespace$1.MatChipsModule, i37__namespace.MatListModule, i2__namespace.MatButtonModule, i5__namespace$2.MatInputModule, i40__namespace.MatDialogModule, i41__namespace.MatPaginatorModule, i42__namespace.MatDatepickerModule, i43__namespace.MatGridListModule, i44__namespace.MatSlideToggleModule, i45__namespace.MatTreeModule, i7__namespace.MatNativeDateModule, i47__namespace.MatAutocompleteModule, i48__namespace.MatSidenavModule, i2__namespace$2.MatIconModule, i11__namespace.DragDropModule, i1__namespace$2.MatButtonToggleModule], exports: [UploadFilesBtnComponent, XmlTagTableViewComponent, XmlTagViewComponent, XmlTagRichTextViewComponent, XmlTagHtmlViewComponent, XmlTagTextViewComponent, XmlTagHeaderTextViewComponent, XmlTagHeaderInnerTextViewComponent, XmlTagExternalVideoComponent, MainEditorComponent, FileIdSelectComponent, TextEditorComponent, ExternalVideoBlockComponent, ImageEditorComponent, MainEditorBlockComponent, VisualEditorComponent, AddFilesBtnComponent, HtmlRawEditorComponent, RichTextToHtmlPipe, TagToSpanPipe, ToPreviewPipe, ToHtmlBodyTagsPipe] });
2020
+ CrocoHtmlModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: CrocoHtmlModule, imports: [__spreadArray([
2021
+ i2$1.CommonModule,
2022
+ i5.FormsModule,
2023
+ i5.ReactiveFormsModule,
2024
+ i3.NgSelectModule
2025
+ ], __read(MaterialModules))] });
2026
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.5", ngImport: i0__namespace, type: CrocoHtmlModule, decorators: [{
2027
+ type: i0.NgModule,
2028
+ args: [{
2029
+ declarations: __spreadArray([], __read(CrocoHtmlDeclarations)),
2030
+ exports: __spreadArray([], __read(CrocoHtmlDeclarations)),
2031
+ imports: __spreadArray([
2032
+ i2$1.CommonModule,
2033
+ i5.FormsModule,
2034
+ i5.ReactiveFormsModule,
2035
+ i3.NgSelectModule
2036
+ ], __read(MaterialModules))
2037
+ }]
2038
+ }] });
2039
+
2040
+ /*
2041
+ * Public API Surface of croco-html
2042
+ */
2043
+
2044
+ /**
2045
+ * Generated bundle index. Do not edit.
2046
+ */
2047
+
2048
+ exports.AddFilesBtnComponent = AddFilesBtnComponent;
2049
+ exports.AngularMaterialTableMethods = AngularMaterialTableMethods;
2050
+ exports.BodyTagsExtensions = BodyTagsExtensions;
2051
+ exports.BootstrapTableMethods = BootstrapTableMethods;
2052
+ exports.CrocoHtmlModule = CrocoHtmlModule;
2053
+ exports.DefaultTags = DefaultTags;
2054
+ exports.ExternalVideoBlockComponent = ExternalVideoBlockComponent;
2055
+ exports.ExternalVideoSupportedTypes = ExternalVideoSupportedTypes;
2056
+ exports.ExternalVideoTagDataConsts = ExternalVideoTagDataConsts;
2057
+ exports.FileIdSelectComponent = FileIdSelectComponent;
2058
+ exports.FileImageTagDataConsts = FileImageTagDataConsts;
2059
+ exports.HtmlRawEditorComponent = HtmlRawEditorComponent;
2060
+ exports.ImageEditorComponent = ImageEditorComponent;
2061
+ exports.ImageMethods = ImageMethods;
2062
+ exports.MainEditorBlockComponent = MainEditorBlockComponent;
2063
+ exports.MainEditorComponent = MainEditorComponent;
2064
+ exports.RichTextToHtmlPipe = RichTextToHtmlPipe;
2065
+ exports.TableBuilder = TableBuilder;
2066
+ exports.TableMethods = TableMethods;
2067
+ exports.TableTypes = TableTypes;
2068
+ exports.TagToSpanPipe = TagToSpanPipe;
2069
+ exports.TextEditorComponent = TextEditorComponent;
2070
+ exports.TextMethods = TextMethods;
2071
+ exports.TextSimpleMethods = TextSimpleMethods;
2072
+ exports.TextTag = TextTag;
2073
+ exports.ToHtmlBodyTagsPipe = ToHtmlBodyTagsPipe;
2074
+ exports.ToPreviewPipe = ToPreviewPipe;
2075
+ exports.UploadFilesBtnComponent = UploadFilesBtnComponent;
2076
+ exports.VideoMethods = VideoMethods;
2077
+ exports.VisualEditorComponent = VisualEditorComponent;
2078
+ exports.XmlExtensions = XmlExtensions;
2079
+ exports.XmlTagExternalVideoComponent = XmlTagExternalVideoComponent;
2080
+ exports.XmlTagHeaderInnerTextViewComponent = XmlTagHeaderInnerTextViewComponent;
2081
+ exports.XmlTagHeaderTextViewComponent = XmlTagHeaderTextViewComponent;
2082
+ exports.XmlTagHtmlViewComponent = XmlTagHtmlViewComponent;
2083
+ exports.XmlTagRichTextViewComponent = XmlTagRichTextViewComponent;
2084
+ exports.XmlTagTableViewComponent = XmlTagTableViewComponent;
2085
+ exports.XmlTagTextViewComponent = XmlTagTextViewComponent;
2086
+ exports.XmlTagViewComponent = XmlTagViewComponent;
2087
+
2088
+ Object.defineProperty(exports, '__esModule', { value: true });
2089
+
2090
+ }));
2091
+ //# sourceMappingURL=croco-html.umd.js.map